text stringlengths 8 6.88M |
|---|
/**
* @file UriTests.cpp
*
* This module contains the unit tests of the Uri::Uri class.
*
* © 2021 by developer-pseudo
*/
#include <gtest/gtest.h>
#include <Uri/Uri.hpp>
TEST(UriTests, ParseFromStringUrl) {
Uri::Uri uri;
ASSERT_TRUE(uri.ParseFromString("http://www.example.com/foo/bar"));
ASSERT_EQ(... |
/*
•• E2.12
Write a program that reads a number between 1,000 and 999,999 from the user and prints it with a comma separating the thousands. Here is a sample dialog; the user input is in color:
Please enter an integer between 1000 and 999999: 23456
23,456
*/
#include <iostream>
#include <iomanip>
#include <stri... |
#include "spis.h"
int y, x = 0;
bool cursorVisible = false;
int tickDelay = 1024;
vector<runtimeInput *> runtimeInputs;
void editLoop();
void *runtimeInputLoop(void *ptr);
void runtimeLoop();
void redrawContent();
int main(int argc, char *argv[]){
std::ifstream file;
signal(SIGWINCH, redrawSystem);
if(argc>... |
#include "sensorBase.h"
#include "sensoremu.h"
#include "sensorDHT22.h"
float sensorBase::getTemperature(void) {
return temperature;
}
float sensorBase::getHumidity(void) {
return humidity;
}
short int sensorBase::getCrcError(std::string& e) {
e = errorString;
return crcError;
}
int sensorBase::getCrcErrorCounter(... |
//
// Created by tyan on 1/31/18.
//
#ifndef MYSQL_CPP_DRIVER_H
#define MYSQL_CPP_DRIVER_H
#include <mysql/mysql.h>
#include <string>
#include "connection.h"
#include "sqlexception.h"
using std::string;
using std::unique_ptr;
class Driver
{
public:
static Driver *get_instance();
unique_ptr<Connection> con... |
#include "mainwindow.h"
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
ui->setupUi(this);
connect(ui->input_button, SIGNAL (clicked()), this, SLOT (build()));
connect(ui->step_button, SIGNAL (clicked()), this, SLOT (step()));
}
MainWindow::~MainWindow()
{
dele... |
#include "helpers.h"
int main (void) {
cl_uint dev_number = 0;
cl_platform_id platform_id = 0;
/* number of platforms on the system */
platforms_number ();
/* id of the first platform proposed by the system */
platform_id = get_platform ();
/* information about the platform specified by platform_id */... |
#ifndef __ASYNC_VBO_TRANSFERS_TYPES_H__
#define __ASYNC_VBO_TRANSFERS_TYPES_H__
#include <glm/glm.hpp>
#include <glm/ext.hpp>
typedef unsigned short ushort;
typedef unsigned char uchar;
typedef unsigned int uint32;
typedef unsigned char uint8;
typedef unsigned __int64 uint64;
typedef __int64 int64;
//typedef glm::ve... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setupTask();
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::setDescription(QString text)
{
ui->taskField... |
#include<iostream>
#include<string>
using namespace std;
string numbers[10] = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
int main()
{
int sum = 0;
string number;
cin >> number;
int length = number.length();
for (int i = 0; i < length; i++)
{
sum += ((char)number[i] - ... |
/*
* NTP.cpp
*
* Author: Hiromasa Ihara (taisyo)
* Created: 2016-04-22
*/
|
#ifndef FANGZHEN_H_INCLUDED
#define FANGZHEN_H_INCLUDED
class Node
{
public:
Node();
~Node();
private:
int data;
Node * next;
Node * head;
Node * tail;
Node * q;
public:
Node * create(int n);
void fangzhen(Node * head,int n);
};
#endif // FANGZHEN_H_INCLUDED
|
//
// main.cpp
// FunctionOverload
//
// Created by 裴明明 on 2020/2/4.
// Copyright © 2020 裴明明. All rights reserved.
//
#include <iostream>
using namespace std;
// MARK: - 函数重载的规则
// 规则:
// 函数名相同,参数个数不一样,类型不一样,或者顺序不一样
// 注意点:
// 返回值类型的不同与函数重载无关
// 调用函数时,实参的隐式类型转换,默认参数的设置 等情况都有可能会产生二义性
// MARK: - 参数个数不一样
int sum... |
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int val;
Node *next;
Node() : val(0), next(NULL){};
Node(int val) : val(val), next(NULL){};
};
Node *insert(vector<int> nums)
{
Node *head = new Node(nums[0]), *temp = head;
int i = 1;
while (temp && i < nums.size())
{
... |
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
int main() {
int n;
scanf("%d", &n);
vector<ll> A(n);
for (int i = 0; i < n; ++i) {
scanf("%lld", &A[i]);
}
for (int i = 1; i < n; ++i) {
A[i] += A[i - 1];
}
ll q, x... |
#include "philosophersmodel.h"
PhilosophersModel::PhilosophersModel() : philosopherList(nullptr){}
PhilosopherList *PhilosophersModel::list() const {
return philosopherList;
}
void PhilosophersModel::setList(PhilosopherList *list) {
beginResetModel();
if(philosopherList)
philosopherList->disconne... |
#include<iostream>
using namespace std;
int main()
{
int day;
cout<<"enter day:";
cin>>day;
switch(day)
{
case 1:
cout<<"Monday"<<endl;
break;
case 2:
cout<<"Tuesday"<<endl;
break;
case 3:
cout<<"Wednesday"<<endl;
break;
case 4:
cout<<"Thursday"<<end... |
#include "graphics.h"
int main()
{
graphics image(500, 500); // game is all contained in graphics class
return 0;
}
|
#include "spis.h"
#include <pthread.h>
#include <locale.h>
pthread_t inputThread;
string makeThreeDigit(int n);
WINDOW *playButton;
WINDOW *stopButton;
WINDOW *pauseButton;
WINDOW *delayValueWindow;
WINDOW *increaseDelayButton;
WINDOW *decreaseDelayButton;
int grid_size[2] = {4,4};
std::vector<node> grid;
vector<... |
#include <iostream>
using namespace std;
class node{
public:
int data;
node* next;
node(int d){
data=d;
next=NULL;
}
};
void InsertAtBeg(node* &head,node* &tail,int data){
if(head==NULL){
// Linked is empty
node* n=new node(data);
head=tail=n;
}
else{
node* n=new node(data);
n->next=head;
head... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
long tc;cin>>tc;
while(tc--)
{
long n;long k;
cin>>n>>k;
if(n%k==0) cout<<n<<endl;
else
{
long k1=floor(n-k/2);
long remain=k1%k;
cout<<n-remain<<endl;
}
}
}
|
// include header files
#include <iostream>
#include <string>
// using namespace declaration
using namespace std;
int main()
{
// variables
// here we create 2 strings to hold the first and last names
string firstName, lastName = "";
// output a message to the console
cout << "\t\t\t\t\tCin and Cout" << endl;
... |
/***********************************************************************
created: Tue May 29 2012
author: Paul D Turner
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2012 Pa... |
#include <iostream>
#include <vector>
#include <rose.h>
#include "printer.hpp"
#include "translator.hpp"
#include "main.hpp"
#include <map>
#include <string>
using std::cout;
using std::endl;
using std::vector;
using std::string;
using std::map;
using std::pair;
using namespace SageBuilder;
using namespace SageInterf... |
/***************************************************************************
# Copyright (c) 2020, NVIDIA CORPORATION. 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... |
#include "../Include/UI.h"
#include "../Include/Rect.h"
#include "../Include/Botton.h"
#include "../Include/Widget.h"
#include "../Include/Manager.h"
#include "../Include/Factory.h"
UI::UI(Manager* mng)
:backgroundCount(0)
, isdrawing(false)
, isSaving(false)
, isLoading(false)
{
mManager = mng;
init();
}
void ... |
#include "Random.h"
#include <iostream>
#include <stdlib.h>
#include <time.h>
Random::Random()
{
init();
}
Random::Random(long seed)
{
}
Random::~Random()
{
}
void Random::init()
{
if (false == bInit)
{
//初始化随机数种子,只在程序首次使用Random调用时候执行一次
srand((unsigned int)time(NULL));
bIn... |
// Solution one:
class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
if(matrix.empty())
return;
int m = matrix.size(), n = matrix[0].size();
for(int i = 0; i < m; i++)
{
for(int j = 0; j < n; j++)
{
if(matrix[i][j... |
#include<bits/stdc++.h>
using namespace std;
int solve(int n)
{
map<int,vector<int>> hash;
hash[0].push_back(8);
hash[0].push_back(0);
hash[1].push_back(4);
hash[1].push_back(1);
hash[1].push_back(2);
hash[2].push_back(2);
hash[2].push_back(3);
hash[2].push_back(5);
hash[2].push_back(1);
hash[3].push_back(... |
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
long long c1,c2,sum;
scanf("%lld%lld",&c1,&c2);
sum = ((c2 -c1)/100.0 + 0.5);
int h = sum/3600;
int m = sum%3600/60;
int s = sum%3600%60;
printf("%d%d:%d%d:%d%d",h/10,h%10,m/10,m%10,s/10,s%10);
re... |
// avvinci - summers 18
// #include"prettyprint.hpp"
#include<bits/stdc++.h>
using namespace std;
typedef pair<long long,long long > P;
#define mod 998244353
#define pb push_back
#define fs first
#define sc second
#define ll long long
#define fr(it,st,en) for(it=st;it<en;it++)
#define all(container) container.... |
/*
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... |
#ifndef TWODV_H
#define TWODV_H
#include <QMainWindow>
#include <QtCore>
#include <QtGui>
#include <QGraphicsScene>
#include <QGraphicsItemAnimation>
#include <QMouseEvent>
#include <QKeyEvent>
QT_BEGIN_NAMESPACE
namespace Ui { class TwoDV; }
QT_END_NAMESPACE
class TwoDV : public QMainWindow
{
Q... |
// algo_binarySearch.cpp : Defines the entry point for the console application.
//finding an element in a SORTED array
//divide-conquer-combine
/*
1.Divide : check middle element
2.Conquer : recursively search 1 binary array
3.Combine : trivial
*/
/*
// initially called with low = 0, high = N-1
BinarySearch(A... |
#pragma once
#include <SFML\Graphics.hpp>
class ChessPiece;
class ChessSquare :
public sf::Drawable
{
public:
ChessSquare();
~ChessSquare();
void Initialize(sf::Color inColor, sf::Vector2u inPositionIndex, sf::Vector2f inPosition, ChessPiece* inPieceOccupying = nullptr);
public:
ChessPiece* GetPieceOccupyingSqu... |
// This file has been generated by Py++.
#ifndef PropertyDefinitionColourUDim_hpp__pyplusplus_wrapper
#define PropertyDefinitionColourUDim_hpp__pyplusplus_wrapper
void register_PropertyDefinitionColourUDim_class();
#endif//PropertyDefinitionColourUDim_hpp__pyplusplus_wrapper
|
/*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
#include <iostream>
using namespace std;
int main() {
int str[5], i, sum = 0;
for (i = 0; i < 5; i++) {
cin >> str[i];
}
for (i = 0; i < 5; i++) {
if (str[i] > 0)
sum += str[i];
}
cout << sum << endl;
}
|
#include <cstdio>
#include <vector>
#include <string>
using namespace std;
int ca, cb, n;
vector<string> actions;
vector<pair<int, int>> states;
int stateLen;
bool flag = false;
void dfs(int ta, int tb)
{
if (flag)
return;
if (tb == n)
{
for (int i = 0; i < actions.size(); i++)
... |
#include "CellProcessor.h"
Cell processCell(const Cell& i_cell, int i_numberOfAliveNeighbours)
{
Cell next(i_cell);
if(i_numberOfAliveNeighbours > 3)
next.d_state = State::InternalState::DEAD;
if(i_numberOfAliveNeighbours < 2)
next.d_state = State::InternalState::DEAD;
if(i_numberOfAliveNeighbours == 3... |
#include "mygraficview.h"
#include <QWidget>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsItemGroup>
#include <QTimer>
#include <QDebug>
void mygraficview::mousePressEvent(QMouseEvent *event)
{
QGraphicsView::mousePressEvent(event); // З
qDebug() << "Pressed";
}
|
/**
* @file ParticleIteratorWrapper.h
* Contains ParticleIteratorWrapper class.
* @author seckler
* @date 29.05.2018
*/
#pragma once
#include <memory>
#include "autopas/iterators/ParticleIteratorInterface.h"
namespace autopas {
/**
* ParticleIteratorWrapper class is the main class visible to the user to iterat... |
#include "Commands.h"
#include "iostream"
#include "GlobalVariables.h"
RenameCommand::RenameCommand(string args):BaseCommand(args){
}
void RenameCommand::execute(FileSystem & fs){
if (verbose==2||verbose==3)
cout<<toString()+" "+getArgs()<<endl;
int whereSpace=getArgs().find_first_of(' ');
if (whe... |
/*
* configureparser.h
*
* Created on: 2015年5月5日
* Author: root
*/
#ifndef CONFIGUREPARSER_H_
#define CONFIGUREPARSER_H_
#include<string>
#include<fstream>
#include<iostream>
#include<map>
#include<sstream>
//using namespace std;
//reference: www.dreamincode.net/forums/topic/183191-create-a-simple-configur... |
/**********************************************************
* License: The MIT License
* https://www.github.com/doc97/TxtAdv/blob/master/LICENSE
**********************************************************/
#include "catch.hpp"
#include "StoryPointStore.h"
namespace txt
{
TEST_CASE("StoryPointStore - add/get story poi... |
#ifndef GESTION_UTI_H
#define GESTION_UTI_H
#include <QWidget>
/******************************************
* Widget n'étant disponible que pour les administrateurs et permettant de modifier le login,
* le Nom et le type d'utilisateur de n'importe quel utilisateur selon son club
* **********************************... |
#ifndef INEXOR_NET_MULTI_CONNECT_HEADER
#define INEXOR_NET_MULTI_CONNECT_HEADER
#include <list>
#include "net/MessageConnect.h"
namespace inexor {
namespace net {
/**
* This is a Hub for multiple MessageConnect.
*
* Supports listening for Messages on the attached
* connects and broadcasting messages to... |
#include <iostream>
using namespace std;
template <typename T>
class LinkedList {
private:
class Node {
public:
Node *next;
T data;
Node(T input);
};
Node *head;
public:
// constructor
LinkedList();
void append (T data);
void prepend (T data);
// because delete is a protected keyword
... |
/* Class for doin transformations on an image (polar & inverse polar, with both nearest neighbor
* and bilinear interpolation)
*/
#ifndef IMAGE_TRANSFORMS_H
#define IMAGE_TRANSFORMS_H
#include <cmath>
#include <cstdlib>
#include <cstdio>
#define PI 3.14159265359
#pragma once
class ImageTransformClass
... |
//
// Created by wiktor on 03.06.18.
//
|
/*
this is the solution fo beakjoon #9613
https://www.acmicpc.net/problem/9613
*/
#include<iostream>
using namespace std;
int a[100];
int gcd(int a,int b){
if(b==0) return a;
else{
return gcd(b,a%b);
}
}
int main(){
int T;
cin>>T;
for(int i=0;i<T;i++){
int num=0;
long long int sum=0;
cin>>num;
f... |
#include <Arduino.h>
#include "SWCommand.h"
SWCommand::SWCommand()
{
_done = false;
_type = SWCommandTypeNone;
_index = 0;
}
bool SWCommand::available()
{
if ( Serial.available() > 0 )
{
char chr = (char)Serial.read();
if ( chr == '\n' )
{
_done = _parse();
_index = 0;
i... |
/*#######.
########",#:
#########',##".
##'##'## .##',##.
## ## ## # ##",#.
## ## ## ## ##'
## ## ## :##
## ## ##*/
#include <iostream>
#include "Pony.hpp"
int Pony::_lastId = 0;
Pony::Pony()
{
// Set current instance ID
Pony::_lastId++;
this->_id = Pony::_lastId;
std::cout <<... |
#include <stdio.h>
// empty cell
#define UNASSIGNED 0
// size of grid
#define N 9
bool FindUnassignedLocation(int grid[N][N], int &row, int &col){
for(row = 0; row < N; row++){
for(col = 0; col < N; col++){
if(grid[row][col] == UNASSIGNED)
return true;
}
}
return false;
}
bool UsedInRow(int grid[N][N]... |
#pragma once
#include <landstalker-lib/patches/game_patch.hpp>
/**
* Make the effect of Statue of Gaia and Sword of Gaia way faster than in vanilla.
*/
class PatchFasterGaiaEffect : public GamePatch
{
public:
void alter_rom(md::ROM& rom) override
{
constexpr uint8_t SPEEDUP_FACTOR = 3;
rom.... |
class Solution {
public:
bool isIsomorphic(string s, string t) {
unordered_map<char,char> ss,tt;
for(int i=0;i<s.size();i++)
{
ss[s[i]]=t[i]; //充分利用了map的一对一特性,对重复键值重新赋值,将檫除之前的
tt[t[i]]=s[i];
}
for(int j=0;j<s.size();j++)
{
... |
/***************************************************************************//**
* @file {FileName}
* @brief Implementation for the {ClassName} class.
*
* @date {GenerateTime}
* @autor generated by {ScriptName} script.
* {ScriptName} written by Mitsu(https://github.com/mitsuaki-n).
***********... |
// -*- C++ -*-
//
// Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory,
// Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC
//
// This file is part of FreePOOMA.
//
// FreePOOMA is free software; you can redistribute it and/or modify it
// under the terms of the Expat license.
//
// This progr... |
/*
* SPDX-FileCopyrightText: (C) 2013-2022 Daniel Nicoletti <dantti12@gmail.com>
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef CUTELYST_REQUEST_P_H
#define CUTELYST_REQUEST_P_H
#include "engine.h"
#include "request.h"
#include "upload.h"
#include <QtCore/QStringList>
#include <QtCore/QUrl>
#include <QtCore/QU... |
// -*- C++ -*-
//
// Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory,
// Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC
//
// This file is part of FreePOOMA.
//
// FreePOOMA is free software; you can redistribute it and/or modify it
// under the terms of the Expat license.
//
// This progr... |
#ifndef SCORE_PROC_H
#define SCORE_PROC_H
#include <iostream>
#include <fstream>
#include "armadillo"
#include "Skeleton.h"
#include <cmath>
using namespace arma;
using namespace std;
#define NUM_WINDOWS 10
#define SCALING_FACTOR 30000
/**
* A struct representing the 4 tuple nature of each joint.
*/
struct jointData... |
#include<bits/stdc++.h>
using namespace std;
int d[110][110];
bool vis[110];
int ccn = 0;
vector<int> v[110];
vector<int> cc[110];
void f(int cur){
if(vis[cur]) return;
vis[cur] = 1;
cc[ccn].push_back(cur);
for(int next:v[cur]) f(next);
}
int main(){
int n,m;
scanf("%d %d",&n,&m);
for(int i=0;i<n... |
/****************************************************************************
** Meta object code from reading C++ file 'qtmaterialtoggle_internal.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.13.1)
**
** WARNING! All changes made in this file will be lost!
******************************************... |
#include <bits/stdc++.h>
#include <sys/types.h>
#include <sys/socket.h>
#include<arpa/inet.h>
#include <signal.h>
#include <netinet/in.h>
#include<netdb.h>
#include<errno.h>
#include<unistd.h>
#include <pthread.h>
#include <string>
#include <dirent.h>
using namespace std;
struct trackerdara{
string socketdata;... |
#include "veritas.hpp"
#include "BoundaryCondition.hpp"
BoundaryCondition::~BoundaryCondition() {
}
double BoundaryCondition::GetValueFromSameLevel(int i, int j,int val) {
return 0.0;
}
|
/*
Copyright (c) 2017, Mathias Hans & Cyrill Stachniss
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 above copyright notice, this
list of condition... |
#ifndef SRC_FUNCIONARIO_H_
#define SRC_FUNCIONARIO_H_
#include <string>
#include <iostream>
#include <vector>
#include "Veiculo.h"
#include "Excepcoes.h"
using namespace std;
class Funcionario {
string nome;
vector<Veiculo *> veiculos;
public:
Funcionario(string n);
vector <Veiculo *> getVeiculos() const;
void ... |
/* GPA2 - IFC
Criado Por: Natalia Kelim Thiel
Data: 06/04/2016
Descrição:
Código fonte (source) da biblioteca para uso do Teclado Analógico
*/
#include "Teclado.h"
/*static*/int Teclado::_pino;
/*static*/boolean Teclado::mudanca;
/*static*/int Teclado::menu;
/*static*/int Teclado::x;
/*static... |
#include <iostream>
#include <stdio.h>
#include "CIR.h"
#include "vector"
#include "map"
#define _USE_MATH_DEFINES
#include "math.h"
using namespace std;
int main() {
CIR c(0,M_PI,double(10e-6));
cout << c.f1();
}
|
/**
*
* @file Dynamixel.hpp
* @beief Dynamixel communication control class
* @author Naoki Takahashi
*
**/
#pragma once
#include "SerialControllerBase.hpp"
#include <memory>
#include <Tools/Log/Logger.hpp>
#include "../SerialReturnPacket.hpp"
namespace IO {
namespace Communicator {
namespace Seria... |
#include "YShirt.h"
YShirt::YShirt()
{
m_name = "Y-Shirt";
m_price = 30000;
}
const std::string YShirt::product()
{
return m_name;
}
const int YShirt::price()
{
return m_price;
}
|
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package
#ifndef JACTORIO_INCLUDE_GAME_WORLD_TILE_LAYER_H
#define JACTORIO_INCLUDE_GAME_WORLD_TILE_LAYER_H
#pragma once
namespace jactorio::game
{
enum class TileLayer
{
base = 0,
resource,
entit... |
#include <iostream>
const int Nscores = 10;
int fill(double *);
double get_avg(double *, int);
void output(double *, int);
int main(void)
{
using namespace std;
int n;
double scores[10] = {0.0};
// read in scores
n = fill(scores);
// get average
double avg;
avg = get_avg(scores, n)... |
/**
* 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
*
* ... |
#include "sprite.h"
namespace LM {
Sprite::Sprite(float x, float y, float width, float height, const glm::vec4 &color) :
Renderable2D(glm::vec3(x, y, 0), glm::vec2(width, height), color)
{
}
} |
#pragma once
#ifndef _BAKA_BODY_
#define _BAKA_BODY_
#include "Vector2D.hpp"
#include <cstdio>
#include <cstdlib>
#include <ctime>
class Body {
public:
// Линейные компоненты движения
// (положение)
// (position)
Vector2D p;
// Угловой компоненты движения
// (угол)
// (angle)
... |
#include "ChatWindow.hpp"
WINDOW* ChatWindow::_displayMessageWindow = nullptr;
WINDOW* ChatWindow::_enterMessageWindow = nullptr;
void ChatWindow::displayChatWindows()
{
clear();
int sizeX, sizeY;
getmaxyx(stdscr, sizeY, sizeX);
_displayMessageWindow = newwin(sizeY * 0.75, sizeX, 1, 1);
_enterMess... |
extern int test_sparql();
int main (int argc, char * const argv[]) {
// insert code here...
return test_sparql();
}
|
#include <bits/stdc++.h>
int SET = 670 , MAX_N = 1e5 + 10 , MAX_L = SET + 10 ;
int f[2][MAX_L] ;
int T , n , k , x[MAX_N] , y[MAX_N] ;
int main() {
scanf("%d" , &T) ;
for (; T-- ;) {
scanf("%d %d" , &n , &k) ;
for (int i = 1 ; i <= n ; ++i) {
int r ; scanf("%d" , &r) ;
scanf("%d %d" , &x[r] , &y[r])... |
#include <stdio.h>
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
using namespace std;
using namespace cv;
int main() {
int blurSize = 12;
Mat image = imread("..\\..\\..\\test_data\\brid... |
//
// Created by Peter Chen on 5/29/16.
//
#ifndef CUBEWORLD_SERIALIZATION_H
#define CUBEWORLD_SERIALIZATION_H
class Serialization {
};
#endif //CUBEWORLD_SERIALIZATION_H
|
class Solution {
public:
vector<int> getRow(int rowIndex) {
int i = 2;
vector<int> ret(rowIndex + 1, 1);
if(rowIndex > 1){
while(i <= rowIndex) {
int j = i - 1;
while(j > 0) {
ret[j] += ret[j - 1];
j--;
... |
// STRUTTURA DATI LINKED LIST INTERAMENTE SCRITTA DA LUIGI MARINO, UTILIZZABILE PER QUALSIASI TIPO DI DATO, CON L'UTILIZZO DEI TEMPLATE - MODIFICA EFFETTUATA SULLA STRUTTURA
// DOVUTA ALLA RISOLUZIONE DEL QUESITO 1 DELLA TRACCIA 2 DEI PROGETTI DELL'ESAME ALGORITMI E STRUTTURE DATI, NEL METODO GETTAIL/), VIENE FATTO UN ... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "./InteractionComponent.h"
UInteractionComponent::UInteractionComponent()
{
PrimaryComponentTick.bCanEverTick = false;
}
void UInteractionComponent::BeginPlay()
{
Super::BeginPlay();
}
bool UInteractionComponent::CanInteract(... |
// I first use a vector<vector<bool>> to state whether a point is visited, but time out.
// We do not need another bool vector, we can simply change the value of board[i][j]
// Pay attention that the backtracking method needs to restore the state of board[i][j] after we changed it!!!!! Used a lot of time here.
class So... |
//Problem Link: https://www.codechef.com/LTIME58A/problems/AFK/
#include<bits/stdc++.h>
using namespace std;
main()
{
int t;
cin>>t;
while(t--)
{
long long int a,b,c;
cin>>a>>b>>c;
long long int x = ceil(abs(2*b - a - c)*1.0/2);
cout<<x<<"\n";
}
}
|
/**
* Copyright (c) William Niemiec.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "../../../../include/wniemiec/io/cpp/LogLevel.hpp"
using namespace wniemiec::io::cpp;
//-------------------------------------------------... |
#pragma once
#include <DirectXMath.h>
#include "../GraphicsDLL/GraphicsHandler.h"
#include "../AIDLL/AIComponent.h"
#include "LevelHeaders.h"
#include "../SSPSolution/ComponentStructs.h"
enum ContainerType
{
MODEL = 0,
BUTTON,
LEVER,
WHEEL,
DOOR,
MAGNET,
PRESSUREPLATE,
NUM_PUZZLE_ELEMENTS,
LIGHT,
AIWAYPOINT,... |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int ara[100005],n,mx=0;
int sagar(int x)
{
int prev=0;
for(int i=0;i<n;i++)
{
int bad=ara[i]-prev;
if(bad>x)return false;
if(bad==x)x--;
if(x<0)return false;
prev=ara[i];
}
if(x>=0)return true;... |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
typedef tuple<ll, ll, ll> tp;
typedef pair<ll, ll> pr;
const ll MOD = 1000000007;
const ll INF = 1e18;
template <typename T> void print(const T &t) {
std::copy(t.cbegin(), t.cend(),
std::ostream_iterator<typename T::value_type>(std::co... |
#include<bits/stdc++.h>
using namespace std;
string s,t;
int dp[1010][1010][15];
int call(int i,int j,int sofar,int k)
{
if(dp[i][j][sofar]!=-1) return dp[i][j][sofar];
if(i>=s.length() || j>=t.length()) return 0;
if(sofar>=k) return 0;
if(s[i]==t[j]){
int len=0;
for(int x=i, y=j;x<s.len... |
/***************************************************************************
Copyright (c) 2020 Philip Fortier
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... |
#pragma once
#ifndef CLIENT_MAIN_H
#define CLIENT_MAIN_H
#include <WinSock2.h>
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <thread>
#include <chrono>
#include <string>
using std::string;
#include <stdexcept>
#define SERVER_PORT 11235 // 서버 포트
#define BUF_SIZE 4096 // 버퍼 사이즈
#def... |
#include <iostream>
#include <time.h>
#include "SaveLoadStream.h"
using namespace std;
int main()
{
srand((unsigned int)(time(NULL)));
while (1)
{
int oldInt;
bool oldBool;
long oldLong;
SaveLoadStream *save = new SaveLoadStream();
oldInt = rand();
oldBool... |
#include "capsule.h"
#ifndef DISABLE_RENDER
#include "renderer.h"
#endif
namespace physics
{
Capsule::Capsule(RigidBody *body)
: Primitive(PRIMITIVE_TYPE::PRIT_CAPSULE)
{
this->body = body;
}
Capsule::Capsule()
: Primitive(PRIMITIVE_TYPE::PRIT_CAPSULE)
{
body = new RigidBody(this);
}
... |
#include <CoreFoundation/CFBundle.h>
#include "Game.hpp"
int main(__unused int argc, __unused char *args[]) {
Game game = Game();
return game.run();
}
|
#ifndef __URTEXTURE_H__
#define __URTEXTURE_H__
#include "config.h"
#include "urImage.h"
#include "urFont.h"
#ifndef __APPLE_CC__
typedef enum {
kTexture2DPixelFormat_Automatic = 0,
kTexture2DPixelFormat_RGBA8888,
kTexture2DPixelFormat_RGB565,
kTexture2DPixelFormat_A8,
} Texture2DPixelFormat;
typedef enum {
... |
#include "intcomparator.h"
IntComparator::IntComparator()
{
}
bool IntComparator::compare(int number1, int number2)
{
return number1 < number2;
}
|
#ifndef TINYENGINE_LTE_GLOBALS_H_
#define TINYENGINE_LTE_GLOBALS_H_
#pragma once
#include <signal.h>
#include <vector>
#include <mutex>
#include <thread>
#include <algorithm>
#include "LTE_Types.h"
#ifndef HAVE_SIGACTION
#error sigaction is not supported
#endif
// sig_atomic_t is defined by C99
static volatile si... |
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
#define N 50
//#define Pon 0.8
//#define Poff 0.5
//#define Koff 0.5
//#define Kon 0.5
//#define f 2.0
//#define Ks 0.1
//#define Kc 100
#define l 1.5
#define Iter 10000.0
#define Dt 1.0
#define St 0.3
//#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.