text stringlengths 8 6.88M |
|---|
#include "object.hpp"
namespace GameEngine
{
class DummySerializable : public Serializable
{
public:
virtual void
Serialize(std::ostream *s) {
}
virtual void
Deserialize(std::istream *s) {
}
};
class DummyDrawable : public Drawable
{
public:
virtual void Draw(tick_t tick, void *scene) { }
};
... |
#include <iostream>
#include <cstdio>
//#include <bits/stdc++.h>
#define Inf 0x3f3f3f3f
#define Neinf 0xc0c0c0c0
using namespace std;
int main()
{
//freopen("./in.txt", "r", stdin);
//freopen("./out.txt", "w", stdout);
//ios::sync_with_stdio(0);
//cin.tie(0);
int ca;
bool first = 1;
cin >>... |
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 1e4;
int n, radix, len = 0, ans[maxn];
int main() {
// #define DEBUG
#ifdef DEBUG
freopen("d:\\.in", "r", stdin);
freopen("d:\\.out", "w", stdout);
#endif
cin >> n >> radix;
cout << n << ... |
/*************************************************************
* > File Name : c1075_0.cpp
* > Author : Tony
* > Created Time : 2019/10/15 12:26:41
* > Algorithm : math
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
inl... |
#include <iostream>
using namespace std;
const int Len = 10;
void Fill_array(double *, int);
void Show_array(const double *, int);
void Reverse_array(double *, int);
int main(void)
{
double a[Len] = {0.0};
// fill the array
Fill_array(a, Len);
// show elements
Show_array(a, Len);
// rever... |
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
int n, x, y;
cin >> n;
if (n & 1){
x = 9; y = n-9;
} else{
x = 8; y = n-8;
}
cout << x << ' ' << y << endl;
return 0;
}
|
#include "File.h"
#include <iostream>
File::File(std::string name, std::string extension) :
name_{ std::move(name) },
extension_{ std::move(extension) }
{
}
void File::print(const unsigned depth, const int) const
{
print_indentation(depth);
std::cout << name() << '.' << extension() << '\n';
} |
#pragma once
#ifdef __EMSCRIPTEN__
#include <GL/gl.h>
#include <GL/glext.h>
#else
#include <glbinding/gl/gl.h>
using namespace gl;
#endif
#include "resource.h"
#include "shader_resource.h"
#include <map>
namespace GLPlay {
class Shader {
public:
Shader(std::string frag_shader, std::string vert_shader);
GL... |
#pragma once
#include "SFML/System.hpp"
#include "SFML/Graphics.hpp"
#include "SFML/Window.hpp"
#include <iostream>
#include <vector>
#include <array>
#include <unordered_set>
#include <unordered_map>
#include <utility>
#include <queue>
#include <stack>
#include <string>
#include <random> |
/*LIBRARY MANAGEMENT SYSTEM
ZAIN ASGHAR 19011519-062
ALI HASSAN CHEEMA 19011519-067
*/
#include<windows.h>
#include<iostream>
#include<string>
#include<conio.h>
#include<fstream>
#include <iomanip>
using namespace std;
using std::ostream;
using std::istream;
void loading()
{
cout<<"\n\n\n\n\n\n\n\n"... |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
double INF = 1e100;
double EPS = 1e-12;
typedef long long int ll;
typedef pair < int,int > PII;
typedef ... |
#include<bits/stdc++.h>
using namespace std;
/*
Complexity: O(nlogn + mlogm)
n: Numbers of applicants
m: Number of apartments
*/
int main() {
int n, m, k, data;
vector<int> desires;
vector<int> apartments;
cin >> n >> m >> k;
for(int i = 0; i < n ; i++) {
cin >> data;
desires.push_back(data);
}
for (i... |
#include "clockwisetrace.h"
#include "ui_clockwisetrace.h"
ClockWiseTrace::ClockWiseTrace(QWidget *parent) :
QDialog(parent),
ui(new Ui::ClockWiseTrace)
{
ui->setupUi(this);
}
ClockWiseTrace::~ClockWiseTrace()
{
delete ui;
}
void ClockWiseTrace::on_buttonBox_accepted()
{
maxDist... |
#include <iostream>
#include "parentList.h"
using namespace std;
int main()
{
List_parent LP;
list_relasi LR;
createList(LP);
createList(LR);
infotype_relasi Y;
infotypeParent X;
infotype_child Z;
address_parent P;
address_relasi R;
string cari;
X... |
#include<iostream>
#include<algorithm>
#include<stdlib.h>
using namespace std;
int main()
{
long long int count = 0,i,j,k = 0,n,x,arr[100000],arra[100000];
cin>>n>>x;
for(i = 0;i < n;++i)
cin>>arr[i];
for(i =0 ;i < n;++i)
cin>>arra[i];
sort(arr,arr+n);
sort(arra,arra+n);
for(... |
#include "pagelogsetup.h"
#include "ui_pagelogsetup.h"
#include "QDebug"
#include <QFileDialog>
//#include <QDirIterator>
PageLogSetup::PageLogSetup(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageLogSetup)
{
ui->setupUi(this);
layout()->setContentsMargins(10, 10, 10, 10);
mVesc = 0;
}
PageLo... |
#include <jni.h>
#include <string>
#include <rtmp.h>
#include <x264.h>
#include "VideoChannel.h"
#include "safe_queue.h"
#include "macro.h"
#include "AudioChannel.h"
extern "C" JNIEXPORT jstring JNICALL
Java_com_sty_ne_livepushclient_MainActivity_stringFromJNI(
JNIEnv* env,
jobject /* this */) {
st... |
#include "food_chain.h"
std::string food_chain::verse(uint16_t num) {
std::string verse;
switch (num) {
case 1:
verse = "I know an old lady who swallowed a fly.\n"
"I don't know why she swallowed the fly. Perhaps she'll die.\n";
break;
case 2:
verse = "I know an old lady who swallowed a spider.\n"
"I... |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#include <stdio.h>
#include <iostream>
#include <climits>
#include <map>
#include <cmath>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <vector>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <utility>
#include <queue>
using namespace std;
#define ll long long
#de... |
/*************************************************************************
*
* Copyright (C) 2016-2020 Mediator Software and/or its subsidiary(-ies).
* All rights reserved.
* Contact: Mediator Software (info@mediator-software.com)
*
* NOTICE: All information contained herein is, and remains the property of
* Mediator ... |
// Pointers
#include <iostream>
using namespace std;
int main(){
int a=10;
int *aptr=&a;
// int **b= &aptr;
// cout<<a<<endl;
// cout<<aptr<<endl;
// cout<<*aptr<<endl;
// cout<<&aptr<<endl;
// cout<<b<<endl;
// cout<<(*b)<<endl;
// cout<<(**b)<<endl;
// cout<<&b<<endl;
int *x=NULL;
cout<<*x<<endl;
... |
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <iomanip>
const int SPORTSMEN = 5;
const int ATTEMPT = 3;
double drand()
{
double d1 = rand();
double d2 = rand();
double d3 = d2 / d1;
return d3 - floor(d3);
}
void create(double result[SPORTSMEN][ATTEMPT])
{
for(int i = 0; i < SPORTSMEN; i++)
{... |
//
// main.cpp
// GameEngine
//
// Created by 梅宇宸 on 17/1/2.
// Copyright © 2017年 梅宇宸. All rights reserved.
//
#include <iostream>
#include "Engines/Input.hpp"
#include "Engines/Window.hpp"
#include "Engines/Shader.hpp"
#include "Engines/Loader.hpp"
#include "Engines/Renderer.hpp"
#include "Engines/Model.hpp"
#in... |
#include <QCoreApplication>
#include "uart_socket.h"
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
uint32_t un_baud = 1000000;
CUARTSocket pipe("/dev/ttyACM0", un_baud);
uint8_t stuff[2] = {0, 0};
uint8_t confirm[1] = {69};
pipe.O... |
#ifndef CSTENCILPANEL_H
#define CSTENCILPANEL_H
#include "datatypes.h"
#include "CGuiPanel.h"
class CStencilPanel: public CGuiPanel{
public:
CStencilPanel(const vec2d& pos, const vec2d& size);
void draw();
void afterDraw();
};
inline CStencilPanel::CStencilPanel(const vec2d& pos, const v... |
#include "doppler_image.h"
#include "settings.h"
#include <math.h>
#include <wx/file.h>
doppler_image::doppler_image()
{
//Add Image Handler
wxImageHandler *gifLoader = new wxGIFHandler();
wxImage::AddHandler(gifLoader);
m_sourceImage = NULL;
m_cachedImage = NULL;
}
doppler_image::~doppler_image()... |
#include "image.h"
Image::Image() : Binary()
{
}
Image::Image(const QString& id, const QString& titre, const QString& path, const QString &desc) : Binary(id,titre,path,desc)
{
}
Note::NoteType Image::getType()const{
return IMAGE;
}
|
#include "pch.h"
#include "RPostgres_types.h"
[[cpp11::register]]
int client_version() {
return PQlibVersion();
}
[[cpp11::register]]
cpp11::external_pointer<DbConnectionPtr> connection_create(
std::vector<std::string> keys,
std::vector<std::string> values,
bool check_interrupts
) {
LOG_VERBOSE;
DbConne... |
#include"stdafx.h"
#include "Pkw.h"
#include "FzgVerhalten.h"
#include "Weg.h"
#include "SimuClient.h"
#include <iostream>
#include <iomanip>
using namespace std;
extern double dGlobaleZeit;
extern double tInkrement;
PKW::PKW()
{
vInitialisierung();
}
PKW::~PKW()
{
}
PKW::PKW(const PKW& pkw) :Fahrzeug(pkw.p_sNam... |
#ifndef PATH_PLANNING_HEADER
#define PATH_PLANNING_HEADER
#include "ros/ros.h"
#include <octomap_msgs/Octomap.h>
#include <octomap_msgs/conversions.h>
#include <octomap_ros/conversions.h>
#include <octomap/octomap.h>
#include <octomap/ColorOcTree.h>
#include <octomap/OcTree.h>
#include <message_filters/subscriber.h>
#... |
#include "node.hpp"
#include "topic.hpp"
void Node::RegSubscriber(const std::string _topic) {
sub_ptr_ = Topic::Instance()->RegistSubscriber(_topic);
sub_topic_ = _topic;
return;
}
void Node::RegPublisher(const std::string _topic) {
pub_ptr_ = Topic::Instance()->RegistPublisher(_topic);
pub_topic_... |
#ifndef ICAMERA_H
#define ICAMERA_H
class ICamera
{
public:
virtual void Move(float dx,float dy,float dz) = 0;
virtual void Rotate(float dangle) = 0;
virtual void ApplyProjectionTransform() = 0;
virtual void ApplyViewTransform() = 0;
ICamera()
{}
virtual ~ICamera()
{}
};
#endif // ICAMERA_H
|
#include "point.h"
// grid (row 0:8, column 0:8) coordinates
// private base constructor
Point::Point(int rowNo, int columnNo) :
rowNo(rowNo),
columnNo(columnNo) {
initBlock(rowNo, columnNo);
}
// convert (block 0:8, blockrow 0:2, blockcolumn 0:2) to
// grid (row 0:8, column 0:8) c... |
#include <iostream>
using namespace std;
class Solution {
public:
int climbStairs(int n) {
if (n == 1) return 1;
if (n == 2) return 2;
int a = 1, b = 2;
int ret;
for (int i = 3; i <= n; i++) {
ret = a+b;
a = b;
b = ret;
}
... |
#ifndef List_hpp
#define List_hpp
#include <iostream> // std::cout
#include <stdio.h>
#include "MinimumHeap.hpp"
#include "splay.hpp"
//using namespace std;
typedef enum{
LIST_SUCCES, LIST_MEMORY
} ListRes;
class NodeGroup{
public:
int group_num;
NodeGroup* next;
SPtree<>* group_glad_tree;
Gr... |
// This file has been generated by Py++.
#ifndef PropertyInitialiserVector_hpp__pyplusplus_wrapper
#define PropertyInitialiserVector_hpp__pyplusplus_wrapper
void register_PropertyInitialiserVector_class();
#endif//PropertyInitialiserVector_hpp__pyplusplus_wrapper
|
#ifndef EX5_2_PLAYER_H
#define EX5_2_PLAYER_H
#include <iostream>
#include "playfield.h"
#include "jan_playfield.h"
class player {
public:
virtual int play(const playfield &field) = 0;
virtual ~player() {}
};
#endif //EX5_2_PLAYER_H
|
#pragma once
// Declarations for a calculator that builds an AST
// and a graphical representation of the AST.
// by Brian Malloy
#include <iostream>
#include <string>
#include <map>
#include <list>
#include "literal.h"
class SymbolTable;
extern void yyerror(const char*);
extern void yyerror(const char*, const c... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->model=new QStandardItemModel;
this->model->setHorizontalHeaderItem(0,new QStandardItem("ID"));
this->model->setHorizontalHeaderItem... |
//**************************************************************************
//**
//** See jlquake.txt for copyright info.
//**
//** 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 Foundation; either ... |
#include "algorithm/module/include/map.h"
namespace OpticalFlow_SLAM_algorithm_opticalflow_slam {
/**
* @brief
* @author snowden
* @date 2021-07-28
* @return
* @version 1.0
*/
bool Map::add_frame(std::shared_ptr<Frame> sp_frame)
{
std::unique_lock<std::mutex> frames_lock_{frames_mutex_};
... |
class SPM_AmbientRadio2
{
name = "SPM_AmbientRadio2";
sound[] = { "@a3\sounds_f\sfx\radio\ambient_radio2.wss", 5, 1.0, 100.0 };
titles[] = {};
};
class SPM_AmbientRadio6
{
name = "SPM_AmbientRadio6";
sound[] = { "@a3\sounds_f\sfx\radio\ambient_radio6.wss", 5, 1.0, 100.0 };
titles[] = {};
};
class SPM_AmbientRad... |
#include <opencv2/core.hpp>
#include <opencv2/opencv.hpp>
#include "facialLandmarkDetection.cpp"
#include <iostream>
#include <fstream>
#include <stdio.h>
using namespace std;
using namespace cv;
#if 1
// Variable for landmarks.
// Landmarks for one face is a vector of points
// There can be more th... |
#include <ge.hpp>
#include "menu/menu.hpp"
GE_MAIN(doodle::Menu, 640, 1080, "Doodle Jump"); |
#ifndef GENAIG_H
#define GENAIG_H
/// @file GenAig.h
/// @brief GenAig のヘッダファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2012 Yusuke Matsunaga
/// All rights reserved.
#include "YmTools.h"
#include "YmLogic/AigMgr.h"
#include "YmLogic/Aig.h"
#include "AigPat.h"
#include "FuncXform.h"
BEGIN_... |
// 가변저항테스트
void setup() {
Serial.begin(9600);
pinMode(11, OUTPUT);
}
void loop() {
//가변저항에서 값을 읽어오기 - 0~1023
//led : 0~255
int inputVal = analogRead(A0);
// int convertVal = (float)inputVal * 255/1023;
int convertVal = map(inputVal, 0, 1023, 0,255); // 알아서 계산해줌
// 입력값으로 전달되는 값의 범위를 이용해서 원하는 범위 값으로... |
/*
Control pileta V1.0
CLIENTE: Analia Conesa
COMIENZO DEL PROYECTO : 11/03/2020
Programa funcionando para controlar el encendido de un motor de filtrado
Cuenta con un reloj y una programacion por DIA, HORA INI, HORA FIN
FORMATO PARA ENVIAR LA PROGRAMACION (2,15,30,16,30)(dia,hora_ini,min_ini,hora_fin,min_fin)
Topico... |
#include "uiscannersettings.h"
#include <QFileDialog>
#include <QMessageBox>
#include "VideoScanner.h"
//
UIScannerSettings::UIScannerSettings( VideoScanner *vi,
QWidget * parent, Qt::WFlags f)
: QDialog(parent, f)
{
setupUi(this);
videoScanner = vi;
}
void UIScannerSettings::... |
#include <graph/graph.hpp>
#include "../catch.hpp"
#include "fixture.hpp"
#include <map>
#include <type_traits>
TEST_CASE( "Graph creation", "[graph][data_structure]" ) {
SECTION("rule of 3+2") {
REQUIRE ( std::is_default_constructible<Graph<int> >::value == true);
REQUIRE ( std::is_copy_constructible<Gr... |
#ifndef NULL
#define NULL 0
#endif
#define SIZE 500000
extern struct queue;
struct node {
int r, c;
node * prev, *next;
queue * qAddr;
node * alloc(int _r, int _c, node * _prev, node * _next, queue* _qAddr) {
r = _r, c = _r, prev = _prev, next = _next, qAddr = _qAddr;
if (prev) prev->next = this;
if (next)... |
#ifndef SHS2605_NAV6CALIBRATIONBEHAVIOR_H
#define SHS2605_NAV6CALIBRATIONBEHAVIOR_H
#include <Behaviors/IBehavior.h>
#include <Hardware/Drive/Filters/MecanumMagDirOrientationOffset.h>
#define NAV6CALIB_BID "nav6_yaw_calibration"
class Nav6CalibrationBehavior : public IBehavior
{
public:
Nav6CalibrationBehavior (... |
/**
* Copyright (C) 2017 Alibaba Group Holding Limited. All Rights Reserved.
*
*
* 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
*
* ... |
/*
* Group.hpp
*
* Created on: 2 ????? 2018
* Author: Or
*/
#ifndef GROUP_HPP
#define GROUP_HPP
class Group{
int _GroupId;
int _index;
public:
Group(int Id, int i){ _GroupId=Id;_index=i;};
void SetIndex(int i){_index=i;}
int GetIndex(){return _index;}
int GetId(){return _GroupId... |
#include "Particle.h"
// Port of TinyGPS for the Particle AssetTracker
// https://github.com/mikalhart/TinyGPSPlus
#include "TinyGPS++.h"
#include <ArduinoJson.h>
#include "LIS3DH.h"
PRODUCT_ID(5435);
PRODUCT_VERSION(6);
SYSTEM_MODE(MANUAL);
SYSTEM_THREAD(ENABLED);
/*
This sample sketch demonstrates the normal u... |
#include "mined.h"
#include "game/play.h"
#include "player/choose.h"
#include "preparation.h"
int main() {
using namespace minesweeper;
auto const board = mined(makeBoard(9_rows, 9_columns), 10);
game::play(player::choose(), board);
}
|
//**************************************************************************
//**
//** See jlquake.txt for copyright info.
//**
//** 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 Foundation; either ... |
/// @file src/pt/PtAndOp.cc
/// @brief PtAndOp の実装ファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2011 Yusuke Matsunaga
/// All rights reserved.
#include "PtAndOp.h"
BEGIN_NAMESPACE_YM_BB
// @brief コンストラクタ
// @param[in] file_region ファイル上の位置
// @param[in] opr1, opr2 オペランド
PtAndOp::PtAndOp(con... |
// My_First_GPU.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
//#include <opencv2\core\cuda.hpp>
//#include<opencv2\core.hpp>
//#include<highgui\highgui.hpp>
//#include<cv.hpp>
//#include<opencv.hpp>
#include<opencv2\opencv.hpp>
using namespace cv;
int main()
{
int num_devices = cuda::getCudaEnab... |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#include <iostream>
using namespace std;
int main()
{
int number, forLater, reverseNumber = 0, remainder;
cout << "Enter Number : ";
cin >> number;
forLater = number;
if (number >= 0)
{
while (number != 0) {
remainder = number % 10;
reverseNumber = reverseNumb... |
#include "util/catch.cpp"
struct runtime_s
{
double dt{ 1000 };
};
struct alignas(64) keyboard_mapping_s
{
keyboard_mapping_s() { std::fill(size, size + 1023, 'r'); };
char size[1024]{};
};
struct big_s
{
char size[16 * 1000]{};
};
struct example_system
{
void update(name&, pos&, const runtime_s... |
#include<iostream>
#include "Payslip.h"
using namespace std;
int main(){
Payslip p;
p.Accept();
p.Display();
cout <<"\nYour Basic Salary is: "<<p.calSalary();
return 0;
}
|
#include "DLList.h"
template <typename T>
DLList<T>::Node::Node(const T &data)
{
this->data = data;
next = NULL;
prev = NULL;
}
//Constructor
template <typename T>
DLList<T>::DLList()
{
head = NULL;
tail = NULL;
count = 0;
}
template <typename T>
DLList<T>::DLList(initializer_list<T> l)
{
count = l.size();
a... |
// -*- 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... |
#pragma once
#include "Ray.hpp"
#include "Vector.hpp"
#include <limits>
#include <array>
class Bounds3
{
public:
Vector3f pMin, pMax; // two points to specify the bounding box
Bounds3()
{
double minNum = std::numeric_limits<double>::lowest();
double maxNum = std::numeric_limits<double>::m... |
#include <stdio.h>
#include <iostream>
#include <string.h>
using namespace std;
#define Maxint 2147483647
int n, map[1001][1001], m[1001][1001], a[1001][1001];
int f[1001][1001], ans = Maxint;
void search (int i, int j, int x) {
if (map[i][j] == 0) {
a[i][j] = -1;
return;
}
... |
#ifndef CBGFADE_H
#define CBGFADE_H
#include "CGuiPanel.h"
class CBgFade: public CGuiPanel{
public:
CBgFade();
void draw();
protected:
double m_alphaStart;
double m_timeStart;
double m_time;
double m_alphaEnd;
double m_currAlpha;
};
#endif // CBGFADE_H
|
#pragma region Methods
inline const Bounds Mesh::Get_Bounds() const { return this->m_kBounds; };
inline PrimitiveTopology Mesh::Get_Topology() const { return this->m_kTopology; };
inline void Mesh::Set_Topology(PrimitiveTopology value) { this->m_kTopology = value; };
inline VertexBuffer* Mesh::Get_VertexBuffer(... |
//
// main.cpp
// ZazerkalieTest2
//
// Created by Артем on 02.01.18.
// Copyright © 2018 Артем. All rights reserved.
//
/*
TASK:
Написать код на С++ для определения кратчайшего расстояния между двумя отрезками в 3D пространстве.
Отрезки заданы координатами концов.
*/
#include <iostream>
#include <cma... |
#pragma once
class RResourceManager
{
public:
RResourceManager(void);
~RResourceManager(void);
static bool LoadResources();
static bool ReleaseAllResources();
};
|
#ifndef SRC_HUMANPLAYER_H_
#define SRC_HUMANPLAYER_H_
#include <ncurses.h>
#include "Player2.h"
class HumanPlayer : public Player2 {
public:
HumanPlayer(int x, int y);
int getX();
int getY();
int getHeight();
void setX(int a);
void setY(int a);
void drawPlayer(int y, int x);
protected:
... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define all(x) begin(x), end(x)
#define rep(i, a, b) for(ll i = a; i < b; ++i)
using pi = pair<int, int>;
#define f first
#define s second
void setIO(string name = "angry") {
ios_base::sync_with_std... |
#include <ESP8266WiFi.h>
const char* ssid = "";
const char* password = "";
const char* host = "";
int light = 0;
int buttonPin = 15;
int outputPin = 12;
int onLight = 13;
int connectedLight = 16;
int activatedLight = 2;
int previousState = 1;
unsigned long lastPressed = 0;
int timeBetweenPresses = 5 * 1000;
... |
/* GPU rendering the darkmatter all skymap. Using stereographic projection */
/* Classes:
* Parameter: read parameter from configure.ini.
* Including the units infomation, datafile path etc.
* Kernel.cu: the GPU files
* Skymap: dealwith all other stuffes
*
*/
#include <string>
#include "Parameter.h"
int main(){
... |
#include "projectdatabase.h"
#include "projectfooditem.h"
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <windows.h>
#include <iomanip>
#include <fstream>
using namespace std;
Database::Database()
{
capacity=5;
used=0;
food=new Fooditem[capacity];
}
Data... |
#ifndef _I_GAME_LOGIC_H_
#define _I_GAME_LOGIC_H_
//forward declared
class Actor;
class ActorComponent;
class IGamePhysics;
class IGameLogic
{
public:
IGameLogic() {}
virtual ~IGameLogic() {}
virtual WeakActorPtr VGetActor(const unsigned int id) = 0;
//virtual StrongActorPtr VCreateActor(const std::string &a... |
#ifndef ORDERREPOSITORY_H
#define ORDERREPOSITORY_H
#include "../main.h"
class OrderRepository
{
public:
void saveOrder(int file, vector<string> listOfItems, string phone, int pizza, int drink, int side, int total, char pizzaState);
///This function helps us decide if we're either making a new file o... |
#ifndef SPRITE_H
#define SPRITE_H
#include <iostream>
#include <SDL.h>
#include <cstdlib>
#include <SDL_image.h>
#include "CollisionBox.h"
using namespace std;
class Sprite
{
public:
Sprite(SDL_Renderer* passed_renderer, string FilePath, int x, int y, int w, int h, int r, float *passed_CameraX, float *pas... |
#include "tipos.h"
void enfileirar(TFila *p)
{
TElemento *novo;
//novo = (TElemento*) malloc(sizeof(TElemento));
novo = new TElemento;
printf("\n Informe valor: ");
scanf("%d", &novo->valor);
novo->proximo = NULL;
if (p->inicio == NULL)
{
p->inicio = novo;
p->fim = novo;
}
else
{
p->fim->proximo... |
/*****************************************************************************************************
* 剑指offer第53题
* 请实现一个函数用来匹配包括'.'和'*'的正则表达式。模式中的字符'.'表示任意一个字符,而'*'表示它前面的字符
可以出现任意次(包含0次)。 在本题中,匹配是指字符串的所有字符匹配整个模式。例如,字符串"aaa"与模式
"a.a"和"ab*ac*a"匹配,但是与"aa.a"和"ab*a"均不匹配
*
* Input: 字符串和匹配字符串... |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
/* Đề bài:
Yêu cầu đề bài:
Chúng ta sẽ thực hiện tính toán biểu thức số học thông thường bao gồm 4 phép toán (+ - / *).
Gợi ý: Sử dụng cấu trúc ngăn xếp, chúng ta sử dụng thư viện:
http://www.cplusplus.com/reference/stack/stack/
càng tốt, khuyến khích các bạn sử dụng thư viện.
Lưu ý: Trong bài tập này chúng ta chỉ ... |
/***************************************************************************
fuzznum.h - description
-------------------
begin : dom abr 13 2003
copyright : (C) 2003 by Oscar Germán Duarte Velasco
email : ogdua... |
int ledPin;
void ledInitial(Chain *ptrchain){
ledPin = ptrchain->ledPin;
pinMode(ledPin, OUTPUT);
}
void ledBlink(void){
digitalWrite(ledPin, HIGH);
}
void ledDown(void){
digitalWrite(ledPin, LOW);
}
|
// github.com/andy489
#include<iostream>
#include<string>
#include<sstream>
#include<vector>
#include<map>
using namespace std;
int main() {
/*
Read students in the following format:
4
Tony 2 5 5 3 6
George 2 2 3
Kerrigan 6 6 2 6 2 6
Jaina 6 6 5
Then reads commands in the following format:
George
Kerrigan
end
..... |
// -*-c++-*-
//-----------------------------------------------------------------------
// TACC SLURM Plugin
//
// SPANK plugin for use with SLURM at job submission time. Used to
// impose queue ACLs, verify file system availability, validate ssh
// keys, and various other duties as required for TACC productino
// envi... |
/*************************************************************************
> File Name : ToBeSignedCrl.cpp
> Author : YangShuai
> Created Time: 2016年07月29日 星期五 19时45分15秒
> Description :
************************************************************************/
#include"Itsdata.h"
#include"data_handle... |
/*
2379. 트리 탐색하기
(참고)
https://viruz.tistory.com/entry/2379-%ED%8A%B8%EB%A6%AC-%ED%83%90%EC%83%89%ED%95%98%EA%B8%B0
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <cstring>
#include <stack>
using namespace std;
int T;
string Route_01, Route_02;
vector<int> Result_01;
vec... |
#include "particula_chatarra.h"
using namespace App_Juego_ObjetoJuego;
Particula_chatarra::Particula_chatarra(float x, float y, float tv, const DLibH::Vector_2d& v):
Particula_movil_base(x, y, tv, v),
frame(0)
{
//Escoger frame.
using def=App_Definiciones::definiciones_particulas;
auto g=Herramientas_proyecto::G... |
#include <fstream>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
if(argc >= 4){
ifstream ifile(argv[1], ios::in); //입력 (가져옴)
ifstream ifile_(argv[2], ios::in);
ofstream ofile(argv[3], ios::out | ios::app); //출력 , 덫붙
try {
if (!(ifile.is_open() && ifile_.is_open())) {
... |
//
// Created by zlc on 2021/5/25.
//
#include <stdlib.h>
#include <math.h>
#include "../include/part_slam/utils/stat.h"
namespace GMapping
{
double pf_ran_gaussian(double sigma)
{
double x1, x2, w;
double r;
do
{
do { r = drand48(); } while (r == 0.0); // drand48() 返回服从均匀分布的·[0.0, 1... |
// Klasa prostego przycisku
#ifndef SBUTTON_H
#define SBUTTON_H
class SButton : public SWindow
{
public:
SButton(SWindow * pWin, UINT uStyle = 0, UINT uId = 0, UINT uExStyle = 0); // Konstruktor - wskażnik na okno - rodzica
virtual ~SButton();
virtual DWORD Click();
virtua... |
#ifndef ENTITY_H
#define ENTITY_H
#include <iostream>
#include <bitset>
#include <string>
#include <sstream>
#include "Bitsize.h"
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
#include "ComponentManager.h"
#include "World.h"
#include "Component.h"
#include "... |
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define scl(n) scanf("%lld", &n)
#define fr(i,n) for (ll i=0;i<n;i++)
#define fr1(i,n) for(ll i=1;i<=n;i++)
int main()
{
ll m,n,t,b,c,d,i,j,k,x,y,z,l,q,r;
ll cnt=0,ans=0,cn=0;... |
// plane.h
// Rejtrejs
//
// Created by Amaru on 2012-09-18.
// Copyright 2012 __MyCompanyName__. All rights reserved.
//
#ifndef _PLANE_H
#define _PLANE_H
#include "Vec.h"
#include "Material.h"
#include "Objects.h"
struct Plane : Objects
{
Vec p0, normal;
Vec orig, dir;
Plane(const Vec &n,const Ve... |
//
// buffer_pool.h
// str2-local
//
// Created by xiazhou on 10/22/13.
// Copyright (c) 2013 xiazhou. All rights reserved.
//
#ifndef str2_local_buffer_pool_h
#define str2_local_buffer_pool_h
#include "internal_buffer.h"
#include "vector"
const int INIT_BUFFER_NUMBER = 20;
class BufferPool
{
public:
~Buffe... |
#include "bst.h"
bool BST::Contains(int elem) {
return ContainsHelper(root, elem);
}
bool BST::ContainsHelper(Node *node, int elem) {
if (node == nullptr) {
return false;
} else if (node->value == elem) {
return true;
} else if (node->value < elem) {
return ContainsHelper(node->right, elem);
} e... |
#include <vector>
using namespace std;
const int MOD = 1000;
typedef vector<int> vec;
typedef vector<vec> mat;
typedef long long ll;
// matrix mul & pow
mat mul(mat &A, mat &B){
mat C(A.size(), vec(B[0].size()));
for(int i=0; i < A.size(); i++){
for(int k=0; k < B.size(); k++){
for(int j=0; j < B[0].siz... |
// -*- 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.