text stringlengths 8 6.88M |
|---|
#include "BooleanFieldDescriptorContainer.h"
#include <google/protobuf/message.h>
#include <sstream>
using namespace std;
using namespace google;
using namespace protobuf;
QWidget * BooleanFieldDescriptorContainer::getWidget(QWidget * parent)
{
if(m_check == NULL)
{
m_check = new QCheckBox... |
#include "MyDebugger.h"
int main()
{
/*选择要调试的程序*/
SelectProcdure();
/*进行调试循环*/
DebugLoop();
return 0;
}
/*输出错误信息*/
VOID DisplayError(char* Infor)
{
char buf[MAX_PATH] = { 0 };
sprintf_s(buf, "%s\n%d", Infor, GetLastError());
MessageBoxA(NULL, buf, "ERROR!", MB_ICONEXCLAMATION);
exit(EXIT_SUC... |
//: C12:ReflexivityInOverloading.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
class Number {
int i;
public:
Number(int ii = 0) : i(ii) {}
const Number
operator+(const Number& n) ... |
#include <chuffed/core/propagator.h>
#include <map>
#include <utility>
#define DEBUG 0
#define PREPROCESS 1
#define CALC_SCC 1
#define COMPLETE 1
#define ADD_CLAUSES 0
#define FLIP_NEG 1
using namespace std;
class ConjRule {
public:
int head;
int sz;
Lit body_lit;
int w;
int body[0];
ConjRule(int h, vec<int>... |
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
class Record {
public:
std::string term;
int docid;
int freq;
Record(std::string, int, int);
}; |
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2011.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#include <itkImageFileWriter.h>
#include <itkImageFileReader.h>
#include ... |
#include "fastslam1_sim.h"
#include "read_input_file.h"
#include "particle.h"
#include "fastslam1_utils.h"
#include "configfile.h"
#include <cstdlib>
int main (int argc, char *argv[])
{
double *lm = NULL; // landmark positions
size_t lm_rows = 0;
size_t N_features = 0;
if (argc < 2)
return -... |
#include <iostream>
#include <stdlib.h>
#include <fstream>
#include <iterator>
#include <string>
#include <vector>
#include <cmath>
#include <opencv2/opencv.hpp>
#ifndef EVALUATOR_H
#define EVALUATOR_H
class evaluator
{
public:
evaluator(cv::String name_file, float a, float b);
int test(cv::Point p, cv::Mat frame... |
#include<stdio.h>
#include<conio.h>
#include<string.h>
void intercalarArchivos(FILE*,FILE*,FILE*);
int main(int argc,char *argv[])
{
FILE *f1,*f2,*f3;
f1=fopen(argv[1],"r");
f2=fopen(argv[2],"r");
f3=fopen(argv[3],"a");
intercalarArchivos(f1,f2,f3);
return 0;
}
void intercalarArchivos(FILE *in1,FILE *in2,FILE *... |
#pragma once
#include <valarray>
#include <utility>
#include <string>
using std::string;
using ArrayInt=std::valarray<int>;
using PairArray=std::pair<ArrayInt, ArrayInt>; //PairArray=pair< valarray<int>,valarray<int> >
class Wine
{
string name;
PairArray pair;
int numYears;
public:
Wine(const char* l, int y, cons... |
/*
ID: stevenh6
TASK: spin
LANG: C++
*/
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
ofstream fout("spin.out");
ifstream fin("spin.in");
struct wheel
{
int rspeed;
int wedges;
int angle[5];
int extent[5];
};
int main()
{
int tot = 0;
int fill[360];
whee... |
// 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 Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with spe... |
#include <log4cplus/logger.h>
#include <log4cplus/loglevel.h>
#include <log4cplus/loggingmacros.h>
#include <log4cplus/configurator.h>
#include <iomanip>
void printMessages(log4cplus::Logger const & logger)
{
// Print messages using all common log levels.
LOG4CPLUS_TRACE (logger, "printMessages()");
LOG4CPLUS_DE... |
#include<iostream>
using namespace std;
int main()
{
cout<<"Enter your name."<<endl;
string name;
cin>>name;
cout<<"Welcome to the world of competitive coding!"<<" "<<name;
return 0;
} |
#pragma once
#include<string>
#include<set>
#include"MarcoDef.h"
using namespace std;
class Node
{
public:
Node(string node_name);
Node(int node_id, string node_name, string node_value);
virtual ~Node();
virtual bool operator<(const Node& n)const;
ATTRIBUTE_MEMBER_FUNC(int, node_id);
ATTRIBUTE_MEMBER_FUNC(string,... |
//===-- utils/range-map.hh - RangeMap class definition ---------*- C++//-*-===//
//
// ODB Library
// Author: Steven Lariau
//
//===----------------------------------------------------------------------===//
///
/// \file
/// Map with whole range of keys that have the same associated value
///
//===--------------------... |
#include <string>
#include <iostream>
using namespace std;
class LeftOrRight
{
private:
int count(const string &program,char W)
{
int num = 0;
int ans = 0;
for (int i=0; i<program.size(); ++i) {
if (program.at(i) == W) {
--num;
}
else {
++num;
}
ans = max(ans,abs(num));
}
return ans... |
/* -*- 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 UNIFORM_GRID_SIZER_H
#define UNIFORM_GRID_SIZER_H
#inclu... |
#pragma once
#include "stdafx.h"
#include "Question.h"
namespace qp
{
class CTypeInQuestion :
public CQuestion
{
public:
LOKI_DEFINE_CONST_VISITABLE()
CTypeInQuestion(std::string const& description, std::set<std::string> const& answers, double score = 0.0);
~CTypeInQuestion();
std::set<std::stri... |
//
// Created by Omer on 18/01/2018.
//
#include "../MtmSet.h"
#include "../testMacros.h"
using namespace mtm;
bool testIteratorDereference() {
MtmSet<int> set;
MtmSet<int>::iterator i;
ASSERT_EXCEPTION((*i == 2), NodeIsEndException);
i = set.insert(2);
ASSERT_TRUE(*i == 2);
// TODO: check... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2004 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 GADGET_SUPPORT
#ifdef WIDGET_CONTRO... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
//
// Copyright (C) 2003-2007 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 <wintrust.h>
#include <Softp... |
/*
** EPITECH PROJECT, 2019
** OOP_indie_studio_2018
** File description:
** Menu
*/
#include "Menu.hpp"
#include "Assets.hpp"
#include <unistd.h>
Menu::Menu(Core *core)
{
// this->_game = game;
this->_core = core;
}
Menu::~Menu()
{
}
void Menu::MenuInit()
{
this->_core->addImage(Assets::FILES::BACKGROU... |
#include <ctime>
#if defined(OBLIVION)
#include "obse_common\SafeWrite.h"
#include "obse\GameOSDepend.h"
//#include "obse\GameData.h"
#elif defined(NEWVEGAS)
#include "nvse\SafeWrite.h"
//#include "nvse\GameData.h"
#endif
static const UInt32 kRenderShadowMapHook = 0x0040C919;
static const UInt32 kRenderShadowMapReturn... |
// Created on: 1999-11-26
// Created by: Andrey BETENEV
// 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 Less... |
#include <iostream>
#include <string>
#include <fstream>
#include <streambuf>
#include <math.h>
#include <algorithm>
#include <range/v3/algorithm.hpp>
#include <range/v3/view.hpp>
#include <json.h>
using namespace ranges;
//not written by me
template <std::size_t N>
struct get_n {
template <typename T>
auto op... |
// never the same!!
#include <iostream>
#include <cstdio>
#include <cmath>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <iomanip>
#include <cassert>
#include <string>
#include <cstring>
//#include <boost/graph/properties.hpp>
#include <queue>
using namespace std;
using namespace std;
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2008-2012 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef THUMBNAILMANAGER_THUMBNAILVIEW_H_
#define THUMBNAILMANAG... |
#include "../JuceLibraryCode/JuceHeader.h"
#include "FoodPlan.h"
#include <memory> // std::unique_ptr, std::make_unique
#include <Poco/Data/DataException.h> // Poco::Data::ConnectionFailedException
#include <iostream> // std::cerr
#include "GlobalHeader.h"
#include <mylibs/utility.hpp> // HANDLE_EXCEPTIONS
#incl... |
// Copyright (c) 2013 Nick Porcino, All rights reserved.
// License is MIT: http://opensource.org/licenses/MIT
#pragma once
#ifndef EXTERNC
# ifdef __cplusplus
# define EXTERNC extern "C"
# else
# define EXTERNC
# endif
#endif
EXTERNC void* landruCreateEngine(char const*const workingDir);
EXTERNC void landrUDest... |
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#inc... |
#include <thread>
#include <cstring>
#include "FontImporter.h"
#define TTF_FONT_PARSER_IMPLEMENTATION
#include <ttf-parser/ttfParser.h>
FontImporter::FontImporter() {
}
FontImporter::~FontImporter() {
}
void FontImporter::import(const char* filename) {
uint8_t condition_variable = 0;
TTFFontParser::FontData... |
#ifndef MENUMODE_H
#define MENUMODE_H
#include "Mode.h"
#include "MyPurplePanelColors.h"
#include <QFile>
#include <QJSEngine>
#include <QTextStream>
class MenuMode:public Mode
{
public:
MenuMode();
virtual void update(const Ogre::FrameEvent&);
virtual void init();
virtual bool keyRe... |
#ifndef F3LIB_LODGROUP_H_
#define F3LIB_LODGROUP_H_
#include "GeometryModel.h"
#include <vector>
namespace f3
{
class LodGroup
{
public:
explicit LodGroup();
~LodGroup();
std::vector<GeometryModel> _models;
std::vector<types::Matrix> _updateMatrices;
};
} // namespace f3
#endif //... |
#include "stdafx.h"
#include "CppUnitTest.h"
#include "PredicateConstructor.h"
#include "VehicleData.h"
#include "PredicateVehicle.h"
#include "PredicateValues.h"
#include <iostream>
#include <memory>
#include <map>
#include <algorithm>
using std::unique_ptr;
using std::shared_ptr;
using std::move;
using std::make_uni... |
#define F_CPU 1000000UL
#include <util/delay.h>
#include <stdlib.h>
#include <avr/io.h>
#include <uart1.h>
#define TX PB1
typedef unsigned int uint;
int main()
{
init_uart1(F_CPU, TX);
char str[10];
uint i =0;
for(;;) {
utoa(i++, str, 10);
puts_uart1(str);
_delay_ms(400);
}
}
|
ll baby_gaient_step()
{
memset(beg,0,sizeof(beg));
m=ceil(sqrt(p*1.0));
ll rsl=1;
nList=0;
insert(1,0);
for(int i=1;i<m;++i)
{
rsl=rsl*b%p;
if(!find(rsl)) insert(rsl,i);
}
ll bm=pow_mod(b,p-m-1,p);
for(int i=0;i<m;++i)
{
if(find(n)) return i*m+get(n);
else n=mod(n,bm,p);
}
return -1;
}
|
#include <GL/glew.h>
#include <vector>
#include <graphics/Vertex.hpp>
#include <graphics/ShaderAttributes.hpp>
#include "grid.hpp"
////////////////////////////////////////////////////////////////////////////////
static std::vector<Vertex> grid_gen_vertices(Grid* grid, float x0, float z0,
float xlen, float zlen);
... |
#ifndef FastTimingSimProducers_FastTimingCommon_FTLDigitizer_h
#define FastTimingSimProducers_FastTimingCommon_FTLDigitizer_h
#include "SimFastTiming/FastTimingCommon/interface/FTLDigitizerBase.h"
#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h"
#includ... |
//
// NamedMutex.cpp
//
// $Id: //poco/1.4/Foundation/src/NamedMutex.cpp#2 $
//
// Library: Foundation
// Package: Processes
// Module: NamedMutex
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "_/NamedMutex.h"
#... |
// Copyright (c) 2020 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.1 as published
// by the Free Software Foundation, with special ... |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Myexception
{
public:
virtual void error() = 0;
};
class Out_of_range : public Myexception
{
public:
void error()
{
cout << "Out of range" << endl;
}
};
class Bad_cast : public Myexception
{
public:
void er... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
//
// Copyright (C) 2006 Opera Software AS. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
//
// Adam Minchinton
//
#ifndef __PRIVACY_MANAGER_H__
#define __PRIVACY_... |
// 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.... |
// CodeGear C++Builder
// Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc.
// All rights reserved
// (DO NOT EDIT: machine generated header) 'Dcrhexeditor.pas' rev: 21.00
#ifndef DcrhexeditorHPP
#define DcrhexeditorHPP
#pragma delphiheader begin
#pragma option push
#pragma option -w- // All warnings o... |
// Created on: 1997-07-29
// Created by: Denis PASCAL
// 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 GNU L... |
// Given a string, generate all the possible strings from the characters
#include <bits/stdc++.h>
using namespace std;
int fun(int k)
{
if(k==0 || k==1)
return 1;
else
return k*fun(k-1);
}
void strings(string s,int l,int r)
{
if (l == r)
cout<<s<<'\n';
else
{
for (... |
#include <cstdint>
#include <string>
#include <set>
#include <map>
namespace dfa {
// TYPEDEFS
typedef struct state state;
typedef struct state* state_t;
typedef struct state_set* states_t;
typedef struct state_set state_set;
typedef std::string transition_fn(std::string label, char transition);
// STRUCTS
st... |
//
// AUTHOR
// N. Nielsen
//
// LICENSE
// This software is in the public domain.
//
// The software is provided "as is", without warranty of any kind,
// express or implied, including but not limited to the warranties
// of merchantability, fitness for a particular purpose, and
// noninfringement. In no event shall ... |
// ДАННЫЙ ПРИМЕР УПРАВЛЯЕТ СВЕТОДИОДАМИ КНОПОК: // * Строки со звёздочкой являются необязательными.
//
#include "../iarduino_I2C_Keyboard.h" // Подключаем библиотеку для работы с клавиатурой I2C-fl... |
#ifndef IOREMAP_THEVOID_MONITOR_CONNECTION_P_HPP
#define IOREMAP_THEVOID_MONITOR_CONNECTION_P_HPP
#include <boost/asio.hpp>
#include <boost/array.hpp>
#include "server.hpp"
namespace ioremap {
namespace thevoid {
class monitor_connection : public std::enable_shared_from_this<monitor_connection>
{
public:
typedef bo... |
#include <iostream>
using namespace std;
template <typename Key, typename Value, typename Hash>
HashTable<Key, Value, Hash>::HashTable(const int size) :vec(size) {}
template <typename Key, typename Value, typename Hash>
void HashTable<Key, Value, Hash>::insert(const Key& key, Value&& value) {
const size_t i = has... |
#include <fstream>
#include <cmath>
#include <gtk/gtk.h>
#include <cstring>
#include <cstdlib>
using namespace std;
static int a[9][9];
static GtkWidget *wid[9][9],*janela;
void open_dialog(const char* c){
GtkWidget *dialog, *label;
dialog=gtk_dialog_new_with_buttons("Erro",GTK_WINDOW(janela),GTK_DIALOG_MODAL... |
#include<cstdio>
#include<cstring>
using namespace std;
bool f[100000];
int cash,n;
int num[11];
int w[11];
int main()
{
freopen("test.in","r",stdin);
while (scanf("%d",&cash)!=EOF)
{
scanf("%d",&n);
for(int i=1;i<=n;++i)
scanf("%d%d",&num[i],&w[i]);
memset(f,0,sizeof(f));
f[0]=1... |
/*
* PowerControllerMCB.h
* File the power controller for the motor control board
* Author: Alex St. Clair
* February 2018
*/
#ifndef POWERCONTROLLERMCB_H_
#define POWERCONTROLLERMCB_H_
#include "Arduino.h"
#include "WProgram.h"
#include "HardwareMCB.h"
#include <StdInt.h>
#include <StdLib.h>
... |
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2010.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/convenienc... |
#include "stdafx.h"
#include "../EditTool.h"
#include "../Editor.h"
#include "../Resource.h"
#include "../TerrainLightDialog.h"
#include "TerrainLightTool.h"
IMPLEMENT_DYNCREATE(CTerrainLightTool, CEditTool)
CTerrainLightTool::CTerrainLightTool()
{
m_iCurrentPageId = 0;
m_pTerrainCtrl = GetEditor()... |
/*
kamalsam
*/
#include<iostream>
#include<stdio.h>
#include<vector>
#include<queue>
#include<cstring>
using namespace std;
int vertices[2001],glob=1;
vector<int> v[2001];
bool bfs(int a)
{
queue<int> q;
q.push(a);
int cur;
vertices[a]=1;
while(q.empty()!=1)
{
cur=q.front();
q.po... |
// Q 22
#include "stdio.h"
#include "conio.h"
void main(void){
clrscr();
int val,i,fact=1;
printf("Put the value = ");
scanf("%d",&val);
for(i=val; i>=1; i--)
fact*=i
;
printf("%d is %d\n",val,fact);
getch();
} |
// -------------------------------------------
// Word
// -------------------------------------------
#include "Word.h"
Word::Word(const string& word): _word{word}
{
// throws an exception (in the form of WordContainsNoLetters object)
// indicating that the word being constructed contains no letters
if (_word... |
// RsaToolbox includes
#include "VisaBus.h"
using namespace RsaToolbox;
// C/C++
#include <cstdio>
// Qt
#include <QDebug>
#include <QByteArray>
#include <QFile>
#include <QStringList>
/*!
* \class RsaToolbox::VisaBus
* \ingroup BusGroup
* \brief Establishes a connection with an instrument via the NI-VISA bus... |
#include <stdlib.h>
#include <string.h>
#include <map>
#include "GameCmd.h"
#include "PlayerManager.h"
#include "Logger.h"
#include "Despatch.h"
#include "HallHandler.h"
#include "Util.h"
#include "Configure.h"
#include "RobotDefine.h"
#include "Protocol.h"
using namespace std;
PlayerManager::PlayerManager()
{
int s... |
#include <stdint.h>
#include <sstream>
#include "frame.h"
#include "util.h"
#include "mqttError.h"
#include <string.h>
FixedHeader::FixedHeader(MessageType type, bool dup, uint8_t qos, bool retain, uint32_t length, uint16_t id) :
type(type), dup(dup), qos(qos), retain(retain), length(length), packetID(id) {}
int64_t ... |
#ifndef NODE_H
#define NODE_H
class Node {
protected:
Node* _prev;
Node* _next;
public:
Node(void);
virtual ~Node(void);
Node prev(void);
Node next(void);
Node insert(Node*); //Insert after this
Node remove(void); //Remove this
void splice(Node*);
};
#endif NODE_H |
#include "parentstudy.h"
#include "parentMode.h"
#pragma execution_character_set("utf-8")
USING_NS_CC;
#define H_PI 1.570796327f
//#include "FlowWord.h"
#include "DropDownList.h"
#include "Timeset.h"
#include"HelloWorldScene.h"
#include"introduction.h"
Scene* parentstudy::createScene(){
// 'scene' is an auto... |
#include "Healer.h"
Healer::Healer(const std::string& name, const std::string& type, int health, int damage, int mana) : SpellCaster(type, new HealerState(name, health, damage, mana), new HealerAttack(), new Fireball(static_cast<int>(FIREBALL::HEALER)), new Healing(static_cast<int>(HEALING::HEALER))) {
std... |
#ifndef DRAWER_H
#define DRAWER_H
#include <QWidget>
#include <QPainter>
#include <QList>
#include <QPointF>
#include <QTransform>
#include <QtGlobal>
class Drawer : public QWidget
{
public:
Drawer(QWidget *parent = 0);
void setSegs(QList <QList<QPointF> > );
protected:
void paintEvent(QPaintEvent *event)... |
#include "stdafx.h"
#include "MainGame.h"
#include "TestScene.h"
#include "ResultScene.h"
MainGame::MainGame()
{
}
MainGame::~MainGame()
{
}
HRESULT MainGame::Init()
{
GameNode::Init();
isDebug = false;
// 이미지 추가
// 게임 시작화면
IMAGE->AddImage("intro", "images/intro.bmp", 0, 0,
WINSIZEX, WINSIZEY, false, RGB(2... |
#include "pch.h"
#include "Motor.h"
#include "../System/PhysicsSystem.h"
#include "Core/ComponentFactory.h"
#include "Transform.h"
#include "Core/Entity.h"
#include "Core/TimeManager.h"
namespace Hourglass
{
uint32_t Motor::s_TypeID = ComponentFactory::GetSystemComponentID();
void Motor::LoadFromXML( tinyxml2::XML... |
#ifndef __JMM_STL_QUEUE
#define __JMM_STL_QUEUE
#include "jmm_stl_deque.h"
#include "jmm_stl_vector.h"
#include "jmm_stl_function.h"
#include "jmm_stl_heap.h"
namespace JMM_STL
{
template <class T, class Sequence = deque<T>>
class queue{
friend bool operator==(const queue& x, const queue& y);
friend bool o... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2003-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#ifndef _FL_BASE_H_
#define _FL_BASE_H_
... |
/*
Sample of using OpenCV dnn module with Torch ENet model.
*/
#include <opencv2/dnn.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
using namespace cv;
using namespace cv::dnn;
#include <fstream>
#include <iostream>
#include <cstdlib>
#include <sstream>
using namespace std;
const String keys =
... |
#ifndef EXPENSE_H
#define EXPENSE_H
#include "base_entity.h"
#include "expense_category.h"
#include "user.h"
class Expense : public BaseEntity
{
Q_OBJECT
Q_PROPERTY(ExpenseCategory* category READ getCategory WRITE setCategory NOTIFY propChanged)
Q_PROPERTY(User* user READ getUser WRITE setUser NOTIFY prop... |
#include<iostream>
using namespace std;
int main()
{
int num, i, j;
cout << "Enter the numbers"<<endl;
cout<<">"; cin>>num;
while(num != 0)
{
i = num % 10;
j = j*10 + i;
num = num / 10;
}
cout<<"The reverse of the number is"<<" is "<<j;
return 0;
}
|
/*! \file */ //Copyright 2011-2016 Tyler Gilbert; All Rights Reserved
#ifndef SGFX_BITMAP_HPP_
#define SGFX_BITMAP_HPP_
#include <sgfx/sg.h>
#include "../var/Data.hpp"
#include "Region.hpp"
#include "Pen.hpp"
namespace sgfx {
/*! \brief Bitmap Class
* \details This class implements a bitmap and is
* powered by t... |
#include <iostream>
#include <ctime>
#include <fstream>
#include <vector>
#include <array>
#include <string>
#include <stdexcept>
#include <sstream>
#include <map>
using namespace std;
long long mod = pow(2, 30);
vector<vector<string>> components;
string solve(long long);
template<size_t h1, size_t wh, size_t w2> ar... |
/*
* LSST Data Management System
* Copyright 2014-2015 AURA/LSST.
*
* This product includes software developed by the
* LSST Project (http://www.lsst.org/).
*
* 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... |
#ifndef ITAK_DOSANALYZER_HPP
#define ITAK_DOSANALYZER_HPP
#include "KeyValue.hpp"
#include "Config.hpp"
#include "Analyzer.hpp"
#include "KeyCount.hpp"
#include "KeyDictionary.hpp"
#include <vector>
class DOSAnalyzer : public Analyzer {
public:
DOSAnalyzer(std::vector<Config> *configs, UserIPList *addresses);
... |
#pragma once
class ITestRoot : public DataFoundationAccess::WObject
{
private:
ITestRoot ();
~ITestRoot ();
public:
static UINT64 s_aullClassId[1];
static UINT16 s_ausAttributesCount[1];
static DataFoundationAccess::stcObjectClassList<1>
s_oclClassList;
static DataFoundation::UBi... |
//factorial
#include<iostream>
using namespace std;
int main(){
int n,sum=1;
cin>>n;
if(n==0)
{
cout<<"0";
}
else{
for(int i=1;i<=n;i++)
{
sum=sum*i;
}
cout<<sum;
}
}
|
#include <iostream>
#include <algorithm>
#include <vector>
struct Object
{
int weight;
bool mark;
};
bool cmp(Object& a, Object& b)
{
return a.weight < b.weight;
}
int main()
{
int number_of_items;
do
{
std::cout << "Enter the number of items: ";
std::cin >> number_of_items;
} while (number_of_items <= 0)... |
#pragma once
#include "common.h"
#include <iostream>
struct PerlinNoise {
unsigned char perm[256] = { 151,160,137,91,90,15,
131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
88,237,149,56,87,174,20,125,136... |
#pragma once
#include "baseflex.h"
#include "studio.h"
class CBaseCombatCharacter : public CBaseFlex
{
public:
NETVAR(m_flNextAttack, float, "CBaseCombatCharacter", "m_flNextAttack");
NETVAR(m_hActiveWeapon, int, "CBaseCombatCharacter", "m_hActiveWeapon");
NETVAR(m_hMyWeapons, void *, "CBaseCombatCharacter", "m_hMy... |
/*!
* \file messagesort.h
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Header file for the message sort
*/
#ifndef MESSAGESORT_H_
#define MESSAGESORT_H_
#include <QMetaType>
#include <QtGui>
#include <QPainter>
class MessageSort {
public:
enum EditMo... |
// Solution 1 Binary Search Pigeon Hole Principle
// mid = beg + (end - beg) / 2
// a: beg <= end beg = mid + 1 end = mid - 1 b: beg < end beg = mid + 1 end = mid
class Solution {
public:
int findDuplicate(vector<int>& nums) {
int beg = 0;
int end = nums.size() - 1;
while (beg <= en... |
#pragma once
#include "../../entity/Entity.h"
#include "../interfaces/Module.h"
#include <unordered_map>
#include <typeindex>
namespace Game
{
class EntitiesModule : public Module
{
public:
EntitiesModule();
~EntitiesModule();
void update() override;
void draw() override;
void start() override;
... |
#include <iostream>
using namespace std;
// FLoyd's algorithm
class Node
{
public:
int data;
Node *next;
Node(int value)
{
data = value;
}
};
void insertathead(Node *&head, int value)
{
Node *n = new Node(value);
Node *temp = head;
Node *prev = n;
prev->next = temp;
h... |
#ifndef GRAPH_H_
#define GRAPH_H_
#include <iostream>
#include <cassert>
#include <fstream>
#include <set>
#include <vector>
using namespace std;
class Graph{
private:
int V;
int E;
bool directed;
vector<set<int>> adj;
void isValidVertex(int v) const{
assert(v >= 0 && v < V);
}
publi... |
#pragma once
#include "Norm.h"
class FirstNorm : public Norm
{
public:
double calculateNorm(matrix & prev, matrix & current);
double calculateNorm(matrix & r);
};
|
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class WorkingRabbits
{
public:
int calcProfitSum(vector <string> profit)
{
int size = static_cast<int>(profit.size());
int sum=0;
int i,j;
for (i=0; i<size; ++i) {
for (j=i+1; j<size; ++j) {
sum += static_cast<int>(profit[i]... |
#ifndef LUZ_H
#define LUZ_H
class luz {
public:
// Construtor
luz(float x, float y, float z, float i) {
this->x = x; this->y = y; this->z = z;
this->i = i;
}
~luz(){};
// transforma a posição da luz para o sistema de coordenada da câmera
const float ... |
#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 <Poco/SharedPtr.h>
#include <Poco/Timestamp.h>
#include <Poco/JSON/Object.h>
#include "gwmessage/GWRequest.h"
#include "model/Severity.h"
namespace BeeeOn {
/**
* @brief GWNoticeRequest allows a gateway to send a notice
* about something that happen. It can report progress information,
* er... |
#include "../command.hpp"
#include <rapidjson/reader.h>
#include <worker/builder.hpp>
unsigned int computeRoot(void) {
bool * pParentExists = new bool[boost::num_vertices(theGraph)];
for (auto v : range_pair(boost::vertices(theGraph))) {
// Initialize to false.
pParentExists[v] = false;
}
for (auto... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#include "core/pch.h"
#include "module... |
// Only thing we care about is that these headers are found
#include <cuda.h>
#include <cuda_runtime_api.h>
int main()
{
return 0;
}
|
#ifndef GNOBJECT_H
#define GNOBJECT_H
#include "GnSmartObject.h"
class GNMAIN_ENTRY GnObject : public GnSmartObject
{
GnDeclareRootRTTI(GnObject);
GnDeclareAbstractStream;
public:
GnObject();
virtual ~GnObject(){};
virtual bool GetRTTINameForStream(gchar* outName, gtuint uiMaxSize);
};
#endif // GNOBJECT_H |
/* -*- 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.
*
* @author Tomasz Kupczyk (tkupczyk)
*/
#include "core/pch.h"
#incl... |
#include <iostream>
#include <Console.hpp>
#include <widgets/Window.hpp>
#include <widgets/Text.hpp>
int main() {
auto console = new Blame::Console();
console->setTitle("Dim");
auto window = new Blame::Widgets::Window(console, "Dim");
window->place(1, 1, 10, 10);
window->fullscreen();
window->... |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
/* wanted to move on since my code kept giving me runtime errors, so I looked
in discussion and found code similar to mine but that uses the multi-dimension
vector arrays more tactfully to make their code... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.