text
stringlengths
8
6.88M
#ifndef BBOX_H #define BBOX_H #include "math/Point3.h" #include "math/Vector3.h" #include <limits> #include <algorithm> namespace revel { template <typename T> class BoundingBox { math::Point3<T> m_Min; math::Point3<T> m_Max; public: BoundingBox() : m_Min(std::numeric_limits<T>::infinity(), std:...
#ifndef REPORTWITER_H #define REPORTWITER_H #include <QObject> #include <QVector> class IoDev; class ReportWiter : public QObject { Q_OBJECT public: ReportWiter(QVector<IoDev*> &source); public slots: void checkState(); private: QVector<IoDev*> &src; QVector<int> lastState; QVector<QVecto...
#ifndef HACK_ASSEMBLER_PARSER_H_ #define HACK_ASSEMBLER_PARSER_H_ #include <fstream> #include <string> typedef enum { A_COMMAND, C_COMMAND, L_COMMAND, } CommandType; class Parser { public: Parser(std::string& filename); ~Parser(); void advance(); CommandType g...
#include "Visitor.h" #include <iostream> void Visitor::Info() { } Visitor::Visitor() { } Visitor::Visitor(const std::string& v_name, double v_cash): Person(v_name) { this->cash = v_cash; } void Visitor::SetCash(double v_n) // ¬вести деньги { v_n = cash; } double Visitor::GetCash() { return ca...
#ifndef CMI_UID_H__ #define CMI_UID_H__ #include <stdio.h> #include <memory.h> namespace CMI { /// A Unique ID. /// David Schweinsberg template <UInt32 length> class UID { public: /// Default constructor. Initializes a null UID. UID(); /// Constructor. Initializes from the specified buffer. ...
#include <iostream> //#include "factor.h" using namespace std; // Function Prototype void FactorMod3(); // Main Function int main() { FactorMod3(); return 0; } // Function Definition void FactorMod3() { unsigned int count = 0; int MaxCount = 30; for (int num1 =1; num1 <= MaxCount; ++num1) ...
// // Created by nickolay on 20.02.2021. // #ifndef DRONEAPP_SETTINGS_H #define DRONEAPP_SETTINGS_H class Settings { public: }; #endif //DRONEAPP_SETTINGS_H
#include <iostream> using namespace std; int add(int a, int b) { return a + b; } int hi(int z) { int a = 56; if (true) { return 777; } else { return 444; } } int main() { }
#include "NetworkMapWriter.h" #include "MACVendors.h" #include <iostream> #include <boost/format.hpp> #include <arpa/inet.h> #include <type_traits> #include <iterator> using namespace std; static auto COUT_FORMAT = boost::format( "%=12X|%=20s|" // Dst MAC "%=12X|%=20s|" // Src MAC "%=15d|%=15d|" //...
#include<cstdio> #include<iostream> using namespace std; int main() { int a,b; cin >> a >> b; if(b == 0) printf("%d/%d=Error",a,b); else if(b < 0) printf("%d/(%d)=%.2f",a,b,a*1.0/b); else printf("%d/%d=%.2f",a,b,a*1.0/b); return 0; }
#include "../system/pr2-sim.h" #include "../system/pr2-system.h" #include "../geometry/geometry3d.h" #include "../utils/rave-utils.h" #include "../utils/pr2-utils.h" #include "../../util/Timer.h" #include <openrave-core.h> namespace rave = OpenRAVE; #define M 1000 TimerCollection tc; void test_fov(bool view=false) ...
#include <cstdio> #include <string> #include <iostream> using namespace std; const int maxn = 500010; int a[maxn], b[maxn]; long long num; void Merge(int a[], int start, int mid, int end) { int i = start, j = mid + 1, k = start; while (i <= mid && j <= end) { if (a[i] <= a[j]) { ...
// // Copyright Jason Rice 2017 // 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) // #ifndef NBDL_WEBSOCKET_DETAIL_PARSE_HANDSHAKE_RESPONSE_HPP #define NBDL_WEBSOCKET_DETAIL_PARSE_HANDSHAKE_RESPONSE_HPP #include <...
// ***************************************************************** // This file is part of the CYBERMED Libraries // // Copyright (C) 2007 LabTEVE (http://www.de.ufpb.br/~labteve), // Federal University of Paraiba and University of São Paulo. // All rights reserved. // // This program is free software; you can redist...
// github.com/andy489 // https://www.hackerrank.com/contests/practice-9-sda/challenges/roads-5 #include <iostream> #include <vector> using namespace std; int n, i; vector<pair<int, int>> edges; vector<int> p; void init() { for (i = 0; i < n; ++i) p[i] = i; } int find(int v) { if (p[v] == v) ...
#include <migraphx/gpu/pooling.hpp> #include <migraphx/gpu/context.hpp> namespace migraphx { inline namespace MIGRAPHX_INLINE_NS { namespace gpu { shape miopen_pooling::compute_shape(const std::vector<shape>& inputs) const { check_shapes{inputs, *this}.has(2).standard(); return op.compute_shape({inputs.at(0)}...
#include <string> #include <mysql++.h> #include <unistd.h> #include <sys/types.h> #include <fstream> #include <cstring> #include "dominio.h" #include "util.h" #include "servicio.h" #include "servicioPOP3.h" #include "configuracion.h" using namespace std; using namespace mysqlpp; cServicioPOP3::cServicioPOP3(cDominio ...
#include "control.h" using namespace std; int main() { House *house = House::instance(); Control *control = new Control(house); control->run(); return 0; }
// @copyright 2017 - 2018 Shaun Ostoic // Distributed under the MIT License. // (See accompanying file LICENSE.md or copy at https://opensource.org/licenses/MIT) #pragma once #include <distant/access_rights.hpp> namespace distant::agents { class kernel_object; class basic_process; template <process_rights R> c...
#include<bits/stdc++.h> using namespace std; // Time Complexity: O(N2) // Auxiliary Space: O(N) struct node { int data; struct node* left = NULL; struct node* right = NULL; }; typedef struct node Node; Node* create_node(int val) { Node* temp = new Node(); temp->data = val; temp->left = NULL; temp->right = NULL...
// // Created by diego on 6/08/2021. // #ifndef EDD_SMARTCLASS_201908327_MENU_H #define EDD_SMARTCLASS_201908327_MENU_H #endif //EDD_SMARTCLASS_201908327_MENU_H #include <iostream> #include <string> class Mostrar{ public: void ImprimirMenu(); };
#ifndef __TRADING_CENTRES_HPP__ #define __TRADING_CENTRES_HPP__ #include <jflib/jflib.hpp> namespace jflib { // Interface class for TradingCentre template<class T> class TradingCentreBase { public: typedef T date_type; typedef typename date_type::day_iterator day_iterator; virtual ~TradingCentreB...
#pragma once #include <GL\glew.h> #include "wrappers\Texture.h" /** Provides some basic common rendring debug functionality */ namespace Visualizer { bool initialize(); void terminate(); void displayTexture(Texture * texture); void displayDepth(Texture * texture); }
#include <cstdio> #include <algorithm> using namespace std; const int MAX_N = 100; const int MAX_a = 10000; const int MAX_K = 100000; int n,K; int a[MAX_N], m[MAX_N]; int dp[MAX_K + 1]; void read(){ scanf("%d\n", &n); for(int i=0; i<n; i++){ scanf("%d", &a[i]); } for(int i=0; i<n; i++){ scanf("%d", ...
#include "stdafx.h" int main() { int i, j; int num; scanf("%d", &num); int a[10] = { 240, 105, 98, 82, 66, 27, 18, 9, 1 }; for (i = 0; i < 10; i++) { if (a[i] <= a[i + 1]) { if ((num >= a[i]) && (num < a[i + 1])) { for (j = 8; j >= i + 1; j--) a[j + 1] = a[j]; a[i + 1] = num;break; } } els...
/************************************************************* * Copyright © 2015, Felix Bytow <felix.bytow@googlemail.com * * * * See the file COPYING for copying permissions. * *************************************************************/ #in...
#include <limits.h> #include <iostream> #include <set> #include <utility> #include <fstream> #include <list> using namespace std; int main() { int n,m,p,i,t[100],d[100],st,x,y; ifstream fin("graf.in"); list <pair<int,int> >L[100]; fin>>n>>m; for(i=0;i<m;i++) { fin>>x>>y>>p; L[x...
/*============================================================================== Copyright (c) Laboratory for Percutaneous Surgery (PerkLab) Queen's University, Kingston, ON, Canada. All Rights Reserved. See COPYRIGHT.txt or http://www.slicer.org/copyright/copyright.txt for details. Unless required by applicable law...
#ifndef __HW4Q3_CPP__ #define __HW4Q3_CPP__ #include "hw4q3.h" template <class Item> PriorityQueue<Item>::PriorityQueue() { capacity = DEF_CAP; first = 0; last = 0; used = 0; data = new Item[capacity]; } template <class Item> PriorityQueue<Item>::PriorityQueue(const PriorityQueue<Item>& source) {...
#include <iostream> //cases to test //I*10+k/p*10+I = k/p //k*10+I/I*10+p = k/p //k*10+I/p*10+I = k/p using namespace std; int main() { for (int i=1;i<10;i++) { for (int k=1;k<10;k++) { for (int p=1;p<10;p++) { float test1=(float)(i*10.0+k)/(float)(p*10+i); ...
//Title: Diver.h //Author: Jeremy Dixon //Date: 2/24/2020 //Description: This is part of the Subnautica Project in CMSC 202 @ UMBC // This is the non-pointer version header files #ifndef DIVER_H //Include/Header Guard #define DIVER_H //Include/Header Guard #include "Material.h" //Include for the material struct #incl...
#include <bits/stdc++.h> using namespace std; int main (){ int n; cin >> n; int a[n]; for (int i=0; i<n; ++i){ cin >> a[i]; } int tg=0; for (int i=0; i<n-1; ++i){ for (int j=i+1; j<n; ++j){ if(a[i] > a[j]){ tg = a[i]; a[i] = a[j];...
#ifndef FUZZYCORE_OUTPUTTERMOBJECT_H #define FUZZYCORE_OUTPUTTERMOBJECT_H #include <string> #include "../../DAO/DAOUtils/NullConverter.h" class OutputVariable { private: unsigned long id; unsigned long space_id; std::string name; std::string description; double range_start; double range_end; ...
#include <testlib.h> void builtinCheckerIntegers() { int n = 0; std::string firstElems; while (!ans.seekEof() && !ouf.seekEof()) { n++; long long j = ans.readLong(); long long p = ouf.readLong(); if (j != p) quitf(_wa, "%d%s number differ - expected: '%s', found...
#include "adaption_decorator.hh" #include "ghb_pcdc.hh" GHB_PCDC<512> p; AdaptionDecorator prefetcher(&p); void prefetch_init() { DPRINTF(HWPrefetch, "Initializing adaption_prefetcher.cc\n"); } void prefetch_access(AccessStat stat) { PrefetchDecision d = prefetcher.react_to_access(stat); DPRINTF(HWPrefet...
#include "stats.h" Stats::Stats(int size, int mode) : GridSize(size) , GameMode(mode) { this->setObjectName("Stats"); //Widget { centralWidget = new QWidget(this); centralWidget->setObjectName("centralWidget"); } //Label { label = new QLabel*[6]; label[0] = Cre...
#ifndef __BinCompass_interruptanalysis__ #define __BinCompass_interruptanalysis__ #include "RoseBin_DataFlowAbstract.h" class InterruptAnalysis : public RoseBin_DataFlowAbstract { public: InterruptAnalysis(GraphAlgorithms* algo):RoseBin_DataFlowAbstract(algo) {} ~InterruptAnalysis() {} bool run(std::string...
/* NO WARRANTY * * BECAUSE THE PROGRAM IS IN THE PUBLIC DOMAIN, THERE IS NO * WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE * LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE AUTHORS * AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT * WARRANTY OF ANY KIND, EITHER E...
#include <iostream> using namespace std; int main(){ srand (time(NULL)); int num1 = rand() % 13 + 1; int num2 = rand() % 13 + 1; cout << "Your numbers are " << num1 << " and " << num2; }
#pragma once #include <array> #include <vector> #include "Graphics/Camera.h" #include "Graphics/Color.h" #include "Graphics/Gui/Text.h" #include "Graphics/Light.h" #include "Graphics/Object3D.h" #include "Graphics/RenderTarget.h" #include "Graphics/Triangle.h" namespace GRAPHICS { /// A software renderer. cla...
// // TouchableLayer.cpp // Boids // // Created by Yanjie Chen on 5/9/15. // // #include "TouchableLayer.h" using namespace cocos2d; TouchableLayer::TouchableLayer() { } TouchableLayer::~TouchableLayer() { } bool TouchableLayer::init() { if( !Layer::init() ) { return false; } ...
#include "StdAfx.h" #include "wgeometry.h" #include "utilites/foreach.hpp" #include "math.h" ////////////////////////////////////////////////////////////////////////// line operator*(pwindow_t win, border brd) { return win->get_rect() * brd; } line operator*(border brd, pwindow_t win) { return win->get_re...
#include "./utils/test_utils.hpp" #include <vrm/pp/bool.hpp> int main() { TEST_ASSERT(VRM_PP_XOR(0, 0) == 0); TEST_ASSERT(VRM_PP_XOR(0, 53) == 1); TEST_ASSERT(VRM_PP_XOR(22, 0) == 1); TEST_ASSERT(VRM_PP_XOR(35, 11) == 0); return 0; }
#include "../header/rectangle.hpp" Rectangle::Rectangle() { } Rectangle::Rectangle(int w, int h) { } void Rectangle::set_width(int w) { } void Rectangle::set_height(int h) { } int Rectangle::area() { } int Rectangle::perimeter() { }
// // OpenGL_Utils.hpp // OpenCV_OpenGL // // Created by Milton Eiji on 2/11/16. // Copyright © 2016 Takamura. All rights reserved. // #ifndef OpenGL_Utils_hpp #define OpenGL_Utils_hpp // Basic includes #include <iostream> #include <stdio.h> #include <vector> // OpenGL includes #include <GL/glew.h> #include <GLF...
#include <iostream> typedef int keyType; void InsertSort(keyType k[], int n); void SelectSort(keyType k[], int n); void BubbleSort(keyType k[], int n); void ShellSort(keyType k[], int n); void QuickSort(keyType k[], int n); void HeadSort(keyType k[], int n); void MergeSort(keyType k[], int n); void printSort(k...
#include<cstdio> #include<algorithm> using namespace std; const int MAX_N = 100000; int n,S; int a[MAX_N]; int sum[MAX_N + 1]; void solve(){ int res = n+1; int s=0, t=0, sum=0; for(;;){ while(t<n && sum<S){ sum += a[t++]; } if (sum<S) break; res = min(res, t-s); sum -= a[s++]; } ...
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) #define ok() puts(ok?"Yes":"No"); using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<vi> vvi; typedef vector<ii> vii; typedef vector<bool> vb; typedef vector<vb> vvb; typedef set<int> si; ty...
#include <string> #include <vector> #include "facilitator_engine/math_evaluator.h" class GeographyEvaluator: EvaluatorBase { public: GeographyEvaluator(std::string actualAnswer, std::string receivedAnswer):_actualAnswer(actualAnswer),_receivedAnswer(receivedAnswer) { } virtual float Evaluate(){ //float r...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "sync/util/cryptographer.h" #include <string> #include "base/memory/scoped_ptr.h" #include "base/string_util.h" #include "sync/internal_api...
#ifndef WORLD_H #define WORLD_H #include "engine/resourceholder.h" #include "resourceidentifiers.h" #include "engine/scenenode.h" #include "engine/spritenode.h" #include "engine/commandqueue.h" #include "engine/command.h" #include "tilemapnode.h" #include "level_datatables.cpp" #include "player.h" #include "character...
#include<bits/stdc++.h> using namespace std; struct node { int x; int hp; }a[100005]; bool cmp(node a, node b) { return a.x < b.x; } int main() { int n,y; cin >> n >> y; for(int i = 0; i < n; i++) { cin >> a[i].x >> a[i].hp; } sort(a,a+n,cmp); int res = 0, left = 0; ...
#include "TriMesh.h" #include "meshFIM.h" #include "math.h" #include <iostream> #include <algorithm> #include <sstream> #include <string> #include <climits> // C++/STL #include <iostream> #include <sstream> #include <string> #include <vector> #include <ctime> #include <map> #include <set> #include <iterator> #includ...
#include "ShippingOrder.h" int main() { ShippingOrder shippingOrder(41, 52.50f); return 0; }
// ============================================================== // RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2013.4 // Copyright (C) 2013 Xilinx Inc. All rights reserved. // // =========================================================== #include "load_centres_buffer....
#include<vector> #include<stdio.h> #include<algorithm> #include<unordered_map> using namespace std; int main(){ bool flag = false; int n,tea; scanf("%d",&n); vector<int> buffer(n); unordered_map<int,int> map; for(int i=0;i<n;i++){ scanf("%d",&buffer[i]); map[buffer[i]]=1; } ...
#pragma once #include "Subsystem.h" #include <SD.h> #include "Flightdata.h" const unsigned long deltaTimeFlightSdCard = 500; class SdCard:Subsystem { public: void init(Flightdata& flightdata); void test(); void flightProcess(unsigned long currTime); void groundProcess(); void teardown(); private: Flightdata ...
// // GA-SDK-CPP // Copyright 2018 GameAnalytics C++ SDK. All rights reserved. // #pragma once #include <sqlite3.h> #include <string> #include <vector> #include <json/json.h> #include "Foundation/GASingleton.h" namespace gameanalytics { namespace store { class GAStore : public GASingleton<GAStore> ...
#include <iostream> using namespace std; int main() { double v1,v2; cout<<"请输入两个数:"<<endl; cin>>v1>>v2; if(v2==0){ cout<<"v2等于0不能当除数"<<endl; return -1;} else{ cout<<"v1除以v2等于:"<< v1 / v2 <<endl; } return 0; }
/*************************************************************************** Copyright (c) 2020 Philip Fortier This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or...
#include <sstream> #include <iostream> #include <string> #include <fstream> #include <cstdio> #include <streambuf> #include <cerrno> #include <cstdlib> #include <ctype.h> #include <iomanip> #define NICEHEX setw(2) << setfill('0') #define FCAST (unsigned)(unsigned char) typedef unsigned char uchar; using namespace st...
#ifndef DeviceDisplaySensor_h #define DeviceDisplaySensor_h #include "Arduino.h" #include "../DeviceSensor/Sensor.h" namespace ART { class DeviceDisplay; class DeviceDisplaySensor { public: DeviceDisplaySensor(DeviceDisplay* deviceDisplay); ~DeviceDisplaySensor(); static void create(DeviceDisplaySe...
#include "Globals.h" #include "Application.h" #include "ModuleRender.h" #include "ModuleSceneIntro.h" #include "ModuleInput.h" #include "ModuleTextures.h" #include "ModuleAudio.h" #include "ModulePhysics.h" ModuleSceneIntro::ModuleSceneIntro(Application* app, bool start_enabled) : Module(app, start_enabled) { circle ...
/* * ManPages.hpp * * Created on: 28/06/2015 * Author: LuizF */ #ifndef MANPAGES_HPP_ #define MANPAGES_HPP_ #define INDICESDAT "E:\\ManPages\\DAT\\manpages.dat" #define INDICESSECUNDARIOS "E:\\ManPages\\DAT\\indSecundario.dat" #define DIRFILES "E:\\ManPages\\txt\\" #include <iostream> #include <string.h> #...
#include<fstream.h> #include<conio.h> void main() { ofstream fin; fin.open("C:\\eeesma.txt"); fin.close(); getch(); }
/* 经过了特征处理, l2 regularization做了之后,稍有改进 # map 1: x -> [0, 100] -> [30, 100] # map 2: x -> [0, 50] -> [15, 50] # map 11:x -> [0, 30] -> [10, 30] 之后如论如何调整l2 reg的参数,都无法提高auc,说明此时lr模型出现欠拟合占主导 train auc:0.532509 test auc:0.531455 train auc:0.546925 test auc:0.545621 train auc:0.569203 test auc:...
#include <iostream> using namespace std; int main(int argc, char *argv[]) { // at(int idx); //返回索引idx所指的数据,如果idx越界,抛出out_of_range异常。 // operator[]; //返回索引idx所指的数据,越界时,运行直接报错 // front(); //返回容器中第一个数据元素 // back(); //返回容器中最后一个数据元素 return 0; }
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
#define MAKERLINE_AN A0 // MAKERLINE AN pin ke A0 Nano #define MAX_SPEED 550 // kalau ubah ni, kena ubah semula Kp dan Kd //left wheel int pwm1 = 10; int in1 = 9; int in2 = 8; //right wheel int pwm2 = 5; int in3 = 7; int in4 = 6; //PID SETTING float Kp = 1.5; //ubah float Kd = 5.0; //ubah int ...
#pragma once #include <string> #include <vector> #include "MassSpectrometry/MassSpectrometry.h" using namespace MassSpectrometry; #include "MzLibUtil.h" using namespace MzLibUtil; #include "Proteomics/Proteomics.h" using namespace Proteomics; #include "TomlReadWrite.h" namespace EngineLayer { class CommonPar...
#ifndef TASK_WORKER_H #define TASK_WORKER_H #include "Task.h" #include <iostream> using namespace std; class TaskWorker:public Task { public: TaskWorker(int id); ~TaskWorker(); void run(); }; #endif
#include "DXUT.h" #include "Renderer.h" bool Renderer::Comp(Node* a, Node* b) { return (a->layer < b->layer); } void Renderer::AddRenderTarget(Node* n) { if (find(rendertargets.begin(), rendertargets.end(), n) != rendertargets.end()) return; rendertargets.push_back(n); rendertargets.sort(Comp); } void Rendere...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
#include<iostream> using namespace std; struct student { //成员列表 string name; int age; int score; }; struct teacher { //成员列表 int id; string name; int age; student stu[10];//结构体内可以嵌套结构体,嵌套需要提前定义 }; //打印学生信息函数 //1.值传递 void printstudent(student st) { st.name = "wang"; cout<<"值传...
#include <alloca.h> #include <iostream> int main() { int* tab = static_cast<int*>(alloca(3 * sizeof(int))); std::cout << "tab[3] allocated on stack with alloca():\n"; for (int i = 0; i != 3; ++i) { tab[i] = i; std::cout << "tab[" << i << "] = " << tab[i] << std::endl; } return 0; }...
#ifndef DE_SHADER_H #define DE_SHADER_H #include "export.h" #include "core/CountedObject.h" #include <string> #include <gl/glew.h> namespace de { /** \namespace data \brief the namespace of all data that lives in memory. */ namespace data { /** * \class Shader * * \brief Encapsulate a shader. Simply ...
#ifndef OPENGL_GRID_4242351870_HEADER #define OPENGL_GRID_4242351870_HEADER #include <cstdint> #include <cstddef> namespace solar { namespace openGL { class Grid { public: //Number of lines in both axes //Needs OpenGL context created Grid(size_t gridRes); ~Grid(); void Draw() const; private: ...
#include "fail-container.h" #include "grade.h" stu_container extract_fails(stu_container& students) { stu_container fails; stu_container::iterator iter = students.begin(); while (iter != students.end()) { if (fgrade(*iter)) { fails.push_back(*iter); iter = students.erase(iter); } else ++i...
class Solution { public: int minimumTotal(vector<vector<int>>& triangle) { int n = int(triangle.size()); vector<int>result1(n,triangle[0][0]); vector<int>result2(n,triangle[0][0]); for (int i =1;i<n; i++) { if (i%2 ==1) { result2[0] = result1[0]+triangle[i][0]; ...
/** * Capture facial motion by detecting and tracking facial landmarks using single camera, and send motion data to Maya server. */ #include <dlib/opencv.h> #include <opencv2/highgui/highgui.hpp> #include <opencv2/core/core.hpp> #include <opencv2/opencv.hpp> #include <opencv2/imgproc.hpp> #include <dlib/image_proces...
/********************************************************************** * Felix Winterstein, Imperial College London * * File: init_memory_tb.cpp * * Revision 1.01 * Additional Comments: distributed under a BSD license, see LICENSE.txt * **********************************************************************/ #include ...
/************************************************************************************************/ /*** Topic: Wang-Buzsaki model with Runge-Kutta 4th Order Method for one neuron Ali-Seif ***/ /*** Version Release 17.12 rev 11256 ***/ /*** Date: 11/10/202...
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package #ifndef JACTORIO_INCLUDE_PROTO_DETAIL_TYPE_H #define JACTORIO_INCLUDE_PROTO_DETAIL_TYPE_H #pragma once #include "core/data_type.h" namespace jactorio::proto { using ProtoFloatT = double; using ProtoIntT = in...
class Solution { public: bool isHappy(int n) { unordered_set<int> store; store.insert(n); while(n != 1) { int s = 0; while(n != 0) { int v = (n % 10); s += v * v; n /= 10; } if (store.find(s) != ...
#ifndef __UART_DRIVER_H__ #define __UART_DRIVER_H__ #include "stm32f0xx.h" #include "RingBuffer.h" #include "System.h" #include "packet_def.h" typedef RingBuffer<U8> SerialRingBuffer; class C_UART { public: C_UART(UI rec_buf_size = 512, UI tr_buf_size = 512); void set_hardware(USART_TypeDef * hard_uart, ULONG ...
#ifndef LOGICA_EFECTOS_COLISION_H #define LOGICA_EFECTOS_COLISION_H #include <vector> #include "efecto_colision_recogedor.h" #include "../../interfaces/efecto_colision_i.h" namespace App_Juego_Logica { class Logica_efectos_colision { ///////////////////////// //Interface pública. public: Logica_efectos_col...
#include<iostream> using namespace std; int sum_of_digit(int num) { if (num != 0) { return (num % 10 + sum_of_digit(num / 10)); } else { return 0; } } int main() { int num; cout << "Enter num: "; cin >> num; int result = sum_of_digit(num); cout <...
#ifndef UTILITY_H #define UTILITY_H #include <QtGlobal> #include <QTime> class Utility { public: Utility(); static int randInt(int low, int high); }; #endif // UTILITY_H
#include "ros/ros.h" #include "beginner_tutorials/GetFullName.h" #include <cstdlib> int main(int argc, char **argv){ ros::init(argc, argv, "get_full_name_client"); if (argc != 3){ ROS_WARN("Usage: add_two_ints_client x y"); return 1; } ros::NodeHandle n; ros::ServiceClient client = ...
#include <bits/stdc++.h> using namespace std; #define ll long long struct Node { ll y, x, sz; Node *left, *right; Node() {} Node(ll x) { this->x = x; this->y = ((rand() << 15)^rand()); this->left = (this->right) = nullptr; this->sz = 1; } Node(ll x, ll y) { ...
#include <iostream> void error1() { int a; printf("%d\n", a); } void error2() { error1(); } void error3() { error2(); } int main(int argc, char **argv) { error3(); return 0; }
#include <iostream> #define TAMANHO 1000 using namespace std; typedef struct{ int topo; int item[TAMANHO]; }PILHA; void empilhar(PILHA &s, int x){ s.item[++s.topo] = x; } int desempilhar(PILHA &s){ return (s.item[s.topo--]); } int main() { int qntNecessaria, qntAmigos, qntSe...
#include <TESTS/test_assertions.h> #include <TESTS/testcase.h> #include <CORE/types.h> REGISTER_TEST_CASE(testValidArraySizer) { int testArray[16]; TEST(testing::assertEquals(ARRAY_LENGTH(testArray), 16)); TEST(testing::assertEquals(ARRAY_LENGTH_M(testArray), 16)); }
#include <algorithm> #include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <vector> int main(int argc, char **argv) { if (argc != 2) { return 0; } std::ifstream f(argv[1]); // first argument is the test file std::cout << std::fixed; std::cout << std::setpreci...
#include "Menu.h" int main() { struct Menu menu1; menu1.menu(); }
#include "Brain.hpp" #define HEX "0123456789ABCDEF" Brain::Brain(std::string type) { this->type = type; } Brain::Brain(void) { return; } Brain::~Brain(void) { return; } std::string Brain::identify(void) const { std::string addr = ""; long num = (long) this; while (num > 0) { addr ...
// Copyright 2020-2021 Russ 'trdwll' Treadwell <trdwll.com>. All Rights Reserved. #include "SteamIDUtils.h"
#ifndef __VECTOR_H__ #define __VECTOR_H__ #include <iostream> #include <typeinfo> using namespace std; template <class T> class vector { private: T *v; int sz; int count = 0; public: vector(int size); ~vector(); T& elem(int i) { return v[i]; ...
#include <map> #include <string> std::map<std::string, int> reg; void regist(std::string name, int val){ reg[name] = val; }
//************************************************************************** //** //** See jlquake.txt for copyright info. //** //** This program is free software; you can redistribute it and/or //** modify it under the terms of the GNU General Public License //** as published by the Free Software Foundation; either ...