text
stringlengths
8
6.88M
#include <iostream> #include <cstring> #include "liveMedia.hh" #include "ffmpeg_demux.h" #include "BasicUsageEnvironment.hh" #include "ffmpeg_demuxed_elementary_stream.h" extern "C" { #include "libavutil/avutil.h" #include "libavformat/avformat.h" #include "libavcodec/avcodec.h" } class SavedData { publ...
#include <stdio.h> #include <vector> #pragma warning (disable:4996) using namespace std; #define FRAME 10 /* 볼링 계산 방법 구형(2018년 개정 전) 1824043 강등원 */ int T; FILE* fp1; FILE* fp2; typedef struct fragment { int score; int index; fragment(int score1, int index1) { score = score1; index = index1; } fragment* nex...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "../base.h" #include "Windows.Gaming.Input.Preview.0.h" #include "Windows.Gaming.Input.Custom.0.h" WINRT_EXPORT namespace winrt { namespace ABI::Windows::Gaming::Input::Preview { st...
/*===========================================================================*\ author: Matthias W. Smith email: mwsmith2@uw.edu date: 2015/09/04 about: The program runs on a shim data in a specific format usage: ./make_stability_plots <input-file> [output-dir] \*================================================...
#pragma once //MouseScrollingToRight.h #ifndef _MOUSESCROLLINGTORIGHT_H #define _MOUSESCROLLINGTORIGHT_H #include "MouseAction.h" using namespace std; class Form; class MouseScrollingToRight : public MouseAction { public: MouseScrollingToRight(Form *form = 0); MouseScrollingToRight(const MouseScrollingToRight& sou...
#pragma once #include "rose.h" namespace StencilTranslator { class ArrayVariable; class LoopAttribute; class LoopReplacer : public AstSimpleProcessing { protected: // store the generated call statements to generate benchmark code std::map<LoopAttribute *, std::string> fortranCalls; std:...
class Solution { public: int numTeams(vector<int>& rating) { int n = rating.size(); int ans = 0; // 枚举三元组中的 j for (int j = 1; j < n - 1; ++j) { int iless = 0, imore = 0; int kless = 0, kmore = 0; for (int i = 0; i < j; ++i) { if (ra...
#include "bullet.h" Bullet::Bullet() { } Bullet::Bullet(sf::Texture* texture,float pos_x, float pos_y, float dir_x, float dir_y, float bullet_speed ) { this->sprite.setTexture(*texture); this->sprite.setPosition(pos_x,pos_y); this->direction.x = dir_x; this->direction.y = dir_y; this->bulletSpee...
#include "Connection.hpp" Connection::Connection(Neurone* post,double J) :postsynapticNeurone_(post),J_(J){} Neurone* Connection::getPost(){ return postsynapticNeurone_; } double Connection::getJ() const{ return J_; } Connection::~Connection(){ //postsynapticNeurone_=null...
#include <SPI.h> #include <LedCubeStills.h> #include <LedCubeSequences.h> int clockPin = 13; int dataPin = 11; int latchEnablePin = 8; int outputEnablePin = 10; byte leds[8][8]; // [z],[y], 1<<x int activeLayerIndex = 0; void setup() { Serial.begin(9600); // Timer 2 Initialization for 125uS interrupt. cli...
// // SMDateTimePickerScene.h // SMFrameWork // // Created by SteveMac on 2018. 6. 15.. // #ifndef SMDateTimePickerScene_h #define SMDateTimePickerScene_h #include "../../SMFrameWork/Base/SMScene.h" #include "../../SMFrameWork/Picker/SMWheelPicker.h" enum InputPickerType { InputPickerTypeDate, InputPicker...
/* Question 3: * Write a program that reads from the user a positive integer (in a decimal representation), * and prints its binary (base 2) representation.*/ #include <iostream> using namespace std; int main() { int inputInt; int logCalc; int log2Curr, exponent, log2Mem; int powOf2; int remaind...
#ifndef UNET_HOST_H #define UNET_HOST_H #include <arpa/inet.h> namespace unet { template <typename T> constexpr uint16_t hton16(T h) { return htons(static_cast<uint16_t>(h)); } template <typename T> constexpr uint16_t ntoh16(T n) { return ntohs(static_cast<uint16_t>(n)); } template <typename T> constexpr uint...
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ #include "point.h" Point::Point(double X, double Y){ this->X = X; this->Y = Y; } double Point::getX() const{ return X; } d...
/* * InputRadii.cpp * * Created on: Aug 5, 2013 * Author: marchi */ #include "InputRadii.h" #include "mydata.hh" InputRadii::~InputRadii() { // TODO Auto-generated destructor stub }
#include "exception_wrapper.h" namespace UmanagedCPPException { ExceptionWrapper::ExceptionWrapper(String ^ err_msg, int err_code) : ApplicationException(err_msg) { m_err_code = err_code; } }
#include <bits/stdc++.h> using namespace std; int main(){ size_t T,i,S = 0; vector<int> N; size_t menor = 0,maior = 0; cin >> T; for(i = 0;i < T;i++) { int E; cin >> E; N.push_back(E); } for(i = 1; i < N.size();i++) { if(N[menor] >= N[i]) { menor = i; } if(N[maior] < N[i]) { mai...
// github.com/andy489 // https://www.hackerrank.com/contests/practice-3-sda/challenges/balloons-and-candy #include <iostream> #include <vector> #include <algorithm> #include <limits> typedef long long ll; using namespace std; struct Day { ll a, b; auto operator()() const { return a * b; } ...
#pragma once #include "../pch.h" #include "BidTieBreakerByLastName.h" std::string BidTieBreakerByLastName::ComputeWinner(const std::vector<BidSubmission>& bidList) const { int highestBidValue = 0; for (int i = 0; i < bidList.size(); i++) { if (bidList[i].getBidAmount() > highestBidValue) highestBidValue = bidL...
#include <iostream> #include "tree.h" #include "tree_util.h" tree<std::string> test_move_constructor() { tree<std::string> mtree; tree<std::string>::iterator it = mtree.set_head("top"); mtree.append_child(it, "one"); mtree.append_child(it, "two"); mtree.append_child(it, "three"); tree<std::string> ctree(std::m...
#include "pch.h" #include <windows.h> #include <Dbghelp.h> #include <sstream> #pragma comment(lib, "Dbghelp") typedef unsigned __int64 QWORD; typedef DWORD* (WINAPI* OriginalAPI)(); OriginalAPI originalAPI; DWORD WINAPI MyAPI() { MessageBox(NULL, TEXT("Hooked GetSystemTimeAsFileTime!!"), TEXT("success"), MB_OK...
#pragma once #include "printable.h" #include "types.h" #include <algorithm> #include <stdexcept> #include <limits> #include <istream> namespace ant { /** * @brief Interval class template */ template <class T> class interval: public printable_traits { protected: T _start; T _stop; public: constexpr in...
#include<iostream> #include<algorithm> #include<vector> #include<string> using namespace std; int main() { int n1,m1; cin>>n1; cin>>m1; vector<int> one,two; for(int i=0;i<n1;i++) { int k; cin>>k; one.push_back(k); } for(int j=0;j<m1;j++) { int k; cin>>k; two.push_back(k); } if(one.size(...
#ifndef ___plotbuffertest__aera_h___ #define ___plotbuffertest__aera_h___ #include "controls\plot\buffer.h" namespace plot { class UNITTEST_SUITE( darray_test ) { public: static int sum(darray &b) { return std::accumulate(b.get(), b.get()+b.size(), 0); } UNITTEST( testA ) { darr...
#ifndef _TEMPLATEDBOOL_H_ #define _TEMPLATEDBOOL_H_ namespace hermes { template<typename T> struct TemplatedBool { enum Value { False = 0, True = 1 }; }; } #endif /* _TEMPLATEDBOOL_H_ */
#include <bits/stdc++.h> using namespace std; using ll = long long int; int mex(set < int > &s){ int m = 0; while(s.find(m) != s.end()) m++; return m; } void solve(){ int n; cin >> n; vector<int> cnt(110, 0); set < int > a , b; for(int i = 0; i < n; i++){ int a; cin >> a...
#pragma once #include "DataStructure.h" class Graph : public DataStructure { #pragma region Attributes private: Utility::Vec2 position; Utility::Vertex vertex; #pragma endregion #pragma region Constructors public: #pragma endregion #pragma region Properties public: #pragma endregion #pragma region Method...
#include <cstdlib> #include <cmath> #include <cstring> #include <ctime> #include <algorithm> #include <vector> #include <stack> #include <list> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <Eigen/SparseCore> #include <Eigen/SparseCholesky> #i...
/************************************************* * Publicly released by Rhoban System, August 2012 * www.rhoban-system.fr * * Freely usable for non-commercial purposes * * Licence Creative Commons *CC BY-NC-SA * http://creativecommons.org/licenses/by-nc-sa/3.0 *************************************...
#pragma once #include "BThing.h" class CTerrain: public BThing { public: CTerrain(); virtual ~CTerrain(void); TVector3 m_vecRotationCylinder; float m_fRadian; float m_fSize; TQuaternion m_qRot; virtual bool Tick(unsigned long dTime); virtual void PhysicsTick(unsigned long dTime); virtual voi...
// Fill out your copyright notice in the Description page of Project Settings. #include "RailgameInstance.h" URailgameInstance::URailgameInstance(const FObjectInitializer & ObjectInitializer) { PlayingState = EPlayingState::Menu; } void URailgameInstance::SetPlayingState(EPlayingState NewState) { PlayingState = ...
/* * pb_solver.cpp * * Created on: 30 May 2013 * Author: wjm34 */ #include "pb_solver.h" #include <boost/numeric/odeint.hpp> namespace odeint = boost::numeric::odeint; namespace Popbal { SolverOutputs::SolverOutputs(std::vector<dvec>& states, dvec& times): mStates( states ), mTimes( times ) {} void ...
#include <QtConcurrent/QtConcurrent> #include "projecteditionviewmodel.hpp" #include "databasemanager.hpp" ProjectEditionViewModel::ProjectEditionViewModel(QObject *parent) : QObject(parent) { m_isWorking = false; m_appDatabase = QSqlDatabase::database(DATABASE_CONNECTION_NAME); connect(this, &Projec...
#ifndef NODE_H #define NODE_H #include <cmath> #include <iostream> typedef unsigned ulong; typedef unsigned uchar; typedef unsigned uint; enum { INVALID = 0, VALID, DIRTY }; class cacheLine { protected: ulong tag; ulong Flags; ulong seq; public: cacheLine() {tag = 0; Flags = 0;} }; class Cache { protected:...
#include <cstdio> #include <algorithm> const int MAXN = 1000; using namespace std; int main() { int arr[MAXN] = {0}; int n; scanf("%d", &n); for(int i = 0; i < n;i++) { scanf("%d", arr+i); } if(n == 1) { // only 1 printf("%d", arr[0]); } // 1. Sort could be // sort(arr, arr+n); // 2. cmp ...
#pragma once #include <boost/asio.hpp> #include <ViGEm/Client.h> namespace RemoteGamepad { class Server { public: Server(unsigned short port); ~Server(); void connectWithClient(); void receiveData(); bool hasConnection() const { return m_hasConnection; } pri...
// // Created by Will Smith on 4/12/18. // #include "Rectangle.h" Rectangle::Rectangle() {width=height=0;} Rectangle::Rectangle(int width, int height) : width(width), height(height) {} int Rectangle::getWidth() const { return width; } void Rectangle::setWidth(int width) { Rectangle::width = width; } int R...
#include <iostream> using namespace std; void print_table(); void check_win(); void start(); char* _table = new char[9]; int _player; const char PLAYER_CHAR[2] = { 'X', 'O' }; const int WIN_IDX[9][3] = { { 0, 1, 2 }, { 3, 4, 5 }, { 6, 7, 8 }, { 0, 3, 6 }, { 1, 4, 7 }, { 2, 5, 8 }, { 2, 4, 6 }, { 0, 4, 8 } }; i...
#include<bits/stdc++.h> using namespace std; //O(logn) and auxillary space O(1) int solve(int n) { int count = 0; while(n!=0) { n=n&(n-1); count+=1; } return count; } int main() { int n; cin >> n; cout << solve(n) << endl; return 0; }
#include <iostream> #include <vector> #include <algorithm> #include <fstream> struct record { std::vector<int> v; record(std::vector<int> vp):v(vp) {} }; struct cmp { int t; cmp(int tp):t(tp) {} bool operator()(const record &r1, const record &r2) { if(r1.v[t - 1] < r2.v[t - 1]) return true; else if(r1.v[t -...
#include<iostream> #include<math.h> using namespace std; main() { unsigned long long N; cin>>N; bool isPrime[N]; for(unsigned long long i=0;i<N;i++) { isPrime[i]=true; } isPrime[0]=false; isPrime[1]=false; for(unsigned long long i=2;i<sqrt(N);i++) { if(isPrime[i]) { for(unsigned long long j=i*i;j<=N;...
/************************************************************* Author : qmeng MailTo : qmeng1128@163.com QQ : 1163306125 Blog : http://blog.csdn.net/Mq_Go/ Create : 2018-03-03 21:23:56 Version: 1.0 **************************************************************/ #include <iostream> #include <cstdio> #include <vec...
#include "resource.hpp" namespace Game { std::map<std::string, void *> Resource::sMap; }
#include <whiskey/Passes/Verifications/VerificationPreCodeGen.hpp> #include <whiskey/Messages/MessageContext.hpp> #include <whiskey/AST/Node.hpp> #include <whiskey/AST/Requires.hpp> #include <whiskey/AST/Predicates.hpp> namespace whiskey { PassResult VerificationPreCodeGen::onRunPre(Node &node, MessageContext &msgs) ...
#ifndef FLOW_GRAPH_FILTERNODE_HPP #define FLOW_GRAPH_FILTERNODE_HPP #include <memory> #include "graph/unary_node.hpp" #include "expressions/filter_expression.hpp" namespace flow { class FilterNode; using FilterNodePtr = std::shared_ptr<FilterNode>; class FilterNode : public UnaryNode { public: FilterNode(const ...
//queue using array #include <iostream> using namespace std; #define n 20 class queue { int *arr; int f; int b; public: queue() { arr = new int[n]; f = -1; b = -1; } void enqueue(int x) { if (b == n - 1) { cout << "Queue Overflow" ...
/* 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...
#include "amicable.h" amicable::~amicable() { delete[] _refArray; } void amicable::_sieveMultiples(ui root) { ui j = 2; while (j <= root ) { if (_refArray[j] == true) { ui id = j; while (id < _number) { id = id + j; if (id <= _number && _refArray[id] == true) { _refArray[id] = false; } ...
//FINAL VERSION OF PEG SOLITAIRE //HEADER FILES USED #include<graphics.h> //For graphics #include<stdlib.h> //For exit() #include<iostream.h> //For cout #include<conio.h> //For getch() #include<dos.h> //For delay #include<b...
//////////////////////////////////////////////////////////////////////////////// // // 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 ...
#include "RaiseAnimation.h" RaiseAnimation::RaiseAnimation(int x, int y, int hitpoint, int buff) { cnt = 0; dy = 0; dt = 0; this->x = x; this->y = y; raiseNum = Util::getSmallSignedNumBitmap(hitpoint); this->bShowNum = hitpoint != 0; srsList.clear(); if ((buff & FightingCharacter...
#include <iostream> using namespace std; int ns[100000]; int nss[500000]; long long sum = 0; void merge(int l, int r){ if(l == r){ nss[l] = ns[l]; return; } int mid = l + (r - l) / 2; //p2 is mid merge(l, mid); merge(mid + 1, r); int p1 = l, p2 = mid + 1; int p = l; ...
// ***************************************************************** // This file is part of the CYBERMED Libraries // // Copyright (C) 2007 LabTEVE (http://www.de.ufpb.br/~labteve), // Federal University of Paraiba and University of São Paulo. // All rights reserved. // // This program is free software; you can redist...
#include <ros/ros.h> #include <ros/forwards.h> #include <ros/single_subscriber_publisher.h> #include <sensor_msgs/Image.h> #include <image_transport/image_transport.h> #include <cv_bridge/cv_bridge.h> #include <sensor_msgs/image_encodings.h> #include <geometry_msgs/PoseStamped.h> #include <tf2_eigen/tf2_eigen.h> #inc...
#include<iostream> bool isPalindrome(char arr[], int, int); int main(){ char arr[]={'f','a','b','b','a','f'}; int n = sizeof(arr)/sizeof(arr[0]); if(isPalindrome(arr, 0, n-1) == 1) std::cout << "E' PALINDROMA!\n"; else std::cout << "NON E' PALINDROMA!\n"; } bool isPalindrome(char arr[], int begin, int end)...
#include<bits/stdc++.h> using namespace std; int main() { fstream fin, fout; fin.open("Input.txt", ios::in); fout.open("Output.txt", ios::out); std::vector<int> v(10); auto first = v.begin(); auto last = v.end(); int x; for(auto it = first; it != last; ++it){ fin>>*it; } copy(first, last, ostream_ite...
/* 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...
#include<bits/stdc++.h> using namespace std; int n, m; int main_w[70], main_c[70]; int other_w[70][3], other_c[70][3]; int dp[32010]; int main() { scanf("%d %d", &n, &m); for (int i = 1; i <= m; ++i) { int v, p, q; scanf("%d %d %d", &v, &p, &q); if (q == 0) { main_w[i] = v; main_c[i] = v * p; } ...
#include <cstdio> #include <cstdlib> #include <iostream> #include <deque> void printKMax(int * arr, int n, int k) { std::deque<int> Qi(k); int i; for (i = 0; i < k; ++i) { while ( (!Qi.empty()) && arr[i] >= arr[Qi.back()]) Qi.pop_back(); // Remove from rear Qi.push_back(i...
#include "Parameter.h" #include "Information.h" using namespace CWE; Parameter::~Parameter() { End(); } bool Parameter::LoadSucceeded() const { if(mMask.LoadResult() == Task::Failed || mShape.LoadResult() == Task::Failed) { FatalError::GetInstance().Outbreak(L"Failed to load data.\nMay file is corrupted."); ...
#include <rtthread.h> #include <rtdevice.h> #include <board.h> #include <stdlib.h> #include "rtt_interface.h" #include "AC_Base.h" #include "Logger.h" #include "AP_Buffer.h" #include "SRV_Channel.h" #include "mode.h" #if defined(__ICCARM__) || defined(__GNUC__) #include "AP_RangeFinder.h" #include "AP_KF.h" #endif usi...
#include <iostream> #include <asio.hpp> #include <cryptopp/osrng.h> #include "TcpServer.h" int main() { try { asio::io_service io_service; CryptoPP::AutoSeededRandomPool rng; RansomManager ransomManager(rng); TcpServer server(io_service, ransomManager); io_service.run(); } catch (std::exception& e) {...
#include<iostream> #include<iomanip> using namespace std; int main() { // int a = 34; // cout<<"the value of a was:"<<a<<endl; // a = 45; // cout<<"the value of a is:"<<a; // Constants in c++ // const int a = 3; // cout<<"the value of a was:"<<a<<endl; //a = 45; // you will get an error because a is a constant...
// -*- 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...
/************************************************************* * > File Name : P1196_review.cpp * > Author : Tony_Wong * > Created Time : 2019/11/11 09:29:33 * > Algorithm : review ufs **************************************************************/ #include <bits/stdc++.h> using nam...
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <cstring> #include <queue> #include <sstream> #include <cmath> #include<unordered_set> // 需要c++ 11才能支持 using namespace std; class Transform { public: int cnt2(int n){ int cnt = 0; while(n){ n = n&(n-1)...
#ifndef SCENE_H #define SCENE_H #include "entity.h" #include "animation.h" #include "mesh.h" class Scene //igual que World { public: static Scene* instance; //singleton bool free_camera = true; //standar variable float angle = 0; Scene(); //current scene std::vector<Entity*> static_list; EntityCar* player_c...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "base.h" WINRT_WARNING_PUSH #include "internal/Windows.Foundation.3.h" #include "internal/Windows.UI.3.h" #include "internal/Windows.Devices.Lights.3.h" #include "Windows.Devices.h" #...
#include "../headers/ftemployee.h" #include <exception> #include <iostream> double ftemployee::ft_base_bonus_salary = 100; int ftemployee::ft_bonus_vac_day = 1; ftemployee::ftemployee(): worker(), level1() {} ftemployee::ftemployee(std::string n, std::string sn, std::string cf): worker(n, sn, cf), level1() {} ftemp...
#include "Motor.h" #include <Servo.h> #include <SoftwareSerial.h> Servo servo; #define SMIN 0 #define SMAX 90 #define MYRX 12 //デジタル12番ピンはソフトウェアシリアルRX #define MYTX 11 //デジタル11番ピンはソフトウェアシリアルTX int pos = 90; SoftwareSerial mySerial(MYRX, MYTX); unsigned char c[8]; unsigned long chksum; //int direction(int x, int y){ // ...
#include <conio.h> #include <fstream> #include "Game.h" #include "Resource.h" Game::Game() { m_currentScore = 0; m_currentGameState = GameStates::mainMenu; m_scoreFileToOpen = "HighScore.txt"; m_highScoreFile.open(m_scoreFileToOpen); m_highScoreFile >> m_highScore; m_highScoreFile.close(); m_snake.setPickupXPo...
#include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] double huc(IntegerVector x, NumericVector d, NumericVector a, double b, NumericVector z, NumericVector beta) { int nj = x.size(); int nk = z.size(); double suma = 0; double bdi = 0; double zb...
#ifndef RANGE_HPP #define RANGE_HPP #include <iostream> #include <iomanip> #include "geometry/PrintFormat.hpp" using namespace std; template <typename T> class Range { public: /* Members */ const T start; const T end; /* Constructors */ Range(T start, T end) : start(start), end(end) { che...
#include <cassert> #include "Tensor.h" int main() { using namespace StaticNet; Tensor<int, 2, 2> int_test1 = {{1, 2}, {3, 4}}; Tensor<int, 2, 2> int_test2 = {{5, 6}, {7, 8}}; int int_test3 = 3; Tensor<int, 2, 2> int_test_add_result = {{6, 8}, {10, 12}}; Tensor<int, 2, 2> int_test_sub_result =...
#pragma once #include <QtWidgets/QMainWindow> #include "windows.h" #pragma comment(lib, "version") #include <QFileInfo> #include <QDir> #include <QTimer> #include <QLibrary> #include "../QT_FrontCheckClass/QT_FrontCheckClass.h" typedef CBaseCheckAlg* (__stdcall* pExport)(bool b); typedef void(__stdcall* pDeleteExport)...
#include "idcells.h" GUID::GUID(ISettingsGeneral * common) : common(common) {} Error GUID::write(Address addr, uint8_t data, Num num) { return OK; } ReadType GUID::read(Address addr, Num num) { return common->getDeviceGUID(addr); } size_t GUID::size() { return GUID_SIZE; } DeviceName::DeviceName(ISett...
#include <cstdio> #include <vector> #include <algorithm> #include <unordered_set> using namespace std; typedef long long ll; int main() { int n; ll k; scanf("%d %lld", &n, &k); vector<ll> v(n); unordered_set<ll> us; for (int i = 0; i < n; ++i) { scanf("%lld", &v[i]); } sort...
#include "NetBuffer.h" #include "Debugger.h" #include "Randomizer.h" NetBuffer::NetBuffer() { MEMORY_PROCESS( MEMORY_NET_BUFFER, DefaultBufSize + sizeof( NetBuffer ) ); isError = false; bufLen = DefaultBufSize; bufEndPos = 0; bufReadPos = 0; bufData = new uchar[ bufLen ]; memzer...
#include "graphics\Singularity.Graphics.h" namespace Singularity { namespace Graphics { class IRenderIterator { public: #pragma region Properties virtual const unsigned Get_Size() const = 0; virtual Renderer* Get_Renderer() const = 0; #pragma endregion #pragma region Methods...
#ifndef ARMORY_H #define ARMORY_H #include <places/shop.h> #include <character.h> #include <objects/equipment.h> #include <objects/protection.h> #include <objects/weapon.h> #include <characters/human.h> #define REPAIR_COST 20 namespace lab3 { namespace places{ class Armory : public Shop { public: Armory(const...
/* * In this program it will illustrate copy constructor and how to use it. */ #include <iostream> // Headers. using namespace std; class Vector{ // Vector class. public: Vector():real{0},img{0}{} // Cosntructor without arguments. Vector(Vector &x){ // Copy constructor to copy values of same class object in...
#ifndef SHIKU_QUERY_QUEUE_HPP_ #define SHIKU_QUERY_QUEUE_HPP_ #include <queue> #include <cstdint> namespace shiku { // Not thread-safe // No locks when modifying queue class QueryQueue { private: bool mutex; uint64_t counter; std::queue<uint64_t> queue; public: QueryQueue(void); bool Lock(void); bool ...
#pragma once #include "finterpol.h" #include "kdtree.h" #include "utilites/strings.h" #include "utilites/serl/Archive.h" namespace location { struct VesselElement; typedef shared_ptr<VesselElement> PVElement; struct VesselSensor; typedef shared_ptr<VesselSensor> PVSensor; inline bool is_normal_angle(double a) { ...
//Programmer: Ryan Hoffman //Date: 2/2/14 //Description: cpp file for the ai class #include "ai.h" AI::AI(string fileName, int outputFlags) { board.setup(fileName, false); numWrigglers = board.getNumWrigglers(); Move move(-1, 0, HEAD, -1, -1);//root tree.insert(move); move.parent = -1; vector<Wriggle> t...
#include "../headers/House.h" House::House(Camera * cam, Light * light) { this->cam = cam; this->light = light; posX = 0; posY = 0; posZ = 0; } void House::createHouse(float X, float Y, float Z) { walls.push_back(new Wall(cam, light, X + 5, Y + 1.5, Z + 2, 1, 0.5, 1, 0, 0)); walls.push_back(new Wall(cam, li...
#include <iostream> #include <cstdio> #include <conio.h> #include <Windows.h> #include <stdlib.h> #include "../BasicConsoleInterfaceCreator/bcic.h" #include "../BasicConsoleInterfaceCreator/ANSIEscapes.h" #include "Board.h" int main() { /* UNDER DEVELOPMENT! */ }
#include "module2.h" namespace core { module2::module2() { } module2::~module2() { } string module2::name() { string result = "sum"; return result; } double module2::execute() { vector<float> *v = Global::activator->values; if(v) { for(size_t i = 0; i < 10; i++) { v->emplace_back(v->at(i)); }...
//============================================== // Name : AKSHAY MUKESHBHAI KATRODIYA // Email : amkatrodiya@myseneca.ca // Student ID : 125298208 // Section : NAA // Date : 06/09/2021(wednesday) // I have done all the coding by myself and only copied the code that my professor ...
#ifndef ENTRYVIEWMODEL_H #define ENTRYVIEWMODEL_H #include <QtMvvmCore/ViewModel> #include <proxerentrymodel.h> class EntryViewModel : public QtMvvm::ViewModel { Q_OBJECT Q_PROPERTY(ProxerEntryModel* model READ model NOTIFY modelChanged) Q_PROPERTY(int typeIndex READ typeIndex WRITE setTypeIndex NOTIFY typeIndexC...
#ifndef HASHINGFUNCTIONS_H #define HASHINGFUNCTIONS_H #include "HashTableChaining.h" #include "HashTableLinearProbing.h" #include "Course.h" #include "EngWord.h" #include <vector> #include <crtdbg.h> #include <iostream> // English Words Functions #define MAX_WORDS 1000 std::vector<std::string> GetEngWordsFromFile()...
#ifndef __CLUCK2SESAME_TESTS_UI_POLLAFTERUIMOCK_INC #define __CLUCK2SESAME_TESTS_UI_POLLAFTERUIMOCK_INC extern initialisePollAfterUiMock extern calledPollAfterUi #endif
// Fill out your copyright notice in the Description page of Project Settings. #include "UE4VoxelTerrain.h" #include "TerrainController.h"
#include<iostream> using namespace std; int hanio(int x) { if (x == 1) return 2; else return hanio(x - 1) * 3 + 2; } void func() { int n; while(cin>>n){ int ans = hanio(n); cout << ans << endl; } } int main() { ios::sync_with_stdio(false); cin.tie(0); func(); return 0; }
/* Description: A program that prompts the user to enter four words, then displays a table showing the four words and their respective number of syllables. Author: Zurone Chen Input Variables: string str Process Flow: When the characters 'a', 'e', 'i', 'o', 'u', and 'y' are detected in a string: vowel++. Wh...
#pragma once #ifndef HAD_INCLUDED #define HAD_INCLUDED #include<Node.hpp> #endif // !HAD_INCLUDED template<class T> class Stack{ public: Stack() = default; Node<T>* head; Node<T>* tail; constexpr Node<T> begin()const { assert(!is_empty()); return *head; } constexpr Node<T>end()const { assert(!is_empty()); return ...
// // Recorder - a GPS logger app for Windows Mobile // Copyright (C) 2006-2019 Michael Fink // /// \file ShellNotifyIcon.hpp Shell notify icon for Win32 and WinCE // #pragma once #include <shellapi.h> /// callback interface for shell notify icon class IShellNotifyIconCallback { public: /// dtor virtual ~IShell...
#pragma once #include <string> #include <GL\glew.h> class Texture { private: GLuint value = 0; GLenum target = 0; public: Texture(); ~Texture(); static void targeting(GLenum); GLuint getValue(); Texture * bindAs(GLenum); Texture * unbind(); static void unbindFrom(GLenum); static void tryOrDefault(GLenum...
#include <Servo.h> Servo myServo; int push_btn1 = 12; // + 용 int btn_state1 = 0; // 버튼이 눌려졌는지 판단하기 위한 상태값 int push_btn2 = 10; // - 용 int btn_state2 = 0; int angle = 0; // 서브모터에 세팅할 각도 void setup() { Serial.begin(9600); myServo.attach(6); // 6은 핀 번호 pinMode(push_btn1, INPUT); pinMode(push_btn2, INPUT); ...
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: unordered_map<int, int> dict; TreeNode* buildTree(vector<int>& preorder, ve...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "../base.h" #include "Windows.UI.WebUI.0.h" #include "Windows.ApplicationModel.0.h" #include "Windows.ApplicationModel.Activation.0.h" #include "Windows.ApplicationModel.Background.0.h...