text
stringlengths
8
6.88M
#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 <stdio.h> #include <string.h> #include <time.h> #include <numeric> const int dy...
#include <BinomialQueue.h> #include <PuttingVisitor.h> #include <Wrapper.h> #include <iostream> int main(void) { using namespace std; BinomialQueue bq; Int *ip1 = new Int(1); Int *ip2 = new Int(2); Int *ip3 = new Int(3); Int *ip4 = new Int(4); Int *ip5 = new Int(5); Int *ip6 = new Int(6); Int *ip7 ...
#include <bits/stdc++.h> using namespace std; int func(int a, int b, int c, int x, int y); int main() { int g[3], m[2], ret, maior=0; while(scanf("%d %d %d %d %d", &g[0], &g[1], &g[2], &m[0], &m[1]) && (g[0] || g[1] || g[2] || m[0] || m[1])) { sort(g, g+3); ret = func(g[0], g[1], g[2], m[0],...
#include <GL/glut.h> #include <cstdlib> #include <memory> #include <vector> using namespace std; static void Timer(int value) { glutPostRedisplay(); glutTimerFunc(10, Timer, value); } class Cube { public: float x; float y; float width; float height; float speed; Cube(float xp, float...
#ifndef SPECEX_PYPSF__H #define SPECEX_PYPSF__H #include <vector> #include <string> #include <specex_unbls.h> #include <specex_psf.h> #include <specex_spot.h> #include <specex_gauss_hermite_psf.h> #include <specex_pyoptions.h> #include <pybind11/pybind11.h> #include <pybind11/numpy.h> namespace py = pybind11; na...
#include <iostream> #include <fstream> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <map> #include <vector> #include <algorithm> #include <math.h> #define pb push_back using namespace std; int a, b; void input() { scanf("%d %d", &a, &b); } void printfChar(int num, char c) { for (int i ...
 #include <stdlib.h> #include <stdio.h> #include <string> #include <stdint.h> #include <time.h> typedef unsigned int uint; typedef unsigned int uint32; typedef int64_t int64; #ifndef _MSC_VER typedef unsigned long DWORD; #endif /* Have our own assert, so we are sure it does not get optimize...
