text
stringlengths
8
6.88M
#ifndef __BALL__ #define __BALL__ #include "Texture.h" #include "Drawable.h" #include <math.h> #define BALL_IMG_PATH "imgs/ball.png" class Ball : public Drawable { public: Ball(SDL_Renderer*); ~Ball(); void setSpeedX(); virtual void update(); float getX(); float getY(); float getNextPositionX(); float getNext...
// Storage.h: interface for the CStorage class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_STORAGE_H__B71D1162_71FB_4175_B23D_5BBFE1519F14__INCLUDED_) #define AFX_STORAGE_H__B71D1162_71FB_4175_B23D_5BBFE1519F14__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif...
#include <iostream> #include <vector> #include <map> #include <string> #include <bitset> #include <queue> #include <algorithm> #include <functional> #include <cmath> using namespace std; class CheatingQuiz { public: vector <int> howMany(string answers) { vector<int> ans(answers.size()); vector<char> stock; in...
#ifndef GameState_H #define GameState_H #include <Ogre.h> #include "GameManager.h" class GameState { public: virtual void enter() = 0; virtual void exit() = 0; virtual void pause() = 0; virtual void resume() = 0; virtual bool frameStarted(GameManager* game, const Ogre::FrameEvent& evt) = 0; virtual bool frame...
#include "mainwindow.h" #include "ui_mainwindow.h" //#include <QDebug> bool user_typing; double firstnum; MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ui->label->setText("0"); //numbers; connect(ui->number0,SIGNAL(released()),this,S...
// // FootSwitchActuator.cpp // // // Created by Markus Buhl on 15.11.18. // #include "FootSwitchActuator.hpp" int FootSwitchActuator::lastID = 0;
#include "../include/StdAfx.h" #include "../include/configure.h" #include <Sketch.h> #include <RelativeCoord.h> #include <EllipsoidES.h> #include <Canvas.h> /** * Визуальное тестирование для 'shape'. */ int main( int argc, char** argv ) { setlocale( LC_ALL, "Russian" ); // Для разделителя '.' вместо ',' ...
// // Collector.h // Dev // // Created by Taylor Holliday on 6/14/13. // #ifndef __Dev__Collector__ #define __Dev__Collector__ #include <set> #include <vector> #include <boost/lockfree/queue.hpp> #include <boost/thread.hpp> #include <boost/thread/tss.hpp> // Derive from Collectable if you'd like an object // to b...
/* * grupo.h * * Created on: Apr 19, 2018 * Author: adesl */ #include <vector> #include <pthread.h> #include <iostream> #include "becario.h" #ifndef GRUPO_H_ #define GRUPO_H_ class Grupo { private: std::vector<Becario*> becarios; std::vector<pthread_t> becariosHilos; int rc; pthread_m...
#include <bits/stdc++.h> using namespace std; int sum(int n){ int s=0; if(n==0) return s; else{ s=s+n%10+sum(n/10); } return s; } int main(){ int n; cin>>n; cout<<sum(n); return 0; }
//Nike likes playing cards and makes a problem of it. // //Now give you n integers, ai(1≤i≤n)ai(1≤i≤n) // //We define two identical numbers (eg: 2,22,2) a Duizi, //and three consecutive positive integers (eg: 2,3,42,3,4) a Shunzi. // //Now you want to use these integers to form Shunzi and Duizi as many as possible. // ...
/* moveniu 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. moveniu is distributed in the hope that it will be useful, but WITHOUT ANY ...
#include "MultiplayerMinMax.h" #include <cstdio> #include <vector> State::State() { } State::~State() { } Result::Result(int players) : scores_(players, 0.0) { } Result::~Result() { } void MultiplayerMinMax::FindBestMove(State *initial_state, vector<int> *best_move, ...
/**************************************************************** * TianGong RenderLab * * Copyright (c) Gaiyitp9. All rights reserved. * * This code is licensed under the MIT License (MIT). * *****************************************************************/ #pragma once namespace TG::Math { template...
#include <iostream> #include <vector> #include <cstring> #include <algorithm> int n, list[5000], memo[5000]; int solve(int now) { int &ret = memo[now]; if(ret != -1) { return ret; } ret = 1; for(int next = now + 1; next < n; next++) { if((list[next] % list[now]) == 0) ...
#include "stdafx.h" #include "QuestionWithChoices.h" namespace qp { using namespace std; CGradedChoices::CGradedChoices(const std::initializer_list<GradedChoice> & choices) :m_choices(choices) { } size_t CGradedChoices::GetChoiceCount() const { return m_choices.size(); } void CGradedChoices::Add...
//=========================================================================== /* This file is part of the CHAI 3D visualization and haptics libraries. Copyright (C) 2003-2004 by CHAI 3D. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms o...
#include "stdafx.h" #include "log.h" #include "ComBSTR2.h" #include <stdio.h> #include <time.h> // #ifdef _ISFREEEXE #include "../../component/wodSSHDCom.h" #include "../../component/SSHKeyPair.h" #include "../../component/SSHUsers.h" #endif // void GetHostname(char *ip, char *hostname); void GetTimest...
#include <iostream> #include <string> using namespace std; class EasyConversionMachine { public: string isItPossible(string originalWord, string finalWord, int k) { int diff = 0; for (int i=0; i<originalWord.size(); ++i) { if (originalWord.at(i) != finalWord.at(i)) { ++diff; } } if (k-diff<0) { ...
#include <iostream> #include <cstdlib> int drawLetter(char** &arr, char symbol) { srand(time(0)); int length = 0; do { length = rand() % 30 + 11; } while (length % 2 != 1); int j = length / 2; arr = new char*[length]; for (int i = 0; i < length; ++i) { arr[i] = new cha...
#pragma once #include <PA9.h> #include "Cell.h" #include "LIBPATH.h" #include LIB(UnitBase.h) #include LIB(Team.h) #include LIB(UnitSpriteData.h) #define MAX_BLOBS 50 enum BLOB_STATE{ INACTIVE, CREATION, TRAVEL, COLLISION, DESTINATION }; class Blob : public UnitBase{ private: static...
#pragma once #include "ofMain.h" class ofApp : public ofBaseApp { public: // -------------------------------- void setup() { fontSmall.loadFont("Fonts/DIN.otf", 8 ); } // -------------------------------- void draw() { ofBackgroundGradient( ofColor(55), ofColor(0), OF_GRADIENT_CIRCULAR ); ...
#include "LinkStack.h" template<typename T> LinkStack<T>::LinkStack() :top_(nullptr), count_(0) { } template<typename T> LinkStack<T>::~LinkStack() { Node<T>* p = nullptr; while (top_) { p = top_; top_ = top_->next; delete p; } /* Node<T>* p = nullptr; for (int i = 0; i != count_; ++i) ...
#include "RocketMQManager.h" #include "MPLogger.h" RocketMQManager::RocketMQManager() : ManagerModule(eStatsMgr_RocketMQ) { } RocketMQManager::~RocketMQManager() { } bool RocketMQManager::Awake() { RocketMQProducer* pProducer = new RocketMQSyncProducer("test_group_name"); m_mProducers.emplace("test_group_name", p...
// Check that no errors occur when compiling without the plugin. // RUN: %clangxx -std=c++11 -fsyntax-only %s 2>&1 | FileCheck %s -allow-empty \ // RUN: --check-prefix=CHECK-NO-PLUGIN // CHECK-NO-PLUGIN-NOT: {{.*}}error{{.*}} // "not" is used here because compiling with our plugin SHOULD result in an // error (and ...
/*#include "Value.h" using namespace std; shared_ptr<Value> FractionVal::isLesserThan(shared_ptr<FractionVal> another) { return shared_ptr<Value>(new Boolean(core.lesser(another->core))); } shared_ptr<Value> FractionVal::isGreaterThan(shared_ptr<FractionVal> another) { return shared_ptr<Value>(new Boolean(core.gre...
#include "InputHandling.h" InputHandling::InputHandling(): m_pInputMgr(NULL), m_pKeyboard(NULL), m_pMouse(NULL), rMode(0), m_iNumScreenShots(0), m_bShutDownOgre(false) { } InputHandling::~InputHandling() { if(m_pInputMgr) OIS::InputManager::destroyInputSystem(m_pInputMgr); } bool InputHandling::k...
#include<iostream> #include<vector> using namespace std; bool isPrime[100000001]; vector<int> primes; void sieve() { for (int i = 2; i <= 100000000; i++) isPrime[i] = 1; for (int i = 2; i <= 10000; i++) if (isPrime[i]) for (int j = i*i; j <= 100000000; j += i) isPrime[j] = 0; for (int i = 2; i...
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr> // Copyright (C) 2008 Benoit Jacob <jacob.benoit.1@gmail.com> // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU ...
#include "WidgetComparisonArea.hh" #include "WindowOpenTextFile.hh" #include "WindowSaveTextFile.hh" #include "WindowComparison.hh" #include "WindowTextEdit.hh" #include "Exception.hh" #include "scrap.h" #include <pglabel.h> WidgetComparisonArea::WidgetComparisonArea(Window &parent, ...
#ifndef PLAYER_H #define PLAYER_H #include <vector> #include "Lib.h" #include "Actor.h" #include "Map.h" #include "Parameter.h" #include "PlayerBody.h" #include "../FrameTimer.h" namespace gnGame { using std::vector; // プレイヤーの状態 enum class PlayerState { Wait, // 待機中 Move, // 移動中 FirstJum...
//------------------------------------------------------------------------------------------------- // File : s3d_plastic.cpp // Desc : Plastic Material. // Copyright(c) Project Asura. All right reserved. //------------------------------------------------------------------------------------------------- #include ...
////////////////////////////////////////////////////////////////////// ///Copyright (C) 2011-2012 Benjamin Quach // //This file is part of the "Lost Horizons" video game demo // //"Lost Horizons" is free software: you can redistribute it and/or modify //it under the terms of the GNU General Public License as published ...
// // Particle.cpp // final_sketch4 // // Created by Kris Li on 12/9/16. // // #include "Particle.hpp" Particle::Particle(){ attract = true; } void Particle::init(){ pos = ofPoint(ofRandomHeight(), ofRandomWidth()); vel = ofPoint(0,0,0); frc = ofPoint(0,0,0); rep = ofPoint(0,0,0); dam...
// // Application.hpp // Sorted_Doubly_Linked_List // // Created by 세광 on 2021/08/12. // #ifndef Application_hpp #define Application_hpp #include "Iterator.hpp" class Application { public: Application(); ~Application(); void Run(); int GetCommand(); int AddItem(); int DeleteItem(); ...
#ifndef DATASTRUCTS_SETTINGSSTRUCT_H #define DATASTRUCTS_SETTINGSSTRUCT_H #include "../DataStructs/ESPEasyLimits.h" #include "../Globals/Plugins.h" /*********************************************************************************************\ * SettingsStruct \****************************************************...
#include <iostream> #include <cstdint> using namespace std; int main(void){ unsigned int ui = -8; int si2 = -8; std::cout << ui << std::endl; //gives you garbage value cout << si2/2; return 0; }
/* Monitor.h Header file for class Monitor @author: Martin Terneborg. */ #ifndef MONITOR_H #define MONITOR_H #include <Windows.h> #include <vector> /* Class representing a monitor. */ class Monitor { private: HMONITOR m_hMonitor; std::wstring m_displayDeviceName; std::wstring m_monitorN...
#include <vector> #include <string> #include <iostream> #include <fstream> #include <sstream> #include <list> #include <algorithm> #include <sstream> #include <set> #include <cmath> #include <map> #include <stack> #include <queue> #include <cstdio> #include <cstdlib> #include <cstring> #include <numeric> #include <bits...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // // Copyright (C) 1995-2004 Opera Software AS. All rights reserved. // // This file is part of the Opera web browser. It may not be distributed // under any circumstances. #ifndef BT_INFO_H #define BT_INFO_H // --------------------------...
/* * write template functions that are guaranteed to read and write the * number of bytes desired */ #ifndef fancyRW_h #define fancyRW_h #include <unistd.h> #include <errno.h> template<typename T> int READ(int fd, T* obj_ptr, int count) { char* addr=(char*)obj_ptr; int rem=count; int n=0; //loop. Read repea...
#define OPENGL_33 #define THREADING bool beta = true; bool alpha = true; float version = 0.1; bool debug = true; bool rainBowPowa = false; //#define ERROR_HANDLE #include <SFML/OpenGL.hpp> #include "levels.h" #include <thread> #include <future> #include<stdio.h> #include<cstdlib> #include<iostream> #include<string.h> ...
#include "nrfs.h" #include <stdio.h> #include <string.h> #include <stdlib.h> #define PATH_LEN 500 #define CMD_LEN 20 static char path[PATH_LEN] = "/"; static char workPath[PATH_LEN]; static char cmd[CMD_LEN]; nrfs fs; void usage(); void getCmd(); void doCmd(); void do_cd(); void do_ls(); void do_touch(); void do_write...
#ifndef OPTIONS_H #define OPTIONS_H #include <time.h> #include <string> #include "Typedef.h" #include "Game/GameConfig.h" class Configure : public GameConfig { public: static Configure* getInstance() { static Configure * options = NULL; if (options == NULL) options = new Configure(); return options; } pu...
#include<iostream> #include<bits/stdc++.h> #include<algorithm> #include<cmath> #include<string> #include<cstring> #include<vector> #include<map> #include<set> #include<list> #include<unordered_map> #include<unordered_set> #define ll long long #define MAX 100000003 using namespace std; void calculate(char ch) { int n1,...
#pragma once #include "MoveableObj.h" #include "Map.h" #include "Astar.h" #include "BFSearchPos.h" #include <deque> typedef std::deque<Pos> DEQUE; class CRole : public CMoveableObj { public: CRole(hgeResourceManager*, char* name, CMap* map, float spd = 200.f); virtual~CRole(){} virtual bool Init(); virtual void ...
// Handout #1: Source code of a C++ Program, which // converts distance in miles to kilometers. #include <iostream> //inclusion of support for doing input & output #include <vector> //inclusion of support for doing input & output #include <ctime> #include <time.h> using namespace std; //declare access to standa...
#include "Level.h" Level::Level(sf::RenderWindow* hwnd, Input* in) { window = hwnd; input = in; area1 = false; window->setMouseCursorVisible(false); font.loadFromFile("font/Orbitron-VariableFont_wght.ttf"); // initialise game objects player1.setSize(sf::Vector2f(50, 150)); player1.setCollisionBox(0, 0, 50, 1...
/******************************** * Reef-Life Aquarium Controller * * Versión 3.0.0 - 201506 * * Lectura y Escritura * * Archivos de Parámetros * * y Configuración * ********************************/ //Abre el archivo de configración y busca un parámetro String getParameter(String...
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int ans = n; for(int i=0; i<=n; i++){ int t = i; int cc = 0; while(t > 0) cc += t%6, t/= 6; t = n - i; while(t > 0) cc += t%9, t/=9; ans = min(ans, cc); } co...
/******************************************************************************** This file contains functions used to configure hardware peripherals and various libraries. ********************************************************************************/ /*************************************************************...
// Created on: 1993-08-12 // Created by: Frederic MAUPAS // 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 GN...
#include <iostream> #include <vector> #include <map> #include <cmath> #include <queue> #include <algorithm> #include <iomanip> #include <set> using namespace std; /*ϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕ*/ #define int long long int #define ld long double #define F first #define S second #define P p...
#include <bits/stdc++.h> using namespace std; int main() { int a; while(scanf("%d", &a)!=EOF) { getchar(); if(!(a%6)) printf("Y\n"); else printf("N\n"); } return 0; }
#ifndef HISTO_HPP #define HISTO_HPP #include "globals.hpp" // template<typename _Tx> std::array<int, 256> histogram( cv::Mat& img ); std::array<int, 256> indexed_histogram( cv::Mat& img, cv::Mat index ); std::array<int, 1024> histogram_ex( cv::Mat& img ); // estimate global threshold double global_threshold( cv::Mat...
//知识点:状压DP /* By:Luckyblock 题目要求: 给出一 n*m 的矩阵,有些方格可以生草 不能有相邻的 , 生草的方格, 求填充矩阵的方案数 分析题意: 看到此题。 n<=12,m<=12 ,基本确定这是一个状压DP了 还可以发现,只有相邻的两行 , 才会互相影响. 之后开始设计状态: 使用二进制数 , 表示每行 地皮的生草情况. 设 f[i][j] 表示 ,当前到了第i行,第i行的状态为j,的方案数. 可以先进行初始化 , 获得每一行的合法状态, 即不存在 左右相邻 的 生草地皮的 状态. 然后 再将矩阵从上至下遍历, 每次枚举相邻的两行 , 再枚举两...
#include <chuffed/mdd/weighted_dfa.h> #include <algorithm> #include <cstring> #include <thirdparty/MurmurHash3/MurmurHash3.h> #define OPCACHE_SZ 100000 const int EVLayerGraph::EVFalse = (-1); const int EVLayerGraph::EVTrue = (0); struct edge_leq { bool operator()(const EVLayerGraph::EInfo& e1, const EVLayerGraph:...
#ifndef _DEMONWHEEL_H #define _DEMONWHEEL_H #include "Enemy.h" #include "Path.h" class DEMONWHEEL : public Enemy { private: iPoint original_pos; Path path; Animation fly; Animation forward; Animation backward; Animation shoot; Animation death; int timer = 0; void Shoot(); public: DEMONWHEEL(int x, int y, ...
#include "MappingSwipeListener.hpp" #include "KeyEvent.hpp" using namespace Leap; void MappingSwipeListener::onLeftSwipe(const SwipeGesture& swipe) { KeyEvent event(VK_LEFT); event.trigger(); } void MappingSwipeListener::onRightSwipe(const SwipeGesture& swipe) { KeyEvent event(VK_RIGHT); event.trigger(); } void...
#include "GeneratorInterface/GenFilters/interface/HighETPhotonsFilterAlgo.h" #include "DataFormats/Math/interface/deltaR.h" using namespace edm; using namespace std; HighETPhotonsFilterAlgo::HighETPhotonsFilterAlgo(const edm::ParameterSet& iConfig) { //set constants FILTER_ETA_MAX_ = 2.5; //parameters sumETTh...
#include<conio.h> #include<iostream.h> void main (){ char bin[]={'1','0','1','0','1'}; int dec=0; int count=1; clrscr(); for(int i=4;i>=0;i--){ if(bin[i]=='1') { dec=dec+count; } count=(count+count); } cout<<endl<<"Decimal "<<dec; getche(); }
#include "stdafx.h" #include "Models.h" int const NumVertices = 36; //(6 faces)(2 triangles/face)(3 vertices/triangle) point4 points[NumVertices * 3]; color4 colors[NumVertices * 3]; point4 pointsNew[NumVertices * 3]; color4 colorsNew[NumVertices * 3]; MatrixStack mvstack; MatrixStack mvstackNew; Node nodes[NumN...
#include <iostream> using namespace std; int PathCount(int m, int n) { if (m == 1 || n == 1) { return 1; } return PathCount(m - 1, n) + PathCount(m, n - 1); } int main() { int n, m; cout << "Enter value of m" << endl; cin >> m; cout << "Enter value of n" << endl; cin >> n; ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Luca Venturi ** */ #ifndef CACHE_SIMPLE_STREAM_ #define CACHE_S...
#pragma once #include <functional> #include <QString> #include <QMap> #include <QGroupBox> #include "GenericParameter.h" class Parametrizable { friend class GenericParameterWidget; public: Parametrizable(); virtual ~Parametrizable(); Parametrizable(const Parametrizable & other); Parametrizable & operator=(...
#include "precompiled.h" #include "game/jsplayer.h" #include "game/player.h" #include "script/jsvector.h" namespace jsplayer { JSBool posChanged(JSContext* cx, JSObject* obj, D3DXVECTOR3& new_vec, void* user); JSBool sizeChanged(JSContext* cx, JSObject* obj, D3DXVECTOR3& new_vec, void* user); JSBool getP...
#include <iostream> #include <fstream> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <math.h> using namespace std; int main() { freopen("mamxanh4.inp","r",stdin); freopen("mamxanh4.out","w",stdout); int a,b; scanf("%d %d",&a,&b); printf("So thu nhat o file la: %d\n",a);...
/************************************************************************************** * File Name : Mesh.cpp * Project Name : Keyboard Warriors * Primary Author : JeongHak Kim * Secondary Author : * Copyright Information : * "All content 2019 DigiPen (USA) Corporation, all rights reserved." **...
#pragma once #include "severity.hpp" #include <ctime> #ifdef ELOG_STATIC_RECORD # ifndef ELOG_RECORD_LEN # define ELOG_RECORD_LEN 26 # endif # include <ostream> # include <streambuf> #else # include <sstream> # include <string> #endif namespace elog { # ifdef ELOG_STATIC_RECORD class RecordBuf: public std::stre...
// // Bell.hpp // final_sketch2 // // Created by Kris Li on 12/1/16. // // #pragma once #include "ofMain.h" class Bell { public: Bell(); void init(ofPoint pos); void update(float rad1, float rad2); void draw(); ofMesh bell; int gridScale; int size; float theta; ...
#include "msg_0x0c_playerlook_cts.h" namespace MC { namespace Protocol { namespace Msg { PlayerLook::PlayerLook() { _pf_packetId = static_cast<int8_t>(0x0C); _pf_initialized = false; } PlayerLook::PlayerLook(float _yaw, float _pitch, bool _onGround) : _pf_yaw(_yaw) , _pf_pitch(_pitch) , _pf_onGround(_onGround) ...
#include "Trie.h" #include<iostream> using namespace std; //******************* //*GET NODE FUNCTION //******************* Trie::Node* Trie :: getNode(string word) { Trie::Node * curr = root; for(int i = 0 ; i< word.length() ; i ++) { char ch = word[i]; if(curr->e == 0...
#include <bits/stdc++.h> using namespace std; int l, r, n = 0; string s; int main(){ freopen("DEM.inp", "r", stdin); freopen("DEM.out", "w", stdout); cin >> l >> r; for(int i = l; i <= r; i++) s += to_string(i); for(int i = 0; i < 9; i++){ n = 0; while(s.find(to_string(i)) != string::npos){ ...
#pragma once #include "GameNode5.h" class MainGame6 : public GameNode5 { private: RECT player; RECT rc[10]; int score; HFONT hFont; HFONT OldFont; bool isJump; bool isStart; bool isOver; int gravity; int jumpPower; int jumpTime; float prevTime; float currentTime; public: MainGame6(); ~MainGame6()...
#pragma once #ifdef _UNICODE typedef std::wstring _tstring; typedef std::wifstream _tifstream; #else typedef std::string _tstring; typedef std::ifstream _tifstream; #endif typedef _tstring PROG; struct DEVICE { TCHAR name[20]; TCHAR alias[10]; TCHAR fuses[8]; }; struct PORT { TCHAR name[10]; ...
#include <bits/stdc++.h> using namespace std; class Solution { public: enum Status{valid = 0,invalid}; int status; int StrToInt(string str) { status = invalid; long long num = 0; int index = 0; if(str.size() > 0){ bool minus = false; if(str[index] == '...
#include "../Headers/partition.h" Partition::Partition() { for(int i = 0; i <= numNodes ; i++) { intCon.push_back(0); extCon.push_back(0); lockStatus.push_back(false); basket.push_back(UNKNOWN_SIDE); } } Partition::~Partition() { delete &intCon; delete &extCon; delete &lockStatus; } void Partition::ini...
#include <TWI.h> #include <MPU-6050.h> // in main program before all this functions run TWI::TWIInit(); namespace MPU6050{ uint8_t setup(uint8_t DLPF, uint8_t GyroRange, uint8_t AccelRange){ //MPU6050::setup(DLPF_CFG_OFF, FS_SEL_250, AFS_SEL_2) TWI::TWIInit(); if(TWI::WriteByte(MPU6050_ADDRESS, CONFIG, DLPF)) re...
#include "core/pch.h" #include "modules/ecmascript/oppseudothread/oppseudothread.h" #include <stdio.h> class MyThread : public OpPseudoThread { public: static void Run(OpPseudoThread *thread) { for (unsigned i = 0; i < 0x1000000; ++i) if ((i & 0xfffff) == 0xfffff) { static_cast<MyThr...
//=========================================================================== //! @file scene_cube_shadow_map.h //! @brief 全方位シャドウマップ //=========================================================================== #pragma once //=========================================================================== //! @class Scene...
#include "core/pch.h" #ifdef M2_SUPPORT #include "groupsmodel.h" #include "adjunct/m2/src/engine/message.h" #include "adjunct/m2/src/engine/engine.h" #include "adjunct/m2/src/engine/indexer.h" #include "adjunct/m2/src/engine/store.h" #include "adjunct/m2/src/engine/accountmgr.h" #include "adjunct/quick/Application.h...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; 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 BT_Filecache_H #define BT_Filecache_H // --------------...
#include<iostream> //#include<algorithm> #include<cstdio> #include<cstring> using namespace std; struct node { int num,i; } ; node dp[10000017]; int num[100000+7]; inline void get_min(int n,int k){ for(int i = 0 ;i <= n; i++){ dp[i].num = dp[i].i =0; } dp[0].num = -0x3f3f3f3f; int head =1,tail =1; for(int i = 1...
// -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- /* Strings referenced in adjunct/quick_toolkit/. * * Comment lines of both forms valid in C++ are ignored. Preprocessor * directives are allowed: the #if-ery around each string tag should reflect the * #if-ery around its use in the indicated file(s). Strings ...
#pragma once #include <vector> #include <Ren/Texture.h> #include "BaseElement.h" namespace Gui { class Frame : public BaseElement { Ren::Texture2DRef tex_; float frame_offset_, frame_offset_uv_; std::vector<float> positions_, uvs_; std::vector<uint16_t> indices_; public: Frame(c...
//This example will use a file_logger: a log that writes to a file. #include <lm/file_logger.h> //In the example we will use locking sentries to use multiple threads writing //to the same logger. #include <lm/log.h> #include <thread> #include <string> #include <vector> #include <chrono> using namespace lm; //Initial...
#ifndef _DEFAULT_HEADER_FILES_H #define _DEFAULT_HEADER_FILES_H #include <iostream> #include <windows.h> #include <vector> #include <time.h> #include <fstream> #include "conio_yp.h" using namespace std; #define BOUNDARY_LEFT 4 #define BOUNDARY_RIGHT 77 #define BOUNDARY_TOP 3 #define BOUNDARY_BOTTOM 38 enum DIRECTIO...
// Created on: 1993-01-11 // Created by: CKY / Contract Toubro-Larsen ( SIVA ) // 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 ...
#include <bits/stdc++.h> using namespace std; vector<int> v; void solve(int A[], int B[], int n, int m, int i, int j) { if(i == n && j == m) return; if(i == n) { v.push_back(B[j]); solve(A, B, n, m, i, j + 1); } if(j == m) { v.push_back(A[i]); solve(A, B, n, m, i + 1, j); } else { v.push_back(A[i]...
#ifndef IOREMAP_THEVOID_ACCEPTORLIST_P_HPP #define IOREMAP_THEVOID_ACCEPTORLIST_P_HPP #include "server.hpp" #include <thread> namespace ioremap { namespace thevoid { template <typename Connection> class acceptors_list { public: typedef typename Connection::socket_type socket_type; typedef typename socket_type::pro...
#include <bits/stdc++.h> using namespace std; class DoublyLinkedListNode { public: int data; DoublyLinkedListNode *next; DoublyLinkedListNode *prev; DoublyLinkedListNode(int node_data) { this->data = node_data; this->next = nullptr; this->prev =...
#include "CreateCommitmentQWidget.h" #include "ui_CreateCommitmentQWidget.h" #include <CommStatsQWidget.h> #include <Commitment.h> #include <Listener.h> #include <QDebug> #include <QObject> #include <StatsUtility.h> #include <User.h> #include <mainui.h> using namespace util; using namespace udata; /** * @brief Creat...
#include "wsa_xtra.h" #include <windows.h> #include <windowsx.h> //#include <ver.h> #include <winsock.h> //#include "resource.h" #include <string.h> #include <stdlib.h> #include <time.h> #include <stdio.h> #include <dos.h> #include <direct.h> #include "winsockx.h" /*-------------- global data -------------*/ char szA...
// // NullPartHandler.cpp // // $Id: //poco/1.4/Net/src/NullPartHandler.cpp#1 $ // // Library: Net // Package: Messages // Module: NullPartHandler // // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 // #include "_Net/NullPartHandle...
#include <iostream> #include <unordered_map> using namespace std; int main(){ int k, m, num; bool result; int coursesInCategory, minCoursesInCategory, numChosenInCategory; while(cin >> k && k != 0){ cin >> m; unordered_map<int, bool> courses; result = true; for(int...
#include "Block.h" Block::Block() { } Block::Block(GLfloat width, GLfloat height,GLfloat depth,Vector3 pos,Physics* a_physics){ m_Cube = new CubeObject(Vector3(width, height, depth),"PBR.vert","PBR.frag",ambColor,diffColor,specColor,shiness); rigidBodyIndex = physics->CreateRigidBody(m_Cube->GetVertices(), m_Cube...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <fizz/client/ClientExtensions.h> #include <quic/client/handshake/ClientTransportParametersExtension.h> #in...
// -*- LSST-C++ -*- /* * LSST Data Management System * Copyright 2009-2014 LSST Corporation. * * This product includes software developed by the * LSST Project (http://www.lsst.org/). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License ...
#include "../../include/actors/BodyOfSnake.h" BodyOfSnake::BodyOfSnake(const Rectangle& rect, SDL_Texture* tex, const shared_ptr<Actor>& target):Actor(rect, tex), waifu(target) { setSpeed(Vec(1.0f, 1.0f)); } BodyOfSnake::~BodyOfSnake() {} void BodyOfSnake::tick() { stalk(); Actor::tick(); } void BodyOfSnake::s...
#include <iostream> using namespace std; int value = 1234; int main() { cout << "What is the password?: " << endl; cin >> value; if(value == 1234) cout << "you are now logged in" << endl; else cout << "the password is wrong!" << endl; return 0; }