text
stringlengths
8
6.88M
// Copyright (c) 2007-2013 Hartmut Kaiser // Copyright (c) 2011 Bryce Lelbach // Copyright (c) 2013 Adrian Serio // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)...
void operator()( const ast::file& file ) const { indent() << "<file>" << std::endl; for( const ast::function_definition& func : file.functions ) { recurse( func ); } } void operator()( const ast::function_argument& arg ) { indent() << "<function argument " << static_cast< const std::string& >( ar...
#ifndef _PQUEUE_CPP #define _PQUEUE_CPP #include "pqueue.h" template <class T> pqueue<T>::pqueue(vector<T> elem) { size = elem.size(); numE = 0; heap = new T[size]; for (int i = 0; i < size; i++) { heap[i] = elem[i]; buildbottomup(i); numE++; } } template <class T> void pqueue<T>::buildbottomup(int i...
#include <iostream> #include <thread> #include <future> #include <string> void thFunc(std::promise<std::string> && prm) { std::string str("Hello from future!"); std::this_thread::sleep_for(std::chrono::seconds(1)); prm.set_value(str); } int main() { std::promise<std::string> prm; std::future<std::string> ft...
// // TexturedOBJObject.cpp // Dev // // Created by Wahid Chowdhury on 6/3/13. // Copyright (c) 2013 Wahid Chowdhury. All rights reserved. // #include "TexturedOBJObject.h" #include "GLJoe.h" using namespace GLJoe; void TexturedOBJObject::initializeOpenGLBuffers() { OBJObject::initializeOpenGLBuffers();...
#include <string> #include <fmt/core.h> int main(int, char**){ using namespace std::literals; const auto x = "Hello"s; const auto y = "World"s; fmt::print("{}, {}!\n", x, y); return 0; }
#include <iostream> #include <limits.h> int main () { int i = 2; while (i + 1 > 0) { i *= 2; }; std:: cout << "Maximum value of int: " << i-1 << " " << INT_MAX << std::endl; std:: cout << "Minimum value of int: " << i << " " << INT_MIN << std::endl; std:: cout << "Maximum ...
#pragma once #include "proto/data_base.pb.h" #include "proto/data_player.pb.h" #include "proto/ss_base.pb.h" #include "proto/processor.hpp" #include "utils/client_process_base.hpp" #include "proto/ss_login.pb.h" #include "utils/client_process_mgr.hpp" namespace pd = proto::data; namespace ps = proto::ss; namespace n...
#pragma once #include <QWidget> #include <QSplitter> class SplitTerm : public QWidget { Q_OBJECT public: SplitTerm(QWidget* parent = NULL); virtual ~SplitTerm(); private: SplitTerm(QWidget* parent, QWidget* konsole); signals: void closed(); private slots: void addSplitTerm(Qt::Orientation dir)...
#include <OGLML/DynamicQuadRender.h> #include <glew.h> #include <glfw3.h> using namespace oglml; DynamicQuadRender::DynamicQuadRender() { const short int VERTEX_NUM = 4; const short int VERTEX_COORD_TEX_COORD_NUM = 5; const short int VERTEX_COORD_NUM = 3; const short int TEX_COORD_NUM = 2; glGen...
#pragma once #include "sequence.h" namespace u_interface_sort { void sort_interface(); }
#include "metodosOrdenacao.h" #include <fstream> #include "Dados.h" using namespace std; MetodosOrdenacao::MetodosOrdenacao(int n) { tamanhoPreenchido = n; } MetodosOrdenacao::~MetodosOrdenacao() { } void MetodosOrdenacao::Particao(Dados dados[], int Esq, int Dir, int *i, int *j) { Dados pi...
// Copyright (c) 2019 The NavCoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef NAVCOINLISTWIDGET_H #define NAVCOINLISTWIDGET_H #include <QFrame> #include <QLabel> #include <QListWidget> #include <QLin...
/* * ===================================================================================== * * Filename: fonc_factory_gnu.h * * Description: * * Version: 1.0 * Created: 24/05/2017 21:33:10 * Revision: none * Compiler: gcc * * Author: Jobs (), charlesdavid.b...
#include "Cuboid.h" Cuboid::Cuboid(float x, float y, float z, float dX, float dY, float dZ) { position[0] = x; position[1] = y; position[2] = z; dim[0] = dX; dim[1] = dY; dim[2] = dZ; testOType = 0.5f; orientation = glm::mat4(1.0f); GLfloat vertex_array_data[] = { -dX / 2.0f, -dY / 2.0f, dZ / 2.0f, 0.0...
// // Created by Marklar on 2017/5/19. // #include <list> #include <string> #include <sstream> #include <iostream> #include "command_line/CommandLine.hpp" #include "alpha/alpha.hpp" int main(int argc, char **argv) { std::string cmd_name(argv[0]); std::list<std::string> items; std::stringstream cl_ss; ...
#ifndef BASE_CHECK_H_ #define BASE_CHECK_H_ #include <assert.h> #include "base/scheduling/scheduling_handles.h" #include "base/threading/thread.h" namespace base { #define CHECK(condition) assert(condition) #define CHECK_EQ(actual, expected) CHECK(actual == expected) #define CHECK_GE(actual, expected) CHECK(actual ...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> #define INF 0x3f3f3f3f #define eps 1e-8 #define pi acos(-1.0) using namespace std; typedef long long L...
#ifndef APP_HH #define APP_HH #include <sys/resource.h> #include <iostream> #include <fstream> #include <boost/program_options.hpp> #include <boost/program_options/parsers.hpp> #include "task.hh" #include "logging.hh" #include "descriptors.hh" namespace ten { static int set_maxrlimit(int resource, rlim_t &max) { ...
#pragma once #include "plbase/PluginBase.h" #pragma pack(push, 1) class PLUGIN_API CPickupText { public: float m_fX; float m_fY; int field_8; float m_fW; float m_fH; class RwRGBA m_Color; char flags; char field_19; char __padding[2]; int m_dwPrice; int m_dwTextMessage; }; #pragma pack(pop)
#ifndef PROJECTILE_HPP #define PROJECTILE_HPP #include "box2d/box2d.h" #include "body.hpp" #include <vector> #include "agent.hpp" class Projectile : public Body { public: Projectile(b2World& world, float posX = 0.f, float posY = 0.f, b2Shape* shape = nullptr); void Update(float fElapsedTime) override; // void Ren...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2005-2012 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * Partially stolen from Emil's code in libgogi. */ #ifndef _OP_RE...
#include "PLayerThrowClimb.h" #include "Player.h" #include "PlayerClimbState.h" PLayerThrowClimb::PLayerThrowClimb(PlayerData *playerData) { this->mPlayerData = playerData; } PLayerThrowClimb::~PLayerThrowClimb() { } void PLayerThrowClimb::Update(float dt) { int curFrame = mPlayerData->player->GetCurrentAni...
#pragma once #include "COMALG.h" #include <windows.h> #include <msclr/marshal.h> namespace Zipper_winForms_ { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing;...
#pragma once #include"stdfax.h" class Penalty_method { private: vector_2d X0; double r, C, eps; void input(string Filename); double F(double X, double Y,double Rk); //4Gaus vector<double> Xk, Xk_1; function<double(double)> F_1; double eps0, eps1; void Check_Interval(pair<double, double> &Interval, int n_va...
#include <iostream> #include <algorithm> #include <iterator> #include <vector> using namespace std; class Solution{ public: vector<vector<int> > subsets(vector<int>& nums){ sort(nums.begin(), nums.end()); vector<vector<int> > result; vector<int> empty; result.push_back(empty); for(int i = 0; i ...
#ifndef _GetPlayerListProc_H_ #define _GetPlayerListProc_H_ #include "BaseProcess.h" class GetPlayerListProc : public BaseProcess { public: GetPlayerListProc(); virtual ~GetPlayerListProc(); virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket,Context* pt) ; }; #endif
// // Created by fab on 31/05/2020. // #ifndef DUMBERENGINE_MESH_HPP #define DUMBERENGINE_MESH_HPP #include <assimp/Importer.hpp> #include <assimp/scene.h> #include <assimp/postprocess.h> #include <vector> #include "../../utils/Vertex.hpp" #include "../../rendering/helper/Shader.hpp" #include "../../rendering/render...
#ifndef APPLICATION_INCLUDED #define APPLICATION_INCLUDED #include <Window.hpp> #include <Renderer.hpp> class Application { public: Application(HINSTANCE instance) : _instance(instance), _window(*this), _renderer(_window) { } HINSTANCE instance() const { retu...
//Declaración de constantes const int pinLectura = 1; //La lectura analógica la reslizaremos en el pin A0 const int pinLed = 6; int contadorFade = 0; int sentidoDeFade = 0; int contadorDeCiclos = 0; unsigned long milisActual =0; unsigned long milisAnterior = 0; void setup() { //Inicializa la comunicación serial a ...
// Created on: 1998-10-29 // Created by: Jean Yves LEBEY // Copyright (c) 1998-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GN...
// // Created by Yujing Shen on 28/05/2017. // #ifndef TENSORGRAPH_SESSIONOPTIMIZER_H #define TENSORGRAPH_SESSIONOPTIMIZER_H #include "TensorGraph.h" namespace sjtu{ class SessionOptimizer { public: SessionOptimizer(Session* sess); SessionOptimizer(const SessionOptimizer &rhs); vi...
#include "BMPHEAD.h" #include "PIXELDATA.h" #include <string> using namespace std; class image { public: BMPHEAD info; PIXELDATA **bitmap; }; class readImage:public image{ void readInfoHeader(image&,FILE*); public: image read(const char*); }; class resizeImage :public image { public: image resize(image&, double...
void setup() { Serial.begin(115200); delay(20); // Give port time to initalize // mpu_setup(); // Lidarsetup() Armsetup(); } void loop() { String data = Serial.readStringUntil('\n'); //------------Sensor data--------------- //getlidardata(); //getlidardata2(); //motion_sense(); //----------------------------...
// Author: Andrew Edwards // Email: ancedwar@ucsc.edu // ID: 1253060 // Date: 2015 Jan 18 #include <iostream> #include <sstream> #include <stdexcept> #include <iomanip> using namespace std; #include "debug.h" #include "inode.h" int inode::next_inode_nr {1}; inode::inode(inode_t init_type): inode_nr (...
#include "StdAfx.h" #include "Anime.h" /*------------------------------------------- コンストラクタ 引数:読む込むAnime(XML)ファイルパス --------------------------------------------*/ Anime::Anime(char* file_name) :isMirror(false), animeNo(0), count(0) { // XML読み込み ReadXML(file_name); } /*------------------------------...
void polymorphic(){ ; } int polymorphic(float p, float z){ polymorphic(); polymorphic(1.0,p); } int polymorphic(float p, int z){ z = 1.0; polymorphic(); polymorphic(1.0,p); } int polymorphic(float p, int z, float j){ p = 1.0; polymorphic(1.0,p); polymorphic(1.0,p,p); } void polymorphic(float p, int z, void j){...
#include <string> #include <cmath> #include <iostream> #include <sstream> #include "field.hh" using namespace std; const int RED = 0; const int BLUE = 1; std::string number_to_string(int num) { ostringstream convert; convert << num; return std::string(convert.str()); } void print_color(std::string t, int color) {...
// // main.cpp for main.cpp in /home/dupil_l/Module_C++/cpp_indie_studio/sources // // Made by Loïc Dupil // Login <dupil_l@epitech.net> // // Started on Wed May 3 16:39:31 2017 Loïc Dupil // Last update Wed May 31 14:33:38 2017 Stanislas Deneubourg // #include <ctime> #include "Core.hpp" int main() { std::un...
#ifndef BUTTON_H #define BUTTON_H #include <QtWidgets> class Button : public QGraphicsItem { public: Button(int w, int h); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); void mousePressEvent(QGraphicsSceneMouseEvent *even...
#include <iostream> using namespace std; int main() { int t; cin>>t; while(t--){ long long n,k; cin>>n>>k; long long ans = 1; k--; while(k%2){ ans++; k/=2; } cout<<ans<<endl; } return 0; }
#include "mocker_vas.h" #include <Windows.h> #include <Winsock2.h> #include <gmock/gmock.h> #include <stdio.h> using namespace ::testing; //gbkÖÐÎÄ int main(int argc, char *argv[]) { auto mocker = TestMocker::getMocker(); //gbkÖÐÎÄ EXPECT_CALL(*mocker, bind(::testing::_, ::testing::_,...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
#ifndef UTILS_H #define UTILS_H #include <iostream> #include <string> using std::stoul; using std::string; #include <cctype> #include <vector> using std::vector; #include "DataStructure.h" int parseInsertStatement(const string& target, Row& insertRow) { string buffer{}; vector<string> words; for (int i = 0...
/** @file */ #ifndef __TREEMAP_H #define __TREEMAP_H #include "ElementNotExist.h" #include <ctime> #include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #include <cmath> /** * TreeMap is the balanced-tree implementation of map. The iterators must * iterate through the map in the natural orde...
#include <gflags/gflags.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include <assert.h> #include "rlib/tests/random.hh" #include "./gen_addr.hh" #include "two_sided/core.hh" #include "two_sided/r740.hh" #include "../huge_region.hh" #include "../nvm_region.hh" #include "./statucs.hh" #inclu...
/* * Copyright (C) 2013 Tom Wong. All rights reserved. */ #ifndef __GT_DOC_MODEL_H__ #define __GT_DOC_MODEL_H__ #include "gtobject.h" #include <QtCore/QObject> GT_BEGIN_NAMESPACE class GtDocMeta; class GtDocument; class GtBookmarks; class GtDocNotes; class GtDocModelPrivate; class GT_BASE_EXPORT GtDocModel : publ...
//Given an array of strings, return all groups of strings that are anagrams. //Note: All inputs will be in lower-case. vector<string> anagrams(vector<string> &strs) { vector<string> result; if(strs.size() < 2) return result; //-1 for already in result unordered_map<string, int> cache; for(int i=0...
#include "sfmlBitmap.h" #include "sfmlDrawManager.h" SFMLBitmap::SFMLBitmap(Point<int> size, Color color) { fillWithColor(size, color); } SFMLBitmap::SFMLBitmap(sf::Image image) : image(image) { } int SFMLBitmap::getWidth() { return image.getSize().x; } int SFMLBitmap::getHeight() { return image.getSize().y; ...
#include "sudoku/BlockSplit.h" static cv_bridge::CvImageConstPtr cv_ptr; static ros::Publisher led_rect_pub; static ros::Publisher sudoku_rect_pub; static BlockSplit block_split; static bool sudoku_run; void sudokuParamCallback(const std_msgs::Int16MultiArray& msg) { block_split.setParam(msg.dat...
#include <omp.h> #include <stdio.h> #include <iostream> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <algorithm> #include <string> using namespace std; #ifdef __cplusplus extern "C" { #endif void generateMergeSortData (int* arr, size_t n); void checkMergeSortResult...
// // imautotest.cpp // AutoCaller // // Created by Micheal Chen on 2017/7/26. // // #include "imautotest.hpp" #include "autocontroller.hpp" #include "imcases.hpp" USING_NS_CC; using namespace ui; IMAutoTests::IMAutoTests() { ADD_TEST_CASE(IMAutoTest); } IMAutoTest::IMAutoTest() { btn_start = Button::c...
#pragma once #include <SFML/Window/Event.hpp> #include "EventSubscriber.h" namespace Game { class MouseSubscriber: public EventSubscriber { public: virtual void onMouseClick(sf::Event::MouseButtonEvent event) = 0; virtual void onMouseMove(sf::Event::MouseMoveEvent event) = 0; void onEvent(sf::Event event)...
#include "../command.hpp" void stop(void) { theGraph.clear(); response::clean(); }
#include <string> #include "../headers/Leaf.hpp" using namespace std; Leaf::Leaf(string value) { this->className = "leaf"; this->value = value; } Leaf::Leaf(string value, string type) { this->value = value; this->type = type; } string Leaf::getValue() { return value; } string Leaf::getType() { retu...
/* * Utils.cpp * * Created on: Jan 2, 2018 * Author: robert */ #include <fcntl.h> #include <stdio.h> #include <unistd.h> #include <termios.h> #include <iostream> #include "../inc/Utils.h" int Initport(int fd) { struct termios options; // Get the current options for the port... tcgetattr(fd, &options); ...
/** * @file macs-internals.hpp * * Internal include file. Contains global variables in the internal namespace * used to track the global status. */ #ifndef MACS_INTERNALS_HPP #define MACS_INTERNALS_HPP #include <cstdio> #ifdef __WIN32 #include <GL/glew.h> #endif #include <GL/gl.h> #ifndef __WIN32 #include <...
#include "WebServer.h" #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include "Steganography.h" #include "Certificate.h" #include "Rsa.h" using namespace cv; FILE * _jobFile; FILE * _messageFile; FILE * _doneFile; #define DWORD int void openFile() { _jobFile = fopen("/var/www/html/...
class Solution { public: vector<vector<int>> matrixReshape(vector<vector<int>>& nums, int r, int c) { if(nums.size()*nums[0].size()!=r*c){ return nums; }else{ vector<int> temp; for(int i=0;i<nums.size();++i){ for(int j=0;j<nums[0].size();++j){ temp.push_back(nums[i][j]); } } ...
// Created: 2009-01-09 // // Copyright (c) 2009-2013 OPEN CASCADE SAS // // This file is part of commercial software by OPEN CASCADE SAS, // furnished in accordance with the terms and conditions of the contract // and with the inclusion of this copyright notice. // This file or any part thereof may not be provided...
#include "stdafx.h" #include "Wall.h" Wall::Wall(int width, int height, float x, float y) : width(width) , height(height) , image(sf::Vector2f(width, height)) { image.setOrigin(width / 2, height / 2); image.setPosition(x, y); } float Wall::getTopY() { return image.getPosition().y - (height / 2); } float Wall:...
#ifndef MAINWINDOW_H #define MAINWINDOW_H // Qt cabeceras #include <QMainWindow> #include <QMessageBox> #include <QTimer> #include <QDir> // Librerias estandar de C++ #include <fstream> // Cabeceras OpenCV #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/objdetect/objdetect...
#include <bits/stdc++.h> using namespace std; /** * 面积树 * 四叉树 * **/ int str_to_int(string a){ int sum = 0; for(int i = 0; i < a.length(); i ++){ sum = sum * 10 + (a[i] - '0'); } return sum; } int tot = 0; const int MAXN = 1e6 + 5; struct AREA_tree{ struct NODE{ int lx, ly, rx, ry,...
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main () { vector<int> vet(6); vector<int> lott(6); vector<int>::iterator it; for (int i = 0; i < 6; i++) { cin >> vet[i]; } for (int i = 0; i < 6; i++) { cin >> lott[i]; } int cont = 0; for (auto i...
// // Created by Alex on 06/09/2018. // #ifndef CAPM_TIMESERIESDATA_H #define CAPM_TIMESERIESDATA_H #include <string> #include <vector> #include "Tools/CustomDate.h" #include "TimeSeriesHeaderReader.h" class TimeSeriesData { public: enum Variable{ OPEN, CLOSE, HIGH, LOW, VOLUME, EXDIVIDEND, SPLITRATIO, ...
#include "ball.h" #include "main.h" Ball::Ball(float x, float y, double xspeed, double yspeed) { this->position = glm::vec3(x, y, 0); this->rotation = 0; this->xspeed = xspeed; this->yspeed = yspeed; GLfloat vertex_buffer_data[8][400]; int i,j=1,k,l=0; for(i=0;i<120;i++) { if(i%2...
#include <iostream> #include <vector> #include <map> #include <queue> #include <stack> #include <string> #include <ctype.h> #include <stdio.h> #include <unordered_set> using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; ListNode *addTwoNumbersR(ListNode ...
const int N = 300; struct Dinic { struct Edge{ int from, to; ll flow, cap; }; vector<Edge> edge; vector<int> g[N]; int ne = 0; int lvl[N], vis[N], pass; int qu[N], px[N], qt; ll run(int s, int sink, ll minE) { if(s == sink) return minE; ll ans = 0; fo...
/********************************* * Lab 02 * Created by Kenneth Hobday & Elvet Potter II 01/21/2020 *********************************/ #include <iostream> using namespace std; #include "Bushel.h" // Main program void main() { class bushel a,b,c; // Initialize bushels a = bushel(3,8); b = bushel(2,6)...
#ifndef CPASSWDCONFIG_H #define CPASSWDCONFIG_H #include <QDialog> class CTitleWidget; class QTableWidget; class QDialogButtonBox; #define SEMIRPASSWD ("smfwk") #define BALABALAPASSWD ("balaitbalait") class CPasswdConfig : public QDialog { Q_OBJECT public: CPasswdConfig(QWidget *parent = 0); ~CPasswdConfig(); ...
#ifndef TREEFACE_POST_SURFACE_H #define TREEFACE_POST_SURFACE_H #include <treecore/RefCountObject.h> #include "treecore/ClassUtils.h" #include "treeface/gl/Enums.h" namespace treeface { class PostNetwork; class PostProcess; class PostTarget; class Framebuffer; class PostSurface: public treecore::RefCountObject { ...
//============================================================================ // Name : UnorderedMultimap.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ ...
#include "mini/BlackJack/blackjacktile.h" BlackJackTile::BlackJackTile(int index, const char *a, QWidget* parent) :QPushButton(parent) { this->index=index; this->a = a; } BlackJackTile::~BlackJackTile() { } int BlackJackTile::getIndex() { return this->index; }
/* * pod serializer requirements: * - allocate memory when needed; * - named blocks with pod types defined by user; */ #include <cstring> #include <cstdlib> #include <cerrno> #include <iostream> #include <fstream> #ifndef _SERIALIZER_H #define _SERIALIZER_H namespace csys { class serializer { /* ...
/* -*- 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" #ifndef NS4P_COMPONENT_PLUGINS #include "...
// // File: CLedBuf.cpp // Author: Andy Shepherd // email: seg7led@bytecode.co.uk // License: Public Domain // #define __TEST__ #ifdef __TEST__ #include <stdio.h> #include <stdlib.h> #endif #include "CLedBuf.h" CLEDBuf::CLEDBuf() { clear(); } void CLEDBuf::clear() { for(uint8_t x = 0; x < sizeof( m_buf ); x++ )...
#include <iostream> #include <vector> using namespace std; #define int long long int #define pb push_back #define endl '\n' const int N = 4e1 + 5; vector <string> Graph; int vis[N][N]; int n, m, spike; int ans = 0; int row[4] = { -1, 1, 0, 0}; int col[4] = {0, 0, -1, 1}; bool is_safe(int i, int j) { if (i < 0 || ...
#ifndef PHYSICS_SCENE_CPP #define PHYSICS_SCENE_CPP #include <component/MeshRenderer.h> #include <component/Rigidbody.h> #include <component/SphereCollider.h> #include <component/BoxCollider.h> #include <resource/Scene.h> #include <resource/Texture.h> #include <resource/shader/GShader.h> #include "../PostProcessors/S...
#include "pcbwindow.h" #include "ui_pcbwindow.h" #include <QtDebug> pcbWindow::pcbWindow(QWidget *parent) : QWidget(parent), ui(new Ui::pcbWindow) { qDebug()<<"begining of pcbWindow constructor"; ui->setupUi(this); control = new QPCBController(); scheduler = new processSchedulers; ticketWi...
#include "Merchant.h" Merchant::Merchant() { //ctor } Merchant::~Merchant() { //dtor } Merchant::Merchant(const Merchant& other) { for(unsigned int i=0; i < other.merchandises.size(); i++) { add(other.merchandises[i]); } } Merchant& Merchant::operator=(const Merchant& rhs) { if (this...
/* * Copyright (c) 2016 Morwenn * SPDX-License-Identifier: MIT */ //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifi...
/*Source: Combining Fuzzy Information: An Overview. Ronald Fagin. A Survey of Top-k Query Processing Techniques in Relational Database Systems. Ilyas, Beskales and Soliman. http://alumni.cs.ucr.edu/~skulhari/Top-k-Query.pdf */ /* * Threshold Algorithm 1. Access the elements sequentially and at each sequential ...
#include <vector> //二分查找(循环) bool binary_search(std::vector<int> &sort_array, int target){ int begin=0; int end=sort_array.size()-1; while(begin<end){ int mid=(begin+end)/2; if(target==sort_array[mid]) return true; else if(target<sort_array[mid]) end=mid-1; ...
// // Created by peachy_ash on 15.09.2021. // #include "../lib/folium_of_Descartes.hpp" #include "gtest/gtest.h" using namespace fancyCurve; TEST(Constructors, DefaultConstructor){ foliumOfDescartes f; ASSERT_EQ(1, f.get_n()); } TEST(Constructors, InitConstructor){ foliumOfDescartes f (3); ASSERT_EQ(3...
$NetBSD$ * put inclusion of asiolonk first so that map from net/if.h on illumos won't confict with std::map --- src/bin/dhcp6/tests/parser_unittest.cc.orig 2020-01-02 23:01:48.000000000 +0000 +++ src/bin/dhcp6/tests/parser_unittest.cc @@ -6,9 +6,9 @@ #include <config.h> +#include <dhcpsrv/parsers/simple_parse...
// // Created by cirkul on 27.11.2020. // #include "Lion.h" Animal *Lion::spawn(Playground &pg, int i, int j) { Lion *newAnimal = new Lion(pg, i, j); ++newAnimal->home->creatureCount; newAnimal->pg->newCreatures[newAnimal] = 1; newAnimal->pg->allAnimals.push_back(newAnimal); newAnimal->home->anima...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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. */ #ifndef CSS_PROPERTY_LIST_H #define CSS_PROPERTY_LIST_H class Te...
// // Created by drunkgranny on 13.04.16. // #include <iostream> using namespace std; void thePowerOfThor() { int lightX; // the X position of the light of power int lightY; // the Y position of the light of power int initialTX; // Thor's starting X position int initialTY; // Thor's starting Y positi...
///**************************************************************************** // * * // * Author : lukasz.iwaszkiewicz@gmail.com * // * ~~~~~~~~ * ...
#include<bits/stdc++.h> using namespace std; map<int,int> mp; int main() { int n; int cnt=0; int t=0; scanf("%d",&n); for(int i=0; i<n; i++) { int a; scanf("%d",&a); if(i+1==a) { cnt++; } else mp[a]++; } map<int,int>::it...
#include "windows.h" #include "NuiApi.h" #include <string> namespace NuiErrorsStringInterface { std::string NuiFusionDepthToDepthFloatFrameError(HRESULT hr); }
#include "ImageManager.h" //------------------------------------------------- //コンストラクタ・デストラクタ ImageManager::ImageManager( ) { LoadResource( ); } ImageManager::~ImageManager( ) { } //------------------------------------------------- //------------------------------------------------- //--------------------------...
/* Prac9 Q2 - histogram by Alan Agon a1636896 */ #include <iostream> #include <malloc.h> using namespace std; void histPrint(int bins[], int nrBins); int* histGen(double data[], int nrPts, double lo, double hi, int nrBins); int main() { cout << "histPrint and histGen outputs: " << endl; double data[]={4.1, 1....
#include "Common.h" #include "ARP.h" class Device { private: pcap_if_t* alldevs; pcap_if_t* d; pcap_t* adhandle; public: int obtainDeviceList(); int openAdapter(const char* nam); int setFilter(const char* packet_filter); void sendPacket(const BYTE* packet); pcap_t* getHandle() const; };
#pragma once #include "AAModel.h" class MyCube : public AAModel { public: MyCube(char * name); ~MyCube(); void update(); private: AAModel* front_left_wheel; AAModel* front_right_wheel; AAModel* rear_left_wheel; AAModel* rear_right_wheel; };
enum class Orientacion:int{ NORTE=0, SUR=1, ESTE=2, OESTE=3 };
// -*- C++ -*- // // Package: L1Trigger/L1TCaloLayer1Spy // Class: L1TCaloLayer1Spy // /**\class L1TCaloLayer1Spy L1TCaloLayer1Spy.cc L1Trigger/L1TCaloLayer1Spy/plugins/L1TCaloLayer1Spy.cc Description: [one line class summary] Implementation: [Notes on implementation] */ // // Original Author: Sridha...
// Created on: 1998-05-12 // Created by: Philippe NOUAILLE // Copyright (c) 1998-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 <bits/stdc++.h> #define MAX 110 using namespace std; int peso[MAX], wss[3]={}, memo[MAX], n, k, cont=0; int solve(int i, int p1, int p2, int p3); int main() { for(int i=0;i<MAX;i++) memo[i] = -1; scanf("%d %d", &n, &k); for(int i=0;i<n;i++) scanf("%d", &peso[i]); for(int i=0;i<k...
#ifndef HOSTID_H #define HOSTID_H #include <QHostAddress> typedef QHostAddress ID_TYPE; class HostID { friend uint qHash(const HostID & key); private: ID_TYPE m_id; quint32 m_ipAddr; public: HostID(const ID_TYPE & id); HostID(const HostID & rhs); ~HostID(); HostID & o...