text stringlengths 8 6.88M |
|---|
#pragma once
#include "ofMain.h"
#include "ofxGui.h"
#include "Utils/ofEasyCamExt.h"
class ofApp : public ofBaseApp
{
public:
// --------------------------------
void setup()
{
fontSmall.loadFont("Fonts/DIN.otf", 8 );
ofxGuiSetFont( "Fonts/DIN.otf", 8 );
ofxGuiSetDefaultWidth( 260 );
s... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t, r1, r2, r3;
cin>>t;
while(t--)
{
cin>>r1>>r2;
r3 = r1+r2;
cout<<r3<<"\n";
}
return 0;
}
|
#include<bits/stdc++.h>
using namespace std;
class node{
public:
int data;
node* left;
node* right;
node(int d){
this->data = d;
this->left = NULL;
this->right = NULL;
}
};
node* buildTree(node* root){
int data;
cin>>data;
if(data == -1) return ... |
#include <SFML/Graphics/RectangleShape.hpp>
class RectangleCollider
{
public:
RectangleCollider(sf::Vector2f& position, sf::Vector2f& size);
RectangleCollider() = default;
void set_position(sf::Vector2f& position);
void set_size(sf::Vector2f size);
sf::Vector2f get_posotion() const;
sf::Vector... |
// Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <ie_builders.hpp>
#include <ie_icnn_network.hpp>
#include "single_layer_common.hpp"
#include "tests_vpu_common.hpp"
using namespace InferenceEngine;
/* this function assumes that the precision of a generated network is F... |
#include <stdio.h>
#include <node.h>
/*
NodeDescriptor::NodeDescriptor()
{
this->node = NULL;
this->offset = NULL;
}
NodeDescriptor::NodeDescriptor(Context* origin_, Node* node_, iref_t offset_)
: origin(origin_), node(node_), offset(offset_)
{
}
NodeDescriptor::NodeDescriptor(Node* node_)
: node(node_)
{
... |
/**
\file Point.cpp
Point class's implementation
\author Antoine Colmard (2014)
\author Nicolas Prugne (2014)
\copyright 2014 Institut Pascal
*/
#include "Point.h"
#include <stdlib.h>
// -----------------------------------------------------------------------------
// CONSTRUCTOR
// ----------------------------------... |
#ifndef BUS_H
#define BUS_H
#include "GameObject.h"
//#include "Traffic.h"
class Bus
{
public:
enum BUS_STATES
{
S_FULL_SPEED,
S_HALF_SPEED,
S_STOP,
};
Bus();
~Bus();
virtual void Update(double dt);
int GetCommuters();
void SetCommuters(int x);
float GetSpeed();
void SetSpeed(float x);
private:
... |
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmBinUtilsLinker.h"
#include "cmRuntimeDependencyArchive.h"
cmBinUtilsLinker::cmBinUtilsLinker(cmRuntimeDependencyArchive* archive)
: Archive(archive)
{
}
v... |
#pragma once
#include "../../../Toolbox/Toolbox.h"
#include "ShaderParameter.h"
namespace ae
{
class Shader;
/// \ingroup graphics
/// <summary>
/// Shader parameter for boolean uniforms.
/// </summary>
/// <seealso cref="Shader"/>
/// <seealso cref="Material"/>
/// <seealso cref="ShaderParameter"/>
class ... |
#include <iostream>
using namespace std;
void printInt(int n,int base);
int main()
{
int n,base;
cin>>n>>base;
printInt(n,base);
return 0;
}
void printInt(int n,int base)
{
char ch[]="0123456789ABCDEF",re[31];
int shang(0),i(0);
if(base<=10){do{
re[i]=n%base+'0';
shang=n/bas... |
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <chrono>
using namespace std;
using namespace cv;
int main(int argc, char **argv) {
if (argc != 3) {
cout << "usage: feature_extraction img1 img2" << endl;... |
#ifndef _SERVER_SERVER_HPP_
#define _SERVER_SERVER_HPP_
#include <iostream>
#include <boost/asio.hpp>
#include "DatabaseServerApi.hpp"
using boost::asio::ip::tcp;
class Session : public std::enable_shared_from_this<Session>
{
public:
Session(tcp::socket Socket) : socket(std::move(Socket)){ }
void Run()... |
#pragma once
#include <core/Map.h>
#include <core/Product.h>
#include <qt/QtCore/QEvent>
#include <qt/QtCore/QObject>
namespace launcher {
namespace qt {
struct EventFilter : public QObject {
core::Map<core::Product<QObject *, QEvent *>, bool> f;
EventFilter(core::Map<core::Product<QObject *, QEvent *>, boo... |
#include "commandbuilder.h"
CommandBuilder::CommandBuilder()
{
}
QString CommandBuilder::build(QString code, QStringList parameteres)
{
QString command;
command.append(code);
for(int i = 0; i < parameteres.size(); i++)
command.append("#" + parameteres.at(i));
command.append("\r\n");
return... |
#include "styleditemdelegate.h"
#include "tableview.h"
#include <QDebug>
StyledItemDelegate::StyledItemDelegate()
: QStyledItemDelegate ()
{
}
void StyledItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QStyleOptionViewItem opt(option);
opt.stat... |
//
// normal_esti_coarse2fine_ps.cpp
// pm_stereo
//
// Created by KaiWu on Sep/9/16.
// Copyright © 2016 KaiWu. All rights reserved.
//
#include "normal_esti_coarse2fine_ps.hpp"
// OV_tar_ind is not used
void esti_norm(MatrixXd &OV_tar, vector<MatrixXd> &OV_ref, VectorXi &OV_tar_ind, vector<VectorXi> &OV_ref_ind... |
#include<conio.h>
#include<stdlib.h>
#include<iostream>
using std::cin;
using std::cout;
using std::endl;
float Swap(float *p1,float *p2)
{
float temp;
temp=*p1;
*p1=*p2;
*p2=temp;
}
int main()
{
float *pointer1,*pointer2;
float m,n;
cout<<"Enter two numbers: "<<endl;
cin>... |
#include <cstdlib>
#include <iostream>
#include <chrono>
#include <random>
using namespace std;
int main()
{
unsigned seed = chrono::system_clock::now().time_since_epoch().count();
default_random_engine dre(seed); // [1,2147483646]
mt19937 mt(seed); // [0,4294967295]
uniform_int_distribution<unsigne... |
#include "monitordialog.h"
#include "ui_monitordialog.h"
MonitorDialog::MonitorDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MonitorDialog)
{
ui->setupUi(this);
main_layout = new QVBoxLayout;
main_layout->addWidget(ui->gridLayoutWidget);
setLayout(main_layout);
}
MonitorDialog::~Monito... |
#include <iostream>
#include "Flags.hpp"
#include "font.hpp"
using namespace std;
static const char *device = "/dev/spidev0.0";
static uint8_t mode;
static uint8_t bits = 8;
static uint32_t speed = 500000;
static uint16_t delay;
#define MAX_BUFFER 1024
int main(void)
{
int ret = 0;
int fd;
unsigned char tx[24] ... |
#pragma once
namespace BroodWar
{
namespace Api
{
namespace Client
{
public enum class CommandType
{
None,
SetScreenPosition,
PingMinimap,
EnableFlag,
Printf,
SendText,
ChangeRace,
StartGame,
PauseGame,
ResumeGame,
LeaveGame,
RestartGame,
SetLocalSpeed,
... |
#include "Statement.h"
#include <iostream>
std::string Parsed::ASMStat (Statement* Statement)
{
if (Statement -> Variable)
{
Variable Var;
try
{
Var = this -> VariableList.at (Statement -> Identifier);
}
catch (...)
{
return ";fuck \n";
}
if (!Var.Constant)
{
// this->bss.append(var.Def... |
#include "Production.h"
Production::Production(NonTerminator* head, int production_id):head(head),production_id(production_id)
{
}
void Production::printProduction()const {
cout << head->get_node_name() << " --> ";
vector<Node*> production = head->getProduction(production_id);
for (auto iter = production.begin()... |
#include "Month.h"
#include <string>
Month::Month(string date) {
this->date = date;
int year = stoi(date.substr(6, 4));
int mon = stoi(date.substr(3, 2));
int numDays = 0;
if (mon ==2 && year % 4 == 0 && year % 100 && year % 400) {//equation for leap year
numDays = 29;
}
else {
if (mon == 2) {
... |
#ifndef BUFFER_HH
#define BUFFER_HH
#include <memory>
#include <cassert>
namespace ten {
//! reference counted buffer, slices hold reference
class buffer {
private:
struct impl {
char *p;
size_t n;
impl(size_t bytes=0) : p(bytes ? new char[bytes] : 0), n(bytes) {}
~impl() { delet... |
//
// main.cpp
// Queue_Linked
//
// Created by 王宗祥 on 2020/11/27.
//
#include <iostream>
using namespace std;
class QueueNode {
private:
int elt;
QueueNode* next;
public:
QueueNode() : elt(0), next(nullptr) {};
QueueNode(int x) : elt(x), next(nullptr) {};
QueueNode(int x, QueueNode* next) : el... |
#include "GameLayer.h"
void on_attach()
{
}
void on_detach()
{
}
void on_update(float dt)
{
}
|
/*
Morse.cpp - Library for flashing Morse code.
Created by David A. Mellis, November 2, 2007.
Released into the public domain.
*/
#include "Arduino.h"
#include "Lib.h"
Prints::Prints(){}
String Prints::Timer(int tmr) {
String S;
if (tmr < 10)
S="00";
else if (tmr < 100)
S="0";
S = S + tmr;
S=S+"; ";
... |
#include <ESP8266WiFi.h>
#define trigPin D8
#define echoPin D1
const char* ssid = "your SSID";
const char* password = "password";
int motor1Pin1 = D0; // pin 7 on L293D IC
int motor1Pin2 = D2; // pin 2 on L293D IC
int motor2Pin1 = D3; // pin 15 on L293D IC
int motor2Pin2 = D4; // pin 10 on L293D IC
int LED... |
//===========================================================================
/*
This file is part of the CHAI 3D visualization and haptics libraries.
Copyright (C) 2003-2004 by CHAI 3D. All rights reserved.
This library is free software; you can redistribute it and/or modify
it under the terms o... |
#pragma once
#include "../Component.h"
#include "../model/Model.h"
#include "../../shader/Shader.h"
class Shader;
class Renderer : public Component
{
public:
Renderer(Model* model, Shader* shader);
virtual ~Renderer() {}
//virtual void render();
virtual void render(RenderingEngine* renderingEngine);
private:
... |
#include "dialog.h"
#include "ui_dialog.h"
#include <QGraphicsScene>
#include <QGraphicsview>
#include <QGraphicsItem>
#include <QGraphicsObject>
#include <QPixmap>
#include <vector>
#include <QPen>
#include <QMenuBar>
#include <iostream>
#include <QPainterPath>
#include <QSerialPort>
#include <QSerialPor... |
/*********************************************************************
* File pongObject.cpp
* Author Peter Look
* Class COP 2001 201901 10410
* Purpose Implementation file for a pong game object class that represents
the ball, paddles, and walls.
**********************************************************************... |
#include "Enemy.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void Enemy::Initialize(int mode)
{
if (mode == 0) LoadExportedModel("data/models/md2/zombie.md2"), health = 2;
else LoadExportedModel("data/models/md2/zombie1.md2"), health = 3;
counter = 75;
objectType = ObjectType::Enemy;
animationState... |
#pragma once
#include <maya/MPxLocatorNode.h>
class BasicLocator : public MPxLocatorNode
{
public:
virtual void draw(M3dView&, const MDagPath&, M3dView::DisplayStyle, M3dView::DisplayStatus);
virtual bool isBounded() const;
virtual MBoundingBox boundingBox() const;
static void *creator();
static MStatus initiali... |
/*Escape sequence or special characters which is used for specific task in a C++ program*/
/*inculding preprocessor*/
#include <iostream>
/*using namespace*/
using namespace std ;
/*main function of a programing*/
int main()
{
/*Here Manjor Escape Sequence are explained here*/
cout<<"\nBalck Slash will be prin... |
#include <cstdio>
using namespace std;
int main() {
int N, trans, newTrans, cnt = 0;
scanf("%d", &N);
trans = N;
do {
trans = trans % 10 * 10 + (trans / 10 + trans % 10) % 10;
cnt++;
} while(N != trans);
printf("%d", cnt);
return 0;
}
|
class Solution {
public:
// Parameters:
// numbers: an array of integers
// length: the length of array numbers
// duplication: (Output) the duplicated number in the array number
// Return value: true if the input is valid, and there are some duplications in the a... |
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<int> inorderTraversal(TreeNode* root) {
vector<int> left, right;
if(!roo... |
#ifndef PPJ_EMIT_H
#define PPJ_EMIT_H
#include <string>
using namespace std;
// Common use cases for registers:
// R5 = base pointer
// R6 = result, exit code, return value
// SP = stack pointer
extern string l_global;
void emit();
void emit(const char *format, ...);
string makeLabel();
void emitLabel(const char *... |
#pragma once
#include<iostream>
struct Position {
int x;
int y;
Position() {
x = y = 0;
}
Position(int x, int y) {
this->x = x;
this->y = y;
}
};
class BaseObject
{
protected:
int id;
std::string name;
Position position;
public:
explicit BaseObject(int, std::string, int, int);
virtual std::string getNa... |
/***************************************************************************************************
gameobject.h
Interfaces for gameobjects
by David Ramos
***************************************************************************************************/
#pragma once
//---------------------------------------------... |
#include <iostream>
#define MAX 103
#define INF 1000000000
using namespace std;
int matrix[MAX][MAX];
pair<int, int> pMatrix[MAX];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int tc;
cin >> tc;
while(tc--){
int n;
cin >> n;
for(int i = 1; i <= n+2; i++){
... |
#include "mainwindow.hpp"
#include "sinusform.hpp"
#include "ui_mainwindow.h"
#include "buttonworkerform.hpp"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow) {
ui->setupUi(this);
ui->widget_2->setWorker(new Worker(new ButtonWorkerForm()));
ui->widget_4->setWorker(new W... |
/* -*- 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 Arjan van Leeuwen (arjanl)
*/
#include "core/pch.h"
#... |
/*****************************************************************************************************************
* File Name : DivisibilityRules.h
* File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\fun\maths\school\class06\DivisibilityRules.h
* Created on : Dec 27, 2013 :: 1:00:50 AM
* Au... |
#include <bits/stdc++.h>
using namespace std;
typedef vector< long long int> VLLI;
typedef vector<VLLI> VVLLI;
short int N,suma,i;
unsigned long long int posibilidades;
vector<short int> triangulares(150);
VVLLI realizados;
long long int busca(short int n,short int j){
if(n== 0) return 1;
if(n < 0) return 0;
... |
//
// Created by Jingyi Lin on 2021-02-05.
//
#include <iostream>
#include "MapLoader.h"
#include "MapLoaderMain.h"
using std::cout,std::endl;
int mapLoader::main() {
MapLoader *mapLoader,*mapLoader_invalid, *mapLoader_valid, *mapLoader_copy;
try {
cout << "Loading valid map"<<endl;
mapLoader... |
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*-
*
* 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 RE_COMPILER_H
#define RE_COMPILER_H
#include "modules/regexp/src... |
#include "Triggers.h"
#include <iostream>
#include <string>
using namespace std;
string Triggers::getType(){
return type;
}
void Triggers::setType(string type){
this->type = type;
} |
#ifndef SHADER_HPP_
#define SHADER_HPP_
#include <stdint.h>
#include <SDL2/SDL_opengles2.h>
class shader {
protected:
uint32_t shader_id;
public:
shader(GLenum shader_type, const char *shader_source);
shader(shader const &) = delete;
~shader();
void operator=(shader const &) = delete;
uint32_... |
/*
* Fadecandy testjig firmware for production.
* This loads an initial bootloader/firmware image on the device, and runs electrical tests.
*
* Communicates with the PC for debug purposes using USB-Serial.
* Final OK / Error status shows up on WS2811 LEDs attached to the DUT.
*/
#include "arm_kinetis_debug.h"
#i... |
/*
* File: Area.hpp
* Author: vitaliy
*
* Created on July 16, 2017, 11:30 PM
*/
#ifndef AREA_HPP
#define AREA_HPP
#include <string>
#include <set>
class Sensor;
struct by_id
{
bool operator ()(Sensor *a, Sensor *b) const;
};
class Area
{
private:
protected:
int id;
std::string name;
std::se... |
#pragma once
#include "stdafx.h"
#include "Graphics\Surfaceobj.h"
#include <carve/carve.hpp>
#include <carve/poly.hpp>
#include <carve/polyline.hpp>
#include <carve/pointset.hpp>
typedef carve::poly::Polyhedron Polyhedron;
typedef carve::geom3d::Vector cVector;
typedef carve::poly::Vertex<3> cVertex;
typedef ca... |
// Harry Beadle
// LED Color Match
// Original 19/09/15
// Last Updated 06/10/15
// Initalise the arrays, incuding the pin numbers.
// You should make these any PWM enabled pins on
// your brand of Arduino. This is set up for an
// Arduino mini.
int pinColor[3] = {6, 9, 5}; // {R, G, B}
int oldColor[3] = {0, 0, 0}; ... |
/* -*- 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.
**
** Ole Gunnar Westgaard
**
*/
#include "core/pch.h"
#ifdef HAS... |
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <regex>
using namespace std;
struct Range{
Range(int begin, int end) : b(begin), e(end) {}
int b, e;
bool operator<(const Range& other){
return (this->b == other.b && this->e < other.e) || this->b < other.b;
}
... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
using namespace std;
int a[10][10];
bool vis[10];
int dfs(int k) {
}
int main() {
int t;
... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Troop.h"
#include "SiegeEngine.generated.h"
/**
*
*/
UCLASS()
class NEWTD_API ASiegeEngine : public ATroop
{
GENERATED_BODY()
public:
ASiegeEngine();
};
|
class Solution {
public:
ListNode* reverseBetween(ListNode* head, int m, int n) {
ListNode* pre = nullptr;
ListNode* dummyNode = new ListNode(0,head);
ListNode* now = head;
ListNode* cur = now;
for(int i=0; i<m-1; i++) { //now移动到需要反转的地方
cur = now;
now = now... |
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
using namespace std;
vector<int> v[1010];
int n;
void find_blocks(int t,int& x,int& y)
{
for (int i = 0;i < n; i++)
for (int j = 0;j < v[i].size(); j++)
if (v[i][j] == t)
{x = i;y = j;
return;
}
}
void clear_above(in... |
// Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ORBIT_CORE_TRACEPOINT_INFO_MANAGER_H_
#define ORBIT_CORE_TRACEPOINT_INFO_MANAGER_H_
#include <optional>
#include <string>
#include "BlockChain.... |
/*
Exp no : 13
Selective repeat SW simulation
S1330-R-Jayadeep
15/11/2016
*/
#include<iostream>
#include<random>
#include<queue>
#include<map>
using namespace std;
#define window_size 5
class Socket{
map<int,char> data;
public:
int receive(char c,int seq){
if(random()%2){
data[seq] = c;
return seq;
}
... |
/*Programmer: Medha Aiyah
* assignment2.h
*This is the header file for Assignment 2
*/
#ifndef ASSIGNMENT2_H_
#define ASSIGNMENT2_H_
// put any includes here
#include <iostream>
#include <fstream>
#include <iomanip>
//put constant variables
const unsigned int MAX_SIZE = 4; //is this alright creating a const vari... |
/*
* Copyright (c) 2015-2021 Morwenn
* SPDX-License-Identifier: MIT
*/
#include <algorithm>
#include <cstddef>
#include <ctime>
#include <random>
#include <string>
#include <utility>
#include <vector>
#include <cpp-sort/detail/bitops.h>
#include <cpp-sort/detail/type_traits.h>
#include <cpp-sort/utility/as_function.... |
#include "thread_mcl.h"
QImage thread_mcl::img;
QString thread_mcl::state;
QString thread_mcl::neff;
bool thread_mcl::kind;
int thread_mcl::n_particles;
thread_mcl::thread_mcl(Robot *robo, Mcl *myMcl, Map *myMap, int time, bool localization, bool kld)
{
this->robo = robo;
this->myMcl = myMcl;
this->locali... |
/**
* created: 2013-4-7 0:04
* filename: FKType
* author: FreeKnight
* Copyright (C):
* purpose:
*/
//------------------------------------------------------------------------
#pragma once
//------------------------------------------------------------------------
#include <string.h>
//------------------------... |
#include <Unixfunc.h>
#include <iostream>
using namespace std;
/*
应用层协议设计,通过上面的例子,我们得知,只读一次recv很可能无法将内核缓存中的数据读完,这样便不能解决TCP传输中粘包的问题
recv函数可能出现的问题:接收缓存区中的字节较少(不够len字节),recv有字节读取就返回,就无法一次性读取len的字节,所以需要循环读,保证字节读够
*/
//改进recv函数,可以完整的接收数据
int recvCycle(int fd, void* p, size_t len)
{
char *pStart = (char*)p;
size_t ... |
#ifndef FORMREACSETTINGS_H
#define FORMREACSETTINGS_H
#include "config.h"
#include <QWidget>
namespace Ui {
class FormReacSettings;
}
class FormReacSettings : public QWidget
{
Q_OBJECT
signals:
void SaveConfig();
public:
FormReacSettings(SysConfig *config, DevSettings *devSettings, QWidget *parent = nullp... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; 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"
#ifdef M2_SUPPORT
#include <ctype.h>
#in... |
#include <iostream>
using namespace std;
int minm(int A,int B,int C)
{
int ans=A;
if(B<ans)
ans=B;
if(C<ans)
ans=C;
return ans;
}
int minm(int A,int B)
{
if(A<=B)
return A;
else
return B;
}
int minm(int A[3],int B)
{
int ans=B;
for(int i=0;i<3;i++)
{
if(A[i]<ans)
{
ans=A[i];
}
}
return ans... |
#ifndef MDFN_FILE_H
#define MDFN_FILE_H
#include <string>
class MDFNFILE
{
public:
MDFNFILE();
MDFNFILE(const char *path);
~MDFNFILE();
bool Open(const char *path);
bool Close(void);
uint8 *f_data;
int64 f_size;
char *f_ext;
};
// These functions should be used for data like save states and non-volatile ... |
#ifndef AMVK_QUAD_H
#define AMVK_QUAD_H
class Quad {
public:
};
#endif
|
#pragma once
#include <DxLib.h>
#include "Sounder.h"
const int FIRST_DISTANCE = 80; //playerとenemeyの初期距離(playerの初期z座標)
const int PRE_POS_MAX_INDEX = 30; //配列pre_posの要素数
const int ESCAPE_COUNT_MAX = 200; //逃げられる最大フレーム数
const int FREEZE_COUNT_MAX = ESCAPE_COUNT_MAX; //硬直する最大フレーム数
const int FLA... |
#include "core.h"
template<typename Type>
Type sum(int size, Type* array, int& treatmentError, bool& error, bool& JustOneElement)
{
Type _sum = 0;
int fixMove = 0, temp = 0;
treatmentError = 0;
JustOneElement = false;
error = false;
for (int i = 0; i < size; i++)
if (array[i] < 0)
... |
#include <iostream>
using namespace std;
int main()
{
int n, m; cin >> n >> m;
int x = 0, y = 0, z = 0;
bool flag = false;
// xが決まった後のyとzの関係式は以下の通り
// y + z = n - x;
// 5000 * y + 1000 * z = m - 10000 * x;
for (int i = 0; i <= n; i++) {
x = i;
for (int j = 0; j <= n - i; ... |
// CreateAnimationKeyDlg.cpp : 구현 파일입니다.
//
#include "stdafx.h"
#include "CocosTool.h"
#include "CreateAnimationKeyDlg.h"
#include "afxdialogex.h"
IMPLEMENT_DYNAMIC(CreateAnimationKeyDlg, CDialogEx)
CreateAnimationKeyDlg::CreateAnimationKeyDlg(CWnd* pParent)
: CDialogEx(CreateAnimationKeyDlg::IDD, pParent) , mSelec... |
/************************************************************************/
/* detect . */
/************************************************************************/
#ifndef detector_h__
#define detector_h__
#include "../utils/util.h"
#include "../utils/singleton.h"
namespace ice
{
class SSDNet;
... |
#include<stdio.h>
#include<iostream>
#include<cmath>
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int numCases;
scanf("%d", &numCases);
for(int i = 0; i < numCases; i++)
{
long long num = 0;
... |
/* ***** 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 <boost/filesystem/path.hpp>
#include <boost/filesystem/convenienc... |
class Solution {
public:
int FindGreatestSumOfSubArray(vector<int> array) {
if(array.size() <= 0){
return 0;
}
vector<int> dp(array.size()+1);
dp[0] = array[0];
for(int i=1; i<array.size(); ++i){
if(dp[i-1] <= 0){
dp[i] = array[i];
... |
#include <QDebug>
// RsaToolbox includes
#include "General.h"
#include "VnaLogSweep.h"
#include "VnaChannel.h"
#include "Vna.h"
using namespace RsaToolbox;
// Qt includes
// #include <Qt>
/*!
* \class RsaToolbox::VnaLogSweep
* \ingroup VnaGroup
* \brief The \c %VnaLogSweep class
* configures and controls a frequ... |
/*
==========================================
Copyright (c) 2016-2018 Dynamic_Static
Patrick Purcell
Licensed under the MIT license
http://opensource.org/licenses/MIT
==========================================
*/
#pragma once
#include "Dynamic_Static/Core/VectorUtilities.hpp"
#include "Dynamic_Static... |
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;
vector<ll> suffix_array(const string &S) {
ll n = S.length(), k = 1;
vector<ll> sa(n + 1), rnk(n + 1), tmp(n + 1);
auto compare_sa = [&](const ll& i, const ll& j) {
if(rnk[i] != rnk... |
#include "bricks/core/exception.h"
#include <errno.h>
namespace Bricks {
void ThrowErrno()
{
int err = errno;
if (!err)
return;
BRICKS_FEATURE_THROW(ErrnoException(String::Format("errno %d: %s", err, strerror(err)), err));
}
void ThrowErrno(const String& message)
{
int err = errno;
if (!err)
ret... |
//
// Created by Nikita Kruk on 26.11.17.
//
#ifndef SPRAPPROXIMATEBAYESIANCOMPUTATION_SIMULATIONRUNOBSERVER_HPP
#define SPRAPPROXIMATEBAYESIANCOMPUTATION_SIMULATIONRUNOBSERVER_HPP
#include "../Definitions.hpp"
#include "../ParameterSets/AbstractParameterSet.hpp"
#include "SyntheticObserver.hpp"
#include <string>
#i... |
#include "line_fit_iterator_viewer.h"
LineFitIteratorViewer::LineFitIteratorViewer(ceres::Problem* problem, Line<double> line_gt, bool stop_every_iteration):
m_problem(problem), m_stop_every_iteration(stop_every_iteration), m_line_gt(line_gt)
{
m_viewer.reset(new pcl::visualization::PCLVisualizer);
m_viewe... |
// **************************** all submasks ***************************
for (int s = m; ;s = (s - 1) & m) {
do_smth(s);
if (!s) break;
}
// ***************************** Geometry ******************************
struct Point { //integer point
int x, y;
inline Point() : x(0), y(0) {}
inline Point(int _x, int ... |
#ifndef SPECEX_GAUSS_HERMITE_PSF__H
#define SPECEX_GAUSS_HERMITE_PSF__H
#include "specex_psf.h"
#include <string>
#include <vector>
namespace specex {
class GaussHermitePSF : public PSF {
protected :
int degree;
public :
typedef std::shared_ptr <GaussHermitePSF> pshr;
GaussHermitePSF(... |
#ifndef CONFIGURABLE_H
#define CONFIGURABLE_H
#include "configuration.h"
class Configurable
{
public:
virtual void setConfiguration(Configuration configuration) = 0;
virtual ~Configurable() =default;
};
#endif // CONFIGURABLE_H
|
#include <gtest/gtest.h>
#include "shoc/cipher/aes.h"
using namespace shoc;
template<size_t N>
static void compare(span_i<N> out, span_i<N> exp)
{
ASSERT_TRUE(out.data());
ASSERT_TRUE(exp.data());
ASSERT_TRUE(out.size() == exp.size());
for (size_t i = 0; i < N; ++i)
ASSERT_EQ(out[i], exp[i]) <... |
#pragma once
#include "predefines.h"
#include "SystemBase.h"
// uint64 EntityID;
struct EntityDTRecord
{
// 맵같은 경우 SubEntity가 있다.
uint32 m_NumSubEntity;
vector<uint64> m_vSubEntityID;
// ComponentSystemIndex(8bit), ComponentIndex(24bit)
uint32 m_NumComponent;
vector<uint32> m_vComponentDTID;
};
/... |
using namespace std;
enum cardinal {
NORTH = 0,
SOUTH,
EAST,
WEST
};
struct Dirs {
vector<Point> dir;
cardinal d;
Dirs()
{
dir.resize(4);
dir[NORTH] = {0,-1};
dir[SOUTH] = {0, 1};
dir[EAST] = {1, 0};
dir[WEST] = {-1,0};
}
}; |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef ELEMENT_EXPANDER_IMPL_H
#define ELEMENT_EXPANDER_IMPL_H
... |
#include <iostream>
#include <glm/gtc/matrix_transform.hpp>
#include <math.h>
#include "Camera.hpp"
#define PI 3.14159265f
#define PI_HALF PI / 2.0f
#define TWO_PI 2.0f * PI
////////////////////////////////////////////////////////////////////////////////
Camera::Camera() {
pos_ = glm::vec3(0.0f, 0.0f, 0.0f... |
//: C10:Dependency2.h
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
#ifndef DEPENDENCY2_H
#define DEPENDENCY2_H
#include "Dependency1.h"
class Dependency2 {
Dependency1 d1;
public:
Dep... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2005-2006 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 SVG_SUPPORT
#include "modules/svg/s... |
#include <iostream>
#include <cmath>
using namespace std;
int countPrimes(int n){
if(n == 0 || n == 1 || n == 2){
return 0;
}
if(n == 3){
return 1;
}
int count = n >> 1;
int ret = 1;
int sqrt_n = int(sqrt(n));
bool *bptr = new bool[count];
for(int i = 0; i < count;... |
#ifndef VECTOR_H
#define VECTOR_H
#include "float.hpp"
namespace geometry
{
class Vector : public Object
{
public:
Vector();
Vector(Float x, Float y);
Vector(Float* x, Float* y);
Vector(std::string string);
Vector(Object* obj);
~Vector();
Float* getX();
void setX(Float* value);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.