text stringlengths 8 6.88M |
|---|
#pragma once
#include "ExampleBase.h"
class CreateGLContext : public ExampleBase
{
public:
void initGLData() {
// 面剔除需要手动开启
glEnable(GL_CULL_FACE);
glCullFace(GL_FRONT);
glFrontFace(GL_CCW);
glViewport(0, 0, WINDOW_WIDTH - 100, WINDOW_HEIGHT - 100);
}
void renderLoop() {
glClearColor(0.3f, 0.3... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
/*
* validatorTests.cpp
*
* Created on: 19. 12. 2016
* Author: ondra
*/
#include <iostream>
#include <fstream>
#include "testClass.h"
#include "../imtjson/validator.h"
#include "../imtjson/object.h"
#include "../imtjson/string.h"
using namespace json;
void ok(std::ostream &out, bool res) {
if (res) out ... |
#ifndef TENSOR_vec2_INCLUDED
#define TENSOR_vec2_INCLUDED
#include <iostream>
using namespace std;
struct vec2 {
float x, y;
vec2();
vec2(float);
vec2(float, float);
vec2& operator+=(const vec2&);
vec2& operator-=(const vec2&);
vec2& operator*=(const float);
vec2& operator/=(const float);
vec2 operator-();
... |
//
// Created by 송지원 on 2019-12-06.
//
#include "iostream"
using namespace std;
int main() {
int N;
int D[31];
cin >> N;
D[0] = 1;
D[1] = 0;
D[2] = 3;
D[3] = 0;
D[4] = 3*3 + 2*1;
if (N%2 == 1) {
cout<< 0 << endl;
return 0;
}
if (N <= 4) {
cout <<... |
#ifndef PLAYER_H_
#define PLAYER_H_
class Player
{
public:
Player();
virtual ~Player();
};
#endif
|
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
bool isMatch(string s, string p) {
//简化版:动态规划
vector<vector<bool>> dp(s.size()+1,vector<bool>(p.size()+1,false));
dp[0][0]=true;
for(int i=1;i<=p.size();i++)
{
if(p[i-1]=='*')
dp[0][i]=true;
else
break;
}
for(... |
/*
* Vector.cpp
*
* Created on: 05-Apr-2015
* Author: kishor
*/
#include "Vector.h"
template <class Object>
Vector<Object>::Vector(int size) {
m_data = new Object[size];
m_capacity = size;
m_size = 0;
}
template <class Object>
void Vector<Object>::push_back(Object val) {
m_data[m_size] = val;
m_size+... |
#ifndef E_FVEC2
#define E_FVEC2
#include "types.hpp"
class fvec2{
public:
sreal x, y;
public:
fvec2(){}
fvec2(sreal x, sreal y) : x(x), y(y){}
sreal length() const;
};
bool operator!=(fvec2 m, fvec2 n);
bool operator<(fvec2 m, fvec2 n);
fvec2 operator-(fvec2 a, fvec2 b);
fvec2 intersection(fvec2 a, fvec2 b, fve... |
//
// Created by yus on 03.05.2020.
//
#ifndef LINAL_MATRIX_H
#define LINAL_MATRIX_H
#include <iostream>
#include <vector>
class Matrix
{
private:
int n;
int m;
std::vector<std::vector<double>> value;
public:
Matrix(int n, int m);
Matrix(std::vector <std::vector<double>> value);
~Matrix();
... |
#include "../headers/BlockNode.hpp"
#include <string>
#include <sstream>
BlockNode::BlockNode() = default;
Node *BlockNode::getLastField() {
if (!s.empty())
return s.at(s.size() - 1);
return nullptr;
}
void BlockNode::addNode(Node *node) {
s.push_back(node);
type = node->getType();
}
void Bl... |
#include "Personne.hpp"
namespace enseirb{
Personne::Personne():_nom(""){}
Personne::Personne(const Chaine &c):
_nom(c) {printf("%s (%d): %s\n", __FILE__,__LINE__,__func__);}
Personne::Personne(const Personne &P):
_nom(P.nom()) {printf("%s (%d): %s\n", __FILE__,__LINE__,__func__);}
Chaine Person... |
//
// AbsWordStats.cpp
// TopFrequent
//
// Created by Steven on 20/5/18.
// Copyright © 2018 tengx. All rights reserved.
//
#include "AbsWordStats.hpp"
|
module Color = {
let color_enabled = lazy(Unix.isatty(Unix.stdout));
let forceColor = ref(false);
let get_color_enabled = () => {
forceColor^ || Lazy.force(color_enabled);
};
type color =
| Red
| Yellow
| Magenta
| Cyan;
type style =
| FG(color)
| Bold
| Dim;
let code_o... |
#include <cstdio>
#include <iostream>
using namespace std;
#include <boost/bimap.hpp>
#include <boost/flyweight.hpp>
using namespace boost;
typedef uint32_t key;
struct User {
User(const string& first_name, const string& last_name)
: first_name{add(first_name)}, last_name{add(last_name)} {}
const string... |
#pragma once
#include "Image.hpp"
#include <iostream>
#include <unistd.h>
#include <fstream>
using std::ofstream;
using std::ifstream;
#pragma pack(push, 1)
typedef int LONG; // 4 Byte
typedef unsigned short WORD; // 2 Byte
typedef unsigned DWORD; // 4 Byte
typedef struct tagBITMAPFILEHEAD... |
#include <opencv2/photo.hpp>
#include "opencv2/imgcodecs.hpp"
#include <opencv2/highgui.hpp>
#include <vector>
#include <iostream>
#include <fstream>
using namespace cv;
using namespace std;
void loadExposureSeq(String, vector<Mat>&, vector<float>&);
int main(int, char**argv)
{
vector<Mat> images;
vector<flo... |
#include<stdio.h>
int main()
{
float a,b;
scanf_s("%f",&a);
if(a>=30)
{
b=(a-32)*5/9;
printf("%.2f f = %.2f c",a,b);
}
else
{
printf("Too cold to live");
}
return 0;
}
|
#include "gtest/gtest.h"
#include <sstream>
#include <boost/scoped_ptr.hpp>
#include "wali/domains/matrix/Matrix.hpp"
#include "fixtures-minplus-matrix.hpp"
#include "matrix-equal.hpp"
using namespace testing::minplus_matrix;
namespace wali {
namespace domains {
TEST(wali$domains$matrix$MinPlusIntMatrix$$construc... |
#include "Draw.h"
void CDraw::ReloadFonts()
{
g_Fonts[EFonts::DEBUG] = { "Verdana", 16, FONTFLAG_OUTLINE };
for (auto &v : g_Fonts)
I::Surface->SetFontGlyphSet(v.second.m_dwFont = I::Surface->CreateFont(), v.second.m_szName, v.second.m_nTall, 0, 0, 0, v.second.m_nFlags);
}
void CDraw::UpdateScreenSize()
{
m_nSc... |
#include<bits/stdc++.h>
using namespace std;
main()
{
int n, m;
while(cin>>n>>m)
{
double ans1, ans, a, b;
cin>>a>>b;
ans1=(a/b)*m;
for(int i=1; i<n; i++)
{
cin>>a>>b;
ans = (a/b)*m;
if(ans1>ans) ans1=ans;
}
printf("... |
#ifdef CURSES_HAS_PRAGMA_ONCE
#pragma once
#endif
#ifndef __CURSES_NONCOPYABLE_HPP_INCLUDED__
#define __CURSES_NONCOPYABLE_HPP_INCLUDED__
#include "config.hpp"
/// Macro for hide/delete the private constructor and assign operator
#ifdef CURSES_HAS_CPP11
# define CURSES_MOVABLE_BUT_NOT_COPYABLE(__CLASS) \
__CLASS(... |
// Created on: 1994-12-21
// 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 ... |
#ifndef CAPP_TEST_H
#define CAPP_TEST_H
#include <iostream>
#include <mutex>
#include <thread>
using namespace std;
class Data {
private:
int data;
int datas[2];//if int datas[]; undertermined on value init
public:
//Data(int a);
static volatile int s;
void proc(recursive_mutex& mtx, in... |
#include<cstdio>
using namespace std;
int main(){
//input
int a,b;
scanf("%d %d",&a,&b);
//output
int i,j;
for(i=a,j=1;i<=b;++i,++j){
printf("%5d",i);
if(j%5==0){
printf("\n");
}
}
if(j%5!=1){
printf("\n");
}
int sum = 0;
if(a>=0)... |
#include <stdio.h>
#include <iostream>
using namespace std;
int fun(int now, int m) {
if(now == 1)
return m;
else
return 2 * (fun(now - 1, m) + 1);
}
int main() {
int x, y, z;
while (~scanf("%d %d %d", &x, &y, &z)) {
int sum;
sum = (z) * fun(x, y);
printf("%d\n", sum);
}
return 0;
}
|
class equip_aa_battery : CA_Magazine
{
scope = 2;
count = 1;
displayName = $STR_ITEM_NAME_equip_aa_battery;
descriptionShort = $STR_ITEM_DESC_equip_aa_battery;
model = "\z\addons\dayz_epoch_w\magazine\dze_aa_battery.p3d";
picture = "\z\addons\dayz_communityassets\pictures\equip_aa_battery_ca.paa";
type = 256;
}... |
// Copyright (c) 2013 Nick Porcino, All rights reserved.
// License is MIT: http://opensource.org/licenses/MIT
#pragma once
#include <vector>
#include "LandruVM/VarObj.h"
namespace Landru
{
class Exemplar;
class Fiber;
struct MachineCacheEntry
{
MachineCacheEntry(std::unique_ptr<Exemp... |
#include "ParamConfig.h"
#include <iostream>
using namespace std;
#include <TDirectory.h>
#include <TParameter.h>
ParamConfig *ParamConfig::params = NULL;
ParamConfig::ParamConfig(TString conffile) : TEnv(conffile)
{
cout << "load parameters ... " << conffile << endl;
}
template <class T>
void ParamConfig::Sav... |
//====C++
#include <iostream>
#include <fstream>
#include <vector>
//===ROOT
#include "TLorentzVector.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TProfile.h"
#include "TProfile2D.h"
#include "TF1.h"
#include "TList.h"
#include "TFile.h"
#include "TTree.h"
#include "TString.h"
#include "TMath.h"
#include "TRandom3.... |
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
using namespace std;
class Solution {
public:
bool canPartition(vector<int>& nums) {
//基本思想:动态规划,01背包问题,用递归回溯必超时
int sum=accumulate(nums.begin(),nums.end(),0);
if(sum&1) return false;
//dp[i]表示能否填满容量为i的背包
... |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "11541"
#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 kase;
... |
#include <SoftwareSerial.h> // Inclui Biblioteca
SoftwareSerial mySerial(10, 11); // Simula RX e TX em outras portas
const int ordemServico = 2;
int buttonA = 4;
int buttonB = 5;
int buttonC = 6;
int buttonD = 7;
int ledPin = 13;
void setup() {
Serial.begin(9600); // Taxa de transferência ... |
void printdata(void)
{
/*
* This function:
* 1. Prints data generated by IMU handling functions. It is a function for testing.
*/
SerialUSB.print("!");
#if PRINT_EULER == 1
SerialUSB.print("ANG:");
SerialUSB.print(ToDeg(roll));
SerialUSB.print(",");
SerialUSB.print(T... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 1995-2012 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef WINDOWSOPASYNCICONLOADER_H
... |
#pragma once
#include "ExampleBase.h"
#include <cmath>
class UseTexture : public ExampleBase
{
private:
GLuint vao;
GLuint textures[2];
Shader *shader;
GLfloat factor = 0.5f;
public:
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) {
__super::key_callback(window, key, scan... |
#pragma once
#include <SFML\System\Vector2.hpp>
#include <SFML\Graphics\Rect.hpp>
#include <string>
#include <cinttypes>
class PhysicsEngine;
using namespace sf;
class Collisionable
{
friend class PhysicsEngine;
public:
Collisionable();
std::string tag;
uint64_t id;
bool isTrigger;
virtual Vector2f GetVelo... |
ifndef MINE_H
#define MINE_H
/*class mine
{
public:
mine(int nval = 9);
bool getChecked();
int getVal();
void setVal(int newVal);
void setChecked();
private:
int val;
bool checked = false;
};
class cords {
public:
int getX();
int getY();
void setX(int X);
void setY(int Y)... |
/*
You are given N, and for a given N x N chessboard, find a way to place N queens such that no queen can attack any other queen on the chess board.
A queen can be killed when it lies in the same row, or same column, or the same diagonal of any of the other queens. You have to print all such configurations.
Input Form... |
#include "AnimSpriteComponent.h"
#include "Math.h"
AnimSpriteComponent::AnimSpriteComponent(Actor* owner, int drawOrder) :
SpriteComponent(owner, drawOrder),
mCurrFrame(0.0f),
mAnimFPS(24.0f),
mLoop(true)
{
}
void AnimSpriteComponent::Update(float deltaTime) {
SpriteComponent::Update(deltaTime);
if (mAnimTextu... |
#include "msg_0x6c_encnahtitem_stc.h"
namespace MC
{
namespace Protocol
{
namespace Msg
{
EncnahtItem::EncnahtItem()
{
_pf_packetId = static_cast<int8_t>(0x6C);
_pf_initialized = false;
}
EncnahtItem::EncnahtItem(int8_t _windowId, int8_t _enchantment)
: _pf_windowId(_windowId)
, _pf_enchantment(_enchantment)
{
... |
#include "rplidar.h"
|
#include "GamePch.h"
#include "BossAgent.h"
#include "GameMessage.h"
IMPLEMENT_GAME_COMPONENT_TYPEID(BossAgent)
void BossAgent::Start()
{
m_health = GetEntity()->GetComponent<Health>();
m_Bar = hg::Entity::FindByName(SID(Boss_Indicator_Bar));
}
void BossAgent::Update()
{
if (hg::g_Time.GetTimeScale() != 0)
{
fl... |
#include "stdafx.h"
#include "CartoonScene.h"
#include "ZeroSceneManager.h"
#include "MenuScene.h"
#include <conio.h>
CartoonScene::CartoonScene() : index(1)
{
page1 = new ZeroSprite("Resource/UI/Menu/Cartoon/cartoon_1.png");
page2 = new ZeroSprite("Resource/UI/Menu/Cartoon/cartoon_2.png");
page3 = new ZeroSprite... |
#include "Functions.h"
class Implementation : public Interface
{
void Method() {}
};
DECL(void) GetInterfaces(int numInstances, Interface** results)
{
for (int i = 0; i < numInstances; ++i)
{
results[i] = new Implementation();
}
}
DECL(void) GetInterfacesOptional(int numInstances, Interface**... |
#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 <signal.h>
using namespace std;
#define PROCESS_COUNT "prc_cnt"
#define DIRECTORY "dir"... |
#include "medicalej.h"
medicalej::medicalej()
{
}
|
#pragma once
#include "Rect.h"
class Chickens :
public Rect
{
protected:
bool pos;
GLuint nextChange;
public:
bool anotherLife;
Chickens();
Chickens(string);
virtual void Update(GLfloat deltaTime);
void Attack();
~Chickens();
};
|
//$$---- Form HDR ----
//---------------------------------------------------------------------------
#ifndef experimentNotesH
#define experimentNotesH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <... |
//
// Created by fab on 31/05/2020.
//
#ifndef DUMBERENGINE_VERTEX_HPP
#define DUMBERENGINE_VERTEX_HPP
#include <glm/glm.hpp>
#include <cereal/archives/portable_binary.hpp>
struct Vertex {
glm::vec3 Position;
glm::vec3 Normal;
glm::vec2 TexCoords;
template<class Archive>
void serialize(Archive& ... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
int main(){
int minInd, maxInd, numValid = 0, letterCount;
char letter;
char password[100];
while(scanf("%d-%d %c: %s", &minInd, &maxInd, &letter, password) > 0){
if((password[minInd - 1] == l... |
#ifndef GNSMELEMENT_H
#define GNSMELEMENT_H
GnSmartPointer(Gn2DMeshObject);
class GNMESH_ENTRY Gn2DMeshObject : public GnObjectForm
{
GnDeclareRTTI;
GnDeclareFlags( guint16 );
GnDeclareStream;
public:
enum eSMFlag
{
VISIBLE_MASK = 0x0001,
};
protected:
Gn2DMeshObject* mpParent;
GnReal2DMes... |
#include <iostream>
#include <fstream>
#include <string>
#include<streambuf>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <time.h>
#include <vector>
#include "base64.cpp" //Base64 Library (written by René Nyffenegger)
#include "EncryptClass.cpp"
#include "DecryptClass.cpp"
using namespace std;
//... |
#ifndef TABLERO_H_
#define TABLERO_H_
#include "casillero.h"
#define ANCHO 3
#define ALTO 3
typedef struct{
Casillero *** casilleros;
int ancho;
int alto;
} Tablero;
Tablero * inicializarTablero();
void imprimirTablero(Tablero * tablero, std::string archivoSalida);
void destruirTablero(Tablero *... |
#include <codecvt>
#include "fakeit.hpp"
// Matcher for wchar_t* and std::wstring
template<typename T>
struct EqSTRCreator : public fakeit::TypedMatcherCreator<T> {
const std::wstring expected;
virtual ~EqSTRCreator() = default;
EqSTRCreator(const std::wstring &expected)
: fakeit::TypedMat... |
#include <iostream>
#include "string.hpp"
String fun(){
String a;
std::cout << "a-num:\t" << a.getNum() << std::endl;
return a;
}
int main() {
String str1;
String str2 = str1;
str1.setNum(90);
std::cout << "Num:\t" << str1.getNum() << std::endl;
std::cout << "Num:\t" << str2.getNum() << st... |
#include <NewPing.h>
#include <TridentTD_LineNotify.h>
#include <BlynkSimpleEsp8266.h>
#include <DHT.h>
#include <Adafruit_Sensor.h>
#define SONAR_NUM 5
#define MAX_DISTANCE 100
#define DHTPIN D8
#define DHTTYPE DHT22
NewPing sonar[SONAR_NUM] = { // Sensor object array.
NewPing(D1, D1, MAX_DISTANC... |
#include <iostream>
#include "polynomials.h"
#include <ctype.h> // isdigit()
#include <sstream> // stringstream
using namespace std;
void Wx::isFloat(string &s, float &f, int iI)
{
int isFlt=0;
int decimalCount=0;
int stringZero=0;
bool isFltBool=false;
bool containsSpaces = false;
do
{
... |
//
// main.cpp
// fraction-to-recurring-decimal
//
// Created by xiedeping01 on 15/11/12.
// Copyright (c) 2015年 xiedeping01. All rights reserved.
//
#include <iostream>
#include <limits>
#include <unordered_map>
using namespace std;
class Solution {
public:
string fractionToDecimal(int numerator, int denomi... |
#include "Tick.hh"
#include "umlrtinsignal.hh"
#include "umlrtobjectclass.hh"
#include "umlrtoutsignal.hh"
struct UMLRTCommsPort;
static UMLRTObject_field fields_tick[] =
{
#ifdef NEED_NON_FLEXIBLE_ARRAY
{
0,
0,
0,
0,
0
}
#endif
};
static UMLRTObject payload_... |
#include <cstdio>
#include <sstream>
#include <iostream>
#include <cmath>
#include <math.h>
#include <stdlib.h>
#include <ctime>
#ifdef __APPLE__
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
# include <GLUT/glut.h>
#else
# include <GL/glut.h>
#endif
using namespace std;
// // Rotation consta... |
/*
* SpaceShip.cpp
*
* Created on: Dec 2, 2017
* Author: ryanw
*/
#include "Spaceship.hpp"
Spaceship::Spaceship() {
vector<Point*> cp;
cp.push_back(new Point(3,0,0));
cp.push_back(new Point(1.5,1,0));
cp.push_back(new Point(0,0,0));
body = new BezierCurve(cp, 50,370,2);
body->setDrawin... |
#ifndef CFG_OTHER
# error "This source should only be compiled in a non-Debug configuration."
#endif
#ifdef CFG_DEBUG
# error "This source should not be compiled in a Debug configuration."
#endif
#include "iface.h"
int iface_other()
{
return 0;
}
|
#if !defined(ERROR_HPP)
#define ERROR_HPP
#include "HttpResponse.hpp"
class Error : public HttpResponse
{
public:
Error(ResponseContext&, BufferChain&, int);
~Error();
void handleRead(BufferChain& readChain, BufferChain& writeChain);
};
class HeadersError : public HttpResponse
{
public:
HeadersError(ResponseCon... |
#include <hpx/hpx_fwd.hpp>
#include <hpx/runtime/components/server/managed_component_base.hpp>
#include <hpx/runtime/components/server/locking_hook.hpp>
#include <hpx/runtime/actions/component_action.hpp>
#include "../lib/glm/glm.hpp"
#include "table.h"
struct serialVec {
float x;
float y;
float z;
private:
... |
#include "server.h"
using namespace std;
void run_thread() {
while(1) {
int client = Server::clientqueue.pop();
// cout << "popping off: " << client << endl;
Worker worker(client);
worker.handle_client();
close(client);
}
}
Mailbox
Server::mailbox;
ClientQueue
Serve... |
#pragma once
#include <pcl/io/pcd_io.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
class DepthFrame
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
DepthFrame(const double ×tamp, const pcl::PointCloud<pcl::PointXYZ>::Ptr &point_cloud, const Eigen::Matrix4d &pose);
DepthFrame(const pcl::PointCloud<p... |
/* -*- 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.
**
** Alexander Remen (alexr)
*/
#include "core/pch.h"
#include "Ins... |
/*Heap sort implementation.*/
#include "cc/algo/sorting/heap_sort.h"
#include "cc/shared/generic_array.h"
#include "cc/shared/common.h"
using cc_shared::GenericArray;
namespace cc_algo_sorting {
namespace {
size_t parent_index(size_t index) {
RT_ASSERT_GT(index, 0);
// TODO: Add unit tests for this.
// 1 ->... |
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int f[100010];
int find(int x)
{vector<int> s;
while (x != f[x])
{s.push_back(x);
x = f[x];
}
while (!s.empty())
{f[s.back()] = x;
s.pop_back();
}
return x;
}
int main()
{int n,m;
while (sca... |
#pragma once
#include "CoreMinimal.h"
namespace EMessageBoxButton
{
enum Type
{
MB_Ok = 0b00000001,
MB_Cancel = 0b00000010
};
}
|
#include "gold.h"
Gold::Gold(QObject *parent) : Values(parent)
{}
Gold::Gold(int x, int y, int width, int height, QObject *parent)
: Values(x, y, width, height, ":/images/gold/images/gold/gold.png", 1, parent)
{}
|
#include "Solar.hpp"
#include "CelBody.cpp"
#include "MultiBodySystem.cpp"
#include <fstream>
#include <armadillo>
using namespace std;
using namespace arma;
void makeObject(string&, istringstream&, CelBody*, int&, string, double);
void makeStatSun(CelBody*);
int main(int argc, char const *argv[]){
int steps = s... |
#pragma once
#include <stdint.h>
#include <sys/epoll.h>
#include <mutiplex/callbacks.h>
namespace muti
{
typedef std::function<void(uint64_t)> EventCallback;
class EventLoop;
class EventSource
{
public:
explicit EventSource(int fd, EventLoop* loop)
: state_(StateNoEvent),
loop_(loop),
... |
#include "wiring.c"
// Unit size in milliseconds
#define UNIT 75
void setup() {
Serial.begin(9600);
pinMode(2, OUTPUT);
pinMode(14, OUTPUT);
}
void loop(){
digitalWrite(14, LOW);
morse_string("hello world");
digitalWrite(14, HIGH);
delay_LPM1(2000);
}
// modify the delay function to
void delay_LP... |
#pragma once
#include <boost/filesystem.hpp>
#include <gsl/span>
#include "SphinxModel.h"
namespace PticaGovorun
{
class KaldiModelBuilder
{
struct AssignedPhaseAudioSegmentAndUttId
{
const AssignedPhaseAudioSegment* SegRef;
std::string UttId;
};
boost::filesystem::path outDirPath_;
std::function<au... |
/**
* Copyright (c) 2014, Timothy Stack
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of condi... |
#include <reactor/net/EventLoop.h>
#include <signal.h>
#include <reactor/base/SimpleLogger.h>
#include <reactor/net/Channel.h>
#include <reactor/net/PollPoller.h>
#include <reactor/net/TimerId.h>
#include <reactor/net/TimerQueue.h>
namespace reactor {
namespace net {
namespace {
#pragma GCC diagnostic ignored "-Wol... |
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/crostini/crostini_share_path.h"
#include "base/barrier_closure.h"
#include "base/bind.h"
#include "base/files/file_util... |
#include "Globals.h"
#include "Application.h"
#include "ModuleTextures.h"
#include "ModuleInput.h"
#include "ModuleParticles.h"
#include "ModuleRender.h"
#include "ModuleCollision.h"
#include "ModuleFadeToBlack.h"
#include "ModuleSceneTemple.h"
#include "ModuleAyin.h"
#include "ModuleAyinArrow.h"
#include "ModuleUI.h"
... |
#pragma once
#include "VirtualMemoryChunk.h"
#include <cassert>
namespace keng::memory
{
template<typename T>
class VirtualVector
{
public:
VirtualVector(size_t capacity, size_t resizeValue = 1) :
m_resizeValue(resizeValue),
m_capacity(capacity),
m_memory(m_... |
#include<iostream>
#include<vector>
using namespace std;
bool palindrome(string word){
string dummy="";
int i;
if(word.size()==1){
dummy+=word;
}
for(i=word.size()-1;i>=0;i--){
dummy+=word[i];
}
if(dummy == word){
return true;
}
return false;
}
int main(){
string str;
int len,counter... |
#ifndef SFR_OBJECT_H
#define SFR_OBJECT_H
#include <QObject>
class SFR_Object : public QObject
{
Q_OBJECT
public:
explicit SFR_Object(QObject *parent = 0);
signals:
public slots:
};
#endif // SFR_OBJECT_H
|
#include <stdio.h> // - Just for some ASCII messages
#include "visuals.h" // Header file for our OpenGL functions
#include <time.h>
#include "GL/glut.h"
// - An interface and windows management library
int main(int argc, char* argv[])
{
// initialize GLUT library state
glutInit(&argc, arg... |
#include<iostream>
#include<vector>
#include<algorithm>
#include <unistd.h>
#include<stdio.h>
using namespace std;
struct process {
int pid, at, bt, wt, tt, c;
};
bool compare(process p1, process p2) {
return p1.at < p2.at;
}
void arrange(vector<process> &arr) {
sort(arr.begin(), arr.end(), compare);
}
void... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
// Info taken from these sites:
// http://www.learncpp.com/cpp-tutorial/19-header-files/
// http://www.umich.edu/~eecs381/handouts/CppHeaderFileGuidelines.pdf
// This is start of the header guard.
#ifndef FSTREAM_I
#define FSTREAM_I
#include <fstream>
#endif
#ifndef IOSTREAM_I
#define IOSTREAM_I
#include <iostream>
... |
#include <Wire.h>
#include <ZumoMotors.h>
#include <Pushbutton.h>
#include <ZumoBuzzer.h>
#include <LSM303.h>
ZumoMotors motors;
ZumoBuzzer buzzer;
Pushbutton button(ZUMO_BUTTON);
LSM303 compass;
#define SPEED 120 // default motor speed
float red_G, green_G, blue_G; // RGB values
int zoneNumber_G; // zone... |
#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 "codegen/il2cpp-codegen.h"
#include "il2cpp-object-internals.h"
// Syste... |
#include <VirtualWire.h>
void setup()
{
vw_set_ptt_inverted(true); // Required by the RF module
vw_setup(2000); // bps connection speed
vw_set_tx_pin(3); // Arduino pin to connect the receiver data pin
}
void loop()
{
//Message to send:
const char *msg = "HELLO WORLD";
vw_send((uint8_t *)msg, strlen(msg));
vw... |
//
// main.cpp
// course-schedule
//
// Created by xiedeping01 on 15/11/8.
// Copyright (c) 2015年 xiedeping01. All rights reserved.
//
#include <iostream>
#include <vector>
using namespace std;
class DirectedGraph {
public:
DirectedGraph(int n) : adj(n) {}
void addEdge(int from, int to) {
adj... |
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// Простая программа для запоминания таблицы умножения.
// Simple program for storing multiplication tables.
// V 2.3 beta refactoring
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
#include<iostream>
#i... |
/*
* audio.cpp
*
* Created on: Apr 14, 2012
* Author: edge87
*/
#include <iostream>
#include <SFML/Audio.hpp>
#include "audio.hpp"
sf::SoundBuffer Buffer1;
sf::SoundBuffer Buffer2;
sf::Sound Sound;
void playTest(){
Sound.Stop();
if (!Buffer1.LoadFromFile("/home/teamheck/exec/media/sound/effect/boo... |
#pragma once
/**
* @file
* @copyright (C) 2020 Anton Frolov johnjocoo@gmail.com
*/
#include "FreeRTOS/portable.h"
void* os_raw_alloc(const unsigned int bytes)
{
return pvPortMalloc(bytes);
}
void os_raw_dealloc(void* mem)
{
if (mem == nullptr)
{
return;
}
vPortFree(mem);
}
template... |
/*
* Copyright 2019 LogMeIn
*
* 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 applicable law or agreed to in w... |
#include "Hooks.h"
#include "framework.h"
Hook* instance;
Hook::Hook() {
}
Hook* Hook::getHook() {
if (!instance) {
instance = new Hook();
}
return instance;
}
typedef void(WINAPI* AVKeyItem)(uint64_t key, bool isDown);
AVKeyItem _AVKeyItem;
const char* te = "48 89 5C 24 18 55 56 57 41 54 41 55 41... |
#include <iostream>
#include <stack>
using namespace std;
typedef long long ll;
int n;
ll x = 0, m, cnt;
char c;
stack <int> a;
int main() {
cin >> n;
while(n--) {
cin >> c;
if(c == 'f') {
cin >> m;
if(a.empty()) {
a.push(m);
//printf("m = %lld\n", m);
}
else {
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
**
** Copyright (C) 2007-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#include <stdio.h>
#include <sys/stat.... |
#if OCAML_MINOR >= 8
let attributeTxt = (x: Parsetree.attribute) => x.attr_name.txt;
#else
let attributeTxt = (x: Parsetree.attribute) => fst(x).txt;
#endif
|
/*
* Copyright (c) 2015-2021 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_DETAIL_INPLACE_MERGE_H_
#define CPPSORT_DETAIL_INPLACE_MERGE_H_
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <algorithm>
#include <c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.