text
stringlengths
8
6.88M
#include <Servo.h> #include <math.h> Servo servo, servo2, servo3, servo4; const byte numLEDs = 3; //byte ledPin[numLEDs] = {11, 12, 13}; const byte buffSize = 40; char inputBuffer[buffSize]; const char startMarker = '<'; const char endMarker = '>'; byte bytesRecvd = 0; boolean readInProgress = false; boolean newData...
// Alfred Shaker // accumulating_observer.cpp // cs33901 #include "accumulating_observer.h" #include <iostream> #include <string> #include <vector> void AccumulatingObserver::update(Observable* obs) { // get state, save state char state = obs->get_state(); upperCase.push_back(state); } ...
//O(n) using bucket of size t+1 and then slide window of k class Solution { public: bool containsNearbyAlmostDuplicate(vector<int>& nums, int k, int t) { if(t < 0 || k < 0) return false; unordered_map<long, long> mp; long w = t+1; for(int i = 0; i < nums.size(); ++i){ lo...
#ifndef UTILS_ERROR_HANDLING_STATUS_H_ #define UTILS_ERROR_HANDLING_STATUS_H_ namespace utils { namespace error_handling { enum class Status { kOk, kError }; } // namespace utils } // namespace error_handling #endif
#include "githabic.h" #include <iostream> #include <cmath> using namespace std; int task4(){ int x; cout << "Used task 30 (IF) from Abramyan book" << endl; cout << "Enter your number:" << endl; cin >> x; x = abs(x); if (x%2 == 0){ if (x < 100){ if (x < 10) cou...
/* * TestTime.cpp * * Created on: 02-Nov-2016 * Author: sirisha */ using namespace std; #include "TestHeader.h" #include <stdio.h> #include <time.h> #include <unistd.h> #include <ctime> class TestTime; class TestTime { private: time_t currentRawTimeInSeconds; struct tm currentTime; char buf[180]; stat...
// // Created by 송지원 on 2019-10-23. // #include "iostream" using namespace std; int main() { int n, i; scanf("%d", &n); for (i=1; i<10; i++){ printf("%d * %d = %d\n", n, i, n*i); } }
/*The function should return the modified array as specified in the problem statement */ vector<int> threeWayPartition(vector<int> A, int a, int b) { // only gravity will pull me down // Three way partitioning int lo = 0, hi = A.size()-1, i = 0; while(i <= hi) { if (A[i] < a) ...
#include "GeneticOperator.h" Crossover::Crossover() { } chromosomePair Crossover::crossover(chromosomePair parents) { int tmp1, tmp2, tmp3; tmp1 = (rand() % 1028) + 1; Sleep(1); tmp2 = (rand() % 100) * (rand() % 200); Sleep(1); tmp3 = (((rand() % 2048) * tmp2) + tmp1) % 4096; int breakingPoint = (tmp3 % 69) +...
/* 该函数只返回n的一个因数,可以通过和Miller Rabin配合来进行质因数分解。 */ ll pollard_rho(ll n) { ll i, x, y, k, d,c; while(true) { c=rand()%(n-1)+1; //f(x)=x^2-c i = 1; y=x = rand() % (n-1)+1; k = 2; while(true) { i++; d = gcd(y-x+n, n); if (d > 1 && d < n) return d; if (i == k) y = x, k *= ...
#pragma once ////////////////////////////////////////////////////////////////////////// // ExpandCollapseControl.h - Provides expand and collapse functionality// // to hide and unhide data on web browser // // // // Language: Visual C++ 2015 ...
/* -*- 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. */ #include "core/pch.h" #include "adjunct/desktop_pi/desktop_file...
#include <iostream> #include <sstream> #include <vector> #include <list> #include <queue> #include <algorithm> #include <iomanip> #include <map> #include <unordered_map> #include <unordered_set> #include <string> #include <set> #include <stack> #include <cstdio> #include <cstring> #include <climits> #include <cstdlib> ...
#include "GnMeshPCH.h" #include "GnGamePCH.h" #include "GLayer.h" GnInterfacePtr GLayer::smpModalInterface = NULL; void GLayer::SetModalState(GnInterface* pModalInterface) { smpModalInterface = pModalInterface; } GnInterface* GLayer::GetModalState() { return smpModalInterface; } void GLayer::AddCh...
// // Created by HHPP on 2020/4/30. // #include "Polygon.h" #include "Point.h" #include "Line.h" Polygon::Polygon(int n, double ** p) { num=n; poly=new Point[n]; for(int i=0;i<n;i++){ poly[i].x=p[i][0]; poly[i].y=p[i][1]; } } double Polygon::largestX() { double largestX=poly[0].x; ...
#pragma GCC optimize("Ofast") #include <algorithm> #include <bitset> #include <deque> #include <iostream> #include <iterator> #include <string> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #include <unordered_map> #include <unordered_set> using namespace std; void abhisheknaiidu()...
#include "ros/ros.h" #include <ros/package.h> //not sure if needed // #include "std_msgs/String.h" #include <std_msgs/Int32MultiArray.h> #include <std_msgs/Float32MultiArray.h> #include<geometry_msgs/PoseStamped.h> #include "mission/maintomission.h" #include <std_msgs/Int32.h> #include <sstream> #include <stdio.h> #inc...
#pragma once namespace Move { class Kalman { float q; //process noise covariance float r; //measurement noise covariance float x; //value float p; //estimation error covariance float k; //kalman gain bool firstValue; public: Kalman() { p=0.47f; q=0.0625f; r=4.0f; firs...
/** * @file * @brief Implementation of user class MyHit. */ #include "MyHit.hh" #include "G4SystemOfUnits.hh" //using namespace CLHEP; // -- one more nasty trick for new and delete operator overloading: G4Allocator<MyHit> MyHitAllocator; MyHit::MyHit(const G4int Detector_ID, const G4bool isPrimary, const G4String ...
#include <iostream> #include <gl/glut.h> #include<windows.h> #include <math.h> #include "object.h" using namespace std; Object object = Object(); void chessboard() { glClearColor(0, 1, 1, 0);// For displaying the window color glMatrixMode(GL_PROJECTION);// Choosing the type of projection ...
#include <iostream> using namespace std; template <typename T, typename U> U sum(T a, U b){ return(a+b); } int main(){ int x = 7; double y = 7.12; cout << sum(x,y) << endl; }
// octree_test.cpp #include "../library/leap.h" using namespace leap::system; using namespace leap::rendering; using namespace leap::world; using namespace leap; int main(int argc, char* argv[]) { std::vector<vec3> loaded_chunks; constexpr float CHUNK_REAL_EDGE = CHUNK_EDGE * BLOCK_EDGE; constexpr float W...
#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...
#include <cstdio> using namespace std; /* //3 int numMayor( int n1, int n2, int n3); int main(){ int n1 = 4; int n2 = 7; int n3 = 3; int mayor; mayor = numMayor(n1,n2,n3); printf("El mayor es %d", mayor); } int numMayor( int n1, int n2, int n3){ int mayor; if ((n1>n2) && (n1>n3)...
#pragma once #include <windows.h> #include <iostream> #include <TlHelp32.h> #include "defines.h" namespace driver { class kernel_interface { public: HANDLE driver_handle; kernel_interface(LPCSTR registry_path) { driver_handle = CreateFile(registry_path, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FIL...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2006-2011 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Peter Krefting */ #include "core/pch.h" #include "modules/pre...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2006 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef SVG_DOM_RECT_IMPL_H #define SVG_DOM_RECT_IMPL_H #incl...
#ifndef GLOBAL_H #define GLOBAL_H #include <iostream> #include <vector> #include <math.h> using namespace std; extern int modPart; extern int display; extern int showNormals; extern int REAL; extern int WIDTH; extern int HEIGHT; extern std::vector<int> NORMAL; /*extern int LX; extern int LY; extern int LZ;*/ #endif ...
// Copyright (c) 2007-2021 Hartmut Kaiser // // 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) #include <pika/config.hpp> #include <pika/assert.hpp> #include <pika/coroutines/c...
#include <QSplitter> #include <QLayout> #include <QTableView> #include <QStandardItemModel> #include <QHeaderView> #include <QToolBar> #include <QToolButton> #include <QTextEdit> #include <QPushButton> #include <QFileSystemWatcher> #include "hostsmanager.h" #include "hostmanagerwidget.h" /** * @brief HostManagerWidg...
#include <iostream> #include <vector> #include <algorithm> #include <fstream> #include <queue> #include <unordered_set> #include <unordered_map> #include <stack> #include <cstdio> #include <cmath> #include <cstring> using namespace std; #define INT_MIN (1<<31) #define INT_MAX (~INT_MIN) #define UNREACHABLE (INT_MAX>>2...
#include <bits/stdc++.h> using namespace std; #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) #define MAXN 100 struct Point{ double x,y; }; struct Line { double ax,ay,bx,by; void init(Point A, Point B){ ax = A.x,ay = A.y; bx = B.x,by = B.y; } }; double cross(Line K, double a, double b) { double...
//带有额外整型参数的operator new重载 #include<new> using namespace std; class MemoryDemo { public: MemoryDemo(); ~MemoryDemo(); void* operator new(size_t size) throw(bad_alloc); void operator delete(void* ptr) throw(); void* operator new[](size_t size) throw(bad_alloc); void operator dele...
// // Peer.cpp // superasteroids // // Created by Cristian Marastoni on 21/05/14. // // #include "EndPoint.h" #include "Internal.h" #include "NetTime.h" #include "Connection.h" #include "Channel.h" #include <algorithm> #include "../Debug.h" namespace { struct IfDisconnected { bool operator()(Connection ...
// 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...
#ifndef CORE_NET_EVENT_LOOP_H #define CORE_NET_EVENT_LOOP_H #include "lock.hpp" #include "TcpSock.h" #include <pthread.h> #include <boost/shared_ptr.hpp> #include <boost/noncopyable.hpp> #include <boost/enable_shared_from_this.hpp> #include <boost/function.hpp> #include <vector> namespace core { namespa...
// Created by: Kirill GAVRILOV // Copyright (c) 2013-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 Fre...
// Copyright (c) 2011-2017 The Cryptonote developers // Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs // 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....
#pragma once #include "LayerBuilder.hpp" #include "Utils/ArrayView.hpp" #include "Utils/NotNull.hpp" #include "LayerBuilder.hpp" #include "NodeBuilders/ConnectedLayerNodeBuilder.hpp" #include <vector> #include <memory> struct UnaryNodeBuilder; struct ConstSingleValueNodeBuilder; struct MultipleInputLayerNodeBuilder; s...
#include "regulator.h" #include <stdio.h> Regulator::Regulator(QObject *parent) : QObject(parent) { openPort(); timeoutTimer = new QTimer(this); endtimeTimer = new QTimer(this); connect(timeoutTimer,&QTimer::timeout,this,&Regulator::handleTimeout); QObject::connect(endtimeTimer,SIGNAL(timeout()),t...
#include "report.h" #include "ui_report.h" Report::Report(QWidget *parent) : QDialog(parent), ui(new Ui::Report) { ui->setupUi(this); } Report::~Report() { delete ui; } void Report::on_BackToGeneralWindow_clicked() { GeneralWindow gw; this->close(); gw.setModal(true); gw.exec(); }
#include "tilelayer.h" TileLayer::TileLayer(sge::graphics::Shader* shader) :Layer(new sge::graphics::Batch2DRenderer(), shader, sge::math::mat4::orthographic(0.0f, 16.0f, 0.0f, 9.0f, -1.0f, 1.0f)) { } TileLayer::~TileLayer(){ }
#include <iostream> using namespace std; int main(){ int h,m; cin >> h >> m; if(m > 44) cout << h << " " << (m-45) << endl; else{ h = (h + 24 - 1) % 24; m = (m + 15) % 60; cout << h << " " << m << endl; } return 0; }
#include "common/buffer/buffer_impl.h" #include "common/router/config_impl.h" #include "common/router/router.h" #include "common/router/upstream_request.h" #include "extensions/common/proxy_protocol/proxy_protocol_header.h" #include "extensions/upstreams/http/tcp/upstream_request.h" #include "test/common/http/common....
// // Created by payaln on 20.02.2019. // #pragma once #include <G4VUserPrimaryGeneratorAction.hh> #include <G4ParticleGun.hh> #include <G4Event.hh> #include <G4Gamma.hh> #include <G4ParticleTable.hh> #include <G4SystemOfUnits.hh> #include <Randomize.hh> #include "GlobalMessenger.h" class PrimaryPartGenerator : publ...
#include "machine_fixture.h" namespace mix { class MachineAddressesTestSuite : public MachineFixture {}; TEST_F(MachineAddressesTestSuite, enta) { machine.enta(make_instruction(cmd_enta, 70)); EXPECT_EQ(70, get_reg_a_value()); } TEST_F(MachineAddressesTestSuite, ent1) { machine.ent1(make_instruction(cmd_ent1...
/***************************************************************************************************************** * File Name : mergeTwoSortedArray.h * File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\sites\geeksforgeeks\arrays\page08\mergeTwoSortedArray.h * Created on : Jan 2, 2014 :: 10:09...
/** * @copyright 2013 Christoph Woester * @author Christoph Woester * * 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 ...
/** \file goalDetector.cpp \author UnBeatables \date LARC2018 \name goalDetector */ #include "goalDetector.hpp" #define DEBUG_PERCEPTION 1 void GoalDetector::run(cv::Mat topImg, cv::Mat goalImg, PerceptionData *data) { // Goal detection on roi_field cv::Mat goal = topImg.clone(); cv::M...
// winmain.cxx #include "mainwin.h" // global-variables ////////////////////////////////////////////////////////////////////// HINSTANCE hAppInstance; char HomeFolderName[MAX_PATH]; CRITICAL_SECTION c_section; ID2D1Factory *pD2D_Factory; IWICImagingFactory *pWIC_Factory...
#pragma once #ifndef __HI_MAYA_H__ #define __HI_MAYA_H__ #include <maya/MPxCommand.h> //a very very basic Maya command; class HiMaya : public MPxCommand { public: HiMaya() = default; //when call "HiMaya;" from mel or "Maya.cmds.HiMaya()" from python virtual MStatus doIt(const MArgList&); //called when the com...
/* This program uses an arduino to collect flight mission parameters from a user. It then calculates and performs the correct timing of shutter events given the input. */ #include <Arduino.h> #include <LiquidCrystal.h> #include <math.h> enum Button { up, down, right, left, select, none, unknown }; LiquidCrystal lcd(...
#ifndef NIKESHOES_H #define NIKESHOES_H #include "shoes.h" #include <iostream> class NikeShoes : public Shoes { public: virtual void show() override { std::cout << "Just do it" << std::endl; } }; #endif // NIKESHOES_H
// $Id: lasvariablerecord_test.cpp 712 2008-05-14 22:47:43Z hobu $ // // (C) Copyright Mateusz Loskot 2008, mateusz@loskot.net // Distributed under the BSD License // (See accompanying file LICENSE.txt or copy at // http://www.opensource.org/licenses/bsd-license.php) // // liblas #include <liblas/liblas.hpp> // tut #in...
#include "GnSystemPCH.h" #include "GnFrameSkip.h"
#include "EvaluationMap.h" #include "Entities/Range/Appraised/AppraisedRange.h" #include "JsonArraySerialization.h" struct EvaluationMap::Implementation { QList<AppraisedRange> appraisedRanges; }; // :: Lifecycle :: // :: Constructors :: EvaluationMap::EvaluationMap() : pimpl(new Implementation()) {} // :: Copy...
/* * License: * License does not expire. * Can be distributed in infinitely projects * Can be distributed and / or packaged as a code or binary product (sublicensed) * Commercial use allowed under the following conditions : * - Crediting the Author * Can modify source-code */ /* * File: Vertex...
//------------------------------------------------------------------------------------------------- // File : s3d_testScene.h // Desc : Test Scene. // Copyright(c) Project Asura. All right reserved. //------------------------------------------------------------------------------------------------- #pragma once ...
#include "Infantry_Config.h" #include "PID.h" S_Infantry Infantry; void Infantry_Config_Init() { Shoot_Init(); Pitch_Yaw_Init(); } //发射pid参数设置 void Shoot_Init() { Shoot.pid_init(LEFT_FRI_SPEED,10.0f,0.5f,0.0f,0,30000.0f); Shoot.pid_init(RIGHT_FRI_SPEED,10.0f,0.5f,0.0f,0,30000.0f); Shoot.pid_init(T...
#ifndef UTILS_H__ #define UTILS_H__ #include <iostream> #include <iomanip> #include <cuda.h> #include <cuda_runtime.h> #include <cuda_runtime_api.h> #include <cassert> #include <cmath> #define checkCudaErrors(val) check((val),#val,__FILE__,__LINE__) using namespace std; template<typename T> void check( T err, ...
/* * @lc app=leetcode.cn id=712 lang=cpp * * [712] 两个字符串的最小ASCII删除和 */ // @lc code=start class Solution { public: int minimumDeleteSum2(string s1, string s2) { int m = s1.length(); int n = s2.length(); vector<vector<int>> dp(m+1, vector<int>(n+1, 0)); for(int i=1;i<=m;...
#include <iostream> #include "operaciones.h" #include <iostream> using namespace std; bool primo(int numero) { int cont = 0; for(int i = 1; i <= numero; i++) { if(numero % i == 0) { cont += 1; } else { cont += 0; }...
#include "linked_list.h" #include "node.h" #include <iostream> using namespace std; Linked_List::Linked_List(){ bool another = true; string temp; cout << "Please enter a number: "; getline(cin, temp); while(is_int(temp) == false){ cout << "Invalid integer, please enter a valid integer: "; ...
//---------------------------------------------------------------- // ClientAFEntity.h // // Copyright 2002-2006 Raven Software //---------------------------------------------------------------- #ifndef __GAME_CLIENT_AFENTITY_H__ #define __GAME_CLIENT_AFENTITY_H__ /* ==================================================...
#include <cstdio> #include <iostream> #include <vector> #include <string> #include <stack> #include <unordered_map> #include <unordered_set> #include <queue> #include <algorithm> #define INT_MAX 0x7fffffff #define INT_MIN 0x80000000 using namespace std; string longestCommonPrefix(vector<string> &strs){ if(strs.size...
#include <iostream> #include <stdlib.h> #include <vector> #include <algorithm> using namespace std; vector <int> highScores; class Game{ private: int numOfPlayers; int playerOneScore; int playerTwoScore; string playerOneName; string playerTwoName; public: Game(){ numOfPlaye...
#include "Engine.h" class Gravity { public: void startJump() { speedY = -5; jumping = true; } bool isJumping() { return jumping; } void nextStep() { speedY += step; } int ChangeX() { return speedX; } int ChangeY() { return speedY; } void leftPress(int actPlayerX) { speedX = 1; if (act...
#include <iostream> using namespace std; int main(void) { ios::sync_with_stdio(false); cout.tie(NULL); cin.tie(NULL); int num, sum = 0; string numbers; cin >> num >> numbers; for (char num : numbers) sum += num - '0'; cout << sum << endl; return 0; }
#include<vector> #include<iostream> #include<cstdio> #include <cstring> #include<set> using namespace std; int main(){ int n; int a; set <int> v; while(cin >>n){ for( int i = 0; i < n; i++){ cin >> a; v.insert(a); } set <int> :: iterator p; for(p = v.begin(); p != v.end(); p ++){ ...
/*! * \file Profiler.h * * \author Shiyang Ao * \date November 2016 * * */ #pragma once namespace Hourglass { #define MAX_PROFILE_BLOCK_COUNT 64 #define ENABLE_PROFILER 0 #if (ENABLE_PROFILER == 1) # define BEGIN_PROFILER() Hourglass::g_Profiler.BeginProfiling() # define END_PROFILER() Hourglass::g_Pro...
#include<cstdio> #include<algorithm> using namespace std; int dui[30100]; int size=0; void put(int x)//大根堆的put { dui[++size]=x; int son=size,dad=size/2; while(dad > 0) { if(dui[son]<=dui[dad]) break; swap(dui[son],dui[dad]); son=dad; dad/=2; } } int get()//大根堆的get { int t...
#ifndef MONSTER_H #define MONSTER_H #include <QObject> #include <QString> #include <math.h> #include <QStringList> class Monster : public QObject { Q_OBJECT public: explicit Monster(QObject *parent = 0); Monster ( const Monster &monster); Monster& operator= (const Monster &monster); int id; ...
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmBinUtilsWindowsPEGetRuntimeDependenciesTool.h" #include "cmRuntimeDependencyArchive.h" cmBinUtilsWindowsPEGetRuntimeDependenciesTool:: cmBinUtilsWindowsPEG...
#include <vector> #include <numeric> #include <algorithm> #include <cmath> #include "halide_benchmark.h" //#include "Profiler.h" std::vector<double> get_normal_dist_tuple(std::vector<double> v){ double sum = std::accumulate(v.begin(), v.end(), 0.0); double mean = sum / v.size(); std::vector<double> diff(...
/* 边双连通分量 POJ 3352 边双连通分量求法: dfn[x]表示搜索到x的时间戳,low[x]表示以x为根的搜索子树能联系到的时间戳最小的 点,在搜索过程中把点压入栈中。 如果low[x]>dfn[fa],那么说明x连向父亲的边是桥,那么栈中到x为止的点构成一个边 双连通分量,把它们全部弹出来。 最后还剩下包含根节点的分量,这又是一个新的分量。 */ #include<iostream> #include<queue> #include<vector> #include<cstdio> #include<cstdlib> #include<cstring> #include<a...
#include "Gugu.h" #include <allegro5\allegro.h> #include <allegro5\allegro_image.h> Gugu::Gugu(){ this->x = 0; this->y = 390; this->curFrameX = 0; this->curFrameY = 0; this->frameWidth = 168; this->frameHeight = 252; this->image = NULL; } void Gugu::InitGugu(ALLEGRO_BITMAP *image){ this->x = 0; //posicao x na...
#ifndef TPOOL_H #define TPOOK_H #include <vector> #include <deque> #include <thread> #include <mutex> #include <algorithm> #include <iterator> #include <functional> #include <condition_variable> #include <iostream> namespace tsk { namespace tpool { class no_thread_exception : public std::exception { }; class Thre...
#include<iostream> #include<vector> #include<list> #include<stdlib.h> #define Default_Chances 10 using namespace std; class Guess{ public: char guess[10]; int a,b; Guess(char* s_guess, int s_a, int s_b):a(s_a),b(s_a){ for(int i=0; s_guess[i]; i++){ guess[i] = s_guess[i]; } }; Guess() { a = 0; ...
#include "glut.h" #include "DisplayManager.h" #include "Player.h" #include "Bullet.h" #include "DrawMap.h" DisplayManager::DisplayManager() { bullet = new Bullet; } DisplayManager::~DisplayManager() { delete bullet; bullet = nullptr; } void DisplayManager::myDisplay() { glClear(GL_COLOR_BUFFER_BIT | GL_D...
/* * File: calibration_check.cpp * Date: 11/05/20 * Description: Testing of camera calibration using an object of known size * Author: Athena Petropoulou */ #include <stdio.h> #include "iostream" #include <vector> #include <stdlib.h> #include <unistd.h> #include <stdbool.h> #include <math.h>...
/* One acre of land is equivalent to 43,560 square feet. Write a program that calculates the number of acres in a tract of land with 391,876 square feet. Author: Aaron Maynard */ #include <iostream> using namespace std; int main() { // Declare variables double conversion = 43560; //1 acre = 43560 sq ft ...
#include <iostream> using namespace std; int main() { cout << "In Test.cpp" << endl; cout << "Added in branch-1" << endl; }
#include <gtest/gtest.h> #include "shoc/hash/md2.h" #include "shoc/hash/md4.h" #include "shoc/hash/md5.h" #include "shoc/hash/sha1.h" #include "shoc/hash/sha2.h" // #include "shoc/hash/sha3.h" #include "shoc/hash/gimli.h" using namespace shoc; struct Data { std::string_view msg; std::string_view exp; }; temp...
#include<bits/stdc++.h> using namespace std; int main(){ (3>5) ? printf("3 bigger than 5!!!!\n") : printf("3 not bigger than 5!!!!\n"); }
#include "scenario_insert.hpp" ScenarioInsert::~ScenarioInsert() { } ScenarioInsert::ScenarioInsert(const std::vector<std::string>& word_list, std::size_t nqueries) : Scenario() { std::random_device rd; std::mt19937 gen(rd()); this->m_impl->queries.reserve(nqueries); this->m...
#include "gamewindow.h" GameWindow::GameWindow(QWidget *parent) : QMainWindow(parent) { gameWidget = new QWidget; //LAYOUT PRINCIPAL gameLayout = new QGridLayout; //BACKGROUND DE LINTERFACE QPixmap bkgnd("./Image/Background.jpg"); bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio); QPalet...
 // MainFrm.cpp: CMainFrame 클래스의 구현 // #include "pch.h" #include "framework.h" #include "MFCPainter.h" #include "CLeftToolBar.h" #include "MFCPainterView.h" #include "MFCPainterDoc.h" #include "MainFrm.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CMainFrame IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd) BEGIN_MES...
// BkGnuPG.cpp : DLL アプリケーション用のエントリ ポイントを定義します。 // #include "stdafx.h" #include "BkGnuPG.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case D...
#include<bits/stdc++.h> using namespace std; main() { int n; while(cin>>n) { int r; r = n%4; if(n==0) cout<<"1"<<endl; else if(r==1) cout<<"8"<<endl; else if(r==2) cout<<"4"<<endl; else if(r==3) cout<<"2"<<endl; else if(r==0 && n!=0) ...
#include <iostream> #include <vector> using namespace std; int soliNumeros(); vector<int> Numeros(); int sumaNumeros( vector<int> ); int productoNumeros( vector<int> ) ; int main() { vector<int> lista ; int suma , producto ; lista = Numeros(); suma = sumaNumeros( lista ) ; produ...
/* -*- 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. */ #include "core/pch.h" #include "platforms/mac/model/MacServices....
// File: fullSample.cpp // Library: SimpleOpt // Author: Brodie Thiesfield <code@jellycan.com> // Source: http://code.jellycan.com/simpleopt/ // // MIT LICENCE // =========== // The licence text below is the boilerplate "MIT Licence" used from: // http://www.opensource.org/licenses/mit-license.php // // ...
#include <stdio.h> int main() { float c, f; printf("Digite a temperatura em Graus Celcius: "); scanf("%f", &c); f = (9 * c + 160) / 5; printf("Sua temperatura equivale a %.2f Graus Fahrenheit.", f); }
#include "pch.h" #include "IComponent.h" #include "Core\ComponentFactory.h" namespace Hourglass { IComponent::IComponent() { m_IsAlive = false; m_IsEnabled = false; m_Entity = nullptr; } IComponent* IComponent::Create( StrID name ) { return ComponentFactory::GetFreeComponent( name ); } IComponent* IC...
#include <iostream> #include <cmath> #include <Eigen/Core> #include <Eigen/Geometry> //Eigen几何模块 using namespace std; using namespace Eigen; //本程序演示Eigen几何模块的使用方法 int main(int argc, char** argv) { //旋转向量使用AngleAxisd,它的底层不直接是Matrix //但运算可以当作矩阵(因为重载了运算符) //此旋转向量是沿z轴旋转45度 AngleAxisd rotation_vector(M_PI/4, Vecto...
#include <iostream> #include <stdlib.h> #include <stdint.h> #include "weights.h" #ifdef __SDSCC__ #include "sds_lib.h" #endif #include "loss_HW.h" #ifdef __SDSCC__ class perf_counter { public: uint64_t tot, cnt, calls; perf_counter() : tot(0), cnt(0), calls(0) {}; inline void reset() { tot = cnt = calls = 0;...
#ifndef _BresserReceiver_h #define _BresserReceiver_h // enable DEBUG with: //#define BresserReceiver_DEBUG_TIMINGS true #include "Arduino.h" #define BresserReceiver_PREAMBLE 3850 // (us) preamble is low #define BresserReceiver_HIGH_PULSE 550 #define BresserReceiver_SHORT_LOW_PULSE 900 #define BresserReceiver_LONG_L...
#pragma once class MonAIPresetIcon :public GameObject { public: void OnDestroy() override; //デストラクタ ~MonAIPresetIcon(); //Start bool Start(); //初期化関数 //args: // monID: モンスターのID // pyInd: pythonの番号 void init(int monID,const wchar_t* pypath,CVector3 pos); void Setpos(CVector3 pos); void Setrot(float rot...
#include "playToneGenerator.h" using namespace qReal; using namespace robots::generator; void PlayToneGenerator::generateBodyWithoutNextElementCall() { mNxtGen->mGeneratedStrings.append(SmartLine( "ecrobot_sound_tone(" + mNxtGen->mApi->stringProperty(mElementId, "Frequency") + ", " + mNxtGen->mApi->stringPro...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> #include <map> using namespace std; typedef long long ll; #define INF 10e17 // 4倍しても(4回足しても)long longを溢れない #de...