text stringlengths 8 6.88M |
|---|
#include <TESTS/test_assertions.h>
#include <TESTS/testcase.h>
#include <CORE/TYPES/concurrent_queue.h>
#include <thread>
#include <vector>
using core::types::ConcurrentQueue;
struct TestState {
TestState(ConcurrentQueue< int > &queue, int count)
: m_queue(queue), m_count(count) {}
ConcurrentQueue< int >... |
#include<iostream>
using namespace std;
const int MAX_M=10;
const int MAX_N=100;
int m,n;
bool reserved;
bool light[MAX_M][MAX_N];
bool _light[MAX_M][MAX_N];
bool tmpArray[MAX_M][MAX_N];
bool dfsArray[MAX_M];
int process(int i,int j)
{
light[i][j]=!light[i][j];
if(i-1>=0)
{
light[i-1][j]=!light[i-1][j];
}
if... |
#ifndef PARAMS_HPP_
#define PARAMS_HPP_
class Params
{
public:
static int iterations_number;
// temperature value
static double T;
// epoch length (number of internal iterations)
static int L;
// temperature change factor
static double r;
static void calculate_new_temperature();
};
... |
#include "Graph.h"
#include "UnderectedGraph.h"
int main() {
int menu = -1;
int type = -1;
while (type == -1) {
system("cls");
cout << "\n\tChoose Type of your Graph:";
cout << "\n\n\t1. Directed";
cout << "\n\t2. Undirected";
cout << "\n\n\t";
cin >> type;
if (type > 2 || type < 1) {
... |
#include <bits/stdc++.h>
using namespace std;
const int MAX_INT = std::numeric_limits<int>::max();
const int MIN_INT = std::numeric_limits<int>::min();
const int INF = 1000000000;
const int NEG_INF = -1000000000;
#define max(a,b)(a>b?a:b)
#define min(a,b)(a<b?a:b)
#define MEM(arr,val)memset(arr,val, sizeof arr)
#defi... |
//program to calculate prime number between given number
#include <iostream>
using namespace std;
int main()
{
int n, m,count=0;
cout<<"please enter the interval to print prime No.";
cin>>n>>m;
if(n<3) {
cout<<"2 3 ";
n=5;
}
if(n==3){
cout<<"3 ";
n=5;
}
for(int i=n;i<=m;i++) {
... |
#include "stdafx.h"
#include "SamplerState.h"
using namespace GraphicsEngine;
SamplerState::SamplerState(ID3D11Device* d3dDevice, const D3D11_SAMPLER_DESC& samplerDesc)
{
Initialize(d3dDevice, samplerDesc);
}
void SamplerState::Initialize(ID3D11Device* d3dDevice, const D3D11_SAMPLER_DESC& samplerDesc)
{
// Create s... |
#include <bits/stdc++.h>
using namespace std;
int main() {
string time;
cin >> time;
int hour = (time[0]-'0')*10 + (time[1]-'0');
// int min = (time[3] - '0')*10 + (time[4] - '0');
// int sec = (time[6]-'0')*10 + (time[7]-'0');
if(time[8]=='P' && hour!=12){
hour += 12;
}
if(h... |
//
// Created by Lachezar on 1.5.2020 г..
//
#ifndef PROJECT_VECRORS_TRIANGLE_H
#define PROJECT_VECRORS_TRIANGLE_H
#include <ostream>
#include "Point.h"
#include <cmath>
#include <string>
class Triangle : public Point{
public:
Triangle( );
Triangle( const Point &,const Point&,const Point&);
Triangle( d... |
#include "Player.h"
#include <iostream>
Player::Player(bool pIsWhite)
{
this->isWhite = pIsWhite;
this->isItsTurn = pIsWhite;
while (name.empty())
{
std::cout << "Please choose a nickname (max 10 characters): ";
std::string temp;
try
{
std::cin >> temp;
if (temp.length() > 10)
{
... |
#ifndef OBJECT_H
#define OBJECT_H
#include <QOpenGLShaderProgram>
#include <vector>
#include "objectmodel.h"
class Object
{
public:
Object();
Object(const std::vector<GLfloat>& vert ,const std::vector<GLfloat>& norms ):vertex(vert) , normal(norms){};
void setObject(const std::vector<GLfloat>& ... |
/*
==============================================================================
Seaboard.cpp
Created: 1 Jul 2014 10:46:40am
Author: Christopher Fonseka
==============================================================================
*/
#include "Seaboard.h"
#pragma mark Inits, Constructors and Dest... |
#include "storageitem.h"
#include <QDir>
#include <QFile>
#include <QFileInfo>
StorageItem::StorageItem(ObjHandle handle, QString path, quint32 storageId) :
m_handle(handle), m_path(path), m_file(0), m_parent(0),
m_firstChild(0), m_nextSibling(0)
{
QString name = m_path;
m_objectInfo.mtpFileName = name.remove(0, ... |
#include<stdio.h>
#include<stdlib.h>
int binarySearch(int[], int, int,bool);
int main(){
int arr[]={1,1,2,2,3,5,5,5,5,5,6,7,7,8};
int firstSearch = binarySearch(arr,sizeof(arr)/sizeof(arr[0]),5,true);
printf("%d",firstSearch);
if(firstSearch==-1)
printf(" %d ",0);
else{
int lastSearch=binarySearch(... |
// 14. Longest Common Prefix
// Write a function to find the longest common prefix string amongst an array of strings.
// If there is no common prefix, return an empty string "".
// Example 1:
// Input: ["flower","flow","flight"]
// Output: "fl"
// Example 2:
// Input: ["dog","racecar","car"]
// Output: ""
// Expl... |
#include <iostream>
#include <vector>
#include <windows.h>
#include <cstdlib>
#include <ctime>
#include <utility>
#include <fstream>
#include <cstdlib>
#include "Temp.h"
#include "Player.h"
#include "Board.h"
#include "Piece.h"
#include "Square.h"
#include "Constants.h"
//using namespace std;
//void Piece::move()
//{... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int const N = 3e5 + 100;
vector < int > g[N] ;
int ara[N] ;
int calc(int x){
int diff = 0;
for(int i = 1; i < g[x].size(); i++) {
diff = max(diff, g[x][i] - g[x][i-1]);
}
return diff;
}
void solve(){
int n;
cin >> n... |
//#include <cstdio>
//#include <cstring>
//#include <algorithm>
//#include <ctime>
#include <bits/stdc++.h>
#define mod 1000007
using namespace std;
int f[101]={1},b[101]={1};
int main()
{
//freopen("..\\file\\input.txt","r",stdin);
//freopen("..\\file\\output.txt","w",stdout);
/*clock_t start_c,end_c;
... |
#define STRICT
#define ORBITER_MODULE
#include <orbitersdk.h>
#include <oicominit.h>
OICOM_PID pid=0; // plug-in ID for this plugin.
bool *active=0;
double *setpoint=0;
DLLCLBK void opcPreStep(double simt, double simdt, double mjd)
{
OrbiterPluginMessage * opm; // holds our msg and msg data
char * msg;
int len;
... |
#include "CSocket.h"
bool CSocket::CreateSocket(SOCKET& _socket)
{
_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
return _socket != INVALID_SOCKET;
}
bool CSocket::CreateAsynSocket(SOCKET& _socket)
{
_socket = WSASocketW(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, WSA_FLAG_OVERLAPPED);
return _socket != I... |
#include "lane_class.h"
#include "../hvapi/hvLanedet.h"
lane_detect_c::lane_detect_c(HV_INIT_USERDATA * pUserData)
{
mat_input_en_ = 1;
//camera_yaw = -5.194, camera_pitch = -0, camera_roll = -1; //201
//camera_yaw_ = -3.28, camera_pitch_ = 0.31, camera_roll_ = 1.64; //veran
//camera_yaw = 4.763175, came... |
//-----------------------------------------------
//
// This file is part of the Siv3D Engine.
//
// Copyright (c) 2008-2018 Ryo Suzuki
// Copyright (c) 2016-2018 OpenSiv3D Project
//
// Licensed under the MIT License.
//
//-----------------------------------------------
# include <Siv3D/Platform.hpp>
# if defined(SI... |
/*
* RequestManager.h
*
* Created on: Mar 21, 2016
* Author: uwe
*/
#ifndef SRC_REQUESTMANAGER_H_
#define SRC_REQUESTMANAGER_H_
#include <set>
#include <map>
#include "ThreadSafeQueue.h"
#include <memory>
namespace as {
template<typename InputType, typename CommonType>
class Request;
template<typename I... |
#ifndef IMPCMD_H
#define IMPCMD_H
/// @file ImpCmd.h
/// @brief ImpCmd のヘッダファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2011 Yusuke Matsunaga
/// All rights reserved.
#include "YmNetworks/bdn.h"
#include "YmTclpp/TclCmd.h"
#include "ImpMgr.h"
BEGIN_NAMESPACE_YM_NETWORKS
//////////////////... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include"AVLtree.h"
#include<QFile>
#include<QTextStream>
#include<QListWidgetItem>
#include<QListWidget>
#include<QDebug>
#include<QMessageBox>
#include<QFileDialog>
#include<QTextToSpeech>
namespace Ui {
class MainWindow;
}
class MainWindow : public ... |
#include <iostream>
#include <regex>
#include "../ex3_2/pvector.h"
#include "../ex3_2/pset.h"
using namespace std;
void start_check(string &d, string &f) {
pset<string> dict(d);
pvector<string> file(f);
for (string line : file) {
regex match_words("\\w+");
auto start = sregex_iterator(l... |
#include "Script.h"
#include "StringUtils.h"
#include "Testing.h"
static void CScriptArray_InsertFirst( CScriptArray* arr, void* value )
{
arr->InsertAt( 0, value );
}
static void CScriptArray_RemoveFirst( CScriptArray* arr )
{
arr->RemoveAt( 0 );
}
static void CScriptArray_Grow( CScriptArray* ... |
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <string.h>
#include <algorithm>
using namespace std;
template<typename T>
#define MAXM 100000000
void random_permutation(T a[], int n)
{
int i;
for(i = 0; i < n; i++)
{
int j = rand() % (n - i) + i;
swap(a... |
// eric farkas - cus 1151
// mwf 10:10-11:05
struct node{
int info;
node* next;
};
typedef node* ptrType;
class linkedList{
private:
ptrType l;
public:
linkedList();
void enter(int);
int count();
int nthElement(int);
void printList();
void printLastElement();
void printRev();
ptrType prior(ptrType);
};
l... |
#ifndef WORLD_H_
#define WORLD_H_
#include <GL/glut.h>
class Graph;
class World
{
public:
World();
void previewGraph(int type, int color,int lineWidth, int curPosX, int curPosY, int motionPosX, int motionPosY);
void saveGraph();
void addGraph(int type);
void show();
private:
Graph* mGraphs[10000000];
Graph... |
#include "pybind11/eigen.h"
#include "pybind11/pybind11.h"
#include "pybind11/stl.h"
#include "drake/bindings/pydrake/documentation_pybind.h"
#include "drake/bindings/pydrake/pydrake_pybind.h"
#include "drake/common/constants.h"
#include "drake/common/drake_assert.h"
#include "drake/common/drake_assertion_error.h"
#in... |
#include<stdio.h>
int main() {
int a ,x ,y ,z ;
scanf("%d",&a);
x=a/100;
y=a%100/10;
z=a%10;
if(a==x*x*x+y*y*y+z*z*z)
printf("1");
else
printf("0");
return 0;
}
|
// github.com/andy489
/*
We search for the toy with lowest price and
place it in front of the array of toys.
We proceed iteratively with the second toy
searching for toy with lowest price, among
all left toys and stop when we exceed the budget
*/
#include <iostream>
#define mxN (int)1e5
using namespace std;
void s... |
//
// Created by wxy on 2018/2/24.
//
#include <unordered_map>
#include <vector>
using namespace std;
namespace p447 {
class Solution {
public:
int numberOfBoomerangs(vector<pair<int, int>> &points) {
int res = 0;
for (int i = 0; i < points.size(); ++i) {
unor... |
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
ull v[21], n, sum=0;
int main()
{
cin >> n;
for(int i=0; i<n; i++) {
cin >> v[i];
}
for(int i=0; i<(1<<n); i++) {
ull aux=0;
for(int j=0 ; j<n; j++) {
if(i&(1<<j)) {
aux|=v[j];
}
}
sum+=... |
#ifndef _RIVE_ANDROID_JNI_REFS_HPP_
#define _RIVE_ANDROID_JNI_REFS_HPP_
#include <jni.h>
namespace rive_android
{
extern jclass fitClass;
extern jmethodID fitNameMethodId;
extern jclass alignmentClass;
extern jmethodID alignmentNameMethodId;
extern jclass radialGradientClass;
extern jmethodID radialGradientIni... |
#include "txn/mvcc_storage.h"
// Init the storage
void MVCCStorage::InitStorage() {
for (int i = 0; i < 1000000;i++) {
Write(i, 0, 0);
Mutex* key_mutex = new Mutex();
mutexs_[i] = key_mutex;
}
}
// Free memory.
MVCCStorage::~MVCCStorage() {
for (unordered_map<Key, deque<Version*>*>... |
//#include<stdio.h>
//#include<stdlib.h>
//#define length 4
//
//typedef struct record {
// int x,y;
// int mark[15][15];
// struct record* next;
//}record;
//
////int Bscore[15][15][4][length];
//void evaluate(const int V[15][15],int mark/*,int *s*/);
//
////void score(int V[15][15], int*s);
//
//
///*对棋盘空位进行打分,选择AI落... |
// Copyright 2019 Sic Studios. All rights reserved.
// Use of this source code is governed by our license that can be
// found in the LICENSE file.
#ifndef GEOMETRY_BOUNDING_BOX_HPP_
#define GEOMETRY_BOUNDING_BOX_HPP_
#include "types.hpp"
namespace cxl {
// Axis-aligned bounding box.
class BoundingBox {
public:
... |
TEST(SymGTOsMatrix, OneIntNewOld) {
// ==== Symmetry ====
SymmetryGroup D2h = SymmetryGroup_D2h();
// ==== Molecule ====
Molecule mole = NewMolecule(D2h);
mole
->Add(NewAtom("H", 1.0)->Add(0,0,0.7))
->Add(NewAtom("Cen", 0.0)->Add(0,0,0))
->SetSymPos();
EXPECT_EQ(3, mole->size());
// ==== S... |
/****************************************************************************
** Meta object code from reading C++ file 'SH_MainToolBar.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.4.1)
**
** WARNING! All changes made in this file will be lost!
******************************************************... |
#ifndef MAIN_MAIN_H_
#define MAIN_MAIN_H_
#define PI 3.14159265
#define CAN_PERIOD 100
#define WS_PERIOD 100
#define BLINK_GPIO GPIO_NUM_5
#include <string.h>
#include <stdlib.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/event_groups.h"
#include "freertos/queue.h"
#include "freertos/task... |
#ifndef LIGACAO_H
#define LIGACAO_H
static const int VELOCIDADE = 500;
// USER INCLUDES BEGIN
#include "date.h"
// USER INCLUDES END
class Ligacao : public Date
{
private:
Date _data;
double _duracao;
public:
Ligacao(double dur, Date d) : _duracao(dur), _data(d) {};
unsigned int get_dia() { return... |
#include "stack.h"
Stack::Stack()
{
stack = nullptr;
stack_size = 0;
}
void Stack::add_to_stack(char new_stack_element)
{
//Here we create a new stack and then we copy all elements from previous stack to new one.
char* previous_stack = stack;
stack = new char[stack_size + 1];
for(unsigned i = 0; i... |
/***************************************************************************
Copyright (c) 2020 Philip Fortier
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or... |
# define ATTRIBUTES_HPP
class Attributes
{
public:
Attributes(short unsigned health = 3);
const short unsigned & get_health() const;
void healted();
void attacked();
void restoreAttackable();
void inmortal();
bool attackable() const;
bool recentlyAttacked();
bool dead() const;
private:
short un... |
#include "node.h"
#include <stdio.h>
#include <cstdlib>
Node * buildTree(uint64_t * counts) {
//WRITE ME!
priority_queue_t pq;
unsigned index = 0;
while(index <= 256){
if(counts[index] != 0){
pq.push(new Node(index, counts[index]));
}
++index;
}
Node *node1;
Node *node2;
while(pq.si... |
#include "P010Cover.h"
P010_Cover::P010_Cover()
{
}
P010_Cover::~P010_Cover()
{
}
|
#include "context.h"
#include "platform.h"
namespace render {
class NullShader;
using NullShaderPtr = std::shared_ptr<NullShader>;
class NullTexture : public Texture, public std::enable_shared_from_this<Texture>
{
public:
inline NullTexture(std::string name)
: m_name(name)
{
}
virtual ~NullTexture()
{
}... |
//
// UG entry point
//
#include <Windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include "TestNKGUI.h"
void init()
{
}
void reshape(GLFWwindow* win, int width, int height)
{
GLfloat h = (GLfloat)height / (GLfloat)width;
GLfloat xmax, znear, zfar;
znear = 5.0f... |
#ifndef RWTNODE_H
#define RWTNODE_H
/// @file RwtNode.h
/// @brief RwtNode のヘッダファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2011 Yusuke Matsunaga
/// All rights reserved.
#include "YmNetworks/bdn.h"
BEGIN_NAMESPACE_YM_NETWORKS
//////////////////////////////////////////////////////////////... |
#include "StdAfx.h"
#include "RAsset.h"
|
/********************************************************************************
** Form generated from reading UI file 'mappoints.ui'
**
** Created by: Qt User Interface Compiler version 5.11.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
****************************************... |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "utils.h"
#include "mydefs.h"
//! \brief This function will run the application as a daemon process.
void Daemonize()
{
int pid, sid;
if ( getppid() == 1 )
return;
pid = ... |
/*
* Copyright (C) 2007-2015 Frank Mertens.
*
* Use of this source is governed by a BSD-style license that can be
* found in the LICENSE file.
*
*/
#include <flux/Process>
#include <flux/File>
#include <flux/NullStream>
#include <flux/Mutex>
#include <flux/Guard>
#include <flux/stdio>
#include "LogMaster.h"
#inc... |
#include "Defines.h"
#include "ChessPiece.h"
#include <SFML/Graphics.hpp>
#include <assert.h>
sf::Vector2i GetSquareIndexUnderMouse(sf::Vector2i inBoardOrigin, sf::RenderWindow& inWindow)
{
sf::Vector2i MousePosition = sf::Mouse::getPosition(inWindow);
sf::Vector2i Index;
Index.x = (int)(((float)MousePosition.x - (... |
#pragma once
#include"Queue.h"
#include"myLL.h"
template<class T>
class myQueue :public Queue<T>
{
public:
bool isEmpty()
{
bool flag=false;
if (Queue<T>::obj.isEmpty())
{
flag= true;
}
return flag;
}
void enqueue(T data)
{
Queue<T>::obj.insertAtEnd(data);
}
T dequeue()
{
... |
#include<bits/stdc++.h>
using namespace std;
int dfs(int** adj,map<int,vector<int>>& adj2,int start,int n,int dest,vector<bool>& visited)
{
if(start==dest)
{
return 0;
}
visited[start]=true;
int count;
int min_count = 100000;
// neighbours
for(int i=0;i<adj2[start].size();i++)
{
count = 0;
int next = ad... |
#include "TradosSAX2Handler.h"
void TradosSAX2Handler::startElement(const XMLCh* const uri,
const XMLCh* const localname,
const XMLCh* const qname,
const Attributes& attrs)
{
if (wcscmp(localname, Tags::TAG_TU) == 0)
{
sTags.push(E_TAG_TU);
tu = new TradosUnit();
XMLSize_... |
#ifndef TAGMANAGER_H
#define TAGMANAGER_H
#include "../Manager.h"
#include "../ImmutableBag.h"
#include <map>
#include <vector>
#include <string>
#include <algorithm>
class TagManager : public Manager
{
public:
TagManager()
{
entitiesByTag = new std::map<std::string, Entity*>();
tagsByEntity = new... |
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<string.h>
#include<set>
#define ll long long
using namespace std;
int T,n,m,l,r,pre[100005],ans[100005];
int main()
{
freopen("tree.in", "r", stdin);
freopen("tree.out", "w", stdout);
scanf("%... |
#pragma once
#include <stdint.h>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <vector>
class ElementBuffer{
private:
const uint8_t num;
GLuint* ids{};
public:
ElementBuffer(const uint8_t num = 1);
ElementBuffer(const std::vector<int> v, const GLenum usage = GL_STATIC_DRAW);
ElementBuff... |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
//
// Observer.cpp
// PracticingObserverPattern
//
// Created by mushfiqur anik on 2019-11-16.
// Copyright © 2019 mushfiqur anik. All rights reserved.
//
#include "Observer.hpp"
Observer::Observer() {
};
Observer::~Observer() {
};
|
// Author Glen Popiel, KW5GP
// uses Morse Library by Erik Linder, Errors fixed and modified by Glen Popiel, KW5GP
// uses PS2Keyboard Library written by Christian Weichel <info@32leaves.net>, Errors fixed and modified by Glen Popiel, KW5GP
/*
This program is free software: you can redistribute it and/or modify
... |
// -*- C++ -*-
//
// Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory,
// Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC
//
// This file is part of FreePOOMA.
//
// FreePOOMA is free software; you can redistribute it and/or modify it
// under the terms of the Expat license.
//
// This progr... |
//
// Created by Alexey A. Ponomarev on 05.03.19.
//
#include "storage.h"
|
#include <iostream>
#include "websocket_session.hpp"
WebSocketSession::WebSocketSession(
tcp::socket socket_,
std::shared_ptr<SharedState> const& state)
: webSocketStream_(std::move(socket_))
, state_(state)
{ }
WebSocketSession::~WebSocketSession()
{
// Remove this session from the list of activ... |
//Copyright 2015-2016 Tomas Mikalauskas. All rights reserved.
#include <stdafx.h>
#include <TywLib\math\GLXMath.h>
#include <TywLib\geometry\JointTransform.h>
#include <TywAnimation\AnimationMacro.h>
#include "MD5Anim.h"
#include <iostream>
//=====================
MD5Anim::MD5Anim() :
//=====================
m_... |
// p253
// 타일덮기!
// 신박
// MOD라는 어어엄청 큰 숫자로 나눈 나머지!
// 그렇다면 원래 수는 몫*MOD + 나머지
#include <iostream>
#include <cstring>
using namespace std;
int cache[101];
const int MOD = 10000000007;
// 2*n 덮기
int tiling(int wid){
// 너비 1이면 세로 하나!
if (wid<=1) return 1;
int& res = cache[wid];
if (res!=-1) return res;
return ... |
#include "DynamicKernel.h"
void DynamicKernel::addCore(DynamicCore& core) {
core.createInitialWitnessSet();
cores.push_back(&core);
}
size_t DynamicKernel::coreSize() {
return cores.size();
}
State::ptr DynamicKernel::initialState() {
State *initialState = new State;
Bag emptyBag; // Empty
for (siz... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "base.h"
WINRT_WARNING_PUSH
#include "internal/Windows.Devices.Geolocation.3.h"
#include "internal/Windows.Foundation.3.h"
#include "internal/Windows.Foundation.Collections.3.h"
#incl... |
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
char m_Ascii = 33;
for (int i = 33; i <= 255; i++)
{
cout << i << ": " << m_Ascii << " ";
m_Ascii = i + 1;
}
cin.ignore();
cin.get();
return 0;
} |
#ifndef TRANSLATOR_DEBUG_H
#define TRANSLATOR_DEBUG_H
#include <cstdlib>
#include <string>
#include <iostream>
namespace StencilTranslator {
/*
struct debug {
int verbosity;
debug(int v) : verbosity(v) { }
template<typename T>
debug &operator<<(T x) {
std::cerr << x;
return *this;
}
};
*/
#... |
//
// DarthVader.cpp
// emptyExample
//
// Created by Leytzher on 2/15/15.
//
//
#include "DarthVader.h"
#include "ofMain.h"
DarthVader::DarthVader(){
darthVaderImage.loadImage("darthVader.png");
}
void DarthVader::setup(){
/* setup Darth Vader at the top of the screen
*/
int rand = ofRandom(0,ofGetWidth(... |
/***********************************************************************
created: 27/6/2006
author: Andrew Zabolotny
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2006 Paul ... |
#include "stdafx.h"
#include "PipelineStateManager.h"
#include "D3DBase.h"
#include "RasterizerStateDescConstants.h"
#include <array>
#include "ShaderBufferTypes.h"
#include "BlendStateDescConstants.h"
#include "DepthStencilStateDescConstants.h"
#include "VertexTypes.h"
using namespace Common;
using namespace Graphi... |
/*
Auteur : Nicolas Cantin
Modifier par: Walan Brousseau
*/
#include <QApplication>
#include "Jeu.h"
#include "Affichage.h"
//Le menu de base vas ici
int main(int argc, char* argv[])
{
QApplication app(argc, argv); //cette boucle fait tourner l'application constament
Affichage affichage;
affichage.setFocus();
... |
#define _CRT_SECURE_NO_WARNINGS
#include <GL/glew.h>
#include <gl/freeglut.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/euler_angles.hpp>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <time.h>
#include <iostream>
#include <thread>
#include <mutex>
#includ... |
// lab_05.cpp
// Write a subfunction that returns the largest value in a two-dimensional array.
// Assume that the calling function will pass a pointer to an existing array and
// counts of how many rows and columns are used in the array. Assume that the
// array was declared to have 6 columns
#include <fstream.h>
... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int m,n,i,j,k,ans;
cin>>n;
int a[n],p;
int cnt=0;
for(i=0; i<n; i++)
{
cin>>a[i];
}
cin>>m;
sort(a,a+n);
while(m--)
{
cin>>k;
ans=upper_bound(a,a+n, k)-a;
cout<<ans<<endl;
}
return... |
#include<iostream>
using namespace std;
int nstairs(int n,int k=3)
{
if(n==0)
{
return 1;
}
if(n<0)
{
return 0;
}
int ans=0;
for(int i=1;i<=k;i++)
{
ans+=nstairs(n-i,k);
}
return ans;
}
int topdown(int n,int *dp,int k=3)
{
if(n==0)
{
dp[n]=1;
return dp[n];
}
if(n<0)
{
return 0;
... |
#include "actor.h"
using namespace App_Juego;
using namespace App_Interfaces;
Actor::Actor()
:caja(0.0, 0.0, 0, 0)
{
}
Actor::Actor(float x, float y, unsigned int w, unsigned int h)
:caja(x, y, w, h)
{
}
void Actor::establecer_caja(float x, float y, unsigned int w, unsigned int h)
{
caja.origen.x=x;
caja.ori... |
/*
* Copyright (C) 2007-2015 Frank Mertens.
*
* Use of this source is governed by a BSD-style license that can be
* found in the LICENSE file.
*
*/
#ifndef FLUXCLAIM_SHHEADERSTYLE_H
#define FLUXCLAIM_SHHEADERSTYLE_H
#include "HeaderStyle.h"
namespace fluxclaim {
using namespace flux;
class ShHeaderStyle: pub... |
//**************************************************************************
//**
//** See jlquake.txt for copyright info.
//**
//** This program is free software; you can redistribute it and/or
//** modify it under the terms of the GNU General Public License
//** as published by the Free Software Foundation; either ... |
#include "easytf/operators/op_concat.h"
#include "easytf/easytf_assert.h"
#include "easytf/easytf_logger.h"
//meta string
//None
//init
void easytf::OP_Concat::init(const Param& param)
{
}
//forward
void easytf::OP_Concat::forward(const std::map<std::string, std::shared_ptr<Entity>>& bottom, std::map<std::string, std:... |
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// # DARK PLUGIN - POWERED BY FIRE TEAM
// # GAME SERVER: 0.97.40T (C) WEBZEN.
// # VERSÃO: 1.0.0.0
// # Autor: Maykon
// # Skype: Maykon.ale
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// # O S... |
#include <iostream>
#include <vector>
#include <map>
using namespace std;
/*
0000000111
0000001011
0000001101
0000001110
0000010011
000001xxxx
*/
void Solve() {
int N, K;
cin >> N >> K;
if (N == 1) {
cout << 1 << "\n";
return;
}
if (K == N || (K % 2 == 0)) {
cout << -1 <<... |
#pragma once
#include "LineSeg.h"
#include "SlingshotAnimObject.h"
class Surface;
class LineSegSlingshot : public LineSeg
{
public:
LineSegSlingshot(const Vertex2D& p1, const Vertex2D& p2, const float _zlow, const float _zhigh);
virtual float HitTest(const BallS& ball, const float dtime, CollisionEvent& coll) con... |
// 149
#include <iostream>
#include <vector>
using namespace std;
// cntN : 원소 총 개수
// M : 더 골라야 할 원소 수
// A : 지금까지 고른 원소들
void pick(int cntN, int M, vector<int> A){
if (M==0){
for(int i=0; i<A.size() ; ++i){
cout << A[i] << " ";
}
cout << " "<<endl;
return;
}
int mmin = A.empty() ? 0 : A.... |
#include<iostream>
using namespace std;
struct ListNode
{
int value;
ListNode* next;
ListNode(int x) { value = x; next = NULL; }
};
ListNode* merge(ListNode* phead, ListNode* qhead)
{
if (phead == NULL && qhead != NULL) {
return qhead;
}
if (phead != NULL && qhead == NULL) {
return qhead;
}
if (phead == N... |
#ifndef FUZZYCORE_INPUTEXCEPTION_H
#define FUZZYCORE_INPUTEXCEPTION_H
#include "../FuzzyCoreException.h"
class InputException : public FuzzyCoreException {
public:
explicit InputException(const std::string &);
};
#endif
|
#include "mainwindow.h"
#include <QApplication>
#include "note.h"
#include "article.h"
#include <iostream>
#include <time.h>
#include <sstream>
#include "notesmanager.h"
#include <QSettings>
#include "document.h"
#include "article.h"
/**
*@mainpage Rapport du Projet LO21 réalisé avec joie par Pauline Cuche et Simon Ro... |
#include<bits/stdc++.h>
using namespace std;
// given an array output the min swaps to sort the array
// method-1 using selection sort
// time complexity O(n^2)
// space complexity O(1)
int get_min(vector<int>& arr,int start,int n)
{
int min_value = INT_MAX;
int min_index = -1;
for(int i=start+1;i<n;i++)
{
if(... |
#ifndef _WCSim_Draw_H
#define _WCSim_Draw_H
#include "TObject.h"
#include <TApplication.h>
#include <TGClient.h>
#include <TGButton.h>
#include "TGLayout.h"
#include <TGFrame.h>
#include <TGListBox.h>
#include <TList.h>
#include <TFrame.h>
#include <TRootEmbeddedCanvas.h>
#include <TGStatusBar.h>
#include <TGButtonGrou... |
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package
#ifndef JACTORIO_INCLUDE_DATA_PYBIND_MANAGER_H
#define JACTORIO_INCLUDE_DATA_PYBIND_MANAGER_H
#pragma once
#include <string>
namespace jactorio::data
{
/// Evaluates string of python
/// \param python_str Pyth... |
double appSqrt(double value);
|
// *****************************************************************
// This file is part of the CYBERMED Libraries
//
// Copyright (C) 2007 LabTEVE (http://www.de.ufpb.br/~labteve),
// Federal University of Paraiba and University of São Paulo.
// All rights reserved.
//
// This program is free software; you can redist... |
#include <iostream>
using namespace std;
struct True_type {};
struct False_type {};
struct A{};
struct B{};
template <class type>
struct type_traits {
typedef False_type has_xxx; // 默认为False_type
};
template <> // 特化A
struct type_traits<A> {
typedef True_type has_xxx;
};
template <... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.