text stringlengths 8 6.88M |
|---|
#ifndef TOOLBOX_H
#define TOOLBOX_H
#include <QWidget>
class ToolBoxPrivate;
class ToolBox : public QWidget
{
Q_OBJECT
Q_PROPERTY(int count READ count NOTIFY countChanged)
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
public:
ToolBox(QWidget *parent = 0);
... |
#pragma once
#include <map>
#include <fmt/format.h>
#include <json.hpp>
#include <physfs.h>
using json = nlohmann::json;
namespace GLPlay {
template<typename T>
class Resource {
public:
Resource(const Resource<T> & resource);
Resource(std::string name);
~Resource();
T & operator*();
T * resour... |
#include "FuGenNodeEditor.h"
FuGenNodeEditor::FuGenNodeEditor(QWidget *parent)
:QStackedWidget(parent)
{}
FuGenNodeEditor::~FuGenNodeEditor()
{
for(INodeListener *Listener : AllocatedListeners)
{
delete Listener;
}
}
#include "FuGenNodeEditor.moc"
|
#include "service_layer_server_grpc.h"
grpc::Status ServiceLayerServer::registeruser(
grpc::ServerContext* context, const chirp::RegisterRequest* request,
chirp::RegisterReply* reply) {
// unwrap the request's fields so that we may pass them to the ServiceLayer's
// data structure
std::string username = ... |
/*
*Write a program to find largest and smallest elements among the array along with sum and average of element
*/
#include "iostream"
using namespace std;
int main(int argc, char const *argv[])
{
int j=0,SIZE,sum=0,avg,largest,smallest;
cout<<"SUM, AVERAGE, LARGEST AND SMALLEST AMONG ARRAY ELEMENTS";
cou... |
#include <vector>
#include "defs.h"
#include "globals.h"
using namespace std;
int LCP ( vector<int> x, int a, int * xx, int b )
{
int lcp = a;
for ( int i = a; i < x.size(); i ++)
{
if ( x[i] == xx[i+b] )
lcp++;
else
break;
}
return lcp;
}
|
#pragma once
#include <string>
#include <vector>
#include <map>
using namespace std;
class HtmlNode{
public:
vector<HtmlNode> ChildNodes;
string tag = "";
string InnerHtml = "";
string InnerText = "";
map<string, string> Attributes;
vector<HtmlNode> findNodes(string tag);
};
class HtmlDocument
{
string data;
ve... |
#pragma once
#include "Common.h"
class IDataFile
{
public:
virtual const string& GetPackName() = 0;
virtual bool IsFilePresent( const string& path, const string& path_lower, uint& size, uint64& write_time ) = 0;
virtual uchar* OpenFile( const string& path, const string& path_lower... |
#pragma once
#pragma execution_character_set("utf-8")
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
class Solution
{
public:
int maxSubArray(vector<int>& nums)
{
vector<int>dp(nums.begin(),nums.end());
int maxA = nums[0];
for (unsigned int i = 1; i < nums.size(); i++)
{
dp... |
//Link to the task: https://www.hackerrank.com/challenges/triple-sum/problem
#include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
long pairCounter (vector<int> &l, vector<int> &r) {
long pairCounter = 0;
set<int> left;
left.clear();
set<int> right;
right.clear();
... |
#include <bits/stdc++.h>
#define MAX 1000001
#define M 1000000007
#define ll long long
#define ld long double
#define ESP 0.0001
using namespace std;
int main() {
int t;
int cs = 1;
scanf("%d",&t);
while(t--) {
printf("Case #%d: \n", cs++);
ll n, m, q;
scanf("%lld%lld%lld", &n, &m, &q);
vector< pair<ll,ll ... |
#include <iostream>
using namespace std;
struct Part
{
/* all data is public */
int model_num;
int part_num;
float cost;
};
struct Car
{
Part doors;
Part windows;
Part tires;
};
// Local Prototypes
int main()
{
Part part1;
part1.model_num = 6344;
part1.part_num = 373;
part1.cost ... |
#include <iostream>
#include <vector>
#include <list>
using namespace::std;
class Link
{
public:
list<double> data;
};
void BucketSort(vector<double> &A);
int main()
{
vector<double> A{0.78, 0.17, 0.39, 0.26, 0.72, 0.94, 0.21, 0.12, 0.23, 0.68};
BucketSort(A);
return 0;
}
void BucketSort(vector<double> &A... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int Q=9,q=9,r=5,R=5,B=3,b=3,K=3,k=3,P=1,p=1,white=0,black=0;
char chess[8][8];
for(int i=0;i<8;i++)
for(int j=0;j<8;j++)
cin>>chess[i][j];
for(int m=0;m<8;m++)
{
for(int n=0;n<8;n++)
{
if(ch... |
#ifndef DEFINICIONES_ANIMACIONES_H
#define DEFINICIONES_ANIMACIONES_H
namespace App_Definiciones
{
enum animaciones
{
sprites,
particulas,
celdas_template
};
enum animaciones_sprites
{
jugador=1,
bonus_tiempo,
bonus_salud,
proyectil_rojo,
proyectil_azul,
enemigo_basico,
enemigo_rebote,
salida,
obstaculo... |
// This file contains the implementation of the team class
// Author: Jamie Beamguard
// Last Revision: 7/6/2021
#include <iostream>
#include "team.h"
using namespace std;
// Given the name, seed number, and ID number
Team::Team(string teamName, int teamSeed, int idNum) {
name = teamName;
seedNum = teamSeed;
team... |
/*
* 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 ... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Services.Cortana.2.h"
WINRT_EXPORT namespace winrt {
namespace Windows::Services::Cortana {
struct WINRT_EBO CortanaPermissionsManager :
Windows::Services::Cortana::ICo... |
#include "TimeManagment.hpp"
#include <cstring>
#include <sstream>
#include <iomanip>
const std::tm* TimeManagment::getLocalTime()
{
const auto time = Time::to_time_t(Time::now());
return std::localtime(&time);
}
std::string TimeManagment::convertTimeToString(const std::tm* time)
{
std::ostringstream tim... |
#include "CWEGraphicManager.h"
#include "CWEError.h"
#include "CWEPolygon.h"
#include <vector>
#define RAW_STRING_W(var) L#var
namespace CWE
{
//==========================================================================================================================================================================... |
#include <iostream>
#include <string>
#include "main_menu.cpp"
using namespace std;
//Main execution
int main()
{
//main menu
main_menu(0);
return 0;
} |
// [[Rcpp::depends(RcppArmadillo)]]
#include <RcppArmadillo.h>
using namespace Rcpp;
using namespace arma;
// [[Rcpp::export]]
NumericVector cb(NumericVector m1, NumericVector m2, NumericVector m3,
IntegerVector d, IntegerVector e) {
NumericVector mat1(m1);
NumericVector mat2(m2);
NumericVector mat... |
#include "Repository.h"
Repository::Repository(const IJKSize& domain)
: domain(domain) {
fields_.reserve(N_HORIDIFF_VARS);
for (size_t i = 0; i < N_HORIDIFF_VARS; ++i) {
auto f = new SimpleSwappableStorage< Real >(domain, "field" + std::to_string(i));
fields_.push_back(std::unique_ptr< Sim... |
/* Copyright 2017-2018 All Rights Reserved.
* Gyeonghwan Hong (redcarrottt@gmail.com)
*
* [Contact]
* Gyeonghwan Hong (redcarrottt@gmail.com)
*
* Licensed under the Apache License, Version 2.0(the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the Lic... |
#ifndef TCPCLIENT_H
#define TCPCLIENT_H
#include <QObject>
#include <QTcpSocket>
class TcpClient : public QObject
{
Q_OBJECT
public:
TcpClient(QObject* parent);
void requestToServer(const char* request);
signals:
void responseFromServer(QString message);
private slots:
... |
#include "header.h"
/*
Author: Michael English
*/
int main()
{
LinkedList teachers; // because of unknown number of substitute teachers
loadTeacher(teachers);
Course *courses;
int numberOfCourses = getNumberOfCourses();
courses = new Course [numberOfCourses];
loadCourse(courses, numberOfCourses);
string use... |
#include "pch.h"
#include "Framawork.h"
#include "Protocol.h"
#include "DBServer_Protocol.h"
Framawork::Framawork()
{
}
Framawork::~Framawork()
{
}
void Framawork::init()
{
iocp_ = CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0, 0);
repository_ = new Repository();
for (int i = 0; i < MAX_USER; i++)
client... |
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
int main(){
int tc;cin>>tc;
while(tc--){
int n,no_dest;
cin>>n>>no_dest;
int arr[n];
int dest[no_dest];
for(int i=0;i<n;i++) cin>>arr[i];
for(int i=0;i<no_dest;i++) cin>>dest[i];
int dp[n];
for(int i=0;i<... |
#include "SaveLoadStream.h"
SaveLoadStream::SaveLoadStream()
{
mLen = 0;
mPos = 0;
memset(mSaveData, 0x00, sizeof(mSaveData));
}
void SaveLoadStream::writeString(std::string &str)
{
//string 格式的数据,只有64字节长度,超长的需要另起
const char *p = str.c_str();
size_t strLen = strlen(p);
if (strLen >= 64)
... |
//
// Modified by Steven Smith on 2020-04-04.
// Modified for Concordia W 2020 Comp 371
// A class created to help and simplify the main driver into something more simple
// and easier to manage.
// A modified version of labs5 EventManager
#include "GLFW/glfw3.h"
#include <cstdio>
#include <cstdlib>
#include <ctime>... |
class Solution {
public:
int maxSubArray(vector<int>& nums) { // 动态规划
if (nums.size() == 0) return 0; // 特判
vector<int> dp(nums.size(),0); // dp的初始化
int result; // 存放最大结果
dp[0] = nums[0];
result = nums[0];
for (int i = 1; i < nums.size(); ++i){
dp... |
#include "../common/protocol_common.h"
#include "../common/tcp_socket.h"
#include "../common/global.h"
#include <sys/time.h>
#include <sys/prctl.h>
#include <sys/select.h>
#include <unistd.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
using namespace s... |
#ifndef PAUSESTATE_H
#define PAUSESTATE_H
#include "engine/state.h"
#include "engine/gui/container.h"
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/Text.hpp>
class PauseState : public State
{
public:
PauseState(StateStack& stack, Context context);
virtual void draw();
virtual bool update(s... |
/*CARLS SUPERDUPERMARKET v1 POS SYSTEM LEGGO*/
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <time.h>
#include <windows.h>
//started 12:20 AM SEPT 21 2015 lets see when this'll be finished. \m/
void menuInventory();
void cr... |
#include "test_util.h"
int TEST_RM_8_B(const string &tableName)
{
// Functions Tested
// 1. Simple scan **
cout << "****In Test Case 8_B****" << endl;
RID rid;
int numTuples = 100;
void *returnedData = malloc(100);
set<int> ages;
RC rc = 0;
for(int i = 0; i < numTuples; i++)
... |
//
// Created by Nitish Mohan Shandilya on 7/2/20.
//
// [3, 4, 5, 7, 1, 0, 0, 2]
#include "stdlib.h"
#include "vector"
int partition(vector<int>& input, int begin, int end)
{
int pivot = input[(end - begin)/2 + begin];
//int pivot = input[end];
while (begin <= end)
{
while (input[begin] > pivo... |
#include "LineLayer.h"
LineLayer::LineLayer()
{
m_isDrawedAble = false;
m_star1 = nullptr;
m_star2 = nullptr;
m_isCompleted = false;
m_nextLine = nullptr;
m_lineBg = nullptr;
}
LineLayer::~LineLayer()
{
}
LineLayer* LineLayer::create(WJSprite *star1, WJSprite *star2)
{
LineLayer* layer = new (std::nothrow) ... |
///////////////////////////////////////////////////////////////
// Centre of gravity of a mask image.
#include <irtkImage.h>
char *image_name = NULL;
void usage()
{
cerr << "Usage: imagecentreofgravity [image] <options>" << endl;
cerr << " -pad : padding value , default = 0" << endl;
exit(1);
}
int main(int... |
//
// Copyright Jason Rice 2017
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef NBDL_ENDPOINT_HANDLER_HPP
#define NBDL_ENDPOINT_HANDLER_HPP
#include <boost/hana/map.hpp>
#include <boost/hana/pair.hpp>... |
#include "Rectangle2D.h"
#include <stdio.h>
Rectangle2D::Rectangle2D(Point start, float width, float height)
:m_bottomLeft(start)
,m_width(width)
,m_height(height)
{
setRectangle();
}
Rectangle2D::~Rectangle2D()
{
}
bool Rectangle2D::isInRectangle(const Point& point) const
{
return (point.X... |
#include "Turtle2D.h"
#include "TurtleStateStack.hpp"
bool IsTurtle2DCommand(char command)
{
if( (command == 'F') ||
(command == 'f') ||
(command == '+') ||
(command == '-') ||
(command == '[') ||
(command == ']') ||
(command == '{') ||
(command == '}') ||
(command == '.')
)
{
return true;
}
/... |
#ifndef PURCHASEINFO_H
#define PURCHASEINFO_H
#include <QtGui>
#include <QTime>
class PurchaseInfo
{
public:
PurchaseInfo();
int ID() { return m_id; }
void ID(int id) {m_id = id; }
int UnitID() { return m_unit_id; }
void UnitID(int uid) { m_unit_id = uid; }
QString Supplier() { return m_supplie... |
#ifndef ANIMATEDSPRITENODE_H
#define ANIMATEDSPRITENODE_H
#include "spritenode.h"
#include "../game/animationtable.h"
#include "utility.h"
class AnimatedSpriteNode : public SpriteNode
{
public:
explicit AnimatedSpriteNode(const sf::Texture& texture, Animation animationTable);
void setState(int state);
vo... |
//
// UICallBack.h
// cocostudio
//
// Created by wangpeng on 15/8/12.
//
//
#ifndef __cocostudio__UICallBack__
#define __cocostudio__UICallBack__
#include <stdio.h>
#include "cocos2d.h"
#include "cocostudio/CocoStudio.h"
#include "cocostudio/WidgetCallBackHandlerProtocol.h"
using namespace std;
struct UICallbac... |
//
// Copyright Jason Rice 2017
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef NBDL_WEBSOCKET_API_DETAIL_EVENT_RECEIVER_HPP
#define NBDL_WEBSOCKET_API_DETAIL_EVENT_RECEIVER_HPP
#include <nbdl/endpoin... |
//****************************************************************************
// Model: uartController.qm
// File: ./UartController.h
//
// This code has been generated by QM tool (see state-machine.com/qm).
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// This program is open source software: ... |
#include <iostream>
#include <vector>
#include <iomanip>
#define Max 500001
using namespace std;
struct Point
{
int x;
int y;
};
struct Rect
{
Point lb;
Point rt;
};
bool Inside(Point &p,Rect &l)
{
return (p.x>=l.lb.x && p.x<=l.rt.x && p.y>=l.lb.y && p.y<=l.rt.y);
}
int Distance(Point &a,Point &b)
{
return ((a.x... |
#include "animations\Singularity.Animations.h"
namespace Singularity
{
namespace Graphics
{
class SkinnedMeshRenderer : public Singularity::Graphics::MeshRenderer
{
DECLARE_OBJECT_TYPE;
private:
#pragma region Static Variables
static Singularity::Graphics::Material* g_pAnimatedMateria... |
/***************************************************************************
Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD
FileName: RTSPProtocol.cpp
Description: A grouping of static utilities that abstract keyword strings
... |
#include "Mesh.h"
Mesh::Mesh(std::vector<Vertex> vertices, std::vector<GLuint> indices, std::vector<Texture> textures) {
this->vertices = vertices;
this->indices = indices;
this->textures = textures;
glGenVertexArrays(1, &vao);
glGenBuffers(1, &vbo);
glGenBuffers(1, &ebo);
glBindVertexArray(vao);
... |
#pragma once
#include "03-hash_table.h"
#include "07-fastest.h"
#include <vector>
#include <algorithm>
#include <cstdint>
using namespace std;
vector<vector<int>> comb(52, vector<int>(7));
vector<uint16_t> vec(133784560);
uint16_t evaluate_vector(const int *hand) {
int sorted[7];
copy(hand, hand + 7, sorted);
s... |
/*************************************************************
Author : qmeng
MailTo : qmeng1128@163.com
QQ : 1163306125
Blog : http://blog.csdn.net/Mq_Go/
Create : 2018-03-27 16:41:53
Version: 1.0
**************************************************************/
#include <cstdio>
#include <iostream>
using namesp... |
/*
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... |
#ifndef __CRITTER_MANAGER__
#define __CRITTER_MANAGER__
#include "Common.h"
#include "Map.h"
#include "Critter.h"
class CritterManager
{
public:
Npc* CreateNpc( hash proto_id, Properties* props, Map* map, ushort hx, ushort hy, uchar dir, bool accuracy );
bool RestoreNpc( uint id, hash proto_id, con... |
//uva-12582
//Undefined_Error
//Dept. ICE, NSTU-11 Batch
#include<bits/stdc++.h>
using namespace std;
#define INF 1<<28
#define ll long long
#define SZ 100009
#define MX 100000000
#define sfint(a) scanf("%d",&a)
#define sfint2(a,b) scanf("%d%d",&a,&b)
#define sfint3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define forlp0(i,n) f... |
/// @file tests/enumcut/enumcut.cc
/// @brief カットの列挙プログラム
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2011 Yusuke Matsunaga
/// All rights reserved.
#include "YmNetworks/BdnMgr.h"
#include "YmNetworks/BdnBlifReader.h"
#include "YmNetworks/BdnIscas89Reader.h"
#include "YmNetworks/BdnNode.h"
#inc... |
#include <iostream>
#include <gtest/gtest.h>
#include "hs_math/random/normal_random_var.hpp"
#include "hs_sfm/calibrate/planar_calibration_generator.hpp"
#include "hs_sfm/calibrate/planar_calibrator.hpp"
namespace
{
template <typename _Scalar>
class TestPlanarCalibrator
{
public:
typedef _Scalar Scalar;
typed... |
#include <GL/glut.h>
#include <GL/glui.h>
#include <stdio.h>
#include "graph.h"
#include "drawing.h"
enum{
ADD_TEXT_FILE = 1,
ADD_GRAPH_FILE,
SAVE_GRAPH,
DELETE_NODES,
CLEAR_FILE_PATH
};
#define MAXIMUM_FILE_PATH_LENGTH 100
char filePath[MAXIMUM_FILE_PATH_LENGTH+1];
double translation[3] = {0.0, 0.0, -100... |
#include "skybox.h"
Skybox::Skybox() {
float skyVertices[] = {
// positions
-1.0f, 1.0f, -1.0f,
-1.0f, -1.0f, -1.0f,
1.0f, -1.0f, -1.0f,
1.0f, -1.0f, -1.0f,
1.0f, 1.0f, -1.0f,
-1.0f, 1.0f, -1.0f,
-1.0f, -1.0f, 1.0f,
-1.0f, -1.0f, -1.0f,
-1.0f, 1.0f, -1.0f,
-1.0f... |
class Solution {
public:
vector<vector<int>> subsetsWithDup(vector<int>& nums) {
set<vector<int>>result;//nb
sort(nums.begin(), nums.end());
int nlen = int(nums.size());
vector<int> v;
for (int i = 1<<nlen,j=0;i>0; i--) {
j = 0;
v.erase(v.begin(),v.end());
while ... |
#include "text_field_backend.hpp"
#include "abstract_view_model.hpp"
namespace ViewModelsFramework
{
TextFieldBackend::TextFieldBackend(QObject* parent) : EditFieldBackendBase(parent)
{
}
TextFieldBackend::TextFieldBackend(AbstractViewModel* parent, QString& value, int fieldId, const QString& label) :
EditFi... |
class Solution {
public:
vector<int> singleNumber(vector<int>& nums) {
int a = 0;
for (int i = 0; i<nums.size(); i++) {
a ^= nums[i];
}
sort(nums.begin(), nums.end());
int i = 0;
for (; i<nums.size()&&nums[i] == nums[i+1]; i = i+2);
return vector<int>{nums[i],nums[i]... |
/* Vertical Order Traversal */
#include <iostream>
#include <map>
#include <vector>
#include <algorithm> // just for sorting vector
struct Node
{
Node* left, * right;
int data;
Node(int data) : left(nullptr), right(nullptr), data(data) {};
};
Node* add(Node* root, short data)
{ // BST add like function just for te... |
#pragma once
#ifndef NODE_H
#define NODE_H
#endif // !NODE_H
#include <cstdlib>
using namespace std;
class Node
{
private:
int value;
int min;
Node* next;
public:
Node(int value=NULL, int min=NULL, Node* next=nullptr)
{
this->value = value;
this->min = min;
this->next = next;
}
int getValue() { retu... |
#include<bits/stdc++.h>
using namespace std;
void merge(vector<int> &arr, int low, int mid, int high) {
vector<int> sorted;
int k=low;
int i=low;
int j=mid+1;
while(i<=mid && j<=high) {
if(arr[i] <= arr[j]) {
sorted.push_back(arr[i]);
i++;
}
else{
sorted.push_back(arr[j]);
j++;
}
// k++;
}... |
void tempHumCheck(){
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
float t = dht.readTemperature();
float tf = ((t*9)/5) + 32;
// check if returns are valid, if they are Na... |
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
using namespace std;
int main(){
fastio;
int N;
cin>>N;
int vet[N],aux[N];
for(int i=0;i<N;i++) aux[i]=0;
for(int i=0;i<N;i++) cin>>vet[i];
for(int i=0;i<N;i++){
int esq=0,dir=0;
if(vet[i]==0){
for(int... |
#ifndef __IZONE_H_
#define __IZONE_H_
#include "CommonHeader.h"
#include "CUser.h"
#include "CZoneTileData.h"
/*
존의 인터페이스
유저가 존 전체를 들고 있는것 보단 이 인터페이스를 들고 있는게 가벼워 보여서 만듦.
*/
class IZone
{
protected:
USHORT m_nZoneIndex;
CZoneTileData* m_pTileData;
public:
IZone() = default;
virtual ~IZone() = default... |
#include "SceneGraph.h"
#include <algorithm>
using namespace std;
Transform::Transform(glm::mat4 M) {
this->M = M;
maxA = 0;
minA = 0;
minX = 0;
minY = 0;
minZ = 0;
maxX = 0;
maxY = 0;
maxZ = 0;
rotationVector = glm::vec3(0, 0, 0);
currentX = 0;
currentY = 0;
currentZ = 0;
currentScale = 1;
currentAn... |
/*
* main.cpp
*
* Created on: Aug 25, 2016
* Author: Istvan
*/
#include "Library.h"
#include <fstream>
int finBookArray(Book book[], string fileName){
//This function populates a given array of books
//with a fin file having the format: title \n author \n language \n year\n
int bookCount = 0;
ifstream f... |
#ifndef GLOBAL_H
#define GLOBAL_H
SDL_Surface * screen = NULL;
bool quit = false;
bool win = false;
bool pause = false;
bool quitscreen = false;
SDL_Surface *secondsA = NULL;
SDL_Surface *secondsB = NULL;
SDL_Surface *startStop = NULL;
SDL_Event event;
SDL_Surface *inputScreen;
//TTF_Font *font = TTF_OpenFont( "... |
//
// action_lightingSprite.cpp
// HelloCpp
//
// Created by ck02-084 on 13-12-12.
//
//
#include "action_lightingSprite.h"
|
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ok() puts(ok?"Yes":"No");
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
ty... |
//auto create by tocpp.rb, plz don't modify it!
//#{Time.now}
#include "#{ClassName}.h"
using std::string;
#{ClassName}::#{ClassName}()
{
#{initlist}
}
bool #{ClassName}::ReadJsonImpl(const CSJson::Value& obj)
{
#{reaeJson}
return true;
}
|
#include "KnapsackResult.h"
#include <sstream>
using namespace std;
KnapsackResult::KnapsackResult()
{
value = 0;
first = NULL;
}
KnapsackResult::KnapsackResult(int value)
{
this->value = value;
first = NULL;
}
KnapsackResult::~KnapsackResult()
{
Item * pointer;
pointer = first;
while (first)
{
pointer = f... |
#include "Utility.h"
using namespace std;
vector<string> split_string(string input_string, char delimiter)
{
vector<string> output_vector;
string curr_string = "";
for(int i=0; i<input_string.length(); i++)
{
char curr_char = input_string[i];
if(curr_char == delimiter)
{
... |
/***************************************************************************
Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD
FileName: OS.h
Description: Provide OS utility functions. Memory allocation, time-dealing, directory-c... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Array.cpp :+: :+: :+: ... |
//42. Write a language program in C++ which accepts the user's first and last name and print them in reverse order with a space between them.
#include<iostream>
#include<string>
using namespace std;
int main()
{
string a,b;
cout<<"Enter first name:";
cin>>a;
cout<<"Ener last name:";
cin>>b;
cout<<"Name in ... |
#include <iostream>
#include <iomanip>
#include <math.h>
#include "gamma.h"
#include "coupling.h"
#include "basis.h"
#include "energies.h"
#define PI 3.14159265358979
#define ROOT_PI 1.77245385090552
#define DOUBLE_INFINITY 1.7e308
using namespace std;
int main () {
// ********************************************... |
#include <Arduino.h>
#include <SPI.h> // for Ethernet
#include <Ethernet2.h>
#include <utility/w5500.h>
#include <Wire.h> // for RTC EEPROM MAC
#include "EthernetConfig.h"
#include "lcd.h"
// ----------------- Networking parameters -----------------
byte ... |
// Author: Jason Lunt
// Assignment: Program3
// File: queue.h
// Instructor: Dr. Reza Sanati
// Class: CS 2420 Section: 003
// Date: 22 September 2015
// Description: Class to create custom queues.
//
#ifndef queue_h
#define queue_h
#ifndef FINISHCODE
#define FINISHCODE
enum FinishCode{success, underflow, ... |
/*
* Point.h
*
* Created on: 31 Mar 2010
* Author: niall
*/
#ifndef POINT_H_
#define POINT_H_
#include <iostream>
namespace cryomesh {
namespace spacial {
template<class T>
class Coordinates;
class SphericalPoint;
class Point {
public:
Point();
Point(const Coordinates<int> & coords);
Point(const Coo... |
#include "akari.h"
#include <fstream>
vector<vector<int>> dirs4 = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}};
Akari::Akari()
{
}
Akari::Akari(string filename)
{
ifstream file{filename};
if (file.good()) {
board_ = {};
string line;
while (getline(file, line)) {
vector<char> row;
... |
#include "vfs_util.h"
#include <CORE/UTIL/lexical_cast.h>
#include <atomic>
namespace vfs {
namespace util {
/**
*
*/
Path GetTempDir() {
return Path(TMP_PATH);
}
/**
*
*/
Path GetTempFile() {
static std::atomic_int32_t uniqueFileCounter(0);
std::string fileName;
core::util::lexical_cast(uniqueFileCoun... |
#include <iostream>
#include <conio.h>
using namespace std;
struct Qarhav
{
private:
int x, y;
public:
Qarhav (int);
int putx();
int puty();
void sqr();
~Qarhav();
};
Qarhav :: Qarhav(int x1) {x=x1;}
int Qarhav :... |
/*Wish.cpp
Wish
copyright Vixac Ltd. All Rights Reserved
*/
#include "Wish.h"
#include <iostream>
#include <string>
#include "UserWish.h"
namespace VI = vixac;
namespace IN = VI::inout;
namespace IA = vixac::ina;
void IA::Wish::getJobs(IA::NodeStoreAsync * store,IN::NodeId userNodeId, IA::MetaMapFunc f)
{
IA::... |
/*
"Maximal" sketch to demonstrate emonLibCM
This demonstrates the use of every API function.
This sketch provides an example of every Application Interface function.
Many in fact set the default value for the emonTx V3.4, and are therefore
not needed in most cases. If you do need to change a value, the
Application... |
int i=0;
void setup(){
Serial.begin(9600);
}
void loop()
{
Serial.print(i);
Serial.print(",10,");
Serial.print(i*2);
Serial.println(",");
delay(500);
i++;
}
|
#pragma once
#include <mbgl/actor/actor_ref.hpp>
#include <mbgl/storage/file_source.hpp>
#include <mbgl/storage/offline.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/optional.hpp>
#include <vector>
#include <mutex>
namespace mbgl {
namespace util {
template <typename T> class Thread;
} // namespace u... |
#pragma once
#include <landstalker-lib/patches/game_patch.hpp>
/**
* This patch adds Gola's Heart, the additional dungeon featured in "The Secret" ARG released on 2022.
*/
class PatchAddGolasHeart : public GamePatch
{
private:
Map* _room_1 = nullptr;
Map* _room_2 = nullptr;
Map* _room_3 = nullptr;
M... |
#pragma once
#include "tile.h"
namespace lab3 {
class RockTile : public Tile {
static const string description;
protected:
virtual inline void do_stay(Game&, PhysicalEntity&) override {}
virtual inline void do_enter(Game&, weak_ptr<PhysicalEntity>) override {}
virtual inline void do_exit(Game&, ... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mqueue.h"
//初始化队列
void InitializeQ(mQueue * pqueue)
{
pqueue->front = NULL;
pqueue->queuecount = 0;
pqueue->tail = NULL;
}
//队列是否为空
bool IsQueueEmpty(const mQueue *pqueue)
{
if (pqueue->queuecount == 0)
return true;
return false;
}
//队列是否为满
... |
#ifndef VirtualPixel_h
#define VirtualPixel_h
// Stripped down version for testing
#include <stdint.h>
#include <stdio.h>
#include "Arduino.h"
#define NEO_GRB 0x01
#define NEO_KHZ800 0x02
class SoftPixel
{
public:
SoftPixel(uint16_t, uint8_t=6, uint8_t=NEO_GRB + NEO_KHZ800);
void begin(void);
void show(... |
#include "Commands.h"
#include "iostream"
#include "GlobalVariables.h"
LsCommand::LsCommand(string args):BaseCommand(args){
}
void LsCommand::execute(FileSystem & fs) {
if (verbose==2||verbose==3)
cout<<toString()+" "+getArgs()<<endl;
string input=getArgs();
bool sort=false;
if(input.substr(0... |
//
// rank_vector.cpp
// TextRetrieval
//
// Created by Joseph Canero on 11/15/15.
// Copyright © 2015 jcanero. All rights reserved.
//
#include "rank_vector.hpp"
#include <cassert>
double RankVector::rank_against(const RankVector& rv) {
// at this point, both of the vectors should be the same length
asse... |
#pragma once
#include "RAsset.h"
#include "TDataTypes.h"
class RTexture: public RAsset
{
DECLARE_CLASS(RTexture,)
public:
class RTextureBuffer* Buffer;
protected:
enum ETextureMemoryType
{
TMT_SYSTEM,
TMT_MANAGED,
TMT_VIDEO
};
TString FileName;
int Width;
int Height;
ETextureMemoryT... |
#pragma once
#include "InputDefine.h"
#include "TDataTypes.h"
class BViewport;
class BCamera
{
public:
BCamera(BViewport* InParentViewport, ECameraMode InCameraMode);
virtual ~BCamera(void);
class BThing* m_Subject;
ECameraMode m_CameraMode;
BViewport* ParentViewport;
TMatrix m_RotationM... |
#include "MoviePlayList.h"
MoviePlayList::MoviePlayList(){
init();
}
MoviePlayList::~MoviePlayList(){
clear();
}
void man(){
cout<<"Welcome to the Playlist manual\n";
cout<<" - Under construction...\n";
cout<<"Basics:\n";
cout<<" - read() is for user input\n";
cout<<" - read(istream&) is for file input\n... |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
typedef map<string, int> msi;
typed... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.