text stringlengths 8 6.88M |
|---|
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
... |
#include <string>
#include <cmath>
#include <fstream>
#include <iostream>
#include <sstream>
#include <list>
#include <algorithm>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <numeric>
#include <bitset>
#include <deque>
//#include <random>
#include <string.h>
#include <stdlib.h>
#include <ve... |
#ifndef NAVIGATIONWIDGET_H
#define NAVIGATIONWIDGET_H
#include <QtCore>
#include <QtGui>
#include <QtWidgets>
namespace Ui {
class navigationWidget;
}
class navigationWidget : public QWidget
{
Q_OBJECT
public:
explicit navigationWidget(QWidget *parent = 0);
~navigationWidget();
voi... |
#include<bits/stdc++.h>
#define inf 100000000
using namespace std;
struct node{
int to,cap,rev;
};
vector<node> e[1000];
bool used[1000];
int s=0,t=999,m,n,tot=0,ans;
inline void ins(int u,int v,int c){
e[u].push_back((node){v,c,e[v].size()});
e[v].push_back((node){u,0,e[u].size()-1});
}
void readit(){
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
/** @file romtablemanager.h
*
* This module provides access to... |
#include "SieveParRangeFinal.h"
std::string SieveParRangeFinal::name()
{
return "Sieve Algorith, parallel finding of primes in given range final";
}
int* SieveParRangeFinal::find(int min, int max, int* size)
{
int dividersSize = sqrt(max) + 1;
int arraySize = max - min;
// Initialize array
bool* arr... |
//
// Created by Данил Козловский on 2019-03-28.
//
#ifndef INC_2_VEC2I_H
#define INC_2_VEC2I_H
class Vec2I {
public:
int x, y;
Vec2I();
Vec2I(int x, int y);
int getX();
int getY();
void setX(int xG);
void setY(int yG);
void setTo(Vec2I vec);
void setTo(int xG, int yG);
... |
#include<cstdio>
#include<cstring>
#define maxn 510
#define inf 1000000000
using namespace std;
int lk[maxn];
int lx[maxn],ly[maxn];
bool sx[maxn],sy[maxn];
int w[maxn][maxn];
bool link[maxn][maxn];
int slack[maxn];
int n,m,nx,ny,e;
int cs;
void input()
{
int s,r,v;
memset(w,0,sizeof(w));
memset(link,0,sizeof... |
//O(n^2).
class Solution {
public:
int maxSubArray(vector<int>& nums) {
int n = nums.size();
int maxsum = 0;
for(int i=0;i<n;i++){
int sum = 0;
for(int j=i;j<n;j++){
sum = sum + nums[j];
if(sum > maxsum){
maxsum = su... |
/*
* ****************************************************************************
* * *
* * Copyright 2008, xWorkshop Inc. *
* * All rights reserved. *
*... |
//
// GnITabCtrl.h
// Core
//
// Created by Max Yoon on 11. 7. 22..
// Copyright 2011년 __MyCompanyName__. All rights reserved.
//
#ifndef __Core__GnITabCtrl__
#define __Core__GnITabCtrl__
#include "GnITabPage.h"
class GnIButton;
class GnITabCtrl : public GnInterfaceGroup
{
protected:
GnInterfaceG... |
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special ... |
/*
//TODO: Comment
*/
#include "SetupGUI.h"
#include <CommCtrl.h>
#include <Strsafe.h>
#include <string>
#define MONITOR_BORDER_WIDTH 4
#define FILENAME_ARROW L"\\Arrow.bmp"
#define FILENAME_LED L"\\LED.bmp"
#define BMP_LED_DISPLAY_WIDTH 20
#define BMP_LED_DISPLAY_HEIGHT 20
#define BMP_ARROW_DISP... |
#pragma once
#include "IEngineTrace.h"
class IMaterial;
class KeyValues;
struct vcollide_t;
struct model_t;
struct cplane_t;
struct studiohdr_t;
struct virtualmodel_t;
typedef unsigned char byte;
struct virtualterrainparams_t;
class CPhysCollide;
typedef unsigned short MDLHandle_t;
class CUtlBuffer;
class IModelLoadC... |
#ifndef rqt_system_control_h
#define rqt_system_control_h
#include <rqt_gui_cpp/plugin.h>
#include <ui_rqt_system_control.h>
#include <QWidget>
namespace rqt_system_control {
class SystemControlPlugin
: public rqt_gui_cpp::Plugin
{
Q_OBJECT
public:
SystemControlPlugin();
virtual void initPlugin(qt_gui_cpp::P... |
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
using namespace std;
int main(void)
{
int Temp1, Temp2;
int Result[4] = { 0 };
int TempRes = 0;
for (int i = 0; i < 4; i++)
{
scanf("%d%d",&Temp1, &Temp2);
TempRes += (Temp2 - Temp1);
Result[i] = TempRes;
}
sort(Result, Result+4... |
// addrspace.cc
// Routines to manage address spaces (executing user programs).
//
// In order to run a user program, you must:
//
// 1. link with the -N -T 0 option
// 2. run coff2noff to convert the object file to Nachos format
// (Nachos object code format is essentially just a simpler
// version of the UNIX exe... |
// Created on: 2003-06-04
// Created by: Galina KULIKOVA
// Copyright (c) 2003-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 ... |
#include "Explosion.h"
int Explosion::animation = -1;
std::vector < std::shared_ptr <Explosion> > Explosion::explosion;
sf::SoundBuffer Explosion::soundBuffer;
Explosion::Explosion(float x, float y, float scale, float timeScale, int timeDelay)
{
texture.loadFromFile("Images/explosion/explosion1.png");
sprite.setTex... |
#include <iostream>
#include <vector>
#include <string>
#include <map>
using namespace std;
class ValueHistogram
{
public:
int getMax(map<int, int> list)
{
int max = 0;
for (int i=0; i<10; ++i) {
if(max < list[i]){
max = list[i];
}
}
return max;
}
vector <string> build(vector <int> values)
{
... |
/**
* @copyright 2013 Christoph Woester
* @author Christoph Woester
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... |
#ifndef SRC_SIZE_H
#define SRC_SIZE_H
/**
* Return the number of children/first-level descendants for this TrieNode.
*/
template<class T> int TrieNode<T>::getNumChildren()
{
return children.size();
}
/**
* Return true if this TrieNode has children and false otherwise.
*/
template<class T> bool TrieNode<T>::ha... |
#pragma once
#include "merger_base.hpp"
#include "proto/data_tower.pb.h"
#include "utils/service_thread.hpp"
#include <memory>
using namespace std;
namespace pd = proto::data;
namespace nora {
class tower_merger : public merger_base {
public:
static tower_merger& instance() {
... |
/**
* Copyright (c) 2007-2012, Timothy Stack
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of ... |
#pragma once
#include <stdio.h>
#ifdef __linux__
// OpenGL includes for Raspberry Pi
#include <GL/glu.h>
#include "GLES2/gl2.h"
#include "EGL/egl.h"
#include "EGL/eglext.h"
#else
// OpenGL includes for Windows
#include <gl\glew.h>
#include <SDL_opengl.h>
#endif
#include "globals.h"
#include "stb_image.h"
/**
* Cub... |
class Solution {
public:
int longestPalindrome(string s) {
unordered_map<char, int> check;
for(char c : s)
++check[c];
int res = 0;
for(auto it : check)
{
if(!(it.second % 2))
res += it.second;
else if(it.second >= 2) //odd... |
#pragma once
#include "Curve.h"
namespace ae
{
/// \ingroup math
/// <summary>Linear 3D parametric curve.</summary>
class AERO_CORE_EXPORT CurveLinear : public Curve
{
public:
/// <summary>
/// Build a curve with the given control points.<para/>
/// The tangents are autom... |
// Created on: 1992-08-06
// Created by: Laurent BUCHARD
// Copyright (c) 1992-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GN... |
#ifndef __SERIALRDM_H__
#define __SERIALRDM_H__
#include <ros/ros.h>
#include <geometry_msgs/PoseStamped.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>... |
// Created on: 2013-01-17
// Created by: Kirill GAVRILOV
// Copyright (c) 2013-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 ... |
#include "CentralWindow.h"
#include <QMessageBox>
#include <QMouseEvent>
CentralWindow::CentralWindow(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
connect(&timer, SIGNAL(timeout()), this, SLOT(draw()));
timer.start(timerInterval);
bubbleManager = new BubbleManager(ui.centralWidget);
calculation... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#include "core/pch.h"
#if defined(_NA... |
#pragma once
#include <vector>
#include<string>
#include "TrackPoint.h"
#include "SqlTool.h"
using std::vector;
using std::string;
class Track
{
private:
int TRACKID;
int POINTAMOUNT;
string TARGETID;
/*char* TARGETMODELNUMBER;
char* TARGETNAME;
char* TARGETTYPE;*/
int STARTTIME;
int ENDTIME;
double CONFID... |
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#pragma warning (disable: 4104)
#define DLL_EXP extern "C" HRESULT __declspec(dllexport) __stdcall
// define them first with the correct linkage since they are defined incorrectly in the following includes
DLL_EXP DllCanUnloadNow();
DLL_EXP DllGetClassObject(REFCLSID ... |
#include <iostream>
#include <time.h>
#include <algorithm>
#include <random>
#include <vector>
using namespace std;
using ll = long long;
template <typename T>
T gcd(T a, T b) {
if (a < b) return gcd(b, a);
return b == 0 ? a : gcd(b, a % b);
}
mt19937 mert(ll(time(0)));
int q = 0;
int query(int t, int x) {... |
#pragma once
#include"Saving.h"
class Term:public Saving
{
private:
int Kyhan;
public:
friend istream& operator>>(istream&, Term&);
friend ostream& operator<<(ostream&, Term);
double TinhTienLai();
Term();
~Term();
};
|
// Copyright 2018 Benjamin Bader
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
//
// This file contains the C++ code from Program 9.10 of
// "Data Structures and Algorithms
// with Object-Oriented Design Patterns in C++"
// by Bruno R. Preiss.
//
// Copyright (c) 1998 by Bruno R. Preiss, P.Eng. All rights reserved.
//
// http://www.pads.uwaterloo.ca/Bruno.Preiss/books/opus4/programs... |
// Created on: 1992-05-06
// Created by: Jacques GOUSSARD
// Copyright (c) 1992-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the G... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2010 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#include "core/pch.h"
#ifdef SQLITE_SUPPORT
#include "modules/... |
//: C05:Stash.h
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
// Zmieniony w celu wykorzystania kontroli dostepu
#ifndef STASH_H
#define STASH_H
class Stash {
int size; // Wielkosc ka... |
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2012 Bryce Adelstein-Lelbach
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.tx... |
/*
* Copyright 2016 Freeman Zhang <zhanggyb@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2010 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Luca Venturi
**
** This file contains several macros and some c... |
#pragma once
#include <map>
#include <string>
#include <vector>
using namespace std;
class CAMB_CALLER {
public:
CAMB_CALLER();
~CAMB_CALLER();
void call(map<string, double> params);
void call_full(map<string, double> params);
vector<vector<double>> get_Pz_values();
... |
//算法:堆
/*
维护一个最多能存下m个数的大根堆。
每读入一个数xi,
就将xi放入堆中。
如果堆中数的数量大于m,
就删掉大根堆的根。
就能维护当前最小的m个数了。
最后,将堆里的所有数排序,依次输出即可。
*/
#include<cstdio>
#include<queue>
#include<functional>
using namespace std;
int n,m;
priority_queue <int> s;
priority_queue <int,vector<int>,greater<int> > s1;
int main()
{
scanf("%d%d"... |
/*#include <iostream>
#include "cards.h"
using namespace std;
int main() {
// Create and print a demo card with arbitrery values.
Card demoCard(500, 4);
demoCard.printCard();
// Create and print a demo deck.
Deck demoDeck;
demoDeck.printDeck();
// Draw a card from the deck and print it.
Card demoCard2 = dem... |
/********************************************************************************
** Form generated from reading UI file 'window.ui'
**
** Created by: Qt User Interface Compiler version 5.8.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************... |
//
// Created by bodand on 2019-12-22.
//
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wused-but-marked-unused"
#pragma once
#pragma clang diagnostic push
#pragma ide diagnostic ignored "MemberFunctionCanBeStaticInspection"
#pragma ide diagnostic ignored "cert-err58-cpp"
#include <boost/test/incl... |
//
// PlistHandler.cpp
// Aircraft
//
// Created by lc on 11/27/14.
//
//
#include "PlistHandler.h"
PlistHandler* PlistHandler::m_instance = NULL;
PlistHandler::Delete PlistHandler::m_delete;
PlistHandler::PlistHandler() {
init();
}
PlistHandler::~PlistHandler() {
}
PlistHandler* PlistHandler::getInst... |
#ifndef PIONEERCONNECTION_H
#define PIONEERCONNECTION_H
#include "data_types/pioneer.h"
#include "data_types/computer.h"
#include <QCoreApplication>
#include <QtSql>
#include <QDebug>
#include <QFileInfo>
#include <string>
#include <sstream>
#include <fstream>
#include <iostream>
#include <vector>
class PioneerConnect... |
#include "Globals.h"
#include "Application.h"
#include "ModuleTextures.h"
#include "ModuleFadeToBlack.h"
#include "ModuleSceneIntro.h"
#include "ModuleRender.h"
#include "ModulePlayer.h"
#include "ModuleInput.h"
#include "ModuleAudio.h"
#include "SDL\include\SDL_render.h"
#include "SDL/include/SDL_timer.h"
#include "Mo... |
#include <iostream>
#include <string>
using namespace std;
void order_numbers(){
float numbers[10];
for (int i = 0; i < 10; i++){
cout<<"Ingresa un numero: ";
cin>>numbers[i];
}
float temporal;
for (int i = 0;i < 10; i++){
for (int j = 0; j< 10-1; j++){
if (numbers[j] < numbers[j... |
//
// sudokuMain.cpp
//
//
// Created by Juha Kreula on 23/01/2020.
//
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cctype>
#include "sudokuGrid.hpp"
#include "sudokuSolver.hpp"
using std::cout, std::cin, std::endl;
// Overloaded output operator for Grid
std::ostream & operator<<(std::... |
#ifndef RECGANDDRAW_H
#define RECGANDDRAW_H
#include "opencv2/imgcodecs/imgcodecs.hpp"
#include "opencv2/opencv.hpp"
#include "opencv2/core/core.hpp"
extern float ex;
extern float ey;
extern float er;
class recganddraw
{
public:
recganddraw();
void showl();
protected:
};
#endif // ... |
// GameLibrary.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include "GameLib.h"
int ola=0;
void Teste() {
if (ola == 0) {
_tprintf(TEXT("TESTE -- 1"));
ola++;
}
else if (ola == 1) {
_tprintf(TEXT("TESTE -- 2"));
ola++;
}
else {
_tprintf(TEXT("TESTE -- 3"));
}
... |
#include "player/Player.h"
#include "FileRecordThread.h"
CLASS_LOG_IMPLEMENT(CFileRecordThread, "CRecordThread[file]");
///////////////////////////////////////////////////////////////////
int CFileRecordThread::PrepareWrite()
{
m_Mp4file->Start();
return CMediaRecorder::PrepareWrite();
}
int CFileRecordThread::Writ... |
#include <iostream>
#include "FactoryMachineState.h"
#include "FactoryMachine.h"
#include "Event.h"
using namespace std;
void FactoryMachineState::Enter()
{
}
void FactoryMachineState::Execute(FactoryMachine* player)
{
if (isFactoryMachine_PowerOn)
{
cout << "장비를 동작 중..." << endl;
}
}
void... |
#include <iostream>
#include <vector>
using namespace std;
int a, b, c, d, e, f, g, h;
int get_value(char x) {
switch (x) {
case 'A':
return a;
case 'B':
return b;
case 'C':
return c;
case 'D':
return d;
case 'E':
... |
int a=7,b=6,c=5,d=11,e=10,f=8,g=9,dp=4;
int n[10][8]={{1,0,0,0,0,1,0,0},{1,0,0,1,1,1,1,1},{1,1,0,0,1,0,0,0},{1,0,0,0,1,0,1,0},{1,0,0,1,0,0,1,1},{1,0,1,0,0,0,1,0},{1,0,1,0,0,0,0,0},{1,0,0,0,1,1,1,1},{1,0,0,0,0,0,0,0},{1,0,0,0,0,0,1,0}};
int alg[10][8]={{0,0,0,0,0,1,0,0},{0,0,0,1,1,1,1,1},{0,1,0,0,1,0,0,0},{0,0,0,0,1,0,1... |
//
// Created by payaln on 27.02.2019.
//
#include "DataSaver.h"
std::ofstream DataSaver::out;
std::string DataSaver::splitter = " ";
void DataSaver::CreateFile(const std::string& filename) {
out.open(filename);
}
void DataSaver::OpenFile(const std::string& filename) {
out.open(filename, std::ios::app);
}
... |
#include<bits/stdc++.h>
#define ll long long int
#define v vector
using namespace std;
struct AVLNode
{
ll data;
AVLNode* lc;
AVLNode* rc;
ll height,num;
};
AVLNode* AVLCreate(ll k)
{
AVLNode* temp = new AVLNode;
temp->lc = NULL;
temp->rc = NULL;
temp->height = 0;
temp->num = 1;
temp->data = k;
return temp;
... |
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main() {
int N;
stringstream ss;
cin >> N;
for(int i=N; i>0; i--) {
ss << i << '\n';
}
cout << ss.str();
return 0;
}
|
#include <iostream>
using namespace std;
int getHalf(int num) {
if(num == 1) {
return 1;
}
if(num % 2) {
return num / 2 + 1;
} else {
return num / 2;
}
}
int main() {
int day = 0;
int num = 0;
int overflow = 0;
int sum = 0;
int temp = 0;
// input
cin>>day>>num;
// if one day
... |
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <map>
#include <list>
#include <tuple>
#include <algorithm>
using std::string;
using std::vector;
struct Query {
string type, name;
int number;
};
std::ostream& operator << (std::ostream& out, Query q)
{
out << q.type << ... |
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "GameFramework/GameMode.h"
#include "CombatGrid.h"
#include "ParentCombatCharacter.h"
#include "Project_152GameMode.generated.h"
// The GameMode defines the game being played. It governs the game rules, scoring, what actors
// are all... |
/*
** EPITECH PROJECT, 2021
** B-CPP-300-STG-3-1-CPPrush3-maxime.owaller
** File description:
** Shape
*/
#include "RectShape.hpp"
#include "WindowManager.hpp"
#include "Itop.hpp"
#define TITLE_SECTION(n) {_rectangleShape.getPosition().x + 20, _rectangleShape.getPosition().y - n }
RectShape::RectShape(sf::Vector2f p... |
#include "perf_precomp.hpp"
using namespace std;
using namespace cv;
using namespace perf;
using namespace testing;
using std::tr1::make_tuple;
using std::tr1::get;
typedef std::tr1::tuple<Size, int, int> Size_Ksize_BorderType_t;
typedef perf::TestBaseWithParam<Size_Ksize_BorderType_t> Size_Ksize_BorderType;
PERF_TE... |
#ifndef DEBUG_H_
#define DEBUG_H_
#include <fstream>
#include <ctime>
class Debug {
private:
std::ofstream* file;
public:
Debug();
~Debug();
void write(std::string toWrite);
};
#endif
|
/*
* Copyright [2017] <Bonn-Rhein-Sieg University>
*
* Author: Torsten Jandt
*
*/
#include <mir_planner_executor/actions/move/mockup_move_action.h>
#include <mir_planner_executor/actions/mockup_helper.h>
bool MockupMoveAction::run(std::string& robot, std::string& from, std::string& to) {
return mo... |
#pragma once
#include "framework/system/core/types.h"
#include "ElementDoubleLink.h"
#include "IteratorDoubleLink.h"
namespace framework {
//--------------------------------------------------------------------------------
// ListDoubleLink Class
// Manages the elements linked by double link method
//----------------... |
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define rep(i, begin, end) \
for (__typeof(end) i = (begin) - ((begin) > (end)); \
i != (end) - ((begin) > (end)); i += 1 - 2 * ((beg... |
#include "Engines/AbcRejectionEngine.hpp"
#include "Engines/AbcSmcEngineSynthetic.hpp"
#include "Engines/AbcSmcEngineExperimental.hpp"
#include "Engines/SimulationEngineForSyntheticData.hpp"
#include "ParameterSets/SyntheticParameterSet.hpp"
#include "Other/PeriodicBoundaryConditionsConfiguration.hpp"
#include "Paralle... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2009 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
/**
* @file OpSSLSocket.cpp
*
* SSL-capable socket creation functio... |
#include "_pch.h"
#include "ReportListModel.h"
#include "globaldata.h"
using namespace wh;
//-----------------------------------------------------------------------------
ReportListModel::ReportListModel()
//:IModelWindow()
{
}
//-----------------------------------------------------------------------------
void Re... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 100 //Maximum degree possible
#define max(a,b) (a>b?a:b)
typedef struct{
int row;
int column;
int value;
}SM;
void input(SM *a)
{
cout<<"Enter number of rows and columns: ";
int m,n,k=1,item;
int i,j;
cin>>m>>n;
... |
// GML2CityGML.cpp : Defines the entry point for the console
application.
//
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <windows.h>
#include <map>
#include <vector>
struct S_Point
{
char x[15];
char y[15];
};
struct S_Surface
{
int nrPoints;
S_P... |
#include <iostream>
using namespace std;
int main()
{
// int - устанавливает целые числа (и только)
int a, b;
cin >> a >> b;
// деление нацело т.к. числа => int
// cout << a / b;
// округление в большую сторону
cout << (a + b - 1) / b;
return 0;
}
|
#include <iostream>
#define vx vertex*
#include <random>
using namespace std;
#define SEED 12345
mt19937 getRand(SEED);
struct vertex {
int key;
vx parent;
vx left;
vx right;
};
vx make_v(int value, vx parent) {
auto *v = new vertex;
v->key = value;
v->parent = parent;
v->left = v->r... |
#include "mOpenCL.h"
mOpenCL::mOpenCL(cl_device_type devtype)
{
//register cl_int i, j;
this->devtype = devtype;
SELECT_PLATFORMS_AND_DEVICES(pidx, didx, devtype);
context1 = createContextFromIndex(pidx, didx, devtype);
ContextDevice(context1);
try {
cl::CommandQueue queue = cl::CommandQueue(context1, co... |
// Copyright Oliver Kowalke 2013.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// idea of node-base locking from 'C++ Concurrency in Action', Anthony Williams
#ifndef BOOST_FIBERS_qU... |
// Adapted cloning algorithm from RLJ.
#ifndef CLONINGSERIAL_HPP
#define CLONINGSERIAL_HPP
#include <random>
#include <vector>
#include <chrono>
#include <experimental/filesystem>
// note this is called CloningSerial even if it also supports openMP
// all loops over clones should be parallelised via openMP if suppor... |
//
// Created by Christofer on 20/08/2017.
//
#include "SpriteRenderer.h"
const char *shaderSources[] = {
""
"#version 330\n"
"\n"
"layout(location = 0) in vec3 position;\n"
"layout(location = 1) in vec2 texCoords;\n"
"\n"
... |
#include "Stage.h"
#include <DxLib.h>
Stage::Stage()
{
int fmf_h = DxLib::FileRead_open("Stage/Stage2.fmf", false);
DxLib::FileRead_read(&_fmfdata, sizeof(_fmfdata), fmf_h);
std::vector<char> _tmp;
_tmp.resize(_fmfdata.mapWidth * _fmfdata.mapHeight);
DxLib::FileRead_read(&_tmp[0], _tmp.size(), fmf_h);
DxLib:... |
/*********************************************************\
* Copyright (c) 2012-2018 The Unrimp Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software without
* restriction, including wit... |
#include <iostream>
#include <string>
#include "UndirectedGraph.hpp"
class Point
{
public:
Point() {}
Point(int x_in, int y_in) {x = x_in; y = y_in;}
bool operator==(const Point& other) {
return (x == other.x && y == other.y);
}
int x;
int y;
};
inline int index_of(int x, int y, int width) {
return y * wi... |
#pragma once
#include "config/behavior_tree_ptts.hpp"
#include "proto/data_base.pb.h"
#include "proto/data_behavior_tree.pb.h"
#include "scene/log.hpp"
#include "utils/service_thread.hpp"
#include <memory>
#include <queue>
#include <chrono>
using namespace std;
using namespace std::chrono;
namespace pc = proto::confi... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser.
** It may not be distributed under any circumstances.
*/
#ifndef SINGLEBTREE_H
#define SINGLEBTREE_H
#include "modules/se... |
#ifndef CUSTOMGRAPH_H
#define CUSTOMGRAPH_H
/*
Copyright (c) 2008-2018, Benoit AUTHEMAN All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copy... |
#ifndef _STACK_H_
#define _STACK_H_
#include "Maze.h"
static const int STACK_SIZE = 1024;
class Stack
{
public:
Stack()
{
Initialize();
}
//~Stack();
bool Initialize();
bool Push(Node);
Node Pop();
bool IsEmpty();
private:
Node stack[STACK_SIZE];
int front;
bool empty;
};
bool Stack::Initialize()
{
#... |
int state;
void setup() {
Serial.begin(38400);
pinMode(LED_BUILTIN,OUTPUT);
}
void loop() {
if(Serial.available()>0){
state=Serial.read();
Serial.println(state);
if(state==120)
digitalWrite(LED_BUILTIN,HIGH);
else if(state==0)
digitalWrite(LED_BUILTIN,LOW);
}
}
|
#include <iostream>
#include <cstring>
using namespace std;
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
int main()
{
FASTIO;
int start, end;
char dash, letter, colon;
string line;
int count = 0;
while... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
//
// Copyright (C) 1995-2003 Opera Software AS. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
//
#ifndef WINDOWSCOMPLEXSCRIPT_H
#define WINDOWSCOMPLEXSCRIPT_H
... |
#ifndef MANGASTREAM_H
#define MANGASTREAM_H
#include "isdebug.h"
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QStringList>
#include <QUrl>
#include <QEventLoop>
#include <QByteArray>
#include <QIODevice>
#include <QRegularExpression>
... |
/*
===========================================================================
Copyright (C) 2017 waYne (CAM)
===========================================================================
*/
#pragma once
#ifndef ELYSIUM_GRAPHICS_COMMANDPOOL
#define ELYSIUM_GRAPHICS_COMMANDPOOL
#endif
#ifndef ELYSIUM_CORE... |
#include <ros.h>
#include <std_msgs/UInt16.h>
#include <Servo.h>
#define SERVO_PIN 9
ros::NodeHandle nh;
Servo servo;
void servo_callback( const std_msgs::UInt16& cmd_msg){
servo.write(cmd_msg.data); // set servo angle
digitalWrite(13, HIGH-digitalRead(13)); // toggle the led
}
ros::Subscriber<std_msgs::UIn... |
#include <vector>
#include <string>
#include <gtest/gtest.h>
#include "StringUtils.h"
#include <TranscriberUI/PhoneticDictionaryViewModel.h>
namespace PticaGovorunTests
{
using namespace PticaGovorun;
struct StringEditDistanceTest : public testing::Test
{
};
template <typename Letter>
class WordErrorCosts {
p... |
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <map>
#include <iomanip>
#include <set>
#include <climits>
#include <ctime>
#include <complex>
#include <cmath>
#include <string>
#in... |
#include "bsdf.h"
#include <warpfunctions.h>
BSDF::BSDF(const Intersection& isect, float eta /*= 1*/)
//TODO: Properly set worldToTangent and tangentToWorld
: worldToTangent(glm::transpose(Matrix3x3(isect.tangent,isect.bitangent,isect.normalGeometric))),
tangentToWorld(Matrix3x3(isect.tangent,isect.bitangent... |
#include <LPD8806.h>
#include <SPI.h>
#include <Adafruit_NeoPixel.h>
#include "Animation.h"
#include "MovingAnimation.h"
#include "SpinningAnimation.h"
#include "PulseAnimation.h"
#include "BouncingAnimation.h"
#include "FireBearsAnimation.h"
#include "BlinkAnimation.h"
#include "CatchFire.h"
#include "OneColor.h"
#inc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.