text stringlengths 8 6.88M |
|---|
#include "game.h"
#include "scene.h"
#include "prefabs.h"
#include "engine/engine.h"
#include "engine/gui/imgui.h"
#include "engine/components/fps_camera.h"
#include "engine/components/viewport.h"
#include "engine/rendering/renderer.h"
#include "engine/math/math_tools.h"
#include "engine/tools/colors.h"
#include "tna... |
/*
* Copyright (c) 2006-2009 Erin Catto http://www.gphysics.com
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any pur... |
#ifndef _EVALUATOR_H
#define _EVALUATOR_H
#include <string>
#include <map>
#include <boost/shared_ptr.hpp>
#include <affine/affine.h>
namespace evaluator {
typedef const std::string& rstring;
typedef const std::string cstring;
typedef std::map<std::string, Affine> var_map;
struct expression;
typedef boost::shared_pt... |
#include <iostream>
#include <vector>
// #include <utility>
using namespace std;
int main() {
vector<long long> out;
pair<long long, long long> p;
while (cin >> p.first >> p.second) {
if (p.first > p.second) {
out.push_back(p.first - p.second);
}
else {
ou... |
/*************************************************************
* > File Name : hdu5391.cpp
* > Author : Tony
* > Created Time : 2019/05/16 16:11:02
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
bool isprime(int n) {
for (in... |
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "udp_server.h"
#include <windows.h>
#include <stdio.h>
boost::asio::io_service io_service;
BOOL CtrlHandler(DWORD fdwCtrlType)
{
switch (fdwCtrlType)
{
// Handle the CTRL-C signal. ... |
#include <opencv2/opencv.hpp>
#include <opencv2/face.hpp>
#include "drawLandmarks.hpp"
//#include "genlandmask.hpp"
#include "stdio.h"
#define D_USE_IPCAM 0
using namespace std;
using namespace cv;
using namespace cv::face;
char gc_landMaskInit = 0;
CascadeClassifier gm_faceDetector;
Ptr<Facemark> gm_facemark ;
... |
/* NO WARRANTY
*
* BECAUSE THE PROGRAM IS IN THE PUBLIC DOMAIN, THERE IS NO
* WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
* LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE AUTHORS
* AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
* WARRANTY OF ANY KIND, EITHER E... |
#include<iostream>
using namespace std;
#include<fstream>
#include<string.h>
class showcard
{
public:
showcard();// constrctor
// initialize each of the character to a specific address.
char * address(int b);//main function
//Enter an number, it would return an address.
//The number is created randomly.... |
#include "stdafx.h"
#include "base/nextai_string.h"
namespace NextAI
{
std::string StringUtil::ws2s(const std::wstring& ws)
{
//const char* curLocale = setlocale(LC_ALL, NULL);
//setlocale(LC_ALL, "en_US.UTF-8");
size_t _Dsize = 4 * ws.size() + 1;
char *_Dest = new char[_Dsize];
memset(_Dest, 0,... |
template <typename T>
Stack<T>::Stack(){
top = nullptr;
}
template <typename T>
Stack<T>::~Stack(){
while(top != nullptr){
pop();
}
}
template <typename T>
void Stack<T>::push(T element){
if(top == nullptr){
top = new Node<T>;
top->data = element;
top->next = nullptr;
return;
}
Node<T>* temp = new... |
#include<bits/stdc++.h>
using namespace std;
bool ispossible(string* input,int n,int m,int si,int sj,string s,int count,bool** visited)
{
if(si < 0 || si >= n || sj < 0 || sj > m)
{
return false;
}
if(visited[si][sj]==true)
{
return false;
}
if(input[si][sj] !=s[count])
{
return false;
}
return true;... |
#ifndef NPNNODEMGR_H
#define NPNNODEMGR_H
/// @file NpnNodeMgr.h
/// @brief NpnNodeMgr のヘッダファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2012 Yusuke Matsunaga
/// All rights reserved.
#include "YmTools.h"
#include "YmUtils/SimpleAlloc.h"
#include "NpnXform.h"
BEGIN_NAMESPACE_YM
class NpnNo... |
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
using namespace std;
/*
341181198809150011
11010119900307387X
150102199003075131
1222222222
11111111111111111111
150102200003075131
Corrent ID
Corrent ID
Corrent ID
Wrong ID
Wrong ID
Wrong ID
@公众号:一航代码
*/
int main()
{
... |
#include <map>
#include <boost/functional/factory.hpp>
#include "TaggerFactory.hpp"
#include "UnigramTagger.hpp"
#include "HMMTagger.hpp"
#include "MarkovTagger.hpp"
using std::map;
typedef boost::function<Tagger *(const Corpus& corpus)> factory_t;
static map<string, factory_t> factoryMap;
static void init_factory... |
#include "Hill.h"
void Hill::Encryption(string& mesaj, string& key)
{
int keyMatrix[3][3];
getKeyMatrix(key, keyMatrix);
int mesajVector[3][1];
getMesajVector(mesaj, mesajVector);
doMatrixCalc(mesaj, keyMatrix, mesajVector);
}
void Hill::Decryption(string& mesaj, string& key)
{
int keyMatrix[3][3];
getK... |
#include <algorithm>
#include <iostream>
#include <string>
/**
* Find the longest palindrome of substring
* But, this algorithm can find only odd number palindrome, so
* add # to string can find only even number palindrome. ex) abba -> ba#b#b#aa -> a#b#b#a -> abba
* s: input string
* a: the longest palindrome whi... |
#include <QTimer>
#include <QMessageBox>
#include <QLabel>
#include <cstdio>
#include <assert.h>
#include <iostream>
#include <vector>
#include "mainwindow.h"
#include "plot.h"
#include "../shared/protocol.h"
#include "log.h"
#include <stdio.h>
using namespace std;
MainWindow::MainWindow(uint32_t rate_K, uint32_t ch... |
#include "TexturedModel.h"
TexturedModel::TexturedModel()
{
}
TexturedModel::TexturedModel(RawModel model, Texture modelTexture) {
texture = modelTexture;
rawModel = model;
} |
#include "error.h"
class error_category_impl : public std::error_category
{
public:
virtual const char *name() const noexcept override final
{
return "unet";
}
virtual std::string message(int c) const override final
{
switch (static_cast<unet::error>(c)) {
case unet::error::already_open: return "Device is ... |
//**************************************************************************
//**
//** 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 <stdio.h>
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
using namespace cv;
using namespace std;
int main() {
Mat src;
String imageFile = "..\\..\\..\\test_data\\railway.jpg";
src = imread(imageFile, IMR... |
/**
* Universidad de La Laguna
* Escuela Superior de Ingeniería y Tecnología
* Grado en Ingeniería Informática
* Diseño y Análisis de Algoritmos
*
* Algoritmos constructivos y búsquedas por entornos
*
* @author Ángel Tornero Hernández
* @date 12 Abr 2021
* @file Task.cc
*
*/
#include "../inclu... |
// *****************************************************************
// 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 <stdio.h>
#include <math.h>
#include <conio.h>
int main ()
{
float a,b,c,S,p;
printf ( "Chieu dai canh a : ");
scanf ("%f",&a);
printf ( " Chieu dai canh b : ");
scanf ("%f",&b);
printf ( " Chieu dai canh c : ");
scanf ("%f",&c);
printf (" Chu vi tam giac : %f ", ( a+b+c));
p=(a+b+c)/2;
S=(sqrt)((p-a... |
#ifndef STATICMODELPART_H
#define STATICMODELPART_H
#include "json/json.h"
#include "elements/Vertex.h"
#include "elements/Material.h"
class StaticModelPart{
typedef std::vector<Vertex> VertexList;
typedef std::vector<GLuint> IndexList;
public:
StaticModelPart(const json::mValue& data);
do... |
#include<iostream>
#include<stdlib.h>
#include<helppilas.c>
using namespace std;
int main()
{
int i;
int cant;
pila p;
int dato;
inicializa(&p);
cout<<"Ingrese cantidad de nodos=";
cin>>cant;
while(i<=cant){
// Ingresan datos del nodo
cout << " Dame... |
#ifndef INC_LLkParser_hpp__
#define INC_LLkParser_hpp__
/**
* <b>SOFTWARE RIGHTS</b>
* <p>
* ANTLR 2.6.0 MageLang Insitute, 1999
* <p>
* We reserve no legal rights to the ANTLR--it is fully in the
* public domain. An individual or company may do whatever
* they wish with source code distributed with ANTLR or th... |
#include "DUIWinVer.h"
#include "DUITooltip.h"
#include <commctrl.h>
DUI_BGN_NAMESPCE
CDUITooltip::CDUITooltip()
{
m_hWndTooltip = NULL;
}
CDUITooltip::~CDUITooltip()
{
Uninstall();
}
BOOL CDUITooltip::Setup()
{
if(m_hWndTooltip != NULL
&& ::IsWindow(m_hWndTooltip))
{
return TRUE;
}
m_hWndTooltip = ::Cre... |
//#include "mpi.h"
//this line is only for implementation
#include "/usr/lib/openmpi/include/mpi.h"
#include "mpi_centralized_barrier.h"
#include <stdio.h>
#define ROUND 100
int main(int argc, char** argv){
int my_id, num_processors;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &num_processors);
MPI_Com... |
#ifndef VECTOR_H_INCLUDED
#define VECTOR_H_INCLUDED
#include <iostream>
class Vector{
public:
Vector(int len = 3, float* data = NULL);
Vector(const Vector& v);
~Vector();
friend float dotProduct(const Vector& a, const Vector& b);
friend Vector crossProduct(const Vector& a, const Vector& b); ... |
#ifndef FRINGE_H
#define FRINGE_H
#include<stack>
#include<queue>
#include<vector>
#include "Node.h"
template<typename T>
class Fringe : public std::queue<T>
{
private:
//
protected:
//
public:
void PutChildren(std::vector<T>);
};
#include "Fringe.hpp"
//
#endif // FRINGE_H
|
#pragma once
#include <iostream>
#include "COREFramework/CORETask.h"
#include "COREUtilities/COREConstant.h"
#include "COREDrive.h"
#include "ctre/Phoenix.h"
#include "VelocityPair.h"
namespace CORE {
class COREEtherDrive: public COREDrive {
public:
COREEtherDrive(TalonSRX* leftMotor1, TalonSRX* leftMotor2,
T... |
// #include<Arduino.h>
#include <wiring_private.h>
#ifdef __AVR_ATtiny13__
#define MOTOR_LEFT 0
#define MOTOR_RIGHT 1
#define BUZZER 2
#define CONTROL_PIN 3
#define DOOR_SWITCH 4
#else
#define MOTOR_LEFT 4
#define MOTOR_RIGHT 3
#define BUZZER 0
#define CONTROL_PIN 1
#define DOOR_SWITCH 2
#endif
#define LOCK_TIM... |
#ifndef LISTNODE_H
#define LISTNODE_H
template<class Node> class List;
template<class Node>
class ListNode{
friend class List<Node>;
public:
ListNode(const Node &);
Node getData() const;
private:
Node data;
ListNode<Node> *nextPtr;
};
template<class Node>
ListNode<Node>::ListNode(const Node &info):data(info), ne... |
#include <cstdlib>
#include <iostream>
#include <cmath>
using namespace std;
int main() //метод из книги Реброва О.Ю. "Статистический анализ медицинских данных"
{
setlocale(0, "");
int n; //количество объектов исследования
float r; // коэффициетн корреляции
float t; // t-критерий для данного количества степеней сво... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,d,e,f,y;
cin>>y;
while(1){
y++;
a=y/1000;
b=y/100;
c=b%10; d=y/10; e=d%10; f=y%10;
if(a!=c&&a!=e&&a!=f&&c!=e&&c!=f&&e!=f) break;
}
cout<<y<<endl;
return 0;
}
|
#include "CMaterialMgr.h"
#include <utility>
#include "IL/il.h"
#include "IL/ilu.h"
#include "IL/ilut.h"
#include <boost/foreach.hpp>
#include "CBaseEngine.h"
CMaterialMgr::CMaterialMgr(){
ilInit();
iluInit();
ilutRenderer(ILUT_OPENGL);
}
Material* CMaterialMgr::getPersistentMaterial(const S... |
/***************************************************************************
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... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using pi = pair<int, int>;
#define f first
#define s second
#define mp make_pair
void setIO(string name = "moobuzz") {
... |
class Solution {
public:
bool check(int num[],int target[]){
bool ans=true;
for(int i=0;i<26;i++)
if(num[i]<target[i]){
ans=false;
break;
}
return ans;
}
vector<int> findAnagrams(string s, string p) {
vector<int> ans;
... |
#ifndef __STACK_H__
#define __STACK_H__
#include <iostream>
using namespace std;
typedef struct node {
int data;
struct node* next;
} NODE;
class Stack {
NODE* top;
int size;
public:
Stack() {
top = NULL;
size = 0;
}
~Stack() {
if (top != NULL) {
NODE... |
//
// Created by artim on 15.06.2020.
//
#include "Client.h"
Client::Client(const string& ip_address)
{
if (this->socket.connect(ip_address.c_str(), 5000))
{
//throw std::string("Либо сервера не существует, либо проверьте подключение!");
}
}
void Client::send(Message &msg)
{
this->socket.sen... |
#include<bits/stdc++.h>
using namespace std;
int n;
int cur[100010];
int main(){
scanf("%d",&n);
int p=0;
for(int i=0;i<n;i++){
int t;
scanf("%d",&t);
while(t--) cur[p++] = i;
}
int k = 0;
for(int i=0;i<n;i++){
k = max(cur[i]-i,k);
}
long long ans = 0ll;
for(int i=0;i<n;i++){
int de... |
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <stdexcept>
#include <unordered_map>
#include "City.hpp"
#include"Color.hpp"
#include "Board.hpp"
using namespace std;
using namespace pandemic;
Board::Node::Node(const std::string &color, const std::string &city, set<Ci... |
/**
* @File mcts_alg/mcts_simulator.cpp
* @Brief file_description
* Details:
* @Author guohainan
* @Version v0.0.1
* @date 2017-09-10 15:46:11
*/
#include "mcts_alg/mcts_simulator.h"
#include <stdlib.h>
#include <math.h>
#include <time.h>
using namespace gomoku;
namespace mcts_alg
{
/**
* 判断最后谁赢了局面
* 返回胜... |
#include <iostream>
#include <string>
using namespace std;
int main() {
//Grabbing the word to reverse
string word;
cout << "Enter the string to reverse: ";
cin >> word;
//Printing out the letters in reverse by integrating the string in reverse, then printing it.
for (int i = word.size() -1; i >... |
#include "..\Include\StorerForEllipse.h"
#include "../Include/Ellipse.h"
void StorerForEllipse::save(Graph * g, ofstream & f)
{
f << "@" << endl;
f << g->getId() << endl;
f << g->getCenterPos().x << endl;
f << g->getCenterPos().y << endl;
f << g->getRadiusA() << endl;
f << g->getRadiusB() << endl;
f << g->getFi... |
#include "BitmapFile.h"
BitmapFile::BitmapFile(std::string FilePath)
{
std::ifstream inputFile(FilePath, std::ios::binary);
//doing a quick test above
if (!inputFile)
{
//exception of some sort?
Good = false;
lastErr = "Unable to open input file " + FilePath + "\n";
return;
}
//make sure we're at the ... |
#include "WaterFactory.h"
std::shared_ptr<IDrink> WaterFactory::create()
{
return std::make_shared<Water>();
}
|
#ifndef NODE_H
#define NODE_H
class Node
{
public:
Node();
Node(char sign);
Node(int number);
Node(bool flag, char var);
Node(Node* expr);
int getAtomValue();
int getContNumb();
char getContChar();
Node* getNext();
void setNext(Node* next);
void setContExprNext(Node* next);... |
/* Copyright 2017 Istio Authors. All Rights Reserved.
*
* 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 applicab... |
#pragma once
#include "Types.h"
#include <Windows.h>
#include <string>
struct Win32FileContents {
long long Size;
unsigned char * Data;
};
std::string Trim(std::string str);
///<summary>Displays a Win32 meessage in human readable form</summary>
///<param name="Code">The error code to process</param>
void Display... |
class Solution {
public:
int minCostClimbingStairs(vector<int>& cost) {
int n = cost.size();
if(n == 0) return 0;
if(n == 1) return cost[0];
if(n == 2) return min(cost[0], cost[1]);
int a = cost[0];
int b = cost[1];
for(int i = 2; i < n; i++)
{
... |
#ifndef JUEGO_H
#define JUEGO_H
#include <SFML/Graphics.hpp>
#include "Nave.h"
#include "AST.h"
#include "Bala.h"
#include "Puntaje.h"
#include "Leer.h"
#include "Game_Over.h"
#include <vector>
#include <list>
#include "Entidad.h"
using namespace std;
class Juego
{
public:
Juego(sf::Rend... |
#include <stdint.h>
#include "interface.hh"
#include <bitset>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <cstdlib>
#include <set>
/* PREFETCHER INTERFACE */
struct PrefetchDecision
{
explicit PrefetchDecision()
: prefetchAddresses() { /*empty */}
explicit Pref... |
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ok() puts(ok?"Yes":"No");
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
ty... |
#include <primitives/sphere.h>
#include <math/ray.h>
#include <math/bounds.h>
Sphere::Sphere(const glm::vec3 &origin, float radius)
: m_origin(origin)
, m_radius(radius)
, m_radiusSq(radius*radius)
{}
float Sphere::area() const
{
return 4.0f*Pi*m_radiusSq;
}
AABB Sphere::bounds() const
{
return {m_origin-vec3(m... |
//
// Copyright Jason Rice 2016
// 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)
//
#ifndef NBDL_FWD_BIND_MAP_HPP
#define NBDL_FWD_BIND_MAP_HPP
#include <nbdl/concept/BindableMap.hpp>
namespace nbdl {
struct b... |
// description: defines a class for repetitive structure detection
// Time: 11/25/2014
// Author: Sway
// Organization: Institue of Automation, Chinese Academy of Science
#ifndef GTS_REPETITIVESTRUCTURE_H
#define GTS_REPETITIVESTRUCTURE_H
#include"ui_gts_repetitiveStructure.h"
#include"gts_paintWidget.h"
#include<Q... |
#include "UnitTests.h"
#include "Utilities.h"
#include "AudioEngineAPI.h"
int TestSimpleOsc(int algoId)
{
//Create oscillator
int oscId = ::createElaborationUnit(BASIC_EU_FACTORY, VIRTUAL_EU_CATEGORY, 0, -1);
//Create DirectSound
int dsId = ::createElaborationUnit(INOUT_EU_FACTORY, PHYSICAL_EU_CATEGORY,... |
#ifndef GEOMETRYRENAMEDIALOG_H
#define GEOMETRYRENAMEDIALOG_H
#include "SelfDefObject/QFDialog.h"
namespace Ui
{
class DialogRename;
}
namespace Geometry
{
class GeometrySet;
class GeoComponent;
}
namespace DataProperty
{
class DataBase;
}
class QTreeWidgetItem;
namespace MainWidget
{
class GeometryRenameDi... |
#ifndef NOISE2_H_
#define NOISE2_H_
#include "Types.h"
#include <cmath>
namespace revel
{
class Noise2
{
public:
inline double findnoise2(double x,double y)
{
int n=(int)x+(int)y*57;
n=(n<<13)^n;
int nn=(n*(n*n*60493+19990303)+1376312589)&0x7fffffff;
return 1.0-((double)nn/1073741824.0);
}
inline doub... |
#include <iostream>
#include <cstdio>
//#include <bits/stdc++.h>
#define Inf 0x3f3f3f3f
#define Neinf 0xc0c0c0c0
using namespace std;
int t[100005]={0};
int main()
{
//freopen("./in.txt", "r", stdin);
//freopen("./out.txt", "w", stdout);
ios::sync_with_stdio(0);
cin.tie(0);
for(int i=1;i<=100000;... |
#include <iomanip>
#include <iostream>
int inumber, in, is, id, isqr; double il;
using namespace std;
int prost(int inumber, int in)
{
for (is = 1; is < sqrt(in); is++)
{
if (in % is == 0)
{
id += 1;
}
if (id > 1 && is <= sqrt(in))
{
return id=0;
}
}
return id = 1;
}
int main()
{
setlocale(LC_... |
#pragma once
#include "library.h"
class Bullet
{
private:
//Variables
sf::Sprite sprite;
sf::Vector2f direction;
float bulletSpeed;
public:
Bullet();
Bullet(sf::Texture* texture, float pos_x, float pos_y, float dir_x, float dir_y, float bullet_speed);
~Bullet();
//Accessor
const ... |
#pragma once
#include "Light.h"
namespace gg {
class SpotLight :
public Light
{
private:
SpotLight() {}
protected:
SpotLight(
vmath::vec3 _position,
vmath::vec3 _coneCenter,
vmath::vec3 _color,
vmath::vec3 _ambient,
float _spotCos,
float _spotExp,
float _c,
float _l,
float _q
... |
#include <iostream>
using namespace std;
int main()
{
//övning 4.5 (prioritetsordning) sidan 60
//int tal = 5+(6%4); = 7
int tal = 5+6%4; // = 7
int tal = (5+6)%4; // = 3
/*
// exempel 4.2 på sidan 55
int tid = 800; //800 sekunder
int min = tid/60; //antalet hela minuter som rymms i 80... |
/**this is the main code for your LED Matrix device.
* It makes use of the MD_MAX72XX Library, so make sure to include it
* This works for the 24x8 LED Matrix by Skippy and Wickie, created during the PFF 2019 Mosaik
* Because that chip is not like any other system in the library, the code wont work on other MAX72... |
#ifndef ENEMY_H_INCLUDED
#define ENEMY_H_INCLUDED
#include "circ_hitbox.h"
#include "enemy_data.h"
//MODIFIED FROM MOVER MODULE
enum ENEMY_STATE{
ENEMY_NOT_END,
ENEMY_KILLED,
ENEMY_FINISHED
};
enum ENEMY_DIRECTION{
ENEMY_RIGHT,
ENEMY_DOWN,
ENEMY_LEFT,
ENEMY_UP
};
float type_scale(ENEMY_... |
class collisionCheck : public CybThread
{
private:
CybSphereTriangle *collisionObj;
CybParameters *cybCore;
int count;
public:
collisionCheck(int layerID, int interatorId)
{
collisionObj = new CybSphereTriangle(layerID, interatorId);
count = 0;
cybCore = CybParameters::getInstance();
this->setTime(5... |
#include <vector>
#include <experimental/random>
#include <ncurses.h>
#include "constants.h"
using namespace std;
// checks if food is consumed by the snake or not-- T/F
bool consume_food(int x, int y);
// prints the food items
void paint_food();
// initializes all the food items(here its set to 10)
void init_food()... |
#ifndef __VISITOR_H__
#define __VISITOR_H__
#include <memory>
class Element;
class Visitor
{
public:
virtual void order(std::shared_ptr<Element> element) = 0;
};
#endif // __VISITOR_H__
|
#pragma once
#include "data/processes.h"
#include "data/slice.h"
#include "data/data_fwrd.h"
#include "data/object_id.h"
#include "data/node.h"
#include "data/LocationSetup.h"
#include "plot/range.h"
#include "plot/screen.h"
#include "plottypes.h"
namespace nodes
{
class grader;
}
enum { buffer_width=1024, bu... |
#include <iostream>
using namespace std;
int main()
{
int hashmatTroops;
int enemyTroops;
int instances;
int difference;
cout << "Input number of instances: " << endl;
cin >> instances;
for(int i = 0; i < instances; i++)
{
cout << "Input number of Hasmat's troop... |
#ifndef LOGINWINDOW_H
#define LOGINWINDOW_H
#include <QDialog>
#include <QWidget>
#include <QFile>
#include <QIcon>
#include <QVariantMap>
#include "databasehandler.h"
namespace Ui {
class LoginWindow;
}
class LoginWindow : public QDialog
{
Q_OBJECT
public:
explicit LoginWindow(QWidget *parent = nullptr);
... |
#include "ScubaSoldier.h"
ScubaSoldier::ScubaSoldier(GVector2 pos) : BaseEnemy(eID::SCUBASOLDIER)
{
_sprite = SpriteManager::getInstance()->getSprite(eID::SCUBASOLDIER);
_sprite->setFrameRect(0, 0, 15, 30);
this->setPosition(pos);
}
ScubaSoldier::ScubaSoldier(float x, float y) : BaseEnemy(eID::SCUBASOLDIER)
{
_s... |
//@@author A0097681N
#pragma once
#include "..\CommandTokeniser.h"
class ConfigureCommandTokeniser : public CommandTokeniser {
public:
ConfigureCommandTokeniser(void);
virtual ~ConfigureCommandTokeniser(void);
virtual bool canTokeniseUserInput(std::string userInput) override;
virtual CommandTokens tokeniseUserInp... |
#include <functional>
#include <iostream>
int main()
{
std::function<bool(int, int)> greater{ std::greater<int>{ } };
std::cout << greater(1, 10) << '\n' << greater(20, 2) << '\n';
return 0;
}
|
//
// PocketTextElite - port of Elite[TM] trading system
// Copyright (C) 2008-2009 Michael Fink
//
/// \file MarketView.cpp Market view
//
// includes
#include "stdafx.h"
#include "resource.h"
#include "IMainFrame.hpp"
#include "MarketView.hpp"
#include "TextElite.hpp"
LRESULT MarketView::OnInitDialog(UINT /*uMsg*/,... |
/* NO WARRANTY
*
* BECAUSE THE PROGRAM IS IN THE PUBLIC DOMAIN, THERE IS NO
* WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
* LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE AUTHORS
* AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
* WARRANTY OF ANY KIND, EITHER E... |
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(int argc, char* argv[]) {
ifstream htmlFile;
string line = "";
string hilera = getenv("HTTP_COOKIE");
// Insertar header en el body
htmlFile.open("../html/headerInsert.html"... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#include <sstream>
#include <cmath>
#include<unordered_set> // 需要c++ 11才能支持
using namespace std;
/*
此题有另一个开拓思路的解法:
每个编号转化成二进制,于是发现,每个节点A的2个儿子节点的二进制表示,是A的二进制表示后,右边分别追加0和1.
把10进制数转化成二进制串,从高位到低位,找最长公共前缀。这个前缀转... |
#include<iostream>
using namespace std;
int main()
{
long long int t,i,n,arr[100000],count = 0,ans = 0;
cin>>t;
while(t--)
{
cin>>n;
for(i= 0;i < n;++i)
{
cin>>arr[i];
}
for(i = 0;i < n;++i)
{
if(arr[i+1] >= arr[i])
... |
#ifndef CAN_INTERFACE_H_
#define CAN_INTERFACE_H_
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "esp_log.h"
#include "esp_event.h"
#include "driver/gpio.h"
#include "driver/can.h"
#include "status.hpp"
#include "demo.hpp"
void can_init();
extern void can_transmit_t... |
#include "stdafx.h"
#include "operators.h"
#include "page_test.h"
#include "utilites/unittest.h"
class UNITTEST_SUITE( inserter_test )
{
Page *page;
void setUp()
{
page=0;
}
void tearDown()
{
delete page;
}
public:
UNITTEST( test_inserter )
{
page=Page... |
#include <iostream>
using namespace std;
void main()
{
//TASK 01//
int numb = 0;
cout << "Vvedit 6-tu znachne chislo" << endl;
cin >> numb;
if (99999 >= numb || numb > 999999)
cout << "Nevirnuy vvid" << endl;
else
if (numb % 10 + (numb / 10) % 10 + (numb / 100) % 10 == ((numb / 1000) % 10 + (... |
#include "Action.hpp"
bool operator==(Action& a1, Action& a2)
{
return (a1.decision == a2.decision) && (a1.amount == a2.amount);
}
|
#include "log.h"
#include "dominio.h"
#include "servicio.h"
#include "interfaz.h"
#include "util.h"
#include "configuracion.h"
#include "servicioAlias.h"
#include "EliminarAlias.h"
using namespace std;
int main(int argc, char *argv[]) {
//Inicializar el dominio
cDominio dominio;
if (!dominio.iniciar())
repo... |
//--------------------------------------------------------------
//--------------------------------------------------------------
//
// AngraSimulation HIT header file
//
// Authors: P.Chimenti
//
// 3-8-2009, v0.01
//
//--------------------------------------------------------------
//------------------------------... |
#include "ConfigFileEntry.h"
#include <string>
using namespace std;
ConfigFileEntry::ConfigFileEntry(string type_, string name_, string defaultValue_)
: type(type_), name(name_), defaultValue(defaultValue_)
{
}
void ConfigFileEntry::print()
{
cout << " " << name << ": " << "type: " << type << ", default: ... |
#include <iostream>
using namespace std;
int main()
{
int qntJogadores, qntRodadas, pontos;
cin >> qntJogadores >> qntRodadas;
int tabela[qntJogadores+1];
for(int i = 1; i <= qntJogadores; i++)
tabela[i] = 0;
for(int i = 0; i < qntRodadas; i++){
for(int j = 1; j <= ... |
/**
*
* @file ControlPointMap.cpp
* @author Naoki Takahashi
*
**/
#include "ControlPointMap.hpp"
#include <stdexcept>
namespace Kinematics {
template <typename Scalar>
ControlPointMap<Scalar>::ControlPointMap() {
access_map_mutex = std::make_unique<std::mutex>();
}
template <typename Scalar>
Contr... |
/*
* SPDX-FileCopyrightText: 2017 Rolf Eike Beer <eike@sf-mail.de>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include "osm2go_annotations.h"
#include "color.h"
#include "josm_presets_p.h"
#include "osm.h"
#include "pos.h"
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include ... |
/**********************************
进度框
***********************************/
#ifndef _PROCESSWINDOWBASE_H_
#define _PROCESSWINDOWBASE_H_
#include "moduleBaseAPI.h"
#include "dockWidgetBase.h"
#include <QList>
namespace GUI
{
class MainWindow;
}
namespace Ui
{
class ProcessWindow;
}
namespace ModuleBase
{
// class... |
#ifndef ENEMY_H
#define ENEMY_H
class Enemy{
private:
/* data */
float head[180*3*6];
float body[2*3*6];
float eyes[2*3*6];
public:
float centre[3];
Enemy(float x, float y ,float z);
void Move(float x, float y);
void SetCoordinates();
void Draw(unsigned int *t,unsigned int *VBO);
... |
/* Copyright (C) 2015 Willi Menapace <willi.menapace@gmail.com>, Simone Lorengo - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
* Written by Willi Menapace <willi.menapace@gmail.com>
*/
#ifndef CONSTANT_OUTPUT_ACTION_INCLUDED
#d... |
#ifndef _HS_SFM_ESSENTIAL_EMATRIX_5_POINTS_RANSAC_REFINER_HPP_
#define _HS_SFM_ESSENTIAL_EMATRIX_5_POINTS_RANSAC_REFINER_HPP_
#include <utility>
#include "hs_fit/ransac/ransac.hpp"
#include "hs_sfm/essential/ematrix_5_points_calculator.hpp"
namespace hs
{
namespace fit
{
template <typename _Scalar>
... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.ApplicationModel.Appointments.AppointmentsProvider.1.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Foundation {
#ifndef WINRT_GENERIC_5541d8a7_497c_5aa4_86fc_77... |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
struct node
{
int data;
node *left,*right;
};
node *insert(node *ptr,int n)
{
if(ptr==NULL)
{
ptr=new node;
ptr->data=n;
ptr->left=ptr->right=NULL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.