text
stringlengths
8
6.88M
// // Created by anggo on 6/10/2020. // #include "Health.h" Health::Health(std::string filepath) { texture.loadFromFile(filepath); healthIcon.setTexture(texture); } void Health::draw(sf::RenderTarget& window,sf::RenderStates state) const { window.draw(healthIcon); } void Health::setSize...
#include <iostream> #include "Plane.h" using namespace std; Plane::Plane() :x(2.1f), z(2.2f), Vehicle() { /*Default Constructor of Vehicle is called*/ cout << "Plane constructor" << endl; x++; z++; } void Plane::setX(float x) { this->x = ++x; }
// Copyright (c) 2015 University of Szeged. // Copyright (c) 2015 The Chromium Authors. // All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "sprocket/browser/ui/javascript_dialog.h" #include "base/android/jni_string.h" #include "jni/...
/* * RatingList.cpp * * Created on: Oct 24, 2016 * Author: Istvan */ #include "RatingList.h" RatingList::RatingList() { init(); } RatingList::RatingList(const RatingList &rl) { deepCopy(rl); } RatingList::~RatingList() { clear(); } void RatingList::init(){ front = NULL; back = NULL; length = 0; } ...
#include <iostream> #include <algorithm> #include <vector> #include <map> #include <string> #include <set> #include <cmath> #include <unordered_map> #include <unordered_set> #include <cstring> #include <climits> #include <queue> using namespace std; struct node{ unordered_map<char,node*> children; bool end; ...
#include "image.h" Image::Image(void) { } Image::Image(IMAGETYPE imageType, int width, int height) { m_imageType = imageType; m_width = width; m_height = height; } Image::~Image(void) { } int Image::GetWidth() const { return m_width; } int Image::GetHeight() const { return m_heig...
//--------------------------------------------------------------------------- #ifndef UnitKT76CH #define UnitKT76CH //--------------------------------------------------------------------------- #include <Classes.hpp> #include <Controls.hpp> #include <StdCtrls.hpp> #include <Forms.hpp> #include <ExtCtrls.hpp> #include ...
#include "include/MIDIfile.hpp" #include <cstdio> // for std::fopen #include <cstring> int main(int argc, char **argv) { // Now that we have a class that can create MIDI files, let's create // music. // Begin with some chords. static const int chords[][3] = { { 12,4,7 }, // +C E G = 0 ...
class Solution { void permuteUnique(vector<int> &nums, int pos, vector<bool> &visited, vector<int> &value, vector<vector<int>> &result) { if (pos == nums.size()) { result.push_back(value); } else { for (int i = 0; i < nums.size(); i++) { if (visit...
#include "executor.h" #include <queue> #include <string> #include <vector> #include "command.h" #include "cmdAlways.h" #include "cmdFailure.h" #include "cmdSuccess.h" // creates commands based off of the connector type void executor::addCommand(string type, const vector<string>& cmdarg, int depth){ if (...
#include<bits/stdc++.h> using namespace std; int main() { int n,k; char a[2005]; char ch[3][5] = {"DAY","AYD","YDA"}; while(~scanf("%d%d",&n,&k)) { cin >> a; int minN = 2000; for(int i = 0; i <= n-k; i++) { for(int j = 0; j < 3; j++) { int sum = 0; ...
#pragma once ref class BitmapStack // Bitmap stack class { private: ref struct BITMAP { // structure of a node in the stack System::Drawing::Bitmap^ bitmap; // holds the previous bitmap BITMAP^ prev; // points to bitmap which is next in the stack }; BITMAP^ stackPtr; // points to top of the stack public: Bitmap...
#include "PrimitiveRestart.h" namespace revel { namespace renderer { PrimitiveRestart::PrimitiveRestart() : m_Enabled(false) , m_Index(0) { } } // ::revel::renderer } // ::revel
#include"BSTree.h" void main() { int select; int key; Tree tree; while(1) { cout << "1.Insert 2.Delete 3.Search 4.Print 5.Post 6.Pre 7.In: "; cin >> select; switch(select) { case 1: cout << "Insert data : "; cin >> key; tree.insertTree(tree.root , key); cout << endl << endl; break;...
//KaiXinAPI_ApplicationList.h #ifndef __KAIXINAPI_APPLICATIONLIST_H__ #define __KAIXINAPI_APPLICATIONLIST_H__ #include "KaiXinAPI.h" #define KX_APPLIST_ITEM_X_START (10) #define KX_APPLIST_ITEM_Y_START (70) #define KX_APPLIST_ITEM_WIDTH (145) #define KX_APPLIST_ITEM_HEIGHT (30) #define KX_APPLIST_ITEM_COL (2)...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
/** * 说反话 * words reverse * ATTENTION: while 能不用就不用, 坑爹 * 2018+ : gets函数无法使用, 改用fgets **/ #include <cstdio> #include <cstring> int main() { char str[500]; // 既定内存可以更大, 一开始的100提示partitial accept char str_arr[50][50]; int j = 0, k = 0; // gets(str); fgets(str, sizeof(str), stdin); ...
#pragma once #include <cstdlib> #include <vector> #include "Cell.hpp" namespace Kruskal { class Board { public: Board(const size_t height, const size_t width); Cell& getCell(const size_t x, const size_t y); Cell& getCell(const std::pair<size_t, size_t> p); size_t getHeight() const; size_t getWi...
#ifndef IC_TRANSLATOR_H #define IC_TRANSLATOR_H #include "../symboltable.h" #include "../instructions/instructions.h" #include "../syntaxtree/identifier.h" #include "../syntaxtree/aggregates.h" #include "bexptranslator.h" using namespace std; //forward references class ICOpTranslator; class Variable; class Functio...
#ifndef TASKSDIALOG_H #define TASKSDIALOG_H #include <QDialog> #include <QTableWidgetItem> #include "administrator.h" namespace Ui { class TasksDialog; } /** * @brief Клас для создания и сортировки задач */ class TasksDialog : public QDialog { Q_OBJECT public: /** * @brief TasksDialog * @param ty...
#include <cmath> #include <vector> #include <iostream> #include <stdlib.h> #include <numeric> #include <algorithm> #include "metrics/metrics.h" namespace h2o4gpu { template <typename T> std::vector<size_t> argsort(const std::vector<T> &v) { std::vector<size_t> idx(v.size()); std::iota(idx.begin(), idx.e...
#include<iostream> using namespace std; struct lnode { int data; struct lnode *next; }; typedef struct lnode *lptr; lptr L; void addend(lptr &L,int k) { if(L==NULL) { L=new(lnode); L->data=k; L->next=NULL; } else { lptr T=L; while(T->next!=NULL) { T=T->next; } T->n...
#include "log.h" #include "dominio.h" #include "servicio.h" #include "interfaz.h" #include "util.h" #include "configuracion.h" #include "servicioDB.h" #include "servicioASP.h" #include "DeshabilitarASP.h" #include <vector> using namespace std; int main(int argc, char *argv[]) { //Inicializar el dominio cDominio ...
// Fill out your copyright notice in the Description page of Project Settings. #include "XProjectGameModeBase.h"
#include "Square.hpp" Square::Square(Color color) : color(color), vertices{} {}
#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup(){ ofEnableAlphaBlending(); ofSetVerticalSync(true); ofSetFrameRate(60); ofBackground(22, 22, 22, 255); font.setup("Vera.ttf", 1.0, 1024, false, 8, 1.5); font.addFont("VeraMono-Bold.ttf"); unicodeFont.setup("...
#include <iostream> #pragma once using namespace std; class Node{ private: int value; Node* lChild; Node* rChild; public: Node(); Node(int value); int getValue(); Node* getLChild(); Node* getRChild(); void setValue(int value); void setLChild(Node* n); void setRChild(Node* n); }...
// glfw_testDll.h : Defines the exported functions for the DLL application. // #include <windows.h> #include <cstdlib> #define GLFW_INCLUDE_GLU #include <GLFW/glfw3.h> #ifdef GLFW_TESTDLL_EXPORTS #define GLFW_TESTDLL_API __declspec(dllexport) #else #define GLFW_TESTDLL_API __declspec(dllimport) #endif namespace glf...
#include "gui\Singularity.Gui.h" namespace Singularity { namespace Gui { #pragma region Static Variables VertexDeclaration* GuiFontVertexDeclaration::Declaration = GuiFontVertexDeclaration::GetVertexDeclaration(); #pragma endregion #pragma region Static Methods VertexDeclaration* GuiFontVertexD...
#include "TaskAction.h" using namespace Task; void Move::init() { entity->position.round(); target->position.round(); pathfinder = new Pathfinding::Pathfinder(grid->getWidth(), grid->getHeight()); path = pathfinder->findPath(entity->position, target->position, grid); } bool Move::run() { // moving - next positio...
#include<iostream> using namespace std; enum Color { Red, Black }; template<class K, class V> struct RBTreeNode { RBTreeNode<K, V>* _pLeft; RBTreeNode<K, V>* _pRight; RBTreeNode<K, V>* _pParent; K _key; V _value; Color _color; RBTreeNode(const K& key, const V& value) :_pLeft(NULL) , _pRight(NULL) , _pPar...
#pragma once #include <string> #include <vector> /* This is a utility class that reads, creates and stores shader programs for GLSL*/ class ShaderReader { public: enum class shaderType { vertex, fragment }; struct shader { shaderType type; const char* shader; unsigned int shaderObject; ...
// // SMMenuTransitionScene.cpp // FreeTrip // // Created by N15051 on 2020/04/07. // #include "SMMenuTransitionScene.h" #include "../Util/ViewUtil.h" #include "ViewAction.h" SMMenuTransitionScene::SMMenuTransitionScene() : _menuBarTitle("") , _menuBar(nullptr) , _swipeStarted(false) , _prevMenuTitle("") , _toMen...
//============================================================================ // Name : ExperimentalTest.cpp // Author : Goran Kostadinov // Version : // Copyright : // Description : Hello World in C++, Ansi-style //============================================================================ #inclu...
#pragma once #include "std_lib_facilities.h" class Image { static constexpr int N_DIM{ 5 }; public: // Internally used data types typedef short T; typedef std::array<int, N_DIM> dimension; // STL container and iterator typedefs typedef T value_type; typedef T* iterator; typedef const T...
#include <stdio.h> #include <deque> #include <iostream> using namespace std; typedef long long int lli; int main(int argc, char const *argv[]) { int T; scanf("%d", &T); while (T-- > 0) { deque<lli> dq; lli noStations; lli maximumSum; scanf("%lli", &noStations); scanf("%lli", &maximumSum); lli cu...
#pragma once #include "Vehicle.h" #include <string> #include <iostream> #include "math.h" #include "locale.h" #define DEFAULT_FACTOR_OF_SAFITY_CAR 500 // км без ремонта #define DEFAULT_LIFTING_CAPACITY_CAR 450 // кг перевозит без прицепа #define DEFAULT_AVERAGE_SPEED_CAR 80 // км/ч #define DEF...
/*********************************************************************** created: 21/2/2004 author: Paul D Turner purpose: Defines the Property class which forms part of a PropertySet *************************************************************************/ /**************************************************...
#include<bits/stdc++.h> using namespace std; int n, m, ans = 0; struct farmer { int p; int a; }f[5010]; bool cmp(farmer a. farmer b) { if (a.p != b.p) return a.p < b.p; return a.a > b.a; } int main() { freopen("P1208.in", "r", stdin); cin>>n>>m; for (int i = 1; i <= m; ++i) cin>>f[i].p>>f[i].a; sort(f + 1, ...
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <conio.h> #include <string.h> #include <ctype.h> float funcao (float a0,float a1,float a2,float a3,float a4,float a5,float x){ float y; y=a0*cos(a1*x)+a2*sin(a3*x)+exp(a4*x)+a5; return y; } float funcaoderiv (float a0,float a1,...
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. /*=========================================================================== Generated code exported from UnrealHeaderTool. DO NOT modify this manually! Edit the corresponding .h files instead! ==============================================================...
#include <gtest/gtest.h> #include "hs_math/random/normal_random_var.hpp" #include "hs_math/random/uniform_random_var.hpp" #include "hs_sfm/sfm_utility/ransac_fit_plane.hpp" namespace { template <typename _Scalar> class TestRansacFitPlannar { public: typedef _Scalar Scalar; typedef EIGEN_VECTOR(S...
#include "WebGL.hxx" int main() { return WebGLExample().Main(); }
#pragma once #include <map> #include <memory> #include <string> #include <utility> #include <vector> #include "drake/common/eigen_types.h" #include "drake/geometry/frame_kinematics_vector.h" #include "drake/multibody/rigid_body.h" #include "drake/multibody/rigid_body_tree.h" #include "drake/systems/framework/leaf_sys...
/*----------------------------------------------------------------------- Matt Marchant 2015 - 2016 http://trederia.blogspot.com Robomower - Zlib license. 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 thi...
// // Created by nickolay on 21.02.2021. // #ifndef DRONEAPP_VEHICLEDATA_H #define DRONEAPP_VEHICLEDATA_H #include <opencv2/core/core_c.h> #include <QString> #include "../Utils/AsyncVar.h" enum VehicleMode{QUADROCOPTER = 0, CAR = 1}; class VehicleData { public: AsyncVar<CvPoint3D32f> targetpoint{CvPoint3D32f{0...
#include "ros/ros.h" #include "std_msgs/String.h" #include "math.h" #include <algorithm> // std::sort //Librerias propias usadas #include "constantes.hpp" #include "camina8/v_repConst.h" #include "../../Convexhull/vector3d.hpp" #include "../../Convexhull/convexhull.cpp" #include "../../Convexhull/analisis.cpp" // Us...
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) { ListNode* ans = new ListNode(0); ListNode* cur = ans; int ret = 0; while ...
#ifndef __DOG_H #define __DOG_H #include<string> #include "animal.h" class Dog:public Animal{ public: Dog(); Dog(/*Dog_breed breed, */std::string name/*, Gender gender*/, int age); ~Dog(); void family(); void breed(); private: // Dog_breed _breed; }; #endif
const int ledPin = 13; char inByte = 0; char buffer[32]; int pos = 0; void setup() { // put your setup code here, to run once: Serial.begin(9600); } void contralLED(char *str) { int num = atoi(str); Serial.print("num "); Serial.println(num); //digitalWrite(ledPin,HIGH); analogWrite(ledPin, num); } void...
#ifndef HELPERFUNCS_H #define HELPERFUNCS_H #include <string> #include <vector> #include <iostream> #include <limits> #include <cstdio> #define PRINT_DEBUG_INFO 0 #define DEBUG_PRINT(...) \ do { if (PRINT_DEBUG_INFO) std::fprintf(stderr, __VA_ARGS__); } while (0) /** * @brief Pausa o programa a...
#pragma once #include <string> class Subject; class Observer { public: virtual ~Observer() = default; virtual void on_notify(const Subject& subject) const = 0; }; class CelsiusDisplay : public Observer { public: void on_notify(const Subject& subject) const override; }; class KelvinDisplay : public Observer { p...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "../base.h" #include "Windows.Foundation.0.h" #include "Windows.Foundation.Collections.1.h" WINRT_EXPORT namespace winrt { namespace ABI::Windows::Foundation { struct __declspec(uui...
#include <iostream> using namespace std; int factorial(int n){ if (n <= 1) return 1; else return n*factorial(n-1); } int main() { cout << factorial(1000) << endl; return 0; }
/* * Author : BurningTiles * Problem : Swayamvar * File : A.cpp */ #include <algorithm> #include <iostream> #include <vector> using namespace std; int main(){ int n; cin >> n; string temp1,temp2; cin >> temp1 >> temp2; vector<char> bride(temp1.begin(),temp1.e...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update using namespace std; using namespace __gnu_pbds; double INF = 1e100; double EPS = 1e-12; typedef long long int ll; typedef pair < int,int > PII; typedef ...
#include <graphene/chain/loyalty_evaluator.hpp> #include <cmath> namespace graphene { namespace chain { void_result balance_lock_evaluator::do_evaluate(const balance_lock_operation& op) { try { database& _db = db(); // insurs assets FC_ASSERT(op.amount.asset_id == GRAPHENE_INSURS_ASSET, "lock asset must ...
#include "mainwin.h" #include "entrydialog.h" #include <string> Mainwin::Mainwin() : Mainwin{*(new Store)} { } Mainwin::Mainwin(Store& store) : _store{&store} { // ///////////////// // G U I S E T U P // ///////////////// set_default_size(640,480); set_title("Some kind of Sweets shop"); // Set up a...
int Solution::singleNumber(const vector<int> &a) { int n=a.size(); int val=0; for(int i=0;i<n;i++) val^=a[i]; return val; }
/** * **** Code generated by the RIDL Compiler **** * RIDL has been developed by: * Remedy IT * Westervoort, GLD * The Netherlands * http://www.remedy.nl */ #ifndef __RIDL_TESTC_H_HBDCIAAA_INCLUDED__ #define __RIDL_TESTC_H_HBDCIAAA_INCLUDED__ #pragma once #include /**/ "ace/pre.h"...
#include "HeadList.h" struct TMonom { double coeff; int x, y, z; }; bool operator<(const TMonom& p, const TMonom& g) { bool k=false; if (p.x==g.x) { if (p.y==g.y) { if (p.z==g.z) { if (p.coeff<g.coeff) k=true; } else if (p.z<g.z) k=true; } else if (p.y<g.y) k=true; } else if (p.x...
#include "drake/automotive/idm_controller.h" #include <algorithm> #include <limits> #include <utility> #include <vector> #include "drake/common/default_scalars.h" #include "drake/common/drake_assert.h" namespace drake { namespace automotive { using maliput::api::GeoPosition; using maliput::api::GeoPositionT; using ...
#include<iostream> #include<algorithm> #include<initializer_list> #include<memory> using namespace std; //vector是动态数组 //内存遵循的规则,当前的内存不可用的时候,开二倍的内存 template <class T> void destroy(T *pointer) { pointer->~T(); } template <class ForwardIterator> void destroy(ForwardIterator first, ForwardIterator last) { for (F...
// // Created by clo on 13/09/2019. // #include "AudioCapture.h" #include <iostream> using namespace Eigen; template<typename T, T min, T max> static void convertToFloat(ArrayXd & dst, T * src, unsigned long len); int AudioCapture::readCallback(const void * input, void * output, unsig...
#pragma once #include <queue> #include <vector> #include <cmath> #include <iostream> #include "Passenger.h" enum Indicator { UP, DOWN, STOP, NONE }; class Elevator { public: Elevator(int maxFloor) : maxFloor(maxFloor), timer(0), currentFloor(0), achievedPassenger(0) { } void goToFloor(int); // 前往指定楼层 void stop();...
/* BAEKJOON 17281. 야구 DFS + 시뮬레이션 */ #include <iostream> #include <algorithm> #include <cstring> #define MAX 51 using namespace std; int N, Answer = 0; int Game[MAX][10]; int Player[10]; bool Selected[10]; int Roo[4]; void Input() { cin >> N; for(int i = 1; i <= N; i++) { for(int j = 1; j <=...
#include <iostream> #include <algorithm> #include <vector> #include <map> #include <string> #include <set> #include <cmath> #include <list> #include <unordered_map> #include <unordered_set> #include <cstring> #include <climits> #include <queue> #include <assert.h> using namespace std; int N; vector<vector<pair<int,int...
/** * @file ventana.h * @brief Fichero de interfaz gráfica * * Esta interfaz se ha diseñado de la forma más simple y ajustada al problema * Otelo de la asignatura Metodología de la Programación. Está basada en el uso * de la biblioteca SFML. * * El código no está diseñado para su reutilización ni para su manten...
// // SMViewConstValue.h // SMFrameWork // // Created by KimSteve on 2016. 11. 3.. // // #ifndef SMViewConstValue_h #define SMViewConstValue_h #include <base/ccTypes.h> class SMViewConstValue { public: /************************************************************************* 레이어별 로컬 Z Order ...
class TrieCollision{ public: /*float distance(sf::Vector2f depart, sf::Vector2f arrive){ float saveX(arrive.x - depart.x), saveY(arrive.y - depart.y); return sqrt(saveX*saveX + saveY*saveY); } sf::Vector2f astar(sf::Vector2f depart, sf::Vector2f arrive){ }*/ /*void algoAstar(sf::Vector2f act...
#pragma once #include <Transformation.h> #include <iosfwd> class MetaEvent; class Channel{ public: using TransPtr = Transformation::TransPtr; protected: enum class Errors { InvalidEvent, MissingAttribute, IncompatibleType }; TransPtr mTrans; virtual void fixType(MetaEve...
int lib1(); int lib2(); int main() { return lib1() + lib2(); }
#include "../include/loadFile.h" #include <vector> using std::vector; loadFile *loadFile::_loadFile=loadFile::getInstance(); loadFile::AutoRelease loadFile::_auto; loadFile *loadFile::getInstance() { if(!_loadFile) { _loadFile=new loadFile(); } return _loadFile; } void loadFile::loadPageLib(c...
//************************************************************************** //** //** 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 ...
#pragma once struct _DROP_BLOOD { BYTE index[7]; BYTE id[7]; BYTE level[7]; BYTE skill[7]; BYTE luck[7]; BYTE addopt[7]; BYTE addoptex[7]; }; class _blood_castle { public: int blood[7]; _DROP_BLOOD drop[255]; void _iniciar_blood_castle(char * filename); void _blood_drop(LPOBJ lpObj, char vector); private:...
#include<bits/stdc++.h> using namespace std; string solve(string a,string b,string output) { if(a.size()==0 || b.size()==0) { return output; } if(a[0]==b[0]) { output = output + a[0]; return output; } string suni = solve(a.substr(1),b,output); string ani = solve(a,b.substr(1),output); if(suni.s...
#include "mbed.h" DigitalOut arrLeds[3] = {PB_3, PB_5, PB_4}; DigitalIn Button(PC_13); int main() { while (1) { for (int i = 0; i < 3; i += 1) { arrLeds[0] = i == 0; arrLeds[1] = i == 1; arrLeds[2] = i == 2; wait(0.05); } } }
// // FirstScene.hpp // demo_ddz // // Created by 谢小凡 on 2018/2/8. // #ifndef FirstScene_hpp #define FirstScene_hpp #include "cocos2d.h" #include "ui/UIButton.h" class FirstScene : public cocos2d::Scene { public: static cocos2d::Scene* createScene(); static cocos2d::Scene* createEntryScene(); CRE...
#pragma once #include "Common.h" extern int MemoryDebugLevel; #define MEMORY_PROCESS( block, memory ) \ if( MemoryDebugLevel > 0 ) \ Debugger::Memory( block, memory ) #define MEMORY_PROCESS_STR( block, memory ) \ if( MemoryDebugLevel > 1 ) \ Debugger::MemorySt...
#include <sstream> #include <iomanip> #include "cqp.h" #include "pee.h" #include "appmain.h" #include "group.h" #include "cpp-base64/base64.h" namespace pee { void modifyCurrency(int64_t qq, int64_t c) { db.exec("UPDATE pee SET currency=? WHERE qqid=?", { c, qq }); } void modifyBoxCount(int64_t qq, ...
#include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include "opencv2/core/core.hpp" #include <algorithm> #include <math.h> using namespace cv; using namespace std; int main() { int x = 0, y = 0, n; Mat img = imread("C:\\Users\\ariji\\Desktop\\Extra\\im...
#ifndef OBSERVE_LOOP_TREE #define OBSERVE_LOOP_TREE #include <DepRel.h> #include <ObserveObject.h> #include <SymbolicBound.h> class LoopTreeNode; class BlockLoopInfo ; class MergeLoopInfo ; class DistNodeInfo ; class SwapNodeInfo ; class InsertLoopInfo; class MergeStmtLoopInfo ; class SwapStmtLoopInfo; class DeleteS...
#include <iostream> #include <conio.h> #define _WIN32_WINNT 0x0500 #include<windows.h> #include <string> #include "Design.h" using namespace std; bool recaptcha(string u, string p) { char temp1[100],temp2[100]; int a; FILE *fp_userpass = fopen("../userpass.txt","w"); while (fscanf(fp_userpass, "%s\t%s", temp1, tem...
#include "mainwindow.h" #include "ui_mainwindow.h" #include <functionstree.h> #include <bintree.h> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); scene = new QGraphicsScene; ui->graphicsView->setScene(scene); } MainWindow::~MainWindow()...
#include "span/Sleep.hh" #include "span/Common.hh" #include "span/exceptions/Assert.hh" #include "span/fibers/Fiber.hh" #include "span/fibers/Scheduler.hh" #include "span/Timer.hh" namespace span { static void scheduleMe(fibers::Scheduler *scheduler, fibers::Fiber::ptr fiber) { scheduler->schedule(fiber); } ...
#pragma once #include <dsnutil/chrono/dsnutil_cpp_chrono_Export.h> #include <dsnutil/chrono/duration.hpp> #include <dsnutil/chrono/time_point.hpp> namespace dsn { namespace chrono { class dsnutil_cpp_chrono_EXPORT timer { protected: time_point m_point; public: time_point point() const; ...
#ifndef __WHISKEY_AST_Predicates_HPP #define __WHISKEY_AST_Predicates_HPP #include <whiskey/AST/NodeType.hpp> namespace whiskey { enum class Arity { Unary, Binary, NAry }; bool isAtomicType(NodeType type); bool isLiteralExpr(NodeType type); bool isOpExpr(NodeType type); Arity getExprArity(NodeType type); } #endi...
#include "mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { this->setupMenu(); } void MainWindow::setupMenu() { QMenuBar* menuBar = this->menuBar(); menuProfiles = new QMenu("Profils"); menuAPI = new QMenu("API"); QAction *manageProfiles = new QAction("Gérer les profi...
/* COMP11 Fall 2017 * Homework 6 * Ryan Sheehan * Signoff by [Leah Stern] [11/16/2017]*/ #ifndef Score_H #define Score_H using namespace std; class Score { private: // current score int total_score; public: // constructor Score(); // show top 5 highscores void show_highscores(); // sort hi...
#include "framework.h" #include "node.h" #include "headers.h" using namespace std; using namespace Gdiplus; extern HWND ghWnd; extern HDC hMainDC; extern HDC hBufferDC; extern HDC hBackBufferDC; map<string, MapManager::TilesetData> MapManager::tilesetTable; map<string, Map::MapData> MapManager::mapTable; Map* MapMan...
#include "LineTracer.h" LineTracer::LineTracer( ushort hx, ushort hy, ushort tx, ushort ty, ushort maxhx, ushort maxhy, float angle, bool is_square ) { maxHx = maxhx; maxHy = maxhy; if( is_square ) { dir = atan2( (float) ( ty - hy ), (float) ( tx - hx ) ) + angle; dx = cos( d...
#ifndef NULL #define NULL 0 #endif #define MAX_LEN_RC 150 #define MAX_LEN_NAME 10 #define SIZE 150*150 #define BUF_SIZE 100000 void strcpy(char* dest, char* origin) { while (*origin && ('a'<=*origin && *origin <='z')) *dest++ = *origin++; *dest = 0; } int strcmp(char* s1, char* s2) { while (('a'<=*s1 && *s1<='z')...
/** * Trying to figure out how to return huge objects when they are created * inside a function or changed inside a function (i.e. avoiding copy constructors). * * Code and output should be easy to understand. */ #include <iostream> using namespace std; class InnerDummy { public: InnerDummy(){ cout << "\...
// // CommonDefineSet.hpp // demo_ddz // // Created by 谢小凡 on 2018/2/13. // #ifndef CommonDefineSet_hpp #define CommonDefineSet_hpp namespace _xxf { /** * opt_event_name set 玩家的牌局按钮选项操作 */ const std::string en_call = "en_call"; const std::string en_nocall = "en_nocall"; const std::string en_bet_one = ...
#include <iostream> #include <cmath> using namespace std; double Mean(double x[], int N); double StdDev(double x[], double mean, int N); void instrucciones(int&); void SoliData(double x[], int);//esta función guarda los datos en el arreglo x[] //el arreglo se pasa a la función como de costumbre //a...
#include <bits/stdc++.h> using namespace std; int findMaxConsecutiveOnes(vector<int> &nums) { int ans = 0, itr = 0, curr = 0; while (itr < nums.size()) { if (nums[itr] != 1) curr = 0; else { curr++; ans = max(curr, ans); } itr++; ...
#include <bits/stdc++.h> using namespace std; class Solution { public: map<int, int> m; void solve(int n) { int sol = 0; for (int i = 1; i <= n; i++) { sol += (m[i - 1] * m[n - i]); } m[n] = sol; } int numTrees(int n) { m[0] = 1, m[1]...
#include <iostream> using namespace std; class B; class A { // 友元类, 要在前面声明 friend class B; public: string name; A() { } A(string name, int age) : name(name), age(age) { } private: int age; }; class B { public: A a; string name; B(string name, int age, A &a) : name...
// // Created by Benjamin Steinert on 05/11/15. // #ifndef CHROMA_CPP_BENCHMARKS_HAYAI_JSON_OUTPUTTER_MOD_HPP #define CHROMA_CPP_BENCHMARKS_HAYAI_JSON_OUTPUTTER_MOD_HPP #include "hayai_outputter.hpp" #include "hayai_console.hpp" #include <vector> #include <string> #include <cstddef> #include <sstream> namespace mod...
/** * @file Optimizer.h * @brief Class implementing batch and incremental nonlinear equation solvers. * @author Michael Kaess * @author David Rosen * @version $Id: Optimizer.h 6368 2012-03-28 23:01:19Z kaess $ * * Copyright (C) 2009-2013 Massachusetts Institute of Technology. * Michael Kaess, Hordur Johannsson,...