text
stringlengths
8
6.88M
#include "Monster.h" #include <algorithm> #include "Skill.h" #include "SoulBead.h" #include "Fate.h" struct CSpecialFeature { EnFeatures nFeature; double dValue; }; CMonster::CMonster() : m_nClass(EC_WOOD), m_nSpeciality(0), m_pSoulBead(nullptr), m_bIgnore(false), m_dFactor(0), m_bIsAffectAll(false), m_bIsGol...
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <list> #include <random> #include <time.h> #include <set> #include <map> #include <math.h> #include <cmath> #include <queue> #include <unordered_set> #include <unordered_map> #define mp make_pair #define ull unsigned long long #define...
#include<cstdio> #include<algorithm> using namespace std; const int MARX=2147483646; struct baka9 { int u,v,w,ne; }a[401000]; int head[20010]; int minn[20010]; bool f[20010]; int n,m,ans,num; void add(int x,int y,int z) { a[++num].ne=head[x]; a[num].u=x; a[num].v=y; a[num].w=z; head[x]=num; } ...
class Solution { public: int strStr(string haystack, string needle) { if(needle == "") return 0; int pos = 0, hlen = haystack.size(), nlen = needle.size(); for(int i = 0; i < hlen-nlen+1; ++i){ int j = 0; for(; j < nlen; ++j){ if(haystack[i+j] != needl...
// // nehe18.cpp // NeheGL // // Created by Andong Li on 9/16/13. // Copyright (c) 2013 Andong Li. All rights reserved. // #include "nehe18.h" const char* NEHE18::TITLE = "NEHE18"; GLfloat NEHE18::sleepTime = 0.0f; int NEHE18::frameCounter = 0; int NEHE18::currentTime = 0; int NEHE18::lastTime = 0; char NEHE18::...
#pragma once //使用するヘッダー #include "GameL\DrawTexture.h" #include "GameL\SceneObjManager.h" //使用するネームスペース using namespace GameL; //オブジェクト class CObjHeroSword : public CObj { public: CObjHeroSword(float x, float y); //コンストラクタ ~CObjHeroSword() {}; void Init(); //イニシャライズ void Action(); //アクション void Draw(); //ドロ...
// stack 的弹入弹出顺序: 边界扣得真烦 class PushPopSeq { public: bool IsPopOrder(vector<int> pushV, vector<int> popV) { if (pushV.size() != popV.size()) return false; stack<int> help; int pushIdx = 0; int popIdx = 0; while (pushIdx < pushV.size() && popIdx < popV.size()) { while (help.empty() || pushIdx < pushV.size...
#include <assert.h> #include <stdlib.h> #include "array_3d.h" template <class T> inline unsigned int Array3D<T>::index(unsigned int i1, unsigned int i2, unsigned int i3) { return this->size_i23*i1 + this->size_i3*i2 + i3; } template <class T> Array3D<T>::Array3D(unsigned int size_i1, unsigned int size_i2, unsigne...
// Card.cpp #include "Card.h" const string Card::SuitString[SUITSIZE] = { "Diamonds", "Hearts", "Clubs", "Spades" }; const string Card::ValueString[VALUESIZE] = { "2","3","4","5","6","7","8","9","10","J","Q","K","A" }; ostream& operator<<(ostream& output, const Card& c) { output << Card::SuitString[c.suit] << " : ...
#include <iostream> #include <vector> using namespace std; bool check(vector<int> const& v) { for (int i = 0; i < 10; ++i) { if (v[i] == 0) return false; } return true; } void get_nums(int n, vector<int> &v) { while (n > 0) { v[n % 10]++; n /= 10; } } int mai...
/* * Copyright (C) 2013 Tom Wong. All rights reserved. */ #ifndef __GT_OBJECT_H__ #define __GT_OBJECT_H__ #include "gtcommon.h" #include <QtCore/qatomic.h> GT_BEGIN_NAMESPACE class GT_BASE_EXPORT GtObject { #ifdef GT_DEBUG public: explicit GtObject(); virtual ~GtObject(); public: static int dumpObject...
#pragma once #include <iostream> #include "NodeInterface.h" using namespace std; struct Node : public NodeInterface { int data; Node* left; Node* right; Node(int the_data, Node* left_value = NULL, Node* right_value = NULL) : data(the_data), left(left_value), right(right_value) {} virtual ~Node(); virtual...
#include <assert.h> #include <vector> #include "BinarySearch.h" #include "SelectionSort.h" void testBinarySearch() { int testVal = 11; std::vector<int> binarySearchTest{ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 }; long algoRetVal = BinarySearch(binarySearchTest...
/* -*- 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. */ #include <core/pch.h> #ifdef DOM_EXTENSIONS_CONTEXT_MENU_API_SUPP...
#ifndef MESSAGEFIELDDESCRIPTORCONTAINER_H #define MESSAGEFIELDDESCRIPTORCONTAINER_H #include <QtGui/QWidget> #include <QString> #include <google/protobuf/descriptor.h> #include <google/protobuf/message.h> #include <google/protobuf/generated_message_util.h> #include <google/protobuf/dynamic_message.h> #include...
#include<iostream> #include<iomanip> #include<string> #include<cstring> #include<fstream> #include<cstdlib> //#include"GUI.h" using namespace std; int input,Iseat; char name[20] = "77"; char xname[20] = "77"; char password[20]; bool pass = false; bool run = true; bool seat[8][9] = {0}; int popS = 0; int popM = 0; int...
/** * @file OpenFileDialog.h * @brief 包含类 OpenFileDialog的定义 */ #ifndef OPENFILEDIALOG_H #define OPENFILEDIALOG_H #include <qdialog.h> #include "roammanager.h" class QPushButton; class QListWidget; /**      *  @class OpenFileDialog     *  @brief 继承自QDialog类.   *  打开文件对话框 */ class OpenFileDialog: public ...
/* -*- 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. */ #ifndef OP_PLUGIN_CRASHED_BAR_H #define OP_PLUGIN_CRASHED_BAR_H...
// -*- LSST-C++ -*- /* * LSST Data Management System * Copyright 2009-2015 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 ...
#pragma once #include "../MonsterAction.h" #include "cmp/CAct_Beam.h" class Act_Blizzard : public MonsterAction { public: Act_Blizzard(); ~Act_Blizzard(); bool Action(Monster* me) override; private: CAct_Beam m_cBeam; CVector3 m_efs = CVector3::One() * 3.5; bool m_first = true; float m_cost = 0.1f; float m_ti...
#include "StdAfx.h" #include "FriendListUI.h" namespace DuiLib { CFriendListUI::CFriendListUI(CPaintManagerUI& paint_manager) : paint_manager_(paint_manager) , delay_deltaY_(0), delay_number_(0), delay_left_(0) { root_node_ = new Node; //root_node_->data().level_ = -1; //root_node_->data().child_visible_ = true; /...
//hung.nguyen@student.tut.fi - student id: 272585 //sanghun.2.lee@student.tut.fi - student id: 272571 #include <string> #include <limits> #include <vector> #include <fstream> #include <iomanip> #include <iostream> #include "splitter.hh" #include "market.hh" /*The input file is read in the constructor of the 'market' c...
#include "../include/surface_feature_extractor.h" using namespace SurfaceFeatureExtractor; void SurfaceFeatureExtractor::fillVertexToTriangleLookup(const std::vector<glm::ivec3> &_tris, const std::vector< TriangleData >& _triangleData, std::map<vertex_id, std::vector<triangle_id> >& _lookup) { for(size_t i = 0;...
#ifndef _SHARED_H_ #define _SHARED_H_ #include <iostream> #include "sqlite3/sqlite3.h" #include <string.h> #include <thread> #ifdef _WIN32 #include <windows.h> #include <tchar.h> #endif #ifdef __linux__ #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #endif #define pipename "\\\\....
#pragma once #include "CollidableSquare.h" /* Brick is a collidable square that can be destroied by the ball. Hitting it for an amount of times, the brick will be destroied. An animation will be applied to the brick. When number of hits is 0, a random powerup will be generated. The brick only has a va...
#include <cstdio> #include <iostream> #include <vector> #include <string> #include <stack> #include <unordered_map> #include <unordered_set> #include <queue> #define INT_MAX 0x7fffffff #define INT_MIN 0x80000000 using namespace std; struct TreeLinkNode{ int val; TreeLinkNode *left, *right, *next; TreeLinkNode(...
/* You are given with an integer k and an array of integers that contain numbers in random order. Write a program to find k largest numbers from given array. You need to save them in an array and return it. Time complexity should be O(nlogk) and space complexity should be not more than O(k). Order of elements in the o...
// Created on: 2002-12-10 // Created by: data exchange team // Copyright (c) 2002-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...
#include <stdio.h> #include <stdlib.h> struct kahoy { int item; struct kahoy *left; struct kahoy *right; }; typedef struct kahoy tree; tree *insert(tree *root,int x) { if(!root) { root=(tree*)malloc(sizeof(root)); root->item = x; root->left = NULL; root->right = NULL; return(r...
#include<iostream> #include<algorithm> #include<cstdio> using namespace std; int main(){ int n; scanf("%d",&n); for(int i=10000;i<100000;i++){ int a,b,c,d,e; a=i/10000; b=(i%10000)/1000; c=(i%1000)/100; d=(i%100)/10; e=i%10; if(a==e&&b=...
#include "../../idlib/precompiled.h" #pragma hdrstop #include "../Game_local.h" #include "../client/ClientModel.h" class rvMonsterGladiator : public idAI { public: CLASS_PROTOTYPE( rvMonsterGladiator ); rvMonsterGladiator ( void ); void InitSpawnArgsVariables( void ); void Spawn ( void ); void ...
#include <string> #include <iostream> #include <vector> #include <cctype> using namespace std; int getLength(int m){ int l = 0; while(m){ m/=10; l++; } return l; } int getI(int a, int l){ while(l!=1){ a/=10; l--; } a%=10; return a; } ...
#ifndef __DDISPLAYMANAGER__ #define __DDISPLAYMANAGER__ class DDisplayManager { public: DDisplayManager (); ~DDisplayManager (); bool initSDL (); bool initIMG (); bool initTTF (); bool isLegit () { return imgLegit && sdl...
#include <iostream> #include "string.h" #include "messagedisplay.h" using namespace std; int main(){ MessageDisplay k("Default"); k.setstring("This is a message."); k.display(); return 0; }
String processor(const String &var) { // Serial.println(var); if (var == "Last_Update") { return (String(Time) + String(Date)); } else if (var == "Temp") { return String(bmp.readTemperature()); } else if (var == "Battery") { return String(BattLevel()); } ...
#include "SimExamples/voronoi/ExmVoronoi.h" #include "simd3d9/include/SimD3D9.h" #include "include/SimException.h" ExmVoronoi::ExmVoronoi(HINSTANCE app_instance, const char* init_file): Framework(app_instance, init_file), depth_(2.0f), effect_vor_(NULL), scene_texture_(NULL), scene_surface_(NULL), final_surface_(NULL)...
#include <iostream> #include <array> #include <fstream> #include <string> #include <optional> #include <cmath> #include <vector> #include <iomanip> typedef std::array<std::array<double, 3>, 3> matrix; std::optional<std::string> ParseArgs(int argc, char* argv[]) { if (argc != 2) { std::cout << "Invali...
#include <LocalDB.hpp> #include "Client.hpp" Client::Client(boost::asio::io_service &ioService, std::string const &host, std::string const &port) : APacketServer(ioService, 0, new LocalDB()) { this->_serverEndpoint = *this->_resolver.resolve({boost::asio::ip::udp::v4(), host, port}); this->saveClient("SERV...
#ifndef FILESYSTEM_H #define FILESYSTEM_H #include <string> #include <Vector> #include <boost/shared_ptr.hpp> class File; class FileSystem { public: FileSystem(); virtual ~FileSystem(); private: typedef std::vector<boost::shared_ptr<File> > fileVector; fileVector mFiles; }; ...
#include "../headers/Stage.h" Stage::Stage( int width, int height, int x , int y, SDL_Renderer* pRenderer) : Drawable(STAGE_IMG_PATH, pRenderer) { this->setPosition(x,y); this->height = height; this->width = width; this->setSize(width, height); } Stage::~Stage() { } void Stage::draw() { /* this->texture::dr...
// // Copyright (C) 2006-2012 Greg Landrum // // @@ All Rights Reserved @@ // This file is part of the RDKit. // The contents are covered by the terms of the BSD license // which is included in the file license.txt, found at the root // of the RDKit source tree. // #ifndef _RD_CHEMTRANSFORMS_H__ #define _RD_CHEM...
#ifndef CPOINT_H #define CPOINT_H // external include #include "xmlParser.h" // project include #include "CShape.h" class CPoint : public CShape { public: CPoint( double inX, double inY ); ~CPoint(); void SetCoord( double inX, double inY ); void GetCoord( double& outX, double& outY ) const;...
#include "cpptest.h" CPPTEST_CONTEXT("core.threads.test.cpptest.TA_Thread_CppTest/core.thread.test.cpptest/src/Thread.cpp"); CPPTEST_TEST_SUITE_INCLUDED_TO("core.threads.test.cpptest.TA_Thread_CppTest/core.thread.test.cpptest/src/Thread.cpp"); class TestSuite_get_time_f531f15c : public CppTest_TestSuite { public:...
#include<cstdio> #include<cstring> #define M 10010 using namespace std; int l[M],r[M],pre[M],next[M],key[M]; int n,len,root,pr,ne; int x; void insert(int &x,int num) { if(x==0) { x=++len; l[x]=r[x]=0; pre[x]=pr; next[x]=ne; //给x的前趋后趋都标志一下 next[pr]=x; pre[ne]=x; ...
#pragma once #include <glm/glm.hpp> namespace Game { struct CameraData { CameraData() { } glm::mat4 viewMatrix; glm::mat4 projectionMatrix; }; }
//KM算法 #include<cstdio> #include<cstring> #include<algorithm> #define INF 1000000000 using namespace std; bool x[110],y[110]; int link[110],lx[110],ly[110]; int w[110][110]; struct point { int x,y; }man[110],house[110]; int n,m,lm,lh,ans; char ch; void build() { memset(w,0,sizeof(w)); for(int i...
/* -*- 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 DOM3_LOAD #include "modules/dom/src...
#include <stdio.h> #include <iostream> #include <string> using namespace std; int main() /* endl = end line cout = for formatted output operations cin = for formatted input operations */ { //cout example int x; x = 1; cout << "Output sentence" << endl; // prints 'output' sentence on sc...
#include <iostream> const int SPECIAL = 1000000; const int FIXED = 10000; int main() { int i = 1; int bef1 = 144, bef2 = 154; // 144 and 154 in that order works int found1 = 0, found2, found3, found4; int count =1; int new1, new2; int total; std::cout << bef2 << " " << bef1<< std:...
//************************* FUNÇÕES PARA O MENU DE DADOS BATERIA ********************************* void dadosBateria() { while(!digitalRead(up) == LOW) { //Loop necessário para o programa ficar nesse menu //Leitura de botões e atualização de variáveis if(!digitalRead(mais) == HIGH) { Sel...
#pragma once class SuddenDeath :public GameObject { public: bool Start(); void Update() override; private: };
#pragma GCC optimize("Ofast") #include <algorithm> #include <bitset> #include <deque> #include <iostream> #include <numeric> #include <iterator> #include <string> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #include <unordered_map> #include <unordered_set> using namespace std; vo...
#include "SteeringController.h" SteeringController::SteeringController(double Kp_, double Ki_, double Kd_, bool optimize) : pid{Kp_, Ki_, Kd_}, is_optimized{optimize} { } SteeringController::~SteeringController() { } double SteeringController::update(double cte) { if(is_optimized) opt.run(pid); pid.UpdateErro...
#include "simulatorwindow.h" #include "ui_simulatorwindow.h" SimulatorWindow::SimulatorWindow(QWidget *parent) : QWidget(parent), m_exportFilename(""), m_importFilename(""), m_updateFrameTimer(this), m_currentPlayingFrame(0), ui(new Ui::SimulatorWindow) { ui->setupUi(this); ui->fram...
#include <SoftwareSerial.h> #include <Adafruit_Sensor.h> #include <ArduinoJson.h> #include <DHT.h> //?sensores #define Sensor1 A0 #define Sensor2 A1 #define Sensor3 A2 #define Sensor4 A3 #define Sensor5 A4 int Dht11 = 8; int Ws = 3; //?variables float h1 = 0; float h2 = 0; float h3 = 0; float h4 = 0; float h5 = 0; fl...
#ifndef ICETOWER_H #define ICETOWER_H #include "Tower.h" const float ICETOWERCOOLDOWN = 1.0f; const float ICETOWERRANGE = 0.5f; const float ICETOWERPRICE = 25; const string ICEPROJECTILETEXTURE = "rock"; const int ICEPROJECTILEDAMAGE = 5; const float ICEPROJECTILESPEED = 1.0f; class IceTower : public...
#include "PhysicalPlan.h" void PhyPlanNode::addParameter(string parameter) { parameters.push_back(parameter); } void PhyPlanNode::addAddition(string addition) { additions.push_back(addition); } void PhyPlanNode::showParameters() { cout << "paramater:" << endl; for (string parameter : parameters) {...
#pragma once #include <cstddef> #include <stdexcept> #include <string> #include <iostream> template <class T> class Allocator { public: Allocator(size_t min_size, size_t max_size): min_size_(min_size), max_size_(max_size), blocks_(new Block[max_size_]), memory_(new T[max_size_]) { blocks_[0] = Blo...
#pragma once #include <stdint.h> class InputManager { public: inline static InputManager* GetInstance(); bool GetKeyDown(uint8_t keyCode); private: static InputManager* m_instance; InputManager(); ~InputManager(); }; inline InputManager* InputManager::GetInstance() { if (m_instance == nullptr) { m_...
#ifndef CONSTRAINTS_H #define CONSTRAINTS_H #include <vector> #include <math.h> #include <unordered_map> #include "gl_const.h" #include "Vector2D.h" #include "structs.h" #include <algorithm> #include <iostream> class Constraints { public: Constraints(int width, int height); virtual ~Constraint...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "Item.h" #include "PhysicsEngine/DestructibleActor.h" #include "Hammer.generated.h" /** * */ UCLASS() class HYPOXIA_API AHammer : public AItem { GENERATED_BODY() public: virtual void BeginPlay() override; p...
#include "imu_mpu9250.h" #ifndef __cplusplus #error "Please define __cplusplus, because this is a c++ based file " #endif #include "imu_mpu9250.h" uint8_t Imu::adc_[SENSOR_DATA_LENGTH]; extern Imu imu_; namespace { //Delay function uint32_t getUs(void) { uint32_t usTicks = HAL_RCC_GetSysClockFreq() / 1000000; reg...
#ifndef MQTT_FRAME_H_ #define MQTT_FRAME_H_ #include "mqttError.h" #include <stdint.h> #include <string> #include <vector> //typedef MessageType uint8_t; enum MessageType { RESERVED_0 = 0, CONNECT_MESSAGE_TYPE, CONNACK_MESSAGE_TYPE, PUBLISH_MESSAGE_TYPE, PUBACK_MESSAGE_TYPE, PUBREC_MESSAGE_TY...
/* * MCB.h * File defining the MCB state manager * Author: Alex St. Clair * February 2018 */ /* To add a new state: * 1) Add it to the enum "MCB_States_t" * 2) Define a private member function of the form "void func(bool exit)"" * 3) Add the state to the private array "state_array" * 4) Wr...
// CSC 111 // Sharna Hossain // Assignment 2B #include <iostream> using namespace std; double calc_area(double radius) { return (radius * radius) * 3.14; } double calc_circumference(double radius) { return 2 * 3.14 * radius; } int main() { double radius, area, circumference; cout << "Enter the radi...
#ifndef _WORLDOBJECT_AERO_H_ #define _WORLDOBJECT_AERO_H_ #include "../../Toolbox/Toolbox.h" #include "../../Idioms/NotCopiable/NotCopiable.h" #include "../World.h" namespace ae { /// \ingroup scene /// <summary> /// Class that represent an object in the world. <para/> /// Identified by an unique ID. /// </summ...
#ifndef BUTTON_H #define BUTTON_H #include <UtH/UtHEngine.hpp> enum class ButtonType { Click, Toggle }; typedef std::function<void(uth::GameObject&)> ButtonCallback; class Button : public uth::Component { public: Button() = default; Button(const ButtonCallback&); Button(ButtonType, const ButtonCallback&); ~B...
#include "Shader.h" #include "../app/Engine.h" #include <assert.h> #include <stdio.h> Shader::Shader() { } Shader::~Shader() { DeleteProgram(); } bool Shader::Initialize(string shaderFileName) { m_name = shaderFileName; string vsFile = shaderFileName + "_vs.glsl"; string psFile = shaderFileName + "_ps.glsl"; ...
class ItemTrapTripwireCans { weight = 0.2; }; class ItemTrapTripwireFlare { weight = 0.2; }; class ItemTrapTripwireGrenade { weight = 0.2; }; class ItemTrapTripwireSmoke { weight = 0.2; };
#include "../core/core.h" #include "proxy_object.h" extern "C" EXPORT const char* proxy_initialize(int n_args, const char** args) { if (!(Core::initialize() && Proxy::initialize())) return Core::FAIL; return Core::SUCCESS; }
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008 Daniel Gomez Ferro <dgomezferro@gmail.com> // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Soft...
#ifndef VULKANLAB_INDEXBUFFER_H #define VULKANLAB_INDEXBUFFER_H class IndexBuffer { public: /** * The index buffer constructor. */ IndexBuffer() { glGenBuffers(1, &this->id); } /** * The index buffer destructor. */ ~IndexBuffer() { glDeleteBuffers(1, &id); }...
#include <bits/stdc++.h> using namespace std; #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) #define MAXN 100 #define INF 0x3f3f3f3f #define DEVIATION 0.00000005 int main(int argc, char const *argv[]) { int kase; scanf("%d",&kase); int num; for(int K = 1 ; K <= kase ; K++ ){ scanf("%d",&num); ...
#include <signal.h> #include "CDLReactor.h" #include "Configure.h" #include "Despatch.h" #include "Logger.h" #include "Version.h" #include "RobotSvrConfig.h" #include "GameServerConnect.h" #include "CoinConf.h" //#include "RobotRedis.h" #include "Util.h" #include "Protocol.h" #include "NamePool.h" #ifdef CRYPT #includ...
#include <ros/ros.h> #include <actionlib/client/simple_action_client.h> #include <actionlib/client/terminal_state.h> #include <mc_graspable/FindGraspablesAction.h> int main (int argc, char **argv) { ros::init(argc, argv, "test_find_graspables"); // create the action client // true causes the client to spin its ...
#include "pch.h" #ifdef KORE_OCULUS #include <Kore/Vr/VrInterface.h> #include <Kore/Graphics4/Graphics.h> #include <Kore/Log.h> #include "Direct3D11.h" #include "OVR_CAPI_D3D.h" #include <vector> #include "d3d11.h" #if _MSC_VER > 1600 #include "DirectXMath.h" using namespace DirectX; #else #include "xnamath.h" #en...
/* -*- 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. ** ** Yngve Pettersen */ #include "core/pch.h" #include "modules/pr...
#ifndef IMAGEWINDOW_H #define IMAGEWINDOW_H #include <QGraphicsView> #include <../framework/ModuleManager.hpp> namespace uipf { class ImageWindow : public QGraphicsView { Q_OBJECT public: ImageWindow(ModuleManager& mm, QWidget *parent = 0) : QGraphicsView(parent), mm_(mm) {}; ImageWindow(ModuleManager&...
// API_07_DIVWINDOW.cpp : 애플리케이션에 대한 진입점을 정의합니다. // #include "framework.h" #include "API_07_DIVWINDOW.h" #define IDC_USER 500 #define IDC_BUTTON_SEND IDC_USER + 1 #define IDC_EDIT_TYPO IDC_USER + 2 #define IDC_EDIT_OUT IDC_USER + 3 #define MAX_LOADSTRING 100 // 전역 변수: HINSTANCE hInst; ...
/* * @lc app=leetcode id=64 lang=cpp * * [64] Minimum Path Sum * * https://leetcode.com/problems/minimum-path-sum/description/ * * algorithms * Medium (47.77%) * Likes: 1484 * Dislikes: 42 * Total Accepted: 245.3K * Total Submissions: 513.4K * Testcase Example: '[[1,3,1],[1,5,1],[4,2,1]]' * * Give...
#ifndef ESPChipConnection_h #define ESPChipConnection_h #include <Arduino.h> #include <SoftwareSerial.h> class NetworkController { private: int PIN_RX; int PIN_TX; String ssid; String pw; void sendSerialMessage(String msg); public: NetworkController(int pinRx...
#ifndef KDTREE_H_ #define KDTREE_H_ #include <memory> // Structure to represent node of kd tree template<typename PointT> struct Node { PointT point; int id; std::unique_ptr<Node> left; std::unique_ptr<Node> right; Node(const PointT &pnt, int setId) : point(pnt), id(setId), left(nullptr), right(nullptr) {} ...
#include <iostream> #include <vector> using namespace std; #define MAX_ARR 4 vector<int> countingSort(vector<int> arr) { vector<int> countArr; countArr.assign(MAX_ARR, 0); for(int i=0; i < arr.size(); i++) { int index = arr[i]; countArr[index] += 1; } return countArr; ...
#ifndef USART2_H #define USART2_H #include "serial.h" #include "message/ithread.h" #include <QThread> #define USART2_DEVNAME ("/dev/ttySAC1") class USART2 : public Serial { public: USART2(); ~USART2(); public: static USART2* getInstance(void); void initSerialPort(int dataBits, int parity, int stop...
#include "../include/RenderableObject.h" #include "../include/Renderer.h" RenderableObject::RenderableObject() { //_IsMoveCheck = false; Renderer::GetInstance()->addRenderObject(this); position = glm::vec3(0.0f, 0.0f, 0.0f); rotVec = glm::vec3(0.0f, 0.0f, 0.0f); scaleVec = glm::vec3(0.0f, 0.0f, 0.0f); Rot = gl...
#include <bits/stdc++.h> #include <vector> using namespace std; int main() { // Assign vector vector<int> v; // fill the array with 10 five times v.assign(5, 10); // we can write : vector<int>v(5,10); cout << "The vector elements are: "; for (int i = 0; i < v.size(); i++) cout << v[i] << " "; ...
#include <ZSharpIR.h> #include <RunningMedian.h> // define the number of runs to calculate median #define NumOfRuns 20 // define 5 short range sensors #define SENSOR_1 A0 #define SENSOR_2 A1 #define SENSOR_3 A2 #define SENSOR_4 A3 #define SENSOR_5 A4 // define 1 long range sensors #define SENSOR_6 A5 //long range s...
// Copyright (c) 2011 Thomas Heller // Copyright (c) 2014 Bryce Adelstein-Lelbach // // 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) #include <pika/functional/function.hpp> ...
#include "UIElement.h" UIElement::UIElement(int UIElementID, GameEngine* Engine) :GameObject() { engine = Engine; if (UIElementID == 2) { spriteIcon.loadFromFile("spritesheet.png", sf::IntRect(96, 0, 32, 32)); icon.setTexture(spriteIcon); icon.setScale(800.0 / 32, 200.0 / 32); icon.setPosition(0, WIN...
#include <include/cef_app.h> int mainImpl(CefMainArgs & args); int main(int argc, char ** argv) { CefMainArgs args { argc, argv }; return mainImpl(args); }
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> #include <limits.h> using namespace std; typedef long long ll; #define INF 10e10 #define rep(i,n) for(int i=0;...
#include "PlaneObject.hh" PlaneObject :: PlaneObject(const Vector3F &surfaceNormal, float distanceFromOrigin){ this->surfaceNorm = surfaceNormal; this->distanceFromOrigin = distanceFromOrigin; } Vector3F PlaneObject :: get_surfaceNormal(void) const{ return surfaceNorm; } float PlaneObject :: get_distanceFromOr...
#include <stdio.h> #include "pico/stdlib.h" #include "hardware/gpio.h" #include "hardware/clocks.h" #include "hardware/pwm.h" typedef uint16_t u16; typedef uint32_t u32; #define SPK 19 int main() { // set your desired inputs here const u32 f_pwm = 440; // frequency we want to generate const u16 duty = 60; // du...
/** Kabuki SDK @file /.../Source/Kabuki_SDK/include/_Com/MIDI/String.h @author Cale McCollough @copyright Copyright © 2016 Cale McCollough © @license Read accompanying /.../README.md or online at http://www.boost.org/LICENSE_1_0.txt */ #pragma once namespace _Com { namespace MIDI { ...
#include <vector> #include <string> #include <iostream> #include <map> #include <set> #include <unordered_map> #include <algorithm> #include <fstream> #include <sstream> using namespace std; int main(int argc, char** argv) { ifstream f; f.open(argv[1]); string s; vector<int> numbers; int res...
#ifndef PERSONNE_H #define PERSONNE_H #include"QString" #include"QDebug" #include "connection.h" #include "QSqlQueryModel" #include <QPalette> #include <QDesktopWidget> #include <QtGui> class Personne { private: QString Prenom ; QString Nom; QString Num_Tel; QString CIN ; QString Adresse ; in...
#include <iostream> #include <string> int main() { std::string xosq[4] = {"barev","vonc es","dasern inchpes en","hajox"}; std::cout<<"Barev sireli ogtater. Es Chat_bot em ev karox em patasxanel ays harcerin \n"; for(int i = 0; i < 4; ++i) { std::cout<<xosq[i]<<std::endl; ...
/* Copyright 2021 University of Manchester Licensed under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http: // www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 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. * */ #include "core/pch.h" #ifdef APPLICATION_CACHE_SUPPORT #include ...
// // Created by 송지원 on 2020/07/04. // #include <iostream> using namespace std; int input[7]; int MIN = 100; int SUM; int main() { for (int i=0; i<7; i++) { cin >> input[i]; if (input[i] % 2 == 1) { SUM += input[i]; if (input[i] < MIN) MIN=input[i]; } } if ...