text
stringlengths
8
6.88M
//--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #ifndef cppparseH #define cppparseH //--------------------------------------------------------------------------- #include "AccToken.h" class ICppToken : publi...
#include <iostream> #include <sstream> #include <vector> #include <list> #include <queue> #include <algorithm> #include <iomanip> #include <map> #include <unordered_map> #include <unordered_set> #include <string> #include <set> #include <stack> #include <cstdio> #include <cstring> #include <climits> #include <cstdlib> ...
// This file is part of HemeLB and is Copyright (C) // the HemeLB team and/or their institutions, as detailed in the // file AUTHORS. This software is provided under the terms of the // license in the file LICENSE. #include "lb/iolets/InOutLetFileVelocity.h" #include <algorithm> #include <fstream> #include "log/Logge...
#define _USE_MATH_DEFINES #include "ros/ros.h" #include "std_srvs/Empty.h" #include "std_msgs/String.h" #include "geometry_msgs/PoseStamped.h" #include "tf/transform_datatypes.h" #include "nav_msgs/OccupancyGrid.h" #include "ackermann_msgs/AckermannDriveStamped.h" #include <sstream> #include <fstream> #include <math.h>...
#include "stdafx.h" #include "SequenceQuestion.h" #include "utils.h" BOOST_AUTO_TEST_SUITE(SequenceQuestionTests) using namespace qp; using namespace std; using Sequence = CSequenceQuestion::Sequence; BOOST_AUTO_TEST_CASE(CorrectConstruction) { { // test constructor Sequence sequence = { "one", "two", "three" }...
#pragma once #include "MemoryManagerSwitcher.h" class GlobalSwitcher { public: static MemoryManagerSwitcher& get_switcher() { static MemoryManagerSwitcher switcher; return switcher; } };
#pragma once #ifndef CARD_H #define CARD_H #include "BFW/Entity.h" //#include "text.h" class Card : public Entity { public: Card(std::string sp,int f,float x,float y,float r); Card(); virtual ~Card(); virtual void update(float deltatime); private: }; #endif // !CARD_H
//: C16:TPStash2.h // Kod zrodlowy pochodzacy z ksiazki // "Thinking in C++. Edycja polska" // (c) Bruce Eckel 2000 // Informacje o prawie autorskim znajduja sie w pliku Copyright.txt // Szablon klasy PStash, zawierajacy zagniezdzony iterator #ifndef TPSTASH2_H #define TPSTASH2_H #include "../require.h" #inclu...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2009 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef VISUAL_DEVICE_TRANSFORM_H #define VISUAL_DEVICE_TRANSF...
#ifndef SHOC_MAC_GMAC_H #define SHOC_MAC_GMAC_H #include "shoc/mode/gcm.h" namespace shoc { /** * @brief Authentication-only variant of the GCM. All pointers MUST be * valid when relevant length is not 0. Tag length MUST be {4, 8, 12, 13, 14, 15, 16}: * https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpubl...
#pragma once #include "stdafx.h" #include "Item.h" #include "PassWord.h" #include <QSql> #include <QSqlDatabase> #include <QSqlQuery> #include <QSqlRecord> #include <QMap> #include <QSqlQueryModel> #include "City.h" #include "DragEmployee.h" class ItemDAO { public: static ItemDAO* getInstance() { if (!instance...
#ifndef _COIL_CONTROLLER_H #define _COIL_CONTROLLER_H #include "coil.h" #include "socket_server.h" #include "pin_io.h" // #include "game_show.h" class CoilController { public: CoilController(); ~CoilController(); void update(unsigned int delta); void startup(PinIO* _pinio, SocketServer* _socket_server); v...
/******************************************************************************* * filename: C_LinkRobustNetwork.cpp * description: Implementation of the 'LinkRobustNetwork' class * author: Moritz Beber * created: 2010-07-20 * copyright: Jacobs University Bremen. All rights reserved. ***************...
// Created on: 1996-01-12 // 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 <iostream> using namespace std; //2. КОНИ.Вводим 4 целых числа.это координаты двух коней на шахматной доске.Бьют ли они друг друга ? int main() { int x1 = 0, y1 = 0, x2 = 0, y2 = 0; cout << "Enters coordinats from 1 to 8 white horse: "; cin >> x1; cin >> y1; cout << "Enters coordinats from 1 to 8 bla...
/******************************************************************************** ** Form generated from reading UI file 'TresholdWidget.ui' ** ** Created by: Qt User Interface Compiler version 5.2.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ************************************...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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. */ #ifndef CSS_ANIMATION_H #define CSS_ANIMATION_H #ifdef CSS_ANIMA...
#include<bits/stdc++.h> using namespace std; #define PI 3.1415926535897932 int main(){ int a,b; int *p=&a; a=5; b=10; printf("a=%d, b=%d, *p=%d\n",a,b,*p); p=&b; printf("a=%d, b=%d, *p=%d\n",a,b,*p); }
#include "macs-internals.hpp" namespace macs { namespace internals { int ogl_maj, ogl_min; int draw_bufs, col_attach; int out_units; int tex_units; int width, height; tmu_manager *tmu_mgr; } }
// Copyright (C) 2004 Id Software, Inc. // #ifndef __RENDERWORLD_H__ #define __RENDERWORLD_H__ /* =============================================================================== Render World =============================================================================== */ // RAVEN BEGIN // jscott: new proc forma...
#include<bits/stdc++.h> using namespace std; main() { int n; while(cin>>n) { int sum=0; string name; for(int i=1; i<=n; i++) { cin>>name; if(name=="Icosahedron")sum+=20; else if(name=="Dodecahedron")sum+=12; else if(name=="Oct...
#include "resistance.h" using namespace std; namespace sbg { template<int n> Resistance<n>::Resistance(const double value) : _value(value) { } template<int n> Vector<n, double> Resistance<n>::getResult(const PhysicPoint<n>& object) const { return -1 * object.getVelocity() * getValue(); } template<int n> double ...
// Created on: 1993-07-27 // Created by: Christian CAILLET // 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 ...
#include <iostream> #include <string> #include <fcntl.h> #include <sys/mman.h> #include <unistd.h> #include "oscilloscope.h" #include <stdio.h> #include <string.h> #include <poll.h> using namespace uio_lib; void * MmapNumber(int _fd, size_t _size, size_t _number) { const size_t offset = _number * getpagesize(); ...
#if !defined(QSOCKET__INCLUDED_) #define QSOCKET__INCLUDED_ #include <unordered_set> #include <crow.h> #include <mutex> class HackWebSocketRule : public crow::BaseRule { using self_t = HackWebSocketRule; public: HackWebSocketRule(std::string rule) : BaseRule(std::move(rule)) { } ...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // // Copyright (C) 1995-2004 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 "modules/util/gen_math.h" #include...
// Matrix Construct // // Copyright (C) Matrix Construct Developers, Authors & Contributors // Copyright (C) 2016-2018 Jason Volk <jason@zemos.net> // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above // copyright notice...
// // utils.h // NeheGL // // Created by Andong Li on 8/31/13. // Copyright (c) 2013 Andong Li. All rights reserved. // Compute accurate FPS by averaging one frame processing // time of a certina amout // #ifndef __NeheGL__utils__ #define __NeheGL__utils__ #include <iostream> #include <stdio.h> #include <OpenGL/g...
/** * @file OSControl.h * @author dtuchscherer <daniel.tuchscherer@hs-heilbronn.de> * @brief Abstraction interface * @details Abstracting the management of real-time tasks. * @version 1.0 * @copyright Copyright (c) 2015, dtuchscherer. * All rights reserved. * * Redistribut...
#pragma once #include "log.hpp" #include <stdexcept> #include <string> using namespace std; #define DECLARE_BORING_EXCEPTION(class_name) class class_name : public runtime_error { \ public: \ explicit class_name(string&& file, int line) : \ runtime_error(move(file) + string(":") + to_string(line)) {} \ explic...
// // Created by pierreantoine on 09/01/2020. // #include <iostream> #include "symbol_catalog.h" symbol::symbol & symbol::symbol_catalog::lookup(const std::string & key) { auto symbol_link = catalog.find(key); if (symbol_link != catalog.end()) { return symbol_link->second; } auto insertio...
#ifndef PAINTBALL_CLASS_H_ #define PAINTBALL_CLASS_H_ class competition; class Weapon{ public: Weapon(std::string _name, double _power, double _effective_range, double _cost); double get_power(){return power;} double get_range(){return effective_range;} double get_cost(){return cost;} std::string get_name(){return...
#pragma once extern "C" { extern void emscripten_worker_respond(char const * const, int); extern void emscripten_worker_respond_provisionally(char const * const, int); } namespace response { enum Response { VOID = 1, CLEAN = 2, SVG = 20, }; typedef enum Response Response; void respond...
#ifndef __GRAVITATIONAL_FORCE_H__ #define __GRAVITATIONAL_FORCE_H__ #include <Eigen/Core> #include "Force.h" #include <iostream> class GravitationalForce : public Force { public: GravitationalForce( const std::pair<int,int>& particles, const scalar& G ); virtual ~GravitationalForce(); virtual void addEnergyT...
//--------------------------------------------------------------------------- #pragma hdrstop #include "SPCommon.h" #include "KOEItlbm.h" //--------------------------------------------------------------------------- #pragma package(smart_init) static String gAppPath; static String gSrcModPath; static LangMod...
/* * @lc app=leetcode.cn id=297 lang=cpp * * [297] 二叉树的序列化与反序列化 */ // @lc code=start /** * Definition for a binary tree node. * */ #include<iostream> #include<vector> #include<string> #include<sstream> using namespace std; // struct TreeNode { // int val; // TreeNode *left; // TreeNode *right; // ...
/* * main.cpp * * Created on: Jul 16, 2018 * Author: Micha */ #include <iostream> using namespace std; int main(){ cout<< "Test" << endl; return 0; }
#include "stdafx.h" #include <iostream> #include "List.h" using namespace std; void List::add(int value){ List* ls = new List; if(!head){ ls->element = value; this->head = ls; } else{ List* last = new List; last->element = value; ls = this->head; while(ls->next != NULL){ ls = ls-...
// // Created by Yujing Shen on 29/05/2017. // #include "../../include/nodes/MatMulNode.h" namespace sjtu{ MatMulNode::MatMulNode(Session *sess, const Shape &shape): SessionNode(sess, shape) { } MatMulNode::~MatMulNode() { } Node MatMulNode::forward() { const Tensor X...
//#pragma once #ifndef __GO_ROLLING_CMD_H__ #define __GO_ROLLING_CMD_H__ #include <maya/MPxCommand.h> #include <maya/MDGModifier.h> class GoRollingCmd : public MPxCommand { public: virtual MStatus doIt(const MArgList&); virtual MStatus undoIt(); virtual MStatus redoIt(); virtual bool isUndoable() const { return ...
#ifndef __DB_REC_H #define __DB_REC_H #include "db_data.h" namespace wh{ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- enum ...
#include<iostream> #include<cstdio> #include<cstring> #define getint(a) scanf("%d",&a) #define MAX 1000 using namespace std; int gcd(int a, int b) { if(a == 1 || b == 1) return 1; if(a == 0) return b; if(b == 0) return a; if(a == b) return a; else if(a > b) return gcd(a%b,b); else return gcd(a,b%a); }...
#include "misc.h" // Rozne pomniejsze funkcje. // Konwersja stopni na radiany. fp_t deg2Rad(fp_t degrees){ return degrees * M_PI / 180.0; } // Funkcja znaku. bool sign(int x){ return x ? (x > 0 ? 1 : -1) : 0; } // Sprawdzenie, czy czesc wycinka/luku ograniczonego // katami alfa1, alfa2 lezy w danej cwiartce. bool...
// // TiendaAbarrotes.cpp // // // Created by Daniel on 14/08/14. // // #include "TiendaAbarrotes.h"
#include <iostream> #include <vector> #define cn(x) cout << #x << " = " << x << endl; using namespace std; int main(){ int t; cin >> t; for(int i = 0; i < t; i++){ int n; cin >> n; vector<string> vs(n); for(int j = 0; j < n; j++) cin >> vs[j]; int k = 0; for(; k < n; k++){ if(vs[k][0]!='#') bre...
// Tom Koole // 2011-11-18 // Project Euler #5 #include <stdio.h> #include <stdlib.h> int main() { int number = 0; // number to check int mod = -1; // mod value to check do { number += 20; // don't need to check all numbers for(int p = 19; p > 0; p--) { mod = number % p; if(mod > 0) break; // don't nee...
#ifndef wali_IWALI_HANDLER_GUARD #define wali_IWALI_HANDLER_GUARD 1 /** * @author Nicholas Kidd */ #include "wali/Common.hpp" #include "wali/Countable.hpp" #include <xercesc/sax2/DefaultHandler.hpp> XERCES_CPP_NAMESPACE_USE namespace wali { class IWaliHandler : public DefaultHandler, public Countable { ...
#include "ros/ros.h" #include "std_msgs/Int32MultiArray.h" #include "std_msgs/MultiArrayDimension.h" #include "std_msgs/Float32.h" #include "geometry_msgs/Twist.h" #include "geometry_msgs/Vector3.h" #include "tf2_geometry_msgs/tf2_geometry_msgs.h" #include "hexapi.h" #include "hexapi_control.h" #define MAX_PCA9685_IN...
// // Date.cpp // EX05_05 // // Created by Eben Schumann on 11/1/16. // Copyright © 2016 Eben Schumann. All rights reserved. // #include <stdio.h> #include "Date.h" Date::Date() { year = 1900; month = 1; day = 1; } void Date::setDate(int YEAR, int MONTH, int DAY) { year = YEAR; month = MONT...
/* -*- Mode: c++; tab-width: 4; 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. * * @author Patricia Aas (psmaas) */ #include "core/pch.h" // Core : #include "modules...
// g++ -g --pedantic -Wall -o echotime echotime.cxx #include <iostream> #include <ctime> #include <iomanip> #include <unistd.h> short echoTime() { time_t now = time(0); static short c = 0; // convert now to string form char* dt = ctime(&now); std::cout << std::setfill('0') << std::setw(2) << c << ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2003-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen ** */ #ifndef _SSL_XML_UPDATE_H_ #define _SSL_...
#pragma once namespace ugsdr { struct AcquisitionResult { }; }
#include "pch.h" #include "DebugRenderer.h" #include "RenderBuffer.h" #include "VertexDeclaration.h" #include "RenderDevice.h" // Color for next debug primitive static Vector4 s_PrimitiveColor = Vector4(1.0f, 1.0f, 1.0f, 1.0f); // Render buffer used by debug renderer static Hourglass::RenderBuffer s_DebugRendererBuf...
#include <iostream> #include <algorithm> #include <vector> int main() { std::cin.sync_with_stdio(false); std::cin.tie(NULL); int n, list[1001], dp[1001], sz = -1; std::vector<int> ans; std::cin >> n; std::fill(dp, dp + 1001, 1); for(int i = 0; i < n; i++) { std::cin >> lis...
// Copyright 2017 Elias Kosunen // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
// Copyright Onygox 2020. #pragma once #include "CoreMinimal.h" #include "Components/ActorComponent.h" #include "Engine/TriggerVolume.h" #include "OpenDoor.generated.h" UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) class DUNGEONESCAPE_API UOpenDoor : public UActorComponent { GENERATED_BODY() p...
#include <iostream> using namespace std; void merge(int array[], int start, int middle, int end){ //Algorithm for the merge sort int n = middle-start+1; int m = end- middle; int leftarray[1000]; int rightarray[1000]; for(int i =0;i<n;i++){ //Copying the element into sub-Array leftarray[i] = array[st...
/* -*- 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. */ #include "core/pch.h" #include "adjunct/quick/extensions/Extens...
#include "D.h" #include <jni.h> #include <stdio.h> JNIEXPORT void JNICALL Java_D_printName(JNIEnv*, jobject) { printf("D\n"); }
// Copyright (c) 1991-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 Lesser General Public License version 2.1 as published ...
#include <iostream> #include <vector> #include <queue> #include <cstring> const int MAX_V = 1e9; struct link_n{ int node, cost, time; link_n(int N, int C, int T) : node(N), cost(C), time(T){} bool operator<(const link_n &rhs) const{ return time > rhs.time; } }; int n, m, k; int dist[101][10001]...
// Project_33 Accelerometer Mouse int gndPin = A2; int xPin = 5; int yPin = 4; int zPin = 3; int plusPin = A0; int switchPin = 12; void setup() { pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW); pinMode(plusPin, OUTPUT); digitalWrite(plusPin, HIGH); pinMode(switchPin, INPUT_PULLUP); pinMode(A1, INPUT);...
#ifndef GAME_H #define GAME_H #include <SDL2/SDL.h> #include <memory> #include <string> #include "Scene.h" using namespace std; class Game { public: Game(); ~Game(); void start(); private: //SDL void SDLInit(); void RendererInit(); SDL_Window* win; SDL_Renderer* ren; // Scene* scene; ...
let value = 34;
#include "tile.h" #include <iostream> #include "levelgenerator.h" //#define DRAW_BOXES Tile::Tile(sf::Vector2f position) { if (!mTexture.loadFromFile("Resources/tile.png")) { std::cout << "Texture not loaded" << std::endl; } mSprite.setTexture(mTexture); mSprite.setPosition(position); } Tile::Tile(sf::Vector2i...
#ifndef DNDSEQUENCE_LOAD_H #define DNDSEQUENCE_LOAD_H //#include "../Paramcommand.h" #include "Icommand.h" class Load:public Icreate { public: /*virtual*/~Load(){} std::string run(Iwriter &writer, Ireader& reader, dataDNA& containerDna, const Paramcommand& obj); private: bool isValid(...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@tiliae.eu * * ~~~~~~~~ * * Lice...
#include "point_cloud_viewer.hpp" void PointCloudViewer::append_line(const Eigen::Vector3d &point_a, const Eigen::Vector3d &point_b) { auto id = unique_id(); pcl::PointXYZ pt_a(point_a.x(), point_a.y(), point_a.z()); pcl::PointXYZ pt_b(point_b.x(), point_b.y(), point_b.z()); lines_.emplace_back(std::make_tuple...
#ifndef ListviewDelegate_H_ #define ListviewDelegate_H_ #include <QtGui> #include <QStyledItemDelegate> #include <QApplication> #include "hmldefinitions.h" class ListviewDelegate : public QStyledItemDelegate { public: ListviewDelegate(); virtual ~ListviewDelegate(); enum datarole {headerTextRole =...
#ifndef _GUARD_TASK_ALLOCATION_H #define _GUARD_TASK_ALLOCATION_H #include <cassert> #include <initializer_list> #include <ostream> #include <utility> #include <vector> #include "dump.h" #include "perm.h" #include "util.h" namespace cgtl { class TaskAllocation : public std::vector<unsigned> { public: TaskAllocati...
#pragma once #include "Ellipsoid.h" namespace siu { namespace shape { /** * —фера. * * @see Sphere * * @template —м. Shape. */ template< size_t SX, size_t SY, size_t SZ > class Sphere : public Ellipsoid< SX, SY, SZ > { public: /** * —сылки на сферу. */ typedef std::shared_ptr< Sphere > Ptr; ...
#pragma once ///解码和显示视频 struct AVPacket; class XDecode; #include <list> #include <mutex> #include <QThread> class XAudioThread; class XVideoThread; class XDecodeThread : public QThread { public: XDecodeThread(); virtual ~XDecodeThread(); virtual void Push(AVPacket* pkt, XAudioThread* at, XVideoThread* vt, long long...
#include <iostream> #include <cstring> using namespace std; int main(){ string a; int i=0; int max=1,type=1,t=0; double gyh; cin>>a; while(a[i]!='\0'){ i++; } if(i==1){ cout<<1; return 0; } for(int j=1;j<i;j++){ if(a[j]==a[j-1])max++; else{ type++; t+=max; max=1; } } t+=max; gyh=1.0*t...
/****************************************************************************** * * * Copyright 2018 Jan Henrik Weinstock * * * ...
// // IService.h // client // // Created by Sergey Proforov on 09.05.16. // Copyright (c) 2016 Proforov Inc. All rights reserved. // #ifndef client_IService_h #define client_IService_h #include <string> #include <functional> //Интерфейс взаимодействия с сервером, делаем независимость от протокола. class IService...
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QMessageBox> #include <QSqlError> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); createConnectionSqlite(db, "CD_Sammlung.db"); model = new QSqlTableModel(this, db); model->...
#include <iostream> using namespace std; int main(){ string c; int sum = 0; int j = 1; char flag; for (int i = 0; i <= 12; i++) { cin >> c[i]; if (c[i] <= '9' && c[i] >= '0' && i != 12) { sum += (c[i] - '0') * j; j++; } if (i == 12) ...
// Created on: 2002-10-30 // Created by: Michael SAZONOV // 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.1 ...
#pragma once struct chank; class SuperMonsterSelect; typedef SuperMonsterSelect SMS; class GameCursor; class MonAIPresets; struct Person { int aimode = 0; int monID = 0; int stlen = 0; char str[255]; int stind = 0; }; struct Preset { ~Preset() { for (int i = 0; i < 3; i++) delete person[i]; } Person* p...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** 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. ** ** Alexander Remen (alexr) */ #include "core/pch.h" #include "Op...
// Frame Functions // // Copyright (C) 2008 // Center for Perceptual Systems // University of Texas at Austin // // jsp Thu Oct 16 15:12:06 CDT 2008 #ifndef FRAME_H #define FRAME_H #include <QImage> #include <cassert> namespace flying_dragon { /// @brief An image frame class Frame : public QImage { public: ...
// This is a personal academic project. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com #include "shared.h" #include "material.h" #include "pbr.h" #include "mat4.h" #include "sphere.h" //--------------------------------------------------------------...
#ifndef ISA_STORE_H #define ISA_STORE_H #include <map> #include <functional> #include "formats.h" /* * STORE-type instruction implementation */ namespace selen { namespace isa { struct STORE { enum {TARGET = OP_STORE}; typedef formatS format_t; explicit STORE(format_t l) : data(l) {} void ...
#include <bits/stdc++.h> using namespace std; const int maxn = 1e2+2; typedef pair<string,int> pa; typedef map<string,int> m; string str; m role; m a; m user; vector<pa> role_a[maxn]; vector<pa> user_a[maxn]; void join(int v){ int k = role[str],j; for(int i = 0;i<role_a[k].size();++i){ pa p = role_a[k]...
#pragma once #include "resource.h" // CEntityDialog 对话框 class CEntityDialog : public CDialog { DECLARE_DYNCREATE(CEntityDialog) public: CEntityDialog(CWnd* pParent = NULL); // 标准构造函数 virtual ~CEntityDialog(); // 对话框数据 enum { IDD = IDD_ENTITY_DIALOG }; protected: virtual void DoDataExchang...
1 #include <iostream> 2 #include <sys/socket.h> 3 #include <unistd.h> 4 #include <netinet/in.h> 5 #include <arpa/inet.h> 6 #include <string.h> 7 #include <stdlib.h> 8 using namespace std; 9 int main(int argc, char* argv[]) 10 { 11 if(argc!=3) 12 { 13 cout<<"Usage: "<<endl; 14 ...
#include <bits/stdc++.h> using namespace std; int main(){ int n, d, k; cin >> n >> d >> k; vector<int> l(d), r(d); for(int i=0; i<d; i++) cin >> l[i] >> r[i]; for(int i=0; i<k; i++){ int ans = 0; int s, t; cin >> s >> t; for(int j=0; j<d; j++){ ...
#include <iostream> #include <algorithm> #include <vector> #include <map> using namespace std; typedef pair<int, int> ii; typedef map<int, int> mii; ii twoSums(mii list, int target) { int size = list.size(), currentValue, otherValue; mii::iterator it; // create an iterator type for map for(int i=0;i<size;i++) ...
#include <windows.h> void buildProgram(); int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow) { buildProgram(); // Run the message loop. It will run until GetMessage() returns 0 MSG messages; while (GetMessage (&messages, NULL, 0, 0)) { ...
#include "world.h" world::world(std::string const &path) { std::ifstream ifs(path + "/map.txt"); ifs >> size; int nchunks = read<int>(ifs); std::vector<world_chunk::terrain_type> chunks_types; for(int i : boost::irange(0, nchunks)) { chunks_types.push_back(static_cast<world_chunk::terrain_type>(read<int>(ifs))...
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int main(){ double a; cin >> a; cout << "Primitive : Double"<<"\n"; char b; cin >> b; cout << "Primitive : Character"<<"\n"; bool c; cin >> c; cout << "Primitive : Boolean"<<"\n"; int d; cin >> d; cout <<"Primitive : Integer"<<"\...
/* * The obstace avoider avoids obstacles by * changing the driving direction * ObstacleAvoidance only uses lidar sensors * * * Creation date: 2019 07 31 * Author: Taha Tekdemir */ #include <Arduino.h> #ifndef OBSTACLEAVOIDANCE_H #define OBSTACLEAVOIDANCE_H class ObstacleAvoidance { public...
#ifndef STUDENTWORLD_H_ #define STUDENTWORLD_H_ #include "GameWorld.h" #include "GameConstants.h" #include "GraphObject.h" #include "Actor.h" #include <string> #include <vector> enum Direction { none, up, down, left, right }; class StudentWorld : public GameWorld { public: StudentWorld(std::string assetDir) : Game...
#include<iostream> #include<cstring> #include<stdlib.h> #include<stdio.h> using namespace std; class charStack { private: int top=-1; char Stack[300]; public: void push(char elem); char pop(); char showLast(); }; class intStack { private: i...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 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 "modules/hardcore/opera/opera.h" #incl...
#include "BMP.h" #include <stdio.h> #include "stdlib.h" #include <iostream> using namespace std; BMP::BMP() { //ctor } int BMP::isImported = 0; int BMP::isSharped = 0; BMP::~BMP() { //dtor } void BMP::readbmp(char bmpname[26]) { int width,height;//图片的宽度和高度 FILE *fpi; fpi=fopen(bmpname,"rb"); i...
#ifndef HTTP_HH #define HTTP_HH #include <string> #include <vector> #include <stdexcept> #include <stdarg.h> #include <boost/lexical_cast.hpp> #include "http_parser.h" #include "error.hh" namespace ten { // TODO: define exceptions typedef std::pair<std::string, std::string> header_pair; typedef std::vector<header_...
#pragma once #include "widget.hpp" #include "controller.hpp" struct View : Widget, Controller { };
#include "Cube.h" Cube::Cube() : m_render(false), m_gVBO(0) { // Make sure all textures are init to 0 m_textures[0] = 0; } Cube::~Cube() {} bool Cube::init() { bool success = true; // Vertex data vertex * vertices = new vertex[26]; // Front face vertices[0].position[0] = -1.0f; vertices[0].position[1] = -...