text stringlengths 8 6.88M |
|---|
#ifndef SHOC_HASH_SHA1_H
#define SHOC_HASH_SHA1_H
#include "shoc/util.h"
namespace shoc {
struct Sha1 : Eater<Sha1> {
static constexpr size_t SIZE = 20;
static constexpr size_t STATE_SIZE = 5; // In words
static constexpr size_t BLOCK_SIZE = 64; // In bytes
public:
void init();
void... |
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sstream>
#include "ros/ros.h"
#include "sensor_msgs/NavSatFix.h"
//gps conversion tools
#include "./gps_conv.h"
void convert_and_pub(cha... |
class Solution {
public:
bool isPerfectSquare(int num) {
long left = 0;
long right = num;
while(left <= right){
long mid = left + (right-left)/2;
long cur = mid*mid;
if(cur == num){
return true;
}else if(cur > num){
... |
#ifndef BUTTON_H
#define BUTTON_H
#include <QPushButton>
class Button : public QPushButton
{
Q_OBJECT
public:
Button(qint8 keyId, QPushButton *parent = nullptr);
~Button();
qint8 getKeyId() const;
public slots:
void slotEventPressed();
signals:
void signalEventPressed();
private:
qi... |
#include "Snake.h"
const int BODY_SIZE = 32;
using namespace sf;
Snake::Snake()
{
RectangleShape head;
head.setFillColor(Color::Green);
head.setOutlineThickness(-4.f);
head.setOutlineColor(Color::Blue);
head.setSize(Vector2f(BODY_SIZE, BODY_SIZE));
head.setPosition(640 / 2 - BODY_SIZE / 2, 480 / 2 - BODY_SIZE ... |
/*
===========================================================================
Copyright (C) 2017 waYne (CAM)
===========================================================================
*/
#pragma once
#ifndef ELYSIUM_GRAPHICS_GRAPHICSINSTANCE
#define ELYSIUM_GRAPHICS_GRAPHICSINSTANCE
#endif
#ifndef EL... |
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2012-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
// gdcmIO
#include "gdcmIO/writer/DicomSRWriterManager.hpp"
#include "gdcm... |
#include <iostream>
using namespace std;
int main()
{
double tank_volume = 300 * 200 * 100;
int max_cups = 0;
double cup_volume = 0, cup_radius = 0, cup_height = 0;
cout << "Please enter the cup radius in cm" << endl;
cin >> cup_radius;
cout << "Please enter the cup height in cm" << endl;
cin >> cup_height;
... |
#include"Treasure.h"
Treasure::Treasure(int x, int y, char display, std::string type, int numGold) : Item(x, y, display, type)
{
this->numGold = numGold;
}
int Treasure::getNumGold()
{
return this->numGold;
}
GoldPile::GoldPile(int x, int y) : Treasure(x, y, '$', "GoldPile", 10)
{
}
DragonHoard::DragonHoard(int x... |
/*******************************************************************************
The MIT License (MIT)
Copyright (c) 2015 Dmitry "Dima" Korolev <dmitry.korolev@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), ... |
/*!
* @file GeneratorElfX86.hpp
* @brief x86 ELF binary generator
* @author koturn
*/
#ifndef GENERATOR_ELF_X86_HPP
#define GENERATOR_ELF_X86_HPP
#include <iostream>
#include "BinaryGenerator.hpp"
#include "util/elfsubset.h"
/*!
* @brief x86 ELF binary generator
*/
class GeneratorElfX86 : public BinaryGenerat... |
/*
基于先序序列和中序序列重建而建二叉树
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* reConstructBinaryTree(vector<int> pre,vector<int> vin) {
if(pre... |
#include "../../gl_framework.h"
using namespace glmock;
extern "C" {
#undef glEnableVertexAttribArray
void CALL_CONV glEnableVertexAttribArray(GLuint en) {
}
PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray = &glEnableVertexAttribArray;
}
|
#include "basicValues.h"
#include "value.h"
namespace json {
template<typename T>
class AllocOnFirstAccess: public RefCntPtr<IValue> {
public:
AllocOnFirstAccess():RefCntPtr<IValue>(new T) {}
};
template<bool v>
class StaticBool : public BoolValue {
public:
virtual bool getBool() const override { return v; }... |
#pragma once
struct Direction
{
enum Type { NORTH, NORTHWEST, NORTHEAST, SOUTH, SOUTHWEST, SOUTHEAST, EAST, WEST };
Type t_;
Direction(Type t) : t_(t) {}
operator Type () const { return t_; }
private:
//prevent automatic conversion for any other built-in types such as bool, int, etc
template<typename T>
oper... |
// For ECE2031 project
// Written by Michael Reilly
#ifndef CONFIG_HPP
#define CONFIG_HPP
#include <cstdint>
#include <cstdlib>
#include <cstddef>
#include <cstring>
#include <cmath>
#include <tuple>
#include <memory>
#include <functional>
#include <algorithm>
#include <iostream>
#include <initializer_list>
#include ... |
#include <iostream>
#include <cmath>
int convertDec(int num,int mPow,int system, int newNum = 0) {
if(mPow < 0) {
return newNum;
}
std::cout << "num:\t" << num << std::endl;
int include = pow(system,mPow);
std::cout << "Includ:\t" << include << std::endl;
int count = num/inclu... |
/*
Departamento de ComputaŤ‹o
ComputaŤ‹o Gr‡fica 2017.1
Prof: Laurindo de Sousa
Antonio Fabricio Almeida e Silva
Editor Gr‡fico - Trabalho 04
*/
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
// Biblioteca com funcoes matematicas
#include <cmath>
#in... |
#pragma once
class GameCamera2D :public GameObject
{
public:
~GameCamera2D();
bool Start();
void Update();
private:
}; |
// Created on: 1997-01-03
// Created by: Christian CAILLET
// Copyright (c) 1997-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 TOOLS_SHELL_SHELLCONTEXT
#define TOOLS_SHELL_SHELLCONTEXT
#include <map>
#include <string>
#include <boost/utility.hpp>
#include <boost/shared_ptr.hpp>
#include "DB.h"
#include "DBClientProxy.h"
class ShellState;
class ShellContext : private boost::noncopyable {
public:
void changeState(ShellState * pSta... |
#ifndef NETMSGBUS_REQ2RECEIVER_MGR_H
#define NETMSGBUS_REQ2RECEIVER_MGR_H
#include "msgbus_def.h"
#include "NetMsgBusServerConnMgr.hpp"
#include "msgbus_handlerbase.hpp"
#include "condition.hpp"
#include "threadpool.h"
#include "NetMsgBusUtility.hpp"
#include "EventLoopPool.h"
#include "SelectWaiter.h"
#include "Tcp... |
//
// Created by 钟奇龙 on 2019-05-10.
//
#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<vector<int>> getDP(string s){
vector<vector<int>> dp(s.size(),vector<int>(s.size(),0));
for(int j=1; j<s.size(); ++j){
for(int i=0; i<j; ++i){
if(i == j-1){
... |
class Solution {
public:
int search(vector<int>& nums, int target) {
int n = nums.size();
if(!n) return -1;
int low = 0, high = n-1;
while(low < high){
int mid = (low + high)/2;
if(nums[mid] > nums[high]) low = mid+1;
else high = mid;
}
... |
// Wed Aug 24 15:46:50 EDT 2016
// Evan S Weinberg
// Include file for GCR
#ifndef ESW_INVERTER_GCR
#define ESW_INVERTER_GCR
#include <string>
#include <complex>
using std::complex;
#include "inverter_struct.h"
#include "verbosity.h"
// Solves lhs = A^(-1) rhs using generalized conjugate residual
// Makes no assump... |
#ifndef __DXRENDER_H__
#define __DXRENDER_H__
#include "UISprite.h"
class CubeDynamicTeapot;
class Skybox;
class CubeEnvTeapot;
class MyTeapot;
class Water;
class MSDwarf;
class MSPlane;
class MyMesh;
class Light;
class TripleWindMill_Two;
class Windmill;
class Star;
class Shield;
class Tree;
class Object;
class Map;... |
#ifndef _BASE_VECTOR_3
#define _BASE_VECTOR_3
#ifdef _PSP_VER
#include <libgum.h>
#else
#include <D3dx9math.h>
#endif
class BaseVector3
{
protected:
BaseVector3(void) {}
public:
virtual ~BaseVector3(void) {}
public:
#ifdef _PSP_VER
ScePspFVector3& GetVector(void) { return _vec; }
const ScePsp... |
class ItemAPSI_DZE : ItemCore
{
scope = 2;
displayName = $STR_EQUIP_APSI;
picture = "\dayz_epoch_c\icons\tools\ItemAPSI.paa";
descriptionShort = $STR_EQUIP_APSI_DESC;
};
class ItemAPSIBroken_DZE : ItemCore
{
scope = 2;
displayName = $STR_EQUIP_APSI_BROKEN;
descriptionShort = $STR_EQUIP_APSI_BROKEN_DESC;
pictu... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(0);
std::cout.tie(0);
int n, m, ans = std::numeric_limits<int>::max();
std::cin >> n >> m;
std::vector<std::string> board(n);
for (int i = 0; i < n... |
#include "InfiniteGrid.hpp"
InfiniteGrid::InfiniteGrid(sf::Vector2u window_size)
{
//Init settings.
mWindowSize = window_size;
mCellSize = 16;
mPosition = {0, 0};
//Init constants.
mLineColor = sf::Color::Black;
//Init vertex arrays.
mGridLines.setPrimitiveType(sf::Lines);
mGridCells.setPrimitiveType(sf... |
// This file is for a basic string library so I do not have to use <cstring>
int getStringLength(char *str)
{
int resultLength = 0;
// loop until you find the null ending term
for(int i = 0; str[i]; i++)
{
++resultLength;
}
return resultLength;
}
void clearTempStringsToNull(char *str)... |
/* BEGIN LICENSE */
/*****************************************************************************
* SKCore : the SK core library
* Copyright (C) 1995-2005 IDM <skcontact @at@ idm .dot. fr>
* $Id: stringlist.h,v 1.3.4.3 2005/02/17 15:29:20 krys Exp $
*
* Authors: Christopher Gautier <krys @at@ idm .dot. fr>
*
* ... |
// Colton Sellers
// 20 Oct 2019
// BST class
// Creates a BST to store values
// Uses Node which holds the Data
// Uses templates to store any type of Data
// binarysearchtreee.cpp file is included at the bottom of the .h file
// binarysearchtreee.cpp is part of the template, cannot be compiled separately
#ifndef BS... |
#pragma once
class memes
{
public:
memes();
~memes();
};
|
#include "../Cheat.h"
HFont F::Meme;
HFont F::ESP;
HFont F::Watermark;
HFont F::Build;
HFont F::Revue;
HFont F::Icon;
HFont F::MenuTab;
void D::SetupFonts()
{
//"Courier New", 14, 450, 0, 0, FONTFLAG_OUTLINE, 0, 0); <- STYLES FONT
I::Surface->SetFontGlyphSet(F::Revue = I::Surface->Create_Font(), charenc("Revue"), 2... |
#ifndef HPREDUCER_H
#define HPREDUCER_H
class HPReducer {
public:
HPReducer(int _HPReduce = 1);
int getHPReduce() const;
protected:
int _HPReduce;
};
#endif // HPREDUCER_H
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int numOne = 0, numTwo = 1, numThree;
int input = 50;
cout<<"Fibonacci Series = "<<endl;
cout<<numOne<<endl;
cout<<numTwo<<endl;
for(int i = 2; i < input; ++i){
numThree = numOne + numTwo;
cout<<numThree<<endl;
num... |
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int i = 0;
int number;
int max =INT8_MIN;
int min = INT8_MAX;
while (i < n) {
cin >> number;
if (number>max) {
max = number;
}if(number<min) {
min = number;
}
... |
//
// Created by 杨殿生 on 2020/7/30.
//
#include <jni.h>
#include <string>
#include <logutil.h>
// 八种基本数据类型 从 Java 到 JNI 的类型转换操作
// JNI 的基础数据类型在 Java 的基础类型上加了一个 j
// 查看源码,JNI 的基础数据类型就是在 C/C++ 基础之上,通过 typedef 声明的别名
///* Primitive types that match up with Java equivalents. */
//typedef uint8_t jboolean; /* unsigned 8 ... |
#include <iostream>
using namespace std;
//s(n)=1*2*3*...*n
int dequi(int n)
{
if(n==1)
{
return 1;
}
return n*dequi(n-1);
}
int khudequi(int n)
{
int tong=1;
for(int i=2;i<=n;i++)
{
tong*=i;
}
return tong;
}
int dequiduoi(int n,int x=1)
{
if(n==1)
{
... |
#include <iostream>
#include <string>
#include <vector>
#include "utils.h"
using namespace std;
//请实现一个函数用来判断字符串是否表示数值(包括整数和小数)。
// 例如,字符串"+100","5e2","-123","3.1416"和"-1E-16"都表示数值。
// 但是"12e","1a3.14","1.2.3","+-5"和"12e+4.3"都不是。
// 数字的一般形式 [+/-] .A/B./A.B/A [e/E][+/-]C
// A,B,C只包含数字,[]内的是可选部分 , /表示左右二者选其一即可
cla... |
/**
funtion check (a^s)*d
paramater: uint64_t x
return (s,d)
*/
pair<ll, ll > factor(ll x){
ll s=0;
while((x&1)==0){
s++;
x>>=1;
}
return {s, x};
}
/**
funtion pow(a,d,n)
paramater: uint64_t -> a,d,n
return (a^d)%n
*/
ll Pow(ll a, ll d, ll n){
ll res=1;
a%=n;
while(d){
if(d&1) res=res*a%n;
a=a*a%n... |
/*******************************************************************\
Module: Assembler -> Goto
Author: Daniel Kroening, kroening@kroening.com
\*******************************************************************/
#include <ansi-c/string_constant.h>
#include "goto_convert_class.h"
/********************************... |
#include "connbas_dbox.h"
#include <memory.h>
#include <string.h>
#include <stdio.h>
#include "_syslog.h"
#include "trace_memory.h"
#include <time.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include <string.h>
//----------------------------------------------------------------... |
//
// Created by roy on 12/27/18.
//
#ifndef PROJECTPART1_EQUALCOMMAND_H
#define PROJECTPART1_EQUALCOMMAND_H
#include "Command.h"
#include "DataReaderServer.h"
#include "DataSender.h"
#include "Utilities.h"
#include "SmallLexer.h"
/**
* This command is the "assign" command which receives a variable and
* a value ... |
/*
*@author: profgrammer
*@date: 09-01-2019
*/
#include <bits/stdc++.h>
using namespace std;
int ncr(int n, int r){
if(n < r || n < 0 || r < 0) return 0;
if(n == r || r == 0) return 1;
return ncr(n-1,r) + ncr(n-1, r-1);
}
int main() {
int n;
cin>>n;
for(int i = 0;i <= n;i++){
for(int j = 0;j <= i... |
/*
Copyright 2021 University of Manchester
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 writing, s... |
/* -*-C++-*-
*/
/*
* Copyright 2016 EU Project ASAP 619706.
*
* 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 app... |
#include "jni.h"
#include "iberbar\Base\FileUtils.h"
#include "iberbar\Base\Platform\Android\JNIEnvHelper.h"
#include "iberbar\Base\LogText.h"
#include "android\log.h"
#include "Java_FileUtil.h"
bool iberbar::FileUtilsFindData::attrib_is_sub() const
{
return false;
}
const TCHAR* iberbar::CFileUtils::sm_Defa... |
#include <stdio.h>
#include "pageLib.h"
typedef int PageID;
typedef struct {
FILE *file_ptr;
int page_size;
} Heapfile;
typedef struct {
int page_id;
int slot;
} RecordID;
typedef struct {
int page_offset;
int freespace;
} DirEntry;
void init_heapfile(Heapfile *heapfile, int page_size, FILE ... |
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <algorithm>
#include <sstream>
#include <set>
#include <cmath>
#include <map>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <bits... |
// GMP class
// Generalized movement primitive.
//
#include <gmp_lib/GMP/GMP.h>
namespace as64_
{
namespace gmp_
{
// ===================================
// ======= Public Functions ========
// ===================================
GMP::GMP(unsigned N_kernels, double D, double K, double kernels_std_scaling)
{
#i... |
/*
* File: main.cpp
* Author: Elijah De Vera
* Created on January 14, 2021, 12:36 PM
* Purpose: Conditionals and if statements
*/
//System Libraries
#include <iostream> //Input/Output Library
#include <iomanip>
using namespace std;
//User Libraries
//Global Constants, no Global Variables are ... |
#include <iostream>
#include <fstream>
#include "Stack.h"
#include "Queue.h"
using namespace std;
struct NodeItem{
int row;
int col;
int weight; // weight = abs(x-root.row) + abs(y-root.y)
NodeItem* parent; // used in shortest-path
NodeItem(int r, int c, int d):row(r),col(c),weight(d),parent(0){}
... |
#include "dfAnimator.h"
#include "../Entity/Entity.h"
dfAnimator::dfAnimator()
{
}
dfAnimator::~dfAnimator(void)
{
}
void dfAnimator::Setup(wchar_t* animFilename)
{
currentAnimIndex = 0;
currentFrame = 0;
playing = true;
timer = 0.f;
LoadAnimJSON(animFilename);
}
void dfAnimator::Setup(std::string name, float... |
#include <iostream>
using namespace std;
//Bubble – Sort (sortarea prin interschimbare)
int main()
{
int a[100],i,j,aux,n;
cout<<"n=";
cin>>n;
for(i=1; i<=n; i++)
{
cout<<"a["<<i<<"]=";
cin>>a[i];
}
cout<<"Sirul original arata de forma:"<<endl;
for(i=1; i<=n; i++)
... |
# include <iostream>
//# include <iomanip>
using namespace std;
int main () {
float lowerLimit, higherLimit, stepSize, temperature;
cout << "Please give in a lower limit, limit >= 0: ";
cin >> lowerLimit;
cout << "Please give in a higher limit, 10 > limit <= 50000: ";
cin >> higherLimit;
cout << "Please give in a... |
#include "Socket.h"
namespace chatty {
namespace net {
Socket::Socket(int fd) : fd_(fd) {}
} // namespace net
} // namespace chatty |
// typedef int cod;
// bool eq(cod a, cod b){ return (a==b); }
#define vp vector<point>
typedef ld cod;
bool eq(cod a, cod b){ return fabs(a - b) <= EPS; }
struct point
{
cod x, y, z;
point(cod x=0, cod y=0, cod z=0): x(x), y(y), z(z){}
point operator+(const point &o) const{
return {x+o.x, y+o.y,... |
#include "mList.h"
#include "utils.h"
ListNode* buildList(std::string in, char p) {
auto nums = split(in.substr(1,in.length()-2), p);
ListNode* head = new ListNode(0);
ListNode* tail = head;
for (int i = 0;i < nums.size();i++) {
tail->next = new ListNode(parseInt(nums[i]));
tail = tail->next;
}
return head->... |
#include <algorithm>
#include <assert.h>
#include "model.h"
#include "parameters.h"
Model::Model() {
}
void Model::init(const uint32_t in_epochs,
const Batch_Method_T batch_method,
const boolean_t in_schuffle_input) {
random_engine.generate(weight, PARAMETERS_LOWER_BOUND, PARAMETERS_UP... |
//
// Created on 21/01/19.
//
//
// Code translated to C++ from the original: https://github.com/iskandr/fancyimpute
//
#include "IterativeSVD.h"
#include "../Algebra/RSVD.h"
#include <iostream>
namespace Algorithms
{
bool converged(const arma::mat &X_old, const arma::mat &X_new, const std::vector<arma::uvec> &ind... |
#ifndef _LogoutProcess_H_
#define _LogoutProcess_H_
#include "BaseProcess.h"
class Table;
class Player;
class LogoutProcess : public BaseProcess {
public:
LogoutProcess();
virtual ~LogoutProcess();
virtual int doRequest(CDLSocketHandler *clientHandler, InputPacket *pPacket, Context *pt);
private:
... |
#include <iostream>
#include "options.h"
using namespace std;
void Options::printOptions()
{
cout << "Options:" << endl;
} |
//
// main.cpp
//
// Created by Héctor Esteban Cabezos on 15/1/19.
// Copyright © 2019 Héctor Esteban Cabezos. All rights reserved.
//
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <iterator>
#include <fstream>
#include <cmath>
using namespace std;
int rows, columns;
vector<... |
/*
SD card read/write
This example shows how to read and write data to and from an SD card file
The circuit:
SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4
*/
int led0 = 23;
int led1 = 25;
int led2 = 27;
char comdata;
void setup()
{
pinMode(led0, ... |
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include "database.h"
DataBase::DataBase() :
file(),
index(),
overflowPtr(Record::NO_PTR),
overflowStart(Record::NO_PTR),
overflowEnd(Record::NO_PTR),
primaryAreaCount(0),
overflowAreaCount(0)
{
}
void DataBase::Open(std::string in... |
/*
Copyright 2021 University of Manchester
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 writing, s... |
#ifndef COLAT_H
#define COLAT_H
#include <iostream>
#include <stdlib.h>
#include "NodoT.h"
using namespace std;
template <typename T>
class ColaT
{
private:
NodoT<T>* extremo;
NodoT<T>* cabeza;
public:
ColaT(){
cabeza = NULL;
extremo = NULL;
}
... |
/**
* SMuFF Firmware
* Copyright (C) 2019 Technik Gegg
*
* 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 3 of the License, or
* (at your option) any later version.
*
* Th... |
//
// Created by JACK on 9/14/2015.
//
#include "soft.h"
#include <iostream>
#include <string.h>
#include <stdlib.h>
#include <sstream>
using namespace std;
soft::soft():name(nullptr),
extension(nullptr),
size(0),
date(nullptr),
time(nullptr){}
soft::soft(char* name,ch... |
/*
* Copyright (C) 2010 The Android Open Source Project
*
* 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 requir... |
/*
* AndroidEngine.h
*
* Created on: May 1, 2012
* Author: iwasz
*/
#ifndef ANDROIDENGINE_H_
#define ANDROIDENGINE_H_
#include <android/sensor.h>
#include <EGL/egl.h>
#include "android_native_app_glue.h"
#include "AndroidCmdDispatcher.h"
#include "AndroidInputDispatcher.h"
namespace Util {
struct Android... |
/* -*- 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.
*/
/**
* @file OpTrustAndSecurityButton.h
*
* Button that is used... |
//
// main.cpp
// BinarySearch
//
// Created by Prateek Khandelwal on 4/8/15.
// Copyright (c) 2015 Prateek Khandelwal. All rights reserved.
//
#include <iostream>
#include <algorithm>
#include <vector>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <cstdio>
using namespace std;
int binarySear... |
#pragma once
#include "qresource.h"
#include <qEngine/DynamicVB.h>
namespace qEngine
{
class qDynamicVB :
public qResource
{
public:
qDynamicVB(void);
~qDynamicVB(void);
};
} |
#include <stdio.h>
#include <iostream>
#include "sha256.h"
#include <string.h>
#include <sqlite3.h>
#include <ctime>
using namespace std;
char choice;
sqlite3* db;
string signedInUser;
void promptUser(){
start:
cout << "Type 's' for Sign-In or 'r' for Register New User: " << endl;
cin >> choice;
if ... |
/**
* @file utils.h
*
* @brief Provide some miscellaneous tools for use throughout the code.
*
* @version 0.1
* @date 2021-06-21
*
* @copyright Copyright (c) 2021
*
*/
#include "globals.h"
#ifndef UTILS_PIO_H
#define UTILS_PIO_H
namespace Utils
{
/**
* @brief The namespac... |
#include <simpleProtocolParser.h>
#include "serialParserStates.h"
SimpleProtocolParser::SimpleProtocolParser()
{
pState = std::make_shared<WaitForStart>(this);
}
void SimpleProtocolParser::receiveChar(char received)
{
pState->receiveChar(received);
}
void SimpleProtocolParser::setState(std::shared_ptr<ParserState>... |
#ifndef MILLWRIGHT_H
#define MILLWRIGHT_H
#include "employee.h"
class Millwright : public Employee
{
private:
bool department_;
public:
Millwright();
void setDepartment(string str);
bool getDepartment(){return department_;}
};
#endif // MILLWRIGHT_H
|
#include "bitmap_persister.h"
#include "../core/types.h"
#include "../include/bitmap_image.hpp"
namespace persistence {
model::Image *BitmapPersister::load(const std::string &fileName) {
bitmap_image bmp(fileName);
model::Image *image = new model::Image(bmp.width(), bmp.height());
for (unsigned x = 0; x < bmp... |
//
// nehe28.cpp
// NeheGL
//
// Created by Andong Li on 10/7/13.
// Copyright (c) 2013 Andong Li. All rights reserved.
//
#include "nehe28.h"
const char* NEHE28::TITLE = "NEHE28";
GLfloat NEHE28::sleepTime = 0.0f;
int NEHE28::frameCounter = 0;
int NEHE28::currentTime = 0;
int NEHE28::lastTime = 0;
char NEHE28::... |
/* 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 writing, software
* distributed ... |
#include "utils.h"
namespace Utils {
} |
// LeastCommonAncestor.cc
#include <iostream>
using namespace std;
#define N 10000
int getIndex(int &key, const int *input, const int length, int *index){
int occur = 0;
int i = 0;
int j = 0;
while(i<length){
if(input[i] == key){
occur++;
index[j++] = i;
}
if(occur==3)
break;
i++;
}
return o... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 1995-2007 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.h"
#if defined(VEG... |
#define CATCH_CONFIG_MAIN
#include "../external/catch2/catch.hpp"
#include "../src/array/includes_any.hpp"
#include <vector>
#include <string>
template<typename T>
struct TestStruct
{
std::vector<T> nums;
std::vector<T> incs;
bool actual;
TestStruct(std::vector<T> nums, std::vector<T> incs, bool ac... |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Stack{
private:
int *stack;
int size;
int pos;
vector<int> v;
public:
Stack(int _size = 0){
size = _size;
stack = new int[size];
pos = 0;
}
~Stack(){
delete[] stack;
}
... |
// Copyright 2012 Yandex
#ifndef LTR_SCORERS_BAYESIAN_SCORER_H_
#define LTR_SCORERS_BAYESIAN_SCORER_H_
#include <map>
#include <string>
#include "ltr/density_estimators/base_probability_density_estimator.h";
#include "ltr/utility/shared_ptr.h"
#include "ltr/data/object.h"
#include "ltr/scorers/scorer.h"
using ltr::... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#define INT_MIN (1<<31)
#define INT_MAX (~INT_MIN)
#define UNREACHABLE (INT_MAX>>2)
using namespace std;
ifstream fin("314_input.txt");
#define cin fin
struct ele
{
ele(int... |
#include <pthread.h>
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
#include "mysql_connection.h"
#include <cppconn/driver.h>
#include <c... |
#include "SortingIO.h"
#include "stdlib.h"
using namespace std;
using std::vector;
void merge(vector<long>& a, vector<long>& b, int size, int left, int middle);
void mergeSort(vector<long>& a, int size);
int main(int argc, char *argv[]) {
int size;
vector<long> myVector;
std::string inputFileName;
... |
#include "mesh.h"
#include <QOpenGLFunctions>
Mesh::Mesh(const QVector<QVector3D> &positions,
const QVector<QVector2D> &uvs,
const QVector<QVector3D> &normals,
const QVector<unsigned int> &indices,
const Material &material)
: vao(), positionBuffer(QOpenGLBuffer::Typ... |
// This program tests the integrity of the Mersenne Twister PRNG by comparing the expected average of summed random numbers to the real average
// To-do: Get floating-point averages to work as expected, maybe add other PRNGs?
#include <iostream>
#include <random>
#include <ctime>
// Global namespace for initializing t... |
#include <iostream>
#include "Word.h"
#include "Translate.h"
using namespace::std;
namespace md = myDictionary;
int main()
{
try
{
md::Word a("Hellow", "Eng");
md::Translate t(a);
cout << t.GetTrans().GetWord();
}
catch (exception &e)
{
cout << "Exception -> " << e.what() << endl;
}
catch (...)
{
... |
#include <cstdio>
#include <cstring>
#include <queue>
#include <functional>
using namespace std;
int read()
{
int x=0, t=1;
char c = getchar();
while(c<'0'||c>'9')
{
if(c == '-')
t = -1;
c = getchar();
}
while(c>='0'&&c<='9')
{
x = x*10 + c-'0';
... |
#pragma once
#include "Light.h"
class RectangleAreaLight : public Light
{
public:
RGB lightColor;
double radianceScalingFactor;
vector<Vector> samplePoints;
Vector direction;
int samplePointWidth;
int samplePointHeight;
Matrix areaLightMatrix;
Vector lightOrigin;
double rectangleWidth;
double rectangleHeig... |
#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
#define FIREBASE_HOST "meter-gsm-default-rtdb.firebaseio.com" //Your Firebase Project URL goes here without "http:" , "\" and "/"
#define FIREBASE_AUTH "mFye9VZL4fQzootlQg1ySxwRLQSqQ3ddQsPcqoNc" //Your Firebase Data... |
#ifndef ULTRASONIC_HPP
#define ULTRASONIC_HPP
enum e_UltrasonicSensor : uint8_t
{
FRONT = 0,
LEFT = 1,
RIGHT = 2,
BACK = 3
};
class UltrasonicSensor
{
public:
static UltrasonicSensor& getInstance()
{
static UltrasonicSensor instance;
return instance;
... |
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
#include<math.h>
void main()
{
int gd=DETECT,gm;
float h,k,a,b,run,x,y,l,z;
do
{
initgraph(&gd,&gm,"C:\\TURBOC3\\BGI");
printf("Enter the center (h,k)\n==> ");
scanf("%f%f",&h,&k);
printf("Enter the length o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.