text stringlengths 8 6.88M |
|---|
#include "VirtualWire.h"
// Definicja pinow
#define led_pin 11
#define transmit_pin 10
void setup()
{
// Przygotowanie danych potrzebnych dla biblioteki
vw_set_tx_pin(transmit_pin);// ustalenie pinu do ktorego podlaczone jest zlacze data
vw_setup(2000); // ustalenie predkosci
}
void loop()
{
String... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.System.UserProfile.1.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Foundation {
#ifndef WINRT_GENERIC_cdb5efb3_5788_509d_9be1_71ccb8a3362a
#define WINRT_GENERIC... |
#pragma once
#include "DataList.h"
class __declspec(dllexport) CDataListCtrl : public CListCtrl
{
public:
enum ColumnIndex
{
ColumnTime = 0,
ColumnEsmTheta,
ColumnInfraredTheta,
ColumnInfraredPhi,
ColumnRadarDistance,
ColumnRadarTheta,
ColumnRadarPhi,
... |
#include "veritas.hpp"
#include "SolverManager.hpp"
#include "Settings.hpp"
#include "EMSolver.hpp"
#include "Mesh.hpp"
#include "Level.hpp"
SolverManager::SolverManager(Settings &settings) : settings(settings) {
std::cout << std::setfill('-') << std::setw(3) << '-' << " Time (T) " << std::setw(4) << '-' << '|' <<... |
#pragma once
#include "_cvar.h"
#include <unordered_map>
struct EconomyItemCfg
{
int iItemDefinitionIndex = 0;
int nFallbackPaintKit = 0;
int iEntityQuality = 4;
float flFallbackWear = 0.1f;
};
extern std::unordered_map<int , EconomyItemCfg> g_SkinChangerCfg;
extern std::unordered_map<int , const char*> g_ViewM... |
#include <bits/stdc++.h>
using namespace std;
long long int s;
int rank1(int n,long long int p[],long long int p2[])
{
if (n=1)
{
return s;
}
long long int s=p[n-1];
swap(p[n-1], p[p2[n-1]]);
swap(p2[s], p2[n-1]);
return (s+n*rank1(n-1,p,p2));
}
int main ()
{
int n ;
cin >> n;
long... |
#pragma once
#pragma comment(lib, "lua51.lib")
namespace Singularity
{
namespace Scripting
{
class LuaBinder;
class LuaTask;
class LuaSubTask;
}
}
#include "scripting\Singularity.Scripting.Defines.h"
extern "C" {
#include "3rdparty\lua\lua.h"
#include "3rdparty\lua\lauxlib.h"
#include "3... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "TankAimingComponent.h"
#include "TankBarrel.h" //Include in cpp files, not h files!. Improves compilation time.
#include "TankTurret.h"
#include "Projectile.h"
#include "Runtime/Engine/Classes/Engine/World.h" //Intellisense GetWor... |
#include <Timer.hpp>
#include <SDL.h>
namespace engine
{
void Timer::start()
{
start_ticks = SDL_GetTicks();
}
float Timer::elapsed_seconds() const
{
return float(elapsed_milliseconds()) / 1000.f;
}
uint32_t Timer::elapsed_milliseconds() const
{
return SDL_GetT... |
class Solution {
public:
ListNode* middleNode(ListNode* head) {
ListNode* mid = head;
ListNode* cur = mid->next;
while (cur)
{
mid = mid->next;
cur = cur->next;
if (cur)
cur = cur->next;
}
return mid;
}
}; |
/*
* AreaLight.cpp
*
*
*/
#include "AreaLight.h"
namespace rt {} // namespace rt
|
#ifndef MCCHANNEL_H
#define MCCHANNEL_H
class MCChannel {
public:
int channelNo;
int plane;
int wire;
int hash;
MCChannel(int c=-1, int p=-1, int w=-1);
virtual ~MCChannel();
// methods
void SetChannel(int c, int p, int w);
static int Encode(int plane, int wire);
static void... |
#include "../include/mathGL_graphics.h"
#include <cmath>
#include <list>
#include <string>
/**********************************************************
* This code is an example of MathGl_Graphics module usage.
* Module is used to visualize dynamics of luminescence
* spectra. All the equations can be found at:
*
... |
// -*- 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... |
// Created by yuanzhongji on 2013/08
#ifndef _SHOW_DIY_DIALOG_H__
#define _SHOW_DIY_DIALOG_H__
#include "cocos2d.h"
#include "LBLibraryBase.h"
#include "LBModalDialogLayer.h"
#include "TipDialog.h"
#include "PConfig.h"
class ShowDiyDialog : public TipDialog
{
private:
CC_SYNTHESIZE(string, m_diySaveKey, DiySaveKey... |
#pragma once
#include<cv_bridge/cv_bridge.h>
#include<cstdlib>
#include<image_transport/image_transport.h>
#include<iostream>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc.hpp>
#include<opencv2/imgcodecs.hpp>
#include<ros/ros.h>
#include<sensor_msgs/Image.h>
#include<vector>
#include<string>
class Map... |
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include "accounts.h"
using namespace std;
Account::Account()
{
accounts_file = ACC_FILE;
ReadFile();
}
Account::Account(string s)
{
accounts_file = s;
ReadFile();
}
int Account::ReadFile()
{
ifstream ifs(accounts_file);
if (!i... |
#include "stdafx.h"
#include "Character.h"
Character::Character(int id)
{
init(id);
}
Character::~Character()
{
} |
//合并两递增序列
int merge(int a[],int b[],int c[],int n,int m)
{
//将a[n]与b[m]两个数组合并至c[]中
while(i<n&j<m)
{
//每次将最小的数合并至c中
if(a[i]<b[j])
c[index++]=a[i];
else
c[index++]=b[j];
}
//当其中一个数组中所有元素用完后,剩下的另一个数组直接合并
while(i<n)
c[index++]=a[i++];
while(j<n)
c[index++]=b[j++];
}
|
#ifndef SETTINGS_H
#define SETTINGS_H
#include <string>
#include <map>
#include <boost/property_tree/ptree.hpp>
enum ExtendedBoolean
{
EB_IGNORE,
EB_CONSISTENT,
EB_FALSE,
EB_TRUE,
};
enum IndentStyle
{
IS_IGNORE,
IS_CONSISTENT,
IS_TABS,
IS_SPACES,
};
enum IndentPolicy
{
IP_IGNORE... |
/* Copyright 2017 Istio 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 applicab... |
#pragma once
#include <vector>
#include <iostream>
#include "Cell.h"
#include "Board.h"
#include "Moore.h"
#include "CellsStateStatistic.h"
template<class S = Moore>
class GameOfLife {
public:
GameOfLife();
GameOfLife(S* siblings);
void start() const;
S* siblings;
// Since the pointer is mutab... |
#include "seal/seal.h"
#include "helper.hpp"
#include <iostream>
using namespace std;
using namespace seal;
void bfv_basics()
{
EncryptionParameters parms(scheme_type::bfv);
/*
Set polynomial modulus.
Recommended values are 1024, 2048, 4096, 8192, 16384, 32768, etc.
Any value smaller than 4096 wil... |
#include <iostream>
#include <unistd.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sys/types.h> // socket 及 宏定义头文件
#include <sys/socket.h>
#include <netinet/in.h> //sockaddr_in htonl等
#include <arpa/inet.h>
using namespace std;
constexpr int DOMAIN = AF_INET;
constexpr int BufferLen = 1024;... |
#include <stdio.h>
#include <stdint.h>
int main()
{
uint32_t i = 0;
for (i = 0; i < 100; i++) {
printf("i = %d \n", i);
}
return 0;
}
|
/**
* @brief Finds mass center, summarizes applied forces.
* @file PhysicsManager.h
* @author matthewpoletin
*/
#pragma once
namespace liman {
class PhysicsManager {
public:
PhysicsManager() = default;
virtual ~PhysicsManager() = default;
void UpdateMovables(int deltaTime);
private:
};
} |
#include<bits/stdc++.h>
using namespace std;
int getdigits(int n)
{
int count = 0;
while(n!=0)
{
count+=1;
n=n/10;
}
return count;
}
int power(int a,int b)
{
if(b==0)
{
return 1;
}
if(b==1)
{
return a;
}
int value = power(a,b/2);
if(b%2 == 0)
{
return value*value;
}
return value*value*a;
}
... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "base.h"
WINRT_WARNING_PUSH
#include "internal/Windows.Storage.3.h"
#include "internal/Windows.Foundation.3.h"
#include "internal/Windows.Foundation.Collections.3.h"
#include "interna... |
// CppCom.cpp : Implementation of DLL Exports.
#include "stdafx.h"
#include "resource.h"
#include "CppCom_i.h"
#include "ComInterface.h"
CComModule _AtlModule;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_ComInterface, CComInterface)
END_OBJECT_MAP()
class CCppComApp : public CWinApp
{
public:
// Overrides
v... |
// 1461. Check If a String Contains All Binary Codes of Size K
// Given a binary string s and an integer k.
// Return True if all binary codes of length k is a substring of s. Otherwise, return False.
// Example 1:
// Input: s = "00110110", k = 2
// Output: true
// Explanation: The binary codes of length 2 are "00", "... |
//二叉树结点的插入
//二叉树插入的位置就是数据域在二叉树中查找失败的位置
//insert函数将在二叉树中插入一个数据域为x的新结点
//注意根结点指针root要使用引用,否则插入不会成功
void insert(node* &root,int x){
if(root==NULL){ //空树,说明查找失败,也即插入位置(递归边界)
root=newNode(x); //创建新结点,插入
return ;
}
if(/*由二叉树的性质,x应该插在左子树*/){
insert(root->lchild,x); //往左子树搜索(递归式)
}else{
insert(root->rchild,x); /... |
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#include <cmath>
#include <iostream>
#include "table.h"
#include "tapis.h"
#include "tapis2.h"
#include "bois.h"
#include "metal.h"
#include "trous.h"
using namespace std;
Table::Table()
{
freinage=0.2;
}
void Table::setFreinage(float f)
{
freina... |
//#include <irtkImage.h>
//#include <irtkGaussianBlurring.h>
//#include <irtkBiasField.h>
//#include <irtkBiasCorrection2.h>
#include <irtkIntensityMatcher.h>
char *target_name = NULL;
char *source_name = NULL;
char *tissueMask_name = NULL;
char *tgtout_name = NULL;
char *srcout_name = NULL;
char *biasOutputT = NUL... |
#ifndef BST_H
#define BST_H
#include "..\Binary Tree\BinaryTree.h"
#include "..\Binary Tree\BinaryTree.cpp"
#include "..\Item\TreeItem.h"
template <typename T>
class BST : public BinaryTree<T>
{
protected:
//Helper function
static void insert(Node<T> *&, const T &);
static void removeRightmostNode(Node<T> *&, Nod... |
#include "graphics\Singularity.Graphics.h"
namespace Singularity
{
namespace Graphics
{
class Material
{
private:
#pragma region Nested Classes
struct MATERIAL_DESC
{
Color Color;
float Ambient;
float Diffuse;
float Specular;
float Shininess;
int... |
//-----------------------------------------------
//
// This file is part of the Siv3D Engine.
//
// Copyright (c) 2008-2018 Ryo Suzuki
// Copyright (c) 2016-2018 OpenSiv3D Project
//
// Licensed under the MIT License.
//
//-----------------------------------------------
# include <Siv3D/DirectoryWatcher.hpp>
# if d... |
/*
Copyright (C) 2011 by Ladislav Hrabcak
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, merge, publish, distrib... |
#ifndef __CONTROLMETHOD
#define __CONTROLMETHOD
class ControlMethod {
public:
ControlMethod();
virtual int calculateControlLevel(int targetValue, int currentValue) = 0;
virtual ~ControlMethod() {};
};
#endif // __CONTROLMETHOD |
/*
* SPDX-FileCopyrightText: (C) 2014-2022 Daniel Nicoletti <dantti12@gmail.com>
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "common.h"
#include "upload_p.h"
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QTemporaryFile>
using namespace Cutelyst;
QString Upload::filename() const
{
Q_D... |
#ifndef CO_TASK_H
#define CO_TASK_H
#include "namespdef.h"
NAMESP_BEGIN
namespace net
{
struct CoTask{
struct promise_type {
CoTask get_return_object() { return {}; }
std::suspend_never initial_suspend() { return {}; }
std::suspend_never final_suspend() noexcept { return {}; }
void return_void() {}... |
class Solution {
public:
int maxProfit(vector<int>& prices) {
if(prices.size()<=1)return 0;
int minprice = prices[0];
int maxprofit = 0;
for (int i = 1; i<prices.size(); i++) {
if ((prices[i]-minprice)>maxprofit) {
maxprofit = prices[i]-minprice;
}
else if(min... |
#ifndef _TRANSFORM_COMPONENT_H_
#define _TRANSFORM_COMPONENT_H_
#include "Actors\ActorComponent.h"
class TransformComponent : public ActorComponent
{
glx::mat4<float> m_transform;
public:
static const char* g_Name;
virtual const char* VGetName() const { return g_Name; }
TransformComponent(void) : m_transform() ... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... |
#include <iostream>
#include <DGtal/helpers/Shortcuts.h>
#include <DGtal/helpers/ShortcutsGeometry.h>
using namespace DGtal;
using SH3 = Shortcuts<Z3i::KSpace>;
using SHG3 = ShortcutsGeometry<Z3i::KSpace>;
int main() {
auto params = SH3::defaultParameters();
params("polynomial", "goursat" )( "gridstep", 0.5 ... |
#include "stdafx.h"
#include "FeatureSet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
///////////////////////////////////////////////////////////////////////////////
CPointFeatureSet& CFeatureSet::GetPointFeatureSet()
{
CPointFeatureSet* p = dynamic_cast<CFeatur... |
#include <iostream>
#include <cstring>
using namespace std;
class Nota
{
protected:
int *note;
int nr_note;
public:
Nota();
Nota(int*,int);
~Nota();
Nota(const Nota&);
Nota& operator=(const Nota&);
friend ostream& operator<<(ostream&, const Nota&);
friend istream& ... |
#include "Stdafx.h"
#include "TVFrame.h"
#include "TVCreator.h"
#include "utilites/foreach.hpp"
#include "utilites/serl/Archive.h"
#include "utilites/serl/serl_registry.h"
#include "utilites/Localizator.h"
#include "arrangeWnd.h"
#include "utilites/document.h"
#include "others/cximage/ximage.h"
enum { m=point::... |
#ifndef HELLOWORLD_H_
#define HELLOWORLD_H_
#include <iostream>
class HelloWorld
{
public:
HelloWorld();
~HelloWorld();
void set(double r1, double r2);
inline double get() const { return s; }
void message(std::ostream& out) const;
protected:
double r1, r2, s;
void compute(); // compu... |
/* control_analysis/arduino-code/src/main.ino - Jacob Killelea
* Control Loop code to regulate heaters using an arduino
*
*/
#include "pidcontroller.h"
// Heater physical properties
const float m = 0.013; // Kg
const float R = 10; // Ohm
const float cp = 920.0; // J/(Kg K)
const float Kc = 0.01; // Conduction
c... |
#include "hstack.h"
#include "base/std_ext/string.h"
#include "base/std_ext/math.h"
#include "base/std_ext/memory.h"
#include "base/Logger.h"
#include "tree/stream_TBuffer.h"
#include "TBrowser.h"
#include "TPad.h"
#include "TLegend.h"
#include "TLegendEntry.h"
#include "TH1.h"
#include "TDirectory.h"
#include "TPav... |
#include "Image2D.h"
namespace revel
{
namespace pixel
{
RGB_u8::RGB_u8() : r(0), g(0), b(0) {}
RGB_u8::RGB_u8(u8 r, u8 g, u8 b) : r(r), g(g), b(b) {}
RGB_u8::RGB_u8(const RGB_u8& c) : r(c.r), g(c.g), b(c.b) {}
RGB_u8::RGB_u8(const RGBA_u8& c) : r(c.r), g(c.g), b(c.b) {}
RGB_u8::RGB_u8(const Gray_u8& c) : r(c.val), ... |
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#define pirPin1 15//For first pir pin weak one to be placed at front when facing out of class and connected to d8 pin of nodemcu
#define pirPin2 5//For second pir pin more sensitive one to be placed at front when facing into the class and connecte... |
/**
BSD 2-Clause License
Copyright (c) 2017, DaiMysha
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 conditions... |
/*
* Copyright (c) 1995 Danny Gasparovski.
*
* Please read the file COPYRIGHT for the
* terms and conditions of the copyright.
*/
#define WANT_SYS_IOCTL_H
#include <stdlib.h>
#include "slirp.h"
#include "ip_icmp.h"
#include "main.h"
#ifdef __sun__
#include <sys/filio.h>
#endif
#ifdef _WIN32
#define IS_EAGAIN(e... |
/*********************************************************************/
/** strutils.cpp by Alex Koukoulas (C) 2017 All Rights Reserved **/
/** File Description: Implementation of string helper functions **/
/*********************************************************************/
// Local Headers
#include "stru... |
#pragma once
#include "lab/dialogs/lab_dialog.h"
class DestroySubsystems : public LabDialog {
public:
~DestroySubsystems() override = default;
private:
// Called when this dialog is opened via the top toolbar
void open(Button* /*caller*/) override;
// Called when the dialog is closed
void close() override {
... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... |
/*
* 纯虚析构函数
* 纯虚析构函数在c++中是合法的,但是在使用的时候有一个额外的限制:必须为纯虚析构函数提供一个函数体。
*/
#include <iostream>
using namespace std;
//非纯虚析构函数
class A
{
public:
virtual ~A();
};
// 纯虚析构函数在c++中是合法的,但是在使用的时候有一个额外的限制:必须为纯虚析构函数提供一个函数体。
A::~A(){}
//纯析构函数
class BClass
{
public:
virtual ~BClass();
};
BClass::~BClass(){}
void te... |
#include <cmath>
#include <iostream>
#include <fstream>
#include <boost/math/distributions/chi_squared.hpp>
#include "kmers_QQ_plot_statistics.h"
using namespace std;
using boost::math::chi_squared;
using boost::math::cdf;
KmersQQPlotStatistics::KmersQQPlotStatistics():
m_scores(0) // accumelating information (migh... |
/*
* Copyright (C) 2007-2015 Frank Mertens.
*
* Use of this source is governed by a BSD-style license that can be
* found in the LICENSE file.
*
*/
#ifndef FLUXSYNTAX_SYNTAXDEBUGGER_H
#define FLUXSYNTAX_SYNTAXDEBUGGER_H
#include <flux/String>
#include <flux/Map>
#include <flux/syntax/syntax>
namespace flux {
n... |
#include "movegen.h"
#include "attacks.h"
#include "util.h"
namespace apollo {
namespace {
void GeneratePawnMoves(const Position& pos, std::vector<Move>& moves) {
Color color = pos.SideToMove();
Bitboard enemy_pieces = pos.Pieces(!color);
Bitboard allied_pieces = pos.Pieces(color);
Bitboard pieces = enemy_pi... |
//~ author : Sumit Prajapati
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
#define int long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb pus... |
#ifndef as5048_h
#define as5048_h
#include <SPI.h>
class AS5048A
{
private:
uint8_t _VSPI_SS;
uint8_t _VSPI_MISO;
uint8_t _VSPI_MOSI;
uint8_t _VSPI_SCLK;
bool errorFlag;
bool ocfFlag; // Avoid printing OCF flag everytime
uint16_t position;
uint8_t esp32_delay;
SPISettings settings;
uint8_t spiCalcEvenPar... |
#pragma once
#include <string>
using namespace std;
#define BY_SURNAME 0
#define BY_PHONENUM 1
#define BY_STREET 2
//Телефон, Фамилия, Имя, Отчество, Улица, Дом, Корпус, Квартира
class PhoneBookRecord {
public:
string phoneNum;
string name;
string surname;
string patronymic; //отчетсво
string street;
int house... |
// -*- C++ -*-
//
// Package: bbtoDijet/bbtoDijetAnalyzer
// Class: bbtoDijetAnalyzer
//
/**\class bbtoDijetAnalyzer bbtoDijetAnalyzer.cc bbtoDijet/bbtoDijetAnalyzer/plugins/bbtoDijetAnalyzer.cc
Description: collect b-tagging data (online and offline), calo and pf jet kinematics, and trigger results
Imple... |
//
// OperateLayer.cpp
// CatchGirl
//
// Created by xin on 16/4/6.
//
//
#include "OperateLayer.hpp"
bool OperateLayer::init(){
Button * bt = Button::create();
bt->loadTextures( "Default/Button_Press.png","");
bt->setPosition(Vec2(800, 200));
bt->addTouchEventListener(CC_CALLBACK_2(OperateLayer::to... |
/**
* @brief An example of using a packed memory graph to solve a problem.
* Usage: ./a.out [path to folder containing DIMACS10 maps] [map name]
*
* @author Panos Michail
*
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <stdlib.h>
#include <Structs/Graphs/dynamicGraph.h>
#include <Structs... |
#include <gflags/gflags.h>
#include <sstream>
#include <map>
#include <math.h>
#include <iostream>
#include "scal.h"
#include "datastructures/balancer_partrr.h"
#include "datastructures/boundedsize_kfifo.h"
#include "datastructures/distributed_queue.h"
#include "datastructures/dts_queue.h"
#include "datastructures/fl... |
#ifndef __HELLO_H__
#define __HELLO_H__
#include "Prototype.h"
class Hello : public Prototype
{
public:
Hello(const std::string &message);
virtual std::shared_ptr<Prototype> clone() const;
virtual void setMessage(const std::string &message);
virtual std::string getMessage() const;
private:
std... |
#include "TextureUnit.h"
namespace revel
{
namespace renderer
{
//Intentionally left blank
}
}
|
//CS 246 A6 - hx3zhang/z289wang
//Implemented in RandomPlayer.cc
#ifndef RANDOMPLAYER_H_
#define RANDOMPLAYER_H_
#include <string>
#include "Player.h"
using namespace std;
class RandomPlayer : public Player {
public:
//constructor
RandomPlayer(string name);
RandomPlayer(string name,int seed); //Randomplayers re... |
/*
* Written by: David Trask
* Created on: 2017-01-17
* Last Updated: 2017-01-17
* Version: 0.00.01
* Last Update Notes:
* - Created initial file
* - Added base libraries
* - Created Main and Setup functions
*/
//The various needed libraries.
#include <SPI.h> // SPI?
#include <Ethernet.h> //Ethernet Protocols Li... |
#include<bits/stdc++.h>
using namespace std;
struct node
{
int data;
node* next;
};
node *head;
void printList()
{
node* temp = head;
while(temp != NULL)
{
cout<<temp->data<<"->";
temp = temp->next;
}
cout<<endl;
}
void insertToList(int x)
{
node* temp = head;
if(head == NULL)
{
temp = new node();... |
//414 - Machined Surfaces
//Dept. ICE, NSTU-11 Batch
#include<bits/stdc++.h>
using namespace std;
//#define INF 99999999
#define INF 1<<28
#define ll long long
#define SZ 100009
#define MX 100000000
#define sfint(a) scanf("%d",&a)
#define sfllint(a) scanf("%lld",&a)
#define sfch(a) scanf("%c",&a)
#define sfchsq(a) scan... |
#include "Gunner.h"
#include "../../../GameDefines/GameDefine.h"
#include "GunnerState/GunnerFall/GunnerFall.h"
#include "../../Player/GamePlayer.h"
#include "GunnerState/GunnerDie/GunnerDie.h"
#include "../../../GameComponents/GameCollision.h"
Gunner::Gunner()
{
tag = Tag::Enemy;
anim = new Animation(Define::HEAD_G... |
#include <stdlib.h>
#include <iostream>
#include <vector>
using namespace std;
class ThreeSumClosest
{
public:
int threeSumClosest(vector<int>& nums, int target);
void Test();
}; |
#include <bits/stdc++.h>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int t,n,k,posi1,posi2;
cin >> t;
while(t-->0){
cin >> n >> k;
vector<bool> taken(n+1,false);
vector<int> ans;
bool canMake = true;
... |
#include "ReplayControls.h"
#include <fstream>
#include <algorithm>
#include "Source/Units/SystemUnit.h"
#include "Source/Common/Exception.h"
#include <imgui/imgui.h>
#include "Source/Viewers/IMGuiViewer/Drawers/Scene/LineTrailsDrawer.h"
namespace solar
{
namespace gui
{
ReplayControls::ReplayControls(const std:... |
/*
Author: Nayeemul Islam Swad
Idea:
- Suppose, we are at the peg with id `at` and length of remaining rope is
`len`. We'll roll the rope 360 degrees anti-clockwise, switching pegs in-
between if needed. Now, after the complete roll, suppose the new position
of the rope is at peg `at2` and remaining length... |
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package
#ifndef JACTORIO_INCLUDE_RENDER_IRENDER_BUFFER_H
#define JACTORIO_INCLUDE_RENDER_IRENDER_BUFFER_H
#pragma once
#include <imgui.h>
#include "jactorio.h"
#include "core/convert.h"
#include "render/opengl/index_buffer.h... |
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int sumNumbers(TreeNode* root) {
int total = 0;
helper(root, 0, total);
... |
/*
* utils.h
*
* Created on: Feb 16, 2021
* Author: Madison Callan
*/
#ifndef INCLUDES_UTILS_H_
#define INCLUDES_UTILS_H_
#include <vector>
#include "constants.h"
void sortData(const SORT_ORDER &mySortOrder,std::vector<process> &myProcesses);
process getNext(std::vector<process> &myProcesses);
int getSize... |
#include <irtkImage.h>
char *input_name = NULL, *output_name = NULL;
void usage()
{
cerr << " Usage: addslices [in] [out] <-x xslices> <-y yslices> <-z zslices>" << endl;
cerr << " Add slices symmetrically on either side of an image. E.g.:" << endl;
cerr << " " << endl;
cerr << " addslices in.nii.gz out.... |
// This file has been generated by Py++.
#ifndef TextureTarget_hpp__pyplusplus_wrapper
#define TextureTarget_hpp__pyplusplus_wrapper
void register_TextureTarget_class();
#endif//TextureTarget_hpp__pyplusplus_wrapper
|
#ifndef CLIPBOARD_HPP_
#define CLIPBOARD_HPP_
#include <bb/system/Clipboard>
#include <QtCore>
/*!
* @class Clipboard
* @brief Clipboard class
* @details Copies input QByteArray to system clipboard
* @author Thurask
* @date 2014-2015
*/
class Clipboard: public QObject
{
Q_OBJECT
publ... |
#include <iostream>
#include "include/MainGame.h"
int main(int argc, char** argv)
{
MainGame main_game;
main_game.run();
//std::cout << "Enter any key to exit...";
//int a;
//std::cin >> a;
return 0;
} |
/*
*
*/
#include "player.h"
#include "rocket.h"
Player::Player(Terrain * terrain)
: Object(terrain)
{
object_type_ = PLAYER;
// geometric_center() = Vector(0, 0, 0);
speed() = 2;
horizontal_speed() = 2;
collision_radius() = 0.9; // person height is 1.8m
rocket_to_emit_ = 0;
emited... |
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/types.h>
#include <unistd.h>
#include <math.h>
#include <pthread.h>
#include "Xsocket.h"
#include "xhcp.hh"
#include "../common/XIARouter.hh"
#include "dagaddr.hpp"
#define DEFAULT_HOSTNAME "www_h.hostxxx.com.xia" // used if not provided by user... |
/*************************************************************************
> File Name : CmeAddCertificate.cpp
> Author : YangShuai
> Created Time: 2016年08月15日 星期一 15时59分59秒
> Description :
************************************************************************/
#include"Primitive.h"
#include"Primi... |
#include "canopen_sdo_sender.h"
#include "system_config.h"
#include "macros.h"
#include "base_proto_def.h"
#include "canopenport.h"
#include "debug_print_interface.h"
void SDOQueueSender::Init(CO_Data* d, node_id_t receiver, sdo_transfer_callback_t sdo_callback, overflow_callback_t overflow_callback)
{
_dict... |
/***************************************************************************
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... |
#include <cstdio>
#include <climits>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
using namespace std;
const int MAX_N = 100000;
const int MAX_M = 5000;
const int INF = std::numeric_limits<int>::max(); //2,147,483,647 == 2^31 -1
const int B=1000; //bucket ... |
/*
Akhmal Dimas Pratama
123200047 /Class H
*/
#include <iostream>
#include <cstdlib>
#include <iomanip>
using namespace std;
string name[15],nim[15];
int check[15], a, x, k, choice, out_group, out_student;
char loop='n', input_group;
struct project{
string name_project;
};
struct student{
st... |
#include <fstream>
#include <iostream>
#include <string>
#include <regex>
#include<stdio.h>
int main()
{
std::regex url("/.*(href=')(.*)(>)/");
std::string url_test = "11_custom_io.ppt";
std::ifstream file("in.txt");
if (!file.is_open())
{
std::cerr << "Failed to open file!\n";
return... |
#include <iostream>
#include <string>
using namespace std;
#include "solution2.h"
int main() {
string str1("UD");
string str2("LL");
Solution sol;
cout << sol.judgeCircle(str1) << endl;
cout << sol.judgeCircle(str2) << endl;
return 0;
} |
///////////////////////////////////////////////////////////////////////////////
/// \file
/// \brief Contains pseudo-implementation part of bidirectional list structure
/// template declared in the file's h-counterpart
///
/// © Sergey Shershakov 2015–2017.
///
/// This code is for educational purposes of the course ... |
#include<iostream>
#include<cmath>//biblioteca para poder utilizar la funcion pow()
using namespace std;
/*para encontrar una raiz de la ecuación f(x)=0 analiticamente, proporcionar la funcion
F(X)
DATOS:
-->a Y b que forman un intervalo, en donde se halla una raiz
-->TOL criterio de convergencia//la tolerancia
-->EX... |
#include "Ship.hpp"
#include "App.hpp"
//#include "Physics.hpp"
#include "Vector2.hpp"
#include <gl\GL.h>
//STL
#include <iostream>
#include <cmath>
#include "GameObject.hpp"
#include "Bullet.hpp"
#include "Physics.hpp"
namespace Engine
{
Ship::Ship(App *parent)
: GameObject(1.0f, RADIUS, 0.0f, 250.0f), m_parent... |
#pragma once
#include "ActorBuffer.hpp"
#include "DataFormat.hpp"
#include "Command.hpp"
void RPCStartServer(unsigned short port, int commandTimeout = 500);
void RPCStopServer();
ActorBuffer<FrameState>* RPCGetFrameBuffer();
ActorBuffer<Command>* RPCGetCommandBuffer();
int SendCommand(Command cmd);
|
#include<bits/stdc++.h>
using namespace std;
#define debug(x) cerr << #x << ": " << x << endl;
#define iosbase ios_base::sync_with_stdio(false)
#define tie cin.tie();cout.tie();
#define endl '\n'
typedef pair<int, int> ii;
typedef long long ll;
int vet[101000];
int faltas[101000];
int n, m;
int main(){
iosbase;... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.