text
stringlengths
8
6.88M
/***************************************************************** * Copyright (C) 2017-2018 Robert Valler - All rights reserved. * * This file is part of the project: DevPlatformAppCMake. * * This project can not be copied and/or distributed * without the express permission of the copyright holder *************...
#include <iostream> #include "stack.h" using namespace std; int main() { cout << "=========Inside Tester========" << endl; Stack s; s.dump(); cout << endl; s.push(10); s.push(20); s.dump(); cout << endl; cout << "pop returns: " << s.pop(); cout << endl; s.dump(); s.push(30); s.push(40); s.push(5...
/* * fonc.h * * Created on: 2 mars 2014 * Author: droper */ #ifndef FONC_H_ #define FONC_H_ #include <vector> #include <memory> #include "node.h" class fonc: public node { public: fonc(); ~fonc(); virtual void display(std::ostream&, int)=0; virtual double getValue() = 0; void addChild(std::shared_p...
/* leetcode 296 * * * */ class Solution { public: int minTotalDistance(vector<vector<int>>& grid) { vector<vector<int>> people; vector<int> row, col; for (int i = 0; i < grid.size(); i++) { for (int j = 0; j < grid.at(0).size(); j++) { if (grid.at(i).at(j) == ...
#include <bits/stdc++.h> using namespace std; void recursion(int N, int from, int to, int ex, int &cnt, int n) { // same as Tower of Hanoi if (N == 1) { cnt++; if(cnt == n) cout << from << " " << to << endl; return; } recursion(N-1, from, ex, to, cnt, n); cnt++; ...
// // Created by pierreantoine on 09/01/2020. // #pragma once #include "src/symbol_manager.hpp" #include "src/symbol_catalog.h" #include "src/lexer_interface.h" class reference_lexer : public lexer_interface { symbol::symbol_manager<symbol::symbol_catalog> manager; std::string current_file; std::size_...
#include "MainController.hpp" MainController::MainController(Model *m, View *view) : Controller(m, view) { connect(m, SIGNAL(err(QString)), this, SLOT(modelError(QString))); connect(this, SIGNAL(viewTableUpdate(QList<QString>)), linkedView, SLOT(updateTable(QList<QString>))); connect(linkedView, SIGNAL(toolB...
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*- * * Copyright (C) 1995-2005 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 XPATH_SUPPORT #include "modules/xpath/src/...
#pragma once #include <Tanker/Crypto/EncryptionKeyPair.hpp> #include <optional> #include <tconcurrent/coroutine.hpp> namespace Tanker { namespace DataStore { class ADatabase; } class UserKeyStore { public: UserKeyStore(UserKeyStore const&) = delete; UserKeyStore(UserKeyStore&&) = delete; UserKeyStore& operato...
#include "mainhello.h" #include <QApplication> #include <QLabel> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainHello w; w.show(); QLabel l ( "Hello World" ); l.show(); return a.exec(); }
//Carl Borillo, Tony Tran, Steven Yacoub //Class (CECS 282-01 Lab:282-03) //Project Name: (Prog 2 - Object and Class) //Due Date: 2/3/2021 //Demo Time: 6:11 PM #ifndef Account_h #define Account_h #include <iostream> using namespace std; class Account{ public: Account(); Account(double initBal); void deposit(d...
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/MainView.g.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Fuse.App.h> #include <Fuse.IProperties.h> #include <Uno.Float4.h> namespace g{namespace Fuse{namespace Controls{struct DockPanel;}}} namespa...
#include<cstdio> typedef long long ll; const int maxn = 1e5+5; ll a[maxn]; int num[maxn],n; #define lowbit(i) i&(-i) void update(int inx,int v){ for(int i=inx;i<=n;i+=lowbit(i))a[i]+=v; } ll getsum(int inx){ ll ans = 0; for(int i=inx;i>0;i-=lowbit(i))ans+=a[i]; return ans; } int main(){ int m,d,l,...
#include "StdAfx.h" #include "SideDialog.h" #include "MainFrm.h" #define DIALOG_POSITION _T("Side dialog's position") #define DIALOG_SHOW _T("Show/hide side dialog bar") SideDialog::SideDialog(void) { //Load setting position = DIALOG_LEFT; shown = false; parent = NULL; } SideDialog::~SideDialog(void) { // ...
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <tuple> #include <utility> #include <vector> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0); int m, n; std::cin >> m >> n; std::vector<std::vector<int>> map(n, std::vect...
/***************************************************************** * Project: Project 4 * File: Project4.cpp * Author: Martin Plut * Date: December 12th, 2017 * Description: File for testing OrderedSet and WordData Class */ #include <iostream> #include <fstream> #include "OrderedSet.hpp" #include "WordData.h" #i...
#pragma once #include "CUrlParsingException.h" #include <string> #include <regex> enum class Protocol { HTTP, HTTPS }; const std::string urlRegexRule = "^((https?)://)?([0-9a-zA-Zа.-]*)(:[0-9]+)?(/[a-zA-Zа.-?&]*)*/?$"; const std::string domainRegexRule = "(.+).([a-z]+)"; const int MIN_PORT = 1; const int MAX_PORT ...
#include "Skybox.h" Skybox::Skybox(Camera* cameraN,float height1,char* texname) { height = height1; camera = cameraN; //isStatic = true; fragmentName = "fragment-shader[none].txt"; //position = glm::translate(glm::mat4(),glm::vec3(0,5*METER,0)); positionXYZ = glm::vec3(0.0f,-2.0*METER,0.0f); float height = M...
#include "SvrConfig.h" #include <string> #include <vector> #include "tinyxml.h" #include "Logger.h" #include "Configure.h" using namespace std; static SvrConfig* instance = NULL; std::string GetAttribute(TiXmlElement * element,std::string name,std::string defaultValue) { const char * attribute = element->Attri...
// // Created by fab on 23/02/2020. // #ifndef DUMBERENGINE_SHADER_HPP #define DUMBERENGINE_SHADER_HPP #include <string> #include <glad/glad.h> #include <list> #include <vector> #include "glm/glm.hpp" class Shader { public: Shader(const char *path); void reload(); void use(); void setInt(const std...
// Created on: 1992-12-09 // Created by: Christian CAILLET // 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 "waitForEncoderGenerator.h" using namespace qReal; using namespace robots::generator; void WaitForEncoderGenerator::generateBodyWithoutNextElementCall() { QString const port = mNxtGen->mApi->stringProperty(mElementId, "Port"); QString const tachoLimit = mNxtGen->mApi->stringProperty(mElementId, "TachoLimit...
#include <iostream> #include <sstream> #include <string> #include <algorithm> #include <vector> #include <set> using namespace std; bool checkPassport(const string& s){ set<string> fields({"byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid"});//, "cid"}); set<string> inFields; stringstream ss(s); string k...
#include <iostream> #include<vector> #include<string> #include <map> using namespace std; bool IsEExists(vector<string>_e, string e){ if(_e.size()==0){ cout<<"Event named, "<<e<<" doesn't exist. Creating new one."<<endl; return false; }else{ for(unsigned int i=0; i<_e.size(); i++){ ...
#include "Renderer.h" #include "../Display/Viewport.h" #include "../Core/Engine.h" #include "../Scene/SceneManager.h" #include "../Scene/Scene.h" #include "../Geometry/Mesh.h" #include "../Materials/Material.h" #include "../Shaders/Shader.h" #include "../Cameras/Camera.h" #include "../ECS/Components/MeshComponent.h" #...
//--------------------------------------------------------------------------- #pragma hdrstop #include "SourceLoader.h" #include "SPCommon.h" //--------------------------------------------------------------------------- #pragma package(smart_init) SourceLoader::SourceLoader() { m_ClassManager = NULL; m_CurParseC...
/* -*- 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. */ #ifndef OP_SCOPE_DISPLAY_LISTENER_H #define OP_SCOPE_DISPLAY_LIST...
#include "precompiled.h" #include "interface/fps.h" #include "interface/interface.h" #include "render/render.h" #include "render/font.h" #include "timer/timer.h" using namespace ui; FPS::FPS() { d3dfont = NULL; frames = 0; last_ms = timer::time_ms; fps = 0; draw = 1; } FPS::~FPS() { if (d3dfont) delete d3dfo...
#include "Image.h" #include <memory> #include <Sys/AssetFile.h> #include "Renderer.h" Gui::Image::Image(const Ren::Texture2DRef &tex, const Vec2f uvs[2], const Vec2f &pos, const Vec2f &size, const BaseElement *parent) : BaseElement(pos, size, parent), tex_(tex) { uvs_[0] = uvs[0...
//#include <iostream> //#include <fstream> //#include <trevi.h> //#include "gf256.h" //#include "udpreceiver.h" //#include "udptransmitter.h" //#include <unistd.h> //#include <cstring> //using namespace std; //#ifdef USE_PROFILING //#include <dollar.hpp> //#endif //#define DEBUG_ORDER //#define TEST_VARIABLE_LE...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- ** ** Copyright (C) 2009-2010 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef DOM_WW_INFO_H #define DOM...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2011 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef UNIX_IPC_H #define UNIX_IPC_H #include "modules/otl/list....
#include <Dot++/lexer/states/StringLiteralEscapeState.hpp> #include <Dot++/lexer/Token.hpp> #include <Dot++/lexer/TokenizerState.hpp> #include "./ProduceToken.hpp" namespace dot_pp { namespace lexer { namespace states { TokenizerState StringLiteralEscapeState::consume(const char c, FileInfo&, Token& token, ...
#include <cstdio> #include <set> using namespace std; #include "ast.h" #include "types.h" #include "parse.h" #include "symtable.h" #include "emit.h" void ASTree::check(bool test, string msg = "") { if (!test) { if (msg != "") { cerr << msg << endl; } else { cerr << this->token << " ::="; ...
// Author: Miles Meacham // Course: CS-1410-X01-deBry-Fall 2015 // Instructor: Professor deBry // File: lab06.cpp // Date: 9/30/2015 // Contents: lab06 - Pointers // I delcare that the following source code was written solely by me, or provided by the instructor. // I understand that copying any source code, in whole...
#include <iostream> #include <cstdlib> #include <vector> #include <pybind11/pybind11.h> #include <pybind11/numpy.h> #include "fastjet/ClusterSequence.hh" #include <algorithm> #include <pybind11/stl.h> using namespace fastjet; namespace py = pybind11; using namespace std; void interface(){ vector<PseudoJet> particle...
// Created by: DAUTRY Philippe // Copyright (c) 1997-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 Li...
// Created on: 1997-02-12 // Created by: Alexander BRIVIN // Copyright (c) 1997-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 G...
#include "./lda/lda.h" #include "./lda/document.h" #include "./lda/file_access.h" #include <jni.h> #include <android/log.h> #include <fstream> using namespace std; void lda_main(JNIEnv *env, jobject pObj,jint lda_k,jint doc_num,jintArray category) { int topic_num = lda_k; int sample_num = 50; // how many ...
#include <assert.h> #include <math.h> #include <algorithm> #include <climits> #include <functional> #include <iostream> #include <numeric> #include <queue> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #define ll long long using namespace std; int n, m, rices, k; vector<string...
#ifndef CMPRO_COORDINATECONVERT_H #define CMPRO_COORDINATECONVERT_H //(u,v)->(x,y) //u,v:int , x,y:double #include "common_include.h" #include <cmath> class CoordinateConvert { public: CoordinateConvert(); std::vector<double> multi_convert(std::vector<int> uvdata); private: bool is_determined; //The ...
#ifndef WEBSERVER_DIGEST_AUTH_H_ #define WEBSERVER_DIGEST_AUTH_H_ #ifdef WEB_HTTP_DIGEST_SUPPORT /* Work in progress. Do not use */ class WebserverServerNonceElement { public: WebserverServerNonceElement(); ~WebserverServerNonceElement(); /* construct a nonce * return The constructed nonce */ OP_STATUS Co...
#include "BusinessSaving.h" using namespace std; BusinessSaving::BusinessSaving() { } //Create a business saving account with parameters id, balance, date and customer and pass them to Account class BusinessSaving::BusinessSaving(string a_id, double a_bal, string a_date, Customer &a_cus):Account(a_id, a...
/* * NetWorkConfig.h * * Created on: Jun 11, 2017 * Author: root */ #ifndef NETWORK_NETWORKCONFIG_H_ #define NETWORK_NETWORKCONFIG_H_ #include <string> #include "../define.h" #include "InetAddress.h" #include "../Smart_Ptr.h" #include "../util.h" #include "../Memory/MemAllocator.h" using namespace std; n...
/** * Copyright (c) 2022, Timothy Stack * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of condi...
#include "Stone.h" #include "omp.h" Stone::Stone( ) { setFuzzy( 10.0f ); setRadius( 40.0f ); setSize( 60 ); transparency = 255; borderTransparency = 255; saturation = 255; borderSize = 30; currentGrowRad = 10; maxGrowRad = 250; } Stone::~Stone() { } void Stone::init( float _x, floa...
#include <iostream> #include <string> using namespace std; /** * Temperature class. */ class Temperature { private: /** * Temperature value in Celsius. */ double value; /** * Returns true if this Temperature is NULL; */ bool null; public: /** * Empty constructor....
#include "EnginePCH.h" #include "Recourse.h" namespace samc { ResourceDefinition::ResourceDefinition(ResourceType type, std::string name, std::string path) : m_type(type) , m_name(std::move(name)) , m_path(std::move(path)) { } std::shared_ptr<samc::Resource> ResourceDefinition::getResource() { //if the resource ...
#include "logger.h" #include <memory> #include <stdexcept> #include <chrono> #include <ctime> #include <iomanip> namespace mysql_proxy { std::unique_ptr<logger> logger_instance; void logger::initialize(const std::string &path /*= "log.log"*/) { logger_instance.reset(new logger(path)); } logger &logger::instance...
/* =========================================================================== Copyright (C) 2017 waYne (CAM) =========================================================================== */ #pragma once #ifndef ELYSIUM_DATA_CACHING_USERDATACACHE #define ELYSIUM_DATA_CACHING_USERDATACACHE #ifndef ELYSIUM_...
/* * elem.h * * Created on: Nov 23, 2012 * Author: chjd */ #ifndef ELEM_H_ #define ELEM_H_ // interface class, base virtual class class Elem { public: Elem()=default; Elem(DeviceType tp):type(tp){} DeviceType Type() const { return type;} void Type(DeviceType tp) { type = tp;} // may be this is not ne...
#ifndef FRMMAIN_H #define FRMMAIN_H #include <QMainWindow> #include <QGraphicsScene> #include <QVector> #include <QPair> #include "../geometry/geometry.h" namespace Ui { class frmMain; } class frmMain : public QMainWindow { Q_OBJECT public: explicit frmMain(QWidget *parent = 0); ~frmMain(); void cle...
#include "pch.h" #include "core.h" using namespace System; void MatrixOut(array<int>^ matrix) { Console::Write("\n"); for each (int element in matrix) Console::Write("{0} ", element); Console::Write("\n\n"); }
#include <iostream> #include <sstream> #include <vector> #include <list> #include <queue> #include <algorithm> #include <iomanip> #include <map> #include <unordered_map> #include <unordered_set> #include <string> #include <set> #include <stack> #include <cstdio> #include <cstring> #include <climits> #include <cstdlib> ...
#include <iostream> #include <iomanip> #include "rbtree.hxx" #include "tree_traversing.hxx" template <class Tree> static void dump_to_dot(Tree const &tree, std::ostream &out) { out << "digraph {\n"; tree.traverse([&out](typename Tree::Node const *n) { std::string const color = n->color() == Tree::Node::Color...
#include "platforms/utilix/OpGtk.h" #include <dlfcn.h> #include <errno.h> #include <stdio.h> #include <string.h> #include <unistd.h> namespace OpGtk { void * g_gtk_handle = 0; void * g_gdk_handle = 0; void * g_glib_handle = 0; void * g_gobject_handle = 0; // glib DEFINE_SYMBOL(guint, g_idle_add, ...
// $Id$ // // Copyright (C) 2002-2013 Greg Landrum and Rational Discovery LLC // // @@ All Rights Reserved @@ // This file is part of the RDKit. // The contents are covered by the terms of the BSD license // which is included in the file license.txt, found at the root // of the RDKit source tree. // #include ...
// cppag::CLArguments // // a class for dealing with command line arguments passed to the program // // Last modified 2009-02-17 by Willi #ifndef CLARGUMENTS_H_INCLUDED #define CLARGUMENTS_H_INCLUDED #include <string> #include <vector> #include "GxSingleton.h" ///Stuff from the "C++ AG" at school namespace cppag {...
//------------------------------------------------------------------------------ /* This file is part of Beast: https://github.com/vinniefalco/Beast Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com> Portions of this file are from JUCE. Copyright (c) 2013 - Raw Material Software Ltd. Please visi...
#ifndef BOARD_H #define BOARD_H #include <QFrame> #include "Stone.h" #include "Step.h" #include <QVector> class Board : public QFrame { Q_OBJECT public: explicit Board(QWidget *parent = 0); ~Board(); /* game data */ Stone _s[32];// int _r; //棋子半径 QPoint _off; //車与窗口角落的偏移 bool ...
// // Created by chris on 22/08/2017. // #include "Air.h" Air::Air(): Block(false, false) { } std::vector<PixelData> Air::loadTextures() const { return {}; } void Air::mine(glm::ivec3 position) const { // Can't mine air } std::tuple<std::vector<Vertex>, std::vector<GLuint>> Air::appendFaces(const Block **...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2006 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 "modules/util/OpHashTable.h" #incl...
#pragma once #include <httpd.h> #include "visibility.h" #include <pv/Config.hh> namespace pv { int handler(const Config *cnf, request_rec *r) noexcept DSO_LOCAL; }
#include "precompiled.h" #include "scene/scene.h" #include "scene/scenebsp.h" #include "settings/settings.h" #include "entity/entitymanager.h" #include "physics/physics.h" #include "sound/sound.h" #include "q3shader/q3shadercache.h" namespace scene { shared_ptr<Scene> g_scene; // global scene object } using namespa...
#include <cmath> #include<iostream> using namespace std; int maxProfit(int price[], int n) { int profit = 0; for(int i = 1; i < n; i++) { if(price[i] > price[i - 1]) profit += price[i] - price[i -1]; } return profit; } int main() { int n; cout<<"Enter the elemnets in arra...
#include <iostream> #include "tree.h" #include <stdlib.h> #include <fstream> #include <sstream> using namespace std; int main(int argc, char* argv[]) { tree t; string STRING; ifstream infile(argv[1]); //int rankings; //string title; int v; node* n; //int year; //int quantity; w...
// Created on: 1992-11-17 // Created by: Christian CAILLET // 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 ...
// // Created by OLD MAN on 2020/1/24. // //如果 x=2^y,我们称 x 为的 2 的 y 次幂( y 是非负整数)。所以这里 2 的幂为:1,2,4,8,⋯ // //给你两个整数 n 和 k。你的任务是:判断 n 是否可以用 k 个 2 的幂来表示。 //输入格式 // 输入两个整数 n 和 k。 // //输出格式 // 如果可以表示输出"YES",否则输出"NO"。 // //数据范围 //1≤n≤10^9,1≤k≤2×10^5。
#ifndef __SEGLUTFLOWCONTROLLER_H__ #define __SEGLUTFLOWCONTROLLER_H__ #include <GL/freeglut.h> #include "SEFlowController.h" #include "SimpleEngine.h" class SEGLUTFlowController : public SEFlowController { public: SEGLUTFlowController(); ~SEGLUTFlowController() {} virtual void mainLoop(); virtual...
// Lab 1 Q3.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <fstream> using namespace std; void swap(int& x, int& y){ int z=0; z=x; x=y; y=z; } int _tmain(int argc, _TCHAR* argv[]) { ofstream fout("D:\\l180929\\Lab 1 Q3\\results_l18...
#ifndef _PushSendCardProc_H_ #define _PushSendCardProc_H_ #include "BaseProcess.h" class PushSendCardProc :public BaseProcess { public: PushSendCardProc(); virtual ~PushSendCardProc(); virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket,Context* pt) ; virtual int doResponse(CDLSo...
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <cstdint> namespace document { class GlobalId; } namespace search { /* * Interface class for mapping from gid to lid. Instances should be short * lived due to implementatio...
#include <iostream> using namespace std; // n any // returns n choose 2 unsigned long long n_choose_2(int n) { if (n < 2) return 0L; if (n == 2) return 1L; unsigned long long long_n = n; return long_n * (long_n-1L) / 2L; } // n >= 2 // returns n choose 2 - (n-1) choose 2 unsigned long long n_diff(int n) { retur...
#pragma once #include <iosfwd> template <typename T> class Matrix3 { private: Vector3<T> el[3]; public: inline Matrix3( const T& xx, const T& xy, const T& xz, const T& yx, const T& yy, const T& yz, const T& zx, const T& zy, const T& zz){ this->setValues(xx, xy, xz, yx, yy, yz, zx, zy, zz); }...
#ifndef MAPBOX_UTIL_VARIANT_HPP #define MAPBOX_UTIL_VARIANT_HPP #include <cassert> #include <cstddef> // size_t #include <new> // operator new #include <stdexcept> // runtime_error #include <string> #include <tuple> #include <type_traits> #include <typeinfo> #include <utility> #include <functional> #include <l...
#include <iostream> #define _USE_MATH_DEFINES #include <cmath> using namespace std; int main(){ cout << "Hello World\n"; cout << M_PI << "\n"; return 0; }
// Copyright (c) Improbable Worlds Ltd, All Rights Reserved #pragma once #include "CoreMinimal.h" #include "Components/ActorComponent.h" #include "GenericTeamAgentInterface.h" #include "TeamDeathmatchSpawnerComponent.generated.h" DECLARE_LOG_CATEGORY_EXTERN(LogTeamDeathmatchSpawnerComponent, Log, All) UCLASS( Class...
#include "stdafx.h" #include "surfcluster.h" #include "hitrecord.h" #include "float.h" #include "sphere.h" //surfcluster::surfcluster(const surfcluster & other) //{ // std::cout << "\nSurfcluster MOVE constructor called!\n"; //} // //surfcluster::surfcluster(surfcluster && other) noexcept : // subsurfs(std::move(oth...
/* Author: Inan Evin www.inanevin.com MIT License Lina Engine, Copyright (c) 2018 Inan Evin 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 limitation the ...
// // OBJObject.cpp // loadModels // // Created by Wahid Chowdhury on 5/16/13. // Copyright (c) 2013 Wahid Chowdhury. All rights reserved. // #include "OBJObject.h" //Make sure to call initializeOpenGLBuffers before making a call to draw!! OBJObject::OBJObject(const char *objFileName, const OBJObjectShaderHandl...
//Contraction Hierarchies algorithm #include<bits/stdc++.h> using namespace std; #define MAX 500005 typedef pair<long long int,long long int> pa; #define pb push_back long long int INF=1e18; vector<pa>adj[MAX]; // Graph vector<pa>adjr[MAX]; // Reversed Graph bool contracted[MAX]; //tells if the node is con...
#include <bits/stdc++.h> #define left(x) x<<1 #define right(x) x<<1|1 #define MAX 100000 int tree[4*MAX]={}, lazy[4*MAX]={}, A[MAX], n, m; void updateRange(int pai, int L, int R, int UL, int UR, int diff); int querySum(int pai, int L, int R, int QL, int QR); void build(int pai, int L, int R); int main() { int q, re...
#include <bits/stdc++.h> using namespace std ; const int N = 1e5 + 5 ; const int k = 16 ; int par[N][k + 1] , dep[N]; vector < vector < int > > g ; void dfs(int s, int p = 0){ par[s][0] = p ; dep[s] = 1 + dep[p] ; for(int i = 1 ; i <= k ; ++i){ par[s][i] = par[par[s][i - 1]][i - 1] ; } for(int i ...
#include <cstdio> #include <vector> #include <algorithm> #include <iostream> using namespace std; const int N = 77777; vector< pair<int, int> > g[N]; int pi[N+N], po[N+N], timer = 0; int p[N][18], d[N]; void dfs(int x, int pr = 0) { p[x][0] = pr; for (int j = 1; j < 18; ++j) p[x][j] = p[p[x][j - 1]]...
#include "MainWindow.h" #include <QFileDialog> #include "TrainingDataGenerationDialog.h" #include "VisualizePredictedDataDialog.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); ui.actionRenderingLine->setChecked(true); QActionGroup* groupRenderingMode = new QActionGroup(this); ...
#ifndef MY_CALLBACK_TYPE #define MY_CALLBACK_TYPE #include "DFITCL2Api.h" #include <iostream> #include <string> #include <stdio.h> #include <time.h> using namespace DFITC_L2; class my_callback_t : public DFITC_L2::DFITCL2Spi{ public: my_callback_t() { } ~my_callback_t() { } const std::string currentDateT...
class Solution { public: vector<int> intersection(vector<int>& nums1, vector<int>& nums2) { set<int> s(nums1.begin(),nums1.end()); vector<int> res; for(int i=0; i<nums2.size() ; ++i){ if(s.count(nums2[i])){ s.erase(nums2[i]); res.push_back(nums2[i]...
#include<iostream> using namespace std; main(){ int n,i; float d,s=0; cin>>n; for(i=1;i<=n;i++){ s=s+i; } cout<<s<<endl; i--; d=s/i; cout<<d; }
// // Created by manout on 17-3-28. // #include "common_use.h" /* * Given n non-negative integers representing ab elevation map where width of each bar is 1, * compute how much water it is able to trap after raining. * 分析: * 第一种方法,对每个柱子,找到它左边和右边的最高的柱子,所以这个柱子所能存储的水为 max(left, right) - height * 然后...
#include "GamePch.h" #include "AI_TurnTo.h" #include "Laser.h" #include "Common.h" void AI_TurnTo::LoadFromXML( tinyxml2::XMLElement* data ) { m_Acceleration = 0.0f; data->QueryFloatAttribute( "acceleration", &m_Acceleration ); m_InitialVelocity = 3.0f; data->QueryFloatAttribute( "velocity", &m_InitialVelocity ...
//// //// Created by heze on 18-1-6. //// // //#include "header/ShellSort.h" //#include "header/randPerm.h" //#include "header/QuickSort.h" //#include "header/HeadSort.h" //#include <sys/timeb.h> // //using namespace std; // //int main20180107() { // int arr[50], distance[3] = {6, 3, 1}; // struct timeb startTime...
#ifndef SUDOKUDATA_H #define SUDOKUDATA_H #include <QObject> #include <QVector> #include <QSet> enum class GridState { Originally_Valued, Solved, Guess, Conflict }; class SudokuData : public QObject { Q_OBJECT public: explicit SudokuData(QObject *parent = nullptr); void initializeDatem(c...
/* Implementation and tests for post order iterator class.*/ #include "cc/exercises/node.h" #include "cc/shared/common.h" #include "cc/shared/rand_utils.h" #include <vector> #include <stack> using cc_exercises::Node; using std::vector; using std::stack; typedef void (*visit_func)(Node* root, vector<int>* accumulator...
#pragma once #include <Tanker/Crypto/EncryptedSymmetricKey.hpp> #include <Tanker/Serialization/SerializedSource.hpp> #include <Tanker/Serialization/Varint.hpp> #include <Tanker/Trustchain/Actions/Nature.hpp> #include <Tanker/Trustchain/DeviceId.hpp> #include <Tanker/Trustchain/ResourceId.hpp> #include <nlohmann/json_...
/* Token object definition 2013, Tivins <https://github.com/tivins> */ #include "token.h" namespace v { int Token::counter = 0 ; Token::Token(int nline, int column, int _type, const char * _data) { this->id = counter++; if (data != NULL) this->data = _data; this->line = nline; this->col = colu...
#include <bits/stdc++.h> using namespace std; int a[999]; int main(){ string s; cin >> s; for(char c: s) a[(int)c]++; for(int i='a'; i<='z'; i++){ if(a[i] == 0){ cout << (char)i << endl; return 0; } } cout << "None" << endl; return 0;...
#pragma once #include "ARPG.h" #include "Blueprint/UserWidget.h" #include "Enum/SlotType.h" #include "Widget/BaseSlot/SlotDragDropOperation/SlotDragDropOperation.h" #include "BaseSlot.generated.h" DECLARE_MULTICAST_DELEGATE_OneParam(FSlotMouseEventSignature, ESlotType) DECLARE_MULTICAST_DELEGATE_OneParam(FSlotDragE...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) Opera Software ASA 2001-2004 * * Contains high-precision non-radix-10 number-to-string conversion */ #include "core/pch.h" #include "modules/ecmascript/carakan/src/es_pch.h" JString* ecma_...
#ifndef RELATION_OPS_BUDDY_HPP #define RELATION_OPS_BUDDY_HPP #include <algorithm> #include <iterator> #include <cassert> #include <utility> #include <map> #include <set> #ifndef NDEBUG #include <boost/type_traits/is_same.hpp> #include <boost/static_assert.hpp> #endif #include <boost/shared_ptr.hpp> ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2010 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef SCOPE_RESOURCE_MANAGER_H #define SCOPE_RESOURCE_MANAGER_H #if...