text stringlengths 8 6.88M |
|---|
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Schedule{
public:
Schedule(string Tit,string Loc,string Det,string Y,string M,string D,string BH,string BM,string EH,string EM)
:title{Tit},location{Loc},detail{Det},year{Y},month{M},day{D},begin{BH,BM},end{EH,EM}
{}
st... |
/**
* @file test/test_stop.cc
* @brief
* @version 0.1
* @date 2021-01-14
*
* @copyright Copyright (c) 2021 Tencent. All rights reserved.
*
*/
#include <cstdio>
#include "mini_sdp.h"
void printx(const char* buff, size_t len) {
for (int i = 0; i < len; i++) {
printf("%02X ", (uint8_t)buff[i]);
... |
#ifndef ICsquare_H_
#define ICsquare_H_
//Class for storing a square initial condition Riemann problem, where each quadrant has its own initial values
#include <math.h>
#include <iostream>
#include <cassert>
#include <vector>
#define PI 3.1415926535897932384626433832795
class ICsinus{
public:
ICsinus(float xmin = ... |
// Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
//
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.... |
/*
* contour_format.cpp
*
* Created on: 8 Jul 2012
* Author: sashman
*
* File to translate the heightmap into a grid of tile types found in TILE_CASE (terrian_generator.hpp) enum
*/
#include "terrain_generator.hpp"
extern int crop_height;
extern int crop_width;
extern int** tmap;
int... |
#ifndef COLORS_H
#define COLORS_H
namespace MC {
struct Color {
unsigned char RED;
unsigned char GREEN;
unsigned char BLUE;
float R() { return RED/256.0f; }
float G() { return GREEN/256.0f; }
float B() { return BLUE/256.0f; }
};
}
#endif
|
#include <iostream>
#include <bitset>
using namespace std;
// 11分43秒
const size_t INT_SIZE = sizeof(int) * 8;
class Bit{
public:
Bit();
int changeBit(int num);
private:
bitset<INT_SIZE> b;
};
Bit::Bit(){
for(int i=0; i<INT_SIZE; i++){
if(!(i % 2)){
b.set(i);
}
}
}
int... |
#include <stdio.h>
#include "SDL2_net.h"
using namespace SDL2;
#pragma comment(linker, "/subsystem:console")
int main(int argc, char **argv)
{
SDL sdl;
Net net;
TCP server(9999);
if (!server)
{
printf("server:%s\n", net.GetError());
return 1;
}
//TCP tcp = server.WaitForAccept(100);
SocketSet set(2);
se... |
#include<bits/stdc++.h>
using namespace std;
main()
{
int a,b,c;
while(cin>>a>>b>>c)
{
int sum1, sum2, sum3, sum4, sum5;
sum1= a + (b * c);
sum2= a * (b + c);
sum3= a * b * c;
sum4= (a + b) * c;
sum5= a + b + c;
int res = max(sum5, max(sum1, max(sum2, ... |
#pragma once
#include "StochProc.h"
StochProc::StochProc(const StochProc& init){
if (PHI_STATES == 1){
phiTrans[0][0] = init.phiTrans[0][0];
phiTransCDF[0][0] = init.phiTransCDF[0][0];
}
else if (PHI_STATES == 2){
phiTrans[0][0] = init.phiTrans[0][0];
phiTrans[0][1] = init.phiTrans[0][1];
phiTrans[1][0] ... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* This file is used as PRODUCT_SYSTEM_FILE by Desktop on Unix.
*/
#ifndef UNIX_SYSTEM_... |
#include "global.h"
const float t = 14; |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2007 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser.
** It may not be distributed under any circumstances.
*/
#ifndef IMAGEDECODERICO_H
#define IMAGEDECODERICO_H
#include "mod... |
#include "SvcTimer.h"
#include "protocol.h"
//毫秒级定时器, 每隔30毫秒触发一次, 更新玩家的位置信息
SvcTimer::SvcTimer(io_service& ios, PlayerManager*& playerMgr)
: mTimer(ios, boost::posix_time::milliseconds(30)), mPlayMgr(playerMgr)
{
mTimer.async_wait(boost::bind(&SvcTimer::handler, this));
}
SvcTimer::~SvcTimer()
{
}
//void SvcTimer:... |
#include<stdio.h>
#include<conio.h>
#define MAX 6
using namespace std;
int arr[100],head,tail;
void enqueue(int arr[],int a)
{
int temp = (tail+1)%MAX;
if(head==temp)
{
printf("\n queue overflow");
}
else
{
arr[... |
#ifndef GLMCFG_H
#define GLMCFG_H
// TODO appropriate defines for glm
#include <glm/fwd.hpp>
#include <glm/vec3.hpp>
#include <glm/gtc/quaternion.hpp>
#include <glm/gtx/quaternion.hpp>
#include <vector>
namespace pb
{
typedef glm::vec3 Vec3;
typedef glm::quat Quat;
typedef glm::mat4x4 Mat4;
typedef uint32_t ColorRGB... |
//
// PostgreSQLTypes.h
//
// $Id: //poco/1.4/Data/PostgreSQL/include/_Db/PostgreSQL/SessionHandle.h#1 $
//
// Library: Data
// Package: PostgreSQL
//
// Definition of the SessionHandle class.
//
// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby grante... |
#include "moc_IncA.cpp"
/// AUTOMOC moc_ include on the first line of the file!
#include "IncA.hpp"
/// @brief Source local QObject
///
class IncAPrivate : public QObject
{
Q_OBJECT
public:
IncAPrivate(){};
};
IncA::IncA()
{
IncAPrivate priv;
}
#include "IncA.moc"
|
//
// BoatBList.cpp
// GAME2
//
// Created by ruby on 2017. 11. 11..
// Copyright © 2017년 ruby. All rights reserved.
//
#include "BoatBList.hpp"
#include "BoatB.hpp"
void BoatBList::add(BoatB * new_BoatB){
if (head == NULL) { // BoatB가 아직 없는 경우
head = new_BoatB;
size++;
} else {
Bo... |
#include <iostream>
constexpr void SafeDeleteArray(bool* arr) noexcept
{
if (arr)
{
delete[] arr;
arr = nullptr;
}
}
void solution(int start, int end)
{
bool* arr = new bool[end + 1];
for (int i = 0; i < end + 1; i++)
arr[i] = false;
arr[1] = true;
for (int i = 2; i * i <= end; i++)
{
if (!arr[i])
{... |
#include <iostream>
#include "rsdgMission.h"
#include <vector>
#include <stack>
#include <stdlib.h>
#include <unistd.h>
using namespace std;
bool verbose;
bool local;
//derive your own rsdgMission class
//where you can reimplement the updateFunction
//each time when reconfig() is called, this function would be used t... |
#include<string>
#include<iostream>
using namespace std;
class address{
private:
char name[10];
char city[10];
public:
address(char *p,char *q){
//return 1;
strcpy(name,p);
strcpy(city,q);
}
};
class date{
private:
int day,month,year;
date(){
day=7;mon... |
#ifndef LogVol_PCBs_Cyl_h
#define LogVol_PCBs_Cyl_h 1
/*! @file LogVol_PCBs_Cyl.hh
@brief Defines mandatory user class LogVol_PCBs_Cyl.
@date August, 2015
@author Flechas (D. C. Flechas dcflechasg@unal.edu.co)
@version 2.0
In this header file, the 'physical' setup is defined: materials, geometries and po... |
int motor_one1=9;
int motor_one2=10;
int motor_two1=5;
int motor_two2=3;
void setup() {
// put your setup code here, to run once:
pinMode(6,INPUT);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
pinMode(11,INPUT);
pinMode(5,OUTPUT);
pinMode(3,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int... |
#ifndef PRODUCT_H
#define PRODUCT_H
class Product {
public:
virtual ~Product() = 0;
protected:
Product();
};
class ConcreteProduct :public Product {
public:
~ConcreteProduct();
ConcreteProduct();
};
#endif |
#ifndef AI_BATTLEPLANNER_H
#define AI_BATTLEPLANNER_H
#include <string>
#include "../Objects/Characters/Skill.h"
using std::string;
class AIBattlePlanner
{
Skill* m_SkillUsed;
size_t m_Attacker;
size_t m_Target;
public:
AIBattlePlanner();
AIBattlePlanner(Skill* SkillUsed, size_t Attacker, size_t Target);
~AIB... |
#ifndef SIGHT_H
#define SIGHT_H
#include <GL/glu.h>
#include <QOpenGLWidget>
#include "Vector.h"
class Object;
class PlayerNeo;
class UniversalForce;
class UniversalTorque;
class QKeyEvent;
class Sight : public QOpenGLWidget
{
Q_OBJECT
public:
Sight(PlayerNeo*, UniversalForce*, UniversalTorque*);
signals:
void... |
#pragma once
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <sys/random.h>
using namespace std;
namespace randomize
{
uint32_t rangeInt(uint32_t min, uint32_t max);
string queryString(uint32_t min, uint32_t max);
string cookie(uint32_t min, uint32_t max);
string path(uint32_t min, uint32... |
#include "ring.h"
Ring::Ring()
{
this->ringWidth = 30;
this->objectId = 5;
}
Ring::Ring(int width)
{
this->ringWidth = width;
this->objectId=5;
}
void Ring::paintShape()
{
glColor4f(0.75,0.75,0.75,0.85);
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
glEnable(GL_BLEND);
glutSolidTorus(5.0,this->ri... |
// Copyright (c) 2022 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 ... |
#ifndef MOTOR_HPP
#define MOTOR_HPP
class Motor {
private:
int pin1;
int pin2;
bool isDirType;
bool isInverted;
public:
Motor(int _pin1, int _pin2, bool _isDirType=true, bool _isInverted=false);
void write(int _spd);
void invert();
};
#endif
|
#include "simulation.hpp"
#include "profile/profile.hpp"
#include <kalman/kalman1d.hpp>
Simulation::Simulation(): m_realAccelerationX(1), m_basicSpeedX(1), m_basicPositionX(1), m_gpsPositionX(1), m_kalmanAccelerationX(1), m_kalmanBiasX(1), m_kalmanSpeedX(1), m_kalmanPositionX(1)
{}
const Signal& Simulation::realAccel... |
#include "../inc/SEMD2Mesh.h"
#include <cstdio>
template <class T>
bool SEMD2Mesh<T>::loadBufferFromFile(std::string f, uint32_t i)
{
FILE *fp; // ponteiro de arquivo
tMD2 *header; // header do modelo
char *buffer; // buffer dos frames
tMD2Frame<T> *frame; // frame temporário
tMD2Vertex *ptrverts; ... |
#include <iostream>
#include <fstream>
#include <string>
#include "wordfinder.h"
using namespace std;
int main()
{
WordFinder wf;
ifstream file("in.txt");
cout<<(file.is_open()?"opened in.txt file":"input file doesn't open")<<endl;
ofstream out("out.txt");
cout<<(out.is_open()?"opened out.txt file... |
#ifndef COMMANDS_H_
#define COMMANDS_H_
#include <string>
#include "Triggers.h"
using namespace std;
class Commands: public Triggers{
public:
Commands();
string getCommand();
void setCommand(string);
private:
string command;
};
#endif |
#include "login_form.h"
#include "complex_form.h"
using namespace mmcomplex;
void login_form::auth_do()
{
String^ login = L"admin\n";
String^ password = L"admin\n";
bool auth = true;
if (edit_login->Text == L"" || edit_password->Text == L"")
{
edit_login->Text = L"Введите логин и пароль!";
auth = false;
}
... |
//
// Created by 송지원 on 2019-11-13.
//
#include "iostream"
using namespace std;
int main() {
int i,j, N;
long long D[91][2];
D[1][0] = 0;
D[1][1] = 1;
cin >> N;
for (i=2; i<=N; i++) {
D[i][0] = D[i-1][0] + D[i-1][1];
D[i][1] = D[i-1][0];
}
cout << D[N][0] + D[N][1] ... |
#pragma once
#include <vector>
// 需要尽量高效的插入和删除
// 需要方便的找到最大元素
#include <set>
#include <string>
#include <functional>
#include <sys/select.h>
#include "tcp_socket.hpp"
bool operator<(const TcpSocket& lhs, const TcpSocket& rhs)
{
return lhs.GetFd() < rhs.GetFd();
}
class Selector
{
public:
void Add (const TcpSo... |
#include "ResultScene.h"
#include "DxLib.h"
#include "Game.h"
#include "Peripheral.h"
#include "TitleScene.h"
#include <cmath>
const float waitTime = 30.0f;
const int defInterval = 60;
const int ShortInterval = 10;
void ResultScene::FadeinUpdate(const Peripheral & p)
{
_wait = max((_wait - 1), 0);
SetDrawBlendMode(... |
#include <bits/stdc++.h>
using namespace std;
void solve () {
int n;
cin >> n;
vector<int> s(n);
for (auto& it: s) cin >> it;
sort(s.begin(), s.end());
int ans = 1000;
for (int i=1; i<n; ++i) {
ans = min(ans, abs(s[i] - s[i-1]));
}
cout << ans << endl;
}
int main()
{
ios::sync_with_stdio(0)... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2012 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* The idea for this class is arjanl's (arjanl@opera.com), faithfu... |
/**
* Copyright (c) 2022, 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 condi... |
/*
* Array-based Stack
*
*/
#ifndef STACK_H
#define STACK_H
template <typename E>
class Stack {
public:
Stack(int maxsize = 0);
void push(E e);
bool isEmpty() const { return size == 0; }
E pop();
E last() const { return stack[size-1]; }
private:
E* stack;
int size;
int maxSize;
void resize(int newSize);
};
... |
#pragma once
#include "proto/ss_base.pb.h"
#include "proto/processor.hpp"
#include "utils/server_process_base.hpp"
namespace ps = proto::ss;
namespace nora {
namespace scene {
class common_resource : public proto::processor<common_resource, ps::base>,
public serv... |
#include <iostream>
using namespace std;
int main()
{
int i,j,max=1;
for(i=1; i<=5; i++)
{
cout<<""<<endl;
for(j=1;j<=max; j++)
{
cout << "*"<<endl;
}
max++;
}
return 0;
}
|
#include <memory>
#include "base/scheduling/scheduling_handles.h"
#include "base/scheduling/task_loop.h"
#include "base/threading/thread.h"
#include "base/threading/thread_checker.h"
#include "gtest/gtest.h"
namespace base {
class ThreadCheckerTest: public testing::Test {
public:
ThreadCheckerTest() = default;
... |
//====================================================================================
// @Title: STRING
//------------------------------------------------------------------------------------
// @Location: /prolix/common/include/xString.h
// @Author: Kevin Chen
// @Rights: Copyright(c) 2011 Visionar... |
#include "ParallelPrimeFinder.h"
void ParallelPrimeFinder::test(int min, int max)
{
omp_set_num_threads(MAX_THREAD_NUM);
try {
std::stringstream ss;
ss << name() << " (" << MAX_THREAD_NUM << " threads)";
printResult(ss.str(), measureTime(min, max));
}
catch (std::exception e) {
std::cerr << e.what() << ... |
#include "MxAudioSource.h"
#include "../../GameObject/MxGameObject.h"
#include "../RigidBody/MxRigidBody.h"
#include "../../Time/MxTime.h"
#include <fmod/fmod.hpp>
namespace Mix {
MX_IMPLEMENT_RTTI(AudioSource, Component);
void AudioSource::setMute(const bool _mute) {
if (mChannel)
mCh... |
#ifndef MODELPARAMETERS_H
#define MODELPARAMETERS_H
/**
* @brief The ModelParameters class
*/
class ModelParameters
{
public:
/// The slope of the ground (radians)
double slope;
/// Our gravitational constant (or is it?)
double g;
/// These lengths represent the mass distribution of the leg seg... |
#ifndef EXEC_HOLDER_HPP_INCLUDED
#define EXEC_HOLDER_HPP_INCLUDED
#include <elfio/elfio.hpp>
#include <cstdint>
class ExeHolder {
// begin of aligned storage
void *AllocPtr;
uint64_t Base;
int PageSize;
int RetCode;
void memoryInitSegment(const ELFIO::segment &S, int AllocSize);
public:
ExeHolder():
... |
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#inc... |
//算法:DP(单调队列维护)
/*
简单的转移方程式: f[i]= max (f[i-r,i-r])+a[i]
但是n方复杂度对200000的数据量来说,就是送命的
优化:
要找到区间[i-r,i-l]内的最大值,
可以用优先队列,但是(nlogn)还是慢了些
这时候复杂度为(n)的单调队列登场了
将f数组先初始化为极小值
因为琪露诺可以移动到[i+l,i+r]区间内的点
则除[1,l-1]外,其他任何点都可到达
则计算f[i]时,从l开始枚举即可,不需要考虑到不了的点
(因为他们不会被更新,f永远是极小值)
每次都将i-l放入单调队列,并进行维护
并依次删去队首k+r<i的,即到达不... |
/**
* Copyright 2015 ViajeFacil
* @author Hugo Ferrando Seage
*/
#ifndef DIALOGINFORME_H
#define DIALOGINFORME_H
#include <QDialog>
#include <string>
#include "./pelVector.hpp"
#include "./owner.hpp"
#include "./entradaHistorial.hpp"
namespace Ui {
class dialogInforme;
}
struct rank {
std::string name = ""... |
#include "_pch.h"
#include "MoveObjPresenter.h"
using namespace wh;
//-----------------------------------------------------------------------------
CtrlMoveExecWindow::CtrlMoveExecWindow(
const std::shared_ptr<IMoveObjView>& view
, const std::shared_ptr<ModelMoveExecWindow>& model)
: CtrlWindowBase(view, model)
{
... |
#pragma once
class DBUserManager : public CMultiThreadSync<DBUserManager>
{
public:
DBUserManager();
~DBUserManager();
private:
std::vector<DBUser*> m_UserSessionVector;
SOCKET m_ListenSocket;
public:
BOOL Begin(DWORD maxUserCount, SOCKET listenSocket);
BOOL End(VOID);
BOOL AcceptAll(VOID);
BOOL WriteA... |
#pragma once
#include <string>
namespace dot_pp {
struct NullConstructionPolicy
{
void createGraph(const std::string&) {}
void createDigraph(const std::string&) {}
void createVertex(const std::string&) {}
void createEdge(const std::string&, const std::string&){}
... |
#include<bits/stdc++.h>
using namespace std;
#define maxn 10005
int n;
int t[maxn];
int ans[maxn];
int ind;
void solve(int l,int r){
if(r-l<2)
return;
ind=l;
for(int i=l;i<=r;i+=2){
t[ind++]=ans[i];
}
for(int i=l+1;i<=r;i+=2){
t[ind++]=ans[i];
}
for... |
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <conio.h>
int main()
{
int curfl = 0, destfl, floor;
float high, speed;
float time1;
high = 3.0; // Height of the floor
speed = 5.0; // Speed of the elevator per second
while(1)
{
printf("Currently the elevator is at floor nu... |
#ifndef REL_OP_H
#define REL_OP_H
#include "Pipe.h"
#include "DBFile.h"
#include "Record.h"
#include "Function.h"
#include <sstream>
class RelationalOpThreadMemberHolder{
public:
Schema *mySchema;
Pipe *inPipe;
Pipe *outPipe;
CNF *selOp;
DBFile *inFile;
Record *literal;
int numAttsInput;
int numAttsOutput;
i... |
#include <TMRpcm.h>
#include <SD.h>
#include <SPI.h>
TMRpcm tmrpcm;
long k = 0;
int skipDay = 0;
int shamash = 2;
int candle1 = A0;
int candle2 = A1;
int candle3 = A2;
int candle4 = A3;
int candle5 = A4;
int candle6 = A5;
int candle7 = 8;
int candle8 = 3;
int dayUp = 5;
int dayDown = 6;
int day = 1;
int tempRead ... |
//
// RockManage.h
// GetFish
//
// Created by zhusu on 15/3/11.
//
//
#ifndef __GetFish__RockManage__
#define __GetFish__RockManage__
#include "cocos2d.h"
#include "Rock.h"
#include "ActorManage.h"
USING_NS_CC;
class RockManage : public ActorManage
{
public:
CREATE_FUNC(RockManage);
RockManage();... |
#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... |
#include "mopology.hpp"
cv::Mat rectSE( const int size )
{
return cv::Mat( size, size, CV_8UC1, cv::Scalar( 255 ) );
}
cv::Mat rectSE( const int x, const int y )
{
return cv::Mat( x, y, CV_8UC1, cv::Scalar( 255 ) );
}
cv::Mat crossSE()
{
return ( cv::Mat_<uchar>( 3, 3 ) << 0, 255, 0, 255, 255, 255, 0, 25... |
#pragma once
#include "constants.h"
#include "Model.h"
#include "constants.h"
#include <string>
#include <vector>
class Fish :public Model {
public:
Fish::Fish(std::string path, float radius, float offset_x, float offset_y , float offset_z, bool R_direction, int max_deviation);
Fish::Fish();
float radius;
int ... |
//
// main.cpp
// GardenOfEden
//
// Created by Russell Lowry on 12/5/17.
// Copyright © 2017 Russell Lowry. All rights reserved.
//
#include <iostream>
#include <stdio.h>
using namespace std;
int func[8];
int target[50], origin[50];
int ID, n, found;
char s[50];
void depthFirstSearch(int var) {
if(fou... |
// Auduino Grain oscillator
//
// by Peter Knight, Tinker.it http://tinker.it,
// Ilja Everilä <saarni@gmail.com>
//
// ChangeLog:
// 18 Oct 2012: Attempt at optimizing 8bit multiplications
#include <avr/pgmspace.h>
#include "asm.h"
// Sine!
//
// _--_
// - - -
// -__-
//
static const uint8_t sine_loo... |
// Created on: 1995-09-18
// Created by: Bruno DUMORTIER
// 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 GN... |
#include<iostream>
#include<string>
using namespace std;
void myFunction1(int, char);
void breakDown(string, int); |
#include "_pch.h"
#include "globaldata.h"
#include "ViewActBrowser.h"
//#include "wxDataViewIconMLTextRenderer.h"
//#include "wxComboBtn.h"
//#include "config.h"
//#include <wx/uiaction.h>
using namespace wh;
//-----------------------------------------------------------------------------
//----------------------------... |
#include "Patrol.h"
#include <iostream>
Patrol::Patrol()
= default;
Patrol::~Patrol()
= default;
void Patrol::Execute()
{
std::cout << "Performing Patrol Action" << std::endl;
} |
// Created on: 1992-04-06
// Created by: Christian CAILLET
// 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 ... |
// Example 6.4 : std::string, std::string_view
// Created by Oleksiy Grechnyev 2020
#include <iostream>
#include <string>
#include <string_view>
//==============================
int main(){
using namespace std;
{
cout << "std::string :\n\n";
// Create string from C-string literal... |
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
class Solution {
public:
string largestNumber(vector<int>& nums) {
//基本思想:排序,将先将nums中数字转为字符串保存到ans,然后对ans排序
//排序算法是将两个字符串正反拼接后比较大小,这正好是题目所要求的返回最大拼接的字符串
string res;
vector<string> ans;
for (auto num : nums)
ans.pu... |
#ifndef CMESSAGEDATAMEDIATOR_H
#define CMESSAGEDATAMEDIATOR_H
#include <QObject>
#include <QMap>
#include <QMutex>
#include "../SMonitorServer/CNetMessage.h"
class CMessageDataMediator : public QObject
{
Q_OBJECT
public:
CMessageDataMediator(QObject *parent = 0);
~CMessageDataMediator();
static CMessageDataMedi... |
#include <iostream>
int serch(int* arr, int num, int begin, int end) {
if (num > arr[end]) {
std::cout << "number is not element of array: " << std::endl;
return 1;
}
if (num == arr[begin]) {
std::cout << "number is a element of array: " << begin + 1 << std::endl;
return 0;
... |
#ifndef _CancleBankerProc_H_
#define _CancleBankerProc_H_
#include "BaseProcess.h"
#include "Player.h"
#include "Table.h"
class CancleBankerProc : public BaseProcess {
public:
CancleBankerProc();
virtual ~CancleBankerProc();
virtual int doRequest(CDLSocketHandler *clientHandler, InputPacket *inputPacket... |
#include "stdafx.h"
#include "specmath.h"
#include <math.h>
#include <random>
#include <functional>
specrand specmath::sprand = specrand();
vec3 specmath::random_inside_unit_sphere()
{
float x = 2 * sprand.pull() - 1;
float y = 2 * sprand.pull() - 1;
float z = 2 * sprand.pull() - 1;
while (x*x + y * y + z * z > ... |
#pragma once
#include <vector>
#include <Windows.h>
namespace physmeme
{
NTSTATUS __cdecl map_driver(std::vector<std::uint8_t>& raw_driver);
NTSTATUS __cdecl map_driver(std::uint8_t * image, std::size_t size);
} |
#include <iostream>
#include <vector>
#include <ctime>
#include <ios>
#include <iomanip>
using namespace std;
int validar( string , vector<string> ) ;
string soliRegistro( vector<string> ) ;
vector<int> calificaciones() ;
int promedioNotas( vector<int> ) ;
void mostrarRegistro( vector<int> , vector<stri... |
int pin = 3;
char instruction;
int action = 0;
void setup(){
Serial.begin( 9600);
pinMode( pin, OUTPUT);
}
void loop(){
if ( Serial.available() > 0){
instruction = Serial.read();
if ( instruction == '1'){
digitalWrite( pin, HIGH);
}
else if ( instruction == '0'){
digitalWrite( ... |
// Author: Kirill Gavrilov
// Copyright (c) 2018-2019 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 So... |
/*Contains the Arduino Uno/atmega328 code for the board which controls the photogate and personnel gate open/closed sensors on the tower.
* This board has support for 6 photogate sensors that are high when open, and low when blocked. The following sensors are defined:
* SENSORS0 Register:
* TOP_TRIP_SENSOR - in... |
// Copyright (c) 2021 Hartmut Kaiser
//
// 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.txt)
#pragma once
#include <pika/config.hpp>
#include <pika/iterator_support/counting_iter... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "InteractorComponent.h"
#include "InteractableActor.h"
// Sets default values for this component's properties
UInteractorComponent::UInteractorComponent()
{
// Set this component to be initialized when the game starts, and to be... |
#pragma once
#include "components/component.hpp"
#include "utilities/global_set.hpp"
#include "point.hpp"
#include <unordered_set>
#include <cassert>
#include <string>
namespace item {
/// Properties of an item -- name of item, mass of item, material of item, etc.
struct ItemProperties {
std::string ... |
#ifndef BLUETANK_H
#define BLUETANK_H
class BlueTank
{
public:
BlueTank();
};
#endif // BLUETANK_H |
#include <stdio.h>
#include <iostream>
#include <math.h>
void selectionSort(int a[], int n) {
int i, j, min, temp;
for (i = 0; i < n - 1; i++) {
min = i;
for (j = i + 1; j < n; j++)
if (a[j] < a[min])
min = j;
temp = a[i];
a[i] = a[min];
a[min] = temp;
}
}
... |
#include <gtest/gtest.h>
#include "utl/bit_window.h"
#include "utl/log.h"
using namespace utl;
// TEST(BitWindow, Default)
// {
// bit_window bw;
// ASSERT_EQ(bw.check_and_update(0), true);
// ASSERT_EQ(bw.check_and_update(0), false);
// ASSERT_EQ(bw.check_and_update(31), true);
// ASSERT_EQ(bw.c... |
/**
widget.h
@author Dmytro Haponov
@version 1.2 3/08/15
*/
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
namespace Ui {
class Widget;
}
class Widget : public QWidget
{
Q_OBJECT
public:
explicit Widget(QWidget *parent = 0);
~Widget();
private slots:
void on_CreateDBbutt_clicked(... |
#include "GameObject.h"
GameObject::GameObject(): x(0), y(0) {
}
GameObject::~GameObject() {
}
void GameObject::update(int keyCode) {
}
void GameObject::render(Graphics& graphics) {
} |
/*
kamalsam
*/
#include<iostream>
#include<stack>
#include<string.h>
#include<ctype.h>
using namespace std;
int priority(char a)
{
switch(a)
{
case '+': return 1;
case '-': return 2;
case '*': return 3;
case '/': return 4;
case '^': return 5;
}
}
int main()
{
stack<char>a;
int size,i,j;
cin>>size;
c... |
/*
** EPITECH PROJECT, 2019
** OOP_indie_studio_2018
** File description:
** FileNotFoundException
*/
#ifndef FILENOTFOUNDEXCEPTION_HPP_
#define FILENOTFOUNDEXCEPTION_HPP_
#include <string>
#include "Exception.hpp"
class FileNotFoundException : public Exception {
public:
FileNotFoundException(const std::... |
#include "processor.h"
#include "linux_parser.h"
// TODO: Return the aggregate CPU utilization
float Processor::Utilization() {
// idea from https://stackoverflow.com/questions/23367857/accurate-calculation-of-cpu-usage-given-in-percentage-in-linux
long long Idle = LinuxParser::IdleJiffies();
long long No... |
#include "web_message_handler.h"
WebMessageHandler::WebMessageHandler()
{
}
WebMessageHandler::~WebMessageHandler()
{
}
void WebMessageHandler::startup(GameController* _game_controller)
{
pGameController = _game_controller;
}
void WebMessageHandler::processWebMessages(Document* document)
{
// Document* docum... |
#pragma once
#include "PhysicsInclude.h"
class Physics
{
public:
Physics();
~Physics();
//シミュレーション系
//bool PhysicsInit();
void PhysicsRelease();
void PhysicsUpdate(Vector3 Force, Vector3 Torque);
//Integrate系=========================
void Integrate(RigidbodyState &states, unsigned int numRigidbodys, float t... |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* LispC FuncExpression
* Represents a function call in the AST.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#pragma once
#include <vector>
#include "Expression.h"
namespace lispc
{
c... |
//
// 7576.cpp
// baekjoon
//
// Created by 최희연 on 2021/07/13.
//
#include <iostream>
#include <queue>
using namespace std;
int dx[4]={0, 0, 1, -1};
int dy[4]={1, -1, 0, 0};
int m, n, result = 0;
int tomato[1001][1001];
queue<pair<int, int>> q;
bool isIn(int x, int y){
if(x>=0&&x<n&&y>=0&&y<m)
return... |
/*
* TDrawingView.h
*
* Created on: Apr 11, 2017
* Author: Alex
*/
#ifndef TDRAWINGVIEW_H_
#define TDRAWINGVIEW_H_
#include "TView.h"
#include <cairo.h>
#include "TGraphics.h"
class TDrawingView: public TView {
public:
TDrawingView();
virtual ~TDrawingView();
public:
TCairoGraphics graphics;
Eva... |
#include "Snowflakes.h"
#include <cstdlib>
#include <ctime>
SnowflakeGenerator::SnowflakeGenerator(gfx::Canvas* canvasToSet, int nSnowflakes) :
Primitive (canvasToSet, 0, Color(255,255,255)),
_snowflakes(nSnowflakes)
{
srand(time(0));
{
int x, y;
for (int i = 0; i < nSnowflak... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.