text
stringlengths
8
6.88M
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2007 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 ACCESSIBILITY_EXTENSION_SUPPORT #i...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<algorithm> #include<cmath> using namespace std; int a[210],f[210][210][210]; int pow(int k) { return k*k; } int dfs(int l,int r,int k) { if (f[l...
// Copyright (c) 2011-2017 The Cryptonote developers // Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs // 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 <cstdio> #include <vector> #include <algorithm> #include <iostream> using namespace std; const int N = 111111; vector<int> g[N]; int color[N], was[N], maxcol; void dfs(int x) { bool can[3] = {1, 1, 1}; was[x] = 1; for (int i = 0; i < (int)g[x].size(); ++i) { if (was[g[x][i]]) { ...
#include "..\..\01-Shared\Elysium.Graphics\GameHost.hpp" Elysium::Graphics::Platform::GameHost::GameHost(Game* Game) : Elysium::Core::Object(), Elysium::Graphics::Platform::IGameHost(), _Game(Game), _GameCanvas(GameWindow()) { } Elysium::Graphics::Platform::GameHost::~GameHost() { } Elysium::Graphics::...
#include "Sample.h" Sample::Sample() { samples = NULL; diskSamples = NULL; hemisphereSamples2D = NULL; hemisphereSamples3D = NULL; numberOfSamples = 4; numberOfHemisphereSamples = 4; e = 2.718281828459; roomDepth = 100; ambientAmountToShade = 0; } void Sample::setRoomDepth(double room) { roomDepth = room; }...
#include <Adafruit_NeoPixel.h> #include "CatchFire.h" CatchFire::CatchFire(void) { } void CatchFire::reset(variables_t *vars) { vars->progress = 0; vars->time = 0; vars->isSparking = true; vars->isPausing = true; vars->toQuit = false; vars->lastTime = millis(); } void CatchFire::loop(variables_t *vars) {...
#include "Human.hpp" #include "utils.hpp" #include <cmath> #include <iomanip> #include <iostream> bool operator>(sf::Vector2f a, sf::Vector2f b) { return sqrt(pow(a.x, 2) + pow(a.y, 2)) > sqrt(pow(b.x, 2) + pow(b.y, 2)); } sf::Vector2f operator*(float k, sf::Vector2f a) { return sf::Vector2f(k * a.x, k * a.y); } ...
#ifndef PYTHIA_WRAPPER_H #define PYTHIA_WRAPPER_H #include "simpleLogger.h" #include "Pythia8/Pythia.h" #include "workflow.h" #include <sstream> #include <unistd.h> #include "predefine.h" using namespace Pythia8; class HQGenerator{ public: HQGenerator(std::string f_pythia, std::string f_trento, ...
// Copyright (c) 2019 The NavCoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef DAOCONSULTATIONCREATE_H #define DAOCONSULTATIONCREATE_H #include "consensus/dao.h" #include "main.h" #include "navcoinlis...
#include "game.hpp" #include <algorithm> #include <memory> #include <utility> #include "game_object_visitor.hpp" #include "stats.hpp" sgfx::rle_image const& resource_manager::rle(std::string const& path) { auto i = rle_images_.find(path); if (i != rle_images_.end()) return i->second; rle_images_.e...
//Phoenix_RK /* https://leetcode.com/problems/delete-node-in-a-bst/ Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST. Basically, the deletion can be divided into two stages: Search for a node to remove. I...
#include "Configuration.h" #include <map> #include <stdlib.h> using json = nlohmann::json; Configuration::Configuration(std::string fname) { ifs.open(fname); jsons.assign(std::istreambuf_iterator<char>(ifs) , std::istreambuf_iterator<char>()); j = json::parse(jsons); } Configuration::~Configuration() {...
#include <iostream> #include <forward_list> using namespace std; struct incorrect_k_value {}; /* * Runs O(n) * */ int kth_to_last(forward_list<int> flist, int k) { if (k <= 0) { throw incorrect_k_value {}; } auto i = flist.begin(); int pos = 0; while ((i != flist.end()) && (pos < k))...
#include "stdafx.h" #include "QuizView.h" namespace qp { CQuizView::CQuizView() { } CQuizView::~CQuizView() { } }
#ifndef RECOGNITION_HH_ #define RECOGNITION_HH_ #include <list> #include <string> /** Data structure for morphemes. */ struct Morpheme { unsigned long time; //!< Starting frame of the morpheme. unsigned long duration; //!< Duration of the morpheme. std::string data; //!< The morpheme. }; /** Container type fo...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** 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. */ #ifndef HTMLEXPORTER_H #define HTMLEXPORTER_H #include "modules/...
// // this code writes a SALT ini file to the primary FRAM_SETTINGS section of fram (0x0100-0x0FFF) and writes a // second, backup copy, to the backup FRAM_SETTINGS_2 section (0x1100-0x1FFF) // // This version of ini loader reads an ini file from the uSD flash // #include <Systronix_MB85RC256V.h> #include <SALT_settin...
#pragma once #include "ray.h" class Camera { public: __device__ Camera() = default; __device__ Camera(const glm::vec3& _origin, const glm::vec3& _lower_left) : origin(_origin), lower_left(_lower_left) { int width = abs(2 * lower_left.x); horizontal = glm::vec3(width, 0, 0); int height = abs(2 * lower_left....
#include <bits/stdc++.h> using namespace std; ofstream fout ("notlast.out"); ifstream fin ("notlast.in"); #define For(x) for(int i = 0; i < x; i++) #define For2(x) for(int j = 0; j < x; j++) #define Forv(vector) for(auto& i : vector) int main(){ int n; fin>>n; vector<string> cows= {"Bessie", "Elsie", "Daisy...
/* * Copyright [2017] <Bonn-Rhein-Sieg University> * * Author: Torsten Jandt * */ #include <mir_planner_executor/actions/perceive/perceive_action.h> PerceiveAction::PerceiveAction() : client_("/perceive_location_server") { //client_.waitForServer(); } bool PerceiveAction::run(std::string& robot, ...
#ifndef CLUBE_H #define CLUBE_H #include<iostream> #include<string.h> using namespace std; class Clube { string nome; int pontos,vitorias,saldo,gols; public: Clube(); }; #endif
// Created on: 1994-09-15 // Created by: Bruno DUMORTIER // Copyright (c) 1994-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GN...
#pragma once #include "proto/data_mail.pb.h" using namespace std; namespace pd = proto::data; namespace nora { namespace scene { pd::mail mail_new_mail(uint64_t role, uint32_t pttid, const pd::dynamic_data& dynamic_data, const pd::event_array& extra_events); pd::mail mail_new...
#pragma once #include <memory> #include <vector> #include <map> #include <windows.h> #include <d2d1_2.h> #include <dwrite_2.h> #include "util.h" #include "view.h" #include "bitmap.h" #include "board_screen.h" COM_MAKE_PTR(ID2D1HwndRenderTarget); COM_MAKE_PTR(ID2D1Factory); COM_MAKE_PTR(IDWriteFactory); COM_MAKE_PTR...
#include "Writefile.h" #include <iostream> std::string Writefile::execute(std::string & text) { std::ofstream fout(outputFile); if (!fout) { //colorMessages::RedError(" Can't open file " + outputFile + "!"); HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hConsole, 12); // Red Color ...
#include<bits/stdc++.h> using namespace std; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); int even = 0; int num; for(int i = 0; i < 5; i++) { cin>>num; if(num % 2 == 0) { even ++; } } cout<<even<<" valores pares\n"; return 0; }
#include "stdafx.h" bool Core::OnInit() { if(SDL_Init(SDL_INIT_EVERYTHING) < 0) { return false; } moving = false; lastMoved = false; mainWindow = SDL_CreateWindow("Core Window", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 1136, 640, SDL_WINDOW_SHOWN); mainRenderer = SDL_CreateRenderer(mainWindow, -1, ...
//*-- Author : Stephen Wood 20-Apr-2012 ////////////////////////////////////////////////////////////////////////// // // THcHallCSpectrometer // // A standard Hall C spectrometer. // Contains no standard detectors, // May add hodoscope // // The usual name of this object is either "H", "S", or "P" // for HMS, SOS,...
#include <iostream> #include <conio.h> #include <stdio.h> #define MAX 100 using namespace std; short checkUnique1(char input[],int n) { int hashTable[300]={0},i; for(i=0;i<n;i++) { if(hashTable[input[i]]==0) hashTable[input[i]]++; else return 0; } ...
#ifndef _EUI_ANIMATION_HELPER__H__ #define _EUI_ANIMATION_HELPER__H__ #include <vector> namespace UiLib { class IAnimationCallback { public: virtual void OnFrame() = 0; }; class CAnimation { #pragma pack(1) // turn byte alignment on enum GIFBlockTypes { BLOCK_UNKNOWN, BLOCK_APPEXT, ...
#pragma once #include"Entity.h" #include"Chamber.h" #include"Player.h" #include"Enemy.h" #include<vector> #include<string> class Floor { private: static Floor *f; Player *p; std::vector<std::string> defaultMap; std::vector<std::string> map; std::vector<Chamber*> chamberList; int level; Entity *stair; Floor(); ...
#include <iostream> #define N 100 int powOf(int a) { for (int i = 2; i*i <= a; i++) { if (a % i == 0) { int pow = 0, temp = a; for (; temp % i == 0; temp /= i, pow++); if (temp == 1) return pow; } } return 1; } int main() { int overlap[6+1] = {0}; bool used[6*N+1] = {0}; for (int pow = 1; pow ...
/* NOTE: make the variables unique for each file by perhaps parsing in the file name. malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich malkovich */ #i...
#include <iostream> #include <algorithm> #include <vector> using namespace std; int N, M; int nResult; vector<int> v; void DFS(int Index, int Cnt, int Sum) { if (3 == Cnt && M >= Sum) { nResult = max(Sum, nResult); return; } if (3 < Cnt || Index >= N || M < Sum) { return; } DFS(Index + 1, Cnt + 1, Su...
#include <iostream> #include "MapAnalyzer.h" using namespace sc2; MapAnalyzer::MapAnalyzer() { } void MapAnalyzer::AnalyzeMap(const ObservationInterface* obs) { std::cout << "beginning of the map analysis" << std::endl; const ObservationInterface* observation = obs; Units all_neutrals = observation->GetUnits(Uni...
// Registry.h: interface for the CRegistry class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_REGISTRY_H__08F26279_A63D_11D3_B73D_0050DA34A2BA__INCLUDED_) #define AFX_REGISTRY_H__08F26279_A63D_11D3_B73D_0050DA34A2BA__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2007 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * psmaas - Patricia Aas Oct 2005 */ #include "core/pch.h" #inclu...
#include <math.h> #include <array> #include <deque> #include <iostream> #include <limits.h> #include "Neighbor.h" using namespace std; // Constructors Neighbor::Neighbor() : GrowArray() {}; Neighbor::Neighbor(int i) : GrowArray(i) {}; Neighbor::Neighbor(int i, int j) : GrowArray(i, j) {}; // Destructor Neighbor::~...
/* * File: maildrops.h * Author: Wouter Van Rossem * */ #ifndef _MAILDROPS_H #define _MAILDROPS_H #include <dvthread/thread.h> #include <map> #include <string> #include <utility> #include <string> #include <sstream> #include "maildrop.h" #include "player.h" /** The Maildrops class manages the different maild...
// // main.cpp // 1100 // // Created by Pedro Neves Alvarez on 7/10/17. // Copyright © 2017 Pedro Neves Alvarez. All rights reserved. // #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using namespace std; map<string,vector<string> > graph; map<string, bool> visited; map<s...
#include "llvm/Pass.h" #include "llvm/IR/Function.h" #include "llvm/Support/raw_ostream.h" #include "llvm/IR/InstIterator.h" #include <unordered_map> #include <string> using namespace llvm; namespace{ struct countInstrPass:public FunctionPass { static char ID; countInstrPass() : FunctionPass(ID) {...
class Solution{ public: vector<string> AllPossibleStrings(string s){ // only gravity will pull me down // Power Set int n=s.size(); vector<string> res(pow(2,n)-1); for(int i=1; i<pow(2,n); i++) { int x = i, idx=0, l=32; while(l--) { if(x&1) ...
#pragma once #ifndef _LEAGUEITEMDATABASE_H #define _LEAGUEITEMDATABASE_H #include "common.h" #include "LeagueItemData.h" #include "opencv2/core.hpp" /* * Contains mapping of the item ID to the item data. * It also contains the mapping of the location on the database image to the item ID. */ class LeagueItemDataba...
/* The MIT License (MIT) Copyright (c) 2014 nightblizard 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, ...
#include <Adafruit_NeoPixel.h> #include "Glowing.h" Glowing::Glowing(void) { } void Glowing::reset(variables_t *vars) { vars->lastTime = 0; vars->isPausing = false; } void Glowing::loop(variables_t *vars) { int k = millis()*10 % 127; int i; if(vars->lastTime > k) { if(vars->isPausing) { vars->isP...
#pragma once #include <wrl/client.h> #include <d3d11_1.h> #include <d2d1_1.h> #include <d2d1effects.h> #include <dwrite_1.h> #include <wincodec.h> #include <DirectXMath.h> #include <agile.h> using namespace Windows::UI::Core; using namespace Windows::UI::Xaml::Controls; namespace OpenGraphicsLibrary ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2012 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * * @author Arjan van Leeuwen (arjanl) */ #ifndef QUICK_WIDGET_H ...
#include "libshared_and_static.h" #ifndef MY_CUSTOM_CONTENT_ADDED # error "MY_CUSTOM_CONTENT_ADDED not defined!" #endif int libshared_and_static::Class::method() const { return 0; } int libshared_and_static::Class::method_exported() const { return 0; } int libshared_and_static::Class::method_deprecated() const...
#include "waittingdlg.h" #include <QLabel> #include <QMovie> #include <QBoxLayout> CWaittingDlg::CWaittingDlg(QWidget *parent) : QDialog(parent, Qt::ToolTip), m_pLabMovie(NULL), m_pLabTips(NULL) { _initCtrls(); m_pMovie->start(); } CWaittingDlg::~CWaittingDlg() { m_pMovie->stop(); delete m_pMovie;...
#pragma once #include "../engine/core/Game.h" #include "../engine/components/model/Mesh.h" #include "../engine/components/model/Model.h" #include "../engine/components/model/Material.h" #include "../engine/scenegraph/Node.h" #include "../engine/texture/Texture.h" #include "../engine/shader/Shader.h" class TestGame : ...
/* ***** BEGIN LICENSE BLOCK ***** * FW4SPL - Copyright (C) IRCAD, 2009-2010. * Distributed under the terms of the GNU Lesser General Public License (LGPL) as * published by the Free Software Foundation. * ****** END LICENSE BLOCK ****** */ #include <stdio.h> /* for printf */ #include <stdint.h> #include <stdl...
#pragma once #ifndef __MEMORYHEADER_H_ #define __MEMORYHEADER_H_ #include "MACROS.h" namespace PPSHUAI{ namespace SystemKernel{ __inline static BOOL ReadProcessMemoryData(HANDLE hProcess, LPCVOID lpBaseAddress, LPVOID lpData, SIZE_T stSize, SIZE_T * pstNumberOfBytesRead) { return ReadProcessMe...
class Solution { public: int longestConsecutive(vector<int>& nums) { if(nums.empty()) return 0; map<int,int> M; int maxLen = 1; for(int i=0; i<nums.size(); ++i){ if(M.find(nums[i]) != M.end()) continue; M[nums[i]] = 1; if(M.find(nums[i] - 1) != M.e...
#include"Tests.h" #include"RepoTemplate.h" #include"Service.h" #include"UI.h" #include"TestFile.h" int main() { cout << "start" << endl; Tests test; test.testDomain(); test.testRepoTemplate(); //test.testService(); //########repo file tests################ TestRepositoryFile testf; testf.testLoadFr...
//#include "Sensor.h" //#define DEBUG_RAIN 1 const unsigned long int RAINFALL_COUNT_PERIOD = 20 * 1000l; // Update rainfall every 20 seconds volatile int rainfall_count = 0; // Incremented in the interrupt function // Tipping Bucket Rainfall Sensor RainfallSensor::RainfallSensor( const String& id, const int& pi...
/**************************************************************************** ** Copyright (C) 2017 Olaf Japp ** ** This file is part of FlatSiteBuilder. ** ** FlatSiteBuilder 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 S...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define rep1(i, n) for(int i = 1; i <= (int)(n); i++) #define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}} #define show(x) {for(auto i: x){cout << i << " ";} cout...
/*** * Copyright (C) 2016 Luca Weihs * * 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 3 of the License, or * (at your option) any later version. * * This program is distr...
#include <iostream> #include <vector> #include <algorithm> const std::vector<std::size_t> GetPrimes(std::size_t min, std::size_t max) { if (max <= 1) { return {}; } std::vector<bool> check(max + 1, true); for (std::size_t i = 2; i * i <= max; ++i) { if (check[i]) { ...
#include<iostream> using namespace std; int countingValleys(int steps, string path) { int seal = 0; int valley = 0; for(int i=0; i<steps; i++){ if(path[i]=='D'){ seal--; } else if(path[i]=='U'){ seal++; } if(path[i] == 'U'&&seal==0){ valle...
#include <iostream> using namespace std; #define MAX 100000 #define NIL -1 struct Node { int parent, left, right; }; struct Node T[MAX]; int D[MAX]; // int getDepth(int u){ // d = 0; // while(T[u].parent != NIL){ // u = T[u].parent; // d++; // } // return d; // } void setDepth(int u, int p){ D[u] ...
#include <map> #include <vector> #include <string> #include "rsdgMission.h" using namespace std; pair<int, int> getLoc(map<string,pair<int,int>>&,string); void addLoc(map<string,pair<int,int>>&,string, int, int);
// Created on: 2001-09-26 // Created by: Michael KLOKOV // Copyright (c) 2001-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 a...
 #include "ar.Base.h" namespace ar { }
#pragma once #include "afxcmn.h" #include "ClistCtrlEx.h" // MyDelayDlg 对话框 class MyDelayDlg : public CDialogEx { DECLARE_DYNAMIC(MyDelayDlg) public: MyDelayDlg(CWnd* pParent = NULL); // 标准构造函数 virtual ~MyDelayDlg(); // 对话框数据 #ifdef AFX_DESIGN_TIME enum { IDD = IDD_DELAYTAB_DIALOG }; #endif...
#include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> #include <limits.h> #include <stdbool.h> long int aVeryBigSum(int n, int ar_size, long int* ar) { long long int sum=0; for(int i=0;i<n;i++) { sum=sum+ar[i]; } return sum; } int main() { int...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*- ** ** Copyright (C) 2005 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** THIS FILE IS AUTO-GENERATED BY A SCRIPT....
#include <iostream> #include <cmath> using namespace std; int main() { float G = 6.67e-11; float M = 9.982e12; float R = 2650; float Vesc = sqrt((2.0*G*M)/(R)); //cout << "Escape Velocity is: " << Vesc << endl; float jumpV = 0.; cout << "What was the Jump Velocity?: "; cin >> jumpV; if(jumpV < Vesc) { /...
#pragma once namespace Hourglass { class WaypointAgent; class Separation; } class Chase : public Hourglass::IAction { public: void LoadFromXML(tinyxml2::XMLElement* data); bool IsRunningChild() const { return false; } void Init(Hourglass::Entity* entity); IBehavior::Result Update(Hourglass::Entity* entity); ...
// poj 1330 #include <iostream> #include <fstream> #include <sstream> #include <utility> #include <vector> #include <list> #include <string> #include <stack> #include <queue> #include <deque> #include <set> #include <map> #include <algorithm> #include <functional> #include <numeric> #include <bitset> #include <complex>...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2012 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef MODULES_UTIL_TESTS_OPFILEMOCK_H #define MODULES_UTIL_TESTS_OPFI...
#include <iostream> #include <cstdio> using namespace std; int main(){ int stops = 0; int in = 0,out = 0,max = 0,total = 0; cin >> stops; while(stops--){ //cin >> in >> out; cin >> out >> in; total += in-out; if(total > max){ max = total; } } cout << max<<"\n"; return 0; }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2008 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" #if defined(SELFTEST) #include "modu...
// // Created by mikcy on 15. 6. 7. // #include "KillTimerTask.h" void Timer::KillTimerTask::task() { kill(_target, SIGKILL); }
#include "ItemTableModel.hpp" #include <glog/logging.h> #include <envire_core/items/ItemMetadata.hpp> using namespace envire::core; namespace envire { namespace viz { ItemTableModel::ItemTableModel(QObject* parent): QAbstractTableModel(parent), numColumns(4) {} void ItemTableModel::addItem(envire::core::ItemBase...
#pragma once #include "Core/Core.h" namespace Rocket { struct WindowProps { String Title; int32_t Width; int32_t Height; WindowProps(const String& title = "Rocket Engine", uint32_t width = 1280, uint32_t height = 720) : Title(title), Width(width), Height(height) {} }; // Interface repr...
#include <iostream> #include <cstdio> #include <cstring> #include <map> #include <string> #include <iomanip> #include <cstdlib> #include <list> #include <sstream> #include <sys/ioctl.h> #include <stdio.h> #include <unistd.h> #include <algorithm> #include <vector> #include <istream> #include <iterator> #include "colors....
// // File: Seg7LED.h // Author: Andy Shepherd // email: seg7led@bytecode.co.uk // License: Public Domain // #ifndef SEG7LED_H #define SEG7LED_H #include <arduino.h> #include "CLedBuf.h" #define CHAR_0 ((byte) 0b1111110) #define CHAR_1 ((byte) 0b0110000) #define CHAR_2 ((byte) 0b1101101) #define CHAR_3 ((byte) 0b111...
#include "tipoqueue.h" #include <cstddef> TipoQueue::TipoQueue() { //ctor this->start = NULL; this->end = NULL; } TipoQueue::~TipoQueue() { //dtor this->free(); } Tipo* TipoQueue::retrieve() { if (!start) return NULL; Tipo* value = start->getTipo(); TipoN...
#include "WordsParser.h" namespace WordCounter { WordsParser::WordsParser() { Words = new map<string, pair<int64_t, float>>(); } WordsParser::~WordsParser() { delete Words; } void WordsParser::AddWord(string word) { WordsAmount++; map<string, pair<int64_t, float>>::iterator it = Words->find(word); ...
#include<iostream> using namespace std; int main() { int arr[100],n,i,j; int flag=0; int sum; cout<<"Enter length of array\n"; cin>>n; for(i=0;i<n;i++) { cout<<"Enter elements\n"; cin>>arr[i]; cout<<endl; } for(i=0;i<n;i++) { sum=0; for(j=i;j<n;j++) { sum+=arr[j]; if(sum==0) { f...
/* DIGITAL SENSOR CHECK FOR 3 DIGITAL SENSORS Connect the + on the sensor board to +5V on the Arduino Connect the - on the sensor board to GND on the Arduino Connect the R on the board to Digital Pin 2 on the Arduino Connect the P on the board to Digital Pin 3 on the Arduino Connect the X on the board to Digital Pi...
#include "kompute/Tensor.hpp" #include "kompute/operations/OpTensorSyncLocal.hpp" namespace kp { OpTensorSyncLocal::OpTensorSyncLocal() { SPDLOG_DEBUG("Kompute OpTensorSyncLocal constructor base"); } OpTensorSyncLocal::OpTensorSyncLocal( std::shared_ptr<vk::PhysicalDevice> physicalDevice, std::shared_ptr<v...
#ifndef __MYTEAPOT_H__ #define __MYTEAPOT_H__ class MyTeapot { D3DXVECTOR3 m_vPos; D3DXVECTOR3 m_vRot; D3DXVECTOR3 m_vScale; D3DXMATRIX m_mTM; D3DXMATRIX m_mScale, m_mRot, m_mTrans; D3DMATERIAL9 m_Mtrl; LPD3DXMESH m_pTeapot; LPDIRECT3DTEXTURE9 m_envTexture; public: void InitTeapot(voi...
/* * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory a...
// // Created by Nikita Kruk on 25.11.17. // #ifndef SPRAPPROXIMATEBAYESIANCOMPUTATION_DEFINITIONS_HPP #define SPRAPPROXIMATEBAYESIANCOMPUTATION_DEFINITIONS_HPP //#define MPI_PARALLELIZATION //#define BCS_CLUSTER typedef double Real; const int kS = 4; // number of state variables <-> (x,y,v_x,v_y) const int kSe = 8...
// https://oj.leetcode.com/problems/integer-to-roman/ // Reference: // http://fisherlei.blogspot.com/2012/12/leetcode-integer-to-roman.html class Solution { public: string intToRoman(int num) { char symbol[7] = {'I', 'V', 'X', 'L', 'C', 'D', 'M'}; string ret; int base = 1000; ...
// // Created by laureano on 08/11/19. // #ifndef AEDA_PROJETO_TIME_H #define AEDA_PROJETO_TIME_H #include <sstream> #include <string> #include <vector> #include "utilitarios.h" using namespace std; class Time { int hora; int minutos; int segundos; public: Time(); Time(int hora, int minutos, i...
// Copyright (c) 2015, Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory. // // This file is part of Caliper. // Written by David Boehme, boehme3@llnl.gov. // LLNL-CODE-678900 // All rights reserved. // // For details, see https://github.com/scalability-llnl/Caliper....
#include<bits/stdc++.h> using namespace std; struct node{ int to,cap,rev; }; vector<node> e[3000]; bool used[3000]; int s=0,t=2999,n,m,ans; inline void ins(int u,int v,int c){ e[u].push_back((node){v,c,e[v].size()}); e[v].push_back((node){u,0,e[u].size()-1}); } void readit(){ scanf("%d%d",&n,&m); for...
// // EPITECH PROJECT, 2018 // zappy // File description: // Menu.cpp // #include "Menu.hpp" Menu::Menu() { } Menu::Menu(ImageManager *img, ButtonManager *btn, ServPanel *srv, SoundManager *snd, StaticTextManager *txt, CheckBoxManager *bx, Table *tl, ListBox *lstB, ScrollBar *scrllB) { _img = img; _btn = b...
//============================================================================ // Name : stack.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <io...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- */ #include "core/pch.h" #include "modules/libgogi/mde.h" #ifdef MDE_SUPPORT_MOUSE void MDE_Screen::ReleaseMouseCapture() { if (m_captured_input) { // OnMouseLeave() below can trigger a re-enter (example: DSK-318237) MDE_View *captured_input = m_captured_inp...
/**************************************************************************** ** Copyright (C) 2017 Olaf Japp ** ** This file is part of FlatSiteBuilder. ** ** FlatSiteBuilder 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 S...
/*************************************************************************************************** mathutils.h math-related constants and utilities by David Ramos ***************************************************************************************************/ #pragma once // TODO: review if/when I get the VS2...
#include<bits/stdc++.h> using namespace std; map<string,int> mp; map<int,string> mp1; void init() { mp["1m"]=1,mp["2m"]=2,mp["3m"]=3,mp["4m"]=4,mp["5m"]=5; mp["6m"]=6,mp["7m"]=7,mp["8m"]=8,mp["9m"]=9; mp["1s"]=10,mp["2s"]=11,mp["3s"]=12,mp["4s"]=13,mp["5s"]=14; mp["6s"]=15,mp["7s"]=16,mp["8s"]...
/* Petar 'PetarV' Velickovic Algorithm: Graham Scan */ #include <stdio.h> #include <math.h> #include <string.h> #include <iostream> #include <vector> #include <list> #include <string> #include <algorithm> #include <queue> #include <stack> #include <set> #include <map> #include <complex> #define MAX_N 100001 #define ...
#include "GnMeshPCH.h" #include "GnLayerMain.h" GnLayerMain::GnLayerMain() : mpBackground(NULL) { } bool GnLayerMain::CreateBackgroundFromFile(const gchar* fileName) { if( mpBackground ) { removeChild( mpBackground, true ); } GnReal2DMesh* mesh = CCSprite::spriteWithFile( fileName ); if( mesh == NULL ) ret...
// 1.15(월) Day 3 // 과제 : 반복문과 조건문, rand()를 이용한 가위 바위 보 게임 // 진행 방식 // 플레이어 2명 1명은 나, 한명은 컴퓨터 // 가위(0), 바위(1), 보(2) // 나는 하나 선택 // 총 5번 플레이 // 매 플레이마다 누가 어떻게 이겼다. 라는 문구 출력 // ex) 사용자가 가위로 컴퓨터를 이겼다 // 최종적으로 이긴 횟수, 진 횟수, 비긴 횟수 출력 // 카페에 스샷찍어서 올리기 #include <iostream> #include <time.h> using namespace std; void makeCover...