text
stringlengths
8
6.88M
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.UI.Composition.Interactions.1.h" #include "Windows.Foundation.1.h" #include "Windows.UI.Composition.1.h" #include "Windows.UI.Composition.2.h" WINRT_EXPORT namespace winrt { ...
/* Copyright 2019 Istio Authors. All Rights Reserved. * * 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 applicab...
#include <Wire.h> #define SMPL_SENDER #define DURATION_0s01 10000 #define DURATION_1s00 1000000 #define DURATION_TIMER DURATION_1s00 //0.01 s #define EXREAD 0x01 #define EXWRITE 0x02 #define RECEIVEBUFFER_FULL 0x64d #define RECEIVEBUFFER_CNT RECEIVEBUFFER_FULL #define SEND_NOTHING_MSG int EnableRead = 0; b...
#include "../Common/Types.h" class CWindow; class CWindowHandler { public: CWindowHandler(); ~CWindowHandler(); void AddWindow( CWindow* pWindow ); void RemoveWindow( CWindow* pWindow ); protected: CWindow* GetWindow( u32 uWindowIndex ); u32 GetNumWindows() const; private: static const u32 ms_...
// // Created by drnuc on 9/9/2018. // #include "GPIOInterrupts.h" GPIOInterrupts & gpioInterrupts = GPIOInterrupts::getInstance(); SemaphoreHandle_t xSemaphore[2][32]; void GPIOInterrupts::Initialize() { // enable interrupts on port 0/2 NVIC_EnableIRQ(EINT3_IRQn); // Register C function which delegates...
#ifndef LINEAR_REG #define LINEAR_REG #include <iostream> #include <vector> #include <algorithm> #include "Math.h" template<typename T, typename M> void estimate_coeff(std::vector<T> indep_var, std::vector<T> dep_var, M &B1, M &B0) { M X_mean = alg_math::Math_Mean(indep_var); M Y_mean = alg_math::Math_Mean(dep_var)...
// // Rectangle.h // // A module to encapsulate a rectangle. // #ifndef __RECTANGLE_H__ #define __RECTANGLE_H__ #include "Buffer.h" // // Rectangle // // A class to represent a Rectangle. A Rectangle has a // position and two dimensions. // // Class Invariant: // <1> row_size >= 1 // <2> column_size >= 1 ...
#pragma once #include "Operation.h" #include <string> class XChangeOperation : public Operation { public: XChangeOperation(std::string var, int old_val, int new_val) : variable(var), old_value(old_val), new_value(new_val) {}; ~XChangeOperation(); private: std::string variable; int old_value, new_value; };
/* * Copyright (C) 2007-2015 Frank Mertens. * * Use of this source is governed by a BSD-style license that can be * found in the LICENSE file. * */ #ifndef FLUXCRYPTO_SHA1_H #define FLUXCRYPTO_SHA1_H #include <flux/crypto/HashSum> namespace flux { namespace crypto { /** \brief Secure Hash 1: a one-way hash fu...
// SenderWorker.cpp // CSCE 463-500 // Luke Grammer // 11/21/19 #include "pch.h" INT result = -1; DWORD duplicateACKVal = 0; SHORT numDuplicateACKS = 0; BOOL resetTimer = false; DWORD timerExpire = 0; INT lastReleased = 0; ReceiverHeader ACKHeader; clock_t elapsedTime; Packet* AckPacket; Packet* BasePacket; DWORD byt...
/************************************************************* * > File Name : T96526.cpp * > Author : Tony * > Created Time : 2019/10/26 09:15:17 * > Algorithm : DS **************************************************************/ #include <bits/stdc++.h> using namespace std; typedef...
/* GPA2 - IFC Criado Por: Natalia Kelim Thiel Data: 11/03/2016 Descrição: Cabeçalho (header) da biblioteca para processos de variáveis */ #ifndef Variavel_h #define Variavel_h #include "Arduino.h" class Variavel { public: // Construtor (vazio) Variavel(); // Atualiza mínima...
#include "XmlResourceLoader.h" #include "../../Application.h" namespace liman { extern Application* g_pApp; bool XmlResourceLoader::VLoadResource(char* rawBuffer, unsigned int rawSize, ResHandle* handle) { if (rawSize <= 0) return false; XmlResourceExtraData* pExtraData = new XmlResourceExtraData(); pEx...
#include <iostream> using namespace std; int main() { int a; cout << "정수 입력: "; cin >> a; cout << a<< "번째" << " 영어 대문자는" <<(char)(a+'A')<< endl; }
#pragma once #include <vector> #include <GL/glew.h> #include "Textures.h" #include "Utility.h" #include <glm/mat4x4.hpp> #include <glm/glm.hpp> #include <glm/vec4.hpp> #include <glm/vec3.hpp> #include <memory> #include <list> #include <map> // all information for individual vertex6 struct Vertex { glm::vec4 loc; ...
// header inclusion #include <stdio.h> #include <opencv2/opencv.hpp> #include <opencv2/highgui.hpp> #include <opencv2/core/core_c.h> #include <cmath> #include <opencv2/objdetect.hpp> #include <opencv2/imgproc.hpp> #include <vector> using namespace cv; using namespace std; #define pi 3.14159265 void getThresholded...
#include "device.h" #include "pin.h" #include "spi.h" #include "delay.h" #include "dma.h" #include "pit.h" #ifndef FLASHSPI_H #define FLASHSPI_H namespace flashCommands { const uint8_t WriteEnable = 0x06; const uint8_t WriteDisable = 0x04; const uint8_t ReadStatusReg1 = 0x05; const uint8_t ReadStatusReg2 = 0x35; con...
//============================================================================ // Name : bubble-sort.cpp // Author : Oneal Abdulrahim // Date : 14 September 2016 // Copyright : // Description : Implementation of bubble sort in C++ //=================================================================...
#ifndef DATE_H #define DATE_H #include <string> #include <vector> #include <iostream> #include "kattistime.h" #include <ctime> #include <cmath> #include <iomanip> #include <stdexcept> #define KATTIS #define MOD_JULIAN_DATE_DIFF 2400000.5 #define GREGORIAN_EPOCH 1721425.5 namespace lab2 { /** * @brief Abstract clas...
/** * File: path.cpp * -------------- * This file implements the Path class. */ #include "path.h" #include "strlib.h" void Path::addArc(Arc *newone) { pathcost += newone->cost; pathofarcs.add(newone); } void Path::addNode(Node *newnode) { newnode->dist = pathcost; pathofnodes.add(...
#include "stdafx.h" #include "NewGame.h" #include "MainMenu.h" void NewGame::Init() { m_states.resize(GS_NUM_STATES, nullptr); MainMenu *Menu = new MainMenu(this); m_states[GS_MAIN_MENU] = Menu; m_current = Menu; Menu->Enter(); } void NewGame::Close() { for ( unsigned int i = 0; i < m_states.size(); i++ ) i...
#pragma once #include "Point.h" /////////////////////////////////////////////////////////////////////////////////// //链表定义 class Line //链表定义 { public: int N; /////////////////////头指针 Point *head; Line(); ~Line(); /////////////////////插入节点 void Insert(Point b); /////////////////////删除节点,成功则返回1 bool Delete(...
// pyramid 11 #include<iostream.h> #include<conio.h> void main() { clrscr(); int i,j,a; // logic for the reqyired pyramid for(i=1;i<=5;i++) { a=1; for(j=1;j<=i;j++) cout<<a++; cout<<endl; } getch(); }
/** * @File test_hash_table.cpp * @Brief file_description * Details: * @Author guohainan * @Version v0.0.1 * @date 2017-09-10 10:15:39 */ #include "gtest/gtest.h" #define UNIT_TEST true #include "gomoku/hash_table.h" using namespace gomoku; TEST(HashTable, test) { HashTable<int> hashTable(97); ChessBo...
//$Id$ //------------------------------------------------------------------------------ // TestEarthModel //------------------------------------------------------------------------------ // GMAT: General Mission Analysis Tool // // Author: Wendy Shoan // Created: 2016.05.11 // /** * Unit-...
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QFileDialog> #include <math.h> #include <float.h> #include <stdlib.h> #include <time.h> //#include <kmlp.h> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *pare...
#include <bits/stdc++.h> using namespace std; int main() { int r, km, ha, horas, sf, salario; cin >> km >> ha >> horas >> sf >> salario; r = ((km+ha+horas)*sf)-salario; cout << "Nao creio, Seu Armando! " << r << endl; return 0; }
//Initialize IR sensor #include <SharpIR.h> #define ir A0 #define model 1080 SharpIR sharp(ir, 25, 93, model); int dis; boolean present; float defaultIrMin = 14; //Setup Pins void setup() { Serial.begin(9600); pinMode (ir, INPUT); } void loop(){ dis = sharp.distance(); present = (dis<defaultIrMin); Serial.p...
#pragma once #ifndef __PLAYPAUSE_H__ #define __PLAUPAUSE_H__ #include "Panel.h" class PlayPause : public Panel { public: void Draw(Application* App); }; #endif // !__PANEL_PLAYPAUSE_H__
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; typedef pair<int, int> ii; int find(vector<ii> &V, int C) { if (V[C].first != C) { V[C].first = find(V, V[C].first); } return V[C].first; } void merge(vector<ii> &V, int I, int J) { ...
/* * Runnable.hpp * * Created on: Jun 24, 2018 * Author: yyhu */ #ifndef INCLUDE_RUNNABLE_HPP_ #define INCLUDE_RUNNABLE_HPP_ #include <iostream> #include <string> #include <sstream> #include "SLFException/SLFException.hpp" #include "BulkMem/BulkMem.hpp" namespace slf { class Runnable { public: typedef ...
// // Updatable.h // Boids // // Created by Yanjie Chen on 3/2/15. // // #ifndef __Boids__Updatable__ #define __Boids__Updatable__ namespace boids { class Updatable { public: virtual void updateFrame( float delta ) = 0; }; } #endif /* defined(__Boids__Updatable__) */
#include "ConditionCommand.h" int ConditionCommand::execute() { return 3; }
class Solution { public: int largestRectangleArea(vector<int>& heights) { stack<int> stk; int index = 0; int size = 0, maxSize = 0; heights.push_back(0); while(index < heights.size()) { if(stk.size() == 0 || heights[stk.top()] <= heights[index]) { ...
#include <stdafx.h> #include "CoorTransEquations.h" #include "Geometry.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif #define SIN_COS_ABNORMAL_LIMIT 1.02f // // 对给定x值的绝对值进行限制,使它的绝对值不超过fLimitValue。 // 注意,这里fLimitValue必须为正数。 // float LimitAbs(float x, f...
// This is an independent project of an individual developer. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com #include "number_solutions.hpp" using std::ostream; ostream& operator<< (ostream& out, number_solutions s) { switch (s) { ca...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
#include "DUIRenderEngine.h" #include "DUIDdb.h" DUI_BGN_NAMESPCE CDUIRenderClip::CDUIRenderClip(HDC dc, RECT& rtItem) { RECT rcClip = { 0 }; ::GetClipBox(dc, &rcClip); m_hRgnOld = ::CreateRectRgnIndirect(&rcClip); m_hRgnNew = ::CreateRectRgnIndirect(&rtItem); ::ExtSelectClipRgn(dc, m_hRgnNew, RGN_AND)...
// Game: Road Rage COPYRIGHT; // By the AAs (Abdullah Mehboob and Ain E Muhammad); // Copying this game's code will result on extreme punishments due to the law of copyright; #include <iostream> #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> #include <windows.h> #include <cstdl...
const int MAX_N = 10000; int prime[MAX_N]; bool is_prime[MAX_N + 1]; // number of primes below N int sieve(int n){ int p = 0; for (int i=0; i<=n; i++) is_prime[i]=true; is_prime[0] = is_prime[1] = false; for (int i=2; i<=n; i++){ if (is_prime[i]){ prime[p++] = i; for (int j=2*i; j<=n; j+=i) is...
#include <iostream> #include <stdlib.h> #include <time.h> #include <math.h> #include "inout.h" #include "wyarray.h" #include "proassign.h" using namespace std; class SolverAssDual { private: int niter; int inner; int iprint; int nx, nusr, nmsg; double lambda; double epsilon; double *w, *b; ...
#ifndef CONTROLLER_H #define CONTROLLER_H #include <QObject> #include "connectwindow.h" #include "clientlistwindow.h" #include "chatwindow.h" #include "Client.h" #include "connection.h" class Controller : public QObject { Q_OBJECT public: explicit Controller(QObject *parent = 0); signals: //Client window...
#include "FrameWnd.h" #include <errno.h> #include <stdlib.h> #include <string.h> #include<stdio.h> #include<algorithm>//因为用了sort()函数 #include<functional>//因为用了greater<int>() #include "D:\\code\\glib\\glib\\glib\\gstring.h" #include "D:\\code\\glib\\glib\\glib\\MemoryModule.h" #include "D:\\code\\glib\\glib\\glib\\glog...
/******************************************************************************** ** Form generated from reading UI file 'setting.ui' ** ** Created by: Qt User Interface Compiler version 5.11.2 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ******************************************...
/**************************************** * * INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE * Copyright (C) 2019 Victor Tran * * 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 Foundati...
// // Created by lijiaqian on 1/20/21. // #include <rclcpp/rclcpp.hpp> #include <geometry_msgs/msg/twist_stamped.hpp> #include <std_srvs/srv/trigger.hpp> #include <thread> #include <fstream> // moveit #include <moveit/planning_scene_interface/planning_scene_interface.h> #include <moveit/move_group_interface/move_group...
#include <graph/graph.hpp> #include <graph/graph_algorithms.hpp> #include "../catch.hpp" #include "fixture.hpp" #include <iostream> void printPath(std::size_t number_of_rows, std::size_t number_of_columns, float2 source, float2 destination, const std::vect...
/* * SortMergeJoin.cpp * * Created on: Jul 21, 2010 * Author: root */ #include "SortMergeJoin.h" #include "../EntityIDBuffer.h" #include "util/Timestamp.h" //#define MERGE_DEBUG SortMergeJoin::SortMergeJoin() { // TODO Auto-generated constructor stub //pool = new CThreadPool(THREAD_NUMBER); temp1 = (ID...
/* 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...
/* * Copyright: * Daniel D. Neilson (ddneilson@ieee.org) * University of Saskatchewan * All rights reserved * * Permission granted to use for use in assignments and * projects for CMPT 485 & CMPT 829 at the University * of Saskatchewan. */ #include "GL3/gl3w.h" #include <GL/glext.h> #include <GL/glfw.h> #in...
// // Created by Liang on 2019-08-24. // #include <vector> #include <algorithm> #include <iostream> #include <sstream> using namespace std; namespace { string int2string(int x){ stringstream ss; string string1; ss<<x; ss>>string1; return string1; } bool cmp_str(string...
#include <gtest/gtest.h> #include <libndgpp/algorithm/accumulate.hpp> TEST(noargs, test) { EXPECT_EQ(0, ndgpp::accumulate()); } TEST(sumzero, test) { EXPECT_EQ(0, ndgpp::accumulate(1, -1)); } TEST(boolsum, test) { EXPECT_EQ(2, ndgpp::accumulate(true, true)); } TEST(negative, test) { EXPECT_EQ(-2, n...
// Copyright (C) 2017 Elviss Strazdins // This file is part of the Ouzel engine. #pragma once #include "math/Vector2.h" namespace ouzel { class Size3; class Size2 { public: float v[2]; Size2() { v[0] = 0.0f; v[1] = 0.0f; } Size2(float...
#ifndef GPUPROGRAMGL_H #define GPUPROGRAMGL_H #include "renderer/ShaderProgram.h" #include "renderer/ShaderType.h" #include "renderer/gl/UniformGL.h" namespace revel { namespace renderer { namespace gl { class ShaderProgramGL : public ShaderProgram { public: ShaderProgramGL(const std::string& vs, const std::stri...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
// // Created by Wesley Moncrief on 4/9/16. // #ifndef RAYTRACING_PLANE_H #define RAYTRACING_PLANE_H #include <iostream> #include <vector> #include "Point.h" #include "Pixel.h" #include "Ray.h" #include "Color.h" #include "LightSource.h" #include "Shape.h" #include "Sphere.h" class Plane : public Shape { doubl...
// BinocularDlg.h : 头文件 // #pragma once #include "afxwin.h" //自定义的 相机类 #include "Camera.h" //自定义的 投影仪类 #include "Projector.h" #include <string> #include "afxeditbrowsectrl.h" #define CAM_FINDER_TIMER_ID 1 //用于动态发现是否有相机接入/拔出的TIMER #define CAM_FRAMERATE_GET_ID 2 //用于动态获得相机图像张数的TIMER #define PROJ_FINDER_TIMER_...
#pragma once #include <glm/glm.hpp> #include <vector> void TransformVector(std::vector<glm::vec3>& vertices, const glm::mat4x4& transform); void TransformVector(std::vector<glm::vec4>& vertices, const glm::mat4x4& transform);
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QFileDialog> #include <QMessageBox> #include <QHBoxLayout> #include <QSlider> #include <iostream> #include "viewer.h" extern "C" { #include "callbacks.h" } #include "processor.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(...
#ifndef POINTSVIEWMODEL_H #define POINTSVIEWMODEL_H #include <QAbstractTableModel> #include "route.h" class PointsViewModel : public QAbstractTableModel { Q_OBJECT public: PointsViewModel(Route* route = nullptr, QObject* parent = nullptr); int rowCount(const QModelIndex &parent = QModelIndex()) const ove...
#include "CEGUI/String.h" #include "CEGUI/GeometryBuffer.h" #include "CEGUI/Texture.h" #include "CEGUI/TextureTarget.h" #include "CEGUI/GUIContext.h" #include "CEGUI/RendererModules/Ogre/Renderer.h" #include "CEGUI/RendererModules/Ogre/ResourceProvider.h" #include "CEGUI/RendererModules/Ogre/ImageCodec.h" namespace O...
#include <cassert> #include <string> #include <cstring> #include <iostream> #include <fstream> #include <sstream> #include <vector> #include <unistd.h> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/core/utility.hpp> #include "TensorSSD.hpp" using namespace std; ICudaEngine* TensorSSD::engine; IRuntime* Te...
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); connect(ui->btnGuardar,SIGNAL(clicked()),this,SLOT(openDisplay())); } MainWindow::~MainWindow(){ delete ui; } void MainWindow::openDisplay(...
/* * SPDX-FileCopyrightText: 2020 Rolf Eike Beer <eike@sf-mail.de> * * SPDX-License-Identifier: GPL-3.0-or-later */ #pragma once #include <osm.h> #include <QAbstractTableModel> #include <string> #include <vector> class TagModel : public QAbstractTableModel { Q_OBJECT Q_DISABLE_COPY(TagModel) osm_t::TagMa...
#include "Item.h" Item::Item(const char* textureFile, uint x, uint y) : super(textureFile, x, y) { m_Behavior = BehaviorManager::getInstance().getBehavior(std::string(textureFile, 1)); } void Item::trigger(Player& player) { m_Behavior(player); } Item::~Item() { }
#include "Despesa.h" #include "ControleDeGastos.h" #include <iostream> #include <string> #define MAX 10 using namespace std; //g++ SistemaDeControleDeGastosDeMesada.cpp ControleDeGastos.cpp Despesa.cpp int main(){ double vl; string tg; int sair; Despesa d; int i; ControleDeGastos c; cout << " Si...
#include<bits/stdc++.h> using namespace std; int sum(int n) { int sum1=0; while(n>0) { sum1+=n%10; n=n/10; } return sum1; } int main() { int n; cin>>n; int x=0; while(n) { x++; if(sum(x)==10) { n--; } } cout<<x...
#include "Utility.h" #include "Node.cpp" #include "Lists.cpp"
#include "GLContext.h" #include <GL/GL.h> #include "GL/glext.h" #include "GL/wglext.h" struct SAppContext { SAppContext() { hdc = NULL; context = NULL; wglChoosePixelFormatARB = NULL; } HDC hdc; HGLRC context; PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB; }; GLContext::GLContext(const HWND& HWn...
// -*- 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...
#include "Gyroscope.h" #include "cppcompat.h" #include "I2COp.h" Gyroscope::Gyroscope(I2CController* i2c, bool sdo) : RegisterDevice(i2c, GYRO_ADDR_BASE | sdo) { I2COp* reset = new I2COp(addr, true, 2); reset->data.enqueue(GYRO_REG_CTRL_REG5); reset->data.enqueue(0x80); // reboot memory content i2c->p...
#include "Pawn.h" #include "ChessBoard.h" void Pawn::Initialize(sf::Color PlayerColor, sf::Vector2f Position) { sf::String fileName = "../Resources/PawnTexture_"; fileName += (PlayerColor == sf::Color::Black ? "black.png" : "white.png"); // Load texture, set it to the sprite and set what part of the sprite sheet ...
#pragma once #ifndef __INC_PLANE_H_ #define __INC_PLANE_H_ #include "Point.h" #include <string> namespace MathsLib { class Matrix4x4; class Vector3; /** A plane is mathematical set of points in 3-dimensional euclidean space. Points satisfy the equation: A*x + B*y + C*z + D = 0. @par The plane is descr...
#include "device.h" // Device header #include "shape.h" #include "colors16bit.h" #include "font.h" #ifndef SSTRING_H #define SSTRING_H class Sstring : public Shape { private: uint16_t x, y, color, fon; char * str; Font * font_; uint8_t interval, nChar; public: Sstring (uint16_t x_, uint16_t y_, ui...
#include <stdint.h> #include "interface.hh" #include <bitset> #include <vector> #include <cstdio> using std::vector; struct PrefetchDecision { explicit PrefetchDecision() : prefetchAddresses() { /*empty */} explicit PrefetchDecision(const std::vector<Addr> &addrs) : prefetchAddresses(addrs) { /* empty */ } ...
#include "../headers/Profiling.h" #include <gmock/gmock.h> TEST(nuskaitymas, ns){ vector<Studentas> studentai; Studentas *k; std::ifstream fd; try { fd.open( "test.txt", std::ios::in); if (!fd.good()) throw "Error opening file"; } catch (string &e){ cout << e << endl; ...
/*************************************************************************** Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. 2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD FileName: OSBufferPool.h Description: Provide fast access to fixed size buffers, used in RTPPacketRese...
/* * add.h */ #ifndef ADD_H_ #define ADD_H_ #include <string> #include <stdio.h> #include <stdlib.h> #include <iostream> using namespace std; BigInteger gcd(BigInteger a, BigInteger b); BigInteger modPow(BigInteger base, BigInteger exp, BigInteger modulus); BigInteger modInv(BigInteger a, BigInteger b); BigInteg...
#ifndef ADMINSERVICE_H #define ADMINSERVICE_H #include "AdminRepository.h" #include "DrinkRepository.h" #include "SideDishRepository.h" #include "ToppingRepository.h" #include "ComboRepository.h" class AdminService { public: AdminService(); void add_drink_to_drinklist(); void remove_drink_from_drinklist()...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
#include "Board.h" #include <queue> void Board::initializeCells() { const uint32_t piecesPerPlayer = (boardSize * boardSize - 2 * boardSize) / 4; uint32_t counter = 0; for (size_t i = 0; i < boardSize && counter < piecesPerPlayer; i++) { for (size_t j = 0; j < boardSize && counter < piecesPerPlayer; j++) { ...
#include <cstdlib> #include <string> #include <iostream> #include "CinemaSimulation.h" CinemaSimulation::CinemaSimulation(int len, int timeBetweenPeople): simulationLen(len), timeBetweenPeople(timeBetweenPeople), incomingPeopleCountdown(timeBetweenPeople), tickets(30), popcorn(90), glasses(15) {...
//----------------------------------------------------------------------------- // VST Plug-Ins SDK // VSTGUI: Graphical User Interface Framework for VST plugins // // Version 4.2 // //----------------------------------------------------------------------------- // VSTGUI LICENSE // (c) 2013, Steinberg Media Technologi...
#include <memory> #include <mutex> #include <ostream> #include <vector> #include <string> #include <gazebo/common/Events.hh> #include <gazebo/physics/Collision.hh> #include <gazebo/physics/Contact.hh> #include <gazebo/physics/ContactManager.hh> #include <gazebo/physics/Joint.hh> #include <gazebo/physics/Link.hh> #inclu...
// 2. sum関数を実装しよう! // 関数名はsum_array(配列) // 戻り値は合計 // 最初にデータ数Nを入力し // N個分のデータを入力し合計を表示せよ #include <iostream> int sum_array(int a[]){ int i=0,go=0; while(a[i] != NULL){ go += a[i]; i++; } return go; } int main(){ // insert code here... //std::cout << "Hello, World!\n"; in...
/* 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 RETVAL_INSTRUCTION_H #define RETVAL_INSTRUCTION_H #include "assigni.h" #include "varregister.h" #include "../visitors/codevisitor.h" #include <string> using namespace std; /** * A Return Value instruction is usually generated after a CALL instruction * to load the return value of a function into a registe...
#include "gui.hpp" bool purriGUI::GUI::freeInteractable(purriGUI::Interactable* interactable) { if(interactable == nullptr) { std::cerr << "Error in purriGUI::GUI::freeInteractable(): null pointer inserted into function!\n"; return false; } purriGUI::Interactable* interactablePointer = int...
#include <chrono> #include <stdio.h> #include <stdlib.h> #include <iostream> #include <thread> #include <vector> #include <fstream> #include <Windows.h> #include <iomanip> #define SIZE 1000 #define THREAD_SLEEP 10 typedef std::chrono::high_resolution_clock Clock; typedef std::chrono::duration<double, std::milli> milli...
// // Created by Peter Chen on 5/29/16. // #ifndef CUBEWORLD_MANHATTAN_H #define CUBEWORLD_MANHATTAN_H class Manhattan { }; #endif //CUBEWORLD_MANHATTAN_H
#include<iostream> #include<string> #include<vector> using namespace std; class Solution { public: bool isMatch(string s, string p) { if (p.empty()) return s.empty(); if ('*' == p[1]) // x* matches empty string or at least one character: x* -> xx* // *s is to ensure s is non-empty return ( ...
 /// @file src/pt/Assign.cc /// @brief Assign の実装ファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2005-2011 Yusuke Matsunaga /// All rights reserved. #include "Assign.h" #include "PtMgr.h" BEGIN_NAMESPACE_YM_BB // @brief 新しい代入文を追加する. void PtMgr::new_assign(const FileRegion& file_region, ymuint ...
// Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "master/availability.h" #include <string> #include <gflags/gflags.h> #include <glog/logging.h> #include "common/base/string_ext.h" #include "com...
#include "kernel.h" #include <iostream> #include <vector> #include <algorithm> #include <chrono> #include <opencv2/opencv.hpp> #include <opencv2/cudaarithm.hpp> using namespace std; using namespace cv; int main() { try { Mat src = imread("Lenna.png", CV_LOAD_IMAGE_GRAYSCALE); Mat brightness = adjust_brightness(s...
// Copyright (c) 2015 University of Szeged. // Copyright (c) 2015 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 "sprocket/browser/javascript_dialog_manager.h" #include "base/strings/utf_string_conversions....
#ifndef POINT2D_INCLUDE_GUARD_H #define POINT2D_INCLUDE_GUARD_H 1 #include "Vector2d.h" class Point2d { public: double x; double y; Point2d (double x, double y); Point2d (); void applyVector(Vector2d &v); double distanceFrom(const Point2d &p); }; #endif
#include <xmorphy/build/PhemDict.h> namespace X { const std::string PhemDict::MAIN_PHEM = "_m"; const std::string PhemDict::FORWARD_PHEM = "_f"; const std::string PhemDict::BACKWARD_PHEM = "_b"; bool PhemDict::contains(const utils::UniString & word) const { return dict->contains(word.toUpperCase().getRawString())...
// // 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 <nbdl/catch.hpp> #include <nbdl/pipe.hpp> #include <nbdl/run_async.hpp> #include <boost/hana.hpp> #include <catch.hpp>...
#include <cassert> #include "IBaseCloud.hpp" #include "IBaseSim.hpp" #include "CRucio.hpp" IBaseSim::IBaseSim() = default; IBaseSim::~IBaseSim() = default; void IBaseSim::Run(const TickType maxTick) { mCurrentTick = 0; while(mCurrentTick<=maxTick && !mSchedule.empty()) { std::shared_ptr<CSchedu...
#include<bits/stdc++.h> using namespace std; int main(){ int t; scanf("%d", &t); int rs, ps, ss, a, b, c; int n; char s[1000]; while(t--){ scanf("%d", &n); scanf("%d %d %d",&a, &b, &c); scanf("%s", s); rs = 0; ss = 0; ps = 0; for(int i = 0; i < strlen(s); i++){ if(s[i] == ...