text stringlengths 8 6.88M |
|---|
//
// nextNum
// J. A. Pearson, jon@jpoffline.com
// Feb 2017
//
#pragma once
#include <vector>
#include <numeric>
#include <iostream>
#include "solution.h"
#include "tools.h"
namespace JP{
namespace UNIT{
struct UNIT_TEST_RETURN;
// Declare unit tests...
UNIT_TEST_RETURN TEST_pdftocdf();
UNIT_TE... |
#include <gtest/gtest.h>
#include <NDT/Tensor.h>
namespace {
using namespace NDT;
TEST(TensorElementAccessTest, Test1D) {
float data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
Tensor<1, float, HostResident> tensor(10, data);
for (int i = 0; i < 10; ++i) {
EXPECT_EQ(i, tensor(i));
}
Tensor... |
/**
* count number of nodes in the binary search tree in the specified
* range.
6
4 7
3 12
2 11 16
0 10 22
32
... |
//算法:hash哈希表
//一道哈希表例题
//对于一个数,如果hash表中未出现过,
//则加入表中,并将其输出
//如果出现过,则直接跳过
//这样就能做到去重并输出的效果
#include<cstdio>
#include<vector>
using namespace std;
const int mod = 1145141;
vector <int> ha[mod+1];
bool judge(int x)//判断是否出现,并加入表中
{
int k=x%mod;
int l=ha[k].size();
for(int i=0;i<l;i++)
if(ha[k][i... |
#ifndef SPECEX_HERMITE__H
#define SPECEX_HERMITE__H
#include <specex_unbls.h>
namespace specex {
double HermitePol(const int Degree, const double &x);
double HermitePolDerivative(const int Degree, const double &x);
}
#endif
|
/*
* Copyright (c) 2016, The Regents of the University of California (Regents).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the a... |
#include <iostream>
#include <cstdio>
using namespace std;
/*int fun(int x) {
if(x == 1)
return 1;
else
return x * fun(x - 1);
}
*/
int main(){
double sum = 0, temp = 1;
for(int i = 1; i <= 30; i++) {
for(int j = 1; j <= i; j++) {
temp *= j;
}
sum += temp;
temp = 1;
}
printf("%... |
#include <iostream>
#include "EmpleadoPorComision.h"
EmpleadoPorComision::EmpleadoPorComision(const std::string & a, const std::string & b, const std::string & c, double d=0.0 , double e= 0.0){
primerNombre=a;
apellidoPaterno=b;
numeroSeguroSocial=c;
ventasBrutas=d;
tarifaComision=e;
}
voi... |
#pragma once
#include "../../Toolbox/Toolbox.h"
#include "../Vector/Vector3.h"
#include "../Rotator/Rotator.h"
namespace ae
{
/// \ingroup math
/// <summary>
/// Useful to do 3D transformations like translation, rotation and scaling.
/// </summary>
/// <seealso cref="Matrix4x4"/>
/// <see... |
#pragma once
#include "Core/Core.h"
#include "Render/DispatchPass/BaseDispatchPass.h"
namespace Rocket
{
class SkyBoxGenerate : implements BaseDispatchPass
{
public:
void Dispatch(Frame& frame);
};
} |
#include "stdafx.h"
#include "CPrimitive.h"
CPrimitive::CPrimitive()
{
}
CPrimitive::~CPrimitive()
{
Release();
}
void CPrimitive::Release()
{
m_vertexBuffer.Release();
m_indexBuffer.Release();
}
bool CPrimitive::Create(
D3D_PRIMITIVE_TOPOLOGY topology,
int numVertex,
int vertexStride,
void* pSrcVertexBuff... |
#include<bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
typedef std::vector<ll> vi;
typedef std::vector<std::vector<ll> > vv;
#define MOD 1000000007
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fo(i,a,b) for(i=a;i<b;i++)
#define mp make_pair
#define pb(x) push_back(x)
#defi... |
//
// cut_rod_ref.hpp
// rod-cut
//
// Created by mndx on 26/10/2021.
//
#ifndef cut_rod_ref_hpp
#define cut_rod_ref_hpp
#include <stdio.h>
void ext_bu_cut_rod(int p[], int n, int r[], int s[]);
void print_cut_rod_sol(int p[], int n);
#endif /* cut_rod_ref_hpp */
|
#include "manager.h"
/**
* @brief Manager::Manager
*/
Manager::Manager(unsigned int _n) : m_state(_n), m_totalTime(0.0)
{
}
Manager::~Manager() {
}
|
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s; cin >> s;
int abcd[4];
for (int i = 0; i < 4; i++) abcd[i] = s[i] - '0';
if (abcd[0] + abcd[1] + abcd[2] + abcd[3] == 7) {
cout << abcd[0] << "+" << abcd[1] << "+" << abcd[2] << "+" << abcd[3] << "=7" << endl;... |
#ifndef BASE_SCHEDULING_TASK_LOOP_H_
#define BASE_SCHEDULING_TASK_LOOP_H_
#include <memory>
#include <queue>
#include "base/callback.h"
#include "base/scheduling/task_runner.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/mutex.h"
#include "base/threading/thread.h"
namespace ba... |
#ifndef WIB_LOGGING_H
#define WIB_LOGGING_H
#pragma once
namespace WhatIBuild
{
typedef void (LogFunc)(const char*);
struct LoggingCallbacks
{
LogFunc* logInfo;
LogFunc* logWarning;
LogFunc* logError;
};
class LogManager
{
public:
static void Inititalize(const LoggingCal... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) Opera Software ASA 2006 - 2008
*
* Web server implementation -- overall server logic
*/
#ifndef REQUEST_QUEUE_H_
#define REQUEST_QUEUE_H_
#ifdef WEBSERVER_SUPPORT
#include "modules/util/simset.h"
#include "modules/webs... |
/* Copyright 2016 tgil All Rights Reserved */
#ifndef UI_BUTTONPIN_HPP_
#define UI_BUTTONPIN_HPP_
#include "../hal/Pin.hpp"
#include "Button.hpp"
namespace ui {
/*! \brief Button Pin Class
* \details This class implements a button using a hal::Pin object.
*/
class ButtonPin : public Button, public hal::Pin {
publ... |
#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 <functional>
#inc... |
#pragma once
#include <Poco/Util/AbstractConfiguration.h>
#include "util/FileLoader.h"
#include "util/Loggable.h"
namespace Poco {
class File;
class Path;
}
namespace BeeeOn {
class ConfigurationLoader : public FileLoader, public Loggable {
public:
ConfigurationLoader();
virtual ~ConfigurationLoader();
void ... |
/*
Copyright (c) 2016, Los Alamos National Security, LLC
All rights reserved.
Copyright 2016. Los Alamos National Security, LLC. This software was produced under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National Laboratory (LANL), which is operated by Los Alamos National Security, LLC for the ... |
/*
* Copyright (c) 2015-2018 Morwenn
* SPDX-License-Identifier: MIT
*/
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
|
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int n, m, k;
int S[1111][1111];
int mx = 0, maxc = 0;
int main() {
freopen("bread.in", "r", stdin);
freopen("bread.out", "w", stdout);
scanf("%d%d%d", &n, &m, &k);
for (int i = 0; i < k; ++i) {
int x1, y1, x2, y2... |
#include <fstream>
#include <iostream>
#include <cstring>
#include <vector>
#include <regex>
enum DelimiterTypes {
begin, begin_print, end
};
void run(std::istream &in, std::ostream &out, std::vector<std::string> delimiters = {"<%", "=", "%>"}) {
out << "#ifndef OUT" << std::endl;
out << "#define OUT out" << st... |
#include<cstdio>
#include<algorithm>
#include <iostream>
#include<cstring>
using namespace std;
#define N 2500
#define INF 0xfffffff
typedef long long ll;
ll dp[N][N][2];
ll n,V,X;
ll sum[N];
struct node
{
ll x;
ll v;
} a[N];
ll cmp(node b,node c)
{
return b.x<c.x;
}
ll Delay(ll l,ll r... |
//#include "DetectorConstruction.hh"
#include "SCENE_TwoPhasePrototype_CoincidentGeometry.hh"
#include "BeamTestSensitiveDetector.hh"
#include "PeripherySensitiveDetector.hh"
#include "G4Polyhedra.hh"
#include "G4Polycone.hh"
#include "G4Tubs.hh"
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#inclu... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* 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 OP_INFOBAR_H
#define OP_INFOBAR_H
#include "adjunct/quic... |
#include <bits/stdc++.h>
#define MAX 100010
using namespace std;
int N, C, T;
int v[MAX];
int main()
{
ios_base::sync_with_stdio(false); cin.tie(0);
cin >> N >> C >> T;
int max=-1;
long int time = 0, acc = 0;
for(int i=0;i<N;i++){
cin >> v[i];
acc += v[i];
if(v[i] > max){
max = v[i];
}
time+=(int)c... |
#pragma once
#ifndef _REGISTER_H
#define _REGISTER_H
#include "stdafx.h"
using namespace std;
class registerFunc {
private:
typedef string DllNameType;
typedef vector<string> FunArgType;
typedef map<DllNameType, FunArgType> RegFunType;
public:
//注册函数所在的dll以及其中的被注册函数
static map<string, vector<string> > funReg;
p... |
/*****************************************************************
* Copyright (C) 2017-2018 Robert Valler - All rights reserved.
*
* This file is part of the project: DevPlatformAppCMake.
*
* This project can not be copied and/or distributed
* without the express permission of the copyright holder
******... |
#include "headerc.h"
#include <iostream>
#include <sstream>
using namespace std;
class Box {
private:
long l;
long b;
long h;
public:
Box(): l(0), b(0), h(0) {}
Box(int length, int breadth, int height): l(length), b(breadth), h(height) {}
friend bool operator<(Box& a, Box& b) {
if (a.l < b.l) {
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Opera test plugin.
*
* Library entry points.
*
* Copyright (C) 2011 Opera Software ASA.
*/
#include <algorithm>
#include <cassert>
#include "common.h"
/**
* Global library data.
*/
NPNetscapeFuncs* g_browser = 0;
bool g_crashed = ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright 2002-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Peter Krefting
*/
#ifndef OPPREFSCOLLECTION_OVERRIDE_H
#define OP... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <climits>
int n, dp[256][256], minimum[256][256];
int solve(int s, int e)
{
if(s == e)
{
return 0;
}
int &ret = dp[s][e];
if(dp[s][e] != -1)
{
return ret;
}
ret = INT_MAX;
for(int i ... |
#include <iostream>
#include <string>
using namespace std;
void swap(char *&s1,char *&s2)
{
char *tmp;
tmp = s1;
s1=s2;
s2=tmp;
}
void swap_pointer(char **s1,char **s2)
{
char *temp;
temp = *s1;
*s1=*s2;
*s2=temp;
}
int main()
{
char *a="hello";
char *b="ni hao";
// swap... |
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
int temp,i,n,d,r,cost;
vector<int>morn,nite;
while (1)
{
cost=0;
cin>>n>>d>>r;
if(n==0)break;
morn.clear();
for(i=0;i<n;i++)
{cin>>temp;morn.push_back(temp);}
nite.clear();
for(i=0;i<n;i++)
... |
/// C++ code to demonstrate working of remove() and
// remove_if()
//
#include<iostream>
#include<forward_list>
using namespace std;
int main()
{
// Initializing forward list
forward_list<int> flist = {10, 20,40, 30, 25, 40, 40};
// Removing element using remove()
// Removes all occurrences of 40
fl... |
#pragma once
#using <mscorlib.dll>
#include "llvm/IR/Metadata.h"
#include "Value.h"
namespace LLVM
{
ref class LLVMContext;
ref class Value;
ref class Module;
ref class MDNode;
ref class raw_ostream;
ref class AssemblyAnnotationWriter;
public ref class MDString
: public Value
{
internal:
llvm::MDString *base;
pro... |
#include "dialogclass.h"
#include "ui_dialogclass.h"
DialogClass::DialogClass(QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogClass)
{
ui->setupUi(this);
licenseArray = {"license1" , "license2"};
connect(this->ui->pushButton , SIGNAL(clicked(bool)) , this , SLOT(accept()));
}
Di... |
// 후위 표기법
/*
중위 표기식이 주어졌을 때 후위 표기식으로 고치고
계산값 출력하기
ex)
입력
2+3*(5+4*2)-3+6
출력
23542*+*+3-6+
*/
#include <iostream>
#include <string>
#include <vector>
#include <stack>
using namespace std;
vector<char> v; // 후위 수식을 담을 벡터
stack<char> st; // 연산자 스택
string infix; // 중위표기식
string postfix; // 후위표기식
//stack<int> st2... |
/*
===========================================================================
Copyright (C) 2017 waYne (CAM)
===========================================================================
*/
#pragma once
#ifndef ELYSIUM_GRAPHICS_PLATFORM_GAMEWINDOW
#define ELYSIUM_GRAPHICS_PLATFORM_GAMEWINDOW
#endif
#ifn... |
#include "PhotonBox/component/DirectionalLight.h"
#include "PhotonBox/resource/FrameBuffer.h"
#include "PhotonBox/core/system/Lighting.h"
#include "PhotonBox/core/system/Renderer.h"
#include "PhotonBox/resource/shader/DefaultPostShader.h"
#include "PhotonBox/resource/shader/DirectionalShadowShader.h"
#include "PhotonB... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define pi acos(-1.0)
using namespace std;
typedef long long L... |
//
// EnemyRBullet.cpp
//
// Created by Yajun Shi
//
#include "EnemyRBullet.h"
#include "Player.h"
EnemyRBullet::EnemyRBullet(Enemy* enemy){
Vector2 enemyVector = MathUtil::VectorFromAngle(enemy->GetRotation() + 90.0f);
Vector2 pos = enemy->GetPosition();
pos -= enemyVector * (enemy->GetSize().Y *... |
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright Patrick Dehne <patrick@mysonicweb.de> (www.sonicweb-radio.de)
Permission to use, copy, modify, and/or distribute this software for any
purpose with or ... |
#include "punto.h"
razionale punto::getX() const {return x;}
razionale punto::getY() const {return y;}
bool punto::operator ==(const punto& p){
if((p.getX() == getX()) && (p.getY()) == getY()){
return true;
}
else return false;
}
double punto::distanceTwoPoints(const punto& p1) ... |
#include "stick.h"
void Stick::unlock()
{
m.unlock();
}
bool Stick::try_lock()
{
return m.try_lock();
}
|
#pragma once
#pragma unmanaged
#include <BWAPI\Region.h>
#include <BWAPI\Regionset.h>
#pragma managed
#include "IIdentifiedObject.h"
#include "Position.h"
using namespace System::Collections::Generic;
using namespace System::Drawing;
namespace BroodWar
{
namespace Api
{
public ref class Region sealed : public ... |
#include "ResultsReader.h"
ResultsReader::ResultsReader(){
data_read = false;
target_read = false;
data_normalized = false;
distances_computed = false;
n_threads = 0;
n_stats = 0;
n_params = 0;
min_distance = 1000000;
max_distance = 0.0;
cut_distance = 0.0;
}
ResultsReader::~ResultsReader(){
}
void... |
#include <string.h>
#include "vsop.h"
#include "tree/headers/AstNode.hpp"
void yyerror(char *s);
extern FILE *yyin;
extern int yylex_call(char *fileName);
using namespace std;
int main(int argc, char **argv) {
// LEXICAL ANALYSIS
if (argv[1] && strcmp(argv[1], "-lex") == 0)
return yylex_call(argv... |
#include<iostream>
#define GGMU 0
using namespace std;
class theGrandDad
{
public:
float h;
public:
theGrandDad():h(0) { cout << "Default Grandad\n"; }
theGrandDad(int n):h(n) {cout << "Power GranDad :" + n << "\n"; }
virtual void theFunction()
{
cout << "Generation Power:" << cout.width(5) << h<<endl;
}
v... |
/*
* CriticalSection.h
*
* Created on: Jan 16, 2019
* Author: juniper
*/
#ifndef UTILITY_CRITICALSECTION_H_
#define UTILITY_CRITICALSECTION_H_
#include <pthread.h>
#include "Time.h"
#include <time.h>
class CriticalSection {
public:
inline CriticalSection() noexcept
{
mutex_ = (pthread_mutex_t*) mallo... |
int buzzer = 7;
int frequency = 900;
int PIR_sensor = A5;
int val = 0;
void setup() {
pinMode(buzzer,OUTPUT);
pinMode(PIR_sensor, INPUT);
Serial.begin(9600);
}
void loop() {
val = analogRead(PIR_sensor); //读取A0口的电压值并赋值到val ... |
/*1069*/
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <list>
#include <queue>
#include <set>
#include <cstdlib>
#include <cmath>
using namespace std;
class Block
{
public:
int x, y, z;
Bl... |
#include "MyTruthAnalysis/Cutflow.h"
#include <iostream>
#include <iomanip>
using std::cout;
using std::setw;
using std::size_t;
using std::string;
using std::vector;
void Cutflow::addCut(const std::string &sName, const float &fWeights)
{
if (m_mapIndex.find(sName) != m_mapIndex.end())
{
m_vCutflow[... |
#include<bits/stdc++.h>
using namespace std;
int main(){
int a=10;
printf("a is %d\n",a);
printf("a==10 is %d\n",a==10);
printf("a==20 is %d\n",a==20);
printf("a!=10 is %d\n",a!=10);
printf("a!=20 is %d\n",a!=20);
}
|
#include "daemon.h"
static char s_cfgFilename[PATH_MAX + 1];
static int s_updatePeriod;
static char s_dirToDelete[PATH_MAX + 1];
static void loadConfig()
{
FILE* cfgFile = fopen(s_cfgFilename, "r");
if (cfgFile == NULL)
{
syslog(LOG_ERR, "Failed to find configuration file (%s). Ter... |
#ifndef __GRAPH_HPP__
#define __GRAPH_HPP__
#include <list>
#include <utility>
#include <vector>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/topological_sort.hpp>
#include <boost/graph/bellman_ford_shortest_paths.hpp>
#include <boost/graph/graphviz.hpp>
#de... |
// Created on: 2004-11-23
// Created by: Pavel TELKOV
// Copyright (c) 2004-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.1 as ... |
#include "CWorld.h"
CPlayerInfo *CWorld::Players = (CPlayerInfo *)0xB7CD98;
int8_t& CWorld::PlayerInFocus = *(int8_t *)0xB7CD74;
CEntity *&CWorld::pIgnoreEntity = *(CEntity **)0xB7CD68;
Bool CWorld::ProcessLineOfSight(CVector const& origin, CVector const& target, CColPoint &colPoint,
CEntity *&colEntity, b... |
#ifndef Glowing_h
#define Glowing_h
#include "Animation.h"
class Glowing : public Animation {
public:
Glowing(void);
virtual void loop(variables_t *vars);
virtual void reset(variables_t *vars);
private:
};
#endif
|
//
// Created by Brady Bodily on 2/3/17.
//
#include <string>
#include <iostream>
#include "PurchaseSale.hpp"
PurchaseSale::PurchaseSale(std::string symbol, int quantity, int purchaseTime,
int purchasePrice, int purchaseFee, int saleTime, int salePrice, int saleFee) :
m_symbol(symb... |
#include <conio.h>
#include <stdio.h>
void main () {
clrscr();
int guests, chairs, fact=1;
printf("Enter number of guests: ");
scanf("%d",&guests);
printf("Enter number of chairs: ");
scanf("%d",&chairs);
int n = guests-chairs;
fact=guests;
for(int i=guests-1; i>n; i--)
fact = (fact*i);
printf("\n\nT... |
// Created on: 1993-01-11
// Created by: CKY / Contract Toubro-Larsen (TCD)
// Copyright (c) 1993-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
// ... |
//
// Cat.hpp
// MixingCppObjC
//
// Created by Miralem Cebic on 27.07.17.
// Copyright © 2017 Miralem Cebic. All rights reserved.
//
#ifndef Cat_hpp
#define Cat_hpp
#include <stdio.h>
#include <iostream>
class Cat
{
public:
Cat(int initialAge);
Cat(const Cat& copy_from);
~Cat();
int GetAge(... |
#pragma once
#include <vector>
#include "rectangularvectors.h"
namespace WinTetris
{
class Grid
{
public:
const int width, height;
std::vector<std::vector<bool>> occupied;
Grid(int w, int h);
void FillCell(int x, int y);
void UnFillCell(int x, int y);
bool isFinish(Grid *block);
std:... |
#include <iostream>
#include <thread>
int glob = 1337;
void foo()
{
std::cout << "foo done " << glob << std::endl;
}
void bar()
{
std::cout << "bar done " << glob << std::endl;
}
int main()
{
auto fooThread = std::thread(foo); // startuje dany watek
auto barThread = std::thread(bar); // startuje dany watek
... |
#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
class Solution {
public:
vector<string> res;
vector<string> addOperators(string num, int target) {
//基本思想:递归回溯,暴力遍历所有的可能性,时间复杂度O(4^N)
string s="";
Recursion(num,target,0,0,1,s);
return res;
}
voi... |
#ifndef VnaCalibrate_H
#define VnaCalibrate_H
// RsaToolbox
#include "Definitions.h"
#include "NameLabel.h"
#include "Connector.h"
// Qt
#include <QObject>
#include <QScopedPointer>
namespace RsaToolbox {
class Vna;
class VnaChannel;
class VnaCalibrate : public QObject
{
Q_OBJECT
public:
enum CalType {
... |
#include "entity.hpp"
EntityGUI::EntityGUI()
: m_Label(Label())
, m_DoubleSpinBox(DoubleSpinBox())
, m_LCDNumber(LCDNumber())
, m_Layout(Layout())
, m_Frame(Frame())
, m_ComboBox_Species(new QComboBox)
, m_CheckBox_Magical(new QCheckBox)
{
initGUI();
}
EntityGUI::Label::Label()
: Weight(new QLabel)
, Height(new QLabe... |
#include <signal.h>
#include <unistd.h>
#include <iostream>
using namespace std;
int received_signum = 0;
void signalHandler(int signum)
{
received_signum = signum;
}
void registerSignals()
{
signal(SIGINT, signalHandler);
signal(SIGUSR1, signalHandler);
signal(SIGUSR2, signalHandler);
}
int listen... |
#pragma GCC optimize("Ofast")
#include <algorithm>
#include <bitset>
#include <deque>
#include <iostream>
#include <iterator>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <unordered_map>
#include <unordered_set>
using namespace std;
void abhisheknaiidu()... |
//==================================================================================================
// Name : DebugUtil.h
// Author : Ken Cheng
// Copyright : This work is licensed under the Creative Commons
// Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this
// ... |
/**
* Copyright (c) 2021, 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... |
//: C10:MyLib.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
namespace MyLib {
// Deklaracje
}
int main() {} ///:~
|
//$$---- Form CPP ----
//---------------------------------------------------------------------------
#include <vcl.h>
#include <mmsystem.h>
#include <stdio.h>
#include <fstream.h>
#pragma hdrstop
#include "TimeCourses.h"
#include "PredStart.h"
#include "ExperimentNotes.h"
#include "BuildProtocol.h"
#in... |
// Copyright 2012 Yandex
#ifndef LTR_UTILITY_CONTAINER_UTILITY_H_
#define LTR_UTILITY_CONTAINER_UTILITY_H_
#include <stdexcept>
#include <sstream>
#include "boost/unordered_map.hpp"
#include "boost/unordered_set.hpp"
using std::logic_error;
using std::stringstream;
namespace ltr {
namespace utility {
template <cla... |
/*
There are ‘n’ number of balls in a container. Mr. Sharma and Singh want to take balls out from the container.
At each step, Mr. Sharma took ‘k’ balls out of the box and Mr. Singh took one-tenth of the remaining balls.
Suppose there are 29 balls at the moment and k=4. Then, Mr. Sharma will take 4 balls and Mr. Singh... |
/*
Name - Aman Jain
Date - 23-06-2020
*/
#include<bits/stdc++.h>
using namespace std;
int main (){
int verti,edges;
cin>>verti>>edges;
int visi[verti +1]={0};
vector<pair<int,int>> gr[verti+1]; //1 based vertices
for(int i=0; i<edges ;i++){
int x,y,w; //x,y edge from x to y having weig... |
#pragma once
#include <QDialog>
#include <memory>
struct ui_about_us_dlg;
class about_us_dlg final : public QDialog
{
public:
static void show_info (const QString & text, const QString & qr_code);
static std::unique_ptr<about_us_dlg> make (QWidget * parent = nullptr);
~about_us_dlg () override;
void ... |
// Programmable-Air
// Author: tinkrmind
// https://github.com/orgs/Programmable-Air
//
// Basic example of using Suck function of the Programmable-Air board.
// The neopixels show pressure. Cyan for low pressure and Purple for high pressure
// Brighter color means more extreme pressure. Bright cyan means lower press... |
/**************************************************************************************
* File Name : ColorInChar.hpp
* Project Name : Keyboard Warriors
* Primary Author : JeongHak Kim
* Secondary Author :
* Copyright Information :
* "All content 2019 DigiPen (USA) Corporation, all rights r... |
#include <iostream>
using namespace std;
struct Cyclist{
int id,n_id;
};
struct Node{
Node *parent;
int Rank;
int id,n_id;
};
Node *makeSet(Cyclist x)
{
Node *q=new Node;
q->id=x.id;
q->n_id=x.n_id;
q->parent=q;
}
Node *findSet(Node *x)
{
if(x->parent!=x)
x->parent=findS... |
#ifndef MCP4651_H
#define MCP4651_H
#if (ARDUINO >=100)
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <Wire.h>
class MCP4651 {
protected:
uint8_t address;
public:
// Constructor
MCP4651(uint8_t addr = 0x28);
// Methods
void begin();
void write(uint8... |
/*
* Ref_Object.h
*
* Created on: Jun 8, 2017
* Author: root
*/
#ifndef REF_OBJECT_H_
#define REF_OBJECT_H_
#include "Common.h"
namespace CommBaseOut
{
class Ref_Object
{
public:
Ref_Object(void) : ref_count_(0)
{
}
Ref_Object(const Ref_Object& val)
{
ref_count_ = 0;
}
public:
virtual ~Ref_Obj... |
#include <iostream>
#include <string>
#include <vector>
using namespace std;
void findminpos(string str,vector<int> & pos)
{
int l,minpos;
char min;
l=str.length();
min=str[0];
minpos=0;
pos.clear();
for(int i=1;i<l;i++)
{
if(str[i]<min)
{
pos.clear();
min=str[i];
minpos=i;
}
else if(str[i]==m... |
#include "scene_controller.h"
#include "assertion.h"
void SceneController::Load() {
DOUT() << "Loading Scenes" << std::endl;
level.Load("sandboxLevel");
editor.Load();
sandbox.Load();
stateMap = {
{ Scenes::Level, &level },
{ Scenes::Sandbox, &sandbox },
{ Scenes::Editor, &editor },
};
states.AddState... |
#include <iostream>
using namespace std;
int main()
{
int i,j,k;
int n;
cout<<"Enter the size of the array: ";
cin>>n;
int arr[n];
cout<<"Enter the elements of the array: ";
for(i=0;i<n;i++)
{
cin>>arr[i];
}
int sum;
cout<<"Enter the Sum: ";
cin>>sum;
i... |
#pragma once
#include <iberbar/Renderer/Headers.h>
namespace iberbar
{
namespace Renderer
{
enum class EVertexElementSlot
{
Position = 0,
Color = 1,
Normal = 2,
Tex0 = 3,
Tex1 = Tex0 + 1,
Tex2 = Tex0 + 2,
Tex3 = Tex0 + 3,
Tex4 = Tex0 + 4,
Tex5 = Tex0 + 5,
Tex6 = Tex0 + 6,
Tex7 =... |
#include <iostream>
#include <sstream>
template<typename Key, typename V, typename Compare = std::less<Key>>
class map {
public:
explicit map(Compare const& cmp = {})
: cmp{cmp}
{}
Compare cmp{};
};
struct no_case_cmp {};
template<typename Target = std::string, typename Source = std::string>
Tar... |
// Created by: Peter KURNEV
// 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 GNU Lesser General Public License version 2.1 as published
// by the Free S... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* 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.
*/
#ifndef _SYNC_MYOPERA_PARSER_H_INCLUDED_
#define _SYNC_MYOPERA_PAR... |
//
// linked_list.h
// DataStructures
//
// Created by Tri Khuu on 1/30/18.
// Copyright © 2018 TK. All rights reserved.
//
#ifndef linked_list_h
#define linked_list_h
#include <iostream>
using namespace std;
namespace LinkedList {
template<class T>
struct SingleLinkedListNode
{
/** Val... |
#ifndef _ROS_SERVICE_UpdateThrusterLayout_h
#define _ROS_SERVICE_UpdateThrusterLayout_h
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
namespace sub8_msgs
{
static const char UPDATETHRUSTERLAYOUT[] = "sub8_msgs/UpdateThrusterLayout";
class UpdateThrusterLayoutRequest : public ros:... |
/*
* Copyright (c) 2007, Cameron Rich
*
* 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 c... |
#include "stdafx.h"
#include "KeyBoard.h"
int Keyboard::Key = 0;
char Keyboard::GetKeyChar()
{
char res = 0;
if (g_Key >= 65 && g_Key <= 90)
{
// a ~ z
if (g_isPressShift)
{
res = g_Key;
}
else
{
res = g_Key + 32;
}
}
else if (g_Key >= 48 && g_Key <= 57)
{
// 数字
res = g_Key;
}
else if ... |
#include "Racional.hpp"
#include <string>
#include <iostream>
using namespace std;
Racional::Racional(){
}
Racional::Racional(int n, int d){
num = n;
den = d;
simplificar();
}
int Racional::getNum(){
return num;
}
int Racional::getDen(){
return den;
}
Racional Racional::suma(Racional r1, Rac... |
#pragma once
#include <nonstd/optional.hpp>
#include <scip/scip.h>
#include "ecole/scip/type.hpp"
#include "ecole/scip/view.hpp"
namespace ecole {
namespace scip {
using nonstd::optional;
class VarProxy : public Proxy<SCIP_Var> {
public:
using Proxy::Proxy;
static VarProxy const None;
optional<real> ub_local(... |
#include <iostream>
#include <vector>
#include <cmath>
#include <ctime>
using namespace std;
int tc, m1, m2, n;
int Size = 1;
int aSize = 1;
int heapSize;
int AheapSize;
int m2res = 0;
vector<int> vec;
vector<int> accvec;
void constructHeap(int);
void heapSort();
int deleteMax(int);
int fixHeap(int, int, int);
int comp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.