text
stringlengths
8
6.88M
#include <stdio.h> #include <conio.h> #include <Windows.h> #include <stdlib.h> #include <cstdlib> #include <iostream> #include <locale.h> #include <string> #include <iomanip> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; int menu_task(); int menu_save(); int menu_1(); int main(); char...
#ifndef GAMESTRUCT_H #define GAMESTRUCT_H #include "entities/actor.h" #include "json11/json11.hpp" #include "ui/targetwidget.h" #include "entities/environment.h" #include "game/entities/self.h" #include <vector> namespace gamestruct { void set_self(const json11::Json &); Self * self(); std:...
#include <bits/stdc++.h> using namespace std; int main() { int N = 100; int number; pair<int,int> result; for(int i = 1; i <= 100; i++){ cin >> number; if(i == 0) { result.first = number; result.second = i; } if(number > result.first) ...
#pragma once #include<iostream> #include<string> #include<vector> #include<set> #include"Film.h" using namespace std; class Personal { protected: string cnp; string nume; Film film; static int procent; public: Personal(); Personal(string cnp, string nume, string nume_film...
#include <iostream> #include <string> #include <vector> #include <math.h> #include "utils.h" // Linear hash table implementation table class HashTable { private: int maxSize; std::string *table; int numStrings; public: unsigned long int insertString(const std::string key); int getSize(); void setSize(const i...
#include "CylinderMesh.h" CylinderMesh::CylinderMesh(unsigned int param1, unsigned int param2, float param3) : Mesh(param1, param2, param3) { update(); } CylinderMesh::~CylinderMesh(){ } void CylinderMesh::update() { unsigned int s = m_param2; unsigned int t = m_param1+2; float r = ...
#ifndef EVENT_HPP_INCLUDED #define EVENT_HPP_INCLUDED #include "Packet.hpp" #include "Peer.hpp" /** * Holds all relevant data of the according ENetEvent. */ struct Event final { /** * The type of the Event, maps to an ENetEventType. */ enum class Type : Uint16 { ...
// // Compiler/AST/StatementReturn.h // // Brian T. Kelley <brian@briantkelley.com> // Copyright (c) 2014 Brian T. Kelley // // This software is licensed as described in the file LICENSE, which you should have received as part of this distribution. // #ifndef COMPILER_AST_STATEMENTRETURN #define COMPILER_AST_STATEMENTR...
#ifndef CIRCULARBUFFER_H #define CIRCULARBUFFER_H #include <stdint.h> //****************************************************************************// // // Circular Buffer // //****************************************************************************// //Class CircularBuffer is int16_t //Does not care about over...
#include <iostream> #include <gl/glut.h> #include <cmath> #include <vector> #include <string> using std::vector; using std::pair; using std::string; void draw_line(float x, float y, float x1, float y1); float pi = 3.14/2; float t = 0; float precision = 0.025; float lx = -0.2f, lz = -1.0f, ly = 0.0f; // XZ position of...
#include "I2CBuffer.h"
#include<iostream> using namespace std; int main() { int number=57; cout<<"after post increment by 1: " << number++<<endl; cout<<"after pre increment by 1: " << ++number<<endl; number +=1; cout<<"after increasing the number by 1: "<<number<<endl; number--; cout<<"after post decrement by 1: " << number<<endl...
//************************************************************************************// //* - GrowWorkingHard'script - www.growworkinghard.wordpress.com - *// //************************************************************************************// // ...
#include "productionview.h" #include <QApplication> #include "presenter.h" #include "route.h" #include "model.h" #include "routesviewmodel.h" #include "pointsviewmodel.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); Model model; ProductionView view; view.setUpTables(&model.getRoute...
/* * Copyright (C) Mellanox Technologies Ltd. 2019. ALL RIGHTS RESERVED. * See file LICENSE for terms. */ #include "jucx_common_def.h" #include "org_openucx_jucx_ucp_UcpContext.h" extern "C" { #include <ucp/core/ucp_mm.h> } /** * Bridge method for creating ucp_context from java */ JNIEXPORT jlong JNICALL Java_or...
#include <iostream> #include <fstream> #include <map> #include <vector> struct mpint { std::vector<int> digits; mpint(int s) { while (s > 0) { digits.push_back(s % 10); s /= 10; } } mpint(const struct mpint &a) { for (size_t d = 0; d < a.digits....
/*************************************************************************** Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. 2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD FileName: RunServer.cpp Description: define the mian entry functions to run the Streami...
#include<cstdio> #include<iostream> #include<cstring> using namespace std; long long n = 1; int main() { int x,t = 1; cin >> x; while(n) { if(n % x == 0) { printf("%lld %d",n/x,t); break; } else { n = n*10+1; t++; ...
#include<bits/stdc++.h> using namespace std; int main(){ string A,Q=""; int B,R=0; cin>>A>>B; for(char a:A){//大整数除法 R=R*10+a-'0'; Q+=R/B+'0'; R%=B; } while(!Q.empty()&&Q.front()=='0')//删除Q首部的'0' Q.erase(Q.begin()); printf("%s %d",Q.size()==0?"0":Q.c_str(),R);/...
#define _CRT_SECURE_NO_DEPRECATE #include <stdio.h> #include <iostream> #include <opencv/cv.h> #include <opencv/highgui.h> #include <opencv2/features2d/features2d.hpp> #include <opencv2/nonfree/nonfree.hpp> #include "opencv2/nonfree/features2d.hpp" #include <dirent.h> #include <sys/types.h> #include "mysql_connection....
#ifndef __SEARCH__AUTHOR__HPP____ #define __SEARCH__AUTHOR__HPP____ #include "search.hpp" #include <string> using namespace std; class Search_Author :public Search { private: string author; public: Search_Author(const string& author) : author(author) {} Book* search(vector<Book*> books) { for (int i = 0; i < bo...
// // Created by 邓岩 on 2018/11/25. // # include <iostream> # include <vector> # include <algorithm> # include <numeric> using std::cout; using std::endl; int main(void) { std::vector<int> x(12); std::iota(x.begin(),x.end(),18); std::vector<int> z(12); std::vector<double> y = {76.1, 77, 78.1, 78.2, 7...
#ifndef TTC_H_ #define TTC_H_ #include <iostream> #include <math.h> #include <map> #include <deque> #include <Eigen/Core> #include <Eigen/Dense> #include"Object.h" // #include "opencv2/imgproc/imgproc.hpp" // #include "opencv2/highgui/highgui.hpp" #include<iomanip> #define TTCTRACKINGFRAMES 11 #define VEHICLEWIDTH 1....
#pragma once #include <string> #include <vector> //todo 如何通过反射注册消息事件?? class RegitsteredEvents { public: static const std::string GOLD_CHANGED; static const std::string SHOW_RESTART; static const std::string GAME_OVER; static const std::string GAME_START; static const std::string GAME_RESTART; };
/** * @file forwarder.cpp * @author dvv <dvv@avauntguard.com> * @brief A forwarder to replay packet to DNS server * @test: dig @192.168.230.83 -p 10053 newsletterupdatecenterline.com */ #include "forwarder.h" namespace screenDNS { // New Reader object when initialize forwarder forwarder::forwarder...
#include <bits/stdc++.h> using namespace std; //initial height is always 1 //this method finds height after n years(ie n cycles) int findH(int n){ int iniH = 1; //given, always 1 for(int i=0;i<n;i++){//for each cycle if(i%2==0){ //grows double in first cycle iniH *= 2;} else{ ...
#include <sstream> #include <gtest\gtest.h> #include "..\..\lib\geometry\vector.h" using namespace j::math; // // Vector2DTests // TEST(Vector2DTests, Constructors) { vec2i vec_default; vec2i vec_xy(3, 5); vec2i vec_copy(vec_xy); EXPECT_EQ(vec_default, vec2i(0, 0)) << "Default constructor did not initialize c...
#pragma once #include "TDataTypes.h" class BCollisionBody { public: BCollisionBody(class BThing* InOwner); virtual ~BCollisionBody(); TArray<class BPrimitive*> Primitives; class BThing* Owner; virtual TVector3 LineCheck(TVector3& Start, TVector3& End, TVector3& Extent) = 0; };
#include <cstring> #include "LibSVM.h" using namespace std; namespace LibSVM { #pragma region Node Node endOfNode() { Node n; n.index = -1; return n; } #pragma endregion #pragma region NodeArray NodeArray::NodeArray() : nodes(nullptr) { setupTail(); } NodeArray::NodeArray(const...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.UI.Composition.Effects.1.h" #include "Windows.Graphics.Effects.1.h" WINRT_EXPORT namespace winrt { namespace Windows::UI::Composition::Effects { struct ISceneLightingEffect...
/** * @file C18TraversalTest.h * @author S. Seckler * @date 10.01.2019 */ #pragma once #include <gtest/gtest.h> #include "AutoPasTestBase.h" #include "autopas/AutoPas.h" #include "mocks/MockFunctor.h" #include "testingHelpers/GridGenerator.h" #include "testingHelpers/commonTypedefs.h" class C18TraversalTest : pu...
// Copyright 2020-2021 Russ 'trdwll' Treadwell <trdwll.com>. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Steam.h" #include "SteamEnums.h" #include "SteamStructs.h" #include "UObject/NoExportTypes.h" #include "SteamMusicRemote.generated.h" DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnMusicPlayerRem...
/* * Automat.cpp * */ #include "Automat.h" /** * Neuen Automaten generieren */ Automat::Automat() { lastAcceptingState = Token::null; currentState = Token::START; numSteps = 0; for (int i = 0; i < tableSize; i++) { for (int j = 0; j < tableSize; j++) { uebergang[i][j] = Token::VOID; } } uebergang[...
/* * File: Buffer.h * Author: Leonardo * * Created on 5 de Agosto de 2015, 18:34 */ #ifndef BUFFER_H #define BUFFER_H #define TAM_CODE 256 #define TAM_TYPES 7 #define NUM_CIDADES 6 #define HOURS 7 #include <math.h> #include <iostream> #include "Eventos2.h" typedef bool bit; using std::string; ...
#include "stdafx.h" using namespace cv; bool getPosition(Point2f& head, Point2f& tail){ extern VideoCapture cap; extern Mat BGRImage, rotated, transmat, frame; extern std::vector<int> BGRthreshold, HSVthreshold; #ifdef camera cap >> frame; #else frame = imread("car.jpg"); #endif warpPerspective(fra...
#include "type.h" Type::Type(ValueType valueType) { this->type = valueType; this->paramNum = 0; this->dim = 0; } string Type::getTypeInfo() { return getTypeInfo(this->type); } string Type::getTypeInfo(ValueType type) { switch(type) { case VALUE_BOOL: return "bool"; cas...
#include "Normal.h" #include"Bombas.h" #include"Item.h" #include"Jugador.h" Normal::Normal(){ } Normal::Normal(int x,int y,char letra):Bombas(x,y,letra){ setAlcance(); } void Normal::setAlcance(){ srand(time(NULL)); alcance=rand()% 4+1; } int Normal::getAlcance(){ return alcance; } void Normal::Explota(Item***& ma...
#include <string> #include "neural.h" #include <jni.h> #include <cmath> #include <android/log.h> static NeuralNetwork *n = NULL; extern "C" { void Java_com_mycompany_myndkapp_Neural_newNeuralNetwork(JNIEnv *env, jobject clazz, jlong time){ if(n != NULL){ delete n; } n = new NeuralNetwork(time); } ...
#include <iostream> using namespace std; template <typename T> T midpoint (T a, T b) { return (a + b)/2; } int main() { cout << midpoint('a', 'c') << endl; cout << midpoint(10, 20) << endl; return 0; }
#include "stdafx.h" #include "LineMatchPair.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif /////////////////////////////////////////////////////////////////////////////// // // 根据此直线匹配对生成用于“最小二乘法”的参数。 // 最小二乘法的矩阵形式为 A*X = B,本函数将生成A矩阵中的两行及B列向量中的两行。 // bool CLine...
// github.com/andy489 #include<iostream> #include<vector> using namespace std; const int MAX = 1024; vector<pair<int, int>> w[MAX]; int o[MAX]; int find(int a) { if (a == o[a]) return a; return o[a] = find(o[a]); } void uni(int a, int b) { o[find(a)] = find(b); } int main() { int n, m; cin >> n >> m; while (m...
#define IRkiri_depan A5 #define IRkanan_depan A4 #define echoPinKiri 6 #define echoPinKanan 9 #define trigPinKiri 7 #define trigPinKanan 8 #define buzzer A0 #define button_jalan 12 #define button_counter 4 #define CLK 2 #define DIO 3 #define COLUMN 3 #define ROW 3 #include <Servo.h> #include <TM1637Display.h> Servo k...
/* * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 applica...
/*********************************************************** // OOP244 Workshop 8: Virtual Functions // File SavingsAccount.h // Version 1.0 // Date July. 17, 2019 // Author Nilan Patel // Student Number: <038 908 117> // Section SEE // Description // // // // Revision History /////////////////////////////...
/* * LOCVException.hpp * * Created on: Aug 7, 2018 * Author: yyhu */ #ifndef INCLUDE_SLFEXCEPTION_SLFEXCEPTION_HPP_ #define INCLUDE_SLFEXCEPTION_SLFEXCEPTION_HPP_ #include <exception> #include <iostream> #include <sstream> #include <boost/exception/all.hpp> #include <boost/shared_ptr.hpp> #define EXCEPTI...
#pragma clang diagnostic push #pragma clang diagnostic ignored "-Wcovered-switch-default" #pragma clang diagnostic ignored "-Wsign-compare" #pragma clang diagnostic ignored "-Wdeprecated" #pragma clang diagnostic ignored "-Wshift-sign-overflow" #include <gtest/gtest.h> #pragma clang diagnostic pop #pragma clang diagnos...
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long int main() { ll m,n,t,b,c,d,...
#include <bits/stdc++.h> using namespace std; struct Point { double x; double y; }; void print(Point p) { cout << &p << endl; } void print1(Point* p) { cout << &p << endl; } int main() { Point t; t.x=5; t.y=4; print(t); print1(&t); }
/*********************************************************************** created: 25/4/2004 author: Paul D Turner purpose: Interface for a Titlebar Widget *************************************************************************/ /******************************************************************...
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Name: Braydon Hampton // File: main.cpp //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include <iostream> #include "Fraction.h" void test_Fraction_print() { int n = 0, d = 0; // num and denom of fra...
/* * 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 FLUX_FILE_H #define FLUX_FILE_H #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <fcntl.h> #include <flux/String> #include <flux/Sy...
#include<bits/stdc++.h> using namespace std; bool ispossible(int rx,int ry,int m,int n) { if(rx < 0 || rx>=m || ry <0 || ry>=n) { return false; } return true; } bool helper(char** arr,string search,int cur_index,int x,int y,int m,int n,int ax,int ay) { if(cur_index==search.size()) { return true; } if(is...
//Sender Shepard //Algorithms in C++ // //Main program which will run both mergesort and quicksort. //In this program the creation of an unordered array is performed through //the creater_Array function. Thereafter, the sorting algorithms are //executed. The resulting array is then tested with the test function. //Th...
#pragma once #include "Colors.h" #include <string> #include "RectI.h" class Surface { private: int width; int height; Color* pColor; public: Surface(int width_in, int height_in); Surface(std::string filename); Surface(const Surface& rhs); Surface& operator = (const Surface& rhs); ~Surface(); int getWidth()...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "../base.h" #include "Windows.Perception.Spatial.0.h" #include "Windows.Foundation.0.h" #include "Windows.Foundation.Collections.0.h" #include "Windows.Perception.0.h" #include "Window...
#ifndef NEW_STRATEGY_1_VIDEOMODE_HPP #define NEW_STRATEGY_1_VIDEOMODE_HPP #include <SFML/Graphics.hpp> class VideoMode { public: VideoMode() = default; VideoMode(unsigned int modeWidth, unsigned int modeHeight, unsigned int modeBitsPerPixel = 32); ~VideoMode() = default; bool isValid() const; fri...
#ifndef GAME_H #define GAME_H #include "common.h" using namespace sfEngine; //Global variables FileSystem gFilesystem; //sfEngine::Renderer *gRenderer; class Game : public IManager<Game> { Game::Game(); Game::~Game(); //Create systems void Game::InitSys() { //gFilesystem.Init(); //gFilesystem.Instance()...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "Enemy.generated.h" class UBoxComponent; class UStaticMeshComponent; class AFPSCharacter; class AMainGameMode; UCLASS() class TEST_API AEnemy : public AActor...
#include "DUIMenu.h" #include "DUIRenderEngine.h" #include "DUIPopupWindow.h" #if defined (_MSC_VER) && (_MSC_VER <1300) #include <multimon.h> // DUIPopupMenuWindow.cpp have defined the STUB #else #if WINVER < 0x0500 #define COMPILE_MULTIMON_STUBS #include <multimon.h> #endif // WINVER < 0x0500 #endif #de...
#ifndef __ModulePlayer2_H__ #define __ModulePlayer2_H__ #include "Module.h" #include "Animation.h" #include "Globals.h" #include "p2Point.h" #include "p2Qeue.h" #include "ModuleInput.h" #include "SDL/include/SDL_timer.h" struct SDL_Texture; class ModulePlayer2 : public Module { private: Uint32 speed = 2; int anim...
struct ListNode { int m_nValue; ListNode* m_pNext; }; ListNode* ReverseList(ListNode *pHead) { ListNode* pReversedHead=nullptr; ListNode* pNode=pHead; ListNode* pPrev=nullptr; while (pNode!=nullptr) { ListNode* pNext=pNode->m_pNext; if(pNext==nullptr) pReversedHe...
/* * Clase que permite manejar el mapa * (trabaja con archivos de extension "pbm"). * INF-134 Estructuras de Datos */ #ifndef MAP_H_ // Comprueba si la etiqueta no esta definida #define MAP_H_ // Crea una bandera en tiempo de compilacion #include <fstream> // Biblioteca para las operaciones con archivos #in...
// This file has been generated by Py++. #include "boost/python.hpp" #include "generators/include/python_CEGUI.h" #include "Workarounds.pypp.hpp" namespace bp = boost::python; void register_Workarounds_class(){ { //::CEGUI::Workarounds typedef bp::class_< CEGUI::Workarounds > Workarounds_exposer_t; ...
/** * Copyright 2017 * * This file is part of On-line POMDP Planning Toolkit (OPPT). * OPPT is free software: you can redistribute it and/or modify it under the terms of the * GNU General Public License published by the Free Software Foundation, * either version 2 of the License, or (at your option) any later ver...
//************************************************************************** //** //** See jlquake.txt for copyright info. //** //** This program is free software; you can redistribute it and/or //** modify it under the terms of the GNU General Public License //** as published by the Free Software Foundation; either ...
#ifndef _I_PRODUCT_H_ #define _I_PRODUCT_H_ // Workshop 7 - STL Containers // iProduct.h #include <iostream> #include <fstream> #include <iomanip> namespace w7 { class iProduct { public: virtual double getCharge() const = 0; virtual void display(std::ostream&) const = 0; }; ...
#include "core\Singularity.Core.h" using namespace Singularity; using namespace Singularity::Threading; using namespace Singularity::Components; namespace Singularity { #pragma region Constructors and Finalizers Game::Game() { ULONG HeapFragValue; // Use low fragmentation heap HeapFragValue = ...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "base.h" WINRT_WARNING_PUSH #include "internal/Windows.Storage.3.h" #include "internal/Windows.Foundation.3.h" #include "internal/Windows.Storage.Streams.3.h" #include "internal/Windo...
/// \file node.hpp /// /// \author Chun-Hsu Lai /// /// \date 2020/01/15 #ifndef NODE_HPP_ #define NODE_HPP_ #include "typedef.hpp" #include <iostream> class Node { public: explicit Node(std::string _name): sub_ptr_(nullptr), pub_ptr_(nullptr), name_(_name) {}; void RegSubscriber(const std::strin...
/* 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...
// Group: The Powers (Karim, Jibran, Viktor) // Date: Apr 16, 2019 #include <iostream> #include "Section.h" #include "VehicleBase.h" Section::Section() { // all will be set by default to false or NULL this->forwardSection = nullptr; this->rightSection = nullptr; this->vehicle = nullptr; this->right ...
// Copyright ⓒ 2020 Valentyn Bondarenko. All rights reserved. #pragma once namespace be { namespace utils { class Color { public: explicit Color(float red = 1.0f, float green = 1.0f, float blue = 1.0f, float alpha = 1.0f) : r(red), ...
#include<iostream> using namespace std; #include "swap.h" // //函数分文件编写,让代码更清晰 // 1. .h头文件中写函数的声明 // 2. .cpp源文件中写函数的定义 // //函数声明 // void swap(int a ,int b); int main() { swap(1,2); return 0; } // //函数定义 // void swap(int a ,int b) // { // int t = a; // a = b; // b = t; // cout<<a<<" "<<b<...
#pragma once ref class FirmwareCommand { public: FirmwareCommand(void); property String^ Name { String^ get() { return _name; } void set( String^ Name ) { this->_name = Name; } } property String^ Description { String^ get() { return _description; } void set( String^ Description )...
/* * Copyright Regents of the University of Minnesota, 2017. This software is released under the following license: http://opensource.org/licenses/ * Source code originally developed at the University of Minnesota Interactive Visualization Lab (http://ivlab.cs.umn.edu). * * Code author(s): * Dan Orban (dtorban)...
#include<cstdio> #include<algorithm> #define MAXN 100005 using namespace std; struct node{ int add,data,next; int order; }mylist[MAXN]; bool cmp(node a, node b){ return a.order < b.order; } void reverlist(int first, int k){ int low = first; int high = first + k - 1; while(low < high){ ...
#include "span/io/streams/SocketStream.hh" #include <vector> #include "span/exceptions/Assert.hh" #include "span/io/streams/Buffer.hh" #include "span/io/Socket.hh" namespace span { namespace io { namespace streams { SocketStream::SocketStream(span::io::Socket::ptr socket, bool own) : socket_(socket), own...
class FreqStack { public: FreqStack() { } void push(int val) { maxFreq = max(maxFreq, ++freq[val]); // update maxFreq m[freq[val]].push_back(val); // } int pop() { int x = m[maxFreq].back(); // pop the most recent one m[maxFreq].pop_back(); --freq[x]; /...
#ifndef _ERROR_GENERATOR_H_ #define _ERROR_GENERATOR_H_ #include "CAN_interface.h" #include "proto_def.h" #include <map> #include <vector> class CErrorGenerator { public: CErrorGenerator( systems_t system, C_CAN_CHANNELL * chan ){ _system = system; _chan = chan; } void process_500ms( void ); bool isError( cons...
#pragma once template <typename T> T Max(T _A, T _B) { return _A > _B ? _A : _B; } template <typename T> T Min(T _A, T _B) { return _A < _B ? _A : _B; } template <typename T> T Clamp(T _value, T _A, T _B) { return _A < _B ? Min(Max(_value, _A), _B) : Min(Max(_value, _B), _A); }
#include "SoXipBitmapFont.h" #include <Inventor/fields/SoSFEnum.h> #include <Inventor/nodes/SoNode.h> #include <Inventor/nodes/SoTranslation.h> #include <Inventor/fields/SoMFColor.h> #include <Inventor/fields/SoSFString.h> #include <Inventor/sensors/SoTimerSensor.h> #include <xip/inventor/overlay/SoXipText2.h> #inclu...
// // PartyVideoDJ - YouTube crossfading app // Copyright (C) 2008-2017 Michael Fink // /// \file IPlaylist.hpp Interface to playlist // #pragma once /// type for video id's typedef int T_VideoId; class IPlaylist : public boost::noncopyable { public: virtual ~IPlaylist() throw() {} /// returns current playlist...
#ifndef _MATRIX4_H #define _MATRIX4_H #include "geomath.h" #include <assert.h> class Matrix4 { private: float m_data[16]; public: Matrix4(); Matrix4(float mat[16]); Matrix4(float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22,...
#include<bits/stdc++.h> using namespace std; int main(){ long n,k; int t; cin>>t; while(t--){ cin>>n>>k; long r = n%k; long d = n/k; long add =0; if(r==0){ cout<<n<<"\n"; continue; } if(r>(k/2)){ add = k/2; }else{ add = r; } long total = d*k + add; cout<<total<<"\n"; } return...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.ApplicationModel.Contacts.1.h" #include "Windows.Foundation.1.h" WINRT_EXPORT namespace winrt { namespace ABI::Windows::Foundation { #ifndef WINRT_GENERIC_cdb5efb3_5788_509...
#pragma once #include "..\\Led5kSDK\\Led5kSDK.h" #include "afxwin.h" // CAreaDlg 对话框 class CAreaDlg : public CDialogEx { DECLARE_DYNAMIC(CAreaDlg) public: CAreaDlg(CWnd* pParent = NULL); // 标准构造函数 virtual ~CAreaDlg(); // 对话框数据 enum { IDD = IDD_AREADLG }; protected: virtual void DoDataExchange(CDataExchange*...
//************************************************************************** //** //** See jlquake.txt for copyright info. //** //** This program is free software; you can redistribute it and/or //** modify it under the terms of the GNU General Public License //** as published by the Free Software Foundation; either ...
#include <bits/stdc++.h> #include <cassert> #define rep(i,n) for (int i = 0; i < (n); ++i) #define ok() puts(ok?"Yes":"No"); template<class T> bool chmax(T &a, const T &b) { if(a < b) { a = b; return true; } return false; } template<class T> bool chmin(T &a, const T &b) { if(a > b) { a = b; return true; } return false;...
#ifndef __FCMEDIA_H #define __FCMEDIA_H #include "common.h" extern "C" { #include "libavcodec/avcodec.h" #include "libswscale/swscale.h" } #pragma pack (push ,1) typedef struct { /* bmfh */ uint16_t bfType; uint32_t bfSize; uint16_t bfReserved1; uint16_t bfReserved2; uint32_t bfOffBits; } BMP_FILE_HDR; typ...
/////////////////////////////////////////////////////////////////// //Copyright 2019-2020 Perekupenko Stanislav. All Rights Reserved.// //@Author Perekupenko Stanislav (stanislavperekupenko@gmail.com) // /////////////////////////////////////////////////////////////////// #pragma once #include "CoreMinimal.h" #include ...
#pragma once #pragma execution_character_set("utf-8") #include<iostream> #include<vector> #include<string> #include<set> using namespace std; class Solution { public: int thirdMax(vector<int>& nums) { set<int>top3; for (int n : nums) { top3.insert(n); if (top3.size() > 3) top3.erase(top3.begin());...
#include<iostream> using namespace std; /* class cDemo { const int iNo; int iNo2; public: cDemo():iNo(10),iNo2(20)//we can write non-const data member also in member initilizing list { } void display() { cout<<iNo<<iNo2; } }; */ class cDemo { const int m_iNo; int m_iNo2; public: cDemo(in...
// This file has been generated by Py++. #ifndef CoordConverter_hpp__pyplusplus_wrapper #define CoordConverter_hpp__pyplusplus_wrapper void register_CoordConverter_class(); #endif//CoordConverter_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...
#include "model/CollisionClass.hpp" int CollisionClass::count = 0; CollisionClass::CollisionClass(std::string slogan) : slogan(slogan), id(count++) { } CollisionClass::~CollisionClass() { } namespace TrivialCollisionClass { CollisionClass& All() { static class : public CollisionClass { publi...
#ifndef __DYNARRAY_H_ #define __DYNARRAY_H_ #include <stdio.h> #include <assert.h> template <class TYPE> class DynArray { private: TYPE* queue; // pointer for array's memory unsigned int num_elements; // number of elements unsigned int capacity; // allocated memory public: DynArray() // regular constructor { ...
// BinarySearch #include <iostream> using namespace std; // Using Recursion int BS(int *a,int key,int s,int e){ // base case if(s>e){ return -1; } // Recursive case int mid=(s+e)/2; if(a[mid]==key){ return mid; } else if(a[mid]<key){ s=mid+1; } else{ e=mid-1; } return BS(a,key,s,e); } // Without...
#include "../headers/Walec.h" Walec::Walec(Camera * cam, Light* light, bool * stop) { posX = 5; posY = 3.5f; posZ = 6; this->cam = cam; this->light = light; this->stopp = stop; scaleY = 2; scaleX = 0.25; scaleZ = 0.25; up = 0; running = false; multi = 3; textureName = "res/bruk.png"; } Walec::Walec(Camera...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* mutantstack.hpp :+: :+: :+: ...
#include <iostream> #include <vector> #include <random> #include "seal/seal.h" #include "homomorphic.hpp" #include "data_preprocessing.hpp" #include "plain_algorithms.hpp" using namespace std; using namespace seal; #define MAX_ITER 10 int main() { srand(time(0)); /* [DATA PREPROCESSING] */ // Rea...