text
stringlengths
8
6.88M
#ifndef COSMOS_RELEASE_MINER #define COSMOS_RELEASE_MINER #include <cosmos/cosmos.hpp> #include <data/tools/ordered_list.hpp> #include <thread> #include <csignal> namespace cosmos::bitcoin { // an address miner struct miner { // way of organizing addresses by proof-of-work struct addr...
#include "error_indication.h" // Sets up error indication void setup_error_indication() { pinMode(PIN_ERROR_LED1, OUTPUT); pinMode(PIN_ERROR_LED2, OUTPUT); pinMode(PIN_ERROR_SOUNDER, OUTPUT); } // Turn on or off error LED 1 void error_1 (bool on) { if (on) { digitalWrite(PIN_ERROR_LED1, HIGH);...
#include "stdafx.h" #include "data/datafactory.h" #include "data/dta_loader.h" #include "data/naf_loader.h" namespace data { ////////////////////////////////////////////////////////////////////////// shared_ptr<loader> factory::get_loader(std::string path) { shared_ptr<dta_loader> dta_file; dta_file.reset(n...
#include <compressor/cli.h> int main(int argc, char *argv[]) { compressor::CLI cmd(std::make_unique<argparser::Argparser>(argc, argv), std::make_unique<compressor::Compressor>()); cmd.run(); return 0; }
//============================================================================================= // A beadott program csak ebben a fajlban lehet, a fajl 1 byte-os ASCII karaktereket tartalmazhat, BOM kihuzando. // Tilos: // - mast "beincludolni", illetve mas konyvtarat hasznalni // - faljmuveleteket vegezni a printf-et ...
/********************************************************************** markdown_lib.c - markdown in C using a PEG grammar. (c) 2008 John MacFarlane (jgm at berkeley dot edu). This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License or the MIT ...
#include <iostream> #include "pretty_printing.h" using namespace std; // Terrible, but it's topcoder. Everything should be in one file. #include "sol.cc" int main(int argc, char **argv) { test_bitpowersets(); int m; cin >> m; vector<int> peg_values; for (int i = 0; i < m; i++) { peg_values.push_bac...
#include <memory> #include "MenuPageJoinServer.hpp" #include "../../state/StateManager.hpp" #include "../PlayState.hpp" #include <string.h> MenuPageJoinServer::MenuPageJoinServer(StateManager& manager, nk_context* nk) : MenuPage(manager, nk, "join server") { strcpy(hostname, "localhost"); strcpy(username, "I are C...
#ifndef _INPUT_H_ #define _INPUT_H_ #define DIRECTINPUT_VERSION 0x0800 #pragma comment(lib, "dinput8.lib") #pragma comment(lib, "dxguid.lib") #include <dinput.h> #include "keyboardinput.h" #include "mouseinput.h" #include "inputsenum.h" #include <vector> class InputController { public: InputCont...
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: bool isValidBST(TreeNode *root) { return isv(root, -10000000000ll, 10000000000ll); } ...
// github.com/andy489 // https://codeforces.com/contest/475/problem/D // https://codeforces.com/blog/entry/14168 #include <iostream> #include <vector> #include <unordered_map> using namespace std; #define ios ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr) #define rep(i, s, e) for(int i=s; i<e; ++...
/** * \file ItemTile.h * * \author PaulaRed * * Base class for any tile in the game */ #pragma once #include <memory> #include <string> #include "ImageMap.h" #include "Item.h" #include "ItemVisitor.h" /** * Base class for any tile in the game */ class CItemTile : public CItem { public: CItemTile(CLe...
#include "../apue.h" #include "../error.c" int glob = 6; char buf[] = "a write to stdout\n"; int main (void){ int var; pid_t pid; var = 88; if (write(STDOUT_FILENO, buf, sizeof(buf)-1) != sizeof(buf)-1) err_sys("write error"); printf("before fork\n"); if ((pid = fork()) < 0){ err_sys("forl error"); }els...
#include <windows.h> #include <gl/glut.h> void DoDisplay(); void DoMenu(int value); int Action; int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance ,LPSTR lpszCmdParam,int nCmdShow) { glutCreateWindow("OpenGL"); glutDisplayFunc(DoDisplay); glutCreateMenu(DoMenu); glutAddMenuEntry("점 찍기",0); glutA...
#include <gtest/gtest.h> #include <Expected.h> #include <Errors.h> #include "Common.h" TEST(ErrorList, handleAllErrors_ListOrder) { auto expected = Expected_AlwaysErrorList(); EXPECT_FALSE(isInSuccessState(expected)); int order = 0; llvm::handleAllErrors(expected.takeError(), [&](const llvm::StringError...
#pragma once /* *基于C++template实现的单链表类 *作者:刘涵 *时间:2017/11/13 */ #ifndef _SINGLELIST_H #define _SINGLELIST_H //结点结构 template<class T> class Node { public: Node() = default; Node(T _value,Node* _next):value(_value),next(_next){} public: T value; Node* next; }; //单链表 template<class T> class SingleList { public: ty...
#pragma once #include <iostream> enum MonsterType { Ogr, Goblin, Orc, Skelet, Troll }; struct Monster { MonsterType type; std::string name; int hp; uint16_t speed; }; std::string GetMonsterInfo(Monster monster); std::string GetMonsterTypeName(MonsterType type);
#include "Player.hpp" Player::Player( void ) : _name(1), _color(0x000000), _capturedPawns(0) { return ; } Player::Player( int name, int color ) : _name(name), _color(color), _capturedPawns(0) { return ; } Player::~Player( void ) { return ; } Player::Player( Player const & src ) { *this = src; } Player & Player...
#pragma once #include "../pch.h" //#include "Player.h" class Player; class Game; #include "../Cards/Cards.h" #include "../GameCore/GameCore.h" class Strategy { public: Strategy(); virtual Card* buyCard(Player* player, CardSpace& cardSpace, Deck& deck); virtual void performAction(Game* game, Player* player, Card* ca...
#include<bits/stdc++.h> using namespace std; int a[100010]; struct SegmentTree{ int s,e; vector<int> v; SegmentTree *l, *r; void build(int start, int end){ s = start; e = end; if(s!=e){ l = new SegmentTree; r = new SegmentTree; l->build(s,(s+e)/2); r->build((s+e)/2+1,e); ...
#ifndef _INDEXED_LINE_SET_HPP_ #define _INDEXED_LINE_SET_HPP_ // VRML'97 // // IndexedLineSet { // eventIn MFInt32 set_colorIndex // eventIn MFInt32 set_coordIndex // exposedField SFNode coord NULL // field MFInt32 coordIndex [] # [-1,) // exposed...
#include "precompiled.h" #include "mathematics.h" #include "gameCT.h" void GameCT::drawGameOver(sf::RenderWindow& windowView) { sf::Texture texture; texture.loadFromFile("./textures/gameOver.jpg"); sf::Sprite sprite; sprite.setPosition(Xyla::getCenterPosition(sf::Vector2f(1920, 1080), (sf::Vector2f) ...
#include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> using namespace std; using namespace cv; #define WINDOW_NAME1 "[原始图片]" #define WINDOW_NAME2 "[效果窗口]" Mat g_srcImage; Mat g_templateImage; Mat g_resultImage; int g_nMatchMethod; int g_nMaxTrackbarNum = 5; void on_Matching(int, void*); int...
/********************************************************************* Matt Marchant 2014 - 2016 http://trederia.blogspot.com xygine - Zlib license. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this soft...
#include "client_main_window.h" #include "ui_client_main_window.h" #include <common/dwiz_assert.h> #include <common/network/network_connector_factory_interface.h> #include <common/protocols/login_protocol_interface.h> #include <common/protocols/protocol_factory_interface.h> #include <common_qt/error_handler/qt_error_ha...
#include "../include/hdivider_worker.h"
#pragma once #include <assert.h> #include <array> #include "MemoryPoolElement.h" namespace GraphicsEngine { template<typename Type, size_t Size> class MemoryPool { public: MemoryPool() { m_activeElements = 0; m_firstAvailable = &m_pool[0]; // Initialize a list of available elements: for (size_t...
#pragma once #include <2D-Game-Engine/Scene.h> #define NUM_STARS 50 #define NUM_BULLETS 1000 #define RELOAD_TIME 16 #define BULLET_SPEED 9.6f #define STAR_SPEED 2.75f #define NUM_ASTEROIDS 50 struct Bullet : public Engine::StaticSprite { bool isAlive; bool isFriendly; }; struct Asteroid : public Engine::Stati...
#include <ESP8266WiFi.h> #include <Wire.h> //I2C needed for sensors #include "MPL3115A2.h" //Pressure sensor #include "DHT.h" #define DHTPIN 2 //Pin to attach the DHT (pinD4 en el node) #define DHTTYPE DHT11 //type of DTH const char* ssid = "Network"; const char* password = "****"; const int...
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); init(); this->ptimer=new QTimer; go=0; connect(this->ptimer,SIGNAL(timeout()),this,SLOT(update_Time())); } MainWindow::~MainWindow()...
/** * Definition for singly-linked list with a random pointer. * struct RandomListNode { * int label; * RandomListNode *next, *random; * RandomListNode(int x) : label(x), next(NULL), random(NULL) {} * }; */ class Solution { public: RandomListNode *copyRandomList(RandomListNode *head) { Ran...
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { // 贪心算法 private: int result; int traversal(TreeNode* cur) { // 首先是后序遍历。这是因为贪心的思路导致的,我们...
// Author: AlexHG @ XENOBYTE.XYZ // License: MIT License // Website: https://XENOBYTE.XYZ #ifndef SCANNER_H #define SCANNER_H //opencv libs #include <opencv2/opencv.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> //C++ STDs #include <iostream> class Scanner { private: //webcam...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
/*====================================================================================== * 05-two_pumas.cpp * * * Elena Galbally & Adrian Piedra (based on: https://github.com/manips-sai/cs327a) * *======================================================================================*/ /* ------------------------...
/*************************************************************************** Copyright (c) 2020 Philip Fortier 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...
/* #include <iostream> #include <cstring> using namespace std; class Person{ char* name; int id; public: Person(int id, char* name); Person(Person& person); // 복사 생성자 ~Person(); void changeName(char *name); void show() { cout << id << ',' << name << endl; } }; Person::Person(int id, char* ...
#include "Buff.h" void Buff::draw(bool filling) { string buff; if (filling) { switch (bufftype) { case LIFEBUFF: drawAtPoint(x, y, "◎", RED); break; case SPEEDBUFF: drawAtPoint(x, y, "◎", BLUE); break; case POWERBUFF: drawAtPoint(x, y, "◎", YELLOW); break; case VOLUM...
#include<vector> #include<stack> #include<algorithm> using namespace std; class NestedInteger { public: // Return true if this NestedInteger holds a single integer, //rather than a nested list. bool isInteger() const; // Return the single integer that this NestedInteger holds, //if it holds a single integer //...
#include <iostream> #include <fstream> #include <string> #include <vector> #include <algorithm> using namespace std; int abs(int n) { if (n < 0) n = -n; return n; } vector<int> getparr(vector<int> p) { int m = p.size(); int j = 0; vector<int> pi(m, 0); for (int i = 1; i < m; i++) { while (j > 0 && p[i] != ...
#pragma once #include "OGLRender.hpp" #include "Physics.hpp" #include "PhysicsWidget.hpp" #include "diligentGraphics/Math.hpp" #include "imgui/imgui.h" #include <SDL.h> class ParticleSystemApp { public: ParticleSystemApp(); ~ParticleSystemApp() = default; void run(); bool isInit() const { return m_init; } ...
#ifndef RESTY_MUX_ROUTER_H_ #define RESTY_MUX_ROUTER_H_ #include <qhttpfwd.hpp> #include <QMetaType> #include <QString> #include <QRegularExpression> #include <vector> #include <memory> #include <string> #include "fwds.h" namespace resty { namespace mux { class PrefixChecker; class Router { public: Router(); ...
#pragma once #include <SDL.h> #include <SDL_image.h> #include <vector> // forward declarations class Rect; class Renderer; enum class BlendMode; /* Encapsulates SDLs textures Sprites can be loaded from the renderer class */ class Sprite { friend class Renderer; private: SDL_Texture* _texture = nullptr; int _w...
#include "Easing.h" #include "ExecutionManager.h" Easing::Easing(float from, float to, int duration_ticks) { _from = from; _val = from; _to = to; _total_ticks = duration_ticks; _current_ticks = 0; } void Easing::run(int ticks) { if (_current_ticks >= _total_ticks) return; _current_ticks += ticks; if (_curr...
/* 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...
/*************************************************************************** Copyright (c) 2020 Philip Fortier 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...
#pragma once #include "Range.h" #include "RangeF.h" #include "RangeColor.h" #include "../GMApplication.h" #include <SDL2/SDL.h> #include <math.h> class EmitterParameter { public: EmitterParameter(); EmitterParameter(Range q, RangeF spd, SDL_Color col1, SDL_Color col2, RangeF o, RangeF scl, RangeF rot, RangeF ang, Ra...
#ifndef __ChangeBGScene_H__ #define __ChangeBGScene_H__ #include "cocos2d.h" #include "SimpleAudioEngine.h" #include "cocos-ext.h" using namespace cocos2d; using namespace cocos2d::extension; class ChangeBGScene : public cocos2d::Layer { public: // 这个是用来初始化函数的 virtual bool init(); // 设置一个静态的场景函数...
#pragma once #include <QWidget> #include <QScopedPointer> #include "Subject.hpp" #include "SubjectDateModel.hpp" namespace Ui { class EditSubject; } class EditSubject : public QWidget { Q_OBJECT public: explicit EditSubject(QWidget *parent = 0); Subject subject() const; void setSubject(const Subjec...
#pragma once #include <pthread.h> #include "Util.h" START_NAMESPACE class Mutex { public: Mutex(); Mutex(Mutex&&) = delete; Mutex(const Mutex&) = delete; Mutex& operator=(const Mutex&) = delete; Mutex& operator =(Mutex&&) = delete; ~Mutex(); bool isLockedByThisThread() const; voi...
/* Problem Statement You have given a singly linked list and two integers 'N' and 'M'. Delete 'N' nodes after every 'M' nodes, or we can say more clearly that traverse the linked list such that you retain M nodes then delete next N nodes, continue the same till the end of the linked list. Input Format : The first line...
#include "GamePhysics.h" GamePhysics::GamePhysics(float g, int gH) { gravity = g; groundHeight = gH; }
/* * main.cpp * * Created on: Sep 12, 2016 * Author: Daghamos */ #include "Person.h" #include <iostream> #include <fstream> int determineSize(string s){ /* * Determins the size of the array based on the imput file. */ ifstream fin(s.c_str()); if(!fin){ cout<< "couldn't open the file \n"; return 0...
#include "Stage.hpp" Stage::Stage() {} void Stage::MakeStage(RenderWindow* window, b2World* World, TempObjectHandler* toh){ Window=window; world=World; TOH=toh; //ground b2BodyDef groundBodyDef; groundBodyDef.position.Set(1200.0f, 1795.0f); b2Body* gro...
#include <iostream> #include <stdlib.h> using namespace std; typedef struct _node { int data; struct _node* left; struct _node* right; }node; node* createNode(int x) { node* p=(node*)malloc(sizeof(struct _node)); p->data=x; p->right=NULL; p->left=NULL; return p; } int search(int in[],int start,int end,int da...
#ifndef TABLE_H #define TABLE_H #include <list> #include "order.h" enum TableState { EMPTY, NEW_GUEST, ORDER_PENDING, READY_TO_PAY }; class Table { private: static int count; std::list<const Order*> orderList; TableState state; public: Table(); Table(const Table&); Table(Table&&); TableState getState() ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main(){ ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; ll ans = 0; vector < ll > v(n); for(int i =0 ; i < n; i++){ cin >> v[i] ; } for(int i = 0; i < n; i++){ int tmp; cin >> t...
#include <cmath> #include <iostream> using namespace std; double Delta = 0.0001; double Round (double X,double Delta) { if (Delta<=1E-9) { puts("Неверное задание точности округления\n"); exit(1); } if (X>0.0) return (Delta*(long((X/Delta)+0.5))); else return (Delta*(long((X/Delta)-...
// ============================================================== // RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2013.4 // Copyright (C) 2013 Xilinx Inc. All rights reserved. // // =========================================================== #include "combiner_top.h" #inc...
// // Compiler/Platform/Platform_i386_OSX.h // // Brian T. Kelley <brian@briantkelley.com> // Copyright (c) 2014 Brian T. Kelley // // This software is licensed as described in the file LICENSE, which you should have received as part of this distribution. // #ifndef COMPILER_PLATFORM_PLATFORM_I386_OSX_H #define COMPILE...
#include <iostream> #include "queue.hpp" using namespace std; int main() { queue<int> q1; if (q1.isEmpty()) { cout << "Queue is indeed empty" << endl; } q1.push(1); q1.push(2); q1.push(3); cout << "At the top:" << q1.peek() << endl; cout << "Pop #1:" << q1.pop() << endl; cout << "Pop #2:" <<...
#ifndef SINGLEGAME_H #define SINGLEGAME_H #include"Board.h" class SingleGame:public Board { Q_OBJECT public: explicit SingleGame(QWidget *parent = 0); ~SingleGame(); int _level; //记录博弈算法的层次深度 void back(); virtual void click(int id,int row,int col);//在SingleGame子类中重载click函数 Step* getBestMov...
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstring> #include <fstream> #include "Header.h" Grid::Grid() : content(NULL) { setColumn(column); setRow(row); setContent(content); } void Grid::setColumn(int column) { this->column = column; } void Grid::setRow(int row) { this->row = row; } void Grid:...
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; // #define DEBUG const int maxm = 5005; int n, m; struct Nainong { int price, quantity; Nainong() {} }; Nainong nainong[maxm]; bool cmp(Nainong& a, Nainong& b) { return a.price < b.price; } int main() { #ifdef DEBUG freopen("...
#ifndef ROSE_TRANSFORMATION_SUPPORT #define ROSE_TRANSFORMATION_SUPPORT // #include "transformationOptions.h" #include "optionDeclaration.h" // Access to Query Libraries #include "roseQueryLib.h" // include "nodeQuery.h" // include "nameQuery.h" // include "numberQuery.h" /*! \brief This class simplifies the deve...
#include <iostream> using namespace std; int solution(int X, int Y, int D) { if(X<Y) { if((Y-X)%D != 0) { return ((Y-X)/D)+1; } return ((Y-X)/D); } return 0; } int main() { int JUMP = solution(10, 85, 30); cout<<JUMP; ...
#include "ofxKuDrawRasters.h" //-------------------------------------------------------------- void ofxKuDrawRaster(vector<unsigned char> &pix, int w, int h, float X, float Y, float W, float H, bool nearest_filter, bool rgb) { if (pix.size() != w * h * ((rgb) ? 3 : 1) || w * h <= 0) { cout << "ofxKuDrawRaster erro...
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Layout/Visibility.h" #include "Textures/SlateIcon.h" #include "Widgets/SWidget.h" #include "UnrealClient.h" #include "IDetailCustomization.h" #include "Private/CyLandEditorDetailCustomization_Base.h" #include ...
#include <iostream> #include <math.h> #include <cmath> using namespace std; int main() { int t; cin>>t; while(t--) { int r; cin>>r; int a[3][2]; for(int i=0;i<3;i++) { for(int j=0;j<2;j++) { cin>>a[i][j]; } } ...
#include <iostream> #include <string> #include <vector> #include <fstream> using namespace std; class Transport{ private: int posNS; int posWE; protected: int load; public: string name; void przypisz(); void wypisz(); friend void save(); ...
#ifndef FULLSCREENWIDGET_H #define FULLSCREENWIDGET_H #include <QWidget> #include <QtGui> #include <QtCore> #include <QKeyEvent> #include "experiment.h" namespace Ui { class FullScreenWidget; } class FullScreenWidget : public QWidget { Q_OBJECT public: explicit FullScreenWidget(QWidget *parent = 0); ~F...
// ============================================================================= // Copyright 2012. // Scott Alexander Holm. // All Rights Reserved. // ============================================================================= #include "confederateplayer.h" #include "computerplayer.h" ConfederatePlayer::C...
#pragma once #include "VertexBuffer.h" #include "NonCopyable.h" #include "glm/glm.hpp" struct VertexArray : private NonCopyable { VertexArray(); ~VertexArray(); VertexArray(VertexArray&&) noexcept; VertexArray& operator=(VertexArray&&) noexcept; void reset(); void attachTransparentVBO(); void attachOpaqueVB...
 /// @file GbmBddEngineOneHot.cc /// @brief GbmBddEngineOneHot の実装ファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2014 Yusuke Matsunaga /// All rights reserved. #include "GbmBddEngineOneHot.h" #include "YmLogic/BddLitSet.h" BEGIN_NAMESPACE_YM ///////////////////////////////////////////////////////...
/*867. Transpose Matrix Given a matrix A, return the transpose of A. The transpose of a matrix is the matrix flipped over it's main diagonal, switching the row and column indices of the matrix. Example 1: Input: [[1,2,3],[4,5,6],[7,8,9]] Output: [[1,4,7],[2,5,8],[3,6,9]] Example 2: Input: [[1,2,3],[4,5,6]] Out...
/* GNSS 의 느린 Hz를 보정해줄 DR 구현 스레드 */ #include <stdio.h> #include <iostream> #include "env_setting.h" #include <sys/time.h> #include <unistd.h> #include <queue> #include <fstream> // Read Coordinates Map Data //void Coordinates_Map_Data(); #define DOT_STEERING_MODEL //#define ACKERMANN_STEERING_BICYCLE_MODEL // ...
#pragma once #include <iostream> #ifdef __unix || __unix__ #include <GL/glut.h> #else #include <glut.h> #endif #include <math.h> #include <vector> using namespace std; /*! \brief * A 3D point */ struct Point3D { GLfloat x,y,z; /*! * Constructs a 3D point */ Point3D(GLfloat x=0,GLfloat y=0,GLfloat z=0): x(x),...
class Sudoku { public: //int array[9][9]; void giveQuestion(); void readIn(); void solve(); void transform(); void change(); void changeNum(int a,int b); void changeRow(int a,int b); void changeCol(int a,int b); void rotate(int n); void flip(int n); };
#include "DistanceMeasure.h" void DistanceMeasure::updatepitchyaw(double pitch, double yaw){ _yaw = yaw; _pitch = pitch; Vec3f theta(_pitch, _yaw, _roll); R = eulerAnglesToRotationMatrix(theta); head = R.inv()*cameraMatrix.inv(); } // void DistanceMeasure::ConfigParam(config cfg){ // _fx = cfg.instrinsics...
#include "MoleculeModel.h" #include <glm/glm.hpp> MoleculeModel::MoleculeModel(glm::mat4 modelMatrix, std::shared_ptr<Material> material, Molecule& molecule) :modelMatrix(modelMatrix), material(material) { GeometryData geometryData; for (const auto& atom : molecule.atoms) { ProceduralGeometry::createSphereGeom...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "base.h" WINRT_WARNING_PUSH #include "internal/Windows.Web.Http.3.h" #include "internal/Windows.Foundation.3.h" #include "internal/Windows.Storage.Streams.3.h" #include "internal/Wind...
#ifndef WIDGETIDENTIFY_H #define WIDGETIDENTIFY_H #include <QWidget> #include <QLabel> #include <QBoxLayout> #include <QGridLayout> #include "Widget/widgetcharacterinfo.h" #define MAX_SHOW_NUM 125 #define MAX_ROW 10 #define MAX_COLUMN 10 class WidgetIdentify : public QWidget { Q_OBJECT public: explicit Widge...
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
#include "I2Cdev.h" #include "MPU6050.h" #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE #include "Wire.h" #endif MPU6050 accelgyro; int16_t ax, ay, az; int16_t gx, gy, gz; #include <MaxMatrix.h> const byte DATA1 = 6; // 資料輸入線 const byte CS1= 5; // 晶片選擇線 const byte CLK1 = 4; // 時脈線 const byte DATA2 = 11; //...
#include<iostream> #include<bits/stdc++.h> // How to use pairs /* pair <int, int> p1; p1.first = 10; p1.second = 20; cout<<p1.first<<" "<<p1.second; */ using namespace std; // For making the edges of a pair typedef pair <int, int> intP; #define INF 99999999 char alphabet(int); void addEdge(vector <in...
// Dikstra // shortest path with a single source without negative edge // with adjacent matrix cost[][] #include <limits> const int INF = std::numeric_limits<int>::max(); // 2,147,483,647 == 2^31 -1 const int MAX_V = 100; const int MAX_E = 10000; int cost[MAX_V][MAX_V]; int d[MAX_V]; bool used[MAX_V]; int V; void d...
#ifndef __Utility_H__ #define __Utility_H__ #define PI 3.1415926535897932384626433832795f const float FEQUALEPSILON = 0.00001f; inline bool fequal(const float a, const float b, const float epsilon = FEQUALEPSILON) { return fabs(a - b) <= epsilon; } inline bool fnotequal(const float a, const float b, const float...
#pragma once #include "Room.h" #include "Inventory.h" #include <iostream> #include "Weapon.h" #include "Shield.h" using namespace std; class Player { public: Player(); ~Player(); void MoveDirection(Room::Direction direction); void setName(string n) { name = n; } string getName() { return name; } void setCurren...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "../base.h" #include "Windows.Security.Credentials.UI.0.h" #include "Windows.Storage.Streams.0.h" #include "Windows.Foundation.1.h" WINRT_EXPORT namespace winrt { namespace ABI::Wind...
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package #ifndef JACTORIO_INCLUDE_GUI_LAYOUT_H #define JACTORIO_INCLUDE_GUI_LAYOUT_H #pragma once #include <functional> #include <sstream> #include <imgui.h> #include "jactorio.h" #include "gui/colors.h" namespace jactorio:...
#ifndef SPHERE_H #define SPHERE_H #include <glm/glm.hpp> #include <vector> #define _USE_MATH_DEFINES #include <cmath> #include "shader.h" namespace renderer { class Sphere { public: Sphere(Shader* p_shader, float radius = 0.5f, int sector_count = 32, int stack_count = 18) { float x, y, z...
#include<bits/stdc++.h> using namespace std; #define ll long long int int main() { ll n; cin>>n; int rem=(n%2); if(rem!=0) cout<<'0'<<endl; else { ll x=n/2; if(x%2) cout<<x/2<<endl; else cout<<(x/2 -1)<<endl; } return 0; }
#include "bounding_box.hpp" #include "logging.hpp" namespace cxl { BoundingBox::BoundingBox(vec4 min, vec4 max) { #ifndef NDEBUG CXL_CHECK(max.x >= min.x); CXL_CHECK(max.y >= min.y); CXL_CHECK(max.z >= min.z); #endif // NDEBUG min_ = min; max_ = max; } bool BoundingBox::contains(vec4 v) const { ...
#ifndef BP_NOMOTION_LOCATION_NODE__H #define BP_NOMOTION_LOCATION_NODE__H #include "ros/ros.h" #include "std_msgs/String.h" #include <tf/tf.h> #include <tf/transform_listener.h> #include <tf/transform_broadcaster.h> #include <cmath> #pragma once void loadMapFromFile(nav_msgs::OccupancyGrid *map, ...
#include <Sprite.h> namespace dngine{ Sprite::Sprite(SDL_Renderer_ptr r, std::string fname) : renderer(r), filename(fname) { } Sprite::~Sprite(){ } SDL_Texture_ptr Sprite::get_texture(){ return image; } void Sprite::set_location(SDL_Rect_ptr loc){ location = loc; } void Sprite::set_location(int x, int...
// Мигание светодиодом #define F_CPU 8000000UL #include <avr/io.h> #include <util/delay.h> int main(void) { DDRA = 0xFF; PORTA = 0x01; while (1) { PORTA = PORTA<<1; if(PORTA == 0x00) PORTA = 0x01; _delay_ms(100); } }
// Fill out your copyright notice in the Description page of Project Settings. #include "TankMovementComponent.h" #include "TankTrack.h" UFUNCTION(BlueprintCallable, Category = "Movement") void UTankMovementComponent::IntendMoveForward(float Throw) { //UE_LOG(LogTemp, Warning, TEXT("Intend move forward throw: %f"),T...
#include "WerkplaatsCard.h" WerkplaatsCard::WerkplaatsCard() { } std::unique_ptr<Card> WerkplaatsCard::Create() { std::unique_ptr<Card> card(new WerkplaatsCard()); return std::move(card); } WerkplaatsCard::~WerkplaatsCard() { }
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) scanf(...
#include <string> #include <ostream> #include <fstream> #include <iostream> #include <sstream> #include <stdexcept> #include <algorithm> #include "../utils/macros.hpp" #include "bmatset.hpp" using namespace std; using namespace Eigen; namespace cbasis { // ==== BVec ==== void BVec::Write(string filename) const {...