text stringlengths 8 6.88M |
|---|
// Copyright ©2016 Black Sphere Studios
// For conditions of distribution and use, see copyright notice in "bss_util.h"
#ifndef __C_HEAP_H__BSS__
#define __C_HEAP_H__BSS__
#include "bss_compare.h"
#include "cDynArray.h"
#include <memory>
#include <limits>
namespace bss_util {
template<class T, typename CT_>
stru... |
//Header Files
#include <string>
#include <iostream>
#include <fstream>
#include "HashTable.cpp"
using namespace std;
/**
* @file HashTable.cpp
* @author Henry Huffman
* @version 1.1
* @brief This program (login.cpp) reads in data from a file, place the data into a hashtable, retrieve data and output it to the u... |
#include <MovementComponent.h>
using namespace breakout;
MovementComponent::MovementComponent()
{
}
MovementComponent::~MovementComponent()
{
}
const std::array<float, 2>& MovementComponent::GetVelocity() const
{
return m_velocity;
}
void MovementComponent::SetVelocity(const std::array<float, 2>& velocity)
{
m... |
#include <graphenelib/asset.h>
#include <graphenelib/contract.hpp>
#include <graphenelib/contract_asset.hpp>
#include <graphenelib/dispatcher.hpp>
#include <graphenelib/global.h>
#include <graphenelib/multi_index.hpp>
#include <graphenelib/system.h>
using namespace graphene;
class tableinit : public contract
{
publ... |
// Copyright 2011 Yandex School Practice
#include <gtest/gtest.h>
#include "ltr/measures/measure.h"
#include "ltr/measures/abs_error.h"
#include "ltr/measures/accuracy.h"
#include "ltr/measures/squared_error.h"
#include "ltr/measures/average_precision.h"
#include "ltr/measures/normalized_measure.h"
#include "ltr/data... |
#include <nihttpd/nihttpd.h>
#include <nihttpd/socket.h>
#include <nihttpd/http.h>
#include <iostream>
using namespace nihttpd;
static http_response gen_error_page( http_error err ){
http_response ret;
std::string str = status_string( err.error_num );
std::string cont =
"<!doctype html><html>"
"<head><title>"... |
#include <cstdio>
#include "../include/Judge.h"
#include "../include/Sandbox.h"
#include "../include/OIScoring.h"
using namespace std;
using namespace ACJudge2;
using namespace web;
std::map<Tstring, Language> Judge::languages;
bool Judge::LoadCommands()
{
Tifstream file(T("../lang.cfg"));
if (!file)
return fals... |
#include "GnMeshPCH.h"
#ifdef WIN32
GNMESH_ENTRY void LinkError_GnMeshFunc()
{
return;
}
#endif |
#include "Polygon.h"
namespace P_RVD
{
void Polygon::initialize_from_mesh_facet(
const Mesh* _mesh, t_index _facetIdx
)
{
clear();
Facet temp_facet = _mesh->meshFacets.getFacet(_facetIdx);
Vertex* v1 = add_vertex(
Vertex(
_mesh->meshVertices.getPoint(temp_facet.m_v1),
1.0,
_facetIdx
)
... |
/*
This file is part of SMonitor.
Copyright 2015~2016 by: rayx email rayx.cn@gmail.com
SMonitor 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 ver... |
#ifndef __MAP_TEMPLATE_H__
#define __MAP_TEMPLATE_H__
#include <iostream>
using namespace std;
template <class key__T, class val_T > class map_template
{
private:
struct node
{
node* next;
key__T key;
val_T val;
node() :next(NULL)
{
};
~node()
{
};
};
node* head;
public:
void Add(key__T key,... |
/*
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... |
#include <iostream>
#include "vector.hpp"
Vector::Vector() : m_size(5) {
m_array = new List[m_size];
}
Vector::Vector(const int size) : m_size(size) {
m_array = new List[size];
}
Vector::Vector(const Vector& object) {
m_size = object.m_size;
m_array = new List[m_size];
for (int i = 0; i < m_size;... |
/*
* 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... |
// Voxel.h : main header file for the Voxel DLL
//
#pragma once
#include "DataTypes/vec.h"
#include "Cube.h"
//#include "stdafx.h"
#include "Utility_wrap.h"
#include <memory>
#include "VoxelHash.h"
#include "Graphics/Surfaceobj.h"
#include "sumTable.h"
#define VOXEL_MIN -9999
#define VOXEL_MAX 9999
class VoxelObj
{
... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <cstdio>
#include <cmath>
#define INT_MIN (1<<31)
#define INT_MAX (~INT_MIN)
#define UNREACHABLE (INT_MAX>>2)
#define INF (1e300)
using namespace std... |
#pragma once
#ifndef UNICODE
#define UNICODE
#endif // !UNICODE
#ifndef _UNICODE
#define _UNICODE
#endif // !_UNICODE
#include <tchar.h>
#include <windows.h>
#include <VersionHelpers.h>
#define SafeDelete(x) { delete x; x = 0; }
#define ReleaseCOM(x) {if(x){ x->Release(); x=0;}}
#define DEBUG_BREAK() __debugbreak()... |
/*
Write a program that displays the following pieces of information, each on a separate line:
Your name
Your address, with city, state, and ZIP code
Your telephone number
Your college major
Use only a single cout statement to display all of this information.
Author: Aaron Maynard
*/
#include <iostream>
using namespa... |
#ifndef MacOpSystemInfo_H
#define MacOpSystemInfo_H
#include "modules/pi/OpSystemInfo.h"
#include "modules/hardcore/keys/opkeys.h"
#ifdef DPI_CAP_DESKTOP_SYSTEMINFO
#include "adjunct/desktop_pi/DesktopOpSystemInfo.h"
#endif
#if defined(POSIX_SERIALIZE_FILENAME) && defined(POSIX_OK_FILE)
#include "platforms/posix/pos... |
#pragma once
namespace game {
//コリジョン識別番号
enum class CollisionID {
TekiID,
TekiBulletID,
PlayerID,
PlayerBulletID
};
class CollisionCircle;
//CollisionCircleの仲介役のようなもの
class CollisionData {
//紐づけられているCollisionCircleオブジェクト
CollisionCircle& m_collision;
//削除フラグ
bool deleteFlag = false;
public... |
#ifndef ROOT_THcParmList
#define ROOT_THcParmList
//////////////////////////////////////////////////////////////////////////
//
// THcParmList
//
//////////////////////////////////////////////////////////////////////////
#include "THaVarList.h"
class THcParmList : public THaVarList {
public:
THcParmList() : THa... |
/*****************************************************************************
* ExploringSfMWithOpenCV
******************************************************************************
* by Roy Shilkrot, 5th Dec 2012
* http://www.morethantechnical.com/
**********************************************************... |
#include <iostream.h>
#include <conio.h>
void main(){
clrscr();
int var=7,var2=8;
int *ptr;
ptr=&var;
cout<<"\nValue of var:"<<var;
cout<<"\nAddress of var:"<<&var;
cout<<"\nValue of var (via ptr):"<<*ptr;
cout<<"\nValue of var (via ptr)"<<ptr;
cout<<"\n\nValue of var2:"<<var2;
cout<<"\nAddress of var2:"<<... |
class Solution {
public:
int longestConsecutive(vector<int>& nums) {
unordered_set<int> record(nums.begin(), nums.end());
int ans = 0;
for(int num: nums){
if(!record.count(num-1)){ // only consider the situation that num is the start of consecutive sequence
int en... |
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
reverse(s.begin(), s.end());
vector<string> v = {"dream", "dreamer", "erase", "eraser"};
for(int i=0; i<v.size(); i++) reverse(v[i].begin(), v[i].end());
string t = "";
for(int i=0; i<s.size(); i++){
... |
#include "NTPClient.h"
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include "esp8266.h"
// WiFi objects
IPAddress staticIP(192, 168, 0, 68);
IPAddress gateway(192, 168, 0, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress primaryDNS(8, 8, 8, 8);
IPAddress secondaryDNS(8, 8, 4, 4);
IPAddress... |
/**
* Copyright (c) 2022, 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... |
class names
{
public:
wchar_t firstNames[2];
wchar_t lastNames[2];
names()
{
firstNames[2] = {L"Aaron", "Bob"};
}
}; |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
#pragma once
#include <memory.h>
typedef unsigned __int8 HSUInt8;
typedef unsigned __int32 HSUInt32;
enum HSBIT_STATE{
HSBIT_STATE_INVALID = -2,
HSBIT_STATE_OVERACCESS,
HSBIT_STATE_OFF,
HSBIT_STATE_ON
};
class CHSBits
{
private:
HSUInt8 *pData;
HSUInt32 m_NumberOfBytes;
HSUInt32 m_NumberOfRestBits;
public:
CH... |
// Copyright (c) 2019-2020 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.1 as published
// by the Free Software Foundation, with spe... |
#ifndef CSTATDATATOOL_H
#define CSTATDATATOOL_H
#include <vector>
#include <string>
#include "module_base_def.h"
#include "configfile.h"
struct cJSON;
/** @struct
* @brief 统计选择项,是否进行统计保存
*/
typedef struct _StatRecordItem
{
public:
_StatRecordItem() {
rms[0] = rms[1] = true;
ang[0] = ang[1] = t... |
#ifndef _DISPATCH_H_
#define _DISPATCH_H_
#include "../FormDef.h"
class CDispatch
: public evwork::PHClass
{
public:
DECLARE_FORM_MAP;
// 通用协议处理
void onEnterRoomReply(evwork::Jpacket& packet, evwork::IConn* pConn);
void onEnterRoomFail(evwork::Jpacket& packet, evwork::IConn* pConn);
void onReadyReply(evwork::... |
#pragma once
#include "bricks/java/jobject.h"
#include "bricks/java/jmethoddelegate.h"
namespace Bricks { namespace Java { namespace Lang {
BRICKS_JAVA_QUALIFIED_CLASS_START(ObjectClass, "java/lang/Object");
BRICKS_JAVA_QUALIFIED_CLASS_CONSTRUCTOR_END();
BRICKS_JAVA_QUALIFIED_CLASS_END();
BRICKS_JAVA_QUALIFIED_O... |
#include "stdafx.h"
#include "History.h"
void History::makeUndoRecord(HistoryRecord record)
{
UndoStack.push(record);
}
void History::makeRedoRecord(HistoryRecord record)
{
RedoStack.push(record);
}
History::HistoryRecord History::makeUndo()
{
History::HistoryRecord undo = UndoStack.top();
UndoSt... |
#ifndef __Java_org_cocos2dx_lib_Cocos2dxGreePayment_H__
#define __Java_org_cocos2dx_lib_Cocos2dxGreePayment_H__
#include <string.h>
#include "cocos2d.h"
extern "C"
{
// PaymentItem
jobject createPaymentItemJni(const char *itemId, const char* itemName, double unitPrice, int quantity);
void setImageUrlJni(jobj... |
#include <iostream>
#include <vector>
#include <algorithm>
/*
* The book provides faster solutions for this
*
* The strings don't need to be sorted, they could just use an
* unordered_map to check if two strings are anagrams
*
* The array doesn't need to be sorted. The anagrams just need to be
* grouped togethe... |
#include <iostream>
using namespace std;
int longitud(char *cadena)
{
int c=0;
for(;*cadena!='\0';cadena++)
{
c++;
}
return c;
}
int main()
{
char *cadena= new char[100];
cout<<"Ingrese cadena:"<<endl;
cin>>cadena;
cout<<"LONGITUD DE CADENA ES=>"<<longitud(cadena);
}
|
//
// Collision.cpp
// Project2
//
// Created by William Meaton on 26/01/2016.
// Copyright © 2016 WillMeaton.uk. All rights reserved.
//
#include "Collision.h"
namespace Math {
lineCollide::lineCollide(const Math::Vector2D &v1, const Math::Vector2D &v2){
this->v1 = v1;
this->v2 = v2;
}
... |
#include "Loc.cpp"
using namespace std;
int main(){
Loc ob1(10,20), ob2;
Loc ob3 = ob1;
cout << "Enter a location coordinates (a,b) : " << endl;
cin >> ob2;
cout << "ob1 " << ob1 << endl;
cout << "ob2 " << ob2 << endl;
cout << "ob3 " << ob3 << endl;
++ob1; // incrementing latitude
cout << "ob1 " << ob1 << endl;
... |
#include<vector>
using std::vector;
#include<iostream>
#include<algorithm>
#include<memory>
using std::shared_ptr;
#include<string>
using std::string;
#include<stack>
using std::stack;
#include<queue>
using std::priority_queue;
#include<unordered_map>
using std::unordered_map;
#include<list>
using std::list;
struct L... |
/*
* entity.hpp
*
* @author Jeremy Elkayam
*/
#pragma once
#include "entity.hpp"
#include <iostream>
class Sword : public Entity {
private:
bool active;
public:
Sword(float xcor, float ycor, sf::Texture &texture, float warrior_width, sf::Color color);
//void set_active(bool active){this->active = acti... |
#include <iostream>
#include <vector>
#include <queue>
#define x first
#define y second
using namespace std;
int n, cmd;
vector<pair<int, int>> checkPoint;
queue<int> q;
bool isAvailable(int curCP, int tarCP, int dist){
/* 현재 체크포인트에서 해당 체크 포인트 갈 수 있나 검사 */
/*
1. 그냥 걸어서 도달한다.
2. 걸어서 목표 체크포인트의... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, index;
int arr[1000];
cin>>n;
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
index = min_element(arr, arr+n)-arr;
cout<<"Menor valor: "<<arr[index]<<"\n";
cout<<"Posicao: "<<index<<"\n";
return 0;
}
|
#include <core/macro/try.h>
#include <core/match.h>
#include <core/net/uri/Path.h>
#include <core/operator==.h>
#include <core/sequence/count.h>
#include <core/to.h>
#include <launcher/extends/core/Parse.h>
namespace core {
Result<
launcher::cli::Options,
Union<
launcher::cli::error::BatOption,
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* 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.
*
* @author Alexander Remen (alexr@opera.com)
*
*/
#include "core... |
// #include <boost/multiprecision/cpp_int.hpp>
// using boost::multiprecision::cpp_int;
#include <bits/stdc++.h>
using namespace std;
// ¯\_(ツ)_/¯
#define f first
#define s second
#define p push
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define rep(i, begin, end) for (__typeof(end) i = (begin) -... |
#pragma once
#include "ViewportCapturer.h"
void UViewportCapturer::BeginDestroy()
{
Super::BeginDestroy();
ReleaseFrameGrabber();
}
bool UViewportCapturer::ReleaseFrameGrabber()
{
if (FrameGrabber.IsValid())
{
FrameGrabber->Shutdown();
FrameGrabber = nullptr;
}
return true;
}
bool UViewportCapturer::St... |
/*#include<iostream>
using namespace std;
int main()
{
char input, alphabet=65;
int i, j;
cout << "enter the upper character" << endl;
cin >> input;
for (int i = 1; i <= (input-65 + 1); i++)
{
for (int j = 1;j <= i;j++)
{
cout << alphabet << " ";
}
alphabet++;
cout << "\n";
}
return 0;
}*/
/*#i... |
#include "components/ai/aidsl.hpp"
#include "components/position.hpp"
#include "components/ai/pathai.hpp"
namespace ai {
struct DoAtAI : AIScript {
private:
enum class State {
travel,
activity
};
public:
DoAtAI(point p, AI::timer_t d, AI::timer_t w, std::str... |
//Libraries
#include <stdio.h>
#include <iostream>
#include <unistd.h> // usleep
#include <ucg.hpp>
//Main function
int main()
{
//Print logo
print_uclogo(100000);
//Wait some secs
usleep(1000000);
//Lauch rocket
fly_rocket(300000);
return 0;
}
|
#ifndef MORSE_TRANSLATION_H
#define MORSE_TRANSLATION_H
#include <string>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
class MorseElement
{
public:
char alpha;
string code;
char getAlpha() const {return alpha;};
string getCode() const {return c... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) Opera Software ASA 2004 - 2011
*
* Web server implementation -- overall server logic
*/
#include "core/pch.h"
#ifdef WEBSERVER_SUPPORT
#include "modules/webserver/src/webservercore/webserver_connection_listener.h"
#inclu... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* 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.
*/
#include "core/pch.h"
#include "modu... |
//objmodel.cpp
//Handles storage and rendering of OBJ format models.
//Created by Lewis Hosie
//29-11-11
#include "objmodel.hpp"
#include "renderer.hpp"
//FIXME: Shouldn't use GL commands
#include "glrenderer.hpp"
fvec3 calculateflatnormal(tripoly& thepoly, fvec3* thevecs){
fvec3 a = (thevecs[thepoly.vec[1]]-thevecs... |
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
typedef struct Date{
Date(){};
Date(int _year, int _month, int _day):year(_year),month(_month),day(_day){};
int year;
int month;
int day;
inline void setYear(int _year){ year = _year;};
inline void setMonth(int _month)... |
#ifndef GNANIMATION_H
#define GNANIMATION_H
class Gn2DMeshObject;
GnSmartPointer(GnAnimation);
class GnAnimation : public GnObject
{
GnDeclareFlags(gushort);
GnDeclareRTTI;
GnDeclareAbstractStream;
public:
enum
{
MASK_CREATEDATA = 0x000001,
MASK_MESHSTREAM = 0x000002,
};
class AniInfo : public GnSmartObject... |
int left,right,brake;
void setup() {
Serial.begin(9600);
pinMode(left,INPUT);
pinMode(right,INPUT);
pinMode(brake,INPUT);
}
void loop() {
left=digitalRead(8);
right=digitalRead(9);
brake=digitalRead(10);
if(left==1)
Serial.println('1');
//Serial.print(",");
if(right==1)
Serial.println('2');
//Serial.print(",");
if(br... |
#include <windows.h>
#include "test_world.h"
#include "object.h"
#include "world.h"
#include "renderer_direct3d.h"
#include "mesh.h"
#include "obj.h"
#include "file.h"
#include "memory.h"
static Object create_scaled_box(Renderer* renderer, const Mesh& m, const Vector3& scale, const Vector3& pos, const Color& color, un... |
#ifndef TF_SYNTHESIZER_H_
#define TF_SYNTHESIZER_H_
#include <memory>
#include <string>
#include <vector>
namespace tts {
class TensorflowSynthesizer {
public:
TensorflowSynthesizer();
~TensorflowSynthesizer();
void init(int argc, char* argv[]);
///
/// Load's pretrained TF model.
///
bool load(cons... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define show(x) for(auto i: x){cout << i << " ";}
#define showm(m) for(auto i: m){cout << m.x << " ";}
typedef long long ll;
typedef pair<int, in... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#include "core/pch.h"
#if defined(_N... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* @author Arjan van Leeuwen (arjanl)
*/
#ifndef HASH_H
#define HASH_H
#include "modu... |
#ifndef _ERROR_AERO_H_
#define _ERROR_AERO_H_
#include "../../Toolbox/Toolbox.h"
#include "../Log/Log.h"
#include <assert.h>
namespace ae
{
namespace priv
{
/// \ingroup debugging
/// <summary>
/// Set of function to check standard error
/// (HResult, errno_t, OpenGL errors, .... |
#ifndef ACTIONWIDGET_H
#define ACTIONWIDGET_H
#include <QDialog>
class actionWidget : public QDialog
{
Q_OBJECT
public:
explicit actionWidget(QWidget *parent = nullptr);
void setWindowTitleAndShowThis(const QString &titleName);
signals:
public slots:
};
#endif // ACTIONWIDGET_H
|
#include "GnGamePCH.h"
#include "GStateUILayer.h"
#include "GStateItem.h"
|
//: C10:InitializerDefs.cpp {O}
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
// Definicje dla pliku Initializer.h
#include "Initializer.h"
// Statyczna inicjalizacja spowoduje
// wyzerowanie w... |
#include <stdlib.h>
#include <stdio.h>
#define WEAK __attribute__ ((weak))
// #include "uart.hpp"
// #include "gpio.hpp"
#include "LPC17xx.h"
// #include "lpc17xx_nvic.h"
void *operator new(size_t size) throw() { return malloc(size); }
void operator delete(void *p) throw() { return free(p); }
// UART *dbg = 0;
//... |
#include "sender.h"
Sender::Sender()
{
setupUi(this);
/******************************* UDP *****************************************/
socket = new QUdpSocket(this);
connect(socket, SIGNAL(readyRead()), this, SLOT(donneesRecues()));
tailleMessage = 0;
}
void Sender::on_btnbind_clicked()
{
textEdit... |
/*
* ThreeDObject.cpp
* 02564_Framework
*
* Created by J. Andreas Bærentzen on 02/02/10.
* Copyright 2010 __MyCompanyName__. All rights reserved.
*
*/
#include <CGLA/Quatf.h>
#include <CGLA/Mat4x4f.h>
#include "ThreeDObject.h"
using namespace CGLA;
using namespace Mesh;
using namespace std;
namespace GLGr... |
#include<iostream>
#include<set>
#include<vector>
#include<cmath>
#define FOR(i,n) for(i=0;i<n;i++)
using namespace std;
int main()
{
set<vector<int>>s;
set<vector<int>>::iterator it;
vector<int>v;
string input,tmp;
int i,j,ni=0,qnum,period,t,k;
while(1)
{
getline(cin,input);
if(input=="#")... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "GameFramework/Actor.h"
#include "Grid.generated.h"
UCLASS()
class MEMORYMATRIXPROVA_API AGrid : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AGrid();
protected:
... |
//
// Created by heyhey on 20/03/2018.
//
#include "ExpressionUnaire.h"
ExpressionUnaire::ExpressionUnaire() {}
ExpressionUnaire::~ExpressionUnaire() {
}
ostream &operator<<(ostream &os, const ExpressionUnaire &unaire) {
os << static_cast<const Expression &>(unaire);
os << endl;
return os;
}
Expressio... |
//所用算法:DFS+回溯 ,记忆化搜索
//使用maxx数组存从当前点开始化的最大距离
//然后套dfs模板,并存以各点为起点的最长距离
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,m;
int a[110][110];//存图
bool use[110][110];//是否用过
int maxx[110][110];//记忆距离
int ax[5]={1,-1,0,0};
int ay[5]={0,0,1,-1};
int ans=-1;
int dfs(int,int);
... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 10e10
#define rep(i,n) for(int i=0; i<n; i++)
#define r... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
//
// Copyright (C) 1995-2007 Opera Software ASA. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
//
// Patricia Aas
//
#include "core/pch... |
#ifndef OFXCOMMANDPROCESSORTHREADH
#define OFXCOMMANDPROCESSORTHREADH
class ofxCommandProcessorThread {
protected:
//HANDLE thread_handle_;
// bool thread_active_;
public:
/*
ofxCommandProcessorThread()
:thread_handle_()
,thread_active_(false)
{
}
*/
virtual bool start() = 0;
/*
thread_handle_ = (HAND... |
#include <bits/stdc++.h>
using namespace std;
struct Job{
int d, p;
Job(int d = 0, int p = 0) : d(d), p(p) {}
bool operator < (const Job& rhs) const {
return d < rhs.d;
}
Job operator + (const Job& rhs) const {
return Job(d + rhs.d,p + rhs.p);
}
};
const int maxn = 1e5 + 10;... |
class FoodbeefCooked
{
weight = 0.25;
};
class FoodmuttonCooked
{
weight = 0.25;
};
class FoodchickenCooked
{
weight = 0.25;
};
class FoodrabbitCooked
{
weight = 0.25;
};
class FoodbaconCooked
{
weight = 0.25;
};
class FoodGoatCooked
{
weight = 0.25;
};
class FoodGoatRaw
{
weight = 0.25;
};
class FoodmuttonRaw
{... |
#include "string_util.h"
namespace sloth {
std::string loadStringFromFile(const char * filepath)
{
// 1. Retrieve the vertex/fragment source code from filePath
std::string str;
try
{
// Open files
std::ifstream file(filepath);
std::stringstream stream;
// Read file's buffer contents into stream
... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "EditorGridTick.h"
#include <string>
using namespace std;
// Sets default values
AEditorGridTick::AEditorGridTick()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't nee... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2002 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef DOM_FEEDCONTENT_H
#define DOM_FEEDCONTENT_H
#ifdef WE... |
#include<bits/stdc++.h>
using namespace std;
int a[1000];
int find(int k){
if(k==1)
return a[1];
if(k==2)
return a[2];
if(k%2 == 1)
return find(k/2)*10 + 4;
return find(k/2-1)*10 + 7;
}
int main(){
a[1] = 4;
a[2] = 7;
int k;
cin >> k;
cout << find(k);
} |
#include "Obstacle.h"
#include "../CSC8503Common//StateTransition.h"
#include "../CSC8503Common/StateMachine.h"
#include "../CSC8503Common//State.h"
//#include "../GameTech/TutorialGame.h"
using namespace NCL;
using namespace CSC8503;
Obstacle::Obstacle() {
float x = rand() % 20 - 10;
float z = rand() % 5 + 1;
fl... |
#pragma once
#include "color.h"
#include "math.h"
class PointLight
{
public:
Vec3 pos;
RGB color;
PointLight( Vec3 p , RGB c ) : pos(p) , color(c) {};
};
class Directional
{
public:
Vec3 dir;
RGB color;
Directional( Vec3 d , RGB c ) : dir(d) , color(c) {};
}; |
#ifndef DEMONSUMMON_H
#define DEMONSUMMON_H
#include <iostream>
#include "Spell.h"
#include "../units/Warlock.h"
class DemonSummon : public Spell {
private:
int demonNumber;
public:
DemonSummon(int magicDamage = static_cast<int>(DEMONSUMMON::STANDARD), int cost = static_cast<int>(DEMONSUMMON::... |
//
// 8.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()
{
string colour1, colour2;
cout<<"Please enter two primary colours (red, blue or yellow): ";
cin>>colour1>>colou... |
#include "recorder.h"
Recorder::Recorder(bool t, bool r, bool n, QWidget *parent, Qt::WFlags flags) {
noPlot = n;
record = r;
trigger = t;
QWidget *centralWidget = new QWidget();
QGridLayout *layout = new QGridLayout();
centralWidget->setLayout(layout);
setCentralWidget(centralWidget);
plotWidget = new MeanPlo... |
#include<bits/stdc++.h>
using namespace std;
vector<int>as;
main()
{
int n, m;
while(cin>>n>>m)
{
int x, i, j;
for(x=0; x<m; x++)
{
cin>>i;
as.push_back(i);
cin>>j;
as.push_back(j);
}
i=1;
cout<<n-1<<endl;
... |
//
// Trigonometry.h
// Odin.MacOSX
//
// Created by Daniel on 21/09/15.
// Copyright (c) 2015 DG. All rights reserved.
//
#ifndef Odin_MacOSX_Trigonometry_h
#define Odin_MacOSX_Trigonometry_h
#include <cmath>
#include "Vector2.h"
#include "Vector3.h"
#include "Vector4.h"
namespace odin
{
namespace math
... |
#include "core.h"
double* ArrayIn(int size)
{
double *array = new double[size];
for (int i = 0; i < size; i++)
array[i] = EnterDouble();
return array;
} |
#include "sphere.h"
bool Sphere::hit(const Ray& r, float t_min, float t_max, HitDesc& desc) const
{
glm::vec3 oc = r.origin - center;
auto a = glm::dot(r.direction, r.direction);
auto b = glm::dot(oc, r.direction);
auto c = glm::dot(oc, oc) - radius * radius;
float d = b * b - a * c;
if (d > 0.0f) {
float tem... |
/*
SegaCDI - Sega Dreamcast cdi image validator.
DisjointCollection.h - Creates a copy of a collection and provides utilities for
iterating and enumerating through the collection.
Dec 30th, 2016
- Initial creation.
*/
#pragma once
#include "../stdafx.h"
#include <iterator>
#include "FlatMemoryIte... |
#include <stdio.h>
#include <iostream>
#include <cstdio>
#include <ctime>
#include "brick_servo.h"
#include "bricklet_joystick.h"
#include "ip_connection.h"
#define HOST "localhost"
#define PORT 4223
#define UID_SERVO "6CRBxX"
#define UID_JOYSTICK "w6J"
std::clock_t start_count;
// Timer
std::clock_t s_timer_1;
st... |
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <stdexcept>
#include <GL/glut.h>
#include "wavefront_obj.h"
namespace {
using double2 = wavefront_obj_t::double2;
using double3 = wavefront_obj_t::double3;
double... |
int rtp_recv_init();
int main(int argc,char **argv)
{
rtp_recv_init();
}
|
#include <iostream>
using namespace std;
int main()
{
int years;
int money;
int moneyAnnually
cout<<"Enter the years you are saving for"<<endl;
cin<<years;
cout<<"Enter the amount of money you are saving daily"<<endll;
cin<<money;
moneyAnnually = money * 365;
int yearsRemaining
... |
#include "ActionManager.h"
#include "Core.h"
ActionManager::ActionManager(void)
{
}
ActionManager::~ActionManager(void)
{
}
void ActionManager::init(typeplayercontrol control[2])
{
playertype[0]=control[0];
playertype[1]=control[1];
keylimit=2;
setfirstkeys();
for (int i=0;i<keylimit;i++)
{
playeractions[i].... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 2011 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
group "posix.pi.networkinterface";
require POSIX_OK_NETWORK;
import "pi.opnetworkinterface";... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
//
// Copyright (C) 1995-2003 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 "LinksPanel.h"
#include "adjunc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.