text
stringlengths
8
6.88M
#include "Warlock.h" Warlock::Warlock(const std::string& name, const std::string& type, int health, int damage, int mana) : SpellCaster(type, new WarlockState(name, health, damage, mana), new WarlockAttack(), new Fireball(static_cast<int>(FIREBALL::WARLOCK)), new Healing(static_cast<int>(HEALING::WARLOCK)), new DemonS...
#pragma warning (disable:4996) #include <iostream> #include <sstream> #include <cstdlib> #include <cstdio> #include <vector> #include <queue> #include <deque> #include <stack> #include <list> #include <map> #include <set> #include <ctime> #include <cmath> #include <string> #include <cctype> #include <cs...
#include"conio.h" #include"stdio.h" void main(void) { clrscr(); int feet; float meter; printf("Enter Feets = "); scanf("%d",&feet); meter=feet*0.3084; printf("\n\n%.2f Meters",meter); getch(); }
//Напишите функцию, которая принимает вектор строк и возвращает число строк, начинающихся на большую или маленькую букву "a". #include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; bool IsFirstLetterA(const string& s) { return !s.empty() && (s[0] == 'a' || s[0] == 'A')...
/** * File: World.hpp */ #include "Universe.hpp" Universe::Universe() { myCamera = new Camera(); orbsPassed = 0; /** * opengl only supports 8 lights in the way we use them. Need to keep track of which are already taken so we dont take them again. */ for (int i = 0; i < 9; i++) { lightsAvailab...
#include <cmath> #include <cstdio> #include "Circle.h" #include "Polygon.h" #include "Reuleaux.h" #include "Geom.h" // ======================================= // Constructor ========== Getter Functions ========== // ======================================= Polygon::Polygon(const vector<Point>vec) { ver...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 2007-2011 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" # ifndef POSIX_INTERNAL #define POSIX_INTERNAL(X) X # endif // D...
#include <EEPROM.h> #ifdef __AVR_ATtiny85__ #define SWITCH_PIN 0 #define RED_PIN 1 #define GREEN_PIN 2 #define BLUE_PIN 3 #else #define SWITCH_PIN 2 #define LED_PIN 3 // TODO #endif #define COLORS 7 #define STATE_IDLE 0 #define STATE_BUTTON_DOWN 1 #define STATE_BUTTON_RELEASED 2 #define STATE_TRANSITION 3 #define ST...
// // Core.cpp // GLFW3 // // Created by William Meaton on 08/12/2015. // Copyright © 2015 WillMeaton.uk. All rights reserved. // #include "Core.hpp" //for graphics using namespace Graphics; Core::~Core(){ } void Core::setup(){ Graphics::setBackground(255, 255, 255, 255); } void Core::update(){ } void Core...
// // GStartBackgroundLayer.h // Core // // Created by Max Yoon on 11. 7. 25.. // Copyright 2011년 __MyCompanyName__. All rights reserved. // #ifndef Core_GStartBackgroundLayer_h #define Core_GStartBackgroundLayer_h class GStartBackgroundLayer : public GLayer { enum { NUM_CLOUD = 5, }; privat...
#include "chunkshader.h" ChunkShader::ChunkShader(const std::string &vertexFile, const std::string &fragmentFile) : AbstractShader(vertexFile, fragmentFile) { getUniforms(); } void ChunkShader::loadProjectionViewMatrix(const Matrix4 &matrix) { loadMatrix(_locationProjectionViewMatrix, matrix); } void Chu...
#pragma once #include <memory> #include <glm/glm.hpp> class ComputeShader; class TextureCubeMap; class TimeQuery; class SkyboxGenerator { public: SkyboxGenerator(glm::ivec2 cubemapFaceDims); ~SkyboxGenerator(); /* Generates the cubemap texture */ std::shared_ptr<TextureCubeMap> Generate(glm::vec3 sunDir, flo...
#pragma once #include <glm/ext.hpp> using namespace glm; enum class PrimitiveID { NONE = 0, Plane, Sphere, AABB, Box, TOTAL }; class Primitive { public: inline PrimitiveID GetID() { return m_ID; }; protected: inline Primitive(PrimitiveID id) { m_ID = id; }; virtual ~Primitive() = 0; ...
#include<iostream> #include<cstdlib> #include<conio.h> using namespace std; // prototipo funcion int EncontrarMaximo(int x,int y); int main () { int n1,n2,mayor; cout<<"digite 2 numeros ; "; cin>>n1>>n2; EncontrarMaximo(n1,n2); getch(); return 0; } //definicion de funcion int EncontrarMaxi...
// Created on: 1996-03-08 // Created by: Jacques GOUSSARD // Copyright (c) 1996-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 <assert.h> #include <algorithm> #include <climits> #include <functional> #include <iostream> #include <numeric> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #define ll long long using namespace std; int n, k; struct Solution { void solve() { int pairs = n / 2;...
#include <iostream> using namespace std; //内联函数inline 1类内实现 2用inline关键字类内声明,实现可以写在类外 //public protected private class Clock { public: void ShowTime(); void SetTime(int h,int m,int s); private: int hour; int minute; int second; }; void Clock::ShowTime() { cout << hour << ":" << this->minute << ":" << second << en...
/*********************************************************\ * Copyright (c) 2012-2018 The Unrimp Team * * 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 the Software without * restriction, including wit...
#pragma once #include "resource.h" #include "common.h" class CAdvancedDlg { HWND hWndParent; HWND hwndDlg; INT_PTR CALLBACK DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam); protected: void OnInitDialog(); public: CAdvancedDlg(HWND hParent) : hWndParent(hParent) {} CAdvancedDlg() :hWndParen...
#pragma once #include <optional> #include <string> namespace ImageDimensions { struct SImageDimensions { uint32_t Width; uint32_t Height; }; std::optional<SImageDimensions> GetIMGDimensions(const std::string& file); }
#include <cstdio> int main() { int raio; double pi=3.14159; scanf("%d", &raio); printf("VOLUME = %.3lf\n", (4/3.0) * pi * raio*raio*raio); }
#pragma once #include "../../system.hpp" #include <memory> namespace sbg { struct Entity; struct ResultData; struct CollisionResult { CollisionResult() = default; CollisionResult(std::weak_ptr<const Entity> other, const bool colliding, std::unique_ptr<const ResultData> data, Time time); CollisionResult(const Co...
/* * Copyright 2016 Robert Bond * * 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 ...
#include <iostream> #include <conio.h> #include <cstdio> class geometri { private: int volume; // обьем int height; // высота int number_gran; // кол-во граней int size_side; // длина сторон int footprint; // площадь основания public: void setgeometri(int *i) { std::cout << "Введите обьем " << *i + 1 << " при...
#include <QDebug> #include <QNetworkDatagram> #include <QNetworkInterface> #include "udpfinderserver.h" UdpFinderServer::UdpFinderServer(QObject *parent) : QObject(parent) { startServer(89683); } void UdpFinderServer::startServer(quint16 port) { m_udpSocket.bind(port); connect(&m_udpSocket, SIGNAL(ready...
/* PROBLEM: http://codeforces.com/contest/368/problem/B NOTES: I used use maps to avoid time limit exceptions. AUTHOR: Daniel Caņizares Corrales Systems Engineer [Professor] Universidad Católica de Oriente dacanizares@outlook.com LICENCE: MIT License Copyright (C) 2013 Dani...
#include <chrono> #include <iostream> #include "xgb.hpp" #include "m2cgen.hpp" // https://stackoverflow.com/questions/22387586/measuring-execution-time-of-a-function-in-c/22387757 class Timer { public: Timer() : t1_(std::chrono::high_resolution_clock::now()) {} ~Timer() { auto t2 = std::chrono::high_resolution_c...
// // Created by abel_ on 13-10-2022. // #include <vector> #include <tuple> #include <string> #include <stack> #include <unordered_set> #include <iostream> #include <unordered_map> #include <algorithm> int shortestPath(std::vector<std::tuple<std::string, std::string>> edges, std::string nodeA, std::string nodeB) { ...
int Solution::maxSubArray(const vector<int> &A) { int currSum = 0; int maxSum = INT_MIN; for (int i = 0; i < A.size(); i++) { currSum += A[i]; if (currSum > maxSum) maxSum = currSum; if (currSum < 0) currSum = 0; } return maxSum; }
// Created on: 1999-09-10 // Created by: Andrey BETENEV // Copyright (c) 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 GNU Less...
/* Rocket Drone 1.0 * Leitura de IMU, GPS, leitura de Xbee e escrita de 6 PWM * * Daniel S. Koda <danielskoda@gmail.com> * 28.04.2016 */ /* ********************** * Bibliotecas ************************/ // Biblioteca para o FreeRTOS #include <FreeRTOS_AVR.h> // Bibliotecas para a IMU #include <Wire.h>...
void helper(TreeNode *A, int B, vector<int> &ans, vector<int> temp){ if(ans.size()>0 || A==NULL) return; if(A->val==B){ temp.push_back(A->val); ans = temp; return; } temp.push_back(A->val); helper(A->left,B,ans,temp); helper(A->right,B,ans,temp); } vect...
#include "EDITLABLE.h" #include "..\ApplicationManager.h" EDITLABLE::EDITLABLE(ApplicationManager* pApp) :Action(pApp) { a = pApp; } EDITLABLE::~EDITLABLE(void) { } void EDITLABLE::ReadActionParameters() { } void EDITLABLE::Execute() { //Get Center point of the Gate ReadActionParameters(); Output* pOut = pMan...
#include <iostream> #include "list.hpp" List::List() { this->size = 0; head = nullptr; std::cout << "Default constructor works!" << std::endl; } List::List(List& li) { std::cout << "Copy constructor works!" << std::endl; } List::List(List&& li) { std::cout << "Move constructor works!" << std::end...
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*- * * Copyright (C) 1995-2005 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 XSLT_SUPPORT # include "modules/xslt/src/xs...
#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 <numeric> #include <stdio.h> #include <string.h> #include <iomanip> #define INF...
#ifndef __GREETER_H__ #define __GREETER_H__ #include <string> class Greeter { public: Greeter(); ~Greeter(); void greet() const; private: std::string myGreeting; }; #endif // #ifndef __GREETER_H__
#include <iostream> #include <vector> #include <cmath> #include <iomanip> #include <algorithm> using namespace std; int n; class Planet{ public: double x, y; Planet(double x = 0, double y = 0) :x(x), y(y) {} }; class Tunnel{ public: int i; int j; double w; Tunnel(int i = 0, int j = 0, d...
/* * File: skiplist.h * Author: Richard Fussenegger * Author: Markus Deutschl * * Created on November 19, 2012, 10:45 PM */ #ifndef SKIPLISTS_H #define SKIPLISTS_H #include <iostream> #include <stdlib.h> #include <list> #include <vector> using namespace std; template <typename Tkey, typename Tval> class sk...
/** * @file TcpSocket.cpp * @author dtuchscherer <daniel.tuchscherer@hs-heilbronn.de> * @brief Ethernet TCP/IP communication * @details * @version 1.0 * @copyright Copyright (c) 2015, dtuchscherer. * All rights reserved. * * Redistributions and use in source and binary forms...
#ifndef EXPECTED_DEGREE_H #define EXPECTED_DEGREE_H #include <igraph.h> #include <stdio.h> #include <iostream> #include <assert.h> // 图的期望密度,可优化 // vids中的节点如果看做是子图节点(原图的部分节点),graph是原图,那么求取的是保留那些不属于子图,但与子图相连的边。在此基础上求子图期望密度 // vids中的节点是子图的全部节点,graph也是子图,那么忽略了保留那些不属于子图,但与子图相连的边。在此基础上求子图期望密度 int graph_expect...
// Created on: 2002-12-12 // 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...
/*Team Name: KitKat*/ #include <iostream> #include <queue> #include <algorithm> #include <cstring> using namespace std; typedef pair<int, int> ii; vector< vector<ii> > graph; vector<int> sub; int mst_cost, u, w; priority_queue<ii, vector<ii>, greater<ii> > pq; bool taken[50010]; int main(){ int n...
// Created on: 2016-04-07 // Copyright (c) 2016 OPEN CASCADE SAS // Created by: Oleg AGASHIN // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as publi...
#include "stdafx.h" #include "GamePiece.h" void GamePiece::setOwner_Id(int id) { this->owner_id = id; }; int GamePiece::getOwner_id() { return this->owner_id; }; string GamePiece::getName() { return this->name; }; TrollLair::TrollLair() { this->name = "Troll Lair"; }; Fortress::Fortress() { this->name = "Fo...
#include<bits/stdc++.h> using namespace std; class Student{ private: int age; char *name; public: Student(int age,char *name){ this -> age = age; //Shallow Copy. //this -> name = name; //Deep Copy. this -> name = new char[strlen(name) + 1]; strcpy(this -> name,name); } void print(){ ...
#ifndef __VIVADO_SYNTH__ #include <fstream> using namespace std; // Debug utility ofstream* global_debug_handle; #endif //__VIVADO_SYNTH__ #include "cp_4_opt_compute_units.h" #include "hw_classes.h" struct blue_blue_update_0_write0_merged_banks_4_cache { // RAM Box: {[0, 1920], [0, 1081]} // Capacity: 964 //...
class powerUp { private: int powerUpX, powerUpY; int powerUpType = 0; public: int getPowerUpX(); int getPowerUpY(); void powerUpUpdatePosition(int x, int y); void spawnPowerUp(); void movePowerUp(); void deletePowerUp(); int getPowerUpType(); void powerUpTypeRandomize(); };
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2008-2012 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Jan Borsodi */ #include "core/pch.h" #ifdef PROTOBUF_SUPPORT...
#include "Ending.h" #include "Commonheader.h" #include "Title.h" Ending::Ending() { std::cout << "Ending" << std::endl; } Ending::~Ending() { //イメージリソースの解放 //Common::Delete(); } Boot* Ending::Update(SeaquenceController*){ Boot* next = this; if (mCount == 120){ next = new Title; } //描画 ++mCount; return ...
#include<iostream> using namespace std; main() { cout << "start"<<endl; char g1 = ' '; char g2 = ' '; bool v1 = false,v2 = false; cin >> g1; cin >> g2; //Controllo sulle mosse dei Giocatori if((g1 == 'f' || g1 == 'c' || g1 == 's') && (g2 == 'f' || g2 == 'c' || g2 == 's')){ switc...
#ifdef _WIN32 # ifdef testcxx2_EXPORTS # define CM_TEST_LIB_EXPORT __declspec(dllexport) # else # define CM_TEST_LIB_EXPORT __declspec(dllimport) # endif #else # define CM_TEST_LIB_EXPORT #endif class CM_TEST_LIB_EXPORT LibCxx2Class { public: static float Method(); };
// // Maho.cpp // TuboWariProjection // // Created by Shuya Okumura on 2013/02/17. // // #include "Maho.h" #include "MACROS.h" extern int startMahoTime, currentMahoTime; extern int mahoIndex; extern ofFloatColor mainPink; extern bool trFadeOutLastMaho; extern ofPoint mahoPos[2]; extern ofPoint hondanaPoints[HOND...
#include<stdio.h> #include<conio.h> #include<process.h> #include<stdlib.h> int i,j,ec,fg,ec2; char fn[20],e,c; FILE *fp1,*fp2,*fp; void Create(); void Append(); void Delete(); void Display(); int main() { do { printf("\n\t\t***** TEXT EDITOR *****"); printf("\n\n\tMENU:\n\t—–\n "); printf("\n\t1.CREAT...
//=========================================================================== //! @file asset_model.h //! @brief アセットモデル所有クラス //=========================================================================== #pragma once //-------------------------------------------------------------------------- //! 三角形の座標とUV座標から接ベクトルを求め...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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. */ #include "core/pch.h" #ifdef MACGOGI #include "platforms/macgogi...
#ifndef COPYFILE_H #define COPYFILE_H #include <QObject> #include <QProgressBar> #include <QThread> class CopyFile : public QThread { Q_OBJECT public: explicit CopyFile(QObject *parent = 0); void run() Q_DECL_OVERRIDE; void setInfo(QProgressBar* progressBar, QString originFileName, QString targetFileN...
#include "tower.h" #include "gamemanager.h" Tower::Tower(XY pos, XY size, Team *team, GameManager *game) : Aggressor(300, team, game->getTeams()), Element(pos, size, 300, game) { XY center_of_tower = _pos + _size*XY(0.5,0.5); //_weapon = new Weapon(this, _pos + _size*XY(0.5,0.5), game); _weapon = n...
/* -*- 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 Manuela Hutter (manuelah) */ #ifndef QUICK_DROP_DOWN_H...
#pragma once #include <Eigen/Dense> #include <iostream> #include <random> #include <vector> #include "multi_tree_view.hpp" namespace datastructures { // Helper functions for converting between (flattened) trees and vectors. template <typename Iterable> Eigen::VectorXd ToVector(const Iterable &nodes) { Eigen::Vecto...
//对 回忆一下自己的做题思路(最近每做一题就把这个粘过去) //1. 先理解题 //2. 确定解题思路(选择数据结构算法什么的) 确定能解决正常情况,也不用考虑太多复杂度 //3. 2达到之后, 开始考虑各种解决可能遇到的奇怪情况 然后看看有没有复杂度更低的思路 //这题挺难懂的 先随意试试吧 //讲真 这题思路自己没问题了,昨天就没问题了 //可是被那个什么申请内存错误,释放内存错误给卡住了 换了STL的swap才行 目前还不知道是啥原因 //就这样吧 被浪费了一点时间 还能接受 这题过 不过将来thu的toy估计需要借鉴这道题 //其实这题的有相同的数时不复杂,这就降低了...
// // Created by peto184 on 26-Oct-17. // #pragma once #ifndef PPGSO_PLAYER_H #define PPGSO_PLAYER_H #include <ppgso/ppgso.h> #include "object.h" #include "src/playground/constants.h" #include "src/playground/scene.h" #include "projectile.h" class Player final : public Object{ public: Player(); enum State...
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <ctime> #include <memory.h> #include <cmath> #include <string> #include <cstring> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional> #inc...
#include <iostream> #include <algorithm> #include <cstring> #include <vector> #define MAX 501 int n, k, d[MAX]; bool check[MAX]; std::vector<int> Y[MAX]; bool dfs(int x) { if(check[x]) { return false; } check[x] = true; for(int y : Y[x]) { if(d[y] == 0 || dfs(d[y])) { ...
/* Copyright (c) <2012>, Intel Corporation All Rights Reserved. The source code, information and material ("Material") contained herein is owned by Intel Corporation or its suppliers or licensors, and title to such Material remains with Intel Corporation or its suppliers or licensors. The Material contains pr...
#pragma once #include "Grid_point.h" #include "Particle_cloud.h" #include <vector> #include <Dense> using namespace Eigen; using namespace std; class Grid { public: Grid(); ~Grid(); public: vector<vector<Grid_Point>> Map; Vector2i size; Vector2d start, end; Vector2d cellsize; Particle_Cloud * Material; public:...
#include <Texture.h> #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" CTexture::CTexture(const std::string &filename) : _target(GL_TEXTURE_2D) , _texture(0) , _internalformat(GL_SRGB) , _format(GL_RGB) , _width(0) , _height(0) , _components(0) { stbi_set_flip_vertically_on_load(...
#include "stdafx.h" #include "Ship.h" Ship::Ship() { } Ship::~Ship() { } HRESULT Ship::Init(const char * imageName, int x, int y) { _image = IMAGE->FindImage(imageName); _x = x; _y = y; _angle = 0.0f; _rc = RectMakeCenter( _x, _y, _image->GetFrameWidth(), _image->GetFrameHeight()); _speed = 0; _radius ...
#include "Player.h" #include <iostream> using namespace std; Player::Player() { x=1; y=1; } void Player::CallInput() { char UserInput = ' '; cin >>UserInput; switch(UserInput) { case 'w': lastY=y; y=y-1; break; lastX=x; case 'd': ...
#include <armadillo> #include <iostream> #include "base.h" using namespace std; using namespace arma; double Ls(mat X, mat y, mat theta) { double loss = 0; mat t = X * theta; int n = X.n_rows; for (int i = 0; i < n; i++) { if (y[i] * t[i] < 0) loss++; } return loss / n; } void perceptron(const mat X, co...
/** * @file antiBomb.cpp * @brief Contém a implementação de um anti fork bomba */ #include <iostream> #include <fstream> #include <map> #include <string> #include <cstdlib> #include <cstring> #include <unistd.h> /// fork() using namespace std; int main() { std::ifstream processLog; st...
/** \file yellowDetector.cpp \author UnBeatables \date LARC2018 \name yellowDetector */ #include "yellowDetector.hpp" #define DEBUG_PERCEPTION 0 void YellowDetector::run(cv::Mat topImg, cv::Mat goalImg, PerceptionData *data) { cv::Mat src = topImg.clone(); //Yellow HSL values range definit...
#include "net/server.hpp" #include "net/client.hpp" #include "net/stream.hpp" #include "net/conn.hpp" #include "net/log.hpp" #include "utils/service_thread.hpp" #include <cppunit/extensions/HelperMacros.h> #include <condition_variable> #include <mutex> namespace nora { namespace test { class m...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * 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" #include "modu...
#pragma once #include <YouMeCommon/CrossPlatformDefine/PlatformDef.h> /************************************************************************/ /* g_mapLanguage["en"] = __XT("英语+英国"); g_mapLanguage["en-us"] = __XT("英语+美国"); g_mapLanguage["ar"] = __XT("阿拉伯语+"); g_mapLanguage["ar-ae"] = __XT("阿拉伯语+阿拉伯联合酋长国"); g_map...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // // Copyright (C) Opera Software AS. All rights reserved. // // This file is part of the Opera web browser. It may not be distributed // under any circumstances. #ifndef WEBFEED_PARSESTATES_H #define WEBFEED_PARSESTATES_H #include "modul...
#include "HelloWorldScene.h" #include "MapSprite.h" USING_NS_CC; CCScene* HelloWorld::scene() { CCScene *scene = CCScene::create(); HelloWorld *layer = HelloWorld::create(); scene->addChild(layer); return scene; } // on "init" you need to initialize your instance bool HelloWorld::init() { if ( !C...
#ifndef _MA_TYPE_MANIPULATION_H #define _MA_TYPE_MANIPULATION_H #include "tuple.h" namespace ma { //FUNCTION TYPES // primary template. template<class T> struct function_traits {}; // partial specialization for function type template<class R, class... Args> struct function_traits<R(Args...)> { using result...
#pragma once #include <Eigen/Core> #include <Eigen/Dense> #include <array> #include <chrono> #include <iostream> #include <memory> #include <tuple> // This is a base class for turning a bilinear form into an Eigen matvec. namespace spacetime { template <typename DblVecIn, typename DblVecOut = DblVecIn> class BilinearF...
#include "Juego.h" Juego::Juego() { SDL_Init(SDL_INIT_EVERYTHING); TTF_Init(); nivel = 0; screen = SDL_SetVideoMode(WIDTH, HEIGHT, 32, SDL_SWSURFACE); background = IMG_Load("endless.png"); loseScreen = IMG_Load("gameOver.jpg"); victoryScreen = IMG_Load("winner.jpg"); yMapa = xMapa = c...
#pragma once #include <vector> #include "LidarData.h" #include "Helpers.h" class BugStateMachine { public: enum class State { TO_TARGET, WALL_ENCOUNTER, FOLLOWING_WALL, }; private: State state = State::TO_TARGET; Point target; bool checkWall(const std::vector<lidar::LidarData>& data) const; void to_Ta...
/*==================================================================== Copyright(c) 2018 Adam Rankin 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 the Software without restriction, including without limitati...
// // Created by xukexin on 2019/4/4. // #include "sortClass.h" #include <iostream> #include <vector> using namespace std; Sort::Sort(int *data_value, int dataCnt_value) { data = data_value; dataCnt = dataCnt_value; } // Show the whole array in line void Sort::show() { for (int i = 0; i < dataCnt; i++)...
/*Insertion sort header.*/ #ifndef __CC_ALGO_SORTING_INSERTION_SORT__ #define __CC_ALGO_SORTING_INSERTION_SORT__ #include "cc/shared/generic_array.h" namespace cc_algo_sorting { void insertion_sort(void* base, size_t member_count, size_t member_size, cc_shared::CompareFuncType comparer); } // c...
#ifndef VRJOGREAPP_HPP_GUARD #define VRJOGREAPP_HPP_GUARD #include <boost/noncopyable.hpp> #include <vrj/Draw/OpenGL/App.h> #include <vrj/Draw/OpenGL/ContextData.h> // forward declarations namespace Ogre { class Camera; class Log; class RenderWindow; class Root; class SceneManager; class Vi...
// Created on: 1997-08-04 // Created by: VAUTHIER Jean-Claude // Copyright (c) 1997-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 t...
#include "../../std_lib_facilities.h" int main() { //Load name and surname cout << "Enter floating point number: "; double n; cin >> n; cout << "n == " << n << "\nn+1 == " << n + 1 << "\nThrice n == " << 3 * n << "\nTwice razy n== " << n + n << "\nsquared n == " << n * n << "\nHalf of n == " << n / 2 <...
// // DoorWall.h // Crapenstein // // Created by Bruno Caceiro on 24/06/14. // Copyright (c) 2014 Bruno Caceiro. All rights reserved. // #ifndef __Crapenstein__DoorWall__ #define __Crapenstein__DoorWall__ #include <iostream> #include "OpenGLIncludes.h" #include "Wall.h" #include "collidingObject.h" class DoorWal...
#pragma once class Floor { };
#include "precompiled.h" #include "timer/timer.h" #include "timer/timers.h" #include "console/console.h" namespace timer { class Timer { public: Timer(const string& name, const string& action, const unsigned int frequency_ms, const unsigned int next_ms) : name(name), action(action), frequency_ms(fr...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- */ #include "core/pch.h" #ifdef ES_OPPSEUDOTHREAD #include "modules/ecmascript/oppseudothread/oppseudothread.h" #ifdef _WIN32 # define HAVE_WIN32_THREADS_SUPPORT #endif // _WIN32 #if defined(OPPSEUDOTHREAD_THREA...
#pragma once #include "bricks/core/object.h" #include "bricks/io/endian.h" namespace Bricks { namespace Audio { namespace MidiType { enum Enum { SingleTrack = 0, Uniform = 1, Hybrid = 2 }; } namespace MidiEventType { enum Enum { Comment = 0x01, Copyright = 0x02, TrackName = 0x03, ...
/* //Worthless piece of junk that took forever to code didn't work anyway #pragma once #include <frc/WPILib.h> #include <ctre/Phoenix.h> class RobotMap { public: static void Init(); //static std::shared_ptr<WPI_TalonSRX> Talon1; //static std::shared_ptr<WPI_TalonSRX> Talon2; //static std::sha...
#include <cfloat> #include <vector> #include <typeinfo> #include "caffe/layers/mpi_gather_layer.hpp" namespace caffe { template <typename Dtype> bool MPIGatherLayer<Dtype>::MPISyncFlag(bool flag){ int temp = (int)flag; MPI_Bcast(&temp,1,MPI_INT, this->comm_root_, this->comm_); return (bool)temp; } template <t...
// richeditole.h #include <richedit.h> #include <richole.h> #include "resource.h" #define IDM_RE_OPEN 40101 #define IDM_RE_SAVE 40102 extern void InsertHBITMAP(HWND hwnd, HBITMAP hbmp, int w, int h); extern bool extractHBITMAP(HWND hwnd, HBITMAP *hbmp, int...
/* * TimerInterface.h * * Created on: Jun 11, 2017 * Author: root */ #ifndef TIMER_TIMERINTERFACE_H_ #define TIMER_TIMERINTERFACE_H_ #include "TimerBase.h" #include "Timer.h" #include "../Memory/MemAllocator.h" //定时器用法 /* TimerConnection 用于接收TimerInterface里面注册的定时器对象,可以通过这个删除定时器,判断定时器是否是合法的 class CTimerFu...
/*==================================================================== Copyright(c) 2018 Adam Rankin 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 the Software without restriction, including without limitati...
#include "button.h" Button::Button(qint8 keyId, QPushButton *parent) : QPushButton(parent), m_keyId(keyId) { connect(this, &QPushButton::pressed, this, &Button::slotEventPressed); } Button::~Button() { } void Button::slotEventPressed() { emit signalEventPressed(); } qint8 Button::getKeyId() const { r...
// Fill out your copyright notice in the Description page of Project Settings. #include "FightWithBlock.h" #include "MyHUD.h" AMyHUD::AMyHUD() { //ConstructorHelpers::FObjectFinder<SUserWidget> UI(TEXT("WidgetBlueprint'/Game/UMG/UI.UI'")); } void AMyHUD::BeginPlay() { }
#include <bits/stdc++.h> #define ll long long #define pf printf #define sfi(a) scanf("%d",&a); #define sfii(a,b) scanf("%d %d",&a,&b); #define INF 100000 //10e9 using namespace std; int ar[100005]; //SEGMENT TREE //COPYING BUILD FUNC FOR UPDATE //CHECK IF YOU ARE CALLING BUILD INSIDE UPDATE struct node { int ovma...