text stringlengths 8 6.88M |
|---|
//Author: Benjamin Kleinberg
#include "int.h"
#include<iostream>
#include<fstream>
using std::ostream;
using std::istream;
using std::ifstream;
const Int Int::INF(1, 1);
const Int Int::N_INF(-1, 2);
const Int Int::NAN(0, 3);
int Int::displayASCII = 0;
/**
* Private constructor for setting up constants
* @param va... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* @author Arjan van Leeuwen (arjanl)
*/
#include "core/pch.h"
#include "adjunct/m2/s... |
#ifndef SERVER_AUTHORIZATIONMANAGER_H
#define SERVER_AUTHORIZATIONMANAGER_H
#include <boost/property_tree/ptree.hpp>
#include "BaseManager.h"
#include "src/server/lib/Connection/BaseConnection.h"
class AuthorizationManager: public BaseManager {
public:
~AuthorizationManager() override = default;
boost::prope... |
#include<iostream>
using namespace std;
class base{
public:
base(){
cout<<endl<<"In BASE=1";
}
~base(){
cout<<endl<<"In BASE=1";
}
};
class derived1:public base{
public:
derived1():base(){
cout<<endl<<"In DERIVED=1";
}
~derived1(){
cout<<endl<<"In DERI... |
#pragma once
#ifndef IMAGIO_IMAGIO_H
#define IMAGIO_IMAGIO_H
namespace imagio {
void init();
int draw();
void draw_main_menu();
}
#endif |
#include<iostream>
#include<fstream>
using namespace std;
void function(int *arr,int size,ofstream fout)
{
for(int i=0;i<size;i++)
{
cin>>*( arr + i );
}
for(int i=0; i<size-1; i++)
{
for(int j=i+1; j<size; j++)
{
if(arr[j] < arr[i])
{
... |
#ifndef __ModuleSceneWater_H__
#define __ModuleSceneWater_H__
#include "Module.h"
#include "Animation.h"
#include "SDL_mixer/include/SDL_mixer.h"
#pragma comment(lib,"SDL_mixer/libx86/SDL2_mixer.lib")
struct SDL_Texture;
class ModuleSceneWater : public Module
{
public:
ModuleSceneWater();
~ModuleSceneWater();
v... |
#include "gb_sdl.h"
#include "gb_cpu.h"
struct timeval t1, t2;
struct display display;
struct sdl_joypad joypad;
Sdl_emu_keys emu_keys;
unsigned int frames;
using namespace std;
unsigned char buttons;
unsigned char direction;
void sdl_init(Sdl_params p) {
/* video init */
SDL_SetMainReady();
SDL_Init(SDL_INIT... |
#ifndef MEETINGGROUP_H
#define MEETINGGROUP_H
class MeetingGroup
{
public:
MeetingGroup();
private:
/* admin
* members list
* calendar
* last date revised
* meet time chosen
*/
};
#endif // MEETINGGROUP_H
|
/********************************************************************************
** Form generated from reading UI file 'fluidpropertywidget.ui'
**
** Created by: Qt User Interface Compiler version 5.7.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
*******************************... |
// BEGIN CUT HERE
// PROBLEM STATEMENT
//
// You will be given a vector <int> a and two ints lower and
// upper. Return the number of integers between lower and
// upper, inclusive, that are multiples of all members of a.
//
//
// DEFINITION
// Class:CommonMultiples
// Method:countCommMult
// Parameters:vector <i... |
#include<iostream>
using namespace std;
int main()
{
int p,o,cnt;
cout<<"Enter no. of arrays you want:\n";
cin>>p;
int arr[10];
for(int i=0;i<p;i++)
{
cout<<"\nEnter no. of elements of "<<i+1<<" array:\n";
cin>>o;
cout<<"Enter its elements:\n";
for(int j=0;j<o;j++)
{
cin>>arr[j];... |
// Created on: 1999-03-24
// Created by: data exchange team
// Copyright (c) 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 ... |
#ifndef _UpdateMoneyProc_H_
#define _UpdateMoneyProc_H_
#include "../IProcess.h"
class Table;
class Player;
class UpdateMoneyProc : public IProcess
{
public:
UpdateMoneyProc(){};
virtual ~UpdateMoneyProc(){};
virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket,Context* pt ) ;... |
#include "githabic.h"
#include <iostream>
using namespace std;
int task2(){
int a,b;
cout << "Used task 11 (IF) from Abramyan book" << endl;
cout << "Enter A:" << endl;
cin >> a;
cout << "Enter B:" << endl;
cin >> b;
if (a == b) {
a = 0;
b = 0;
}
els... |
#include<iostream>
void searchArray (int arr[11],int&,int&,int);
int main () {
std::cout<<"\nUnenq hetevyal zangvacy ";
int arr[11] = {1,3,5,7,9,11,13,15,17,19,21};
for (int i = 0; i < 11; ++i){
std::cout<<arr[i]<<" ";
}
std::cout<<"\n\nGreq tiv cragiry kvoroni ayn zangvaci mej - ";
int arg;... |
/**
* ====================================================================
* recorder.h
*
* Copyright (c) 2005 Nokia Corporation
*
* 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
*
* ... |
// Copyright (c) Martin Schweiger
// Licensed under the MIT License
//=============================================================================
// VideoTab class
//=============================================================================
#define OAPI_IMPLEMENTATION
#include <windows.h>
#include <commctrl.h>
... |
/*
* Copyright (c) 2011 Dan Wilcox <danomatika@gmail.com>
*
* BSD Simplified License.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
*
* See https://github.com/danomatika/ofxAppUtils for documentation
*
*/
#pragma once... |
// BEGIN CUT HERE
// PROBLEM STATEMENT
//
// Division is an expensive operation for a computer to
// perform, compared to addition, subtraction, and even
// multiplication.
// The exception is when dividing by powers of 2, because
// this can be done either with a bit shift (for a fixed-
// point value) or by subtr... |
#include <vector>
#include <iostream>
#include <limits>
using namespace std;
long long getArea() {
int count;
cin >> count;
long long minX = LLONG_MAX;
long long maxX = LLONG_MIN;
long long minY = LLONG_MAX;
long long maxY = LLONG_MIN;
for (int i = 0; i < count; ++i) {
long long x;
long long y;
cin >>... |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int Q,x,t;
cin>>Q;
set<int> s;
set<int>::iterator itr;
for(int i = 0 ; i <... |
#include "Leimaaja.h"
Leimaaja::Leimaaja() // Leimaaja kysyy muodostuessaan linjan numeron, jonka matkoja leimaa.
{
cout << "Anna linjan numero: ";
linja = getIntFromStream();
omistajanNimi = std::deque<string>();
}
void Leimaaja::leimaa(Matkakortti& kortti, Matkatyyppi matkatyyppi) {
if (kortti.matku... |
#include "Arduino.h"
#define LEN_BUF 32
static uint8_t rxHead , rxTail, rxBuf[LEN_BUF];
Uart Serial;
extern void UART0_IRQHandler(void)
{
uint32_t Status = LPC_USART0->STAT;
if (Status & RXRDY) {
uint8_t p = rxHead;
rxBuf[p++] = LPC_USART0->RXDATA;
if (p >= LEN_BUF) p = 0;
if (p != rxTail)
rxHead = p;... |
#include "drone.h"
#include "gps.h"
GPSSensor *gps_sensor;
Drone *drone;
void setup() {
gps_sensor = new GPSSensor();
drone = new Drone(gps_sensor);
// gps_sensor.initialize();
drone->initialize();
}
void loop() {
drone->update();
} |
#ifndef UNIT_H
#define UNIT_H
#include <iostream>
#include <string>
#include "../states/UnitState.h"
#include "../states/Observable.h"
#include "../attacks/UnitAttack.h"
class UnitAttack;
class Observable;
class Unit {
private:
std::string unitType;
std::string unitMutation;
UnitState* u... |
//
// CarAccumulator.h
// ofApp
//
// Created by Omer Shapira on 31/03/13.
//
//
#ifndef __ofApp__Accumulator__
#define __ofApp__Accumulator__
#include <iostream>
#include "ofMain.h"
#include "ofxCV.h"
#include "Car.h"
using namespace cv;
#endif /* defined(__ofApp__Accumulator__) */
class CarAccumulator {
pub... |
#include <core/None.h>
#include <core/Union.h>
#include <core/is_in.h>
#include <core/sequence/concat.h>
#include <core/sequence/count.h>
#include <core/to.h>
#include <launcher/extends/core/To.h>
#include <qt/QtCore/QJsonDocument>
#include <qt/QtCore/QJsonObject>
namespace core {
Union<QJsonObject, None, bool, doubl... |
/**
* \file
*
* \brief This file should be at the top of the file hierarchy.
*/
/// A top level structure that should be at the root of the class hierarchy.
struct top_level {
/**
* \brief Creates a top_level structure.
*
* \param name
* The name of this top-level structure. See \ref m... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, count = 0, a, count_z = 0;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a;
if (a == 5)
{
count += 1;
}
}
count_z = n - count;
count -= count % 9;
if (count_... |
#ifndef _MSG_0X05_ENTITYEQUIPMENT_STC_H_
#define _MSG_0X05_ENTITYEQUIPMENT_STC_H_
#include "mcprotocol_base.h"
#include "slotdata.h"
namespace MC
{
namespace Protocol
{
namespace Msg
{
class EntityEquipment : public BaseMessage
{
public:
EntityEquipment();
EntityEquipment(int32_t _entityId, int16_t _slot, SlotData... |
/*
写到文件中的时候用另外一个线程来执行
*/
#include "XLog.h"
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <stdarg.h>
#include <assert.h>
#include <thread>
#include <mutex>
#include <assert.h>
#include <ctime>
#include <time.h>
#include <string.h>
#include <fstream>
#ifndef PLATFORM... |
#include <iostream>
using namespace std;
class A
{
public:
virtual void show();
void hao();
};
void A:: show()
{
cout << " in the A" << endl;
}
void A::hao()
{
cout << "hao in the A" << endl;
}
class B: public A
{
public:
virtual void show();
void hao();
};
void B... |
#ifndef GAME_COMPONENT_H
#define GAME_COMPONENT_H
class GameComponent
{
public:
GameComponent();
virtual ~GameComponent();
//Function: Initialize GameComponent
//PostCondition: GameComponent Initialize
virtual void Initialize() = 0;
//Function: Update GameComponent
//PostCondition: GameComponent is updated
v... |
#include<bits/stdc++.h>
using namespace std;
const int MAX_CHAR = 26;
char stringPalindrome(string A, string B);
int main(){
int n, m;
cin>>n>>m;
string w, s;
int temp = 0;
string str;
cin>>str;
while(m--){
string s;
cin>>s;
for(int i = 0; s[i] = '\0'; i++){
... |
#include<iostream>
#include<stdlib.h>
#include<fstream>
#include<unistd.h>
#include<errno.h>
#include<sys/types.h>
#include <fcntl.h> /* For O_* constants */
#include <sys/stat.h> /* For mode constants */
#include <sys/mman.h>
#include <sstream>
#include <string.h>
#include <cstring>
#include <netdb.h>... |
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
/*
* Runs O(a + b);
* Space O(a);
*
* The book mentions starting from the back, which would provide
* a much better solution that the one implemented below
*
*/
template <typename T>
void merge_sorted(vector<T>& sorted_a, vector<T>& s... |
//
// Created by fab on 27/02/2020.
//
#ifndef DUMBERENGINE_CUBE_HPP
#define DUMBERENGINE_CUBE_HPP
class Cube
{
public :
enum CubeType
{
CUBE_HERBE = 1,
CUBE_TERRE,
CUBE_BOIS,
CUBE_PIERRE,
CUBE_EAU,
CUBE_VERRE,
CUBE_PLANCHE_01,
CUBE_PLANCHE_02,
... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "MWSmoothCameraComponent.h"
#include "Camera/CameraComponent.h"
#include "GameFramework/SpringArmComponent.h"
UMWSmoothCameraComponent::UMWSmoothCameraComponent()
{
PrimaryComponentTick.bCanEverTick = true;
PrimaryComponentTi... |
//: C15:PureVirtualDestructors.cpp
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
// Czysto wirtualny destruktor
// wymaga zdefiniowania kodu
#include <iostream>
using namespace std;
class Pe... |
#include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_set>
using namespace std;
struct Trie
{
Trie* child[26];
string word = "";
Trie() {
for (int i = 0; i < 26; i++)
child[i] = nullptr;
}
};
class Solution {
public:
vector<string> res;
vector<string> findWords(vector<vector<char>>& boar... |
#ifndef _SCENE_H_
#define _SCENE_H_
#include "triangle.h"
#include <vector>
using namespace std;
class Scene {
public:
void loadScene(char* file);
void loadBlend(const char*file);
void getpoint(string a, int(&b)[3]);
int Scene::getBlend(string name);
void addLight(PointLight light);
vector<Vector> pointList;
... |
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#define pb push_back
using namespace std;
struct toado {
int h, c;
};
toado huong[8] = {-1, 0
, -1, 1
, 0, 1
... |
#include "log_server.hpp"
#include "scene/scened.hpp"
#include "net/stream.hpp"
#include "utils/service_thread.hpp"
#include "utils/exception.hpp"
#define SLOGSERVER_TLOG __TLOG << setw(20) << "[SLOGSERVER] "
#define SLOGSERVER_DLOG __DLOG << setw(20) << "[SLOGSERVER] "
#define SLOGSERVER_ILOG __ILOG << setw(20) << "[... |
// Copyright Ralf W. Grosse-Kunstleve 2002-2004. 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 <boost/python/class.hpp>
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
#include <boost/... |
// Created on: 1997-10-22
// Created by: Philippe MANGIN
// 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 <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define INF 10e17 // 4倍しても(4回足しても)long longを溢れない
#de... |
//: C09:Access.cpp
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
// Funkcje inline jako funkcje udostepniajace
class Access {
int i;
public:
int read() const { return i; }
void set(in... |
#include <stdio.h>
int main() {
float s;
char k;
printf("Enter R for translation from radians to degrees\n");
printf("Enter D for translation from degrees to radians\n");
scanf("%f%c", &s, &k);
if (k == 'D')
{
s = (s*3.14) / 180;
printf("%f radians\n", s);
}
if... |
/*
========================================================================
DEVise Data Visualization Software
(c) Copyright 1992-1996
By the DEVise Development Group
Madison, Wisconsin
All Rights Reserved.
========================================================================
Under no circumstances ... |
// Created on: 1993-07-06
// 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 ... |
const int buttonPin1 = 2;
const int buttonPin2 = 3;
const int ledPin1 = 9;
void setup() {
pinMode(buttonPin1, INPUT);
pinMode(buttonPin2, INPUT);
pinMode(ledPin1, OUTPUT);
digitalWrite(buttonPin1,HIGH);
digitalWrite(buttonPin2,HIGH) ;
}
int ledBrightness = 128;
void loop() {
if(digitalRead(buttonPin1) ==... |
//
// Created by Yevhenii Natalenko on 5/2/17.
//
#ifndef INC_3_KOSARAJU_H
#define INC_3_KOSARAJU_H
#include "GraphFormat.h"
bool compare(int a, int b); // comparator for stable_sort
void add_Edge(std::vector<std::vector<int> >& graph, int v, int w); // manual construction
std::vector<std::vector <int> > reverse_g... |
// Created on : Sat May 02 12:41:14 2020
// Created by: Irina KRYLOVA
// Generator: Express (EXPRESS -> CASCADE/XSTEP Translator) V3.0
// Copyright (c) Open CASCADE 2020
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it un... |
#ifndef PWM_CLASS_H
#define PWM_CLASS_H
class PWM_CLASS
{
public:
PWM_CLASS(int factor_umplere ,int frecventa);
void set (int factor_umplere,int frecventa);
int getDutyCycle();
int getFrequency();
private:
int frecventa;
int factor_umplere;
};
#endif // PWM_CLASS_H |
//
// Created by Lee on 2019-04-19.
//
#ifndef UBP_CLIENT_CPP_VER_PHOTOVIEWER_H
#define UBP_CLIENT_CPP_VER_PHOTOVIEWER_H
#include <QLabel>
#include <QPixmap>
#include <src/model/Photo.h>
class PhotoViewer : public QLabel {
Q_OBJECT
private:
Photo photo;
public:
explicit PhotoViewer(QWidget * parent = nullptr, P... |
// Created on: 1993-03-23
// Created by: Jean Yves LEBEY
// 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 GN... |
/* -*- Mode: c++; tab-width: 4; 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 Arjan van Leeuwen (arjanl)
*/
#ifndef MAILTO_H
#define MAILTO_H
/** @brief... |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define pi acos(-1.0)
using namespace std;
typedef long long L... |
#pragma once
#include <stack>
#include "IMemoryManager.h"
#include "StdMemoryManager.h"
//bool STD_NEW_DELETE = true;
class MemoryManagerSwitcher {
public:
MemoryManagerSwitcher() : recManager(new(malloc(sizeof(StdMemoryManager))) StdMemoryManager()) {};
MemoryManagerSwitcher(const MemoryManagerSwitcher&) = delete;... |
// CodeGear C++Builder
// Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc.
// All rights reserved
// (DO NOT EDIT: machine generated header) 'Dcrhexeditorex.pas' rev: 21.00
#ifndef DcrhexeditorexHPP
#define DcrhexeditorexHPP
#pragma delphiheader begin
#pragma option push
#pragma option -w- // All warn... |
#include <iostream>
#include <g2o/core/g2o_core_api.h>
#include <g2o/core/base_vertex.h>
#include <g2o/core/base_unary_edge.h>
#include <g2o/core/block_solver.h>
#include <g2o/core/optimization_algorithm_levenberg.h>
#include <g2o/core/optimization_algorithm_gauss_newton.h>
#include <g2o/core/optimization_algori... |
#include "Iwriter.h"
#include <iostream>
void Consolewriter::write(std::string data)const
{
std::cout<<m_color.substr(0,7)+data+m_color.substr(11)<<std::endl;
}
void Consolewriter::setColor(std::string color)
{
m_color = color;
} |
/*****************************************************************************************************************
* File Name : equilibriumIndex.h
* File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\sites\geeksforgeeks\arrays\page06\equilibriumIndex.h
* Created on : Jan 6, 2014 :: 10:17:09 PM... |
#include "global.h"
float correction_inclined_plane_boundary(float dr,const float &at0,const float &atI,const float &w) {
if (atI <= -1)
return dr;
if (at0 <= atI)
return dr;
float sina = (at0 - atI)*w;
if (abs(sina)>1)
sina = 0;
else
sina = sqrtf(1-SQR(sina));
return dr*sina;
}
float simple_plane_w... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2004-2010 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 SUPPORT_PROBETOOLS
#include "module... |
#include <iostream>
#include <fstream>
#include <iomanip>
#include "AIM.h"
using namespace std;
int main(int argc, char* argv[]) {
int Lx = 256;
int Ly = 100;
double beta = 1.9;
double eps = 0.;
double rho0 = 6;
double h0 = 0.1;
int t_half = 100;
int n_period = 500;
unsigned long long seed = 5;
ru... |
#include "quest.hpp"
namespace nora {
namespace scene {
pd::result quest_check_commit(uint32_t pttid, const role& role) {
const auto& ptt = PTTS_GET(quest, pttid);
if (!role.quest_has_accepted(ptt.id())) {
return p... |
#pragma once
#include "texture/texture.h"
#include "math/vertex.h"
#include "vfs/vfs.h"
#include "q3shader/q3shader.h"
namespace q3bsp
{
struct BSPFace
{
int type;
int vertex;
int numverts;
int meshvertex;
int nummeshverts;
D3DXVECTOR3 nrm;
int texture;
int lightmap;
int size[2];
};
struct BSPN... |
void setup() {
pinMode(7, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(7, HIGH);
delay(82);
digitalWrite(7, LOW);
delay(30);
digitalWrite(7, HIGH);
delay(82);
digitalWrite(7, LOW);
delay(296);
}
|
#include "stdafx.h"
#include "CLog.h"
#include "IOCPHelper.h"
#include <iostream>
#include <string>
CLog::CLog()
{
m_logfile = "log.txt";
m_bOpened = false;
pData = NULL;
}
CLog::~CLog()
{
CloseLog();
SAFE_DELETE(pData);
}
CLog* CLog::pInstance = NULL;
CLog * CLog::Instance()
{
if (pInstance == NULL)
{
pInst... |
#include <iostream>
#include <vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
vector<pair<char,int>> res;
int n,m;
cin>>n>>m;
string s;
cin>>s;
for(int i=0;i<n;i++){
if(res.size()==0){
res.push_back(make_pair(s[i],1));
}
... |
#include "ThreadPool.hpp"
Elysium::Threading::ThreadPool::ThreadPool()
: Elysium::Core::Object()
{
}
Elysium::Threading::ThreadPool::~ThreadPool()
{
}
|
#include "gromacstoolsdefinition.h"
#include <cstddef>
#include <QFile>
#include <QTextStream>
#include <QDomDocument>
GromacsToolsDefinition & GromacsToolsDefinition::GetInstance()
{
static GromacsToolsDefinition instance;
return instance;
}
GromacsToolsDefinition::GromacsToolsDefinition() :
_globalConf... |
/*
*Ultrasonic.h - Library for HC-SR04 Ultrasonic sensor module
*@Author:draon
*@DATA:2013-8-7
*Company website:www.elecfreaks.com
*/
#ifndef _ULTRASONIC_H_
#define _ULTRASONIC_H_
#include <stddef.h>
#if defined(ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#else
#include <Wprogram.h>
#endif
... |
#include <iostream>
using namespace std;
class complex {
private:
int re, im;
public:
complex(int r, int i): re(r), im(i)
{
cout<< "constructor called" << endl;
}
complex(const complex&);
complex operator+(const complex&);
complex operator*(const complex&);
int operator==(const complex&);
//comp... |
// Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
//
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.... |
// Copyright 2017 Elias Kosunen
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to ... |
// HashDemo.cc
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <iomanip>
#include <functional>
#include <unordered_set>
#include "hash.h"
void HashTest(){
expression::HashContent plus_op("plus", 2);
expression::HashContent minus_op("minus", 2);
expression::HashContent m... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* 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.
*/
#include "core/pch.h"
#include "modu... |
#ifndef MOVETHING_H
#define MOVETHING_H
#include "direction.h"
#include <QRect>
class MoveThing {
public:
MoveThing();
MoveThing(int x,
int y,
int width,
int height,
int directio_n,
int _moveSpeed);
virtual void ... |
#pragma once
#include "utils/ptts.hpp"
#include "proto/config_item.pb.h"
using namespace std;
namespace pc = proto::config;
namespace nora {
namespace config {
using item_ptts = ptts<pc::item>;
item_ptts& item_ptts_instance();
void item_ptts_set_funcs();
... |
int Solution::reverse(int A) {
if (A > INT_MAX || A < INT_MIN)
return 0;
int rev = 0;
int a = abs(A);
while (a)
{
int digit = a % 10;
if (rev > (INT_MAX / 10) || (rev == INT_MAX / 10 && digit > INT_MAX % 10))
return 0;
rev *= 10;
rev += digit;
a /= 10;
}
if (A < 0)
rev *= -1;
return rev... |
#ifndef SCC_H
#define SCC_H
/*
* SCC.h
*
* Defines the SCC coprocessor
*
*/
// includes
#include <Coprocessor.h>
#include <Register.h>
#include <vector>
#include <functional>
// forward declaration
class cpu;
// scc: cop0, deals with exception handling and memory management
class scc : public coprocessor
{
//... |
/**
* @file filter2D_demo.cpp
* @brief Sample code that shows how to implement your own linear filters by using filter2D function
* @author OpenCV team
*/
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
using namespace cv;
/**
* @function main
*/
int main ( int ar... |
/*
Name : Aman Jain
Date : 15-07-2020
Question-> https://www.geeksforgeeks.org/largest-sum-contiguous-subarray/
Time complexity : O(n)
Space Complexity : O(1)
*/
#include<bits/stdc++.h>
using namespace std;
long long kandaneAlgo(long long *arr, int n){
long long curr_sum=arr[0];
long long max_sum=arr[0... |
#include<netinet/in.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<unistd.h>
#include<iostream>
#include<arpa/inet.h>
#define SER... |
/*
* stbst.h
*
* Date Author Notes
* =====================================================
* 2014-04-14 Kempe Initial version
* 2015-04-06 Redekopp Updated formatting and removed
* KeyExistsException
*/
#include <iostream>
#include <exception>
#include <cstdlib>
#includ... |
#pragma once
#include "CoreMinimal.h"
#include "Engine/DataTable.h"
#include "Struct/NpcDialogInfo/NpcDialogInfo.h"
#include "NpcInfo.generated.h"
USTRUCT(BlueprintType)
struct ARPG_API FNpcInfo :
public FTableRowBase
{
GENERATED_USTRUCT_BODY()
public:
// Npc 이름
UPROPERTY(EditAnywhere, BlueprintReadWrite)
F... |
/************************************************************************
Class Name: qIFunctionManager
Date: 10/30/02
Purpose: This is the interface for the Function Manager classes, which
are StateManager and ProcessManager. The only thing that differs between
the two classes is the process function, so I decided to ... |
#include <SFML/Window.hpp>
#include <iostream>
#define GLEW_STATIC
#include <GL/glew.h>
using namespace std;
void initGlew();
int main()
{
sf::ContextSettings settings;
settings.depthBits = 24;
settings.stencilBits = 8;
settings.antialiasingLevel = 2;
sf::Window window(sf::VideoMode(800, 600), "OpenG... |
/*
plot lines and wind
last modify:2010 10 14
*/
#ifndef _PLOT_PANEL_
#define _PLOT_PANEL_
#include "wx/wx.h"
#include "wx/sizer.h"
#include "wx/listctrl.h"
#include "main-frame.h"
class PlotPanel : public wxPanel
{
wxListCtrl * list1;
wxButton * button1;
MyFrame * pant;
public:
PlotPanel(wx... |
/*
* @Description: 从点云中截取一个立方体部分
* @Author: Ren Qian
* @Date: 2020-03-04 20:09:37
*/
#ifndef LIDAR_LOCALIZATION_MODELS_CLOUD_FILTER_BOX_FILTER_HPP_
#define LIDAR_LOCALIZATION_MODELS_CLOUD_FILTER_BOX_FILTER_HPP_
#include <pcl/filters/crop_box.h>
#include "lidar_localization/models/cloud_filter/cloud_filter_interfa... |
#include <string.h>
#include "hitmap.h"
HitMap::HitMap(const struct xfm &xfm_, unsigned x, unsigned y)
: hm_xfm(xfm_)
, dimx(x)
, dimy(y)
{
init_img();
}
HitMap::HitMap(unsigned x, unsigned y)
: dimx(x)
, dimy(y)
{
init_img();
}
HitMap::~HitMap()
{
for (unsigned i = 0; i < dimy; i++) delete img[i];
delete [... |
/*
Copyright (c) 2015, M. Kerber, D. Morozov, A. Nigmetov
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditio... |
#pragma once
#include "Pipeline.h"
#include "PreDefine.h"
#include "mathlib.h"
#include <vector>
#include "effect.h"
#include "GbufferPipeline.h"
#include "ShowTexturePipeline.h"
using namespace HW;
class SSAOEffect :public PipelineEffect{
public:
virtual void Init();
virtual void Render();
void createSample();
vo... |
#pragma once
#include "formatter.hpp"
namespace elog
{
class PatternFormatter: public Formatter
{
public:
PatternFormatter(const char* pattern = "%+", bool colored = false);
virtual ~PatternFormatter();
std::string format(const Record& record) override;
private:
std::string pattern_;
bool ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 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 SYSTEM_INPUT_DESKTOP_H
#define SYSTEM_INPUT_DESKTOP_H
#includ... |
#include "Door.h"
Door::Door(Connection* c1, Connection* c2)
{
img = QImage(GlobalStats::GetDoorIcon()).mirrored();
this->setPixmap(QPixmap::fromImage(img));
connections[0] = c1;
connections[1] = c2;
c1->addWallItem(this);
c2->addWallItem(this);
vertMirrored = false;
updatePositions();
}
double Door::cal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.