text
stringlengths
8
6.88M
#include <iostream> #include <vector> #include <unordered_map> /**https://www.hackerrank.com/challenges/breaking-best-and-worst-records/problem */ using namespace std; struct record { int counter = 0; int currentScore = 0; } high, low; vector<int> breakingRecord(vector<int> scores) { // Assign first sc...
#include "VirtualScreen.h" VirtualScreen::VirtualScreen(unsigned int width, unsigned int height) { create(width, height); initialize(); } /// Draws the sprite at a given location in the game world. This location is /// dependent on the implementation within a VirtualScreen subclass. void VirtualScreen::worldD...
#ifndef KMINT_UFO_ANDRE_HPP #define KMINT_UFO_ANDRE_HPP #include "kmint/map/map.hpp" #include "kmint/play.hpp" #include "kmint/primitives.hpp" namespace kmint::ufo { class andre : public play::map_bound_actor { public: andre(map::map_graph& g, map::map_node& initial_node); // wordt elke game tick aangeroepen voi...
#ifdef __STRICT_ANSI__ #undef __STRICT_ANSI__ #endif #include <iostream> #include <gtest/gtest.h> #include <libprecision/libprecision.hpp> #include <bitset> #include <string> std::string operator*(const std::string &left, const int &right) { std::string ret; for(int i = 0; i < right; ++i) ret += left; return ret...
#include <cstdio> #include <iostream> #include <vector> #include <string> #include <stack> using namespace std; int maxSubArray(int A[], int n){ if(n == 0) return 0; int local =A[0]; int global =A[0]; for(int i=1;i<n;i++){ local = max(A[i],local+A[i]); global = max(local,global); } return global; ...
/* * angleblocker.cpp * deflektor-ds * * Created by Hugh Cole-Baker on 1/18/09. * */ #include <nds.h> #include "angleblocker.h" AngleBlocker::AngleBlocker(int bg, int x, int y, unsigned int palIdx, unsigned int tile, BeamDirection setAngle) : SpinBlocker(bg, x, y, palIdx, tile, setAngle), destroyed(false) ...
#include <PubSubClient.h> #include <WiFi.h> #include "esp_wifi.h" #include <ESPmDNS.h> #include <WiFiUdp.h> #include <ArduinoOTA.h> #include <Preferences.h> #include <ArduinoJson.h> // Placeholder for ssid and password read from ram const char* key_ssid = "ssid"; const char* key_pwd = "pass"; WiFiClient espClient; Pu...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define rep1(i, n) for(int i = 1; i <= (int)(n); i++) #define show(x) {for(auto i: x){cout << i << " ";} cout<<endl;} #define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;} typedef long l...
#include <Servo.h> /* pins */ const uint8_t vref_pin = A1; const uint8_t az_pin = 2; const uint8_t z45out_pin = A3; const uint8_t servo_pin = 9; const uint8_t led_pin = 13; Servo servo; uint8_t angle = 90; const uint8_t min_angle = 25; const uint8_t max_angle = 155; /* values in mv */ double vref_mv; double z_mv; d...
// ----------------------------------------------------------------------------- // G4Basic | RunAction.h // // // * Author: Everybody is an author! // * Creation date: 15 Aug 2019 // ----------------------------------------------------------------------------- #include "RunAction.h" // Q-Pix includes #include "...
#include <Arduino.h> #include <TimerOne.h> #include "a_car.h" double x=0; void Motor_Init() { pinMode(AIN1, OUTPUT); pinMode(AIN2, OUTPUT); pinMode(PWMA, OUTPUT); pinMode(BIN1, OUTPUT); pinMode(BIN2, OUTPUT); pinMode(PWMB, OUTPUT); } void motor(double left , double right) { x=left; left=right; rig...
#include "game_object_visitor.hpp" #include "asteroid.hpp" #include "bullet.hpp" #include "game.hpp" #include "player.hpp" #include "scrolling_bg.hpp" #include "spawn_point.hpp" // --------------------------------------------------------------------------------- // updating game_object::status game_object_updater::up...
#include<bits/stdc++.h> using namespace std; class SortedStack{ public: stack<int> s; void sort(); }; stack<int> push_bottom(stack <int> stk, int a){ if(stk.size() == 0 || stk.top() <= a){ stk.push(a); return stk; } if(stk.top() > a){ int t = stk.top(); stk.pop(); ...
#ifndef MIN_MAX_HIERARCHY_H #define MIN_MAX_HIERARCHY_H #include "cpvs.h" #include "Image.h" #include "Texture.h" /** * A min-max hierarchy can be created from an Image (with 1 channel, e.g. depth values) * and will contain in every level (except level 0, the original image) a min-max value. */ class MinMaxHierarc...
/* * LuaInterface.h * * Created on: Jun 11, 2017 * Author: root */ #ifndef LUA_LUAINTERFACE_H_ #define LUA_LUAINTERFACE_H_ #include "../define.h" #include "lua.hpp" #include "../Memory/MemAllocator.h" namespace CommBaseOut { enum E_LuaRet { eLuaSuccess, }; /** * 类的功能:提供与Lua交互接口 * 说明:打开关闭lua环境,所有与lua交互...
////////////////////////////////////////////////////////////////////// // // File: glrender.cc // // Animation Lab, Computer Science Department // Carnegie Mellon University // // Created: Fri Mar 15 02:55:52 1996 by Zoran Popovic // // various GL dependent rendering methods // // includes routines to draw cu...
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 0x3f3f3f3f; const int maxn = 505; ll big[maxn][maxn], small[maxn][maxn]; int vis_big[maxn], vis_small[maxn]; ll sr[maxn], br[maxn]; ll path[maxn];//记录顶点v之前正在连续的小路 ll n, m; ll Dijkstra(ll v0) { for(ll i = 0; i < n; i++) { sr[...
#pragma once #define FMT_HEADER_ONLY #include "fmt/format.h"
/** Purpose: run server program to testing socket How to run: g++ -std=c++11 -pthread Server.cpp -o server.o */ #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <iostream> #inclu...
using namespace std; int getrand(int a, int b) { random_device rd; mt19937 gen(rd()); uniform_int_distribution<int> distrib(a,b); return distrib(gen); }
#include <iostream> #include <string> #include <assert.h> #include <cstdlib> #include <string.h> #include <typeinfo> #include <cerror> #include <cmath> #include "cppJSON.h" using namespace std; #define EXPECT(c, ch) do { assert(*(c->json) == (ch)); c->json++;} while(0) #define ISDIGIT1TO9(ch) do { ((ch) ...
#include "precompiled.h" #include "component/jsrendercomponent.h" #include "component/jscomponent.h" #include "entity/jsentity.h" using namespace jscomponent; using namespace component; using namespace script; namespace jscomponent { static bool parseDesc(JSContext* cx, JSObject* obj, JSRenderComponent::d...
class 7Rnd_9x17_PPK : CA_Magazine { scope = 2; type = 16; displayName = $STR_DZ_MAG_7RND_9x17_PPK_NAME; descriptionShort = $STR_DZ_MAG_7RND_PPK_9x17_DESC; picture = "\RH_de\inv\m_ppk.paa"; model = "\RH_de\mags\mag_ppk.p3d"; ammo = "B_9x17_Ball"; count = 7; initSpeed = 320; class ItemActions { COMBINE_MA...
#ifndef NMOS_FORMAT_H #define NMOS_FORMAT_H #include "nmos/string_enum.h" namespace nmos { // Formats (used in sources, flows and receivers) // See https://github.com/AMWA-TV/nmos-discovery-registration/blob/v1.2/docs/2.1.%20APIs%20-%20Common%20Keys.md#format // and https://github.com/AMWA-TV/nmos-discove...
#pragma once #include "Application.h" #include "Renderer2D.h" #include <vector> #include <vector.h> #include "Behaviour.h" class Agent { public: Agent() {} Agent(vector2 winDim) : windowDimensions(winDim) {}; virtual ~Agent(); // Update the agent and its behaviours virtual void Update(float deltaTime); // Draw t...
#include "BaseEntity.h" #include "Weapon.h" #include "GamePlay.h" #include "Params.h" //---------- weapon general method----------------- // //------------------------------------------------ // shoot at the given position void Weapon::ShootAt(Vec2 pos) { m_iUpdate = (int)Clock->getCurrentTime(); i...
#pragma once enum BonusType {STAR, LIFE, FASTER, SLOWER, BIGGER, SMALLER}; class Bonus { private: int width; int height; int posX, posY; BonusType bonusType; public: Bonus(); void Fall(); int bX(); int bY(); int bWidht(); int bHeight(); BonusType bType(); };
#include <iostream> using namespace std; class Line{ private: int size; int *score; public: Line(){ size = 0; score = NULL; } void setSize(int _size){ size = _size; score = new int[size]; } ~Line(){ delete[] score; } void setScore(int index, i...
#include "stdio.h" int main(){ int N; while(~scanf("%d",&N)){ if(N==2) printf("Y\n"); else if(N==3) printf("Y\n"); else if(N==4) printf("Y\n"); else if(N==5) printf("Y\n"); else if(N==6) printf("Y\n"); else if(N==7) printf("Y\n"); else if(N==8) p...
#include <iostream> #include <string> #include <cstring> #include <sstream> #include <vector> #include <algorithm> #include <iterator> #include <fstream> //files #include <errno.h> //errors #include <stdio.h> //printf #include <unistd.h> // sys calls #include <sys/types.h> // O_ constants #include <sys/ipc.h> // IPC...
// MIT License // Copyright (c) 2020 Marnix van den Berg <m.a.vdberg88@gmail.com> // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the ri...
/* src/var.cpp -- Variable/computation graph-related functions. Copyright (c) 2020 Wenzel Jakob <wenzel.jakob@epfl.ch> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ #include "var.h" #include "internal.h" #include "log.h" #inc...
#include <iostream> #include <vector> #include <algorithm> #include <cstring> using namespace std; int v, e; class Edge{ public: int i = 0; int j = 0; int weight = 0; bool operator<(const Edge &v) const{ return weight < v.weight; } Edge(int i = 0, int j = 0, int weight = 0) :i(i), j...
#include <ros/ros.h> #include "FakeMarkerPublisher.h" int main(int argc, char *argv[]) { ros::init(argc, argv, "fake_marker_pub"); FakeMarkerPublisher fmp; if (!fmp.initialize()) { ROS_ERROR("Failed to initialize Fake Marker Publisher"); return 1; } return fmp.run(); }
// BEGIN CUT HERE // PROBLEM STATEMENT // // Dr. Agnew and Dr. Austin have acquired a bag of stones, // each containing some amount of silver and gold. // Dr. Agnew is only interested in the silver contained in // the stones, while // Dr. Austin is only interested in the gold. // Using their sophisticated instrument...
#ifndef IDA_STAR_ALG #define IDA_STAR_ALG #include "a_star_alg.h" #include <deque> bool find_in_path(Node* n, std::deque<Node*> path) { node_ptr_compare cmp; for (auto el : path) if (cmp.operator()(el, n)) return true; return false; } // recursive search int ida_search(std::deque<Node*> path, i...
#include "msg_0x08_healthupdate_stc.h" namespace MC { namespace Protocol { namespace Msg { HealthUpdate::HealthUpdate() { _pf_packetId = static_cast<int8_t>(0x08); _pf_initialized = false; } HealthUpdate::HealthUpdate(int16_t _health, int16_t _food, float _saturation) : _pf_health(_health) , _pf_food(_food) , _...
//--------------------------------------------------------------------------- #ifndef QCVH #define QCVH //--------------------------------------------------------------------------- //typedef void __fastcall (*TOnRespEvent)( TObject *Sender ); typedef void __fastcall(__closure *TOnReqEvent)( TObject *Sender ); typedef...
#include "fresnel.h" Color3f FresnelDielectric::Evaluate(float cosThetaI) const { //TODO cosThetaI=glm::clamp(cosThetaI,-1.0f,1.0f); float f=0.0f; //potentially swap indices bool entering=cosThetaI>0.0f; float ei=etaI; float et=etaT; if(!entering) { std::swap(ei,et); ...
// ********************************************************************** // This file was generated by a TAF parser! // TAF version 2.1.5.0 by WSRD Tencent. // Generated from `GMOnline.jce' // ********************************************************************** #ifndef __GMONLINE_H_ #define __GMONLINE_H_ #include ...
#include "readerwriterqueue/readerwriterqueue.h" #include "fmt/format.h" #include <thread> #include <atomic> auto main() -> int { moodycamel::ReaderWriterQueue<int> q(1); std::atomic_bool running { true }; std::thread t1([&] { auto count = 0; while (running) { q.try_enqueue(count); count++; std::this...
// Created on: 2014-08-15 // Created by: Varvara POSKONINA // Copyright (c) 2005-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....
// $Id$ // // Copyright (C) 2004-2008 Greg Landrum and Rational Discovery LLC // // @@ All Rights Reserved @@ // This file is part of the RDKit. // The contents are covered by the terms of the BSD license // which is included in the file license.txt, found at the root // of the RDKit source tree. // #include <RD...
// Created on: 1997-07-28 // Created by: Pierre CHALAMET // Copyright (c) 1997-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GN...
//Note for Press #include<bits/stdc++.h> #include<conio.h> #include<windows.h> #include<time.h> using namespace std; void setcursor(bool visible) { HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_CURSOR_INFO lpCursor; lpCursor.bVisible = visible; lpCursor.dwSize = 20; SetCons...
class Kriss_DZ: MP5_DZ { displayName = $STR_DZ_WPN_KRISS_NAME; descriptionShort = $STR_DZ_WPN_KRISS_DESC; model = "\RH_smg\RH_kriss.p3d"; picture = "\RH_smg\inv\kriss.paa"; magazines[] = {"33Rnd_45ACP_KRISS"}; handAnim[] = {"OFP2_ManSkeleton","\RH_smg\Anim\NORRN_RH_Kris1.rtm"}; reloadMagazineSound[] = {"\RH_smg\...
#ifndef __ANOMALY_INTERFACE__ #define __ANOMALY_INTERFACE__ #include "IpAddr.hpp" class AnomalyInterface{ public: /* * check whether the packet is considered an anomaly * @return: will return true if packet is considered anomaly and false otherwise */ virtual bool anomalityCheck(IpAddr& ip) = ...
#include "stdafx.h" #include "CorrectDialog.h" CorrectDialog::CorrectDialog(int row, User* user, QWidget* parent) : QDialog(parent) { ui.setupUi(this); m_row = row; m_user = user; ui.lab_money->setText(QString::number(m_user->money) + tr(" RMB")); ui.edit_correct->setText(QString::number(m_user->mo...
#include<bits/stdc++.h> using namespace std; int main(){ string s; bool prefix[256]; memset(prefix, false, sizeof(prefix)); getline(cin, s); transform(s.begin(), s.end(), s.begin(), ::tolower); int n = 0; for(int i = 0; i < s.size(); i++){ if (((s[i] >= 'a' && s[i] <= 'z') || (s[i]...
#include <iostream> #include <fstream> #include <cmath> struct point { int x, y; }; double area(point &a, point &b, point &c) { return (0.5 * abs ((a.x - c.x)*(b.y - c.y) - (a.y - c.y)*(b.x - c.x))); } bool validate(point &a, point &b, point &c, point &o) { return ((area(o, b, c) +...
#include <core/maths.h> #include <core/pfm.h> #include <core/mesh.h> #include <core/shader.h> #define STRINGIFY(A) #A #include "sh.h" #include <iostream> #include <cmath> #include <functional> #include <algorithm> #include <stdint.h> // Work Items // ---------- // Implement the spherical harmonic functions in C++ /...
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional>...
#include "stdio.h" #include "conio.h" void main(){ clrscr(); int fact; printf("\n\t\tFactorials................\n"); for(int i=1; i<=7; i++){ fact=i; for(int j=i-1; j>0; j--) fact*=j; printf("%d! = %d\n",i,fact); } getch(); }
#include <iostream> using namespace std; int main(){ int i, num, sum=0, mul=0; cout<<"Introduzca el numero que desea verificar si es perfecto: "; cin>>num; for(i=1; i<num; i++) { mul=num%i; if(mul==0) { sum+=i; } } if(sum==num){ cout<<"El numero es perfecto.\n", num; } else{ cout<<"El numero NO e...
#include <iostream> #include <cmath> #define REP(i, a, n) for(int i = (a); i < (n); i++) using namespace std; struct point { double x, y; }; struct line { point p, q; }; double distance(line l, point p) { double x0 = p.x, y0 = p.y; double x1 = l.p.x, y1 = l.p.y; double x2 = l.q.x, y2 = l.q.y; double a = x2 - ...
#include<bits/stdc++.h> using namespace std; int main(){ int a[3][2]={10, 20, 30, 40, 50, 60}; for (int i=0;i<3;++i) { for (int j=0;j<2;++j) { printf("a[%d][%d]=%d\n",i,j,a[i][j]); } } printf("\n"); for (int i=0;i<3;++i) { for (int j=0;j<2;++j) { pri...
// Inspired by https://github.com/Radiateurs/Socket-implementation-UE4 // and https://forums.unrealengine.com/t/tcp-socket-listener-receiving-binary-data-into-ue4-from-a-python-script/7549 #pragma once #include "UObject/Object.h" #include "Networking.h" #include "Sockets.h" #include "SocketSubsystem.h" #include "TCPSo...
// // Created by tompi on 6/3/18. // /*#include "../header/Aggregation.h" void Aggregation::Aggregate(cl_device_id _DEVICE, int _sorted_elements[], uint _element_size, uint _no_distinct_val) { // Make array of double the size of distinct value uint * _m_res_arr = new uint[_no_distinct_val * 2]; // Add d...
#ifndef RTPCLIENT_H #define RTPCLIENT_H #include <QThread> #include <QUdpSocket> #include <errno.h> #include <QSemaphore> #include "rtpclass.h" #include <QTimer> #include "decodeandsendthread.h" const int maxThreadNum=1; class rtpClient : public rtpClass { Q_OBJECT public: rtpClient(QObject *parent = 0); ...
#include <stdlib.h> #include <string.h> #include <map> #include <algorithm> #include "GameCmd.h" #include "PlayerManager.h" #include "Logger.h" #include "HallHandler.h" #include "Util.h" #include "Configure.h" #include "json/json.h" #include "NamePool.h" #include "Protocol.h" #include "RobotUtil.h" #include "Packet.h"...
#include "Enemy.h" void Enemy::Setup( int enemyIndex ) { frameMax = 4; exists = true; atk = 1; atkCounter = -1; frame = IDLE; direction = RIGHT; action = WALKING; deadTimer = 0; collisionRegion.X( position.x + 5 ); collisionRegion.Y( position.y + 5 ); collisionRegion.W( 24 ...
// SimpleGraphic Engine // (c) David Gowor, 2014 // // Module: System Video // Platform: Windows // #include "sys_local.h" // ==================== // sys_IVideo Interface // ==================== class sys_video_c: public sys_IVideo { public: // Interface int Apply(sys_vidSet_s* set); void SetA...
#include "C:\Users\Andrey\Desktop\Linearization\Linerization\Working Test\version 1.1\include\Rectangle.h" Rectangle::Rectangle() { for (int i = 0; i < diskret; i++) val[i] = 0x0; } Rectangle::~Rectangle(void) { } //-----------------------------------------------------------------------------------------------...
#include<iostream> #include<Windows.h> #include<process.h> #include<time.h> #include <Mmsystem.h> #pragma comment(lib, "Winmm.lib") using namespace std; #define MAX 3000000 int getPrime(int* result, int min, int max); unsigned int WINAPI ThreadFunc1(void* arg); unsigned int WINAPI ThreadFunc2(void* arg)...
#ifndef THREADCONTROLLER_H #define THREADCONTROLLER_H #include <QObject> #include <QList> #include <QVector> #include <QThread> #include "httpworker.h" class QThreadController : public QObject { Q_OBJECT public: explicit QThreadController(QObject *parent = 0); ~QThreadController(); int getFreeWorker()...
#include <iostream> using namespace std; int binarysearch(int array[],int size,int x) { // code for the binary search int firstindex = 0; int lastindex = size-1; while(firstindex<=lastindex) { int middle = (firstindex +lastindex)/2; if(array[middle] == x){ return middle; } else if(arr...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2012 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * Allowed #if-ery: SYSTEM_* defines, *_BOOL, __cplusplus. */ #ifndef POSIX_SYS_DECLARE...
/* * QkThings LICENSE * The open source framework and modular platform for smart devices. * Copyright (C) 2014 <http://qkthings.com> * * 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, eith...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * @author Arjan van Leeuwen (arjanl) */ #include "core/pch.h" #include "platforms/un...
#pragma once #include "libOTe/config.h" #if defined(ENABLE_MRR_TWIST) && defined(ENABLE_SSE) #include <cryptoTools/Common/Defines.h> #include <cryptoTools/Crypto/PRNG.h> #include <cryptoTools/Crypto/Rijndael256.h> #include <cryptoTools/Crypto/RandomOracle.h> namespace osuCrypto { class EKEPopf { public: ...
#include <iostream> #include <iomanip> using namespace std; int sum_f(int** arr, int n){ int s=0; for (int i = 0; i < n;i++){ for (int j = 0;j<n;j++) if (j<=(n-1)-i) s += arr[i][j]; } return s; } void print (int** arr, int n, int sum){ cout << "\t" << " ---- Ма...
vector<int> Solution::dNums(vector<int> &A, int B) { unordered_map<int,int> mp; vector<int> ans; if(B>A.size()) return ans; int start=0; for(int i=0;i<B;i++) mp[A[i]]++; ans.push_back(mp.size()); for(int i=B;i<A.size();i++) { mp[A[i]]++; if(mp[A[start]]==1) mp.erase(A[sta...
//==================================================================================== // @Title: WINDOW //------------------------------------------------------------------------------------ // @Location: /prolix/interface/include/cmpWindow.cpp // @Author: Kevin Chen // @Rights: Copyright(c) 2011 V...
#pragma once #include <QWidget> namespace Ui { class StartOptionsPassword; } /** Dialog to ask for passphrases. Used for encryption only */ class StartOptionsPassword : public QWidget { Q_OBJECT public: explicit StartOptionsPassword(QWidget *parent = nullptr); ~StartOptionsPassword(); ...
// // FboPingPong.cpp // emptyExample // // Created by Andreas Müller on 12/08/2013. // // #include "FboPingPong.h" // ------------------------------------------------------------------------------------ // void FboPingPong::allocate( int _w, int _h, int _internalformat, ofColor _clearColor ) { ofFbo::Settings se...
#include "LineOrientedVT100Client.h" #include <QFrame> #include <QPainter> class Pty; class QtTerminalWindow : public QFrame, public LineOrientedVT100Client { Q_OBJECT public: QtTerminalWindow(); void setPty(Pty* pty); protected: void paintEvent(QPaintEvent*); void setFont(QFont*); // LineO...
#include "androidutils.h" #include <QtGlobal> #include <QQmlEngine> #include <QCoreApplication> #include <systemdispatcher.h> #ifdef Q_OS_ANDROID #include <QtAndroidExtras> #else #include <QDebug> #endif #include "filechooser.h" static void setupUtils(); static QObject *createQmlSingleton(QQmlEngine *qmlEngine, QJSEng...
/** \file ballDetector2.cpp \author UnBeatables \date LARC2018 \name ballDetector */ #include "ballDetector2.hpp" #include <string> #define RESIZE_FACTOR 0.5 void BallDetector2::run(cv::Mat imgTop, cv::Mat imgBot, PerceptionData* data) { //Time analyze int time_init, time_final, time_total_n...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2012 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * * @author Cihat Imamoglu (cihati) */ #include "core/pch.h" #in...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** ** Copyright (C) 1995-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" #include "platforms/windows/WindowsC...
#include<stdio.h> int a=1; main() { while(a!=4) { printf("IOI\n\n"); a++; } }
#include <iostream> #include <mpi.h> #include <vector> using namespace std; void sum_cascade(int rank, int processes, const vector<int>& v) { auto leftChild = 2*rank + 1; auto rightChild = 2*rank + 2; if (rank == 0) { auto vecPointer = v.data(); auto leftSize = v.size() / 2; auto...
#include <iostream> #include <armadillo> #include "Body.h" #include "Universe.h" using namespace arma; using namespace std; int main() { Universe mysystem; // Body body1(1, 0,0,0, 0,-0.1,0 ); // Body body2(1, 5,0,0, 0, 0.1,0 ); Body Sun(1,0,0,0,0,0,0); Body Mercury(1.2e-7, 0.39, 0, 0,0,9.96,0); Body Venus(2.4e-6,...
#pragma once #include "mapper.hpp" class Mapper1 : public Mapper { int writeN; uint8_t tmpReg; uint8_t regs[4]; void apply(); public: Mapper1(uint8_t* rom) : Mapper(rom) { regs[0] = 0x0C; writeN = tmpReg = regs[1] = regs[2] = regs[3] = 0; apply(); ...
#include "Queue.h" int queue::pop() { list.del_front(); count--; return front(); } void queue::push(int value) { list.add_back(value); count++; } int queue::front() { return list.front(); } void queue::print() { list.DEBUG_TEMP_PRINT(); } bool queue::empty() { if (count == 0) { return tru...
/*You have to complete this function*/ void recursion(char str[], string result, int i, int sz) { if (i == sz-1) { // base case at sz-1 because we don't want space after the last char of str result += str[i]; // append last char and then print cout << result << "$"; return; } r...
#include "core/pch.h" #include <windows.h> #include <windowsx.h> #include <zmouse.h> #include "mde.h" #define MDE_SCREEN_W 800 #define MDE_SCREEN_H 600 void InitTest(MDE_Screen *screen); void ShutdownTest(); void PulseTest(MDE_Screen *screen); class TestWindow : public MDE_Screen { public: TestWindow(); ~TestWindo...
/* Given an undirected graph G(V, E) and two vertices v1 and v2 (as integers), check if there exists any path between them or not. Print true if the path exists and false otherwise. Note: 1. V is the number of vertices present in graph G and vertices are numbered from 0 to V-1. 2. E is the number of edges present in g...
#include <iostream> #include <windows.h> #include <cstdlib> #include <time.h> using namespace std; //length of the array const int arrayLength = 45; int getRandomNumber(int min, int max) { static const double fraction = 1.0 / (static_cast<double>(RAND_MAX) + 1.0); return static_cast<int>(rand() * fraction * ...
/* Name: ���뷽���� Copyright: Author: Hill bamboo Date: 2019/8/15 16:58:59 Description: �����������ÿ����� */ #include <bits/stdc++.h> using namespace std; int dfs(string num, int s) { if (s >= num.size()) return 1; if (s == num.size() - 1) return ('1' <= num[s] && num[s] <= '9') ? 1 : 0; int ret = 0; if ('1' <=...
#include "Card.h" #include "Dealer.h" #include <vector> #include <stdlib.h> #include <iostream> #include <time.h> #define true 1 #define false 0 using namespace std; //***************************** Dealer Implimentation ********************************************************** Dealer::Dealer(double newBalance):User...
// 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 // by the Free Software Foundation, with spe...
#include <SparkFunAutoDriver.h> #include <SPI.h> #include <Servo.h> Servo servoMag; AutoDriver stepperY(10, 6); // y, board #1 AutoDriver stepperX1(A0, 6); // x1, board #2 AutoDriver stepperX2(A1, 6); // x2, board #3 boolean startup = true; //servo up / down angles int down = 45; int up = 3; int serialDataIn = 0; in...
#include "config.h" #include "base.h" #include "boolean.h" #include "arithmetics.h" #include "mul.h" #include "div.h" #include "barrett.h" void barrettMu(t_bint* b, t_bint* n, t_size sizeB, t_size sizeN) { div(b, n, sizeB, sizeN); } void barrettMod(t_bint* a, t_bint* n, t_bint* mu, t_size sizeA, t...
//include"stdafx.h" #include"updateString.h" string updateString() { string str; cin.ignore();//clear the keyboard buffer getline(cin, str); return str; }
#include <iostream> #include <fstream> #include <vector> #include <map> #include <algorithm> #include "common.h" using namespace std; /** * Day 16 * */ vector<vector<int>> patterns; /** * For each element, a repeating pattern is created. * Start pattern is 0,1,0,-1 * - Pattern for 1st nr is: 0,1,0,-1 * - pa...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <algorithm> #include <folly/lang/Assume.h> #include <quic/QuicConstants.h> namespace quic { std::string_view congesti...
#pragma once #include "merger_base.hpp" #include "proto/data_arena.pb.h" #include "utils/service_thread.hpp" #include <memory> using namespace std; namespace pd = proto::data; namespace nora { class arena_merger : public merger_base { public: static arena_merger& instance() { ...
#if !defined(__GESTURE_H__) #define __GESTURE_H__ #include "tinyxml.h" #include <vector> #include "Ogre.h" #include "OgreVector3.h" //#include "Preprocessor.h" using namespace std; class Gesture { std::string mName; float mSamplingFrequency; std::vector<Ogre::Vector3> mLocalAccelerationArray; std::vector...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n, d; cin >> n >> d; cout << ((n - 1) / ((d * 2)+ 1)) + 1<< endl; }