text
stringlengths
8
6.88M
#pragma once namespace Singularity { namespace Components { class GameObject; class Component; class Extension; class Scene; class Transform; } } #include "components\Singularity.Components.Defines.h" // dependencies #include "common\Singularity.Common.h" #include "core\Singular...
#include "imageencryption.h" #include "cryptionwindow.h" #include <QDebug> #include <QFile> #include <QMessageBox> #include <math.h> #include <QRgb> ImageEncryption::ImageEncryption(QObject *parent) : QThread(parent) { } void ImageEncryption::initSettings(QFile* fileRead, QFile* fileSave, bool useAlpha, bool useForFo...
// Created by wangwenjie on 2013/12 #ifndef __NPC_TALKING_H__ #define __NPC_TALKING_H__ #include "cocos2d.h" #include "LBLibraryBase.h" #include "PrincessModel.h" #include "GuestModel.h" #include "Common.h" typedef std::function<void ()> NpcTalkEndCallBack; template <typename T> T Edge(T i, T x, T w) { T i_k = x...
#include "device.h" #include "listD.h" #ifndef DISPATCHER_H #define DISPATCHER_H class Dispatcher { private: List tasks; List queue; public: Dispatcher (); void addTask (void (*f)(), uint16_t c); void tickTask (); void checkTasks (); void checkQueue (); }; #endif /* LIST_H_ */
//--------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "Windows.h" #include "Unit2.h" #include "Unit1.h" //--------------------------------------------------------------------- #pragma resource "*.dfm" Tkeyboard *keyboard; int pos1 = 0 ; // ***** varibile di ...
#include "Common.h" #include <sstream> #include <tuple> #include <unordered_map> auto parseTicket(std::string &str) { std::stringstream ss(str); std::vector<std::vector<long>> numbers; std::string id; std::getline(ss, id, '\n'); while (std::getline(ss, id, '\n')) { std::vector<long> list; std::strin...
#include "Database.h" namespace FaceIdentifier { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// <summary> /// Summary for DetectFace /// </summary>...
#pragma once #include "common.h" #include "Grammar.h" #include "Geometry.h" #include <ctime> #include "Camera.h" #include <string> #define TREE_NUMS 120 #define TREE_LEVEL 4 #define LEAF_WIDTH 0.1f struct State { glm::vec3 pos; glm::vec3 dir; float length; float radius; int level; }; struct Trunk { glm::vec3 s...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.Media.Protection.2.h" WINRT_EXPORT namespace winrt { namespace Windows::Media::Protection { template <typename H> struct impl_ComponentLoadFailedEventHandler : implements<i...
#include <IRremote.h> //including infrared remote header file int RECV_PIN = 7; // the pin where you connect the output pin of IR sensor IRrecv irrecv(RECV_PIN); decode_results results; int value; //configure Timer 1 (pins 9,10) to output 25kHz PWM void setupTimer1() { //Set PWM frequency to about 25khz on pin...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
#include <iostream> using namespace std; int main(){ int nlines; cout << "no of lines: "; cin >> nlines; for(int i=0; i< nlines; i++){ for(int j=1; j<=i+1; j++){ cout << "*"; } cout << endl; } cout << "" << endl; for(int i=0; i< nlines; i++){ for(int j=nlines-i; j>=1; j--){ cout <<...
//--------------------------------------------------------------------------- #ifndef OverallSettingsFormH #define OverallSettingsFormH //--------------------------------------------------------------------------- #include <System.Classes.hpp> #include <Vcl.Controls.hpp> #include <Vcl.StdCtrls.hpp> #include <Vcl.Forms...
// // ViewBall.cpp // alfrid // // Created by Yi-Wen Lin on 2016/5/29. // // #include "ViewBall.hpp" #include "Geom.hpp" ViewBall::ViewBall() : View("shaders/general.vert", "shaders/simpleColor.frag") { _init(); } void ViewBall::_init() { mesh = Geom::sphere(1); } void ViewBall::render(Vec3f mPosition, ...
// © Kay Sievers <kay@versioduo.com>, 2020-2022 // SPDX-License-Identifier: Apache-2.0 #pragma once #include <cstdint> class V2Potentiometer { public: const struct Config { // The number of steps to map the measurement to. // 128 steps will emit values from 0 to 127. uint16_t nSteps; // The normal...
//************************************************************************** //** //** See jlquake.txt for copyright info. //** //** This program 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 ...
#ifndef __CUSTOM_TO_RUBY_H__ #define __CUSTOM_TO_RUBY_H__ #include <rice/Object.hpp> #include <rice/Hash.hpp> #include <rice/to_from_ruby.hpp> #include "OIS.h" template<> Rice::Object to_ruby<short int>(short int const & a); template<> OIS::ParamList& from_ruby<OIS::ParamList&>(Rice::Object x); #endif
#pragma once #include<iostream> #include<fstream> #include <string> #include<sstream> #include<vector> #include<ctime> #include "TriMesh.h" #include "TriMesh_algo.h" #include "namepoint.h" #include"sparse_solver_eigen.h" #include"Eigen\Dense" #include"SamplePoissonDisk.h" using namespace std; using namespace trimesh; ...
#include<iostream> using namespace std; //每一块内存都有它的地址编号(十六进制) //如果每创建一个数据,都去记录它对应的地址编号,是很不方便的。所以引入变量来获取数据。 //所以如果知道某个数据的地址编号的话,也可以获取数据。 //可以通过新建一个变量,让它来存储另一个数据的地址。成为指针变量。 //简单说,指针也就是一个地址。 //定义指针: 数据类型 * 指针变量名; //&是取地址符 //*代表解引用,可以找到指针指向内存中的数据 //指针变量 = &普通变量;//将普通变量的 地址 赋值给指针变量 //普通变量 = *指针变量;//将指针变量所指向的 数据 赋值给普通变量 int...
#include "ObjFile.h" #include<sstream> #include<fstream> using namespace std; namespace gg { ObjFile::ObjFile(string _fileName, Material _material) : DrawingObject(_material), fileName(_fileName) {} ObjFile::ObjFile(const ObjFile& _obj) :DrawingObject(_obj) { fileName = _obj.fileName; indices.resize(_obj.i...
#pragma once #ifdef LINUX #include <unistd.h> #else #include <windows.h> #endif //LINUX #include <string> #include <iostream> #include <algorithm> #include "Engine.h" #include "Cube.h" #include "Material.h" #include "TextureTestAlpha.h" #include "Mesh.h" #include "text2D.h" #include "Events.h" #include "CameraManager....
// Clang includes #include "clang/AST/ASTConsumer.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" #include "clang/AST/Type.h" #include "clang/AST/Expr.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Basic/Diagnostic.h" #include "clang/Front...
#include "mainwindow.h" #include <QApplication> #include <iostream> #include <vector> #include <QDir> #include <opencv2/opencv.hpp> #include <ctime> #include <QDebug> #include <QTextCodec> #include <QtSql/QSqlDatabase> #include <QtSql> using namespace cv; using namespace std; vector<double> wish_exit(94); vector<vect...
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QMessageBox> #include <QString> #include <QByteArray> #include <QTableWidget> #include <QEvent> #include <QTableWidgetItem> #include <QTimer> #include <QTime> #include "windows.h" #include "winnt.h" #include <tlhelp32.h> #include <psapi.h> #include <fileapi....
#include "openmp_centralized_barrier.h" #include <omp.h> #include <stdio.h> OpenMP_Centralized_Barrier::OpenMP_Centralized_Barrier(int num_procs, bool sense, OpenMP_Centralized_Barrier_Shared* shared_vars){ //Initializing the private variables for each processor this->num_processors = num_procs; this->local_se...
#include<bits/stdc++.h> using namespace std; int vo[200010]; int va[200010]; map<int, int> os; map<int, int> as; // int os[200100]; // int as[200100]; long long int total = 0; int a, b, k; int aux; int main(){ int t; scanf("%d", &t); while(t--){ os.clear(); as.clear(); // for (int i =...
#include "common.h" #include <fstream> #include <stdio.h> #include <time.h> #include <sstream> #include <string> #ifdef WIN32 int gettimeofday(struct timeval *tp, void *tzp) { time_t clock; struct tm tm; SYSTEMTIME wtm; GetLocalTime(&wtm); tm.tm_year = wtm.wYear - 1900; tm.tm_mon = wtm.wMonth -...
#include "PermutationSequence.hpp" string PermutationSequence::getPermutation(int n, int k) { // prepare initial candidates: 1...n string s(n, '0'); for (int i = 0; i < n; i++) s[i] += i + 1; // prepare the initial factorial number: (n - 1)! int base = 1; for (int i = 1; i < n; i++) ...
#pragma once #include "IScriptable.h" #include "misc.h" #include "pole.h" #include <vector> static char* iso8859_1_to_utf8(const char* str, const size_t length) { char* const utf8 = new char[1 + 2 * length]; // worst case char* c = utf8; for (size_t i = 0; i < length; ++i, ++str) { if (*str & 0x80) { *c+...
/** * Author : BurningTiles * Created : 2020-08-06 23:14:03 **/ #include <bits/stdc++.h> using namespace std; int main(){ int t=3; double m=1471, r=12; while(t--){ m *= (1+r/1200); m -= 500; } cout << m; return 0; } /** **/
/** * Square matrix, for gyroscope calculations. * * Jason Leake October 2019 */ #pragma once #include <iostream> #include <ostream> /** * Class encapsulates a 3x3 matrix */ class SquareMatrix { private: // Column and row indices static constexpr const int ELEMENTS[3]{0, 1, 2}; static constexpr const si...
#include "modify.h" #include "graphic.h" int beginning(QTextEdit *&uiInput, QTextEdit *&uiOutput, QGraphicsScene *&scene) { BinTree *tree = nullptr; QString output = processing(uiInput->toPlainText(), tree); uiOutput->setPlainText(output); if (!output.count("Error")) graphic(tree, scene); e...
#ifndef _mamager_h_ #define _mamager_h_ #include <iostream> class HMMathod { public: virtual void* InitBitmap(int w, int h, int type) = 0; virtual void DeleteBitmap(void *haldle) = 0; virtual void SetPixel(void *haldle, int w, int h, int color) = 0; virtual void DrawBitmap(void *distHaldle, void *srcH...
/* Copyright (C) RVRS Industriis <http://rvrs.in> This program 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 2 of the License, or (at your option) any later version. This program is distributed ...
#include <iostream> #include <iomanip> void square_table(int n) { std :: cout << std :: setw(15) << "x |" << std :: setw(15) << "x^2" << '\n'; std :: cout << '\n'; for(unsigned long long int i = 1; i < n; ++i) { std :: cout << std :: setw(15) << i << " |" << std :: setw(15) << i*i << '\n'; } } int main() { ...
#pragma once #include "directxmath.h" #include "Texture.h" #include "Light.h" #include "Mesh.h" #include "Point.h" #include "LoadCMOModel.h" #include <mutex> namespace GameEngine { class Rasterizer { public: Rasterizer(); void SetFrameBuffer(byte* buffer, unsigned int width, unsigned int height); void Clear()...
/* ASSIGNMENT 4 - COEN 244 Jean-Baptiste WARING 40054925 FAROUQ HAMEDALLAH 40087448 HOSPITAL MANAGEMENT SYSTEM */ #include "./person.h" #include "./date.h" #ifndef BED_H #define BED_H using namespace std; class Bed { private: string serial; bool available; string BED_SER[500] = {"00Z587S1V", "02R687SBC", "04448...
#pragma once #include "Analysis/Partition.h" #include "Optimization/PartitionOptimizer.h" #include <memory> #include <vector> namespace pdg { class PDG; } namespace vazgen { class Logger; class PartitionOptimization { public: using PDGType = std::shared_ptr<pdg::PDG>; public: PartitionOptimization(Partit...
// compile with `g++ -std=c++17 -lgmpxx -lgmp Project.cpp` #include <iostream> #include <vector> #include <map> #include <experimental/optional> #include <sstream> #include <algorithm> #include <gmpxx.h> template <typename T> using vector_optional = std::vector<std::experimental::optional<T>>; using u64 = unsigned ...
// // Created by ivan on 5/10/18. // #ifndef MATHGL_MODULE_MGLGRAPHICSOBJECT_H #define MATHGL_MODULE_MGLGRAPHICSOBJECT_H #include <mgl2/mgl.h> #include "functionArg.h" /** * Interface with abstract function draw() and virtual destructor; * This class is used in MathGLGraphics */ class MathGLGraphicsObject { public...
#pragma once #include <string> class DemoLetter { public: std::string letter; DemoLetter(); virtual ~DemoLetter(); virtual void DisplaySomething(); // to setup c style function ptr static void DroppedCallBackFunc(DemoLetter* _Me); };
#include "NumberTile.hpp" #include "Board.hpp" #include "Global.hpp" #include <AnimationPlayer.hpp> namespace godot { void NumberTile::_register_methods() { register_method("_ready", &NumberTile::_ready); register_method("_process", &NumberTile::_process); return; } voi...
#include <Arduino.h> #include <M5Stack.h> #include <WiFi.h> #include <WebSocketClient.h> #include <ArduinoJson.h> #include <M5ez.h> #include <ezTime.h> #include "UbuntuMono_Regular16pt7b.h" #include "UbuntuMono_B18pt7b.h" #include "UbuntuMono_R18pt7b.h" #include "LittleLordFontleroyNF60pt7b.h" #define DEG2RAD 0.017453...
/* Name: Mohit Kishorbhai Sheladiya Student ID: 117979203 Student Email: mksheladiya@myseneca.ca Date: 21/02/05 */ #ifndef SDDS_FOOD_H_ #define SDDS_FOOD_H_ namespace sdds { class Item { char m_itemName[31]; int m_cal; int m_meal; void setName(const char* name)...
#include <cstdio> #include <vector> using namespace std; typedef pair<int, int> pii; #define eb emplace_back #define f first #define s second const int MXN = 555 + 5, MOD = 1e9 + 21; int N, M, Q, dist[MXN][MXN], dp[MXN][MXN]; vector<pii> adj[MXN]; int u, v, w; void init() { scanf("%d%d", &N, &M); for (int...
#pragma once #include "car.h" class Bcar : virtual public Car { public: Bcar(); void MoveY(int num_move); void set_next(Bcar*); Bcar* get_next() const; private: Bcar* next_; };
#include <bits/stdc++.h> using namespace std; char str[30][30]; bool seen[30][30]; int n,row,col; int dx[]={1,-1,0,0,1,1,-1,-1}; int dy[]={0,0,-1,1,-1,1,-1,1}; void dfs(int x,int y) { if(seen[x][y])return; ///cout<<"fx = "<<x<<", fy = "<<y<<endl; seen[x][y]=1; for(int i=0;i<8;i++) { int fx=...
#pragma once #include "ofMain.h" class ofxGpuThicklines { public: ofxGpuThicklines() : m_shaderBegun(false) { } virtual ~ofxGpuThicklines() { ; } /// `positions` and `colors` should be vectors of equal length containing the data /// for each point. /// each element of `curves` describes a single...
/* * AvlPaginaDisco.hpp * * Created on: 28/06/2015 * Author: LuizF */ #ifndef AVLPAGINADISCO_HPP_ #define AVLPAGINADISCO_HPP_ #include <iostream> #include <string.h> #include <stdlib.h> #include <stdio.h> #include <sstream> #include <fstream> #include <ctime> #include <dirent.h> #include <iosfwd> #include <...
#include <sstream> #include <vector> #include "screen/Screen.h" #include "translator/Translator.h" std::string DagToText(const std::string& input); class GraphDAG : public Translator { public: ~GraphDAG() override = default; const char* Identifier() final { return "GraphDAG"; } const char* Name() final { retu...
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // # DARK PLUGIN - POWERED BY FIRE TEAM // # GAME SERVER: 0.97.40T (C) WEBZEN. // # VERSÃO: 1.0.0.0 // # Autor: Maykon // # Skype: Maykon.ale //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // # O S...
#pragma once #include <stdint.h> #include <ecstasy/core/Component.hpp> struct PlayerComponent: public Component<PlayerComponent> { float lookDirX = 0; float lookDirY = 0; uint64_t packetNumber = 0; };
#include <PubSubClient.h> #include <ESP8266WiFi.h> #define WIFI_SSID "XXXXXXXXXXXX" #define WIFI_PASSWORD "XXXXXXXXX" #define TOKEN "XXXXXXXXXXXX" char cloudServer[] = "XXXXXXX"; WiFiClientSecure wifiClient; int LDR = A0; PubSubClient client(wifiClient); unsigned long lastSend; void setup() { Serial.begin(115...
/************************************************************************************ * * * 국민대학교 컴퓨터 공학부 20123417 조성룡 * * 프로그램 명: InfixtoPostfix * * 설 명: 수식을 입력 받고 수식을 Postfix로 변환하여 변환된 식을 출력, 연산 * * 알 고 리 즘: 스택을 이용해 Postfix로 변환한다. 입력값 중 '$' 입력되면 입력중단, * * 반복문을 빠져나온다. ...
#include "Monster.h" Monster::Monster() { bInstanceof_Monster = true; } Monster::~Monster() { } void Monster::setData(char *buf, int offset) { mType = (int)buf[offset] & 0xff; mIndex = (int)buf[offset + 1] & 0xff; ResMagicChain *magicChain = (ResMagicChain *)DatLib::GetRes(DatLib::RES_MLR, 1, (int)...
/*----------------------------------------------------------------------------* * 파일명 : sinSkill.h * 하는일 : 아이템 관리 * 작성일 : 최종업데이트 12월 * 적성자 : 박상열 *-----------------------------------------------------------------------------*/ #define SIN_MAX_SKILL 160 //넓게 잡아놓는다 #define SIN_MAX_USE_SKILL 17 //한캐릭에서 사용할수...
#ifndef MOTIONCAPTURER_H #define MOTIONCAPTURER_H #include <windows.h> #include <iostream> #include <fstream> #include <stdio.h> #include "parser.h" // for bvh parser, assume MAX MAX_CHILDREN joints from a root typedef struct Node Node; #define MAX_CHILDREN 10 // max 10 child nodes (joints) from a ...
//----------------------------------------------- // // This file is part of the Siv3D Engine. // // Copyright (c) 2008-2018 Ryo Suzuki // Copyright (c) 2016-2018 OpenSiv3D Project // // Licensed under the MIT License. // //----------------------------------------------- # include <Siv3D/Platform.hpp> # if defined(SI...
#include<stdio.h> #include<iostream> #include<iomanip> #include<math.h> using namespace std; int main(){ float a = 3576.76754646484684844646468468468; printf("%.2f\n",a); //printing 3576.77 cout<<std::setprecision(2)<<a<<endl; //printing 3.6e+003 cout<<round(a*100)/100.0<<endl;; //printing 3.6e+003 ...
#pragma once #include "AlgorithmRunningTime.h" #include "Generator.h" class RunningTimeTester { AlgorithmRunningTime algorithmRunningTime; Generator generator; public: void test(string resFilePath, int testNum, int testOffset); };
#ifndef STRING_HELPER_H #define STRING_HELPER_H #include <algorithm> #include <functional> #include <cctype> #include <locale> #include <string> #include <sstream> #include <vector> #include <exception> #include <map> namespace POICS{ typedef std::pair<double, double> SolutionMeta; // SolutionMeta : <score, dista...
void move_m(int md,int me){ //Ordem para os motores digitalWrite(4,HIGH); digitalWrite(7,LOW); analogWrite( 5, me); analogWrite( 6, md); } void move_t(int md,int me,int t) { //Ordem para os motores com tempo move_m(md,me); delay(t); move_m(0,0); } void setup() { Serial.begin(9600); //De...
/* * * Copyright (c) Kresimir Fresl 2002 * * 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) * * Author acknowledges the support of the Faculty of Civil Engineering, * University of Zagreb, Croatia. * */...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
// // View.cpp // alfrid // // Created by Yi-Wen Lin on 2016/5/29. // // #include "View.hpp" using namespace ci::app; using namespace alfrid; View::View(string vertexShaderPath, string fragmentShaderPath) { try { shader = new ci::gl::GlslProg( loadResource(vertexShaderPath), loadResource(fragmentShade...
#include "Window.h" const char* window_title = "GLFW Starter Project"; GLuint Window::skyboxShader; GLuint Window::waterQuadShader; GLuint Window::shipShader; GLuint Window::terrainShader; Skybox * cube; WaterQuad * quad; OBJObject * ship; Terrain * terrain; BoundingBox * box; float rotCount = 0.0f;...
#include<cstdio> #include<iostream> #include<algorithm> #include<string> using namespace std; int main() { string num; //string::iterator it; int E_pos,E,neg_tag; cin >> num; if(num[0] == '-') neg_tag = 1; else neg_tag = 0; E_pos = num.find("E"); E = 0; for(int i = E_pos+2; i < nu...
# include <SoftwareSerial.h> SoftwareSerial HM10(2, 3); void setup () { Serial.begin(9600); HM10.begin(9600); HM10.println("AT"); } void loop () { if (HM10.available()) { Serial.write(HM10.read()); } if (Serial.available()) { HM10.write(Serial.read()); } }
#include <iostream> #include <vector> #include <list> #include <stack> using namespace std; vector<int> cats; struct Graph{ vector<list<int>> nodes; vector<bool> visits; stack<int> my_stack; int max, leaves; Graph(int n, int m){ nodes.resize(n); visits.resize(n); this->max = m; leaves = 0; list<int> te...
#pragma once #include "Ball.h" #include "CollisionEvent.h" #include "HitObject.h" #include "Vertex2D.h" class LineSeg : public HitObject { public: LineSeg(); LineSeg(const Vertex2D& p1, const Vertex2D& p2, const float zlow, const float zhigh); virtual float HitTest(const BallS& ball, const float dtime, CollisionE...
#include "stdafx.h" #include "Room.h" Room::Room(int x, int y, Square* parrent, Level* level) : Square(x, y, parrent, level) { special = 0; description = "Geen Beschrijving"; int healerRandom = rand() % 5; if (healerRandom == 1) { healer = true; generateRoomType(6); } else { healer = false; generateRoomType(0...
#include "Player.h" #include "Board.h" #include "Piece.h" #include "Square.h" #include "Constants.h" #include <iostream> #include <vector> Player::Player(Color color, Board* board) { this->board = board; this->color = color; for (int i = 0; i < 8; i++) { Piece* pawn = new Pawn(color); pieces.push_back(pawn); ...
#ifndef SUPERVISOR_H #define SUPERVISOR_H #include "employee.h" #include <qlist.h> #include <qfile.h> #include <qtextstream.h> class Supervisor : public Employee { public: Supervisor(QString fio, size_t uniqueNumber, QString login, QString password, QString department); ~Supervisor(); voi...
// Copyright 2017-2018 Apex.AI, Inc. // // 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...
#include "enemy.h" #include <string> #include <iostream> enemy::enemy(){ name="Monster"; cry="Grah!"; death_cry="Argh!"; hpstat=3; atkstat=30; spatkstat=30; defstat=40; spdefstat=40; hp=hpstat; atk=atkstat; spatk=spatkstat; def=defstat; spdef=spdefstat; } enemy::enemy(std::stri...
#include<bits/stdc++.h> using namespace std; int main() { // Write your code here int n; cin >> n; int target; cin >> target; int* arr=new int[n]; for(int i=0;i<n;i++) { cin >> arr[i]; } int sum=0; int k,h; int s=0; int a=0; for(k=0;k<n;k++) { su...
#ifndef CONTAINERWIDGET_H #define CONTAINERWIDGET_H // one new line #include <QFrame> class QLabel; namespace Ui { class ContainerWidget; } class ContainerWidget : public QFrame { Q_OBJECT public: explicit ContainerWidget(QWidget *parent = 0); ~ContainerWidget(); void fitAndCalc(); private: U...
class Solution { public: int search(vector<int>& nums, int target) { // 二分搜索法 往往来说,这种有序数列的查找就需要二分搜索 int n = nums.size(); if (n == 0) return -1; if (n == 1) return nums[0] == target ? 0:-1; int left = 0, right = n - 1, mid; while (left <= right) { // 二分搜索 ...
// ***************************************************************************** // Module..: Leddar // /// \file LdResultEchoes.cpp /// /// \brief Echoes result. /// /// \author Patrick Boulay /// /// \since March 2016 // // Copyright (c) 2016 LeddarTech Inc. All rights reserved. // ***************************...
#include "client_data.h"
class Solution { public: int minSubArrayLen(int s, vector<int>& nums) { int res = INT_MAX, len = nums.size(); vector<int> sums(len + 1, 0); // sums[i]=nums[0:i-1] for (int i = 1; i <= len; ++i) sums[i] = sums[i - 1] + nums[i - 1]; for (int i = 0; i < len; ++i) { ...
#include "RPCClient.hpp" #include "DataFormat.hpp" #include <rpc/client.h> #include <rpc/server.h> using namespace std; static rpc::client* rpc_client = nullptr; static rpc::server* rpc_server = nullptr; static ActorBuffer<Command>* cmd_buffer = nullptr; static int command(Command cmd) { cmd_buffer->Write(cmd)...
//========================================================== // Author: Baradzenka Aleh (baradzenka@gmail.com) //========================================================== // ///////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include <cassert> #include <algorithm> #inclu...
/*************************************************************** * Name: FuzzynetApp.cpp * Purpose: Code for Application Class * Author: Oscar Duarte (ogduartev@unal.edu.co) * Created: 2017-10-04 * Copyright: Oscar Duarte () * License: **************************************************************/ ...
// // UICard.cpp // demo_ddz // // Created by 谢小凡 on 2018/2/14. // #include "UICard.hpp" #include "audio/include/SimpleAudioEngine.h" using namespace CocosDenshion; using namespace cocos2d; enum zorder { z_base, z_suit_number, z_logo, z_mask }; UICard::UICard() : _data(nullptr) , _model(Model::HA...
#include "include/Piet.h" #include "include/cxxopts/cxxopts.hpp" #include <cassert> #include <cstdio> #include <iostream> #include <png.h> #include <stack> #include <vector> using namespace std; void print_help(const cxxopts::Options &options) { cout << options.help() << endl; } bool validate_options(const cxxopts...
// Copyright 2019 Apex.AI, Inc. // // 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 i...
#ifndef MOUSEMESSAGE_H #define MOUSEMESSAGE_H #include "../Messenger/Message.h" class CMouseMessage : public CMessage { public: enum EMouseAction { LEFT_BUTTON_DOWN, MIDDLE_BUTTON_DOWN, RIGHT_BUTTON_DOWN, LEFT_BUTTON_UP, MIDDLE_BUTTON_UP, RIGHT_BUTTON_UP, LEFT_BUTTON_DOUBLE_CLICK, RIGHT_BUTTON_DOUBL...
#ifndef GBMBDDENGINEENUM_H #define GBMBDDENGINEENUM_H /// @file GbmBddEngineEnum.h /// @brief GbmBddEngineEnum のヘッダファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2014 Yusuke Matsunaga /// All rights reserved. #include "YmTools.h" #include "YmLogic/Bdd.h" #include "YmLogic/BddMgr.h" #include "YmLogi...
#include<iostream> using namespace std; #include<vector> #include<assert.h> #include<string> //用邻接表的方式表示图 template<class W> struct GraphLinkNode { W _weight; //权重 GraphLinkNode<W*> _next; //下一个节点 size_t _src; size_t _dest; GraphLinkNode(size_t src,size_t dest,const W& weight = W()) :_weight(weight)...
/* * The IzPack Launcher * http://izpack.org/ * http://izpack.codehaus.org/ * * Copyright (c) 2004 - 2008 Julien Ponge - All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in ...
#ifndef LOADINGRECT_H #define LOADINGRECT_H #include <QObject> #include <QGraphicsPixmapItem> #include <QTimer> class LoadingRect : public QObject , public QGraphicsPixmapItem { Q_OBJECT private: int velocity; public: explicit LoadingRect(QTimer * bulletTimer , const int & velocity); signals: public...
#ifndef BUFFERDATA_H #define BUFFERDATA_H namespace avt { class BufferData { public: virtual ~BufferData(); virtual void decodeBuffer(const char* buffer) = 0; protected: BufferData(); }; } #endif /* BUFFERDATA_H */
#include "LoopCommand.h" int LoopCommand::execute() { return 3; }
#include <cmath> #include <cstdio> #include <iostream> using namespace std; typedef long long ll; struct Point { int x, y; double r, rr; Point() {} }; const double PI = acos(-1.0); const int maxn = 10; int x, xx, y, yy, n; Point point[maxn]; double dist[maxn][maxn], ans = 0; bool vis[maxn] = { false }; v...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
#include "DetectorConstruction.hh" #include "SensitiveDetector_add.hh" #include "G4Box.hh" #include "G4Isotope.hh" #include "G4LogicalVolume.hh" #include "G4NistManager.hh" #include "G4Element.hh" #include "G4PVPlacement.hh" #include "G4PVReplica.hh" #include "G4Tubs.hh" #include "G4VisAttributes.hh" #include "G4Tran...
#pragma once #define _CRT_SECURE_NO_WARNINGS #include <fcntl.h> #include <io.h> #include <string> #include <afxsock.h> #include <fstream> #include <iostream> #include <time.h> #include <conio.h> #include <Windows.h> #include <Tchar.h> using namespace std; struct TaiKhoan { string ID; string passwd; }; string rece...
#include "circ_hitbox.h" circle_hitbox::~circle_hitbox(){ } void circle_hitbox::move_x(int add_x){ position.set_x(position.get_x()+add_x); } void circle_hitbox::move_y(int add_y){ position.set_y(position.get_y()+add_y); } void circle_hitbox::move_back(){ move_x(moveback.get_x()); move_y(moveback.ge...
#include "../eternity/eternity.h" /////////////////////////////// // PATHFINDING EXAMPLE // (Tilesets from http://rivendell.fortunecity.com/goddess/268/tilesets.html) // USE WASD and the ARROW KEYS // to move the start and goal node // around respectively. // Press '4' to have 4-way grid pathfinding // or...