text stringlengths 8 6.88M |
|---|
//---------------------------------------------------
#include <unordered_set>
#include <functional>
#include <iostream>
#include <string>
namespace jj32
{
/*
//下面的 hash<string>, G2.9需要,G4.9不需要,因為 G4.9 basic_string.h 已提供
template<> struct hash<string>
{
size_t operator()(string s) const {
return __... |
#include<bits/stdc++.h>
using namespace std;
bool isVisited[100001];
vector<int> node[100001],trans[100001];
vector<int> scc,order;
void dfs(int par)
{
isVisited[par]=true;
//cout<<par<<"\n";
for(auto x: node[par])
if(!isVisited[x])
dfs(x);
order.push_back(par);
}
void dfs1(int par)
{
isVisited[par]=true;
/... |
#ifndef FONTCLASS_H_INCLUDED
#define FONTCLASS_H_INCLUDED
class FontClass{
public:
FontClass(){
WINDOWWIDTH = 640;
WINDOWHEIGHT = 480;
}
~FontClass(){
killFont();
}
void initFont(){
fontTextureID ... |
#include"DBSCAN.h"
#include<iostream>
#include<cmath>
#include<fstream>
#include<stack>
using namespace std;
AroyaDBSCAN::AroyaDBSCAN()
{
radius = 2;
density = 5;
data = nullptr;
rows = 0;
columns = 0;
clusters = 0;
cluster = nullptr;
}
void AroyaDBSCAN::setData(const vector<vector<double>>&newData)
{
if (d... |
#pragma once
#include <string>
class HandlerResult
{
public:
enum Result
{
Success,
Fail,
};
HandlerResult(Result result, std::string msg);
const Result& getResult() const;
const std::string& getMsg() const;
private:
Result _result;
std::string _msg;
};
|
#include<iostream>
#include<string>
#include "kolejka.hpp"
using namespace std;
int main()
{
string x={},y;
int size,p;
kolejka *Q;
cout<<endl;
cout<<"Wybierz inicjalizację kolejki: "<<endl;
cout<<"1)Kolejka(int x)"<<endl;
cout<<"2)Kolejka({Ala ma kota})"<<endl;
cout<<"3)Kolejka()"<<endl;
cout<<"4)Kolejka(Kol... |
#ifndef FOGRESERVEDID_HXX
#define FOGRESERVEDID_HXX
class FogReservedId : public FogKeyword
{
typedef FogReservedId This;
typedef FogKeyword Super;
TYPEDECL_SINGLE(This, Super)
private:
const FogTokenType::TokenType _pp_token_type;
const FogTokenType::TokenType _token_type;
private:
FogReser... |
#include "algorithm/base_component/include/camera_config.h"
namespace OpticalFlow_SLAM_algorithm_opticalflow_slam {
std::shared_ptr<CameraConfig> CameraConfig::camera_config = nullptr;
void CameraConfig::show_camera_config_info()
{
std::cout << "**************************** camera config start **********... |
#include <iostream>
#include <fstream>
#include <algorithm>
#include <windows.h>
#include <string>
#include <vector>
#include "Pool.h"
#include "Blur.h"
#include <filesystem>
namespace fs = std::experimental::filesystem;
#pragma comment(lib, "winmm.lib")
std::vector<Task*> createTasks(bitmap* initBmp, bitmap* blur... |
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <cstring>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <limits>
#include <assert.h>
#include <stdint.h>
#include "il2cpp-class-internals.h"
#include "codegen/il2cpp-codegen.h"
#include "il... |
#include "graph.h"
#include<stdio.h>
int LocateMGraphVex(MGraph *G,VertexType v)
{
/*在邻接矩阵G中,若v是途中的顶点名字,
则返回v在图G中的位置,否则返回-1*/
int i;
for(i=0;i<G->vexnum;i++)
if(G->vers[i]==v)
return i;
return -1;
}
/*CreateDNMGraph:创建有向网的邻接矩阵*/
int CreateDNMGraph(MGraph *G)
{
int i,j,k;
VertexType v1,v2... |
/*
* Copyright (c) 2013 William Linna <william.linna(at)kapsi.fi>
*
* 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... |
#include <iostream>
#include "../src/complex.h"
#include "../src/input_image.h"
#include <mpi.h>
#include <cmath>
#include <chrono>
// #include <sstream>
#define DBG 0
#define DBG_DATA 0
#define LOCATE(i, j) ((i) * sequence_len + (j))
#define TAG_INIT_R 0
#define TAG_COLLECTING_R 1
#define TAG_INIT_C 2
#define TAG_COLL... |
#include <iostream>
#include <algorithm>
#include <malloc>
using namespace std;
class bigNum{
public:
char num[50][50]; //Max Size of integer is 10^(50*50) - 1
bigNum add(bigNum, bigNum);
bigNum subtract(bigNum, bigNum);
bigNum multiply(bigNum, bigNum);
bigNum divide(bigNum, bigNum);
bigNum operator+(big... |
/* Rotate an array by K Postions [Reversal Method]
*/
#include <iostream>
#include <iomanip>
using namespace std;
//functions prototypes
void rightRotate(int arr[], int n, int k);
void reverseArray(int arr[], int low, int high);
void printArray(int arr[], int n);
int main()
{
int arr[] = {1, 2, 3, 4, 5};
int n =... |
#include "Globals.h"
#include "Header.h"
using namespace Gdiplus;
class element
{
public:
element(int x,int y, int mass, int typ, std::vector<std::pair<int, int>> &position){
xpos = x;
ypos = y;
weight = mass;
type = typ;
position.push_back(std::make_pair(x, y));
is_obstacle = false;
... |
//
// Created by twome on 06/05/2020.
//
#include <glm/gtc/matrix_transform.hpp>
#include "Camera.h"
#include "GameWindow.h"
void Camera::update() {
auto window = GameWindow::get_instance();
zoom.update();
// Calculate camera size depending on the zoom value
// but keeping the aspect ratio
auto ... |
//结构体的优先级设置,需要用C++对<小于号重载
//重载大于号会编译错误,从数学来讲只需要重载小于号
//f1>f2等价于判断f2<f1
//f1==f2等价于判断 !(f1<f2)&&!(f2<f1)
#include<iostream>
#include<string>
#include<queue>
using namespace std;
struct fruit{
string name;
int price;
friend bool operator < (fruit f1,fruit f2){
return f1.price>f2.price; //价格低的优先级高,优先队列与sort里面的cmp是反着... |
#include <ESP8266WiFi.h>
#include <NTPClient.h>
#include <FirebaseArduino.h>
#include <ArduinoJson.h>
#include <Ticker.h>
#include<SoftwareSerial.h> //Included SoftwareSerial Library
#define FIREBASE_HOST "ph-safe.firebaseio.com"
#define FIREBASE_AUTH "2fxqpAHVPeqpfvNRA3VN3T6Yx61Zo53h9HDPjM4Q"
#define WIFI_SSID ... |
// Fading LED
// by BARRAGAN <http://people.interaction-ivrea.it/h.barragan>
#include "WProgram.h"
void setup();
void loop();
int value = 0; // variable to keep the actual value
int green = 9; // light connected to digital pin 9 green
int blue = 10;
int red = 11;
in... |
/**
* Header file for the CommandPlus class.
@file CommandPlus.h
*/
#pragma once
#include<conio.h>
#include"point.h"
#include"Editor.h"
using namespace std;
class CommandPlus {
private:
char command{};
Point location;
string value;
bool isChar{ false }, isString{ false };
public:
// Default constructor.
// Does... |
#include "VulkanCommandPool.h"
#include "VulkanInstance.h"
#include "VulkanDevice.h"
#include "VulkanException.h"
#include <vulkan\vulkan.h>
VulkanCommandPool::VulkanCommandPool(VkPhysicalDevice* physicalDevice, VulkanDevice* device, VulkanInstance* instance) : device(device)
{
QueueFamilyIndices queueFamilyI... |
#include "stdafx.h"
#include "resource.h"
#include "FindFileDlg.h"
#include "FileFinder.h"
UINT _SearchForFile(void *p);
#define ICONS 11
HICON g_FindFileIconArray[ICONS];
BEGIN_MESSAGE_MAP(CFindFileDlg, CSnapDialog)
//{{AFX_MSG_MAP(CFindFileDlg)
ON_BN_CLICKED(ID_STOP, OnStop)
ON_WM_SHOWWINDOW()
ON... |
/*
* =====================================================================================
*
* Filename: a.cpp
*
* Description:
*
* Version: 1.0
* Created: 09/12/2013 11:07:28 PM
* Revision: none
* Compiler: gcc
*
* Author: YOUR NAME (),
* Organization:... |
#ifndef __LINBOX_matrix_SlicedPolynomialMatrix_SlicedPolynomialMatrixConversion_H
#define __LINBOX_matrix_SlicedPolynomialMatrix_SlicedPolynomialMatrixConversion_H
#include "SlicedPolynomialMatrix.h"
#include "linbox/matrix/polynomial-matrix.h"
#include "linbox/matrix/DenseMatrix/blas-matrix.h"
#include <givaro/gfq.h>... |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() { ll m,n,k; while(cin>>n>>m) { cout<<min((m+n)/3, min(m,n) )<<endl; } }
|
//Code developed by Rafael Ribeiro and Daniel Monteiro in previous PROG project;
#ifndef UTILS_H
#define UTILS_H
#include <iostream>
#include <string>
#include <ostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <map>
#include <algorithm>
namespace utils
{
/**
The first line in 'stream' th... |
/*
** Copyright (c) 2013, Xin YUAN, courses of Zhejiang University
** All rights reserved.
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the 2-Clause BSD License.
**
** Author contact information:
** yxxinyuan@zju.edu.cn
**
*/
/*
This file contains entry point f... |
#include "BSModel.h"
#include <cmath>
#include <iostream>
using namespace std;
void BSModel::GenerateSamplePath(double T, int D, NormalRandomGenerator &RandomNumber)
{
double St = mS0;
for (int k = 0; k < D; k++)
{
St = St * exp((mInterestRate - pow(mSigma, 2)*0.5)*
(T / D) + mSigma * sqrt(T / D)*... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::UI::Xaml::Documents {
struct IBlock;
struct IBlockFactory;
struct IBlockStatics;
struct IBold;
struct IGlyphs;
struct IGlyphs2;
struct ... |
#include "surface.h"
#include <cmath>
namespace rt {
// Calculate the normal of the triangle
Triangle::Triangle(Material* m, Vec3f* a, Vec3f* b, Vec3f* c)
: Surface{m}, a{a}, b{b}, c{c}
{
normal = cross((*b - *a), (*c - *a)).normalize();
}
bool Triangle::hit(Ray ray, HitRecord* rec) const {
Vec3f a... |
/*
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 <QtConcurrent/QtConcurrent>
#include "projectdetailsviewmodel.hpp"
#include "databasemanager.hpp"
ProjectDetailsViewModel::ProjectDetailsViewModel(QObject *parent)
: QObject (parent)
{
m_isWorking = false;
m_currentProject = nullptr;
m_appDatabase = QSqlDatabase::database(DATABASE_CONNECTION... |
#include "Stage2.hpp"
Stage2::Stage2()
{
BGScale=2;
Visiblepath=true;
if (bacgroundImg.LoadFromFile("contents/Fantasy.jpg"))
{
BGWidth = bacgroundImg.GetWidth(); // megvizsgálom a háttér méretét
BGHeight = bacgroundImg.GetHeight();
B... |
#ifndef QARTNETNODE_H
#define QARTNETNODE_H
#include "qartnet_global.h"
#include "common.h"
#include <QObject>
#include <QHostAddress>
class QARTNETSHARED_EXPORT QArtNetNode : public QObject
{
Q_OBJECT
public:
explicit QArtNetNode(QObject *parent = 0);
void parsePollReplyPacket(QByteArray packet);
... |
#pragma once
#ifndef __MAP__
#define __MAP__
#define TILE_PIXEL 32
#define TILE_CELL 4
#define CELL_PIXEL 8
#define NUMS_MAP_LAYER 3
#include "framework.h"
#include "sprite.h"
#include "autoTile.h"
#include <map>
#include <string>
#include <vector>
class Autotile;
class MapManager;
class Node;
class Map
{
friend cl... |
#include "BulletSoftBody/btSoftBody.h"
#include "dSoftBodyCmd.h"
#include "softBodyNode.h"
#include <maya/MPxCommand.h>
#include <maya/MGlobal.h>
#include <maya/MSyntax.h>
#include <maya/MArgDatabase.h>
#include <maya/MDagModifier.h>
#include <maya/MString.h>
#include <iostream>
MString dSoftBodyCmd... |
#include "../src/stubgen.h"
#include "rpc_server_class_skel.h"
#include "rpc_server_class.h"
#define LOG(str) hlog_log(str, "hcomms.log")
class stubgen_test : public CxxTest::TestSuite
{
public:
stubgen_t *stubgen;
stubgen_test()
{
//stubgen = new stubgen_t();
//stubgen->gen("... |
#ifndef GROUPMANAGER_H
#define GROUPMANAGER_H
#include "../Manager.h"
#include "../ImmutableBag.h"
#include <map>
#include <vector>
#include <string>
#include <algorithm>
class GroupManager : public Manager
{
public:
GroupManager() : Manager()
{
entitiesByGroup = new std::map<std::string, Bag<Entity*... |
#include "Topping.h"
Topping::Topping()
{
//ctor
}
Topping::Topping(string name, double price)
{
this -> name = name;
this -> price = price;
}
istream& operator >> (istream& in, Topping& topping)
{
cout << "Name: ";
in >> topping.name;
cout << "Price: ";
in >> top... |
#pragma once
#include "player.h"
namespace minesweeper::player {
auto human() -> Player;
}
|
/* -*- mode: C++ -*-
* All right reserved, Sure_star Coop.
* @Technic Support: <sdk@isurestar.com>
* $Id$
*/
#include <unistd.h>
#include <string>
#include <sstream>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <poll.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/file.h>
#inclu... |
#ifndef SNAPTOOLBAR_H
#define SNAPTOOLBAR_H
#include <QtGui>
#include <QWidget>
#include <QToolBar>
#include <QAction>
#include <QActionGroup>
class SnapToolBar : public QToolBar
{
Q_OBJECT
/*
这个类是绘图工具条,能进行画笔画刷的设置,其它类可以从它这里取到画笔和画刷的设置值
当然,这里面也可以选择绘图图形,也可以获取相应的值
*/
public:
explicit SnapToolBar(QWidget *parent = 0);
... |
#include<bits/stdc++.h>
using namespace std;
bool checkSNT(int x){
if (x<2){
return false;
} else {
for (int i=2; i<=sqrt(x); i++){
if (x%i==0){
return false;
}
}
}
return true;
}
int main(){
int n;
cin >> n;
for (int i=1; i<... |
//~ author : Sumit Prajapati
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
#define int long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb ... |
#ifndef ADAPTIVE_TIME_HPP
#define ADAPTIVE_TIME_HPP
#include <vector>
#include "boost/numeric/ublas/vector.hpp"
namespace GALES{
/**
This file defines the adaptive time step criterion for fluid flow solvers
*/
template<int dim>
struct adaptive_time_criteria
... |
/**
* @file carton.h
* @author your name (you@domain.com)
* @brief Create a class
* @version 0.1
* @date 2019-12-18
*
* @copyright Copyright (c) 2019
*
*/
#pragma once
#include <iostream>
using namespace std;
// Create a class, declaration
class Carton //convention is capitalized
{
pri... |
/****************************************************************************
**
** Copyright (C) 2009 Du Hui.
**
****************************************************************************/
#ifndef QSERIALCOMM_H
#define QSERIALCOMM_H
#include <QIODevice>
class WinSerialComm;
enum BAUD_RATE_TYPE {
... |
/**
* 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
*
* ... |
#include <iostream>
#include <cstring>
int main()
{
int n;
int c;
int arr[10000];
memset(arr, 0, 10000 * sizeof(int));
scanf("%d", &n);
for (int i = 0; i < n; i++)
{
scanf("%d", &c);
arr[c - 1] += 1;
}
for (int i = 0; i < 10000; i++)
{
if (arr[i] != 0)
{
for (int j = 0; j < arr[i]; j++)
prin... |
//программная реализация быстрой сортировки через параметрические циклы
#include <stdio.h>
#include <stdlib.h>
int b; //индекс первого элемента массива
int e; //индекс последнего элемента массива
int l; //индекс левого элемента
int r; //индекс правого элемента
int arr[] = { -6, 1, 0, 5, 7, 8, 4, 9, -17, 12 };
int n = ... |
#pragma once
#include "Sequence.h"
#include "LinkedList.h"
template <class T>
class ListSequence : public Sequence<T> {
private:
LinkedList<T>* items;
int size;
public:
// Конструкторы
ListSequence() {
this->items = new LinkedList<T>();
this->size = 0;
};
ListSequence(LinkedList<T>* items,... |
/*
* tracer_robot.hpp
*
* Created on: Jul 13, 2021 21:59
* Description:
*
* Copyright (c) 2021 Weston Robot Pte. Ltd.
*/
#ifndef TRACER_ROBOT_HPP
#define TRACER_ROBOT_HPP
#include "ugv_sdk/details/robot_base/tracer_base.hpp"
namespace westonrobot {
using TracerRobot = TracerBaseV2;
} // namespace westonrobot... |
#include "include/sphere.h"
//#include "include/common.h"
#include <cmath>
namespace raytracer {
Sphere::Sphere()
: Shape()
{
}
Sphere::~Sphere() = default;
void Sphere::intersect(const Ray& ray, std::vector<Intersection>& xs) const {
Transform sphereTransform = this->getTransform();
Transform inverted... |
#include<iostream>
#include <cstdio>
#include <string.h>
#include <cmath>
using namespace std;
double arr[1001][2006];
double find(int n,int k)
{
if (n == 0)
return k == 0 ? 100 : 0;
if (k <= 0)
return 0;
if (arr[n][k] > -0.5)
return arr[n][k];
return arr[n][k]=(find(n-1,k-1)+find(n-1,k-2)+find(n-1,k-... |
#include<iostream>
#include<string>
using namespace std;
class myclass
{
public:
string name;
int age;
void print(){
cout<<"Name-"<<name<<endl<<"Age-"<<age;
}
};
int main()
{
myclass obj;
cout<<"Enter your name and age:";
cin>>obj.name;
cin>>obj.age;
obj.pri... |
/*
* Copyright (C) 2007-2015 Frank Mertens.
*
* Use of this source is governed by a BSD-style license that can be
* found in the LICENSE file.
*
*/
#ifndef FLUXNET_STREAMSOCKET_H
#define FLUXNET_STREAMSOCKET_H
#include <flux/SystemStream>
#include <flux/net/SocketAddress>
namespace flux {
namespace net {
/** ... |
/* Otto Shaft
* SHAFT ROBOTICA https://instagram.com/shaftrobotica
por VITOR DOMINGUES https://github.com/vitorshaft/
09 fev 2019
*/
#include <Servo.h>
#include <Oscillator.h>
#include <Otto.h>
#include <Otto_gestures.h>
Otto Otto;
#define Dir0 4 //D2
#define Dir1 5 //D1
#define Esq0 0 //D3
#define Esq1 2 ... |
//**************************************************************************
//**
//** 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 ... |
#pragma once
#include "CHandler.h"
#include "CShaderManager.h"
#include <stack>
#include "CDrawing.h"
struct SHierModelNode
{
shared_ptr<CDrawing> draw;
glm::mat4 trans;
glm::mat4 trans_s; // no inheritance
int port;
int left_child;
int right_sibling;
vector<int> homos; // nodes that will be drawed in same t... |
/*
Summary:
Print hexadecimal values
Notes:
0000 - FFFF
-Copy/Pasting hex practice values from cmd to doc file
might require different IDE or directly loading file from
command prompt
*/
#include <iostream> /*cout, endl */
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
using... |
#include "CommitTaskDialog.h"
#include "ui_CommitTaskDialog.h"
#include "TaskMacro.h"
#include <QProgressBar>
#include <QDebug>
#include <QMessageBox>
using namespace Plugins;
CommitTaskDialog::CommitTaskDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::CommitTaskDialog)
{
ui->setupUi(this);
// ad... |
//**************************************************************************
//**
//** 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 ... |
/*
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... |
/*********************************************************************
Matt Marchant 2014 - 2016
http://trederia.blogspot.com
xygine - Zlib license.
This software is provided 'as-is', without any express or
implied warranty. In no event will the authors be held
liable for any damages arising from the use of this soft... |
// FW UNKNOWN: a Mini Library for DLL COM Servers
// Facilitates creating COM DLL server modules without use of ATL
// A special extension for the FreeWill+ system
//
// Provides:
// - ERROR macrodefinition for reporting run-time errors the easy way
// - template-based FWUNKNOWN base class with full implementatio... |
/*********************************************************************
Matt Marchant 2014 - 2016
http://trederia.blogspot.com
xygine - Zlib license.
This software is provided 'as-is', without any express or
implied warranty. In no event will the authors be held
liable for any damages arising from the use of this soft... |
/***************************************************************************
Copyright (c) 2020 Philip Fortier
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 version 2
of the License, or... |
/*
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 i, N;
cout << "Write N number ";
cin >> N;
for (i = 1; i <= N; i++)
cout << "Square root of " << i << " " << i * i << endl;
system("PAUSE");
}
|
#include "fadbad-pr2-sim.h"
/**
* FadbadArm constructors
*/
FadbadArm::FadbadArm(rave::RobotBasePtr robot, Arm::ArmType arm_type) {
origin = rave_utils::rave_to_eigen(robot->GetLink("torso_lift_link")->GetTransform()).cast<bdouble>();
arm_joint_axes = { Vector3b(0,0,1),
Vector3b(0,1,0),
Vector3b(1,0,0),
... |
#include "VB.h"
#define X ((1<<7)-1)
#define W (1<<7)
uint8 *VB::encode(int n, int &len)
{
static uint8 bytes[5];
len = 0;
while (n > X)
bytes[len++] = n & X, n >>= 7;
n |= W;
bytes[len++] = n;
return bytes;
}
int VB::decode(uint8 *bytes, int &len)
{
int ret = 0;
len = 0;
int move = 0;
while (!(bytes[len]... |
#include "LUACalls.h"
#include "..\\Threads.h"
#include "..\\Launcher.h"
#include <setjmp.h>
#include "..\\xboxinfo.h"
MenuList Menu[9]; // Number of Menu Items
CXboxInfo XBOXDriveStatus; // Xbox
// Globals
lua_State* LUA_STATE; // Main Secne State
string LUA_SCENE_BUFFER; // Scene Buffer
// Days
char szXboxDay... |
#include<bits/stdc++.h>
using namespace std;
bool isvalid(vector<int>& stalls,int n,int cows,int dist)
{
int position = 0;
int count = 1;
for(int i=1;i<n;i++)
{
long long diff = abs(stalls[i]-stalls[position]);
if(diff >= dist)
{
count+=1;
position = i;
}
if(count == cows)
{
return true;
}
... |
#include <ax12.h>
#include <avr/pgmspace.h>
//Initialize Variables.
int MotorID = -1;
int LEDDelay = 100;
int CommandType = -1;
int NumMotors = -1;
int NumCommandsLow = -1;
int NumCommandsHigh = -1;
int MoveDelay = 20;
int ReadDelay = 20;
void setup()
{
//Initialize serial communication with baud rate of 9600.
// ... |
#pragma once
#ifndef __MainWindow_H
#define __MainWindow_H 1
#include <thread>
class window;
class input;
class keyboard;
enum keys;
class mouse;
class RenderContext;
class MainWindow
{
public:
MainWindow();
virtual ~MainWindow();
bool isKeyDown(keys key) const;
void getMousePos(long& x, long& y) const;
c... |
#include <iostream>
#include "libxl.h"
#include "headers/config.h"
using namespace libxl;
int getXLSData(struct artikel structure[])
{ /* Read Data from excel file (.xls) and load them into predefined structure, have error checking
* part of class providing methods to handle this type of files. Based on LibXL
... |
/*
* Copyright 2017 Roman Katuntsev <sbkarr@stappler.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... |
//////////////////////////////////////////////////////////////////////////
//
// data library
//
// Written by Pavel Amialiushka
// No commercial use permited.
//
//////////////////////////////////////////////////////////////////////////
#pragma once
#include "data_fwrd.h"
#include "criterion.h"
#include <boost/forma... |
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
==============================================================... |
#pragma once
#include "Person.h"
class Teacher : public Person
{
public:
Teacher();
Teacher(std::string teacherFirstName, std::string teacherLastName);
~Teacher();
};
|
/***************************************************************************
Copyright (c) 2020 Philip Fortier
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 version 2
of the License, or... |
#include<iostream>
#include<vector>
#include<algorithm>//标准算法的头文件
using namespace std;
// vector容器存放内置数据类型
void myPrint(int val)
{
cout<<val<<endl;
}
void test01()
{
//创建vector容器,数组
vector<int> v;
//插入数据
v.push_back(10);//尾插
v.push_back(20);
v.push_back(30);
v.push_back(40);
// /... |
#ifndef FACTORY_BTN_ERASER_H_
#define FACTORY_BTN_ERASER_H_
#include "Factory_Btn.h"
class Factory_Btn_Eraser : public Factory_Btn {
public:
Botton* generate();
};
#endif // !FACTORY_BTN_ERASER_H_
#pragma once
|
//
// Copyright Jason Rice 2019
// 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_APP_SERIALIZER_JS_HPP
#define NBDL_APP_SERIALIZER_JS_HPP
#include <nbdl/binder/js.hpp>
#include <string>
namespace... |
#include "scripting\Singularity.Scripting.h"
using namespace Singularity::Components;
namespace Singularity
{
namespace Scripting
{
IMPLEMENT_OBJECT_TYPE(Singularity.Scripting, LuaRuntime, Singularity::Object);
#pragma region Static Variables
LuaRuntime* LuaRuntime::g_pInstance = NULL;
#pragma ... |
#include <iostream>
using namespace std;
int main(){
bool b=cout.bad();
cout<<b<<endl;
b=cout.good();
cout<<b<<endl;
return 0;
}
|
#pragma once
#ifndef FILELOADER_H
#define FILELOADER_H
#include <Windows.h>
#include <iostream>
#include <fstream>
class FileLoader
{
private:
const char * FilePath;
FILE * FilePointer;
char * FileDataBuffer;
UINT FileLength = 0;
UINT BytesReadFromBuffer = 0;
void... |
#ifndef _RAVE_UTILS_H__
#define _RAVE_UTILS_H__
#include <iostream>
#include <armadillo>
using namespace arma;
#include <openrave-core.h>
namespace rave = OpenRAVE;
namespace rave_utils {
void cart_to_joint(rave::RobotBase::ManipulatorPtr manip, const rave::Transform &matrix4,
const std::string &ref_frame, const... |
/*
* Date.cpp
*
* Created on: Sep 12, 2016
* Author: Istvan
*/
//#include <iomanip>
#include "Date.h"
//////////Functions used for lab2//////////////////////////////////
Date::Date() {
year = 0;
month = 0;
day = 0;
}
int Date::getDate(){
return ((year *pow(10,4)) + (month *pow(10,2)) + day);
}
void Dat... |
#include "stdint.h"
#include <stdio.h>
#include <math.h>
typedef uint32_t color_t;
#define ONE_HALF 0x80
#define A_SHIFT 8 * 3
#define R_SHIFT 8 * 2
#define G_SHIFT 8
#define A_MASK 0xff000000
#define R_MASK 0xff0000
#define G_MASK 0xff00
const uint32_t rgba_r_shift = 0;
const uint32_t rgba_g_shift = 8;
const uint3... |
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const int maxn = 1005;
int n, m, G[maxn][maxn] = { 0 };
int len[maxn] = { 0 }, ans = 0;
int dfs(int v) {
if (!len[v]) {
for (int u = 1; u <= n; ++u)
if (G[u][v])
len[v] = max(len[... |
#ifndef PROCESS_AST_TREE
#define PROCESS_AST_TREE
#include "AstInterface.h"
#include "SinglyLinkedList.h"
class ProcessAstTreeBase : public ProcessAstNode
{
public:
typedef enum {BEFORE = 1, AT = 2, INSIDE = 4, BEFORE_AT = 3, INSIDE_AT = 6} TraverseLocation;
private:
struct TraverseState{
AstNodePtr sco... |
/*
* scene_drawings.h
*
* Created on: 11.10.2015 г.
* Author: martin
*/
#ifndef SCENE_DRAWINGS_H_
#define SCENE_DRAWINGS_H_
#include "PhysicalWorld.h"
extern PhysicalWorld world;
namespace opengl_scene {
void initGLScene();
void drawScene();
void resize (int w, int h);
void keyInput(unsigned char key, i... |
#include <ui_client/tag/tag_list_handler.h>
#include <core/debug/Debug.h>
#include "ui_tag_list_handler.h"
#define IDX_OR_RET(tag) \
const std::size_t _idx = indexOf(tag);\
if (_idx == tags_.size()) {\
return;\
}\
const int idx = static_cast<int>(_idx);
std::size_t
TagListHandler::indexOf(const TagW... |
#include<bits/stdc++.h>
using namespace std;
struct node
{
int data;
struct node* left=NULL;
struct node* right=NULL;
int count = 0;
};
typedef struct node Node;
Node* newnode(int key)
{
Node* temp = new Node();
temp->data = key;
return temp;
}
int insert(Node*& root,int data)
{
if(root==NULL)
{
root = ... |
#include"gts_minESingleV1.h"
#include"gts_repetitiveStructure.h"
#include<QFileDialog>
#include"opencv2/opencv.hpp"
#include"sw_functions.h"
#include <opencv2/core/core.hpp>
#include "opencv2/legacy/legacy.hpp"
#include<cmath>
#include<QTextStream>
#include<QTransform>
#include<QMessageBox>
#include<QRgb>
#define PI... |
#include "Node.h"
#include "Glob.h"
#include <string>
#include <iostream>
using std::endl;
using std::cout;
using std::string;
int main() {
Node<string>* ns = new Node<string>(string("hello world!"));
Node<int>* ni = new Node<int>(5);
Node<double>* nd = new Node<double>(3.1459);
std::cout << ns->getValue()<... |
#include "command.h"
CommandOperator *CommandOperator::instance = nullptr;
bool CommandOperator::checkForExistence(Object *current)
{
for (std::size_t i = 0; i < objects.size(); i++)
{
if (*current == *objects[i])
{
return true;
}
}
return false;
}
void CommandOpe... |
#include<bits/stdc++.h>
using namespace std;
int solve(vector<int> arr,int n,int value,int index,int sum)
{
int count = 0;
if(index >= arr.size())
{
return 0;
}
if(sum >= value)
{
return 0;
}
// if(sum >= value)
// {
// return 0;
// }
// exclude
count+=solve(arr,n,value,index+1,sum);
// include
if... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.