text stringlengths 8 6.88M |
|---|
#ifndef TEXTCOMPARISON_HH_
#define TEXTCOMPARISON_HH_
#include <string>
#include "Process.hh"
#include "Exception.hh"
// A simple process executor is declared here to make the actual comparing
// class a bit simpler. This class could be moved to a file of its own but
// because it is so small and I don't need it els... |
#include "queue.hpp"
namespace broker {
uint64_t queue::add_submission(pending_addition_submission submission) {
return 0;
}
}
|
#include"GameObj.h"
std::string GameObj::toString()
{
std::string str="a";
std::cout << "GOBJ to string" << std::endl;
return str;
}
bool GameObj::doAction(std::string)
{
std::cout << "DoActionA()" << std::endl;
return 0;
} |
//组播
#pragma once
#include "xr_udp.h"
namespace xr
{
class mcast_t : public udp_t
{
protected:
std::string in_if; //recv
std::string out_if; //send
std::string ip; //239.X.X.X
uint16_t port; //239.X.X.X
public:
mcast_t();
//return 0:succ
int create(const char *ip, uint16_t port,
const char *in_if, con... |
// Created on : Sat May 02 12:41:16 2020
// Created by: Irina KRYLOVA
// Generator: Express (EXPRESS -> CASCADE/XSTEP Translator) V3.0
// Copyright (c) Open CASCADE 2020
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it un... |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <iostream>
#include "ros/ros.h"
#include "node_robot_msgs/robot_info_report.h"
#include "node_robot_msgs/agent_task_2.h"
using namespace std;
class Robot_2{
public:
Robot_2();
~Robot_2();
void run();
pri... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2006 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef BT_UTIL_H
#define BT_UTIL_H
// -----------------------------------------------... |
#include <iostream>
#include <iomanip>
using namespace std;
//******************************************************************************
int main()
{
int flag = 1;
int flag_2 = 0;
string header_Name;
do {
string function_Type;
string function_Name;
cout << "//******************************************... |
#include "ConfigReader.hpp"
ConfigReader::ConfigReader(int processorId, Conf &cfg) {
this->processorId = processorId;
this->cfg = &cfg;
}
int ConfigReader::GetProcessorId() {
return this->processorId;
}
Conf *ConfigReader::GetConfiguration() {
return this->cfg;
}
int ConfigReader::GetRoiId() {
i... |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
using ii= pair<ll,ll>;
#define fr(i,a,b) for(ll i=a;i<b;i++)
#define all(o) (o).begin(),(o).end()
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define ld long double
#define eps 0.00000000001
#define mod 1000000007
c... |
/*
* Queue.h
* Comp 220 Bookstore Project
* Written by Joe Cleveland, Chase McGough, and Anthony Pizzo
* This file is the tempelated ADT definition for a Queue
*/
#ifndef INC_220PROJECT_QUEUE_H
#define INC_220PROJECT_QUEUE_H
#include <string>
#include <stdexcept>
template <class T>
class Queue {
public:
/**... |
#include <algorithm>
#include <array>
#include <numbers>
#include <numeric>
#include <sstream>
#include <unordered_map>
#include <vector>
#include "Misc.h"
#include "../imgui/imgui.h"
#include "../fnv.h"
#include "../GameData.h"
#include "../GUI.h"
#include "../Helpers.h"
#include "../Interfaces.h"
#include "../Memo... |
/*
* map_saver.cpp
* Copyright: 2018 Shanghai Yikun Electrical Engineering Co,Ltd
*/
#include <cstdio>
#include "ros/ros.h"
#include "ros/console.h"
#include "nav_msgs/GetMap.h"
#include "tf/LinearMath/Matrix3x3.h"
#include "geometry_msgs/Quaternion.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/hig... |
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// Простой пример со строками
// V 1.0
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
#include<iostream>
#include<string>
using namespace std;
int main() {
string name = "Alex";
cout << "Firstname: ... |
// g2o - General Graph Optimization
// Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard
// 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 cod... |
#include <vector>
#include <QFile>
#include <QXmlStreamReader>
#include <QDomDocument>
#include <boost/filesystem/path.hpp>
#include <boost/lexical_cast.hpp>
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "TextProcessing.h"
#include "AppHelpers.h"
namespace PticaGovorunTests
{
using namespace PticaGovorun... |
#ifndef FARMACIE_ONLINE_H
#define FARMACIE_ONLINE_H
#include <Farmacie.h>
#include <Negative_Number.h>
class Farmacie_online : public Farmacie
{
std::string web;
int nr_viz;
std::vector<double> discount;
public:
Farmacie_online();
Farmacie_online(std::string,int, std::vector<double>);
virtual ... |
#include<stdio.h>
#include<conio.h>
void question1(void);
int main()
{
printf("kdhvds");
getch();
question1();
getch();
return 0;
}
void question1(void)
{
int x=0,set1[x];
int set2[x];
printf("Enter number of elements 1st set :");
scanf("%d",&x);
printf("Enter elements of set i\n")... |
/*
Author : AMAN JAIN
DATE: 03-07-2020
PROGRAM -> BFS
Time Complexity of the below program is O(V+E) using adjacency list.
*/
#include<bits/stdc++.h>
using namespace std;
void bfs(vector<int> list[], int visited[], int start){
queue<int> q;
visited[start]=1;
q.push(start);
cout<<start<<" ";
... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
int n,m;
while (scanf("%d%d",&n,&m) != EOF) {
long l... |
#include "stdafx.h"
std::string GetOnlyFileNameAttachNumber(gtint iID, const gchar* filePath)
{
GtNumberString number;
number.SetNumber( 3, iID );
GtConvertString convert = number.GetString().c_str();
convert += _T("_");
// get only filename
gchar name[GN_MAX_PATH] = { 0, };
GnVerify( GnPath::GetFileNameA( fil... |
#pragma once
#include "SIngletonBase.h"
#include "Frame.h"
class TimeManager : public SingletonBase<TimeManager>
{
private:
Frame * _frame;
public:
TimeManager();
~TimeManager();
HRESULT Init();
void Release();
void Update(float lock = 0.0f);
// GameNode 상속 받지 않고 있어서 hdc 필요함
// 만약 GetMemDC() 함수 상속 받고 싶으면 Gam... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define pi acos(-1.0)
using namespace std;
typedef long long L... |
// Created on: 2015-06-18
// Created by: Anton POLETAEV
// Copyright (c) 2015 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 pub... |
#ifndef __U2F_H_INCLUDED__
#define __U2F_H_INCLUDED__
#include <string>
std::string u2f_process(std::string data);
#endif
|
// ==========================================================================
// = Copyright (C) 2013/2015 Seagull Project - Contrato Ref: 20131034063 =
// = -----------------------------------------------------------------------=
// = Parceiros:
// = - Critical Software - CSW
// = - Força Aérea Portuguesa - FAP
/... |
// O(n^2)
class Solution {
public:
int threeSumClosest(vector<int>& nums, int target) {
if(nums.empty()) return 0;
sort(nums.begin(), nums.end());
int diff = INT_MAX, res = 0;
for(int i = 0; i < nums.size(); ++i){
int tmp = target - nums[i];
for(int x = i+1, y... |
#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<map>
using namespace std;
struct Point{
int z,x,y;
};
Point p,q;
int l,r,c,ans,step[35][35][35],visit[35][35][35];
int d[6][3]={0,0,-1,
0,1,0,
0,0,1,
0,-1,0,
1,0,0,
-1,0,0};
char maze[35][35][35];
bool init(Point& a){
... |
#include<stdio.h>
int main()
{
int z, x=5, y=-10, a=4, b=2;
z = x++ - --y * b /a;
printf("%d",z);
}
|
#ifndef TBB_HPP_
#define TBB_HPP_
#include <functional>
#include <utility>
#include "ascend_task.hpp"
#include "descend_task.hpp"
#include "flow_complex.hpp"
namespace FC {
template <class point_cloud_t>
class abstract_task {
public:
typedef point_cloud_t pc_type;
typedef typename pc_... |
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: s; c-basic-offset: 2 -*-
**
** Copyright (C) 2012 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
**
*/
#ifndef OAUC_COMMON_INCLUDES_H
#define OAUC_COMMON_INCLUDES_H
#... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2007 Opera Software AS. 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 ACCESSIBILITY_EXTENSION_SUPPORT
#i... |
#include "Paddle.h"
Paddle::Paddle()
{
if (colorIsStopped == Color())
colorIsStopped = Color::Red;
if (colorIsMoving == Color())
colorIsMoving = Color::Green;
m_paddle.setFillColor(Color::Transparent);
m_paddle.setSize(Vector2f(150.f, 15.f));
m_paddle.setOutlineThickness(-2.5f);
m_paddle.setOutlineColor(co... |
int Solution::maxArr(vector<int> &A) {
int n = A.size();
vector<int> plusI;
vector<int> minusI;
for (int i = 0; i < n; i++)
{
plusI.push_back(A[i] + i);
minusI.push_back(A[i] - i);
}
int plusMax = INT_MIN, plusMin = INT_MAX, minusMax = INT_MIN, minusMin = INT_MAX;
for... |
#include <iostream>
void rev(unsigned int *a,unsigned int *b,unsigned int *c);
int main(void){
unsigned int a=0,b=0,c=0;
std::cout<<"Input a,b,c respectively : \n";
std::cin>>a>>b>>c;
std::cout<<"\n The initial value of a,b,c are respectively as :"<<a<<b<<c;
rev(&a,&b,&c);
std::cout<<"\n The f... |
#include <iostream>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <vector>
#define W 25
#define H 6
using namespace std;
ifstream fin("input.txt");
//Why? Because I'm limited by the technology of my time, that's why
struct table {
int content[H][W];
inline int* operator[](int h) {
return con... |
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
//基本思想:敏锐的观察力,从从左下上角出发会发现每次都是向上数字会变小,向右数字会变大
//有点和二分查找树相似,时间复杂度O(m+n)
int n = matrix.size() - 1, m = 0;
while (n >= 0 && m < matrix[0].size())
{
... |
#include "HighScoreFileWriter.h"
namespace fileio
{
HighScoreFileWriter::HighScoreFileWriter()
{
//ctor
}
HighScoreFileWriter::~HighScoreFileWriter()
{
//dtor
}
void HighScoreFileWriter::writeToFile(const string filePath, const string output)
{
if(filePath.empty())
{
cout << "File Path ca... |
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<list>
using namespace std;
class Solution {
public:
int maxCoins(vector<int>& nums) {
//简化版:动态规划,正向动态规划,dp[i][j]表示[i,j]范围的最大分数,注意第一重循环必须是j,不断扩大j的范围,并且i必须从j-2不断往前到0,先计算出nums[i]*nums[k]*nums[j]
nums.insert(nums.begin(),1);
... |
/*
** EPITECH PROJECT, 2019
** tek3
** File description:
** CallThread
*/
#ifndef CALLTHREAD_HPP_
#define CALLTHREAD_HPP_
#include <QThread>
#include "UdpSocket.hpp"
#include "Audio.hpp"
namespace babel {
class CallThread : public QThread {
Q_OBJECT
public:
... |
//知识点:单调栈
/*
此题与 P1901 类似(但是更难 XD
维护一个 单调递减 的单调栈
对于一个新加入的人:
1.如果栈中有人,那么相邻的人多了一对,ans++ .
2.然后将栈从顶往下扫:
①如果 新加入的人<栈顶的人高度=<栈顶第二个人 ,
说明能相互看到的人多了一对,ans++
并将栈顶人弹出栈(他会被挡住
②如果 新加入的人 <=栈顶的人的高度 ,
1.如果新加入的人==栈顶人的高度,
说明新加入的人即将被挡住(他将遇到比他高的人
新加入的人 还能看到的人数 = 栈顶和他一样高的人数+1
ans+= ... |
#include "Sudoku.hpp"
#include <iostream>
#include <cassert>
#include <chrono>
#include <bits/stdc++.h>
//#define DEBUGGING
/**
@file main.cpp
@brief File di testing per la classe templata Queue
*/
bool test_tutorial(){
std::cout << "Test tutorial" << std::endl;
Sudoku s;
std::cout << "END Test ... |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <folly/portability/GTest.h>
#include <quic/common/test/TestUtils.h>
#include <quic/congestion_control/QuicCubic.h>
usin... |
#include <iostream>
int fib(int num) {
if (1 > num){
return 0;
}
if(1 == num) {
return 1;
}
return fib(num-1) + fib(num-2);
}
int main()
{
int num;
std::cout << "nermuceq hertakan hamar@\n";
std::cin >> num;
if(0 < num && 300 > num){
int value = fib(num);
... |
#pragma once
#include <iberbar/Gui/Headers.h>
#include <iberbar/Utility/Stack.h>
#include <iberbar/Utility/Result.h>
#include <iberbar/Utility/Xml/Base.h>
#include <iberbar/Utility/Log/Logger.h>
#include <iberbar/Font/Types.h>
#include <functional>
#ifdef _UNICODE
#define ELYQ_GUIXML_MAKE_NODE_NAME(name) L(... |
#pragma once
#include "PlayerData.h"
#include "../Entity.h"
#include <map>
class PlayerState
{
public:
enum StateName
{
Standing,
Running,
Falling,
Throwing,
Jumping,
Climbing,
Fighting,
Sit,
SitFight,
RunFight,
JumpThrow,
SitThrow,
Die,
Fired,
ThrowC... |
#ifndef PHYSICAL_H
#define PHYSICAL_H
#include "GameObject.h"
#include <SFML\Graphics\Shape.hpp>
//#include "WindowRef.h"
class Physical : public GameObject {
public:
Physical();
~Physical();
std::vector<sf::Shape*> shape;
sf::Vector2<float> relativePosition;
sf::Vector2<float> position;
void reserve(int size);
... |
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include "base.h"
#include "Q01.h"
#include "Q02.h"
#include "Q03.h"
#include "Q04.h"
#include "Q05.h"
#include "Q43.h"
#include "Q44.h"
#include "Q45.h"
void testBase()
{
Tree1* tree = new Tree1();
free(tree);
}
void testQ01()
{
Tree1* tree = new T... |
#include <bits/stdc++.h>
using namespace std;
void solve () {
int n;
cin >> n;
vector<int> a(n);
vector<int> cnt(n+1, 0);
for (auto& it: a) {
cin >> it;
++cnt[it];
}
int ans=0;
for (int l=0; l<n; ++l) {
int sum = 0;
for (int r=l; r<n; ++r) {
sum += a[r];
if (l == r) conti... |
#ifndef STACKEDWIDGET_H
#define STACKEDWIDGET_H
#include <QStackedWidget>
class StackedWidget : public QStackedWidget
{
public:
StackedWidget(QWidget* o) : QStackedWidget(o) { }
protected:
virtual QSize sizeHint() const;
virtual QSize minimumSizeHint() const;
};
#endif
|
template <typename T>
inline Matrix<T,3,3>::Matrix() :
data{ Vector<T,3>(1,0,0), Vector<T,3>(0,1,0), Vector<T,3>(0,0,1)}
{
}
template <typename T>
inline Matrix<T,3,3>::Matrix(T m00, T m01, T m02, T m10, T m11, T m12, T m20, T m21, T m22) :
data{ Vector<T,3>(m00,m01,m02), Vector<T,3>(m10,m11,m12), Vector<T,3>(m2... |
#pragma once
#include "libOTe/config.h"
#ifdef ENABLE_BITPOLYMUL
#include <stdint.h>
#include <cryptoTools/Common/Defines.h>
#include <vector>
#include <boost/align/aligned_allocator.hpp>
#include "bitpolymul/bitpolymul.h"
namespace osuCrypto
{
template <typename T>
using aligned_vector = std::vector<T, boo... |
/*
Name: Adrian Dy
SID: 861118847
Date: 5/01/2015
*/
#ifndef LAB4_H_INCLUDED
#define LAB4_H_INCLUDED
#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
#include <queue>
using namespace std;
typedef pair<int, int> Entry;
/*
class priority_queue
{
public:
vector<Entry> ent... |
#include <iostream>
#include "Node2.h"
using namespace std;
/*
* Convert the given binary tree to a doubly linked list
* IDEA: maintain a previous pointer
* while doing inorder traversal
*/
Node2* prev_Node=NULL;
void binTOdll(Node2* root){
if(root==NULL)
return ;
Node2* head= binTOdll(root->left);
if(prev... |
/**
* Copyright (c) 2013-2016, Timothy Stack
*
* 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 ... |
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
struct stop
{
int index;
int time_to_next;
stop *next;
};
int main()
{
// Create nodes
stop *list;
list = new stop[2];
list[1].index = 11;
list[1].time_to_next = 30;
list[1].next = NULL;
list[2].index = 22;
list[2].time_to_nex... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2007 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef OPLIST_H
#define OPLIST_H
class OpGenericListItem;
/***... |
/**
* image.h - Image representation.
*/
#ifndef __NEURAL_NETWORK_IMAGES_H__
#define __NEURAL_NETWORK_IMAGES_H__
#include <vector>
#include "neural_network.h"
#define NLABELS 2
class Image {
public:
std::vector<std::vector<double> > pixels;
unsigned label;
std::vector<double> getPixelEncoding();
std::vec... |
// Created on: 2011-02-03
// Created by: Mikhail SAZONOV
// Copyright (c) 2011-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 2.1 ... |
#include "Tanque.h"
Tanque::Tanque() : Inimigo()
{
}
Tanque::~Tanque()
{
// destroy_bitmap(img); // Destrói a imagem;
}
/* Movimentação */
void Tanque::Movimento()
{
if(y <= 20)
{
vy = -vy;
Sx = 31;
}
if(y >= 470)
{
... |
// Created on: 2004-09-03
// Created by: Oleg FEDYAEV
// Copyright (c) 2004-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 2.1 as ... |
// Copyright Epic Games, Inc. All Rights Reserved.
#include "TwoTheEdge.h"
#include "Modules/ModuleManager.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, TwoTheEdge, "TwoTheEdge" );
|
#ifndef MEDIATOR_H
#define MEDIATOR_H
#include "ui_mainwindow.h"
#include <QObject>
#include <QColorDialog>
#include <QTimer>
#include "simpleViewer.h"
#include "sphere.h"
#include "oGlHeader.h"
/**
* @brief La classe mediator (qui relie la vue avec le formulaire)
*/
class Mediator : public QObject
{
Q_OBJECT
... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 1000000
#define rep(i,n) for(int i=0; i<n; i++)
#define... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
//
//
// Copyright (C) 1995-2012 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 M2_SUPPORT
#include "adjunct... |
/*
* stringValue.h
*
* Created on: Oct 25, 2016
* Author: ondra
*/
#ifndef SRC_IMMUJSON_STRINGVALUE_H_
#define SRC_IMMUJSON_STRINGVALUE_H_
#pragma once
#include "basicValues.h"
namespace json {
class StringValue: public AbstractStringValue {
public:
StringValue(BinaryEncoding encoding, const StringView<... |
/*
* Copyright (c) 2011 Pierre-Etienne Bougué <pe.bougue(a)gmail.com>
* Copyright (c) 2011 Florian Colin <florian.colin28(a)gmail.com>
* Copyright (c) 2011 Kamal Fadlaoui <kamal.fadlaoui(a)gmail.com>
* Copyright (c) 2011 Quentin Lequy <quentin.lequy(a)gmail.com>
* Copyright (c) 2011 Guillaume Pinot <guillaume.pino... |
#include <iostream>
#include <vector>
#include <chrono>
#include <random>
#include <algorithm>
#include <type_traits>
#include "tsp.h"
#include "route.h"
#include "knapsack.h"
#include "knapsackP.h"
#include "real_function.h"
#include "real_vector.h"
template <typename problem_t, typename solution_t>
void random_se... |
#include "Conductor.h"
Conductor::Conductor(const std::string& song) {
if (mInputStream.open(song) == false) {
std::cout << "Failed to load song " << song << std::endl;
} else {
mSong.openFromStream(mInputStream);
mSong.play();
}
}
Conductor::~Conductor() {
stopSong();
}
sf::Time Conductor::getCurrentTimes... |
#include<iostream>
#include<queue>
#include<stack>
using namespace std;
/* pop from queue and put it in stack...then pop from stack and put it in res
* queue
* */
queue<int> revQueue(queue<int> &q1){
stack<int> st;
while(!q1.empty()){
st.push(q1.front());
q1.pop();
}
queue<int> res;
while(!st.empty()){
... |
#if !defined(HTTPWORKER)
#define HTTPWORKER
#include <iostream>
#include <vector>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include "ListenSocket.hpp"
#include "Runnable.hpp"
#include "Config.hpp"
#include "Log.hpp"
#include "Connection.hpp"
#include "HttpServer.hpp"
class HttpWorker : public Runna... |
/*
* TransporterService.h
*
* Created on: 11 Mar 2011
* Author: two
*
* This is used as a template for all "Transporting" classes such as HTTP, RTP etc
* Not threaded. But you can inherit from two classes to make it so :)
*/
#ifndef TRANSPORTERSERVICE_H_
#define TRANSPORTERSERVICE_H_
#include <... |
#include<iostream>
#include<stdio.h>
#include<string>
#include<set>
using namespace std;
/*
//所有元素都是按照字典序自动排序,set只有键值,键值就是市值
(1)构造:
(2)通用操作:empty(), insert(), erase(), size(), swap(), find(), count(),
(3)特有操作:equal_range(), lower_bound(), upper_bound()
*/
void settest()
{
cout<<"-----------------------------thi... |
// Created on: 2002-02-20
// Created by: Andrey BETENEV
// Copyright (c) 2002-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 2.1 a... |
#ifndef HcalCommonData_HcalGeomParameters_h
#define HcalCommonData_HcalGeomParameters_h
/** \class HcalGeomParameters
*
* this class extracts some geometry constants from CompactView
* to be used by Reco Geometry/Topology
*
* $Date: 2015/06/25 00:06:50 $
* \author Sunanda Banerjee, Fermilab <sunanda.banerjee@... |
/*
amazon-interview-questions
Given an array of 0s and 1s, and k, Find the longest continuous streak of 1s after flipping k 0s to 1s.
E.x array is {1,1,0,0,1,1,1,0,1,1}
k = 1 (which means we can flip ‘k’ one 0 to 1)
Answer: 6 (if we flip 0 at index 7, we get the longest continuous streak of 1s having length 6)
... |
#include "GameScene.hpp"
GameScene::GameScene(std::string name) : Scene(name) {
m_levelHndlr.loadLevel("test", "data/test.txt");
m_levelHndlr.switchLevel("test");
m_eventHandler.loadEvent("data/test.event");
m_eventHandler.playEvent();
}
GameScene::~GameScene(void) {
}
void GameScene::events(const ... |
#ifndef PLATFORMER_WORLD_H
#define PLATFORMER_WORLD_H
#include <vector>
#include <string>
#include "Vector2i.h"
namespace platformer {
/**
* All types of blocks, read friendly characters used for easy plotting of
* the map.
*/
enum BlockType : char {
AIR = ' ',
SOLID = '+',
... |
#pragma GCC optimize("Ofast")
#include <algorithm>
#include <bitset>
#include <deque>
#include <iostream>
#include <iterator>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <unordered_map>
#include <unordered_set>
using namespace std;
void abhisheknaiidu()... |
#pragma GCC optimize("Ofast")
#include <algorithm>
#include <bitset>
#include <deque>
#include <iostream>
#include <iterator>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <unordered_map>
#include <unordered_set>
using namespace std;
void abhisheknaiidu()... |
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <algorithm>
#include <sstream>
#include <set>
#include <cmath>
#include <map>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <bits... |
#ifndef ABSTRACTOVERLAPPSEUDOGENOMEGENERATOR_H_INCLUDED
#define ABSTRACTOVERLAPPSEUDOGENOMEGENERATOR_H_INCLUDED
#include "PseudoGenomeGeneratorBase.h"
#include <algorithm>
#include <set>
#include "../persistence/SeparatedPseudoGenomePersistence.h"
using namespace PgSAReadsSet;
namespace PgSAIndex {
template < t... |
#include <cstdio>
#include <iostream>
#include <cstdlib>
typedef long long LL;
typedef double LD;
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
cout.precision(10);
LD s = 0;
for (int i = 0; i < 200000; ++i) {
LD x = s + LD(4) / (8... |
#ifndef SWORD_H
#define SWORD_H
#include <PhysycalWeapon.h>
class Sword : public PhysicalWeapon
{
private:
public:
Sword(string name="DEFAULT", int damages=3, int hit=100, int range=1, int crit=0, int worth=1, int uses = 40, WeaponType type= WeaponType::sword);
virtual ~Sword();
... |
#include "checksum.h"
#include "lookuproute.h"
#include "arpfind.h"
#include "recvroute.h"
#include "rip.h"
//接收路由信息的线程
void *thr_fn(void *arg)
{
selfroute selfrt;
char *ifname = new char[IF_NAMESIZE];
int32_t sock_fd = socket(AF_INET, SOCK_STREAM, 0);
sockaddr_in server_addr;
bzero(&server_addr, sizeof(sockaddr_... |
#ifndef MAPPING_SWIPE_LISTENER_HPP
#define MAPPING_SWIPE_LISTENER_HPP
#include <iostream>
#include "BaseSwipeListener.hpp"
/*
* Maps SwipeTap events to system's arrow key (VK_LEFT, VK_RIGHT, VK_UP or VK_DOWN) event.
* @author: Grzegorz Mirek
*/
class MappingSwipeListener : public BaseSwipeListener {
protected:
voi... |
// FogVolumes.cpp :
//
#include "core/perlin.h"
#include "core/shader.h"
#include "core/types.h"
#include "core/maths.h"
#include "core/platform.h"
#include <vector>
using namespace std;
uint32_t g_width = 1280;
uint32_t g_height = 720;
GLuint g_staticPrograms[2];
GLuint g_depthBuffer;
enum LightType
{
kLightS... |
#include <SPI.h>
#include <Ethernet.h>
#include <Keypad.h>
// Local Network Settings
byte mac[] = { 0xD4, 0x28, 0xB2, 0xFF, 0xA0, 0xA1 }; // Must be unique on local network
const byte numRows= 4; //number of rows on the keypad
const byte numCols= 4; //number of columns on the keypad
boolean DEBUG = true;
char DEVID1[... |
/**
* Copyright (c) 2020 Grama Nicolae
*
* 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, publ... |
#include "pch.h"
#include "Data.h"
//坦克在地图上的显示的0和1
char g_aTank[4][3][3] =
{
{
{0,1,0}, //上
{1,1,1},
{1,0,1}
},
{
{1,0,1}, //下
{1,1,1},
{0,1,0}
},
{
{0,1,1}, //左
{1,1,0},
{0,1,1}
},
{
{1,1,0}, //右
{0,1,1},
{1,1,0}
}
};
const char *g_apStyle[5] = { "■","□", "○","●", "㊣"}... |
#pragma once
// Math constants
#define _USE_MATH_DEFINES
#include <cmath>
#include <random>
// Std. Includes
#include <string>
#include <time.h>
// GLM
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/matrix_operation.hpp>
#include "glm/ext.hpp"
// Ot... |
#pragma once
#include "GameNode.h"
#include "TileMap.h"
// 타일 정보를 탱크한테 넘겨주면 탱크가 알아서 처리하게 할꺼
class TankMap : public GameNode
{
private:
tagTile _tiles[TILEX * TILEY];
// DWORD 특정값이 아닌 4byte로 된거 담는 녀석
DWORD _attributes[TILEX * TILEY];
int _pos[2];
public:
TankMap();
~TankMap();
HRESULT Init();
void Release();... |
#ifndef AOC_10_H
#define AOC_10_H
#include <vector>
#include <string>
#include <algorithm>
namespace AoC_10 {
std::vector<std::vector<int>> CreateMap(std::vector<std::string> mapData) {
std::vector<std::vector<int>> asteroids = {};
for (size_t x = 0; x < mapData[0].size(); x++) {
std::... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#include "core/pch.h"
#ifdef _ENABLE_A... |
#pragma once
#include <cppunit/TestAssert.h>
#include <Poco/Exception.h>
CPPUNIT_NS_BEGIN
#ifdef CPPUNIT_ASSERT_THROW_MESSAGE
#undef CPPUNIT_ASSERT_THROW_MESSAGE
#endif
#define CPPUNIT_ASSERT_THROW_MESSAGE(message, expression, ExceptionType) \
do { ... |
#pragma once
#include <string>
#include "ICommand.h"
class ICommandMaker {
public:
virtual ICommand* Create(std::string parametrs) const = 0;
};
|
//Copyright 2011-2016 Tyler Gilbert; All Rights Reserved
#include <stdlib.h>
#include "calc/Rle.hpp"
#include "sys/File.hpp"
#include "sgfx/Bitmap.hpp"
using namespace sgfx;
using namespace sys;
using namespace calc;
void Bitmap::calc_members(sg_size_t w, sg_size_t h){
m_bmap.columns = sg_calc_byte_width(w);
m_... |
#include "furniture.h"
Furniture::Furniture(float h, int k, int m) : Primitive(h, k) {
primitives = new std::vector<int*>();
worldTransforms = new std::vector<glm::mat4*>();
localTransforms = new std::vector<glm::mat4*>();
inverses = new std::vector<glm::mat4*>();
}
void Furniture::computeInverses(glm::mat4 T) ... |
#include "ros/ros.h"
#include "geometry_msgs/PoseStamped.h"
#include "tf/transform_datatypes.h"
#include "nav_msgs/Path.h"
int main(int argc, char **argv)
{
ros::init(argc, argv, "test_pose");
ros::NodeHandle n;
ros::Publisher chatter_pub = n.advertise<nav_msgs::Path>("path", 1000);
ros::Rate loop_rate(1);
nav_ms... |
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/msg.h>
#include <thread>
#include <chrono>
using namespace std;
void samSpeak(int difference, int moves);
struct location_buf{
long mtype;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.