text
stringlengths
8
6.88M
#pragma once namespace keng::window_system { class IWindowListener { public: virtual void OnWindowResize(int w, int h) = 0; virtual ~IWindowListener() = default; }; }
#include <cstdio> using namespace std; int a[110],b[110]; int main() { int n; scanf("%d",&n); for (int i=1;i<=n;i++) { scanf("%d",&a[i]); int temp=0; for (int j=1;j<i;j++) if (a[i]>a[j]) temp++; b[i]=temp; } for (int i=1;i<=n;i++) printf("%d ",b[i]); return 0; }
#include "myNode.h" myNode::myNode() { data = 0; next = nullptr; prev = nullptr; } myNode::myNode(int data) { this->data = data; this->next = nullptr; this->prev = nullptr; } void myNode::setData(int value) { if (value > 0) data = value; else return; } void myNode::setNext(myNode* next) { this->next = ne...
#include <csignal> #include <iostream> #include <stdio.h> #include <sys/time.h> #include <unistd.h> #include "LDR.h" using namespace std; double light; void timerHandler(int signum) { if(signum == 14) { light = readLight(); fprintf(stdout, "Light read from LDR sensor is: %.2f Lux\n", light); fflush(stdout);...
#pragma once #include "d3d11.h" #include "WinWrappers/ComPtr.h" #include "FwdDecl.h" #include "Keng/GPU/PipelineInput/ISampler.h" namespace keng::graphics::gpu { class Sampler : public core::RefCountImpl<ISampler> { public: Sampler(Device& device, const SamplerParameters& params); virtual ...
// Created on: 1993-02-03 // Created by: Christian CAILLET // 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 ...
/* Author: Mincheul Kang */ #include <harmonious_sampling/Scene.h> #include <tf/LinearMath/Quaternion.h> Scene::Scene(planning_scene::PlanningScenePtr& planning_scene, std::string frameID){ planning_scene_ = planning_scene; frameID_ = frameID; } void Scene::addCollisionObjects(){ std::vector<moveit_msgs:...
#ifndef _LogoutProcess_H_ #define _LogoutProcess_H_ #include "BaseProcess.h" class Table; class Player; class LogoutProcess:public BaseProcess { public: LogoutProcess(); virtual ~LogoutProcess(); virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* pPacket,Context* pt ) ; private: int sen...
#include "SocketsOps.h" #include <sys/types.h> #include <sys/socket.h> #include <unistd.h> #include <fcntl.h> #include <cassert> using SA = struct sockaddr; const SA* sockaddr_cast(const struct sockaddr_in* addr) { return static_cast<const SA*>(implicit_cast<const void*>(addr)); } SA* sockaddr_cast(struct sock...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #define INF 1000000000 #define REP(i,n) for(int i=0; i<n; i++) #define REP_R(i,n,m) for(int i=m; i<n; i++) #define MAX 100 using namespace std; i...
/* * Copyright (c) 2021 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_PROBES_SUS_H_ #define CPPSORT_PROBES_SUS_H_ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <functional> #include <iterator> #include <type_...
/* -*- mode: c++; tab-width: 4 -*- ** ** Copyright (C) 2009 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Test for reading input data into native objects. ** ** Jan Borsodi */ group "protobuf.protocolbuffer_input"...
#ifndef StartState_H #define StartState_H #include<Ogre.h> #include "GameState.h" class StartState: public GameState { public: void enter(); void exit(); void pause(); void resume(); bool frameStarted(GameManager* game, const Ogre::FrameEvent& evt); bool frameEnded(GameManager* game, const Ogre::FrameEvent& e...
#include<iostream> #include<cmath> #include<vector> using namespace std; int main() { int i,j,k,N=1000,cnt=0,numerator,denomentor,ou; long double p0,p1,pn,q0,q1,qn,ans=0.0; vector<int>p; for(i=2;i<=N;i++) { p.clear(); j=(int)sqrt(i); if(j*j==i) continue; ...
// Created on: 1993-02-05 // Created by: Jacques GOUSSARD // 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 G...
#pragma once #include <iberbar/Utility/Platform.h> #include <iberbar/Utility/Result.h> namespace iberbar { namespace OS { enum class EDpiAwareness { Unaware, System }; class __iberbarUtilityApi__ CDpiHelper { public: CDpiHelper(); CResult SetAwareness( EDpiAwareness awareness ); EDpiAwa...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> #include<ctime> #define INF 0x3f3f3f3f #define eps 1e-8 #define pi acos(-1.0) using namespace std; ty...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "GameFramework/GameModeBase.h" #include "MemoryMatrixProvaGameModeBase.generated.h" /** * */ UCLASS() class MEMORYMATRIXPROVA_API AMemoryMatrixProvaGameModeBase : public AGameModeBase { GENERATED_BODY() public:...
#include <LoRaTxRx.h> /* 資料來源 https://www.youtube.com/watch?v=vTSLijvnVxg 輸出要接在 pin 2 */ int i = 0; // used if calculations are made int ax = 0; // hundreds .... sadat int bx = 0; // tens ... kymmenet int cx = 0; // ones ... ykköset int dx = 0; int ex = 190; int top = 0; int mov = 0; int ix = 0; int kx = 0; int r...
// // Created by manout on 18-3-27. // #include <cstdio> #include <iostream> #include <vector> #include <algorithm> using namespace std; int n; int w; int count_ = 1; vector<int> snacks; void bag(int w, int i) { //sort(snacks.begin(), snacks.end()); //vector<vector<int>> mat(snacks.size() + 1, vector<int>(...
#include "Week.h" #include <string> Week::Week(string date) {//might need to check that the substr is correct this->date = date; int mon = stoi(date.substr(3, 1)); int daysInMonth = 1; if (mon == 04 || mon == 06 || mon == 9 || mon == 11) { daysInMonth = 30; } else if (mon == 02) { int year = stoi(...
#ifndef PAD_H #define PAD_H #include "bloco.h" class Bloco; class Pad { private: Bloco *pad; Vertice vertices_elipse[15]; double centro_x, centro_y, raio_x, raio_y, valor_tamanho_profundidade, valor_tamanho_altura, valor_tamanho_base; int num_segmentos; void monta_elipses(); public: /// CONSTR...
////////////////////////////////////////////////////////////////////////////// // // Copyright (c) Triad National Security, LLC. This file is part of the // Tusas code (LA-CC-17-001) and is subject to the revised BSD license terms // in the LICENSE file found in the top-level directory of this distribution. // ////...
#pragma once #include "GameNode.h" #include "IsoTile.h" class SubIsoMap : public GameNode { private: bool isDebug; int currentTile; RECT rc[TILE_SIZE_X][TILE_SIZE_Y]; int frameX, frameY; public: SubIsoMap(); ~SubIsoMap(); HRESULT Init(); void Release(); void Update(); void Render(HDC hdc); };
#include "pch.h" #include "CppUnitTest.h" #include "../laba6.1.2/Source.cpp" using namespace Microsoft::VisualStudio::CppUnitTestFramework; namespace Test612 { TEST_CLASS(Test612) { public: TEST_METHOD(TestMethod1) { int c; int a[20]{ 9,- 20, - 20, 21, 7, - 12, 8, - 18, - 8, 32, 37, 18, - 14,...
#ifndef ETW_CONFIG_EXPRESSION_INTERFACE_H_ #define ETW_CONFIG_EXPRESSION_INTERFACE_H_ #include "ConfigurationInterface.h" #include "OptionInterface.h" namespace etw { class ExpressionInterface { public: int getResult(ConfigurationInterface *cfg, OptionInterface **op); }; } #endif
#include <GL/glut.h> #include "Posizione.h" Posizione::Posizione() { } Posizione::Posizione(double x1, double y1, double z1) { x = x1; y = y1; z = z1; } double Posizione::getX() { return x; } double Posizione::getY() { return y; } double Posizione::getZ() { return z; } void Posi...
class Solution { public: string removeKdigits(string num, int k) { int n = num.size(); if( n<= k ) { return "0"; } while(k) { int i = 0; // for finding the peaks. while(i+1<n && num[i+1]>=num[i]) i++; ...
/* --- This file is distributed under the MIT Open Source License, as detailed in "LICENSE.TXT" in the root of this repository --- */ #ifndef HURCHALLA_PROGRAMMING_BY_CONTRACT_H_INCLUDED #define HURCHALLA_PROGRAMMING_BY_CONTRACT_H_INCLUDED /* These are the main contract assertion macros: HPBC_PRECONDIT...
/* * @Description: 一些文件读写的方法 * @Author: Ren Qian * @Date: 2020-02-24 20:09:32 */ #include "lidar_localization/tools/file_manager.hpp" #include <boost/filesystem.hpp> #include "glog/logging.h" namespace lidar_localization { bool FileManager::CreateFile(std::ofstream& ofs, std::string file_path) { ofs.close(); ...
#include <bits/stdc++.h> using namespace std; // Complete the counterGame function below. bool isPowerOfTwo (long x) { return x && (!(x&(x-1))); } int inverse(int x) { if(x==0) return 1; else return 0; } long highestPowerof2(long n) { long p = (long)log2(n); return (long)pow(2, p); ...
// // nehe30.h // NeheGL // // Created by Andong Li on 10/10/13. // Copyright (c) 2013 Andong Li. All rights reserved. // #ifndef __NeheGL__nehe30__ #define __NeheGL__nehe30__ #include <iostream> #endif /* defined(__NeheGL__nehe30__) */
#include <windows.h> #include <iostream> using namespace std; int main () { SetConsoleTitle("Cit Root Chopper"); string choice; int x; int y; int run; int done = 0; start: cout << "Cit Root Chopper" ; cout << endl << "Version 1.0" << endl; cout << endl << ...
// // Tableau.cpp // Puissance 4 // // Created by Glorian on 12/02/2016. // Copyright (c) 2016 Glorian . All rights reserved. // #include "Tableau.h" using namespace std; Tableau::Tableau(int taille, int p){ puissance = p; x = taille; this->array = new char*[x]; for(int i = 0; i <= x; i++) ...
#include<iostream> #include<vector> #include<algorithm> using namespace std; struct ListNode { int val; ListNode* next; ListNode(int x) : val(x), next(NULL) {} }; void Init_ListNode(ListNode* head, vector<int> vec) { if (vec.size() == 0) { head = NULL; return; } ListNode* p; p = head; p->val = vec[0]; for...
#include "deathEvent.h" deathEvent::deathEvent(GameObject a, GameObject b) { this->a = a; this->b = b; } GameObject deathEvent::getObjA() { return a; } GameObject deathEvent::getObjB() { return b; } eventType deathEvent::getType() { return deathEvent_type; } char deathEvent::getKeyPress() ...
#include <bits/stdc++.h> using namespace std; int main() { int t,a; scanf("%d",&t); while(t--){ scanf("%d",&a); a=(a*567)/9; a=(a+7492)*235; a=(a/47)-498; a=a%100; a=a/10; if(a<0) a=a*-1; cout<<a<<endl; } return 0; }
#include <iostream> #include <fstream> #include <bits/stdc++.h> using namespace std; // class for AVL node class AVL_Node { private: int key; int bf; // balance factor bf = height(left subtree) – height(right subtree) AVL_Node *LChild, *RChild; friend class AVL_Tree; public: // parameterized constructor ...
// Created on: 2014-09-01 // Created by: Ivan SAZONOV // Copyright (c) 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 as publi...
#ifndef LOSS_FUNCTION_H_ #define LOSS_FUNCTION_H_ #include "Layer.h" class Loss_function: public Layer { public: Loss_function(); virtual ~Loss_function(); virtual void forward(MatrixXd act_p, MatrixXd label); protected: virtual MatrixXd act_func(MatrixXd stat, MatrixXd label)=0; virtual MatrixXd act_func_g(Mat...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** 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. ** */ #ifndef __DESKTOPNOTIFIER_H__ # de...
// Created on: 1994-03-18 // 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...
#include <stack> #include <string> #include <iostream> using namespace std; int operation(string &S, std::stack<int> &nums, string &word, int i){ int top_element; int num1, num2; if (i == S.size() || S.at(i) == ' '){ if (word == "DUP"){ // push the top of stack if (nums.size()>0){ top_element = ...
#include "AIControoller.h"
#include "gtest/gtest.h" #include "Student.hpp" constexpr char STUDENT_NAME[] = "Anna"; constexpr char STUDENT_SURNAME[] = "Nowak"; constexpr char STUDENT_ADDRESS[] = "Wroclaw"; constexpr char STUDENT_INDEX_NUMBER[] = "123456"; constexpr char STUDENT_PERSONAL_IDENTITY_NUMBER[] = "95012600149"; constexpr char STUDENT_G...
#include "logind.hpp" #include "log.hpp" #include "utils/service_thread.hpp" #include "utils/time_utils.hpp" #include "utils/process_utils.hpp" #include "config/utils.hpp" #include "config/options_ptts.hpp" #include <signal.h> using namespace nora; int main(int argc, char **argv) { srand(time(0)); PT...
#pragma once #include "Behaviour.h" #include "State.h" class Transition; class Condition; class FiniteStateMachine : public Behaviour { public: FiniteStateMachine() : m_currentState(nullptr) {} FiniteStateMachine(State* state) : m_currentState(state) {} virtual ~FiniteStateMachine() { for (auto state : m_stat...
/** Author: Elliott Waterman Date: 08/01/2019 Description: Program to use an alarm on the RTC module to wake a sleeping Arduino via an interrupt. */ /* INCLUDES */ #include <avr/sleep.h> //AVR library contains methods and sleep modes to control the sleep of an Arduino #include <SPI.h> //SPI library...
#include <iostream> struct Matrix { double matrix[100][100]; int M; }; void read(Matrix& a) { do { std::cout << "Enter M: "; std::cin >> a.M; if (std::cin) { std::cin.clear(); std::cin.ignore(32767, '\n'); } } while (a.M <= 0 || a.M > 100); std::cout << "Enter the matrix: \n"; for (int i = 0;...
//Kris Li and William Easterby /* hashTable.h Implementation of templated hash table */ #ifndef HASH_TABLE_H #define HASH_TABLE_H #include <cstdlib> #include <vector> #include <string> #include <math.h> using namespace std; template<class ItemType, int TABLESIZE> class HASH_TABLE { public: HASH_TABLE(); ~...
#pragma once #include <stddef.h> #include <stdint.h> #include <type_traits> #include <limits.h> #include "Config.hpp" #if defined(_MSC_VER) #include <intrin.h> namespace accel { // // Begin ByteSwap // template<typename __IntegerType> __IntegerType ByteSwap(__IntegerType x) noexcept { s...
#pragma once #include <vector> #include <string> #include <memory> #include "rttr/type.h" namespace studio { class Node; using NodePtr = std::shared_ptr<Node>; class Node { public: Node(const std::string &_name, rttr::type t) : name(_name), type(t){} void addChild(NodePtr node) { node->parent = this; childre...
#include <bits/stdc++.h> using namespace std; struct Dir { string name; map<string, Dir *> subDir; }; void print_directories(Dir *disk, string space_char) { cout << space_char << disk->name << '\n'; space_char += " "; for (auto &it : disk->subDir) { print_directories(it.second, space_char); ...
#include <iostream> #include <cstring> #include "cipher.hpp" #include "cgilib.hpp" #include "freqan.hpp" #include "hypertext.hpp" void readData(); void errMsg(); int main() { char card[257]; std::string cipher, flag, keystr; readQueryString(card); std::cout << "Content-Type: text/html; charset=utf-8\n\n"...
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional>...
#ifndef STARTMENUER_H #define STARTMENUER_H #include <QObject> #include <QGraphicsScene> #include <QPushButton> #include<QGraphicsView> #include"score.h" class StartMenueR : public QObject { Q_OBJECT public: StartMenueR(QObject *parent=0); QGraphicsView *v = new QGraphicsView(); Score *...
#define _CRT_SECURE_NO_WARNINGS #include "vector3f.h" using namespace std; #define ESCAPE '\033' #define DELETE '\010' unsigned char* image1; int J = 0, JL = 0; int Width = 700, Height = 700; double t_min = 1, t_max = 1e+25; double tetta = 120; double N = 1; double Aspect = (double)Width / Height; double H = N * t...
#include <iostream> using namespace std; int main() { /*Initialization*/ char type = 0, initial_1 = 0, final_1 = 0; int initial_2 = 0, final_2 = 0; cout << "Welcome to Chess Mania!!!!\n\n"; //Taking input from the user cout << "Enter the type of your piece\n" << "Enter P for Pawn, K for King, Q for Queen,...
#include "engine/GameEngine.hpp" #include "game/Player.hpp" #include "game/GameMessage.hpp" GameEngine::GameEngine(int c_or_s){ camera = new SDL_Rect(); camera->x = 0; camera->y = 0; camera->w = CAMERA_WIDTH; camera->h = CAMERA_HEIGHT; pauseMode = new PauseMode(); homeMode = new HomeMode() ; gMode = homeMode; ...
#include "triangolo.h" double triangolo::numeroFisso = 0.289 ; double triangolo::getfisso() const{ return numeroFisso; } /* CALCOLO DISTANZA TRA I PUNTI TRA 1-2 1-3 2-3 */ double triangolo::perimetro() const{ double per = 0 ; per = per + pt[0]->distanceTwoPoints(*pt[1]) + pt[0]->distanceTwoPoints(*pt[2])...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2009 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/url/tools/arrays.h" voi...
#ifndef MASTERS_PROJECT_BLACKSCHOLESDISCRETEDIVPUT_H #define MASTERS_PROJECT_BLACKSCHOLESDISCRETEDIVPUT_H #include "../BlackScholesMertonPut.hpp" #include "../../binomial_method/method/dividend/Dividend.hpp" #include "DiscreteDividend.h" class BlackScholesDiscreteDivPut: public BlackScholesMertonPut { public: Bl...
// // Created by goturak on 21/02/19. // #ifndef POO2_MATRIX_H #define POO2_MATRIX_H #include <ostream> #include "Operation.hpp" class Matrix { public: int **getElements() const; int getWidth() const; int getHeight() const; int getModulo() const; void setElement(int x, int y, int value); ...
// // Created by sunlin on 2020-10-11 // #ifndef KALMAN_H_ #define KALMAN_H_ #include "opencv2/video/tracking.hpp" //#include "opencv2/highgui/highgui.hpp" //#include <stdio.h> //#include <stdlib.h> //#include <string.h> //#include <iostream> class Kalman{ private: const int stateNum=4; ...
//__BEGIN_LICENSE__ // Copyright (c) 2017, United States Government, as represented by the // Administrator of the National Aeronautics and Space Administration. // All rights reserved. // // The GeoRef platform is licensed under the Apache License, Version 2.0 // (the "License"); you may not use this file except in co...
#ifndef MarchingCubes_HPP #define MarchingCubes_HPP #include "OgreFramework.h" #include "UberCube.h" #include "MarchingCubesTable.h" #include "BooleanVoxel.h" struct Voxel { bool _vertex0; bool _vertex1; bool _vertex2; bool _vertex3; bool _vertex4; bool _vertex5; bool _vertex6; bool _vertex7; Voxel(bool ve...
/** * @file sum_of_squares_variable.cc * @author Gerbrand De Laender * @date 18/02/2021 * @version 1.0 * * @brief E091103, Master thesis, HLS testing * * @section DESCRIPTION * * IP that calculates the sum of the squares of an incoming AXI stream. * */ #include <stdint.h> #include <hls_strea...
#include<iostream> #include<vector> #include<algorithm> using namespace std; struct ListNode { int val; ListNode* next; ListNode(int x) : val(x), next(NULL) {} }; void Init_ListNode(ListNode* head, vector<int> vec) { if (vec.size() == 0) { head = NULL; return; } ListNode* p; p = head; p->val = vec[0]; for...
#ifndef __IM_WINDOW_MANAGER_DX11_H__ #define __IM_WINDOW_MANAGER_DX11_H__ #include "../ImWindow/ImwConfig.h" #include "../ImWindow/ImwWindowManager.h" namespace ImWindow { class ImwWindowManagerDX11 : public ImwWindowManager { public: ImwWindowManagerDX11(); virtual ~ImwWindowManagerDX11(); protected:...
#include <iostream> #include <algorithm> #include <sstream> #include <fstream> #include <torch/torch.h> #include <torch/ordered_dict.h> #include <torch/nn/modules/conv.h> #include "Cifar10DataSetParser.hpp" namespace TDD = torch::data::datasets; struct ReLu: torch::nn::Module { ReLu() {} torch::Tensor forward(...
// Created on: 1995-03-08 // Created by: Laurent BUCHARD // Copyright (c) 1995-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...
#include "stdafx.h" int main() { srand((unsigned)time(NULL)); removeCursor(); system("mode con cols=56 lines=30"); Tetris *T = new Tetris(); T->title(); while (1) { for (int i = 0; i < 5; i++) { // 최대 5회의 키 입력 T->keyCheck(); T->drawGameboard(); Sleep(T->getSpeed()); if (T->getEvent(...
#ifndef TO_LOWER_HPP #define TO_LOWER_HPP #include <algorithm> #include <string> namespace String { static std::string toLower(std::string& str) { std::transform( str.begin(), str.end(), str.begin(), [](unsigned char c) { retu...
#include "stdafx.h" #include "StubDataProcessor.h" #include <iostream> #include "VehicleData.h" #include "CppUnitTest.h" using std::unique_ptr; using std::shared_ptr; using std::move; using namespace Microsoft::VisualStudio::CppUnitTestFramework; StubDataProcessor::StubDataProcessor() { } StubDataProcessor::~StubDa...
#pragma once #include "core/maths.h" #include "core/core.h" class Metaballs { public: struct Ball { Point3 m_pos; float m_radius; }; Metaballs(const Ball* balls, uint32_t n) { m_numBalls = n; m_balls = new Ball[n]; memcpy(m_balls, balls, sizeof(Ball)*n); // calculate the sum of the radii used to...
#include "adaptivecanny.h" adaptivecanny::adaptivecanny() { }
#include <bits/stdc++.h> using namespace std; using namespace std::chrono; typedef long long int ll; using ii= pair<ll,ll>; #define fr(i,a,b) for(ll i=a;i<b;i++) #define all(o) (o).begin(),(o).end() #define F first #define S second #define MP make_pair #define PB push_back #define ld long double #define eps 0.00000000...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * @author Adam Minchinton */ #include "core/pch.h" #ifdef USE_COMMON_RESOURCES #inc...
#include <iostream> #include <string> using namespace std; class timeFM { }; int main() { char done = 'y'; while (done == 'y') { try { int hours = 0; string min; char useless =0; cout << "Enter time in 24-hour notation:\n"; cin >> hours >> useless >> min; int newHours = 0; string newMin; strin...
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { srand (time(NULL)); int x; x = rand() %7; cout << x; x = rand() %5; cout << x; x = rand() %7; cout << x; x = rand() %5; cout << x; x = rand() %7; cout << x; x = rand() %5; cout << x; x = rand() %7; cout << x;...
#include <iostream> #include <string> using namespace std; int numDivisors(long long n) { int num = 1; for (long long i = 2; i <= n; i++) { if ( n % i == 0 ) { num++; } } return num; } int main() { long long count = 3; long long num = 3; int divs; bool ex[4] = {false, false, false, false}; while(tru...
#include "Sprite.h" #include "ImageManager.h" namespace WGF { Sprite::Sprite() : mFilename("") { //ctor } Sprite::~Sprite() { //dtor if(mFilename != "") { ImageManager::GetSingleton().Unload(mFilename); } } Sprite::Sprite(const...
// // Created by peto184 on 09-Dec-17. // #ifndef PPGSO_OBJECT_H #define PPGSO_OBJECT_H #include <glm/vec3.hpp> #include <glm/detail/type_mat.hpp> #include <glm/detail/type_mat4x4.hpp> #include "src/playground/constants.h" class Scene; class Object { public: Object() = default; glm::vec3 mPosition; glm...
#include "stdafx.h" #include "SkinModelDummy.h" SkinModelDummy::SkinModelDummy() { } SkinModelDummy::~SkinModelDummy() { } bool SkinModelDummy::Start() { return true; } void SkinModelDummy::Update() { m_model.UpdateWorldMatrix(m_pos, m_rot, CVector3::One()); } void SkinModelDummy::Render() { } void SkinMod...
#include <iostream> #include <string.h> #include <cjxml/cjson.h> int main() { void * writer = json_create_writer(); json_append_double(writer, "key1", 1.425); json_append_int(writer, "key2", 7); json_append_string(writer, "key3", "hello world!"); int vals[10]; for(int i = 0; i < 10; i++) vals...
/** * Unidad 3: LightBuzzer o Buzz Lightyear * * Hacemos sonar un altavoz piezoeléctrico (buzzer) * con un LDR (Light Dependant Resistor) usando * la configuración de un divisor de tensión. */ const byte pinBuzzer = 10; const byte pinBoton = 2; void setup() { pinMode(pinBuzzer, OUTPUT); pinMode(pinBo...
#pragma once #include "datablock.h" namespace trevi { class SourceBlock : public trevi::DataBlock { public: // From payload SourceBlock( uint8_t* payloadBuffer, int payloadSize ); // From Raw Buffer SourceBlock( int bufferSize, uint8_t* rawBuffer ); virtual ~SourceBlock(); virtual uint16_t ...
/* * @author: aaditkamat * @date: 28/12/2018 */ #include <iostream> using namespace std; bool can_replace_a_character(string str1, string str2) { if (str1.size() != str2.size()) { return false; } int change = 0; for (int i = 0; i < str1.size(); i++) { if (str1[i] != str2[i]) { change++; } } re...
#include "MappingScreenTapListener.hpp" #include "LeftMouseButtonEvent.hpp" using namespace Leap; void MappingScreenTapListener::onScreenTap(const ScreenTapGesture& screenTap) { LeftMouseButtonEvent event; event.trigger(); }
#include "GameObject.h" #include "GameState.h" #include "sdlwrap.h" #include <SDL_events.h> #include <SDL_render.h> Player::Player(int x, int y) : _x(x), _y(y) { _hp = Player::defaultHp(); _weapons[WEAPON_PISTOL].reset(new Pistol()); _weapons[WEAPON_SHOTGUN].reset(new Shotgun()); _weapons[WEAPON_U...
/* Name: �������еĵ�nλ��ֵ Copyright: Author: Hill bamboo Date: 2019/8/15 18:26:55 Description: ��� */ #include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); int k = 0; int sum; do { sum = (k + 1) * k / 2; ++k; } while (sum < n); // int ans = 1; // while (ans * (ans + 1) / 2 ...
// Copyright (c) 2011-2016 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #pragma once namespace CryptoNote { const static boost::uuids::uuid CRYPTONOTE_NETWORK = { { 0x17, 0x15, 0x62, 0x97, 0x1...
#include <cmath> #include <list> #include <Poco/Exception.h> #include <Poco/Path.h> #include <Poco/StringTokenizer.h> #include <Poco/Dynamic/Var.h> #include "di/DependencyInjector.h" #include "math/SimpleCalc.h" #include "util/ClassInfo.h" #include "math/LogicalExpression.h" #include "util/MultiException.h" #include ...
#ifndef __SETESTAPP1_H__ #define __SETESTAPP1_H__ #include <se.h> class SETestApp1 : public SEApplication<GLfloat> { public: SETestApp1(); virtual ~SETestApp1() {} virtual void init(int argc, char **argv); virtual void update(); virtual void run(); virtual void quit(); vir...
#include "_pch.h" #include "whPGFileLinkProperty.h" /// BtnStringEditor class PGFileLinkEditor : public wxPGTextCtrlEditor { public: DECLARE_DYNAMIC_CLASS(PGFileLinkEditor) typedef std::function<bool(wxPGProperty*)> OnBtnFunc; PGFileLinkEditor(){} virtual ~PGFileLinkEditor() {} virtual wxPGWindowList CreateCo...
#include <Rigidbody.h> #include <iostream> using namespace NoHope; Rigidbody::Rigidbody(b2World *world, Vec2 position, float angle, Vec2 size, bool fixedRotation, bool staticBody) :m_world(world) { Init(position, angle, size, fixedRotation, staticBody); } Rigidbody::~Rigidbody() { m_world->DestroyBody(body); ...
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> const int maxn = 1e6 + 7; int id, ch[maxn][30], cnt[maxn]; char str[15]; void Insert(char *s) { int rt = 0; int len = strlen(s); for(int i = 0; i < len; i++) { if(!ch[rt][s[i]-'a'...
#include <iostream> #include <vector> #include "StrongDataTypes.h" #include "Utils.h" using namespace std; using namespace utils; int main() { // simple integer container std::vector<int> nativeTypeCollection {1, 4, 5, 3, 6, 8, 9, 0, 2, 7}; // custom class type container std::vector<Integer> userDefi...
#pragma once #include <string> #include <iostream> #include <fstream> #include "json.hpp" using json = nlohmann::json; class Configuration { public: Configuration(std::string fname); ~Configuration(); template <class T> T Get(std::string name) { return j[name.c_str()]; } void Reloa...
// Helena Ruiz Ramirez (A01282531) , Gilberto Alejandro Castillo Perez (A00821306) // 12/marzo/2018 // Proyecto 2: Fecha header #ifndef Fecha_h #define Fecha_h using namespace std; class Fecha{ private: int dia; int mes; int anio; public: // Constructores Fecha(); Fecha(int,int,int); // ...