text
stringlengths
8
6.88M
#include <Logger.h> #include <Serial.h> #include "gtest/gtest.h" using ::testing::SafeMatcherCast; using ::testing::Exactly; using ::testing::Eq; TEST(LoggerTest, initialize_CallsSerialBegin) { int pin = 1234; SerialMock *pSerialMock = serialMockInstance(); EXPECT_CALL(*pSerialMock, begin(Eq(pin))).Times(Exact...
/* vim: set sw=4 ts=4 et: */ /* * This file is part of Other Maemo Weather(omweather) * * Copyright (C) 2006-2011 Vlad Vasiliev * Copyright (C) 2010-2011 Tanya Makova * for the code * * Copyright (C) 2008 Andrew Zhilin * az@pocketpcrussia.com * for default icon set (Glance) * * This software is fr...
#include "Texture2D.h" #include "Bitmap.h" #include <stdexcept> #include <new> #include <memory> using namespace std; static GLenum TextureFormatForBitmapFormat(Bitmap::Format format, bool srgb = false) { switch (format) { case Bitmap::Format_Grayscale: return GL_LUMINANCE; case Bitmap::Format_Gray...
/* * SPDX-FileCopyrightText: (C) 2013-2022 Daniel Nicoletti <dantti12@gmail.com> * SPDX-License-Identifier: BSD-3-Clause */ #include "action.h" #include "application.h" #include "common.h" #include "config.h" #include "context_p.h" #include "controller.h" #include "dispatcher.h" #include "enginerequest.h" #include "...
#include <ros/ros.h> #include <tf/transform_broadcaster.h> #include <tf/transform_listener.h> #include <moveit/move_group_interface/move_group.h> #include <moveit/planning_scene_interface/planning_scene_interface.h> #include <moveit_msgs/DisplayTrajectory.h> #include <moveit_msgs/RobotState.h> #include <fstream> #inclu...
#ifndef PARALLEL_FOR_H #define PARALLEL_FOR_H #include <thread> #include <dsnutil/dsnutil_cpp_Export.h> namespace dsn { void dsnutil_cpp_EXPORT parallel_for(const size_t size, std::function<void(const size_t)> func, unsigned numThreads = std::thread::hardware_concurrency()); } #endif // PARALLEL_FOR_H
#include "CarService.h" #include "invalidmanifacturerexeption.h" #include <iostream> using namespace std; CarService::CarService() { //ctor } void CarService::add_car(const Car& car) { if(isValidManufacturer(car) && isValidCarAge(car)) { car_repo.add_car(car); } /// validat...
#ifndef XORSHIROBWGEN_ #define XORSHIROBWGEN_ #include "prng.h" #include "xorshiro.h" #include <cmath> class xorshiroGen{ private: xorshiro uniform; //oggetto della classe xorshiro double pi; double* data ; double* smeared ; public: xorshiroGen(); ~xorshiroGen(); double BW(doub...
/* problem : printout stars following rules of example condition : 1<=n<=100 Example -Input 4 -Output * * * * * * * * * * */ #include<iostream> using namespace std; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ for(int j=n-i;j>0;j--){ printf(" "); } for(int k=1; k<=2*i-1; k++){ if(k%2==1){ ...
#include <iostream> #include <memory> #include "abstractfactory.hpp" using std::cout; using std::endl; using std::shared_ptr; int main() { shared_ptr<RoundFactory> rof(new RoundFactory()); shared_ptr<MaskARound> maro(rof->CreateFigureA()); shared_ptr<MaskBRound> mbro(rof->CreateFigureB()); shared_ptr<...
/* Copyright (c) 2011 Andrew Wall 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 rights to use, copy, modify, merge, publish, distribute, sub...
/* this code is the solution of beakjoon #2743. please refer below url for checking problem. https://www.acmicpc.net/problem/2743 */ #include <iostream> #include <queue> using namespace std; int main(void) { string input; cin>>input; cout<<input.size()<<endl; }
/* This project uses Automatic Package Restore feature of NuGet to resolve Aspose.BarCode for .NET API reference when the project is build. Please check https://docs.nuget.org/consume/nuget-faq for more information. If you do not wish to use NuGet, you can manually download Aspose.BarCode for .NET API from http://www.a...
/* 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...
#ifndef SIPLASPLAS_REFLECTION_INIT_FILE_{{hash}}_HPP #define SIPLASPLAS_REFLECTION_INIT_FILE_{{hash}}_HPP /* * Reflection initialization file generated from file: * {{tu.filePath}} * * Classes: {% for class in tu.classes %} * - From line {{class.cursor.location.line}}: {{class.declKind}} {{class.className}} ({{cl...
// $Id: main.cpp,v 1.9 2016-07-20 21:00:33-07 - - $ #include <cstdlib> #include <exception> #include <iostream> #include <string> #include <unistd.h> #include <fstream> using namespace std; #include "listmap.h" #include "xpair.h" #include "util.h" //==================================================================...
#ifndef SW_GRAPH_STR_H #define SW_GRAPH_STR_H #include"sw_alpha_expansion.h" #include"sw_dataType.h" #include "stdlib.h" #include<vector> #include<string> #include<iostream> using namespace std; /*********************************class alpha expansion string ********************************/ class alpha_expansion_st...
#include<iostream> #include<string> #include<vector> using namespace std; class book { public: string name; int phone; int day; int month; int year; int code = { 20 }; int choice; void reserve() { cout << ".............BOOK YOUR ROOM ............." << endl; cout << "Enter customer name" << endl; cin...
#ifdef _WIN32 #include <Windows.h> #else #include <unistd.h> #endif #include <fstream> #include <iostream> #include <queue> #include <set> #include <vector> #include <filesystem> #include <opencv2/core.hpp> #include <opencv2/videoio.hpp> #include <opencv2/highgui.hpp> template <class T, class S, class C> S& Containe...
// LAB1.cpp : Defines the entry point for the console application. // #include <stdlib.h> #include <stdio.h> #include <cstring> #include "altbit.h" //#include "stdafx.h" // The following allows this to run on Linux #ifdef linux #define _TCHAR char #define scanf_s scanf #define _tmain main #endif /* *...
#include <cstdio> #include <climits> #include <vector> using namespace std; const int MAX_M = 100; const int MAX_N = 100; const int INF = std::numeric_limits<int>::max(); //2,147,483,647 == 2^31 -1 //INPUT int M,N; int X1[MAX_M], Y1[MAX_M]; int X2[MAX_N], Z2[MAX_N]; // slice by x double width(int* X, int* Y, int n,...
#include <bits/stdc++.h> #include <time.h> using namespace std; #define ll long long #define ld long double #define uint unsigned int #define ull unsigned long long void print(vector<int> &t) { for (int i = 0; i < (int)t.size(); ++i) cout << t[i] << " "; cout << "\n"; } ll dp[2001][2001]; ll MOD = 1e...
/*Ques. 10. Design a scheduler with multilevel queue having two queues which will schedule the processes on the basis of pre-emptive shortest remaining processing time first algorithm (SROT) followed by a scheduling in which each process will get 2 units of time to execute. Also note that queue 1 Has higher priority ...
// // SMPath.h // SMFrameWork // // Created by SteveMac on 2018. 7. 3.. // #ifndef SMPath_h #define SMPath_h // Bezier 따라 만든거 #include <cocos2d.h> #include <vector> class SMPath { public: SMPath(); virtual ~SMPath(); inline int size() {return (int)_vertices.size();} inline void reset() ...
/* * 길 찾기 게임 * 전무로 승진한 라이언은 기분이 너무 좋아 프렌즈를 이끌고 특별 휴가를 가기로 했다. * 내친김에 여행 계획까지 구상하던 라이언은 재미있는 게임을 생각해냈고 역시 전무로 승진할만한 인재라고 스스로에게 감탄했다. * * 라이언이 구상한(그리고 아마도 라이언만 즐거울만한) 게임은, 카카오 프렌즈를 두 팀으로 나누고, * 각 팀이 같은 곳을 다른 순서로 방문하도록 해서 먼저 순회를 마친 팀이 승리하는 것이다. * * 그냥 지도를 주고 게임을 시작하면 재미가 덜해지므로, 라이언은 방문할 곳의 2차원 좌표 값을 구하고 * 각 ...
#include <cstddef> struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution { public: ListNode *rotateRight(ListNode *head, int k) { if (!head) return head; ListNode *l1 = head, *l2; int count = 0; while (l1) { ++count; l1 = l1->next; ...
#pragma once // Warning disabled --- #pragma warning( disable : 4577 ) // Warning that exceptions are disabled #pragma warning( disable : 4530 ) #include <windows.h> #include <stdio.h> #include <utility> #include <experimental\filesystem> #include <string> #define LOG_OUT(format, ...) log(__FILE__, __LINE__, format,...
#include<bits/stdc++.h> using namespace std; bool used[1001][1001]; bool Y[1001], X[1001]; pair< int, pair<int,int> > p[1000010]; int main(){ int n,m; scanf("%d %d",&n,&m); for(int i=0;i<n;i++) for(int j=0;j<m;j++){ int t; scanf("%d",&t); p[m*i+j] = {-t,{i,j}}; } sort(p,p+n*m); long long ans =...
//----------------------------------------------------------------------------- // File: XBUtil.h // // Desc: Shortcut macros and helper functions for the XBox samples // // Hist: 11.01.00 - New for November XDK release // 12.01.00 - Moved input code to XBInput.cpp // 12.15.00 - Changes for December XDK rel...
/***** 描述 编写程序,将大于整数m且紧靠m的k个素数输出(k小于10)。 关于输入 输入为一行,包括两个整数,第一个为整数m,第二个为个数k 关于输出 输出为一行,即满足条件的k个素数 例子输入 3 4 例子输出 5 7 11 13 *****/ #include <iostream> using namespace std; #define MAX_N 10000 int prime[MAX_N] = {2, 3, 5, 7}, n_prime = 4; bool check_prime(int num) { for (int i = 0; i < n_prime &...
#include "device.h" #include "pin.h" #include "spi.h" #include "flexio.h" #include "intrpt.h" #include "delay.h" #include "spisoft.h" #ifndef XPT2046_H #define XPT2046_H const uint8_t channelY = 0x90; const uint8_t channelX = 0xD0; class Xpt2046 { private: using modeF= void (Xpt2046::*) (); //variables uint16_t x...
/** * $Source: /backup/cvsroot/project/pnids/zdk/zls/zfc/SmartPointer.hpp,v $ * * $Date: 2001/11/14 17:25:10 $ * * $Revision: 1.3 $ * * $Name: $ * * $Author: zls $ * * Copyright(C) since 1998 by Albert Zheng - 郑立松, All Rights Reserved. * * lisong.zheng@gmail.com * * $State: Exp $ */ #ifndef _ZLS_zfc_...
#include "../headers/operateuror.h" const OperateurOR& OperateurOR::evaluate(Pile& pile) const { if (pile.taille() >= getArite()) { try { dynamic_cast<Entier&>(pile.top()); } catch(exception&) { throw ComputerException("Erreur : mauvais arguments"); ...
#include<bits/stdc++.h> using namespace std; struct Queue { int size1; int front1; int rear1; int *Q; }; void create(struct Queue *q,int size) { q->size1=size; q->front1=q->rear1=0; q->Q=(int*)malloc(q->size1*sizeof(int)); } void enqueue(struct Queue *q,int x) { if((q->rear1+1)%q->si...
/************************************************************************* > File Name: heap_sort.cpp > Author: > Mail: > Created Time: Sat 11 Jul 2020 08:57:29 AM CST ************************************************************************/ #include<iostream> #include <cstdio> #include <cstdlib> #include <queu...
// // Created by 98595 on 2020/4/18. // 蓝桥杯校赛模拟 //问题描述 //  给定三个整数 a, b, c,如果一个整数既不是 a 的整数倍也不是 b 的整数倍还不是 c 的整数倍,则这个数称为反倍数。 //  请问在 1 至 n 中有多少个反倍数。 //输入格式 //  输入的第一行包含一个整数 n。 //  第二行包含三个整数 a, b, c,相邻两个数之间用一个空格分隔。 //输出格式 //  输出一行包含一个整数,表示答案。 //样例输入 //30 //2 3 6 //样例输出 //10 //样例说明 //  以下这些数满足要求:1, 5, 7, 11, 13, 17, 19, 23,...
#ifndef QUEUE_LIST #define QUEUE_LIST #include "../list/list.h" template <typename T> class queue : public List<T> { public: void enqueue ( const T &e ) { insertAsLast ( e );} T dequeue () { return remove ( this->first() );} T &front () { return this->first()->data; } }; #endif /* ifndef QUEUE_LIST */
/*************************************************************************** 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...
/* Copyright (C) 2011 Tal Pupko TalP@tauex.tau.ac.il. 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 3 of the License, or (at your option) any later version. This program is...
#ifndef QQUICKFOLDERLISTMODEL_H #define QQUICKFOLDERLISTMODEL_H class QQuickFolderListModel { public: QQuickFolderListModel(); }; #endif // QQUICKFOLDERLISTMODEL_H
/* Copyright (C) 2015 Willi Menapace <willi.menapace@gmail.com>, Simone Lorengo - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential * Written by Willi Menapace <willi.menapace@gmail.com> */ #include "GlobalDefines.h" #ifdef OFFBOA...
#ifndef __CAR_H__ #define __CAR_H__ #include "rectangle.h" #include "obstacle.h" #include "runrl.h" #include "rl.h" #include "GLFW/glfw3.h" #include "glm.hpp" #include "xtensor/xarray.hpp" #include "xtensor/xmath.hpp" #include <cmath> #include <unordered_map> #include <string> #include <algorithm> const float car_...
#ifndef GRAPHICSDEVICECREATOR_H_ #define GRAPHICSDEVICECREATOR_H_ #include <memory> #include <string> namespace revel { namespace renderer { //forward decl class GraphicsDevice; class GraphicsDeviceCreator { public: GraphicsDeviceCreator(); ~GraphicsDeviceCreator(); /** * @brief Create a render de...
#include "stdafx.h" #include "InputHandler.h" using namespace GraphicsEngine; InputHandler::InputHandler() : m_keys({}) { }
#include <cstdio> #include <algorithm> using namespace std; const int maxv = 512; const int INF = 0x3fffffff; int n, m, st, ed, weight[maxv], G[maxv][maxv]; int d[maxv], w[maxv], num[maxv]; bool vis[maxv] = {false}; void Dijkstra(int st) { fill(d, d + maxv, INF); fill(w, w + maxv, 0); fill(num, num + maxv...
#include <cstdio> int main() { int n, m; scanf("%d %d", &n, &m); int ans = n, tmp = n; while (tmp >=m) { ans += tmp / m; tmp /= m; } printf("%d", ans); return 0; }
#pragma once #include "SteeringBehaviour.h" class Approach : public SteeringBehaviour { public: Approach(Boid* parent, sf::Vector2f* target, float weight = 1.0f); sf::Vector2f CalculateSteeringForce() override; const sf::Vector2f* target; };
#ifndef DEUS_PERFORMANCETESTS_UTIL_HPP_ #define DEUS_PERFORMANCETESTS_UTIL_HPP_ #include <cstddef> #include <deus/Constants.hpp> #include <deus/UnicodeView.hpp> namespace deus_perf_util { //------------------------------------------------------------------------------ // ENUMERATOR...
#include <sstream> #include <iostream> #include <fstream> #include <openssl/sha.h> #include <iomanip> using namespace std; SHA256_CTX sha256; unsigned char my_hash[SHA256_DIGEST_LENGTH]; static const std::string base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/"; //See https://...
#include<omp.h> #include<iostream> #include<fstream> #include<cstdlib> #include<cmath> #include<vector> #include<string> #include<sstream> #include<iomanip> #include<ctime> #include<sys/ioctl.h> #include<unistd.h> #include <linux/perf_event.h> //#include <linux/hw_breakpoint.h> #include<stdint.h> #include<sys/syscall.h...
#ifndef _VEC_H #define _VEC_H struct Vec { double x,y,z; Vec() { x = 0.0; y = 0.0; z = 0.0; } Vec(double x0, double y0, double z0) { x = x0; y = y0; z = z0; } Vec(double v0) { x = y = z = v0; } Vec operator+(const Vec& vec3) const { return Vec(x+vec3.x,y+vec3.y,z+vec3.z);...
// // Copyright Jason Rice 2016 // 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 <mpdef/tree_node.hpp> #include <boost/hana.hpp> namespace hana = boost::hana; int main() { // Comparable { B...
#pragma once #include <vector> #include <functional> class Function { using xn_t = std::vector<double>; public: Function(std::function<double(xn_t const&)> func, std::function<xn_t(xn_t const&)> grad); Function(std::vector<double> const& func, std::function<xn_t(xn_t const&)> grad); double operator()(xn_t const& ...
/* * SPDX-FileCopyrightText: 2017 Rolf Eike Beer <eike@sf-mail.de> * * SPDX-License-Identifier: GPL-3.0-or-later */ #include "josm_presets_p.h" #include <algorithm> #include <array> #include <cassert> #include <cctype> #include <cstdio> #include <cstdlib> #include <cstring> #include <dirent.h> #include <fdguard.h...
#include "conn_check.h" #include "System_config.h" #ifndef CONN_REFRESH_VALUE #define CONN_REFRESH_VALUE 60 #endif //static UI counters[PROTO_MAX_ID + 1]; void ProtoConnCheck::update_counters(void) { // for( UI i = 0; i <= PROTO_MAX_ID; i++) // { // if (counters[i]) // counters[i]--; // } } bool ProtoCon...
#include "graphics\Singularity.Graphics.h" namespace Singularity { namespace Graphics { class OctTreeRenderIterator : public Singularity::Graphics::IRenderIterator { private: #pragma region Variables OctTreeRenderGraph* m_pGraph; OctTreeRenderGraph::OctNode* m_pStart; #pragma end...
// // Created by roundedglint585 on 10/4/19. // #define STB_IMAGE_IMPLEMENTATION #include <GL/glew.h> #include <GLFW/glfw3.h> #include "include/Fractal.h" constexpr uint32_t width = 800; constexpr uint32_t height = 600; int main() { Fractal fractal(width, height); fractal.init(); fractal.run(); ret...
//auto create by tocpp.rb, plz don't modify it! //2013-10-23 14:19:45 +0800 #include "TemplateHero.h" using std::string; TemplateHero::TemplateHero() { m_sn = 0; m_LevelUpIncAttack = 0; m_LevelUpIncDefence = 0; m_LevelUpIncHP = 0; m_LevelUpIncEnergy = 0; } bool TemplateHero::ReadJsonImpl(cons...
#pragma once #include "vector3.h" class Ray { public: Ray(); Ray(const Vector3& inOrigin, const Vector3& inDirection); const Vector3& GetOrigin() const { return origin; } const Vector3& GetDirection() const { return direction; } Vector3 PointAt(float t) const; public: Vector3 origin; Vec...
#include "Login.hpp" Login::Login(std::string cor,std::string contra){ correo = cor; contrasena = contra; } Login::Login(std::string* jsonLogin){ Json::Reader readerJson; Json::Value login; if(!readerJson.parse(*jsonLogin,login)) // Se verifica que se realice correctamente la conversion { std::co...
// Copyright ⓒ 2020 Valentyn Bondarenko. All rights reserved. #include <StdAfx.hpp> #include <Sound2D.hpp> #include <FileSystem.hpp> #include <Log.hpp> namespace be::sound { }
#include <stdio.h> #include <deque> #include <iostream> using namespace std; typedef unsigned long long int ulld; ulld max(ulld a, ulld b) { if (a > b) { return a; } return b; } int main(int argc, char const *argv[]) { ulld noInputs; ulld maximumSum; scanf("%lld", &noInputs); scanf("%lld", &maximumSum)...
#include "bonus_tiempo.h" #include "../../recursos.h" using namespace App_Juego_ObjetoJuego; using namespace App_Graficos; using namespace App; const float Bonus_tiempo::CANTIDAD_TIEMPO_DEFECTO=10.0f; Bonus_tiempo::Bonus_tiempo(float x, float y, float t): Objeto_juego_I(), Actor(x, y, W, H), tiempo(t) { } unsig...
#include "definiciones.h" #include <stdexcept> using namespace App_Definiciones; App_Definiciones::direcciones App_Definiciones::obtener_direccion_contraria(App_Definiciones::direcciones s) { switch(s) { case App_Definiciones::direcciones::arriba: return App_Definiciones::direcciones::abajo; break; case App_De...
#pragma once #include "CIL/mat/mat.h" namespace cil { enum RotateFlags { ROTATE_90_CLOCKWISE = 0, // Rotate 90 degrees clockwise ROTATE_180 = 1, // Rotate 180 degrees clockwise ROTATE_90_COUNTERCLOCKWISE = 2, // Rotate 270 degrees clockwise }; void flip(InputArray _src, OutputArray _...
#include "containers.h" #include "csvstream.h" #include <iostream> #include <algorithm> #include <iterator> /** * @brief Display the content of a map * * @param st_count: Reference to map with key-> states, value-> count */ void Display_by_State(std::map<std::string, int> &st_count) { int total = 0; //...
#include <irtkImage.h> #include <irtkMatrix.h> char *input_name = NULL; char *output_name = NULL; void usage(){ cout << "csv2mat [csvFile] [rows] [cols] [outputFile.mat]" << endl; cout << "csv file must be space separated." << endl; exit(1); } int main(int argc, char **argv){ if (argc < 5){ usage(); ...
// // Created by hw730 on 2020/6/8. // #ifndef DEFENCE_GAME_MONSTER_H #define DEFENCE_GAME_MONSTER_H #include "Position.h" class Monster { static int geneId(){static int id = 0;id++;return id;} public: //constructor Monster(): id(geneId()) {} //getters int getHP(){return HP;} int ...
#ifndef ARR_ASSIGN_I_H #define ARR_ASSIGN_I_H #include "instruction.h" #include "varregister.h" #include "arrayregister.h" #include "../visitors/codevisitor.h" #include <string> using namespace std; /** * An array assignment assigns a value to a slot of an array */ class ArrayAssignmentI: public Instruction { ...
class point{ public: float m; vect c,s,a; vect ff; point(){ m = 1.0f; } void force(vect af){ a += af/m; } void frict(vect aff){ ff += aff; } vect frict(){ if(ff*ff==0.0f){return ff;}//to avoid division by zero float afv = sqrt(ff*ff); vect an = ff/afv; vect ls = s - (s*an)*an; float lsv; ve...
/* * Author : BurningTiles * Problem : Death Battle * File : F.cpp */ #include <iostream> #include <cmath> #define ll long long using namespace std; ll gcd(ll a, ll b){ return (b==0)? a : gcd(b, a%b); } ll fact(ll x){ return (x<2)? 1 : x*fact(x-1); } ll nCr(ll n, ll r){ retu...
#include <bits/stdc++.h> using namespace std; int fibonacci(int x){ if(x <= 1) return x; else return (fibonacci(x-1)+fibonacci(x-2)); } int main() { int x; cin >> x; x = fibonacci(x); cout << x << endl; }
// This file has been generated by Py++. #ifndef GUIContextRenderTargetEventArgs_hpp__pyplusplus_wrapper #define GUIContextRenderTargetEventArgs_hpp__pyplusplus_wrapper void register_GUIContextRenderTargetEventArgs_class(); #endif//GUIContextRenderTargetEventArgs_hpp__pyplusplus_wrapper
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
#pragma once #include "EventLoopThreadPool.h" #include "Acceptor.h" #include "Buffer.h" #include "EventLoop.h" START_NAMESPACE class Connection; class TcpServer { public: using MessageCallback = std::function<void(std::shared_ptr<Connection>, Buffer&)>; using ConnectionCallback = std::function<void(std::s...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.Devices.Geolocation.2.h" WINRT_EXPORT namespace winrt { namespace Windows::Devices::Geolocation { struct WINRT_EBO CivicAddress : Windows::Devices::Geolocation::ICivicA...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once WINRT_EXPORT namespace winrt { namespace ABI::Windows::Devices::Printers::Extensions { struct IPrint3DWorkflow; struct IPrint3DWorkflow2; struct IPrint3DWorkflowPrintRequestedEventArgs; stru...
// alignas_alignof.cpp // compile with: cl /EHsc alignas_alignof.cpp #include <iostream> struct alignas(16) Bar { int i; // 4 bytes int n; // 4 bytes alignas(4) char arr[3]; // This wull make sure that arr will stat at a 4 byte boundary short s; // 2 bytes }; struct alignas(4) Bar...
#line 2 "Gen_hlslang.cpp" #line 4 "Gen_hlslang.cpp" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First...
/* * 8 September 2016 * Il Guastafeste - Stereo * Ivan Iovine * * Call for Residency - Casa Jasmina / Maker Faire Rome */ #include <WiFi101.h> #include <ArduinoCloud.h> // variables for WLAN Communication char *ssid = ""; char *pass = ""; // arduino cloud settings and credentials const char userName[] ...
#include "Collisions.h" #include <iostream> #include <windows.h> Collisions::Collisions() {} Collisions::~Collisions() {} BOX Collisions::GetSweptBroadphaseBox(BOX b) { BOX broadphasebox = BOX(); broadphasebox.x = b._velocityX > 0 ? b.x : b.x + b._velocityX; broadphasebox.y = b._velocityY > 0 ? b.y : b.y + b._v...
#include <bits/stdc++.h> #define MAX_V 1000 #define INF_NUM 100000000 using namespace std; using ii = pair<int,int>; vector<ii> G[MAX_V]; int distances[MAX_V]; int dijkstra(int source, int destiny,int N){ fill(distances, distances + N + 1,INF_NUM); priority_queue<ii,vector<ii>,greater<ii>> tovisit; dis...
#include <cstdlib> #include <ctime> #include <iostream> using namespace std; int main() { srand(time(0)); double x = rand() / (double)RAND_MAX; double y = rand() / (double)RAND_MAX; cout << x << " " << y; 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...
#ifndef CPPAST_INTERFACE #define CPPAST_INTERFACE #include "AstInterface.h" class CPPAstInterface : public AstInterface { public: CPPAstInterface(AstInterfaceImpl* _impl) : AstInterface(_impl) {} //! Check if $n$ is a data member access operator; If yes, grab the object and the field name bool IsMemberAccess(...
#include "push.h" //============================Log=================================== Log::Log(const char *path){ char *pathname=new char[strlen(path)+5](); strcpy(pathname,path); file=fopen(strcat(pathname,"/log"),"a"); delete pathname; } Log::~Log(){fclose(file);} void Log::printf(const char *format,...){ ti...
#ifndef __ANIMATOR_H__ #define __ANIMATOR_H__ #include <string> #include <vector> #include "VehicleBase.h" //========================================================================== //* This code requires that the VehicleBase class be a super class of //* any vehicle class(es). //* //* Usage: //* - construct an i...
// // Created by wqy on 19-11-18. // #include "Process.h" namespace esc{ void Process::setProcessName(string _processName) { this->processName = _processName; } void Process::setAttributes(list<esc::Attribute *> _attributes) { this->attributes = _attributes; } void Process::addAttribute(esc::Attribute *_attr...
#include <iostream> #include <vector> using namespace std; int min(int a, int b, int c) { return min(a, min(b, c)); } int m(char a, char b) { if (a == b) { return 0; } return 1; } int main() { string string1, string2; cin >> string1 >> string2; vector<vector<int>> dp(string1.siz...
// Copyright (c) 2019, Alliance for Sustainable Energy, LLC // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this...
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation; * * This program is distributed in the hope that it will be us...
/*************************************************************************** Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. 2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD FileName: RTPPacketResender.h Description: RTPPacketResender class to buffer and track(缓...
#include <iostream> #include <queue> using namespace std; class Node { public : int value; Node* left; //allocate size = 8 byte Node* right; }; class BinarySearchTree { public : Node* root; BinarySearchTree() { root = NULL; //to set to 0 } void Insert(int value) { Insert(roo...
/* * Copyright 2016-2017 Flatiron Institute, Simons Foundation * * 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 ...
/* 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...
#include <stdio.h> #include <iostream> #include <algorithm> #include <list> using namespace std; list<int> li{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; int main() { // 鉴规氢 立辟 for (auto it = li.begin(); it != li.end(); it++) { printf("%d, ", *it); } // 开规氢 立辟 for (auto it = li.end(); it!=li.begin(); it--) { --it;...
#include <cstdint> #include "Types.hpp" //#include "NewOrder.cpp" const int32_t warehouses=5; int32_t random(){ return rand();} int32_t urand(int32_t min,int32_t max) { return (random()%(max-min+1))+min; } int32_t urandexcept(int32_t min,int32_t max,int32_t v) { if (max<=min) return min; int32_t r=(ra...
#ifndef LIGHT_H #define LIGHT_H #include "SceneGraph.hpp" #include <glm/glm.hpp> class DirLight : public Light { public: DirLight(const glm::vec3 & inDir, const glm::vec3 & inColor); glm::vec3 color; glm::vec3 dir; }; #endif
#include "SuffixTree.h" SuffixTree::SuffixTree(const char* dotFileName) { dotFile = NULL; if(dotFileName) dotFile = fopen(dotFileName, "w"); } void SuffixTree::serialize(Compressor* compressor) { //Escreve o tamanho do texto e o texto compressor->feedRawBits(n, 32); int tot = n + nodes.size(), saved = 0, per...
// Complete the reverse function below. /* * For your reference: * * DoublyLinkedListNode { * int data; * DoublyLinkedListNode* next; * DoublyLinkedListNode* prev; * }; * */ DoublyLinkedListNode* reverse(DoublyLinkedListNode* head) { if (head == NULL) return head; DoublyLin...