text
stringlengths
8
6.88M
#ifndef OBJECT_H #define OBJECT_H #include <json/json.hpp> using json = nlohmann::json; class object { public: virtual json serialize()=0; virtual void deserialize(json& serialized)=0; }; #endif //!OBJECT_H
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.unoproj.g.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.UX.PropertyAccessor.h> namespace g{namespace Uno{namespace UX{struct PropertyObject;}}} namespace g{namespace Uno{namespace UX{stru...
#pragma once #ifdef WIN32 #include <Windows.h> #endif #undef min #undef max #include <cstring> // strlen, memcpy, etc. #include <cstdlib> // exit #include <cfloat> // FLT_MAX #include <vector> #include "Math.h" #include "Time.h" #include "../Body/Body.h" #include "../Shape/Shape.h" #include "../Collision/Collisio...
#include "GroundShadowCmd.h" #include "GroundShadowNode.h" #include <maya/MSelectionList.h> #include <maya/MGlobal.h> #include <maya/MDagPath.h> #include <maya/MFnTransform.h> #include <maya/MItSelectionList.h> #include <maya/MPlug.h> #include <maya/MPlugArray.h> #include <maya/MTime.h> #include <maya/MFnSet.h> #includ...
#include <Windows.h> #include <stdio.h> #include <winternl.h> #include <iostream> #include <fstream> #include <sstream> #include <string.h> #include <psapi.h> #include <shlwapi.h> #include <shlobj.h> #pragma comment (lib, "psapi.lib") #pragma comment (lib, "shlwapi.lib") #include "MemFunctions.h" //-...
/* ***** BEGIN LICENSE BLOCK ***** * FW4SPL - Copyright (C) IRCAD, 2009-2011. * Distributed under the terms of the GNU Lesser General Public License (LGPL) as * published by the Free Software Foundation. * ****** END LICENSE BLOCK ****** */ #ifndef _FWITKIO_ITKPP_HPP_ #define _FWITKIO_ITKPP_HPP_ #include <boost/s...
#include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { int result = 0; do { QApplication a(argc, argv); MainWindow w; w.show(); result = a.exec(); } while (result == 33333); return result; }
/* YourDuino Example: Relay Control 1.10 Handles "Relay is active-low" to assure no relay activation from reset until application is ready. terry@yourduino.com */ /*-----( Import needed libraries )-----*/ /*-----( Declare Constants )-----*/ #define RELAY_ON 0 #define RELAY_OFF 1 /*-----( Declare objects )----...
#ifndef CBT_NODES_SPAWN_T_HPP #define CBT_NODES_SPAWN_T_HPP #include "cbt/behavior.hpp" #include <utility> #include <type_traits> namespace cbt { template<typename T, bool C1, bool C2> struct _spawn_t { static void spawn(behavior&& x, T y) { (void) new _spawn_t(std::move(x), std::move(y)); } private: behavior _tr...
#ifndef AUDIOINPUTCONTROLLER_HH_ #define AUDIOINPUTCONTROLLER_HH_ #include <string> #include "AudioStream.hh" #include "msg.hh" /** * Class for handling operations between audio stream and out queue (pipe to * recognizer). Stores the whole audio data. */ class AudioInputController { public: enum Mode { RECORD,...
// Copyright (c) 2020 ETH Zurich // Copyright (c) 2002-2003 Pavol Droba // // 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/string_util/classification.hpp...
/** * Definition for a point. * struct Point { * int x; * int y; * Point() : x(0), y(0) {} * Point(int a, int b) : x(a), y(b) {} * }; */ class Solution { public: int maxPoints(vector<Point>& points) { int result = 0; for(int i = 0; i < points.size(); i++){ int ove...
#include "pch.h" #include "GridRepresentation.h" #include "Constants.h" Vector2i GridRepresentation::ScreenToGridPosition(sf::Vector2f aScreenPos) { return ScreenToGridPosition(aScreenPos.x, aScreenPos.y); } sf::Vector2f GridRepresentation::GridToScreenPosition(Vector2i aGridPos) { return sf::Vector2f(static_cast<...
#ifndef VM_HPP #define VM_HPP #include "defs.hpp" #include "log.hpp" #include <map> #include <boost/unordered_map.hpp> #include <string> #include <list> #include "process.hpp" #include "mmobj.hpp" #include "core_image.hpp" class CoreImage; class MECImage; class MMObj; class Process; typedef boost::unordered_map<std...
// // Created by gaoxiang on 19-5-4. // #include <gflags/gflags.h> #include "myslam/visual_odometry.h" DEFINE_string(config_file, "../config/default.yaml", "config file path"); int main(int argc, char **argv) { google::ParseCommandLineFlags(&argc, &argv, true); myslam::VisualOdometry::Ptr vo( ...
#ifndef WINDOWSTIMER_H #define WINDOWSTIMER_H #include "Timer.h" typedef unsigned long DWORD; class WindowsTimer : public Timer { friend class Timer; public: ~WindowsTimer(); void start(); int get_elt(); void stop(); void Continue(); private: WindowsTimer(); DWORD begin; DWORD end; }; #endif // W...
#ifndef GAMEPLAY_SCREEN_H #define GAMEPLAY_SCREEN_H #include "game.h" #include "raylib.h" #include "ball_init.h" #include "player_init.h" #include "bricks_init.h" using namespace g_var; extern const int health; extern int hp; extern int score; extern bool start; extern int framesCounter; extern Rec...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2002 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" #include "ad...
#pragma once #include<iostream> #include<iomanip> #include<vector> #include<queue> #include<stack> #include"tools.h" using namespace std; //边结点,链表 typedef struct node { int dest; //弧头顶点序号 int weight; struct node* next; }Edge; //顶点,一个三元组,在类外定义结构体模板 template<class dataType> struct Triple { dataType data; //顶点数据...
#ifndef CSoftUploadMessage_H #define CSoftUploadMessage_H #include "CMessage.h" #include <QObject> //Ãŵê±àºÅ×¢²á class CSoftUploadMessage : public CMessage { Q_OBJECT public: CSoftUploadMessage(CMessageEventMediator* pMessageEventMediator, QObject *parent = 0); ~CSoftUploadMessage(); virtual void packedSendMes...
#include "Student.h" int main() { Student A; cout << "Input information of Student A: " << endl; A.Input(); Student B; cout << "Input information of Student B: " << endl; B.Input(); int r = A.compareMark(B); if (r == 1) A.saveFile("Output.xml"); else B.saveFile("Output.xml"); return 0; }
#include <stdio.h> int main(int argc, const char* argv[]) { for (int i = 1; i < argc; ++i) { fprintf(stderr, "unexpected argument: '%s'\n", argv[i]); } return argc == 1 ? 0 : 1; }
#ifndef CFG_DEBUG # error "This source should only be compiled in a Debug configuration." #endif #ifdef CFG_OTHER # error "This source should not be compiled in a non-Debug configuration." #endif #include "iface.h" int iface_debug() { return 0; }
#include "stdafx.h" #include "QuestionViewControllerFactory.h" #include "MultipleChoiceQuestionView.h" #include "MultipleChoiceQuestionViewController.h" #include "MultipleResponseQuestionView.h" #include "MultipleResponseQuestionViewController.h" #include "QuestionState_fwd.h" #include "IQuestionState.h" #inclu...
//https://www.patest.cn/contests/gplt/L1-053 #include<bits/stdc++.h> using namespace std; #define INF 2147483647 const int MaxN = 520; int main(){ //input int a,b; cin>>a>>b; int n = a+b; string dog = "Wang!"; //output for(int i=0;i<n;++i){ cout<<dog; } return 0; }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright 2007 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" #include "modules/dochand/docman.h" #include "modul...
#include<bits/stdc++.h> using namespace std; main() { int n, m, a, b; while(cin>>n>>m>>a>>b) { int ttk1, ttk2, ans1, ans2, a1, a2; ttk1 = n*a; ans1 = n/m; ans2 = n%m; ttk2 = ans1*b; if(ans2 != 0) { a1 = ttk2 + (ans2*a); a2 = ttk...
#pragma once #include "../../Graphics/Mesh/2D/QuadMesh.h" #include "../../UI/Dependencies/IncludeImGui.h" #include "ColorToEditor.h" namespace ae { namespace priv { namespace ui { inline void QuadMeshToEditor( QuadMesh& _QuadStatic ) { ImGui::Text( "Quad...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * 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. * * @author Wojciech Dzierzanowski (wdzierzanowski) */ #ifndef QUI...
#include <iostream> #include <cstring> using namespace std; void wyswietlacz() { string tab[5] = {"Jeden", "Dwa", "Trzy", "Cztery", "Piec"}; for(int i = 0; i < 5; ++i) { cout << tab[i] << '\n'; } } int main() { wyswietlacz(); return 0; }
#ifndef CLIENT #define CLIENT #include <boost/asio.hpp> #include <boost/asio/ssl.hpp> #include <boost/array.hpp> #include <string> #include "message.h" class Client{ public: Client(boost::asio::io_service& io_service, boost::asio::ssl::context& ctx); void connect_to_server(); int connected; int authenticate...
// Distributed with a free-will license. // Use it any way you want, profit or free, provided it fits in the licenses of its associated works. // BNO055 // This code is designed to work with the BNO055_I2CS I2C Mini Module available from ControlEverything.com. // https://www.controleverything.com/products #include <Wi...
#ifndef HEADER_CURL_SMTP_H #define HEADER_CURL_SMTP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| ...
#ifndef _ROS_mag_calibration_mag_values_h #define _ROS_mag_calibration_mag_values_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" #include "std_msgs/Header.h" namespace mag_calibration { class mag_values : public ros::Msg { public: std_msgs::Header header; float...
#include "Zombie.hpp" Zombie::Zombie() : name_("default_name"), type_("default_type") { } Zombie::~Zombie() { std::cout << this->name_ << " scream: "<<"Arghh.h..h....\n"; } Zombie::Zombie(const std::string &name, const std::string &type = "default_type") : name_(name), type_(type) { } void Zombie::set_name(const s...
#pragma once #include "bricks/core/object.h" #include "bricks/core/time.h" #include "bricks/core/copypointer.h" namespace Bricks { namespace Threading { namespace MutexType { enum Enum { Lock, RecursiveLock }; } class Mutex : public Object, NoCopy { protected: MutexType::Enum type; void* mutexHand...
class SampleInfo{ float volume; };
/* * Project PlantMonitor * Description: * Author: * Date: */ #include <I2CSoilMoistureSensor.h> I2CSoilMoistureSensor soilSensor; bool published=false; int numOfReads=0; int readsTotal=0; #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #include <math.h> #include <HttpCli...
// Copyright (c) 2020 The Orbit 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 <gtest/gtest.h> #include <chrono> #include <thread> #include "OrbitBase/Profiling.h" TEST(Profiling, MonotonicClock) { uint64_t t0 = Monoto...
class Solution { public: vector<vector<string>> solveNQueens(int n) { vector<vector<string>> res; vector<vector<int>> mark; vector<string> item; for(int i = 0; i < n; i ++) { mark.push_back(vector<int>()); for(int j = 0; j < n; j ++) { ...
#include<cstdio> #include<cstring> #include<cctype> #include<algorithm> #include<queue> using namespace std; const int maxn=222222; char s[maxn]; int len[maxn], n=0, l[maxn], r[maxn], ans=0; int main(){ #ifndef ONLINE_JUDGE freopen("in","r",stdin); #endif char ch; s[n++]='$', s[n++]='#'; while(s...
// Created on: 1993-06-17 // Created by: Jean Yves LEBEY // 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 "precompiled.h" #include "q3shader/q3shadercache.h" #include "q3shader/q3shader.h" #include "q3shader/q3shaderpass.h" #include "render/render.h" namespace q3shader { Q3Shader::parse_map Q3Shader::s_parseMap; static void init(); } using namespace q3shader; REGISTER_STARTUP_FUNCTION(Q3Shader, Q3Shader::ini...
#include <Wire.h> #define I2C_SLAVE_ADDRESS 0x4 int i=0; void setup() { Wire.begin(I2C_SLAVE_ADDRESS); Wire.onRequest(requestEvent); //pinMode(PB4, 1); //digitalWrite(PB4, HIGH); } void loop() { } void requestEvent() { Wire.write(i); i++; }
#pragma once #include <iostream> #include <string> #include <vector> #include <map> #include <memory> typedef unsigned short int u16; typedef unsigned int u32; #if defined(WIN32) || defined(_WIN32) #include <Windows.h> #endif using namespace std; //protobuf #include "ProtoBuf\pb.h" #pragma comme...
// Copyright 2017 The WCT(Wisdom City Times) Authors. All rights reserved. #ifndef CHROME_BROWSER_UI_VIEWS_TABS_MOVING_POPUP_THUMBNAIL_H_ #define CHROME_BROWSER_UI_VIEWS_TABS_MOVING_POPUP_THUMBNAIL_H_ #include <map> #include <memory> #include <vector> #include "base/macros.h" #include "chrome/browser/ui/views/tabs/p...
// Created by: Peter KURNEV // 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 General Public License version 2.1 as published // by the Free S...
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*- * * Copyright (C) 1995-2002 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #ifndef XSLT_UTILS_H #define XSLT_UTILS_H #ifdef XSLT_SUPPORT #include ...
#pragma once namespace jsgame { void init(); }
#include <stdio.h> #include <iostream> #include <cmath> #include <algorithm> #include <memory.h> #include <set> #include <map> #include <queue> #include <deque> #include <string> #include <string.h> #include <vector> #include <ctime> typedef long long ll; typedef long double ld; typedef unsigned long long ull; const l...
#include "../lexertl/rules.hpp" enum cpp_id {T_ERROR, T_AND_ALT = 1, T_ANDASSIGN_ALT, T_ANDAND_ALT, T_OR_ALT, T_ORASSIGN_ALT, T_OROR_ALT, T_XORASSIGN_ALT, T_XOR_ALT, T_NOTEQUAL_ALT, T_NOT_ALT, T_COMPL_ALT, T_IMPORT, T_ARROWSTAR, T_DOTSTAR, T_COLON_COLON, ...
#include <deque> #include <iostream> std::deque<int> q; int main() { q.push_back(3); std::cout << q[0] << std::endl; return 0; }
#include<iostream> int foo() { int a = 0; return a; }
// MickeLedToggle.h #ifndef _MICKELEDTOGGLE_h #define _MICKELEDTOGGLE_h #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif #define MAX_NUM_OF_OUTPUTS_FOR_PULSING_LEDS 8 /* Creates object for enabling time controlled LED ON/OFF pulse operation. */ class MickeLedToggle {...
#pragma once #ifndef __BULLET_H__ #define __BULLET_H__ #include <glm/vec4.hpp> #include "Sprite.h" #include "SpriteSheet.h" class Bullet : public Sprite { private: glm::vec2 m_direction; float m_rotation; public: Bullet(); Bullet(glm::vec2 _pos, glm::vec2 _dir, float _angle); void draw() override; void update(...
#include "../Solution.h" string Solution::convert(string s, int numRows) { int g = numRows * 2 - 2; int a = 0; string str; if (numRows == 1) { return s; } if (numRows == 2) { for (int j = 0; j < s.length(); j = j + 2) { str.push_back(s.at(j)); ...
#include<iostream> using namespace std; int main() { cout<<"\n\t\t*** BINARY SEARCH ***\n\n"; int n,x; int first,last,middle; cout<<" Enter no. of element in array : "; cin>>n; int ar[n]; cout<<"\n Enter elements in an array : \n"; for(int i=0; i<n; i++) { cout<<" "; cin>>ar[i]; } cout<<...
#ifndef PROCESSOR_H #define PROCESSOR_H class Processor { public: float Utilization(); long TotalDifference(); void CalculateUtilization(); private: long prevTotal_ = 0; long prevIdle_ = 0; long totalDifference_ = 0; float utilization_ = 0.0f; }; #endif
#include <iostream> #include <algorithm> class num_iterator { protected: int i; public: explicit num_iterator(int position = 0) : i{position} {} int operator*() const { return i; } num_iterator& operator++() { ++i; return *this; } bool operator!=(num_iterator const& other ) co...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2010 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Author: Jan Borsodi, Anders Ruud */ #ifndef SCOPE_WIDGET_MANAGER_H ...
// Created on: 1994-08-31 // Created by: Jacques GOUSSARD // 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 G...
#include <iostream> using namespace std; int count2s(int n); int digits(int n); int main(void){ cout << count2s(7000) << endl; return 0; } int count2s(int n){ int count = 0; int digit = digits(n); int r = n / pow(10,digit); if(r == 1){ } else if(r == 2){ digit = digit - 1; } else{ } count += (n /...
// you can use includes, for example: // #include <algorithm> // you can write to stdout for debugging purposes, e.g. // cout << "this is a debug message" << endl; int solution(vector<int> &A) { // write your code in C++14 (g++ 6.2.0) int local_max=A[0]; int global_max=A[0]; for (int i = 1; i < A.size...
#include "charwidget.h" #include <QPixmap> #include <QPalette> #include <QString> #include <QBrush> #include <QIcon> #include <QSize> #include <QFont> #include "addfrd.h" #include <QTreeWidgetItem> CharWidget::CharWidget(QWidget *parent) : QWidget(parent) { this->setWindowTitle(QString("Chat")); this->setW...
#include "../Solution.h" int Solution::maxArea(vector<int> &height) { int i = 0, j = height.size() - 1; int temp = 0; int ma = 0; while (i < j) { temp = (j - i) * min(height[i], height[j]); ma = max(ma, temp); if (height[i] < height[j]) i++; else ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2009 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef WEBSERVERERROR_H #define WEBSERVERERROR_H #ifdef WEBSERV...
#ifndef wali_wpds_WITNESS_RULE_GUARD #define wali_wpds_WITNESS_RULE_GUARD 1 /*! * @author Nicholas Kidd */ #include "wali/Common.hpp" #include "wali/Printable.hpp" #include "wali/Key.hpp" #include "wali/witness/Witness.hpp" #include "wali/wpds/Rule.hpp" namespace wali { using wpds::Rule; using wpds::rule_t; ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** 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. */ #ifndef VEGAFILTERMERGE_H #define VEGA...
// Copyright (c) 2023 ETH Zurich // // 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/assert.hpp> #include <pika/command_line_handling/get_env_var_as.hpp> #inclu...
#include<cstdio> using namespace std; int b[1001];//储存各情况的数量 int zz(int a) { if(b[a]!=0) return b[a];//返回数组内值 int s1=1;//赋初值,即它本身 s1+=a/2; for(int i=1;i<=a/2;i++) s1+=zz(i)-1;//数量累加 ,累加时减去 它本身 b[a]=s1;//给数组赋值 return s1; } int main() { int a; scanf("%d",&a); int s=zz(a); //输入输出 ...
#include "include/Symbol.h" const string Symbol::EPSILON("ε"); const string Symbol::END("$"); Symbol::Symbol() { this->str = EPSILON; this->type = SymbolType::TERMINATOR; } Symbol::Symbol(string str, SymbolType type) { this->str = str; this->type = type; } string Symbol::getStr() const { return this->str; } S...
#include "object.h" Object::Object() { posAnimation = new QPropertyAnimation(this, "pos"); rotationAnimation = new QPropertyAnimation(this, "rotation"); } QRectF Object::boundingRect() const { int height = image.height(); int width = image.width(); return QRectF(-height / 2, -width / 2, height, wi...
#include<bits/stdc++.h> using namespace std; int m, n; int b[100]; int has[100]; void input(){ memset(has, 0, sizeof(has)); int x; cin >> m; for(int i = 0; i < m; i++){ cin >> x; has[x]++; } cin >> n; for(int i = 0; i < n; i++) cin >> b[i]; } int count(){ int result = 0; for(int i = 0;...
#ifndef WIZARD_H #define WIZARD_H #include "BreadCrumbs.h" #include "ErrorLabel.h" #include "TimedProgressBar.h" #include "WizardButtons.h" #include "WizardPage.h" #include <QWidget> #include <QLabel> #include <QWizard> namespace RsaToolbox { class BreadCrumbs; class WizardButtons; class WizardPage; typedef QList...
/* * File: Esfera.cpp * Author: raul * * Created on 21 de enero de 2014, 11:17 */ #include "Esfera.h" Esfera::Esfera() { } Esfera::Esfera(GLdouble radius, GLint slices, GLint stacks) : ObjetoCuadrico() { _radius = radius; _slices = slices; _stacks = stacks; } void Esfera::dibuja() { glPush...
//Dave Bryant, 10/19/2011 #include <iostream> #include <fstream> #include <cstdlib> #include <list> #include <cmath> #include <time.h> using namespace std; #include "triangle.h" main() { srand(time(NULL)); cout << rand() % 20000; }
#ifndef APPLICATION_MANAGER_H #define APPLICATION_MANAGER_H #include "DEFS.h" #include "Statements\Statement.h" class Input; class Output; //Main class that manages everything in the application. class ApplicationManager { enum { MaxCount = 200 }; //Max no of statements/connectors in a single flowchart private: P...
/* * **************************************************************************** * * * * * Copyright 2008, xWorkshop Inc. * * * All rights reserved. * *...
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, instal...
#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...
// FIRST METHOD #include <iostream> using namespace std; int searchElement(int a[], int n, int key) { int start = 0, end = n-1; int mid; while(start <= end) { mid = start + (end - start) / 2; if( a[mid] == key) return mid; //Element is present in first line ...
#include <vector> #include <string> #include <iostream> #include <fstream> #include <sstream> #include <list> #include <algorithm> #include <sstream> #include <set> #include <cmath> #define INF (1<<20) #define MAX 101 using namespace std; class MarbleDecoration { public: int maxLength(int R, int G, int B) { vec...
#include "Game.h" #include "CLArguments.h" #include "csvparser.h" #include <iostream> int main(int argc, char** argv) { //die CLArguments initialisieren cppag::CLArguments::CLArguments(argc, argv); Game myGame = Game(); //initialisieren if(myGame.init()) myGame.run(); else std...
#ifndef topology_hpp #define topology_hpp #include <stdio.h> #include <vector> #include <set> #include <string.h> #include "../tiny-dnn/tiny_dnn/tiny_dnn.h" using tiny_dnn::vec_t; class Topology { std::vector<std::pair<vec_t, double>> vals; std::vector<std::set<int>> structure; public: void init(char *t...
// // Created by 钟奇龙 on 2019-05-12. // #include <iostream> #include <vector> using namespace std; /* * 有一个出现奇数次的数 */ int printOddTimesNum1(vector<int> arr){ int res = 0; for(int num:arr){ res ^= num; } return res; } /* * 有两个出现奇数次的数 */ vector<int> printOddTimesNum2(vector<int> arr){ int a...
// // Created by Masayuki IZUMI on 5/8/16. // #include <OpenNI.h> #include <pcl/console/parse.h> #include <pcl/console/print.h> #include <pcl/filters/filter.h> #include <pcl/io/pcd_io.h> #include <boost/filesystem.hpp> #include <thread> #include "pctools/ni_device.hpp" namespace pc = pcl::console; typedef pcl::Po...
#include <bits/stdc++.h> using namespace std; int main() { double a,b,c,s,d; while(scanf("%lf %lf %lf",&a,&b,&c)!=EOF){ s=(a+b+c)/2; d=sqrt(s*(s-a)*(s-b)*(s-c))*(4.00/3.00); if(d>0.0) printf("%0.3lf\n",d); else { d=-1.00; printf("%0.3lf\n"...
#include "TextureManager.h" #include "debug/Logger.h" using namespace std; TextureManager* TextureManager::m_instance = NULL; vector<TextureLoader*> TextureManager::m_textures; TextureManager::TextureManager() { m_instance = this; m_rootDirectory = NULL; } TextureManager::~TextureManager() { while(!m_textures.em...
/**************************************** Zerus97 *****************************************/ #include <bits/stdc++.h> #define loop(i,s,e) for(int i = s;i<=e;i++) //including end point #define pb(a) push_back(a) #define sqr(x) ((x)*(x)) #define CIN ios_base::sync_with_stdio(0); cin.tie(0); #define ...
#pragma once #include <QScopedPointer> #include "Serializable/Object/SerializableObject.h" class Entity : SerializableObject { public: // :: Lifecycle :: // :: Constructors :: Entity(int id = 0); // :: Copy :: Entity(const Entity &other); Entity &operator=(const Entity &other); // :: Move :: Entity(...
#ifndef INC_GPENGINE_GPMATH_MAT4_H #define INC_GPENGINE_GPMATH_MAT4_H #include<cstdint> #include<algorithm> #include"Math.hpp" #include"Vec4.hpp" //Forward declaration namespace GPEngine { namespace GPMath { class Mat4 { float elements[16]; float& operator[](int index) { return this->elements[index];...
// Copyright (c) 2020 [Alekhya Vakkalagadda]. All rights reserved. #ifndef FINALPROJECT_MYLIBRARY_EXAMPLE_H_ #define FINALPROJECT_MYLIBRARY_EXAMPLE_H_ #include <mylibrary/tilestate.h> #include "ship.h" #include <string> namespace mylibrary { const int kGridSize = 7; const int kShipASize = 3; const int kShipBSize = ...
#pragma once #include "Nodes/ConstSingleValueNode.hpp" #include "ConstStorageBuilder.hpp" #include "VariableStorageBuilder.hpp" #include "BuilderToNodeMaps.hpp" #include "ConstNodeBuilder.hpp" #include <memory> struct ConstSingleValueNodeBuilder : ConstNodeBuilder { std::unique_ptr<ConstNode<BNN_TYPE>> build(Cons...
#include <iostream> #include <unordered_map> struct coord { int x; int y; }; namespace std { template<> struct hash<coord> { using argument_type = coord; using result_type = size_t; result_type operator() (argument_type const& c) const { return static_cast<result_type>(c.x) + static_cast...
#ifndef KEY_EVENT_HPP #define KEY_EVENT_HPP #include "Event.hpp" #include "windows.h" /* * @author: Grzegorz Mirek */ class KeyEvent : public Event { private: int keyCode; public: KeyEvent(int keyCode); void trigger() override; private: INPUT createKeyDownInput(); INPUT createKeyUpInput(); INPUT createKeyInput...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "UObject/Interface.h" #include "SMITElabs/Public/SLVulnerable.h" #include "SLDangerous.generated.h" class ISLVulnerable; // This class does not need to be modified. UINTERFACE(MinimalAPI) cl...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; 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. */ #include "core/pch.h" #ifdef M2_SUPPORT #include "adjunct/desk...
#include <string> #include "greeter.h" namespace HelloWorld { int Greeter::count_ = 0; Greeter::Greeter(std::string who) { ++count_; who_ = who; } Greeter::~Greeter() { --count_; } int Greeter::count() { return count_; } } // namespace HelloWorld
#include "WorkArea.h" WorkArea::WorkArea() { } WorkArea::WorkArea(string name, vector<Unit*> stations) { AreaName = name; Stations = stations; } void WorkArea::AddToOverflow(list<Unit> &Overflow, Unit MOT) { Overflow.push_back(MOT); return; } void WorkArea::AddToRework(vector<Unit> &Rework, Unit MOT) { Rew...
#ifndef _SPRITE_STATE_MOVE_H_ #define _SPRITE_STATE_MOVE_H_ class SpriteAIState; #include "spritestate.h" class SpriteStateMove : public SpriteState { public: SpriteStateMove(); ~SpriteStateMove(); static SpriteStateMove* Instance(); virtual void nothing(SpriteAIState*); virtual void attacking(SpriteAIS...