text
stringlengths
8
6.88M
#include "GameHandler.h" GameHandler::GameHandler(WindowRef ref) { setWindow(ref); Background = new GameLayer(ref); MainLayer = new GameLayer(ref); UI = new GameLayer(ref); } void GameHandler::setWindow(WindowRef window) { this->window = window; } void GameHandler::drawGame() { Background->drawLayer(); MainLayer...
/* * subckt.h * * Created on: Nov 25, 2012 * Author: chjd */ #ifndef SUBCKT_H_ #define SUBCKT_H_ class Subckt { public: Subckt(string nm):name(nm){} void AddNode(int p){node.push_back(p);} void AddParam(string nm,double v=0){ paramMap.insert(make_pair(nm,new ParamNode(v))); } void AddElem(Elem* elem...
/**************************************************************************** ** Copyright (C) 2017 Olaf Japp ** ** This file is part of FlatSiteBuilder. ** ** FlatSiteBuilder 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 S...
class ArmoredSUV_DZE_Base_PMC: Car { scope = 0; brakeDistance = 19; vehicleClass = "DayZ Epoch Vehicles"; htMin = 60; htMax = 1800; afMax = 200; mfMax = 100; mFact = 1; tBody = 200; expansion = 4; displayName = "SUV (Armored)"; model = "\Ca\Wheeled_PMC\ArmoredSUV\armoredSUV_PMC.p3d"; icon = "\ca\Wheeled_PM...
#ifndef _BASE_VECTOR_4 #define _BASE_VECTOR_4 #ifdef _PSP_VER #include <libgum.h> #else #include <D3dx9math.h> #endif class BaseVector4 { protected: BaseVector4(void) {} public: virtual ~BaseVector4(void) {} public: #ifdef _PSP_VER ScePspFVector4& GetVector(void) { return _vec; } const ScePsp...
//==================================================================================== // @Title: CARTESIAN //------------------------------------------------------------------------------------ // @Location: /prolix/common/include/cCartesian.cpp // @Author: Kevin Chen // @Rights: Copyright(c) 2011 ...
#ifndef COMMON_THREAD_THREAD_INSTANCE_H_ #define COMMON_THREAD_THREAD_INSTANCE_H_ #include <cstdint> #include <set> #include <memory> #include "common/thread/lock.h" #include "common/thread/lock_guard.h" #include "common/thread/threading.h" namespace common { // quite same with singleton // but each thread owns a uni...
//http://www.codeproject.com/Tips/816934/Min-Binary-Heap-Implementation-in-Cplusplus #include "vector" #include "Eigen/Dense" using namespace std; class MinHeap { private: void BubbleDown(int index); void BubbleUp(int index); void Heapify(); public: vector<double> _vector; MinHeap(Eigen::Mat...
#pragma once #include "SDL.h" #include "TextureManager.h" #include "LoaderParams.h" class GameObject { /* public: virtual void load(int x, int y, int width, int height, std::string textureID); virtual void draw(SDL_Renderer* pRenderer); virtual void update(); virtual void clean() {}; protected: std::s...
#include "Function.h" #include <iostream> void Parsed::ParseFunc () { int PArg = 0; // parenthesis argument lister int SArg = 0; // scope argument lister bool ArgOpened = false; bool ArgClosed = false; bool ScopeOpened = false; bool ScopeClosed = false; int Pos = 0; // may have to do it -1 for (auto& State...
#include <iostream> #include "Image.h" #define CATCH_CONFIG_MAIN #include "catch.hpp" TEST_CASE("Test Load and Save", "[LOAD/SAVE OPERATION]") { // buffer for test image unsigned char* buffer = new unsigned char[16]; for(int i = 0; i < 16; i++) { buffer[i] = 128 + 4*i; } KNGEMI002::Image im_test(4,4, b...
// // FlowField.h // yearLong // // Created by Surya on 01/04/13. // // #ifndef __yearLong__FlowField__ #define __yearLong__FlowField__ #define ROWS 3 #define COLS 3 #include <iostream> #include "ofMain.h" class FlowField{ public: FlowField(); FlowField(int _resolution, int _w, int _h); void init(); ...
#include "stdafx.hpp" #include "action.hpp" namespace curses { // action action::action(event_handler&& handler) CURSES_NOEXCEPT: handler_( CURSES_MOVE(event_handler,handler) ) {} action::~action() CURSES_NOEXCEPT {} // signal signal::signal(const sp_action& action) CURSES_NOEXCEPT: action_(action) {} void signa...
//Phoenix_RK /* https://leetcode.com/problems/find-the-duplicate-number/ Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number, find the duplicate one. Example 1: Input: [1,...
/* * File: main.cpp * Author: babang * Problem: Petya and String * Created on April 24, 2018, 10:13 PM */ #include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string s, d; cin >> s >> d; transform(s.begin(), s.end(), s.begin(), ::tolower); transform(d.b...
// Created on: 1992-04-06 // Created by: Christian CAILLET // Copyright (c) 1992-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 ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*- ** ** Copyright (C) 1995-2012 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #include "core/pch.h" #ifdef DRAG_SU...
#include "database.h" #include <fcntl.h> #include <stdio.h> #include <iostream> #include <glog/logging.h> #include <glog/stl_logging.h> #include <google/protobuf/text_format.h> #include <google/protobuf/io/zero_copy_stream_impl.h> #include "machine_study_config.pb.h" #include "machine_study.pb.h" using namespa...
//************************************************************************************************************* // // 2DUI設定する構造体の処理[UISetingTypes.h] // Author : Sekine Ikuto // //************************************************************************************************************* #ifndef _UISETINGTYPES_H...
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int n; while(scanf("%d",&n)){ if(n==-1) break; ll male=0,female=1; for(int i=0;i<n;i++){ ll t=female; female=male+1; male+=t; // cout...
#pragma once #include "common.h" #include "streams/streams.h" NAMESPACE_BEGIN(NAMESPACE_BINTABLE) class MemoryInputStream : public InputStream { public: MemoryInputStream(char* input_data, std::streamsize input_data_size); void read(char *data, const std::streamsize size) override; void sk...
#include<iostream> #include<cstring> #include<cmath> #include<algorithm> #include<vector> #include<set> #include<map> #include<bits/stdc++.h> #include<queue> #define FOR0(i,n) for(i=0;i<n;i++) #define FOR(i,j,n) for(i=j;i<n;i++) #define FORD(i,j,k) for(i=j;i>=k;i--) #define pb push_back inline long long M...
#ifndef CONNEXION #define CONNEXION #include <winsock2.h> #include <iostream> int connexion(u_short port, SOCKET &sock, SOCKADDR_IN &sin); #endif
/* * @author : dhruv-gupta14 * @date : 25/12/2018 */ #include <bits/stdc++.h> using namespace std; int main() { int count = 0; string str; cin >> str; transform(str.begin(), str.end(), str.begin(), ::tolower); for (int i = 0; i < str.length(); i++) { if (str[i] == 'a' || str[i] == 'e...
/****************************************************************************** * This file is part of the Geometric harmonization project * * * * (C) 2014 Azamat Shakhimardanov *...
// ----------------------------------------------------------------------------- // AnalysisManager.h // // Class definition of the analysis manager // * Author: Everybody is an author! // * Creation date: 4 August 2020 // ----------------------------------------------------------------------------- #ifndef Anal...
#include "C:\Users\Andrey\Desktop\Linearization\Linerization\Working Test\version 1.1\include\Signal.h" #include "C:\Users\Andrey\Desktop\Linearization\Linerization\Working Test\version 1.1\include\Sinus.h" #include "C:\Users\Andrey\Desktop\Linearization\Linerization\Working Test\version 1.1\include\Rectangle.h" #inclu...
/* Crapenstein: - Bruno Caceiro - David Cardouzo */ #include "OpenGLIncludes.h" #include <iostream> #include <cmath> #include <vector> #include <cstring> #include "Camera.h" #include "Room.h" #include "Wall.h" #include "Robot.h" #include "DoorWall.h" #include "Map.h" #include "Ball.h" ...
#include <iostream> using namespace std; int main() { /*int count = 255; cout<<count;*/ /*int count; cin>>count; cout<<count;*/ int count, age; cout<<"Enter your number "<<" "; cin>>count; cout<<"Enter your age "; cin>>age; return 0; }
#include <cstdlib> #include <iostream> #include <string> #include <vector> #include <numeric> #include <sstream> #include <cmath> #include <ctime> std::vector<int> GenerateRandVec(int numOfNums, int min, int max); void BubbleSort(std::vector<int>& theVec); int Factorial(int number); void PrintHorizontalVector(std::vec...
#include <bits/stdc++.h> #define CASE(t) printf("Case %d: ",++t) // t initialized 0 using namespace std; #define INF 1e9 #define EPS 1e-9 #define PI acos(-1.0) double sqr(double x) { return (x*x); } double DEG_to_RAD(double d) { return d * PI / 180.0; } double RAD_to_DEG(double r) { return r * 180.0 / PI...
#include <stdio.h> #include <algorithm> #include <memory.h> #include <vector> #include <queue> #include <functional> using namespace std; #define ll long long struct edge { ll ax, ay, bx, by; }; struct dot { ll x, y; }; ll ccw(dot A, dot B, dot C) { return (A.x*B.y + B.x*C.y + C.x*A.y) - (A.y*B.x + B.y*C.x + C.y*A.x...
#include "DrawGraphics.h" namespace P_RVD { /* set the initial attributes */ void GraphicsDrawer::Init() { cameraPosition = { 0.0f, 0.0f, 0.0f }; centerPosition = { 0.0f, 0.0f, 3.0f }; upDirection = { 0.0f, 1.0f, 0.0f }; // set the position of light lightPosition[0] = 0.0f; lightPosition[1] = 0.0f;...
#include <iostream> #include<algorithm> #include<cstring> using namespace std; int value[1005]; int vol[1005]; int just[1005][1005]; int N,V; void d(int x) { if(x==N+1) { return; } else { for(int i=0; i<=V; i++) //考虑总体积为0,物品体积为0情况 { if(i>=vol[x]) ...
#include <SDL.h> #include <iostream> #include "Room.h" #include "SDLobsluga.h" #include <SDL_image.h> using namespace std; int main(int argc, char* args[]) { int x, y; Room room; Ekwipunek* equipment=new Ekwipunek; room.WeNeedToBuildAWall(); room.AddNewPuzzle('N', 359, 210, 70, 45, 0, 0,1);//sejf room.AddNewPuz...
// Created on: 1994-06-16 // Created by: EXPRESS->CDL V0.2 Translator // Copyright (c) 1994-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 te...
/** * Unidad 4: Servo con joystick */ #include <Servo.h> Servo servo; // Crear un objeto tipo Servo llamado servo int angulo = 0; int pinX = A1; int pinY = A2; void setup() { servo.attach(6); } void loop() { int ejeX = analogRead(pinX); angulo = ejeX - 512;...
#ifndef _GLIBCXX_MACHINE_H #define _GLIBCXX_MACHINE_H #include <list> #include "Item.h" #include "Being.h" #include "Platform.h" using namespace std; class Machine{ list<Item*> items; list<Item*>::iterator it = items.end(); bool paid; public: Machine(bool mpaid); bool addItem(Item& i); void removeItem(int item)...
/* * Copyright 2016 Freeman Zhang <zhanggyb@gmail.com> * * 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 applic...
/***************************************************************************************************************** * File Name : sortElementsByFrequency.h * File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\sites\geeksforgeeks\arrays\page07\sortElementsByFrequency.h * Created on : Jan 5, 2014 ...
/* =========================================================================== Copyright (C) 2017 waYne (CAM) =========================================================================== */ #pragma once #ifndef ELYSIUM_CORE_OBJECT #define ELYSIUM_CORE_OBJECT #ifndef ELYSIUM_CORE_EXPORT #include "Export....
// WAP to create an array where index is the multiple of all the elements //expect that #include<stdio.h> #include<conio.h> void Multiply(int*, int*, int); void main(){ int size; int a[100]; int b[100]; scanf_s("%d", &size); for (int i = 0; i < size; i++) scanf_s("%d", &a[i]); Multiply(a, b, size); for (int ...
#include "particle.h" void V_scalar::update_v(double eta, double torque, Ran &myran) { double tmp = std::sqrt(vx_next * vx_next + vy_next * vy_next); double c1 = vx_next / tmp; double s1 = vy_next / tmp; double noise; if (eta > 0) { noise = (myran.doub() - 0.5) * eta * 2 * PI + torque; } else { noi...
/* * MidiMessage.h * * Created on: Feb 4, 2019 * Author: juniper */ #ifndef TOUCHKEYS_MIDIMESSAGE_H_ #define TOUCHKEYS_MIDIMESSAGE_H_ // MIDI standard messages enum { kMidiMessageNoteOff = 0x80, kMidiMessageNoteOn = 0x90, kMidiMessageAftertouchPoly = 0xA0, kMidiMessageControlChange = 0xB0, kMidiMessag...
#include <iostream> using namespace std; typedef struct LIST_NODE { int Data; LIST_NODE *Next_Ptr; } LIST_NODE; class Linked_LIST { private: int Global_Position; LIST_NODE* Head_NODE; public: Linked_LIST(); int Create(); int Get_ITEM(int n); bool IsEmpty(); int Length(); int Insert(int Position, int Data);...
#include "Acceptor.h" #include <arpa/inet.h> #include <stdlib.h> #include <sys/socket.h> #include "InetAddress.h" #include "Logger.h" namespace chatty { namespace net { Acceptor::setConnectionCallback() { // channel_.setReadCallBack(); channel_.setReadCallBack(std::bind(&Acceptor::startAccept, this)...
#ifndef __HSAREA__ #define __HSAREA__ #define HSAREA_PROPERTY(GetFunc , SetFunc , Type , Name) __declspec(property(get = GetFunc , put = SetFunc)) Type Name #define HSAREA_PROPERTY_R(GetFunc , Type , Name) __declspec(property(get = GetFunc)) Type Name enum EHSAreaType { EHSAreaType_Rectangle = 0, EHSAreaT...
#include <conio.h> #include <stdlib.h> #include <stdio.h> #include <time.h> #include <string.h> #include <math.h> #include <locale.h> #include <ctype.h> float valor = 1; int main() { ret: printf("\nInsira um valor\n"); scanf("%f",&valor); while(valor>=0) { printf("\nInsira um valor\n"...
/* #include <stdio.h> #include <string.h> #include "pico/stdlib.h" //#include "hardware/spi.h" #include "hardware/gpio.h" */ #include "pico/time.h" #include "blinkt.h" #define dataPin 17 #define clockPin 18 int main() { //stdio_init_all(); blinkt_init(dataPin, clockPin); for(;;) { static int red = 0; red ...
#include <iostream> #include <stdlib.h> using namespace std; class Vector{ private: int length, capacity; double *v; public: Vector(){ length= 0; cout<<"Enter starting capacity of the array\n"; cin>>capacity; v = new double[2]; } ~Vector(){ cout<<"Array dele...
#include <iostream> #include <queue> #include <cstdio> #include <cstring> using namespace std; int N; int nMap[101][101]; int nAns[101][101]; int nChecked[101][101]; queue<int> q; void BFS(int y) { q.push(y); while (!q.empty()) { int cy = q.front(); q.pop(); for (int i = 1; i <= N; i++) { if (nMap[...
// Fill out your copyright notice in the Description page of Project Settings. #include "CSPowerUpSpawner.h" #include "CSPowerUpBase.h" #include "CSCharacter.h" #include "Components/DecalComponent.h" #include "Components/SphereComponent.h" #include "TimerManager.h" // Sets default values ACSPowerUpSpawner::ACSPowerU...
#include <iostream> using namespace std; int main(){ int tests{}; int cols{}; int diff{}; int top{}; int bottom{}; bool possible{}; cin >> tests; while(tests--){ diff = -1; possible = true; cin >> cols; while(cols--){ cin >> top >> bot...
#ifndef __RTSP_SVR_HH__ #define __RTSP_SVR_HH__ #include <pthread.h> #include "LiveStreamMediaSource.hh" #include "BasicUsageEnvironment.hh" //#include "service/Service.h" #include "RTSPServer.hh" class CRtspServer //: public CService { public: CRtspServer(); virtual ~CRtspServer(); virtual int PrepareStream(const...
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // // Пример базовых операций с фиксированными одномерными массивами // V 1.0 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- // #include <iostream> using namespace std; int main() { cout << "Целочисленный масс...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2005 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef BTConfigDialog_H #define BTConfigDialog_H #include "Simp...
#ifndef DATEWINDOW_H #define DATEWINDOW_H #include <QDialog> #include <QPushButton> namespace Ui { class dateWindow; } class dateWindow : public QDialog { Q_OBJECT public: explicit dateWindow(QWidget *parent = 0); ~dateWindow(); private: Ui::dateWindow *ui; QPushButton *doneButton; }; ...
// Created on: 1993-02-26 // Created by: Remi LEQUETTE // 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 ...
//==========================LDR and LEDS=================================================== #define analogpin 0 #define led_r 10 #define led_g 11 #include <LiquidCrystal.h> LiquidCrystal lcd(2,3,4,5,6,7); int val; void setup() { Serial.begin(9600); lcd.begin(16,2); pinMode(analogpin,INPUT); pinMode(led_r ,OUTPUT); ...
#include <string> #include <iostream> #include <vector> #include <cctype> using namespace std; int fun(string A){ int i = A.length()-1; int ans = 0; int flag = 1; if(int(A[i])==32){ // cout<<"yes"; while(i>=0&&int(A[i])==32){ i--; } } cout<<A; while(i>=0&&i...
#ifndef MATH_PRIME_FACTOR_HPP #define MATH_PRIME_FACTOR_HPP #include <vector> namespace Math { std::vector<int> primeFactors(int num) { std::vector<int> v; int f = 2; while (num > 1) { if (num % f == 0) { v.push_back(f); ...
#include "string.h" #include "input_params.h" // Print usage. void display_usage() { cout << "--help\n"; cout << "--lattice-size [32, 64, 128] {##} (default 32x32)\n"; cout << "--operator [laplace, laplace2, staggered\n"; cout << " g5_staggered, normal_staggered, index] (default st...
#include<cstdio> #include<string> #include<vector> #include<set> #include<cctype> #include<iostream> #include<sstream> using namespace std; set<string> ss; set<string>::iterator it; string s,t; vector<string> ans; int n,m; int cnt; inline void tol() { for(int i=0;i<s.length();++i) if(isalph...
#ifndef USER_H_ #define USER_H_ #include <iostream> #include <fstream> #include <string.h> #include <vector> #include "parser.h" #include "helper_funcs.h" using namespace std; int addUser(Json::Value requestBody){ // Check arguments inside requestBody string checkStr[2] = {"username", "password"}...
#include<iostream> #include<algorithm> #include<ctime> #include<vector> using namespace std; int main() { int n=10000000; vector<int> data; data.resize(n); srand(time(NULL)); for(int i=0;i<n;i++) { data[i]=(rand()%10); } clock_t t=clock(); sort(data.begin(),data.begin()+n); t=clock()-t; cout<<t<<endl; cou...
#ifndef RDDLPARSER_PSTREAM_H #define RDDLPARSER_PSTREAM_H #include<fstream> class PStream{ public: PStream(const char* name); PStream& operator<<(bool val); PStream& operator<<(short val); PStream& operator<<(unsigned short val); PStream& operator<<(int val); PStream& operator<<(unsigned int val); PStream& op...
#include "harmdataview.h" #include "module_base_def.h" #include "qcustomplot.h" #include "statdatatool.h" #include <QComboBox> CHarmDataView::CHarmDataView(QWidget *parent) : CStatViewBase(parent) { /* for (int i = 0; i != HARM_MAX; i++) { QString chn, key; key.sprintf("%dharm_rms_vol.dat"...
/*********************************************************\ * Copyright (c) 2012-2018 The Unrimp Team * * 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 wit...
#pragma once #include "Object.h" #include <string> #include <DxLib.h> using namespace std; class TitleObject : public Object { private: Vector2 accel; public: TitleObject(Vector2 vec); ~TitleObject() = default; Vector2 GetAccel() const; void Init() override; void Fin() override; void Update() override; void...
#ifndef LISTAST_H #define LISTAST_H #include "NodoT.h" #include <iostream> using namespace std; template <typename T> class ListaST { private: NodoT<T>* inicio; NodoT<T>* fin; public: ListaST(){ inicio = fin = NULL; } void muestraTusDatos(void){ ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2010 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** @author Manuela Hutter (manuelah) */ #ifdef AUTO_UPDATE_SUPPOR...
#include <catch2/catch_test_macros.hpp> #include <iostream> #include <fstream> #include <random> #include <oineus/oineus.h> using dim_type = size_t; template<class Int, class Real, size_t D> typename oineus::Grid<Int, Real, D> get_grid(Real* pdata, typename oineus::Grid<Int, Real, D>::GridPoint dims, bool wrap) { ...
#include "TestFramework.h" #include "treeface/math/Mat2.h" void TestFramework::content() { { treeface::Mat2f mat_fwd(123.456f, 789.123f, 654.321f, 234.578f); treeface::Mat2f mat_inv = mat_fwd; float det = mat_inv.inverse(); IS_EPSILON(det, -487379.7); IS_EPSILON(mat_inv.dat...
/* * @lc app=leetcode.cn id=1000 lang=cpp * * [1000] 合并石头的最低成本 */ // @lc code=start class Solution { public: int dp[31][31][31]; int sum[31]; int mergeStones(vector<int>& stones, int K) { int n = stones.size(); if((n-1)%(K-1))return -1; if(n < 2)return 0; memset(dp, 0x3f...
#include <functional> #include <reactor/base/SimpleLogger.h> #include <reactor/net/EventLoop.h> #include <reactor/net/InetAddress.h> #include <reactor/net/TcpConnection.h> #include <reactor/net/TcpServer.h> using namespace reactor::net; class DiscardServer { public: DiscardServer(EventLoop *loop, const InetAddress &...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) 2012 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #include "core/pch.h" #include "modules/...
#include <modul/kas/kas.h> #include "ui_kas.h" #include <QStandardItemModel> #include <QSqlQuery> #include <QSqlRecord> #include <QDate> #include <QSqlError> #include <QDebug> #include <QLocale> #include <QMessageBox> Kas::Kas(QWidget *parent) : QDialog(parent), ui(new Ui::Kas) { ui->setupUi(this); th...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define INF 10e13 #define rep(i, n) for(int i = 0; i < (int)(n); i++) typedef long long ll; int main() { ll n; cin >> n; ll ans = INF; for (ll i = 1; i*i <= n; i++) { if (n % i == 0){ ans = min(ans, i + (n/i) ...
#pragma once #include "torch/networks.hpp" #include <memory> #include <mutex> #include <string> #include <thread> #include <torch/torch.h> namespace OptimExplorer { struct Hparams { size_t batch_size = 256; size_t epochs = 5; }; class TorchSystem { public: TorchSystem(); private: void train(); void set_...
// // Created by Nowidh on 2020/7/8. // #include"TargetCodeGenerator.h" #include<iostream> #include<algorithm> using std::ios; using std::cout; using std::endl; extern FunSheet xTable; //测试用,实际应该使用符号表的函数 bool isTemporary(string nowString) { if (nowString[0] == '_' && nowString.size()>1) return true; ...
/** Underscore @file /.../Source/Kabuki_SDK-Impl/_App/RealTimeKeyboard.h @author Cale McCollough @copyright Copyright 2016 Cale McCollough © @license http://www.apache.org/licenses/LICENSE-2.0 @brief This file contains the _ class. */ using System.Diagnostics; namespace _IO { ...
#pragma once #include <string> #include "../include/definitions.h" namespace ACJudge2 { class Sandbox { public: Result Run(Tstring cmd, Time time, Memory memory, bool restricted, Tstring fin = T(""), Tstring fout = T(""), Tstring ferr = T("")); private: #if defined _WIN32 // Set limits // Tags will be sa...
// OLED #include <Multi_BitBang.h> #include <Multi_OLED.h> #define OLED_w 128 #define OLED_h 64 #define NUM_DISPLAYS 2 #define NUM_BUSES 2 #define BASE_CONTRAST 1000 // I2C bus info uint8_t scl_list[NUM_BUSES] = {D1, D1}; //{9,9,9,9}; uint8_t sda_list[NUM_BUSES] = {D2, D0}; //{5,6,7,8}; int32_t speed_list[NUM_BUSES]...
#include "cleanuptools.hpp" #include "scene.hpp" // #include <SFML/Graphics.hpp> #include "SFML-2.5.1-macos-clang/include/SFML/Graphics.hpp" #include "SFML-2.5.1-macos-clang/include/SFML/Window.hpp" #include "whereami/whereami.h" #include <csignal> // kill // #include <string> - don't think it is needed #include <thre...
#ifndef CONTACTSPANEL_H #define CONTACTSPANEL_H #include "adjunct/quick_toolkit/windows/DesktopWindow.h" #include "adjunct/desktop_util/treemodel/optreemodel.h" #include "adjunct/desktop_util/treemodel/optreemodelitem.h" #include "modules/util/adt/opvector.h" #include "adjunct/quick/panels/HotlistPanel.h" #include...
#include <stdio.h> #include <stdlib.h> //트리노드 구조체 typedef struct TreeNode { int data; //데이터 struct TreeNode *left, *right; //왼쪽 노드를 가리키는 포인터, 오른쪽 노드를 가리키는 포인터 } TreeNode; //함수 선언 void inorder(TreeNode *); void preorder(TreeNode *); void postorder(TreeNode *); void triple_order(Tree...
int momBut = 2; int led1 = 3; int led2 = 4; int led3 = 5; int counter = 0; int lastButtonState = 0; int buttonVal; void setup() { pinMode(2, INPUT); pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); // put your setup code here, to run once: } void loop() { // put your main code here, to run repeatedly: butto...
#include <SDL.h> #define GLEW_STATIC #include <GL/glew.h> #include "treeface/base/PackageManager.h" #include "treeface/graphics/ShapeGenerator.h" #include "treeface/math/Constants.h" #include "treeface/misc/UniversalValue.h" #include "treeface/scene/Geometry.h" #include "treeface/scene/MaterialManager.h" #include "tr...
#pragma once #include "Functions.h" #include "Player.h" #include "Skeleton.h" #include "MySFML.h" using namespace std; //--------------------------------------------------------------------------------------- class Game { Player* player; vector<GameObject*> staticObjects; vector<Enemy*> enemies; Game(); Positio...
/* 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...
#pragma once #include "../../../Toolbox/Toolbox.h" #include "Mesh3D.h" namespace ae { class Curve; /// \ingroup graphics /// <summary> /// Give the possibility to draw a parametric curve. /// </summary> /// <seealso cref="Mesh3D" /> /// <seealso cref="Drawable" /> /// <seealso cref="Curve" /> class AERO_COR...
#include<stdio.h> #include<stdlib.h> #include<X11/Xlib.h> #include <unistd.h> #include<cmath> using namespace std; GC gc; Display *display; Window window; //initialization for a window int screen; //which screen void initGraph(int width,int height) { /* open connection with the server */ ...
#ifndef wali_wpds_RULE_FUNCTOR_GUARD #define wali_wpds_RULE_FUNCTOR_GUARD 1 /** * @author Nicholas Kidd * @author Akash Lal */ #include "wali/Common.hpp" #include "wali/ref_ptr.hpp" #include <iostream> #include <set> namespace wali { namespace wpds { class WPDS; class Wrapper; class Rule; clas...
// Created on: 1993-01-11 // Created by: CKY / Contract Toubro-Larsen ( Arun MENON ) // 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 ...
#include "Dribbler.h" #include "Command.h" #include "Util.h" #include <iostream> Dribbler::Dribbler(int serialId) : serialId(serialId), speed(0), ballDetected(false), ballInDribblerTime(0.0), ballLostTime(-1.0), serial(NULL) { serial = new Serial(); if (serial->open(serialId) == Serial::OK) { std::cout << "+ Dri...
#include "material.h" #include "world.h" #include "raytracer.h" PerfectDiffuse::PerfectDiffuse(RGB c) { color = c; } RGB PerfectDiffuse::Shade(RayTracer * tracer , HitInfo hit ) { RGB totalcolor; for(int i=0 ; i < hit.world->lights.size() ; i++) { Vec3 inDirection = hit.world->lights[i].pos - hit.HitPoint; ...
#pragma once #include "AvatarView.h" #include "EnemyStaticModel.h" class EnemyGruntView : public AvatarView { public: void initView(AvatarModel* avatarModel); };
#include "graphreader.hh" #include "stats.hh" #include "timer.hh" #include <cassert> #include <iostream> #include <string> using namespace std; using Mat = vector<vector<int>>; void ad0(const Mat &m1, const Mat &m2, Mat &res) { int i = m1.size(); // number of rows in m1 int j = m1[0].size(); // number of cols ...
class ItemJerrycanEmpty { weight = 1; }; class ItemJerrycan { weight = 10; }; class ItemFuelcanEmpty { weight = 0.5; }; class ItemFuelcan { weight = 5; }; class ItemFuelBarrel { weight = 167; }; class ItemFuelBarrelEmpty { weight = 20; }; class ItemOilBarrel { weight = 140; }; class ItemOilBarrelEmpty { weight ...
#pragma once #include <iosfwd> #include <set> #include <string> #include <vector> #include <cppunit/Outputter.h> namespace CppUnit { class Exception; class Test; class TestFailure; class TestResultCollector; } namespace BeeeOn { /** * Plugin to CppUnit that outputs the test results in * the TAP format: * * ...