text
stringlengths
8
6.88M
#include <iostream> #include <cmath> #define REP(i, a, n) for(int i = (a); i < (n); i++) using namespace std; struct point { double x, y; }; struct line { point p, q; }; bool intersect(line l1, line l2) { double ax = l1.p.x, ay = l1.p.y; double bx = l1.q.x, by = l1.q.y; double cx = l2.p.x, cy = l2.p.y; double...
// a = (-r)c + d = (-r)c + d - r + r = (-r)(c + 1) + (d + r) #include<stdio.h> #include<conio.h> void NegaBinary(int); void Binary(int); /*void toNegaBinary(unsigned int value) // input in standard binary { unsigned int Schroeppel2 = 0xAAAAAAAA; // = 2/3*((2*2)^16-1) = ...1010 printf("%d", (value + Schroeppel2) ^...
//this is my stack //感觉挺溜,直接手打出来,提前没看书.这个用得少,啥时候用再根据需要改吧 //大二寒假的复习 //原来的思路都清楚,没啥大变化 就是这次写了个STACK类 感觉代码比原来清楚多了 //第一次直接40分,然后改了改95,最后除了个小思维缺陷就100了. #include<iostream> #include<cstdio> using namespace std; class STACK{ public: STACK(int length);//构造函数,确定栈的长度 bool empty();//判断栈空 bool full();//判断栈满 bool pus...
#include "ClientHandler.h" #include "Logger.h" #include "Despatch.h" #include "GameCmd.h" #include "HallManager.h" using namespace std; ClientHandler::ClientHandler() { hallid = -1; callback_count = 0; for(int i=0; i<MAX_CALL_BACK; ++i) callback_seq[i] = 0; } ClientHandler::~ClientHandler() { //socket关闭,析构...
#include "glUtil.h" void CrossProduct(c_vec3 &result, c_vec3 a, c_vec3 b) { result[0] = a[1] * b[2] - b[1] * a[2]; result[1] = a[2] * b[0] - b[2] * a[0]; result[2] = a[0] * b[1] - b[0] * a[1]; } float InnerProduct(c_vec3 v, c_vec3 q) { return ((v)[0] * (q)[0] + (v)[1] * (q)[1] + (v)[2] * (q)[2]); } void Norma...
/* * @lc app=leetcode.cn id=142 lang=cpp * * [142] 环形链表 II */ // @lc code=start /** * Definition for singly-linked list. */ #include<iostream> #include<algorithm> using namespace std; // struct ListNode { // int val; // ListNode *next; // ListNode(int x) : val(x), next(NULL) {} // }; class Solution...
#pragma once #include "ofMain.h" #include "ofxVoro.h" #include "ofxTimeMeasurements.h" struct Point1 { float x, y; bool operator <( const Point1 &p ) const { return x < p.x || ( x == p.x && y < p.y ); } }; class VoronoiLayer { public: VoronoiLayer(); ~VoronoiLayer(); void addPoint( f...
// Copyright (c) 2012-2017 The Cryptonote developers // 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 "gtest/gtest.h" #include <future> #include <chrono> #in...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2005 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" #ifdef M2_SUPPORT #include "strutil.h" #include "adjunct/deskto...
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <ctime> #include <memory.h> #include <cmath> #include <string> #include <cstring> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #ifndef FAVORITES_COMPOSITE_LISTENER_H #define FAVORITES_COMPOSIT...
// // Created by manout on 18-3-27. // #include <string> #include <algorithm> #define SUM(A) ((A) * (A - 1) / 2) using namespace std; int adjust_team(string& team) { int boy = 0, girl = 0, boy_sum = 0, girl_sum = 0; for (int i = 0; i < team.length(); ++i) { if (team[i] == 'B') { ...
// // Created by FF on 2019-06-20. // #ifndef PUSHFLOW_AUDIOCHANNEL_H #define PUSHFLOW_AUDIOCHANNEL_H #include "faac.h" #include "librtmp/rtmp.h" class AudioChannel { typedef void (*AudioCallback)(RTMPPacket *packet); public: void setAudioInfo(int samplesInHZ, int channels); void encodeData(int8_t *da...
#include <iostream> #include <cmath> using std::cin; using std::endl; using std::cout; int gcd(const int a, const int b) { if (a == 0) return b; if (b == 0) return a; if (a == b) return a; if (a > b) return gcd(a-b, b); return gcd(a, b-a); } int primeFactors(int n) ...
#include<bits/stdc++.h> using namespace std; int main(){ int n; string s; cin>>n; for (int i = 0; i < n; i++) { cin>>s; if(s[s.length()-1] == 'o'){ cout<<"FILIPINO"<<endl; } else if (s[s.length()-1] == 'u') { cout<<"JA...
#ifndef CMPRO_RATE_CPP #define CMPRO_RATE_CPP #include "../include/cmpro/rate_method.h" int main(){ RateMethod rate_method; rate_method.loop_process(false); return 0; } #endif
#include <iostream> #include <stdio.h> using namespace std; int main() { int tipo, qtd; float conta; cin >> tipo >> qtd; switch (tipo){ case 1: conta = qtd * 4.00; break; case 2: conta = qtd * 4.50; break; case 3: conta = qtd * 5.00; break; case 4: conta = qtd * 2.00; break; case 5: conta = qtd * 1.50; break; } print...
#include <iostream> #include <vector> #include <cmath> #include "TFile.h" #include "TTree.h" #include "TVector3.h" #include "TRandom3.h" #include "TMath.h" #include "TH1.h" #include "TH2.h" #include "TH3.h" #include "TVectorT.h" #include "constants.h" #include "fiducials.h" #include "AccMap.h" using namespace std; ...
#pragma once #include "RandomObject.h" class RealImplementation { public: RealImplementation(const std::string& text, float value); void AddText(const std::string& string); void ClearText(); float operator*(float op); float operator-(float op); float operator+(float op); float operator/(float op); float opera...
#include <iostream> #include <fstream> using namespace std; struct StudentData { int fn; char name[100]; }; struct SubjectData { int code; char name[100]; char teacher[100]; }; struct GradeData { int studentFn, subjectCode; int d,m,y; double value; }; void createStudents () { ifstream i...
#include "kmint/ufo/saucer.hpp" #include "kmint/ufo/human.hpp" #include <string> #include <iostream> namespace kmint::ufo { namespace { char const *color_for(saucer_type type) { switch (type) { case saucer_type::blue: return "Blue"; case saucer_type::green: return "Green"; case saucer_type::beige: ...
#include "../idlib/precompiled.h" #pragma hdrstop #include "Game_local.h" #include "Effect.h" #include "client/ClientEffect.h" const idEventDef EV_LookAtTarget( "lookAtTarget", NULL ); const idEventDef EV_Attenuate( "attenuate", "f" ); CLASS_DECLARATION( idEntity, rvEffect ) EVENT( EV_Activate, rvEffect::Event_A...
/* * UDPTransportServer.cpp * * Created on: 5 Apr 2011 * Author: two */ #include "UDPTransportServer.h" bool byteMatch(char* a, char* b, int len) { /* * Will return if the binaries match, strcmp not safe, may not be nulled! */ int i; for(i = 0; i<len; i++) { if(a[i] != b[i]) return false; } r...
#include <iostream> #include <memory> #include <array> #if HAS_MATLAB #include "matrix.h" // mxArray, mxCreateLogicalArray #include "PticaGovorunInteropMatlab.h" #endif namespace MatlabTesterNS { #if HAS_MATLAB void testClassifyWithMatlabNeuralNet() { std::cout << "Init Matlab runtime" << std::endl; auto errHan...
// texture_tga.cpp #include "system/exception.h" #include "texture.h" #include <memory> using namespace std; namespace leap { namespace rendering { namespace detail { // https://en.wikipedia.org/wiki/Truevision_TGA struct TGAHeader { BYTE id_field_length; BYTE color_map_type; BYTE image_type; BYTE color_map...
// Example 7.3 : istream, ostream // Created by Oleksiy Grechnyev 2017 #include <iostream> #include <sstream> #include <iomanip> #include <string> //============================== // This is a simple ostream impementation of printf // This one uses a fixed-size static buffer and // does not support e.g. C++ strings ...
#include <simplecpp> int main(){ initCanvas("Trtest",0,0,800,800); Circle c(100,100, 30); c.imprint(); getClick(); for(int i=0; i<10; i++){ c.move(10,10); c.imprint(); wait(0.1); } c.setColor(COLOR("blue")); getClick(); for(int i=0; i<10; i++){ c.scale(1.1); c.imprint(); wait(...
/************************************************************************* > File Name: 11.8.1.cpp > Author: JY.ZH > Mail: xw2016@mail.ustc.edu.cn > Created Time: 2018年07月29日 星期日 20时58分25秒 ************************************************************************ Stonewt operator*(double x); Stonewt S...
#include <algorithm> #include <format> #include <memory> #include <vector> #include <iostream> #include <cstdint> #include <format> #include <thread> #include <filesystem> #include <cstdio> #include <regex> #define GLFW_INCLUDE_NONE #include <glad/glad.h> #include <GLFW/glfw3.h> import Image; import ...
#include "Ak_SceneManager.h" #include "cocos2d.h" #include <list> #include "Ak_Scene.h" namespace AK_SCENEMANAGER { std::list<Ak_CScene*> g_sceneList; void Init() { Ak_CScene* pScene = new Ak_CScene; pScene->Create(); g_sceneList.push_back(pScene); cocos2d::Director::getInstance()->runWithScene(pScene->...
#ifndef INDEXNAME_H #define INDEXNAME_H #include <QString> #include <QStringList> #include <QVector> #include <QMetaType> namespace RsaToolbox { class IndexName { public: IndexName(); IndexName(uint index, QString name); uint index() const; QString name() const; void setIndex(uint index); ...
#include "segment.hpp" #include <iostream> namespace geometry { Segment::Segment() { this->a = new Float(0.0); this->b = new Float(0.0); this->c = new Float(0.0); this->p1 = new Point(); this->p2 = new Point(); } Segment::Segment(Point* p1, Point* p2) { this->p1 = p1; this->p2 = p2; *t...
#ifndef __DECLPLAYBACK_H__ #define __DECLPLAYBACK_H__ // WARNING: These must stay mirrored in both Q4Monster.state #define PBFL_GET_POSITION BIT( 0 ) // Stored in playback file #define PBFL_GET_ANGLES BIT( 1 ) #define PBFL_GET_BUTTONS BIT( 2 ) #define PBFL_GET_VELOCITY BIT( 4 ) // Derived from data #define ...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> using namespace std; const int maxn = 1e4; int a[10100]; int main() { int n; while (scanf("%d...
#include <chuffed/core/propagator.h> class TableChecker : public Checker { vec<IntVar*> x; vec<vec<int> > t; TableChecker(vec<IntVar*>& _x, vec<vec<int> >& _t) { NOT_SUPPORTED; } bool check() override { NOT_SUPPORTED; } }; void table_GAC(vec<IntVar*>& x, vec<vec<int> >& t) { assert(x.size() >= 2); for (int i ...
/* Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agre...
#ifndef __JMM_STL_HEAP #define __JMM_STL_HEAP #include "jmm_stl_iterator.h" namespace JMM_STL { template<class RandomAccessIterator,class Distance, class T> void __push_heap(RandomAccessIterator first, Distance holeIndex, Distance topIndex, T value) { Distance parent = (holeIndex - 1) / 2; while (holeIndex>to...
#pragma once #include <cstdint> #include <GL/glew.h> #include <vector> class Shader { public: uint32_t m_program = 0; std::vector<GLuint> m_shaders; public: bool loadFromFile(GLenum type, const char* filename); bool link(); };
#include <stdio.h> #include <iostream> #include <math.h> #include <algorithm> #include <memory.h> #include <set> #include <map> #include <queue> #include <deque> #include <string> #include <string.h> #include <vector> typedef long long ll; typedef long double ld; typedef unsigned long long ull; const ld PI = acos(-1.)...
#include "List.h" #include <cstdlib> #include <iostream> #include "List.h" using namespace std; int main() { List Lilian; Lilian.AddNode(3); //making new nodes to make a list Lilian.AddNode(5); //making new nodes to make a list Lilian.AddNode(7); //making new nodes to make a list Lilian.AddNode...
// Copyright (c) 2007-2021 Hartmut Kaiser // Copyright (c) 2008-2009 Chirag Dekate, Anshul Tandon // Copyright (c) 2012-2013 Thomas Heller // // 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/...
/* Name: CircularContainers.ino Created: 12/15/2016 3:49:08 AM Author: jaejunlee */ #include "CircularQueue.h" #include "CircularStack.h" #include "CircularDeque.h" #include "CircularArray.h" #include "CircularBuffer.h" // the setup function runs once when you press reset or power the board void setup() { Serial.b...
#pragma once #include "INavController.h" #include "MoveIncludes.h" namespace Move { class NavController : public INavController { NavData data; int navId; HANDLE _hThread; public: NavController(int navId); ~NavController(); NavData getNavData(); private: static DWORD W...
/* * File: gtypes.h * -------------- * This file defines three classes (GPoint, GDimension, and GRectangle) * that are used in the graphics library to encapsulate basic geometrical * concepts. */ #ifndef _gtypes_h #define _gtypes_h #include <string> /* * Class: GPoint * ------------- * This class represents a point ...
// // Graph.cpp // PPBFS // // Created by Denis Sancov. // Copyright © 2016 University of Crete. All rights reserved. // #include "Graph.hpp" #include <fstream> #include <algorithm> #include <thread> #include <iostream> using namespace std; Graph::Graph() { _vertices = new vector<Vertex *>; } Graph::Graph(s...
#include "ofApp.h" // ------------------------------------------------------------------------------------------------------ // void ofApp::setup() { ofBackground( ofColor::white ); ofSetLogLevel(OF_LOG_VERBOSE); fontSmall.loadFont("Fonts/DIN.otf", 8 ); currAppMode = APP_MODE_LIVE; ofxGuiSetFont( "Fonts/D...
/* * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 ...
/* * 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) */ #include "cairomock.hh" #include "allocmock.hh" #ifdef _WIN32 #include "w32win-mock...
#include <bits/stdc++.h> using namespace std; int n,i=0,digitos[13],d; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin>>n; while(i<n){ cin>>d; digitos[d]++; i++; } i=0; while(i<10){ while(digitos[i]>0){ cout<<i<<" "; digitos[i]-...
// ========================================================================== // $Id: g_Part.h 3406 2012-10-31 16:23:40Z jlang $ // Wrapper code to interface g_plane // ========================================================================== // (C)opyright: // // Jochen Lang // SITE, University of Ottawa // 800...
#include "cpu_ptr.h" #include "kernel.h" #include "ICsquare.h" #include "util_cpu.h" #include "configurations.h" #include "cudaProfiler.h" #include "cuda_profiler_api.h" // Global variables, will be moved to h-file when ready // Grid parameters unsigned int nx = 2000; unsigned int ny = 2000; int border = 2; //Time p...
#include <iostream> #include <algorithm> using namespace std; int ver = 0; void backt(int *v, int i, int tot) { if (i==5) if(tot == 23) { ver=1; return; } else return; else { backt(v, i+1, tot+v[i]); backt(v, i+1, tot-v[i]); backt(v, i+1, tot*v[i]); } } int main() { int v[5],flag=0; while(ci...
#ifndef CORE_DEVICEIDENTIFICATION_H #define CORE_DEVICEIDENTIFICATION_H #include "AbstractPacket.h" #include "AbstractHandler.h" namespace DeviceIdentification { extern const char* identification; class Response : public AbstractPacket { public: Response(); }; class Handler : public A...
#pragma once #include <string> using namespace std; class Aresta { private: int origem; int destino; int peso; public: Aresta(int origem, int destino, int peso); const int getPeso() { return peso; }; const int getDestino() { return destino; }; const int getOrigem() { return origem; }; ...
#include "bluetanksweapon.h" BlueTanksWeapon::BlueTanksWeapon() { }
#ifndef MYOPENGLWIDGET_H #define MYOPENGLWIDGET_H #include <QOpenGLWidget> class MyOpenGLWidget : public QOpenGLWidget { public: MyOpenGLWidget(); ~MyOpenGLWidget(); // QWidget interface protected: virtual void paintEvent(QPaintEvent *); }; #endif // MYOPENGLWIDGET_H
//const char* host = "api.thingspeak.com"; //String url = "/update?api_key=H6YJBAB6J82QY153"; // Your Own Key here //const char* ssid = "KT_GiGA_2G_3ED2"; // Your own ssid here //const char* password = "fca1zg2399"; // Your own password here fca1zg2399 const char* host = "maker.ifttt.com"; String url = "/trigger/...
// Created on: 1998-03-12 // Created by: Pierre BARRAS // 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 ...
#pragma once #ifndef _IMAGESVM_H #define _IMAGESVM_H #include "common.h" #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/features2d.hpp" #include "svm.h" class ImageSVM { public: ImageSVM(const std::string& datasetName, bool performTraining); virtual ~ImageSVM(); virtual void Exec...
#ifndef DIALRECOGNITION_H #define DIALRECOGNITION_H #include <QDialog> #include <QGridLayout> #include <QGroupBox> #include <QPushButton> #include <QTableWidget> #include<QPaintEvent> #include<QLabel> #include <QHBoxLayout> #include <QVBoxLayout> #include <QLineEdit> #include "mylineedit.h" #include <QLin...
#ifndef INC_SPRITE_RENDERER_H #define INC_SPRITE_RENDERER_H //C++ headers #include<memory> #include<gl/glew.h> //Third party headers #include<glm/glm.hpp> #include<glm/gtc/matrix_transform.hpp> //shady_engine headers #include"shader.h" #include"texture2D.h" #include"smath/math.h" #include<vector> namespace s...
#pragma once #include "common.hpp" #include "tiny_ecs.hpp" #include "render_system.hpp" // These are ahrd coded to the dimensions of the entity texture const float DOLL_BB_WIDTH = 0.4f * 64.f; const float DOLL_BB_HEIGHT = 0.4f * 64.f; const float ENEMY_BB_WIDTH = 0.4f * 64.f; const float ENEMY_BB_HEIGHT = 0...
// // NetworkOperation.h // NOQ // // Created by Clawoo on 1/26/12. // Copyright (c) 2012 __MyCompanyName__. All rights reserved. // #ifndef NOQ_NetworkOperation_h #define NOQ_NetworkOperation_h #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <unistd.h> #include "curl.h" #include <assert.h> #...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- ** ** Copyright (C) 2009-2012 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #include "core/pch.h" #ifdef DO...
//-------------------------------------------------------- // musket/include/musket/widget/screen.hpp // // Copyright (C) 2018 LNSEAB // // released under the MIT License. // https://opensource.org/licenses/MIT //-------------------------------------------------------- #ifndef MUSKET_WIDGET_SCREEN_HPP_ #define MUSKET_...
#ifndef _SOCKETS_HPP #define _SOCKETS_HPP #include <arpa/inet.h> #include <fcntl.h> #include <netdb.h> #include <netinet/in.h> #include <stdexcept> #include <stdio.h> #include <stdlib.h> #include <string> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/wait.h> #include <sys/select.h> #...
#include "FastLED.h" #include "Indexers.h" #include "Canvas.h" //============================================================================ // GPIO Constants const uint8_t DOUT = 10; const uint8_t LFT_BUT = 5; const uint8_t MID_BUT = 6; const uint8_t RGT_BUT = 7; //==================================================...
/******************************************************************************* Copyright (c) 2010, Steve Lesser Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1) Redistributions of source code must retain the above c...
class Solution { public: vector<string> addOperators(string num, int target) { vector<string> res; dfs(num,target,0,0,"",res); return res; } void dfs(string num,int target,long long diff,long long curNum,string temp,vector<string> &res){ if(num.size() == 0 && curNum == target...
#include<bits/stdc++.h> using namespace std; int main(){ int t,n,p; cin>>t; for (int i = 0; i < t; i++) { cin>>n; vector<int>v; for (int j = 0; j < n; j++) { cin>>p; v.push_back(p); } for (int j = n-1; j >= 0; j--)...
#include<iostream> #include<cstdio> #include<string> #include<vector> using namespace std; int main(){ //input int n; cin>>n; vector<string> result; for(int i=0;i<n;++i){ string name; int breathing; int pulse; cin>>name>>breathing>>pulse; if(breathing<15||bre...
#include "illuminationsim.h" #include "profiler.h" #include "core.h" #include "glsl.h" #include "material.h" #include <limits> using namespace std; // helper function to create a floating point texture GLuint CreateGPUBuffer(size_t width, size_t height, GLuint format=GL_RGBA16F) { // create a new texture name GLui...
#include "Bispectrum.hpp" #include "wignerSymbols.h" #include "Integrator.hpp" #include <complex> #include <cmath> #include "Log.hpp" #include <fstream> #include "ODEs.hpp" #include "ODE_Solver.hpp" #include <ctime> #include <chrono> using namespace chrono; Bispectrum::Bispectrum(AnalysisInterface* analysis) { WP...
#include "CWebCategory.h" #include "CClientLog.h" CWebCategory::CWebCategory(QObject *parent) : CCategoryBase(parent) { } CWebCategory::~CWebCategory() { } QString CWebCategory::Category() const { return QString::fromLocal8Bit("网页"); } bool CWebCategory::IsAppInstall(const SoftData& data) { return true; } con...
#include "../headers/item.h" #include "../headers/player.h" #include "../headers/enemy.h" #include "../headers/Safe_Input.h" #include "../headers/skill.h" #include "../headers/FileFunctions.h" #include <stdio.h> #include <stdlib.h> #include <iostream> #include <string> //#include <cstdlib> using namespace std; void p...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #include "core/pch.h" #ifdef WIN_O...
#include <doctest.h> #include <Tanker/Serialization/Serialization.hpp> #include <Tanker/Trustchain/Actions/KeyPublish/ToProvisionalUser.hpp> #include <Tanker/Trustchain/Actions/ProvisionalIdentityClaim.hpp> #include <Tanker/Trustchain/Block.hpp> #include <Tanker/Trustchain/DeviceId.hpp> #include <Tanker/Trustchain/Gro...
class Solution { public: //Insert one char from stringstream void Insert(char ch) { cnt[ch]++; if(cnt[ch] == 1){ data.push(ch); } } //return the first appearence once char in current stringstream char FirstAppearingOnce() { while(data.empty() == false...
#pragma once #include "QsoItem.h" enum QsoMode; class Mode : public QsoItem { public: Mode(Qso *qso); Mode(const Mode& m); virtual ~Mode(); virtual void Copy(const Mode& source); virtual bool ProcessToken(const string& token, Qso* qso); QsoMode GetMode() const { return m_mo...
#include <iostream> #include <string> #include <sstream> #include "roster.h" using namespace std; const string studentData[] = { "A1,John,Smith,John1989@gm ail.com,20,30,35,40,SECURITY", "A2,Suzan,Erickson,Erickson_1990@gmailcom,19,50,30,40,NETWORK", "A3,Jack,Napoli,The_lawyer99yahoo.com,19,20,40,33,SOFTWARE", "A4,Er...
#pragma once class GameCursor; class RatePopup : public GameObject { public: bool Start() override; void Update() override; void OnDestroy() override; void setEnemyRating(float rate) { m_eneRating = rate; } void show(bool me, bool enemy) { m_isShowMyRate = me; m_isShowEnemyRate = enemy; } private: bool m_...
#include <LinearAllocator.h> #include <cassert> using namespace breakout; LinearAllocator::LinearAllocator(const size_t size) : Allocator(size) { m_memoryStart = static_cast<void*>(new uint8_t[size]); m_currentPosition = m_memoryStart; } LinearAllocator::~LinearAllocator() { Clear(); delete[] m_...
#ifndef WIDGET_COMMSTATS_H #define WIDGET_COMMSTATS_H #include "User.h" #include <CreateCommitmentQWidget.h> #include <QTreeWidget> #include <QWidget> #include <TimerWindowQWidget.h> namespace Ui { class CommStatsQWidget; } /** * @brief The CommStatsQWidget class */ class CommStatsQWidget : public QWidget { Q_OB...
/*****************************************************************************/ /*! \file: List.h \author Joe Centeno \par DP email: joe.centeno\@digipen.edu \par Course: CS170 \par Assignment: Assignment 5 \date: 7/2/2021 \brief Header File for List */ /**************...
# include <iostream> # include <algorithm>
#include "ProcessManager.hpp" void sig_handler(int sig) { g_singaled++; g_server->setStatus(HttpServer::STOPPING); if (g_ismaster) { if (g_singaled > 1) { std::cerr << "Force killing workers\n"; g_server->killWorkers(SIGKILL); } else { std::cerr << "\nWebserv is shutting down gently, resend the ...
#include<bits/stdc++.h> using namespace std; void dfs(vector<int> adj[], int s, int d, int res[101][101]) { res[s][d]=1; for(auto x: adj[d]) { if(!res[s][x]) dfs(adj, s, x, res); } } int main() { // only gravity will pull me down // Transitive closure of a Graph int...
#include <stdio.h> void merge_array(int arr[], int first, int mid, int last) { int len = last - first + 1; int temp[len]; int i = first; int j = mid + 1; int k = 0; while(i <= mid && j <= last) { if(arr[i] <= arr[j]) { temp[k++] = arr[i++]; } else ...
// // GnFileUtil.h // Core // // Created by Max Yoon on 11. 8. 11.. // Copyright 2011년 __MyCompanyName__. All rights reserved. // #ifndef __Core__GnFileUtil__ #define __Core__GnFileUtil__ class GnFileUtil { public: static bool FileCopy(const char* pcSrcPath, const char* pcDestPath); static bool E...
#include "MemoryMapper.h" #include "CartridgeReader.h" #include "MemoryBus.h" #include "PictureProcessingUnit.h" #include "CentralProcessingUnit.h" #define MM__NO_MAPPER_SELECTED (0xFFFFu) #define MM__NAME_TABLE_HORIZONTAL (0x00u) #define MM__NAME_TABLE_VERTICAL (0x01u) #define MM__NAME_TABLE_ONE_SCREEN_HIGHER (0x08...
#include "mainwindow.h" #include "ui_mainwindow.h" #include "tetrisconstants.h" #include "tetrismodel.h" #include <QKeyEvent> #include <iostream> namespace { void setQWidgetColor(QWidget& widget, const QColor& newColor) { if (newColor != widget.palette().color(widget.backgroundRole())) { QPalette pale...
#include "ofApp.h" //----------------------------------------------------------------------------------------- // void ofApp::setup() { //ofSetLogLevel( OF_LOG_VERBOSE ); ofSetFrameRate( 60 ); fontSmall.loadFont("Fonts/DIN.otf", 8 ); ofxGuiSetFont( "Fonts/DIN.otf", 8 ); ofxGuiSetDefaultWidth( 300 ); stri...
#include <iostream> #include <vector> #include <algorithm> using namespace std; vector<int> h; int solve(int left, int right) { if ( left==right ) return h[left]; int m=(left+right)/2; int ret = max(solve(left, m), solve(m+1,right)); int lo=m, hi=m+1; int height=min(h[lo], h[hi]); ret=max(r...
#include<iostream> #include<cstdio> #include<malloc.h> using namespace std; struct Road{ int from; int to; int price; }; int main(){ //输入 int n,m; fscanf(stdin,"%d %d",&n,&m); Road*road=(Road*)malloc(1000100*sizeof(Road)); for(int i=0;i<m;i++){ fscanf(stdin,"%d %d %d",&(road[i].from),&(road[i].to),&(road[i]...
// transform.h #pragma once #include "mat4.h" #include "math.h" #include "system/system.h" #include "vec3.h" namespace leap { namespace math { LEAP_INLINE mat4 translate(float x, float y, float z) { return mat4( // Col 1 1, // 0 0, // 1 0, // 2 0, // 3 0, // 4 1, // 5 ...
/* This is the contributed code: Firewire and video4linux camera support for videoio 2003-03-12 Magnus Lundin lundin@mlu.mine.nu THIS EXEPERIMENTAL CODE Tested on 2.4.19 with 1394, video1394, v4l, dc1394 and raw1394 support This set of files adds support for firevre and usb cameras. First it tries to install a fire...
//=========================================================================== //! @file light_manager.cpp //! @brife ライトの管理 //=========================================================================== //--------------------------------------------------------------------------- //! 初期化 //----------------------------...
#include "TestObservable.h" TestObservable::TestObservable(CObserver* observer, const int data) : CObservable(), myData(data) { AddObserver(observer); } void TestObservable::UpdateData(const int newData) { myData = newData; NotifyObservers(this); }
#ifndef SYMBOL_TABLE_H #define SYMBOL_TABLE_H #include <iostream> #include <string> #include <vector> #include <map> #include <set> #include <utility> #include <algorithm> struct NamedId { int id; std::string name; std::string repr() const { std::string s("NamedId("); s+= std::to_string(id); s+= ",...
#include <stdio.h> #include <iostream> #include <stdio.h> #include <vector> #include <string> #include <fstream> int main() { const char *kernel_code; std::string inputFilename = "kernel_inter.ocl"; std::ifstream inputFile(inputFilename); std::string result=""; if(inputFile) { std::string line; while(std::...