text stringlengths 8 6.88M |
|---|
/*
* OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees
* https://octomap.github.io/
*
* Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg
* All rights reserved.
* License: New BSD
*
* Redistribution and use in source and binary forms, with or without
* modificat... |
#pragma once
#include "GameNode.h"
#include "Shop3.h"
#include "Inventory2.h"
#include "Item.h"
#define ITEMCOUNT 10
enum PlayerSTATUS {
DOWN_WALK,
UP_WALK,
LEFT_WALK,
RIGHT_WALK,
};
struct tagPlayer {
float x, y;
int gold;
};
struct tagShopInfo {
RECT shopBox;
tagItemInfo item;
float x, y;
};
struct tag... |
#include <iostream>
using namespace std;
int root[101];
int findRoot(int n){
if(root[n] == n){
return n;
}else{
return root[n] = findRoot(root[n]);
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int tc;
cin >> tc;
int tcase = 1;
while (tc--)
{... |
#ifndef CTESTA_H
#define CTESTA_H
#include "MyObject.h"
class CTestA: public MyObject
{
public:
CTestA();
void metacall(int slotID);
My_signals:
typedef enum {
SIGNAL_1,
SIGNAL_2,
}SIGNAL_ID;
void signalTestA1(int signalID);
void signalTestA2(int signalID);
};
#endif // CTES... |
#include <bits/stdc++.h>
#define MAX 100005
using namespace std;
vector<int>lista[MAX];
int memo[MAX]={};
int main()
{
int n, m, s, t, v1, v2;
scanf("%d %d %d %d", &n, &m, &s, &t);
for(int i=0;i<m;i++)
{
scanf("%d %d", &v1, &v2);
lista[v1].push_back(v2);
}
memo[s] = 0;
printf... |
#include "GnGamePCH.h"
#include "GStartBackgroundLayer.h"
GStartBackgroundLayer* GStartBackgroundLayer::CreateBackground()
{
GStartBackgroundLayer* background = new GStartBackgroundLayer();
if( background->InitBackground() == false || background->InitClouds() == false )
{
delete background;
return NULL... |
#include "CAccountLogin.h"
#include "json/json.h"
#include "Logger.h"
#include "threadres.h"
#include "MySqlDBAccess.h"
#include "JsonValueConvert.h"
#include "RedisLogic.h"
#include "SqlLogic.h"
#include "CConfig.h"
/****************************************************************************************************... |
/*
* EpollMain.cpp
*
* Created on: Jun 11, 2017
* Author: root
*/
#include "EpollMain.h"
#include "NetWorkConfig.h"
#include "Context.h"
#include "Service_Handler.h"
#include "../Log/Logger.h"
#include "DispatchMessage.h"
#include "MessageManager.h"
namespace CommBaseOut
{
CEpollLoop::CEpollLoop(Context *c... |
#ifndef PROJECT_KERMARRECKPLUGIN_H
#define PROJECT_KERMARRECKPLUGIN_H
#include <tulip/TulipPluginHeaders.h>
#include <string>
#include <stdlib.h>
#include <time.h>
#include <thread>
#include <future>
#include <omp.h>
#include "NodeWalkInfo.h"
/**
* Main class of the Kermarreck plugin
* This plugin's job is to run ... |
#include<iostream> //infix to postfix conversion
#include<string.h>
using namespace std;
char stack[100];
int top=-1;
void push(char data)
{
top++;
stack[top]=data;
}
char pop()
{
int data=stack[top];
top--;
return data;
}
int priority(char a)
{
if(a=='^')
return 4;
else if(a=='*' || a=='/')
return 3;
else ... |
#include "physicpoint.h"
using namespace std;
namespace sbg {
template<int n>
PhysicPoint<n>::PhysicPoint()
{
}
template<int n>
PhysicPoint<n>::~PhysicPoint()
{
}
template<int n>
PhysicPoint<n>& PhysicPoint<n>::operator=(PhysicPoint<n>&& o)
{
_velocity = move(o._velocity);
_corrections = move(o._corrections);
_... |
//
// Created by Nikita Kruk on 08.08.18.
//
#ifndef SPRAPPROXIMATEBAYESIANCOMPUTATION_SIMULATIONENGINEFOREXPERIMENTALDATA_HPP
#define SPRAPPROXIMATEBAYESIANCOMPUTATION_SIMULATIONENGINEFOREXPERIMENTALDATA_HPP
#include "../Definitions.hpp"
#include "../ParameterSets/ExperimentalParameterSet.hpp"
#include "../Other/Fre... |
#include <iostream>
#include <opencv2/opencv.hpp>
#include "annotator.h"
using namespace std;
using namespace cv;
/*** 鼠标事件回调函数 ***/
void onMouse(int event, int x, int y, int flags, void* param);
bool is_annotating = false;
Annotator::Annotator() {
color = Scalar(255, 255, 0);
thr_area = 1.0;
}
Annotato... |
#include <iostream>
#include <vector>
#include <algorithm>
const int MAX = 1e9;
int main()
{
std::cin.sync_with_stdio(false);
std::cin.tie(NULL);
int t;
std::cin >> t;
while(t--)
{
int n, x, y;
std::vector<int> list;
std::cin >> n >> x >> y;
int d = 1;
fo... |
#include <stdio.h>
#include <assert.h>
#include <time.h>
#include <cstdlib>
int gcd (int a, int b);
struct fraction
{
int nominator, denominator;
bool is_correct()
{
return ((denominator!=0)&&(abs(nominator)<abs(denominator))?true:false);
}
void shorten()
{
int nwd=gcd(nominator, denominator);
nominator=no... |
#include <fstream>
#include "parser.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
/**
Takes a string and ouputs a vector of all the words in the string
*/
bool Parser::checkFileName(const string & file_name) {
string line;
ifstream myfile(file_name);
if (myfile.is_open()... |
//
// EPITECH PROJECT, 2018
// zappy
// File description:
// EditBox.hpp
//
#ifndef EDITBOX_HPP
#define EDITBOX_HPP
#include "include.hpp"
#include "Rectangle.hpp"
class EditBox
{
public:
enum ID {
PORT = 200,
WIDTH,
HEIGHT,
NAME1,
NAME2,
NAME3,
NAME4,
CLIENT,
FREQ,
TEAM
};
EditBox(irr::gui::I... |
/**
* @author shaoDong
* @email scut_sd@163.com
* @create date 2018-10-11 15:42:30
* @modify date 2018-10-11 15:42:30
* @desc 下一个更大元素,数组循环计数
*/
#include <iostream>
#include <vector>
using namespace std;
vector<int> nextGreaterElements(vector<int>& nums)
{
vector<int> res;
int len = nums.size(), flag = 0;... |
#include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <utility>
#include <vector>
class Map
{
public:
Map(int n, int m) : n(n), m(m), map(n, std::vector<int>(m, 0))
{
// Do nothing.
}
Map(const Map& map) = default;
void show() const
{
... |
/*
* This code reads values from a set of one or more DS18B20 Dallas One Wire temperature
* sensors with an ESP8266 board, and publishes the readings using MQTT.
* Borrows from various examples by Adafruit, Dallas One Wire and Arduino libraries.
*
*/
#include <FS.h> //this needs to be first, or ... |
/*
* Copyright 2016 Freeman Zhang <zhanggyb@gmail.com>
*
* 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 applic... |
// Created on: 1993-07-12
// Created by: Yves FRICAUD
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU L... |
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest.h"
int factorial(int number) { return number <= 1 ? 1 : factorial(number - 1) * number; }
// if number is less than or equal to 1, return 1. If number is greater than 1, calculate
// the factorial recursively until number =1, and then return the factorial.
... |
/*
* Arduino RF24 Network slave with different sensors.
* Temperature in aquarium with alarm buzzer and reset button.
* Motion detection, DS18B20 temperature and LDR light level in living room.
* Reporting to RF24 Network master which stores it into SQL database.
*
* Sandolution 2016
*/
//Include communication ... |
#pragma once
class Rect
{
private:
public:
int x, y, w, h;
Rect() { x = y = w = h = 0; }
void Set( int tx, int ty, int tw, int th ) { x = tx; y = ty; w = tw; h = th; }
int X() { return x; }
void X( int val ) { x = val; }
int Y() { return y; }
void Y( int... |
#pragma once
#include "effect.h"
#include "PreDefine.h"
#include <string>
#include "Pipeline.h"
#include "ShowTexturePipeline.h"
using namespace std;
using namespace HW;
class ForwardEffect :public PipelineEffect{
public:
virtual void Init();
virtual void Render();
//input
string input_scenename;
string input_c... |
#include "mainwindow.h"
#include "init.h"
#include "ui_mainwindow.h"
#include <QCoreApplication>
#include <QScrollArea>
#include <QMessageBox>
#include <QString>
#include <QSpacerItem>
#include <qdebug>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow)
{
ui->setupUi(this);
... |
// Using floodfill. Time-0.010s
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
int dr[] = {1,0,0,-1};
int dc[] = {0,1,-1,0};
char a[101][101];
ll n;
void dfs(ll i, ll j)
{
if(i >= n || j >= n || i < 0 || j < 0)
return;
if(a[i][j]=='.') return;
a[i][j]... |
#include <stdio.h>
#include <wrl/client.h>
//#include <d3dx9.h>
//#include <DxErr.h>
#include <d3d11.h>
#include <d3d11_1.h>
#include <d3dcompiler.h>
#include <string>
using namespace Microsoft::WRL;
void TestD3D9();
void TestD3D11();
void TestD3D12();
std::string DXGetErr( HRESULT hr )
{
char err[ 256 ];
... |
// This is a sample code that constructs general kinetic terms!
#include <iostream>
#include <iomanip> // to set output precision.
#include <fstream>
#include <cmath>
#include <string>
#include <sstream>
#include <complex>
#include <random>
#include <vector>
#include <cstring> // should be replaced by using sstream
... |
#include "User.h"
#include "UdataUtils.h"
#include <QDebug>
#include <QVector>
#include <stdlib.h>
using namespace udata;
User *User::thisInstance = new User(QVector<Commitment>{});
/**
* @brief User::User
* @param newCommitments
*/
User::User(QVector<Commitment> newCommitments) {
commitments = newCommitments... |
/*
TouchKeys: multi-touch musical keyboard control software
Copyright (c) 2013 Andrew McPherson
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 3 of the License, or
(at you... |
#include <cstdio>
#include <cstring>
using namespace std;
const int maxn = 50 + 5;
int main(int argc, char const *argv[])
{
// long long about 20 digit, not meet the req. of que. of 50 digits
char num[maxn];
scanf("%s", num);
int flag = (num[0] == '-' ? 1 : 0); // good!
int len = strlen(num);
int bits = len ... |
#ifndef _MSG_0X0F_PLAYERBLOCKPLACEMENT_CTS_H_
#define _MSG_0X0F_PLAYERBLOCKPLACEMENT_CTS_H_
#include "mcprotocol_base.h"
#include "slotdata.h"
namespace MC
{
namespace Protocol
{
namespace Msg
{
class PlayerBlockPlacement : public BaseMessage
{
public:
PlayerBlockPlacement();
PlayerBlockPlacement(int32_t _x, int8_... |
#include <iostream>
#include <vector>
using namespace std;
class node;
class Tree{
public:
vector <node> arr;
int SizeOfTree;
//int height;
int t; //coeffcient
int modul; //modul
unsigned int FirstLeaf;
vector<int> powers;
Tree(string str);
bool IsPal(int begin, int end);
void SetAt(char a, int i);
void ... |
//Jake Leonen
//Object Oriented Programming II
//Assignment 4
//April 2nd, 2015
//mainfile.cpp
#include "iostream"
#include "arrayDouble.h"
using namespace std;
int main()
{
int enteredLength; // user's desired lenght
char userRes; // user response for sort method
ArrayDouble userArray; //
cout << "M... |
/*
* WiFi configurable ESP32 Ruuvi Collector
*
* See https://github.com/oh2mp/esp32_ruuvicollector
*
*/
#include <WiFi.h>
#include <WiFiMulti.h>
#include <HTTPClient.h>
#include <WiFiClientSecure.h>
#include <WiFiClient.h>
#include <WebServer.h>
#include <SPIFFS.h>
#include <time.h>
#include "strutils.h"
#incl... |
/*1. Implement three nodes point – to – point network with duplex links between them.
Set the queue size, vary the bandwidth and find the number of packetsdropped.*/
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#inclu... |
class Solution {
public:
vector<int> maxNumber(vector<int>& nums1, vector<int>& nums2, int k) {
int m = nums1.size();
int n = nums2.size();
vector<int> res;
/*
* 从nums1中取i个数,从nums2中取k-i个数
* 0 <= i <= m , 0 <= k-i <= n
*/
for(int i=max(k-n,0); i<=min... |
#include"alu_16b_tb.h"
#include<iostream>
using namespace std;
void alu_16b_tb::clk_process()
{
while (true)
{
clk_val = !clk_val;
clk.write(static_cast<sc_logic>(clk_val));
wait(1, SC_NS);
}
}
void alu_16b_tb::tb_process()
{
rst.write(SC_LOGIC_0); //keep reset for 10 ns
wait(10, SC_NS)... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2012 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Kajetan Switalski
**
*/
#ifndef _SPDY_PROTOCOL_H_
#define _SP... |
#include "game.hpp"
#include <memory>
#include <utility>
game::game() : wnd_{640, 480, "Space!"}
{
}
void game::run()
{
while (wnd_.handle_events() && !wnd_.should_close())
{
using namespace std::chrono;
auto const now = high_resolution_clock::now();
leftover_time += duration_cast<mill... |
#include <cstdlib>
#include <exception>
#include <stdexcept>
#include <unordered_map>
#include <unordered_set>
#include <iostream>
#include <ostream>
#include <fstream>
#include <utility>
#include "critical_point.hpp"
#include "flow_complex.hpp"
template <typename nt, typename st>
using inc_map = std::unordered_map<... |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
char arr[1005][1005];
int ix[]={0,0,-1,1};
int iy[]={1,-1,0,0};
int n,m,k=0,temp=0;
void dfs(int x,int y){
arr[x][y]='.';
temp++;
for(int i=0;i<4;i++){
int tx=x+ix[i];
int ty=y+iy[i];
if(tx>=n || tx<0 || ... |
//
// Created by dwb on 2019-07-18.
//
#include <iostream>
#include "Cite.h"
using namespace std;
#define PI 3.1415926
double g_area=0;
void swap1(int *t_p1,int *t_p2){
int temp = *t_p1;
*t_p1 = *t_p2;
*t_p2 = temp;
}
void swap2(int &t_x,int &t_y){
int temp = t_y;
t_y = t_x;
t_x = temp;
}... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2009 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* Tomasz Kupczyk tkupczyk@opera.com
*/
#ifndef RUNTIME_GADGET_MA... |
#ifndef LIGHTIMAGE_ERROR_HPP
#define LIGHTIMAGE_ERROR_HPP
#include <iostream>
#include <cstdio>
#include <cstdlib>
#define ERR(info) error(__FILE__, __LINE__, info)
namespace li {
inline void error(const char *file, long line, const char *info) {
std::cerr << file << "\t" << line << ":" << info << std::e... |
class Singleton
{
private:
Singleton() {};
Singleton(const Singleton& s) = delete;
static Singleton *m_instance;
public:
static Singleton* getInstance();
~Singleton();
};
// 如果有多线程访问则必然会产生碎片
Singleton* Singleton::getInstance() {
if (m_instance == nullptr) {
m_instance = new Singleton();
}
return m... |
#include "component.h"
namespace sge{ namespace graphics{ namespace gui {
Component::Component(const math::Rectangle& bounds)
: Widget(bounds), m_TransformationMatrix(math::mat4::identity()) {
}
Component::~Component(){
clear();
}
void Component::submit(Renderer2D* renderer) const{
renderer->push(m_Tran... |
/*
* SDEV 340 Week 13 Problem 1
* Store the contents of a file reversed character-by-character into a second file
* November 19, 2019
* Benjamin Lovy
*/
#include <fstream>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
class FileReverser
{
std::string name;
std::ifstream inFile;
... |
#include<stdio.h>
#include<math.h>
int a,b,k=1;
main()
{
scanf("%d %d",&a,&b);
for(int s=1; s<=b; s++)
{
printf("%d^%d=%d\n\n",a,s,k=pow(a,s));
}
}
|
/*
* File: Sombrero.h
* Author: raul
*
* Created on 21 de enero de 2014, 18:57
*/
#ifndef SOMBRERO_H
#define SOMBRERO_H
#include "ObjetoCompuesto.h"
#include "freeglut.h"
GLdouble const DIVISORPROPORCIONALSOMBRERORADIO = 3.0;
GLdouble const DIVISORPROPORCIONALSOMBREROALTURA = 6.0;
class Sombrero : public Ob... |
// Created on: 1997-12-09
// Created by: Jean-Louis Frenkel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the... |
// # include<iostream>
// using namespace std;
// int main (){
// sqrt( double a, b, c );
// cout << "Please enter a number" << endl;
// cin >> a;
// cout << "Please enter another number" << endl;
// cin >> b;
// cout << c = a + b << endl;
// system("pause");
// return 0;
// }
# includ... |
#include "CGetNotice.h"
#include "json/json.h"
#include "Logger.h"
#include "threadres.h"
int CGetNotice::do_request(const Json::Value& root, char *client_ip, HttpResult& out)
{
//Json::Value ret;
//Json::FastWriter write;
out["result"] = 0;
if (root["ctype"].isNull() || root["cid"].isNull() || root... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
// Created on: 2020-06-18
// Created by: PASUKHIN DMITRY
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as pu... |
#include <iostream>
using namespace std;
#define maxn 1000
int st[maxn];
int N;
void init(int* arr, int n) {
N = n;
for (int i = N; i < 2 * N; ++i) st[i] = arr[i - N];
for (int i = N - 1; i > 0; --i) st[i] = st[i << 1] + st[1 + i << 1];
}
void updateSingle(int i, int val) {
for (i += N; i; i >>= 1) ... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int arr[] = {1, 2, 3, 2};
int n = sizeof(arr)/sizeof(int);
sort(arr, arr + n);
int sum = 0;
for (int i=0; i<n; i++)
{
if (arr[i] != arr[i+1])
sum = sum + arr[i];
}
cout<<sum;
return 0;
}
|
//
// sequence.h
// trackers
//
// Created by Lianghua Huang on 16/5/22.
// Copyright © 2016年 Lianghua Huang. All rights reserved.
//
#pragma once
class Sequence {
private:
std::string path_video;
cv::VideoCapture cap;
unsigned int frame_index;
bool is_initia... |
// ESW Fri Oct 21 21:37:18 EDT 2016
// Structs and functions that manage all input parameters.
#ifndef MG_INPUTS
#define MG_INPUTS
#include <vector>
#include "operators.h"
#include "null_gen.h"
#include "mg.h"
#include "mg_complex.h"
#include "u1_utils.h"
// Print usage.
void display_usage();
// Forward declarati... |
#include <iostream>
using namespace std;
bool isPalindrome(int arr[], int from_front, int from_end)
{
if (from_front >= from_end)
{
return true;
}
if (arr[from_front] == arr[from_end])
{
return isPalindrome(arr, from_front + 1, from_end - 1);
}
else
{
return fal... |
#pragma once
#include <memory>
#include <tsl/ordered_map.h>
#include "Types/Configurable.hpp"
#include "YAMLStream.hpp"
class Config {
public:
Config();
void resetToDefault();
void renderImGui();
void loadFromFile(std::string_view filePath);
void saveToFile(std::string_view filePath);
const Co... |
#include "stdafx.h"
#include "Phoenix.h"
HRESULT Phoenix::init()
{
IMAGEMANAGER->addFrameImage("피닉스", "image/ulti2.bmp", 1380, 245, 8, 1);
img = IMAGEMANAGER->findImage("피닉스");
speed = 7.0f;
isFire = false;
_count = 0;
_index = 0;
return S_OK;
}
void Phoenix::release()
{
}
void Phoenix::update()
{
bullet... |
#include <iostream>
#include "field.hh"
using namespace std;
const pos unitvec[6] = {{1,1},{0,1},{-1,0},{-1,-1},{0,-1},{1,0}};
bool is_equal(pos a, pos b) {
if(a.a==b.a&& a.b ==b.b) return true;
else return false;
}
pos add_pos(pos a, pos b){
pos c;
c.a = a.a+b.a;
c.b = a.b+b.b;
return c;
}
pos sub_pos(pos a,... |
/******************************************************************************
"Multiverse's Lowest LO-FI Wood Pixel Display—Arduino Art" (Version 1.0)
https://www.youtube.com/watch?v=4f1J5LzRdIo
This code was written to power the WTD 1.0 (Wood Tile Display) project
created while participating in Mark Rober... |
//
// Created by 송지원 on 2020-01-30.
//
#include <iostream>
#include <string.h>
using namespace std;
int main() {
int MOD = 1000000;
int D[5001] = {1, };
char str[5001];
int len;
cin >> str;
len = strlen(str);
for (int i=1; i<=len; i++) {
int val1 = str[i-1] - '0';
if (1<=v... |
/**
[PROGRAM] : Object Oriented Programming
[AUTHOR] : Saddam Arbaa
[Email] : <saddamarbaas@gmail.com>
Object Oriented Programming with C++ - Introduction
*/
#include<iostream>
using namespace std;
// Create Rectangle class with some attributes
class Rectangle {
// Access specifier
publ... |
#ifndef AWS_NODES_DECREASE_H
#define AWS_NODES_DECREASE_H
/*
* aws/nodes/decrease.h
* AwesomeScript Decrease
* Author: Dominykas Djacenka
* Email: Chaosteil@gmail.com
*/
#include <string>
#include "statement.h"
#include "variable.h"
namespace AwS{
namespace Nodes{
class Decrease : public Statement{
publi... |
//This is the implementations of pattern search process used in GOSIM
//The code is implemented based on the PatchMatch algorithm proposed by Barnes et al., 2009.
//Some modifications have been added to the original PatchMatch
//in the case of 3D SIMULATION and CONDITIONAL SIMULATION
#include "GOSIM.h"
Grid *GOSIM::P... |
#include "stdafx.h"
#include "DxccCountryManager.h"
#include "boost/algorithm/string.hpp"
using namespace boost;
#include "StringUtils.h"
#include "FileUtils.h"
#include "TextFile.h"
#include "DxccCountry.h"
DxccCountryManager::DxccCountryManager()
{
}
DxccCountryManager::~DxccCountryManager()
{
auto iter = m_count... |
// Copyright 2011 Yandex
#ifndef LTR_SCORERS_COMPOSITION_SCORERS_LINEAR_COMPOSITION_SCORER_H_
#define LTR_SCORERS_COMPOSITION_SCORERS_LINEAR_COMPOSITION_SCORER_H_
#include <string>
#include <vector>
#include "ltr/scorers/composition_scorers/composition_scorer.h"
using std::string;
using std::vector;
namespace ltr ... |
#include <Arduino.h>
typedef void (*brightnessChangeCallback)(int8_t);
class BrightnessChanger
{
public:
BrightnessChanger(
unsigned long tickPeriodTime,
brightnessChangeCallback callback,
int8_t brightnessStep);
void start();
void stop();
void tick();
private:
unsigned long _previousMillis =... |
#ifndef VnaPowerCorrections_H
#define VnaPowerCorrections_H
// RsaToolbox
#include "Definitions.h"
// Etc
// Qt
#include <QObject>
#include <QScopedPointer>
namespace RsaToolbox {
class Vna;
class VnaChannel;
class VnaPowerCorrections : QObject
{
Q_OBJECT
public:
explicit VnaPowerCorrections(QObject *par... |
#ifndef AUX_H
#define AUX_H
extern bool SHOW_INFO,SAVE_AT_INTERFACE,INIT_AT_INTERFACE;
template <class myType>
myType*** allocate3D(int x,int y,int z) {
myType ***a = new myType**[x];
for (int i=0;i<x;i++) {
a[i] = new myType*[y];
for (int j=0;j<y;j++) {
a[i][j] = new myType[z];
}
}
return a;
}
extern... |
/*
Name: leetcode 91
Copyright:
Author: xiao dong, xiao
Date: 2019/8/12 20:41:34
Description: 本题有DP 解法 但我用的朴素解法 扣边界扣了半小时 AC了
*/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int numDecodings(string s) {
return solve(s, 0);
}
int solve(string& str, int s) {
i... |
#include <iostream>
#include <string>
using namespace std;
bool isPalindrome(string input)
{
int start =0,end = input.length()-1;
char front, back;
while(start< end)
{
//front = tolower(input[start]);
//back = tolower(input[end]);
// check if both are alphabets
while(!isalpha(input[start])) // if cha... |
#include "PixmapDisplay.h"
PixmapDisplay::PixmapDisplay(void)
{
}
PixmapDisplay::~PixmapDisplay(void)
{
}
|
#include <stdio.h>
#include <conio.h>
#include <dos.h>
void main () {
clrscr();
int A[3][3]={1,0,0,0,2,0,0,0,3};
int r,c;
printf("\n\n\tDIAGONAL MATRIX");
printf("\n\n A Diagonal Matrix will always be a Square matrix whose all elements\n are zero except the diagonal elements.");
printf("\n\n\tLet ... |
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#inc... |
/// \file NiCfEventAction.hh
/// \brief Definition of the NiCfEventAction class; adapted from
/// Geant4 example B5 B5EventAction.hh
#ifndef NiCfEventAction_h
#define NiCfEventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
#include <vector>
#include <array>
/// Event action
class NiCfEvent... |
#pragma once
#include "ofMain.h"
#include "shapes\shapeBase.h"
class characterBase
{
public:
ofPoint position;
shapeBase * shapes[20];
virtual void update(){};
virtual void updateSkeleton(ofPoint skeletonPoints[20]);
void draw();
}; |
#include <bits/stdc++.h>
#include "myFind.h"
#include "randomNumberGeneration.h"
using namespace std;
int main()
{
//randomNumberGeneration();
string s;
cout<<"Enter the file name: ";
cin>>s;
ifstream f(s);
int x,n;
f>>x>>n;
int a[n];
for(int i=0;i<n;i++){
f>>a[i];
}
... |
// Created on: 2006-05-25
// Created by: Alexander GRIGORIEV
// Copyright (c) 2006-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version ... |
#include <iostream>
using namespace std;
// A function that takes a string and checks if the string is palindrome
int checkPalindrome(string Str) {
int i = 0;
int j = Str.length()-1;
for ( ; i < j; i++, j--) {
if (Str[i] != Str[j])
return 0;
}
return 1;
}
// main program
int ... |
#include "XYmodel.h"
#ifdef _MSC_VER
#include "../VM/rand.h"
#else
#include "rand.h"
#endif
#include <cmath>
#include <cstring>
int L;
int n;
double dt;
double noise_strength;
double h; // Strength of the external fields
double *phi;
double *phi_next;
double *psi=NULL;
int *neighbor;
Ran *myran;
void set_neigh... |
/////////////////////////////////////////////
//main.cpp
//Eron Lake
//ejlake@ucsc.edu
//CMPS104A
//main program for asgn1
//////////////////////////////////////////////
#include <string>
using namespace std;
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "string_set.h"
#incl... |
#pragma once
#include "GameObject.h"
class Obstacle :
public GameObject
{
public:
Obstacle(sf::Texture& tex);
~Obstacle();
virtual void update(sf::Time deltaTime);
};
|
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define show(x) for(auto i: x){cout << i << " ";}
typedef long long ll;
const int mod = 1000000007;
struct mint {
ll x; // typedef long long ll;
mint(ll x=0):x((x%mod+mod)%mod){}
mint& operato... |
#include <stdio.h>
long long int arr1[10000001];
long long int arr2[10000001];
long long int arr3[10000001];
long long int arr4[10000001];
long long int arr5[10000001];
long long int arr6[10000001];
long long int arr7[10000001];
long long int arr8[10000001];
long long int arr9[10000001];
long long int arr10[10000001];... |
#ifndef RECEIVER_H
#define RECEIVER_H
#include <QObject>
class Receiver : public QObject
{
Q_OBJECT
public:
explicit Receiver(QObject *parent = 0);
signals:
Q_INVOKABLE void sendToQml(QString longi, QString lat);
Q_INVOKABLE void sendToQmlLongi(QString longi);
Q_INVOKABLE void sendToQ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 2008 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#include "core/pch.h"
#ifdef CORE_SPEED_D... |
// --- This file is distributed under the MIT Open Source License, as detailed
// by the file "LICENSE.TXT" in the root of this repository ---
#ifndef HURCHALLA_UTIL_COMPILER_MACROS_H_INCLUDED
#define HURCHALLA_UTIL_COMPILER_MACROS_H_INCLUDED
#ifdef _MSC_VER
# define HURCHALLA_FORCE_INLINE __forceinline
#elif defin... |
#ifndef GUI_TIME_VIEW_H__
#define GUI_TIME_VIEW_H__
#include <toys/Time.h>
#include <pipeline/all.h>
#include <gui/TextPainter.h>
#include <gui/Signals.h>
class TimeView : public pipeline::ProcessNode {
public:
TimeView();
~TimeView();
private:
void onModified(const pipeline::Modified& signal);
void onUpdat... |
//////////////////////////////////////////////////////////////////////
//
// File: view.cc
//
// Animation Lab, Computer Science Department
// Carnegie Mellon University
//
// Created: Sun Mar 10 02:57:18 1996 by Zoran Popovic
// CVS info:
// $Source: /afs/cs.cmu.edu/user/andrewb/cvsroot/cs463/p2/cellview/... |
/*
* controlTemp.cpp
*
* Created on: Nov 7, 2012
* Author: christoph
*/
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <sstream>
//#include <vector>
#include <ctime>
extern "C" {
#include <rrd.h>
}
#include "tempSensor.h"
#include "RCSwitch.h"
u... |
#include"stdio.h"
#include"conio.h"
int add(int, int);
void main (void)
{
clrscr();
int a,b;
printf("Enter 1st value = ");
scanf("%d",&a);
printf("Enter 2nd value = ");
scanf("%d",&b);
int c=add(a, b);
clrscr();
printf("The result is %d",c);
getch();
}
int add(int a, int b)
{ return a+b; }
|
/*************************************************************************/
/* Copyright (C) Network Accessing Control -USTC, 2013 */
/* */
/* File Name : client/KFilter.h */
/* Pricipal Aut... |
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#inc... |
/*
* Program: Image_Morphing.h
* Usage: Morph source image to dest image
*/
#ifndef IMAGE_MORPHING_H
#define IMAGE_MORPHING_H
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include "CImg.h"
#include "Delaunay.h"
using namespace std;
using namespace cimg_library;
struct Point {
float x,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.