text stringlengths 8 6.88M |
|---|
#include <chuffed/branching/branching.h>
#include <chuffed/core/engine.h>
#include <chuffed/core/options.h>
#include <chuffed/support/misc.h>
#include <chuffed/vars/vars.h>
BranchGroup::BranchGroup(VarBranch vb, bool t) : var_branch(vb), terminal(t), fin(0), cur(-1) {}
BranchGroup::BranchGroup(vec<Branching*>& _x, Va... |
#include <iostream>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
template <typename T, typename U>
T mypow(T b, U n) {
if (n == 0) return 1;
if (n == 1) return b % MOD;
if (n % 2 == 0) {
return mypow(b * b % MOD, n / 2);
} else {
return mypow(b, n - 1) * b % M... |
#include "ART.h"
ART::ART() : m_vconf("Data//WDM_camera_flipV.xml"),
m_cparam_name("Data//camera_para.dat"),
m_num_patt(0), m_thresh(100), m_pImage(NULL)
{
// set the initial camera parameters //
if( arParamLoad(m_cparam_name, 1, &m_wparam) < 0 ) {
printf("Camera parameter load error !!\n");
exi... |
#include "book.h"
using namespace std;
Book::Book(const std::string category, const std::string name, double price, int qty, std::string author, std::string isbn) :
Product (category, name, price, qty) {
author_ = author;
isbn_ = isbn;
name_ = name_;
}
Book::~Book() {
}
std::set<std::string> Book::ke... |
//===- NVPTXSplitBBatBar.cpp - Split BB at Barrier --*- C++ -*--===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-----------------------------------------------------------------... |
#include "Vampire.h"
Vampire::Vampire(const std::string& name, const std::string& type, const std::string& mutation, int health, int damage, bool isUndead) : Unit(type, new VampireState(name, health, damage, isUndead), new VampireAttack(), mutation) {
std::cout << " creating Vampire " << std::endl;
}
Vampire::~Va... |
// Example 10.3 : CTPL thread pool.
// Note: You must load git modules, see the root README.md !
// Created by Oleksiy Grechnyev, IT-JIM 2020
#include <iostream>
#include <sstream>
#include <vector>
#include "ctpl_stl.h"
using namespace std;
//==============================
int main() {
cout << "Example 10.3 : ... |
#include <cstring>
#include <iostream>
#include <string>
#include <cstdio>
using namespace std;
string elem[110] ={ "",
"H","He","Li","Be","B","C","N","O","F","Ne",
"Na","Mg","Al","Si","P","S","Cl","Ar","K","Ca",
"Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu",
"Zn","Ga","Ge","As","Se","Br"... |
/*
* @lc app=leetcode.cn id=354 lang=cpp
*
* [354] 俄罗斯套娃信封问题
*/
// @lc code=start
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
int maxEnvelopes(vector<vector<int>>& envelopes) {
int n = envelopes.size();
if(n==0)return 0;
sort(... |
#ifndef SIGNUP_H
#define SIGNUP_H
#include <QDialog>
#include"login.h"
namespace Ui {
class signup;
}
class signup : public QDialog
{
Q_OBJECT
public:
QSqlDatabase mydb;
/*void connclose()
{
mydb.close();
mydb.removeDatabase(QSqlDatabase::defaultConnection );
}*/
... |
#include "../include/basic.h"
Permission::Permission()
{
;
}
Permission *Permission::getById(int value_)
{
std::list<Permission *> permissions = this->getAll();
for (const auto &item : permissions)
{
if (item->getID() == value_)
return item;
}
return nullptr;
}
std::list<... |
//
// Created by heze on 18-1-6.
//
#ifndef DATASTRUCTURE_HEADSORT_H
#define DATASTRUCTURE_HEADSORT_H
#include <iostream>
using namespace std;
//调整对,调整非叶节点a[h]使之满足最大堆,n为数组a的元素个数
template<typename DataType>
void CreatHeap(DataType a[], int n, int h){
int i, j, flag;
DataType temp;
i=h; //i为要建堆的... |
#include <Lights/LightRenderer.h>
CLightRenderer::CLightRenderer()
: _forceUpdate(false)
{
}
void CLightRenderer::addLight(const std::shared_ptr<CLight> &light)
{
if (light) {
_lights.push_back(light);
_forceUpdate = true;
}
}
void CLightRenderer::render()
{
unsigned index = 0;
fo... |
// Copyright (C) 2014, 2015, 2016 Alexander Golant
//
// This file is part of csys project. This project 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 3 of the License, or
// (at your... |
#pragma once
#include <iberbar/Renderer/Headers.h>
namespace iberbar
{
namespace RHI
{
class ITexture;
}
namespace Renderer
{
class __iberbarRendererApi__ CSprite
: public CRef
{
protected:
RHI::ITexture* m_pTexture;
CRect2f m_UV;
};
}
} |
/*
* @Description: NDT 匹配模块
* @Author: Ren Qian
* @Date: 2020-02-08 21:46:45
*/
#include "lidar_localization/models/registration/ndt_registration.hpp"
#include "glog/logging.h"
namespace lidar_localization {
NDTRegistration::NDTRegistration(const YAML::Node& node)
:ndt_ptr_(new pcl::NormalDistributionsTransf... |
#include "test_dynamic_array.h"
#include "dynamic_array.h"
#include <cassert>
#include <string>
#include <exception>
namespace tests::dynamic_array
{
void test_constructors()
{
int a[5] = { 1, 2, 3, 4, 5 };
DynamicArray<int> first(a, 5);
assert(first.GetCount() == 5);
assert(first.Get(0) == 1);
assert(first.Get(... |
#include "shapes.h"
#include <GL/freeglut.h>
#include <iostream>
//#include <QGLWidget>
using namespace std;
//int display;
Shapes::Shapes(){
}
void Shapes::axes(){
glLineWidth(1.0);
glBegin(GL_LINES);
glColor3f(1,0,0);
glVertex3f(0,0,0);
glVertex3f(3,0,0);
glColor3f(0,1,0);
... |
#include "Pass.h"
#include "Module.h"
#include "raw_ostream.h"
#include "PassManagers.h"
#include "PassAnalysisSupport.h"
#include "Pass.h"
#include "Function.h"
#include "BasicBlock.h"
#include <msclr/marshal_cppstd.h>
#include <string>
#include "utils.h"
using namespace LLVM;
Pass::Pass(llvm::Pass *base)
: base(ba... |
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
long j;
long long sum=2;
long long mas[j];
mas[0]=0;
mas[1]=1;
mas[2]=1;
cout<<"Введите номер числа фибоначии(не число - выход)=";
while(cin>>j)
{
for (long long i = 3; i <=j; i++)
mas[i]=mas[i-1]+mas[i-2];
//... |
/*
* @lc app=leetcode.cn id=886 lang=cpp
*
* [886] 可能的二分法
*/
// @lc code=start
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
bool possibleBipartition(int N, vector<vector<int>>& dislikes)
{
vector<int> father((N+1)*2+10, 0);
for(int i=1;i<(N+1)*2;i++)... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2011 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 "adjunct/quick_toolkit/widgets/Qu... |
#ifndef CLOCK_H
#define CLOCK_H
#include <memory>
#include <QMainWindow>
#include <QTimer>
#include <QPoint>
namespace Ui {
class Clock;
}
class Clock : public QMainWindow
{
Q_OBJECT
public:
explicit Clock(QWidget *parent = 0);
~Clock();
private:
void onTick();
void closeEvent(QCloseEvent* e)... |
#include <simplecpp>
main_program{
initCanvas("Projectile motion", 500,500);
int start = getClick();
Circle sp(start /65536, start % 65536, 5);
sp.penDown();
double vx=1,vy=-5;
repeat(100){
sp.move(vx,vy);
vy += .1;
wait(0.1);
}
getClick();
}
|
/**
* created: 2013-4-7 22:24
* filename: FKRandomPool
* author: FreeKnight
* Copyright (C):
* purpose:
*/
//------------------------------------------------------------------------
#include <windows.h>
#include "../Include/FKRandomPool.h"
#include "../Include/FKLogger.h"
#include "../Include/Network/FKPacke... |
#include <bits/stdc++.h>
#define MAX 105
#define INF 1<<30
using namespace std;
struct V
{
int u, w;
string s;
V(int a, int b, string c){u = a; w = b; s = c;}
};
struct comp
{
bool operator()(V a, V b){return a.w>b.w;}
};
int n, cost[MAX][MAX];
int dijkstra(char ori, char des);
string p;
int main()
{
... |
// Created on: 1993-06-23
// Created by: Jean Yves LEBEY
// Copyright (c) 1993-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 "stdafx.h"
#include "kdtree.h"
#include <stdio.h>
#include <malloc.h>
#include "minpq.h"
#include "feature.h"
#include "utils.h"
struct bbf_data
{
double d;
void* old_data;
};
static struct kd_node* kd_node_init(struct feature*, int);
static void expand_kd_node_subtree(struct kd_node*);
static struct kd_no... |
#ifndef ORBITALELEMENTS
#define ORBITALELEMENTS
class OrbitalElements
{
public:
double sma; // Semi-major Axis
double ecc; // Eccentricity
double inc; // Inclination (radians)
double lan; // Longitude of the Ascending Node (radians)
double aop; // Argument of Periapsis (radians)
double tra; // True Anomal... |
/* This is my first
cpp program
*/
// Do you remember what is identifier in CPP
#include <iostream>
using namespace std;
int main(){
float m;
//automatically defines n as int as input is an int
auto n=5;
float x;
//auto does not work in the below command as value for o is not defined
int o;
// pri... |
#include <opencv2/opencv.hpp>
#include <stdio.h>
#include <stdarg.h>
using namespace cv;
using namespace std;
void ShowManyImages(string title, int nArgs, ...);
|
#include "History.h"
#include <iostream>
using namespace std;
History::History(int nRows, int nCols)
{
m_Rows = nRows;
m_Cols = nCols;
for (int r = 0; r < m_Rows; r++)
{
for (int c = 0; c < m_Cols; c++)
Grid[r][c] = 0;
}
}
bool History::record(int r, int c)
{
if (r > m_Rows || c > m_Cols || ... |
#ifndef REACTOR_EXAMPLE_HTTP_SERVER_H
#define REACTOR_EXAMPLE_HTTP_SERVER_H
#include "../TcpServer.h"
#include "HttpContext.h"
namespace reactor {
namespace net {
namespace http {
class HttpHandler;
class HttpServer {
public:
HttpServer(EventLoop *loop, const InetAddress &addr, HttpHandler *handler):
loop_(loop)... |
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
int a[N], ma = 0;
for (int i = 0; i < N; ++i) {
cin >> a[i];
ma = max(ma, a[i]);
}
for (int i = 0; i < N; ++i) {
if (a[i] == ma) continue;
vector<int> stack;
int ... |
#ifndef _BINARY_SEARCH_TREE_H
#define _BINARY_SEARCH_TREE_H
namespace cs2420 {
template <typename T>
struct Node {
T info;
Node *left;
Node *right;
Node(T info) : info(info), left(nullptr), right(nullptr) {}
};
enum class Traversal { PRE_ORDER, IN_ORDER, POST_ORDER };
// Implemenation
temp... |
#define FUSE_USE_VERSION 26
#include "clientSNFS.h"
int clientSocket;
//assign functions in main
static struct fuse_operations fuse_oper = {
0,
};
//open
//
extern "C" int fuse_open(const char *path, struct fuse_file_info *fi)
{
int rc;
char msg[5000];
char response[5000];
strcpy(msg, "");
strcat(msg, "open "... |
// Created on: 1998-07-27
// Created by: Philippe MANGIN
// Copyright (c) 1998-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... |
//===========================================================================
//! @file shape_3D.h
//! @brief 3D形状
//===========================================================================
#pragma once
//! 形状種類
enum class ShapeType3D : int
{
None = 0, //!< 初期化用
Point, //!< 点
Sphare, ... |
#include<bits/stdc++.h>
#include <vector>
#include <iomanip>
#include "User.h"
#include "Player.h"
#include "Admin.h"
#include "Complete.h"
#include "MCQ.h"
#include "TF.h"
using namespace std;
vector<Admin>Alladmins;
vector<Player>Allplayers;
vector<Complete> complete;
vector<MCQ> mcq;
vector<TF> tf;
vector<int> sco... |
#ifndef COMPONENTE_H_INCLUDED
#define COMPONENTE_H_INCLUDED
using namespace std; // Para poder utilizar strings
// DEFININDO UMA CLASSE
/*abstract*/ class Componente{ // Como "Componente" deve ser uma Classe Abstrata , ao menos um de seus métodos deve ser “Pure Virtual” ...
... |
/*
* fsmPrioritization.cpp
*
* Created on: 2 de nov de 2016
* Author: damasceno
*/
#include <cstdio>
#include <iostream>
#include <cstring>
#include "lib/fsmLib.h"
#include <time.h>
using namespace std;
void printModel(FsmModel *fsmModel);
void printTest(FsmTestSuite *fsmTest);
int main(int argc, char **... |
#include "Button.h"
#include "GL\glew.h"
#include "../Systems/EventSystem.h"
#include "../Mains/Application.h"
#include "../Scene/MainMenu.h"
#include "../Systems/BattleSystem.h"
#include "../../Base/Source/Main/Engine/System/InputManager.h"
#include "../../Engine/System/SceneSystem.h"
Button::Button()
{
}
Button::... |
//Tree ADT
//각각 data node가 저장되어있는 position 기반, 계층구조
#include <iostream>
using namespace std;
#include <string>
//예외처리
//Array나 LinkedList나 다른 클래스 구현
template <typename E>
class Position<E> //기본 원소 타입
{
private:
public:
public:
E& operator*(); //원소를 구해라
Position parent() const; //부모 구하라
Posi... |
#include "Repository.h"
#include <string>
using namespace std;
int Repository::addDoggie(const Doggie& d)
{
Doggie dog = findDoggieByNameAndBreed(d.getName(), d.getBreed());
if (dog.getName() != "" && dog.getBreed() != "")
return 0;
this->doggies.add(d);
return 1;
}
void Repository::deleteDoggie(const std::str... |
#include<bits/stdc++.h>
using namespace std;
int n;
bool vis[20];
string str[10]={"0","1","2","3","4","5","6","7","8","9"};
int ans;
map<int,int> mp;
void dfs(string s,int d){
if(d==9){
for(int i=1;i<=7;i++){
string t=s.substr(0,i);
int a=atoi(t.c_str());
if... |
#ifndef SDUZH_REACTOR_NET_TIMER_ID_H
#define SDUZH_REACTOR_NET_TIMER_ID_H
#include <memory>
namespace reactor {
namespace net {
class Timer;
typedef std::weak_ptr<Timer> TimerId;
} // namespace net
} // namespace reactor
#endif
|
// Copyright (c) 2019, tlblanc <tlblanc1490 at gmail dot com>
#ifndef BUFFER_MSGBUFFER_H_
#define BUFFER_MSGBUFFER_H_
#include <algorithm>
#include "buffer.hpp"
#include "dispose_func.hpp"
#include "memio.hpp"
/// MsgBuffer provides a buffer implementation in which
/// the input is treated as a sequence of messages... |
#ifndef DIRECTED_REACHABILITY_H
#define DIRECTED_REACHABILITY_H
#include <chuffed/globals/graph.h>
#include <chuffed/support/lengauer_tarjan.h>
#include <chuffed/support/union_find.h>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
class FilteredLT : public Lengau... |
#ifndef AS64_QTPLOT_UTILS_H
#define AS64_QTPLOT_UTILS_H
#include <mutex>
#include <condition_variable>
namespace as64_
{
namespace pl_
{
class Semaphore
{
public:
void notify();
void wait();
bool try_wait();
private:
std::mutex mutex_;
std::condition_variable condition_;
// unsigned long count_ = 0; //... |
#include "Calculator.h"
Calculator::Calculator() {}
Calculator::~Calculator() {}
double
Calculator::plus(double left, double right)
{
return left + right;
}
double
Calculator::minus(double left, double right)
{
return left - right;
}
double
Calculator::divide(double left, double right)
{
return left / ... |
#include "../include/atomloader.h"
AtomLoader::AtomLoader(const std::string &_coords, const std::string &_properties)
{
std::vector<Point> centers = readAtomCoords(_coords);
std::vector<double> crippen = readCrippen(_properties);
std::vector<std::vector<double> > properties = readFeatures(_properties);
for(size_t... |
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <set>
#include <stack>
#include <cstdio>
#include <cstring>
#include <climits>
#include <cstdlib>
... |
#ifndef WALI_DOMAINS_REVERSED_SEM_ELEM_HPP
#define WALI_DOMAINS_REVERSED_SEM_ELEM_HPP
#include <limits>
#include <boost/function.hpp>
#include "wali/SemElem.hpp"
namespace wali
{
namespace domains
{
class ReversedSemElem
: public SemElem
{
private:
sem_elem_t backing_elem_;
public:
... |
// Created by: Kirill GAVRILOV
// Copyright (c) 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 Sof... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2009 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef MODULES_STYLE_STYLE_MODULE_H
#define MODULES_STYLE_STYLE_MODULE_H
#include "mo... |
#pragma once
#include <typelib/typelib.h>
#include <vtkPointSource.h>
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
#include <vtkPolyDataMapper.h>
#include <vtkActor.h>
#include <vtkLight.h>
#include <vtkLightCollection.h>
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <vtkRenderWindowInteract... |
#include "menucontroller.h"
int main()
{
(new MenuController())->menu();
return 0;
}
|
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
using namespace std;
int main()
{
freopen("choinon1.inp","r",stdin);
freopen("choinon1.out","w",stdout);
int a,b;
scanf("%d %d",&a,&b);
if(a>b){
printf("So lon nhat = %d",a)... |
//Phoneix_RK
/*
https://leetcode.com/problems/sort-array-by-parity/
Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A.
You may return any answer array that satisfies this condition.
*/
class Solution {
public:
vec... |
#include "../include/Label.h"
Label::Label()
{
}
Label::Label(sf::RenderWindow &window, sf::Texture imageTexture, sf::Vector2i labelPosition)
{
m_window = &window;
m_labelSprite.setTexture(imageTexture);
m_labelPosition = labelPosition;
}
void Label::setWindow(sf::RenderWindow &window)
{
... |
//
// Created by 钟奇龙 on 2019-05-04.
//
#include <iostream>
using namespace std;
class Node{
public:
int data;
Node *left;
Node *right;
Node(int x):data(x),left(NULL),right(NULL){}
};
int getLeftMostLevel(Node *head,int currentLevel){
while(head){
head = head->left;
currentLevel++;
... |
#ifndef MAGE_H
#define MAGE_H
#include "Character.h"
#include "Dark.h"
class Mage : public Character
{
private:
static const WeaponType type;
public:
Mage(string name="XXX");
virtual ~Mage();
Mage(const Mage& other);
Mage& operator=(const Mage& other);... |
// Created on: 2011-09-20
// Created by: Sergey ZERCHANINOV
// Copyright (c) 2011-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... |
#include "Manager.h"
#include <stdlib.h>
#include <fstream>
#include <string>
using namespace std;
Manager::Manager()
{
flog.open("log.txt", ios::app); // Option app: write new content into an existing file.
//flog.open("log.txt", ios::trunc);
flog.setf(ios::fixed);
avl = new AVLTree(&flog);
gp = n... |
/**
* @file Stack_Allocation_Policy.hpp
*
* @author Matthew Rodusek
* @date March 11, 2015
*/
/*
* Change Log:
*
* March 20, 2015:
* - Implemented Downward-growing stack allocator
* - Switched to Memory_Pool instead of raw pointers
*/
#ifndef VALKNUT_CORE_ALLOCATION_POLICIES_STACK_ALLOCATOR_HPP_
#define V... |
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
int main(int argc,char *argv[])
{
FILE *fIn,*fOut;
char buffer;
if(argc<2)
return 1;
fIn=fopen(argv[1],"r");
fOut=fopen(argv[2],"w");
buffer=fgetc(fIn);
while(!feof(fIn))
{
if(buffer=='a')
fprintf(fOut,"e");
else
fprintf(fOut,"%... |
#pragma once
#include <iostream>
#include "Engine.h"
#define LOG_ERROR 2
#define LOG_NORMAL 0
#define LOG_SUCCES 1
#define LOG_WARNING 3
float positiving(float e) {
return sqrt(e * e);
}
bool checkCollisionRecPoint(rectangle rec, Vector2f pos) {
bool collision = false;
if ((pos.x >= rec.x) && (pos.x <= (rec.x + r... |
/*
* load.h
*
* Created on: Nov 26, 2012
* Author: chjd
*/
#ifndef LOAD_H_
#define LOAD_H_
/*
* stamp index with branch index, as default StampIndex
* for,
* generalized MNA,
* partial improved MNA
* transient C, L
* also for,
* improved MNA
*
*/
class kStampIndex
{
public:
kStampIndex()=def... |
#include "main2.h"
|
#include "TdlibJsonWrapper.hpp"
#include "include/AppApiInfo.hpp"
#include <QThread>
#include "ListenObject.hpp"
#include "ParseObject.hpp"
#include <td/telegram/td_log.h>
namespace tdlibQt {
TdlibJsonWrapper::TdlibJsonWrapper(QObject *parent) : QObject(parent)
{
td_set_log_verbosity_level(0);
client = td_js... |
// This file was generated based on '/Users/r0xstation/Library/Application Support/Fusetools/Packages/Fuse.Launcher.Phone/1.3.1/Phone/JS.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Fuse.Scripting.IModuleProvider.h>
#include <Fuse.Scripting.NativeModule.h>
#include <Un... |
#ifndef CAMERA_H
#define CAMERA_H
#include "Component.h"
#include "../maths/MathCore.h"
class Entity;
class Camera : public Component
{
public:
Camera(Entity* entity);
~Camera();
virtual void Initialize(float fov, float aspect, float pNear, float pFar);
void CreateOrthoMatrix(float left, float right, float top,... |
#include "DHT.h" // rIncluir a biblioteca (comandos do Sensor)
#define DHTPIN 2 // Pino 2 com DHT 22
DHT Sensor(DHTPIN, DHT22); // Conectar o sensor em algum pino, no exemplo pino 2, tipo dht22
void setup() {
Serial.begin(9600);
Serial.println("testando....");
Sensor.begin(); // Iniciar o Sensor
}
vo... |
#ifndef Population_H
#define Population_H
#include <cstdlib>
#include <vector>
#include "Gene.h"
namespace HWA2{
class Population{
public:
Population();
Population(int);
void readDataset();
double calculateFitness();
void reproduce(int, int);
void mutate(std::vector<int>&, int);
Gene bestGen... |
/*
TouchKeys: multi-touch musical keyboard control software
Copyright (c) 2013 Andrew McPherson
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 3 of the License, or
(at you... |
/*
* In a more traditional environments, one would split into .H and .CPP files. However in Arduino, the ".ino" file
* comes with certain built-in includes (such as "Arduino.h" and more) which are not automatically added to other CPP
* files. So, to make things more seamless, I will be putting implementation directl... |
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "sub/bar.h"
#include <stdio.h>
Bar::Bar()
: QObject()
{
}
void Bar::doBar()
{
printf("Hello bar !\n");
}
#include "sub/moc_bar.cpp"
|
//Reverse k nodes iteratively
#include<iostream>
using namespace std;
typedef struct Node
{
int key;
Node *next;
Node(int x)
{
key = x;
}
} Node;
Node *insert(Node *head, int key)
{
Node *temp = new Node(key);
temp->next = head;
return temp;
}
void printList(Node *head)
{
N... |
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
typedef int datatype;
typedef struct node{
int data;
struct node *next;
}linklist;
//形成链表
linklist *create()
{
linklist *L,*p,*r;
L=(linklist*)malloc(sizeof(linklist));
L->next=NULL;
r = L;
int x;
scanf("%d",&x)... |
#include <iostream>
#include <string>
#include <fstream>
#include "../Headers/matrix.h"
#include "../Headers/partition.h"
#include"../Headers/DNode.h"
using namespace std;
void test ()
{
DNode D1(1,BASIC_RES,1,2);
cout<<D1.getDVal()<<endl;
cout<<D1.getId()<<endl;
}
int main(int argc, char *argv[])
{
//ifstream is ... |
#ifndef CLIENTE_H
#define CLIENTE_H
#include <mysql_connection.h>
#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/resultset.h>
#include <cppconn/statement.h>
using namespace std;
class Cliente
{
public:
Cliente();
Cliente(sql::ResultSet*);
virtual ~... |
#include "test.hh"
using namespace tensor;
template <template <class> class Container>
void SlicingWithArgsTests() {
Tensor<int32_t, 3, Container> tensor_1({2, 4, 6});
for (size_t i = 0; i < tensor_1.dimension(0); ++i)
for (size_t j = 0; j < tensor_1.dimension(1); ++j)
for (size_t k = 0; k < tensor_1... |
/*
* IntList.h
*
* Created on: Sep 9, 2016
* Author: ymaslov
*/
#ifndef INTLIST_H_
#define INTLIST_H_
#include <stdlib.h>
class IntList {
struct ListItem {
int item;
ListItem *next;
ListItem(int i, ListItem *n = NULL) { item = i; next = n; }
};
int count = 0;
ListItem *first;
ListItem *last;... |
/**
* \file
*
* \brief This file should be one level down in the hierarchy.
*/
namespace nested {
/// The second class inside the ``nested`` namespace.
struct two {
/// Nesting even further: ``nested::two::params``.
struct params {
/// A union that occupies four bytes: http://en... |
#include <algorithm>
#include "Dispatch.h"
#include "protocol.h"
#include "Client.h"
#include "../EVWork.h"
using namespace evwork;
extern struct g_args_s g_args;
BEGIN_FORM_MAP(CDispatch)
ON_REQUEST_CONN(SERVER_LOGIN_BC, &CDispatch::onEnterRoomReply)
ON_REQUEST_CONN(SERVER_LOGIN_FAIL, &CDispatch::onEnterRoomFail)... |
#include "gamecore.h"
#include "bg.h"
StarManager starManager;
Star star[STAR];
void Title::update() {
static const byte* bitmaps[] = { title_1, title_2, title_3, title_4, title_5, title_6,
title_7, title_8, title_9, title_10, title_11, title_12, title_13, title_14 };
timerPriv = (timerPriv + 1) % 8;... |
/*
Copyright 2021 University of Manchester
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 writing, s... |
#ifndef GAME_HPP_
# define GAME_HPP_
#include <vector>
#include "Menu.hpp"
#include "SceneCat.hpp"
// NOT PERMANANT
#include "SFML\Graphics.hpp"
#include "SFML\Window.hpp"
#include "SFML\System.hpp"
#include <iostream>
//NOT PERMANANT
class Game
{
public:
Game();
~Game();
bool init();
i... |
#ifndef SOPNET_INFERENCE_PROBLEM_CONFIGURATION_H__
#define SOPNET_INFERENCE_PROBLEM_CONFIGURATION_H__
#include <boost/lexical_cast.hpp>
#include <pipeline/all.h>
#include <sopnet/exceptions.h>
class ProblemConfiguration : public pipeline::Data {
public:
void setVariable(unsigned int segmentId, unsigned int variab... |
#pragma once
#include "RGB.h"
#include "Vector.h"
using namespace blvector;
const double inversePI = 0.3183098861837906;
class BRDF
{
public:
virtual double calculateBRDF() { return 0; }
virtual double calculateBRDF(Vector &wi, Vector &normal, Vector &wo) { return 0; };
//methods for Lambertian class
virtual ... |
/**
* 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... |
#include "ReduireDynamique.hpp"
using namespace ns_wtni;
ReduireDynamique::ReduireDynamique( pluglink *p ) : plugin(p)
{
// Ajout des donnees en entree
add_input( input );
// Ajout des donnees en sortie
add_output( output );
// Ajout des parametres
dynamic = 7;
add_param( dynamic, "" );
}
bool ReduireDynamique... |
/*
Name : AMAN JAIN
DATE: 13-06-2020
*/
#include<bits/stdc++.h>
using namespace std;
int R,C;
void printMat(char arr[][100]){
for(int i=0 ; i<R; i++){
for(int j=0 ; j<C; j++){
cout<<arr[i][j]<<" ";
}
cout<<endl;
}
}
int dx[] ={-1,0,1,0};
int dy[] ={0,-1,0,1};
void fl... |
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2018 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistribution... |
///////////////////////////////////////////////////////////////////////////
// Becky! API header file
//
// You can modify and redistribute this file without any permission.
#ifndef _BECKY_API
#define _BECKY_API
#define BKC_MENU_MAIN 0
#define BKC_MENU_LISTVIEW 1
#define BKC_MENU_TREEVIEW 2
#define BKC_ME... |
#include "fastButton.h"
FastButton::FastButton()
{
}
FastButton::~FastButton()
{
}
void FastButton::begin(uint8_t _pin, bool _pullup, unsigned long _debounceDelay)
{
io.begin(_pin);
debounceDelay = _debounceDelay;
//setup pin mode
io.pinMode(_pullup ? INPUT_PULLUP : INPUT);
}
bool FastButton::updat... |
#include <windows.h>
#include <psapi.h>
#include <tchar.h>
#include <stdio.h>
#include <winternl.h>
#include "kafl_user.h"
#define ARRAY_SIZE 1024
#define INFO_SIZE (128 << 10)
PCSTR ntoskrnl = "C:\\Windows\\System32\\ntoskrnl.exe";
PCSTR kernel_func = "PsCreateSystemThread";
typedef NTSTATUS(NTAPI* _NtQuerySystemIn... |
#pragma once
#include "Keng/GPU/FwdDecl.h"
namespace keng::graphics::gpu
{
class DepthStencil;
using DepthStencilPtr = core::Ptr<DepthStencil>;
class SwapChain;
using SwapChainPtr = core::Ptr<SwapChain>;
class TextureRenderTarget;
using TextureRenderTargetPtr = core::Ptr<TextureRenderTarget>... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2000-2012 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* Yngve Pettersen
*/
#include "core/pch.h"
#ifdef _NATIVE_SSL_... |
#ifndef AMVK_TEXTURE_DATA_H
#define AMVK_TEXTURE_DATA_H
#include "state.h"
#include "file_manager.h"
#include <stb/stb_image.h>
#include <string>
#include <stdexcept>
class TextureData {
public:
TextureData();
~TextureData();
stbi_uc* load(const char* filename, int reqComp);
int getWidth() const;
int getHeight()... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.