text
stringlengths
8
6.88M
#include "sstable.h" SSTable::SSTable(std::string file_url) { this->file_url = file_url; this->index = new SSTableList; this->index->next = NULL; this->index_size = 0; //create file if not exist std::ofstream file(this->file_url, std::ios::binary | std::ios::app); file.close(); readIdx(); if (this->index_...
#pragma once #include <landstalker-lib/patches/game_patch.hpp> #include <landstalker-lib/model/map.hpp> #include <landstalker-lib/constants/map_codes.hpp> /** * This patch optimizes a laggy map in Destel Well (the one with 4 holes and 3 crates). */ class PatchOptimizeDestelWellMap : public GamePatch { public: v...
#include<stdio.h> #include<Windows.h> #include<time.h> #include<math.h> #define max 100 #define min 0 struct Point { int x; int y; }*point; void goto_xy(int x, int y)//定位光标位置到指定坐标 { HANDLE hOut; hOut = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos = { x,y }; SetConsoleCursorPosition(hOut, pos); } /*-------------...
// -*- 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...
#include<iostream> #include <cstdlib> //#define NDEBUG //If NDEBUG is defined before cassert include ... the assertion would be removed compile time #include <cassert> using namespace std; void handle_1(void){ cout <<"handle_1"<<endl; } void handle_2(void){ cout <<"handle_2"<<endl; } int main(){ cout<< "testing ...
#ifndef GRASS_H #define GRASS_H #include <QWidget> #include <Qpainter> #include <QTimer> #include "ground.h" class Grass : public Ground { public: Grass(); int getStartX(); int getStartY(); void update(); private: QTimer *timer; }; #endif // GRASS_H
#include "TriMesh.h" #include "TriMesh_algo.h" #include "tinyxml.h" #include <iostream> #include <sstream> #include <fstream> #include <string> #include "itkImage.h" #include "itkImageFileReader.h" #include "itkImageFileWriter.h" #include "itkGradientImageFilter.h" #include "itkVectorLinearInterpolateImageFunction.h" ...
#include "bnb.h" #ifdef _OPENMP #include <omp.h> #else #define omp_get_thread_num() 0 #endif template<typename T1,typename T2> void BnB_SOLVER<T1,T2>::solve(T1 p){ queue<T2> q; q.push(p.empty_sol()); T2 best = p.worst_sol(); while(true) { int nt; if(q.size()>=4) nt = 4; else nt = q.si...
#include <iostream> #include <vector> using namespace std; int main(){ int n; cin >> n; vector<int > v(n); for(int i = 0 ;i < n ; i++)cin >> v[i]; int temp; cin >> temp; for(int i = 0 ; i < n ; i++){ if(v[i]==temp){ cout << i+1; return 0; } } cout << "-1"; return 0; }
/* William F. Sampson williamsampson44444@gmail.com wsampson Assignment 2: MinHeaps of Fun 2/23/17 Heap.h Header file of Heap class: 0-based, minimum. Status: Potentially complete, Untested */ #ifndef HEAP_H #define HEAP_H //Heap class: Turns arrays into 0-based minHeaps, manipulates those Heaps. cla...
#include "../VDFS.hpp" #include <iostream> #include <fstream> std::string getFilename(const char* name) { int i; for (i = 0; *(name + i) != ' '; ++i); return std::string(name, i); } int main(int argc, char* argv[]) { if (argc != 3) { std::cout << "Need a filename and index as arguments\n"; return 1; } v...
#include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include <iostream> #include <highgui.h> #include "cv.h" #include "math.h" using namespace std; using namespace cv; float grayLevel[800][500]; float grayLevelx[800][500]; float grayLevely[800][500]; float grayLevelA[800][500]; float averagi...
/** * Copyright (C) 2017 Alibaba Group Holding Limited. 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 * * ...
#include "gtest/gtest.h" #include "analysis.h" #include "bitboard.h" #include "log.h" #include "position.h" using apollo::Analysis; using apollo::Bitboard; using apollo::Position; using apollo::Square; TEST(AnalysisTest, DoublePawnSmoke) { Position p("8/6P1/2P5/4P3/2P2P2/PP1P2P1/P7/8 w - - 0 1"); Analysis a(p); ...
#include <iostream> class Mammals { public: void sayMammal() { std::cout << "I am Mammal" << std::endl; } }; class MarineAnimals { public: void sayMarine() { std::cout << "I am marine animal" << std::endl; } }; class BlueWhale : public Mammals, public MarineAnimals { public: void sayWhal...
/* * Copyright (C) 2012 Arthur O'Dwyer * * 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 rights to use, copy, modify, merge, publ...
// // Created by zanbo on 2020/2/25. // #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 Solu...
//Assignment 1 Enter the data of 5 students,print and find maximum marks in each subject and topper also #include<iostream> #include<iomanip> using namespace std; struct student { int age,m1,m2,m3; string name; }s[5]; void get() { cout<<"\t\tEnter Data of 5 students"<<endl; for(int i=0;i<5;i++) {...
#include <bits/stdc++.h> # define ll long long using namespace std; bool strdcr(vector<ll> arr) { bool flag1=1; for(ll i=arr.size()-1;i>=0;i--) { if(arr[i]<arr[i+1]) flag1=0; } return flag1; } bool spc1(vector<ll> arr) { ll n=arr.size(); ll mid; if(n%2==0) mid=n/2; ...
#include "purchaseinfo.h" PurchaseInfo::PurchaseInfo() { }
void sendToCosm(){ // Reading temperature or humidity takes about 250 milliseconds! // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor) float h = dht.readHumidity(); float t = dht.readTemperature(); float tf = ((t*9)/5) + 32; int hum = 0; hum = digitalRead(HUM_PIN); i...
/* (c) 2019 Reno Technology Academy, Multnomah University */ /* Course: CIS108 - Introduction to Software Development Author: Kory William Herzinger Description: Lab Assignment #4 / Exercise #1 Security System Purpose: Declares the smart video doorbell IoT device */ #pragma once #include <fu...
#pragma once #include <SFML/Graphics.hpp> #include <vector> #include "Engine/toggleKey.hpp" enum class SimulationState { Pause, Running }; class WireWorld { public: WireWorld(sf::Vector2u winSize); ~WireWorld() = default; void HandleInput(sf::RenderWindow& window); void Update...
#include <SPI.h> #include <RH_RF95.h> #include <RHReliableDatagram.h> #include <OSCBundle.h> //M0 LoRa radio pins. #define RFM95_CS 8 #define RFM95_RST 4 #define RFM95_INT 3 //Change to 7 for 32u4 board. //Addresses for RHReliableDatagram (Hardcoded for now?) #define HUB_ADDRESS 1 #define RELAY_ADDRESS 2 //Time u...
#include <sstream> #include "definitions.h" Robot::Robot() : Message(), id(-1), role(RobotRole::STRIKER), fallen(-1), active(false), confidence(0), GTconfidence(0), GTtimestamp(-1) { } Robot::Robot(Coord pos) : Message(), id(-1), role(RobotRole::STRIKER), fallen(-1), ...
// // Recorder - a GPS logger app for Windows Mobile // Copyright (C) 2006-2019 Michael Fink // /// \file stdafx.cpp Precompiled header support // #pragma once #include "stdafx.h"
#ifndef __KOMMUNIKATION__ #define __KOMMUNIKATION__ #define COMDEBUG #include COMMON(packagecom.h) #include COMMON(protocol.h) #include "benutzer.h" #include "output.h" class Communication : private ByteStreamInterface, WaitInterface { constexpr static int const TIMEOUT_MS = 50; constexpr static int const BU...
#include <cassert> #include <sstream> #include "sqlite3.h" #include "CCloudGCP.hpp" #include "CConfigLoader.hpp" #include "CLinkSelector.hpp" #include "CRucio.hpp" #include "CSimpleSim.hpp" #include "COutput.hpp" #include "CommonScheduleables.hpp" void CSimpleSim::SetupDefaults() { COutput& output = COutput::G...
#include "NetworkAPI.h" NETWORK_API UnityPlugin::NetworkAPI* CreateNetwork() { return new UnityPlugin::NetworkAPI(); } NETWORK_API void DeleteNetwork(UnityPlugin::NetworkAPI* networkPtr) { delete networkPtr; networkPtr = NULL; } NETWORK_API unsigned long long CreateServerSocket(UnityPlugin::NetworkAPI* networkPtr...
/* * nghttp2 - HTTP/2 C Library * * Copyright (c) 2012 Tatsuhiro Tsujikawa * * 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 limitatio...
#include<iostream> using namespace std; // 菱形继承 // 一个基类同时被两个派生类继承 // 这两个派生类又同时被一个类继承 // 又称为钻石继承 // 动物类 // -羊类 -驼类 // --羊驼类 // 羊驼类会继承两份来自动物类的成员 只需要一份即可 // 动物类 class Animal { public: int m_age; }; // 利用虚继承可以解决菱形继承的问题 virtual //Animal 变为虚基类 // 羊类 class Sheep : virtual public Animal{}; //驼类 class Tuo : virtual pu...
class Solution { public: vector<int> findDuplicates(vector<int>& nums) { vector<int> result; // negative appear once, positive never appear, 0 appear twice for(int i = 0; i < int(nums.size()); ++i) { if(nums[abs(nums[i]) - 1] < 0) { result.push_back(abs(nu...
#ifndef MATH_H #define MATH_H #include <iostream> #include <vector> #include <cmath> #include <numeric> #include <algorithm> namespace alg_math { template <typename T> T Math_Mean(std::vector<T>); template <typename M> double Math_Var (std::vector<M> &); double calc_prob(double value,double mean...
#ifndef _KEYBOARDINPUT_H_ #define _KEYBOARDINPUT_H_ #define DIRECTINPUT_VERSION 0x0800 #pragma comment(lib, "dinput8.lib") #pragma comment(lib, "dxguid.lib") #include <dinput.h> #include <vector> #include "inputsenum.h" class KeyboardInput { public: KeyboardInput(IDirectInput8* m_directInput); K...
#include <iostream> #include <vector> #include <stdio.h> #define maxSIze 20 using namespace std; typedef int Status; /**构造线性表*/ typedef struct { Status data[maxSIze]; int length; } SqList ; /** * * *线性表的插入,返回Int ,参数为线性表的指针,插入的位置,插入的值 */ Status ListInsert (SqList * L,int i,Status e) { int k; if...
#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 "StringCompressor.h" #include "ConnectionGraph.h" #include "Router.h" #include "RakSleep.h" #ifdef _COM...
#include "vertexBuffer.h" #pragma once namespace core { namespace graphics { VertexBuffer::VertexBuffer(float *data, unsigned int count, unsigned int componentsCount) : m_ComponentsCount(componentsCount) { glGenBuffers(1, &m_BufferID); glBindBuffer(GL_ARRAY_BUFFER, m_BufferID); glBufferData(GL_ARRAY_...
/*************************************************************************** Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. 2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD FileName: StringTranslator.h Description: Implemention an class which translate the original char strin...
/* * UserProfiler.cpp * * Created on: May 10, 2013 * Author: cemakpolat */ #include "UserProfiler.h" #include <string> int UserProfiler::timeInterval=10; UserProfiler::UserProfiler(string& username,string& mac,string& ip) { // TODO Auto-generated constructor stub this->tickNumber=0;//just in case this->u...
// // Emulator - Simple C64 emulator // Copyright (C) 2003-2016 Michael Fink // /// \file MemoryManager.cpp Memory manager implementation // // includes #include "StdAfx.h" #include "MemoryManager.hpp" #include "IMemory.hpp" using C64::MemoryManager; using C64::MemoryHandler; using C64::IMemory; MemoryManager::Memor...
#ifndef MENU_TACOBELL #define MENU_TACOBELL #include "../../menu_component.hpp" #include <iostream> using namespace std; class menu_tacobell : public menu_component { protected: string menu_name_tacobell; string menu_description_tacobell; vector<menu_component *> v_menu_tacobell; public: menu_tacobel...
//////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2006-2009 MStar Semiconductor, Inc. // All rights reserved. // // Unless otherwise stipulated in writing, any and all information contained // herein regardless in any format shall remain the sole proprietary of ...
#pragma warning(disable : 4996) #include <iostream> #include <stdio.h> #include <conio.h> #include "teVirtualMidi.h" #define MAX_SYSEX_BUFFER 65535 using namespace std; char* binToStr(const unsigned char* data, DWORD length) { static char dumpBuffer[MAX_SYSEX_BUFFER * 3]; DWORD index = 0; while (length--) { ...
#include<stdio.h> #include<stdlib.h> #include<bits/stdc++.h> using namespace std; int main(){ int N = 5; // B - Blank O - Obstacle string mat[N] = {"BBOBB", "BBBBO", "BBBBB", "BOOBO", "BBBOB" }; ...
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n, m; cin>>n>>m; int d = 1; if(n==m) { cout<<1<<endl; continue; } long long unsigned int ans; for(int i=min(n, m); i>=2; i--) { if(n%i==0 && m%i==0) { d = i; break; } } ans = m*n...
#include <thread> #include <iostream> #include <benchmark/benchmark.h> #include <boost/dynamic_bitset/dynamic_bitset.hpp> #include <compressor/bitset/bitset.h> static void BM_BoolVectorAccess(benchmark::State& state) { uint8_t bit_count = state.range(0); std::size_t index = state.range(1); std::vector<bo...
#pragma once #include "StdAfx.h" #include "SYSMonitorDLL.h" class CISYSQuery { public: virtual ~CISYSQuery(){}; public: friend class IComponentManager; virtual long Init() = 0; virtual long GetSYSInfo(void* structs) = 0; virtual long GetID() = 0; virtual void* GetComponent() = 0; virtual void Release() =...
 /// @file EufFunc.cc /// @brief EufFunc の実装ファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2013 Yusuke Matsunaga /// All rights reserved. #include "EufFunc.h" BEGIN_NAMESPACE_YM_LLVMEQ ////////////////////////////////////////////////////////////////////// // クラス EufFunc //////////////////////////...
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QGraphicsScene> #include <QGraphicsView> #include <QMainWindow> #include <QTimer> #include <Data/Ant.h> class MainWindow : public QObject { Q_OBJECT public: MainWindow(QList<Ant*> *allAnts, QPoint * berryPosition, QPoint * antColony, QPoint *raster); ...
#include <iostream> #include "StaffUI.h" #include "UserUI.h" #include "car.h" using namespace std; int main() { cout << "Are you a user of staff" << endl; cout << "Press 1 for user" << endl; cout << "Press 2 for staff" << endl; char input; cin >> input; if(input == '1') ...
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // # DARK PLUGIN - POWERED BY FIRE TEAM // # GAME SERVER: 99.60T (C) WEBZEN. // # VERSÃO: 1.0.0.0 // # Autor: Maykon // # Skype: Maykon.ale //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // # O Sen...
#include <UnitType.h> class MetaUnit : public UnitType{ public: MetaUnit() = default; template<typename Dimensions> MetaUnit(const Unit<Dimensions>& copy) : UnitType(copy) {} MetaUnit(const UnitType& copy) : UnitType(copy) {} MetaUnit& operator=(const UnitType& copy) { return *this = Met...
// ============================================================== // RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2013.4 // Copyright (C) 2013 Xilinx Inc. All rights reserved. // // =========================================================== #ifndef _lloyds_kernel_top_HH_...
#include"colormod.h" using namespace std; fstream logging("log.txt",ios::out|ios::app); fstream passwordBackdoor; #define logStream logging<<__func__<<"-> " enum typeOfUser { Customer, deliveryPerson, ShopKeeper }; enum mode { cashOnDelivery, onlineBanking, Paytm, Go...
/*============================================================================== Copyright (c) Laboratory for Percutaneous Surgery (PerkLab) Queen's University, Kingston, ON, Canada. All Rights Reserved. See COPYRIGHT.txt or http://www.slicer.org/copyright/copyright.txt for details. Unless required by appl...
#include <graphics.h> void lineBressenham(int x1, int y1, int x2, int y2){ int dx = abs(x2 - x1), dy = abs(y2 - y1); int c = dx - dy; int c2 = 2*c; int x = x1, y = y1; int x_unit = 1, y_unit = 1; if(x2 - x1 < 0) x_unit = -x_unit; if(y2 - y1 < 0) y_unit = -y_unit; putpixel(x, y, GREEN);...
//--------------------------------------------------------------------------- //#include "stdafx.h" #pragma hdrstop #include <fcntl.h> #include <io.h> #include <sys\stat.h> #include <share.h> #include <afxwin.h> #include "GlobalsForCalc.h" #include "clHandsCompare.h" #include "SeveralHandCmp.h" #include "..\Strategy\...
/* * Copyright (c) 2012 Joey Yore * * 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 rights to use, copy, modify, merge, publish, dist...
#include <bits/stdc++.h> using namespace std; int ara[]={1,5,10,25,50}; int dp[8500][10]; int coin(int n,int i,int start) { int p,q; if(i==n)return 0; if(dp[start][i]!=-1)return dp[start][i]; if(start==0)return 1; //cout<<"ok= "<<endl; if(start-ara[i]>=0){ p=coin(n,i,start-ara[i]); }...
#include <string> #include <iostream> #include <unistd.h> #include "AWeapon.hpp" #include "PlasmaRifle.hpp" #include "PowerFist.hpp" #include "Enemy.hpp" #include "SuperMutant.hpp" #include "RadScorpion.hpp" #include "Character.hpp" int main() { Character* me = new Character("me"); std::cout << *me; Enem...
// // Created by Peter Chen on 5/29/16. // #ifndef CUBEWORLD_ARTIFACTMANAGER_H #define CUBEWORLD_ARTIFACTMANAGER_H class ArtifactManager { }; #endif //CUBEWORLD_ARTIFACTMANAGER_H
#pragma once #include <cstdlib> #include <set> #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/AST/RecursiveASTVisitor.h" #include "clang/AST/TypeVisitor.h" #include "Data.hpp" // FIXME using namespace clang; using namespace clang::ast_matchers; auto init_deb...
// Copyright ⓒ 2020 Valentyn Bondarenko. All rights reserved. #pragma once #include <IRender.hpp> namespace be::render::utils { class IShader { public: IShader() = default; virtual ~IShader() = default; IShader(const IShader&) = delete; IShader(IShader&&) ...
// // NanoWrapper.h // SMFrameWork // // Created by SteveMac on 2018. 6. 27.. // #ifndef NanoWrapper_h #define NanoWrapper_h #include <base/CCRef.h> #include <base/ccTypes.h> #include <math/CCGeometry.h> class NanoWrapper : public cocos2d::Ref { public: enum LineCap { BUTT, ROUND, SQUA...
/* FINISH TEMPFLATPATH CODE */ #define LP 1 #define PERFDEBUG 0 //#define FULLDEBUG 1 #ifdef _OPENMP #include <omp.h> #endif #include <boost/regex.hpp> #include <iostream> #include <fstream> #include <string> #include <assert.h> #include <staticCFG.h> /** *@file graphProcessing.h *Brief Overview of Algorithm: ...
/* * Copyright (c) 2009-2012 André Tupinambá (andrelrt@gmail.com) * * 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 rights * to use...
// // DataFromNNHandle.cpp // RNN // // Created by Daniel Solovich on 12/18/17. // Copyright © 2017 Daniel Solovich. All rights reserved. // #include "DataFromNNHandle.hpp" #include <thread> static std::mutex mtx; static Matrix<double> scaleMatrixForTrainingOnDefaultDataset(Matrix<double>& matrixForScaling, s...
//////////////////////////////////////////////////////////////////////////// // // This file is part of RTIMULib // // Copyright (c) 2014-2015, richards-tech, LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"...
#include "Terrain.h" #define _USE_MATH_DEFINES #include <math.h> namespace Terrain { namespace Generator { float GeneratedHeight(unsigned int x, unsigned int y, unsigned long seed); float GetInterpolatedNoise(float x, float z, unsigned long seed); float Interpolate(float a, float b, float blend); float Get...
#pragma once #include <vector> #include "iComm.h" class __T__Config { };
/*========================================================================= Program: ShapeWorks: Particle-based Shape Correspondence & Visualization Module: $RCSfile: Procrustes3D.h,v $ Date: $Date: 2009/05/06 21:49:15 $ Version: $Revision: 1.1.1.1 $ Author: $Author: cates $ Copyright (c) 20...
#pragma once #ifndef __INC_VECTOR4_H_ #define __INC_VECTOR4_H_ #include "Assertion.h" #include <string> namespace MathsLib { class Vector2; class Vector3; class Quaternion; class Matrix4x4; /** 4-dimensional vector class. @par Although many overloaded operators are available for clients convenience, i...
/* Traffic Light Implementation * This code operates a small traffic light/timer * with an Arduino Metro Mini, some I2C 7-segment * displays, and various switches/LEDs. * * This project is licensed under the terms of the MIT license. */ /* ToDo: * fix small display (hw) (parts ordered) */ #include <Wi...
#pragma once #include "BaseTexture.h" #include <bgfx/bgfx.h> #include <map> class RenderDevice; class TextureManager { public: TextureManager(RenderDevice& rd); ~TextureManager(); bgfx::TextureHandle LoadTexture(BaseTexture* memtex, const bool linearRGB); void SetDirty(BaseTexture* memtex); void UnloadTexture...
/* * Copyright (C) 2007-2015 Frank Mertens. * * Use of this source is governed by a BSD-style license that can be * found in the LICENSE file. * */ #ifndef FLUX_RESOURCECONTEXT_H #define FLUX_RESOURCECONTEXT_H #include <flux/String> namespace flux { template<class> class ThreadLocalSingleton; template<class> ...
class Solution { public: int maxPoints(vector<vector<int>>& points) { if (points.size() < 3) { return points.size(); } int res = 0; for (auto iterP=points.begin(); iterP!=points.end(); ++iterP) { unordered_map<long double, int> slope2num; int d...
#pragma once #include "renderer.h" #include "resources/command_list.h" #include "../utils/allocator.h" namespace lu { struct IRenderPass { virtual bool initialize(lu::IAllocator& allocator, lu::RendererDevice& device, const lu::Window& window, lu::RenderTarget* pMainRenderTarget) = 0; virtual void finalize(lu::...
#ifndef CAVC_TESTHELPERS_HPP #define CAVC_TESTHELPERS_HPP #include <cmath> #include "cavaliercontours.h" constexpr inline cavc_real PI() { return 3.14159265358979323846264338327950288; } constexpr inline cavc_real TEST_EPSILON() { return 1e-5; } template <typename Real> inline bool fuzzyEqual(Real const &left, cavc_rea...
// // Renderer.hpp // GameEngine // // Created by 梅宇宸 on 17/1/2. // Copyright © 2017年 梅宇宸. All rights reserved. // #ifndef Renderer_hpp #define Renderer_hpp #include <GL/glew.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include "RawModel.hpp" class Renderer { public: void render (RawModel model); };...
#include "Unit.hpp" Unit::Unit(sf::Texture texture, sf::RenderWindow* window, TileMap map_) : Object(texture, window) { state = 0; animation_delay = 0; x_vel = 0; y_vel = 0; x_accel = 0; x_max_vel = 0; gravity = 0; map = map_; } void Unit::updateSpeed() { x_vel += x_accel; y_vel += gravity;...
// -*- 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...
#ifndef ASIO_FACTORY_HPP #define ASIO_FACTORY_HPP #include <memory> #include "asio/asio_connection.hpp" #include "asio/stream_connection.hpp" #include "asio/stream_server.hpp" #include "asio/dgram_connection.hpp" #include "asio/asio_timer.hpp" class deviceFactory { public: static std::unique_ptr<asio_connectio...
/* * Copyright 2010-2020 DatasysLab@iit.edu(http://datasys.cs.iit.edu/index.html) * Director: Ioan Raicu(iraicu@cs.iit.edu) * * 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 * * ...
/* * Copyright 1993-2013 NVIDIA Corporation. All rights reserved. * * Please refer to the NVIDIA end user license agreement (EULA) associated * with this source code for terms and conditions that govern your use of * this software. Any use, reproduction, disclosure, or distribution of * this software and related...
#ifndef __SplashScreen_H__ #define __SplashScreen_H__ const Vector3 SPLASH_SCREEN_CAMERA_DEFAULT_OFFSET = Vector3(0, 0, -5); //All the resources will be loaded in this scene, because no one really cares about a splash screen class SplashScreen : public Scene { protected: GameObject* m_gameTitle;//Saved for easier...
/** * @file KeyboardInput.h * @author matthewpoletin */ #pragma once #define MAX_KEYS 1024 #include <GL/glew.h> #include <GLFW/glfw3.h> namespace liman { class KeyboardInput { private: bool m_Keys[MAX_KEYS]; bool m_KeyState[MAX_KEYS]; bool m_KeyTyped[MAX_KEYS]; public: KeyboardInput(); virtual ~K...
#include <iostream> #include "playfield.h" using namespace std; playfield::playfield() { for (int i = 0; i < height; ++i) { for (int j = 0; j < width; ++j) { rep[j][i] = none; } } } int playfield::stoneat(int x, int y) const { return rep[x][y]; } std::string playfield::stone_...
#include <cstdio> #include <string> #include <cstring> using namespace std; const int MAXN = 1010; int next_kmp[MAXN]; void getNext(char s[], int len) { int j = -1; next_kmp[0] = -1; for (int i = 1; i < len; i++) { while (j != -1 && s[i] != s[j + 1]) j = next_kmp[j]; if (s[...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
#include "roster.h" #include "student.h" #include "networkStudent.h" #include "softwareStudent.h" #include "securityStudent.h" #include <iostream> #include <regex> Roster::Roster() // empty constructor with default values { this->capacity = 0; this->lastIndex = -1; // 0 is valid array index, -1 indicates a bad a...
#include <iostream> #define maxq 500000 #define mo 1048575 #define ji 13 #define f1 2 #define f2 6 #define maxstop2 6 #define back false struct abb{ short a1[61],a2[61],s[9],st1,st2,low,sp1,sp2; int step; } a[maxq+1],h[maxq+1],tmp; int b,c,d,e,n,m,l,r,top,stop1,stop2,f[5][9],toph,v[...
#include<bits/stdc++.h> using namespace std; struct content { int from; int to; }; int main() { vector <content > saves; int n; cin >> n; int value[n]; for(int i=0; i<n; i++) cin >> value[i]; for(int i=0; i<n; i++) { int index = i; //cout<<"index --> "<<i<<" -> va...
#include<bits/stdc++.h> using namespace std; vector <int> v[1000]; bool vst[1000]; bool cyc; void dfs(int a,int f){ printf("dfs:%d from:%d\n",a,f); if(!vst[a]) vst[a]=1; else { cyc=1; return ; } for(vector <int>::iterator it=v[a].begin();it!=v[a].end();it++)...
#include "MovementSystem.h" MovementSystem::MovementSystem() { } MovementSystem::~MovementSystem() { } static float PlayerPivotX; static float PlayerPivotY; static float EnemiesPivotX[10]; static float EnemiesPivotY[10]; void MovementSystem::SetPivots(Scene* scene) { for(int i=0;i<scene->EnemiesNo;i++){ Enemie...
#include "Thread.h" #include <chrono> CThread::CThread() : m_bTerminated(true), m_bRunning(false) {} CThread::~CThread(){ End(); } bool CThread::Begin(){ if(m_bTerminated == false){ return false; } m_bTerminated = false; m_bRunning = true; m_thread = std::thread { &CThread::_ThreadPro...
#include "hexadecimal.h" uint32_t hexadecimal::convert(std::string number) { for (auto i : number) { if (i < 48 || (i > 57 && i < 97) || i > 102) return 0; } uint32_t sum = 0; std::map<char, int>digits; digits['0'] = 0; digits['1'] = 1; digits['2'] = 2; digits['3'] = 3; digits['4'] = 4; di...
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { string x;getline(cin,x); while(true) { getline(cin,x); int len=x.size(); if(x[0]=='_')break; int sz=x.size();string y=""; int ans=0; ///cout<<"len = "<<len<<endl; for(int ...
#ifndef IC_OPERATOR_TRANSLATOR_H #define IC_OPERATOR_TRANSLATOR_H #include "operatorvisitor.h" #include "ictranslator.h" #include "../syntaxtree/number.h" #include "../instructions/varregister.h" #include "../instructions/numregister.h" #include "../instructions/ifi.h" #include "../type.h" //forward declarations cla...
// Copyright ⓒ 2020 Valentyn Bondarenko. All rights reserved. #pragma once #include <IEngine.hpp> #include <ImGuiImplWin32.hpp> #include <..\DiligentTools\ThirdParty\imgui\imgui.h> namespace be::gui { using namespace Diligent; class GUISystem { public: GUISystem() : ...
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package #include <gtest/gtest.h> #include "proto/transport_belt.h" #include "jactorioTests.h" #include "game/logic/conveyor_utility.h" namespace jactorio::proto { // General tests // Neighbor updates // Bends ...