text
stringlengths
8
6.88M
#include "Logging.h" #include <iostream> static void Info_Fallback(const char* text) { std::cout << "INFO: " << text << std::endl; } static void Warning_Fallback(const char* text) { std::cout << "WARNING: " << text << std::endl; } static void Error_Fallback(const char* text) { std::cout << "ERRO...
#ifndef __INC_GRAPH_HPP #define __INC_GRAPH_HPP #pragma once #include <list> #include <vector> #include <stack> #include <iostream> #include <utility> #include <limits> #include <functional> #pragma once #ifndef _BEGIN_ZHF_LIB #define _BEGIN_ZHF_LIB namespace zhf_lib{ #endif // !_BEGIN_ZHF_LIB #if...
// Created on: 1992-09-28 // Created by: Remi GILET // 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 GNU Les...
class Solution { public: int binaryGap(int N) { int c = 0, p = -1, i = 0; while(N != 0) { if(N&1) { if(p!=-1) c = max(c, i-p); p = i; } N = N>>1; i++; } return c; } };
#include <iostream> #include "time.h" #include "testApp.h" #include "City.h" #include "GeoInfo.h" #include "Utility.h" #include "glc.h" //-------------------------------------------------------------- void testApp::setup() { ofSetFrameRate(60); ofBackground(0, 0, 0); //ofEnableAlphaBlending(); ofEnableSmoothing...
/****************************************** * AUTHOR : Abhishek Naidu * * NICK : abhisheknaiidu * ******************************************/ #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define CPS CLOCKS_PER_SEC #define all(n) ...
#include<iostream> #include<vector> #include<iterator> #include<string> #include<list> #include<random> #include<sstream> #include<time.h> #include<Windows.h> #include<stdlib.h> using namespace std; struct card { friend bool compare(card& c1, card& c2); public: const int readnum(); const int readcol(); ...
// Copyright (C) 2012-2017 Hartmut Kaiser // (C) Copyright 2008-10 Anthony Williams // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include <pika/config.hpp> #inclu...
#include "precompiled.h" #include "component/meshcomponent.h" #include "component/jscomponent.h" #include "entity/entitymanager.h" #include "scene/scene.h" #include "render/render.h" #include "render/shapes.h" #include "render/rendergroup.h" #include "mesh/meshcache.h" using namespace component; REGISTER_...
#ifndef CRequestHelpInfoMessage_H #define CRequestHelpInfoMessage_H #include "CMessage.h" #include <QObject> //ÇëÇóXMLÏûÏ¢ class CRequestHelpInfoMessage : public CMessage { Q_OBJECT public: CRequestHelpInfoMessage(CMessageEventMediator* pMessageEventMediator, QObject *parent = 0); ~CRequestHelpInfoMessage(); vi...
#include "EntitiesModule.h" namespace Game { EntitiesModule::EntitiesModule() : mEntities() { } EntitiesModule::~EntitiesModule() { cleanup(); } Entity* EntitiesModule::get(uint32_t id) { return mEntities.find(id)->second; } Entity* EntitiesModule::add() { auto entity = new Entity(); mEntities.inse...
/*==================================================================== Copyright(c) 2018 Adam Rankin 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 limitati...
#include <bits/stdc++.h> #define REP(i, a, b) for(int i = (int)a; i < (int)b; i++) #define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define pb push_back #define mp make_pair #define st first #define nd second #define vi vector<int> #define ii pair<int, int> #define ll long long int #define MAX 20001...
#include <iostream> //i is a const int //j is an int (top level const dropped) //k is a const int //p is a const int* (pointer to const int) but p is not const //j2 is a const int //k2 is a reference to const int int main() { const int i = 42; auto j = i; const auto &k = i; auto *p =&i; const auto j...
/* * Copyright 2019 Nagoya University * * 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 applicable law or agree...
#include "TTree.h" #include "TSystem.h" #include "TFile.h" #include "TLorentzVector.h" #include "math.h" #include "iostream" #include "FWCore/FWLite/interface/AutoLibraryLoader.h" #include "DataFormats/FWLite/interface/Handle.h" #include "DataFormats/FWLite/interface/Event.h" #include "DataFormats/Common/interface/EDPr...
class Solution { public: vector<int> findDisappearedNumbers(vector<int>& nums) { /* vector<int> vec; if(nums.empty()) { return vec; } sort(nums.begin(), nums.end()); for(int i = 1; i < nums[0]; i++) { vec.push_back(i); } ...
#include <iostream> using namespace std; void merge(int arr[], int left, int middel, int right) { int i = left; //starting index for left subarray int j = middel + 1; //starting index for right subarray int k = left; //starting index for temp array int temp[5]; //tempArray while (i <=...
// // Created by aleksey on 18.04.2019. // #pragma once #include <G4VModel.hh> #include <G4VGraphicsScene.hh> #include <G4TransportationManager.hh> #include <G4Field.hh> #include <G4FieldManager.hh> #include <G4Colour.hh> #include <G4VisAttributes.hh> #include <G4Polyline.hh> #include <G4ArrowModel.hh> class MyElect...
// // Fish.cpp // GetFish // // Created by zs on 14-12-8. // // #include "Fish.h" #include "Common.h" #include "Tools.h" #include "AudioController.h" //#include "FishingPlayLayer.h" Fish* Fish::create(int type,float speed , int dir ,const char* name) { Fish* fish = new Fish(); if(fish && fish->init(ty...
#include <vector> #include <string> #include <iostream> #include <fstream> #include <sstream> #include <list> #include <algorithm> #include <sstream> #include <set> #include <cmath> #include <map> #include <stack> #include <queue> #include <stdio.h> #include <string.h> using namespace std; #define MAX_NA 53 #define M...
/* This Simulator cited from Prof. Demko's Simulator.h * I have changed the class Halton, HaltonGBM, EulerMarayama * This file generates random number and simulates stochastic process */ #ifndef __SIMULATOR_H_ #define __SIMULATOR_H_ #include <cmath> #include <ctime> #include <string> #include "mt19937ar.h" #includ...
#include<iostream> using namespace std; struct Date{ int d,m,y; }; const int monthDays[12]={31,28,31,30,31,30,31,31,30,31,30,31}; int leapYearCount(Date d){ int years = d.y; if(d.m<=2) years--; return (years/4) - (years/100) + (years/400); } int getDifference(Date d1,Date d2){ int n1=0,n2=0; n1=d1.y*...
#include "string.h" #include <cstring> String::String() { data = new char[1]; *data='\0'; size=0; } String::String(int n,char c) { data=new char[n+1]; size=n; char *tmp=data; while(n--) { *tmp++=c; } *tmp='\0'; } String::String(const char *source) { if(source==NULL...
/********************************************************************* ** Author: Chris Matian ** Date: 07/20/2017 ** Description: This is the class specification file for Box which contains all of the early declarations used in Box.cpp *********************************************************************/ // Class ...
#pragma once #include <iostream> #include "Vector3.h" #include "Results.h" using namespace std; class AABB { private: Vector3D<float> Min; Vector3D<float> Max; public: AABB(const Vector3D<float>&, const Vector3D<float>&); Vector3D<float> GetMin() const noexcept; Vector3D<float> GetMax() const noe...
#include "InputParserForTraining.h" namespace Train { InputParserForTraining::~InputParserForTraining() { cout << "destructor of InputParserForTraining called" << endl; int length = AM->length(); for (int i=0; i<length; i++) { map<UID, FriendsMap*> curRow = AM->getRow(i); for (map<UID, FriendsMap*...
#include "bsconnect.hh" #include "Eigen/LU" using namespace Geometry; static Vector3D surfaceNormal(const BSSurface &s, double u, double v) { VectorMatrix der; s.eval(u, v, 1, der); return (der[1][0] ^ der[0][1]).normalize(); } // `p` (supposedly in the `(u,v)` plane) is written as a combination of `u` and `v...
//Phoenix_RK /* https://leetcode.com/problems/longest-common-prefix/ Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1: Input: strs = ["flower","flow","flight"] Output: "fl" Example 2: Input: strs = ["dog...
#include <iostream> #include <map> #include <vector> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long t, n, m, k, r, c, ans; map<pair<int, int>, int> grid; cin >> t; for(int i = 0; i < t; i++) { cin >> n >> m >> k; ans = 0; ...
#include "..\h\backBuffer.h" CBackBuffer::CBackBuffer() : m_hwnd(0), m_BFDC(0), m_hBFBitmap(0), m_hOldBitmap(0), m_iWidth(0), m_iHeight(0) {} CBackBuffer::~CBackBuffer() { SelectObject(m_BFDC, m_hOldBitmap); DeleteObject(m_hBFBitmap); DeleteObject(m_BFDC); } bool CBackBuffer::Initialize(HWND _hwnd, int _i...
// sensorLightClass.h #ifndef _SENSORLIGHTCLASS_h #define _SENSORLIGHTCLASS_h #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #include <ArduinoJson.h> #include <FS.h> #include <SPIFFS.h> #else #include "WProgram.h" #endif class sensorLightClass { public: String name; int light = ...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> using namespace std; const int maxn = 5e3 + 10; int a[maxn],t[maxn],n; int lowbit(int k) { return ...
// Created on: 1997-07-28 // Created by: Pierre CHALAMET // Copyright (c) 1997-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GN...
#include "./platform/UnitTestSupport.hpp" #include <Dot++/Parser.hpp> #include <iostream> #include <map> #include <set> #include <sstream> #include <stdexcept> #include <string> #include <utility> namespace { struct GraphMock { GraphMock() : finalized(false) { } ...
#include "ClnUtils.h" namespace PticaGovorun { // Divdes [min;max] interval into 'numPoints' points. If numPoints=2 the result is two points [min,max]. // The routine is similar to Matlab 'linspace' function. void linearSpace(float min, float max, int numPoints, wv::slice<float> points) { PG_Assert(numPoints >= 2); ...
/* -*- 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. */ #ifndef QUICK_BINDER_ENABLED_H #define QUICK_BINDER_ENABLED_H #i...
#include <cstdlib> #include <stdio.h> #include <vector> #include <omp.h> int main(int argc, char *argv[]) { int N = atoi(argv[1]); std::vector<std::vector<int> > a(N, std::vector<int>(N, 2)); std::vector<std::vector<int> > b(N, std::vector<int>(N, 2)); std::vector<std::vector<int> > prod(N, std::vecto...
//inputpasser.hpp //Turns SDL input into actions. //Created by Lewis Hosie //17-11-11 #include <SDL.h> #include "world.hpp" #ifndef E_INPUTPASSER #define E_INPUTPASSER class inputpasser{ bool keys[SDLK_LAST]; //entity &theentity; public: inputpasser(world& theworld){ for(int i=0; i<SDLK_LAST; i++) keys[i]=f...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright 2002-2009 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Peter Karlsson */ #include "core/pch.h" #ifdef PREFS_HAVE_DESKTO...
/* * Copyright 2019 LogMeIn * * 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 applicable law or agreed to in w...
#include <iostream> using namespace std; //s(n)=1+1*2+1*2*3+....+ ...*n int dequi(int n) { if(n==1) { return 1; } int giaithua=1; for(int i=2;i<=n;i++) { giaithua*=i; } return giaithua+dequi(n-1); } int giaithua(int n) { int gt=1; for(int i=2;i<=n;i++) { ...
#include <avr/io.h> #include "IR_library.h" #include "robotlib.h" #include "motors.h" void setup() { //setupServo(); //setupUltraSonic(); setupMotors(); setupIR(); } void loop() { handleIRinput(); }
/*In this program we will be seeing about LOOPS CONTROL STATEMENTS in C++ Program*/ /*In C++ break , continue and goto are called as LOOP CONTROL STATEMENT, which is been used for controling the flow of loop in a c++ program.*/ /*In this Example lets see how break works in a program.*/ /*break is a type of loop cont...
#include "QFileSearch.h" #include <QtWidgets/QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); QFileSearch w; w.show(); a.installNativeEventFilter(w.filter); return a.exec(); }
#include <iostream> #include <sstream> using namespace std; int main(int argc, char *argv[]) { string k = "##############################################"; cout << " ================================================"<< endl; cout << " Selamat Datang di Program Pointer "<< endl; cout << " Mengetahui Nilai Mata Kul...
//quick select algo to find the kth smallest element //worst case o(n^2) #include <iostream> //#include"lamuto.h" using namespace std; void swap(int arr[],int i,int j){ int temp=arr[i]; arr[i]=arr[j]; arr[j]=temp; } int lamuto(int arr[],int l,int h){ int p=arr[h]; //to handle cases when pivot is not the last...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef OP_SOCKET_H #define OP_SOCKET_H #ifdef _EXTERNAL_SSL_SUPP...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * Copyright (C) Opera Software ASA 2009-2011 * * WebGL GLSL compiler -- AST representation. * */ #ifndef WGL_AST_H #define WGL_AST_H #include "modules/webgl/src/wgl_base.h" #include "modules/webgl/src/wgl_glsl.h" #include "modules/ut...
#pragma once #include "DxLib.h" class StageSelect { private: int key_graphic[2]; int buck_graphic[5]; int number; int pos_x[2];//0->A/1->D int pos_y[2]; int buckground_x[5]; int buckground_y[5]; public: StageSelect(); ~StageSelect() {}; void update(char A, char D); void draw(); int getnumber() { ret...
#include<iostream> using namespace std; int main() { int i,n,num1=0,num2=1,next; cout<<"Enter no. of terms:"; cin>>n; cout<<"\nFibonacci series:\n"; for(i=1;i!=n;i++) { cout<<num1<<" "; next=num1+num2; num1=num2; num2=next; } return 0; }
#include "MoveCalibration.h" #include "simplex.h" #include "IniFile.h" using namespace std; namespace Move { MoveCalibration::MoveCalibration(int moveId, MoveOrientation* orientation) :orientation(orientation) { this->id=moveId; char fileName[]="settings.cfg"; MoveDevice::TMoveBluetooth bt...
#include "editcomputer.h" #include "ui_editcomputer.h" #include "utilities/constants.h" #include "data_types/computer.h" editComputer::editComputer(QWidget *parent) : QDialog(parent), ui(new Ui::editComputer){ ui->setupUi(this); // type dropdown list ui->edit_dropdown_type->addItem(""); ui->...
// Copyright (c) Improbable Worlds Ltd, All Rights Reserved #pragma once #include "CoreMinimal.h" #include "Blueprint/UserWidget.h" #include "Containers/CircularQueue.h" #include "TouchControls.generated.h" DECLARE_LOG_CATEGORY_EXTERN(LogTouchControls, Log, All); class UBorder; class UButton; class UCanvasPanelSlo...
/* BEGIN LICENSE */ /***************************************************************************** * SKCore : the SK core library * Copyright (C) 1995-2005 IDM <skcontact @at@ idm .dot. fr> * $Id: file.cpp,v 1.8.2.3 2005/02/17 15:29:21 krys Exp $ * * Authors: W.P. Dauchy * Mathieu Poumeyrol <poumeyrol @a...
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n, a[200000]; vector<int> v1, v2; bool failed; cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); failed = false; v1.push_back(a[0]); if (n != 1) { v2...
#ifndef Chequera_h #define Chequera_h #include "CtaBanc.h" using namespace std; class Chequera:public CtaBanc{ public: Chequera(); Chequera(int); int getCom(); void setCom(int); void muestra(); private: int comision; }; Chequera():CtaBanc(){ comision=0; } Chequera::Chequera(int n, int s,int...
/* * MacCommandLineArgumentHandler.cpp * Opera * * Created by Adam Minchinton on 6/19/07. * Copyright 2007 Opera All rights reserved. * */ #include "core/pch.h" #include "modules/util/opfile/opfile.h" #include "adjunct/desktop_util/boot/DesktopBootstrap.h" #include "platforms/mac/subclasses/MacCommandLin...
//你们考了多少分 #include <cstdio> #include <iostream> #include <algorithm> using namespace std; #define maxn 200 + 5 typedef struct tree { //结构体,l,r存左右端点,num存分数 int r; int l; int num; }; int num[maxn]; tree t[maxn]; inline void pu(int k) { //没搞明白 t[k].num = max(t[k << 1].num, t[k << 1 | 1].num); return; }...
#ifndef NETWORK_H_ #define NETWORK_H_ #include <iostream> #include <vector> #include <Eigen/Core> #include "Instance.hpp" #include "layers/Linear_layer.h" #include "layers/Logistic_layer.h" #include "layers/Quadratic_loss.h" using namespace Eigen; class Network { public: Network(int input_size, int output_size = 1); ...
// written by Michael - originally written Fall, 2000 // updated Fall, 2005 // updated Fall, 2006 - new texture manager, improvements for behaviors // simple example behaviors - something to learn from #include "../GrTown_PCH.H" #include "../DrawUtils.H" #include "Utilities/Texture.H" #include "../MMatrix.H" #includ...
#include "room.h" #include "ui_mainwindow.h" #include "mainwindow.h" Room::Room(string description, string roomSetting) { this->description = description; this->roomSetting = roomSetting; this->itemDescription = itemDescription; } void Room::setExits(Room *forward, Room *backward, Room *right, R...
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// // Варианты доступа к элементам перечислений enum по выбору пользователя // V 1.1 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// #include <iostream> enum Colors { YELLOW, WHITE, ORANGE, GREEN, }; int m...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "623" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) #define MAXN 3000 struct BigNum { int num[MAXN+5]; BigNum(){ memset(num, 0, sizeof(num)); }; friend ostream &operator<<(ostream &out, const BigNum &rhs){ bool ...
/* * Pen.hpp * * Created on: Jun 14, 2016 * Author: tgil */ #ifndef SGFX_PEN_HPP_ #define SGFX_PEN_HPP_ #include <sgfx/sg_types.h> #include "../var/Item.hpp" namespace sgfx { class Pen : public var::Item<sg_pen_t> { public: enum mode { SET /*! Set pixels to color */ = SG_PEN_FLAG_SET, CLR /*! Clea...
// // Builder.hpp // ItsyForth // // Created by Dad on 4/17/21. // #ifndef Builder_hpp #define Builder_hpp /* #include <string> #include "Types.hpp" class Runtime; class DictionaryWord; class OpCode; class Builder { public: Builder(Runtime* runtime); std::string getNextInputWord(char delim); DictionaryWord* ...
// // Created by fab on 11/05/2020. // #ifndef DUMBERENGINE_RIGIDBODY_HPP #define DUMBERENGINE_RIGIDBODY_HPP #include <bullet/btBulletDynamicsCommon.h> #include "../IComponent.hpp" #include "../../systems/physics/Physics.hpp" #include "ICollisionCallbacks.hpp" class RigidBody : public IComponent { private: float...
#include "mpi.h" #include <vector> #include <iostream> using namespace std; void max(void *a, void *b, int *l, MPI_Datatype *type) { for (auto i = 0; i < *l; i++) { ((int*)b)[i] = max(((int*)a)[i], ((int*)b)[i]); } } int main(int argc, char **argv) { int rank, size; int myres, mpires; M...
#include <ncurses.h> #include <iostream> #include <sys/time.h> #include <sys/types.h> #include <stdlib.h> #include <unistd.h> using namespace std; WINDOW *create_newwin(int height, int width, int starty, int startx); void remove_win(WINDOW *cur_win); int game_win_height = 20; int game_win_width = 25; int next_win_h...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> using namespace std; typedef long long ll; #define INF 10e8 #define rep(i,n) for(int i=0; i<n; i++) #define re...
// Created on: 2015-02-18 // Created by: Nikolai BUKHALOV // Copyright (c) 1992-1999 Matra Datavision // Copyright (c) 1999-2015 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 G...
//UVA 515-King /* 題目大意:   給定一個序列的長度,然後給定若干關係:這個關係是子序列各個元素之和與某個給定整數的大小關係。要求是否存在這樣一個序列滿足所有給定的若干關係。 本題主要就是需要想到利用前n個元素的和為替代,即設s[i] = a[1] + a[2] + …a[i]。 則a[si] + a[si+1] + … + a[si + ni] = s[si + ni] - s[si - 1];所以如果a[si] + a[si+1] + … + a[si + ni] < k 則 s[si + ni] - s[si - 1] < k <= k - 1;如果a[si] + a[si+1] + … + a[si...
#ifndef INTERFACE_H #define INTERFACE_H #include "data_types/pioneer.h" #include "data_types/computer.h" #include "services/pioneerservice.h" #include "services/computerservice.h" #include "services/relationservice.h" #include "services/relationservice.h" #include "ui/menuscreen.h" #include <iostream> #include <vector>...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #include <core/pch.h> #ifdef EXTENSION_SUPPORT #include "modules/...
/** Este codigo esta basado en el ejemplo/data/data/Andres/Repos/command_source/Geant4/Ejemplos10x3/Geant4-10.3.0/extended/electromagnetic/TestEm0/DirectAccess.cc */ #include "MyAnalysisManager.hh" #include "G4Material.hh" #include "G4PEEffectFluoModel.hh" //Fotoelectrico #include "G4KleinNishinaCompton.hh" //Compt...
#include <iostream> int main(void){ std::cout<<"helloworld"<<std::endl; return 0; }
#include <NaryTree.h> #include <Wrapper.h> #include <PrePostVisitor.h> #include <PuttingVisitor.h> #include <iostream> int main(void) { using namespace std; Int *ip = new Int(0); Int *ip1 = new Int(1); Int *ip2 = new Int(2); Int *ip3 = new Int(3); Int *ip11 = new Int(11); Int *ip12 = new Int(12); Int ...
#include "stdafx.h" #include "txtData.h" txtData::txtData(){} txtData::~txtData(){} HRESULT txtData::init(){ return S_OK; } void txtData::release(){} //save void txtData::txtSave(const char * saveFileName, vector<string> vStr) { HANDLE file; char str[128]; DWORD write; strncpy_s(str, 128, vectorArrayCombine(v...
// -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- // opera:config strings #ifdef OPERACONFIG_URL DI_IDHELP SI_SAVE_BUTTON_TEXT S_CONFIG_DEFAULT S_CONFIG_SHOW_ALL S_DOC_NEED_JS SI_IDFORM_RESET S_NO_MATCHES_FOUND S_QUICK_FIND S_SETTINGS_SAVED S_NO_SETTINGS_SAVED S_CONFIG_RESTART S_CONFIG_TITLE #endif #ifndef USE_MIN...
#include <sys/ipc.h> #include <semaphore.h> #include <sys/sem.h> #include <fcntl.h> #include <iostream> #define RWRR (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) using namespace std; sem_t call_sem_init( ); sem_t call_sem_open( ); int main() { sem_t sem = call_sem_open(); cout << "sem=" << (void *) &sem << endl; retu...
/* Author: Matt Pinner @mpinenr Intent : Smooth Sound and Motion Reactivity for Wearable LEDs Wearing LEDs can be dumb. mostly they're not respectful of the surrounding environment. This code uses LOTS of data to infer the energy of the wearer and environment to turn down and slow the reactivity of LEDs...
// Created on: 2008-05-26 // Created by: Ekaterina SMIRNOVA // Copyright (c) 2008-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2...
#include <iostream> #include "FDHeatMethod.hpp" template<typename X> FDHeatMethod<X>::FDHeatMethod(Option<X> *__option, X _S_min, X _S_max, int _N, int _M) : FDMethod<X>(__option, _N, _M) { if (_S_min <= 0) { std::cout << " S_min musi byc większe niż zero "; } this->x_min = transform_to_X(_S_min); ...
#include <atomic> #include <condition_variable> #include <deque> #include <map> #include <mutex> #include <unordered_set> #include <stdlib.h> #include "chunk_registry.hpp" #include "chunk_allocator.hpp" struct freelist : public std::vector<void*> { }; class alloc { public: alloc (void** stack_bottom, bool free_mem...
// MainFrm.h : interface of the CMainFrame class // ///////////////////////////////////////////////////////////////////////////// #pragma once class CMainFrame : public CFrameWindowImpl<CMainFrame>, public CUpdateUI<CMainFrame>, public CMessageFilter, public CIdleHandler, public CAppWindow<CMainFra...
http://www.geeksforgeeks.org/shuffle-a-given-array/
#pragma once template <typename T> void containerSwap(T &a, T &b) { T tmp = a; a = b; b = tmp; } template <typename C> void SelectionSort(C &container, long containerSize) { if (containerSize == 0) return; for (int i = 0; i < containerSize; i++) { long position = i; long minimumPos = i; for (int j =...
#include "source.h" #include <math.h> double heatSource(double x, double y) { double dx = x - 0.9; double dy = y - 0.9; return 2000.0 * exp(-20.0 * (dx * dx + dy * dy)); }
#ifndef SERIAL_H #define SERIAL_H #include "port.h" #include <QMutex> #include <QObject> class Serial : public QObject, public IPort { Q_OBJECT public: // Serial(); virtual ~Serial(); public: static const int DATABITS_FIVE = 5; static const int DATABITS_SIX = 6; static const int DATAB...
#include <iostream> #include <string> #include <vector> #include "../rapidxml/rapidxml.hpp" #include "../rapidxml/rapidxml_utils.hpp" #include "../rapidxml/rapidxml_print.hpp" #include "Container.h" #include "gameObjects.h" #include "Creature.h" #include "Trigger.h" #include "Item.h" #include "Room.h" #include "utils.h...
// Originally Written by Luke Simmons and Megan Sword // Edited by Alfred Ledgin // 11/4/2015 // CS 303 // Project 2 #pragma once #include <string> #include <stack> #include "Operator.h" using namespace std; class Evaluator { public: Evaluator(string line); Evaluator(); const double evaluate(string equatio...
// // Created by micky on 15. 5. 20. // #include <iostream> #include "JudgeServer.h" JudgeServer *JudgeServer::instance = NULL; void JudgeServer::createNewConnection() { InetSocket *clnt = nullptr; clnt = _serv.accept(); if(_conn.size() < (size_t)clnt->getFileDescriptor()) { _conn.resize(clnt->g...
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { freopen(".in", "r", stdin); freopen(".out", "w", stdout); int T, __it = 0; cin >> T; while (T--) { __it++; cout << "Case #" << __it << ": "; int x, r, c; cin >> x >> r >> c; if (r > c) swap(r, c); ...
// // serial.h // serialowabaza // // Created by Julia on 06.11.2018. // Copyright © 2018 Julia. All rights reserved. // #ifndef serial_h #define serial_h #include"ogladadlo.h" #include <fstream> class serial:public ogladadlo{ public: virtual void prezentujsie(); virtual void save(std::fstream &plik); ...
#include <stdio.h> #include <FlexLexer.h> #include "util.h" #include "errormsg.h" #include "tokens.h" //int yylex(void); [> prototype for the lexing function <] std::string toknames[] = { "ID", "STRING", "INT", "COMMA", "COLON", "SEMICOLON", "LPAREN", "RPAREN", "LBRACK", "RBRACK", "LBRACE", "RBRACE", "DOT",...
/*In this program we will be seeing about STRING in C++ Program*/ /*C++ provide 2 types of String representations: 1) C- Style Character string - which is as similar in C Program. 2) The string Class type which is specially introduced with Standard C++. */ /*Strings in C++ Programming is also know as a One Dimensi...
#include <stdlib.h> #include "Mesh.h" void mesh_read(const char* filename, Mesh& out); int main(int argc, char **argv) { Mesh mesh; mesh_read("box.m", mesh); system("pause"); return 0; }
// Created on: 1993-06-07 // Created by: Jacques GOUSSARD // 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 G...
/*! \file */ //Copyright 2011-2016 Tyler Gilbert; All Rights Reserved #ifndef DRAW_ANIMATION_HPP_ #define DRAW_ANIMATION_HPP_ #include "Drawing.hpp" namespace draw { class AnimationAttr { public: AnimationAttr(); enum { PUSH_LEFT = SG_ANIMATION_TYPE_PUSH_LEFT, PUSH_RIGHT = SG_ANIMATION_TYPE_PUSH_RIGHT, PUSH...
#include <bits/stdc++.h> using namespace std; long long int mino=INT_MAX,maxo=INT_MIN,dife,n,i; int main() { ios_base::sync_with_stdio(0); cin.tie(0); for(i=0;i<10;i++){ cin >> n; if(n < mino) mino = n; if(n > maxo) maxo = n; } cout << mino << " " << maxo << " " << (maxo-mino) ;...