text
stringlengths
8
6.88M
//===-- mess/simple-cli-client.hh - SimpleCLIClient class -------*- C++ -*-===// // // ODB Library // Author: Steven Lariau // //===----------------------------------------------------------------------===// /// /// \file /// SimpleCLIClient class definition. Can be used on client or server side /// //===--------------...
#include <Arduino.h> #include <EEPROM.h> #define EEPROM_SIZE 128 int eepromAddress[3] = {0, 32, 64}; String sentences[3] = {"State success", "SSID success", "PWD success"}; char readData[32], receivedData[32], ssid[32], pwd[32]; int dataIndex = 0; char *strings[128]; char *ptr = NULL; char test2[128]; bool test = tru...
/** * Programming Assignment #4 : Six Degrees of Kevin Bacon * CSC300 - Data Structures - Fall 2015 * Professor: Dr. John Weiss * * Author: Lucas Carpenter * * Compile: g++ -O -o Bacon_Number -std=c++14 BaconGame.cpp Graph.cpp * * Usage: Bacon_Number <database_file> [alternate_start] **/ //preprocessors #incl...
/* ======================================================================== DEVise Data Visualization Software (c) Copyright 1992-1996 By the DEVise Development Group Madison, Wisconsin All Rights Reserved. ======================================================================== Under no circumstances ...
#include <stdio.h> #include<stdlib.h> /*Programa que muestra la sumatoria de los numeros pares e impares del 1 al 100 Fecha:15 Febrero 2018 Elaborado por: Viviana Rojas Ruiz*/ int main() { int i; int *pn; int num=100; int sumaPares=0; int sumaImpar=0; pn=new int[num]; for(i=0;i<num;i++){ pn[i]=i...
#ifndef NESTED_INTEGRATION_FUSION_ITERATE_HPP #define NESTED_INTEGRATION_FUSION_ITERATE_HPP #include <boost/fusion/iterator/equal_to.hpp> #include <boost/fusion/include/equal_to.hpp> #include <boost/fusion/iterator/key_of.hpp> #include <boost/fusion/include/key_of.hpp> #include <boost/fusion/support/is_sequence.hpp>...
#include "TextureManager.hpp" #include <QImageReader> #include "LevelManager.hpp" using namespace Maint; using namespace OMGTarga; using namespace std; TextureManager::TextureManager() : _levelManager(NULL) { } TextureManager::~TextureManager() { for(QHash<QString, QImage*>::iterator it = images.begin(); it...
#pragma once #include "Types.h" #include <SDL.h> class Inputs { private: SDL_Event event; public: bool keyPressed[(int)InputKey::COUNT]; bool keyDown[(int)InputKey::COUNT]; Vec2 mousePosition; Inputs(); void UpdateInputs(); void SetKey(InputKey key, bool value); void SetAllFalse(); bool* GetIn...
/* OVERVIEW: You are given 2 bank statements that are ordered by date. Write a function that returns dates common to both statements (ie both statements have transactions in these dates). E.g.: Input: A[3] = { { 10, "09-10-2003", "First" }, { 20, "19-10-2004", "Second" }, { 30, "03-03-2005", "Third" } }; B[3] = { { 10...
#include "DisplayManager.h" #include "Loader.h" #include "Render.h" #include "RawModel.h" #include "StaticShader.h" #include "Camera.h" const char* VERTEX_SHADER_FILLPATH = "../../Shader/vertexShader.vs"; const char* FRAGMENT_SHADER_FILLPATH = "../../Shader/fragmentShader.fs"; const char* IMAGE1_FILLPATH = "../../Sha...
// // Created by OLD MAN on 2019/9/3. // #include <iostream> using namespace std; int main(){ int n,a=0,b=0,c=0; cin>>n; for(int i=0;i<n;i++){ int n1,n2,n3; cin>>n1>>n2>>n3; a+=n1; b+=n2; c+=n3; } cout<<a<<" "<<b<<" "<<c<<" "<<a+b+c; }
// IPNotFound.cpp : 实现文件 // #include "stdafx.h" #include "Talk2Me.h" #include "IPNotFound.h" #include "afxdialogex.h" // CIPNotFound 对话框 IMPLEMENT_DYNAMIC(CIPNotFound, CDialogEx) CIPNotFound::CIPNotFound(CWnd* pParent /*=NULL*/) : CDialogEx(CIPNotFound::IDD, pParent) { m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRA...
#ifndef FASTLEDSTRIP_H_ #define FASTLEDSTRIP_H_ #include <FastLED.h> /* La strip è composta da LED WS2812B che hanno 3 pin in entrata e 3 pin in uscita (power, ground e data) Ogni LED utilizzato utilizza circa 3 BYTES di RAM, quindi la striscia usa circa 3 x 150 = 450 BYTES di RAM Ogni metro si striscia utilizza cir...
// Created on: 2009-04-06 // Created by: Sergey ZARITCHNY // Copyright (c) 2009-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...
//知识点: 双指针(尺取法) ,枚举. /* By:Luckyblock 题目要求: 给定一数列, 从其中选择 两组数 要求 每组中 各数相差<=K, 求 可以选择的数的 最多的数量 分析题意: - 首先对数列进行排序, 则选择的对象 则变成了 数的范围区间 以便于之后的处理 - 先只考虑 选出一个数组的情况: 可以发现, 若固定了区间的左端点, 并向右寻找最优的右端点 当 左端点右移时, 右端点也只单调右移 所以可以使用双指针(尺取法), 先令左端点 = 1, 并向右寻找 第一个满足条件的右端点 之后 左端点右移, 右端点 继续右移, ...
#ifndef __REPORTEDITORVIEW_H #define __REPORTEDITORVIEW_H //----------------------------------------------------------------------------- #include "IReportEditorView.h" #include "IReportEditorView.h" #include "IViewWindow.h" namespace wh{ //----------------------------------------------------------------------------- ...
// This file was generated based on '/Users/r0xstation/Library/Application Support/Fusetools/Packages/Uno.Permissions/1.3.2/Permissions.uno'. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.Object.h> namespace g{namespace Uno{namespace Permissions{struct PlatformPermission;...
//********************************************************************************* // Universidad de Costa Rica // Estructuras de Computadores Digitales II // Tarea 2: Paralelizacion de Clustering Data Mining // I Ciclo 2017 // ...
/* * economy.hpp * * Created on: May 28, 2015 * Author: arun */ #ifndef ECONOMY_HPP_ #define ECONOMY_HPP_ #include "BaseHeader.h" #include "households.h" #include <string> #include <fstream> #include <sstream> #include <random> using namespace std; class Economy{ public: Economy(int numHouseholds, int se...
class Actuator { private: int Pin; public: void Init(int pin) { Pin = pin; // use LED for testing pinMode(Pin, OUTPUT); } void Open() { // use LED for testing digitalWrite(Pin, HIGH); delay(1000); } void Close() { // use LED for testing digitalWrite(Pin, LOW); delay(100...
/* * LoadBalancer.cc * * Created on: Nov 17, 2017 * Author: cis505 */ #include "../common/json.hpp" #include "../FE_server/feconfig.h" #include "../FE_server/feserver.h" #include "../FE_server/httpservice.h" using json = nlohmann::json; //============================ // system funcs //====================...
/* ID: stevenh6 TASK: gift1 LANG: C++ */ #include <iostream> #include <fstream> #include <string> #include <map> using namespace std; map<string, int> p; ifstream fin ("gift1.in"); ofstream fout ("gift1.out"); void addb(int indiv, int count) { for (int i = 0; i < count; i++) { string per; getline(fin, pe...
#include "stdafx.h" #include "FileOpe.h" #include <io.h> using namespace std; FileOpe::FileOpe() { init(); } FileOpe::FileOpe(const char* name) { init(); //openFlag = Open(name); fileName = name; /*if (!isExist()) { fileName.assign(""); }*/ } FileOpe::FileOpe(const FileOpe& tt) { init(); fileName = tt.ge...
// Generated by gencpp from file seagull_autopilot_msgs/AutopilotStatus.msg // DO NOT EDIT! #ifndef SEAGULL_AUTOPILOT_MSGS_MESSAGE_AUTOPILOTSTATUS_H #define SEAGULL_AUTOPILOT_MSGS_MESSAGE_AUTOPILOTSTATUS_H #include <string> #include <vector> #include <map> #include <ros/types.h> #include <ros/serialization.h> #inc...
#include "StatusEdge.h" typedef StatusBase<NfaStatusNumber, EdgeMatchContent> NfaStatusBase; typedef NfaStatusBase::EdgeBase NfaEdgeBase; typedef Status<NfaStatusBase, NfaEdgeBase> NfaStatus; typedef NfaStatus::Edge NfaEdge; template<> Link<NfaStatusBase*> NfaStatusBase::AllStatus{}; template<> Link<NfaEdge...
// // Created by fab on 27/02/2020. // #ifndef DUMBERENGINE_UTILITIES_HPP #define DUMBERENGINE_UTILITIES_HPP #include <cstdlib> #ifndef NAN #define NAN(x) (x!=x) #endif #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif ...
#ifndef FORGETPASS_H #define FORGETPASS_H #include <QWidget> #include <QCloseEvent> #include "connection.h" namespace Ui { class forgetpass; } class forgetpass : public QWidget { Q_OBJECT public: explicit forgetpass(QWidget *parent = 0); ~forgetpass(); void closeEvent(QCloseEvent *...
//////////////////////////////////////////////////////////////////////////////// // //(C) Andy Thomason 2012-2014 // // Modular Framework for OpenGLES2 rendering on multiple platforms. // // fluid example based on Joss Stam paper. // #include <valarray> #include <memory> namespace octet { /// Scene containing a box...
#include "StdAfx.h" namespace UiLib { CControlUI::CControlUI() : m_pManager(NULL), m_pParent(NULL), m_bUpdateNeeded(true), m_bMenuUsed(false), m_bVisible(true), m_bInternVisible(true), m_bFocused(false), m_bEnabled(true), m_bRandom(false), m_bGetRegion(false), m_bMouseEnabled(true), m_bKeyboa...
#define BOOST_TEST_MODULE uri test #include <boost/test/unit_test.hpp> #include <stdio.h> #include "uri.hh" using namespace ten; /* TODO: test uris from: * http://code.google.com/p/google-url/source/browse/trunk/src/gurl_unittest.cc */ BOOST_AUTO_TEST_CASE(uri_constructor) { uri u; BOOST_CHECK(u.scheme.em...
#pragma once #include "GameNode.h" #include <vector> using namespace std; #define SPEED 3 #define GRAVITY 0.25f #define JUMP -12 enum STATUS { STATUS_WALK, STATUS_IDLE = 4, STATUS_JUMPUP, STATUS_JUMPDOWN }; struct tagMonsterInfo { float x, y; float speed; int monsterNumber; }; class MainGame19 : public Gam...
/*-------------------------------------------------------------------------------------- dmd_latin_chars Demo and example Latin-1 encoding project for the Freetronics DMD, a 512 LED matrix display panel arranged in a 32 x 16 layout. See http://www.freetronics.com/dmd for resources and a getting started guide. ...
#include "behaviorwindow.h" #include "ui_behaviorwindow.h" #include "mainwindow.h" #include <ledlabel.h> #include "Dependencies/LightParameter.h" #include "Dependencies/NeoPixelCodeConverter.h" #include <QtAlgorithms> #include <QColorDialog> #include <vector> std::vector<LightParameter> *vectorOfStructs; NeoPixelCodeC...
#include <iostream> #include <cstdlib> #include <time.h> #include "DIET_client.h" const char *configuration_file = "/root/dietg/cfgs/client.cfg"; const float MIN_DURATION = 20.0; const float MAX_DURATION = 60.0; const float MIN_NUMPROCESSES = 1; const float MAX_NUMPROCESSES = 4; const double SIZE_MATRIX = 1e10; //at...
#include <cstdlib> #include <ctime> #include <algorithm> #include <list> #include <iterator> #include <iostream> #include "Population.h" using namespace std; namespace HWA2{ Population::Population(int popSizeIn){ std::srand(std::time(0)); popSize = popSizeIn; pop = new std::vector<Gene>; readDataset(); std...
#pragma once #include <fstream> #include <tuple> #include <memory> #include <yaml-cpp/yaml.h> #include "Types/Configurable.hpp" class YAMLStream { public: enum Type{ in, out }; YAMLStream(); YAMLStream(std::string_view filepath, Type flag); void open(std::string_view filePath, Type flag); ...
#include "util/Vec3f.h" class Entity { private: Vec3f _pos; int list; Vec3f target; bool targetReached; public: Entity(); Entity(Vec3f pos); void tick(); void draw(); void setTarget(Vec3f t); bool reachedTarget(); };
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; char getMaxOccuringChar(char *); int main() { char str[] = "ashsssuu"; char a=getMaxOccuringChar(str); cout << a << endl; } // } Driver Code Ends char getMaxOccuringChar(char *str) { int count[256]; memset(count, 0, sizeof(cou...
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <math.h> using namespace std; int task4() { float meters; cout << "Enter meters: \n"; cin >> meters; float kilometers = meters / 1000; cout << "Kilometers: " << setprecision(5) << kilometers << '\n'; return 0; }
#include<vector> #include<iostream> #include<algorithm> #include<deque> using namespace std; bool compare(vector<int>& a,vector<int>& b) { return a[0]+a[1]<b[0]+b[1]; } class Solution { public: vector<vector<int>> kSmallestPairs(vector<int>& nums1, vector<int>& nums2, int k) { //基本思想:大顶堆,问题转化为215数组中的前K个...
#include<iostream> using namespace std; int sum(int k) {int t=0; while (k) {t=t+k%10; k/=10; } return (t > 9)?sum(t):t; } int main() {int n,k,now; while (1) {cin >> n; if (!n) break; now = k = sum(n); for (int i = 1;i < n; i++) now = sum(now*k); cout << now << endl; } return 0; ...
#ifndef _RABBITS_HPP_ #define _RABBITS_HPP_ class Rabbits { public: Rabbits( ); Rabbits( bool mature, bool sex, int monthsPassed = 0 ); ~Rabbits( ); bool get_mature( ) const; void set_mature( bool mature ); bool get_sex( ) const; void set_sex( bool...
// // Created by manout on 17-3-20. // #include "common_use.h" #include "BiNode.h" /* * Given preorder and inorder traversal of a tree, construct the binary tree * 从先序遍历序列和中序遍历序列中还原二叉树的结构 * 分析: * 利用二叉树的递归性质和中序先序的关系还原二叉树 */ BiNode* build_tree(const vector<int>& pre_order,const vector<int>& in_order) { retur...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // // Copyright (C) 1995-2007 Opera Software AS. All rights reserved. // // This file is part of the Opera web browser. It may not be distributed // under any circumstances. // // Arjan van Leeuwen (arjanl) #ifndef MBOXSTORE_H #define MBOXS...
int sz[MAX]; bool erased[MAX]; vi grafo[MAX]; void dfs(int u, int p=-1){ sz[u] = 1; for(int v: grafo[u]) if(v!=p and !erased[v]){ dfs(v, u); sz[u] += sz[v]; } } int centroid(int u, int p=-1, int size=-1){ if(size==-1) size = sz[u]; for(int v: grafo[u]) if(v!=p and !erased[v...
//Andrea Peņa Calvin #include "jugador.h" tTecla leerTecla() { tTecla sol = TERROR; int dir; std::cin.sync(); dir = _getch(); // dir: tipo int if (dir == 13) sol = TSALIR; else if (dir == 32) sol = TLASER; else if (dir == 0xe0) { dir = _getch(); switch (dir) { case 72: sol = T...
#ifndef cryptobox_core_HSM_hpp #define cryptobox_core_HSM_hpp #include <string> #include <optional> #include "cryptobox/core/Common.hpp" namespace cryptobox { class HSM { public: // status for the verification of the signature enum Status { Accepted, Rejected }; HSM(std::string cons...
/************************************************************************/ /* tools */ /************************************************************************/ #ifndef __UTIL_H__ #define __UTIL_H__ #include <opencv2/opencv.hpp> #include <string> #inclu...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-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" #include "modules/doc/imageprogresshandle...
/** *AUTHOR:Harsh Agrawal* *Birla Institute of Technology,Mesra* **/ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; const int N=2e5+1; #define for0(i,e) for(ll i=0;i<e;i++) #define forx(i,x,e) for(ll i=x;i<e;i++) #define ln "\n" #define in(a) cin...
// Created on: 2016-04-07 // Copyright (c) 2016 OPEN CASCADE SAS // Created by: Oleg AGASHIN // // 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 publi...
#include <stdio.h> int i; void g(); void f() { int i; i = 3; { int i; i = 2; g(); } g(); } void g() { i = i + 1; printf("g: %d\n", i); } int main() { i = 5; g(); f(); return 0; }
#pragma once #include <SFML/Graphics.hpp> namespace CAE { namespace WindowHelper { //sf::Vector2f get } }
#include "CCheckMnick.h" #include "json/json.h" #include "Logger.h" #include "threadres.h" #include "Helper.h" int CCheckMnick::do_request(const Json::Value& root, char *client_ip, HttpResult& out) { out["result"] = 1; std::string username = root["param"]["mnick"].asString(); if (!isNickNameInRule(usern...
#include <algorithm> #include <chrono> #include <future> #include <iostream> #include <map> #include <numeric> #include <string> #include <thread> #include <tuple> #include <type_traits> #include <utility> #include <vector> #include <cmath> #include <cstddef> #include <cstdint> #include <cstring> #include "algorithms...
#include <iostream> using namespace std; class PlatypusDuckAndBeaver { public: int minimumAnimals(int webbedFeet, int duckBills, int beaverTails) { int maxWebbedFeet = duckBills*2 + beaverTails*4; int platypusCnt = (maxWebbedFeet - webbedFeet)/2; return (duckBills+beaverTails)-platypusCnt; } };
#pragma once namespace jsvector { typedef JSBool(* jsVectorOp)(JSContext* cx, JSObject* obj, D3DXVECTOR3& vec, void* user); struct jsVectorOps { jsVectorOp get; jsVectorOp set; }; JSObject* NewVector(JSContext* cx, JSObject* parent, const D3DXVECTOR3& vec); JSObject* NewWrappedVector(JSContext...
#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 <cstdio> #include <cstdlib> #include <cstring> #include <numeric> #include <bits...
#include<iostream> #include<vector> // for 2D vector using namespace std; int main() { // Initializing 2D vector "vect" with // // values vector< vector<int> > vect{{1, 2, 3,5}, {4, 5, 6,8}, {7, 8, 9,2}}; //size of 2d vect cout<<"no. of rows : "<<vect.size(); cout<<endl; cout<<"no.of c...
/* * Class storing data for screen location relative to level */ #include <cassert> #include "playingscreen.h" void PlayingScreen::unitTest() { PlayingScreen* scr = new PlayingScreen(0, 0, 100, 100, 200, 100); assert(scr->getX() == 0); assert(scr->getY() == 0); assert(scr->getCenterX(10) == 45); assert(scr->ge...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2009 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 DAPI_VCARD_SUPPORT #include "mod...
/* * StorageRepositoryImpl.h * * Created on: Nov 11, 2017 * Author: cis505 */ #ifndef BE_SERVER_STORAGEREPOSITORYIMPL_H_ #define BE_SERVER_STORAGEREPOSITORYIMPL_H_ #include <iostream> #include <memory> #include <queue> #include <string> #include <unordered_map> #include <vector> #include <set> #include "B...
// Created on: 1993-03-10 // Created by: JCV // Copyright (c) 1993-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 GNU Lesser Gen...
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*- * * Copyright (C) 1995-2002 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #ifndef XSLT_FOREACH_H #define XSLT_FOREACH_H #ifdef XSLT_SUPPORT #incl...
////////////////////////////////////////////////////////////////////// ///Copyright (C) 2011-2012 Benjamin Quach // //This file is part of the "Lost Horizons" video game demo // //"Lost Horizons" is free software: you can redistribute it and/or modify //it under the terms of the GNU General Public License as published ...
// Copyright (c) 2007-2021 Hartmut Kaiser // Copyright (c) 2013 Agustin Berge // // 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) /// \file wait_any.hpp #pragma once #if de...
#include <ros/ros.h> #include <tf/tf.h> #include <moveit/move_group_interface/move_group.h> #include <geometry_msgs/PoseStamped.h> #include <moveit_msgs/AttachedCollisionObject.h> #include <moveit_msgs/CollisionObject.h> #include <moveit_msgs/Grasp.h> #include <moveit_msgs/DisplayTrajectory.h> #include <visualizatio...
// resolution de la cam : 128 x 96 pixels // angles de detection theoriques: 33 horizontal, 23 vertical // couleurs fils : rouge = +5V, noir = GROUND, vert = SCL, jaune = SDA // champ de vision horizontal 37.5° // champ de vision vertical 29° #include <Wire.h> int IRsensorAddress = 0xB0; //int IRsensorAddress = 0x58;...
/* -*-C++-*- */ /* * Copyright 2016 EU Project ASAP 619706. * * 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 app...
/* XMRig * Copyright 2010 Jeff Garzik <jgarzik@pobox.com> * Copyright 2012-2014 pooler <pooler@litecoinpool.org> * Copyright 2014 Lucas Jones <https://github.com/lucasjones> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2016 Jay D Dee <jayddee246@gmail.com> * C...
#ifndef CONTAINER_H #define CONTAINER_H #include "object.h" class Container:protected Object { public: friend std::ostream& operator<<(std::ostream& out, const Container& plant); //Перегрузка оператора вывода friend std::istream& operator>>(std::istream& in, const Container& plant); //Перегрузка операт...
// Q 19 #include"stdio.h" #include"conio.h" void main(void) { int a,b,c,d,e,f,g; clrscr(); printf("Step 1 -> "); for(a=1; a<=10; a++) { b=a*a; printf("%d ",b); } printf("\n\nStep 2 -> "); for(c=1; c<=10; c++) { d=c*c; printf("%d+",d); } printf("\n\nAverage = Sum of No's / Total Numbers"); for(e=...
#include<fstream> #include<string.h> #include<ctype.h> #include<iostream> #include<algorithm> #include<map> #include<unordered_map> #include<array> #include<deque> #include<unordered_set> using namespace std; int n, i, min1, n1, n2; char c1, c2; vector <int> vec; vector <int> ::iterator it; int main() {...
/* Crayfish - A collection of tools for TUFLOW and other hydraulic modelling packages Copyright (C) 2016 Lutra Consulting info at lutraconsulting dot co dot uk Lutra Consulting 23 Chestnut Close Burgess Hill West Sussex RH15 8HN This program is free software; you can redistribute it and/or modify it under the terms o...
#ifndef __SORTS_CPP #define __SORTS_CPP #include "sorts.h" //===================================================================================== vector<long> InsertionSort(vector<long> nums) { int size = nums.size(); long numbers[size]; for (int i = 0; i < size; i++) { numbers[i] = nums[i]; } for (int i ...
// Given a number, remove consecutive repeated digits from it using stack #include<bits/stdc++.h> using namespace std; string func(string s) { int i=0; stack<char>a; while(i < s.length()) { if(a.empty() || s[i] != a.top()) { a.push(s[i]); i++; } ...
/************************************************************************************** * File Name : CoolDown.cpp * Project Name : Keyboard Warriors * Primary Author : Wonju Cho * Secondary Author : * Copyright Information : * "All content 2019 DigiPen (USA) Corporation, all rights reserved...
/** * Copyright (c) 2020, 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...
/** * \file expatpp.hpp contains the expatpp libraries interface header * * See LICENSE for copyright information. */ #ifndef expatpp_hpp #define expatpp_hpp #include "xmlparser.hpp" #endif // #ifndef expatpp_hpp
// dog.c // AUTHOR: Julia Sales // ID: jesales // DESCRIPTION: A simple program that replicates // the cat function on termninal. // Resources used were piazza posts and man pages. #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <err.h> #include <string.h> int main (int argc, ch...
// Created on: 1996-11-25 // Created by: Philippe MANGIN // Copyright (c) 1996-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...
#include "MyChiSquared.h" MyChiSquared::MyChiSquared( mat xin, mat yin, mat ein ) : xMatrix(xin), yMeasured(yin) { mat buffMatrix(ein.n_rows,ein.n_rows); for (int i = 0; i < ein.n_rows; ++i) for (int j = 0; j < ein.n_rows; ++i) buffMatrix(i,j) = 0; for (int i =...
/* * ==================================================================== * Python_appui.h * * Copyright (c) 2005 Nokia Corporation * * 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...
#include "EventHandler.h" #include <SFML/Window/Event.hpp> #include <SFML/Graphics/RenderWindow.hpp> #include "Log.h" #include "MouseEventHandler.h" #include "GamePadEventHandler.h" #include "KeyboardEventHandler.h" namespace Platy { namespace Game { sf::Event EventHandler::myEvent; void EventHandler::HandleE...
int find(int x) { for(int i=1;i<=mn;i++) if(!used[i]&&map[x][i]) { used[i]=true; if(match[i]==-1||find(match[i])) { match[i]=x; return true; } } return false; } int Hungry() { int sum=0; for(int i=1;i<=cn;...
/** ****************************************************************************** * Copyright (c) 2019 - ~, SCUT-RobotLab Development Team * @file SourceManage.cpp * @author 苏锴南 15013073869 * @brief 底盘电源管理 * @date 2019-11-12 * @version 2.0 * @par Change Log: * <table> * <tr><th>Date <th>Vers...
#include<iostream> #include<vector> #include<algorithm> #include<set> #include<map> using namespace std; int pick=45; int guess(int num) { if(pick<num) return -1; else if(pick>num) return 1; else return 0; } class Solution { public: int guessNumber(int n) { //基本思想:二分查找折半查...
#include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <ctime> #include <memory.h> #include <cmath> #include <string> #include <cstring> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional> #include <numeric> #include <ss...
#include <iostream> #include <stdlib.h> using namespace std; int main(){ #ifdef WIN32 cout << "launching RINS -> 640x640" << endl; system(".\\Release\\RINS.exe"); #endif }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-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" #include "OpSearchEdit.h" #include "modu...
/* kamalsam */ #include<iostream> using namespace std; int main() { long long int n; int r=0; cin>>n; while(n>1&&r==0) { if(n%2==0) n/=2; else r=1; } if(r==1) cout<<"NIE"<<endl; else cout<<"TAK"<<endl; return 0; }
#include "cameraNavigator.h" #include "events/event.hpp" #include <imgui.h> namespace gui = ImGui; namespace lab { } #if 0 void camera_navigator(lab::FontManager& fontManager, const unsigned int frameRate) { SetFont small(fontManager.mono_small_font); ImVec2 pos = gui::GetCursorScreenPos(); gui::SetNextWi...
// Author: WangZhan -> wangzhan.1985@gmail.com #pragma once #include "MessageLoop.h" #include "WaitableEvent.h" class MessageLoopThread { public: struct Options { Options() : messageLoopType(MessageLoop::Type_default), iStackSize(0) {} Options(MessageLoop::Type type, size_t iSize) : ...
// Copyright (c) 2020 The Orbit 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 "ScopeTimer.h" #include "Threading.h" #include "absl/strings/str_format.h" thread_local size_t CurrentDepth = 0; thread_local size_t CurrentDe...
#ifndef __BOX2D_GAME_SCENE_H__ #define __BOX2D_GAME_SCENE_H__ #include "GameScene.h" #include "Box2D/Box2D.h" #include "cocos2d.h" // Game scene with box2d physics class Box2DGameScene : public GameScene, public b2ContactListener { public: static cocos2d::Scene* createScene(); virtual bool init() override; ...
// Copyright (c) 2019 The NavCoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "navcoinlistwidget.h" NavCoinListWidget::NavCoinListWidget(QWidget *parent, QString title, ValidatorFunc validator) : ...
#include "ProductB2.h" #include<iostream> ProductB2::ProductB2() {}; ProductB2::~ProductB2() {}; void ProductB2::Use(){ std::cout << "use productB2" << std::endl; }
#ifndef BS_FUZZY_INTEGRAL_HPP #define BS_FUZZY_INTEGRAL_HPP #include <bs/defs.hpp> #include <opencv2/imgproc.hpp> using namespace cv; namespace { inline void sort3 (double* f, int* i) { static const int arr [][3] = { { 2, 1, 0 }, { 1, 2, 0 }, { 0, 0, 0 }, { 1, 0, 2 }, { 2...
#include "BallLocalizer.h" #include "Config.h" #include "Util.h" #include <vector> #include <algorithm> BallLocalizer::BallLocalizer() { } BallLocalizer::~BallLocalizer() { } void BallLocalizer::update(Math::Position robotPosition, const BallList& visibleBalls, const Math::Polygon& cameraFOV, double dt) { Bal...
#ifndef FIELD_H #define FIELD_H #include <cmath> #include <cstdlib> #include <iostream> #include <string> #include <list> #include <vector> const int N = 9; // size of the field const int K = std::ceil(N/2.0); struct pos { int a, b; }; extern pos not_a_position; struct move { pos a, b, c; int dir; move(){ ...