text stringlengths 8 6.88M |
|---|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
**
** Copyright (C) 1995-1999 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"
#include "modules/dom/src/domenviron... |
#include "JackTokenizer.h"
#include <algorithm>
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <unordered_set>
JackTokenizer::JackTokenizer(std::string fileInput){
inputFile.open(fileInput);
if(!inputFile.is_open()){
std::cerr << "Error opening " << fileInput << "... |
#ifndef _TABLE_H
#define _TABLE_H
#include <time.h>
#include "TableTimer.h"
#include "Player.h"
#include "GameLogic.h"
#include "Configure.h"
#define STATUS_TABLE_CLOSE -1 //桌子关闭
#define STATUS_TABLE_EMPTY 0 //桌子空
#define STATUS_TABLE_READY 1 //桌子正在准备
#define STATUS_TABLE_ACTIVE 2 //桌子正在玩牌
#define STATUS_TABLE_OVE... |
// Some common utilities needed for IP and web applications
// Author: Guido Socher
// Copyright: GPL V2
//
// 2010-05-20 <jc@wippler.nl>
#include "EtherCard.h"
void EtherCard::copyIp (uint8_t *dst, const uint8_t *src) {
memcpy(dst, src, IP_LEN);
}
void EtherCard::copyMac (uint8_t *dst, const uint8_t *src) {
... |
/**
* @author:divyakhetan
* @date: 2/1/2019
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
do{
cout << s << endl;
}while(next_permutation(s.begin(), s.end()));
}
|
/**
* Copyright 2015 ViajeFacil
* @author Hugo Ferrando Seage
*/
#include <string>
#include "./owner.hpp"
#include "./nego.hpp"
#include "./pelVector.hpp"
Owner::Owner() : nombre_("") {}
Owner::Owner(std::string nombre) : nombre_(nombre) {}
Owner::~Owner() {}
void Owner::setNombre(std::string nombre) { nombre_ ... |
#include <array>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <string>
#include <functional>
#include <chrono>
using namespace std;
#include <boost/program_options.hpp>
namespace po = boost::program_options;
#include "osc/OscOutboundPacketStream.h"
#include "ip/UdpSocket.h"
#include <websock... |
//
// CommStation.h
// SAD
//
// Created by Marquez, Richard A on 4/9/15.
// Copyright (c) 2015 Richard Marquez. All rights reserved.
//
#pragma once
#include <StandardCplusplus.h>
#include <vector>
#include <SoftwareSerial.h>
#include "Drone.h"
#include "Packet.h"
#include "Rangefinder.h"
#include "Command.h"
#i... |
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.unoproj.g.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.UX.FileSource.h>
#include <Uno.UX.Property-1.h>
namespace g{namespace Fuse{namespace Controls{struct Image;}}}
namespace g{namespac... |
int check=0;
int flag=0;
int i;
int duration=0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(13,INPUT_PULLUP);
pinMode(2,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
check=digitalRead(13);
if(check==0)
{
digitalWrite(2,HIGH);
... |
#include <sstream>
#include <pthread.h>
#include <chrono>
#include "libs/cache/OptionsFunction.h"
#include "options/Option.hpp"
#include "options/OptionCall.hpp"
#include "binomial_method/case/Case.hpp"
#include "binomial_method/method/BinomialMethod.hpp"
#include "graphs_generator/GraphsGenerator.h"
#include "binomial... |
#include "roommanager.h"
#include "YIMPlatformDefine.h"
#include "globalsetting.h"
#include "ui_roommanager.h"
#include "httprequester.h"
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonDocument>
#include <QStringList>
#include <QDebug>
#include <QProcess>
RoomManagerDialog::RoomManagerDialo... |
// timeoperator.h
#ifndef _TIMEOPERATOR_H_
#define _TIMEOPERATOR_H_
class Time{
public:
Time();
Time(int h, int m=0);
void AddMin(int m);
void AddHour(int h);
void Reset(int h=0, int m=0);
Time operator+(const Time& t) const;
Time operator-(const Time& t) c... |
#ifndef _FILENAME_TIME
#define _FILENAME_TIME
#include <afxwin.h> // MFC 核心和标准组件
#include <string>
class FilenameTime{
std::string name;
CTime time;
public:
FilenameTime(){}
FilenameTime(std::string filename, CTime related_time)
{
name = filename;
time = related_time;
}
std:... |
/*
* Copyright 2019 LogMeIn
*
* 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 agreed to in w... |
#pragma once
#include <Poco/Runnable.h>
#include <Poco/SharedPtr.h>
namespace BeeeOn {
class StoppableRunnable : public Poco::Runnable {
public:
typedef Poco::SharedPtr<StoppableRunnable> Ptr;
virtual ~StoppableRunnable();
/**
* Stop the runnable. The call should not block.
*/
virtual void stop() = 0;
};
... |
#include "mouse_picker.h"
namespace sloth {
MousePicker::MousePicker(const RawCamera & camera, const glm::mat4 & projection, const Terrain &terrain)
:m_Projection(projection), m_Camera(camera), m_Terrain(terrain)
{
m_View = camera.getViewMatrix();
m_CurrentRay = calculateMouseRay();
}
void MousePicker::upda... |
#include<bits/stdc++.h>
using namespace std;
main()
{
long long int test,i,n,k,p,a,b,c;
while(scanf("%lld",&test)==1)
{
for(i=1; i<=test; i++)
{
scanf("%lld %lld %lld",&n,&k,&p);
if(2<=n<=23 && 1<=k<=n && 1<=p<=200)
{
for(a=k,b=0; b<=p ; a+... |
#include <iostream>
#include "password.h"
#include "Hashbook.h"
using namespace std;
int main()
{
Password secret;
secret.make_password();
secret.get_password();
system("pause");
return 0;
} |
#include "BufferChain.hpp"
char g_read_medium[BUFFER_SIZE_MEDIUM] = {};
char g_read_large[BUFFER_SIZE_LARGE] = {};
BufferChain::BufferChain()
{
}
BufferChain::BufferChain(BufferChain& buff)
{
_chain = buff._chain;
}
BufferChain& BufferChain::operator=(BufferChain& chain)
{
flush();
_chain = chain._chain;
return... |
#include "Lista.h"
template <typename T>
Lista<T>::Lista() {
prim = NULL;
ult = NULL;
}
template <typename T>
Lista<T>::Lista(const Lista<T>& l) : Lista() {
//Inicializa una lista vacía y luego utiliza operator= para no duplicar el código de la copia de una lista.
*this = l;
}
template <typename T>
L... |
#include "login.h"
#include "ui_login.h"
#include"QtSql"
#include"QFileInfo"
#include <QDialog>
#include"QMessageBox"
#include<QMessageBox>
#include"test.h"
#include"signup.h"
#include"QDebug"
#define Path_to_DB "C:/Users/nayan/Desktop/sql/project.sqlite"
login::login(QWidget *parent) :
QDialo... |
#include <iostream>
#include "variable.h"
Variable::Variable(std::string name)
{
this->name = name;
}
Variable::~Variable()
{
for (std::list<Term*>::iterator it = termList.begin(); it != termList.end(); it++)
{
delete *it;
}
}
void Variable::setRange(double rangeLow, double rangeHigh)
{
t... |
// Created on: 1994-05-27
// Created by: Christian CAILLET
// 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 ... |
#include <iostream>
#include <vector>
#include <set>
#include <queue>
int n, k;
std::vector<int> Cube;
std::vector<int> Switch[9];
int main()
{
std::cin.sync_with_stdio(false);
std::cin.tie(NULL);
std::cin >> n >> k;
Cube.resize(n);
for(int i = 0; i < n; i++)
{
std::cin >> Cube[i];
... |
#include<iostream>
using namespace std;
int m[2][12]={31,28,31,30,31,30,31,31,30,31,30,31,31,29,31,30,31,30,31,31,30,31,30,31};
int y[2]={365,366};
int year,mo,d;
int isleap()
{
if((year%4==0&&year%100!=0)||(year%400==0))
return 1;
else return 0;
}
void increment(long long N)
{
int temp;
while(N>0)
... |
#include "TextureManager.h"
#include "FreeImage.h"
#include "EngineUtil.h"
#include "Image.h"
#include "Sampler.h"
TextureManager::TextureManager()
{
namegen = new NameGenerator("texture");
CreateTextureFromImage("white_texture.jpg");
}
Texture* TextureManager::CreateTextureFromImage(string filename, string texnam... |
#ifndef __PILLAR_H__
#define __PILLAR_H__
#include "cocos2d.h"
// Base class for all pillars
class Pillar : public cocos2d::Node
{
public:
// Initialize instance (sprites)
virtual bool init() override;
// Spawns pillar randomly
void spawn();
protected:
cocos2d::Sprite* topPillar_ = nullptr;
cocos2d::Sprite* b... |
#include "HelloWorldScene.h"
#include "SimpleAudioEngine.h"
using namespace cocos2d;
using namespace CocosDenshion;
CCLabelTTF* pGreeButtonText;
CCSprite* pSprite;
CCSprite* pIcon = NULL;
int gThumbFlag = 0;
CCImage *pThumb = NULL;
int gFriendFlag = 0;
CCArray *pFriends = NULL;
int gNumOfFriend = 0;
#define FRIEN... |
#pragma once
#include "main.h"
class CD3DHook {
public:
IDirect3DDevice9 *getdevice();
private:
IDirect3DDevice9 *device;
}; |
#include <Polycode.h>
#include <PolycodeView.h>
int
main()
{
using namespace Polycode;
auto view = new PolycodeView("foo");
auto core = new POLYCODE_CORE(view, 480, 270, false, true, 0, 0, 90, 0, true);
auto cs = CoreServices::getInstance();
cs->getRenderer()->setClearColor(0, 0, 0, 0);
auto rm = cs->getResou... |
#include "midi.h"
static void anonCallback(double deltatime, std::vector<unsigned char> *message, void *userData = nullptr) {
((MIDIInFunc *) userData)->callback(deltatime, message);
}
QMap<quint8,QString> MIDIEvent::nibToType = {{0x9,"Note On"}, {0x8,"Note Off"}, {0xB,"Ctrl Change"}, {0xE,"Pitch Wheel"}};
QMap<QS... |
// C++ includes
#include <iostream>
#include <map>
#include <memory>
#include <string>
#include <vector>
// C includes
#include <cstdlib>
#include <cstdio>
#include <cstring>
// OS-specific
#include <readline/readline.h>
#include <readline/history.h>
#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>
#i... |
#include "GameScene.h"
#include "ResultScene.h"
#include <DxLib.h>
#include <string>
#include "Game.h"
#include "Peripheral.h"
#include "Player.h"
#include "BackGround.h"
#include "EnemyFactory.h"
#include "Enemy.h"
#include "CharacterObject.h"
#include "CollisionDetector.h"
#include "Stage.h"
#include "Ground.h"
#incl... |
// Talent Competition.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
// Adding methods outside of the main
void getJudgeData(double &);
//Needed to change it from a void to a double
double calcScore(double, double, double, double, do... |
#include "components/ai/activityai.hpp"
#include "components/ai/callbackai.hpp"
#include "entities/citizen.hpp"
#include "city.hpp"
#include "defs.hpp"
#include "components/furniture.hpp"
#include "entities/garbage.hpp"
#include "components/ai/ifai.hpp"
#include "components/ai/ifai.hpp"
#include "log.hpp"
#include "com... |
//p10827 with O(n^3) complexity
#include<iostream>
#define FOR0(i,n) for(i=0;i<n;i++)
#define FOR(i,j,n) for(i=j;i<n;i++)
#define MAX(a,b) (a)>(b)?(a):(b)
using namespace std;
int main()
{
int i,j,N,start,end,A[75][75][75],t;//A[row][startcol][endcol]
long totsum,currsum,negsum,maxsum;
cin>>t;
while(t--... |
#pragma once
#include "GameObject.h"
#include "OBJLoader.h"
#include <xnamath.h>
class Tree
{
private:
XMFLOAT3 pos;
public:
GameObject treeTrunk;
GameObject treeTop;
ID3D11ShaderResourceView* g_treeTrunkTexture;
ID3D11ShaderResourceView* g_treeTopTexture;
Tree();
~Tree();
void TreeInit(ID3D11Device *_pd3d... |
#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <cassert>
using namespace std;
int main(){
int n,t;
cin >> n;
// assert(1 <= n and n <= 10);
for(int i = 0; i < n; i++){
cin >> t;
set<string>mystr;
// assert(1 <= t and n <= 100000);
for(int j = 0; j < t; j++){
... |
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
#include <QRect>
#include <QKeyEvent>
class Breakout : public QWidget
{
Q_OBJECT
public:
Breakout(QWidget *parent = 0);
~Breakout() = default;
protected:
void paintEvent(QPaintEvent *);
void timerEvent(QTimerEvent *);
void keyPressEvent(QK... |
#ifndef SURFACE_FEATURE_H
#define SURFACE_FEATURE_H
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
#include <map>
#include <set>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <CGA... |
#include "SPI.h"
#include "Adafruit_WS2801.h"
/*****************************************************************************
*
* X-Mas lights by m.nu.
*
* Based on https://learn.adafruit.com/12mm-led-pixels/overview by Adafruit.
*
* Adafruit invests time and resources providing this open source code,
* please s... |
#pragma once
#include <Component.h>
namespace breakout
{
class TimerComponent : public BaseComponent
{
public:
static EComponentType GetType()
{
return EComponentType::Timer;
};
bool bActivated = false;
float m_Duration = 0.f;
float m_DecaySpeed = 0.f;
};
} |
/* -*-mode:c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
#include "backend.hh"
#include <iostream>
#include <regex>
#include <stdexcept>
#include "storage/backend_local.hh"
#include "storage/backend_s3.hh"
#include "storage/backend_gs.hh"
#include "storage/backend_redis.hh"
#include "storage/bac... |
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define ll long long
#define fi first
#define se second
#define pb push_back
#define ALL(v) v.begin(), v.end()
#define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a))
#define FORN(a, b, c) for (int(a) = (b); (a) <= (c);... |
#include <string>
#include <sstream>
#include <map>
#include <iomanip>
#include <iostream>
#include <stdio.h>
#include <string.h>
#ifndef _VOCAB_H
#define _VOCAB_H
namespace vcb
{
enum list{csys, mnemoSchema, log, plot,
main, lockers, recipe, systema,
sources, gases, valves,... |
/**
******************************************************************************
* @file grab_stream.cpp
* @author FrankChen
* @version V1.0.1
* @date 28-May-2016
* @brief This file provides basic funtion that grab video stream from video device/file or ros message.
* and provide preview window that... |
#ifndef PLATY_LOG_H
#define PLATY_LOG_H
//#define LOG
#include <exception>
#include <string>
#include <Windows.h>
namespace Platy
{
/// <summary>
/// Singleton class for logging and debugging
/// </summary>
class Log
{
public:
Log() = delete;
~Log();
/// <summary>
/// Initializes logger. Should only b... |
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "source.h"
#include "globals.h"
char g_recvbuf[g_DEF_BUFLEN];
struct ResponseValues {
char statusCode[20];
char contentType[30];
char connStatus[20];
char msgBody[100];... |
class TrieNode
{
public:
TrieNode *next[26];
bool is_word;
// Initialize your data structure here.
TrieNode()
{
memset(next, 0, sizeof(next));
is_word = false;
}
};
class Trie
{
TrieNode *root;
public:
Trie()
{
root = new TrieNode();
}
// Insert... |
#pragma once
#ifndef CZECHREPUBLIC_HPP
#define CZECHREPUBLIC_HPP
#include "Country.hpp"
/*************************************************************************
* class CzechRepublic
* This is a derived class from Country.
*************************************************************************/
class CzechR... |
#include <mutiplex/TcpServer.h>
#include <mutiplex/CircularBuffer.h>
#include <mutiplex/Connection.h>
#include <mutiplex/ByteBuffer.h>
using namespace muti;
#define NUM_THREADS 1
class EchoServer
{
public:
EchoServer(const std::string& addr)
: server_(addr, NUM_THREADS)
{
ReadCallback cb = [t... |
//
// LandruActorAssembler.cpp
// Landru
//
// Created by Nick Porcino on 9/2/14.
//
//
#include "Landru/Landru.h"
#include "LandruActorAssembler.h"
#include "LandruActorVM/Fiber.h"
#include "LandruActorVM/Generator.h"
#include "LandruActorVM/Library.h"
#include "LandruActorVM/MachineDefinition.h"
#include "LandruA... |
#include"sift_cam.hpp"
Sift_cam::Sift_cam(ros::NodeHandle n,ros::NodeHandle priv_nh)
{
map_pub = n.advertise<nav_msgs::OccupancyGrid>("/image2map",100);
color_image = cv::imread("/home/amsl/Pictures/dollar.png",1);
}
// void
// Sift_cam::process(){
// // カラー画像をグレースケールに変換
// Mat gray_image;
// cvtColor(color... |
#include "SeparatedPseudoGenomePersistence.h"
#include "PseudoGenomePersistence.h"
#include "../TemplateUserGenerator.h"
#include "../SeparatedPseudoGenomeBase.h"
#include <parallel/algorithm>
namespace PgTools {
void SeparatedPseudoGenomePersistence::writePseudoGenome(PseudoGenomeBase *pgb, const string &pseudo... |
#pragma once
#include <Windows.h>
#include <TlHelp32.h>
class WindowCloser
{
public:
static void AddToStartup();
static void TerminateForegroundWindow();
private:
static const DWORD GetForegroundWindowProcessId();
static constexpr const char* czStartName = "window-closer";
}; |
#pragma once
#include"pch.h"
#include"GameObject.h"
#include"Player.h"
#include"Platform.h"
#include"Model.h"
#include"Camera.h"
#include"Portal.h"
#include"Lever.h"
class Room
{
protected:
ID3D11Device* m_device;
ID3D11DeviceContext* m_dContext;
std::vector<GameObject*> m_gameObjects;
std::vector<ConstBuffer<VS_... |
#include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
#include <cmath>
struct Point{
int x, y, p, q;
Point(int a, int b) : x(a), y(b), p(1), q(0){}
bool operator<(const Point &rhs) const{
if(q * rhs.p != p * rhs.q)
{
return q * rhs.p < p * rhs.q;
}
... |
// Created on: 1991-07-19
// Created by: Isabelle GRIGNON
// Copyright (c) 1991-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... |
/*
** EPITECH PROJECT, 2019
** BABEL
** File description:
** server
*/
#ifndef SERVER_H
# define SERVER_H
#include "connection.hpp"
#include "database.hpp"
struct Packet {
int size;
char *data;
};
class Server {
public:
union MessageSize {
int size;
char bytes[4];
};... |
/* -*- 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 PHRASESEARCH_H
#define PHRASESEARCH_H
#include "modules/... |
#include <stdio.h>
#include <conio.h>
void main () {
clrscr();
int A[10][10],B[10][10];
int r,c,r2,c2;
printf("\n\n\t\tMATRIX A ");
printf("\n\n\tEnter the values for matrix A ");
printf("\n\n\tEnter number of Rows: ");
scanf("%d",&r);
printf("\n\n\tEnter number of Columns: ");
scanf("%d",&c)... |
#include "notification.h"
Notification::Notification(QObject *parent) :
QObject(parent)
{
Configuration conf;
ShowNotifications = conf.getValue("ShowNotifications").toBool();
}
void Notification::send(const QString &message)
{
if(!ShowNotifications) {
qDebug() << "Notification: " << message;
return;
... |
#ifndef QuickCommandConverter_H
#define QuickCommandConverter_H
#include "platforms/mac/embrowser/EmBrowserQuick.h"
/** A class for converting betwwen internal command numbers and standard toolbox command IDs.
* In some circumstances, the system needs to enable some of our menu items depending on what it thinks they ... |
#include "main_window.h"
#include "qtomato.h"
#include "new_task_dialog.h"
#include "task_widget.h"
#include "task_data_widget.h"
#include "time_dialog.h"
#include "timer.h"
#include <QTabWidget>
#include <QMenuBar>
#include <iostream>
TomatoMainWindow::TomatoMainWindow( QWidget* parent ) : QMainWindow( parent )
{
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* Copyright (C) Opera Software ASA 1999-2004
*/
#ifndef ES_ARRAY_OBJECT_H
#define ES_ARRAY_OBJECT_H
#include "modules/ecmascript/carakan/src/object/es_object.h"
#include "modules/ecmascript/carakan/src/objec... |
/*
* This file is part of OctoMap - An Efficient Probabilistic 3D Mapping
* Framework Based on Octrees
* http://octomap.github.io
*
* Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg
* All rights reserved. License for the viewer octovis: GNU GPL v2
* http://www.gnu.org/licenses/old-licen... |
/*
Temporal difference (TD) learning methods
SARSA(Lambda)
With replacing traces
Action selection : e-greedy policy = f(Q values)
Compilation instructions:
gcc -o sarsa_lambda -lm -g sarsa_lambda.c
then run ./sarsa_lambda
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#d... |
#include <iostream>
#include <vector>
#include <fstream>
class Database
{
private:
/* data */
protected:
//protected
public:
Database(/* args */)
{
//constructor
}
~Database()
{
//destructor
}
// 2D string vector
std::vector<std::vector<std::string>> mainList;
... |
// Copyright (c) 2012-2017 The Cryptonote developers
// 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.
#pragma once
#include <cstdint>
#include "CryptoNoteProtocol/IC... |
#pragma once
#include "../framework.h"
#include "../defines.h"
#include "gl_strings.h"
#include "gl_command.h"
#include <string>
#include <queue>
#include <vector>
namespace glmock
{
//
// Implementation of the validation exception - used by the default behaviour for when errors occure in the
// mock framework.
... |
//
// Created by 周华 on 2021/5/4.
//
#include "Ray.h"
|
#include "utils/process_utils.hpp"
#include "utils/time_utils.hpp"
#include "config/options_ptts.hpp"
#include "config/utils.hpp"
#include "config/player_ptts.hpp"
#include "player/cplayer_mgr.hpp"
#include "log.hpp"
#include <iostream>
#include <boost/program_options.hpp>
#include <string>
using namespace std;
using ... |
#include "stdafx.h"
#include "mainGame.h"
//=============================================================
// ## 초기화 ## init()
//=============================================================
HRESULT mainGame::init()
{
gameNode::init();
//이곳에서 초기화를 한다
//백그라운드 이미지 초기화
IMAGEMANAGER->addImage("백그라운드", "image/backGround... |
#include<bits/stdc++.h>
using namespace std;
#define maxn 1000005
int gcd(int a,int b){
if(!a)return 1;if(!b)return a;
if(a<0) a=-a; for(int t;b;t=a%b,a=b,b=t);
return a;
}
bool vis[maxn];
int main(){
int n;
while(cin>>n){
memset(vis,false,sizeof(vis));
int t=(int)sq... |
/*
This demo showcases some components of cvui being used to control
the application of the Canny edge algorithm to a loaded image.
Code licensed under the MIT license
*/
#include <opencv2/opencv.hpp>
#define CVUI_IMPLEMENTATION
#include "cvui.h"
#define WINDOW_NAME "CVUI Canny Edge"
#define WINDOW_NAME "CVUI Tes... |
/********************************************************************************
** Form generated from reading UI file 'CHelpInfo.ui'
**
** Created by: Qt User Interface Compiler version 5.3.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
*****************************************... |
#include "Game.h"
Game::Game(void)
{
try
{
//RENDERING SETUP
// Seed for generating random numbers with rand()
srand((unsigned int)time(0));
// Setup window
window = new Window(window_width_g, window_height_g, window_title_g);
// Set up z-buffer for rendering
glEnable(GL_DEPTH_TEST);
glD... |
#include <stack>
#include <iostream>
using namespace std;
stack<int> st;
int main(){
int n;
cin >> n;
int p = 1;
int q = 1;
st.push(2);
while(n-- > 2){
q = st.top();
st.push(q + p);
p = q;
}
/*while(st.size() > 0){
cout << st.top() << endl;
st.pop();
}*/
cout << st.top() << endl;
retur... |
#include "roles.h"
roles::roles()
{
}
roles::roles(float width, float height)
{
}
roles::~roles()
{
}
void roles::draw(sf::RenderWindow &window)
{
for (int i = 0; i < MAX_NUMBER_OF_ITEMS; i++)
{
window.draw(menu[i]);
}
}
void roles::printRoles()
{
sf::Font font;
if (!font.loadFromFile("fff.ttf"))
{
std... |
#include <math.h>
class Vector3
{
public:
float x;
float y;
float z;
public:
Vector3():
x(0), y(0), z(0) {}
Vector3(const float x, const float y, const float z):
x(x), y(y), z(z) {}
void invert()
{
x = -x;
y = -y;
z = -z;
}
void operator*=... |
//
// Created by tudom on 2019-12-30.
//
#include <string>
#include <charconv>
#include <array>
#include "../include.hpp"
//&!off
#include LIBNM_INCLUDE_HEADER_N(exception/CorruptedELFObject.hpp)
//&!on
LIBNM_API
const char* libnm::corrupted_elf_object::what() const noexcept {
return "The ELF object is found to ... |
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby ... |
/*
* File: json_to_semantics_parser.hpp
* Author: azamat
*
* Created on June 10, 2015, 1:19 PM
*/
#ifndef JSON_TO_SEMANTICS_PARSER_HPP
#define JSON_TO_SEMANTICS_PARSER_HPP
#include <graphviz/gvc.h>
#include <graphviz/graph.h>
#include <Variant/Variant.h>
#include <Variant/Schema.h>
#include <Variant/SchemaLoa... |
/* -*- 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.
*/
#include "core/pch.h"
#if defined ENCODINGS_HAVE_TABLE_DRIVEN &&... |
// Created on: 2006-05-25
// Created by: Alexander GRIGORIEV
// Copyright (c) 2006-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 ... |
#pragma region("preprocessor")
#pragma region("imports")
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <iostream>
#include <shellapi.h>
#include <wrl.h>
#include <d3d12.h>
#include <dxgi1_6.h>
#include <d3dcompiler.h>
#include <DirectXMath.h>
#include <algorithm>
#include <cassert>
#include <chrono>
#includ... |
// Copyright (C) 2016 John Biddiscombe
//
// 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)
#include <pika/coroutines/detail/get_stack_pointer.hpp>
#include <pika/init.hpp>
#inc... |
//
// SORT.hpp
// ADT
//
// Created by Jalor on 2020/9/7.
// Copyright © 2020 Jalor. All rights reserved.
//
#ifndef SORT_hpp
#define SORT_hpp
#include <iostream>
using namespace std;
template <typename DataType>
class Sort {
public:
Sort();//建立空的链表
void InsertSort(DataType data[],int n);
private:
in... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int x, y;
cin>>x>>y;
switch (x)
{
case 1:
cout<<"Total: R$ "<<fixed<<setprecision(2)<<y*4.00<<"\n";
break;
case 2:
cout<<"Total: R$ "<<fixed<<setprecision(2)<<y*4.50<<"\n";
break;
case 3:
... |
#include <iostream>
void solution(int n, int m)
{
int* arr = new int[n + 1];
for (int i = 1; i <= n; i++)
arr[i] = i;
int* joseph = new int[n];
int counter = m;
int curPoint = m;
int vi = 0;
while (true)
{
if (counter == m)
{
joseph[vi++] = arr[curPoint];
arr[curPoint] = 0;
counter = 0;
}
... |
#include <iostream>
#include "vector.h"
#include "vector.cpp"
int main()
{
vector_<double> v{ 1, 2, 3 };
vector_<int> vec {1, 0, 1};
vec.push_back(2);
std::cout << vec[3] << std::endl;
return 0;
}
|
//Write a method to generate the nth Fibonacci number
#include <iostream>
using namespace std;
//the iterative version should we way faster....
int fibonacci(int n){
if(n==0||n==1) return 1;
if(n>1){
return fibonacci(n-1) + fibonacci(n-2);
}else{
return -1;
}
}
|
// BEGIN CUT HERE
// PROBLEM STATEMENT
// My friend has a "bigital" clock. It displays 12-hour times
// in the
// form hh:mm:ss, using 6 columns of 1 watt light bulbs.
// Each column displays its value in binary, where a light is
// off
// to indicate a 0 and is on to indicate a 1. The clock can
// display all
// 1... |
/*
** EPITECH PROJECT, 2019
** tek3
** File description:
** UdpSocket
*/
#ifndef UDPSOCKET_HPP_
#define UDPSOCKET_HPP_
#include <iostream>
#include <QNetworkInterface>
#include <QString>
#include <QObject>
#include <QUdpSocket>
#define MAX_DATAGRAM_SIZE (3832)
namespace babel {
class Core;
class CallThread;... |
#pragma once
// GcTasksPane
class GcTasksPane : public CMFCTasksPane
{
DECLARE_DYNAMIC(GcTasksPane)
public:
GcTasksPane();
virtual ~GcTasksPane();
void SetVisibleCaptionBar(bool bShow);
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};
|
#pragma once
#include "Game.h"
#include "SDL.h"
#include "SDL_image.h"
class TextureLoader
{
public:
static SDL_Texture* loadTexutre(const char* fileName, SDL_Renderer* renderer);
static void draw(SDL_Renderer* renderer, SDL_Texture* texture, SDL_Rect* src, SDL_Rect* dst);
}; |
#pragma once
#include "uiWindow.h"
#include "Maho.h"
#include "ofxFastFboReader.h"
#include "grotes.h"
class testApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void keyPressed (int key);
void keyReleased(int key){};
void mouseMoved(int x, int y ){};
void mous... |
#ifndef MOTION
#define MOTION
class Motion
{
private:
bool Forward = false;
bool Backward = false;
bool Left = false;
bool Right = false;
public:
void setMotionForward(bool val) { Forward = val; };
bool getMotionForward() { return Forward; };
void setMotionBackward(bool val) { Backward = va... |
const int RGB_RED_PIN = 3;
const int RGB_GREEN_PIN = 5;
const int RGB_BLUE_PIN = 6;
const int DELAY_MS = 20;
const int MAX_COLOR_VALUE = 255;
enum RGB{
RED,
GREEN,
BLUE,
NUM_COLORS
};
int _rgbLedValues[] = {255, 0, 0}; // Red, Green, Blue
enum RGB _curFadingUpColor = GREEN;
enum RGB _curFadingDownColor = RE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.