text stringlengths 8 6.88M |
|---|
#ifndef _GEO_INFO
#define _GEO_INFO
#include <string>
using std::string;
class GeoInfo
{
public:
GeoInfo(string _city);
float lat;
float lng;
//string localtime;
int offset;
string address;
private:
bool getLatLng();
bool getTimeZone();
bool parseLatLng();
bool parseTimeZone();
//bool curl(string url);... |
#include <iostream>
#include <cstring>
#include <queue>
using namespace std;
int N, M, p1, p2;
int info[101][101] = {0,};
int visited[101] = {0,};
queue<int> q;
int bfs() {
while( !q.empty() ) {
int cur = q.front();
// printf("cur : %d \n", cur);
q.pop();
if ( cur == p2 )
... |
#include "rule.h"
using namespace std;
namespace sbg {
template<int n>
Rule<n>::~Rule(){}
template struct Rule<2>;
template struct Rule<3>;
}
|
#include <string>
#include "ThrowCardProc.h"
#include "HallManager.h"
#include "Logger.h"
#include "Room.h"
#include "Configure.h"
#include "ErrorMsg.h"
#include "ProcessManager.h"
#include "IProcess.h"
#include "BaseClientHandler.h"
#include "ProtocolServerId.h"
REGISTER_PROCESS(CLIENT_MSG_THROW_CARD, ThrowCardProc)
... |
/**
* author: rasel kibria
* created: 05.07.2020
**/
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, i;
cin>>n;
for(i=1; i<=n; i++)
{
if(n%i==0)
{
cout<<i<<"\n";
}
}
return 0;
}
|
//Copyright 2011-2016 Tyler Gilbert; All Rights Reserved
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include "hal/Adc.hpp"
using namespace hal;
Adc::Adc(port_t port) : Periph(CORE_PERIPH_ADC, port){}
int Adc::get_attr(adc_attr_t & attr){
return ioctl(I_ADC_GETATTR, &attr);
}
int Adc::set_attr(cons... |
/*
###########################################################################################
// cNVMe - An Open Source NVMe Device Simulation - MIT License
// Copyright 2017 - Intel Corporation
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated document... |
// BEGIN CUT HERE
// PROBLEM STATEMENT
//
// In a Las Vegas casino, a new type of six-sided die is
// being introduced. These dice may have any positive
// integers written its sides, but no two sides of the same
// die can contain the same number. For each die, the casino
// owner wants the mean value of the numb... |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
using namespace std;
struct ListNode{
int val;
ListNode* next;
ListNode(int x):val(x),next(NULL){}
};
void printLL(ListNode* head){
ListNode* temp = head;
while(temp!=NUL... |
#pragma once
#include <PA9.h>
class Palette{
private:
u8 m_screen;
void *m_data;
u8 m_id;
public:
Palette();
Palette(u8 screen, void *paletteData);
~Palette();
void Set(u8 screen, void *paletteData);
u8 Screen()const;
void * PaletteData()const;
u8 Id()const;
bool Load();
bool Unloa... |
// Created on: 1997-07-28
// Created by: Pierre CHALAMET
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GN... |
#ifndef PLAYER_H
#define PLAYER_H
#include <QObject>
#include <QString>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonParseError>
#include <QVariantMap>
#include <QVariantList>
#include <QList>
#include <QFile>
#include "cards/card.h"
#include "cards/deck.h"
class MyTCPSocket;
c... |
#include <iostream>
#include <istream>
#include <fstream>
#include <string>
#include <vector>
enum class CSVState {
UnquotedField,
QuotedField,
QuotedQuote
};
typedef std::vector<std::string> row_t;
typedef std::vector<row_t> table_t;
row_t readCSVRow(const std::string &row) {
CSVState s... |
// cpu_vector.h
// Ben Gamari
// August 2009
#ifndef _CPU_VECTOR_H
#define _CPU_VECTOR_H
#include <malloc-stub.h>
#include <stdlib.h>
#include <string.h>
#include "su3.h"
#include "terminate.h"
#include "generic_vector.h"
#include "detail/template_vector_cpu.h"
#include "complex.h"
namespace qcd {
template <typena... |
bool isAllZeroes(vector<int>& A){
for(int i = 0; i<A.size(); i++) if(A[i]!=0) return false;
return true;
}
bool isAllPos(vector<int>& A){
for(int i = 0; i<A.size(); i++) if(A[i]<=0) return false;
return true;
}
bool isAllNeg(vector<int>& A){
for(int i = 0; i<A.size(); i++) if(A[i]>=0) return false;
... |
// 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.... |
/* -*- 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 TIPS_NOTIFICATIONBAR_H
#define TIPS_NOTIFICATIONBAR_H
cla... |
#include "caffe2/operators/locally_connected_op_util.h"
namespace caffe2 {
namespace lc_op_util {
void SetColumnBufferShapeImpl(
const int N,
const int kernel_dim,
const StorageOrder order,
const std::vector<int>& output_image_dims,
std::vector<int>* column_dims,
std::vector<int>* column_trans... |
//
// SplashScreen.hpp for SplashScreen.hpp in /home/deneub_s/cpp_indie_studio
//
// Made by Stanislas Deneubourg
// Login <deneub_s@epitech.net>
//
// Started on Wed May 3 18:56:42 2017 Stanislas Deneubourg
// Last update Wed May 31 14:37:58 2017 Stanislas Deneubourg
//
#ifndef SPLASH_SCREEN_HPP__
#define SPLAS... |
/*
* StorageManagerMCB.cpp
* File implementing the class that manages SD storage
* Author: Alex St. Clair
* March 2018
*
* Note: this class is implemented so that it can be used across multiple
* instances. This means that all data members MUST be static.
*/
#include "StorageManagerMCB.h"... |
#ifndef CALCULATOR_H //조건 컴파일문
#define CALCULATOR_H //조건 컴파일문
class Calculator {
public: //외부에서 접근이 가능하도록 함
int x, y; //run()에서 두 개의 정수를 입력받고 다른 파일에서도 사용가능하도록 저장할 변수
void run(); //Calculator.cpp에서 구현되어 있는 계산기 실행함수 선언
};
#endif //조건 컴파일문 Calculator.h를 여러번 include해도 문제 없게 하기 위함
|
#ifdef USES_P066
//#######################################################################################################
//#################################### Plugin 066: VEML6040 RGBW ##############################
//###################################################################################################... |
// Created on: 1993-03-24
// Created by: JCV
// 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
// the terms of the GNU Lesser Gen... |
#include <iostream>
#include <cmath>
#define FOR(i,s,e) for(int (i)=(s); (i)<(e);(i)++)
using namespace std;
inline void SWAP(int *a, int *b)
{
int tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int t, res;
int x1,y1,r1;
int x2,y2,r2;
... |
#include <iostream>
#include <cstdlib>
struct mult_div_table{
int product;
float dividend;
};
void check(int * rows, int * cols);
mult_div_table** create_table(int rows, int cols);
void populate_table(mult_div_table** table, int rows, int cols);
void print_table(mult_div_table** table, int rows, int cols);
void... |
// Created on: 1995-08-02
// Created by: Arnaud BOUZY/Odile Olivier
// Copyright (c) 1995-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 term... |
#include "max_flow.cpp"
PyMODINIT_FUNC
initmax_flow(void) {
(void) Py_InitModule("max_flow", Methods);
import_array();
}
|
// 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 <Wire.h>
#include "SparkFun_VEML6030_Ambient_Light_Sensor.h"
#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>
#define LED_PIN 13
#define AL_ADDR 0x48
#define GAIN_SETTING .125 /* Possible values: .125; .25; 1 (unsafe); 2 (unsafe) */
#define INTEGRATION_MS_SETTING 800 /... |
//--------------------------------------------------------
// CS 215 - Fall 2019 - Lab 8
//--------------------------------------------------------
// Author: Andrew Cassidy
// Section: 401
// Function members for student class used in lab 8
//--------------------------------------------------------
#in... |
#pragma once
#include <gdiplus.h>
class GdiplusInitializer
{
ULONG_PTR m_token;
public:
GdiplusInitializer()
{
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
Gdiplus::GdiplusStartup(&m_token, &gdiplusStartupInput, NULL);
}
~GdiplusInitializer()
{
Gdiplus::GdiplusShutdown(m_token);
}
}; |
#pragma once
#include "Effect.h"
#include "../ShaderResouceView.h"
#include "../CRenderContext.h"
#include "../Camera.h"
#include "../CPrimitive.h"
#include "../CShader.h"
#include "../Shader.h"
class Sprite : Noncopyable
{
public:
static const CVector2 DEFAULT_PIVOT; //!<ピボット。
Sprite();
~Sprite();
void Init(... |
/* -*- Mode: c++; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* Copyright (C) Opera Software ASA 1995 - 2004
*
* class ES_CurrentURL
*/
#include "core/pch.h"
#include "modules/ecmascript/carakan/src/es_pch.h"
#include "modules/ecmascript/carakan/src/es_currenturl.h"
#ifdef CRASHL... |
#define BOOST_STACKTRACE_LINK
#include <boost/stacktrace.hpp>
#include <iostream>
#include <string>
void foo(const std::string &, double, bool)
{
std::cout << boost::stacktrace::stacktrace() << "\n";
}
int main()
{
#ifdef BOOST_STACKTRACE_USE_BASIC
std::cout << "Use BOOST_STACKTRACE_USE_BASIC\n";
#endif
#ifdef B... |
/****************************************************************************
** Resource object code
**
** Created by: The Resource Compiler for Qt version 5.14.1
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
static const unsi... |
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <math.h>
#define pb push_back
using namespace std;
struct toado {
int h, c;
};
toado huong[5] = {-1, 0
, 0, 1
, 1, 0
, 0, -1};
char ... |
#pragma once
#include <memory>
#include <cctype>
class Symbol
{
public:
Symbol();
~Symbol();
bool parseValue(const std::string & value);
std::shared_ptr<std::string> getValue();
private:
std::shared_ptr<std::string> _symbol;
};
Symbol::Symbol()
{
}
Symbol::~Symbol()
{
}
bo... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
//
// Copyright (C) 2003-2010 Opera Software AS. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
//
// Øyvind Østlund
//
#include "core/pch.h"
#include "adjunct/des... |
#include "WinCommon.h"
#include "DXCommon.h"
#include "Object.h"
#include "Wing.h"
Wing::Wing(void)
{
m_pVB = NULL;
m_pVertex = NULL;
m_bHeroMode = false;
m_fAngle = 0.0f;
m_fCollLength= 3.0f;
for( int i = 0; i < SWG_MAX; ++i )
m_pMaskTexture[i] = NULL;
m_TexState = SWG_NONE;
}
Wing::~Wing(void)
{
Rele... |
#include <gtest/gtest.h>
#include <string>
using std::string;
#include "../src/Utils.h"
TEST(testUtils, parseInsertStatement){
Row* row = new Row;
string target = "insert 1 username email@email.com";
parseInsertStatement(target, *row);
EXPECT_EQ(1, row->id);
EXPECT_STREQ("username", row->username);
EXPECT_... |
#include <NPC.h>
NPC::NPC()
{
if (!npcTexture.loadFromFile("E-100.png"))
{
std::string s("Error loading texture");
}
npcSprite.setTexture(npcTexture);
npcSprite.setPosition(300, 300);
};
NPC::~NPC(){};
void NPC::initialize()
{
cout << "NPC initialize" << endl;
}
void NPC::update()
{
pos = npcSprite... |
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include "types.h"
using namespace std;
extern "C" void RayTraceImage(unsigned int*, int, int, int, float3, float3, float3,
float3, float3, float3, float3... |
// Restaurant Tables.cpp : 定义控制台应用程序的入口点。
//codeforces 828A Restaurant Tables
//一个饭店只有一人桌和2人桌,如果来的个人是1人则优先安排1人桌坐下,如果没有一人桌则安排空的2人桌,
//如果没有空的2人桌则安排拼桌,否则拒绝服务;如果来的是两人,有空余的两人桌则提供服务,否则拒绝服务。
//给定客人信息以及一人桌的数目和2人桌的数目,问会有多少客人被拒绝服务。
//解题思路:先定义一个变量记录2人桌只坐了1人的数量num2Only1,来一组客人,先判断一下他是一人还是两人。
// 如果是1人,则先看一下一人桌是不是有空位置,如果一人桌... |
#pragma once
#include "Renderer.h"
class FrameBuffer
{
public:
FrameBuffer(int width, int height);
~FrameBuffer();
void Bind();
void BindRenderBuffer();
void BindTexture();
void Unbind();
void UnbindRenderBuffer();
void UnbindTexture();
private:
int m_Width;
int m_Height;
unsigned int m_RendererID;
unsi... |
//
// Created by HHPP on 2020/4/29.
//
#include "Rectangular.h"
#include "Point.h"
#include <iostream>
Rectangular::Rectangular() {
for(int i=0;i<4;i++){
rec[i].set(0,0);
}
}
void Rectangular::setPoint(int i, double newX, double newY) {
rec[i].set(newX,newY);
}
double Rectangular::area() {
doub... |
#include <avr/io.h>
#include "display_SSD1309.h"
displaySDD1309Sim::displaySDD1309Sim(i2cSim* i2c, int id)
{
i2c->registerDevice(id, DELEGATE(i2cMessageDelegate, displaySDD1309Sim, *this, processMessage));
lcd_data_pos = 0;
}
displaySDD1309Sim::~displaySDD1309Sim()
{
}
void displaySDD1309Sim::processMessage... |
#ifndef TREE_PROPAGATOR_H
#define TREE_PROPAGATOR_H
#include <chuffed/globals/graph.h>
#include <chuffed/support/union_find.h>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_set>
#include <vector>
#define OTHER(o1, o2, a) (((a) == (o1)) ? (o2) : (o1))
// #define INFINITY 10000
... |
/* =============================
* | Name: Abhishek Mantha |
* | Email: amantha@usc.edu |
* | GitHub: abmantha |
* | Date Submitted: 2/13/15 |
* | HW 3 |
* ==============================
*
* Filename: setint.cpp
*
* Directions from bits.usc.edu/cs104/assignments... |
/*
* @Description: back end 任务管理, 放在类里使代码更清晰
* @Author: Ren Qian
* @Date: 2020-02-10 08:31:22
*/
#ifndef LIDAR_LOCALIZATION_MAPPING_BACK_END_FRONT_END_FLOW_HPP_
#define LIDAR_LOCALIZATION_MAPPING_BACK_END_FRONT_END_FLOW_HPP_
#include <ros/ros.h>
#include "lidar_localization/subscriber/cloud_subscriber.hpp"
#inclu... |
/*
* Stopping Times
* Copyright (C) Leonardo Marchetti 2011 <leonardomarchetti@gmail.com>
*/
#ifndef _FUNCTOR_2D_H_
#define _FUNCTOR_2D_H_
namespace StoppingTimes{
/* FP is a template for Floating Point types. */
template <typename FP>
class Functor2D
{
public:
Functor2D();
virtual ~Functor2D();
... |
/*********************************************************\
* Copyright (c) 2012-2018 The Unrimp Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software without
* restriction, including wit... |
/**
* @file Test_LinkedListOfInts.cpp
* @author Jason Purinton
* @Reference John Gibbons
* @date 2018.11.4
**/
#include "Test_LinkedListOfInts.h"
Test_LinkedListOfInts::Test_LinkedListOfInts(int numNodes)
{
}
void Test_LinkedListOfInts::runTests(){
//Call to tests "tx()". Prints results and returns bool true==... |
//算法:数论/欧拉函数
/*
沿着对角线
将这个正方形切开,
得到两个直角三角形。
发现,实际上要求的答案
大概就是在1到n的范围里
不同的gcd(i,j)的个数,
对于一个特定的i,
gcd(i,j)的个数
就是i-1的欧拉函数值。
那么这个问题
转化成为了欧拉函数的版子题。
*/
#include<cstdio>
using namespace std;
int n,num;
int phi[100010]={0,1};
int p[100010];
bool vis[100010]={1,1};
void prime(int n)//欧拉筛求欧拉函数值
{
fo... |
//*************************************************************************************************************
//
// シーン2D処理[Scene2D.cpp]
// Author : Sekine Ikuto
//
//*************************************************************************************************************
//--------------------------------... |
/*
* Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
*
* 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
... |
#pragma once
#include "sound/sound.h"
#include "script/script.h"
namespace sound
{
class Sound : public script::ScriptedObject
{
public:
Sound(SoundManager* manager, const string& name);
virtual ~Sound();
const string& getName() { return m_name; }
SoundManager* getManager() { return m_mana... |
/*
===========================================================================
Copyright (C) 2017 waYne (CAM)
===========================================================================
*/
#pragma once
#ifndef ELYSIUM_DATA_DBCOMMANDPOOL
#define ELYSIUM_DATA_DBCOMMANDPOOL
#ifndef ELYSIUM_DATA_IDATACOMMAN... |
// wodAppUpdateEvents.cpp: implementation of the wodAppUpdateEvents class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "freesshdservice.h"
#include "log.h"
#include "ComBSTR2.h"
#include "MessageDlg.h"
#ifdef _DEBUG
#undef THIS_FILE
static char TH... |
#ifndef OP_SYSTEM_INFO_H
#define OP_SYSTEM_INFO_H
class OpSystemInfo
{
public:
#if defined OPSYSTEMINFO_CPU_FEATURES
enum CPUFeatures
{
CPU_FEATURES_NONE = 0
#if defined ARCHITECTURE_ARM
, CPU_FEATURES_ARM_VFPV2 = (1 << 0) ///< ARM VFPv2 floating point
, CPU_FEATURES_ARM_VFPV3 = (1 << 1) ///< ARM VFPv3 floati... |
/* This programs indicates five digit
Created by: Enang Emmanuel Eta
Date: 19th May, 2015
*/
#include <iostream>
int main(){
int fivedigit;
int first, second, third, fourth, fifth;
std::cout << "enter the five digit integer: ";
std::cin >> fivedigit;
if(fivedigit < 10000)
{
std::cout << " Restructured to ... |
#pragma once
#include "mixer.hpp"
namespace ugsdr {
class BatchMixer : public Mixer<BatchMixer> {
protected:
friend class Mixer<BatchMixer>;
template <typename UnderlyingType>
static void Process(std::vector<std::complex<UnderlyingType>>& src_dst, double sampling_freq, double frequency, double phase = 0) {
... |
/* -*- 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.
*/
#include "core/pch.h"
#include "adjunct/quick/widgets/OpComposeE... |
/* -*- 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.
**
*/
#ifndef DOM_ANIMATIONEVENT_H
#define DOM_ANIMATIONEVENT_H
#ifd... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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 QUICK_GRID_ROW_C... |
#pragma once
#include "Core\Entity.h"
#include "Core\StrID.h"
namespace Hourglass
{
class EntityManager
{
public:
void Init();
void Shutdown();
/**
* Get an available entity
*/
Entity* GetFree();
/**
* Returns the First entity found with a given name
* @param name - StrID that is serached for... |
#include <iostream>
#include <string>
using namespace std;
int main()
{
string t;
cout << "Enter any thing and this will output the characters in that sentence or paragraph.\n";
cin >> t;
string str (t);
cout << "The size of str is " << str.length() << " bytes.\n";
return 0;
}
|
#include <iostream>
#include "date.h"
using namespace std;
int main()
{
Date date;
date.setDate(2016,1,1);
date.showDate();
return 0;
}
|
#include <stdio.h>
#include <iostream>
#include <GL/glut.h>
#include "./custom-headers/Point.h"
#include "./openGL-comp/HelperDrawerMethod.h"
#include "./algos/4-MidPointCircleAlgo.h"
using namespace std;
int pntX1, pntY1, r;
void myInit(void)
{
glClearColor(1.0, 1.0, 1.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glMa... |
#ifndef WALI_TESTS_NWA_int_client_info_HPP
#define WALI_TESTS_NWA_int_client_info_HPP
#include "opennwa/ClientInfo.hpp"
namespace opennwa {
struct IntClientInfo : ClientInfo
{
IntClientInfo * clone() {
return new IntClientInfo(*this);
}
IntClientIn... |
//function para testar o callback vindo de outro arquivo
//callback funciona, posso fazer aqui outras classes que precisar eventualmente.
|
#pragma once
#include<vector>
#include<map>
#include<memory>
#include "PredicateValues.h"
class PredicateVehicle;
class VehicleData;
class Situation;
/**
* A PredicateConstructor uses hystereses to transform raw data to predicate data.
*/
class PredicateConstructor {
public:
/**
* Standard constructor.
*/
Predica... |
/*****************************************************************
Name :BT_traversal
Author :srhuang
Email :lukyandy3162@gmail.com
History :
20190930 Initial Version
*****************************************************************/
#include <iostream>
#include <sstream>
#include <queue>
#include <stack>
usi... |
#include "Debug.h"
#include "Game.h"
#include "Util.h"
#include "math/Vec2.h"
#include "math/Vec3.h"
//#include "Sound.h"
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <string>
#include <AL/al.h>
#include <AL/alc.h>
using namespace gg;
Game::Game(int width, int height)
{
_graphics = new Graphics... |
//
// Created by payaln on 03.03.2019.
//
#pragma once
#include <G4UImessenger.hh>
#include <G4UIcmdWithABool.hh>
#include <G4UIcmdWithADouble.hh>
#include <G4UIcmdWith3Vector.hh>
#include <functional>
#include <vector>
#include <memory>
#include <algorithm>
#include <type_traits>
#include "PrimaryPartGenerator.h"
... |
#ifndef BUFF_H
#define BUFF_H
#include "baseobject.h"
class Buff : public BaseObject {
Q_OBJECT
public:
Buff(QObject *parent = nullptr);
Buff(int x,
int y,
int width,
int height,
const QString& imgPath,
... |
#include "Fbo.h"
#include <iostream>
using namespace std;
Fbo::Fbo(GLuint width, GLuint height, bool renderbuffer)
: m_hasRenderbuffer(renderbuffer), m_width(width), m_height(height)
{
glGenFramebuffers(1, &m_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
if (renderbuffer) {
attachRenderbuffer();
}
auto st... |
#include "../../headers.h"
#include "PhillipsSpectrum.h"
//-------------------------------------------------------------------------------------------------
void PhillipsSpectrum::init(const Settings& settings)
{
settings_ = settings;
// длина волны при заданной скорости ветра
L_ = settings_.WindSpeed *s... |
#include "BaseController.h"
#include "BaseParameter.h"
#include "helpers.h"
#include "pluginterfaces/base/ibstream.h"
namespace Steinberg {
namespace Vst {
namespace residler {
//-----------------------------------------------------------------------------
BaseController::BaseController ()
: sampleRate (44100)
, addB... |
#ifndef __GRAPH__
#define __GRAPH__
#include <string>
#include <vector>
#include <utility>
using namespace std;
class Node {
private:
int codigo;
int tipo; // 0 = professor, 1 = escola
int v1; // se professor, v1 = nº de habilitacoes; se escola, v1 = habilitacao 1 desejada
int v2;... |
/* -*- 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_THREAD_TOOLS_H
#define OP_THREAD_TOOLS_H
/** @sho... |
/*
* Copyright (c) 2017 Ensign Energy Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Ensign Energy Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Ensign Energy Incorpor... |
#include "StdAfx.h"
#include "UIHelper.h"
namespace ui
{
CPoint operator*(const CPoint& pt, float f)
{
return CPoint(pt.x * f, pt.y * f);
}
CPoint operator*(float f, const CPoint& pt)
{
return CPoint(pt.x * f, pt.y * f);
}
CPoint operator+(const CPoint& pt0, const CPoint& pt1)
{
return CPoint(pt0.x + p... |
#include <mutex>
#include <condition_variable>
/**
* Make up for the lack of a std::semaphore in C++.
*/
class semaphore {
public:
explicit semaphore (int i);
/**
* Implement the semaphore "P" operation.
* wait until count > 0, then acguire it
* then decrement the count atomically
*/
... |
//Project: RTC DS1302 module
//Sketched by JIN-WOO KIM
#include <stdio.h>
#include <DS1302.h>
#include <SimpleTimer.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
const int kCePin = 5 ; //Chip Enable
const int kIoPin = 6 ; //Input and Output
const int kSclkPin = 7 ; //Serial clock
i... |
//
// util.cpp
// BPNN
//
// Created by Lnrd on 2018/6/14.
// Copyright © 2018年 LNRD. All rights reserved.
//
#include "util.hpp"
void split(vector<string>& v, const string& s, const string& c)
{
string::size_type pos1, pos2;
pos2 = s.find(c);
pos1 = 0;
while(string::npos != pos2)
{
v.p... |
/* -*- 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.
*/
#include "core/pch.h"
#ifdef WAND_SUPPORT
#include "modules/wa... |
#include<iostream>
#include<cstring>
#include<cstdio>
#include<iomanip>
using namespace std;
int main()
{
int i=4;
double d=4.0;
string s = "HackerRank ";
int val;
double ans;
string res,result;
cin>>val>>ans;
getline(cin>> ws,res);
val=val+i;
ans=ans+d;
result=s+res;
cou... |
#include<bits/stdc++.h>
using namespace std;
int count(int n){
//Base case
if(n == 0){
return 0;
}
//Recursion
int ans = count(n/10);
//Calculation
return ans + 1;
}
int main(){
int n;
cout<<"Enter value of n: "<<endl;
cin>>n;
cout<<"No of digits: "<<endl;
cout<<""<<count(n);
return 0;
}
|
#pragma once
#include "color.h"
#include "point.h"
#include <string>
class ButtonTheme {
public:
const Color fillColor = Color(255, 255, 255);
const Color fontColor = Color(0, 0, 0);
const int fontSize = 12;
const Point<float> textOffset = Point<float>(4, 1);
};
class SliderTheme {
public:
const Point<fl... |
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
//use dirt for testing
#include "../blocks/BlockDirt.cpp"
#include "world/block.cpp"
#include "world/chunk.cpp"
#include "world/world.cpp" |
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main() {
ifstream infile;
infile.open("input/gunshots.in");
// calculate new region
// right_side = R - num
// left_side = R - num - num if not zero
// same thing for y
int t;
infile >> t;
for (int ... |
#include "MdLibrary.h"
double MinimumDistance::minimumDistance(g_Vector &p1, g_Vector &p2, g_Vector &p3, g_Vector &p4, bool bSquared, double ** barycenters)
{
g_Vector u, v;
double d2121;
u = p2 - p1;
v = p4 - p3;
d2121 = u.Dot(u);
return minimumDistance(p1, u, p3, v, d2121, bSquared, barycenters);
}
double Mi... |
#ifndef CMAKE_IS_FUN
# error Expect CMAKE_IS_FUN definition
#endif
#if CMAKE_IS != Fun
# error Expect CMAKE_IS=Fun definition
#endif
template <bool test>
struct CMakeStaticAssert;
template <>
struct CMakeStaticAssert<true>
{
};
static const char fun_string[] = CMAKE_IS_;
#ifndef NO_SPACES_IN_DEFINE_VALUES
static... |
#include "compiler/token_ids.hpp"
namespace perseus
{
namespace detail
{
namespace token_id
{
std::ostream& operator<<( std::ostream& os, token_id token )
{
switch( token )
{
case whitespace:
return os << "whitespace";
case comment:
return os ... |
#include "lilypadPins.h"
#include "Music.h"
#include "Light.h"
#define GAME_START 1
#define MINI_WIN 2
#define MINI_LOSE 3
#define GAME_LOOP 4
#define PAUSE 5
#define WIN 6
#define LOSE 7
static const int maxTurns = 8;
static const int reqForWin = 6;
static const int numWhiteLights = 3;
static const unsigned long gam... |
#include "stdafx.h"
#include "Material.h"
Material::Material(ComPtr<ID3D11Device> d3dDevice, string matName) {
_name = matName;
tex = make_shared<Texture>("WashedGravel");
shad = make_shared<Shader>(matName);
shad->OnInitRenderer(d3dDevice);
/**/
D3D11_INPUT_ELEMENT_DESC inputElementDesc[] {
{"POSITION", 0... |
// Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ORBIT_GL_GRAPH_TRACK_H
#define ORBIT_GL_GRAPH_TRACK_H
#include <limits>
#include "ScopeTimer.h"
#include "Track.h"
class TimeGraph;
class Gra... |
#include "menuscreen.h"
#include "utilities/constants.h"
using namespace std;
void MenuScreen::asciiArt(){
// Looks kinda funky because backslashes are escape characters
// so I had to add another backslash where there already was one
// CSci = Computer Scientist
cout << string(LEFT_MARGIN, ' ') << "... |
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
#include <stdlib.h>
using namespace std;
using namespace cv;
/** Function Headers */
void on_low_r_thresh_trackbar(int, void *);
void on_high_r_thresh_trackbar(int, void *);
void on_low_g_thresh_trackbar(int, void *);
void on_high_g_th... |
#include "../inc.h"
#include <math.h>
#include <initializer_list>
#ifndef TEMPLATE_MATRIX
#define TEMPLATE_MATRIX
namespace Z_3D_LIB_FOR_EGE {
template < int l, int m, typename T >
class _matrix;
template < typename T >
class _matrix< 0, 0, T >;
template < int l, int m, typename T >
class _matrix {
typedef... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.