text
stringlengths
8
6.88M
#include "gameinstance.h" #include "gamewindow.h" #include "piece.h" #include "i.h" #include "l.h" #include "o.h" #include "r.h" #include "s.h" #include "t.h" #include "z.h" #include <iostream> #include <cstdlib> #include <ctime> #include <QTimer> #include <QObject> using namespace std; GameInstance::GameInstance(): ...
#include "GUI.hpp" GUI::GUI() { /* Initialize dimensions */ mOuterBoxPadding = 1; mFirstTrack = 1; /* Initialize starting row to 0 */ mCurrentRow = 0; /* Initialize screen */ initscr(); /* Don't output anything */ noecho(); /* Get initial screen size */ getmaxyx(stdscr, mScreenHeight, mScree...
#include <cstdio> #include <vector> #include <stdio.h> using namespace std; vector<int> Edges[200005]; vector<int> fromCh[200005]; bool Visit[200005]; class node{ public: int bw, upMax, ans; }a[200005]; int dfs(int pos){ int thisChild; a[pos].upMax = 0; int i, k; k = Edges[pos].size()...
/* ============================================================================ * Copyright (c) 2009-2016 BlueQuartz Software, LLC * * 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 ...
#include "AlgebraicExpression.h" int main() { cout << "\ninfix to prefix" << endl; cout << infix2prefix("(4+5)-2*4") << endl; cout << infix2prefix("((2*(8-3))-(2+1)*4)") << endl; cout << infix2prefix("(2*9-(1-(2+7)*3))") << endl; cout << infix2prefix("((2/3)-(8+1))") << endl; cout << infix2prefix("(6-1)+(7-8...
#include <iostream> using namespace std; void main() { //TASK 01// int numb = 100, numb2 = 1; do { cout << numb << " " << numb2 << endl; numb--; numb2++; } while (numb >= 1); //TASK 02// int numb = 0, counter = 0; cout << "Enter number " << endl; cin >> numb; while (numb >= 0...
#if 0 #include<iostream> #include"Exception.h" #pragma warning(disable:4996) using namespace std; Exception::Exception(char* name, int line,char*filename) { m_pStrName = new char[strlen(name) + 1]; strcpy(m_pStrName, name); m_pFileName = new char[strlen(filename) + 1]; strcpy(m_pFileName, filename); m_nLine = lin...
#ifndef PARSERS_REPLAYER_PARSER_HEADER #define PARSERS_REPLAYER_PARSER_HEADER #include "Parser.h" namespace solar { //Part of replaying a simulation mode. //Responsible for loading correct replay file and initializing data based on it. class ReplayerParser : public Parser { public: //replayFile - filename inclu...
namespace diy { namespace mpi { //! \ingroup MPI //! Simple wrapper around `MPI_Comm`. class communicator { public: inline communicator(MPI_Comm comm = MPI_COMM_WORLD, bool owner = false); ~communicator() { destroy(); } c...
#define NOMINMAX // http://kreationsedge.net/?page_id=26 #include "Mesh.h" #include "pg2_vertexbuffer.h" #include "pg2_indexbuffer.h" #include "Renderer.h" #include "BoundingBox.h" #include "Node.h" using namespace kyrbos; int Mesh::count = 0; Mesh::Mesh(Renderer* renderer) : m_kRenderer(renderer), m_kTexture(no...
// // PocketTextElite - port of Elite[TM] trading system // Copyright (C) 2008-2009 Michael Fink // /// \file PlanetInfoView.cpp Planet info view // // includes #include "stdafx.h" #include "resource.h" #include "PlanetInfoView.hpp" #include "TextElite.hpp" LRESULT PlanetInfoView::OnInitDialog(UINT /*uMsg*/, WPARAM /...
/* Given an unsorted array A of size N of non-negative integers, find a continuous subarray which adds to a given number S. */ #include <iostream> #include <bits/stdc++.h> using namespace std; int main() { int n, s; cin>>n; cin>>s; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } ...
#include <iostream> #include "VectorPractise.h" void printVector(const tk::Vector<double>& vector); tk::Vector<double> MoveConstructorInvoke(); int main() { tk::Vector<double> vector = {4, 3, 2, 53, 33, 22}; vector.pushback(32); vector.pushback(311); vector.pushback(312); vector.pushback(3212); ...
/************************************************************* * > File Name : P1216.cpp * > Author : Tony * > Created Time : 2019/02/01 17:00:40 **************************************************************/ #include<bits/stdc++.h> using namespace std; int n, a[1002], ans, p; int main() ...
#include <iostream> #include <unordered_set> #include <vector> using namespace std; vector<int> LCS(int *arr, int n){ unordered_set<int> q; for(int i=0; i<n; i++){ q.insert(arr[i]); } int ans = 0; vector<int> vq; for(int i=0; i<n; i++){ //element se hi sequence start ho rha ha...
#include <algorithm> #include <array> #include <iostream> #include <iterator> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <vector> #define ll long long using namespace std; typedef tuple<ll, ll, ll> tp; typedef pair<ll, ll> pr; const ll MOD = 1000000007; const ll INF = 1e...
#include <iostream> #include "server/server.h" int main() { int port = 3879; uint max_connections = 16; Server* server = new Server(max_connections, port, port); server->run(); delete server; return 0; }
#include "as/ScriptEngine.hpp" #include <angelscript.h> #include "as/ScriptContext.hpp" #include "as/ScriptModule.hpp" namespace as { ScriptEngine::ScriptEngine() { engine = asCreateScriptEngine( ANGELSCRIPT_VERSION ); engine->SetMessageCallback( asMETHOD( ScriptEngine, rawMessageCallback ), this, asCALL_THISC...
#include "Bill_interface.h" #include <iostream> Bill_interface::Bill_interface() { } Bill_interface::~Bill_interface() { } bool Bill_interface::addPerson(std::string name) { int temp = Person::getNoOfPeople(); if (temp <= BIll_INTERFACE_MAX_PEOPLE) { myNameMap.insert(std::pair<std::string, int>(name, temp)...
#include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; typedef long long ll; struct Edge { int v, d; Edge(int _v, int _d) : v(_v), d(_d) {} }; const int maxn = 105; int n, A, B; vector<Edge> G[maxn]; int dis[maxn]; bool vis[maxn]; bool dijkstra(int s) { memset(dis,...
/* Assignment 3 Recursion 1. Enter a no. and find factorial of that no. 2. Enter two no. find GCD with help of euclidian algorithm */ #include<iostream> using namespace std; int facto(int n) { if(n<0) { cout<<"Can not calculate Factorial of "; return n; } else if(n==1||n==0) return...
////////////////////////////////// /* Ahmet Polat */ /* 150170109 */ /* 23/05/2021 */ ////////////////////////////////// #pragma once #include <iostream> using namespace std; #include "Faction.h" #include "Orcs.h" #include "Dwarves.h" #include "Elves.h" ...
#include<iostream> #include<algorithm> int gcd(int a,int b) { int c; while(a != 0) { c = a; a = b%a; b = c; } return b; } using namespace std; int main() { int n,i,arr[1000],arra[1000],c,t; cin>>t; while(t--) { cin>>n; for(i = 0;i < n;++i) ...
#pragma once //PageForm.h #ifndef _PAGEFORM_H #define _PAGEFORM_H #define PAGEFORM_MAX_WIDTH 32767 #define PAGEFORM_MAX_HEIGHT 32767 //#define PAGEFORM_MAX_WIDTH 4000 //#define PAGEFORM_MAX_HEIGHT 4000 #include "CompositeForm.h" #include "MemoForm.h" #include <afxwin.h> #include <string> using namespace std; typedef...
#include "processed_frame.h" ProcessedFrame::ProcessedFrame(double xmin, double xmax, double ymin, double ymax, Point2D** flatPoints, int pcount) { this->xmin = xmin; this->xmax = xmax; this->ymin = ymin; this->ymax = ymax; this->flatPoints = new Point2D*[pcount]; for (int i = 0; i < pcount; i++) { this->flatP...
// screen.cpp - screen class // (c) 2020 Michael Fink // https://github.com/vividos/OldStuff/ // This file contains reconstructed classes from lost source files that // couldn't be recovered. #include "screen.h" #include <conio.h> #include <mem.h> // far pointer to screen RAM static byte far* screen_ram = (byte far*)...
/* SPDX-License-Identifier: LGPL-2.1 */ /* * Copyright (C) 2017 VMware Inc, Yordan Karadzhov <ykaradzhov@vmware.com> */ /** * @file KsGLWidget.hpp * @brief OpenGL widget for plotting trace graphs. */ #ifndef _KS_GLWIDGET_H #define _KS_GLWIDGET_H // Qt #include <QRubberBand> // KernelShark #include "Ks...
#ifndef __SPRITE__ #define __SPRITE__ #include <d3d9.h> #include <d3dx9.h> class Sprite { protected: static bool isCheckRect(RECT SourceRect); D3DXVECTOR3 position; //Position of the sprite is located in the middle of texture image LPDIRECT3DTEXTURE9 texture; //Image will be saved here LPD3DXSPRITE sp...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ScavTrap.cpp :+: :+: :+: ...
/* * Copyright 2016-2017 Flatiron Institute, Simons Foundation * * 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 ...
#pragma once #include <stdint.h> struct Notification { char* notification = nullptr; uint32_t notificationLen = 0; Notification(const char* userName, const char* message); Notification(void* data, uint32_t dataSize); ~Notification(); void AddRef() const; uint32_t Release() const; st...
#ifndef WEIGHTED_POSE_WITH_COVARIANCE_ARRAY_DISPLAY_H #define WEIGHTED_POSE_WITH_COVARIANCE_ARRAY_DISPLAY_H #ifndef Q_MOC_RUN #include <rviz/message_filter_display.h> #include <tuw_geometry_msgs/WeightedPoseWithCovarianceArray.h> #endif namespace Ogre { class SceneNode; } namespace rviz { class ColorProperty; class ...
#include <bits/stdc++.h> #include <string> using namespace std; template <typename T> class Queuearray{ T *data; int nextindex; int firstindex; int size1; int capacity; public: Queuearray(int s){ data = new T[s]; nextindex=0; firstindex=-1; size1=0; capacity=s; } int getsize(){ re...
#pragma once #include "BackEnd.h" class Label :public BackEnd { private: public: string content = ""; int x = 0; int y = 0; int width = 0; bool check = 0; bool enter = 0; void show(); Label(); ~Label(); };
#pragma once #include <cassert> #include <condition_variable> #include <mutex> #include <thread> namespace async_notification { template <typename Buffer, typename Handler> class manager { using state_t = typename Buffer::state_t; using this_t = manager<Buffer, Handler>; Handler handler_; state_t state_; ...
#include <Arduino.h> #include "Adafruit_VL53L0X.h" #include <Wire.h> #include "Adafruit_MCP23017.h" #include "MyThrottle.h" #include "MyMCP.h" #include "MyJoystick.h" #include "MyInputDef.h" int LidarDist; void setup() { Serial.begin(115200); // while (! Serial) { delay(100); // } InputDef_Setup(); ...
#include <iostream> #include "Junction.hpp" using namespace std; Junction::Junction(Segment * aSource, Segment * aTarget, char aSourceDir, char aTargetDir, double aCoverage, double aCredibility, bool aInferred, bool aIsSourceSinkJunction) { mSourceDir = aSourceDir; mTargetDir = aTargetDir; mCredibility ...
template <class T> class CircularBuffer { typedef std::atomic<int> AtomicInt; public: CircularBuffer(int n_); ~CicularBuffer(); CircularBuffer(CircularBuffer& t_); CircularBuffer& operator= (CircularBuffer& t_); CircularBuffer(CircularBuffer&& t_); bool empty() const; bool full() const; void pu...
#include "stdafx.h" #include "CoxInfo.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif /////////////////////////////////////////////////////////////////////////////// CCoxInfoArray::CCoxInfoArray() { m_pCoxBuf = NULL; m_nSize = 0; m_nMatchingCount = 0; } CCoxInfo...
#pragma once #include "Singleton.h" #include "Scene.h" #include "Renderer.h" class Director : public Singleton<Director> { private: Scene* currentScene; public: void DirectorInit(); void SetScene(Scene* scene); void UpdateScene(); };
#include "coplib.hpp" #include <iostream> #include <fstream> using namespace cop; void cop::readParams(std::map<std::string, double>& parms, std::ifstream& parmfile) { std::size_t linecount = 0; std::string line; std::string n; double v; while(!parmfile.eof()) { ++linecount; // ...
#include "eth.h" #include "fmt.h" #include "host.h" using namespace unet; static const uint8_t broadcast_hw[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; const uint8_t *unet::broadcast_hwaddr = broadcast_hw; const char *unet::eth_name(eth_type type) { switch (type) { #define X(name, val) case ETH_##name: return #nam...
class point{ public: vect c; bool act; bool fix; bool vis; point(){ act = 0; fix = 0; vis = 1; } }; class line{ public: int p[2]; bool act; bool fix; bool vis; line(){ p[0]=-1;p[1]=-1; act = 0; fix = 0; vis = 1; } }; class mesh{ public: int p[3];//point link ...
#ifndef Graph_hpp #define Graph_hpp #include <stdio.h> #include <vector> #include <iostream> #include <queue> #include <algorithm> #include "Vertex.hpp" using namespace std; class Graph { public: vector<Vertex*> vertices; Graph(); Graph(int); void add_vertex(Vertex*); void display(); void topological...
#ifndef __APLICATION_H__ #define __APLICATION_H__ #include <vector> #include <list> #include "Globals.h" #include "Timer.h" #include "PerfTimer.h" #include "parson/parson.h" #include "JSONFile.h" #define FPS_GRAPH_SAMPLES 101 #define GRAPH_TITLE_SIZE 100 typedef unsigned __int32 uint32; typedef unsigned __int64 uin...
/* * Copyright 2016-2017 Flatiron Institute, Simons Foundation * * 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 ...
/** * John Bradley (jrb@turrettech.com) */ #pragma once #include <Awesomium\WebString.h> #include <Awesomium\DataSource.h> #include <Awesomium\WebString.h> #include <Awesomium\STLHelpers.h> #include "STLUtilities.h" #include <cctype> #include <algorithm> #include <fstream> #include <sstream> #include <string> #inclu...
/* ** Copyright (c) 2013, Xin YUAN, courses of Zhejiang University ** All rights reserved. ** ** This program is free software; you can redistribute it and/or ** modify it under the terms of the 2-Clause BSD License. ** ** Author contact information: ** yxxinyuan@zju.edu.cn ** */ /* This file contains main function...
/* * scout_robot_demo.cpp * * Created on: Jul 08, 2021 11:12 * Description: * * Copyright (c) 2021 Weston Robot Pte. Ltd. */ #include <unistd.h> #include <memory> #include <iostream> #include "ugv_sdk/mobile_robot/scout_robot.hpp" #include "ugv_sdk/utilities/protocol_detector.hpp" using namespace westonrobot...
#include "renderer/ShaderProgram.h" namespace revel { namespace renderer { class RenderPass { std::shared_ptr<ShaderProgram> m_pShaderProgram; }; class Effect { class Technique { std::vector<RenderPass> m_RenderPasses; }; }; } }
// ============================================================== // RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and OpenCL // Version: 2019.2 // Copyright (C) 1986-2019 Xilinx, Inc. All Rights Reserved. // // =========================================================== #ifndef _honeybee_HH_ #de...
#ifndef EXAMPLE_WORLD_H #define EXAMPLE_WORLD_H #include <glm/glm.hpp> #include "engine/input.h" #include "opengl/renderer.h" #include "opengl/frame_buffer.h" #include "prefab/ground.h" #include "hmd.h" #include "point_cloud.h" namespace example { class World final { public: World(); void init(int window_widt...
#include "Camera.h" Camera::Camera(string camera_id, float near, float far){ this->camera_id = camera_id; this->near = near; this->far = far; } string Camera::getId(){ return this->camera_id; } int Camera::getCameraType(){ return 0; } Perspective::Perspective(string camera_id, float near, float far, float * ...
/* * Copyright (C) 2007-2015 Frank Mertens. * * Use of this source is governed by a BSD-style license that can be * found in the LICENSE file. * */ #ifndef FLUXTOKI_YASONSYNTAX_H #define FLUXTOKI_YASONSYNTAX_H #include <flux/meta/YasonSyntax> namespace flux { namespace toki { flux::meta::YasonSyntax *yasonSyn...
#include<iostream> using namespace std; /* Constant Casting Examples*/ void print(char * str){cout << str<<endl;} class A { int __i; public: A(int i):__i(i){} //need a default constructor for constant objects void set(int j){__i=j;} void printI() const {cout<<__i<<endl;} // const function fro const obj }; int ...
/* * SPDX-FileCopyrightText: (C) 2017-2022 Matthias Fehring <mf@huessenbergnetz.de> * SPDX-License-Identifier: BSD-3-Clause */ #ifndef CUTELYSTVALIDATORURL_P_H #define CUTELYSTVALIDATORURL_P_H #include "validatorrule_p.h" #include "validatorurl.h" namespace Cutelyst { class ValidatorUrlPrivate : public ValidatorR...
#ifndef __img_MANAGER_H__ #define __img_MANAGER_H__ #include <opencv2/opencv.hpp> #include "daqi/da4qi4.hpp" #include "util_const.h" #include "util_error.h" #include "base64.h" namespace fgtcc { namespace imgproc { std::string Mat2Base64(const cv::Mat &img, std::string imgType); cv::Mat Base2Mat(std::string &base64...
#ifndef ROTATING_CUBE_H #define ROTATING_CUBE_H #include <QtWidgets/QMainWindow> #include "ui_rotating_cube.h" #include <qtimer.h> class RotatingCube : public QMainWindow { Q_OBJECT // Если не добавить, то не будут обрабатываться события private: Ui::RotatingCubeClass ui; QTimer* timer = new QTimer(); // Таймер,...
#include "StatisticObserver.h" #include "iostream" #include "Player.h" StatisticObserver::StatisticObserver() { }; StatisticObserver::StatisticObserver(Player* pl) { p = pl; }; StatisticObserver::~StatisticObserver() { }; void StatisticObserver::Update() { printBarGraph(); } void StatisticObserver::printBarGra...
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QObject> #include <QSlider> #include <QLabel> #include <QCheckBox> #include <vector> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); QSurfaceFormat format; format.s...
/************************************** * * * Michal Svoboda's Basecode Example * * 2002 * * * **************************************/ // Includes #ifdef WIN32 #include <windows.h> ...
#include <math.h> #include <iostream> #include "../configs/AppConfig.hpp" #ifdef USE_APP_MATH #include "libs/math/BasicMath.hpp" #endif int main(int argc, char *argv[]) { std::cout << "Wat da phuc" << std::endl; if (argc < 2) { std::cout << argv[0] << " Version " << TestBase_VERSION_MAJOR << "." ...
#pragma once #include <vector> #include "DirectXFramework.h" #include "Structs.h" using namespace std; // Renderer class for wireframe nodes. Only handles rendering (no updating or generating vertices) class WireframeRenderer : public enable_shared_from_this<WireframeRenderer> { public: WireframeRenderer() { _number...
 /// @file libYmLogic/test/bdd/makebdd.cc /// @brief 論理回路の BDD を作るプログラム /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2005-2011 Yusuke Matsunaga /// All rights reserved. #include "YmLogic/Bdd.h" #include "YmLogic/BddMgr.h" #include "YmNetworks/BdnMgr.h" #include "YmNetworks/BdnBlifReader.h" #include "Ym...
