text stringlengths 8 6.88M |
|---|
#include "sorting.h"
#include <QTextStream>
#define SKYBLUE QColor(135,235,231)
#define GREY QColor(220,220,220)
#define BLACK QColor(0,0,0)
#define RED QColor(255,0,0)
#define GREEN QColor(0,255,0)
#define BLUE QColor(0,0,255)
Sorting::Sorting()
{
}
void Sorting::initialize(double height,double width,QGraphicsScen... |
/// === sol.cpp ===
#ifndef NULL
#define NULL 0
struct Member {
int id, frequency;
};
#endif
/*
* Member 사용
* set과 sum을 관리하는 group 생성
*/
#include<set>
using namespace std;
struct Compare {
bool operator()(const Member& a, const Member& b) const {
return a.frequency != b.frequency ? a.frequency < b.fr... |
#include "Debug.hpp"
#include "Element.hpp"
#include "Encode.hpp"
#include <cctype>
namespace rpg2kLib
{
// xor shift random number generator
uint random()
{
static uint x=123456789, y=362436069, z=521288629, w=88675123;
uint t = ( x^(x << 11) );
x=y; y=z; z=w;
return ( w = ( w^(w >> 19) ) ^ ( t^(t >> 8)... |
/* ============================================================================
* Copyright (c) 2009-2016 BlueQuartz Software, LLC
*
* 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... |
/*
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... |
/*
* LowpassFilter.h
*
* Created on: Mar 16, 2016
* Author: christopher
*/
#ifndef Included_LowpassFilter_H
#define Included_LowpassFilter_H
#include<Arduino.h>
class LowpassFilter {
private:
double tau;
double sampleTime;
double maxIncrement;
double xPrevious = 0;
double yPrevi... |
#pragma once
#include "Command.h"
#include <vector>
#include <map>
#include "RandomInt.h"
class CompasCommand :
public Command
{
private:
vector<Room*> settledRooms;
vector<Room*> unsettledRooms;
map<Room*, Room*> predecessors;
map<Room*, int> distance;
RandomInt rnd;
public:
CompasCommand();
~CompasCommand();... |
#include "GLstate.h"
const char *vertexshader = "#version 150\n"
"in vec2 position;\n"
"in vec2 texcoord;\n"
"out vec2 Texcoord;\n"
"void main(){Texcoord = texcoord; gl_Position = "
"v... |
/* Remove Duplicates from the Sorted Array*/
//C++ program to remove duplicates in-place
#include <iostream>
#include <iomanip>
using namespace std;
//function prototypes
int rmDuplicates(int arr[], int n);
int main()
{
int arr[] = {1,1,1,2,2,2,5,5};
int n = sizeof(arr) / sizeof(arr[0]);
//rmDuplicates( ) retur... |
// $Id: ExpressionType.h,v 1.7 2013/02/11 20:56:50 david Exp $ -*- c++ -*-
#ifndef __CDK8_SEMANTICS_EXPRESSIONTYPE_H__
#define __CDK8_SEMANTICS_EXPRESSIONTYPE_H__
#include <cstdlib>
/**
* This is a quick and very dirty approach to type information.
* It is defined this way (even though it's not extensible at all)
... |
#include "maths.h"
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include "stdio.h"
#include "Possibilite.h"
#include "math.h"
maths::maths()
{
}
maths::~maths()
{
}
// https://www.geeksforgeeks.org/program-calculate-value-ncr/
int maths::fact(int n)
{
if(n > 1)
return n ... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
// your code goes here
int tc;cin>>tc;
while(tc--)
{
string s;
vector<int > vec;
for(int i=0;i<s.length();i++)
{
vec.push_back(s[i]-'a');
}
vector<int> tempvec1;tempvec1=vec;
vector<int> t... |
/***********************************************************************
created: Thu Jan 8 2009
authors: Paul D Turner <paul@cegui.org.uk>
Lukas E Meindl
*************************************************************************/
/***********************************************************... |
#pragma once
#include <unordered_map>
#include <memory>
#include <d3d9.h>
typedef IDirect3DTexture9 Texture;
class TextureManager
{
public:
TextureManager();
~TextureManager();
Texture* get(const std::string& path);
private:
std::unordered_map<std::string, Texture* > m_textures;
};
|
#include "UI.h"
UI::UI()
{
this->setObjectName("UI");
Load_Accueil();
//Background
QPixmap bk("BG.png");
bk = bk.scaled(qApp->primaryScreen()->size(), Qt::IgnoreAspectRatio);
QPalette pa;
pa.setBrush(QPalette::Window, bk);
this->setPalette(pa);
}
UI::~UI()
{
}
#pragma region Accuei... |
#include "uiprovider.h"
UiProvider::UiProvider(QObject *parent) : QObject(parent)
{
}
void UiProvider::setBackgroundColor(const QColor&)
{
}
|
#ifndef __ISAOCHECK_H__
#define __ISAOCHECK_H__
#ifndef USE_PROSTONTALE //=========== 프리스턴소스인경우
#include "..\\clanmenu\\cE_CViewClanInfo.h"
#endif
#define SAVE_DIR "savedata\\clanDATA"
#define SAVE_EXE "cl"
// 이것은 ISAO의 에러 코드이므로
// 변경하고 네 비방하고.
enum{
ISAO_REJECT_OK = 0, // 에러없음.성공.
ISAO_REJECT_BADPASS = 1, // 패... |
//
// Created by dominik on 6/14/19.
//
#include "GraphGenerator.h"
#include <random>
adjancy_matrix GraphGenerator::generate_complete_graph_with_random_weights(int n){
adjancy_matrix graph(boost::extents[n][n]);
std::default_random_engine generator;
std::uniform_int_distribution<int8_t> distribution(1,10... |
/***************************************************************************
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 "animations\Singularity.Animations.h"
namespace Singularity
{
namespace Animations
{
class AnimationClip
{
private:
#pragma region Variables
float m_fDuration;
DynamicList<Frame> m_pFrames;
String m_sName;
#pragma endregion
public:
#pragma regio... |
//---------------------------------------------------------------------------
#ifndef usefullProcH
#define usefullProcH
//---------------------------------------------------------------------------
#include <vector>
using namespace std;
struct stResCount
{
double _res;
int _cn;
};
typedef unsigned char BYTE;
... |
#include "Queue.hpp"
template <class T>
Queue<T>::Queue()
{
m_score = 0;
m_numberCorrect = 0;
m_teamNumber = 0;
}
template<class T>
void Queue<T>::set_time(int time)
{
Problem.time = time;
}
template<class T>
void Queue<T>::set_problemLetter(char problem)
{
Problem.problemLetter = problem;
}
template<class T>... |
#include <iostream>
using namespace std;
int s[100000];
int e[100000];
int main() {
int TC = 0;
cin >> TC;
for (int t = 1; t <= TC; t++)
{
int L = 0;
int N = 0;
cin >> L;
cin >> N;
for (int i = 0; i < N; i++)
{
cin >> s[i] >> e[i];
}
int endTime = 0;
int overLapTime = 0;
int overLapTim... |
//
// Created by ben on 11/19/20.
//
#include <iostream>
#include <utility>
#include <vector>
#include <bitset>
#include <map>
#include <fstream>
#include <sstream>
#include "compute.hpp"
using namespace std;
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <pybind11/complex.h>
#include <pybind11/fun... |
#ifndef TRAJECTORY_H_
#define TRAJECTORY_H_
#include<vector>
#include<map>
#include<opencv2/highgui.hpp>
#include"../Tools/Tools.h"
#include"../dataType.h"
#define PI 3.1415926
#define TRAJECTORYSIZE 64
struct Trajectory
{
std::vector<float> currentAngle;
std::vector<cv::Point2f> updatePoints;
};
class DrivingPat... |
/*
* Parking.cpp
*
* Created on: 30 Eyl 2019
* Author: keske
*/
#include "Parking.h"
#include "Vehicle_Types.h"
std::vector<Space> Parking::car_park(Parking::PARKING_SIZE, Space());
/**
* @param plate The plate of the vehicle to find its index.
* @return The index of the specified vehicle.
... |
/*-----------------------------------------------------------------------
Matt Marchant 2015 - 2016
http://trederia.blogspot.com
Robomower - Zlib license.
This software is provided 'as-is', without any express or
implied warranty.In no event will the authors be held
liable for any damages arising from the use of thi... |
#include<bits/stdc++.h>
using namespace std;
#define NMAX 5100
#define LOG 20
int n, h[NMAX], p[NMAX][LOG];
vector<int> adj[NMAX];
void dfs(int u, int pai){
h[u] = h[pai]+1;
p[u][0] = pai;
for(int k = 1; k < LOG; k++){
p[u][k] = p[p[u][k-1]][k-1];
}
for(int v: adj[u]){
if(v == pai) continue;
... |
#ifndef __TRAJEKTORIE__
#define __TRAJEKTORIE__
#include COMMON(vec2.h)
#include COMMON(structs.h)
using namespace Common;
//usage:
//
// setstart, setgoal, settimes -> calctraj -> eval
//
class Trajektorie {
public:
virtual void setstart(vec2 const &r, vec2 const &dr) = 0;
virtual void setgoal(vec2 const ... |
//
// SMCocosAppDelegate.c
// MyGame
//
// Created by KimSteve on 2017. 6. 8..
// Copyright © 2017년 KimSteve. All rights reserved.
//
#include "SMCocosAppDelegate.h"
#include "../SMFrameWork/Base/ShaderNode.h"
#include "MainScene.h"
#include <cocos2d.h>
#include "ImageEditor/SMImageEditorScene.h"
#define FOR_TES... |
// Niamh Andrews Text Based Missile Game.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
int main()
{
//Declairing variables
std::string launchCode = "3668"; //"D O N T" on a phone/numerical and text keypad
std::string menuSelection1 = "";
std::string ... |
#pragma once
#include "../MetaMorpheusTask.h"
#include "MassDiffAcceptorType.h"
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <limits>
#include <stdexcept>
#include <any>
#include <mutex>
#include "stringhelper.h"
#include "stringbuilder.h"
#include "tangible_filesyste... |
#include <stdexcept>
#include <vector>
#include <tudocomp/def.hpp>
namespace tdc {
/// \brief A ring buffer.
///
/// A ring buffer provides a fixed-size buffer of elements that are aligned
/// in a logical ring. When a new item is added when the buffer is full,
/// the first item will be "rolled o... |
#ifndef _BaseMagic_H_
#define _BaseMagic_H_
#include <iostream>
#include "DatLib.h"
#include "ResBase.h"
#include "ResSrs.h"
class FightingCharacter;
class BaseMagic: public ResBase
{
public:
BaseMagic();
virtual ~BaseMagic();
virtual void setData(char *buf, int offset);
/**
* 获取魔法的持续回合
*... |
#include <iostream>
#include "data.h"
void betaStralning();
int main() {
betaStralning();
return 0;
}
void betaStralning() {
char stralningPolaritet;
std::cout << "Är det en neutron eller proton som sönderfaller?(n/p) ";
std::cin >> stralningPolaritet;
if (stralningPolaritet == 'n') {
float viktDefekt =... |
// Copyright (c) 2012 Ivo Wetzel.
//
// 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, ... |
//
// Created by User on 02/08/2021.
//
#ifndef ASS1_KNNCLASSIFIER_H
#define ASS1_KNNCLASSIFIER_H
#include "Classifier.h"
#include <vector>
#include <algorithm>
#include <map>
#include <iostream>
/**
* knn classifier.
*
* @tparam T is a classifiable - it has the following methods:
* 1. double getDistance(T o... |
// CurrencyExchange.cpp : Defines the exported functions for the DLL application.
#include "stdafx.h"
#include "Logging.h"
#include <iostream>
#include <string>
#include "CurrencyExchange.h"
using namespace std;
#pragma warning(disable:4996)
CURRENCYEXCHANGE_API void currencyExchange_printVersion()
{
printf(curren... |
/*
#Chase Cabrera masc1074
#Michael Potts masc1071
#June 20th, 2015
#Professor Leonard
#CS570 Summer 2015
#Assignment 3
#README 570
*/
#include "a3.h"
using namespace std;
int pipefds[2];
char buffer[1];
pid_t firstp,secondp,thirdp;
//Display the local time
clock_t a3::clock ... |
/* NO WARRANTY
*
* BECAUSE THE PROGRAM IS IN THE PUBLIC DOMAIN, THERE IS NO
* WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
* LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE AUTHORS
* AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
* WARRANTY OF ANY KIND, EITHER E... |
#include "mini_modbus.h"
#include "UART_driver.h"
#include "packet_handler.h"
#include "CRC.h"
extern C_RS485 rs485;
extern U16 Crc16(const U8 *pcBlock, UI len);
UI conn_last_mes_inc_counter = MAX_TIME_BETWEEN_MES;
UI modbus_update_flag = 1;
UI modbus_copy_to_ROM_request = 0;
namespace
{
void mini_modbus_read_from_f... |
#ifndef COMPLETELINEEDIT_H
#define COMPLETELINEEDIT_H
#include <QtGui/QLineEdit>
#include <QStringList>
#include <QHash>
#include <QStandardItem>
#include <QStandardItemModel>
class QListView;
class QStringListModel;
class QModelIndex;
class CompleteLineEdit : public QLineEdit
{
Q_OBJECT
public:
CompleteLineEd... |
#include <iostream>
//#include <cstdio>
//#include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
#define Inf 0x3f3f3f3f
#define NeInf 0xc0c0c0c0
using namespace std;
int n;
string names[125];
map<string, int> m;
bool adj[125][125];
vector<string> ans[125];
... |
#include <algorithm>
#include <random>
#include <cassert>
#include <cmath>
#include <fstream>
#include <string>
#include <sstream>
#include <ctime>
#include "AutocallOption.h"
#include "EuropeanOption.h"
#include "j_fd.h"
#include "k_miscellaneous.hpp"
using namespace std;
AutocallOption::AutocallOption(double refpr... |
#include<bits/stdc++.h>
using namespace std;
void heapify(int* arr,int n,int i)
{
int largest = i;
int l = 2*i + 1;
int r = 2*i + 2;
if(l<n && arr[l] > arr[largest])
{
largest = l;
}
if(r<n && arr[r] > arr[largest])
{
largest = r;
}
if(largest!=i)
{
int temp = arr[largest];
arr[largest]=arr[i];
... |
#pragma once
#include "SFML\Window.hpp"
#include "SFML\Graphics.hpp"
#include "PlayerPaddle.h"
#include "GameObjectManager.h"
#include <Box2D\Box2D.h>
class Game
{
public:
static void Start();
const static signed int SCREEN_WIDTH = 1024;
const static signed int SCREEN_HEIGHT = 768;
static GameObjectManager& Get... |
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int dp[110][110],a[110][110];
int arror[4][2] = {1,0,-1,0,0,1,0,-1};
int r,c,sum;
int dfs(int x,int y)
{
int i,j,arrx,arry;
if(!dp[x][y])
{
for(i = 0; i < 4; i++)
{
arrx = x + arror[i][0];
a... |
#ifndef IVEX_EXTRACTION_HPP
#define IVEX_EXTRACTION_HPP
#include "./IV.hpp"
namespace ivex {
struct iv_params {
double crit_current;
double volt_gap;
double res_norm;
double res_sub;
double ic_fact;
double delta_v;
int crit_index;
int vgap_index;
int normal_index;
int sub_in... |
#include<iostream>
#include<algorithm>
#define ll long long int
using namespace std;
int main()
{
ll n,k;
cin>>n>>k;
ll a[n];
for (size_t i = 0; i < n; i++)
{
cin>>a[i];
}
sort(a,a+n);
if(k==0)
{
if(a[0]==1)
cout<<-1;
else
cout<<a[0]-1;
}
else
{
if(k <= n)
{
... |
#include "ScanWithIndexAndNotchInfo.h"
#include "Ms2ScanWithSpecificMass.h"
namespace EngineLayer
{
ScanWithIndexAndNotchInfo::ScanWithIndexAndNotchInfo(Ms2ScanWithSpecificMass *theScan, int notch, int scanIndex)
{
TheScan = theScan;
Notch = notch;
ScanIndex = scanIndex;
}
}
|
#ifndef KALMANFILTER_H
#define KALMANFILTER_H
#include <cassert>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/lu.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/vector.hpp>
namespace ublas = boost::numeric::ublas;
template <typename NumericType>
class KalmanFilte... |
#include "Network.h"
#include <asio.hpp>
#include <cryptopp/base64.h>
#include <cryptopp/filters.h>
#include <cryptopp/oids.h>
#include <string>
#include <sstream>
#include <iostream>
#include "Commands.h"
#include "PaymentException.h"
const std::string ip = "192.168.56.1";
std::pair<std::uint64_t, PublicKey> getPu... |
#include "BasicEdgeDetection.hh"
uint32_t BasicEdgeDetection::PixelsDifference(sf::Color c1, sf::Color c2)
{
return std::abs(int(c1.r) - c2.r) + std::abs(int(c1.g) - c2.g)
+ std::abs(int(c1.b) - c2.b) + std::abs(int(c1.a) - c2.a);
}
uint32_t BasicEdgeDetection::DifferencesFromNeighbours(int x, int y)
{
uint32_t r... |
#pragma once
#include"Loan.h"
class ForNonFiler:public Loan
{
float penalty;
public:
ForNonFiler(char* = nullptr, char* = nullptr, char* = nullptr, char* = nullptr, int = 0, float = 2.5,float=0.5);
double calculateTax();
~ForNonFiler();
};
|
/************************************************************************
created: 04/07/2014
author: Luca Ebach <bitbucket@lucebac.net>
with code by John Norman
purpose: This codec provides SDL2 based image loading
*************************************************************************... |
/********************************************************************************
Copyright (c) 2012, Francisco Claude.
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 co... |
#include <string>
#include <vector>
using namespace std;
class HexGrid {
public:
HexGrid();
vector<string> directions;
void loadDirection(string fileName);
void doSteps();
int getDistance();
int getMaxDistance();
private:
vector<string> splitStringBy(string str, char c);
void step(string direction)... |
// p313
#include <iostream>
using namespace std;
int cache[N_FACTORIAL];
int mapFunc(const vector<int>& key);
int f(const vector<int>& key){
...
int& res = cache[mapFunc(key)];
if (res!=-1) return res;
return res;
}
int main(){
}
|
#include <bits/stdc++.h>
using namespace std;
void power(long long int F[2][2],long long int n);
void multiply(long long int F[2][2],long long int M[2][2]);
long long int fib(long long int n)
{
long long int F[2][2]={{1,1},{1,0}};
if(n==0)
return 0;
power(F,n-1);
return F[0][0];
}
void multiply(long l... |
#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 "FoundationPch.h"
#include "Foundation/Math/SimdVector4.h"
#include "Foundation/Reflect/Data/DataDeduction.h"
REFLECT_DEFINE_BASE_STRUCTURE( Helium::Simd::Vector4 );
void Helium::Simd::Vector4::PopulateComposite( Reflect::Composite& comp )
{
#pragma TODO("Support static arrays in reflect")
//comp.AddFi... |
#define CATCH_CONFIG_RUNNER
#include <catch.hpp>
#include "vec2.hpp"
#include "mat2.hpp"
#include "color.hpp"
#include "rectangle.hpp"
#include "circle.hpp"
TEST_CASE("StandardCons1","[Vec2]")
{
Vec2 a;
Vec2 b{5.1f,-9.3f};
REQUIRE(a.x == Approx(0.0f).epsilon(0.01f));
REQUIRE(a.y == Approx(0.0f).epsil... |
#include "CreateMaximumNumber.hpp"
using namespace std;
vector<int> CreateMaximumNumber::maxNumber(vector<int> &nums1,
vector<int> &nums2, int k) {
int n1 = nums1.size();
int n2 = nums2.size();
int m1 = min(k, n1);
int m2 = min(k, n2);
if (n1 + n2 == k)
... |
#pragma once
//static -> 정적 (클래스 내부/외부 로 의미가 달라진다.)
//다이나믹 함수와 스태틱 함수의 가장 큰 차이점은 this 의 유무이다.
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <string>
#define MYVALUE 100
class MyClass {
public:
int a;
static int b; //스태틱 변수 타입을 전역변수 처럼 생각
void exam1() { //다이나믹(동적) 함수 -> 자기자신의 인스턴스가 있다(주체가 있다.)
a = 1... |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORR(i,a,b) for(int i=a;i>=b;i--)
#define iosb ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int nax = 1e9;
struct pt
{
double x,y;
};
vector<pt> a, hull;
bool cw(pt a, pt b, pt c)... |
#include <memory>
#include "MenuPageIngame.hpp"
#include "../../state/StateManager.hpp"
#include "../../Signals.hpp"
MenuPageIngame::MenuPageIngame(StateManager& manager, nk_context* nk)
: MenuPage(manager, nk, "ingame") {
}
MenuPageIngame::~MenuPageIngame() { }
void MenuPageIngame::updateContent() {
nk_layout_ro... |
public:
int hIndex(vector<int>& citations) {
int up=citations.size();
vector<int> mp(up+1,0); //为啥up+1 为了和h相对应 实际上可以改成 int up=citations.size()-1 在返回的时候加1 还是不行,应该应题目要求
for(auto ele :citations)
{
if(ele>up)
{
mp[up]++;
}
... |
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#include <Wire.h>
// Note: assumes NeoPixels are connected to PIN 6 on the Arduino!
#define PIN 6
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add togeth... |
// 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.Foundation.3.h"
#include "internal/Windows.Foundation.Collections.3.h"
#include "internal/Windows.Storage.Streams.3.h"
#include ... |
//by liuxin,17.4.20
class Solution {
public:
int removeDuplicates(vector<int>& nums)
{
int len=nums.size();
int lind,rind;
lind=rind=0;
while(lind<len-1)
{
rind=lind+1;
//只可能相邻元素... |
//
// A simple server implementation showing how to:
// * serve static messages
// * read GET and POST parameters
// * handle missing pages / 404s
//
#include <Arduino.h>
#ifdef ESP32
#include <WiFi.h>
#include <AsyncTCP.h>
#elif defined(ESP8266)
#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>
#endi... |
#ifndef GRAPHICS_H
#define GRAPHICS_H
#include <GxGraphics/GxExclusiveGraphicsDevice.h>
#include <pcx/resource_map.h>
#include <pcx/signals.h>
#include <pcx/aligned_store.h>
namespace Gx
{
class GraphicsResource;
class VertexDeclaration;
class VertexShader;
class PixelShader;
class Texture;
}
class VertexBuffer;
... |
#pragma once
//put all include files here
#include "Header.h"
#pragma comment(lib, "d3dx9.lib")
#pragma comment(lib, "d3d9.lib")
#include <d3dx9.h>
#define DRVERTEX_FLAGS (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1)
/*Forward Declarations*/
int GameInit();
int GameLoop();
int GameShutdown();
void SetError(char*, ...);
void ... |
#include <iostream>
#include <stdio.h>
#include <fstream>
using namespace std;
int main(){
int length = 80000;
ofstream myfile("output1.txt");
myfile << length << endl;
for(int i = length-1; i > 0; i = i - 2){
myfile << p[i].photoId << endl;
}
for(int i = 0; i < length; i = i + 2){
myfile << p[i].photo... |
class Solution {
public:
vector<int> diffWaysToCompute(string input) {
vector<int> res;
for(int i = 0; i < input.size(); i++)
{
vector<int> left;
vector<int> right;
if(input[i] == '+' || input[i] == '-' || input[i] == '*')
{
lef... |
#include "fadbad-pr2-system.h"
/**
* FadbadPR2System Constructors
*/
FadbadPR2System::FadbadPR2System(rave::RobotBasePtr r, Arm::ArmType arm_type, PR2System& sys) {
object = sys.object.cast<bdouble>();
j_min = sys.j_min.cast<bdouble>();
j_max = sys.j_max.cast<bdouble>();
Q = sys.Q.cast<bdouble>();
R = sys.R.... |
#include "Precompiled.h"
#include "RenderShape.h"
#include "RenderMesh.h"
#include "RenderContext.h"
#include "Renderer.h"
#include "Material.h"
#include "Texture.h"
RenderShape::RenderShape(void)
{
m_pMesh = nullptr;
m_mWorldMatrix = Matrix::Identity;
m_pMaterial = nullptr;
SetRenderFunc(IndexedPrimitiveRenderFun... |
/**
* 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 "voltmeter_thread.h"
float voltmeter_thread::a_vref = 3.3f; // starting value, to be tweaked during class constructor
voltmeter_thread::voltmeter_thread(PinName _ain_pin, float _a_vref, float _scale)
: worker_thread(osPriorityNormal, OS_STACK_SIZE / 4),
ain_pin(_ain_pin, _a_vref * _scale)
... |
#include "integration.h"
#include "integration_init.h"
int main(int argc, char **argv) {
Int_para para;
init(argc, argv, para);
if(para.term == "with_p1") run_p1(para);
else if(para.term == "with_p3") run_p3(para);
else assert(0);
return 0;
}
|
#include "Detector.h"
int main()
{
Detector detector;
detector.run();
return 0;
} |
#include<iostream>
using namespace std;
void pair_finder()
{
int n;
cin>>n;
int a[2*n];
int a_odd[2*n];
int a_even[2*n];
int n_even = 0;
int n_odd = 0;
for(int i=0; i < 2*n; i++)
{
cin>>a[i];
if(a[i]%2 == 0)
{
a_even[n_even] = i + 1;
n_even++;
}
else
{
a_od... |
#ifndef QUEUE_H
#define QUEUE_H
#include<iostream>
#include "PCB.h"
using namespace std;
class Queue{
private:
PCB * head;
PCB * tail;
PCB * buff;
int capacity;
public:
Queue();
explicit Queue(PCB * head);
~Queue();
bool isEmpty();
bool push(PCB * new_node);
bool pop();
PCB * top();
int get_capacity();
}... |
//二叉树的存储结构
struct node{
typename data; //数据域
node* lchild; //指向左子树根节点的指针
node* rchild; //指向右子树根节点的指针
};
//由于在二叉树建树前根节点不存在,因此地址一般设为null
node* root=NULL;
//二叉树新建结点
node* newNode(int v){
node* Node=new node; //申请一个node型变量的地址空间
Node->data=v; //结点的权值为v
Node->lchild=Node->rchild=NULL; //初始状态下没有左右孩子
return Node; //返... |
// generated from rosidl_typesupport_fastrtps_cpp/resource/idl__type_support.cpp.em
// with input from tutorial_interfaces:msg/Num.idl
// generated code does not contain a copyright notice
#include "tutorial_interfaces/msg/detail/num__rosidl_typesupport_fastrtps_cpp.hpp"
#include "tutorial_interfaces/msg/detail/num__st... |
#include<iostream>
#include<string>
using namespace std;
#ifndef QUEUECLASS
#define QUEUECLASS
typedef struct node{
int data;
node *next;
} mynode;
class MyQueue{
private:
mynode *head, *last;
int queue_size;
public:
MyQueue(void);
~MyQueue(void);
bool pushBack(int);
int pullFront(void);
bool isEmpt... |
//
// Game.cpp
// Assessment Task
//
// Created by on 20/02/2017.
// Copyright (c) 2017 Kyle Walker. All rights reserved.
//
#include <iostream>
#include <stdio.h>
#include <iomanip>
#include <stdlib.h>
#include <math.h>
#include <random>
#include <time.h>
#include <ctime>
#include <unistd.h>
//removes the need... |
#ifndef FOGPOINTERMODIFIER_HXX
#define FOGPOINTERMODIFIER_HXX
class FogPointerModifier : public FogModifier
{
typedef FogModifier Super;
typedef FogPointerModifier This;
TYPEDECL_SINGLE(This, Super)
PRIMREF_DERIVED_DECLS(This)
// FOGTOKEN_LEAF_DECLS
FOGTOKEN_SHAREDLEAF_DECLS
private:
Fog... |
/*
* SPDX-FileCopyrightText: 2017,2018,2020 Rolf Eike Beer <eike@sf-mail.de>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include "fdguard.h"
#include "osm2go_annotations.h"
#include <osm2go_platform.h>
#include <fcntl.h>
#include <filesystem>
#include <sys/stat.h>
#include <unistd.h>
#ifndef O_PATH
#defin... |
/*
* Groups.cpp
*
* Created on: Jun 5, 2013
* Author: marchi
*/
#include "Groups.h"
namespace Topol_NS {
bool isPolar(string & a){if(a.substr(0,1) == "N" || a.substr(0,1) == "O") return true; return false;};
bool isH(string & a){if(a.substr(0,1) == "H") return true; return false;};
bool isC(string & a){if(a... |
#include "uivinputsettings.h"
#include <QFileDialog>
#include "UIFaceFinderWidget.h"
//
UIVInputSettings::UIVInputSettings( VideoInput *vi,
QWidget * parent, Qt::WFlags f)
: QDialog(parent, f)
{
setupUi(this);
videoInput = vi;
sourceComboBox->addItem( vs2str( VideoInput:: VSW... |
/*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
#include "Component.h"
class Voltage : public Component{
private:
double (*Func)(double);
double inResist;
public:
Voltage(double (*func)(double)) : Component(){
Func = func;
inResist = 0.001;
}
double* include(double value){
matrix[0][0] = -1./inResist; matrix[0][1] = 1./inResist; matrix[0][2] =... |
#ifndef STACK_H
#define STACK_H
//Stack is an element structure with a LIFO rule.
//class Stack has 4 main methods for working with stack structure.
class Stack
{
public:
Stack();
void add_to_stack(char new_stack_element);
void remove_last_element();
char get_last_element();
bool is_empty();
p... |
/*
Copyright (c) 2013-2014 Sam Hardeman
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, dist... |
////////
// Libraries Arduino
//
// Library: SerialDebug - Improved serial debugging to Arduino, with simple software debugger
// GitHub: https://github.com/JoaoLopesF/SerialDebug
// Author: Joao Lopes
//
// Example to show how to enabling or disabling features
//
///////
////// Includes
#include "Arduino.h"
// Seri... |
#pragma once
#include"nameandpassword.h"
#include<stdlib.h>
#include<fstream>
#include"string"
#include <iostream>
using namespace std;
using namespace System::Runtime::InteropServices;
namespace miniprojectfirstassignment {
using namespace System;
using namespace System::ComponentModel;
using namespace... |
#include "GccGeometry.h"
#include <string.h> // memcpy
#include <algorithm> // std::min
//#include <float.h> // FLT_MAX
const int POINT_ZERO = 0;
const int POINT_CROSS = 1;
const int POINT_CONTACT1 = 2;
const int POINT_CONTACT2 = 3;
const int POINT_INCLUDE = 4;
CGccGeometry::CGccGeometry()
{
}
CGccGeometry::~CGccG... |
#include "pepper_base_manager/pepper_base_manager.h"
#include <tf2/LinearMath/Quaternion.h>
std::map<std::string,std::shared_ptr<resource_management::MessageAbstraction>> PepperBaseManager::stateFromMsg(const pepper_base_manager_msgs::StateMachineRegister::Request &msg)
{
std::map<std::string,std::shared_ptr<resou... |
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package
#include "data/save_game_manager.h"
using namespace jactorio;
static constexpr auto kSaveGameFolder = "saves";
static constexpr auto kSaveGameFileExt = "dat";
bool data::IsValidSaveName(const std::string& save_name)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.