text
stringlengths
8
6.88M
#include <boost/math/constants/constants.hpp> #include "point_light.h" point_light::point_light(const vector3 center, const ::color color, const double intensity) : light(color, intensity), _center(center) {} auto point_light::direction_from(const vector3& hit_point) -> vector3 { return (_center - hit_point).norm...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** 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 PI_SELFTEST_HELPERS_ADDRESSBOO...
#include <iostream> using namespace std; int matrix[10][10]; int paperCnt[6] = {0, 5, 5, 5, 5, 5}; int ans = 987654321; int cnt = 0; bool checkArea(int size, int dir_i, int dir_j){ for(int i = 0; i < size; i++){ for(int j = 0; j < size; j++){ int cur_i = dir_i + i; int cur_j ...
#ifndef AWS_NODES_NODEEXCEPTION #define AWS_NODES_NODEEXCEPTION /* * aws/nodes/nodeexception.h * AwesomeScript Node Exception * Author: Dominykas Djacenka * Email: Chaosteil@gmail.com */ #include "../exception.h" namespace AwS{ class NodeException : public Exception{ public: enum NodeError{ Undefined ...
// 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 <iostream> using namespace std; int main() { /* - 하나의 문자를 가리키는 포인터 - 10개의 정수 요소를 가지는 배열 - 10개의 정수 요소를 가지는 배열을 가리키는 포인터 - 문자로 이루어진 배열을 가리키는 포인터 - “문자를 가리키는 포인터”를 가리키는 포인터 - 정숫값을 가지는 상수 - 정숫값을 가지는 상수를 가리키는 포인터 - 정수를 가리키는 상수 포인터 */ char* str = "bottle"; // 하나의 문자를 가리키는 포인터 int number[10] = {1,2,3,4,5,6,7...
// // EPITECH PROJECT, 2018 // nanotekspice // File description: // simulate chipsets // #include <stdlib.h> #include <iostream> #include <string> #include "../include/ErrorManage.hpp" ErrorManage::ErrorManage(std::string path) { this->_my_comps = Components(); this->_path = path; this->_file.open(this->_path.c_str...
// Birthday Cake Candles // https://www.hackerrank.com/challenges/birthday-cake-candles/problem #include<bits/stdc++.h> using namespace std; int birthdayCakeCandles(vector<int> candles) { auto tallest=max_element(candles.begin(), candles.end()); int count=0; for(auto itr=candles.begin(); itr!=candles.end...
#include <iostream> #include <vector> #include "limits.h" using namespace std; /** * Definition for singly-linked list. **/ struct ListNode { int val; ListNode *next; ListNode() : val(0), next(nullptr) {} ListNode(int x) : val(x), next(nullptr) {} ListNode(int x, ListNode *next) : val(x), next(n...
#include "stdafx.h" #include "MessageLoop.h" #include "TlsHelper.h" #include "MessagePumpForUI.h" #include "MessagePumpForIO.h" #include "MessagePumpDefault.h" static TlsHelper g_TlsMessageLoopInstanc; MessageLoop::MessageLoop(Type type) : m_Type(type) , m_pState(NULL) , m_iNextSequenceNum(0) , m_bReen...
#include "stdafx.h" #include "MultipleChoiceQuestionViewController.h" #include "MultipleChoiceQuestionState.h" #include "MultipleChoiceQuestionView.h" namespace qp { CMultipleChoiceQuestionViewController::CMultipleChoiceQuestionViewController(IMultipleChoiceQuestionStatePtr const& questionState, CMultipleChoi...
void changeNumberForID(const string& inFilename,int ID,const string& inNewNumber) { fstream ioData(inFilename.c_str()); if(!ioData) { cerr<<"Error while opening file "<<inFilename<<endl; exit(1); } while(ioData.good()) { int id; string number; ioData>>id; if(id==inID...
#include<string> #include"bmi.h" void BMI::setmass(double num){ mass=num; } void BMI::sethigh(double num){ high=num; } double BMI:: getmass(){ return mass; } double BMI::gethigh(){ return high; } double BMI::bmivalue(){ return high==0?0: mass/(high*high); } string BMI::category...
#include <Servo.h> // Incluir la librería Servo #include <LiquidCrystal.h> //Libreria para el LCD #include<Wire.h> //Libreria para el LCD #include <LiquidCrystal_I2C.h> //Libreria para el LCD #include <DHT.h> //cargamos la librería DHT. #define DHTPIN 2 //Seleccionamos el pin 2 digital en el que se...
#include <iostream> #include <string> #include "mappings.hpp" using namespace mappings; void test0() { std::string* str = Create1("hello", Type2Type<std::string>{}); Widget<int>* pw = Create1(100, Type2Type<Widget<int>>{}); } int main() { return 0; }
#include "Texture.h" #include "sdlwrap.h" #include <SDL_image.h> #include <SDL_render.h> #include <memory> #include <unordered_map> Texture::Texture() {} Texture::Texture(char const* path) { load(path); } void Texture::load(char const* path) { SDL_Surface* buf = IMG_Load(path); if(!buf) { SDL_Log...
#ifndef CAMERA_H #define CAMERA_H #include "GL/gl.h" #include <math.h> #include <../mat.h> class Camera { public: Camera(); virtual ~Camera(); vec4 pos; vec4 focus; vec4 side; GLfloat yaw, pitch; void translate(vec3 d); void rotate(); vo...
// script.cpp : Defines the exported functions for the DLL application. // #include "stdafx.h" #include "custom-hooks.h" #include "script.h" #include "MFUtility.h" #include "encoder.h" #include "logger.h" #include "util.h" #include "yara-helper.h" #include "game-detour-def.h" #include <DirectXMath.h> //#include <C:\Pr...
// Copyright (c) 2021 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 as published // by the Free Software Foundation, with special ...
/** \file Sonar.hpp \author UnBeatables \date LARC2018 \name Sonar */ #pragma once #include <alproxies/almemoryproxy.h> #include <alproxies/alsonarproxy.h> #include <string> namespace SonarData { enum{ NONE = 0, LEFT, MIDDLE, RIGHT }; } /** \brief This class is responsabl...
#pragma once #include "rule.h" #include "../physicpoint.h" namespace sbg { template<int n> struct Gravity : Rule<n> { Gravity(const Vector<n, double> value = Vector<n, double>()); Vector<n, double> getResult(const PhysicPoint<n>& object) const override; Gravity<n>* clone() const override; Vector<n, double> g...
#include <Stage.h> #include <iostream> using namespace std; Stage* Stage::uniqueStage = NULL; Stage::Stage(RenderController* renderController) :RenderColleague(renderController) { this->initGLSLPrograms(); //-- Init local structures this->projection = new Projection(); //-- Initialize default values this->sele...
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/web_applications/bookmark_apps/system_web_app_manager.h" #include <memory> #include <utility> #include <vector> #include "base/...
#include <iostream> using namespace std; int main() { string sirch = "hello world"; cout<<sirch<<endl; string adresa = "home\\git_workspaces\\cp\\ex04"; cout<<adresa<<endl; string blank = " "; cout<<blank; return 0; }
#include <iostream> #include <sstream> #include <string> #include <algorithm> #include <vector> #include <set> #include <cstdio> #include <cstdlib> using namespace std; vector<string> values; bool checkPassport(const string& s){ set<string> fields({"byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid"});//, "cid"}); ...
const byte pwm_left = 6; const byte pwm_right = 5; void setup() { // put your setup code here, to run once: pinMode(31,OUTPUT); //IN1 from motor driver to 28th pin of arduino mega pinMode(33,OUTPUT); //IN2 from motor driver to 30th pin of arduino mega pinMode(35,OUTPUT); //IN3 from motor driver to 32nd pin of arduino...
// Wrapper class for infrared sensor. // The greater the distance value, the closer an object is to the sensor. // 1cm is equal to about 15 sensor units. class IRSensor { private: int Pin; const int MIN_DISTANCE = 200; const int MAX_DISTANCE = 300; public: void Init(int pin) { Pin = pin; } bool Ba...
template<int maxv> struct BridgesFinder { typedef UnweighedGraph<maxv, false> Graph; BridgesFinder(const Graph& _g) : g(_g) {} vector<pair<int, int>> findBridges() { for (int v = 0; v < maxv; ++v) if (!tin[v]) dfs(v, -1); return bridges; } private: void...
#include <iostream> using namespace std; double getAverage(int *dat,const int len) { double avg = 0; for(int i = 0;i<len;i++) { avg += *(dat+i); } avg /= len; return avg; } int main() { const int ARR_SIZE = 5; int balance[ARR_SIZE]= {1000,2,3,17,50}; double avg = 0; ...
// Created on : Sat May 02 12:41:15 2020 // Created by: Irina KRYLOVA // Generator: Express (EXPRESS -> CASCADE/XSTEP Translator) V3.0 // Copyright (c) Open CASCADE 2020 // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it un...
#include "stdafx.h" #include "CPortableDeviceManager.h" CPortableDeviceManager::CPortableDeviceManager() { } std::unique_ptr<CPortableDeviceManager> CPortableDeviceManager::GetCPortableDeviceManager() { std::unique_ptr<CPortableDeviceManager> pCPortableDeviceManager = std::unique_ptr<CPortable...
#pragma once typedef unsigned short MaterialHandle_t; class IMaterialSystem { public: IMaterial* CreateMaterial( bool flat, bool ignorez, bool wireframed ); IMaterial* FindMaterial( char const* pMaterialName, const char *pTextureGroupName, bool complain = true, const char *pComplainPrefix = NULL ); MaterialHandle_...
#ifndef APPLICATION_MESSAGESTATUS_H #define APPLICATION_MESSAGESTATUS_H #include <string> #include "BaseObject.h" #include "KeyWords.h" // Message status of reading class MessageStatus : public BaseObject { public: MessageStatus(); MessageStatus(int chatId); ~MessageStatus() override = default; // Ge...
#include <iostream> #include <fstream> #include <ross/ross.hpp> #include "../tools/ppm.hpp" void example_1(); void example_2(); void example_3(); void write_canvas_to_disk(const ross::canvas& canvas, const std::string& ascii_out_path); const ross::color_rgb magenta{ { 1.0, 0.0, 1.0 } }; const ross::color_rgb yellow{ ...
/* Name: һ����ֵ��� Copyright: Author: Hill bamboo Date: 2019/8/17 10:31:14 Description: ���� �˷���д�� */ #include <bits/stdc++.h> using namespace std; const int maxn = 10000 + 5; int feq[26]; int n; char str[maxn]; int main() { for (int i = 0; i < 26; ++i) { scanf("%d", &feq[i]); } scanf("%s", str); n = st...
/* @lc app=leetcode.cn id=23 lang=cpp * [23] 合并K个排序链表 */ // @lc code=start /** Definition for singly-linked list. */ #include<iostream> #include<vector> #include<queue> using namespace std; // struct ListNode { // int val; // ListNode *next; // ListNode(int x) : val(x), next(NULL) {} // }; class Solu...
#pragma once #include <Eigen/Dense> #include <limits> #include <solvers/qp.hpp> namespace sqp { template <typename T> class SQP; template <typename Scalar> struct sqp_settings_t { Scalar tau = 0.5; /**< line search iteration decrease, 0 < tau < 1 */ Scalar eta = 0.25; /**< line search parameter,...
#pragma once #include "Movable.h" #include "OMesh.h" #include "Light.h" //#include "AnimationState.h" #include <list> #include "PreDefine.h" namespace HW { class Camera; /** */ class Entity : public Movable { public: // never use this constructor. Entity():m_CastShadow(true){} Entity(const string &name,S...
/* -*- 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. */ #ifndef MODULES_PUBSUFFIX_MODULE_H #define MODULES_PUBSUFFIX_MODU...
#include "player.h" #include "videowidget.h" #include <QMediaService> #include <QMediaPlaylist> #include <QtWidgets> #include <windows.h> Player::Player(QWidget *parent) : QWidget(parent) { m_player = new QMediaPlayer(this); m_player->setAudioRole(QAudio::VideoRole); qInfo() << "Supported audio role...
#include<iostream> using namespace std; void riempi(int A1[10][5], int A2[10][5]); void cross(int A1[10][5],int A2[10][5],bool B[][5]); bool compareRowColumn(int A1[10][5],int A2[10][5],int rowA1,int columnA2); main(){ int A1[10][5],A2[10][5]; riempi(A1,A2); bool B[10][5]; cross(A1,A2,B); } //PRE = Gli array...
// // Created by litalfel@wincs.cs.bgu.ac.il on 14/01/2020. // #ifndef ASSIGNMENT3CLIENT_BOOK_H #define ASSIGNMENT3CLIENT_BOOK_H using namespace std; #include <string> class Book { private: string name; string topic; string owner; public: Book(string name, string topic, string owner); str...
#include"Anyinclude.h" #include"compman.h" #include"Collider.h" #include"ObjColli.h" #include"hitboxtest.h" #include"TextFont.h" #include"Menu.h" #include"PauseMenu.h" static const float VIEW_HEIGHT = 900.0f; static const float boxes = 512.0f; static const float boxes2 = 513.0f; static const float boxes2_2 = 229.5f; s...
#ifndef __GLUTIL_H__ #define __GLUTIL_H__ #include <glad/glad.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> //#define STB_IMAGE_IMPLEMENTATION #include <stb_image.h> #include <renderer/path.h> #include <math.h> #include <fstream>...
//#include <fstream> //#include <sstream> #include <bcm2835.h> #include "mcp4921.h" //using namespace std; mcp4921::mcp4921() { bcm2835_init(); bcm2835_spi_begin(); bcm2835_spi_setBitOrder(BCM2835_SPI_BIT_ORDER_MSBFIRST); // The default bcm2835_spi_setDataMode(BCM2835_SPI_MODE0); // The ...
#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> ...
// Created on: 1993-03-24 // Created by: JCV // Copyright (c) 1993-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 Gen...
#include <iostream> #include <fstream> #include "specex_linalg.h" #include "specex_legendre.h" #include "specex_message.h" #include "specex_fits.h" // for debugging //! base of (not-normalized) Legendre polynomials static double LegendrePol(const int Degree, const double &X) { switch (Degree) { case 0: retu...
#include "StdAfx.h" #include "Hide.h" namespace ui { Hide* Hide::Create() { return new (std::nothrow) Hide(); } Hide* Hide::Clone() const { return Hide::Create(); } InstantAction* Hide::Reverse() const { return Show::Create(); } void Hide::Update(float time) { InstantAction::Update(time); if (...
#ifndef __COLORUTILS_H__ #define __COLORUTILS_H__ static void RGBfromU32(const uint32_t in, uint8_t & R, uint8_t & G, uint8_t & B) { // TODO inline R = in; G = in >> 8; B = in >> 16; } static __inline__ uint32_t RGBtoU32(const uint8_t R, const uint8_t G, const uint8_t B) { uint32_t output = R; output |= G << 8; ...
#pragma once namespace q3bsp { enum eLumps { kEntities = 0, // Stores player/object positions, etc... kTextures, // Stores texture information kPlanes, // Stores the splitting planes kNodes, // Stores the BSP nodes kLeafs, // Stores the leafs of the nodes kLea...
#include <iostream> using namespace std; int MOD = 1000003; int SPRIME = 107; // correctly calculates a mod MOD even if a < 0 int mod(int a) { return (a % MOD + MOD) % MOD; } int whash(string pattern){ int h = 0; for(int i = 0, len = pattern.length(); i < len; i++){ h *= SPRIME; h += patte...
#pragma once #include "..\resource.hpp" #include "detail\texture_subresource.hpp" namespace leaves { namespace pipeline { struct texture_traits_base { static constexpr bool is_texture_1d() noexcept { return false; } static constexpr bool is_texture_2d() noexcept { return true; } static conste...
#include "DataAdmin.h" #include "LobbyLayer.h" DataAdmin* DataAdmin::_Instance = nullptr; DataAdmin::DataAdmin() { } DataAdmin::~DataAdmin() { } char * DataAdmin::ConvertWCtoC(WCHAR * str) { //반환할 char* 변수 선언 char* pStr; //입력받은 wchar_t 변수의 길이를 구함 int strSize = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0...
#include <iostream> #include "noteContainer.h" int main() { int k = 10; noteContainer cont; string name, lastName; int number, day, month, year, i; while (k != 0){ cout << "Меню: \n" << "0.Закрыть программу\n" << "1.Заполнить\n" << "2.Вывести...
#pragma once #include <memory> #include <vector> #include "UnionFind.h" class UnionFind { private: std::vector<int> id; int size; public: UnionFind(int size); bool Connected(int a, int b); void Union(int a, int b); int Find(int i); int NumSets(); };
/* * SignalingService.cpp * * Created on: 30/11/2019 * Author: frank */ #include "SignalingService.h" SignalingService::SignalingService(Led *ledTemp, Led *lamp, Buzzer *buzina, Delay *delay) { this->ledTemp = ledTemp; this->lampada = lamp; this->buzina = buzina; this->delay = delay; this->i = 0; } v...
#include bitsstdc++.h using namespace std; vectorstring split_string(string); void printReverse(vectorint arr) { int length = arr.size(); for (int i = 0; i length; i++) { cout arr[length - 1 - i] ; } } int main() { int n; cin n; cin.ignore(numeric_limitsstreamsizemax(), 'n'); ...
#include "Order.h"
#include <iostream> #include <sstream> #include <vector> #include <list> #include <queue> #include <algorithm> #include <iomanip> #include <map> #include <unordered_map> #include <string> #include <cstdio> #include <cstring> #include <climits> #include <set> using namespace std; int main() { string s, sub; getline...
/* Author: Mikko Finell * License: Public Domain */ #ifndef CASE_EVENTS #define CASE_EVENTS #include <functional> #include <SFML/Graphics.hpp> namespace CASE { inline void eventhandling(sf::RenderWindow & window, bool & running, bool & pause, bool & single_step, double & framerate, ...
#include <iostream> #include <stdio.h> #include <algorithm> #include <vector> using namespace std; typedef long long ll; struct cell { ll x, y; int id; cell(ll ax, ll ay, int aid = 0) : x(ax) , y(ay) , id(aid) {} bool operator <(const cell& A) const { return x < A...
/**************************************************************************** ** ** Copyright (C) 2010 Instituto Nokia de Tecnologia (INdT) ** ** This file is part of the Rask Browser project. ** ** This file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free So...
//知识点:LCA/树链剖分 /* 使用重链剖分进行LCA 详见注释 */ #include<cstdio> #include<ctype.h> #include<algorithm> //======================================================== const int MARX = 5e5+10; struct edge { int u,v,ne; }a[2*MARX]; int head[MARX]; int num,n,m,root; int s[MARX],dep[MARX],fa[MARX],son[MARX],c[MARX];//...
#include <cppunit/extensions/HelperMacros.h> #include <Poco/Exception.h> #include "cppunit/BetterAssert.h" #include "model/GlobalID.h" using namespace std; namespace BeeeOn { class GlobalIDTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(GlobalIDTest); CPPUNIT_TEST(testToBytes); CPPUNIT_TEST(testFromBytes...
// // Created by arnito on 4/06/17. // #include "Box.h" #include "../Resources.h" Box::Box(std::string texture,sf::Vector2f position, sf::Vector2i size, int frame, int id, int damage, int numFrames) : Entity(texture,position,size,frame,id,damage,numFrames){ _touched_floor = false; _reached_up = false; ...
#include <iostream> #include <vector> #include <string> #include <fstream> #include <math.h> #include <string> using namespace std; // Complete the candies function below. long candies(int n, vector<int> arr) { int sum = 0; int count = 1; if (arr[0] < arr[1]) { count = 2; } for (int i = 0; i < arr.size(); i...
#pragma once #include "funcoesAuxiliares.h" struct sitaucaoDoNo{ bool visitado=false; }; template <typename T> struct GrafoIndirecionado{ Matriz<T> *arestas; sitaucaoDoNo *statusDe; GrafoIndirecionado(int nNos){ arestas=new Matriz<T>(nNos); statusDe=new sitaucaoDoNo[nNos]; } ...
#include <cstdlib> #include <iostream> #include <memory> #include <utility> #include <boost/asio.hpp> #include <boost/filesystem.hpp> #include <ostream> #include <fstream> #include "json.hpp" #include "Base64.h" #include "utility.h" #include "session.h" #include "server.h" #include "rsa.h" #include <osrng.h> #includ...
/* -*- 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. */ /** @file stdlib_string.cpp String functions. Functions com...
//By SCJ #include<bits/stdc++.h> using namespace std; #define endl '\n' #define INF 0x3f3f3f3f #define maxn 10004 int a[maxn],dp[maxn],LIS1[maxn],LIS2[maxn]; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; while(cin>>n) { memset(dp,INF,sizeof(dp)); for(int i=0;i<n;++i) cin>>a[i]; int ma=0; for(int i...
#include "laboratorio.h" laboratorio::laboratorio(){ this->cont=0; } void laboratorio::capturar_final(const computadora &c){ if(cont<5){ this->arreglo[cont]=c; cont++; } else{ cout<<"Arreglo lleno"<<endl; } } void laboratorio::mostrar_elementos(){ cout<<left; cout<<setw(19)<<"Sistema Operativo"; cout<<s...
#include <iostream> #include <string> #include "Student.h" int main() { Student students[5]; students[0] = Student("Tom", 85); students[1] = Student("Alice", 71); students[2] = Student("Jack", 93); students[3] = Student("Mary", 65); students[4] = Student("Sue", 40); for(int i = 0; i < 5; i++){ stude...
#pragma once #include <string> #include <map> #if 0 namespace flex_typeclass_plugin { void setOutdir( const char outdir[]); } // namespace flex_typeclass_plugin #endif // 0
class PrintMinNumberSolver { public: string PrintMinNumber(vector<int> numbers) { if (numbers.size() == 0) return ""; vector<string> nums{}; for_each(numbers.begin(), numbers.end(), [&nums](int a) { nums.emplace_back(to_string(a)); }); sort(nums.begin(), nums.end(), [](string& a, string& b) { ret...
#include "consumermgr.h" #include "config.h" #include "bnlogif.h" #include <unistd.h> #include <sys/time.h> #include "producermgr.h" ConsumerMgr* ConsumerMgr::pConsumerMgr = new ConsumerMgr(); ConsumerMgr* ConsumerMgr::Instance() { return pConsumerMgr; } ConsumerMgr::ConsumerMgr() { } ConsumerMgr::~ConsumerMgr...
// Copyright (c) 2016 Agustin Berge // // 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/LICENSE_1_0.txt) #pragma once #include <pika/config.hpp> #include <pika/preprocessor/cat.hpp> #incl...
// chunk_manager.h #pragma once #include "math/vec3.h" #include "chunk.h" #include "world.h" #include "octree.h" #include <vector> using namespace leap::system; namespace leap { namespace world { class ChunkManager final { public: ChunkManager(); ~ChunkManager(); Rval init(); void new_terrain(); Ch...
/* * OtsuHand.hpp * * Created on: 2017年3月15日 * Author: lcy */ #ifndef OTSUHAND_HPP_ #define OTSUHAND_HPP_ #include <opencv2/opencv.hpp> class OtsuHand { public: OtsuHand() {} cv::Mat& start(cv::Mat &src); cv::Mat& justRGB(cv::Mat &src); private: void SkinRGB( cv::Mat &src); cv::Mat dst; }; #endif /*...
#ifndef _DRAWER_H_ #define _DRAWER_H_ #include "bmp.h" #include "misc.h" //************************************************************ // Interfejs dla metod rysujacych. class Drawer{ public: Drawer() : bitmap(nullptr) {} Drawer(JiMP2::BMP &bmp) : bitmap(&bmp) {} virtual ~Drawer(){ bitmap = nullptr; } virtual ...
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define FOR(i,n) for(ll i=0;i<n;i++) #define FOR1(i,n) for(ll i=1;i<n;i++) #define FORn1(i,n) for(ll i=1;i<=n;i++) #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define mod 1000000007; using namespace std; vector<ll> si...
#pragma once #include <iberbar/Gui/Widget.h> #include <iberbar/Gui/RenderElement.h> #include <iberbar/Utility/Xml/Base.h> #include <iberbar/Utility/Color.h> namespace iberbar { namespace Gui { struct UXmlParserContext; __iberbarGuiApi__ void XmlReadProc_Object( Xml::CNodeA* pXmlNode, CObject* pObject ); __...
#ifndef T_GEOMETRY_HPP #define T_GEOMETRY_HPP #include "../model.hpp" /* this is actually a bad design. I can either write public functions: makeCube, makeUVSphere, makeCylinder, makePyramid something like that */ class CubeModel : public Model { public: //this will give you a one-by-one cube CubeModel(const gl...
#include<bits/stdc++.h> using namespace std; const int maxn = 1e4+4; vector<int>g[maxn]; int f[maxn],n,m,a,b; bool visit[maxn][maxn]; void init(){ for(int i=1;i<=n;++i)f[i]=i; } int find(int x){ int root=x,j; while(root!=f[root])root=f[root]; while(x!=root){ j = f[x]; f[x]=root; ...
// HD-SEN0018 test #include <SoftwareSerial.h> const int PIN_SENSOR = 11; const int PIN_STATE = 10; const int PIN_RX = 2; const int PIN_TX = 3; SoftwareSerial serial(PIN_RX, PIN_TX); void setup() { Serial.begin(9600); serial.begin(9600); } void loop() { static int oldSensor = -1; int sensor = digitalRead(...
#ifndef CSUBSCRIBER_H #define CSUBSCRIBER_H #include "chandler.h" class CSubscriber { ros::NodeHandle nh; ros::NodeHandle nh_private; ros::Subscriber sub_cloud; ros::Subscriber sub_image; ros::Subscriber sub_transform; dynamic_reconfigure::Server<lidar_camera_offline_calibration::CalibrationCo...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4; -*- * * Copyright (C) 2007-2011 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(POSIX_SELECTOR_SELECT) || defined(POSIX_SELECTOR_SEL...
// // Created by 钟奇龙 on 2019-05-06. // #include <iostream> #include <vector> #include <string> using namespace std; bool isCross(string s1,string s2,string aim){ if(aim.size() != s1.size() + s2.size()) return false; vector<vector<bool>> dp(s1.size()+1,vector<bool> (s2.size()+1)); dp[0][0] = true; for(...
#ifndef __Calculator__ #define __Calculator__ #include <iostream> class Calculator { public: Calculator(); ~Calculator() = default; /* c++11 */ void SetNumbersAndSymbol(double x, double y, char ch); double ArithmeticOperations(); private: double m_x; double m_y; char m_symbol...
#include "../include/mvm0/parser.hh" #include "../include/mvm0/defs.hh" #include <cassert> #include <fstream> #include <sstream> namespace mvm0 { namespace { bool is_wspace(char c) { return c == ' ' || c == '\t' || c == '\n' || c == '\r'; } std::string str_trim(const std::string &str) { std::size_t bpos = 0; ...
#include "mini/RandomChance/randomchancetile.h" RandomChanceTile::RandomChanceTile(int number, bool unique, QWidget* parent) :QPushButton(parent) { this->number = number; this->unique = unique; } RandomChanceTile::~RandomChanceTile() { } bool RandomChanceTile::getUnique() { if(this->unique) ...
#include <stdio.h> //reindel john a. raņeses float max(float q,float w,float e,float r,float t) { float maximum; if(q>w && q>e && q>r && q>t) maximum=q; else if(w>q && w>e && w>r && w>t) maximum=w; else if(e>q && e>w && e>r && e>t) maximum=e; else if(r>q && r>w && r>e && r>t) maximum=r; e...
// This file was generated based on /usr/local/share/uno/Packages/Fuse.Controls.Navigation/1.3.1/Navigator.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.Object.h> namespace g{namespace Fuse{namespace Controls{struct Navigator__DeferSwitch;}}} namespace g{namespace Fu...
#include "shape_list.h" ShapeList::~ShapeList() { for (auto& obj : object_list) { delete obj; } } void ShapeList::add_object(Hitable* obj) { object_list.push_back(obj); } bool ShapeList::cast_ray(const Ray& r, float t_min, float t_max, HitDesc& d) { HitDesc temp_d; bool hit_object = false; double closest_obj...
#include <Arduino.h> //Test Routine Program - By Stezipoo #include <SoftPWMServo.h> //#include <Servo.h> //create servo objects //Servo steering; //Servo throttle; const int PIN_STR = 9; const int PIN_THR = 7; const int PIN_IN_STR = 13; const int PIN_IN_THR = 12; //Servo ServoSTR; //Servo ServoTHR; void setup() ...
#include "fhandle.h" int main() { FHandle f; while(true) { f.input(">> "); cout << endl << f(0) << endl << endl; } return 0; }
#include "Client.h" static inline QByteArray IntToArray(qint32 source); Client::Client(QObject *parent) : QObject(parent) { socket = new QTcpSocket(this); } bool Client::connectToHost(QString host) { socket->connectToHost(host, 1024); return socket->waitForConnected(); } bool Client::writeData(QByteArra...
#ifndef BASE_MANAGER_H #define BASE_MANAGER_H #include <deque> #include <mutex> #include <string> #include "BaseConfig.h" #include "Command.h" #include "Client.h" #include "Order.h" #include "Server.h" #include "inventory/InventoryManager.h" #include "State.h" #include "Update.h" class BaseManager { public: // C...
#include <bits/stdc++.h> using namespace std; typedef pair <int, int> dist_node; typedef pair <int, int> edge; const int MAXF=110; const int MAX = 510; const int INF = 1 << 30; int run, fire, inter; vector<int> station; vector<edge> g [MAX]; vector<edge> maxm; int d[MAX]; //distancias; int sta[MAX]; void connect(...
#include <Tanker/Admin/Admin.hpp> #include <Tanker/Crypto/Format/Format.hpp> #include <Tanker/Errors/Errc.hpp> #include <Tanker/Errors/Exception.hpp> #include <Tanker/Errors/ServerErrc.hpp> #include <Tanker/Log/Log.hpp> #include <Tanker/Network/AConnection.hpp> #include <Tanker/Serialization/Serialization.hpp> #includ...