text stringlengths 8 6.88M |
|---|
/** \file RendererProgram.cpp
* \author Eduardo Pinho ( enet4mikeenet AT gmail.com )
* \date 2013
*/
#include "RendererProgram.h"
#include "MathUtils.h"
using namespace derplot;
using namespace math;
RendererProgram::RendererProgram(void)
: p_buffer(nullptr)
{}
RendererProgram::RendererProgram(DisplayBuffer& buf... |
// terminate.h
// Error messages and exit control for the code.
// Andrei Alexandru
// Oct 2003
#ifndef _TERMINATE_H
#define _TERMINATE_H
// Error messages
#define SUCCESS 0
#define ERROR 1
#define ERROR_READING_INITIAL_SET 2
#define ERROR_READING_EXTENDED_SET 3
#define ERROR_MEMORY_ALLOCATION 4
#define ERROR_OVER... |
#pragma once
#include "glm.hpp"
#include <string>
struct QuitMessage
{
};
struct ResizeMessage
{
glm::uvec2 size;
};
struct PlayMusicMessage
{
std::string name;
bool loop;
};
struct PlaySoundMessage
{
std::string name;
bool loop;
};
struct StopSoundMessage
{
};
struct MouseClickMessage
{
g... |
#include "WindowOpenFile.hh"
WindowOpenFile::WindowOpenFile(const PG_Widget *parent,
const std::string &title)
: WindowFile(parent, title)
{
}
bool
WindowOpenFile::do_ok()
{
if (!this->file_exists()) {
this->error("File does not exist.", ERROR_NORMAL);
this->focus_textbox()... |
#include "simd3d9/include/SimD3D9Enum.h"
namespace sim{
HRESULT D3D9Enum::EnumAdapters(
HWND adapter, HWND resolution,
HWND adapter_format, HWND buffer_format,
HWND device_type, HWND full_screen,
HWND windowed)
{
return S_OK;
}
} |
// mpi
#include <mpi.h>
// std
#include <string>
// cstd
#include <cstdio>
int main(int argc, char *argv[]){
// Initialize the MPI environment
if(MPI_Init( &argc, &argv ) != MPI_SUCCESS){
MPI_Abort( MPI_COMM_WORLD, 1 );
}
// Get the number of processes
int world_size;
if(MPI_Comm_size(MPI_COMM_WORLD, &worl... |
#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 Q[100100];
int main()
{
int t;
for (int turn = 1;turn <= t; turn++) ... |
#include <DxLib.h>
#include "SceneGame.h"
#include "Reference.h"
#include "Resource.h"
SceneGame::SceneGame(ISceneChanger *changer, Param ¶m) : Scene(changer, param) {
difficulty = param.get("Difficulty");
count = 0;
vector<Object*> objs;
for (int i = 0; i < Ref::ENEMY_MAX; i++) {
enemy.push_back(new Enemy... |
#pragma once
#include <QScopedPointer>
#include "Indexes.h"
#include "Serializable/Array/SerializableArray.h"
class PartOfKey;
class GeneralAnswerOptionsKey;
class UniqueAnswerOptionsKey;
/**
* @brief Абстрактный класс является представлением ключа для проверки теста
*/
class Key : SerializableArray {
public:
//... |
#ifndef GAMEOVERSCENE_H
#define GAMEOVERSCENE_H
#include <UtH/UtHEngine.hpp>
#include <map>
class GameOverScene : public uth::Scene
{
void createLayers(const std::vector<std::string>& layers);
public:
uth::Layer& getLayer(const std::string& name);
GameOverScene();
~GameOverScene() override;
bool Init() overri... |
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007
#define vi vector<int>
void solve();
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t=1;
// cin>>t;
while(t--)
{
solve();
cout << "\n";
}
... |
// Aaron ALAI EMF Detector May 28th 2009 VERSION 1.1
// aaronalai1@gmail.com
// contains code for averaging sensor data
#define sample 300 //this is how many samples the device takes per reading
//more information for #define http://arduino.cc/en/Reference/Define
int inPin = 5; ... |
// Copyright (c) 2012-2017 The Cryptonote developers
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "gtest/gtest.h"
#include "crypto/crypto.h"
#include "Cr... |
//main
#pragma once
#include <iostream>
#include <string>// string included not basic string
#include <fstream>// file stream for file read write
#include "time.h"
#include "date.h"
#include "unit.h"
#include "Vector.h"//capital V to distinguish from STL vector
#include "BST.h"
#include <map>
//-----------------------... |
#include "Team.h"
#include "Types.h"
TEAM Id2Team(u8 id){
if(id>2)id=2;
return static_cast<TEAM>(id+1);
}
u8 Team2Id(TEAM t){
u8 id = static_cast<u8>(t);
if(id<=0)id=1;
return (id-1);
} |
#ifndef ASSEMBLAGE_H
#define ASSEMBLAGE_H
#include <QWidget>
namespace Ui {
class Assemblage;
}
class Assemblage : public QWidget
{
Q_OBJECT
public:
explicit Assemblage(QWidget *parent = 0);
~Assemblage();
void setNextLayer(QWidget* w);
void setPreviousLayer(QWidget* w);
private slots:
... |
#include <cassert>
#include "Ray.hh"
Ray :: Ray(const Vector3F &orig, const Vector3F &dir, bool normalize){
this->orig = orig;
if(normalize){
this->dir = dir.normalize();
}else{
this->dir = dir;
}
}
Vector3F Ray :: get_orig(void) const{
return orig;
}
Vector3F Ray :: get_dir(void) const{
return... |
#include "Robot.hpp"
namespace RoboDodge
{
Robot::Robot(float iwidth, float iheight, float ix, float iy)
{
width = iwidth;
height = iheight;
x = ix;
y = iy;
}
void Robot::Move(float ix, float iy)
{
x += ix;
y += iy;
}
float Robot::GetX()
... |
/*
* Copyright (C) 2013 Tom Wong. All rights reserved.
*/
#include "gtdocmanager.h"
#include "gtbookmarks.h"
#include "gtdocmeta.h"
#include "gtdocmodel.h"
#include "gtdocnotes.h"
#include "gtdocument.h"
#include <QtTest/QtTest>
using namespace Gather;
class test_docmanager : public QObject
{
Q_OBJECT
private ... |
#include "StdAfx.h"
#include "Sub.h"
CSub::CSub(void)
{
live=false;
x=0;
y=0;
type=0;
num=0;
shot_del=0;
}
CSub::~CSub(void)
{
}
void CSub::init(int numm,int id)
{
live=true;
type=id;
num=numm;
shot_del=sub_missile_del_max[id];
}
void CSub::die()
{
live=false;
x=0;
y=0;
type=0;
num=0;
shot_del=0;
}
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2009 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef GEOLOCATION_MODULE_H
#define GEOLOCATION_MODULE_H
#ifde... |
#include <mqtt/publisher/delivery_action_listener.h>
void delivery_action_listener::on_failure(const mqtt::itoken &tok) {
pub_action_listener::on_failure(tok);
done_ = true;
}
void delivery_action_listener::on_success(const mqtt::itoken &tok) {
pub_action_listener::on_success(tok);
done_ = true;
}
|
/**
* Nodo Doblemente Enlazado
* Implementacion con utilización de Templates
**/
#ifndef __NODO_DOBLEMENTE_ENLAZADO_H__
#define __NODO_DOBLEMENTE_ENLAZADO_H__
#ifndef NULL
#define NULL 0
#endif
template<class T> class Nodo {
private:
/* elemento almacenado */
T dato;
/* puntero al s... |
#include <gmock/gmock.h>
#include <lib/Client/RoleController/RoleController.h>
#include <lib/Client/Client/Client.h>
#include <lib/Client/UserOptions/CompanyOptions.h>
#include <lib/Client/UserOptions/BaseUserOptions.h>
using ::testing::AtLeast;
using ::testing::DoAll;
using ::testing::Return;
using ::testing::SetArg... |
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
set<int> check;
bool match(const string &cur_user_id, const string &cur_banned_id) {
int usize = cur_user_id.size();
int bsize = cur_banned_id.size();
if (usize != bsize) {
return false;
}
for (int i = 0; i < bs... |
#ifndef config_h
#define config_h
#define DEVICE_CONF_ARRAY_LENGHT 50
class config_t
{
public:
config_t() {};
char broker[DEVICE_CONF_ARRAY_LENGHT];
uint16_t brokerPort;
char topicHumidity[DEVICE_CONF_ARRAY_LENGHT];
char wifiSsid[DEVICE_CONF_ARRAY_LENGHT];
char wifiPass[DEVICE_CONF_ARRAY_LEN... |
//
// Builder.cpp
// ItsyForth
//
// Created by Dad on 4/17/21.
//
/*
#include "Builder.hpp"
#include "Runtime.hpp"
#include "OpCode.hpp"
#include "DictionaryWord.hpp"
#include "CountedString.hpp"
#include "Debug.hpp"
static const std::string INDENT(" ");
Builder::Builder(Runtime* runtimeIn) {
runtime = runtim... |
#include "Price.h"
namespace BroodWar
{
namespace Api
{
Price::Price(int minerals, int gas, int timeFrames, int supply)
{
_minerals = minerals;
_gas = gas;
_timeFrames = timeFrames;
_supply = supply;
}
int Price::Minerals::get()
{
return _minerals;
}
int Price::Gas::get()
{
ret... |
#include <iostream>
#include <vector>
/*
* I feel like I missed the reason why this was in the Recursion chapter
*
* After looking at the solutions, the reason this is in the Recursion
* chapter is because binary search actually provides the most efficient
* solution to this problem
*
*/
using namespace std;
... |
#include "TestGTE.h"
#include <iostream>
#include <iomanip>
int main(int argc, char **argv)
{
using namespace test;
gte device;
GTEtestbench tester(&device);
tester.constructInstruction(0, CC);
tester.storeControl(gte::LR1LR2, 0x20001000); // colour matrix
tester.storeControl(gte... |
#ifndef ASSIGNNODE_H
#define ASSIGNNODE_H
#include <vector>
#include <string>
#include <iostream>
#include "Node.hpp"
using namespace std;
class classNode;
class AssignNode : public Node {
private:
Node *expr = nullptr;
string objectID;
public:
AssignNode(string objectID, Node *expr);
string getO... |
#ifndef GNTRANSFORM_H
#define GNTRANSFORM_H
class GNMAIN_ENTRY GnTransform : public GnMemoryObject
{
public:
GnTransform(){};
virtual ~GnTransform(){};
protected:
private:
};
#endif // GNTRANSFORM_H |
/*
==============================================================================
blueprint_EcmascriptEngine.cpp
Created: 24 Oct 2019 3:08:39pm
==============================================================================
*/
namespace blueprint
{
namespace detail
{
/** Helper method t... |
/*
C++ Program to print your name 100 times.
*/
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
#define max 200
int main()
{
char name[max];
int i;
cout << "Enter the name :" << endl;
cin.get(name, max);
for (i = 0; i <= 100; i++)
{
cout << i << "\t" << ... |
#include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <vector>
#include <dirent.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include<algorithm>
#define NAMED_PIPE_PATH "./named_pipe"
#define VAL_SIZE 1024
#define ASCEND... |
#include <OpenScatterTable.h>
#include <Wrapper.h>
#include <PuttingVisitor.h>
#include <iostream>
int main(void)
{
using namespace std;
OpenScatterTable cst(100);
cst.Insert(* new Int(1));
Int * ip1 = new Int(1);
Int i1 (1);
cst.Insert(* ip1);
cst.Insert(* new Int(2));
cst.Insert(* new Int(3));
c... |
//WARNING: It is expressly forbidden to modify any part of this document, including its name
#pragma once
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
class Car
{
private:
string name;
string color;
double price;
public:
//-------------------------------------... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2002 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef DOM_DOMJILMULTIMEDIA_H
#define DOM_DOMJILMULTIMEDIA_H
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2009 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef VEGAD3D10BUFFER_H
#define VEGAD3D10BUFFER_H
#ifdef VE... |
struct soa_tag {};
struct aos_tag {};
|
#include "ShoeManagerNetwork.hpp"
#include <QJsonObject>
#include <QJsonArray>
ShoeManagerNetwork::ShoeManagerNetwork()
{
mConfig = ShoeManagerNetworkConfig::getInstance();
pNetwork = ShoeManagerNetworkAccessManager::getInstance();
}
ShoeManagerNetwork *ShoeManagerNetwork::getInstance()
{
sta... |
//
// Created by fab on 20/11/2020.
//
#ifndef DUMBERENGINE_STATICMESH_HPP
#define DUMBERENGINE_STATICMESH_HPP
#include "../IComponent.hpp"
#include "Mesh.hpp"
#include "../../utils/IDragNDrop.hpp"
#include <assimp/scene.h>
#include <vector>
class StaticMesh : public IComponent, public IDragNDrop
{
public:
void... |
//////////////////////////////////////////////////////////////////////
// Interpolate.h
//
// 插值类 CInterpolate 的声明接口
//
// 周长发编制, 2002/8
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_INTERPOLATE_H__0AF22CA4_A4AA_486B_9D68_E074FABDAF85__INCLUDED_)
#define AFX_INTERPOLA... |
// Interval Scheduling Problem,weighted used dynamic programming
// http://pages.cs.wisc.edu/~shuchi/courses/787-F09/scribe-notes/lec3.pdf
#include <bits/stdc++.h>
using namespace std;
int main()
{
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
// no. of test inputs
int t;
cin>>t;
// vector store... |
#include "pesqthread.h"
#include "settings.h"
#include <QDir>
#include <QRegExp>
PESQThread::PESQThread(QObject *parent)
:QThread(parent)
{
m_PesqDir = QString("./PESQtools/tools");
QStringList commands = GlobalSettings::instance()->getCommandList();
m_commands_number = commands.count();
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 Opera Software ASA. 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 __OPRBRIDGE_DLL__
# include "excep... |
// DlgAddCommand.cpp : implementation file
//
#include "stdafx.h"
#include "QKDTrans.h"
#include "DlgAddCommand.h"
#include "afxdialogex.h"
#include "QKDTimer.h"
// CDlgAddCommand dialog
IMPLEMENT_DYNAMIC(CDlgAddCommand, CDialogEx)
CDlgAddCommand::CDlgAddCommand(CDlgCommandSheet *pDlg, CMD_WN *pCmd, int bNew, CWnd*... |
#pragma once
#
template<typename T>
class GtNumberString : public gtstring
{
public:
void SetNumber(T uiNumber, gtuint uiNumberLength = 1, const gtchar* pcFrontString = NULL
, const gtchar* pcBackString = NULL)
{
gtstring format;
if( pcFrontString )
format = pcFrontString;
gtuint number = abs(uiNumber);
... |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008 Benoit Jacob <jacob.benoit.1@gmail.com>
//
// Eigen is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Softwar... |
#include "SerialRDM.h"
SerialRDM::SerialRDM()
{
}
SerialRDM::~SerialRDM()
{
close(fd);
}
void SerialRDM::set_values(char * path_temp)
{
path = path_temp;
}
int SerialRDM::init()
{
serialopen();
serialconfig();
return 1;
}
int SerialRDM::serialopen()
{
int ret;
fd = open(path, O_RDWR... |
/*
一張圖上每條邊都有權重,最小平均值環是「權重除以邊數」最小的環,可能有許多只。
最小平均值環也可以視作是最小比率環的特例,當每條邊的第二組權重都等於 1 的時候。
令V為圖上的所有點構成的集合,n為圖上的點數。
圖上任意取一個點作為起點,d(k, i)為起點走k條邊到達i的最短路徑。
d(n, i) - d(k, i)
平均權重 = min max ─────────────────
i∊V 0≤k≤n-1 n - k
如果圖上有不連通的部分,可以使用最短路徑 Johnson's Algorithm 所提到... |
#ifndef AMVK_SWAPCHAIN_MANAGER_H
#define AMVK_SWAPCHAIN_MANAGER_H
#include "vulkan.h"
#ifndef __ANDROID__
#include <GLFW/glfw3.h>
#endif
#include <vector>
#include <array>
#include "state.h"
#include "vulkan_utils.h"
#include "image_helper.h"
#include "window.h"
#include "tquad.h"
class SwapchainManager {
public:
... |
#ifndef branching_h
#define branching_h
#include <chuffed/core/engine.h>
#include <chuffed/support/misc.h>
#include <cassert>
#include <climits>
#include <cstdio>
//-----
enum VarBranch {
VAR_DEFAULT, // autonomous search
VAR_INORDER, // inorder
VAR_SIZE_MIN, // smallest domain
VAR_SIZE_M... |
#include <math.h>
#include "Eigen/Dense"
#include <random>
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
using namespace Eigen;
class PCA {
private:
double total_eig = 0;
int features;
public:
MatrixXd Eigen_Vectors;
MatrixXd Basis;
double *Eigen_Values;
PCA() { }
void get_eigen(MatrixXd);
v... |
/************************************************************************
* @project : sloth
* @class : FontShader
* @version : v1.0.0
* @description : 和字体着色器的 uniform 变量相对应,用于修改着色器变量
* @author : Oscar Shen
* @creat : 2017年2月28日09:55:18
* @revise :
*********************************************... |
#include "Player.h"
Player::Player() {
movingDown = true;
head = new Cube(241.0f / 255.0f, 194.0f / 255.0f, 125.0f / 255.0f);
body = new Cube(1.0f, 0.0f, 0.0f);
leftLeg = new Cube(241.0f / 255.0f, 194.0f / 255.0f, 125.0f / 255.0f);
rightLeg = new Cube(241.0f / 255.0f, 194.0f / 255.0f, 125.0f / 255... |
/*
* Stopping Times
* Copyright (C) Leonardo Marchetti 2011 <leonardomarchetti@gmail.com>
*/
#include <sstream>
#include <cstdio>
#include <string>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include "test-maximizer.h"
#include "maximizer.h"
#include "logger.h"
#include "test-poly.h"
using namespace std... |
/**
* @file robot_battery.cc
*
* @copyright 2017 3081 Staff, All rights reserved.
*
* @author Zijing Mo <zijingmo888@gmail.com>
*/
/*******************************************************************************
* Includes
******************************************************************************/
#includ... |
#ifndef RANDAM_H
#define RANDAM_H
#include <random>
namespace gnGame {
namespace Randam {
namespace {
std::random_device rDevice{};
std::mt19937 mt{ rDevice() };
}
int getRandomRange(int _min, int _max) {
std::uniform_int_distribution<> dist(_min, _max);
return dist(mt);
}
}
}
#endif // !RAN... |
#include <iostream>
#include <map>
using namespace std;
int main()
{
int a[] = {1,9,2,-9, -2, -1, -1};
map<int, int> dic;
int sum = 0;
for(int i = 0; i < 4; i++)
{
sum += a[i];
if(dic[sum] != 0 || sum == 0) {
cout << dic[sum] << " " << i << endl;
break;
... |
#include "Spaceship.h"
#include <cstdio>
#include <cmath>
Spaceship::Spaceship(SDL_Rect *r, SDL_Surface *s,double x,double y, double a,double sp,SDL_Color *c=NULL):
DynamicGameObject(r,s,x,y,a,sp)
{
health = 500*rect->h;
damage = 1*rect->h;
if (c==NULL)
{
color = new SDL_Color;
color->r=color->g=color->b = 127... |
//
// Created by heyhey on 20/03/2018.
//
#include "Break.h"
Break::Break() {}
Break::~Break() {
}
std::ostream &operator<<(std::ostream &os, const Break &aBreak) {
os << static_cast<const Instruction &>(aBreak);
os << std::endl;
return os;
}
|
#include "x_pch.h"
#include "x/x_opengles2.h"
#include <GLES3/gl3.h>
#include <GLES3/gl3ext.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <EGL/eglplatform.h>
#define STRING(s) #s
namespace x
{
GLuint CompileShader(GLenum type, const char* source)
{
GLuint shader = glCreateShader(type);
const c... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define show(x) for(auto i: x){cout << i << " ";}
typedef long long ll;
typedef pair<int, int> P;
#define INF 1000000000
int maze[22][22] = {0};
int maze_cnt[22][22] = {0};
int h, w;
int bfs(int x, ... |
#include <iostream>
#include "PlayerState.h"
#include "Player.h"
#include "Event.h"
#include "EventDispatcher.h"
using namespace std;
//HomeState
void HomeState::Enter()
{
cout << "플레이어가 집의 문을 엽니다." << endl;
}
void HomeState::Execute(Player* player)
{
cout << endl << "플레이어 상태: 집" << endl << endl;
int rand_val = r... |
#include "drag_widget.h"
#include <QLabel>
#include <QVBoxLayout>
#include "drag_pixmap.h"
#include <QMouseEvent>
#include <QDrag>
#include <QMimeData>
#include <QPushButton>
#include <QDebug>
#include "item/machining.h"
#include <QPixmap>
#include <QPainter>
#include "item/maker.hpp"
#include <QStyleOption>
struct i... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2011 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef SECURITY_CROSS_ORIGIN_H
#define SECURITY_CROSS_ORIGIN_H
#ifde... |
/*This file is auto generate by dlib/dbus/proxyer. Don't edit it*/
#include <libintl.h>
#include <QtCore>
#include <qdebug.h>
#ifndef __LOCALE_H__
#define __LOCALE_H__
class DLocale: public QObject
{
Q_OBJECT
public:
//LC_ALL for all of the locale.
//LC_COLLATE
//for regular expression ma... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "OtherFloatingActor.generated.h"
UCLASS()
class QUICKSTART_API AOtherFloatingActor : public AActor
{
GENERATED_BODY()
public:
// Sets defau... |
int potPosition; //this variable will hold a value based on the position of the potentiometer
int pushButton = 4; //button
// the setup routine runs once when you press reset:
void setup()
{
Serial.begin(9600); //start a serial connection with the computer
pinMode(13, OUTPUT); //set pin 13 as... |
#include "mainwindow.h"
#include <QApplication>
#include <QSplashScreen>
#include <QFile>
#include <windows.h>
int main(int argc, char *argv[])
{
// 主程序
QApplication a(argc, argv);
a.setFont(QFont("华文新魏", 9)); // 设置字体为华文新魏9号字
// 应用QSplashScreen实现启动加载动画
QImage image(":/splash/splas... |
#include <iostream>
#include<string>
int main() {
int hh = 0;
int mm = 0;
int result = 0;
int n = 808;
if (n >= 60)
{
hh = n / 60;
mm = n%60;
}
else
{
hh = 0;
mm =n;
}
std::cout << hh << ":" << mm << "-->";
result = hh/10+ hh%10+mm/10+mm%10;
std::cout << result << std::endl;
... |
#ifndef SG_RelayHandler_H
#define SG_RelayHandler_H
#pragma once
#include <boost/smart_ptr/shared_ptr.hpp>
#include "Networking/General/SG_ClientSession.h"
#include "Packets/Relay/RelayPackets.h"
class SG_RelayHandler
{
public:
static void HandleLogin(const boost::shared_ptr<SG_ClientSession> Session, const NM_SC_LOG... |
#include <string>
#include <new>
#include <util/config.h>
#include <util/options.h>
#include <goto-programs/read_goto_binary.h>
#include <goto-programs/goto_convert_functions.h>
#include <goto-programs/link_to_library.h>
#include <goto-programs/remove_function_pointers.h>
#include <goto-programs/goto_check.h>
#includ... |
#include "DesPasswordCipher.h"
#include <openssl/des.h>
#include <string.h>
DesPasswordCipher::DesPasswordCipher(const char *password)
: keySchedule(new DES_key_schedule)
{
if (password)
init(password);
}
DesPasswordCipher::~DesPasswordCipher() {
delete static_cast<DES_key_schedule*>(keySchedule);
}
void DesPas... |
#ifndef SDUZH_REACTOR_NET_CONNECTOR_H
#define SDUZH_REACTOR_NET_CONNECTOR_H
#include <functional>
#include <memory>
#include <reactor/net/Channel.h>
#include <reactor/net/InetAddress.h>
#include <reactor/net/TcpSocket.h>
#include <reactor/net/TimerId.h>
namespace reactor {
namespace net {
class Connector {
public:
... |
//
// Created by goturak on 06/03/19.
//
#include "Multiplication.h"
int Multiplication::apply(int i1, int i2) {
return i1*i2;
}
|
/*
Copyright (c) 2014 Mircea Daniel Ispas
This file is part of "Push Game Engine" released under zlib license
For conditions of distribution and use, see copyright notice in Push.hpp
*/
#pragma once
#include "Core/Singleton.hpp"
#include "Math/Rectangle.hpp"
#include "Render/Camera.hpp"
#include "Render/Shader.hpp"
... |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "10783"
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
int main(int argc, char const *argv[])
{
#ifdef DBG
freopen("uva" PROBLEM TESTC ".in", "r", stdin);
freopen("uva" PROBLEM ".out", "w", stdout);
#endif
int sum[105... |
#include <stdlib.h>
#include <unistd.h>
#include <RF24/RPi/RF24/RF24.h>
using namespace std;
RF24 radio(RPI_V2_GPIO_P1_22, RPI_V2_GPIO_P1_15, BCM2835_SPI_SPEED_8MHZ);
const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };
void setup(void){
//Prepare the radio module
radio.begin();
radio.setRetries(... |
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <math.h>
#include <locale.h>
#include <ctype.h>
int ladoa=0;
int ladob=0;
int area=0;
int x=0;
int main()
{
printf(" \n Digite a medida da base do retangulo:\n");
scanf("%d",&ladoa);
... |
//就想找一道简单的凑购array的20道题 然后选中了这道
//果然直接想出思路,然后电脑上敲,然后accept了 不超过10分钟吧
//而且只有一个漏掉的分号的语法错误 牛逼
// 3MS 36.74%
class Solution {
public:
int findMin(vector<int>& nums) {
if(nums.size()==1){
return nums[0];
}
int i = 1;
for(;i<nums.size()&&nums[i]>nums[i-1];++i);
if(i==nums.size()){
return n... |
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/cudaarithm.hpp>
#include <opencv2/video/tracking.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/features2d.hpp>
#inc... |
/* -*- 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.
*/
#ifndef OPDESKTOPPRODUCT_H
#define OPDESKTOPPRODUCT_H
class Opera... |
////////////////////////////////////////////////////////////////////////////////
//
// (C) Andy Thomason 2012-2014
//
// Modular Framework for OpenGLES2 rendering on multiple platforms.
//
namespace octet {
/// Scene containing a box with octet.
class example_fps : public app {
// scene for drawing box
ref<... |
#include <stdio.h>
#include <conio.h>
#include <stdlib.h> //system("cls"); system("pause");
#include <string.h>
//in calitate de marfa sa luat telefoanele mobile
typedef struct{
char marca[30]; //marca
char model[30]; //modelul
char os[20]; //sistemul de operare
int anu; //anul fabricarii
float pret; ... |
#include <Arduino.h>
#include "FastLED.h"
//FastLED definitions
//////
#define NUM_LEDS 10 //Number of LEDs in your strip
#define DATA_PIN 5
CRGB leds[NUM_LEDS];
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"
//MP3 definitions
//////
SoftwareSerial mySerial(10,11); //Define serial on pin 10 and 11
... |
#include "pch.hpp"
#include "client.hpp"
using yama::client;
using yama::window_handle;
class yama::client::impl_t {
public:
using window_ptr = std::unique_ptr<SDL_Window, decltype(&SDL_DestroyWindow)>;
static window_ptr create_window() {
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
BK_ABORT_TODO... |
#include "Player.h"
class Board{
private:
char board[3][3][3];
Player* playerList[2];
int noOfPlayers = 0;
int moveCounter = 0;
public:
Board();
virtual ~Board();
void notifyObservers();
void resetBoard();
void attachPlayer(Player &player);
void detachPlayer(Player &player);
void drawBoard();
... |
#include<bits/stdc++.h>
using namespace std;
long long d[2000000],num[2000000],cost[2000000],sum1[2000000],sum2[2000000],f[2000000],ans;
int q[2000000],n;
void readit(){
scanf("%d",&n);
for (int i=1;i<=n;i++)
scanf("%lld%lld%lld",d+i,num+i,cost+i);
}
void writeit(){
printf("%lld\n",ans);
}
inline doubl... |
// Created on: 1994-10-03
// Created by: Christian CAILLET
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2013 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
**
*/
#ifndef OPERA_PROCESS_UTILS_H
#define OPERA_PROCESS_UTILS_H... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
*
* Copyright (C) 1995-2012 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#include "modul... |
#pragma once
#include <d3d11.h>
#include <wrl/client.h>
#include "Vertex.h"
class Mesh
{
public:
Mesh(Vertex* vertArray, int numVerts, unsigned int* indexArray, int numIndices, Microsoft::WRL::ComPtr<ID3D11Device> device);
Mesh(const char* objFile, Microsoft::WRL::ComPtr<ID3D11Device> device);
~Mesh(void);
Mic... |
#include<iostream>
#include<vector>
#include<cstdio>
#include<cstring>
using namespace std;
int n,m,v[223];
vector<int>son[223];
int dp[223][223];
void dfs(int n,int m){ //树状dp n为父节点,m为背包容量V。
int i,j,k,V,len=son[n].size();
dp[n][1]=v[n];
for(int i=0;i<len;i++) //对每一组背包进行遍历
{
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2009 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_system_includes.h"
#ifdef VEGA_BACKEND_DIR... |
/***************************************************************************
This is a library for the BME680 gas, humidity, temperature & pressure sensor
Designed specifically to work with the Adafruit BME680 Breakout
----> http://www.adafruit.com/products/3660
These sensors use I2C or SPI to communica... |
// // ================nの階乗==================
// // #include <stdafx.h>
// #include <iostream>
// using namespace std;
// int main()
// {
// int n;
// long result=1;
// cout << "Please enter a number : ";
// cin >> n;
// //Calculating Factorial
// cout << n << "! = ";
// for(int i=1; i... |
#pragma once
#include "Commonheader.h"
#include "ShapePoints.h"
//頂点クラスを継承して面情報を管理するクラス
class ShapeTriangle:public ShapePoints
{
//頂点の法線ベクトル
Buffer<GLfloat[3]> normal;
void LoadNormal(GLuint nv, const GLfloat(*norm)[3], GLenum usage){
//頂点法線の設定
normal.Load(GL_ARRAY_BUFFER, nv, norm, usage);
//indexの設定
gl... |
#pragma once
#ifdef __APPLE__
#include <SDL/SDL.h>
#else
#include <SDL.h>
#endif
#include <vector>
#include "Math.h"
#include "core/Structures.h"
namespace gfx {
SDL_Color getPixel (int x, int y, int width, int height, SDL_Surface* screen);
void setPixel(int x, int y, Uint8 R, Uint8 G, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.