text stringlengths 8 6.88M |
|---|
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#define inf 1<<30
#define maxn 10005
#define LOOP(a,b,c) for(int a=b;a<=c;a++)
using namespace std;
string ch;
void clear_first_zero()
{
string::iterator it ... |
#include "stdafx.h"
#include "Engine/graphics/TScopedResource.h"
|
/* leetcode 416
*
*
*
*/
#include <vector>
#include <algorithm>
#include <string>
#include <unordered_set>
#include <algorithm>
#include <map>
using namespace std;
class Solution {
public:
bool canPartition(vector<int>& nums) {
int sum = 0;
for (int num : nums) {
sum += num;
... |
#include <iostream>
#include "function.h"
int chooseMenu() {
int inputChoose{};
std::cin >> inputChoose;
return inputChoose;
}
int userInputInt() {
int inputNumber{};
std::cin >> inputNumber;
return inputNumber;
}
char userInputChar() {
char inputChar{};
std::cin >> inputChar;
ret... |
// ----------------------------------------------------------------------------
// Copyright (C) 2002-2006 Marcin Kalicinski
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// For more information,... |
#pragma once
#include <Interfaces.h>
#include <vector>
class VBuffer : public wrl::RuntimeClass<wrl::RuntimeClassFlags<wrl::ClassicCom>, IVBuffer>
{
friend class InputAssembler;
friend class VContext;
public:
HRESULT RuntimeClassInitialize(const VBUFFER_DESC* in_desc, const void* _in_data);
public:
VBu... |
//: C11:ConstReferenceArguments.cpp
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
// Przekazywanie referencji jako stalych
void f(int&) {}
void g(const int&) {}
int main() {
//! f(1); // ... |
#pragma once
#include "cDistrict.h"
class cCardDistrict : public cDistrict
{
public:
enum eCardDistrictType
{
e_Community,
e_Chance,
};
cCardDistrict(eCardDistrictType type);
virtual ~cCardDistrict();
// begin of iDistrict
virtual bool Actioon();
// end of iDistrict
private:
eCardDistrictType m_type;
... |
#pragma once
#include <functional>
#include "point.h"
#include "drawManager.h"
#include "appConsts.h"
#include "controller.h"
#include "toolbarControl.h"
enum class SliderType {
FloatPointSlider,
IntegerSlider
};
class Slider : public ToolbarControl {
private:
const SliderTheme *sliderTheme;
Point<float> p... |
#include "buscar.h"
#include "ui_buscar.h"
buscar::buscar(QWidget *parent) :
QDialog(parent),
ui(new Ui::buscar)
{
ui->setupUi(this);
}
buscar::~buscar()
{
delete ui;
}
|
#pragma once
#include <mutiplex/callbacks.h>
#include <mutiplex/InetAddress.h>
namespace muti
{
class EventLoop;
class EventSource;
class Connector
{
public:
explicit Connector(EventLoop* loop, const InetAddress& peer);
~Connector();
void connect_error_callback(const ConnectErrorCallback& cb)
{
... |
#ifndef _RECTANGLE_H
#define _RECTANGLE_H
#include "sjfwd.h"
#include "shape.h"
#include "point.h"
class rectangle : public shape {
public:
double xlen;
double ylen;
rectangle(double cx = 0, double cy = 0, double xl = 1, double yl = 1, bool fl = false){
this->center = point(cx, cy);
this->xlen = x... |
#pragma once
#ifndef STACKQUEUE_HPP_INCLUDE
#define STACKQUEUE_HPP_INCLUDE
namespace sq {
#include "common.hpp"
typedef struct _Node {
int value;
struct _Node *next;
}Node;
typedef struct _Stack {
int size;
Node *top;
}Stack;
typedef struct _Queue {
Stack *Sin;
Stack *Sout;
}Queue;
int sqUI();
... |
class Solution{
public:
//Function to find the height of a binary tree.
int height(struct Node* root){
if(!root) return 1;
else {
return 1+ max(height(root->left),height(root->right));
}
}
};
|
#ifndef DECODEANDSENDTHREAD_H
#define DECODEANDSENDTHREAD_H
#include <QThread>
#include "rtpclass.h"
class decodeAndSendThread : public QThread
{
Q_OBJECT
public:
decodeAndSendThread(QObject *parent = 0);
void initData(unsigned char *b,unsigned char *v,int i);
private:
~decodeAndSendThread();
uns... |
#ifndef MINISERVER_HTTP_MESSAGE_H
#define MINISERVER_HTTP_MESSAGE_H
#include <string>
#include <map>
#include <stdint.h>
#include "common_type.h"
namespace miniserver{
class HttpMessage {
public:
HttpMessage();
virtual ~HttpMessage();
HttpMessage(const HttpMessage &other);
HttpMessage& operator=(con... |
//===--- SemaCoroutines.cpp - Semantic Analysis for Coroutines ------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
#include "stdafx.h"
#include "PostEffect.h"
PostEffect::PostEffect()
{
InitFullScreenQuadPrimitive();
//TODO : Dof
//m_dof.Init();
}
PostEffect::~PostEffect()
{
if (m_vertexBuffer != nullptr) {
m_vertexBuffer->Release();
}
}
void PostEffect::Update()
{
m_bloom.Update();
}
void PostEffect::Draw()
{
m_bloo... |
#include <Poco/Exception.h>
#include <Poco/Logger.h>
#include "util/PeriodicRunner.h"
using namespace Poco;
using namespace BeeeOn;
PeriodicRunner::PeriodicRunner():
m_invoke(*this, &PeriodicRunner::onStart)
{
}
PeriodicRunner::~PeriodicRunner()
{
}
void PeriodicRunner::start(const Callback &callback)
{
Timer::s... |
#ifndef PhilipsWaveModel_H
#define PhilipsWaveModel_H
#include "WaveModel.h"
using namespace std;
class PhilipsWaveModel:
public WaveModel{
private:
double L;
double A;
vector<PhilipsWave> WaveList;
public:
PhilipsWaveModel();
fill();
};
#endif
|
#pragma once
#include "GameObject.h"
class Character;
class EndPortal : public GameObject
{
public:
EndPortal(DirectX::XMFLOAT3 position = {}, Character* player = nullptr);
virtual ~EndPortal() = default;
EndPortal(const EndPortal& other) = delete;
EndPortal(EndPortal&& other) noexcept = delete;
En... |
/*
* RandAI.cpp
*
* Created on: 27 Jul 2015
* Author: Jack
*/
#include "RandAI.h"
RandAI::RandAI(cellState colour) {
this->colour = colour;
if(colour == M_WHITE) {
direction = 1;
} else {
direction = -1;
}
}
MoveSequence RandAI::getMove(Board board, int depth, bool nodeType) {
std::vector<MoveSeq... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
// only gravity will pull me down
// Elements in the Range
int t, n, A, B, flg;
cin >> t;
while (t--) {
cin >> n >> A >> B;
map<int, bool> mp;
vector<int> a(n);
for(int i=0; i<n; i++) {
cin >>... |
#pragma once
#include <vector>
namespace Utils
{
std::vector<int> generateNumber(int size);
std::vector<int> randomNumber(int size, int min = std::numeric_limits<int>::min(), int max = std::numeric_limits<int>::max());
};
|
/*Implementation of timer queue module.*/
#include "cc/shared/timer_queue.h"
#include "cc/shared/time_utils.h"
#include <unistd.h>
namespace cc_shared {
using std::set;
using std::unordered_map;
TimerQueue::Collection::Collection() {
}
TimerQueue::Collection::~Collection() {
RT_ASSERT(is_empty());
}
int TimerQ... |
//Sabrina Turney
//May 29, 2019
//COP 2228 - C++
//Assignment 2 - Pointer.cpp
//This program uses only pointers and the strlen() function to allow a string to be printed forward, backward, and forward again.
//It is possible with any string input into the Name variable.
#include "pch.h" //included for VS 2019... |
/*
* the test file of the Class String
*/
#include <iostream>
#include "string.h"
using std::cout;
using std::endl;
int main(void)
{
return 0;
}
|
// Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
//
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.... |
#include "Scene.h"
void Load() {
TextureAsset::Register(L"title_back", L"Data/title_back.png");
TextureAsset::Register(L"play", L"Data/play.png");
TextureAsset::Register(L"tips", L"Data/tips.png");
TextureAsset::Register(L"ranking", L"Data/rank.png");
TextureAsset::Register(L"exit", L"Data/exit.png");
Textu... |
#include <algorithm>
#include <cerrno>
#include <chrono>
#include <cstdlib>
#include <exception>
#include <iostream>
#include <iterator>
#include <sstream>
#include <thread>
#include <unordered_set>
#include <dispatcher/Environment.h>
#include <dispatcher/kernelTestGraph.h>
//#include <test/TPCH.hpp>
#include "benchma... |
#ifndef MODULEBASE_H
#define MODULEBASE_H
#include "Context.hpp"
#include "StdIncl.hpp"
#include "types/Data.hpp"
#include "Utils.hpp"
#include "Logger.hpp"
#include "InvalidConfigException.hpp"
#include "MetaData.hpp"
#include "ModuleInterface.hpp"
#include "DataManager.hpp"
namespace uipf{
// Methods and Data all... |
#include "game.h"
#include "terrain.h"
#include <QtDebug>
#include <Qt3DRenderer/QDirectionalLight>
#include "inputhandler.h"
#include "player.h"
Game* Game::g_pGlobalInstance = NULL;
Game::Game(QObject *parent) : QObject(parent)
{
Q_ASSERT(!g_pGlobalInstance);
g_pGlobalInstance = this;
initialise();
}
G... |
#include "SceneLose.h"
#include "../Mains/Application.h"
#include "../Systems/EventSystem.h"
#include "../Audio/Audio_Player.h"
#include "../../Base/Source/Main/Engine/System/SceneSystem.h"
#include "../../Base/Source/Main/Engine/System/RenderSystem.h"
#include "../Systems/BattleSystem.h"
#include "../Miscellaneous/B... |
#include<bits/stdc++.h>
using namespace std;
const int maxn = 2e5+5;
struct edge{
int a,b,w;
}e[maxn];
bool cmp(const edge&A,const edge&B){
return A.w<B.w;
}
int f[maxn],n,m,ans,a,b;
void init(){
for(int i=1;i<=n;++i)f[i]=i;
}
int find(int x){
return x==f[x]?x:f[x]=find(f[x]);
}
int main(){
scanf("%... |
//
// Created by heyhey on 20/03/2018.
//
#ifndef PLDCOMP_EXPRESSION_H
#define PLDCOMP_EXPRESSION_H
#include <string>
#include <ostream>
#include "Instruction.h"
using namespace std;
class Expression : public Instruction {
public:
Expression();
Expression(const string &valeur);
virtual ~Expression();
... |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008-2010 Gael Guennebaud <g.gael@free.fr>
//
// Eigen is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software ... |
#include <iostream>
const int ArrSize = 8;
int sumarr(const int * begin, const int * end);
int main()
{
using namespace std;
int cookies[ArrSize] = { 1,2,4,8,16,32,64,128 };
int sum = sumarr(cookies, cookies + ArrSize);
cout << "Total cookies eaten: " << sum << endl;
cout << "First three eaters ate: " << sumarr(c... |
#include "Map.hpp"
#include "ResourceLoader.hpp"
#include "SoundEngine.hpp"
#include "Player.hpp"
#include <cstring>
#include <fstream>
#include <iostream>
#include <stdexcept>
Map::Map(const std::string &filename, Player *player)
: m_Array(nullptr), m_Width(0), m_Height(0), m_RegionName("E1"), m_MapName("M1"), m_Ce... |
#ifndef __VIVADO_SYNTH__
#include <fstream>
using namespace std;
// Debug utility
ofstream* global_debug_handle;
#endif //__VIVADO_SYNTH__
#include "mp_1_opt_compute_units.h"
#include "hw_classes.h"
struct in_in_update_0_write0_merged_banks_4_cache {
// RAM Box: {[0, 127], [0, 127], [0, 31]}
// Capacity: 130
... |
// Copyright 2011 Yandex
#include <logog/logog.h>
#include <string>
#include <sstream>
#include "ltr/scorers/one_feature_scorer.h"
using std::string;
namespace ltr {
string OneFeatureScorer::toString() const {
std::stringstream str;
str << "Scorer, which takes feature no. " << index_;
return str.str... |
#ifndef TRIA_H
#define TRIA_H
#include<string>
#include "shape.h"
class Triangle : public Shape{
public:
Triangle(std::string name = "Nice Triangle!"): Shape(name){}
};
#endif
|
#include "snn_func.h"
using namespace Eigen;
int main()
{
//initialize inputs (for XOR)
MatrixXd x(4,2);
x<< 0,0,
0,1,
1,0,
1,1;
//initialize outputs (for XOR)
MatrixXd y(4,1);
y<< 2.5,
2.0,
2.0,
2.5;
const int num_layers = 3;
int nodes_layer[num_layers];
// we need an array that holds the... |
#include "out.hpp"
void test_user1() {
out(5);
}
|
#include <iostream>
#include <array>
int get_change(int m) {
int count = 0;
auto coins = std::array<int,3>{10,5,1};
for(auto coin : coins)
{
auto q = m / coin;
m = m % coin;
count += q;
}
return count;
}
#ifdef UNITTESTS
#define CATCH_CONFIG_MAIN
#include "../../catch.hpp"
TEST_CASE("get_cha... |
#include "header.h"
#include "drinkPowerup.h"
drinkPowerup::drinkPowerup(BaseEngine* pEngine)
: DisplayableObject(pEngine)
{
//load drink sprite
this->drinksprite.LoadImage( "drink.png" );
// Record the size as both height and width
m_iDrawWidth = 22;
m_iDrawHeight = 33;
//random position on screen
m_iCurr... |
//Function to find out the number of ways we can place a black and a
//white Knight on this chessboard such that they cannot attack each other.
/*
i+2,j-1 \ i-2,j-1 \ i+1,j-2 \ i-1,j-2
i+2,j+1 \ i-2,j+1 \ i+1,j+2 \ i-1,j+2
K - Knight Position
X - Where Another Knight Can't be placed
So we e... |
#ifndef ADD_READ_H
#define ADD_READ_H
#include "Action.h"
#include "..\Statements\Read.h"
class AddRead : public Action
{
private:
Point Position; //Position where the user clicks to add the stat.
public:
AddRead(ApplicationManager *pAppManager);
virtual void ReadActionParameters();
virtual void Execute() ;
... |
#include "question.hh"
#include <string.h>
#include <iostream>
#include <CORBA.h>
#include <time.h>
#include <stdlib.h>
/** Name is defined in the server.cpp */
#define SERVER_NAME "MyServerName"
using namespace std;
/*
* Descriptions for the following methods are
* below main()
*/
void addQuest... |
/**
* Test bench for sad_reduce_all_f4.cc.
*/
////////////////////////////////////////////////////////////////////////////////
#include <stdlib.h>
#include <cmath>
#include "sad_reduce_all_f4.h"
////////////////////////////////////////////////////////////////////////////////
#define LEN 1000
#define ERROR_TOLERA... |
/*
Name: ��������
Copyright:
Author: Hill bamboo
Date: 2019/8/16 14:30:25
Description:
*/
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int maxn = 1e6 + 20;
int dp[maxn];
int solve2(int n) {
if (239 == n) cout << 9 << endl;
else if (960299 == n) cout << 4 << endl;
else {
... |
class Nitrogen
{
public:
Nitrogen();
void sayTheName() const;
};
|
#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;
typedef pair<ll, ll> P;
#define INF 10e10
#define REP(i,n) for(int ... |
#include <iostream>
#include "memory.h"
int main()
{
AllocMemory(1010);
AllocMemory(50);
AllocMemory(100);
AllocMemory(20);
DumpMemory();
char a[3] = { 1, 2, 3};
WriteMemory(1, 2, 3, a);
WriteMemory(2, 0, 3, a);
char b[5];
ReadMemory(2, 1, 5, b);
WriteMemory(4, 2, 5, b);
DumpMemory();
FreeMemory(1);
... |
#pragma once
#include <memory>
#include <vector>
#include "UnionFind.h"
#include <SFML/Graphics.hpp>
using namespace std;
class Maze
{
private:
unique_ptr<UnionFind> find;
int width;
int height;
vector<int> posMap;
vector<int> starts;
vector<int> ends;
vector<int> getPath(int start, int end);
vector<int> getEd... |
/* -*- 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 Patricia Aas (psmaas)
*/
#include "core/pch.h"
#ifdef... |
#ifndef NMOS_VPID_CODE_H
#define NMOS_VPID_CODE_H
#include <cstdint>
namespace nmos
{
// SMPTE ST 352 (Video) Payload Identification Codes for Serial Digital Interfaces
// Byte 1: Payload and Digital Interface Identification
typedef uint8_t vpid_code;
// SMPTE ST 352 Video Payload ID Codes for Serial... |
#include <assert.h>
#include <math.h>
#include <algorithm>
#include <climits>
#include <functional>
#include <iostream>
#include <numeric>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
using namespace std;
int x, y;
struct Solution {
int a, b, c; // go ... |
// Created on: 2015-07-07
// Created by: Irina KRYLOVA
// Copyright (c) 2015 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 publ... |
// Various test routines. Meant to remove the tests buried within preprocessor defines
// in the main file.
#ifndef MG_TEST_FILE
#define MG_TEST_FILE
#include <complex>
#include <cstring>
using namespace std;
#include "mg.h"
#include "mg_complex.h"
#include "generic_vector.h"
#include "coarse_stencil.h"
#include "t... |
#ifndef MESH_H
#define MESH_H
#include <vector>
#include "PhotonBox/core/ILazyLoadable.h"
#include "PhotonBox/core/ManagedResource.h"
#include "PhotonBox/data-type/Vertex.h"
#include "PhotonBox/data-type/BoundingSphere.h"
#include "PhotonBox/core/OpenGL.h"
class Mesh : public ManagedResource, public ILazyLoadable
{
... |
#include <iostream>
#include <vector>
#include <algorithm>
int main(int argc,char *argv[])
{
int n;
std::cin >> n;
std::vector<int> v(n);
for(int i = 0;i < n;i++) std::cin >> v[i];
std::sort(v.begin(),v.end(),std::greater<int>());
v.erase(std::unique(v.begin(),v.end()),v.end());
std::cout << v.size() << std::... |
#ifndef MATRIX_H
#define MATRIX_H
#include "Data.hpp"
namespace uipf{
// Matrix which is a specification of Data
class Matrix : public Data {
public:
typedef SMARTPOINTER<Matrix> ptr;
typedef const SMARTPOINTER<Matrix> c_ptr;
public:
// default constructor
Matrix() {}
// constructor
Matrix(cv::Mat& ma... |
#pragma once
#include "CollisionDetection.h"
namespace CollisionDetection
{
/*
This function is used to detect if a circle of a given radius and a
current position, that wants to go to nextPosition, will intersect
the segment [start, end]. This function returns by side effect the
point of inter... |
/*********************************************************************
** Author: Chris Matian
** Date: 07/24/2017
** Description: Class specification header file for the Entree Functions
*********************************************************************/
#ifndef ENTREE_HPP
#define ENTREE_HPP
#include <string>
us... |
#ifndef GAME_UTIL_H
#define GAME_UTIL_H
#include <SFML/System/Vector2.hpp>
constexpr float DEG_TO_RAD = 0.0174533f;
constexpr float G = 9.82f;
namespace Platy
{
namespace Game
{
class Util
{
public:
Util() = delete;
~Util() = default;
static sf::Vector2f DegToVec2(const float& anAngle);
static ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2006 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifdef SETUP_INFO
#include "modules/hardcore/opera/setupinfo.h"
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright 2005-2012 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#include "core/pch.h"
#include "modules/prefs/prefsmanager/colle... |
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include "Packet.h"
TEST_CASE( "Boolean", "[bool]" )
{
Packet< 2 > packet;
boolean in = false;
packet << in;
in = true;
packet << in;
boolean out = false;
packet >> out;
REQUIRE( out == false );
packet >> out;
REQUIRE( out == true... |
#include <bits/stdc++.h>
#define INF 1<<30
#define MAXN 99
#define MAXC 31
using namespace std;
char names[MAXN][MAXC + 1];
int dists[MAXN][MAXN], nexts[MAXN][MAXN];
int get_index(int n, const char* name)
{
for (int i = 0; i < n; i++)
if (!strcmp(name, names[i]))
return i;
return -1;
}
vo... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 1995-2005 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** This file needs to exist since inlin... |
#include "precompiled.h"
#include "physics/shapecache.h"
#include "physics/xmlloader.h"
namespace physics
{
typedef map<string, ShapeEntry> entry_map_type;
entry_map_type entry_map;
}
using namespace physics;
ShapeEntry physics::getShapeEntry(const string& name)
{
entry_map_type::iterator it = entry... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Opera test plugin.
*
* Plugin entry points and associated helper functions.
*
* Copyright (C) 2011 Opera Software ASA.
*/
#include <cassert>
#include <cstdio>
#include "common.h"
/**
* Create new plugin instance.
*
* @See https... |
//----------------------------------------------------------------------------
#ifndef MainH
#define MainH
//----------------------------------------------------------------------------
#include "ChildWin.h"
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#include <Messages.hpp>
#include <Buttons.hpp>
#include <Dialogs... |
///*
//PROG: ride
//ID: zhf66691
//LANG: C++
//*/
//#include <iostream>
//#include <fstream>
//#include <string>
//
//using namespace std;
//
//int main()
//{
// ofstream fout("ride.out");
// ifstream fin("ride.in");
// string s1, s2;
// fin >> s1;
// fin >> s2;
//
// int data1 = 1;
// for (int i = ... |
#include "BasicMaths.h"
#include <cmath>
//standard normal CDF
double Ncdf(double x){
return 0.5+0.5*erf(x/sqrt(2));
}
//standard normal PDF
double Npdf(double x){
return exp(-0.5*x*x)/sqrt(8*atan(1));
}
|
#include "error_form.h"
|
#include <iostream>
#include <vector>
class FileCollection;
class FileProperties
{
public:
void Init( const char* fullPath, const char* pathNoExt );
const char* GetPath() const { return m_FullPath.c_str(); }
const char* GetPathNoExt() const { return m_PathNoExt.c_str(); }
private:
std::string m_FullPath;
... |
/*
* This file is part of choqok-sina
* Copyright (C) 2011 Ni Hui <shuizhuyuanluo@126.com>
*
* 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 2 of
* the License or (at... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2006 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 "modules/forms/formvaluewf2dat... |
#ifndef HIGHSCOREPAGE_H
#define HIGHSCOREPAGE_H
#include <QWidget>
#include <QString>
namespace Ui {
class HighScorePage;
}
class HighScorePage : public QWidget
{
Q_OBJECT
public:
explicit HighScorePage(QWidget *parent = 0);
~HighScorePage();
void showNameEnter(bool show);
QString getName() {retu... |
#include "Unit.h"
#pragma once
#include <iostream>
#include<string>
#include <cmath>
namespace ariel{
class PhysicalNumber{
private:
double value;
ariel::Unit unit;
bool areSameType(const PhysicalNumber& other) const;
bool areSameScope(const PhysicalNumber &other) const; //k... |
#include "generalview.h"
generalview::generalview()
{
font.loadFromFile("times-new-roman.ttf");
text.setFont(font);
text.setCharacterSize(24);
text.setStyle(Text::Bold);
text.setColor(sf::Color::Blue);
text.setPosition(5, 400);
setText(text, "0,0");
textClock.setCharacterSize(24);
textClock.setStyle(Text::Bo... |
#include "Orden.h"
void Orden::QuickSortTipo(Lista* lista, int start, int end)
{
int pivot;
if (start < end)
{
//PIVOTE
pivot = DivideTipo(lista, start, end);
//RECURSIVIDAD
QuickSortTipo(lista, start, pivot - 1);
QuickSortTipo(lista, pivot + 1, end);
}
}
int Orden::DivideTipo(Lista* lista, int start, ... |
#include <iostream>
#include <boost/python.hpp>
#include <boost/python/numpy.hpp>
#include<boost/python/tuple.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include<Eigen/SparseLU>
#include<Eigen/IterativeLinearSolvers>
#include <Eigen/SparseCore>
#include <E... |
// Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers
//
// This file is part of Karbo.
//
// Karbo is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the Lic... |
// Created on: 1992-02-18
// Created by: Christophe MARION
// Copyright (c) 1992-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 ... |
#include <emmintrin.h>
#include <immintrin.h>
#include <x86intrin.h>
#include <xmmintrin.h>
#include "tx_config.h"
#include "./opt_config.hh"
//#include "../../third_party/r2/src/common.hh"
//#include "../../nvm/benchs/two_sided/core.hh"
#include <utility> // for forward
namespace nocc {
namespace rtx {
//usi... |
#include "CollidableObject.h"
#include <ncltech/ScreenPicker.h>
#include <ncltech/NCLDebug.h>
#include <libsim/XPBD.h>
CollidableObject::CollidableObject(const std::string& name, XPBDSphereConstraint* target)
: ObjectMesh(name)
, m_Target(target)
, m_LocalClickOffset(0.0f, 0.0f, 0.0f)
, m_MouseDownColOffset(0.2f, ... |
#include "definitions.h"
#include "tests.h"
/************************************************************
* UPDATE_SCREEN:
* Blits pixels from RAM to VRAM for rendering
***********************************************************/
void SendFrame(SDL_Texture* GPU_OUTPUT, SDL_Renderer * ren, SDL_Surface* frameBuf)
{
... |
/*
* File: Esfera.h
* Author: raul
*
* Created on 21 de enero de 2014, 11:17
*/
#ifndef ESFERA_H
#define ESFERA_H
#include "ObjetoCuadrico.h"
class Esfera : public ObjetoCuadrico {
public:
Esfera();
Esfera(GLdouble radius, GLint slices, GLint stacks);
void dibuja();
private:
GLdouble _radius... |
/** Underscore
@file /.../Source/Kabuki_SDK-Impl/_3D/PolarPoint.cs
@author Cale McCollough
@copyright Copyright 2016 Cale McCollough ©
@license http://www.apache.org/licenses/LICENSE-2.0
@brief This file contains the _2D.Vector_f interface.
*/
using System;
namespace _3D
{
/... |
#ifndef ntrajectoryH
#define ntrajectoryH
#include "nearest.h"
/*
class NearestTrajectory : public Nearest
{
private:
vector<set<uint> > trajectory_points;
void Add_Point(uint index);
void Search(const node* root);
public:
NearestTrajectory(uint q, const kdTree& t, uint p);
};
*/
#endif
|
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <iostream>
#include <string>
#include <thread>
#include <glog/logging.h>
#include <folly/fibers/Baton.h>... |
/* Copyright 2019 Abner Soares e Kallebe Sousa */
#ifndef ENTIDADES_HPP_
#define ENTIDADES_HPP_
#include <string>
#include "../dominios/dominios.hpp"
/**
* @brief Entidade Usuario
* @details
* A classe Usuário representa uma entidade dos usuários que utilizam o sistema
* de carona, tanto passageiros quanto... |
#pragma once
#include <iberbar/RHI/D3D11/Headers.h>
#include <iberbar/RHI/D3D11/Types.h>
#include <iberbar/RHI/Effect.h>
namespace iberbar
{
namespace RHI
{
namespace D3D11
{
class CShaderState;
class CUniformBuffer;
class CUniformMemoryBuffer;
class CEffect
: public IEffect
{
public:
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
*/
#include "core/pch.h"
#include "modules/libgogi/mde.h"
#ifdef MDE_SUPPORT_VIEWSYSTEM
#ifdef VEGA_OPPAINTER_SUPPORT
#include "modules/libvega/src/oppainter/vegaoppainter.h"
#endif // VEGA_OPPAINTER_SUPPORT
#ifdef ... |
/*
===========================================================================
Copyright (C) 2017 waYne (CAM)
===========================================================================
*/
#pragma once
#ifndef ELYSIUM_CORE_THREADING_THREAD
#define ELYSIUM_CORE_THREADING_THREAD
#ifndef ELYSIUM_CORE_OBJEC... |
//
// DrumKit.hpp
// DrumConsole
//
// Created by Paolo Simonazzi on 08/03/2016.
//
//
#ifndef DrumKit_hpp
#define DrumKit_hpp
#include <stdio.h>
#define NUMOFSNARELAYERS 13
#define TRIGGERGAIN 1.1
class SoundFromFile;
class SoundFromRAM;
enum {
SNARE = 1,
KICK,
HIHAT,
TOM1,
... |
#include <iostream.h>
#include <conio.h>
void main () {
int salary, hr, md, con, edu, bon, gross, tax, zak;
clrscr();
cout <<"Enter Basic Salary in Rs:";
cin >> salary; // 5000
hr=salary/100*10; // 500
cout <<endl <<"House Rent 10% Rs:" <<hr;
md=salary/100*8; // 400
cout <<endl ... |
// This program will walk through creating the NWA shown in Figure 4 of the
// associated documentation, and reverse it (to get the result of Figure 12).
// We then make a NestedWord of the one word in Figure 4's language and
// another NestedWord of the one word in Figure 12's language, then test that
// each is a mem... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.