#include "robot.h" #include <iostream> #include <cmath> float sensorAngle[16] = {PI/2.0,(5.0/18.0)*PI,PI/6.0,PI/18.0,-PI/18.0,-PI/6.0,-(5.0/18.0)*PI,-PI/2.0,-PI/2.0,-(13.0/18.0)*PI,-(5.0/6.0)*PI,-(17.0/18.0)*PI,(17.0/18.0)*PI,(5.0/6.0)*PI,(13.0/18.0)*PI,PI/2.0}; int start = 1; int objectRight, objectLeft = 0; int turn...
/* Hackerrank problem: https://www.hackerrank.com/challenges/vector-erase/problem */ #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> int main() { int n, start, number, startDelete, endDelete; std::vector<int> v; std::cin >> n; ...
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you...
#include "KeyboardSubscriber.h" namespace Game { void KeyboardSubscriber::onEvent(sf::Event event) { switch (event.type) { case sf::Event::KeyPressed:onKeyPress(event.key); break; case sf::Event::KeyReleased:onKeyUp(event.key); break; } } }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) 2008-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" #ifdef MEDIA_...
#ifndef SOPNET_GROUND_TRUTH_SEGMENT_EXTRACTOR_H__ #define SOPNET_GROUND_TRUTH_SEGMENT_EXTRACTOR_H__ #include <pipeline/all.h> #include <sopnet/features/SetDifference.h> #include <sopnet/slices/Slices.h> #include <sopnet/segments/Segments.h> class GroundTruthSegmentExtractor : public pipeline::SimpleProcessNode<> { p...
#include <thread> #include <mutex> #include <algorithm> #include "udp_manager.h" #include "main_thread.h" #include "protocol.h" #include "interface.h" #include "path.h" bool on_checkip(const char* remote_ip, const int &remote_port) { file_server_thread::get_instance()->add_log(LOG_TYPE_INFO, "on_checkip---->>>>"); ...
#ifndef CNFDIALOG_H #define CNFDIALOG_H #include <QDialog> namespace Ui { class cnfDialog; } class cnfDialog : public QDialog { Q_OBJECT public: explicit cnfDialog(QWidget *parent = 0); ~cnfDialog(); /* private slots: void on_buttonBox_accepted(); */ private: Ui::c...
#include "TrianglesCommand.h" #include <iberbar/RHI/Texture.h> iberbar::Renderer::CTrianglesCommand::CTrianglesCommand() : CRenderCommand( URenderCommandType::Triangles ) , m_pShaderState( nullptr ) , m_pShaderVariableTables( nullptr ) , m_Triangles() { }
const int maxn = 1010; const int maxm = 1010; struct Matrix { int n, m; int a[maxn][maxm]; void clear() { n = m = 0; memset(a, 0, sizeof(a)); } Matrix operator +(const Matrix &b) const { Matrix tmp; tmp.n = n; tmp.m = m; for(int i = 0;i < n;i++) for(int j = 0;j < m;j++) tmp.a[i][j] = a[i][j] ...
/** * Copyright 2008 Matthew Graham * 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...
../1087/A.cpp
#pragma once #include "random.h" namespace qwaker { template<typename T = int> class treap_array { public: typedef T value_type; treap_array(size_t n = 0) : root(NULL) { root = __init_node(n); } treap_array(treap_array& a, treap_array& b) { __merge(a.root, b.root, root); } ...
/* In Linear Search the list is searched sequentially and the position is returned if the key element to be searched is available in the list, otherwise -1 is returned. The search in Linear Search starts at the beginning of an array and move to the end, testing for a match at each item All the elements preceding the ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2001 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ /** @file fontcache.h * * FontCache class prototype. * * @aut...
#include "cell.h" #include "widget.h" #include <QDebug> extern Widget* widget; Cell::Cell(int s) : QGraphicsItem(), editable(true), red(false), size(s), value(0) {} QRectF Cell::boundingRect() const { return QRect(0, 0, size, size); } void Cell::paint(QPainter *painter, const QStyleOptionGraphicsI...
#include "stdafx.h" #include "../Monster.h" #include "Uma.h" #include "../../GameData.h" Uma::Uma() { m_anim[Monster::en_idle].Load(L"Assets/modelData/uma/anim_uma_idle.tka"); m_anim[Monster::en_idle].SetLoopFlag(true); m_anim[Monster::en_walk].Load(L"Assets/modelData/uma/anim_uma_walk.tka"); m_anim[Monster::en_w...
#pragma once class AbortException : public std::runtime_error { public: explicit AbortException(const char *msg) : std::runtime_error(msg) {} };
#include <stdio.h> #include <sstream> #include <string> #include <iostream> #include "heapfileLib.h" void initializeHeapfile(std::string filename, Heapfile *heapfile, int pageSize) { FILE *colstore = fopen(filename.c_str(), "r+"); if (colstore == NULL) { printf("No colstore found for %s \n", filename.c_str()); ...
//使用するヘッダーファイル #include "GameL\DrawTexture.h" #include "GameL\SceneManager.h" #include "GameL\SceneObjManager.h" #include "GameL\HitBoxManager.h" #include "GameL\DrawFont.h" #include "GameL\Audio.h" #include "GameHead.h" #include "ObjChangeSwitch.h" //使用するネームスペース using namespace GameL; bool m_delete = true; bool m_...
/* Texture functions for cs580 GzLib */ #include "stdafx.h" #include "stdio.h" #include "Gz.h" GzColor *image = NULL; int xs, ys; int reset = 1; #define ARRAY(x,y) (x + (y * xs)) /* Image texture function */ int tex_fun(float u, float v, GzColor color) { unsigned char pixel[3]; unsigned char ...
#include "light_source.hpp" #include "../include/color.hpp" #include "../include/point.hpp" #include <string> #include <ostream> light_source::light_source(): position_(),la_(),ld_(),name_() {} light_source::light_source(std::string const& name , math3d::point const& p, color const& la, color const& ld): position_(p)...
/* ************************************************************************ * Copyright (C) 2020-2023 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * ...
#ifndef EXCEPTION_H #define EXCEPTION_H //Fichier de définition des exception class TacheException{ public: TacheException(const QString& message):info(message){} QString getInfo() const { return info; } private: QString info; }; class CalendarException{ public: CalendarException(const QString& messag...
#ifndef GAME_LOGIC_HEAD_FILE #define GAME_LOGIC_HEAD_FILE #include <vector> #include "Typedef.h" ////////////////////////////////////////////////////////////////////////// //数值掩码 #define LOGIC_MASK_COLOR 0xF0 //花色掩码 #define LOGIC_MASK_VALUE 0x0F //数值掩码 ////////////////////////////////////////////...
#include <iostream> #include <string> #include<vector> #include <cassert> //lets us use assertions in C ++ using namespace std; /// class person class Person { private : string name; string ssnum; int age; public: Person(); Person(string pname, string pssnum, int page); ~Person(); string getName(); st...
#include <bits/stdc++.h> #define MAXN 100010 using namespace std; typedef long long int lli; int main() { ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); int n, x; cin >> n >> x; int v[n]; for(int i=0;i<n;i++){ cin >> v[i]; } sort(v, v+n); int ans = 1; for(int i=n-1;i>=1;i--){ int pos = 1; ...
// // Created by Celeste Tan on 11/16/20. // #include <iostream> #include "Game.h" #include "NextPiece.h" void Game::run() { window.setKeyRepeatEnabled(false);//to make things more smooth /**design**/ sf::RectangleShape line1, line2; line1.setPosition(10, 10); line1.setSize(sf::Vector2f(10, ...
#pragma once #include <RemoteProcess.hpp> #include <easy_lua.hpp> extern void Lua_Export_RemoteModule( lua_State* l, const std::string& global_name ); extern void Lua_Export_RemoteProcess( lua_State* l, const std::string& global_name ); extern std::unique_ptr< haze::CRemoteProcess > g_pRemoteProcess;
#include <iostream> #include <opencv2/opencv.hpp> using namespace std; using namespace cv; int main(int argc, char** argv){ Mat image, mask; int width, height; int nobjects; CvPoint p; image = imread(argv[1],CV_LOAD_IMAGE_GRAYSCALE); if(!image.data){ std::cout << "imagem nao carregou corretament...
// // George O'Neill @ University of York, 2020/02/05 // // This is a simple program for adapting ROOT files created by 'ungroup2tree' at Orsay for FNT2, and: // - Adds new branches to help time order // - Stores a chained root file and checks whether it exists so should not be rewritten // - Sets up channels, calibrat...
#include <iostream> #include "PerlinNoise.hpp" int main(int argc, char* argv[]) { PerlinNoise PN; const int res = 5; for(int i = 0; i < res; ++i) { for(int j = 0; j < res; ++j) std::cout << PN(static_cast<double>(i)/res, static_cast<double>(j)/res) << " \t"; std::cout << std::endl; } }
#ifndef GN2DTRANSFORM_H #define GN2DTRANSFORM_H #include "GnTransform.h" class GNMAIN_ENTRY Gn2DTransform : public GnTransform { protected: GnVector3 mPostion; GnVector2 mScale; float mRotAngle; public: Gn2DTransform(){}; virtual ~Gn2DTransform(){}; public: inline GnVector3& GetPostion() { return mPostion; ...
#ifndef AWS_NODES_STATEMENT_H #define AWS_NODES_STATEMENT_H /* * aws/nodes/statement.h * AwesomeScript Statement * Author: Dominykas Djacenka * Email: Chaosteil@gmail.com */ #include "parsernode.h" namespace AwS{ namespace Nodes{ class Statement : public ParserNode{ public: Statement() : ParserNode(){...
#include "mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { setWindowTitle("M580 HIM"); my_mainWidget = new QWidget(this); my_Vlayout = new QVBoxLayout(this); my_Hlayout = new QHBoxLayout(this); my_diode = new Diode(my_mainWidget); QPushButton *di...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 2012 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" #if defined(VEGA_SUP...
#include <iostream> #include "generation.cpp" int main() { srand(time(NULL)); Generation gen(48,48,4,4,4,4); if(gen.Start(12,6,10,6,10) == -1) std::cout << "ERROR: The rooms can't fit into the map, decrease the minimum rooms size or the amount!" << std::endl; else for(int j = 0; j < gen...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<algorithm> #include<cmath> using namespace std; int r[100100],c[100100],g[]; int lowbit(int k) { return k & (-k); } void updata(int a[],int k,int ...
#pragma once #include "IQuestionView_fwd.h" #include "QuestionState_fwd.h" #include "types.h" namespace qp { class CQuestionViewController : public boost::noncopyable { public: CQuestionViewController(IQuestionStatePtr const& questionState, IQuestionViewPtr const& view); virtual ~CQuestionViewContro...
#ifndef Q04_H #define Q04_H #include<iostream> using namespace std; /** * 4. 归并排序 */ // time: O(n*log2(n)) space: O(n) 稳定 顺序存储和链式存储 void merge_sort(int *data, int start, int end, int *result); void merge(int *data,int start,int end,int *result); #endif
#include <iostream> #include <string.h> #include "BufferManager.h" using namespace std; CBufferManager_t::CBufferManager_t() { } CBufferManager_t::~CBufferManager_t() { if (m_pStart != NULL) { delete[] m_pStart; m_pStart = NULL; } } bool CBufferManager_t::Init(unsigned int maxLength) { m_pStart = new unsig...
#include "CGetPayInfo.h" #include "json/json.h" #include "Logger.h" #include "threadres.h" #include "JsonValueConvert.h" #include "StrFunc.h" #include "TcpMsg.h" int CGetPayInfo::do_request(const Json::Value& root, char *client_ip, HttpResult& out) { //Json::Value ret; //Json::FastWriter write; out["res...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2002 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/widgets/OpTime.h" #incl...
#ifndef MATH_IS_ODD_HPP #define MATH_IS_ODD_HPP namespace Math { static bool isOdd(int num) { return num & 1; } } // namespace Math #endif /* end of include guard : MATH_IS_ODD_HPP */
#pragma once #include "Manager.h" namespace m2 { namespace server { class RegisterManager: public Manager { struct userInfo { uuids::uuid fingerprint; std::string clientPublicKey; }; public: RegisterManager(Database *db); virtual HttpResponse::Code doAction(const std::string &da...
/* -*- 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. */ #ifndef OP_SCOPE_DOCUMENT_LISTENER_H #define OP_SCOPE_DOCUMENT_LI...
// Ed Callaghan // Constructs plots of energies against time - plot using drawAll.cxx // April 2016 TGraph *gSingleChannel(int ich) { double HR_PER_SEC = 1.0/3600.0 ; TChain *dataTree = new TChain("tree") ; dataTree->Add("../filling_pulser.root") ; double file_start_time, first_event_time ; dataTree->SetBranchA...
// One Arduino Leonardo has 2 motor drivers connected, each is driving 2 motors, so together 4 motors // Note: if motors is close to supplied with 100% of 24V i.e. PWM is 255, than even if we stop motor, a few sensor impulses could be produced, it can be max 1,2 for super power jack, but for smaller one it could be up ...
/** * Copyright (c) 2021, Timothy Stack * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of condi...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2006 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/forms/formvaluecolor....
#include<bits/stdc++.h> using namespace std; bool flag=false; int mp[5][5]; int main(){ for(int i=0;i<4;i++){ for(int j=0;j<4;j++) cin>>mp[i][j]; } if(mp[0][3]==1){ for(int i=0;i<3;i++) if(mp[0][i]==1) flag=true; if(mp[3][2]=...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
// Copyright 2011 Yandex #include "ltr/scorers/linear_scorer.h" #include <boost/lexical_cast.hpp> #include <string> #include <sstream> #include "logog/logog.h" using std::string; using boost::lexical_cast; namespace ltr { string LinearScorer::toString() const { std::stringstream str; std::fixed(str); str.pre...
#ifndef FABRIC_GLOBAL_PORT_INFO_UTILS_H #define FABRIC_GLOBAL_PORT_INFO_UTILS_H /******************************************************************** * Include header files that are required by function declaration *******************************************************************/ #include <vector> #include "fabri...
/** * Created by K. Suwatchai (Mobizt) * * Email: k_suwatchai@hotmail.com * * Github: https://github.com/mobizt/Firebase-ESP8266 * * Copyright (c) 2023 mobizt * */ /** This example will show how to authenticate using * the legacy token or database secret with the new APIs (using config and auth...
//This example will use a ostream_logger: a log that writes to an output stream. #include <lm/ostream_logger.h> //Of course, we need the sentries to write to a logger. #include <lm/log.h> #include <iostream> #include <vector> #include <cmath> using namespace lm; void say_something(lm::logger& _logger); int main(in...
#include <GLFW/glfw3.h> #include <glm/glm.hpp> class Input { public: Input(GLFWwindow *m_window); bool isKeyPressed(int32_t keycode); bool isMouseButtonPressed(int32_t button); glm::vec2 getMousePosition(); private: GLFWwindow *m_window; };
#ifndef LANGEVIN_H #define LANGEVIN_H #include <vector> #include "lorentz.h" double delta_qhat(int pid, double E, double M, double T); double qhat_small_angle_LOpQCD(int pid, double E, double M, double T); double qhat_L_small_angle_LOpQCD(int pid, double E, double M, double T); double qhat(int pid, double E, double M...
/* * httpservice.h * PennCloud CIS 505 * Author T01 * Date: Nov 6 2017 */ #ifndef HTTPSERVICE_H #define HTTPSERVICE_H #pragma once #include "feconfig.h" #include "../common/MasterServiceClient.h" #include "StorageRepositoryClient.h" using masterservice::WriteResponse; using masterservice::AddressDTO; using master...
#pragma once #include <iosfwd> template<typename T> class Ray { public: mutable T tMax; Point3<T> origin; Vector3<T> direction; T time; //const Medium *medium; Ray() { tMax = Infinity<T>(); time = (T)0; //medium(nullptr) } Ray(const Point3<T> &o, const Vector3<T> &d, T tM = Infinity<T>(), ...
#ifndef CVISA_H #define CVISA_H #include <QObject> #include <QtNetwork/qnetworkaccessmanager.h> #include <QtNetwork/qnetworkreply.h> #include <QtNetwork/qnetworkrequest.h> #include <QTextCodec> #include <QDebug> #include <QStringList> class CVisa : public QObject { Q_OBJECT public: explicit CVi...
// Created on : Sat May 02 12:41:16 2020 // Created by: Irina KRYLOVA // Generator: Express (EXPRESS -> CASCADE/XSTEP Translator) V3.0 // Copyright (c) Open CASCADE 2020 // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it un...
#include "StopMotionStones.h" StopMotionStones::StopMotionStones() : x( 30 ), y( 20 ), xSpacing( 1920 / x ), ySpacing( 1080 / y ), transparency( 255 ), showVector( false ) { voro = new VoronoiLayer(); voro->setSmoothAmount( 10 ); waterEffect = new ofxPostProcessing(); stonesTex.init(); c...
#ifndef HISTOGRAM_MANAGER_H #define HISTOGRAM_MANAGER_H #include "TFile.h" #include "TList.h" class HistogramManager { public: HistogramManager(); ~HistogramManager(); TList* LoadHistograms(std::string fileName, const char *dir_name); private: TList* ExtractHistograms(TFile* inputFile, const char *d...
#ifndef __NEIGHBOR_H_INCLUDED__ #define __NEIGHBOR_H_INCLUDED__ #include "GrowArray.h" class Neighbor : public GrowArray { public: // Constructors and Destructor Neighbor(); Neighbor(int i); Neighbor(int i, int j); ~Neighbor(); // Generators void pickGenerator(); void GeneratePeriodi...
#if defined(__WXMSW__) # include <cairo-win32.h> #elif defined(__WXGTK__) # include <gdk/gdk.h> //# include "gtk/gtk.h" #endif // __WXMSW__ #include "fw/mainPanel.h" #include "gw/main_ui.h" CMainPanel::CMainPanel(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const...
// Created on: 2000-06-23 // Created by: Sergey MOZOKHIN // Copyright (c) 2000-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 ...
class PartOre: CA_Magazine { scope = 2; count = 1; type = 256; displayName = $STR_ORE_NAME_IRON; model = "\z\addons\dayz_epoch\models\iron_ore.p3d"; picture="\z\addons\dayz_epoch\pictures\equip_iron_ore_CA.paa"; descriptionShort = $STR_ORE_NAME_IRON_DESC; class ItemActions { class Crafting { text = ...
#pragma once #include "LobbyUser.h" class RoomManager : public CMultiThreadSync<RoomManager> { public: RoomManager(); ~RoomManager(); private: DWORD mMaxRoomCount; DWORD mCurrentRoomCount; std::vector<Room*> mRoomVector; public: BOOL Begin(DWORD maxRoomCount); BOOL End(); Room* QuickJoin(LobbyUser * user, ...
#include <iostream> #include <cstdlib> #include "RobotomyRequestForm.hpp" RobotomyRequestForm::RobotomyRequestForm(std::string const &target) : Form("RobotomyRequestForm", 72, 45, target) { std::cout << "[RobotomyRequestForm](std::string const&)" " Ctor called" << std::endl; return ; } RobotomyRequestForm::~Rob...
#include "BarbWire.h" BarbWire::BarbWire() { gridResolutionY = 15; gridResolutionX = 15; distance = 150; barbWireKnobSize = 12; gridDeformAmount = 10; barbWireThickness = 2; hueVal = 0; brightness = 0; transparency = 0; } BarbWire::~BarbWire() { } void BarbWire::draw() { ofPus...
// Programmable-Air // Author: tinkrmind // https://github.com/orgs/Programmable-Air // // Crawling catterpillar // Needs two added valve extension boards // // PCB v0.3/v0.4/v0.5 #include "programmable_air.h" #define DEBUG 1 int state = UN_KNOWN; int atmospheric_pressure[3] = {520, 520, 512}; int u...
#include "redisDb.h" redisDb::redisDb() { } redisDb::~redisDb() { }
#include <stdio.h> #include <iostream> #include <string> using namespace std; int main() { string wow ="INTJ"; for (char i : wow) { cout << "[" << i << "]"; } cout << '\n'; return 0; }
#include<stdio.h> #include<stdlib.h> int main() { FILE *fp; char ch; fp=fopen("Sample.txt","r"); if(fp==NULL) printf("File not found\n"); else { while(!feof(fp)) { ch=fgetc(fp); printf("%c",ch); } fclose(fp); } }
#ifndef __mir9__AttackEnemyInfo__ #define __mir9__AttackEnemyInfo__ #include "figure/Monomer.h" #include "publicDef/PublicDef.h" using namespace ui; class AttackEnemyInfo: public Layer { LoadingBar* m_bloodPro; TextAtlas* m_level; Text* m_nickName; Layout* m_widget; public: ...
#include "bricks/io/substream.h" namespace Bricks { namespace IO { Substream::Substream(Stream* stream, u64 offset) : stream(stream), offset(offset), position(0) { length = stream->GetLength() - offset; } Substream::Substream(Stream* stream, u64 offset, u64 length) : stream(stream), offset(offset), position...
/* -*- 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 DOM_COMPASSNEEDSCALIBRATIONEVENT_H #define DOM_COMPASSNEE...
#include "InterfaceNative.h" class Implementation : public IInterface2 { private: MyValue value; public: Implementation() { value = MyValue{ 1, 3.0 }; } Implementation(int intValue, double doubleValue) { value = {intValue, doubleValue}; } virtual MyValue __stdcall GetValue() override { return value; ...
// Дана строка, содержащая пробелы. Найдите, сколько в ней слов (слово – это последовательность // непробельных символов, слова разделены одним пробелом, первый и последний символ строки – не // пробел). // Входные данные // На вход подается несколько строк. // Выходные данные // Необходимо вывести количество слов ...
#include <stdio.h> #include <stdlib.h> #include <time.h> /* reference : a book : Robot Intelligence how to compile: $ g++ -Wall filename.cpp -o executablename */ int main() { int **population; // 個体集合 int num; // 個体数 int length; // 遺伝子長 int i, j; num = 10; length = 5; population ...
#include <iostream> #include <string> #include <map> #include <vector> #include <fstream> using namespace std; int main(){ string letterList = "abcdefghijklmnopqrstuvwxyz"; int number; string letter; map<string, int> alphabet; for(int i=0;i<26;i++){ letter = letterList[i]; number = i; alphab...
// BEGIN CUT HERE // PROBLEM STATEMENT // // We have an arithmetic expression made up of positive // integers, the + and - operators and parentheses. All the // parentheses, // however, have been erased by the cleaning staff and we // want to calculate the minimum value the original // expression may have had. // ...
// Copyright (c) 2012-2017 The Cryptonote developers // Copyright (c) 2018-2023 Conceal Network & Conceal Devs // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "gtest/gtest.h" #include "CryptoNoteCore/CryptoNoteForm...
//Program Name: Triangle Challenge //Created by Kartik Nagpal - kn8767 #include <iostream> #include <cmath> using std::cin; using std::cout; using std::endl; using std::string; int main () { char array_alphabets [26] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', ...
#ifndef _EVENT_LIST_H_ #define _EVENT_LIST_H_ #include <map> #include "NanoTimer.h" #include "Event.h" using namespace std; //enum EventType { CREATE = 1, SPLIT = 2, ENDSIM = 10 }; class EventList{ private: // Id del escenario unsigned int id; vector<Event*> events; // unsigned int gen_start; // unsigned int g...
#include <ezLCDLib.h> ezLCD3 lcd; // create lcd object void setup() { lcd.begin( EZM_BAUD_RATE ); lcd.cls(); lcd.light(70); lcd.picture(0,0,"Map2.gif"); } void loop(){ }
#include <iostream> #include <thread> #include <mutex> #include <vector> using namespace std; once_flag callflag; void print_once() { cout << "!"; } void print(size_t x) { std::call_once (callflag, print_once); cout << x; } int main() { vector<thread> v; for (size_t i=0; i<10; i++) v.em...
//By SCJ //#include<iostream> #include<bits/stdc++.h> using namespace std; #define endl '\n' #define maxn 2005 int p[maxn],dp[maxn][maxn],go[maxn],back[maxn],c[maxn],start[maxn]; int main() { ios::sync_with_stdio(0); cin.tie(0); int test;cin>>test; while(test--) { int n;cin>>n; for(int i=1;i<=n;++i) cin>>p[i]>>g...
#include <iostream> using namespace std; int test() { int m, n, x, y; cin >> m >> n >> x >> y; int year = -1; for (int i = 0; year <= 40000; i++) { year = i * m + x; int rest = year % n > ? year % n : n; if (rest == y) { return year; } } return -1; } int main() { int T; cin ...
#include "utils.hpp" #include "recharge_ptts.hpp" #include "mail_ptts.hpp" using namespace std; namespace pc = proto::config; namespace nora { namespace config { recharge_ptts& recharge_ptts_instance() { static recharge_ptts inst; return inst; ...
#pragma once #include "aabb_able.h" namespace sbg { struct AABBBox : AABB_able { AABBBox() = default; AABBBox(const AABBBox&) = default; AABBBox(AABBBox&&) = default; AABBBox(std::pair<Vector2d, Vector2d> box); ~AABBBox() = default; void setBox(std::pair<Vector2d, Vector2d> box); std::pair<Vector2d, Vector2d...
#ifndef function_h #define function_h #include <highgui.h> //#include <cxcore.h> #include <cv.h> #include "stdio.h" #include <queue> #include <atlbase.h> #include <cmath> #include "templeteclass.h" using namespace std; CvPoint2D32f originpoints[4]; //保存四个点的原始坐标 CvPoint2D32f newpoints[4]; //保存这四个点的新坐标 int cnt = 0;...