text stringlengths 8 6.88M |
|---|
#include "Count.h"
#include "../Auxiliaryfunctions.h"
bool Count::isValid(const Paramcommand& param)
{
return param.getParam().size() == 3 && (param.getParam()[1][0] == '@' || param.getParam()[1][0] == '#');
}
std::string Count::run(Iwriter &writer, Ireader& reader, dataDNA& containerDna, const Paramcommand& par... |
//C++ 0.000 1700 Accepted
#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;
typedef unsigned long long ull;
int main()
{
int tc;
scanf("%d",&tc);
for(int loop = 1; loop<=tc; loop++)
{
ull t;
scanf("%llu",&t);
double t_prime = sqrt(t);
ull ... |
#include <iostream>
#include <iomanip>
#include "class.h" // includes the prototypes
using namespace std;
ShoppingCart::ShoppingCart() //constructo intializes the private variables
{
m_totalPrice = 0.00; // intializes the total price
m_total_trans_count = 0; // intializes the total transactions
}
void ShoppingCart... |
/*
* function: the declartion of the linklist template, realize the linklist by link
*
* author: feng
* time: 2013/9/10
*/
#ifndef _LINKLIST_H
#define _LINLIST_H
#include <iostream>
#include <cstdlib>
using namespace std;
template <typename T>
class LinkList
{
private:
struct ListElement
{
T m_nValue;
... |
// 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.... |
#ifndef CAMERATHREAD_H
#define CAMERATHREAD_H
#include <QThread>
class CameraThread:public QThread
{
Q_OBJECT
void run() Q_DECL_OVERRIDE ;
public:
CameraThread(int index);
void stopCamera();
private:
int channel;
signals:
void resultReady(const QString &s);
};
#endif // CAMERATH... |
#ifndef GAMESCENE_H
#define GAMESCENE_H
#include "cocos2d.h"
#include "editor-support\cocostudio\CCSGUIReader.h"
#include "ui\CocosGUI.h"
using namespace cocos2d::ui;
using namespace cocostudio;
USING_NS_CC;
class Player;
class MonsterManager;
class ControllerPlayer;
class GameScene : public Layer
{... |
#ifndef __GAME_BRITTLEFRACTURE_H__
#define __GAME_BRITTLEFRACTURE_H__
/*
===============================================================================
B-rep Brittle Fracture - Static entity using the boundary representation
of the render model which can fracture.
=================================================... |
#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>
#define I_INF (1<<20)
#define F_INF 1e7
#define MAX 101
using namespace std;
class Zoo... |
//Copyright 2011-2016 Tyler Gilbert; All Rights Reserved
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include "hal/I2C.hpp"
using namespace hal;
I2C::I2C(port_t port) : Periph(CORE_PERIPH_I2C, port){}
int I2C::get_attr(i2c_attr_t & attr){
return ioctl(I_I2C_GETATTR, &attr);
}
int I2C::set_attr(con... |
#ifndef DIALOG_H
#define DIALOG_H
class Minigame
{
public:
Minigame();
~Minigame();
bool isWin();
void setWin();
void setLose();
void quit();
protected:
bool win;
};
#endif // DIALOG_H
|
#include "MaskElem.h"
MaskElem::MaskElem()
{
infoColor = RenderHelper::getRandomColor();
}
MaskElem::MaskElem(const MaskElem& elem)
{
points = elem.points;
color = elem.color;
isMask = elem.isMask;
blurAmnt = elem.blurAmnt;
infoColor = RenderHelper::getRandomColor();
update();
}
void MaskElem::update()
{... |
#include <iostream>
using namespace std;
int main() {
int N, X, Y;
cin >> N >> X >> Y;
int a[N];
int heal = 0, one = 0;
for (int i = 0; i < N; ++i) {
cin >> a[i];
if (a[i] <= X) {
++one;
if (a[i] + Y > X) ++heal;
}
}
if (X > Y) {
co... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
#include "List.hpp"
#include "../part1/Nat.hpp"
template <Nat N>
struct NatPrinter {
static void print() {
printf("%u", NatToUnsignedInt<N>::value);
}
};
template <Nat N>
struct Mul2 {
using result = Mul<N, Succ<Succ<Z>>>::result;
};
template <Nat N>
struct Mul3 {
using result = Mul<N, Succ<Succ<Succ<Z>>... |
/*
ID: stevenh6
TASK: nocows
LANG: C++
*/
#include <fstream>
#include <iostream>
using namespace std;
ofstream fout("nocows.out");
ifstream fin("nocows.in");
int main()
{
int N, K, c;
int sol[300][300];
int cache[300][300];
sol[1][1] = 1;
fin >> N >> K;
for (int i = 2; i <= K; i++)
{
... |
//###############################################################################
// INTRODUCCION: SoundManager.h
//------------------------------------------------------------------------------
// Esta clase nos permite gestionar el sonido de la aplicacion. Permite crear
// un sistema de sonido general, en el que pode... |
#include "stdafx.h"
#include "hostname.h"
#include <boost/asio/ip/host_name.hpp>
namespace hdd::asio
{
std::string HostName::Get()
{
boost::system::error_code ec;
const std::string hostname = boost::asio::ip::host_name(ec);
return hostname;
}
}
|
#pragma once
#include "NetworkLayer.h"
//Convolutional layer (if you don't know what it is then go th wiki)
class ConvolutionalLayer :
public NetworkLayer
{
public:
//num of the neurons in the comvolution
int numInOne;
//create the layer
ConvolutionalLayer(int width, int type, int _numInOne) : NetworkLayer(width,... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include <cstdlib>
#include "Dientes.generated.h"
UCLASS()
class FIRSTPERSONLAB_API ADientes : public AActor
{
GENERATED_BODY()
public:
// Sets def... |
#include <iostream>
using namespace std;
int main(){//this function print hello world on the console screen only
cout<<"good for you ,hello world"<<endl;
return 0;
}
|
// 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.... |
/**
* @file main.cpp
*
* @brief This file contains the entry point for the led controller
* @version 0.1
* @date 2021-06-16
*
* @copyright Copyright (c) 2021
*
*/
#include <Arduino.h>
#include "storage.h"
#include "printer.h"
#include "messagesystem.h"
void setup() {
PRINTER_SETUP();
... |
#include <iostream>
/*
* Basically the same thing as a shared_ptr from the standard library
*
*/
using namespace std;
template <typename T>
class SmartPointer {
private:
T* ptr;
int* count;
void check_count() {
if (*count == 1) {
cout << "Destroying everyth... |
#include <iostream>
using namespace std;
int main()
{
int n; cin >> n;
long long a[1000010] = {0};
a[3] = 1;
for (int i = 4; i <= n; i++) {
if (a[i] != 0) continue;
else a[i] = (a[i - 1] + a[i - 2] + a[i - 3]) % 10007;
}
cout << a[n] << endl;
return 0;
} |
#ifndef SVG_DOM_HASH_TABLE_H
#define SVG_DOM_HASH_TABLE_H
#ifdef SVG_SUPPORT
#ifdef SVG_DOM
#include "modules/util/OpHashTable.h"
/*
* This class exists becuase OpPointerHashTable defines a Delete()
* function that requires the full definition of the data that is
* stored in the OpPointerHashTable. We don't want ... |
// 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.... |
#pragma once
#include "Agent.h"
#include "Food.h"
#include "Water.h"
#include <Bits.h>
class Dinosaur : public Agent, public Food
{
public:
//setters
void SetCurrentHunger(float val);
void SetMaxHunger(float val);
void SetCurrentThirst(float val);
void SetMaxThirst(float val);
void SetCarnivore(bool val);
voi... |
#ifndef ADMININFO_H
#define ADMININFO_H
#include <QDialog>
#include "login.h"
namespace Ui {
class admininfo;
}
class admininfo : public QDialog{
Q_OBJECT
public:
explicit admininfo(QWidget *parent = 0);
~admininfo();
void Display();
private slots:
void on_pushButton_add_... |
class Solution {
public:
vector<int> singleNumber(vector<int>& nums) {
int eo = 0,eoHasOne = 0;
for(auto &a :nums){
eo ^= a;
}
int rightOne = eo & (~eo + 1);
for(auto &a : nums){
if((a & rightOne) != 0){
eoHasOne ^= a;
}
... |
/* -*- 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)
*/
#include "platforms/quix/toolkits/kde4/Kde4Ma... |
//
// Created by Alejandro Ibarra on 2019-03-07.
//
#ifndef LISTS_NODE_H
#define LISTS_NODE_H
class Node {
/**
* first initiation of the node
*/
public:
int data;
Node *next;
Node *prev;
};
#endif //LISTS_NODE_H
|
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
#define ll long long
#define fi first
#define se second
#define pb push_back
#define ALL(v) v.begin(), v.end()
#define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a))
#define FORN(a, b, c) for (int(a) = (b); (a) <= (c); ++(a))
#define FORD(a, b, c... |
#include "stdio.h"
#include "conio.h"
#include "string.h"
int palindrome(char *strn){
int flag = 1;
int j = (strlen(strn)-1);
for(int i = 0; i<=(strlen(strn)/2); j--, i++){
if(strn[i] != strn[j]){
flag = 0;
break;
}
}
if(flag)
return 1;
else
return 0;
}
void main(){
cl... |
#include <iostream>
#include <iomanip>
#include <conio.h>
using namespace std;
int main ()
{
int arr[10], element, Lnum, Snum;
float total, ave;
for (element=0; element<10; element++)
{
cout << "Enter a number: ";
cin >> arr[element];
}
Lnum = arr[0];
for (element=0; element<10; elem... |
// Created on: 1996-08-30
// Created by: Yves FRICAUD
// Copyright (c) 1996-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... |
// Sharna Hossain
// CSC111
// samsung_discount.cpp
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double amount, net;
const double DISCOUNT = .10;
cout << "Welcome to Samsung!\n";
cout << "Please enter the amount of your order: ";
cin >> amount;
net = amount - (DIS... |
#include "I2Cdev.h"
#include "MPU6050.h"
#include "HMC5883L.h"
#include "BMP085.h"
#include <Wire.h>
#include <SoftwareSerial.h> //시리얼통신 라이브러리 호출
/*
pin
3,4,5,6 -> 확장핀
0 0 0 0 -> 0
1 0 0 0 -> 1
0 1 0 0 -> 2
1 1 0 0 -> 3
0 0 1 0 -> 4
7,8 -> 압력센서
*/
int blueTx=4; //Tx (보내는핀 설정)
int blueRx=5; //Rx (받는핀 설정... |
#include <unordered_set>
#include <unordered_map>
#include "Application.h"
class NewsTracker
{
public:
NewsTracker();
// Incoming data
void OnDirectData(const DirectData& data);
void OnRepublishData(const RepublishData& data);
/*** Queries ***/
// return all topics and s... |
#include <iostream>
#include <string>
using namespace std;
int N;
int i=0;
int rbm(int N);
int ram(int N);
int main()
{
do
{
cout<<"Enter an odd number between 2 and 10000. N = ?"<<endl;
cin>>N;
if(N%2!=0)
{
rbm(N);
ram(N);
}
... |
#include "PhotoCaptureController.h"
#include <QSize>
#include <QDebug>
#include <QFile>
#include <QCryptographicHash>
namespace wpp
{
namespace qt
{
void PhotoCaptureController::saveCapture(QString requestId, int width, int height)
{
QQmlImageProviderBase* imageProviderBase = engine->imageProvider("camera");
QQuic... |
#ifndef PERS_FACTORIAL_H
#define PERS_FACTORIAL_H
#include <string>
#include <set>
#include <unordered_map>
namespace Solutions {
struct FactorFinder {
public:
FactorFinder()
: currMax(36), primes({2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31}) {};
explicit FactorFinder(int n)
... |
#include "functions.hpp"
functions::functions()
{
res = nullptr;
}
functions::~functions()
{
delete res;
}
int functions::browseMovies(connection &C)
{
int option, opt;
cout << "***********************************************************************" << endl
<< "* B... |
/*
A library of functions to produce a trace JSON file describing the events that
happened, to be used with another program.
Current Functions:
trace_start
trace_flush
trace_end
trace_event_start
trace_event_end
trace_object_new
trace_object_gone
trace_instant_global
tr... |
#include "ZombieHorde.hpp"
std::string ZombieHorde::names_list[NAMES_NUM] = {
"Danya",
"Phill",
"Sema",
"Ruslan",
"Olya",
"Valeria",
"Ivan"
};
int ZombieHorde::getRandomNumber_(int min, int max) const
{
static const double fraction = 1.0 / (static_cast<double>(RAND_MAX) + 1.0);
return (static_cast<int>(std... |
#include "logdelegate.h"
#include <QApplication>
#include <QMouseEvent>
#include <QFontMetrics>
#include <QDebug>
#include <QTextLine>
#include <QLabel>
#include <QLineEdit>
#include "ui/Views/Models/LogModel/logmodel.h"
LogDelegate::LogDelegate(QWidget *parent)
: QStyledItemDelegate(parent) {
showPicture.mov... |
const int led_pin = 7;
const int t1_pin = 5;
const int t2_pin = 3;
uint8_t brightness = 0;
void t1_int ()
{
brightness += 5;
}
void t2_int ()
{
brightness -= 5;
}
void setup()
{
pinMode(led_pin, OUTPUT);
attachInterrupt(t1_pin, &t1_int, FALLING);
attachInterrupt(t2_pin, &t2_int, FALLING);
Serial.begin(9... |
#include "dada/gl/GL.h"
#include "dada/app/Application.h"
#include "dada/gl/EBO.h"
#include "dada/gl/Program.h"
#include "dada/gl/Shader.h"
#include "dada/gl/VAO.h"
#include "dada/gl/VBO.h"
#include "dada/geometry/Transform3f.h"
#include "dada/geometry/Matrix4fUtils.h"
#include "dada/geometry/Vector3fUtils.h"
#includ... |
// Created on: 1993-06-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... |
#pragma once
using namespace Ogre;
class CDecalEntity
{
public:
CDecalEntity();
~CDecalEntity();
void Create( const String& decalName, const String& mtlName, int size = 4 );
void Destroy();
void setPosition( Real x, Real z, Real offset = 0.05f );
void SetScale( Real scale );
protected:
Sc... |
#ifndef __WING_H__
#define __WING_H__
#include "Tree.h"
class Tree;
class Wing
{
public:
Tree* m_pTree;
void SetTree(Tree* tree) { m_pTree = tree; }
public:
D3DXVECTOR3 m_vPos;
D3DXVECTOR3 m_vRot;
D3DXVECTOR3 m_vScale;
D3DXMATRIX m_mTM;
D3DXMATRIX m_mScale, m_mRot, m_mTrans;
D3DXMATRIX m_mInvScale... |
#pragma once
#include <cstdint>
#define DMX_FRAME_SIZE 513
/**The @p buffer remain valid forever, no need to copy anything! */
typedef void (*DmxFrameCallback)(const uint8_t* buffer);
/** A simple dmx receiver that uses TIM3 channel 1 and channel 2 and USART 3 */
class DmxReceiver {
private:
static DmxFrameCallb... |
#include "tessellation_generator.h"
#include <ros/ros.h>
#include <map>
#include <cmath>
#include <boost/foreach.hpp>
#define foreach BOOST_FOREACH
TessellationGenerator::TessellationGenerator(const Volume& parentVolume, std::vector<pcl::PointXYZ> voxelAspectRatios, std::vector<float> voxelSizeIncrements, float minV... |
// Copyright (C) 2012 Mihai Preda
#pragma once
#include "value.h"
class GC;
class VM;
class Func;
class SymbolTable;
class Array;
class Types;
class Pepper {
public:
GC *_gc;
VM *vm;
Types *types;
private:
SymbolTable *_syms;
Array *_regs;
public:
Pepper(void *context);
~Pepper();
... |
#include "main.hpp"
int
main( int argv, char** argc )
{
// std::random_device rd;
// std::mt19937 e1(rd());
// std::uniform_int_distribution<int> unif_dist(0,255);
// cv::VideoWriter video_test;
// cv::Mat framebuf = cv::Mat_<cv::Vec3b>(cv::Size(320,240),0);
// video_test.open("./test.mp4",(i... |
/**
* Copyright (c) 2015, Timothy Stack
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of condi... |
// Created on: 1995-01-27
// Created by: Jacques GOUSSARD
// Copyright (c) 1995-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... |
// Copyright (c) 2009, Robert Meijer <robert@grazz.com>
// Please read and understand the License.txt file before using this software.
#pragma once
using namespace System;
namespace amBXLib {
public enum struct RumbleType {
Boing,
Crash,
Engine,
Explosion,
Hit,
Quake,
Rattle,
Roa... |
#pragma once
#ifndef FILEREADER_H
#define FILEREADER_H
#include <stdio.h>
#include <string>
namespace NoHope
{
class FileReader
{
public:
FileReader(const char* filePath);
~FileReader();
bool seek(int offset, int origin);
bool read(unsigned int count, void* buffer);
unsigned int length();
private:
... |
// Created by: Eugeny MALTCHIKOV
// Copyright (c) 2013-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 F... |
#include<iostream>
#include<math.h>
int main () {
int num;
char ch;
bool primeNum = true;
std::cout << "Enter a positive Integer : " ;
std::cin >> num ;
if ( num > 0 ) {
for ( int i = 2; i <= sqrt ( num ) ; ++i ) {
if ( num % i == 0 ) {
primeNum = false;
break;
}
}
}
... |
#include "Object.h"
#include <catch2/catch.hpp>
#include <iostream>
#include <omtalk/Allocate.h>
#include <omtalk/Handle.h>
#include <omtalk/Heap.h>
#include <omtalk/MemoryManager.h>
#include <omtalk/Ref.h>
#include <omtalk/Tracing.h>
#include <omtalk/Util/BitArray.h>
|
int led = 9;
int state;
void setup() {
pinMode(led, OUTPUT);
digitalWrite(led, HIGH);
Serial.begin(12600);
}
void loop() {
state = digitalRead(led);
if (state == HIGH)
Serial.print("Haut\n");
else
Serial.print("Bas\n");
}
|
#include <xhci.h>
#include <pci.h>
#include <logging.h>
#include <paging.h>
#include <idt.h>
#include <memory.h>
#include <assert.h>
#include <video.h>
namespace USB{
PCIDevice* xhciPCIDevice;
uint8_t xhciClassCode = PCI_CLASS_SERIAL_BUS;
uint8_t xhciSubclass = PCI_SUBCLASS_USB;
int ... |
#ifndef CLIENTCORE_H
#define CLIENTCORE_H
#include <QObject>
#include <QWebSocket>
#include <QString>
#include "wevent.h"
#include "wmessage.h"
#include "wsetid.h"
#include "wnickrequest.h"
#include "wnickresponse.h"
#include "wclientlist.h"
#include "clientlistmodel.h"
class ClientCore : public QObject
{
Q_OBJE... |
/* XMRig
* Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* 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
* ... |
#include "MapSystem.h"
#include <chrono>
#include <random>
#include <iostream>
#include "../Constants.h"
using namespace std;
using namespace osg;
using namespace ld;
MapSystem::MapSystem(std::mt19937& rng_)
: rng(rng_)
{
setup_map();
layout_map();
printf("Map System ready\n");
}
void MapSystem::setup_ma... |
#include<iostream>
using namespace std;
int main()
{
int num,data,count=0;
cout<<"Enter a num"<<endl;
cin>>num;
data=num;
do
{
++count;
num = num / 10;
}while(num!=0);
cout<<data<<" is "<<count<<" digits";
return(0);
} |
//
// Shotgun.hpp for shotgun in /home/deneub_s/cpp_indie_studio/include/Worms
//
// Made by Stanislas Deneubourg
// Login <deneub_s@epitech.net>
//
// Started on Thu Jun 1 07:54:52 2017 Stanislas Deneubourg
// Last update Sun Jun 18 17:11:15 2017 Stanislas Deneubourg
//
#ifndef SHOTGUN_HPP
#define SHOTGUN_HPP
... |
#include<iostream>
#include<stdio.h>
#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<map>
#include<queue>
#include<set>
#include<list>
#include<unordered_map>
#include<unordered_set>
#define ll long long
#define MAX 100000003
#define MAX_RLEN 50
#... |
#ifndef __CURSES_WINDOW_HPP_INCLUDED__
#define __CURSES_WINDOW_HPP_INCLUDED__
#include "views.hpp"
namespace curses {
class application;
class window {
public:
window()
{
}
virtual void show() {
}
private:
};
} // namesapce curses
#endif // __CURSES_WINDOW_HPP_INCLUDED__
|
#ifndef PAUSEBUTTON_H
#define PAUSEBUTTON_H
#include <QObject>
#include <QGraphicsRectItem>
#include <QBrush>
#include <QGraphicsTextItem>
#include <QFont>
#include <QGraphicsSceneMouseEvent>
#include <QMouseEvent>
class PauseButton: public QObject, public QGraphicsRectItem
{
Q_OBJECT
public:
e... |
//
// Created by tudom on 2019-12-31.
//
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wused-but-marked-unused"
#pragma once
#pragma clang diagnostic push
#pragma ide diagnostic ignored "MemberFunctionCanBeStaticInspection"
#pragma ide diagnostic ignored "cert-err58-cpp"
#include <boost/test/inclu... |
#include <iostream>
#include <string>
#include <sstream>
#include <ctype.h>
#include <stdexcept>
class Calculator{
private:
int64_t res;
std::istringstream in;
bool num(std::istringstream& in, int64_t& arg){
char minus;
if(!(in >> minus)) return false;
int64_t buf;
if(minus... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
**
** Copyright (C) 1995-1999 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef DOM_XPATHEXPRESSION
#defin... |
#include <iostream>
#include "Player.h"
#include "MapCell.h"
#include "GameMap.h"
using namespace std;
int main()
{
GameMap Map;
Player Hero;
cout<<"inicia juego"<<endl;
while(Map.isGameOver==false)
{
//loop
Hero.CallInput();
//actualiza infomracion de mapa
Map.Set... |
/*
* @Description: 发布tf的类
* @Author: Ren Qian
* @Date: 2020-03-05 15:23:26
*/
#ifndef LIDAR_LOCALIZATION_PUBLISHER_TF_BROADCASTER_HPP_
#define LIDAR_LOCALIZATION_PUBLISHER_TF_BROADCASTER_HPP_
#include <string>
#include <ros/ros.h>
#include <tf/transform_broadcaster.h>
#include <tf/transform_datatypes.h>
#include ... |
/*You are required to complete this method*/
// Max sum in the configuration
int max_sum(int A[],int n)
{
//Your code here
int sum=A[0];
int max_sum=0;
for(int i=1; i<n; ++i) {
sum += A[i];
max_sum += (i)*A[i];
}
int res = max_sum;
for(int i=1; i<n; ++i) {
max_sum = max_sum-(sum-A[i-1])+A[i-1]*(n-1);
... |
#pragma once
#include <Interfaces.h>
class Bindable
{
public:
virtual ~Bindable() = default;
virtual void Bind(class VeritasEngine& in) = 0;
protected:
static IVContext* GetContext(VeritasEngine& in);
static IVDevice* GetDevice(VeritasEngine& in);
static IVSwapChain* GetSwapChain(VeritasEngine& in);
}; |
#include "../../gl_framework.h"
using namespace glmock;
extern "C" {
#undef glBindBuffer
DLL_EXPORT GLboolean CALL_CONV wglewIsSupported(const char*) {
return GL_TRUE;
}
}
|
#include<iostream>
using namespace std;
namespace std1
{
int sum(int a,int b)
{
return(a+b);
}
}
namespace std2
{
float sum(float a,float b)
{
return(a+b);
}
}
int main()
{
cout<<"Sum of 5 and 10 is "<<std1::sum(5,10)<<"\n";
cout<<"Sum is 4.1 and 2.7 is "<<std2::sum(4.1,2.7)<<"\n";
cout<<"Sum of 3 and 5.... |
#ifndef TRAIL_H
#define TRAIL_H
#include "timerlist.h"
#include <QObject>
#include <QGraphicsRectItem>
#include <QTimer>
class Trail: public QObject, public QGraphicsRectItem {
Q_OBJECT
public:
QTimer *moveTimer;
TimerList *allTimers;
Trail();
void setTrail(int xPos, int yPos, int width, int hei... |
// Created on: 1995-06-06
// Created by: Jean Yves LEBEY
// Copyright (c) 1995-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... |
// Copyright (c) 2018 Mozart Alexander Louis. All rights reserved.
// Includes
#include "tmx_engine.hxx"
#include "utils/archive/archive_utils.hxx"
// Singleton Declaration
atomic<TmxEngine*> TmxEngine::instance_;
mutex TmxEngine::instance_mutex_;
TmxEngine::TmxEngine() = default;
TmxEngine::~TmxEngine() = default;... |
#ifdef MODAPI_DLL_EXPORT
#include "stdafx.h"
#include "Application.h"
#include <Spore\ModAPI.h>
namespace ModAPI
{
int GetMajorVersion() {
return 2;
}
int GetMinorVersion() {
return 5;
}
int GetBuildVersion() {
return SDK_BUILD_VER;
}
void AddInitFunction(InitFunction f) {
initFunctions.push_back(f);
... |
// Created on: 1992-10-14
// Created by: Christophe MARION
// 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 ... |
#include "BigNaturalNumber.h"
#include <ctime>
void BigNaturalNumber::random(int n) {
number.resize(n);
for (int i = 0; i < n; i++) {
number[i] = rand() % 10;
}
}
BigNaturalNumber BigNaturalNumber::operator+(const BigNaturalNumber &num) {
BigNaturalNumber answer;
// This is regardless of size of either num... |
/************************************************************************/
/* File name : PassDialog.h */
/************************************************************************/
/* Contents : PassPhrase ダイアログ */
/* ... |
#ifndef DROPBOXCLIENT_H
#define DROPBOXCLIENT_H
#include <QDir>
#include <QLocalSocket>
#include <QMap>
#include <QObject>
#include <QProcess>
#include <QString>
#include <QStringList>
#include <QTimer>
#include "notification.h"
#include "configuration.h"
#include "configurationdbdriver.h"
class SynchronousDropboxCo... |
#include "TestFramework.h"
#include "treeface/math/Mat4.h"
using namespace treeface;
void TestFramework::content()
{
{
Quatf rot_quat(3.1415927f/6, Vec3f(0.0f, 0.0f, 1.0f));
Mat4f rot_mat;
rot_mat.set_rotate(rot_quat);
{
float r0_c0 = rot_mat.get<0, 0>();
f... |
#pragma once
#include "LinkedList.h"
#include "Map.h"
#include "LogManager.h"
class MapManager
{
public:
~MapManager(void);
static MapManager* getInstance(void);
void startUp(void);
void shutDown(void);
void activateMap(Map* in);
void deactivateMap(Map* in);
void registerForInput(Map* in);
void deregFromInput(... |
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
double V;
int cases = 0;
int n, m, A[1005];
while (scanf("%d %d", &n, &m) == 2 && n)
{
int x;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
scanf("%d", &... |
/*
* 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... |
#include <stdio.h>
#include <stdlib.h>
typedef struct stack {//스택을 구현한 간단한 구조체
int data;//데이터를 저장
struct stack* link;//스택의 저장위치 기록
}stack;
stack* top; //stack의 윗 상단의 포인터 값
stack* Node();
void push(int data);//데이터 입력 함수 선언
int pop();//데이터 출력 함수 선언
int isEmpty();//스택이 비었는지 확인 함수 선언
int main(void) {
unsign... |
//Name: Dan Haub
//Student ID#: 2315346
//Chapman Email: haub@chapman.edu
//Course Number and Section: CPSC 350-01
//Assignment: 4 - Registrar Simulation
#include "Window.h"
using namespace std;
//Default constructor
Window::Window(){
idleTimes = new GenDoublyLinkedList<int>();
idleTimes->ins... |
#pragma once
#include "Question_fwd.h"
namespace qp
{
class IQuestionState
: public boost::noncopyable
, public Loki::BaseVisitable<void, Loki::DefaultCatchAll, false>
, public std::enable_shared_from_this<IQuestionState>
{
public:
virtual CConstQuestionPtr GetQuestion()const = 0;
virtual void Su... |
#include <iostream>
using namespace std;
int main()
{
int a[101],time(0),ci,n;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
if(n<=3){switch (n){
case 1:time=a[0];break;
case 2:time=a[1];break;
case 3:time=a[0]+a[1]+a[2];break;
}}
else if (n%2==0){
ci=(n-2)/2;
... |
/************************************************************************
* @project : sloth
* @class : WaterRenderer
* @version : v1.0.0
* @description : water 的渲染操作类
* @author : Oscar Shen
* @creat : 2017年2月13日21:54:09
* @revise :
*************************************************************... |
#pragma once
#include <cstddef>
#include <sys/mman.h>
class LinuxFileMap {
public:
LinuxFileMap(void* address, std::size_t length, int protection, int flags, int fileDescriptor, off_t offset) : map{ mmap(address, length, protection, flags, fileDescriptor, offset) }, length{ length } {}
[[nodiscard]] bool isV... |
#include "stdafx.h"
#include "CallsignCopyErrorTests.h"
#include "Contest.h"
#include "Station.h"
#include "Qso.h"
CallsignCopyErrorTests::CallsignCopyErrorTests()
:
MiniContest("CallsignCopyErrorLogs", "KSQP\\ksqp.txt", "CallsignCopyError")
{
}
CallsignCopyErrorTests::~CallsignCopyErrorTests()
{
}
bool CallsignC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.