text
stringlengths
8
6.88M
#include <Rcpp.h> using namespace Rcpp; #include <limits> // [[Rcpp::export]] int closest_sample(const NumericVector x, const NumericMatrix& constituent_samples){ unsigned int n = constituent_samples.nrow(), i = 0, idx = 0; double d = std::numeric_limits<double>::max(), tmp_d; for (i = 0; i < n; ++i){ const...
#pragma once #include <string> #include <ctime> using namespace std; class Message { public: Message(string senderIn, string textIn, time_t sendTimeIn); ~Message(); private: string sender; string text; time_t sendTime; };
/* * Socket.cpp * * Created on: Jun 3, 2017 * Author: user */ #include "Socket.h" namespace npl{ Socket::Socket(int type) { fsize = 0; socket_fd = socket(AF_INET, type, 0); } int Socket::bind(int port) { bzero((char *) &s_in, sizeof(s_in)); s_in.sin_family = (short) AF_INET; s_in.sin_addr.s_addr = ...
#include <stdafx.h> #include <cstdio> #include "ASModeling.h" #include "../Utils/image/PFMImage.h" #include "../Utils/image/BMPImage.h" //////////////////////////////////////////////////////// // // Load captured image for current frame // // All the frame images are stored at // ../Data/Camera**/F...
#pragma once #include "ofGraphics.h" #include "ofVec2f.h" class Planet { private: ofVec2f m_position; ofColor m_color; float m_distance; float m_radiusAtraction; float m_velocity; float m_mass; float m_size; float m_angle; public: Planet(); Planet(const ofVec2f &center, float distance, float rad...
#include "RakPeerInterface.h" #include "RakNetworkFactory.h" #include <stdio.h> #include "Kbhit.h" #include <string.h> #include <stdlib.h> #include "BitStream.h" #include "MessageIdentifiers.h" #include "Router2.h" #include "RakSleep.h" #include "GetTime.h" #include "Rand.h" bool SendGUID(RakNetGUID...
//linkedList.cpp - linkedList class specification linkedList::linkedList(){ l = NULL; } //enter a value in the front void linkedList::enterFront(int x){ ptrType p = new node; p->info = x; p->next = l; l = p; } //enter a value in the rear void linkedList::enterRear(int x){ if (l == NULL){ enterFront(x); ret...
// MFCSinglePipeParentView.h : interface of the CMFCSinglePipeParentView class // #pragma once class CMFCSinglePipeParentView : public CView { protected: // create from serialization only CMFCSinglePipeParentView(); DECLARE_DYNCREATE(CMFCSinglePipeParentView) // Attributes public: CMFCSinglePipeParentDoc* GetDo...
#include <iostream> #include <exception> class MyException { public: MyException(const std::string error_type) { error = error_type; } ~MyException() {} std::string what() { return error; } private: std::string error; };
#pragma once #include <iostream> #include <iomanip> using namespace std; struct LinkNode //链表类节点 { int data; //数据域 LinkNode *link; //指针域 LinkNode(LinkNode *ptr = NULL) { link = ptr; }//仅初始化指针 LinkNode(const int &item, LinkNode *ptr = NULL) {//初始化数据和指针的构造 data = item; link = ptr; } }; class List //int单链表类 { pu...
#include "llvm/Pass.h" #include "llvm/IR/Module.h" #include "llvm/IR/Function.h" #include "llvm/Support/raw_ostream.h" #include "llvm/IR/Type.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Instruction.h" #include <llvm/Support/ToolOutputFile.h> #include <llvm/Support/FileSystem.h> #include "llvm/IR/ModuleSlotT...
#include "Board.h" static const char *GOSPERGLIDER = "...................................." "...................................." "...................................." "...................................." ...
#include "GoodsManage.h" #include "SaveLoadStream.h" BaseGoods * GoodsManage::getEquip(int i) { if (i >= 0 && i < (int)(mEquipList.size())) { return mEquipList[i]; } return NULL; } int GoodsManage::getEquitTypeNum() { return mEquipList.size(); } BaseGoods * GoodsManage::getGoods(int i) { ...
/*Given a string S consisting of opening and closing parenthesis '(' and ')'. Find length of the longest valid parenthesis substring. Input: First line contains number of test cases T. Each test case have one line string S of character '(' and ')' of length N.*/ #include <bits/stdc++.h> using namespace std; void pr...
#include<iostream> using namespace std; int main() { cout << "큰 따옴표는 \"""입니다\n"; cout << "작은 따옴표는 \'입니다\n"; cout << "문자 A는 \'A\'입니다\n"; cout << "큰 따옴표의 이스케이프 시퀀스는 \\\"입니다."; }
#include <unordered_set> #include <vector> using namespace std; class Solution { public: int singleNumber(vector<int>& nums) { int res = 0; for (auto elem : nums) res ^= elem; return res; } };
// // Created by Alex Shaver on 8/30/17. // #ifndef FACTORYEXAMPLE_APPLE_H #define FACTORYEXAMPLE_APPLE_H #include "Alpha.h" class Apple : public Alpha{ public: void print() override; }; #endif //FACTORYEXAMPLE_APPLE_H
#include<iostream> #include <fstream> #include <string> #include <vector> #include<cctype> using namespace std; string ge; int n=0; int num=0; char name[100]; vector<string>ist; vector<string>sub; vector<int>p; vector<int>c; int x,y,z,j=0; string com,two,sec,mand; int main(){ ifstream dest; dest.open("name_score.t...
#include <iostream> #include <vector> #include <tesseract/baseapi.h> #include <leptonica/allheaders.h> using namespace std; int main(int argc, char *argv[]) { auto input = argv[1]; if (argc < 2) { cout << "argument missing" << std::endl; exit(1); } Pix *image = pixRead(input); tess...
#pragma once #include "cpu.h" #include <SDL.h> namespace chip8 { class SDL_Platform { public: SDL_Platform(char const*, int, int); ~SDL_Platform(); void Update(void const*, int) const; static bool ProcessInput(uint8_t*); private: SDL_Window* window{}; SDL_Renderer* renderer{}; SDL_Texture* text...
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin>>t; while(t--) { int n,m,x,y; cin>>n>>m>>x>>y; double r=(y/2.0); char a[n][m]; ll white=0; for(int i=0;i<n...
#include<iostream> #include<sstream> #include<string> using namespace std; int main() { string s = "07:00:57"; stringstream ss(s); string tok; int converted; char delimiter=':'; while(getline(ss,tok,delimiter)) { stringstream basic(tok); basic >> converted; } cou...
//25 Write A C++ Program To Declare The Global Class. #include<stdio.h> class global{ public: int a; global(int b) { a = b; }; }; global g(8); int main() { printf("Global = %d\n", g.a); return 0; }
#ifndef ZDDIMP2_H #define ZDDIMP2_H /// @file ZddImp2.h /// @brief ZddImp2 のヘッダファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2005-2012 Yusuke Matsunaga /// All rights reserved. #include "YmLogic/Zdd.h" #include "YmLogic/ZddMgr.h" #include "YmNetworks/bdn.h" BEGIN_NAMESPACE_YM //////////////////...
#include <iostream> #include <vector> #include <algorithm> using namespace std; void helper(vector<int> &nums, vector<vector<int>> &res, vector<int> &com, vector<bool> flag) { if (find(flag.begin(), flag.end(), false) == flag.end()) { res.push_back(com); return; } for (int i = 0; i < nums.s...
#ifndef ELECTRICCELL_VER2_H #define ELECTRICCELL_VER2_H #include <cmath> #include <vector> #include <fstream> #include <ctime> #include <string> using namespace std; #include "particle.h" #include "toner_particle.h" #include "wall.h" /*//////////////////////////////////////////////////// Node構造体 ...
#include<stdio.h> #define N 100 #define M 1e8 int main() { int n,m,i,j; int a[N][N],maxh[N],minl[N]; //0 每行最大 1 每列最小 printf("行数:"); scanf("%d",&n); printf("列数:"); scanf("%d",&m); for(i=1;i<=n;i++) { for(j=1;j<=m;j++) { scanf("%d",&a[i][j]); minl[j]=M; } maxh[i]=0; } for(i=1;i<=n;i++) for(j=1...
#ifndef ROSE_BINARY_CALLCONV_H #define ROSE_BINARY_CALLCONV_H #include <cassert> #include <vector> class BinaryCallingConvention { /************************************************************************************************************************** * Calling conventio...
#pragma once #include "HttpServer.h" #include "syncengine/rsyncengine.h" class CServerHost { public: CServerHost(void); virtual ~CServerHost(void); bool Start(HWND hWnd); void Stop (); private: CHttpServer* m_httpserver; CSyncEngine* m_syncengine; };
#include "PBRMaterial.h" /* ; Random Material */ PBRMaterial::PBRMaterial(std::shared_ptr<Shader> shader,glm::vec3 baseColor):Material(shader) { this->baseColor = baseColor; std::random_device rd; std::mt19937 rng(rd()); std::uniform_real_distribution<float> dist(0.0f, 1.0f); this->ambient = 0.1f; this->metallic...
#include "tire.h" unordered_set<string> non_terminals; unordered_set<string> terminals; unordered_set<string> V_T; unordered_set<string> V_N; unordered_map<string, vector<string>> productions; unordered_map<string, set<string>> first; unordered_map<string, set<string>> first_of_prod; unordered_map<string, set<string>>...
#include "gui\Singularity.Gui.h" namespace Singularity { namespace Gui { void ListBoxElement::OnMouseEnter(Vector2 position) { // this->ListPanel->ListBox this->Set_Texture(m_pHighlightTexture); this->Set_FontColor(m_cOptionHighlightColor); } void ListBoxElement::OnMouseDown(Vector...
#ifndef _NEXTAI_STRING_H_ #define _NEXTAI_STRING_H_ #include <string> namespace NextAI { class StringUtil { public: static std::string ws2s(const std::wstring& ws); static std::wstring s2ws(const std::string& s); }; } std::wostream& operator<<(std::wostream& os, const std::string& obj); #en...
#include <iostream> #include <vector> #include <algorithm> // source: https://medium.com/@interviewprep/ugly-number-dynamic-programming-94520110a084 using namespace std; using uInt = unsigned int; uInt findUglyNumber(uInt position) { const uInt NUMBER_TWO = 2; const uInt NUMBER_THREE = 3; ...
// // Count the repetitions of a number in an array. // // Created by iosiah Turnquist on 11/12/19. // Copyright © 2019 NightLabs. All rights reserved. // #include <iostream> #include "arrayCounter.hpp" using namespace std; int main() { int array[] = {1, 4, 1, 3, 2, 3, 4, 5, 6, 11, 2, 999, 55, 4, 55, 24, 54,...
// // builder.h // design_pattern // // Created by jack on 14-7-13. // Copyright (c) 2014年 jack. All rights reserved. // #ifndef design_pattern_builder_h #define design_pattern_builder_h #include <iostream> using namespace std; /** * 只是各个部分的实现 */ class Builder { public: virtual void BuildHead() {} vir...
// // GameTask.h // Boids // // Created by Yanjie Chen on 3/23/15. // // #ifndef __Boids__GameTask__ #define __Boids__GameTask__ #include "cocos2d.h" class MapLogic; class GameTask : public cocos2d::Ref { protected: int _task_id; MapLogic* _map_logic; bool _is_primary; std::string _task_name...
#include <iostream> #include <cstdio> #include <cstdlib> #include <climits> using namespace std; int main ( int argc , char * argv[] ) { int n; scanf("%d" , &n); n <<= 1; char * array = (char * ) malloc ( sizeof(char) * n ); char * temp = (char * ) malloc ( sizeof(char) * 2 ); getchar(); ...
// jpegload.cpp - JPEG image loader // (c) 2020 Michael Fink // https://github.com/vividos/OldStuff/ #include "jpegload.h" #pragma option -a- #pragma option -b- #include <jpeglib.h> #pragma option -a #pragma option -b #include <assert.h> #include <mem.h> #include "image.h" inline void swap_bytes(byte& b1, byte& b2) ...
#include <memory> #include "aloha_stats.h" #include "../bricks/port.h" #if defined(BRICKS_JAVA) || defined(BRICKS_ANDROID) #include "../bricks/java_wrapper/java_wrapper.h" static std::unique_ptr<aloha::Stats> g_stats; extern "C" { JNIEXPORT void JNICALL Java_org_alohastats_lib_Statistics_setupCPP(JNIEnv* env, ...
/*************************************** Author : jt Mail : zhuiyitaosheng@gmail.com ***************************************/ #include <iostream> //#include <cstring> //#include <vector> //#include <cstddef> //#include <exception> //#include <stdexcept> //#include <new> //#include <type_info> using namespace::std; ...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> /** FORK PROCESS * System call fork() is used to create processes. It takes no arguments and returns * a process ID. The purpose of fork() is to create a new process, which becomes the * child process of the call...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "BehaviorTree/BTService.h" #include "BTService_MoveToEnemy.generated.h" /** * */ UCLASS() class XPROJECT_API UBTService_MoveToEnemy : public UBTService { GENERATED_BODY() };
#include "interfaceoptions.h" InterfaceOptions::InterfaceOptions() : m_interface(Hidden) { } InterfaceOptions::InterfaceOptions(Interface interface, const QString &category, const QString &caption) : m_interface(interface), m_category(category), m_caption(caption) { }
/* * @lc app=leetcode.cn id=5364 lang=cpp * * [5364] 按既定顺序创建目标数组 */ #include <vector> // @lc code=start class Solution { public: vector<int> createTargetArray(vector<int>& nums, vector<int>& index) { vector<int> target; for (int i = 0; i < nums.size(); i ++ ) target.insert(...
#include<iostream.h> #include<conio.h> class fibo { public: int n,a,b,c,i; void get() { a=0; b=1; c=0; cout<<"\n Enter the Number:"; cin>>n; for(i=0;i<n;i++) { cout<<" "<<c; c=a+b; b=a; a=c; } } }; void main() { clrscr(); fibo f; f.get(); getch(); }
/* fast_rotate_loose_double : replaces imrotate(image,angle,'crop') for * for double 3 dims image, UINT8 class. * Work ten times faster, tested on matlab 7, VC6. * Compile it using the mex tools - * mex fast_rotate.cpp. */ #include <mex.h> #include <math.h> const double PI = 3.14159265358979323846; inline float...
#include"student.h" //默认构造 Student::Student() { } //有参构造(学号、姓名、密码) Student::Student(int id, string name, string pwd) { //初始化属性 this->m_Id = id; this->m_Name = name; this->m_Pwd = pwd; //初始化机房信息 ifstream ifs; ifs.open(COMPUTER_FILE, ios::in); ComputerRoom com; while (ifs>>com.m_ComId&&com....
// // 演算子のオーバーロードの刑 // #include <iostream> class Int { private: int value{0}; public: Int() : value(0) {} Int(int _val) : value(_val) { std::cout << "代入されました[" << this << "]" << ":" << value << std::endl; } operator int() { std::cout << "int型で返却しました[" << this << "]" << ":" << va...
#include <iostream> #include <string> #include <cmath> #include <chrono> #include <stdexcept> #include <thread> //#include <stdlib.h> #include "../include/Classificator.h" #include "../include/Matrix.h" #include "../include/MatrixOp.h" #include "../include/Tester.h" ///***---------------------------------------------...
#include "ParsimonySequence.h" #include "stringhelper.h" using namespace Proteomics::ProteolyticDigestion; namespace EngineLayer { namespace ProteinParsimony { ParsimonySequence::ParsimonySequence(PeptideWithSetModifications *pwsm, bool TreatModPeptidesAsDifferentPeptides) { ...
/* * SPDX-FileCopyrightText: 2020 Rolf Eike Beer <eike@sf-mail.de> * * SPDX-License-Identifier: GPL-3.0-or-later */ #include "RelationModel.h" #include <osm_objects.h> #include "osm2go_i18n.h" #include "osm2go_platform_qt.h" namespace { std::vector<std::pair<relation_t *, const relation_t *>> getRelations(osm_...
#include "../../include/interactive_mid_protocols/SigmaProtocol.hpp" /***************************/ /* SigmaProver */ /***************************/ void SigmaProver::processFirstMsg(shared_ptr<SigmaProverInput> input) { // compute the first message by the underlying proverComputation. auto a = proverComp...
class Solution { public: int pivotIndex(vector<int>& nums) { int leftSum = 0; int rightSum = 0; int sum = 0; for (int num : nums) { sum += num; } for (int i = 0; i < nums.size(); i++) { leftSum += nums[i]; rightSum = sum ...
#pragma once #include "ofMain.h" #include "ofxLeapMotion2.h" #include "ofxTrueTypeFontUC.h" //#include"Particle.hpp" class ofApp : public ofBaseApp{ private: ofxTrueTypeFontUC font1,font2; public: void setup(); void update(); void draw(); void keyPressed(int key); void keyReleased(...
#include "System.h" class DefaultSystem: public ISystem { public: virtual bool Call( const string& path, const StrVec& args ) override { return false; } }; System Fabric::CreateDefaultSystem() { return std::make_shared< DefaultSystem >(); }
#include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) scanf("%lld", &n) #define scc(c) scanf(" %c", &c); #define fr(i,n) for (ll i=0;i<n;i++) ll f(ll n) { if(n==0)return 1; if(n%3 > 1 )return 0; return f(n/3...
#ifndef __ItemFlower_H__ #define __ItemFlower_H__ #include "Item.h" class ItemFlower : public Item { public: static ItemFlower* create(CCDictionary* dict); bool init(CCDictionary* dict); bool _bShow; // 表现状态,就是花全部显示出来之后的状态 int _yTop; int _yButtom; void updateStatus(); void move(float dt); void collision(); ...
// // Created by zanbo on 2020/2/27. // #include <vector> #include <stdlib.h> #include <iostream> #include <map> #include <unordered_map> #include <set> #include <queue> #include <algorithm> using namespace std; struct ListNode { int val; ListNode* next; ListNode(int x): val(x),next(NULL){}; }; class Sol...
class Solution { public: void flatten(TreeNode* root) { vector<TreeNode*> l; preorderTraversal(root, l); int n = l.size(); for (int i = 1; i < n; i++) { TreeNode *prev = l.at(i - 1), *curr = l.at(i); prev->left = nullptr; prev->right = curr; ...
class Solution { public: ListNode *reverseBetween(ListNode *head, int m, int n) { ListNode **p = &head; ListNode *list = NULL, *tail = NULL; for (int i = 0; i < m-1; ++i) { p = &((*p)->next); } tail = *p; for (int i = 0; i < n-m+1; ++i) { ...
#include "../Include/UI.h" #include "../Include/Botton.h" #include "../Include/Widget.h" UI::UI() :backgroundCount(0) , isdrawing(false) { init(); } void UI::processInput(int x, int y) { //检测工具区域 if ((x >= 930 && x <= 1330) && (y >= 650 && y <= 730) || ((x >= 1170 && x <= 1290) && (y >= 450 && y <= 600))) { ...
/********************************************************************** * Program: hello.cpp * Author: Jason Cearley * Class: CS161 * Date: 10/1/14 * Modified: 10/3/14 * Description: This program prints "Hello World!" to the screen * Input: None * Output: Hello World! text * ***********************************...
#pragma once #include "../Mesh.h" #include <SimpleMath.h> #include <d3d12.h> using namespace DirectX::SimpleMath; class MeshDX12 : public Mesh { public: MeshDX12(); ~MeshDX12(); virtual void bindIAVertexBuffer(unsigned int location); void setCommandList(ID3D12GraphicsCommandList* cmdList); };
#ifndef WEAPON_CHANGE #define WEAPON_CHANGE #include "Event.hpp" class WeaponChangeEvent: public GameEvent{ private: int WeaponNumber; public: WeaponChangeEvent(int i); WeaponChangeEvent(string s); virtual string EventToString(); }; #endif
/*************************************************************************** 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...
/*----------------------------------------------------------------------- Matt Marchant 2015 - 2016 http://trederia.blogspot.com Robomower - Zlib license. This software is provided 'as-is', without any express or implied warranty.In no event will the authors be held liable for any damages arising from the use of thi...
/*************************************************************************** matrixstack.h - description ------------------- begin : Tue Jul 24 2002 copyright : (C) 2002 by Marco Bubke email : marco@bubke.de *...
// // Created by sxg on 2019/9/23. // # include<iostream> #include<stack> using namespace std; template<class T> struct BinNode { T data; BinNode<T> *left; BinNode<T> *right; BinNode(T x) { data = x; left = right = nullptr; } }; template <class T> class BinaryTree { protected: ...
//--------------------------------------------------------------------------- #ifndef FlopTreeH #define FlopTreeH //--------------------------------------------------------------------------- using namespace std; #include <vector> #include "..\..\Source\HandsGroupEX.h" #include "..\..\..\Common\sitHoldem.h" #include ...
/********************************************************************* Matt Marchant 2014 - 2016 http://trederia.blogspot.com xygine - Zlib license. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this soft...
/*************************************************************************** Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. 2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD FileName: QTSSDictionary.h Description: Definitions of two classes: QTSSDictionary and ...
#include "PlatformPch.h" #include "Print.h" #include <stdlib.h> void Helium::Print(const tchar_t* fmt, ...) { va_list args; va_start(args, fmt); _vtprintf(fmt, args); va_end(args); }
#include "Gameobject.h" Vector3f Gameobject::GetPosition() { return _position; } Gameobject::Gameobject(const Vector3f& pos) : _position(pos) { }
#include <iostream> using namespace std; // Function that converts decimal to binary void decToBinary(int n) { // Size of an integer is assumed to be 8 bits for (int i = 7; i >= 0; i--) { int k = n >> i; if (k & 1) cout << "1"; else cout << "0"; } ...
#ifndef JSON_H #define JSON_H #include <parametre.h> #include <json.h> #include <QVector> #include <QJsonDocument> #include <QJsonArray> #include <QJsonObject> #include <QString> #include <QFile> #include <QIODevice> #include <QList> #include <QDebug> class Parametre; //j'inclus la classe Parametre afin ...
#include <iostream> using namespace std; #include <catch2/catch.hpp> #include <cpp_algs.hpp> TEST_CASE("Queue test", "[DS]") { ds::Queue<int> q = ds::Queue<int>(); REQUIRE(q.size() == 0); q.enqueue(10); q.enqueue(20); REQUIRE(q.size() == 2); }
/************************************************************************* > File Name : CertificateResponse.cpp > Author : YangShuai > Created Time: 2016年07月29日 星期五 20时54分08秒 > Description : ************************************************************************/ #include<cstring> #include"Itsdata...
#include "SQLite.h" #include <cstdio> #include <sstream> #include <boost/shared_ptr.hpp> static int callback(void *NotUsed, int argc, char **argv, char **azColName){ int i; for(i=0; i<argc; i++){ // printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL"); } //printf("\n"); ...
#include "PF_Tracker.h" int main() { string imgPath = libraryPath+vedioName+"\\"; vector<string> imgs = makeImgsVector(imgPath, vedioLength); VideoProcessor vedio; PF_Tracker tracker; vedio.setInput(imgs); vedio.displayOutput("Output"); vedio.setFrameProcessor(&tracker); vedio.setDelay(1); vedio.run(); retur...
// // Copyright Jason Rice 2016 // 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_MAKE_DELTA_HPP #define NBDL_MAKE_DELTA_HPP #include <nbdl/concept/BindableSequence.hpp> #include <nbdl/concept/Delt...
// -*- 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...
// // Created by yulichao on 2020/7/4. // #include <vector> #include <cstdio> #include <iostream> using namespace std; template<typename T> class myType { public: private: T _array[10]; }; class Obj { public: Obj() { puts("Obj()"); } ~Obj() { puts("~Obj()"); } }; void foo(int n) { Obj obj; ...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.Media.Effects.1.h" #include "Windows.Media.1.h" WINRT_EXPORT namespace winrt { namespace ABI::Windows::Foundation::Collections { #ifndef WINRT_GENERIC_1a81ec3e_5afb_5e10_92...
#ifndef __RETRIEVER_H__ #define __RETRIEVER_H__ #include"Dog.h" class Retriever : public Dog { public: Retriever(const char* name); virtual ~Retriever(); virtual void printToConsole(); virtual const char* getSpeciesString(); }; #endif
// 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.Xaml.Hosting.0.h" #include "Windows.Foundation.0.h" #include "Windows.UI.Composition.0.h" #include "Windows.UI.Xaml.0.h" #include "Windows.UI.Xaml.Cont...
#include<stdio.h> double save[5][50]; int main() { int c; scanf("%d",&c); while(c--) { int n,k,m; scanf("%d %d %d",&n,&k,&m); int music_len[50]; for(int i=0;i<n;i++) scanf("%d",&music_len[i]); double music_prob[50][50]; for(int i=0;i<n;i++) for(int j=0;j<n;j++) scanf("%lf",&music_prob[i][j]...
// // SkillCache.cpp // Boids // // Created by chenyanjie on 3/31/15. // // #include "SkillCache.h" using namespace cocos2d; SkillCache* SkillCache::_instance = nullptr; SkillCache::SkillCache() { } SkillCache::~SkillCache() { } SkillCache* SkillCache::getInstance() { if( _instance == nullptr ) {...
#include <iostream.h> class Worker{ public: int m_salary; Worker():m_salary(0){} Worker(int i):m_salary(i){} Worker(const Worker& other){ m_salary = other.m_salary; } friend Worker operator+(const Worker& w1,const Worker& w2); Worker& operator+=(const Worker& w){ m_salary+=w.m_salary; retur...
#include <iostream> #include <string> #include <fstream> #define cimg_use_jpeg 1 #include "CImg.h" using namespace cimg_library; using namespace std; const string filename = "data.dat"; const string dimensiones = "dimensiones.dat"; struct Node { int x1; int y1; int x2; int y2; int color; Node...
#pragma once #ifndef SEARCHPAGE_H #define SEARCHPAGE_H #include <vector> #include <QWidget> #include <QScrollArea> #include "PlaylistElementGUI.h" #include "PlaylistElement.h" #include "Playlist.h" #include "PlaylistData.h" #include "ContentPage.h" class SearchPage : public QWidget { Q_OBJECT private: PlaylistDa...
#pragma once #include "GameObject.h" #include "../CSC8503Common/StateMachine.h" #include <vector> /* * @Author - BaileyGardner * EnemyAI class for a variety of AI used for the golf game * * Handles: behaviour, AI state machine, pathfinding */ namespace NCL { namespace CSC8503 { class NetworkObject; // base cla...
/** * Sinks to and from iostreams. */ #ifndef FISHY_SERIALIZER_STREAMSINK_H #define FISHY_SERIALIZER_STREAMSINK_H #include "serializer.h" #include <iostream> namespace core { namespace base { class InStreamSink : public iBinarySerializerSink { public: InStreamSink(std::istream &sink) : m_sink(sink), m_size(si...
// -------------------------- // projects/c++/graph/Graph.h // Copyright (C) 2015 // Glenn P. Downing // -------------------------- #ifndef Graph_h #define Graph_h // -------- // includes // -------- #include <cassert> // assert #include <cstddef> // size_t #include <utility> // make_pair, pair #include <vector> //...
// // SMDownloader.cpp // SMFrameWork // // Created by SteveMac on 2018. 9. 7.. // #include "SMDownloader.h" #include <cocos2d.h> #define TIMEOUT_IN_SECOND (10L) #define LOW_SPEED_LIMIT (1L) #define LOW_SPEED_TIME (5L) #define MAX_REDIRS (2L) #define MAX_WIDTH (160) #define HTTP_SUCCESS ...
#include <iostream> using namespace std; float pangkat(float x,int n){ float hasil; hasil=1; for(int i=1;i<=n;i++){ hasil=hasil*x; } return hasil; } int main(){ int x,n; cout<<"angka : "; cin>>x; cout<<"pangkat : "; cin>>n; cout<<"hasil : "<<pangkat(x,n); }
#include "impl/sprites/Wall.hpp" Wall::Wall(const Point& initPos) : Sprite("Wall", initPos) { } Wall::Wall() : Wall(Point()) { } bool Wall::consider([[maybe_unused]] const Point& newPosition) { return false; } Wall::~Wall() { }
#ifndef COMMON_INCLUDE_H #define COMMON_INCLUDE_H //ros #include <ros/ros.h> #include <ros/package.h> #include <image_transport/image_transport.h> #include <cv_bridge/cv_bridge.h> #include <sensor_msgs/image_encodings.h> //opencv #include <opencv2/opencv.hpp> #include <opencv2/aruco.hpp> #include <opencv2/core.hpp> #...
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) scan...
//#include <stdio.h> //#include <stdlib.h> //#define rdtsc __asm __emit 0fh __asm __emit 031h //#define cpuid __asm __emit 0fh __asm __emit 0a2h // // //unsigned compute_cpuid_overhead() { // unsigned cycles_high1 = 0, cycles_low1 = 0, cpuid_time = 0; // unsigned cycles_high2 = 0, cycles_low2 = 0; // // __asm // ...