text
stringlengths
8
6.88M
#include<iostream> using namespace std; int main() {int n; while (cin >> n && n != 0) {int x = 0,x0 = 0,sum = 0; for (int i = 1;i <= n;i++) {cin >> x; sum+=5; if (x > x0) sum+=(x-x0)*6; else sum+=(x0-x)*4; x0 = x; } cout << sum << endl; } return 0; }
// singleCameraProject.cpp : Defines the entry point for the console application. /* Kalev Roomann-Kurrik 3/30/2011 Interim Senior Design Project A single camera computer vision-based percussion system. These components will be combined with the stereo imaging in TwoFeedTest to produce the final two camera thr...
#include "SeparatedExtendedReadsList.h" #include "../../utils/LzmaLib.h" #include "../SeparatedPseudoGenomeBase.h" namespace PgTools { template <int maxMismatches> SeparatedExtendedReadsListIterator<maxMismatches>::SeparatedExtendedReadsListIterator(const string &pseudoGenomePrefix) : pseudoGenom...
// "Copyright [2020] <Taraymovich Igor>" #include "integrate.hpp" namespace integrate { double Integrate(func F, double left, double right, double eps) { double sum = 0; for (double x = left + eps; x <= right - eps; x += eps) { sum += F(x); } sum += (F(left) + F(right)) / 2; return sum * ...
#pragma once #include "Shape.h" #include "Triangle.h" #include "Sphere.h" #include <vector> namespace RayTracer { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Dr...
#include <iostream> #include <string> #include <vector> using namespace std; #include "ChatRoom.h" #include "Person.h" int main() { ChatRoom room; auto john = room.join(Person{"john"}); auto jane = room.join(Person{"jane"}); john->say("hi room"); jane->say("oh, hey john"); auto simon = room.join(Perso...
#ifndef _SORTING_ADT_H #define _SORTING_ADT_H #include "bag.h" namespace cs2420 { template<typename T> class SortBy { public: SortBy(Bag<T>& bag) : elements(bag) {} virtual void sort(bool reversed = false) = 0; protected: Bag<T>& elements; virtual int findMinOrMax(int start, int sz, bool reve...
#pragma once #include <Arduino.h> class AsyncWebServer; class AsyncWebServerRequest; class ESPReactWifiManager { public: ESPReactWifiManager(); struct WifiResult { String ssid; uint8_t encryptionType; int32_t rssi; uint8_t* bssid; int32_t channel; int quality; ...
#include <Arduino.h> #include <Ticker.h> #include <PubSubClient.h> #include "WifiManagement.h" const char *ssidWifi = "CG"; const char *passwordWifi = "12ImpEglAnt69"; const char *serveurMqtt = "192.168.10.200"; String nomDevice = "MobilePIR"; String categorieDevice = "Capteurs"; WiFiClient clientWifi; IPAddress adr...
#pragma once #include <iostream> #include <ctime> #include <cstdlib> enum Parti{ G,D,ED,EG,C,_ }; int rand_a_b(int a, int b); int max(int nb1,int nb2);
int motor_one1=9; int motor_one2=10; int motor_two1=5; int motor_two2=3; void setup() { // put your setup code here, to run once: pinMode(6,INPUT); pinMode(9,OUTPUT); pinMode(10,OUTPUT); pinMode(11,INPUT); pinMode(5,OUTPUT); pinMode(3,OUTPUT); } void loop() { // put your main code here, to...
/* print a directory tree */ #include <stdio.h> #include "fat32.h" #define BDS_ATTR_RO (1<<0) // read only #define BDS_ATTR_HID (1<<1) // hidden #define BDS_ATTR_SYS (1<<2) // operating syste, #define BDS_ATTR_VID (1<<3) // volume id #define BDS_ATTR_DIR (1<<4) // subdirectory #define BDS_ATTR_ARC (1<<5) // archive...
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- */ #include "core/pch.h" #include "modules/ecmascript/carakan/src/es_pch.h" #include "modules/ecmascript/carakan/src/builtins/es_builtins.h" #include "modules/ecmascript/carakan/src/builtins/es_error_builtins.h" ...
/********************************************************************************** General Jaw Header file Has overall class definition and private and public functions Edited by Ethan Lauer on 2/24/20 *********************************************************************************/ #include<Arduino.h>...
#include <iostream> #include "vector.hpp" void Vector::pushBack(int val) { ++m_size; if(reserve == m_size) { reserve += 10; int* newVec = m_vec; m_vec = new int[reserve]; for(int i =0; i < m_size - 1; ++i) { m_vec[i] = newVec[i]; } m_vec[m_size - 1] =...
// unordered_set and unordered_map are all based on hash table, which find O(1) class Solution { public: int longestConsecutive(vector<int>& nums) { unordered_set<int> s(nums.begin(), nums.end()); int maxLen = 0; for (int num : nums) { if (s.find(num) == s.end()) continue; ...
#ifndef APPLICATION_PARSER_H #define APPLICATION_PARSER_H #include <string> #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/json_parser.hpp> #include <boost/algorithm/string/replace.hpp> // JSON parser class Parser { public: // Add template value template <typename T> void addValue...
#include "platforms/mac/QuickOperaApp/QuickWidgetApp.h" #include "platforms/mac/QuickOperaApp/QuickWidgetLibHandler.h" #include "platforms/mac/QuickOperaApp/CocoaQuickWidgetMenu.h" #include "platforms/mac/QuickOperaApp/QuickCommandConverter.h" #include "adjunct/quick/managers/LaunchManager.h" #ifdef AUTO_UPDATE_SUPPO...
#ifndef MOUSECONTROL_H #define MOUSECONTROL_H #include <QObject> #include <QTimer> #include <opencv2/opencv.hpp> namespace mouse { #if defined(__APPLE__) #include <ApplicationServices/ApplicationServices.h> #elif defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLAND...
#include <ros/ros.h> #include <std_msgs/Float64.h> #include <std_msgs/String.h> #include <cloudSegmentation/objects.h> #include <pcl/visualization/cloud_viewer.h> #include <pcl/filters/statistical_outlier_removal.h> #include <pcl/io/pcd_io.h> #include <pcl_conversions/pcl_conversions.h> #include "util.h" class ShowO...
/* * forward.cpp * * Created on: May 19, 2016 * Author: bakhvalo */ #include "gtest/gtest.h" #include <type_traits> namespace { class testMoves { public: testMoves() {} testMoves(const testMoves&) { x = 1;} testMoves& operator=(const testMoves&) { x = 2; return *this; } testMoves(testMoves&&...
#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; vector<string> PalindromFilter (vector<string> words, unsigned long minLength) { vector<string> Result; string buffer; for (auto x : words) { buffer = x; reverse(buffer.begin(), buffer.en...
#include<iostream> #include<vector> #include<algorithm> #include<unordered_map> using namespace std; class Solution { public: int fourSumCount(vector<int>& A, vector<int>& B, vector<int>& C, vector<int>& D) { //基本思想:哈希表,典型的空间换时间,将四重循环转化为两重循环 //用哈表表存储AB中元素之和出现的次数,如果CD中元素和的相反数在哈希表中出现,说明ABCD组合为0 ...
#ifndef _CDLSocketHandler_H_ #define _CDLSocketHandler_H_ #include "cache.h" #include "CDL_Decoder.h" #include "CDL_TCP_Handler.h" #include "CDL_Timer_Handler.h" using namespace comm::sockcommu; #define MAX_WEB_RECV_LEN 10240 #define MAX_SEQ_LEN 512 enum CConnState { CONN_IDLE, CONN_FATAL_ERR...
#include "add_feature.h" // import file to test #include <cmath> #include "linalg.h" #include "ut.hpp" using namespace boost::ut; using namespace boost::ut::bdd; int main() { "add feature"_test = [] { given( "A particle with three known features and vehicle position " "{1,1,acos(4/5)}) " // t...
#include "storage.h" Storage::Storage(QObject *parent) { } Storage::~Storage() { file.close(); } void Storage::writeHeader(int height, int width, int colorMode, int bytesPerFrame) { QString path = "d:\\work\\"; QString filename = QDateTime::currentDateTime().toString("yyyyMMddhhmmss"); QString extension = ".msr...
#include <ionir/misc/inst_builder.h> #include <ionir/passes/pass.h> namespace ionir { BasicBlock::BasicBlock(const BasicBlockOpts &opts) : ConstructWithParent(opts.parent, ConstructKind::BasicBlock), ScopeAnchor<Inst>(opts.symbolTable), Named{opts.id}, basicBlockKind(opts.kind), ...
#include "_pch.h" #include "wxDataViewRenderer.h" // ------------------------------------- // wxDataViewChoiceRenderer // ------------------------------------- IMPLEMENT_CLASS(wxDataViewChoiceRenderer2, wxDataViewCustomRenderer) wxDataViewChoiceRenderer2::wxDataViewChoiceRenderer2( const wxArrayString& choices, wxDa...
// Name : Angel E Hernandez // Date : April 17 // CIS 1202.800 // Project name : Inheritance #pragma once #include <iostream> #include "Car.h" using namespace std; void Car::displayInfo() { string manufact; int vYear; int numDoors; // prompt user to enter information cout << "Car: \n"; cout << "Enter the manu...
#include <iostream> using std::cout; class A{ public: A(){ cout << "I am constructor of A.\n"; } }; class B{ public: B(){ cout << "I am constructor of B.\n"; } }; class C{ A obj_a; B obj_b; }; int main(){ C cx; }
/* * Copyright (c) 2014-2017 Detlef Vollmann, vollmann engineering gmbh * * 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 CAIROMOCK_HH_SEEN_ #define CAIROMOCK_HH_SEEN_ #include "trompeloeil.hpp" #in...
#include <iostream> namespace mylib { template<typename T> class allocator { public: using size_type = std::size_t; using difference_type = std::ptrdiff_t; using pointer = T*; using const_pointer = T const*; using reference = T&; using const_reference = const T&; using value_type = T; ...
#include "stubs.hpp" // Definicoes de metodo da classe stub do controlador da logica de negocio de autenticacao. bool StubSAutenticacao::autenticar(const Email &email, const Senha &senha, Usuario *current_user) throw(runtime_error) { // Apresentar dados recebidos. cout << endl << "StubSAutenticacao::autenti...
// (C) 1992-2016 Intel Corporation. // Intel, the Intel logo, Intel, MegaCore, NIOS II, Quartus and TalkBack words // and logos are trademarks of Intel Corporation or its subsidiaries in the U.S. // and/or other countries. Other marks and brands may be claimed as the property // ...
#include <iostream> #include <string> #include <algorithm> #include <iomanip> using namespace std; inline int love(string s){ int result = 0; for ( char ch : s ){ ch = ( ch + 1 - 65 ) % 32; if ( 1 <= ch && ch <= 26 ){ result += ch; } } return result; } inline int...
#pragma once #include "resource.h" class WinFramework { public: WinFramework () {} virtual ~WinFramework () {} void quitGame (); virtual int winWidth () { return 640; } virtual int winHeight () { return 480; } HWND hwnd () { return hMainWnd; } void setHWnd ( HWND hwnd ); ...
#ifndef CELLTRACKER_PROBLEM_ASSEMBLER_H__ #define CELLTRACKER_PROBLEM_ASSEMBLER_H__ #include <pipeline/all.h> #include <inference/LinearConstraints.h> #include <sopnet/segments/Segments.h> #include "ProblemConfiguration.h" class ProblemAssembler : public pipeline::SimpleProcessNode<> { public: ProblemAssembler(); ...
#include <iostream> #include <fstream> #include <vector> #include <boost/random.hpp> #include <cppmc/cppmc.hpp> using namespace boost; using namespace arma; using namespace CppMC; using std::vector; using std::ofstream; using std::cout; using std::endl; class EstimatedY : public MCMCDeterministic<double,Mat> { privat...
#include <iostream> #include <vector> #include <queue> #include <algorithm> #include <iomanip> #include <map> #include <string> #include <cstdio> using namespace std; int post[31]; int in[31]; int lch[31]; int rch[31]; int build(int inlow, int inhigh, int postlow, int posthigh) { //cout << inlow << ' ' << inhigh <<...
#ifndef __CTRLMAIN_H #define __CTRLMAIN_H #include "ICtrlWindow.h" #include "CtrlNotebook.h" #include "ViewMain.h" #include "ModelMain.h" #include "globaldata.h" namespace wh{ //--------------------------------------------------------------------------- class CtrlMain : public CtrlWindowBase<ViewMain, ModelMain> { ...
#include <string> #include <cctype> #include <iostream> using namespace std; int main() { cout << "Enter your keyword : "; string input; //cin >> input; char transform; char operate; while(cin >> input) { for(int i = 0; i != input.length(); i++) { transform = input[i]; ...
#ifndef GLOBAL_H #define GLOBAL_H #include <string> namespace gnGame { /// <summary> /// 定数などを定義する名前空間 /// </summary> namespace global { namespace { // マップのフォルダパス static std::string MapFile = "Asset/MapData/"; // 画像のフォルダパス static std::string ImageFile = "Asset/Image/"; // 音楽のフォルダパス static ...
#include "_pch.h" #include "PGPTypeId.h" #include "dbFieldType.h" //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- IMPLEMENT_DY...
#define T1 160 #define T2 120 #define debug false #define MAIN_LED_PIN 5 #define SECOND_LED_PIN 4 volatile boolean mainLed = false; volatile boolean secondLed = false; byte addressArray[10] = {3,4,5,6,7,8,11,12,13,14}; byte dataArray[10] = {4,154,43,166,244,34,82,136,42,128}; //Serial Number for demo purpose //byt...
/*==================================================================== Copyright(c) 2018 Adam Rankin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitati...
#ifndef TOPOLOGY_CONTAINER #define TOPOLOGY_CONTAINER #include "DataTypes/Define.h" #include "DataTypes/Vec.h" #include "DataTypes/Mat.h" #include <afxwin.h> #include <GL/glu.h> #include <GL/gl.h> #include <vector> class TopologyContainer { public: TopologyContainer(void); ~TopologyContainer(void); //functions pub...
// Copyright (c) 2011-2017 The Cryptonote developers // Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs // Copyright (c) 2018-2023 Conceal Network & Conceal Devs // // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php....
#include "OptionState.h" #include "SpriteNode.h" #include "Game.hpp" OptionState::OptionState(StateStack* stack, Context* context) : State(stack, context) { mAllRitems.clear(); mContext->game->ResetFrameResources(); mContext->game->BuildMaterials(); std::unique_ptr<SpriteNode> backgroundSprite = std::...
#include <stdio.h> int main() { int x = 5; int *j; j = &x; printf("%d \n", x); printf("%d \n", *j); //will print value of x printf("%d", j); // it will print containing address of x return 0; }
// Created on: 1996-09-04 // Created by: Christian CAILLET // Copyright (c) 1996-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the ...
#include <iostream> namespace mine { template<typename T1, typename T2> struct my_pair { my_pair() = default; my_pair(my_pair const&) = default; my_pair(T1 const& first, T2 const& second) : first{first}, second{second} {} T1 first; T2 second; }; template<typename T1, typename T2> my_p...
// Created on: 2011-08-01 // Created by: Sergey ZERCHANINOV // Copyright (c) 2011-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2...
// // Created by griha on 06.01.18. // #include <misc/logger.hpp> DECLARE_LOG_DEBUG(Standard, "MICRON SST");
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2010 Benoit Jacob <jacob.benoit.1@gmail.com> // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Softwar...
// // Team.cpp // Polygons // // Created by Italo Ricardo Geske on 2021/05/16. // Copyright © 2021 Italo Ricardo Geske. All rights reserved. // #include <stdio.h> #include <string> #include "Team.h" #include "Player.h" Team::Team() { name = ""; } Team::Team (std::string name, bool isPlayerTeam) { this->...
/** * Create a templated value-like library class to store books, movies etc * Each library item has the data and a set of related works * Each related work object has a ptr to the related works item. */ #include <iostream> #include "Library.hpp" // class to store the description of an item. class Description { ...
#include "orientation.h" #include "./../constants/vector.h" Orientation::Orientation() :_forward(Constants::Vec4::forward), _right(Constants::Vec4::right), _up(Constants::Vec4::up) {} Orientation::Orientation(const glm::quat& quaternion) : _quaternion(quaternion) { update_direction_vectors(); } void Orientation::ro...
#include <iostream> #include <stdlib.h> #include <string> #include <vector> #include <algorithm> #define min(x, y) (x > y ? y : x) using namespace std; vector<long long> num; int main() { int N; cin >> N; for (int i = 0; i < N; i++) { int tmp; cin >> tmp; num.push_back(tmp); ...
#include <bits/stdc++.h> using namespace std; int main(){ double n, k; cin >> n >> k; double ans = 0; int lim = n; if(k <= n) lim = k-1; for(int i=1; i<=lim; i++){ double base = 1; double x = 0; while(k > base * i){ base *= 2; x++;...
#include "Operations.h" double expression(Token_stream &ts); double primary(Token_stream &ts) { Token t = ts.get(); switch (t.kind) { case '(': { double d = expression(ts); t = ts.get(); if (t.kind != ')') error("')' expected"); return d; }...
#pragma once #include "SIngletonBase.h" // 헤더랑 cpp 합친거 #include "./FMOD/inc/fmod.hpp" #pragma comment(lib, "./FMOD/lib/fmodex_vc.lib") // fmod /* 미리 만들어져있는거 사운드 플레이 하기 위해 도와주는 녀석 DirectX랑 같음 옛날에 만들어져서 개발이 중단되었으나 요즘에도 많이 사용하고 있음 간단하게 사용할 수 있고 지원하는 확장자가 많아서 자주 쓰고 있는거 사운드 편집 가능 fmod studio 사이트 가보면 확인 가능 */ // 외부에서 inc...
/* * File: TraverseOperationTest.h * Author: azamat * * Created on Feb 12, 2013, 3:05:31 PM */ #ifndef TRAVERSEOPERATIONTEST_H #define TRAVERSEOPERATIONTEST_H #include <cppunit/extensions/HelperMacros.h> #include <kdl_extensions/functionalcomputation_kdl.hpp> class TraverseOperationTest : public CPPUNIT_NS::T...
#include <iostream> #include "diabetes.h" #include <string> using namespace std; void diabetesproblems() { string Thirst; string Polyurea; string Polyphagia; string BlurredVision; string WeightLoss; string RecurrentInfections; string Tiredness; string Itchiness; str...
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. // Copyright (C) 2016, Intel Corporation, all rights reserved. // Third party copyrights are property of their respective own...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #include "core/pch.h" #include "platforms/windows/installer/Crea...
// 跨平台的epoll // Created by 邦邦 on 2022/6/17. // #ifndef BB_S_EPOLL_H #define BB_S_EPOLL_H #include <cstring> #include <csignal> //kill #include <functional> #include "bb/Log.h" #include "IpTcp.h" #include "bb/FloodIP.hpp" namespace bb { class S_Epoll { IpTcp *tcp_{}; const unsigned short EPOLL_MAX_S...
// Created on: 2015-07-14 // Created by: Irina KRYLOVA // Copyright (c) 2015 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as publ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2009 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #ifndef MESSAGE_CONSOLE_MANAGER_H #define MESSAGE_CONSOLE_MANAGER_H #...
#include "Butterfly.hpp" using namespace bfly; //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //!!GLOBAL STATES AND VARIABLES!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! int component_counter = 0; GLuint vertices_id; GLuint edges_id; GLuint program_id; GLuint check_full; GLuint orto_location; GLuint model_location; GLuint type_locati...
// // FootSwitchActuator.hpp // // // Created by Markus Buhl on 15.11.18. // #ifndef FootSwitchActuator_hpp #define FootSwitchActuator_hpp #include <stdio.h> #include "Arduino.h" enum ActuatorState { UNCHANGED = 0, INACTIVE, ACTIVE }; enum ActuatorType { ONESHOT, HOLD, TOGGLE }; typedef...
#include <iostream> #include "libFunction.h" // 使用此声明是该自定义函数调用了"libFunction.h"中的printHSLAM() using namespace std; void printHCPlus2(); void printHWorld() { cout << "hello, world" << endl; printHCPlus2(); printHSLAM(); return; } void printHCPlus2() { cout << "hello, cplusplus" << endl; ret...
#pragma once #include "../space/triangulation.hpp" namespace space { double Integrate(const std::function<double(double, double)>& f, const Element2D& elem, size_t degree); } // namespace space
// The main function - entry point into an executable. // // argc: number of arguments // argv: array of arguments (array of character array, each character array terminated with NULL) // // char * is a character array (i.e. a string) // char ** is an array of character arrays - could also be written as char *argv[] ...
/* Token object definition 2013, Tivins <https://github.com/tivins> */ #ifndef V_TOKEN_H #define V_TOKEN_H #include "str.h" #include "tokdef.h" namespace v { class Token { public: Token(int column, int line, int type = TOKEN_NONE, const char * data = NULL) ; ~Token() ; const char *getTypeName()...
#include "CustomItem.h" #include <string> #include <iostream> #include <iomanip> #include <sstream> using namespace std; CustomItem::CustomItem(std::string size):IceCreamItem(size) { if(size == "small"){ price = 3.00; } if(size == "medium"){ price = 5.00; } if(size == "large"){ price = 6.50; } } CustomIt...
#include <iostream> #include <unistd.h> #include <ncurses.h> #include <time.h> #include <dirent.h> #include <wiringPi.h> #include <pca9685.h> #include <fstream> #include <ctime> #include <string> #include <chrono> #include "servo_commands.h" #include <stdio.h> #include "../../raspicam/src/raspicam_still.h" using names...
#include <iostream> #include <cstdlib> #include <string> #include "manager.h" #include "visitor.h" #include "sort_by_price_visitor.h" #include "sort_by_name_visitor.h" using namespace std; Manager::Manager():_name("Manager"), _number("1"){ } Manager::Manager(string name = "Manager",string number = "1"):_n...
#include<cstdio> #include<iostream> #include<ctime> #define N 100000000 #define REP(i,N) for(int i=0; i<N; i++) int D; using namespace std; int main() { printf("通常のforループ "); clock_t start = clock(); for(int i=0; i<N; i++){ D = i; } clock_t end = clock(); cout << (double)(end - start) / CLOCKS_PER_S...
#pragma once #include <map> #include <string> class DynLib; class DynLibManager { public: DynLibManager(); ~DynLibManager(); public: DynLib* Load(const std::string& filename); void Unload(DynLib* lib); private: typedef std::map<std::string, DynLib*> DynLibList; DynLibList mDynLibList; private: static Dy...
#include <iostream> #include "sales_data.h" // This assumes that all books read in have the same bookId (ISBN) int main() { Sales_data bookIn, bookTotal; std::cin >> bookTotal.bookId >> bookTotal.unitsSold >> bookTotal.revenue; std::cout << "Transaction Read: " << bookTotal.bookId << " " ...
#ifndef __ENGINECOMMON__ #define __ENGINECOMMON__ #include <Windows.h> #include <chrono> typedef struct { float r, b, g, a; } GLCOLORARGB; typedef struct { double x, y; } GLVECTOR2, GLVERTEX2; typedef struct { double x, y, w, h; } BOUNDINGBOX; class ClockKeeper { private: std::chrono::high_resolution_clock::tim...
#pragma once #include<string> #include "utility.hh" std::ostream& operator<<(std::ostream & out, Parti val); class Personnage{ protected: Parti val; Parti vote; public: Personnage(); Personnage(Parti _val); Parti getvote(); static int nbPerso; void voter(); void afficher(); Parti get...
/******************************************************************************** ** Form generated from reading UI file 'CStatisticsWidget.ui' ** ** Created by: Qt User Interface Compiler version 5.3.2 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! *********************************...
// jsonpack.cpp : Defines the entry point for the console application. // #ifdef _WIN32 #include <io.h> #endif #include <fcntl.h> #include <fstream> #include "../imtjson/json.h" #include "../imtjson/compress.tcc" int main(int argc, char **argv) { #ifdef _WIN32 _setmode(_fileno(stdin), _O_BINARY); #endif try { u...
#ifndef EVENT_H #define EVENT_H #include "TTH/Plotting/interface/metree.h" //JSON parser https://github.com/vivkin/gason #include "TTH/Plotting/interface/gason.h" #include "TTH/Plotting/interface/gen.h" #include "TLorentzVector.h" #include "TH1D.h" #include "THnSparse.h" #include "TFile.h" #include "TPython.h" #inclu...
#include <iostream> #include <utility> using namespace std; // 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: TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p...
#include "ply_loader.h" #include <iostream> #include <fstream> #include <sstream> #include "helpers.h" #include <SDL.h> PlyLoader::PlyLoader() { } PlyLoader::~PlyLoader() { } void PlyLoader::load( std::string filepath, std::vector<GLfloat>& data ) { // TODO: find out if we can just leave the file as always binary...
#ifndef _ITEM_SWORD_HPP #define _ITEM_SWORD_HPP #define SWORD_MODIFIER 4 void sword_deal_damage(entity_t *enemy) { enemy->enemy_health -= 1 + SWORD_MODIFIER; std::cout << "Damage taken. Current health: " << enemy->enemy_health << std::endl; } // Use this to achieve a "magic" effect on the player or whatever you ...
//=========================================================================== /* This file is part of the CHAI 3D visualization and haptics libraries. Copyright (C) 2003-2004 by CHAI 3D. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms o...
//--------------------------------------------------------------------------- #ifndef AllSourceGenH #define AllSourceGenH //--------------------------------------------------------------------------- #include "WorkSpaceManager.h" #include "PluginManager.h" #include "SourceGen.h" class AllSourceGen { private: WorkSpac...
/** * @file No_Track.hpp * * @author Matthew * @version 1.0.0 * @date Apr 17, 2015 */ #ifndef VALKNUT_CORE_TRACKING_POLICIES_NO_TRACKING_HPP_ #define VALKNUT_CORE_TRACKING_POLICIES_NO_TRACKING_HPP_ namespace valknut{ namespace tracking_policies{ //////////////////////////////////////////...
#include <stdexcept> #include "am_pm_clock.h" am_pm_clock::am_pm_clock(): hours(12), minutes(0), seconds(0), am(true) {} am_pm_clock::am_pm_clock(unsigned int hrs, unsigned int mins, unsigned int secs, bool am_val): hours(hrs), minutes(mins), seconds(secs), am(am_val) {} am_pm_clock...
#include "compiler/grammar.hpp" #include "compiler/conversions.hpp" #include "compiler/ast_adapted.hpp" #include <boost/spirit/home/qi.hpp> #include <boost/spirit/home/lex.hpp> using namespace std::string_literals; namespace perseus { namespace detail { namespace ast { // import ast::parser into as...
#pragma once // CAppendAccountDlg 대화 상자 class CAppendAccountDlg : public CDialogEx { DECLARE_DYNAMIC(CAppendAccountDlg) public: CAppendAccountDlg(CWnd* pParent = nullptr); // 표준 생성자입니다. virtual ~CAppendAccountDlg(); // 대화 상자 데이터입니다. #ifdef AFX_DESIGN_TIME enum { IDD = IDD_DIALOG_MEMAPP }; #endif protected:...
// ----------------------------------------------------------------------------- // MCParticle.h // // Class definition of MCParticle // * Author: Everybody is an author! // * Creation date: 7 August 2020 // ----------------------------------------------------------------------------- #ifndef MCParticle_h #defin...
/* * Session.cpp * * Created on: Jun 11, 2017 * Author: root */ #include "Session.h" #include "EpollMain.h" #include "Context.h" #include "../util.h" #include "../Log/Logger.h" #include "MessageManager.h" #include "DispatchMessage.h" #include "GroupSession.h" namespace CommBaseOut { Session::Session(Contex...
#pragma once #include <Dot++/parser/ParserStateInterface.hpp> #include <Dot++/Exceptions.hpp> #include <Dot++/lexer/Token.hpp> #include <Dot++/lexer/TokenType.hpp> namespace dot_pp { namespace parser { namespace states { template<class ConstructionPolicy> class ReadAttributeNameState : public ParserStateInte...
// Import required libraries #include "ESP8266WiFi.h" // WiFi parameters const char* ssid = "dd-wrt"; const char* password = ""; int fullPin = 0; int halfPin = 2; const char* host = "192.168.1.125"; void setup() { // Start Serial Serial.begin(115200); pinMode(fullPin, INPUT); pinMode(halfPin, INPUT); } v...
// Copyright (c) 1998-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published ...
// // Created by Celeste Tan on 11/24/20. // #include "NextPiece.h" /**this function sends a new block from the loaded queue to the top of the screen**/ Blocks NextPiece::giveNext() { /**random length and height**/ l = rand()%5; h = rand()%5; /**new block to push later**/ Blocks nBlock(l, h);...