text
stringlengths
8
6.88M
#pragma once #include "stdafx.h" #include <iostream> #include <string> #include <fstream> using namespace std; class Data { private: string m_make; string m_model; int m_body_type; int m_fuel; int m_transmission; int m_engine_size; int m_year; int m_value; string convert_for_save(string, string, int, int, in...
#include <bits/stdc++.h> #include <cassert> #define rep(i,n) for (int i = 0; i < (n); ++i) #define ok() puts(ok?"Yes":"No"); #define chmax(x,y) x = max(x,y) #define chmin(x,y) x = min(x,y) using namespace std; using ll = long long; using vi = vector<int>; using vll = vector<ll>; using ii = pair<int, int>; using vvi = v...
#ifndef RPCONTACT_h #define RPCONTACT_h #include <Arduino.h> class RpContact : public RpSensor { public: RpContact(byte pin); void loop(); void receiveCReq(const MyMessage &message); private: byte _pin; uint32_t _luxValue; int _prevLuxValue; uint32_t _lastSend; byte _prev_door; }; #endif
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
#include <cstddef> #include <list> #include <iostream> #include <fstream> #include "Node.h" using namespace std; /********************* * Factorial and nCr * ********************/ // lmao no built in factorial size_t fact(size_t n){ return (n==0) || (n==1) ? 1 : n* fact(n-1); } // and here's an N choose R I...
#include <cmath> #include <functional> #include <mathtoolbox/probability-distributions.hpp> #include <random> double CalculateNumericalDifferentiation(const std::function<double(double)>& f, const double x, const double h = 1e-04) { return (-f(x + 2.0 * h) + 8.0 * f(x + h) - 8.0 * f(x - h) + f(x - 2.0 * h)) / (12....
/************************************************************* * > File Name : UVa11694.cpp * > Author : Tony * > Created Time : 2019/08/20 12:39:01 * > Algorithm : dfs **************************************************************/ #include <bits/stdc++.h> using namespace std; inl...
#include <iostream> #include <string> using namespace std; int main() { char grad; string result; cout << "We are going to tell you what kind of student you are." << endl; cout << "Enter your letter grade." << endl; cin >> grad; grad = toupper(grad); switch (grad) { case 'A': result = "Exce...
/* * LifeGame.h * * Created on: Jun 3, 2017 * Author: root */ #include <vector> #include <iostream> #include <stdlib.h> #include <unistd.h> #include <string> #include <cstring> #include <set> using namespace std; #ifndef SRC_LIFEGAME_H_ #define SRC_LIFEGAME_H_ vector<string> split(string& str,const char*...
/* * File: CSynch.hpp * Author: asalazar * * Created on May 5, 2015, 10:25 AM */ #ifndef SSYNC_HPP #define SSYNC_HPP #include <errno.h> #include <stdlib.h> #include <pthread.h> #include "TimeUtils.hpp" #include "SMutex.hpp" const long long FIX_TIME_MILLIS_TO_NANO = 1000000UL; class SSync { private: pt...
#include<bits/stdc++.h> using namespace std; #define mp make_pair typedef long long ll; typedef vector<int> vi; typedef pair<int,int> pi; #define F first #define S second #define PB push_back #define MP make_pair; #define REP(i, a, b) for(int i = a; i <= b; i++) int m = 1e9 + 7; vector<int>subset; void subset_gen(int k...
#include <bits/stdc++.h> using namespace std; const int INF = std::numeric_limits<int>::max() / 3; #define MEM(arr,val)memset((arr),(val), sizeof (arr)) #define PI (acos(0)*2.0) #define eps (1.0e-9) #define are_equal(a,b)fabs((a)-(b))<eps #define abs_val(a)((a)>=0)?(a):(-(a)) #define LS(b)(b&(-(b))) // Least signific...
#ifndef CELLO_SCREEN_H #define CELLO_SCREEN_H #include <gameplay.h> using gameplay::Control; using gameplay::Keyboard; using gameplay::Mouse; using gameplay::Rectangle; using gameplay::Touch; namespace cello { class Atlas; class GameManager; class Sprite; class Screen : protected Control::Listener { public: Scree...
#include "UnitTrail.h" #include <glad/glad.h> #include <GLFW/glfw3.h> #include <vector> #include <numeric> #include <cassert> #include "Shader.h" #include "Error.h" namespace solar { namespace openGL { namespace { // Maximum number of points in one lineTrail. // GPU Memory footprint: // - maxLength*2*4...
// Count all palindromic subsequence #include<bits/stdc++.h> using namespace std; // recursion int solve(string input,int i,int j) { if(i > j) { return 0;// invalid } if(i==j) { return 1; } if(input[i]==input[j]) { return 1 + solve(input,i+1,j) + solve(input,i,j-1); } return solve(input,i+1,j)+solve(i...
#include <ESP8266WiFi.h> const char* SSID = "HP LaserJet P1505n"; const char* PASS = "vQ1tASKOUu"; char server[] = "smtp.1und1.de"; WiFiClient client; byte sendEmail(); byte eRcv(); void setup() { Serial.begin(74880); delay(10); Serial.println(""); Serial.println(""); Serial.print("Connecting To "); Seria...
/* 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...
/** * @file server.cpp * @author dvv <dvv@avauntguard.com> * @brief A relay DNS server using Boost Asio threadpool */ #include "server.h" using boost::asio::ip::udp; namespace screenDNS { server::server( int port, std::size_t thread_pool_size) // Initialisation : thread_pool_size_(thread_pool_s...
#include "ZUI_wndproc_h.inl" #include "ZUI_MAIN_MENU_tables_h.inl" #include "ZUI_SCREEN_SAVER_tables_h.inl" #include "ZUI_CHANNEL_INFO_ATSC_tables_h.inl" #include "ZUI_CHANNEL_INFO_tables_h.inl" #include "ZUI_PROGRAM_EDIT_tables_h.inl" #include "ZUI_DTV_MANUAL_TUNING_tables_h.inl" #include "ZUI_ATV_MANUAL_TUNI...
//what is need of function overriding ???? #include<iostream> using namespace std; class cBase { public: void fun1() { cout<<"in base fun1"<<endl; } }; class cDerived:public cBase { public: void fun1() { cout<<"in cDerived fun1"<<endl; } void fun2() { cout<<"in Cderived fun2"<<endl; } }; ...
/** * Copyright (C) 2017 Alibaba Group Holding Limited. 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 * * ...
# ifndef JAVABACKENDCOMPILER_INSTRUCTION_H # define JAVABACKENDCOMPILER_INSTRUCTION_H # include <iostream> # include "Instruction.hpp" class Value { protected: int value; public: Value(); Value(int value); virtual std::string getString(); }; class AbstractVariable : public Value { bool isStack; public:...
#include "drake/tools/vector_gen/test/gen/sample.h" #include <cmath> #include <gtest/gtest.h> #include "drake/common/autodiff.h" #include "drake/common/symbolic.h" namespace drake { namespace tools { namespace test { namespace { // We don't really expect the Sample<T> implementation to fail, but we'd like // to to...
// defs.h - definitions and typedefs // (c) 1998-1999 Michael Fink // https://github.com/vividos/OldStuff/ // herein are some popular typedefs to make life a bit easier. there is also // a (recommended) base class 'object' for all derived classes #ifndef __defs_h_ #define __defs_h_ // basic typedefs typedef unsigned ...
#include<stdio.h> struct data { char *name; char *date; int moves; int size; struct data *left; struct data *right; }; struct board { int **table; int size; int empty_Tiles; }; struct player { char *name; int no_of_moves; int state; char* time; }; int fib[] = { 0, 1, 1, 2, 3, 5, 8,...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "SWeapon.generated.h" class USkeletalMeshComponent; class UDamageType; class UParticleSystem; class UCameraShake; USTRUCT() struct FHitScanTrace { GENERATED...
#include<stdio.h> int main() { int a,b,c,count; while(scanf("%d",&a)!=EOF) { count=a; while(a>1) { if(a==2) a++; b=a/3; c=a%3; a=b+c; count=count+b; } printf("%d\n",count); } return 0;...
#include<bits/stdc++.h> using namespace std; int main() { int n,a,b; cin>>n>>a>>b; int x=0,y=0,flag=0; while(x>=0) { x=(n-y*b)/a; if(a*x+b*y==n&&x>=0){ flag++; break; } y++; } if(flag>0){ ...
#pragma once #include "analysis/physics/Physics.h" #include "analysis/utils/A2GeoAcceptance.h" #include "analysis/utils/particle_tools.h" #include "analysis/utils/Fitter.h" #include "analysis/utils/Uncertainties.h" #include "analysis/plot/PromptRandomHist.h" #include "base/Tree.h" #include "base/interval.h" #include "...
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) 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; typedef map<string, int> msi; typede...
// 백준 스타트와 링크 14889 #include <iostream> #include <stack> using namespace std; int MIN = 1000000000; int table[20][20] = { {0,}, }; bool visitTable[20] = { {false}, }; int N = 0; void DFS(int, int); void DivideTeam(); int GetScore(int*); void DFS(int s, int len) { if (len >= N / 2) { DivideTeam(); return; }...
class Solution { public: vector<int> findErrorNums(vector<int>& nums) { sort(nums.begin(), nums.end()); int pos = 1; int dup; int sum = nums[0]; while(pos < nums.size()) { if (nums[pos - 1] == nums[pos]) { dup = nums[pos]; } ...
#include <iostream> using namespace std; int main() { int n; cout<<"n= "; cin>>n; long sum =0; int step; cout<< "qaysi son darajasi kerak "; cin>> step; long temp= step; while(temp<=n) { sum +=temp; temp*=step; } cout<<sum; return 0; }
//prgrm for factorial of a no. #include<iostream.h> #include<conio.h> void main() { clrscr(); int num,fact=1; cout<<"Enter the number: "; cin>>num; for(int i=1;i<=num;i++) fact=fact*i; cout<<endl<<"The factorial of the given number is: "<<fact; getch(); }
#include "MoveUpEvent.hpp" MoveUpEvent::MoveUpEvent(){ EventName = "4MoveUpEvent"; } MoveUpEvent::MoveUpEvent(string s){ for(int i = 0; i<s.size(); i++){ if(s.at(i)=='!'){ break; } EventName +=s.at(i); } } string MoveUpEvent::EventToString(){ return...
#pragma once #include <math.h> #include "app.h" #include "game_save.h" #include "slot2_cartridge.h" // 128KByte size #define GEN3_SAVE_FILE_BYTES (128 * 1024) // Offsets #define GAME_SAVE_A_OFFSET 0x000000 #define GAME_SAVE_B_OFFSET 0x00E000 #define HALL_OF_FAME_OFFSET 0x01C000 #define MYSTERY_GIFT_O...
// // Created by Nitish Mohan Shandilya on 7/3/20. // #include "NodeFactory.cpp" BinaryTreeNode<int>* createTree() { BinaryTreeNode<int>* const root = (BinaryTreeNode<int>*)NodeFactory<int>::createNode(3, TypeOfNode::BINARY_TREE_NODE); BinaryTreeNode<int>* const n1 = (BinaryTreeNode<int>*)Node...
#include "Particle.h" #include "AsyncPulseIn.h" #include "RingBuffer.h" static const size_t PULSEINFO_SIZE = 32; static AsyncPulseInPulseInfo pulseInfoBuffer[PULSEINFO_SIZE]; static RingBuffer<AsyncPulseInPulseInfo> ringBuffer(pulseInfoBuffer, PULSEINFO_SIZE); AsyncPulseIn::AsyncPulseIn(int pin, int pulseType) : pin...
/* --COPYRIGHT--,BSD * Copyright (c) 2011, Texas Instruments Incorporated * 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 copy...
#ifndef BOOSTEDTTH_BOOSTEDPRODUCERS_BOOSTEDJETMATCHER_H #define BOOSTEDTTH_BOOSTEDPRODUCERS_BOOSTEDJETMATCHER_H 1 // -*- C++ -*- // // Package: BoostedTTH/BoostedProducer/BoostedJetMatcher // Class: BoostedJetMatcher // /**\class BoostedJetMatcher BoostedJetMatcher.cc BoostedTTH/BoostedProducer/plugins/Booste...
// Find middle element // push element to mystack // pop element from the mystack // delete middle element // finding middle element , push and pop operations take O(1) time // but deleting middle element in arrays is not possible // if we use singly linked list deleting middle element takes O(N) // so it's better to...
#include "..\Render\Textrure.h" #include "..\GLRender\opengl.h" Textrure::~Textrure() { } class gl_Textrure : public Textrure { public: gl_Textrure(const unsigned char versionGL[2]); virtual ~gl_Textrure() override; private: }; gl_Textrure::gl_Textrure(const unsigned char versionGL[2]) { } gl_Textrure::~gl_T...
//----------------------------------Heuristica.h #ifndef HEURISTICA_H_INCLUDED #define HEURISTICA_H_INCLUDED class Heuristica{ private: public: Heuristica(){}; int pecasFora(int* estado, int size_N); }; #endif // HEURISTICA_H_INCLUDED //----------------------------------------Heuristica.cpp #in...
#include "Vec3f.h" #ifndef __RAY_INCLUDE__ #define __RAY_INCLUDE__ class Ray { private: Vec3f pOrigin; Vec3f pDirection; public: Ray(Vec3f Origin, Vec3f Direction); //Get Methods Vec3f getOrigin(); Vec3f getDirection(); //Rendering Methods Vec3f getFromT(double T);...
#include "ros/ros.h" #include "std_msgs/String.h" //Librerias propias usadas #include "../src/constantes.hpp" #include "comm.hpp" #include "camina/v_repConst.h" // Used data structures: #include "camina/commData.h" // Used API services: #include "vrep_common/VrepInfo.h" #include <stdio.h> #include <stdlib.h> #include ...
/* * Copyright 2018 Roman Katuntsev <sbkarr@stappler.org> * * 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 ap...
/************************************************************* * > File Name : c1085_1.cpp * > Author : Tony * > Created Time : 2019/11/06 20:32:13 * > Algorithm : **************************************************************/ #include <bits/stdc++.h> using namespace std; typedef ...
#include<cstdio> #include<sstream> #include<cstdlib> #include <iomanip> #include<cctype> #include<cmath> #include<algorithm> #include<set> #include<queue> #include<stack> #include<list> #include<iostream> #include<fstream> #include<numeric> #include<string> #include<vector> #include<cstring> #include<map> #include<iter...
using namespace std; #include <iostream> int Input(int &a, int &b); int main() { int a, b; if (Input(a, b) == false) { cerr << "error"; return 1; } int s = a + b; cout << "sum = " << s << endl; return 0; } int Input(int&a, int &b) { cout << " Input number a and b " << endl; cin >> a; cin >> b; if (...
#include "graph.hpp" #include <stdexcept> #include <fstream> #include <libxml/parser.h> #include <libxml/tree.h> namespace { template <typename V, typename F> Graph<V> readVertices(F vertexCreator, const xmlNodePtr root_element) { Graph<V> g; for (xmlNodePtr cur_node = root_element->children; cur_node; cur_node...
class Solution { public: int numSubarrayProductLessThanK(vector<int>& nums, int k) { int res = 0, left = 0, subproduct = 1; // subwindow of product < k for (int i = 0; i < (int)nums.size(); ++i) { subproduct *= nums[i]; while (left <= i && subproduc >= k) { su...
#include "BleedState.hpp" #include "../StandState/StandState.h" BleedState::BleedState(GamePlayer* gp, int Direction) :GameState(gp) { gp->setVx(30.0f*Direction); gp->setVy(5.0f); timeBleed = 0.0f; } void BleedState::update(float dt) { if (gp->getAnimation()->getCurrentColumn() >= 8) gp->setState(new StandState...
#include <iostream> using namespace std; float ser(float x,int n){ int fac = 1,i; float s = x; int f = 1; for (i=3;i<=n;i = i+2){ fac = (i-1)*i; f==1?s=s-((s*x*x)/fac):s=s+((s*x*x)/fac); f = f*(-1); } return s; } int main(){ int n; float x,sum; cout<<"Enter a odd n:"; cin>>n; cout<<"Enter x:"; cin>>...
#include<graphics.h> #include<stdlib.h> #include<ctype.h> #include<stdio.h> #include<conio.h> #include<math.h> #include<dos.h> void Draw_graphic(); int get_key(void); void Print_Screen(); void int_to_string(int a); char ST[10]; void BLOCK1(); void BLOCK2(); void BLOCK3(); int current_block_array[3][3];...
#include <Doors.h> #include <Slope.h> #include <Wheels.h> #include <Gimbal.h> #include <Regexp.h> // Pin definitions (pre-processor) #define DOOR_L_PIN 25 #define DOOR_R_PIN 1 #define SLOPE_PIN 0 #define WHEEL_L_ENABLE 6 #define WHEEL_R_ENABLE 5 #define WHEEL_L1_PIN 8 #define WHEEL_L2_PIN 7 #define WHEEL_R1_PIN 2 #def...
#include<iostream> #include<string> #include<queue> #include "hNode.h" #include<map> #include<fstream> #include<vector> #include <sstream> using namespace std; void readFreqs(string , int&, map<string,float>& ); void encode( hNode* , string ); void writeCompressed( string , string , map<string,string>&); class compar...
class Solution { public: int firstUniqChar(string s) { unordered_map<int, pair<int, int>> table; for (int i = 0; i < s.length(); i++) { if (table.find(s[i]) == table.end()) table[s[i]] = make_pair(i, 1); else table[s[i]].second++; } ...
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; char* merge(char *, char*); int f(char *); int main() { char *a; char *b; char *c; int n, m, t; int *ans; //char buffer; cin >> t; ans = new int[t]; for(int i = 0; i < t; i++) { cin >> n; cin >> m; a = ne...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* head.hpp :+: :+: :+: ...
#ifndef RTCDEBUGGER_H #define RTCDEBUGGER_H #include "I2CBus.h" #include "DS3231Registers.h" class RtcDebugger { I2CBus* _bus; public: RtcDebugger(I2CBus* bus); void ShowRegister(DS3231RegisterId reg); private: void ShowSeconds(byte data); void ShowMinutes(byte data); void...
#include "DXUT.h" #include "cGaugeUI.h" cGaugeUI::cGaugeUI(void) :m_fGauge( 0.0f ) ,m_fTime( 0.0f ) ,m_fMaxGauge( 0.0f ) { } cGaugeUI::~cGaugeUI(void) { } void cGaugeUI::Init() { m_fMaxGauge = 100.0f; m_fTime = 0.0f; } void cGaugeUI::Update() { m_fTime += _GETSINGLE( cSystemMgr )->GetDeltaTime(); if( m_fTim...
/* 21. Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: Input: 1->2->4, 1->3->4 Output: 1->1->2->3->4->4*/ #include <vector> struct ListNode { int val; ListNode *next; ListNode(int x) : val...
#include <iostream> #include <cstdlib> #include <time.h> using namespace std; int MyFun(int ar[], int N); int main() { /*int N,r,y; cout<<"Enter Array Size: "; cin>>N; y=N-2; int *arrr; arrr=new int[N]; srand (time(NULL)); r= (rand() % y)+3; for(int i=0;i<N;i++) { if(i>=r) { ar...
//////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2006-2010 MStar Semiconductor, Inc. // All rights reserved. // // Unless otherwise stipulated in writing, any and all information contained // herein regardless in any format shall remain the sole proprietary of ...
#ifndef __PANEL_SCENE_H__ #define __PANEL_SCENE_H__ #include "Panel.h" #include "imgui/imgui.h" #include "MathGeoLib/include/Math/float2.h" #include "imGuizmo/ImGuizmo.h" class ComponentCamera; class ComponentTransform; struct AssetFile; class PanelScene : public Panel { public: PanelScene(std::string name, bool act...
/*============================================================================== Copyright (c) Laboratory for Percutaneous Surgery (PerkLab) Queen's University, Kingston, ON, Canada. All Rights Reserved. See COPYRIGHT.txt or http://www.slicer.org/copyright/copyright.txt for details. Unless required by appl...
/*Source Code to demonstrate the working of constructor in C++ Programming */ /* This program calculates the area of a rectangle and displays it. */ #include <iostream> using namespace std; class Area { private: int length; int breadth; public: Area(): length(5), breadth(2){ cout<<"...
#include "Common.h" #include <cmath> int main() { auto lines = getLines(getFileContents("../input/Day13/input.txt")); auto list = split(lines[1], ','); auto time = std::stol(lines[0]); auto strs = std::vector<std::string>(); auto buses = std::vector<long>(); auto diff = std::vector<long>(); auto getMult...
class Solution { public: int findTargetSumWays(vector<int>& nums, int S) { vector<unordered_map<int, int>> dp(nums.size()); // start--sumWays return findTargetSumWays(nums, S, 0, dp); } int findTargetSumWays(vector<int> & nums, unsigned int sum, int start, vector<unordered_map<int, int>> &dp...
#ifdef HAS_VTK #include <irtkImage.h> #include <vtkPolyData.h> #include <vtkPolyDataAlgorithm.h> #include <vtkPolyDataNormals.h> #include <vtkPolyDataReader.h> #include <vtkPolyDataWriter.h> void usage(){ cerr << "polydatareflect [in] [out] [-x|-y|-z]" << endl; exit(1); } char *input_name = NULL, *output_name...
#ifndef VERTEXARRAYGL_H #define VERTEXARRAYGL_H #include "renderer/gl/VertexBufferAttribGL.h" #include "renderer/gl/IndexBufferGL.h" #include "renderer/VertexArray.h" namespace revel { namespace renderer { namespace gl { class VertexArrayGL : public VertexArray { public: VertexArrayGL(); virtual ~VertexArra...
/* argument.h -*- C++ -*- Rémi Attab (remi.attab@gmail.com), 29 Mar 2014 FreeBSD-style copyright and disclaimer apply Tuple of Type, RefType and isConst. \todo Need to find a better name. */ #include "reflect.h" #pragma once namespace reflect { /*************************...
/* 原理: 将测试点的Y坐标与多边形的每一个点进行比较, ** 会得到测试点所在的行与多边形边的所有交点。 ** 如果测试点的两边点的个数都是奇数个, ** 则该测试点在多边形内,否则在多边形外。 */ #include <stdio.h> #include <iostream> /* 函数功能: 判断点(x, y)是否在有ploy_sides个顶点的多边形内 */ /* 参数: poly_sides 测试多边形的顶点数 ** poly_x 测试多边形的各个顶点的X轴坐标 ** poly_y 测试多边形的各个顶点的Y轴坐标 ** x 测试点的X轴坐标 ...
#ifndef MAP_H #define MAP_H #include "./point.h" #include <exception> class map { public: map(int width, int height); virtual ~map(); int getHeight(); int getWidth(); void getPoint(int x, int y); private: int width; int height; point *map; }; #endif // MAP_H
////////////////////////////////////////////////////////////////////////////// // NoLifeClient - Part of the NoLifeStory project // // Copyright (C) 2013 Peter Atashian // // // // T...
/* * Copyright (C) 2019 TU Dresden * All rights reserved. * * Authors: * Christian Menard */ #pragma once #include <condition_variable> #include <functional> #include <future> #include <map> #include <mutex> #include <set> #include <thread> #include <vector> #include "fwd.hh" #include "logical_time.hh" name...
#pragma once #include "easytf/base.h" #include "easytf/operator.h" namespace easytf { class OP_Convolution : public Operator { public: //meta string //shape const static std::string meta_kernel_num; const static std::string meta_kernel_channel; const static std::string meta_kernel_width; const static st...
#include "ContraGame.h" ContraGame::ContraGame(HINSTANCE hInstance, LPWSTR title) : Game(hInstance, title, WINDOW_WIDTH, WINDOW_HEIGHT) { } ContraGame::~ContraGame() { } void ContraGame::init() { Game::init(); #if _DEBUG SceneManager::getInstance()->addScene(new Stage3(30)); //SceneManager::getInstance()->addSc...
#ifndef IMAGEDISPLAYWIDGET_H #define IMAGEDISPLAYWIDGET_H #include <QWidget> #include <QGridLayout> #include <QScrollArea> #include <QLabel> #include <QResizeEvent> class ImageDisplayWidget : public QWidget { Q_OBJECT public: explicit ImageDisplayWidget(QWidget *parent = 0); ~ImageDisplayWid...
//$Id: StatisticRejectFilter.cpp 1398 2015-03-03 14:10:37Z tdnguyen $ //------------------------------------------------------------------------------ // StatisticRejectFilter //------------------------------------------------------------------------------ // GMAT: General Mission Analys...
#ifndef TRANSFORMATION_OPTIONS_H #define TRANSFORMATION_OPTIONS_H class TransformationAssertion { public: enum TransformationOption { UnknownTransformationOption = 0, LastTransformationOptionTag = 99 }; // Provide a way to spe...
// // Copyright Jason Rice 2017 // 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_APPLY_MESSAGE_HPP #define NBDL_FWD_APPLY_MESSAGE_HPP #include <nbdl/concept/NetworkStore.hpp> namespace nbdl {...
#include "algorithmUnity.h" #include "myalloc.h" #include <ctime> #include <ctime> #include <cstdio> #include <cstdlib> #include <cstring> #include <cassert> #include <set> #include <utility> #include "test.h" #include <algorithm> extern int gsi; extern void staticTestPrint(); void test_DY_remove() { cout << "test r...
#include "server/handlers/Root.hpp" #include <boost/beast/http.hpp> #include <memory> namespace bs { ResponseShPtr<> Root::Handle(Request<>&& request) { auto res{ std::make_shared<Response<>>(http::status::ok, request.version()) }; res->set(http::field::server, "Beast"); res->body() = "Ok"; res->prepare_paylo...
/* C++ program to create class to get and print details of a student */ #include<iostream> class Student { private: int rollNo; std::string name; double percent; public: void setDetails(int, std::string, double); void printDetails(); }; void Student::setDetails(int i, std::string n, dou...
#ifndef ALIVEMESSAGE_H #define ALIVEMESSAGE_H #include "Message.h" #include <time.h> class AliveMessage : public Message { public: AliveMessage() { m_src = -1; m_dst = -1; } AliveMessage(INT p_src_Id) { m_src = p_src_Id ; m_dst = -1; } }; #endif // ALIVEMESSAGE...
#include "VHS.h" //******************************************************** VHS VHS :: VHS(const string id, const string date, const string title, const string auteur, const string maison_prod, const string duree) : document(id, date, title) { set_auteur(auteur); set_maison_prod(maison_prod); set_duree(duree); }...
#include <iostream> #include <fstream> #include <string> #include <vector> #include <ctime> #include "defs.h" using namespace std; string alphabet = DNA; int sigma = 4; double ** pattern; double ** text; double z; int m; int n; int main ( int argc, char ** argv ) { TSwitch sw; string pattern_file; strin...
#pragma once #include <string> #include <cstdlib> #include <vector> #include "multiplayer.h" #include "macro.h" #include "OptionChoice.hpp" struct playerInfo{ playerInfo(int numm, int xx, int yy, std::string const& namee) : num(numm), x(xx), y(yy), name(namee) {} int num; int x; int y; std::string name; }; clas...
//-------------------------------------------------------------- //-------------------------------------------------------------- // // AngraSimulation detector construction implementation file // Final Version of the Geometry // // Authors: P.Chimenti, R.Lima, G. Valdiviesso // // 27-12-2011, v0.02 // //---------...
/************************************************************************* > File Name: thread.cpp > Author: wk > Mail: 18402927708@163.com > Created Time: Sat 17 Sep 2016 03:54:24 PM CST ************************************************************************/ #include<iostream> #include<stdio.h> #include<pthrea...
#include "inc/main.h" #include <ctime> #include "inc/ctpl_stl.h" #include "inc/SQLConnectionPool.h" //extern Con(hash<string>()(jobid)^hash<string>()(jobid))fig *config; using namespace std; using namespace Json; void ReplaceAll(std::string &str, const std::string& from, const std::string& to){ size_t star...
#pragma warning (disable : 4075) #include <windows.h> #include "Engine.h" #include "MyGame.h" #define USEBSP int WINAPI WinMain(HINSTANCE hInstance, //is a handle to the instance of the program you are writing. HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { kyrbos::Engine engine(hInstance,...
// // Created by abrdej on 20.12.17. // #ifndef PIGEONWAR_COMMON_DATA_H #define PIGEONWAR_COMMON_DATA_H #include <unordered_set> #include <unordered_map> #include <board_container.h> #include <states.h> #include <external/json.hpp> static const auto no_selection = std::numeric_limits<std::uint32_t>::max(); struct...
#include <iostream> #include <cmath> #include <fstream> #include <vector> #include <cstdlib> #include <glad/glad.h> #include <GLFW/glfw3.h> #define GLM_FORCE_RADIANS #include <glm/glm.hpp> #include <glm/gtx/transform.hpp> #include <glm/gtc/matrix_transform.hpp> void draw(GLFWwindow*) ; using namespace std; void handl...
#include <iostream> int subtraction (int a, int b) { int r; r = a-b; return (r); } int main() { int x=10000, y=1231; int z=2922, u=28; z = subtraction (3032,2012); std::cout << "Result of first subtraction >" << z << "\n"; std::cout << "\n"; std::cout << "Result of second subtraction >" << subtraction (303...
#ifndef BSCHEDULER_DAEMON_PROBE_HH #define BSCHEDULER_DAEMON_PROBE_HH #include <unistdx/net/socket_address> #include <unistdx/net/interface_address> #include <unistdx/net/ipv4_address> #include <bscheduler/api.hh> namespace bsc { class probe: public bsc::kernel { public: typedef sys::ipv4_address addr_type; ...
//////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2006-2010 MStar Semiconductor, Inc. // All rights reserved. // // Unless otherwise stipulated in writing, any and all information contained // herein regardless in any format shall remain the sole proprietary of ...
/*************************************************************************** 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...
class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { vector<int> ret_value; vector<int>::iterator it; vector< pair<int,int> > v; for (it = nums.begin(); it != nums.end(); ++it) v.push_back(make_pair(*it, it - nums.begin())); sort (v.be...