text stringlengths 8 6.88M |
|---|
#pragma once
namespace Hourglass
{
class WaypointGraph
{
public:
struct Edge
{
unsigned int m_ToVertex;
float m_Distance;
};
struct WVertex
{
Vector3 m_Waypoint;
std::vector<Edge> m_Edges;
explicit WVertex( const Vector3& waypoint ) { m_Waypoint = waypoint; }
void AddEdge( const Edge... |
//
// Copyright (C) 2001 David Gould
//
#include "GroundShadowNode.h"
#include <maya/MPlug.h>
#include <maya/MDataBlock.h>
#include <maya/MDataHandle.h>
#include <maya/MGlobal.h>
#include <maya/MFnUnitAttribute.h>
#include <maya/MFnGenericAttribute.h>
#include <maya/MFnNurbsSurfaceData.h>
#include <maya/MFnNurbsSurfa... |
#include <pthread.h>
#include <stdio.h>
/* compile with g++ main.cpp -lpthread -o example.out */
void* do_work(void* arg) {
printf("abc\n");
pthread_exit((void*) 0);
}
int main() {
pthread_t thread;
pthread_attr_t attr;
int rc;
void* status;
/* Create Thread attribute object */
rc = pthread_attr_init(&attr)... |
#include<bits/stdc++.h>
using namespace std;
int random_number()
{
return rand()%100+1;
}
void computer_guess(int& lower_limit,int& upper_limit,char& c)
{
cout<<"My guess is number: "<<(lower_limit+upper_limit)/2<<endl<<"Please enter: ";
cin>>c;
if(c=='<')
{
lower_limit=(lower_limit+upper... |
#ifndef REACTOR_NET_HTTP_CONTEXT_H
#define REACTOR_NET_HTTP_CONTEXT_H
#include "../TcpConnection.h"
#include "HttpRequest.h"
#include "HttpResponse.h"
namespace reactor {
namespace net {
namespace http {
class HttpRequest;
class HttpResponse;
class HttpContext {
public:
enum State {
kRequestLine = 0,
kHeader,
... |
//
// SerialPort.hpp
// DrumConsole
//
// Created by Paolo Simonazzi on 21/04/2016.
//
//
#ifndef SerialPort_hpp
#define SerialPort_hpp
#include <stdio.h>
class SerialPort : public Thread {
public:
SerialPort();
void run() override;
private:
};
#endif /* SerialPort_hpp */
|
// // // // // // // // // // // // // // //
// //
// vCenterViewer //
// VisionStudio //
// //
// // // // // // // // // // // // // // //
// QT
#include <QApplication>
#include <QMutex>
#... |
// energy.cpp
#include <memory>
#include <vector>
#include "BlobCrystallinOligomer/energy.h"
namespace energy {
using ifile::InputEnergyFile;
using monomer::particleArrayT;
using potential::ZeroPotential;
using potential::HardSpherePotential;
using potential::SquareWellPotential;
using poten... |
class Solution {
public:
// vector<int> getIntialColoring(vector<vector<int>>& graph) {
// int n = graph.length()
// vector<int> coloring(n);
// for(int i=0; i<n; i++) {
// coloring[i] = 0;
// }
// }
int oppositeColor(int Prevnode, vector<int> coloring) {
return coloring[Prevnode] == 1 ? 2 : 1;
}
... |
#pragma once
#include "Polygon3D.h"
#include "Vertex.h"
#include "Matrix.h"
#include <vector>
#include <algorithm>
#include "DirectionalLight.h"
#include "AmbientLight.h"
#include "PointLight.h"
#include "Light.h"
class Model
{
public:
Model();
~Model();
// Acessors
const std::vector<Polygon3D>& GetPolyons();
co... |
// 问题的描述:链表分化
// 给定一个单链表以及一个阈值,对小于阈值的结点放到左边,等于阈值的结点放到中间,大于阈值的结点放到右边
// 保证两种结点内部的位置关系不变
// 分成三个小链表,再组合成一个链表
// 测试用例有4组:
// 1、空链表 threshold = 2
// 输入:NULL 2
// 输出:NULL
// 2、非空链表 threshold = 3
// 输入:{1,4,2,5} 3
// 输出:1,2,4,5
// 3、非空链表 threshold = 8
// 输入:{1,4,2,5} 8
// 输出:1,4,2,5
// 4、非空... |
//
// Model.cpp
// cg-projects
//
// Created by HUJI Computer Graphics course staff, 2013.
//
#include "ShaderIO.h"
#include "Model.h"
#include <GL/glew.h>
#ifdef __APPLE__
#include <OpenGL/OpenGL.h>
#else
#include <GL/gl.h>
#endif
#include <stdlib.h>
#include <glm/gtc/type_ptr.hpp>
#include "glm/gtc/matrix_tra... |
#include "ofTimer.h"
#define NANOS_PER_SEC 1000000000ll
void ofGetMonotonicTime(uint64_t & seconds, uint64_t & nanoseconds);
ofTimer::ofTimer()
:nanosPerPeriod(0)
#ifdef TARGET_WIN32
,hTimer(CreateWaitableTimer(nullptr, TRUE, nullptr))
#endif
{
}
void ofTimer::reset(){
#if defined(TARGET_WIN32)
GetSystemTimeAsFil... |
#include <iostream>
using std::cout; using std::cin; using std::endl;
#include <cstddef>
using std::size_t;
int main()
{
int arr[10] = {};
int arr_copy[10] = {};
int index = 0;
for(auto &i : arr) {
i = index++;
}
for(auto j : arr)
cout << j << endl;
for(int i = 0; i <... |
#include <Unixfunc.h>
#include <iostream>
#include <sys/ipc.h>
#include <sys/shm.h>
using namespace std;
/*
案例二:非亲属进程间通信
写端 写入HelloWorld , 读端进行读取
*/
int main()
{
key_t key = ftok("file", 1);
ERROR_CHECK(key, -1, "ftok");
int shmid = shmget(key, 1024, 0600);
ERROR_CHECK(shmid, -1, "shmget");
char*... |
//===================================== Bibliotecas E Definições =====================================
#include <EEPROM.h> //EEPROM
#include <SPI.h> //Biblioteca necessária para comunicação SPI
#include <SD.h> //Biblioteca necessária para comunicação SD card
#include <Wire.h> //... |
#include <iostream>
using namespace std;
int main() {
int myArray[21] = { 41, 58, 97, 53, 98, 29, 23, 19, 10, 85, 3, 90, 81, 16, 47, 78, 37, 59, 60, 43 };
bool sorted = false; // Determines if array has been sorted, currently set to false
// As long as array is not sorted, sort the array
while (!sorted)... |
// type define
// 형을 정의한다
#include <stdio.h>
int main(){
typedef int Int32;
Int32 n = 20;
printf("%d \n", n);
}
|
#include "customQGraphicsView.h"
CustomQGraphicsView::CustomQGraphicsView(QWidget *parent) : QGraphicsView(parent) {
depressed = false;
last_x = -1;
last_y = -1;
scene = new QGraphicsScene();
this->setScene(scene);
}
|
#include <iostream>
#include <unistd.h>
#include <GLFW/glfw3.h>
#include "Loop.h"
#include "Engine.h"
#include "Clock.h"
#include "../Display/Window.h"
Loop::Loop(Engine* engine) :
running(false),
render(false),
sleepTime(0),
fps(0.0f),
lastTime(0.0),
startTime(0.0),
frameTime(1.0 / 60.0f),... |
#include<iostream>
#include<string>
using namespace std;
int main(){
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n,k,pre,len;
string cur,str;
cin>>n>>cur;
cin.ignore();
while (n--)
{
getline(cin,str);
if(str[0]!='/')str=cur+"/"+str;
... |
#include "stdafx.h"
#include "ShikoChu.h"
#include "../../GameData.h"
ShikoChu::ShikoChu()
{
SkinModelRender* sr = NewGO<SkinModelRender>(0, "smr");
sr->Init(L"Assets/modelData/si_bug.cmo");
//sr->SetScale(CVector3::One() * 20);
sr->SetPosition(CVector3::Zero());
MonsterInitParam prm;
prm.HP = 60;
prm.MP = ... |
#if !defined(FUTURE_FTDCMDAPI_H)
#define FUTURE_FTDCMDAPI_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "FutureFtdcUserApiStruct.h"
#if defined(ISLIB) && defined(WIN32)
#ifdef LIB_MD_API_EXPORT
#define MD_API_EXPORT __declspec(dllexport)
#else
#define MD_API_EXPORT __declspec(dllimport)
#end... |
#ifndef RANDOMNUMBERGENERATOR_H
#define RANDOMNUMBERGENERATOR_H
class RandomNumberGenerator
{
public:
static int randomInt(int from, int tillIncl);
static double randomDouble(double from, double tillIncl, int precision);
private:
RandomNumberGenerator(){};
static bool initiated;
static void checkIfInitia... |
#include "Plate.h"
Plate::Plate()
{
}
Plate::~Plate()
{
}
void Plate::loadVals( PL_NUM _E1, PL_NUM _E2, PL_NUM _nu21, PL_NUM _rho, N_PRES _h, PL_NUM _sigma_x, N_PRES _a )
{
E1 = _E1;
E2 = _E2;
nu21 = _nu21;
rho = _rho;
h = _h;
a = _a;
sigma_x = _sigma_x;
sigma_x_mu = _sigma_x * 0.000001256l;
} |
#include "mbed.h"
#include "adc128.h"
#include "term.h"
#include "uart.h"
const int brakeIOX7Addr = 0x20;
DigitalOut myled(LED1);
I2C i2cbus(I2C_SDA, I2C_SCL);
RawSerial pc(USBTX, USBRX);
int initIOX(char *name, const int addr);
int blink(int ledVal);
int main() {
int ledVal = 0;
int ticks =... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2006 Opera Software AS. 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 M2_SUPPORT
#include "AskMaxMess... |
// Created on: 1992-08-26
// Created by: Remi GILET
// 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 GNU Les... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define INF 10e10
#define rep(i,n) for(int i=0; i<n;... |
#include "Connector.h"
Connector::Connector(Statement* Src, Statement* Dst)
//When a connector is created, it must have a source statement and a destination statement
//There are no free connectors in the folwchart
{
SrcStat = Src;
DstStat = Dst;
ConnType=0;
Selected=false;
}
void Connector::SetSelected(bool ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef OPPAINTER_H
#define OPPAINTER_H
#include "modules/pi/... |
#include<SDL.h>
#include "Bullet.hpp"
#include "Tank.hpp"
#include<list>
using namespace std;
class BattleField{
list<Tank> tanks;
SDL_Renderer *gRenderer;
SDL_Texture *assets;
public:
BattleField(SDL_Renderer *, SDL_Texture *);
void drawObjects();
void createObject(int, int);... |
/*********************************************************\
* 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 <vector>
#include <algorithm>
#include <fstream>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <list>
using namespace std;
#define INT_MIN (1<<31)
#define INT_MAX (~INT_MIN)
#define UNREACH... |
// Copyright (c) 2017 Doyub Kim
//
// I am making my contributions/submissions to this project solely in my
// personal capacity and am not conveying any rights to any intellectual
// property of any third parties.
#include <perf_tests.h>
#include <jet/list_query_engine3.h>
#include <jet/timer.h>
#include <jet/triang... |
#include <iostream>
#include <string>
void replace (char text[255], char change) {
char str;
std::cout << "pleace enter new letter" << std::endl;
std::cin >> str;
for (int i = 0; i < 255; ++i) {
if(text[i] == change) {
text[i] = str;
}
}
}
int count (char text[255], c... |
// 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 as published
// by the Fre... |
#include <bits/stdc++.h>
using namespace std;
int dp[155555];
int main(){
int n;
cin >> n;
vector<int> a(n);
for(int i=0; i<n; i++) cin >> a[i];
for(int i=1; i<=n; i++) dp[i] = 1e9;
for(int i=0; i<n; i++){
dp[i+1] = min(dp[i+1], dp[i]+ abs(a[i+1] - a[i]));
dp[i... |
//Accepted. Time-0.000s
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
string find(int x, int y, int a = 0, int b = 1, int c = 1, int d = 0) {
int m = a + c, n = b + d;
if (x == m && y == n)
return "";
if (x*n < y*m)
return 'L' + find(x, y, a, b,... |
#include <sstream>
#include <algorithm>
#include "IpidDetection.hh"
#include "Log.hpp"
IpidDetection::IpidDetection()
: ADetection()
{
this->setPace(20);
this->setName(std::string("IpidDetection"));
this->worksWithPair(false);
}
IpidDetection::~IpidDetection()
{
}
void IpidDetection::findIpidVariations(boost... |
#include<cmath>
#include<stack>
#include<iostream>
#include<cstring>
using namespace std;
char s0[1000000001];
char a[17]="0123456789ABCDEF";//便于输出
long long s1=0;
int main()
{
int n,m;
stack <int> s;
cin>>n>>s0>>m;
int l=strlen(s0)-1;
int i=0;
while(l>=0)//先转十进制
{
if(s0[l]>='0' && s0[l]... |
#include "piece.h"
#define PROGRAM_TITLE "Rhythm Tetris"
const int PLAY_HEIGHT = 20;
const int PLAY_WIDTH = 10;
const int HEIGHT_PIXEL = 600;
const int WIDTH_PIXEL = 300;
class Board {
private:
int board[PLAY_HEIGHT][PLAY_WIDTH];
Piece * currentPiece = 0;
// (0,0) is top left corner
int pieceXPosition;
int p... |
#pragma once
#include <iostream>
#include "UserInterface.h"
#include "PassengerCar.h"
#include "Motorcycle.h"
#include "Bus.h"
#include "Truck.h"
class Produce
{
public:
PassengerCar* create_passenger_car(UserInterface* ui);
Motorcycle* create_motorcycle(UserInterface* ui);
Truck* create_truck(UserInterface* ui);
... |
#pragma once
#include "Interface/IRuntimeModule.h"
#include "Process/Process.h"
#include <list>
namespace Rocket
{
class ProcessManager : implements IRuntimeModule
{
public:
RUNTIME_MODULE_TYPE(ProcessManager);
ProcessManager() = default;
virtual ~ProcessManager() = default;
... |
#include "header.cpp"
struct edge{
int from, to, wght;
edge(int u, int v, int w=0): from(u), to(v), wght(w) {}
};
bool operator>(edge e1, edge e2){return e1.wght>e2.wght;}
bool operator<(edge e1, edge e2){return e1.wght<e2.wght;}
bool operator==(edge e1, edge e2){return (e1.from==e2.from&&e1.to==e2.to)||(e1.f... |
#include "Camera.h"
Camera::Camera()
{
Start(720, 1280);
}
Camera::~Camera()
{
}
Camera::Camera(float windowHeight, float windowWidth)
{
Start(windowHeight, windowWidth);
}
void Camera::Start()
{
Start(720, 1280);
}
void Camera::Start(float windowHeight, float windowWidth)
{
SetPos(vec3(10));
SetLookAt(vec3(1... |
#include <iostream>
#include <iterator>
#include <fstream>
#include <algorithm> // for std::copy
#include <QCommandLineParser>
#include <QtDebug>
#include <stdio.h>
#include "context.h"
Context::Context(QCoreApplication& app, int argc, char* argv[]) {
/* Set default values */
myHost = "127.0.0.1";
myP... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); ... |
#pragma once
#include "Primitive.h"
class AABB : Primitive
{
public:
AABB(vec3 const& extents, vec3 const& pos) : Primitive(PrimitiveID::AABB)
{
m_extents = extents;
m_pos = pos;
}
inline vec3 GetExtents() { return m_extents; };
inline vec3 GetPos() { return m_pos; };
private:
vec3 m_extent... |
#include <bits/stdc++.h>
using namespace std;
const int SZ = 1 << 18;
struct LazySeg {
unsigned long long sum[2 * SZ], lazy[2 * SZ], num_active[2 * SZ];
LazySeg() {
for (int i = 0; i < SZ; i++) {
num_active[SZ + i] = 1;
}
for (int i = SZ - 1; i > 0; i--) {
nu... |
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2012-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#ifndef _GDCMIO_DICOMINSTANCE_HPP_
#define _GDCMIO_DICOMINSTANCE_HPP_
#in... |
#pragma once
namespace MyDirectX
{
struct Vector2
{
float x, y, z = 0;
Vector2();
Vector2(float x, float y);
Vector2(float x, float y, float z);
bool operator==(const Vector2& vec);
bool operator!=(const Vector2& vec);
Vector2 operator+(const Vector2& vec);
Vector2 operator-(const Vector2& vec);
... |
#include"Play.h"
Play::Play(QObject *parent) : QObject(parent)
{
scene=new QGraphicsScene;
Pview->setScene(scene);
QPixmap back(":/play/Floral-Background.jpg");
scene->setBackgroundBrush(back.scaled(500,500,Qt::IgnoreAspectRatio,Qt::SmoothTransformation));
scene->setSceneRect(0,0,500,500);
... |
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
#define mn 15000
#define mx 33000
int level[mn],tree[mx];
int lb(int x){
return x&-x;
}
void add(int x,int value){
for(int i=x;i<=mx;i+=lb(i)) tree[i]+=value;
}
int get(int x){
int ret=0;
for(int i=x;i;i-=lb(i)) re... |
//
// Created by heyhey on 20/03/2018.
//
#include "Fonction.h"
Fonction::Fonction() {
bloc = NULL ;
parametre = NULL ;
}
Fonction::~Fonction() {
}
Parametre *Fonction::getParametre() const {
return parametre;
}
void Fonction::setParametre(Parametre *parametre) {
Fonction::parametre = parametre;
}
con... |
// Project 20 Light Harp
int soundPin = 11;
int pitchInputPin = 0;
int volumeInputPin = 1;
int ldrDim = 400;
int ldrBright = 800;
byte sine[] = {0, 22, 44, 64, 82, 98, 111, 120, 126, 127,
126, 120, 111, 98, 82, 64, 44, 22, 0, -22, -44, -64, -82,
-98, -111, -120, -126, -128, -126, -120, -111, -98, -82,
-64, -44, -2... |
#include<iostream>
#include<math.h>
using namespace std;
typedef unsigned long long int ll;
bool kt(ll n){
if(n < 2) return false;
ll x = sqrt(n);
for(ll i = 2; i <= x; i++) if(n % i == 0) return false;
return true;
}
int main(){
ll n;
cin >> n;
if(kt(n)) cout << "true";
... |
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <algorithm>
#include <sstream>
#include <set>
#include <cmath>
#include <map>
#include <stack>
#include <queue>
#include <stdio.h>
#include <string.h>
#include <numeric>
#define INF (1<<28)
using nam... |
#include "../../include/time_leak/netAnalyzer.hpp"
using namespace std;
void time_leak::NetAnalyzer::RunAnalysis(time_leak::Net &net, bool runConditional)
{
while(this->wasChanged())
{
this->resetChanged();
this->analyzeNet(net, net.GetPlaces().at("end"), true);
this->transitionsQueue... |
#include "server/HTTPServer.h"
#include "RuntimeArguments.h"
eeskorka::serverConfig eeskorka::config;
int main(int argc, char** argv) {
RuntimeArguments arguments(argc, argv);
eeskorka::config.readConfigFile(arguments.configPath);
if (arguments.port != -1) {
eeskorka::config.port = arguments.port... |
//Declaration header
#include"resources.h"
//C++ headers
#include<sstream>
#include<fstream>
//Engine headers
#include"logger.h"
namespace shady_engine
{
resources::resources()
{
}
std::shared_ptr<shader> resources::load_shader(
const std::string& pName,
const std::string& pVSPath,
const std::stri... |
#pragma once
class Base
{
public:
virtual int PublicMethodBase();
virtual int CallProtectedMethod();
virtual int CallPrivateMethod();
int x;
protected:
virtual int ProtectedMethodBase();
int y;
private:
virtual int PrivateMethodBase();
int z;
};
class A : public Base
{
public:
virtual int PublicMethodBase... |
#include <cmath>
#include <Poco/Ascii.h>
#include <Poco/Exception.h>
#include <Poco/NumberParser.h>
#include <Poco/String.h>
#include "math/SimpleCalc.h"
using namespace std;
using namespace Poco;
using namespace BeeeOn;
double SimpleCalc::evaluate(const string &input) const
{
enum State {
S_INIT,
S_TERM_OP_TE... |
#include <list>
#include <vector>
#include <algorithm>
#include <iterator>
#include <numeric>
#include <limits>
#include <iostream>
#include "graph.hpp"
template<typename T>
class TD;
float
PartitionGraph::compute_weight(int i, int j) {
float weight = -1. * std::pow(std::accumulate(a_.begin()+i, a_.begin()+j, 0.),... |
// chunk_manager.cpp
#include "chunk_manager.h"
#include "math/perlin.h"
#include "system/logger.h"
#include <algorithm>
namespace leap {
namespace world {
ChunkManager::ChunkManager() = default;
ChunkManager::~ChunkManager() = default;
Rval ChunkManager::init() {
constexpr int32_t WORLD_REAL_WIDTH = WORLD_WIDTH... |
#include <bits/stdc++.h>
using namespace std;
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 10000
#define INF 0x3f3f3f3f
#define DEVIATION 0.00000005
int H[MAXN+5];
int W[MAXN+5];
int LIS[MAXN+5];
int LDS[MAXN+5];
int main(int argc, char const *argv[])
{
int kase;
scanf("%d",&kase);
... |
// Labastida Vázquez Fernando
// Práctica 05
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
#include <stdbool.h>
#define MAXSIZE 5
int stack[MAXSIZE];
int top = -1;
int myQueue[MAXSIZE];
int front = 0;
int rear = -1;
int itemCount = 0;
int peekSt();
void pop();
void push(int data);
i... |
#include<iostream>
using namespace std;
long r[100000],n;
bool simulate(long a)
{
long b;
for(int i=0;i<n;i++)
{
if(i==0)b=r[i];
else b=r[i]-r[i-1];
if(a==b)a--;
else if(a<b)return false;
}
return true;
}
int main()
{
int t;
cin>>t;
for(int j=0;j<t;j++)
{
long max,ans;
cin>>n;... |
#ifndef __SECOMPONENT_H__
#define __SECOMPONENT_H__
#include "SEObject.h"
class SEComponent : public SEObject {
public:
typedef enum {
RENDER_COMPONENT,
TIMER_COMPONENT,
PHYSICS_COMPONENT,
ANIMATION_COMPONENT,
UI_COMPONENT,
AUDIO_COMPONENT,
CONTROL_COMPONE... |
#ifndef __CLIENTINFO_INCLUDED__
#define __CLIENTINFO_INCLUDED__
#include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <unistd.h>
#include <vector>
#include "../Utils/network_utils.h"
#include "../Ports/ports.h"
#include "../Packet/packet.h"
class ClientInfo {
private:
char *hostName... |
#include "book.h"
Book::Book()
{
buyTree = NULL;
sellTree = NULL;
lowSell = NULL;
highBuy = NULL;
}
void Book::AddOrder(int timestamp,char id, bool isBid, int price, int size)
{
Order * order = new Order(timestamp, id, isBid, price, size);
if (isBid){// buy order
if (buyTree != NULL){
... |
#ifndef PICTURESHRINKER_H
#define PICTURESHRINKER_H
#include <QThread>
#include <QString>
class PictureShrinker : public QThread
{
Q_OBJECT
public:
explicit PictureShrinker(QObject *parent = 0);
void setPath(QString path);
void setSavePath(QString path);
void setScale(int widthPercent, int heightP... |
//Accepted Solution. Time- 0.090s
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
class SegmentTree { // the segment tree is stored like a heap array
private:
vll st, A;
ll n;
ll left (ll p) { return p << 1; } // same as binary heap operations
ll right(ll p) ... |
//Accepted. Time-0.010s
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
int main()
{
ll n,k,a;
while(cin>>n)
{
if(n==0) break;
vll v;
for(int i=0;i<n;i++)
{
cin>>a;
if(a) v.push_back(a);
}
in... |
#pragma once
#include "afxdialogex.h"
#include "Talk2Me.h"
#include "afxcmn.h"
// CSignup 对话框
class CSignup : public CDialogEx
{
DECLARE_DYNAMIC(CSignup)
public:
CSignup(CWnd* pParent = NULL); // 标准构造函数
virtual ~CSignup();
// 对话框数据
enum { IDD = IDD_SIGNUP_DLG };
protected:
virtual void DoDataExchange(CData... |
/***********************************************************************
Desc: Noise Mesh Renderer (D3D)
************************************************************************/
#include "Noise3D.h"
using namespace Noise3D;
IRenderModuleForMesh::IRenderModuleForMesh()
{
}
IRenderModuleForMesh::~IRende... |
#ifndef IMAGE_ALGORITHM_H
#define IMAGE_ALGORITHM_H
#include <QList>
#include <QMap>
#include <QVariant>
#include <QString>
#include <opencv2/core/core.hpp>
class ImageAlgorithm
{
public:
virtual Mat exec(const QList<Mat> &images, const QMap<QString, QVariant> ¶ms) = 0;
};
#endif
|
#include <iostream>
#include <vector>
void vect_elem(std::vector<int> &myvector)
{
myvector.push_back(4);
for (int i = 0; i < myvector.size(); i++)
{
std::cout << myvector[i] << " \t "; //<< std::endl;
}
std::cout << "\n";
}
int main()
{
std::vector<int> myvector = {1,2,3};
vec... |
/*
* License does not expire.
* Can be distributed in infinitely projects
* Can be distributed and / or packaged as a code or binary product (sublicensed)
*
* Commercial use allowed under the following conditions :
* - Crediting the Author
*
* Can modify source-code
*/
/*
* File: Water.cpp
* Author: Su... |
#ifndef GENERATE_BINDINGS
#include <functional>
#include <string>
#include <utility>
#include <vector>
#endif
class capture_groups {
public:
capture_groups();
int size();
const char* get_match(int index);
#ifndef GENERATE_BINDINGS
bool search(std::string, std::regex);
private:
std::smatch d_matches... |
#pragma once
#include <Poco/Timespan.h>
#include <Poco/Timestamp.h>
namespace BeeeOn {
/**
* Interval between two timestamps. The start must always be
* less or equal to end. The duration of the interval is
* defined as:
*
* m_end - m_start
*
* The m_end is not part of the interval.
*/
class TimeInterval ... |
#include "FluViruss.h"
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <list>
using namespace std;
int bl = 0x0000ff;
int red = 0xff0000;
FluViruss::FluViruss()
{
DoBorn();
this->m_resistance = InitResistance();
}
FluViruss::FluViruss(int color, char * dna, int resistance) : Viruss(dna, resistanc... |
/*
* Copyright (c) 2011 Pierre-Etienne Bougué <pe.bougue(a)gmail.com>
* Copyright (c) 2011 Florian Colin <florian.colin28(a)gmail.com>
* Copyright (c) 2011 Kamal Fadlaoui <kamal.fadlaoui(a)gmail.com>
* Copyright (c) 2011 Quentin Lequy <quentin.lequy(a)gmail.com>
* Copyright (c) 2011 Guillaume Pinot <guillaume.pino... |
#include "Lance.h"
Lance::Lance(string name, int damages, int hit, int range, int crit, int worth, int uses, WeaponType type):PhysicalWeapon(name, damages, hit, range, crit, worth, uses , type)
{
//ctor
}
Lance::~Lance()
{
//dtor
}
Lance::Lance(const Lance& other):PhysicalWeapon(other)
{
//... |
#ifndef WIDGETCONTAINER_HH_
#define WIDGETCONTAINER_HH_
#include <pgwidget.h>
/** This class is used to create word containers in the scrolling hypothesis
* view. This way all morphemes are in the same unite rectangle and it also
* enables the possibility to force word breaks. */
class WidgetContainer : public P... |
// Created on: 1994-03-18
// Created by: Bruno DUMORTIER
// Copyright (c) 1994-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... |
#include "startdialog.hh"
#include "ui_startdialog.h"
#include "gamewindow.hh"
extern gameWindow *gWindow;
startDialog::startDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::startDialog)
{
ui->setupUi(this);
}
startDialog::~startDialog()
{
delete ui;
}
//void startDialog::startGameWindow()
//{
... |
#include "service_thread.hpp"
#include "utils/exception.hpp"
#include "utils/time_utils.hpp"
#include "utils/log.hpp"
#include "utils/assert.hpp"
using namespace std;
using namespace chrono;
namespace nora {
mutex service_thread::timer_counts_lock_;
map<string, int> service_thread::timer_counts_;
... |
///
/// @file SieveOfEratosthenes.cpp
/// @brief Implementation of the segmented sieve of Eratosthenes.
///
/// Copyright (C) 2017 Kim Walisch, <kim.walisch@gmail.com>
///
/// This file is distributed under the BSD License. See the COPYING
/// file in the top level directory.
///
#include <primesieve/config.hpp>
#i... |
// Lab 1 Q1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <ctime>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int x=0, y=0;
int* p=nullptr;
int* q=nullptr;
srand(time(0));
x=rand()%100;
y=rand()%100;
p=&x;
q=&y... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "opencv2/opencv.hpp"
#include "colorretouch.h"
#include "imagehsv.h"
#include "../Tools/imageoperation.h"
#include "../Tools/colorOperation.h"
using namespace std;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)... |
/******<CODE NEVER DIE>******/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FastIO ios_base::sync_with_stdio(0)
#define IN cin.tie(0)
#define OUT cout.tie(0)
#define CIG cin.ignore()
#define pb push_back
#define pa pair<int,int>
#define f first
#define s second
#define FOR(i,n,m) for(int i... |
// Author : Abdullah Baron
#include <iostream>
#include <string>
#include <vector>
#include "bitmap.h"
using namespace std;
// Function to check the size of two images
int checkSize(Bitmap ,Bitmap );
// Function to combine images
void makePic(Bitmap & , Bitmap [] ,int );
int main()
{
Bitmap images[10];
... |
#include <iostream>
using namespace std;
int main ()
{
const int MAX_ARRAY = 5;
string nama[MAX_ARRAY]={};
for(int i=0;i<MAX_ARRAY;++i){
cout<<"Masukan Nama : ";cin>>nama[i];
}
cout<<endl<<"=== Daftar Nama ==="<<endl;
for(int i=0;i<MAX_ARRAY;++i){
cout<<(i+1)<<". "<<nama[i]<<e... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
using namespace std;
int f[50][3],n;
int a[50],b[50],c[50];
bool can(int k1,int t1,int k2,int t2) {
... |
#include "mainwindow.h"
#include <QApplication>
#include <QDebug>
#include <librealsense/rs.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
bool _loop = true;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Mai... |
/*
* File: AIC.cpp
* Author: Corrado Pezzato, TU Delft, DCSC
* Edited: Kristijonas Atkociunas, DTU
*
* Created on April 14th, 2019
*
* Class to perform active inference control of the 7DOF Franka Emika Panda robot.
* Definition of the methods contained in AIC.h
*
*/
#include "AIC.h"
// Constructor which... |
#ifndef BIT_UTILS_INCLUDED
#define BIT_UTILS_INCLUDED
#include "bitBoard.hpp"
#if defined(__GNUC__)
inline int lsb(BitBoard32 bb) { return __builtin_ctzl(bb); }
#else
#define NO_BSF
const int BitTable32[32] = {0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20,
15, 25, 17, 4, 8, 31, 27, 13, ... |
//
// Keyboard.h
// Odin.MacOSX
//
// Created by Daniel on 04/06/15.
// Copyright (c) 2015 DG. All rights reserved.
//
#ifndef __Odin_MacOSX__Keyboard__
#define __Odin_MacOSX__Keyboard__
#include "KeysGLFW.h"
namespace odin
{
namespace io
{
class Keyboard
{
public:
///... |
#include "ShortTestInfo.h"
#include <QString>
// :: Constructors ::
const QString ID_JSON_KEY = "id";
const QString NAME_JSON_KEY = "name";
// :: Implementation ::
struct ShortTestInfo::Implementation {
QString name = "";
};
// :: Lifecycle ::
// :: Constructors ::
ShortTestInfo::ShortTestInfo(int id/*= 0*/,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.