text stringlengths 8 6.88M |
|---|
#include <opencv2/opencv.hpp>
#include <sophus/se3.hpp>
#include <boost/format.hpp>
#include <pangolin/pangolin.h>
using namespace std;
typedef vector<Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d>> VecVector2d;
// Camera intrinsics
double fx = 718.856, fy = 718.856, cx = 607.1928, cy = 185.215... |
/*You are required to complete this method */
int josephus(int n, int k)
{
// only gravity will pull me down
// Josephus problem
if (n == 1)
return 1;
return (josephus(n-1, k) + k - 1) % n + 1; // easy peasy, only if I remember the recurrence relation :)
} |
/*
How to use:
first call init method, with number of input with umbral input inclusive.
than call setSynapses with w0 = - theta
next call thresshold to get the activation function
*/
#include "neuron.h"
#include <math.h>
#include <stdio.h>
#include <assert.h>
Neuron::Neuron(){}
void
Neuron::init(int numberOfDentrit... |
#include <iostream>
#include "HGraph.h"
namespace graph
{
HGraph::HGraph()
{
vertices = new std::set<Vertex>();
edges = new std::set<Edge>();
attributes = new std::set<Attribute>();
marks = new std::set<Mark>();
positions = new std::set<VertexPos>();
}
HGraph::~HGraph()
{
delete vertices;
d... |
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include ... |
/*
* timer.h
*
* Created on: Dec 12, 2012
* Author: suntus
* 对时间的一些操作
*/
#ifndef TIMER_H_
#define TIMER_H_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include "tinyweb.h"
#define TIME_BUFFER_SIZE 40 /* buffer size of time_buffer */
clas... |
/*
** EPITECH PROJECT, 2019
** tek3
** File description:
** Waiting
*/
#ifndef WAITINGANSWER_HPP_
#define WAITINGANSWER_HPP_
#include <iostream>
#include <memory>
#include <QApplication>
#include <QtWidgets>
#include <QPushButton>
#include <QSound>
namespace babel {
namespace graphic {
class WaitingAnsw... |
//
// Created by Brady Bodily on 3/1/17.
//
#ifndef BINGO_CARDTESTER_HPP
#define BINGO_CARDTESTER_HPP
class CardTester {
public:
void testDuplicates(int testCases);
void testConstructor(int size, int num, int index, int testCase);
};
#endif //BINGO_CARDTESTER_HPP
|
/*
* the implementation of the merge sort
*
* author: dongbeibei
* time: 2013/6/23
*
* input: 1. array[] : 待排序数组
* 2. length : 数组长度
*
* output: true: 正确排序;false: 输入有误
*/
#include "sortBase.h"
void helper(ElemType *array, ElemType *array_temp, int start, int end);
void merge(ElemType *array, ElemType *a... |
#pragma once
#include <stdexcept>
#include <PortableDeviceApi.h>
// Unfortunately Fakeit cannot mock __stdcall methods
// It generates implementation for __stdcall method which calls __cdecl virtual methods
#define PROXY_STDCALL(resultDef, name, paramsDef, params, result) \
resultDef __stdcall name paramsDef over... |
#ifndef QCBACKPLATE_H
#define QCBACKPLATE_H
#include <vector>
#include "GL/gl.h"
#include "GL/glext.h"
#include "../mat.h"
#include "TextDefs.h"
class QCBackplate
{
public:
QCBackplate(Pos p);
virtual ~QCBackplate();
void render(GLuint sp);
protected:
private:
GLuint _tex;
GLuint _vbo;
GLuin... |
#pragma once
#include "QsoTokenType.h"
// Class for parsing time tokens
class TimeToken : public QsoTokenType
{
public:
TimeToken();
virtual ~TimeToken();
virtual bool Parse(const string& token);
virtual QsoTokenType* Clone() { return new TimeToken(); }
}; |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* 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"
#if defined(KEYBOARD_SELECTION_SUPPORT) |... |
//
// motion_switch
//
// Description of the project
// Developed with [embedXcode](http://embedXcode.weebly.com)
//
// Author Marco Heyden
// Marco Heyden
//
// Date 09.12.15 00:59
// Version <#version#>
//
// Copyright © Marco Heyden, 2015
// Licence <#licence#>
//
// See ReadMe.txt for references
/... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2006 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef SVG_DOM_PATH_IMPL_H
#define SVG_DOM_PATH_IMPL_H
# ifd... |
#pragma once
#include <cstdint>
#include <string>
#include "common.h"
NAMESPACE_BEGIN(NAMESPACE_BINTABLE)
typedef uint8_t tabledatatype;
const tabledatatype BINTABLE_BOOL = 0;
const tabledatatype BINTABLE_INT8 = 1;
const tabledatatype BINTABLE_UINT8 = 2;
const tabledatatype BINTABLE_INT16 = 3;
const tabledataty... |
#include "pi_to_pi.h"
#include <math.h>
const double TWOPI = 2*M_PI;
/*****************************************************************************
* OPTIMIZATION STATUS
* Done: Base Implementation, unit test, Benchmark added
* While and if implementation -> probably doesn't get much faster
* ToDo: Maybe a ... |
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <fstream>
#include <boost/lexical_cast.hpp>
using namespace std;
using namespace boost;
struct LightSwitch;
struct State {
virtual void on(LightSwitch *lhs) {
std::cout << "light is already on" << std::endl;
}
virt... |
#include "scene_node.h"
#include<math.h>
#include"maths.h"
scene_node::scene_node(void)
{
m_p_model = NULL;
m_x = 0.0f;
m_y = 0.0f;
m_z = 0.0f;
m_xangle = 0.0f;
m_yangle = 0.0f;
m_zangle = 0.0f;
m_scale = 1.0f;
}
void scene_node::SetXPos(float x)
{
m_x += x;
}
void scene_node::SetYPos(float y)
{
m_y = y... |
/*****************************************************************************************************************
* File Name : EightQueensProblem.h
* File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\tutorials\nptel\algodesign\lecture16\EightQueensProblem.h
* Created on : Jan 29, 2014 :: 10:... |
//
// Triangle.h
// Odin.MacOSX
//
// Created by Daniel on 01/10/15.
// Copyright (c) 2015 DG. All rights reserved.
//
#ifndef Odin_MacOSX_Triangle_h
#define Odin_MacOSX_Triangle_h
#include "Vector3.h"
namespace odin
{
namespace math
{
namespace shape
{
class Triangle
... |
struct node{
int pos, l, r, val;
bool operator<(node &o){
if(val==o.val) return l>o.l;
return val>o.val;
}
};
struct FT {
vector<int> bit; // indexado em 0
int n;
FT(int n) {
this->n = n+1;
bit.assign(n+1, 0);
}
int sum(int idx) {
int ret = 0;... |
#include <iostream>
using namespace std;
struct jam{
int jam;
int menit;
int detik;
};
int main(){
jam jam1;
cout <<"Masukkan jam 1" <<endl;
cout <<" Jam : "; cin >>jam1.jam;
cout <<" Menit : "; cin >>jam1.menit;
cout <<" Detik : "; cin >>jam1.detik;
cout<<endl;
jam jam2;
cout <<"Masukan jam 2" <<endl;
cou... |
#include "scroll.h"
#include "scrollimp.h"
#include "scrollinterfacemagicmissile.h"
Scroll::Scroll()
{}
Scroll::~Scroll()
{}
void Scroll::accept(ScrollInterfaceMagicMissile *s)
{
s->useScroll(this);
}
ScrollImp *Scroll::getScrollImp()
{
return _imp;
}
|
//
// main.cpp
// 1124
//
// Created by Pedro Neves Alvarez on 7/9/17.
// Copyright © 2017 Pedro Neves Alvarez. All rights reserved.
//
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
int main() {
double L, C, R1, R2;
while(scanf("%lf %lf %lf %lf", &L ,&C, &R1, &R2) == 4) {
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** @author Manuela Hutter (manuelah)
*/
#ifdef AUTO_UPDATE_SUPPOR... |
#include<cstdio>
#include<queue>
#include<algorithm>
#include<iostream>
#include <iomanip>
using namespace std;
#define maxn 100005
typedef long long ll;
struct Node {
int a;
int b;
int d;
bool operator <(const Node &x) const {
return a<x.a;
}
} node[maxn];
int cmp(Node x,Nod... |
// https://oj.leetcode.com/problems/valid-parentheses/
class Solution {
public:
bool isValid(string s) {
size_t size = s.size();
if (size == 0) {
return true;
}
stack<char> stk;
for (size_t i = 0; i < size; i++) {
char c = s[i];
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** 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.
**
*/
#ifndef OPPRINTERCONTROLLER_H
#def... |
#include <vector>
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <DEdvs/dedvs_auxiliary.h>
#include <DEdvs/dedvs.h>
#include <Eigen/Dense>
int main(int argc, char *argv[])
{
std::vector<dedvs::DEvent> data;
dedvs::DEvent temp;
double numerator = 0;
double denominator = 0;
double dist_... |
/*
* File: main.cpp
* Author: Tom
*
* Created on 13 January 2012, 7:58 PM
*/
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
long sumSquares = 0;
long squareSums = 0;
for(int i = 1; i <= 100; i++) {
squareSums += i;
sumSquares += i*... |
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverse(Lis... |
#include <iostream>
#include <climits>
using namespace std;
// Maximum Circular Subarray Sum
int kadane(int a[], int n)
{
int currsum = 0;
int maxsum = INT_MIN;
// cout<<"function called"<<endl;
for (int i = 0; i < n; i++)
{
currsum += a[i];
if (currsum < 0)
{
cu... |
#ifndef ARRAYLIST_ARRAYLIST_H
#define ARRAYLIST_ARRAYLIST_H
#include <stdio.h>
#include <malloc.h>
/**
* List ADT implemented using arrays
*
* @tparam T
*/
template<typename T>
class ArrayList {
static const int GROWTH_FACTOR = 2;
static const int DEFAULT_CAPACITY = 32;
int capacity;
int size;
... |
//
// DrumSynthesizer.cpp
// DrumConsole
//
// Created by Paolo Simonazzi on 07/04/2016.
//
//
#include "../JuceLibraryCode/JuceHeader.h"
#include "DrumSynthesizer.hpp"
#include "VoiceRAM.hpp"
#include "DrumKit.hpp"
DrumSynthesizer* DrumSynthesizer::getInstance() {
static DrumSynthesizer *instance = nullp... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
// only gravity will pull me down
// Maximize The Cut Segments
int t, n, x, y, z;
cin >> t;
while (t--) {
cin >> n;
cin >> x >> y >> z;
int dp[n+1];
memset(dp, -1, sizeof(dp));
dp[0] = 0;
... |
// This sketch is just to test the lcd display
// Once the 'Hello World' works, implement logic in the loop() of the main file
// to print temperature and humidity values, messages, etc.
// Include the Arduino-LiquidCrystal-I2C-library-master library
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Set the LCD ... |
#include "cnfdialog.h"
#include "ui_cnfdialog.h"
#include "settings.h"
#include <QMessageBox>
#include <QDebug>
cnfDialog::cnfDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::cnfDialog)
{
ui->setupUi(this);
}
cnfDialog::~cnfDialog()
{
delete ui;
}
|
#ifndef SASS_CHECK_NESTING_H
#define SASS_CHECK_NESTING_H
#include "ast.hpp"
#include "operation.hpp"
namespace Sass {
class CheckNesting : public Operation_CRTP<Statement_Ptr, CheckNesting> {
std::vector<Statement_Ptr> parents;
Backtraces traces;
Statement_Ptr parent;
... |
/*
===========================================================================
Copyright (C) 2017 waYne (CAM)
===========================================================================
*/
#pragma once
#ifndef ELYSIUM_DATA_MODEL_COMPONENT
#define ELYSIUM_DATA_MODEL_COMPONENT
#ifndef ELYSIUM_CORE_OBJECT
... |
#include <string>
#include "UpdateTableUserCountProc.h"
#include "ServerManager.h"
#include "Logger.h"
#include "Configure.h"
#include "AllocManager.h"
using namespace std;
UpdateTableUserCountProc::UpdateTableUserCountProc()
{
this->name = "UpdateTableUserCountProc";
}
UpdateTableUserCountProc::~UpdateTableUserCo... |
#include <iostream>
using namespace std;
class SpaceShip{
public:
void fly(){ cout << "Flying.\n"; }
};
class Shuttle : public SpaceShip{
public:
void land(){ cout << "Poof! Landed.\n"; }
};
int main(){
Shuttle sh;
sh.fly();
sh.land();
SpaceShip ss;
Shuttle *ptr = dynamic_cast<Shuttle*>(&ss);
ptr->fly();
... |
#include <stdio.h>
int main() {
int numero, fatorial, numfat, controlador = 1;
printf("Digite o numero que deseja realizar o fatorial: ");
scanf("%d", &numero);
fatorial = numero;
while (controlador != numero) {
numfat = numero - controlador;
fatorial = fatorial * numfat;
controlador = controlador + 1... |
#include <iostream>
int main(){
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
short a, b;
std::cin >> a >> b;
std::cout << b-1 << ' ' << a-1;
} |
//------------------------------------------------------------------------------
/*
This file is part of valueAdded: https://github.com/valueAdd/valueAdded
Copyright (c) 2012, 2013 valueAdd Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee ... |
#if !defined(sse_h)
#define sse_h
namespace et {
struct sse {
enum { vector_size = sizeof(__m128d) / sizeof(double) };
typedef double value_type;
__m128d d;
sse() {}
sse(__m128d a) : d(a) {}
sse(value_type a) {
d = _mm_set_pd(a, a);
}
sse(value_type (&a)[2]) {
d = _mm... |
//
// 1.cpp
// REVIEW BAGUS
//
// Created by Mikha Yupikha on 16/10/2016.
// Copyright © 2016 Mikha Yupikha. All rights reserved.
//
#include <iostream>
using namespace std;
int main()
{
int num1, num2;
cout<<"Please enter the first number: ";
cin>> num1;
cout<<"Please enter the second number... |
#ifndef INCLUDES
#define INCLUDES
#include "../Move.h"
#include "../Board.h"
#endif
#ifndef ZOBRIST
#define ZOBRIST
#include "../Zobrist.h"
#endif
#include <math.h>
#include <map>
class Mcts_ucb{
private:
Board board;
std::vector<std::pair<Move,std::pair<int,int>>> moves_stats; // keeps the stats for each m... |
#ifndef MAPPING_SCREEN_TAP_LISTENER_HPP
#define MAPPING_SCREEN_TAP_LISTENER_HPP
#include <iostream>
#include "BaseScreenTapListener.hpp"
/*
* Maps ScreenTap events to system's left mouse button event.
* @author: Grzegorz Mirek
*/
class MappingScreenTapListener : public BaseScreenTapListener {
protected:
void onScr... |
#ifndef TFrmMainH
#define TFrmMainH
//---------------------------------------------------------------------------
#include <System.Actions.hpp>
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <Dialogs.hpp>
#include <ActnList.hpp>
... |
#include "execution_Unit.h"
void Execution_Unit::execute(){
int result;
switch ((ctrl.read()).to_uint())
{
case 1: result = data_in_a.read(); break;
case 2: result = data_in_a.read() + data_in_b.read(); break;
case 3: result = data_in_a.read() | data_in_b.read(); break;
... |
#pragma once
#include <Windows.h>
#include <d3d11.h>
#pragma comment(lib, "d3d11.lib")
class Window;
class Device {
public:
// コンストラクタ
Device() = default;
Device(const Device&) = default;
Device(Device&&) = default;
// デストラクタ
~Device() = default;
// 代入演算子
Device& operator=(const Devic... |
#include "WinCommon.h"
#include "DXCommon.h"
#include "Wing.h"
#include "Object.h"
#include "Windmill.h"
Windmill::Windmill(int wingcnt)
{
m_pVB = NULL;
m_pVertex = NULL;
m_pWing = NULL;
m_iWingCnt = wingcnt;
for( int i = 0; i < SWW_MAX; ++i )
m_pMaskTexture[i] = NULL;
m_TexState = SWW_NONE;
m_bWindLigh... |
#ifndef _MSG_0X37_BLOCKBREAKANIMATION_STC_H_
#define _MSG_0X37_BLOCKBREAKANIMATION_STC_H_
#include "mcprotocol_base.h"
namespace MC
{
namespace Protocol
{
namespace Msg
{
class BlockBreakAnimation : public BaseMessage
{
public:
BlockBreakAnimation();
BlockBreakAnimation(int32_t _EntityId, int32_t _x, int32_t _y, i... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2008 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef CRYPTO_CERTIFICATE_CHAIN_H
#define CRYPTO_CERTIFICATE_CHA... |
#include <SparkJson.h>
#include <HttpClient.h>
#include <neopixel.h>
#include "Particle.h"
SYSTEM_MODE(AUTOMATIC);
// IMPORTANT: Set pixel COUNT, PIN and TYPE
#define PIXEL_COUNT 10
#define PIXEL_TYPE WS2812B
#define HOUR 60*60
#define MAX_BRIGHTNESS 255
#define MIN_BRIGHTNESS 10
Adafruit_NeoPixel strip(PIXEL_COUNT,... |
//#include "GrBulletObject.h"
//#include "SFML/OpenGL.hpp"
//#include <iostream>
//
//#define _USE_MATH_DEFINES
//#include <math.h>
//
//GrBulletObject::GrBulletObject()
//{
//}
//
//GrBulletObject::GrBulletObject(btRigidBody * rigidBody)
//{
// this->rigidBody = rigidBody;
//
// {
// btTransform transform... |
#include <cmath>
#include "vector3.h"
#include "dlsurf.h"
/****************************/
/* definizione del contorno */
/****************************/
/* t va da 0 a 4\pi */
double R=1.3;
double h=1.0;
vector3 border_function(double t) {
return vector3(R*cos(t),R*sin(t),t>=2.0*M_PI?-h:h);
}
vertex* new_border_ve... |
#include <junction_maneuvering/junction_maneuvering.h>
#include <ros/ros.h>
JunctionManeuvering::JunctionManeuvering()
{
reset();
}
JunctionManeuvering::~JunctionManeuvering()
{
}
bool JunctionManeuvering::setGoal(int goal, int turn_direction, double distance, Gateways detected_gateways)
{
goal_ = goal;
... |
#include "CameraController.h"
#include "glm/glm.hpp"
#include "Player.h"
#include "Components/TransformComponent.h"
#include "Renderer/Renderer.h"
const float x_clamp = 1.0f; // 0.5f is good hehe
const float y_offset = 1.0f;
void camera_update(Player* player_one, Player* player_two, float dt)
{
glm::vec2 pos_one ... |
#include "InputTouch.h"
#include "Logger.h"
namespace HW
{
InputTouch::InputTouch() :m_system_message_processed(false)
{
m_index = true;
m_gesture = GS_None;
m_current_state = State_None;
m_gesture_func[State_None] = &InputTouch::GestureStateNone;
m_gesture_func[State_Pan] = &InputTouch::GestureStatePan;
... |
#pragma once
class Example
{
public:
bool getTrue();
}; |
#include<iostream>
#include "../Shoikoth/Person.hpp"
#include "../Shoikoth/Date.hpp"
#include "Room.hpp"
#include "Floor.hpp"
#include <vector>
using namespace std;
class Property
{
protected:
string type;
Vendor owner;
vector<string> features;
double buyPrice;
double sellPrice;
Date availableD... |
#include "basic.hpp"
uchar threshold( double unlim )
{
if ( unlim <= 0 )
return 0;
else if ( unlim >= 255 )
return 255;
else
return (uchar)std::round( unlim );
}
|
//
// maze.cpp
// Homework 3
//
// Created by Hender Lin on 5/2/21.
//
class Coord
{
public:
Coord(int r, int c) : m_row(r), m_col(c) {}
int r() const { return m_row; }
int c() const { return m_col; }
private:
int m_row;
int m_col;
};
bool pathExists(char maze[][10],... |
/*
Simple ATM
by Alan Agon a1636896
*/
#include <iostream>
using namespace std;
//Function prototypes
bool canDispense(int amount);
void dispense(int amount);
int main (int argc, char *argv[]){
//Greet user and prompt for input, E for exit
cout << "Hello, please enter the amount you'd wish to withdraw: ";
... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "MainPlayer.generated.h"
UCLASS()
class ANIMATIONTEST_API AMainPlayer : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this ch... |
//
// Created by 송지원 on 2020/05/25.
//
#include <iostream>
using namespace std;
char input[50][50];
char cases[2][9] = {"WBWBWBWB", "BWBWBWBW"};
int check(int i, int j) {
int count1 = 0;
int count2 = 0;
for (int k=0; k<8; k++) {
for (int l=0; l<8; l++) {
if (input[i+k][j+l] != cases[... |
#include<stdio.h>
main()
{
long int n;
int m,s=0;
printf("please input a number\n" );
scanf("%ld",&n);
while(n>0)
{
m=n%10;
if(m%2==0)
s=s*10+m;
n/=10;
}
printf("%d\n",s);
}
|
#include <bits/stdc++.h>
using namespace std;
// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeN... |
#pragma once
#ifndef __HEALTH_BAR__
#define __HEALTH_BAR__
#include "DisplayObject.h"
#include "TextureManager.h"
class HealthBar : public DisplayObject {
public:
HealthBar();
~HealthBar();
void draw() override;
void update() override;
void clean() override;
void setHealth(int n) { health = n; }
int getHealt... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2004-2007 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Tord Akerbęk
*/
/**
* @file prefsloadmanager.h
* Framework ... |
// RoadToParcial.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
using namespace std;
int main()
{
//Entrada
char lugarIngreso='X';
char tipoDispositivo;
int horaIngreso;
int sumA = 0;
int sumB = 0;
int sumC = 0;
int sumMad =... |
#include <SakuraIO.h>
SakuraIO_I2C sakuraio;
const int BUTTON = 2;
boolean buttonState = 0;
boolean buttonStatePre = 1;
uint32_t count = 0;
void setup() {
pinMode(BUTTON, INPUT);
//IoT
Serial.begin(9600);
Serial.print("Waiting to come online");
for(;;) {
if( (sakuraio.getConnectionStatus() & 0x80) == 0... |
#pragma once
namespace BroodWar
{
namespace Api
{
namespace Enum
{
public enum class PlayerType
{
None,
Computer,
Player,
RescuePassive,
EitherPreferComputer,
EitherPreferHuman,
Neutral,
Closed,
PlayerLeft,
ComputerLeft,
Unknown,
};
}
}
}
|
#include "conv.hpp"
cv::Mat conv2d( cv::Mat large, cv::Mat small, Padding method )
{
// CV_Assert(large.type() == CV_64F);
cv::Mat conv;
conv = cv::Mat( large.size(), CV_64FC3 );
int nRow = large.rows;
int nCol = large.cols;
int nRowS = small.rows;
int nColS = small.cols;
cv::Vec3d* ptr... |
#include<iostream>
using namespace std;
int main()
{
int choice;
float temp, newtemp;
cout << "Temperature Conversion Menu\nplease type 1 to convert Fahrenheit to Celsius\nplease type 2 to convert Celsius to Farenheit\n";
cin >> choice;
if (choice == 1)
{
cout << "Enter the temperature in Fahrenheit:"... |
// RomanNumerals.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <string>
#include "NumberConverter.h"
int main()
{
std::string userInput;
std::cout << "Roman Numeral to Decimal application by Graham R. Armstrong. (2020-05-17)\n\n";
s... |
//
// Created by 송지원 on 2019-10-30.
//
#include <iostream>
#include <string.h>
using namespace std;
char* order[8] = {"push_front", "push_back",
"pop_front", "pop_back",
"size", "empty",
"front", "back"};
int SIZE_OF_ARR = 50000;
int main() {
int deq[SIZE_OF_ARR];
... |
#include "GamePch.h"
#include "GunLogic.h"
#include "Projectile.h"
#include "Component/Animation.h"
#include "Renderer/DebugRenderer.h"
static const float kMuzzleLightFadeOutTime = 0.1f;
uint32_t GunLogic::s_TypeID = hg::ComponentFactory::GetGameComponentID();
void GunLogic::ConfigureMachineGun(GunLogic * gun)
{
i... |
//
// Created by nikita on 12/28/19.
//
#include "server.h"
void timeouts::update_timeout(time_list::time_list_node_base &s) {
std::lock_guard<std::mutex> l(m);
time_list::remove(s);
assert(&s != &cur.head);
assert(&s != &prev.head);
cur.push(s);
}
void timeouts::check() {
std::lock_guard<std:... |
#pragma once
#include "TileInfo.h"
#include "IEvent.h"
/*
GameObjectGridMap is responsible for holding all the tiles on the level
that have some GameObject on them, as well as providing functionality
like adding and removing these GameObjects from the world.
*/
typedef IEvent<void(std::shared_ptr<GameObject>, cons... |
#include "IProcess.h"
#include "Configure.h"
#include "HallManager.h"
#include "Logger.h"
#include "ErrorMsg.h"
#include "AllocSvrConnect.h"
#include "CoinConf.h"
#include "ProtocolServerId.h"
#include "Util.h"
#include "Player.h"
#include "RedisLogic.h"
#include "GameApp.h"
#include "MySqlAgent.h"
#include "RoundAgent... |
#include<iostream>
#include<string.h>
#include<stdlib.h>
#define max 100000
using namespace std;
int main(){
char a[max],b[max];
cin>>a>>b;
int c[26],d[26],sum=0;
for(int i=0;i<26;i++)
c[i]=d[i]=0;
for(int i=0;i<strlen(a);i++){
c[a[i]-97]++;
}
for(int i=0;i<str... |
#include <iostream> //allows for standard input and output
#include <stdlib.h> //opens the standard library, which includes function rand()
using namespace std; //you wont have to use std::
struct AI { //makes a structure to store enemy information
int x;
int y;
}enemy[99]; //this declares 100 enemies, from 0 to 99
... |
#include "MultipleInputLayerNodeBuilder.hpp"
#include "BuilderStorage.hpp"
#include "BinaryNodeBuilder.hpp"
#include "VariableSingleValueNodeBuilder.hpp"
#include <algorithm>
MultipleInputLayerNodeBuilder::MultipleInputLayerNodeBuilder(BuilderStorage& builderStorage, std::unique_ptr<IMultipleInputLayerOperationsFactor... |
#include "Joueur.h"
const float markerSize = 0.105f;
extern vector<Model_OBJ> objets;
Joueur::Joueur(int nb)
{
m_nb=nb;
}
void Joueur::afficher()
{
switch(m_typeAffichage)
{
case TYPE_EVOLUTION2:
m_typeAffichage=TYPE_EVOLUTION1;
case TYPE_COMBAT:
switch(m_carte)
... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#define MAX 1e18
typedef long long ll;
int check(std::vector<ll> &list, int s)
{
ll sum = 0;
int idx = 0;
int sz = (int)list.size();
for(int i = 0; i < sz; i++)
{
sum += list[i];
}
for(int i = 0, sum = 0; i <... |
#ifndef GRAPHICS_H
#define GRAPHICS_H
static bool FULL_SCREEN = false;
const bool VSYNC_ENABLED = true;
#include "OGL.h"
#include "SpriteBatch.h"
class Graphics
{
public:
Graphics();
~Graphics();
//Function: Initialize OpenGL and Extensions
//PostCondition: OpenGL and Extensions Initialized
bool InitializeOGL(... |
/*
========================================================================
DEVise Data Visualization Software
(c) Copyright 1992-1996
By the DEVise Development Group
Madison, Wisconsin
All Rights Reserved.
========================================================================
Under no circumstances ... |
#include "windowevent.h"
namespace sge { namespace events {
ResizeWindowEvent::ResizeWindowEvent(unsigned int width, unsigned int height)
: Event(ResizeWindowEvent::getStaticType()), m_Size(math::vec2(width, height))
{
}
} } |
#include "LeaveProcess.h"
#include "HallHandler.h"
#include "Logger.h"
#include "Configure.h"
#include "GameServerConnect.h"
#include "PlayerManager.h"
#include "GameCmd.h"
#include "ProcessManager.h"
#include <string>
using namespace std;
REGISTER_PROCESS(CLIENT_MSG_LEAVE, LeaveProcess)
LeaveProcess::LeaveProcess()
... |
#pragma once
#include "x/x_graphics.h"
#include "x/x_win32types.h"
namespace x
{
class X_API x_GDIPlus : public x_Graphics
{
public:
x_GDIPlus::x_GDIPlus();
virtual x_GDIPlus::~x_GDIPlus();
x_Bool create(x_WindowHandler windowHandler, x_DeviceContextHandler deviceContextHandler);
void destroy();
void cle... |
#pragma once
#include "Attack.h"
#include <vector>
enum class BlockType
{
High, Low, None
};
enum class AttackType
{
High, Low, None
};
struct CombatComponent
{
Attack* Current_attack = nullptr;
std::vector<Attack> Attacks = std::vector<Attack>();
float Current_timer = 0.0f;
bool Is_current_attack_resolved =... |
#ifndef __IVIEW_HISTORY_SETUP_H
#define __IVIEW_HISTORY_SETUP_H
//-----------------------------------------------------------------------------
#include "IViewWindow.h"
#include "ModelHistoryData.h"
namespace wh{
//-----------------------------------------------------------------------------
class IViewHistorySetup :... |
#ifdef _WIN32
__declspec(dllexport)
#endif
int empty_3()
{
return 0;
}
|
#pragma once
#include "AI.h"
int computer::get_situation()
{
int result = this->get_combination();
if (result >= kare)
{
return nice;
}
else{
if (result >= big_streit)
{
return good;
}
else
{
if (result >= set_t)
{
return normal;
}
else
{
return bad;
}
}
}
}
int compute... |
// Created on: 2002-12-12
// Created by: data exchange team
// Copyright (c) 2002-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 GNU Lesser General Public License version 2... |
#include <vector>
#include <cmath>
#include <cassert>
#include <cstdio>
extern "C" {
#include "bicubic_interpolation.h"
}
#include "energy_structures.h"
////////////////////////////////////////////////////////////////////////////////
////////////////////////AUXILIAR FUNCTIONS NLTVL1///////////////////////////////
b... |
#include<iostream>
using namespace std;
int main(){
char *s = new char;
*s = 'A';
while(*s <= 90){
cout << *s <<" ";
*s = *s + 1;
}
return 0;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.