#include<stdio.h> #include<stdlib.h> int getLen(char[]); int main(){ int N=0,a=0,b=0; char string[1000]; scanf("%d",&N); scanf("%s",string); int len=getLen(string); int i=0,temp=0; int j=0; for(j=0;j<N;++j){ scanf("%d %d",&a,&b); if(a<1&&b>len) return -1; temp=1; for(i=a-1;i<b;++i){ temp*=(st...
class Solution { public: int orangesRotting(vector<vector<int>>& grid) { int res = 0, m = grid.size(), n = grid[0].size(), freshCnt = 0; queue<pair<int, int>> q; // bfs: row-col for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (grid[i][j] ==...
#include "hw3_4_1.h" int main() { string line; unsigned i, j, i2; //iterator string allNum; //save the substring read in string tmp; //save the first substring string tmp2; //save the second substring stringstream ss; int num; while(getline(cin, line)) { /////////////////////////////////////////////////...
//Coder: Thanh Kobe //Tim so nguyen to #include <iostream> int main(){ int n,d = 0; std::cout <<"Nhap gia tri vao chuong trinh: " << std::endl; std::cin >> n; for(int i =1; i<=n; i++) if (n%i==0) d++; if (d==2) std::cout << "n la so nguyen to "; else ...
#pragma once struct IPlayer; struct ISynth; struct SDL_Thread; struct SDL_AudioCVT; struct Sample16; class Mixer { IPlayer& mPlayer; ISynth& mSynth; int mSampleRate; int mSamples; bool mThreadRunning; bool mAudioOpened; SDL_Thread *mThread; SDL_AudioCVT *mConvert; Sample16 *mBuffer; int mBufferSize; bo...
#include "simphys/collision.h" #include <iostream> #include <math.h> namespace simphys { Collision::Collision( std::shared_ptr<Particle> p1 ) { restitution = 0.9f; // Set a default restitution of something < 1.0 particles.push_back( p1 ); } Collision::Collision( std::shared_ptr<Particle> p1, std::shared_ptr<...
#pragma once typedef std::vector<short> LongNumber; class CLongNumber { public: CLongNumber(const long& number = 0); CLongNumber(const std::string& number); CLongNumber(const LongNumber& number); CLongNumber(const CLongNumber& number); LongNumber GetLongNumber() const; size_t GetSize() const; private: LongNum...
#include <bits/stdc++.h> #include "cs50.h" using namespace std; typedef struct songtemp { string name; int len; }songs; int main() { freopen("in", "r", stdin); freopen("out", "w", stdout); int T; scanf("%d", &T); for(int tt=1; tt<=T; tt++) { printf("Case #%d: ", tt); int n; scanf("%d", &n); songs col...
#pragma once #include <vulkan/vulkan.h> #include <vector> class VulkanInstance; class VulkanDevice { VkDevice device = VK_NULL_HANDLE; VkQueue deviceGraphicsQueue = VK_NULL_HANDLE; VkQueue devicePresentQueue = VK_NULL_HANDLE; public: VulkanDevice(VkPhysicalDevice * physicalDevice, VulkanInstance* inst...
#include <iostream> #include <time.h> #include <stdlib.h> #include <stdio.h> using namespace std; int pares[10]; int NumRandom() { int num=0; do { num=1+rand()%(100-1); }while (!((num%2==0) and (num<=100))); return num; } void generar (int pares[]) { srand(time(0)); for (int i=1;...
#include<stdio.h> #include<malloc.h> struct node{ int data; struct node *left; struct node *right; }; struct node *newNode(int); int maxHeight(struct node *root){ if(root==NULL) return 0; int ldepth=maxHeight(root->left); int rdepth=maxHeight(root->right); if(ldepth>rdepth) return(ldepth+1); el...
#include "MathVector.h" #include <cmath> MathVector::MathVector(): size(0), data(nullptr) {} MathVector::MathVector(int v_size) : size(v_size), data(nullptr) { data = new (std::nothrow) double[v_size]; if (!data) { std::cout << "Error! No memory allocated." << std::endl; return; } for (int i = 0;...
//inclure les librairies suivantes #include <Stepper.h> #include <LiquidCrystal.h> #include <Wire.h> /*************************************************************/ // definition des paramètre du STEPPER const int stepsPerRevolution = 400; // definit le nombre de pas du moteur const int AvanceFood = stepsPerRevol...
#include <WiFi101.h> #include <MySQL_Connection.h> #include <MySQL_Cursor.h> #include <Wire.h> //#include "Adafruit_TMP007.h" //Adafruit_TMP007 tmp007; byte mac_addr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //IPAddress server_addr(192,168,4,102); // IP of the MySQL *server* here IPAddress server_addr(192,168,...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.Data.Html.1.h" WINRT_EXPORT namespace winrt { namespace Windows::Data::Html { struct IHtmlUtilities : Windows::Foundation::IInspectable, impl::consume<IHtmlUtilitie...
#include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) scanf("%lld", &n) #define scc(c) scanf(" %c", &c); #define fr(i,n) for (ll i=0;i<n;i++) #define fr1(i,n) for(ll i=1;i<=n;i++) #define pfl(x) pr...
/************************************************************* * > File Name : P1613.cpp * > Author : Tony * > Created Time : 2019/10/11 20:39:41 * > Algorithm : 倍增 **************************************************************/ #include <bits/stdc++.h> using namespace std; inline ...
#include "stdio.h" #include "math.h" #include "stdlib.h" #define PI 3.1415926 #define NX 400 #define NZ 400 #define PML 150 int main() { float **P_now,**P_pre,**P_aft,**Vx_now,**Vx_pre,**Vx_aft,**Vz_now,**Vz_pre,**Vz_aft; float **K_now,**K_pre,**K_aft,**Psa_now,**Psa_pre,**Psa_aft,**Cita_now,*...
#include<bits/stdc++.h> using namespace std; int Add(int num1, int num2) { int sum,n; while(num2 != 0) { sum = num1^num2; n = (num1&num2)<<1; num1 = sum; num2 = n; } return num1; } int main() { cout << Add(14,5) << endl; return 0; }
class Solution { public: int BonusPoints(vector<int>& rankings) { int n=rankings.size(); vector<int>points(n,1); for(int i=1;i<n;i++){ if(rankings[i]>rankings[i-1]) points[i]=points[i-1]+1; } int sum=points[n-1]; for(int i=n-2;i>=0;i--){ if(rankings[i]>rankings[i+1]) points[i]=m...
#include "RequestValuesJob.h" #include "Session.h" namespace qtsnmpclient { RequestValuesJob::RequestValuesJob( Session*const session, const qint32 id, const QStringList& oid_list, const int limit ) : Abstr...
#include <iostream> #include <math.h> long long cycle(long long n){ if(n==1||n==2){ return 1; } long long a=1,b=1; for(int i=3;i<=n;i++){ std::swap(a,b); b=a+b; } return b; } long long rec(long long n){ if(n==1||n==2){ return 1; } ...
#include<iostream> using namespace std; int i=10; int main() { int a=1; int i=2; for(int i=1;i<=5;i++) { int j; for(j=0;j<7;j++) { } cout<<j<<endl; cout<<i<<endl; a++; } cout<<"outside for loop "<<endl; cout<<a<<endl; cout<<"main wala "<<i<<endl; cout<<"global wala "<<::i++<<endl; co...
#include "geometry.hpp" #include <cmath> #include <iostream> using namespace std; // static int declaration int Polygon::polygonCount = 0; // Point methods Point::Point() { xVal = 0; yVal = 0; } // PointArray methods // default constructor PointArray::PointArray() { // size is updated to 0 size = 0; // ne...
#include <iostream> #include <fstream> #include <algorithm> #include <vector> #include <map> #include <utility> #include <list> using namespace std; ifstream f("date.in"); map<pair<int,int>,int> Hash; map<pair<int,int>,int>::iterator j; list<vector<int> > Paralelipipede; list<vector<int> >::iterator k; void sortare (...
#include "Helit.h" #include "../../../GameDefines/GameDefine.h" #include "../../../GameComponents/Camera.h" #include "HelitState/HelitDie/HelitDie.h" #include "HelitState/HelitStand/HelitStand.h" #include "../../../GameComponents/GameCollision.h" Helit::Helit() { tag = Tag::Enemy; anim = new Animation(Define::HELIT_...
#ifndef __LayerGame_H_#define __LayerGame_H_ #include "cocos2d.h" USING_NS_CC; class LayerGame :public CCLayer { public: static CCScene *scene(); CREATE_FUNC(LayerGame); bool init(); //添加Blocks void startGame(); void addStartLineBlocks(); void addEndLineBlocks(); void addNormalBlocks(int lineIndex); //记录是否到...
#include "CodeGen/Class.h" #include <cassert> #include <sstream> namespace vazgen { std::string accessSpecifierToString(Class::AccessSpecifier access) { switch (access) { case Class::PUBLIC: return "public"; case Class::PRIVATE: return "private"; case Class::PROTECTED: return ...
//************************************************************************** //** //** 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 ...
/** * \file nodes.hpp * \date Jan 31, 2016 */ #ifndef PCSH_IR_NODES_HPP #define PCSH_IR_NODES_HPP #include "pcsh/arena.hpp" #include "pcsh/assert.hpp" #include "pcsh/ir.hpp" #include "ir/visitor.hpp" #include "ir/symbol_table.hpp" #include <sstream> // Disable MSVC warnings for dominant method inheritance in //...
#pragma once #include <vector> typedef std::vector<std::vector<int>> vvi; class IslandPerimeter { public: int findPerimeter(vvi &island); private: int perimeterHelper(vvi &island, int const row, int const col, int perimeter); };
float getTemperature() { float temp; DS18B20.requestTemperatures(); temp = DS18B20.getTempCByIndex(0); return temp; }
#ifndef UDPSERVERWRAPPER_H #define UDPSERVERWRAPPER_H #include <QUdpSocket> #include <QNetworkDatagram> class UdpServerWrapper : public QObject { Q_OBJECT public: explicit UdpServerWrapper(QObject *parent = 0); ~UdpServerWrapper(); bool init(); QByteArray getData(); void write(QByteArray data...
#include "../lib/TippdesDungeon/include/External/TippdesDungeon.hpp" #include <unistd.h> #include <iostream> #include <curses.h> void print(GameData_t* gameData, WINDOW* window) { if (gameData == nullptr) return; for (int j = 0; j < 15; j++) { for (int i = 0; i < 15; i++) { wm...
#pragma once #include <array> #include <exception> #include "base_types.hpp" #include "simd.hpp" namespace simd { #if SIMD_SUPPORTS(SIMD_SSE2) using float64x2 = vector<double, 2>; template <> class vector<double, 2> : public vector_base<double, 2> { public: static constexpr int required_version = native_vecto...
#include <sparky.h> #include <app/Application.h> using namespace sparky; using namespace graphics; using namespace maths; #define WIDTH 1280 #define HEIGHT 720 class Game : public Application { private: Layer* layer; Label* fps; Sprite* sprite; Shader* shader; Mask* mask; Label** debugInfo; public: Game() :...