text stringlengths 8 6.88M |
|---|
#include<bits/stdc++.h>
using namespace std;
struct intervalo{
long long int a, b;
long long int x;
intervalo(){
}
intervalo(long long _a, long long _b, long long _x){
a = _a;
b = _b;
x = _x;
}
const inline bool operator < (intervalo aux){
return a < aux.a;
}
long long size(){
... |
// Copyright 2020 Mateus de Oliveira Oliveira, Farhad Vadiee and CONTRIBUTORS.
#include "Conjecture.h"
bool ConjectureNode::evaluateState(State &q, DynamicKernel *kernel) {
if (children.empty() and logicalOperator != "TRUE" and
logicalOperator != "FALSE") {
Bag b = q.get_bag();
shared_ptr<WitnessSet> witnessSet... |
//
// SkillBehavior.h
// Boids
//
// Created by Yanjie Chen on 3/3/15.
//
//
#ifndef __Boids__SkillBehavior__
#define __Boids__SkillBehavior__
#include "BehaviorBase.h"
class SkillBehavior : public BehaviorBase {
private:
float _elapse;
public:
SkillBehavior();
virtual ~SkillBehavior();
... |
#include <stdio.h>
#include "glut_app.h"
Simulation *g_app_data = 0;
void initialize_app()
{
g_app_data = new Simulation(8,6);
}
|
#include <iostream>
int main()
{
double y, s, z = 1.7, a = 4e-8, m = 3, n = 3;
const int e = 2.71828;
y = (z + log(z))/(pow(e,-3)*sqrt(a));
s = (1+m*n)/log(1+z);
std::cout<<"y=" << y << '\n';
std::cout<<"s=" << s;
} |
#include <iostream>
#include <vector> // vector
#include <map>
#include <string>
#include <cstdlib> // rand()
#include <ctime> // time()
int main()
{
using namespace std;
srand(time(NULL)); // initialise the PRNG
vector<string> fruits({"apple", "orange","banana",
"grapes",... |
/*
* test.cpp
*
* Created on: Oct 22, 2013
* Author: lestefan
*/
#include <tedusar/check_collision.hpp>
#include <tedusar/CollisionChecker.hpp>
int main(){
tedusar::CollisionChecker collisionChecker;
collisionChecker.setParameters(tedusar::CollisionChecker::Parameters());
cv::Mat dem;
const int M=1000... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <string>
#include <vector>
#include <QMessageBox>
#include <iostream>
#include "matrix.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
... |
// ****************** CWaveSimulator0Drv.cpp *******************************
// Generated by TwinCAT Target for MATLAB/Simulink (TE1400)
// MATLAB R2019a (win64)
// TwinCAT 3.1.4022
// TwinCAT Target 1.2.1237
// Beckhoff Automation GmbH & Co. KG (www.beckhoff.com)
// ***********************************************... |
#include <iostream>
#include <GL/glut.h>
class display{
public:
void cube();
void moving_terrain();
};
extern float w ;
|
#pragma once
class Node
{
public:
int value;
Node* next;
Node()
{
value = 0;
next = nullptr;
}
}; |
#ifndef JARO_H
#define JARO_H
#include <iostream>
namespace jro
{
double Distance(const std::string& st1, const std::string& st2)
{
double t = 0.0;
if (st1.length() == 0) return (st2.length() == 0) ? 1.0 : 0.0;
bool* matchst1 = new bool[st1.length()]{ 0 };
bool* matchst2 = ne... |
#include <SDL2/SDL_image.h>
#include "Texture.hpp"
Texture::Texture() {
texture = nullptr;
width = 0;
height = 0;
}
Texture::~Texture() {
free();
}
bool Texture::loadFromFile(SDL_Renderer *renderer, const char *path) {
free();
SDL_Texture *tempTexture = nullptr;
SDL_Surface *tempSurface... |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin>>t;
while(t--)
{
int n , c,k;
cin>>n>>c>>k;
while(k--)
{
int l,r;
cin>>l>>r;
if(l... |
// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/microtask-queue.h"
#include <algorithm>
#include <functional>
#include <memory>
#include <vector>
#include "src/heap/factory.h"
#include... |
#include <bits/stdc++.h>
using namespace std;
int main(){
int x, z, y = 0,i;
cin >> x >> z;
while(z <= x) cin >> z;
i = x;
while(y < z){
y+= i;
i++;
}
cout << i-x << endl;
return 0;
} |
#define _USE_LUZ_CORE
#define _USE_LUZ_ZIP
#define _USE_LUZ_LUA
#include <luz/zip.hpp>
#include <luz/lua.hpp>
__main() {
sol::state lua;
std::string errorMessage;
/// register standard libraries
if (!lua_registlib(lua, &errorMessage)) {
_fputs(stderr, errorMessage);
return 1;
}
... |
//
// Asteroid.h
//
// A module to encapsulate an asteroid.
//
#ifndef __ENEMY_H__
#define __ENEMY_H__
#include "Rectangle.h"
#include "Buffer.h"
//
// Enemy
//
// A class to represent an Enemy. An Enemy has a
// position and dimensions. An Enemy is
// considered to be dead if there is collision.
//
cl... |
#include "rave-utils.h"
std::vector<rave::GraphHandlePtr> handles;
inline double smaller_ang(double x) {
return fmod(x + M_PI, 2*M_PI) - M_PI;
}
inline double closer_ang(double x, double a) {
return a + smaller_ang(x-a);
}
namespace rave_utils {
Matrix4d transform_from_to(rave::RobotBasePtr robot, const Matrix4d... |
#include "preapptasks.h"
#include <QCoreApplication>
#include <QStandardPaths>
#include <QDir>
#include <QSqlDatabase>
void PreAppTasks::setAppVariables()
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QCoreApplication::setApplicationName(QStringLiteral("CompetitionAnalytics"));
QCoreAppl... |
#include "notetaker.h"
NoteTaker::NoteTaker(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::NoteTaker)
{
QTextStream(stdout) << "Initialising GUI\n";
initGUI();
QTextStream(stdout) << "GUI initialised, now setting up "
"signals and slots...\n";
setupSignalsAndSlo... |
#include <pthread.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <atomic>
struct atomic_stuff {
std::atomic_int atomics[100];
};
struct regular_stuff {
int values[100];
};
static int num_loops;
static int num_threads;
void* update_atomic(void* arg)
{
// printf("In upd... |
#pragma once
#include <ndt_map/ndt_map.h>
#include <ndt_registration/ndt_matcher_d2d_2d.h>
#include <ndt_map/pointcloud_utils.h>
#include <Eigen/Eigen>
#include <pcl/point_cloud.h>
#include <cstdio>
#include <fstream>
#include <vector>
#include "HistoryPoses.h"
using namespace std;
#define MAX_SENSOR_RANGE ... |
#pragma once
#include <vector>
using namespace std;
namespace Shim
{
template<typename T>
class Queue
{
private :
vector<T> m_Container;
int m_front, m_back;
int m_size;
public :
Queue(int size)
{
m_size = size+1;
m_Container.resize(m_size);
m_front = 0;
m_back = 0;
}
int push(T* d... |
#include <irtkImage.h>
#include <irtkGaussianBlurring.h>
char *input_name = NULL, *output_name = NULL;
char *sepBasename = NULL;
void usage()
{
cerr << "Usage: grad3D [in] [out] [sigma] <-options> " << endl << endl;
cerr << "A blur with S.D. sigma is appled before the gradient is estimated" << endl;
cerr << "usin... |
#ifndef DISPATCHER_H
#define DISPATCHER_H
#include <boost/regex.hpp>
#include <boost/asio.hpp>
#include <tcpserver.h>
class Dispatcher
{
public:
typedef boost::asio::buffers_iterator<boost::asio::streambuf::const_buffers_type> streambuf_iterator;
Dispatcher(pClient clt, const boost::regex & reg);
~Dispatcher();
... |
#pragma once
#include "Card.h"
class WerkplaatsCard :
public Card
{
public:
WerkplaatsCard();
static std::unique_ptr<Card> __stdcall Create();
~WerkplaatsCard();
};
|
/*
Copyright (C) 2011 by Ladislav Hrabcak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distrib... |
#ifndef EXPLORATION_H
#define EXPLORATION_H
#include "QGraphicsSceneSized.h"
#include "../map/Floor.h"
#include <QKeyEvent>
class Exploration : public QGraphicsSceneSized
{
public:
// constructor
Exploration(QGraphicsView *parent);
// level rendering
void renderFloor(int lvl);
// event manageme... |
#include <iostream>
using namespace std;
void main() {
int n;
cin >> n;
if (n < 0)
cout << "cold, indoor";
else if (0 <= n && n < 40)
cout << "moderate, outdoor";
else if (n >= 40)
cout << "hot, indoor";
}
|
#include "isincorrectsymbols.h"
bool isIncorrectSymbols(QString input)
{
QStringList list ;
bool flag1 = false, flag2 = false, flag3 = false;
for (int j=0;j<input.size();j++){
list.push_back(QChar(input[j]));
}
for(int i=0;i<list.length();i++){
if (!((list[i]>="0"&&list[i]<="9")||(... |
#ifndef EX6_2_FILE_LOCKER_H
#define EX6_2_FILE_LOCKER_H
#include <string>
using namespace std;
class file_locker {
string file;
void lock();
void unlock();
public:
explicit file_locker(string &file);
~file_locker();
string getFileName();
};
#endif //EX6_2_FILE_LOCKER_H
|
/***************************************************************************
tqslconvert.cpp - description
-------------------
begin : Sun Nov 17 2002
copyright : (C) 2002 by ARRL
author : Jon Bloom
email ... |
/****************************************
*
* INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE
* Copyright (C) 2019 Victor Tran
*
* 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 Software Foundati... |
#include <stdlib.h>
#include "ParticleSystem.h"
//-------------------------------------------
//Resets the particle at index
void ParticleSystem::ResetParticle(int index)
{
Particle* p = &m_particles[index];
//set the position
p->m_pos = m_emitPoint;
//reset the life
p->m_life = (m_maxLife - 5) + rand()%10;
//... |
//namespace
//using
#include <iostream>
using namespace std;
namespace ns_1{
void func(); //在头文件中如此声明即可调用跨文件的命名空间。
}
namespace ns_1{
void func()
{
cout << "ns_1:func()" << endl;
}
namespace ns_1_1{ //命名空间的嵌套
void func_1()
{
cout << "ns_1_1:func()" << endl;
}
}
}
namespace ns_2{
void func();
}
nam... |
/*
* SPDX-FileCopyrightText: (C) 2017-2022 Matthias Fehring <mf@huessenbergnetz.de>
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef CUTELYSTVALIDATORREQUIREDUNLESS_P_H
#define CUTELYSTVALIDATORREQUIREDUNLESS_P_H
#include "validatorrequiredunless.h"
#include "validatorrule_p.h"
namespace Cutelyst {
class Valida... |
#pragma once
#include <iostream>
#include <conio.h>
#include <list>
#include <cstdlib>
#include <ctime>
#include "__utils.hpp"
using namespace std;
#ifndef GAME_H
#define GAME_H
#define N_SCREENWIDTH 60
#define N_SCREENHEIGHT 23
#define N_SCREENCENTER_X 15
#define N_SCREENCENTER_Y 15
struct SSnakeSegment
{
c... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: main.cpp
* Author: Eagleye
*
* Created on September 12, 2018, 8:14 PM
*/
#include <iostream>
#includ... |
#include "stdafx.h"
#include "CppUnitTest.h"
#include <distant/memory/address.hpp>
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace distant_unit_tests
{
TEST_CLASS(address_tests)
{
private:
template <typename T>
void test_address(T address)
{
Assert::IsTrue(address == address);
... |
#ifndef SALARY_SERVICE_H
#define SALARY_SERVICE_H
#include "Salary_Repository.h"
#include "Salary.h"
#include "InvalidNameException.h"
#include "InvalidKennitalaException.h"
#include "InvalidYearException.h"
#include "InvalidMonthException.h"
#include "InvalidSalaryAmountException.h"
#include "InvalidSalaryAmountMinusE... |
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
NumericVector ThetaUpdateNormal_DPM(NumericVector Yobs,
NumericVector XX,
NumericVector XTr,
NumericVector Z,
NumericVector Tr,
NumericVector Trstar,
... |
#pragma once
#ifndef ENEMY_HPP
#define ENEMY_HPP
#include <vector>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/Rect.hpp>
#include <SFML/System/Vector2.hpp>
#include <SFML/System/Clock.hpp>
#include "inc/texture_manager.hpp"
#include "inc/main_state.hpp"
#includ... |
// -*- C++ -*-
//
// Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory,
// Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC
//
// This file is part of FreePOOMA.
//
// FreePOOMA is free software; you can redistribute it and/or modify it
// under the terms of the Expat license.
//
// This progr... |
// Copyright (C) 2017 Elviss Strazdins
// This file is part of the Ouzel engine.
#include "Texture.h"
#include "TextureResource.h"
#include "Renderer.h"
#include "ImageDataSTB.h"
#include "core/Engine.h"
namespace ouzel
{
namespace graphics
{
Texture::Texture()
{
resource = sharedE... |
/* Author: Hussain Miyaziwala Class: ECE4122 Last Date Modified: 9/23/19
Description:
HW 2 Part 1 : ECE MATRIX CLASS
*/
#include "ECE_Matrix.h"
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
using namespace std;
//max of two arguments is returned
double max(int a, int... |
// Copyright 2020-2021 Russ 'trdwll' Treadwell <trdwll.com>. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "SteamBridgeSettings.generated.h"
/**
*
*/
UCLASS(config = Engine)
class STEAMBRIDGE_API USteamBridgeSettings final : public UObject
{
GENERATED_BODY... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
double numFst;
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(ui->b0, SIGNAL(clicked()), this, SLOT(digit_nums()));
connect(ui->b1, SIGNAL(clicked()), this, SLOT(digit_nums()));
... |
/*
* Copyright 2016-2017 Flatiron Institute, Simons Foundation
*
* 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 ... |
//CompositeForm.cpp
#include "CompositeForm.h"
#include "Contents.h"
CompositeForm::CompositeForm(Contents *contents, Long capacity)
:Form(contents), forms(capacity){
this->capacity = capacity;
this->length = 0;
}
CompositeForm::~CompositeForm() {
Long i = 0;
while (i < this->length) {
if (this->forms.GetAt(... |
#include "mvscene.h"
MvScene::MvScene()
{
}
void MvScene::makeWalls()
{
float walls[11][4] = {{0, 0, 25, 245}, {25, 0, 425, 25}, {425, 0, 25, 245}, ...};
QBrush brush(QColor(255, 255, 255), QPixmap("wall.jpg"));
QPen pen(Qt::NoPen);
for (int i = 0; i < 11; i++) {
QGraphicsItem * item =
... |
#ifndef WIDGET_H
#define WIDGET_H
#include <QtWidgets>
#include <vector>
#include "ball.h"
class Widget : public QWidget
{
Q_OBJECT
private:
std::vector<Ball*> balls = {new Ball(40, 80), new Ball(80, 40)};
QPixmap image{"../../bounce/ball.png"};
public:
void timerEvent(QTimerEvent *event);
void pa... |
#include<LiquidCrystal_I2C.h>
#include<Wire.h>
LiquidCrystal_I2C lcd1(0x27,20,4);
LiquidCrystal_I2C lcd2(0x39,20,4);
#include <SoftwareSerial.h>
SoftwareSerial fingerPrint1(10, 11);
SoftwareSerial fingerPrint2(12, 13);
#include <Adafruit_Fingerprint.h>
#include<DS3231.h>
DS3231 rtc(SDA, SCL);// Init the DS323... |
/*****************************************************************************************************
* 剑指offer第41-2题
* 题目描述
* 小明很喜欢数学,有一天他在做数学作业时,要求计算出9~16的和,他马上就写出了正确答案是100。但是他并不满足
于此,他在想究竟有多少种连续的正数序列的和为100(至少包括两个数)。没多久,他就得到另一组连续正数和为100
的序列:18,19,20,21,22。现在把问题交给你,你能不能也很快的找出所有和为S的连续正数序列?
*
... |
/*
This project uses Automatic Package Restore feature of NuGet to resolve Aspose.BarCode for .NET API reference
when the project is build. Please check https://docs.nuget.org/consume/nuget-faq for more information.
If you do not wish to use NuGet, you can manually download Aspose.BarCode for .NET API from http://www.a... |
#include "Cell.h"
Cell::Cell()
{
i = 0;
j = 0;
status = EMPTY;
}
|
#include <bits/stdc++.h>
using namespace std;
#define ll long long
vector<string> ans;
string curr = "";
void gen(int i) {
if (i == 20) {
ans.push_back(curr);
} else {
curr += "Aa";
gen(i + 2);
curr.pop_back();
curr.pop_back();
curr += "BB";
gen(i + 2);... |
#include <iostream>
#include "CarDatabase.h"
using namespace std;
int main()
{
CarRecord cr;
cr.set("A9999", 1, "16:33");
CarDatabase cd("database"), cd2("database");
cd.add(cr);
cd2.read();
vector<CarRecord> cars = cd2.IndexRecordsByCar("A9999");
return 0;
}
|
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int mult(int a, int b){
/*
对于32-bit的int,最多执行32次即可
*/
int res = 0;
(a&1) && (res += b); // 当a是奇数时, res+=b
a >>= 1; b <<=1;
a && (res += mult(a, b));
return res;
}
int main(){
cout... |
#pragma once
#include <vector>
#include "mymath.h"
class Box {
public:
Box();
Vec3 GetCenter() { return _center; }
std::vector<Vec3> GetVertex() {
_vertexs.clear();
int sx, sy, sz;
for (int i = 0; i != 8; ++i) {
sx = i >> 2 & 1 ? 1 : -1;
sy = i >> 1 & 1 ? 1 : -1;
sz = i & 1 ? 1 : ... |
//
// Created by wiktor on 16.05.18.
//
#include "Scheduler.h"
namespace academia{
SchedulingItem::SchedulingItem(int course, int teacher, int room, int time, int y) {
course_id_ = course;
teacher_id_ = teacher;
room_id_ = room;
time_slot_ = time;
year_ = y;
}
void... |
class Solution {
public:
vector<vector<string>> groupAnagrams(vector<string>& strs) {
vector<vector<string>> res;
unordered_map<string, vector<string>> umap;
for (auto str : strs) {
vector<int> cnt(26, 0);
string key = "";
for (auto c : str) ++cnt[c - 'a']... |
/* parser.cpp -*- C++ -*-
Rémi Attab (remi.attab@gmail.com), 12 Apr 2015
FreeBSD-style copyright and disclaimer apply
*/
namespace reflect {
namespace json {
namespace {
/******************************************************************************/
/* CUSTOM PARSER ... |
#pragma once
enum ElementType {SQUARE, RECTANGLE, CIRCLE, ELLIPSE, TRIANGLE,TEXT};
class WShape : public CObject
{
public:
ElementType Type;//图元类型
int OrgX;//鼠标原点的坐标
int OrgY;
int Angle;
COLORREF BoderColor;//图形边框的颜色
int BoderType;//图形边框线型(实线,虚线,虚点线)
int BoderWidth;//图形边框宽度
COLORREF FillColo... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "Rerum.h"
#include "PlatformMoviment.h"
// Sets default values for this component's properties
UPlatformMoviment::UPlatformMoviment()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. ... |
#include "debug.h"
#include "an.h"
#include <iostream>
using namespace std;
int main()
{
config();
cout << a[0] << endl;
cout << b << endl;
x();
return 0;
} |
#pragma once
#include "Board.h"
#include "Piece.h"
#include "Square.h"
#include "Constants.h"
#include <iostream>
#include <vector>
class Player
{
Color color;
Board* board;
Player* opponent;
std::vector <Piece*> pieces;
public:
Player(Color color, Board* board);
std::vector <Piece*> getPieces();
Piece* getKing... |
/* GPA2 - IFC
Criado Por: Natalia Kelim Thiel
Data: 06/04/2016
Descrição:
Código fonte (source) da biblioteca para o uso do Sensor de Luminosidade (LDR)
*/
#include "Luminosidade.h"
Luminosidade::Luminosidade() {
_indice = 0;
_titulo = "LUMINOSIDADE";
_arquivo = "ldr";
//LDR _sensor(0... |
#include<bits/stdc++.h>
using namespace std;
int solve(vector<string>& input,int n)
{
int cur = 0;
for(int i=0;i<n;i++)
{
if(input[i]=="../")
{
cur=cur-1;
}
else if(input[i]=="./")
{
continue;
}
else
{
cur=cur+1;
}
}
return cur;
}
int main()
{
vector<string> input;
int n;
cin >> n;... |
/*
1. 3-6am: light traffic
2. 6-9am: medium traffic
3. 9am-9pm: heavy traffic
4. 9pm-3am: medium traffic
*/
int time_slot; //values between 1 and 4
int redLED1 = 2; //signal 1 red LED
int yellowLED1 = 3; //signal 1 yellow LED
int greenLED1 = 4; //signal 1 green LED
int redLED2 = 5; ... |
//
// pu.cpp
// CRsim
//
// Created by Ji on 14-10-6.
// Copyright (c) 2014年 lj. All rights reserved.
//
#include "pu.h"
PU::PU() {
initLocationRandom();
initAllPkt(global::PKT_ARR_RATE_PU, global::PKT_MAX_LEN_PU);
}
void PU::initLocationRandom() {
int x, y;
#ifdef SAME_NET_PARAMETERS_EACH_SIM
x ... |
#include<bits/stdc++.h>
using namespace std;
int solve2(int** gold,int m,int n,int sx,int sy)
{
if(sy==n-1)// last column no where to go..
{
return gold[sx][sy];
}
int first = 0;
int second = 0;
int third = 0;
if(sx-1 >=0)
{
first = solve2(gold,m,n,sx-1,sy+1);
}
second = solve2(gold,m,n,sx,sy+1);
if(sx+... |
#include <bits/stdc++.h>
using namespace std;
struct TreeNode
{
int val;
TreeNode *right;
TreeNode *left;
};
int sovle(TreeNode *root, int L, int R)
{
TreeNode *temp = root;
queue<TreeNode *> q;
q.push(temp);
int ans = 0;
while (!q.empty())
{
TreeNode *curr = q.front();
... |
#pragma once
class Int_Summer
{
public:
void run();
};
|
#define BOOST_TEST_MODULE "dsn::intrusive_ptr"
#include <dsnutil/intrusive_ptr.hpp>
#include <dsnutil/observing_ptr.hpp>
#include <iostream>
#include <boost/test/unit_test.hpp>
namespace {
class TestReferenceCounted : public dsn::reference_counted, public dsn::observable {
public:
TestReferenceCounted() { std::c... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
bool isPossible(vector<ll>& arr,ll n,ll k,ll cut)
{
long long total=0;
for(ll i=0;i<n;i++)
{
if(arr[i] > cut)
{
total+=(arr[i]-cut);
}
}
if(total >= k)
{
return true;
}
return false;
}
ll solve(vector<ll>& arr,ll n,ll k)
{
if(n==0)... |
#include "CommonHeader.h"
WaterFluidObject::WaterFluidObject(Scene * apScene, std::string aName, Vector3 aPos, Vector3 aRot, Vector3 aScale, Mesh * apMesh, ShaderProgram * apShader, GLuint aTexture, vec2 aUVScale, vec2 aUVOffset, const char * aCameraName, unsigned int aDrawRenderOrder) :
GameObject(apScene, aName, aP... |
#pragma once
#include <iostream>
#include <type_traits>
template <typename T>
void WritePrimitive(std::ostream& out, T t, size_t n = sizeof(T)) {
static_assert(std::is_integral<T>::value, "Integral required.");
out.write(reinterpret_cast<const char*>(&t), n);
}
template <typename T>
void WritePrimitive(std::ostr... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.Web.Syndication.0.h"
#include "Windows.Data.Xml.Dom.0.h"
#include "Windows.Foundation.0.h"
#include "Windows.Security.Credentials.0.h"
#include "Windows.F... |
/**********************************************************
* License: The MIT License
* https://www.github.com/doc97/TxtAdv/blob/master/LICENSE
**********************************************************/
#pragma once
#include <string>
#include "ResponseHandler.h"
#include "LuaManager.h"
namespace txt
{
/* Class: L... |
#pragma once
//VerticalScroll.h
#ifndef _VERTICALSCROLL_H
#define _VERTICALSCROLL_H
#include "Scroll.h"
#include "OtherNoteForm.h"
class VerticalScroll : public Scroll {
public:
VerticalScroll(OtherNoteForm *otherNoteForm);
VerticalScroll(const VerticalScroll& source);
virtual ~VerticalScroll();
VerticalScroll& o... |
#pragma once
#include <chrono>
#include <memory>
#include <queue>
#include <vector>
#include "constants.h"
class CScheduleable
{
public:
std::chrono::duration<double> mUpdateDurationSummed = std::chrono::duration<double>::zero();
TickType mNextCallTick;
CScheduleable(const TickType startTick=0)
... |
#include "sysconfig.h"
#include "sysdeps.h"
#include "devices.h"
#include "options.h"
#include "threaddep/thread.h"
#include "memory.h"
#include "audio.h"
#include "gfxboard.h"
#include "scsi.h"
#include "scsidev.h"
#include "sana2.h"
#include "clipboard.h"
#include "cpuboard.h"
#include "sndboard.h"
#include "status... |
/*
* MoleculesDbase.hh
*
* Created on: Aug 5, 2013
* Author: marchi
*/
#ifndef MOLECULESDBASE_HH_
#define MOLECULESDBASE_HH_
string RadiiDBase::mydata=
"$ALA\n"
" NH2 N3H3\n"
" N N3H1\n"
" CA C4H1\n"
" CB C4H3\n"
" C C3H0\n"
" O O1H0\n"
" OXT O1H0\n"
"$ARG\n"
" NH2 N3H... |
#include "../include/little_girl.hpp"
#include "../include/platform.hpp"
#include <typeinfo>
#include <algorithm>
#include <fstream>
using namespace engine;
void LittleGirl::on_collision(GameObject* other, Hitbox* p_my_hitbox, Hitbox* p_other_hitbox){
Hitbox* my_hitbox = dynamic_cast<Hitbox *>(p_my_hitbox);
Hitbo... |
/* Functions regarding server behavior and handling data send to server */
String get_content_type(String filename)
{
if (filename.endsWith(".html")) return "text/html";
else if (filename.endsWith(".css")) return "text/css";
else if (filename.endsWith(".js")) return "application/javascript";
else... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m,flag=0;
cin>>n>>m;
for(int i=n+1;i<=n+15;i++)
{
flag=0;
for(int j=2;j<=sqrt(i);j++)
{
if(i%j==0)
flag++;
}
if(flag==0)
{
if(i==m)
cout<<"YES... |
#include "VertexArray.h"
#include "glad.h"
#include "VertexBuffer.h"
#include "Globals.h"
#include <iostream>
VertexArray::VertexArray()
: m_opaqueVertexBuffer(),
m_transparentVertexBuffer(),
m_opaqueID(Globals::INVALID_OPENGL_ID),
m_transparentID(Globals::INVALID_OPENGL_ID)
{
glGenVertexArrays(1, &m_opaqueID);
... |
#pragma once
#include "Card.h"
class LaboratoriumCard :
public Card
{
public:
LaboratoriumCard();
static std::unique_ptr<Card> __stdcall Create();
~LaboratoriumCard();
};
|
#include <iostream>
#include "camera.hpp"
int main( int argc, char **argv)
{
Camera cam(0);
while(cam.is_connection_open())
{
Mat frame;
cam.capture_image(&frame);
imshow("Teste", frame);
if(waitKey(1)==113)
{
cout<<"Esc key is pressed by user. Stopping ... |
#include "chu_init.h"
#include "gpio_cores.h"
#include "sseg_core.h"
#include "ps2_core.h"
/*
aliases
*/
#define LEFT true;
#define RIGHT false;
/*
global constants
*/
constexpr uint8_t numOfLeds = 16;
constexpr int numOfSsegDisp = 8;
constexpr int minSpeed = 50;
constexpr int maxSpeed = 1000;
constexpr double swip... |
#include "DXUT.h"
#include "cGround.h"
#include "cResourceMgr.h"
#include "cObjMgr.h"
cGround::cGround(void)
{
}
cGround::~cGround(void)
{
}
void cGround::Init()
{
m_vScale.x *= 1.0f;
m_vScale.y *= 1.0f;
m_vDirection = D3DXVECTOR3( 0.0f, 0.0f, -1.0f );
m_fMoveSpeed = 500.0F;
const char* pKey = "ground";
i... |
#pragma once
#include "Definitions.h"
class IJKSize {
public:
constexpr IJKSize(int isize, int jsize, int ksize)
: isize(isize)
, jsize(jsize)
, ksize(ksize) {}
constexpr IJKSize(const IJKSize& other)
: isize(other.isize)
, jsize(other.jsize)
, ksize(other.ksi... |
#ifndef PROGRAMPOINTSIZE_H
#define PROGRAMPOINTSIZE_H
#include "Types.h"
namespace revel
{
namespace renderer
{
class ProgramPointSize
{
bool m_Enabled;
f32 m_PointSize;
public:
ProgramPointSize();
bool is_enabled() const { return m_Enabled; }
f32 point_size() const { return m_PointSize; }
... |
#include "render_target.h"
RenderTarget::RenderTarget( LPDIRECT3DDEVICE9 pD3DDevice, int width, int height, D3DFORMAT pixelFormat ):
m_pixelFormat(pixelFormat),
m_width(width),
m_height(height),
m_pRenderTarget(NULL),
m_pZTarget(NULL),
m_pDepthStencilTarget(NULL),
m_pDevice(pD3DDevice)
{
HRESULT hr;
hr = pD3DDevice-... |
/**
* @file StringUtils.h
* @author F. Gratl
* @date 1/14/19
*/
#pragma once
#include <autopas/options/TuningStrategyOption.h>
#include <cmath>
#include <regex>
#include <set>
#include <string>
#include <vector>
#include "autopas/options/ContainerOption.h"
#include "autopas/options/DataLayoutOption.h"
#include "a... |
#include <iostream>
#include <vector>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
#define WINDOW_NAME "[线性混合示例]" // 为窗口标题定义的宏
const int g_nMaxAlphaValue = 100; // Alpha值的最大值
int g_nAlphaValueSlider; // 滑动条对应的... |
#ifndef PSTATUS_H
#define PSTATUS_H
#include "core.h"
class PStatus : public QThread {
Q_OBJECT
public:
PStatus();
void run();
void PrintStatus(QString);
void PrintDescription(QString);
QString first;
QString second;
QString third;
bool isClient;
bool isDecimal;
private:
void SetPos(int, int);
void Cur... |
#pragma once
#include <QObject>
#include <QtTest/QtTest>
#include "pair.h"
class PairTest : public QObject
{
Q_OBJECT
public:
explicit PairTest(QObject *parent = 0);
private slots:
void emptyNumberTest()
{
Pair pair;
QVERIFY(pair.first == 0);
QVERIFY(pair.second == 0);
}
... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.UI.Xaml.Data.0.h"
#include "Windows.Foundation.0.h"
#include "Windows.UI.Xaml.0.h"
#include "Windows.UI.Xaml.Interop.0.h"
#include "Windows.Foundation.Col... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.