text stringlengths 8 6.88M |
|---|
#pragma once
#include <iostream>
#include <boost/log/sinks/syslog_backend.hpp>
//Here we define our application severity levels.
enum class SysLogSeverity
{
slEMERGENCY = boost::log::sinks::syslog::emergency,
slALERT = boost::log::sinks::syslog::alert,
slCRITICAL = boost::log::s... |
/*
* Process.cpp
*
* Created on: 26 Apr 2013
* Author: william
*/
#include "pb_process.h"
namespace Popbal {
namespace Processes {
Process::Process():
mA(1.0),
mDelta(0) {}
Process::~Process() {}
//! Basic implementation of rate function
double Process::Rate(double t, const Background &bg) const {
re... |
/*
* LocMQTT.h
*
* Created on: Oct 17, 2019
* Author: annuar
*/
#ifndef OURS_LOCMQTT_H_
#define OURS_LOCMQTT_H_
#include "Arduino.h"
#include <PubSubClient.h>
#include <WiFiClient.h>
#include <TimeLib.h>
#include <WiFi.h>
class LocMQTT {
private:
String *_MAC;
public:
LocMQTT(String *mac);
void update(... |
#include <iostream>
using namespace std;
int main()
{
char a;
cout << "문자형 입력(%c) : ";
cin >> a;
cout << endl << "문자로 출력(%c): " << a << endl;
cout << "정수로 출력(%d): " << (int)a-48 << endl;
}
|
#include "substringstatistics.h"
SubstringStatistics::SubstringStatistics(QString str1,QString str2)
{
this->str1=str1;
this->str2=str2;
len1=str1.length();
len2=str2.length();
count=0;
}
SubstringStatistics::~SubstringStatistics(){
}
void SubstringStatistics::calculate(){
for (int i = 0; i... |
//minimum no of no of sq required to get an number
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 5;
int main()
{
int n;
cin >> n;
vector<int> dp(n + 1, MOD);
dp[0] = 0;
dp[1] = 1;
dp[2] = 2;
dp[3] = 3;
for (int i = 1; i * i <= n; i++)
{
for (int j ... |
#include "Arduino.h"
#include "LiquidCrystal.h"
#include "gtest/gtest.h"
TEST(ApplicationTest, setup_initializesLogger) {
uint8_t backLightPin = 13;
ArduinoMock *pArduinoMock = arduinoMockInstance();
LiquidCrystalMock *pLiquidCrystalMock = liquidCrystalMockInstance();
SerialMock *pSerialMock = serialMockInstan... |
#include <bits/stdc++.h>
#include <time.h>
using namespace std;
#define ll long long
#define ld long double
#define uint unsigned int
#define ull unsigned long long
const ll INF = 1e18;
struct pnt {
int place, val;
pnt() {}
pnt(int p, int v) {
place = p;
val = v;
}
};
void print(vect... |
/*************************************************************************************
Daniel Stokes 1331134
**************************************************************************************/
#include <iostream>
#include "LargeNeighbourhoodSearch.h"
#include "Block.h"
#include <chrono>
#include <fstream>
#includ... |
/*
Name: Mohit Kishorbhai Sheladiya
Student ID: 117979203
Student Email: mksheladiya@myseneca.ca
Date: 21/02/14
*/
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <istream>
#include <iomanip>
#include <cstring>
#include "Label.h"
using namespace std;
namespace sdds
{
void Labe... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.Devices.Perception.Provider.0.h"
#include "Windows.Devices.Perception.0.h"
#include "Windows.Foundation.0.h"
#include "Windows.Foundation.Collections.0.h"... |
#ifndef RANK_DEP_ANALYSIS_H
#define RANK_DEP_ANALYSIS_H
#include "genericDataflowCommon.h"
#include "cfgUtils.h"
#include "VirtualCFGIterator.h"
#include "cfgUtils.h"
#include "CFGRewrite.h"
#include "CallGraphTraverse.h"
#include "analysisCommon.h"
#include "analysis.h"
#include "dataflow.h"
#include "latticeFull.h"
... |
//
// Created by twome on 11/05/2020.
//
#ifndef GAMEOFLIFE_OPENGL_FBO_H
#define GAMEOFLIFE_OPENGL_FBO_H
#include <glad/glad.h>
class Fbo {
private:
int width;
int height;
GLuint frameBuffer = 0;
GLuint colorBuffer = 0;
GLuint colorTexture = 0;
public:
Fbo(int width, int height);
~Fbo... |
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
ll util(vector<ll> &arr,vector<vector<ll> > &dp,ll i,ll sum){
if(sum==0) return 0;
ll n=arr.size();
if(i>=n || sum<0) return INT_MAX;
if(sum==arr[i]) return 1;
if(dp[sum][i]!=INT_MAX) return dp[sum][i];
return dp[sum][i]=... |
#include "coverageobject.h"
#include <Cutelyst/Application>
#include <Cutelyst/Controller>
#include <Cutelyst/Plugins/CSRFProtection/CSRFProtection>
#include <QObject>
#include <QTest>
#include <QNetworkCookie>
using namespace Cutelyst;
class TestCsrfProtection : public CoverageObject
{
Q_OBJECT
public:
exp... |
#pragma once
#include "shape.h"
class Bomb : public Shape
{
public:
Bomb(Point & _head, const char _c);
void takeShapeUp() override;
virtual bool canMoveShapeDown(Board & playBoard, bool & bombWasActivated, int & bombScore);
virtual void moveAllWayDown(Board & playBoard, int & bombScore, int & bombHeight);
virtu... |
#include "component/light/DirectionalLight.h"
#include "component/Camera.h"
#include "renderer/Renderer.h"
#include "core/GameObject.h"
#include "core/Helpers.h"
using namespace de;
using namespace de::component;
using namespace de::data;
COMPONENT_DEF_TYPE(DirectionalLight);
de::Material* DirectionalLight::sDireti... |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
//题目:给你一个长度固定的整数数组 arr,请你将该数组中出现的每个零都复写一遍,并将其余的元素向右平移。
//遍历数组,遇到零,重写一个零,不是零,保留下来
#include<stdio.h>
int main(){
int arry[9]={0,1,0,7,0,4,0,2,3};
int destination[9];
int d = 0;
for(int i = 0; i < 9; i++)
{
if (arry[i] == 0)
{// Copy zero twice.
destination[d] = 0;
d += 1;
desti... |
#pragma once
#ifndef _CONSTANTS_HPP_
#define _CONSTANTS_HPP_
#include <vector>
struct Data {
Data(std::string in, std::string out) : input(in), output(out) { }
std::string input;
std::string output;
};
namespace NConstants
{
// The linkage between input and output files
const std::vector<Data> FILES
{
{ "... |
/*************************************************************
* > File Name : P2764.cpp
* > Author : Tony
* > Created Time : 2019年04月08日 星期一 12时51分25秒
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
const ... |
/* Copyright 2015 The TensorFlow Authors. 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
Unless required by applicable law or a... |
//This is the implementation of the Tournament class. Please see the...
//corresponding header file for details about its interface.
#include "Tournament.hpp"
Tournament::Tournament(std::mt19937& generator)
{
this->p1Wins = 0;
this->p2Losses = 0;
this->p2Wins = 0;
this->p1Losses = 0;
this->currentRound = 0;
thi... |
//Dutch National Flag Algorithm
#include<iostream>
#include<vector>
using namespace std;
class Solution{
public:
void sortColors(vector<int> nums)
{
int l = 0;
int m = 0;
int h = nums.size()-1;
while(m<=h){
switch(nums[m]){
case 0:
swap(nums[l++],nums[m++]);
break;
case 1:
... |
// ======================================
// filename: project2_carter_slc0070.cpp
// author: Sydney Carter
// project: Duel Simulator
// sources: I used the Project2_hints.pdf as my source code
// stack overflow links from Piazza
// compile: compiled with g++
// ======================================
#includ... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--)
{
int n;
cin >> n;
int* arr = new int[n];
int* check = new int[n]();
for(int i=0;i<n-1;i++)
{
cin >> arr[i];
check[arr[i]-1]=-1;
}
for(in... |
#ifndef ARRAY_ANNOT_H
#define ARRAY_ANNOT_H
#include <AnnotExpr.h>
#include <AnnotCollect.h>
#include <OperatorDescriptors.h>
#include <CPPAnnotation.h>
#include <ValuePropagate.h>
#include <list>
class ArrayShapeDescriptor {
SymbolicValDescriptor dimension;
SymbolicFunctionDeclarationGroup length;
public:
vo... |
//
// Management.cpp
// Homework6
//
// Created by HeeCheol Kim on 2018. 10. 12..
// Copyright © 2018년 HeeCheol Kim. All rights reserved.
//
#include "Management.h"
double Management::calcScore(double subject[], int subjectCount) {
double sumScore = 0;
for(int i = 0; i < subjectCount; i++) {
sumSco... |
#include "header.h"
int main()
{
int M = 0;//¿
int N = 0;//Çà
string filename;
int X;
int Y;
int X1, X2, Y1, Y2;
char gpp;
char** gparr = nullptr;
char color;
char tmpcolor;
while (1)
{
cin >> gpp;
if (gpp == 'I' || gpp == 'i')
{
if (gparr != nullptr)
{
delete gparr;
}
cin >> M;
... |
#include<bits/stdc++.h>
using namespace std;
main()
{
int n;
cin >> n;
int p1 = 100, p2 = 100;
int a,b;
for(int i = 0; i < n; i++)
{
cin >> a >> b;
if(a == b)
continue;
else if(a > b)
p2 -= a;
else if(b > a)
p1 -= b;
}
cout << p1 << "\n" << p2 << '\n';
}
|
/*
LICENSE
-------
Copyright 2005-2013 Nullsoft, Inc.
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 condit... |
//
// Created by twome on 10/05/2020.
//
#ifndef GAMEOFLIFE_OPENGL_TEXTUREMANAGER_H
#define GAMEOFLIFE_OPENGL_TEXTUREMANAGER_H
#include <string>
#include <map>
#include "Texture.h"
class TextureManager {
private:
static std::map<std::string, Texture> textures;
public:
static Texture *load(std::string id);
... |
#include <iostream>
#include <set>
#include <vector>
#include <map>
#include <algorithm>
#include <sstream>
using namespace std;
template <class T>
vector<T> input_split() {
cin >> ws;
string line;
getline(cin, line);
stringstream ss(line);
T buf;
vector<T> tokens;
while (ss >> buf)
... |
#include <iostream>
#include "freckle/capp.h"
using namespace std;
int main()
{
CApp app;
cout << "Game ON! :D" << endl;
return app.onExecute();
}
|
#include <iostream>
#include <fstream>
#include <sstream>
int main(int argc, char **argv)
{
if (argc != 2) {
return 0;
}
std::ifstream f(argv[1]); // first argument is the test file
while (true) {
std::string line;
std::getline(f, line);
if (f.fail()) {
brea... |
#ifndef GPURESOURCE_H_
#define GPURESOURCE_H_
#include "Types.h"
#include <GL/glew.h>
#include "GpuException.h"
#include "Log.h"
namespace revel
{
namespace renderer
{
class GpuObject
{
public:
GpuObject();
virtual ~GpuObject();
u32 get_id() const;
bool is_valid() const;
protected:
u32 m_Identi... |
/**
* author : Wang Shaotong
* email : wangshaotongsydemon@gmail.com
* date : 2020-04-26
*
* id : poj 1328
* name : Radar Installation
* url : http://poj.org/problem?id=1328
* level : 1
* tag : 贪心
*/
#include <cmath>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace ... |
vector<vector<int>> v;
int st=-1;
for(int i=0;i<n;i++)
{
int flag=-1;
if(i==0 && A[i]<A[i+1])flag=0;
else if(i>0 && i<n && A[i]>=A[i+1] && A[i]>A[i-1])flag=1;
else if(i>0 && i<n && A[i]<=A[i-1] && A[i]<A[i+1])flag=0;
else if(i==n-1 && A... |
#include "i2c_master.h"
void I2C_Master::init() {
RCC->AHBENR |= RCC_AHBENR_GPIOBEN_Msk;
GPIOB->MODER &= ~GPIO_MODER_MODER8_0;
GPIOB->MODER |= GPIO_MODER_MODER8_1;
GPIOB->OTYPER |= GPIO_OTYPER_OT_8;
GPIOB->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR8_Msk;
GPIOB->PUPDR &= ~GPIO_PUPDR_PUPDR8_Msk;
GPIOB->... |
/***************************************************************************
Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD
FileName: MyAssert.h
Description: Provide a assert class in C++ or some assert Macroes in C.
Comment: ... |
/*
How to pass outer scope elements inside lambda functions
Case 1: Using [=]
[=](int &x) {
// All outer scope elements has been passed by value
}
Case 2: Using [&]
[&](int &x) {
// All outer scope elements has been passed by reference
}
$g++ -o lambda_func lambda_func.cpp --std=c++11
... |
#include "AssetTreeHandler.h"
Ui::AssetTreeHandler::AssetTreeHandler()
{
}
void Ui::AssetTreeHandler::AddSubCategories(QTreeWidgetItem * topLevel)
{
QTreeWidgetItem* brick = new QTreeWidgetItem();
brick->setText(0, "Bricks");
brick->setTextAlignment(0, Qt::AlignCenter);
topLevel->addChild(brick);
topLevel->ins... |
#include "boardpart.h"
BoardPart::BoardPart(QGraphicsItem *parent) : QGraphicsObject(parent), color(Qt::lightGray), dragOver(false)
{
setAcceptDrops(true);
}
BoardPart::~BoardPart() { }
void BoardPart::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
{
if(event->mimeData()->hasColor())
{
event->... |
//
// Created by wqy on 19-11-28.
//
#ifndef VERIFIER_VERTEX_H
#define VERIFIER_VERTEX_H
#include <string>
#include <list>
using std::string;
using std::list;
namespace esc {
class Edge;
class Vertex{
private:
string name;
//list<Edge*> nexts;
public:
Vertex() : name("") {}
... |
#include "ESPDevice.h"
#include "EEPROMManager.h"
#include <ESP8266WiFi.h>
#include <DNSServer.h>
#include "ESP8266mDNS.h"
//defines - mapeamento de pinos do NodeMCU
#define D0 16
#define D1 5
#define D2 4
#define D3 0
#define D4 2
#define D5 14 // WiFi Reset Button
#define D6 12 // Antigo DebugM... |
#ifndef WBPENULL_H
#define WBPENULL_H
#include "wbpe.h"
class WBPENull : public WBPE
{
public:
WBPENull();
virtual ~WBPENull();
DEFINE_WBPE_FACTORY( Null );
virtual void Evaluate( const WBParamEvaluator::SPEContext& Context, WBParamEvaluator::SEvaluatedParam& EvaluatedParam ) const;
};
#endif // WBPENULL_H
|
/**
* @file Factor.h
* @brief Graph factor for iSAM.
* @author Michael Kaess
* @version $Id: Factor.h 7610 2012-10-25 10:21:12Z hordurj $
*
* Copyright (C) 2009-2013 Massachusetts Institute of Technology.
* Michael Kaess, Hordur Johannsson, David Rosen,
* Nicholas Carlevaris-Bianco and John. J. Leonard
*
* Th... |
/**
* @brief Lab3: Geometry (part 2)
*
* In this lab we do some basic geometry stuff.
*
* @author Romain Maffina
* @date 26.02.2016
* @file main.cpp
*/
#include "point.h"
#include "segment.h"
#include "geometrydrawing.h"
#include <iostream>
using namespace std;
int main(void) {
// create a new square dr... |
//
// Utils.hpp
// alfrid
//
// Created by Yi-Wen Lin on 2016/5/29.
//
//
#ifndef Utils_hpp
#define Utils_hpp
#include <stdio.h>
#include "cinder/gl/Texture.h"
using namespace ci;
using namespace std;
namespace alfrid {
class Utils {
public:
static gl::TextureRef createTexture(string);
};
}
... |
#define NOMINMAX
#include "ArchiveReader.h"
#ifndef WIN32
#include "../external/minizip/zip.h"
#include "../external/minizip/unzip.h"
#include "../external/minizip/ioapi_mem.h"
#endif
#include "../external/lzma1801/C/7z.h"
#include "../external/lzma1801/C/7zAlloc.h"
#include "../external/lzma1801/C/7zFile.h"
#inclu... |
#include <iostream>
#include <vector>
using namespace std;
int n, m;
int *chain;
vector<pair<int, int>> v;
int main()
{
// freopen("a.txt", "r", stdin);
scanf("%d %d", &n, &m);
chain = new int[n];
for(int i = 0; i < n; i++)
scanf("%d", &chain[i]);
int curSum = 0;
int nSum = 0;
//for(int i = 0; i < n; i++)
/... |
#ifndef _ScreenGameMainMenu_H_
#define _ScreenGameMainMenu_H_
#include <iostream>
#include "BaseGoods.h"
#include "GameView.h"
#include "Global.h"
#include "Player.h"
#include "TextRender.h"
#include "Util.h"
#include "BaseMagic.h"
#include "MagicAttack.h"
#include "MagicRestore.h"
#include "ScreenMagic.h"
#include "... |
#include "Celestial.h"
Celestial::Celestial()
{
celestialName = "Blank";
}
Celestial::~Celestial()
{
//dtor
}
|
/**
MIT License
Copyright (c) 2019 mpomaranski at gmail
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 without limitation the rights
to use, copy, modify... |
#include <iostream>
#include <vector>
#include <string>
#include <opencv2/opencv.hpp>
#include "../HSVImage.hpp"
std::string window = "Threshold Picker";
int hue_upper_threshold;
std::string hue_upper_trackbar = "Hue Upper Threshold:";
int hue_lower_threshold;
std::string hue_lower_trackbar = "Hue Lower Threshold";
in... |
#include <iostream>
#include "afx.h"
#include <winsock2.h>
#include <process.h> /* _beginthread, _endthread */
#include <string.h>
#include <time.h>
using namespace std;
CFile f;
CFileException ex;
clock_t start, finish;
// удалить сообщение с номером
void del(wchar_t* p, int n) {
wchar_t tel[200];
int j = ... |
// Copyright 2020-2021 Russ 'trdwll' Treadwell <trdwll.com>. All Rights Reserved.
#include "Core/SteamUserStats.h"
#include "SteamBridgeUtils.h"
USteamUserStats::USteamUserStats()
{
OnGlobalAchievementPercentagesReadyCallback.Register(this, &USteamUserStats::OnGlobalAchievementPercentagesReady);
OnGlobalStatsRecei... |
//
// Created by BramboraSK on 24. 9. 2021.
//
// Generujte čísla od -10 do 10. Spočítajte 6 čísel, ktoré sú >0 a zároveň deliteľné tromi.
#include <iostream>
#include <random>
using namespace std;
int main() {
int sucet = 0, i = 0, random = 0;
// Dala by sa pouzit aj funkcia rand z kniznice stdlib, ale ni... |
#if defined(WIN32) && 0
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <mmsystem.h>
#include <vector>
#include <mutex>
#include "IAudioSource.h"
#include "platform.h"
#pragma comment(lib,"winmm.lib")
class WaveInAudioSource : public IAudioSource
{
public:
WaveInAudioSource()
:m_handle()
{
... |
//
// PartyVideoDJ - YouTube crossfading app
// Copyright (C) 2008-2017 Michael Fink
//
/// \file YouTubeWebPageView.hpp View to display YouTube web page
//
#pragma once
#include "WebPageWindowEx.hpp"
class VideoInfo;
const DISPID c_uiExternalStateId = 0;
const DISPID c_uiExternalErrorId = 1;
template <typename T>
... |
#pragma once
#include <map>
#include <utility>
#include "IAgent.h"
class QTable {
// find the best action given a state
// find the best state regardless of action
std::map<State, Reward>;
std::map<State, map<Action, State> >;
QTable(int states, int actions) {
}
};
class QLearner : p... |
#ifndef CG_PCH_H
#define CG_PCH_H
#ifdef COMPUTATIONALGEOMETRY_EXPORTS
#define CGAPI __declspec(dllexport)
#else
#define CGAPI __declspec(dllimport)
#endif
#include <Windows.h>
#include <array>
#include <vector>
#endif
|
/* -*- c++ -*- */
/*
* Copyright 2018 <+YOU OR YOUR COMPANY+>.
*
* This 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, or (at your option)
* any later version.
*
* This software i... |
#include "CACLInteger.hpp"
// 重载大于号
bool CACLInteger::operator>(const CACLInteger &number) {
if (symbol != number.symbol) {
return symbol == false ? true : false;
}
// 从找到this和number中位数最高的,然后最高位开始比较
if (symbol == false) {
if (bit > number.bit) {
return true;
} el... |
#include<stdio.h>
//#include<conio.h>
#include<malloc.h>
struct node{
int data;
struct node *next;
};
int push(struct node **,int);
int count(struct node *,int);
int main(void){
struct node *head;
head=NULL;
push(&head,1);
push(&head,4);
push(&head,6);
push(&head,... |
#ifndef _SQMYSQL_CONNECTION_HPP_
#define _SQMYSQL_CONNECTION_HPP_
// ------------------------------------------------------------------------------------------------
#include "Handle/Connection.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
... |
/**
* @File test_chess_board.cpp
* @Brief file_description
* Details:
* @Author guohainan
* @Version v0.0.1
* @date 2017-09-06 23:33:16
*/
#include "gtest/gtest.h"
#define UNIT_TEST true
#include "gomoku/chess_board.h"
using namespace gomoku;
TEST(ChessBoard, isGameOver)
{
ChessBoard board;
board.pla... |
#pragma once
namespace Encoder {
class Encoder {
public:
virtual ~Encoder(){};
virtual bool getAngleDeg(float &angle) = 0;
virtual bool getAngularVelocityDegPerSec(float &speed) = 0;
virtual bool reset() = 0;
};
} // namespace Encoder
|
#include <uWS/uWS.h>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include "Eigen-3.3/Eigen/Core"
#include "Eigen-3.3/Eigen/QR"
#include "helpers.h"
#include "json.hpp"
#include "spline.h"
// for convenience
using nlohmann::json;
using std::string;
using std::vector;
int main() {
uWS::... |
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
class Solution {
public:
bool uniqueOccurrences(vector<int>& arr) {
unordered_map<int, int> m;
for (auto elem : arr) {
if (m.count(elem))
++m[elem];
else
m[elem] = 1;
}
unordered_se... |
#include "connectdialog.h"
#include "ui_connectdialog.h"
connectDialog::connectDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::connectDialog)
{
this->setWindowFlags(this->windowFlags()|Qt::FramelessWindowHint);
ui->setupUi(this);
}
connectDialog::~connectDialog()
{
delete ui;
}
void connect... |
#include "catch.hpp"
#include "window.hpp"
#include "game.hpp"
#include "player.hpp"
#include "soldier.hpp"
#include "misting.hpp"
#include "mistborn.hpp"
#include "metal.hpp"
// game
TEST_CASE("game constructor", "[game]") {
Window window((DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT, "Test");
SECTION("1") {
... |
#include <stdio.h>
#include <string.h>
#include <vector>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include "__t__serviceimpl.h"
#include "iComm.h"
#include "dn.h"
using namespace Comm;
using namespace std;
__T__ServiceImpl :: __T__ServiceImpl(){}
__T__Servic... |
#pragma once
#include "gameNode.h"
struct tagWall
{
RECT top;
RECT bot;
bool isScored;
};
class mainGame : public gameNode
{
private:
RECT _rc;
RECT _land[3];
tagWall _wall[10];
char str[64];
char str2[64];
float countdown;
int _x, _y;
float _jumpPower, _gravity;
bool _is... |
#include <stdio.h>
#include <math.h>
#include <iostream>
using namespace std;
double LM(double *l,double *T1,double *T2);
double MM(double *l,double *T3,double *T4);
double NM(double *l,double *T1,double *T2,double *T3,double *T4);
double Udot(double *X,double *m,double *q,double *r,double *W,double *V,double *th);
d... |
/**
* Copyright (C) 2017 Alibaba Group Holding Limited. 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 <string>
/*
문제:
4개의 기호 ‘(’, ‘)’, ‘[’, ‘]’를 이용해서 만들어지는 괄호열 중에서 올바른 괄호열이란
다음과 같이 정의된다.
한 쌍의 괄호로만 이루어진 ‘()’와 ‘[]’는 올바른 괄호열이다.
만일 X가 올바른 괄호열이면 ‘(X)’이나 ‘[X]’도 모두 올바른 괄호열이 된다.
X와 Y 모두 올바른 괄호열이라면 이들을 결합한 XY도 올바른 괄호열이 된다.
예를 들어 ‘(()[[]])’나 ‘(())[][]’ 는 올바른 괄호열이지만 ‘([)]’ 나 ‘(()()[]’ 은 모두
올바른 괄호열이 아니다. 우... |
// Problem : B. Minimum Average Path
// Contest : Codeforces - ITMO Academy: pilot course - Binary Search - Step 4
// URL : https://codeforces.com/edu/course/2/lesson/6/4/practice/contest/285069/problem/B
// Memory Limit : 512 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#p... |
#include <iostream>
#include "CharacterVector.h"
#include "DoubleVector.h"
#include "IntegerVector.h"
int main()
{
CharacterVector cv;
DoubleVector dv;
IntegerVector iv;
//-------------------------------------------------------------------------
// test DoubleVector: put, get, size, out_of_range
... |
/* --- 1D BINARY INDEXED TREE --- */
#include <bits/stdc++.h>
using namespace std;
const int MAX = 8; // # of elements
// 0 1 2 3 4 5 6 7
int arr[] = {1, 0, 2, 1, 1, 3, 0, 4};
vector<int> BIT(MAX);
void update(int k, int v) {
/*
k = indx which need's to be updated
v = value to be updated... |
#ifndef _HS_SFM_UNIT_TEST_SFM_PIPELINE_DATA_TESTER_HPP_
#define _HS_SFM_UNIT_TEST_SFM_PIPELINE_DATA_TESTER_HPP_
#include <iostream>
#include <fstream>
#include "hs_math/linear_algebra/eigen_macro.hpp"
#include "hs_math/geometry/euler_angles.hpp"
#include "hs_sfm/sfm_utility/key_type.hpp"
#include "hs_sfm/sfm_utilit... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.ApplicationModel.Activation.0.h"
#include "Windows.ApplicationModel.Appointments.AppointmentsProvider.0.h"
#include "Windows.ApplicationModel.Background.0... |
#include <iostream>
#include "version.h"
using namespace std;
void version::displayVersion(){
cout << "Current version is ";
}
|
#include <iostream>
#include <string>
#include "Text.h"
using std::string;
using std::cin;
using std::cout;
using std::endl;
using std::ostream;
int main(){
// read text from standard input
uint length1 = 0;
uint capacity1 = 0;
cout << "Enter a sequence of words separated by white spaces and terminat... |
#include "virtual_machine.h"
using namespace std;
int run(uint64_t *main_program, size_t length) {
stack<Operand> operand_stack;
stack<uint64_t> operand_stack_scope;
operand_stack_scope.push(0);
stack<uint64_t> function_stack;
stack<vector<int64_t>> function_stack_variables;
uint64_t ins, pc=0;
uint... |
#include <bits/stdc++.h>
using namespace std;
int test_case;
int knapsak_sizes[1000][2];
int weights_profits[1000][3];
float knapsack(int weights[],int profits[], int n, int W)
{
int i, j, pos;
float d[n];
float totalValue = 0, totalWeight = 0;
for (i = 0; i < n; i++)
{
d[i] = profits[i]*1.... |
vclass Solution {
public:
vector<vector<int>> flipAndInvertImage(vector<vector<int>>& A) {
for (auto & row : A) reverse(row.begin(), row.end());
for (auto & row : A)
for (int & num : row) num ^= 1;
return A;
}
}; |
/* ASSIGNMENT 4 - COEN 244
Jean-Baptiste WARING 40054925
FAROUQ HAMEDALLAH 40087448
HOSPITAL MANAGEMENT SYSTEM
*/
#include "./date.h"
#include <iostream>
using namespace std;
Date::Date(){ //Default Date; January 24th 1984, presentation of the first Macintosh Computer.
date = new int[3];
date[0]=1984;
date[1]=... |
#ifndef _GoodsMedicineLife_H_
#define _GoodsMedicineLife_H_
#include <iostream>
class Player;
/**
* 10灵药类
* 对生命的恢复0~100,表示恢复被使用者??%的生命,
* 并解除死亡状态,但被使用者必须是死亡状态。
* @author Chen
*
*/
class GoodsMedicineLife: public BaseGoods
{
public:
virtual ~GoodsMedicineLife(){}
protected:
virtual void setOtherData(ch... |
#include "SpellService.h"
#include <thrift/transport/TSocket.h>
#include <thrift/transport/TBufferTransports.h>
#include <thrift/protocol/TBinaryProtocol.h>
//#include <boost/thread.hpp>
//#include <boost/date_time.hpp>
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
#inc... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "HealthDisplayComponent.generated.h"
class ABasic_UMG_Creator;
class UHealthAndDamageComponent;
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableCo... |
#include "SpaceDeletionView.h"
#include "../../services/appContext/AppContext.h"
#include "../../presentations/space/SpacePresentation.h"
#include "../viewUtils/ViewUtils.h"
SpaceDeletionView::SpaceDeletionView() {
cancelCommandEnabled = true;
name = "space deletion";
spaces = SpacePresentation::get_all_s... |
class Solution {
public:
int lengthOfLongestSubstring(string s) {
unordered_map<char, int> m; // char--last pos
// left: left indx of last longest substring (window) w.o repeating
int res = 0, left = -1;
for (int i = 0; i < s.size(); ++i) {
// chararcter exist, ... |
#ifndef ASIO_DGRAM_HANDLER_HPP
#define ASIO_DGRAM_HANDLER_HPP
#include "asio/connection_handler.hpp"
#include "asio/dgram_connection.hpp"
template<class conn_T>
class dgram_handler : public connection_handler
{
public:
dgram_handler(boost::asio::io_service & io_service, std::unique_ptr<deviceDescription> descript... |
#ifndef PAGEJEUX_H
#define PAGEJEUX_H
#include <QWidget>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QString>
#include <QStatusBar>
#include <QDebug>
#include <QKeyEvent>
#include "Grille.h"
#include "Tableau.h"
#include "Score.h"
class PageJeu : public QWidget
{
public:
PageJeu();
PageJeu(in... |
#pragma once
namespace vcpkg::PortFileProvider
{
struct PortFileProvider;
struct PathsPortFileProvider;
}
|
/*vim操作
vimtutor 英文版
vimtutor zh 中文版
*/
/*
oj:命令提示符
ls : 命令
ls -la : 命令 选项
ls -la a.c : 命令 选项 参数
ls -lad dir :命令 选项 参数
*/
/*家目录
权限有r,w,x三种权限分别表示可读、可写、可执行
vim .zshrc
cat /etc/shells
echo ${SHELL}
cat /etc/passwd
*/
/*树形结构
切换目录、目录跳转: 使用cd,如果有GUI也可使用
查看目录... |
/**
* Copyright (C) 2017 Alibaba Group Holding Limited. 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 "MathLibrary.h"
#include "Shape.h"
#include "Sphere.h"
#include "Plane.h"
#include "Ray.h"
#include "PointLight.h"
#include "Lights.h"
#include "BVH.h"
#include "Node.h"
#include <vector>
using namespace std;
class Ray;
class Sphere;
class Shape;
class Plane;
class vec3;
class mat4;
class PointLi... |
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
using namespace std;
typedef long long ll;
const int maxn = 10005, maxm = 30005;
int n, m, eNum;
int dis[maxn];
bool vis[maxn];
// 边结构,存储终点和下一条同起点边的下标
struct Edge {
int v, d, next;
Edge() {}
Edge(int _v, int _d, int _next) : v(_v), ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.