text
stringlengths
8
6.88M
#include <iostream> using namespace std; int h = 0, w = 0; char canvas[51][51] = { 0 }; int dx[4] = {0, 1, 0, -1}; int dy[4] = {1, 0, -1, 0}; void dfs(int x, int y) { canvas[x][y] = 'B'; for (int i = 0; i < 4; i++) { if (x + dx[i] >= 0 && x + dx[i] < h && y + dy[i] >= 0 && y + dy[i] < w && canvas[x +...
#include<iostream> #include<vector> #include<algorithm> using namespace std; class Solution { public: int lengthOfLastWord(string s) { //基本思想:字符串从右往左遍历,去掉末尾空格,再计数出现空格前的非空格字符个数,就是最后一个单词长度 int res = 0, i = s.length() - 1; while (i >= 0 && s[i] == ' ') i--; while (i >= 0 && s[i--] != ' ') res++; return re...
#ifndef GESTIONNAIREPLATEFORME_H #define GESTIONNAIREPLATEFORME_H #include "utilisateur.h" /** @brief La classe GestionnairePlateforme, hérite de @ref Utilisateur. ** ** Elle contient un constructeur, le nom, le prenom et les points de collecte aux quels il est abonné . ** ** @version 1 ** ** @author P. Marty,...
/* * node_car_detect.cpp * * This is the node to extract car states. * * Author: yubocheng@live.cn * * Copyright (c) 2019 Jimu * All rights reserved. * */ #include "node_car_detect.h" int main(int argc, char **argv) { ros::init(argc, argv, "car_extractor_node", ros::init_options::NoRosout); CarExtra...
#include "CCGreePlatform.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxGreeRequestDialog.h" using namespace cocos2d; NS_CC_GREE_EXT_BEGIN CCGreeRequestDialog::CCGreeRequestDialog(void* obj){ mRequestDialog = obj; } CCGreeRequestDialog* CCGreeRequestDialog::create(){ jobject obj = createRequestDialogJni(); CCGr...
#pragma once #include <ResourcesManager.h> #include <OGLML/Shader.h> #include <string> namespace breakout { class ShadersManager : public ResourcesManager<oglml::Shader> { public: static ShadersManager& Get(); protected: virtual bool getFromFile(const std::string& path, oglml::Shader& resource) override;...
//include definition file #include "dataReader.h" #include <iostream> #include <fstream> #include <string.h> #include <math.h> #include <algorithm> using namespace std; using namespace cv; /******************************************************************* * Destructor **********************************...
/*Дано два натуральних числа, знайти середнє геометричне */ #include <iostream> #include <cmath> using namespace std; int main() { cout << "Your number\n"; int a,b; cin >> a >> b ; cout << pow((a*b),0.5) << endl; return 0; }
// // Created by 송지원 on 2020-03-08. // #include <iostream> #define ABS(X) ((X)<0? (X)*(-1) : (X)) using namespace std; int num_list[101]; int prime_lists[101][1001]; int avg[1001]; int pow(int a, int b) { int ret = 1; for (int i=0; i<b; i++) { ret *= a; } return ret; } int get_diff(int nu...
#include <iostream> #include <vector> #include <algorithm> int main(int argc,char *argv[]) { int n; std::cin >> n; std::vector<int> v(n); for(int i = 0;i < n;i++) std::cin >> v[i]; std::sort(v.begin(),v.end(),std::greater<int>()); int ans = 0; for(int i = 0;i < n;i++) if(i%2) ans -= v[i]; else ans += v[i...
#include "Health.h" using namespace uth; using namespace pmath; Health::Health() : Component("defaultHealth") , m_Health(0, 100, 100) { } Health::Health(float min, float max) : Component("Health") , m_Health(min, max, max) { } void Health::Init() { } void Health::Draw(uth::RenderTarget& target) { } void Heal...
#include "_pch.h" #include "CtrlActBrowser.h" using namespace wh; //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- CtrlActBrowser::Ct...
// Created on: 2016-06-23 // Copyright (c) 2016 OPEN CASCADE SAS // Created by: Oleg AGASHIN // // 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 publi...
#include "DoubleEdit.h" // RsaToolbox #include "General.h" using namespace RsaToolbox; // Qt #include <QDebug> #include <QKeyEvent> #include <QRegExp> #include <QRegExpValidator> #include <QScopedPointer> DoubleEdit::DoubleEdit(QWidget *parent) : QLineEdit(parent), _parameterName("Value"), _decimalPlac...
#include "EvaluationMapForm.h" #include "ui_ScaleForm.h" #include "Entities/EvaluationMap/EvaluationMap.h" #include "Entities/Range/Appraised/AppraisedRange.h" #include "Entities/Scale/Scale.h" #include "Forms/AddAppraisedRangeForm/AddAppraisedRangeForm.h" typedef AddAppraisedRangeForm AddForm; EvaluationMapForm::Ev...
#include <iostream> #include <sstream> #include <omp.h> #include <vector> #include <chrono> #include <atomic> #ifdef _WIN32 // Windows #define cpuid(info, x) __cpuidex(info, x, 0) #else // GCC Intrinsics #include <cpuid.h> void cpuid(int info[4], int InfoType){ __cpuid_count(InfoType, 0, info[0], info[1], ...
#include "stdafx.h" #include "animation.h" #include "sprite.h" #include "level_sprite.h" #include "sprite_property.h" #include "rom_file.h" Animation::Animation() { SetRect(&base_, 0, 0, 0, 0); frame_index_ = 0; frame_count_ = 0; counter_ = 0; flip_horz_ = false; flip_vert_ = false; } ...
#include <bits/stdc++.h> #define fastio ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0) #define rep1(i, n) for(int i=0;i<(int)n;i++) #define rep2(i, a, b) for(int i=(int)a;i<(int)b;i++) #define st first #define nd second #define pb push_back #define pf push_front #define p_b pop_back #define p_f pop_front #de...
#include "CCheckUserName.h" #include "json/json.h" #include "Logger.h" #include "threadres.h" #include "Helper.h" int CCheckUserName::do_request(const Json::Value& root, char *client_ip, HttpResult& out) { //Json::Value ret; std::string username = Helper::filterInput(root["param"]["username"].asString()...
// // Created by 邦邦 on 2022/4/22. // #ifndef BB_LOG_H #define BB_LOG_H #include <string> #include <mutex> #include <exception> #include "Time.h" namespace bb { //__FILE__,__LINE__,__func__ class Log{ const char *log_path_ = "./bb.log"; //日志保存位置 std::string msg_arr_; //消息内容 Log()=defaul...
#include<cstdio> #include<iostream> #include<string> #include<cstring> using namespace std; int N,L; int train[55]; int cas=0; int sw(){ for(int i=0;i<L;i++) for(int j=0;j<L-i-1;j++){ if(train[j]>train[j+1]){ int t; t=train[j]; train[j]=train[j...
#include "Transform.h" glm::vec3 transform(glm::mat4 m, glm::vec3 r); Transform::Transform(const glm::vec3& pos, const glm::quat& rot, const glm::vec3& scale) : m_pos(pos), m_rot(rot), m_scale(scale), m_parent(nullptr) { // Transform Constructor utilizing Quaternion Rotation } bool Transform::hasChanged() const...
#include "opennwa/NwaFwd.hpp" #include <wali/util/DisjointSets.hpp> namespace opennwa { namespace construct { /** * * @brief constructs the NWA which is the result of applying the quotient operation on the given NWA * * @param - out: the quotient NWA of the given NWA * @param - nwa: ...
/* @author: AkshitAggarwal @date: 08/03/2019 */ #include<iostream> using namespace std; void pattern_1(int n) { cout<<"#Pattern01\n"; for(int i = 0; i < n; i++) { for(int j = 0; j <= i; j++) cout<<j+1<<" "; cout<<'\n'; } cout<<"==============================\...
#include <cstdio> #include <iostream> #include <vector> #include <string> #include <stack> #include <unordered_map> #include <unordered_set> #include <queue> #define INT_MAX 0x7fffffff #define INT_MIN 0x80000000 using namespace std; int numTrees(int n){ vector<int> index(n+1,0); index[0]=1; index[1]=1; for(int i...
#pragma once #include <Arduino.h> #include "fastIO.h" class FastButton { private: FastIO io; int buttonState = LOW; int currentRead = -1; //uninitialized unsigned long lastChangeTime = 0; unsigned long debounceDelay; bool justFell = false; bool justRose = false; public: FastButton(); ...
// // Created by Cristian Marastoni on 23/04/15. // #include "SocketImpl.h"
#include "pch.h" #include "RepeatUntilFail.h" namespace Hourglass { IBehavior::Result RepeatUntilFail::Run( Entity* entity ) { Result result = GetChild()->Run( entity ); if (result == kFAILURE) { return kSUCCESS; } else if (result == kSUCCESS) { GetChild()->Reset(); } return kRUNNING; } IB...
#include <iostream> #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include "OokDecoder.h" #include "NewKakuDecoder.h" NewKakuDecoder::NewKakuDecoder () { decoderName = "NEWKAKU"; } NewKakuDecoder::NewKakuDecoder (OokDecoder *pdecoder) { decoderName = "NEWKAK...
#pragma once #include "FahrAusnahme.h" class Streckenende : public FahrAusnahme { public: Streckenende(Fahrzeug *pCar, Weg *pWay); ~Streckenende(void){}; virtual void vBearbeiten(); };
// This file was generated based on /usr/local/share/uno/Packages/Fuse.Reactive.JavaScript/1.3.1/ThreadWorker.ScriptClass.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.Object.h> namespace g{namespace Fuse{namespace Reactive{struct ThreadWorker;}}} namespace g{namespa...
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::inserirNaTabela(Aluno fulano, int linha) { ui->tbl_dados->setI...
class cxp_weapon_shop { idd = 38400; movingEnable = 0; enableSimulation = 1; class controlsBackground { class RscTitleBackground: cxp_RscText { colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", ...
#pragma once #include "ISpatial.h" namespace Hourglass { template<typename T, Aabb(*FB)(const T*), bool(*FR)(const T*, const Ray&, float*, Vector3*, uint16_t)> class QuadtreeNode { public: QuadtreeNode(const Vector2& center, float size, int depth = 0) { for (int i = 0; i < 4; i++) children[i] = nullptr...
// Created on: 1993-01-11 // Created by: CKY / Contract Toubro-Larsen ( TCD ) // Copyright (c) 1993-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 /...
#ifndef _ChangeCardResultProc_H_ #define _ChangeCardResultProc_H_ #include "BaseProcess.h" class ChangeCardResultProc :public BaseProcess { public: ChangeCardResultProc(); virtual ~ChangeCardResultProc(); virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket, Context* pt); virtual int do...
// Created on: 1994-03-21 // Created by: Bruno DUMORTIER // Copyright (c) 1994-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 GN...
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- */ /* * Copyright (C) Opera Software ASA 1995-2011 */ #ifndef ES_CLONE_OBJECT_H #define ES_CLONE_OBJECT_H #include "modules/ecmascript/structured/es_clone.h" #include "modules/util/OpHashTable.h" #include "modu...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen ** */ #include "core/pch.h" #ifdef DATASTREAM...
#include "llvm/Pass.h" #include "llvm/IR/Module.h" #include "llvm/IR/Function.h" #include "llvm/IR/BasicBlock.h" #include "llvm/Support/raw_ostream.h" #include "llvm/IR/LegacyPassManager.h" #include "llvm/Transforms/IPO/PassManagerBuilder.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" #include "llvm/IR/IRBuilder...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2002 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef SEARCHMAIL_H #define SEARCHMAIL_H #include "adjunct/q...
#include<iostream> using namespace std; #define OK 1 #define ERROR 0 #define OVERFLOW -2 #define STACK_INIT_SIZE 100 #define STACKINCREMENT 10 typedef char TElemType ; typedef struct BiTNode { TElemType data; struct BiTNode *lchild,*rchild; } BiTNode,*BiTree; typedef BiTree SElemType ; typedef struct { SElemType *ba...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen ** */ #ifndef SSLSNLIST_H #define SSLSNLIST_...
// Copyright (c) 2020 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 // by the Free Software Foundation, with special ...
#pragma once #using <mscorlib.dll> #include "llvm/IR/Module.h" #include "Metadata.h" #include "Value.h" namespace LLVM { ref class LLVMContext; ref class GlobalValue; ref class StructType; ref class FunctionType; ref class AttributeSet; ref class Constant; ref class Function; ref class GlobalVariable; ref class Type;...
#include <iostream> #include <limits.h> #include <fstream> #include <cstdlib> using namespace std; // class for BST node class Node { public: Node *left, *right; int val; public: // constructor Node(int val) { this->val = val; left = right = NULL; } }; // class for BST class BST { public: Node ...
// SimpleGraphic Engine // (c) David Gowor, 2014 // // System OpenGL Header // // ======= // Classes // ======= // OpenGL settings structure struct sys_glSet_s { int bColor; // Color bits int bDepth; // Depth bits int bStencil; // Stencil bits bool vsync; // Enable vsync? }; // ======...
#include "ros/ros.h" #include "geometry_msgs/Twist.h" #include "visual_perception_msgs/PersonFollowedData.h" #include "std_msgs/Int32.h" #include "std_msgs/Float32.h" #include "std_msgs/String.h" #include "sensor_msgs/CameraInfo.h" #include <bica/Component.h> #include <cmath> #include <string> const float Pi = 3.1416;...
// Created on: 1992-10-14 // Created by: Christophe MARION // Copyright (c) 1992-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 <stdio.h> #define MAXN 10 typedef float ElementType; ElementType Average( ElementType S[], int N ); int main () { ElementType S[MAXN]; int N, i; scanf("%d", &N); for ( i=0; i<N; i++ ) scanf("%f", &S[i]); printf("%.2f\n", Average(S, N)); return 0; } ElementType Average( El...
//File name: point.cpp #include"point.h" using namespace std; Point::Point() : mX(0), mY(0) //Initializers can only be used with constructors. { } // end point default constructor Point::Point(int inX, int inY) : mX(inX), mY(inY) { } //end point void Point::setX(int inX) { mX = inX; } //end setX void P...
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional>...
#pragma once #include "Item.h" /* SeedPack represents a pack of seeds the player can plant when interacting with a 'NoInteractable' map tile */ class SeedPack : public Item { public: SeedPack() : Item(ItemType::seedPack) {} };
#if !defined (NULL) #define NULL 0 #endif #if !defined (RADIXSORT_H) #define RADIXSORT_H #include "CSC2110/CD.h" using CSC2110::CD; #include "CSC2110/QueueLinked.h" using CSC2110::QueueLinked; #include "CSC2110/text.h" using CSC2110::String; #include "CSC2110/Valtostr.h" //my own class using CSC2110::Valtostr; t...
#pragma once #include "MainPage.g.h" namespace ClientUI { public ref class MainPage sealed { public: MainPage(); private: void SourceCodeGetAPIButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); void ShowMessageBox(const Platform::String^ message); ...
struct Trie{ int trie[MAX][26]; bool finish[MAX]; int nxt = 1, len = 0; void add(string &s){ int node = 0; for(auto c: s){ if(trie[node][c-'a'] == 0){ node = trie[node][c-'a'] = nxt; nxt++; }else node = trie[node][...
/* XMRig * Copyright 2010 Jeff Garzik <jgarzik@pobox.com> * Copyright 2012-2014 pooler <pooler@litecoinpool.org> * Copyright 2014 Lucas Jones <https://github.com/lucasjones> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2016 Jay D Dee <jayddee246@gmail.com> * C...
#include<iostream> #include<iomanip> using namespace std; int main() { int n,m,k; int value[100],ans; char ch[100]; string in; cin>>n; while(n--) { int no[100]={}; cin>>k; for(int i=0;i<k;i++) {cin>>ch[i]>>value[i]; } cin>>m; cin.ignore(); for(int i=0;i<m;i++) { in....
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> #define INF 0x3f3f3f3f #define eps 1e-8 #define pi acos(-1.0) using namespace std; typedef long long L...
// SPDX-FileCopyrightText: 2021 Samuel Cabrero <samuel@orica.es> // // SPDX-License-Identifier: MIT #ifndef __STATE_UNARMORING_H__ #define __STATE_UNARMORING_H__ #include "state.h" class TUnarmoring : public TState { public: TUnarmoring(); virtual const char *name() const; virtual void enter(); virtual void lo...
// Copyright (c) 2016 Mozart Alexander Louis. All rights reserved. #include "fmod_engine.hxx" AudioUtils* AudioUtils::m_instance_ = nullptr; inline void check_result(const FMOD_RESULT result) { CCASSERT(result == FMOD_OK, "FMOD Asset Failed..."); } AudioUtils::AudioUtils() : audio_enabled_(true), low_level_system_(...
#pragma once #include <mutex> struct AVPacket; struct AVFormatContext; struct AVDictionary; struct AVCodecParameters; class XDemux { public: XDemux(); virtual ~XDemux(); public: //初始化部分参数 virtual bool Init(); //打开媒体文件,或者流媒体文件 virtual bool Open(const char* url); //关闭媒体文件 virtual void Close(); //清空当前参数 virt...
// Created on: 2002-12-12 // Created by: data exchange team // Copyright (c) 2002-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...
// BullCowGame.cpp : This file contains the 'main' function. Program execution begins and ends there. // /* This is the console executable that makes use of the BullCow class This acts as the view in the MVC pattern and is responsible for all user int32eraction. For game logic see the FBullCowGame class. */ #include ...
// Copyright (c) 2021 ETH Zurich // // SPDX-License-Identifier: BSL-1.0 // 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) #pragma once #include <pika/assert.hpp> #include <pika/concepts/concepts.hpp> #include <p...
// // newSet.cpp // Homework 1 // // Created by Hender Lin on 4/12/21. // #include <iostream> #include <string> #include "newSet.h" using namespace std; Set::Set(int max) { if (max < 0) { exit(1); } m_length = 0; m_max = max; m_set = new ItemType[max]; } Set::Set(const Set &other) ...
/* 1220.cc */ #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; #define M 5 #define N 20 class A{ public: A(){ cout<<"class A created."<<endl; } ~A(){ cout<<"class A deleted."<<endl; } }; class B: public A{ public: B(){ cout<<"class B created."<...
// Example 6.6 : Time and date // Created by Oleksiy Grechnyev 2017 #include <iostream> #include <thread> #include <ratio> #include <chrono> #include <ctime> #include <iomanip> using namespace std; using namespace std::chrono; // Some method we are going to time int fun(int n){ int result = 0; for (int i = 0...
#include "stdafx.h" #include "Deque.cpp" class Simple2TieredVector : public ArrayDataStructure { private: int32_t n = 0; int32_t m = 0; // Number of children protected: vector<Deque> children; void init(int32_t size) { this->m = size; this->children = vector<Deque>(m); } void increaseCapacity() { int32_t...
/* Castle of Despair SDH 1/21/03 */ #include "stdafx.h" #include "windows.h" #include <cstdlib> #include <conio.h> #include <iostream> #include <string> #include <time.h> #include <vector> using namespace std; int random(int max) { return rand() % max; } void randomize(void) { srand (time(NULL)); } str...
#pragma once #include <set> #include <memory> #include <iosfwd> #include <boost/range/iterator_range.hpp> #include <bullet/btBulletDynamicsCommon.h> #include <bullet/BulletCollision/btBulletCollisionCommon.h> namespace physics { class body { public: /*! represents body shape To create box shape, type \code shape_...
#include "Renderer.hpp" #include "lodepng.h" #include <string> #include <iostream> using namespace std; namespace mobo { GLfloat vtxData[] = { -1.0, -1.0, 0.0, 1.0, 1.0, -1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 }; GLint vtxDataSize = 12; GLfloat clrData[] = { 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, ...
#include<iostream> #include<cstdio> #include<malloc.h> using namespace std; struct Road{ int from; int to; }; int k=0; int main(){ int quicksort(Road *data,int low,int high); int find_the_height(int spot,int m,Road*road); //输入 int n,m; fscanf(stdin,"%d %d",&n,&m); Road*road=(Road*)malloc(1000100*sizeof(Road));...
#include "akasztofa.h" #include <string> #include <gtest/gtest.h> TEST(AkasztofaTest, getHatra_feladvanyHossz) { std::string feladvany = "abcde"; Akasztofa a(feladvany); EXPECT_EQ(feladvany.length(), a.getHatra()) << "A feladvany hosszanak kell lennie az alapertelmezett " << "maximalis probalkozasi szamn...
#include "stdafx.h" #include "utils.h" #include <malloc.h> /** double the size of an array with error checking @param array pointer to an array whose size is to be doubled @param n number of elements allocated for \a array @param size size in bytes of elements in \a array @return returns the new number of eleme...
#include <iostream> #include <vector> #include <Poco/Environment.h> #include <Poco/Exception.h> #include <Poco/Logger.h> #include <Poco/StringTokenizer.h> #include <Poco/Version.h> #include <Poco/Util/OptionSet.h> #include <Poco/Util/OptionCallback.h> #include <Poco/Util/HelpFormatter.h> #include "di/DependencyInject...
#include "proto\Request.pb.h" #include "proto\RequestOrdersStatus.pb.h" #include "proto\SignalOrdersStatus.pb.h" #include "proto\Signal.pb.h" #include "proto\SignalMT4Trade.pb.h" #include "proto\RequestExecution.pb.h" #include "SignalModule.h" #include "ZeroMqDealer.h" #include <iostream> #include <thread> class Sig...
/* * In a more traditional environments, one would split into .H and .CPP files. However in Arduino, the ".ino" file * comes with certain built-in includes (such as "Arduino.h" and more) which are not automatically added to other CPP * files. So, to make things more seamless, I will be putting implementation directl...
class Solution { public: vector<vector<string>> solveNQueens(int n) { vector<vector<string> > ans; if (n == 1) { vector<string> vec; vec.push_back("Q"); ans.push_back(vec); return ans; } else if (n >= 2 && n <= 3) { return ans; ...
#include "server.h" Server::Server() { } Server::Server(unsigned short int port) { this->isMessage = false; this->port = port; this->listeningSocketDescriptor = -1; this->maxSocketDescriptor = 0; FD_ZERO(&(this->socketsDescriptors)); } bool Server::createListeningSocket() { if((this->listeni...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <folly/container/F14Map.h> #include <glog/logging.h> #include <set> #include <quic/codec/Types.h> namesp...
class CZ_750_S1_ACR; class CZ750_DZ: CZ_750_S1_ACR { displayName = $STR_DZ_WPN_CZ750_NAME; descriptionShort = $STR_DZ_WPN_CZ750_DESC; magazines[] = {"10Rnd_762x51_CZ750"}; };
#include "mailRefList.h" #include <fstream> #include <string> #include <iomanip> using namespace std; void initialize(tMailRefList &refList) { refList.counter = 0; } void load(tMailRefList &refList, ifstream &file) { file >> refList.counter; for (int i = 0; i < refList.counter; i++) { file >> refList.references...
/* * @lc app=leetcode.cn id=355 lang=cpp * * [355] 设计推特 */ // @lc code=start #include<iostream> #include<vector> #include<set> #include<algorithm> #include<queue> #include<map> using namespace std; class Twitter { static int timestamp; struct Tweet{ int id; int time; Tweet ...
/*** File system class. ***/ /** Version 2 + modifications for functional model. **/ #include "r2/src/common.hh" using namespace r2; /** Included files. **/ #include "filesystem.hpp" #include "RPCServer.hpp" extern RPCServer *server; bool Dotx = true; uint64_t TxLocalBegin() { if (!Dotx) return 0; r...
#include <stdio.h> #include <stdlib.h> #include <stdio.h> #include "_syslog.h" // #include <basetsd.h> #include <ctype.h> #include <string> #include <libxml/tree.h> #include <libxml/parser.h> #include <libxml/xpath.h> #include <libxml/xpathInternals.h> #if defined(LIBXML_XPATH_ENABLED) && defined(LIB...
#include <cppunit/extensions/HelperMacros.h> #include <Poco/Exception.h> #include "cppunit/BetterAssert.h" #include "model/RefreshTime.h" using namespace std; using namespace Poco; namespace BeeeOn { class RefreshTimeTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(RefreshTimeTest); CPPUNIT_TEST(testNone)...
#include "stdafx.h" #include "AbsShaderCreator.h" void AbsShaderCreator::SetNext(shared_ptr<AbsShaderCreator> next) { NextShader = next; } HRESULT AbsShaderCreator::CreateShader(ComPtr<ID3D11Device> d3dDevice, string type, const void* pShaderBytecode, SIZE_T BytecodeLength, ID3D11ClassLinkage* pClassLinkage) { if ...
#include <bits/stdc++.h> using namespace std; #define ll long long int int status[3700005]; vector<int>prms; int main() { ll n,i,si,j; si=int(sqrt((double)n+1)); for(i=2; i<=3600000; i++) { if(status[i]==0) { prms.push_back(i); for(j=i; j<=3600000; j+=i...
#include <mesh.h> #include <vector> #include <algorithm> Mesh::Mesh() {} Mesh::Mesh(Vertex* vertices, unsigned int numVertices) { m_drawcount = numVertices; glGenVertexArrays(1, &m_vertexArrayObject); glBindVertexArray(m_vertexArrayObject); std::vector<glm::vec3> positions; std::vector<glm::vec2...
/* -*-C++-*- */ /* * Copyright 2016 EU Project ASAP 619706. * * 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 appl...
/* 在字符原数组上进行操作。计算出有多少个空格和新字符串的长度。使用two pointers的方法,从后向前复制,遇到空格则替换为"%20"。 当两个pointer相遇时所有空格已经替换完。 */ class Solution { public: void replaceSpace(char *str,int length) { int originalLength = 0; // exclude '\0' int numOfBlank = 0; int i = 0; while(str[i] != '\0'){ originalLength...
// Created on: 2016-04-13 // Created by: Denis BOGOLEPOV // Copyright (c) 2013-2016 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 ...
#include "mainwindow.h" #include <QApplication> #include <QMessageBox> #include <iostream> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; // QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); // db.setDatabaseName("test"); // db.open(); // if(db.open...
#include<bits/stdc++.h> using namespace std; class Node{ public: int key; Node* left; Node* right; int height; int findHeight(Node* n){ if(n==NULL){ return 0; } return n->height; } Node* newNode(int key){ ...
#include "../include/Player.h" #include "../include/WindowInfo.h" #include "../include/Camera.h" #include "../include/Bullet.h" #include "../include/TextureManager.h" #include "../include/BulletManager.h" #include "../include/AudioManager.h" #include "../include/Global.h" #include <cmath> namespace gnGame { // プレイヤー...
/** \file Renderer.cpp * \author Eduardo Pinho ( enet4mikeenet AT gmail.com ) * \date 2013 */ #include "Renderer.h" #include <string.h> #ifdef Derplotter_DEBUG #include <stdio.h> static void DEBUG(const char* s) { printf("RENDERER: %s\n", s); fflush(stdout);} #else static void DEBUG(const char* s){} #endif usin...
/* * Copyright (c) 2016-2021 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_COMPARATORS_PROJECTION_COMPARE_H_ #define CPPSORT_COMPARATORS_PROJECTION_COMPARE_H_ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <tu...
// Created on: 1992-10-29 // Created by: Gilles DEBARBOUILLE // Copyright (c) 1992-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 th...
// // EPITECH PROJECT, 2019 // kevin // File description: // cpp // #include "saveData.hpp" Save::Save() { initLoadable(); } Save::~Save(){} void Save::printName() { for (auto i = _name.rbegin(); i != _name.rend(); ++i) std::cout << *i << std::endl; } bool Save::loadData(std::string player_name) { ...