text stringlengths 8 6.88M |
|---|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2002-2010 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef LOCALE_ENUM_H
#define LOCALE_ENUM_H
/**
* "Namespace" ... |
/* -*- coding: utf-8 -*-
!@time: 2020/3/2 21:02
!@author: superMC @email: 18758266469@163.com
!@fileName: 0038_the_depth_of_the_binary_tree.cpp
*/
#include <environment.h>
#include <selfFun.h>
using self_envs::TreeNode;
class Solution {
int ret = 0;
public:
int TreeDepth(TreeNode *pRoot) {
if ... |
/*
* File: main.cpp
* Author: Daniel Canales
*
* Created on July 10, 2014, 1:05 PM
*/
#include <cstdlib>
#include <iostream>
#include <iomanip>
using namespace std;
/*
*
*/
int main(int argc, char** argv) {
//declare vairbales
float fee = 2500;
float newfee = 0;
float rate = .04; //4 p... |
#pragma once
#include "Person.h"
using namespace std;
class Customer : public Person
{
public:
Customer();
Customer(string);
~Customer();
virtual void printName() const;
};
|
//
// Scene5.h
// cg-projects
//
//
#ifndef cg_projects_Scene5_h
#define cg_projects_Scene5_h
#include "Lens.h"
struct Scene5 : public Scene
{
Scene5()
: Scene()
{
defineGeometry();
defineLights();
}
void defineLights()
{
Scene & scene = *this;
Point3d pos(10,100,10);
Color3d color(1,1,1);
Poi... |
//: C06:Constructor1.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
// Konstruktory i destruktory
#include <iostream>
using namespace std;
class Tree {
int height;
public:
Tree(int ... |
/** @file */
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include "User.h"
#include "mono8.h"
#include "mono16.h"
#include "stereo8.h"
#include "stereo16.h"
#include "Limiter.h"
#include "NoiseGate.h"
#include "Echo.h"
#include "analyzeWav.h"
#include "csv.h"
/**
* \brief The function ... |
// Created on: 1995-03-08
// Created by: Mister rmi
// 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 GNU Les... |
#include <iostream>
#include <ctime>
//Eigen部分
#include <Eigen/Core>
#include <Eigen/Dense> //稠密矩阵的代数运算
using namespace std;
using namespace Eigen;
#define MATRIX_SIZE 50
int main(int argc, char** aggv)
{
//Eigen以矩阵为基本数据单元,它是一个模板类
//前三个参数分别是:数据类型,行,列
//同时,Eigen通过typedef提供了许多内置类型
//不过底层仍是Eigen::Mat... |
#include "Engine.h"
Engines::Engines()
{
pinMode(LEFT_PWM, OUTPUT);
pinMode(LEFT_IN1, OUTPUT);
pinMode(LEFT_IN2, OUTPUT);
pinMode(RIGHT_PWM, OUTPUT);
pinMode(RIGHT_IN1, OUTPUT);
pinMode(RIGHT_IN2, OUTPUT);
}
void Engines::setEngineState(e_EngineSide side, e_EngineState state, uint8_t speed)... |
/*
Copyright 2021 University of Manchester
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 writing, s... |
#define BOOST_TEST_MODULE test_smart_pointer
#include <boost/test/unit_test.hpp>
// As we are using templates we need to include the implementation in
// order to allow the compiler to generate the needed methods
#include "SmartPointer1.cpp"
template <typename T>
T test1(T* pval)
{
SmartPointer1<T> sp1(pval);
ret... |
#include <iostream>
using namespace std;
int(){
int a,b;
cin>>a>>b;
cout<<a "+" <<b <<"=" <<a+b;
cout<<a "-" <<b <<"=" <<a-b;
cout<<a "*" <<b <<"=" <<a*b;
return 0;
} |
/*
Copyright 2021 University of Manchester
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 writing, s... |
#include <gtest/gtest.h>
#include "net.h"
TEST(NET,GIVEN_NET_WHEN_LETTER_NOT_IN_THEN_RETURN_FALSE)
{
string s[4] = {
"teca",
"heht",
"eerx",
"phzm",
};
string letter = "teeth";
net n(s,4);
EXPECT_NE(true,n.in_net(letter));
}
TEST(NET,GIVEN_NET_WHEN... |
void setup_InfoTask()
{
#ifdef TASK_INFO
xTaskCreatePinnedToCore(
Info_task, // Function to implement the task
"INFOtask", // Name of the task
10000, // Stack size in words
NULL, // Task input parameter
0, // Priority of the task
&taskInfo, // Task handle
0); // Core where the ta... |
/* -*- 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.
*/
#include "core/pch.h"
#include "adjunct/quick_toolkit/contexts/D... |
#ifndef __SHADER_H__
#define __SHADER_H__
#include <GL/glew.h>
#include <glm/glm.hpp>
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
class Program {
public:
// Faster no function calls
GLuint id;
public:
Program (const GLchar* vertexShaderPath,
const GLchar* fragmentShader... |
/*
* Copyright [2017] <Bonn-Rhein-Sieg University>
*
* Author: Torsten Jandt
*
*/
#pragma once
#include <mir_planner_executor/actions/unstage/base_unstage_action.h>
class MockupUnstageAction : public BaseUnstageAction {
protected:
virtual bool run(std::string& robot, std::string& platform, std... |
#include "../DetectMemoryLeak.h"
#include "Ai_obstacle.h"
#include <iostream>
#include "../EntityManager.h"
#include "../CollisionManager.h"
using namespace std;
/********************************************************************************
Constructor
**************************************************************... |
#ifndef TIME_DIALOG_H
#define TIME_DIALOG_H
#include <QDialog>
#include <QString>
class QLabel;
class QHBoxLayout;
class TimeDialog : public QDialog
{
Q_OBJECT
public:
TimeDialog( void );
~TimeDialog( void );
static QString timeToString( int time )
{
int s_min = time/60;
int s_sec1 = (time%60)/10;
int s_s... |
#include <iostream>
#include <string>
using namespace std;
int main() {
string S;
cin >> S;
bool judge = false;
for (int i = 0; i < 5; ++i) {
string T;
cin >> T;
for (int j = 0; j < 2; ++j) {
if (S[j] == T[j]) judge = true;
}
}
cout << (judge ? "YE... |
#include "net.hh"
#include "ioproc.hh"
#include <netdb.h>
namespace ten {
int netconnect(int fd, const address &addr, unsigned ms) {
while (::connect(fd, addr.sockaddr(), addr.addrlen()) < 0) {
if (errno == EINTR)
continue;
if (errno == EINPROGRESS || errno == EADDRINUSE) {
... |
#define MP7_FLASHLIGHT class FlashLight\
{\
color[] = {0.9, 0.9, 0.7, 0.9};\
ambient[] = {0.1, 0.1, 0.1, 1.0};\
position = "flash dir";\
direction = "flash";\
angle = 30;\
scale[] = {1, 1, 0.5};\
brightness = 0.1;\
}
#define MP7_MFLASHLIGHT class FlashLight\
{\
color[] = {0.9, 0.0, 0.0, 0.9};\
ambient[] = {0.... |
#include <maya/MGlobal.h>
#include <maya/MPxCommand.h>
#include <maya/MArgList.h>
#include <maya/MSyntax.h>
#include <maya/MFn.h>
#include <maya/MFnPlugin.h>
#include <maya/MPoint.h>
#include <maya/MSelectionList.h>
#include <maya/MDagPath.h>
#include <maya/MItSelectionList.h>
#include <maya/MObject.h>
#include <maya/M... |
//
// Created by 邦邦 on 2022/4/17.
//
#ifndef MYSQLORM_DDL_H
#define MYSQLORM_DDL_H
#include <map>
#include <vector>
#include <array>
#include <string>
#include <cstring>
#include "bb/Log.h"
#include "mysql.h"
namespace bb {
class ddl {
ddl();
~ddl();
protected:
std::string config_path_... |
#include "Product.h"
Product::Product() {}
Product::~Product() {}
void Product::SetA(std::string str) {
m_a = str;
}
void Product::SetB(std::string str) {
m_b = str;
}
void Product::SetC(std::string str) {
m_c = str;
}
void Product::Show() {
std::cout << "product has" << m_a << m_b << m_c << std::endl;
} |
#include "std_lib_facilities.h"
const vector<string> months =
{
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
};
enum class Month{
jan, feb, mar, apr, may, jun, jul, aug, sept, oct, nov, dec
};
Month operator++(Month& m)
{
m = (... |
#include "mySpinBox.h"
mySpinBox::mySpinBox(QWidget *parent) :
QSpinBox(parent)
{
setTimer();
connect(this, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &mySpinBox::onValueChanged);
}
void mySpinBox::setTimer()
{
timer = new QTimer;
timer->setSingleShot(true);
... |
#include <iostream>
#include <vector>
#include <fstream>
#include <cmath>
#include <list>
#include <cstdlib>
#include <chrono>
#include <algorithm>
using namespace std;
using namespace std::chrono;
ifstream fin("citire.in");
ofstream fout("citire.out");
void BubbleSort(vector < long long > & v, int n) {
in... |
#include "cxxtest/TestSuite.h"
#include "tinyxml/tinyxml.h"
#include "neural_network/gpu/NeuralNetworkGpu.h"
#include "utility/TextAccess.h"
class NeuralNetworkGpuTestSuite : public CxxTest::TestSuite
{
public:
void test_neural_network_can_be_loaded_from_text_access()
{
std::shared_ptr<TextAccess> textAccess = T... |
#include "MoveArmNode.h"
// system includes
#include <eigen_conversions/eigen_msg.h>
#include <moveit/robot_model_loader/robot_model_loader.h>
#include <smpl/angles.h>
#include <spellbook/msg_utils/msg_utils.h>
#include <spellbook/geometry_msgs/geometry_msgs.h>
namespace rcta {
MoveArmNode::MoveArmNode() :
m_nh(... |
// This function is declared in Astrometry.h but I have separated
// its definition into this file because the list will have to be
// maintained as new leap seconds occur.
// Data for calculation of leap seconds and TT-UTC.
// These tabular data were obtained from
// ftp://maia.usno.navy.mil/ser7/tai-utc.dat
// ... |
#include "Desktop.h"
#include "Tests/Test.cpp"
#include "Figure.h"
#include "livingFigure.h"
#include <unistd.h>
#include "movement.h"
#include <vector>
#include <string>
#include "util.h"
#include "map.h"
#include <thread>
#include <mutex>
#include <queue>
std::mutex eventMutex;
typedef std::string string;
bool deb... |
/*
** EPITECH PROJECT, 2019
** OOP_indie_studio_2018
** File description:
** Assets
*/
#include "Assets.hpp"
#include "FileNotFoundException.hpp"
#include <sys/stat.h>
#include <vector>
#include <string>
Assets::Assets()
{
}
Assets::~Assets()
{
}
void Assets::checkFiles(void) const
{
struct stat buffer;
fo... |
//---------------------------------------------------------
//
// Project: dada
// Module: gl
// File: VAO.h
// Author: Viacheslav Pryshchepa
//
// Description:
//
//---------------------------------------------------------
#pragma once
#include "dada/core/Object.h"
namespace dada
{
cl... |
#include<iostream>
using namespace std;
typedef long long int ll;
ll ucln (ll a, ll b){
if(a==0&&b==0) return 0;
ll r;
while(b!=0){
r=a%b;a=b;b=r;
}
return a;
}
void xuly (double n){
ll k=1;
while(n!=(ll)n){
n*=10;k*=10;
}
ll a=n,b=k;
k=ucln(a,b);
a/=k;b/=k;... |
/*first find what will be the max sum for k = 1 ,2 ,3. if k > 3 if total is greater than 0 we are just adding total to ans of k = 3 for each addition of array*/
#include <bits/stdc++.h>
int t;
long long n,k,a[100000],total,temp,first,second,third,current,previous;
using namespace std;
long long maxSubArray(){
fo... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}}
#define show(x) {for(auto i: x){cout << i << " ";} cout... |
#include "gtest/gtest.h"
extern "C" {
#include "iterator.h"
}
void *memdup(const void *src, size_t n)
{
void *dest = malloc(n);
memcpy(dest, src, n);
return dest;
}
TEST(json_nextTest, not_skipping_space)
{
json_parser *parser;
unsigned char *test_string = (unsigned char *) "\"Hello World \... |
#include <iostream>
#include <fstream>
#include <cmath>
#include "bmp.h"
// Proste operacje na bitmapach.
// Funkcja run() wywoluje szereg testow, a kazdy z nich
// generuje osobny plik BMP.
//************************************************************
// Typ zmiennoprzecinkowy uzywany przy obliczeniach.
// Niewykl... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
**
** Copyright (C) 1995-2012 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#include "core/pch.h"
#if defined DR... |
/* -*- 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.
**
*/
#ifndef WINDOWS_OPPLUGINWINDOW_H
#define WINDOWS_OPPLUGINWIND... |
#ifndef BOOST_ASTRONOMY_COORDINATE_SPHERICAL_DIFFERENTIAL_HPP
#define BOOST_ASTRONOMY_COORDINATE_SPHERICAL_DIFFERENTIAL_HPP
#include <tuple>
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/algorithms/transform.hpp>
#include <boost/geometry/algorithms/equal... |
#ifndef PATRON_H
#define PATRON_H
#include <string>
class Patron {
public:
Patron(std::string, std::string);
Patron();
std::string to_string();
private:
std::string _name;
std::string _number;
};
#endif
|
/*
Copyright 2022 University of Manchester
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 writing, ... |
#ifndef EMHANDLER_H
#define EMHANDLER_H
#include <ATC3DG.h>
#include <QMutex>
#include <QObject>
#include <pthread.h>
#include <pugixml.hpp>
namespace DR {
class EMHandler :public QObject
{
Q_OBJECT
public:
explicit EMHandler(QObject *parent = 0);
virtual ~EMHandler();
Q_INVOKABLE void connect();
Q_IN... |
#ifndef __SRC_UTILS_SINGLETON_H__
#define __SRC_UTILS_SINGLETON_H__
/* 单例 */
template<typename T> class Singleton {
private:
static T * m_Instance;
Singleton(const Singleton &);
Singleton & operator = (const Singleton &);
protected:
Singleton() {}
~Singleton() {}
public:
static T & get... |
#include<bits/stdc++.h>
using namespace std;
class MaxHeap{
private:
int _size{};
vector<int> v = {-1};
int parent(int i) {return i>>1;};
int lchild(int i) {return i<<1;};
int rchild(int i) {return (i<<1)+1;};
public:
bool isEmpty() const {return _size==0;};
... |
#ifndef QUTILSFRAMLESSDIALOG_HPP
#define QUTILSFRAMLESSDIALOG_HPP
#include "shoemanagercore_global.h"
#include <QDialog>
#include <QFrame>
#include <QWidget>
#include <QLabel>
#include <QPushButton>
class FramelessHelper;
class SHOEMANAGERCORESHARED_EXPORT QUtilsFramelessDialog : public QDialog
{
... |
//T.C : O(n^2).
//S.C : O(1).
long long int inversionCount(long long a[], long long n)
{
int invCount = 0;
for(int i=0;i<n-1;i++){
for(int j=i+1;j<n;j++){
if(a[i] > a[j]){
invCount++;
}
}
}
return invCount;
}
|
#ifndef SHAPE_H
#define SHAPE_H
#include "BtOgrePG.h"
#include "BtOgreGP.h"
namespace Shapez
{
enum { sphere, box, trimesh, cylinder, convex, capsule, allignedBox, orientedBox,none };
inline btCollisionShape* setupShape(int shapeType, BtOgre::StaticMeshToShapeConverter& converter)
{
switch(shapeTy... |
// Copyright (C) 2013 Mihai Preda
#include "Value.h"
const char *typeStr(Value v);
class StringBuilder {
public:
char *buf;
int size, allocSize;
StringBuilder();
~StringBuilder();
void reserve(int space);
void clear() { size = 0; }
char *cstr();
void append(const char *s);
void... |
#include "aeMath.h"
namespace aeEngineSDK
{
aeSphere::aeSphere()
{
}
aeSphere::aeSphere(const aeSphere & A)
{
*this = A;
}
aeSphere::aeSphere(const aeVector3 & Pos, float Radius)
{
m_xPosition = Pos;
m_fRadius = Radius;
}
aeSphere::~aeSphere()
{
}
bool aeSphere::operator^(const aeSphere & S)
{
... |
#include <iostream>
#include "Sender.h"
#include "Mail.h"
using namespace std;
Sender::Sender(string addr)
:_addr(addr){}
Sender& Sender::operator<<(Mail& mail)
{
cout << "发送地址:" << _addr << endl;
cout << "标题:" << mail._title << endl;
cout << "信件内容:" << mail._contents << endl;
cout << "发送时间:" << mail._time << e... |
#include <iostream>
#include <memory>
#include <chrono>
#include <boost/lexical_cast.hpp>
#include <boost/lexical_cast/try_lexical_convert.hpp>
#define BOARDSIZE 3 // * Want bigger or smaller boards? Change this macro!
#include "Headers/reliablerand.hpp"
//#include "Headers/tparse.hpp"
#include "Headers/BoardEnums.h... |
traverse from the end and find greater element to the left then reverse the output
|
#include<bits/stdc++.h>
#define rep(i,n) for (int i =0; i <(n); i++)
using namespace std;
using ll = long long;
int main(){
int N, X;
cin >> N >> X;
vector<int>L(N);
rep(i,N)cin >> L[i];
//0の時に一回目を跳ねる
int cnt = 1;
int now = 0;
for(int i = 0; i < N; i++){
... |
#ifndef WEIGHTED_RANDOM_GENERATOR_H
#define WEIGHTED_RANDOM_GENERATOR_H
#include <iostream>
#include <vector>
#include "utility/random/RandomNumberGenerator.h"
template <typename T>
class WeightedRandomGenerator
{
public:
WeightedRandomGenerator(unsigned int seed);
void setSeed(unsigned int seed);
void reset();... |
class G3_DZ: FNFAL_DZ
{
scope = 2;
model = "\z\addons\dayz_epoch_w\g3\h4g3.p3d";
picture = "\z\addons\dayz_epoch_w\g3\data\w_g3_ca.paa";
displayName = $STR_DZ_WPN_G3_NAME;
descriptionShort = $STR_DZ_WPN_G3_DESC;
magazines[] = {20Rnd_762x51_G3};
UiPicture = "\CA\weapons\data\Ico\i_regular_CA.paa";
fireLightDurat... |
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... |
#include ".\timer.h"
#include "SDL.h"
Timer::Timer(void)
{
run();
priority = TP_ENGINE;
}
Timer::~Timer(void)
{
}
void Timer::run() {
lastFrame = time;
time = (float)SDL_GetTicks()/1000;
frameDifference = time - lastFrame;
fps = 1000*frameDifference;
frameScalar = frameDifference;
if (fra... |
#pragma once
#include <SFML/Graphics.hpp>
#include <iostream>
#include "positionComponents.h"
#include "positionComponents.h"
#include "colorComponents.h"
#include "sizeComponents.h"
#include "movementComponents.h"
class GameObject
{
private:
// new instance of object
sf::RectangleShape obj;
public:
... |
#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 10e17 // 4倍しても(4回足しても)long longを溢れない
#define rep(i,n) f... |
#include<iostream>
#include"Node.h"
using namespace std;
/*
* Iterative solution for inserting in a bst
*/
Node* root(Node* root,int x){
Node* tmp=new Node(x);
Node* parent=NULL, *curr=root;
while(curr!=NULL){
parent=curr;
if(curr->key>x)
curr=curr->left;
else if(curr-... |
#include <ros.h>
#include <std_msgs/String.h>
ros::NodeHandle nh;
int left_weel_port_f = 24;
int left_weel_port_b = 25;
int right_weel_port_f = 22;
int right_weel_port_b = 23;
char* s = NULL;
int* params = NULL;
int nParams = 1;
std_msgs::String str_msg;
ros::Publisher chatter("Navigator/arduinoResponse", &str_ms... |
#include "brain_form.hpp"
#include "ui_brain_form.h"
BrainForm::BrainForm(QWidget *parent) :
QWidget(parent),
ui(new Ui::BrainForm)
{
ui->setupUi(this);
}
BrainForm::~BrainForm()
{
delete ui;
}
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-file-style: "stroustrup" -*-
*
* Copyright (C) 1995-2005 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef XMLNAMES_H
#define XMLNAMES_H
#include "modul... |
#include "logmodel.h"
#include <memory>
#include <QDebug>
#include <unordered_set>
#include <QPixmap>
#include <ui/Callbacks/Log.h>
LogModel::LogModel(QObject *parent)
:QAbstractListModel(parent) {}
int LogModel::rowCount(const QModelIndex &parent) const {
return items.size();
}
QVariant LogModel::data(cons... |
/*
* bos2Disp.cc
* Purpose: Send BOS data from a file to the Dispatcher
*/
extern "C" {
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <ntypes.h>
#include <bostypes... |
#include "Produto.hpp"
using namespace std;
Produto::Produto(char nome[50], string categoria, float preco, int qntdEstoque){
setNome(nome);
setPreco(preco);
setCategoria(categoria);
setPreco(preco);
setQntdEstoque(qntdEstoque);
cout << "\n" << getQntdEstoque() << " " << getNome() << " registrado(s) no estoque de... |
#pragma once
#include "GameManager.h"
#include "UnitManager.h"
#include "BuildManager.h"
#include "InformationManager.h"
GameManager::GameManager()
{
}
void GameManager::onStart()
{
BWAPI::Unit resourceDepot = nullptr;
for (BWAPI::Unit unit : BWAPI::Broodwar->self()->getUnits())
{
if (unit && un... |
/*
This file is on implemention of com.
*/
#ifndef _COM_CLASS_H_
#define _COM_CLASS_H_
#pragma warning(disable: 4530)
#pragma warning(disable: 4786)
#pragma warning(disable: 4800)
#include <cassert>
#include <strstream>
#include <algorithm>
#include <exception>
#include <atlstr.h>
#define STRSAFE_NO_DEPRECATE
#includ... |
#include "josephus.h"
JosephusRing::JosephusRing()
{
current_id_ = 0;
step_ = 1;
}
JosephusRing::JosephusRing(unsigned start, unsigned step)
{
current_id_ = start - 1;
step_ = step;
}
JosephusRing::~JosephusRing()
{
}
void JosephusRing::append(Person target)
{
people_.push_back(target);
}
... |
#include <bits/stdc++.h>
#define MAX 1010
using namespace std;
vector<int>lista[MAX];
int color[MAX];
int GRAPHtwocolor(int n);
int dfsRcolor(int v, int c);
int main()
{
int N, lig;
scanf("%d", &N);
for(int i=0;i<N;i++)
for(int j=0;j<N;j++)
{
scanf("%d", &lig);
if(lig... |
#include "quadrato.h"
double quadrato::numeroFisso = 0.5;
double quadrato::getfisso() const {
return numeroFisso;
}
double quadrato::area() const {
return lato()*lato();
}
|
#include "Controller.h"
Controller::Controller()
{
globalInput = new Input();
animation = new Animation();
if (s3eOSReadStringAvailable() == S3E_TRUE)
isTextInputAvalible = true;
else isTextInputAvalible = false;
vertex_touched_index = 0;
}
Controller::~Controller()
{
if (animation !=... |
#ifndef LIBRARY_H
#define LIBRARY_H
#include <vector>
#include <string>
#include "publication.h"
class Library {
public:
/* Singleton pattern components */
static Library & get_instance() {
static Library instance;
return instance;
}
Library(Library const &... |
#include <bits/stdc++.h>
using namespace std;
bool huiwen(int n){
bool r;
int t = 0;
int x = n;
while(x != 0){
t = t * 10 + x % 10;
x = x / 10;
}
if(t == n){
r = true;
}else{
r = false;
}
return r;
}
bool sushu(int n){
bool r = true;
i... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2007 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef OPACCESSIBILITYENUMS_H
#define OPACCESSIBILITYENUMS_H
#i... |
// Created on: 1993-10-26
// Created by: Christian CAILLET
// 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 ... |
#ifndef __LOAD_SCENE_H__
#define __LOAD_SCENE_H__
#include "cocos2d.h"
USING_NS_CC;
enum LoadSceneType
{
LOAD_SCENE_PLAY,
LOAD_SCENE_MENU
};
class LoadScene : public CCScene
{
public:
static LoadScene* createWithScene(LoadSceneType scene);
LoadScene* initWithScene(LoadSceneType scene);
CREATE_FUNC(LoadScene);
... |
// Created on: 1992-02-18
// 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<bits/stdc++.h>
using namespace std;
main()
{
long long int n, k, p, sum=1,i;
while(scanf("%lld %lld",&n,&k)==2)
{
if(n==0 && k==0)break;
else
{
if(k>n/2)
k=n-k;
for(i=0; i<k; i++)
{
sum*=(n-i);
... |
#include <Tanker/TrustchainStore.hpp>
#include <Tanker/Crypto/Format/Format.hpp>
#include <Tanker/DataStore/ADatabase.hpp>
#include <Tanker/Entry.hpp>
#include <Tanker/Log/Log.hpp>
#include <Tanker/Trustchain/Actions/DeviceCreation.hpp>
#include <Tanker/Trustchain/UserId.hpp>
#include <gsl-lite.hpp>
TLOG_CATEGORY(Tr... |
#include "geometry.h"
#include "Voronoi_Tessellation.h"
#include "Centroid_Voronoi_Tessellation.h"
using namespace std;
Model::Model()
{
vs = NULL;
v.clear();
iter = 0;
// default setting
tol = 1e-6;
maxiter = 500;
}
Model::~Model()
{
delete vs;
}
void Model::input_generator(string filenam... |
#ifndef GAMEOBJECT_H
#define GAMEOBJECT_H
#include <iostream>
#include <transform.h>
#include <sprite.h>
#include <camera.h>
#include <math.h>
class GameObject
{
public:
GameObject(const std::string& go_name) : m_name(go_name)
{
m_transform = new Transform();
// rotate all gameobjects 180
... |
//
// Created by Benoit Hamon on 10/3/2017.
//
#include <iostream>
#include <boost/dll/alias.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include "ModuleKeyboard.hpp"
static std::string g_keys;
ModuleKeyboard::ModuleKeyboard(IModuleCommunication *moduleCommunication)... |
// -*- LSST-C++ -*-
/*
* LSST Data Management System
* Copyright 2012-2015 LSST Corporation.
*
* 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 ... |
#include "clips.h"
#include <string>
#include <vector>
class GtkClips
{
public:
GtkClips();
~GtkClips();
void SetMaxActivations() {maxActivations = 1000;}
int GetMaxActications() {return maxActivations;}
//Environment functions
void ClearEnv() {return EnvClear(theEnv);} // clear the environment.
bo... |
#pragma once
#include <memory>
#include <utility>
#include <glad\glad.h>
#include "GLFW\glfw3.h"
#include "glm\glm.hpp"
#include "glm\gtc\matrix_transform.hpp"
#include "Test.h"
#include "VertexArray.h"
#include "VertexBuffer.h"
#include "Shader.h"
#include "Texture.h"
#include "CubeMap.h"
#include "Camera.h"
#inc... |
#include "Parser.h"
// RsaToolbox
using namespace RsaToolbox;
Parser::Parser(QObject *parent) :
QObject(parent)
{
}
Parser::~Parser()
{
}
|
#include "Spell.h"
Spell::Spell(int cost, int points) : cost(cost), points(points) {}
Spell::~Spell() {}
int Spell::getCost() const {
return this->cost;
}
int Spell::getPoints() const {
return this->points;
}
|
// 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 ... |
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// Простой пример вычисления равенства с помощью возвращения логического значения
// V 1.0
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
#include <iostream>
using namespace std;
bool isEqual(int x, int y) ... |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
pair<int, int> coo[3];
int miy = 1000, may = 0;
for (int i = 0; i < 3; ++i) {
cin >> coo[i].first >> coo[i].second;
miy = min(miy, coo[i].second);
may = max(may, coo[i].second);
}
sort(coo, coo + 3... |
#ifndef OMTALK_UTIL_ATOMIC_H_
#define OMTALK_UTIL_ATOMIC_H_
#include <type_traits>
namespace omtalk {
// https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html#g_t_005f_005fatomic-Builtins
enum MemoryOrder : int {
RELAXED = __ATOMIC_RELAXED,
CONSUME = __ATOMIC_CONSUME,
ACQUIRE = __ATOMIC_ACQUIRE,
... |
bool vaciado(){
if(tVaciado->IN(true)){
digitalWrite(bVaciado, HIGH);
return false;
}
else{
digitalWrite(bVaciado, LOW);
tVaciado->IN(false);
return true;
}
}
bool entradaAgua(){
}
|
/*
Copyright (c) 2022 Xavier Leclercq
Released under the MIT License
See https://github.com/ishiko-cpp/test-framework/blob/main/LICENSE.txt
*/
#include "TestFrameworkErrorCategory.hpp"
using namespace Ishiko;
const TestFrameworkErrorCategory& TestFrameworkErrorCategory::Get() noexcept
{
static TestFr... |
#ifndef AD_AMERICANEXPLICITMETHOD_H
#define AD_AMERICANEXPLICITMETHOD_H
#include "EuroExplicitMethod.hpp"
template<typename X>
class AmericanExplicitMethod : public EuroExplicitMethod<X> {
public:
AmericanExplicitMethod(Option<X> *_option, X xl, X xu, int _N, int _M);
void solve(bool showStable = false) ov... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.