text stringlengths 8 6.88M |
|---|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#ifndef YAF_P_H
#define YAF_P_H
#include <stdio.h>
#include <QObject>
class YafP : public QObject
{
Q_OBJECT
public:
YafP() {}
public slots:
void doYafP() { printf... |
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <algorithm>
#define INT_MAX 0x7fffffff
#define INT_MIN 0x80000000
using namespace std;
void rotate(vector<vector<int>> &matrix){
if(matrix.size()==0 ... |
#pragma once
#include "MatchCommDef.h"
class CenterServerManager final : public ManagerModule
{
public:
CenterServerManager();
~CenterServerManager();
public:
virtual bool Awake()override;
virtual bool AfterAwake()override;
virtual bool Execute()override;
virtual bool BeforeShutDown()override;
virt... |
#include "pch.h"
#include "RenderPass.h"
//void Hourglass::RenderPass::AddRenderTechnique(RenderTechnique* technique)
//{
// m_RenderTechniques.push_back(technique);
//}
//
//void Hourglass::RenderPass::ClearRenderTechniques()
//{
// for (size_t i = 0; i < m_RenderTechniques.size(); i++)
// {
// m_RenderTechniques[i... |
void speed()
{
double t=1;
for(int i=1;i<1e9;i++)
{
//cout<<" \r"<<i<<" "<<t;
t *= i;
if(t>1e9) t =1;
}
} |
/**
* @file mpi_jacobi.cpp
* @author Patrick Flick <patrick.flick@gmail.com>
* @brief Implements MPI functions for distributing vectors and matrixes,
* parallel distributed matrix-vector multiplication and Jacobi's
* method.
*
* Copyright (c) 2014 Georgia Institute of Technology. All Righ... |
#ifndef HDLC_SIMULATION_DATA_GENERATOR
#define HDLC_SIMULATION_DATA_GENERATOR
#include <SimulationChannelDescriptor.h>
#include "HdlcAnalyzerSettings.h"
#include <string>
#include <vector>
using namespace std;
class HdlcSimulationDataGenerator
{
public:
HdlcSimulationDataGenerator();
~HdlcSimulationDataGenerator()... |
#ifndef WPP__QT__ANDROID_IMAGE_PICKER_H
#define WPP__QT__ANDROID_IMAGE_PICKER_H
#include <QQuickItem>
#include <QAndroidActivityResultReceiver>
namespace wpp {
namespace qt {
class AndroidImagePicker : public QQuickItem, QAndroidActivityResultReceiver
{
Q_OBJECT
Q_PROPERTY(QString imagePath READ imagePath NO... |
//
// SampleSynth.cpp
// DrumConsole
//
// Created by Paolo Simonazzi on 05/01/2016.
//
//
#include "../JuceLibraryCode/JuceHeader.h"
#include "SampleSynth.hpp"
#include "AudioSettings.hpp"
SampleSynth::SampleSynth(const char *filePath) : sampleFile(filePath) {
readerSourceSample = nullptr;
formatM... |
#ifndef SERVER_H_
#define SERVER_H_
#include "AllJoynBase.h"
#include "NativeBusObject.h"
#include "ConnectionListener.h"
//static const char* CHAT_SERVICE_NAME = "org.alljoyn.bus.samples"; // USED TO ADVERTISE THE SERVICE
/**
* Class representing a server Alljoyn
*/
class Server : public AllJoynBase, public ISess... |
#include "Cell.h"
#include "Maze3D.h"
Cell::CellState Cell::getCellState(int x, int y, int z) { return maze.cells[x][y][z].state; };
|
/*
Krishnan
40089054
*/
#include <opencv2/opencv.hpp>
#include<fstream>
#include <utility>
#include <iostream>
#include <limits.h>
#include <string.h>
#include <queue>
#include <stack>
using namespace cv;
using namespace std;
vector<string> colour;
void updateresdiualgraph(vector<vector<pair<int,int> > > &Residua... |
#include <iostream>
#include <string>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <errno.h>
#include <string.h>
#include <cstdlib>
#include <stdio.h>
struct container
{
char senderName[10];
char tag[10];
char body[100];
};
void getName(char* name)
{
std::... |
#include <iostream>
#include <math.h>
#include <string>
using namespace std;
void primeDigit(int N){
int len;
int temp=N;
int i=1;
int h=pow(4,i);
while(temp>h){
temp=temp-h;
h=pow(4,++i);
}
len=i;
char array[4]={'2','3','5','7'};
for(int j=1;j<=len;j++){
int cases=0;
int index=0;
... |
#include<bits/stdc++.h>
using namespace std;
int add(int);
int i=10;
int main(){
int s;
s=add(10);
printf("s=%d\n",s);
s=add(20);
printf("s=%d\n",s);
s=add(100);
printf("s=%d\n",s);
return 0;
}
int add(int x) {
static int total=0;
total+=x;
return total;
}
|
/*
** EPITECH PROJECT, 2019
** tek3
** File description:
** Errors
*/
#ifndef ERRORS_HPP_
#define ERRORS_HPP_
#include <string>
#include <exception>
template<class Error>
void throw_func(
std::string msg,
char const* file,
char const* function,
std::size_t line)
{
throw Error(
std::strin... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef WINDOWS_SHARED_PLUGIN_BITMAP_H
... |
#include <cmath>
#include <vector>
#include <grid/grid.h>
#include <grid/gridSurface.h>
void processSurface(Grid &grid) {
processSurfaceLeft(grid);
processSurfaceRight(grid);
processSurfaceTop(grid);
processSurfaceBottom(grid);
processSurfaceRightX(grid);
processSurfaceRightY(grid);
... |
/*
* Copyright (c) 2017 Ensign Energy Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Ensign Energy Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Ensign Energy Incorpor... |
// Bottle.hpp
#ifndef __BOTTLE_HPP__
#define __BOTTLE_HPP__
const float PI = 3.14;
class Bottle {
private:
float height; // tinggi Bottle
float radius; // radius alas Bottle
float waterHeight; // tinggi isi Bottle
const int id; // nomor urutan Bottle
static int numOfBottl... |
// Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "GlSlider.h"
#include <algorithm>
#include "GlCanvas.h"
#include "PickingManager.h"
const float GlSlider::kGradientFactor = 0.25f;
GlSlider:... |
class Solution {
public:
vector<string> generatePalindromes(string s) {
int n = s.size();
vector<string> result;
map<char, int> mp;
int count = 0;
string half = "";
for(char c: s){
if(mp[c]){
--mp[c];
--count;
... |
/**
* @file integer_divide.cc
* @author Gerbrand De Laender
* @date 17/12/2020
* @version 1.0
*
* @brief E091103, Master thesis, HLS testing
*
* @section DESCRIPTION
*
* IP that allows to do an integer division with remainder on 8-bit numbers.
*
*/
void integer_divide(unsigned char N, unsig... |
#ifndef Core_GUserPlayingData_h
#define Core_GUserPlayingData_h
#include "GGameDefine.h"
class GPlayingData : public GnSmartObject
{
GnDeclareDataStream;
public:
struct ModeInfo
{
bool mEnableMode;
guint32 mModeLevel; // 0 easy, 1 normal, 2 hard
guint32 mLastClearStage;
};
public:
GnSi... |
#pragma once
#include <GameState/GamePlayState.h>
class IGameState;
class GameStateOperation
{
public:
// TODO 強引注意
static GameStateOperation* GetInstance()
{
static GameStateOperation instance;
return &instance;
}
private:
GameStateOperation();
virtual ~GameStateOperation();
public:
... |
#pragma once
#include "EGLService.h"
void EGLService::Initialise(ANativeWindow *window) {
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (display == EGL_NO_DISPLAY) {
print_log(ANDROID_LOG_ERROR, "Renderer::EGLService::Initialise -> cannot open connection to local windowing system");
return;
}
if (eglInit... |
/*
* clinvar.h
*
*/
#ifndef __CLINVAR_H
#define __CLINVAR_H
#include <string>
#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <list>
#include "enfermedad.h"
#include "mutacion.h"
#include <fstream>
#include <queue>
#include <unordered_set>
using namespace std... |
#include "Text.h"
void CText::Create( std::wstring text, std::wstring font , sf::Uint32 dwCharSize, sf::Uint32 dwColor )
{
SetText( text );
SetColor( dwColor );
SetCharSize( dwCharSize );
CreateAPI(font);
}
CText::~CText()
{
}
void CText::SetText( std::wstring strText )
{
m_strText = strText;
}
void CText:... |
//
//namespace SL
//{
// int drawCall = 0;
// sf::Font globalFont;
// sf::Texture errorTexture;
// sf::RenderWindow* windowGlobalDraw;
// // init the window
// void initSLgineDraw(sf::RenderWindow* win);/// initialisation
//
//
//
// void DrawLine(sf::Vector2f p1, sf::Vector2f p2, sf::Color col); /... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2009-2010 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef APPLICATION_CACHE_GROUP_H_
#define APPLICATION_CACHE_GROUP... |
//
// Created by Alan de Freitas on 12/04/2018.
//
#include "island_EA.h"
template<typename problem, typename solution>
std::default_random_engine island_EA<problem, solution>::_generator = std::default_random_engine(
std::chrono::system_clock::now().time_since_epoch().count());
template<typename problem, ty... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 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 SEARCH_ENGINE
#include "modules/se... |
#include<iostream>
using namespace std;
long long modexp(long long a,long long b,long long n)
{long long t=1;
while (b)
{if (b%2) t=t*a%n;
a=a*a%n;
b/=2;
}
return t;
}
int main()
{long long a,b,n;
cin >> a >> b >> n;
cout << modexp(a%n,b,n) << endl;
return 0;
}
|
#pragma once
#include "DBStructs.hh"
#include "Template.hh"
#include <memory>
#include <vector>
namespace HotaSim {
class Ability : public TemplateObject<Ability> {
public:
using TemplateObject::TemplateObject;
std::vector<AbilityEffect> getEffects() const noexcept;
const float getActivationChance() con... |
// Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
//
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.... |
#include <set>
#include <cppunit/extensions/HelperMacros.h>
#include "cppunit/BetterAssert.h"
#include "model/GatewayID.h"
using namespace std;
namespace BeeeOn {
class GatewayIDTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(GatewayIDTest);
CPPUNIT_TEST(testCreate);
CPPUNIT_TEST(testParse);
CPPUNIT_TES... |
#include <iostream>
#include <fstream>
#include <filesystem>
#include "png_toolkit.h"
#include "red_filter.h"
#include "threshold.h"
#include "convolution.h"
std::istream & operator>>( std::istream &is, filter::base::area &ar )
{
is >> ar.top >> ar.left >> ar.bottom >> ar.right;
return is;
}
void brightness( ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 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/m2_ui... |
#ifndef BUILDER_H
#define BUILDER_H
#include<string>
class BuilderProduct;
class Builder {
public:
virtual ~Builder();
virtual void BuildPartA(const std::string &buildPara) = 0;
virtual void BuildPartB(const std::string &buildPara) = 0;
virtual void BuildPartC(const std::string &buildPara) = 0;
virtual BuilderProd... |
#pragma once
#include <vector>
#include <sys/socket.h>
#include <iostream>
#include <arpa/inet.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
#include <string>
#include <stdlib.h>
class UDPSender {
private:
int sockfd;
struct sockaddr_in serv;
public:
UDPSender();
void sendContours(std::vector... |
#pragma once
#include "../defines.h"
#define STRINGIFY(T) const char __STR_##T[] = #T
#define AS_STRING(T) __STR_##T
namespace glmock
{
STRINGIFY(GL_TEXTURE_1D);
STRINGIFY(GL_TEXTURE_2D);
STRINGIFY(GL_TEXTURE_3D);
STRINGIFY(GL_TEXTURE_1D_ARRAY);
STRINGIFY(GL_TEXTURE_2D_ARRAY);
STRINGIFY(GL_TEXTURE_RECTANGLE)... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2011 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef UNISTRING_UTF8_H_
#define UNISTRING_UTF8_H_
#include "module... |
#include "decoder.h"
using namespace trevi;
trevi::Decoder::Decoder()
{
_buffer = std::make_shared<ReorderingBuffer>(64);
}
trevi::Decoder::~Decoder()
{
}
void trevi::Decoder::addStream(int streamId, StreamDecoder *decoder)
{
_decoders.insert( std::make_pair( streamId, decoder ) );
decoder->setParent(... |
#define BLANK -1
//HARDWARE
byte pins[4] = {10,6,5,3}; //KOLEJNOŚĆ POŁĄCZENIA DIGITS
byte segments[7] = {13,12,11,8,7,4,2}; //KOLEJNOŚĆ POŁĄCZENIA SEGMENTÓW
//POMOCNICZE TABELE
//nums_syns -> binarna representacja heksadecymalnych wartości
byte nums_syms[] = {B11111100, B01100000, B11011010, B11110010, B01100... |
#include <bits/stdc++.h>
#include <tuple>
using namespace std;
class Node
{
public:
int val;
int location;
Node *next;
Node()
{
}
Node(int val, Node *next, int location)
{
this->val = val;
this->next = next;
this->location = location;
}
};
// this implimentat... |
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
struct Person{
int hh1, mm1, ss1, hh2, mm2, ss2;
char id[20];
};
bool cmp1(Person a, Person b){
if(a.hh1 != b.hh1) return a.hh1 < b.hh1;
if(a.mm1 != b.mm1) return a.mm1 < b.mm1;
return a.ss1 < b.ss1;
}
... |
#pragma once
class Card
{
public:
Card();
Card(int newValue, int newMast);
~Card();
int getMast();
int getValue();
private:
int value;
int mast;
};
|
/**
* 死人
* siren186@163.com
* 2014-05-13
*
*
* 编译boost步骤(当然bjam再强大,我也不会用,简单就好)
* 1. 运行bootstrap.bat, 生成bjam.exe
* 2. 使用bjam.exe编译生成相应的boost库.例:
* 用法1:
* bjam toolset=msvc-10.0 install ///> 全部安装(版本VC10),会将生成的文件,拷贝至C:\Boost.文件生成在bin.v2下.
* 用法2:
* bjam toolset=msvc-8.0 stage ///> 全部安装(版本VC8),... |
#pragma once
enum class eMaterial
{
NIL = -1,
HYDROGEN,
HELIUM,
AEROGRAPHITE,
AIR,
TUNGSTEN_HEXAFLOURIDE,
STYROFOAM,
CORK,
PINE,
LITHIUM,
WOOD,
ICE,
WATER,
SALT_WATER,
PLASTICS,
MAGNESIUM,
CONCRETE,
DIAMOND,
VANADIUM,
BRASS,
COPPER,
SILVER,
LEAD,
RHODIUM,
MERCURY,
TUNGSTEN,
GOLD,
PLATINUM,
... |
#include <stdio.h>
int main(){
// Q3
// Get an alphabet and print the next alphabet
printf("=====QUESTION 3=====\n");
char p;
int next_p;
printf("Input alphabet: ");
scanf("%c", &p);
next_p = (int)p + 1;
printf("The next alphabet is: %c\n", next_p);
}
|
#include "function_host.h"
#include "function_both.h" /* LOGadd etc */
#include <math.h> /* fabs etc. */
#pragma warning(disable: 4018 4244)
void function_host_init(void) { /* this groups all the initialisation stuff that was floating around the .h file */
//sockets_accept sets newsocket to new sockets id and wait... |
#include "path_publisher.hpp"
#include <tf2_eigen/tf2_eigen.h>
#include <cmath>
#include <boost/algorithm/clamp.hpp>
#include <boost/math/special_functions/sign.hpp>
#include <boost/range/algorithm/min_element.hpp>
namespace path_publisher_ros_tool {
PathPublisher::PathPublisher(ros::NodeHandle nhPublic, ros::NodeHa... |
// KC Text Adventure Framework - (c) Rachel J. Morris, 2012 - 2013. zlib license. Moosader.com
#ifndef _PEOPLE
#define _PEOPLE
#include "../LuaWrappers/PeopleWrapper.h"
#include "Notebook.h"
enum DialogType { TALK, ASK, INTERROGATION, EVIDENCE, END };
class People
{
public:
void Init(lua_State* state, Noteb... |
/*
* Created by Peng Qixiang on 2018/8/9.
*/
/*
* 删除链表中重复的结点
* 在一个排序的链表中,存在重复的结点,请删除该链表中重复的结点,重复的结点不保留,返回链表头指针。
* 例如,链表1->2->3->3->4->4->5 处理后为 1->2->5
*
*/
# include <iostream>
using namespace std;
struct ListNode {
int val;
struct ListNode *next;
ListNode(int x) :
val(x), next(NULL)... |
#include <iterator>
#include <sstream>
#include <string>
#include <vector>
#include <attoparsecpp/parser.hpp>
#include <catch2/catch.hpp>
using namespace apl;
using namespace std::string_literals;
SCENARIO( "Fundamental parsers", "[parser]" ) {
GIVEN( "anyChar" ) {
WHEN( "given an empty string" ) {
... |
#include "serial.h"
#include <bcm2835.h>
Serial::Serial()
{
} |
#include <unsupported/Eigen/Polynomials>
#include <vector>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
typedef Matrix<double,5,1> Vector5d;
Vector5d roots = Vector5d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,6,1> polynomial;
roots_to_mo... |
#ifndef __rlrpg_enchantment_hpp_defined
#define __rlrpg_enchantment_hpp_defined
#include "EquipmentType.hpp"
#include "Attribute.hpp"
#include "Generated.hpp"
#include "QDValue.hpp"
#include <string>
namespace rlrpg
{
/* Types. */
class EnchantmentDesc;
class Enchantment;
/* A descriptor for an enchantment.
St... |
#include <iostream>
#include <cstring>
int n, m, price[20], pref[20];
int c[201];
int sushi() {
int ret = 0;
c[0] = 0;
for (int budget = 1; budget <= m; ++budget) {
int cand = 0;
for (int dish = 0; dish < n; ++dish) {
if (budget >= price[dish])
cand = std::max(cand, c[(budget - price[dish]... |
//知识点:dfs
/*
题目要求:
判断 能否通过立体空间内一些空心球形
从 0高度 处,到达 指定高度处
根据空间内两点的距离公式:
dist(p1,p2) * dist(p1,p2) = (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2);
可知: 如果两圆心之间距离 <= 2*r , 那么两个空心圆有交点.
那么可以 以与0高度水平面相交的球为起点
开始dfs,转移到能连通的,
且所处高度>=当前球形高度的球
如果转移到一个,与指定高度水平面相交的球
那么可以满足条件, 能到达指定高度处
否则不可.
*/
#include<... |
#include "transformgroup.h"
/**
* @brief TransformGroup::TransformGroup, constructeur
* @param x, la coordonnee X
* @param y, la coordonnee Y
* @param z, la coordonnee Z
* @param canRot, dit si l'objet peut tourner
*/
TransformGroup::TransformGroup(double x, double y, double z, bool canRot)
{
p = new Point... |
#include "odb/server/debugger.hh"
#include <algorithm>
#include <cassert>
#include <iostream>
#ifdef ODB_SERVER_DB_LOG
#include <fstream>
#endif
#ifdef ODB_SERVER_DB_LOG
#define CASE_PRINT_ENUM(Enum, Val) \
case Enum::Val: ... |
#ifndef _FINCHSTD_H_
#define _FINCHSTD_H_
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
namespace finchstd
{
int inpInt(const char *);
}
#endif
|
#include<bits/stdc++.h>
using namespace std;
#define maxn 105
int a1[maxn];
int a2[maxn];
int n;
bool f1=true;
bool f2=true;
int main(){
cin>>n;
string s;
cin>>s;
for(int i=0;i<n;i++)
a1[i]=s[i]-'0';
for(int i=n;i<2*n;i++)
a2[i-n]=s[i]-'0';
sort(a1,a1+n);
... |
// -*- C++ -*-
//
// Package: MyTrigger/myTriggerStudies
// Class: HLT1PFJetinMass
//
/**\class HLT1PFJetinMass HLT1PFJetinMass.cc MyTrigger/myTriggerStudies/plugins/HLT1PFJetinMass.cc
Description: HLT Filter. Order Jets in Mass and apply selection.
*/
//
// Original Author: Alejandro Gomez Espinosa
// ... |
//
// Created by 钟奇龙 on 2019-04-15.
//
#include <iostream>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(int x):data(x),next(NULL){
}
};
void printCommonPart(Node *head1,Node *head2){
cout<<"common part is"<<endl;
while(head1 && head2){
if(head1->data == head2->... |
//By SCJ
//#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
bool ha[128],used[128];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n;
while(cin>>n)
{
if(n==-1) break;
memset(used,0,sizeof(used));
memset(ha,0,sizeof(ha));
cout<<"Round "<<n<<endl;
string a,b;cin>>a>>b;... |
#include "../draw.cc"
#include "../mesh.cc"
#include "cp_lib/quaternion.cc"
using namespace cp;
struct Render_Object {
Mesh *mesh;
vec3f *position;
quat *rotation;
};
void wireframe_frag_shader(void* args) {
Fragment_Shader_Handle* handle = (Fragment_Shader_Handle*)args;
float z = handle->itpl_v... |
#pragma once
template<class T>
class TScopedResource
{
private:
public:
T * res = nullptr;
TScopedResource()
{
}
//Moveコンストラクタ。
TScopedResource(TScopedResource&& a) :
res(a.res)
{
a.res = nullptr;
}
//Move代入演算子。
TScopedResource& operator=(TScopedResource&& a)
{
if (this != &a) {
res = a.res;
a.... |
#include<bits/stdc++.h>
using namespace std;
int as[100000], bs[100000];
main()
{
int n, s, t;
while(cin>>n>>s>>t)
{
int i, path=0, prblm=0;
for(i=1; i<=n; i++)cin>>as[i];
bs[s] = 1;
while(1)
{
if(s==t)
{
cout<<path<<endl;
... |
#include "OpenGL/OpenGLPipelineStateManager.h"
#include <glad/glad.h>
#include <fstream>
#include <sstream>
#include <utility>
using namespace Rocket;
PipelineStateManager* Rocket::GetPipelineStateManager() { return new OpenGLPipelineStateManager(); }
using ShaderSourceList = Vec<std::pair<GLenum, String>>;
bool O... |
/*
* Copyright (c) 2016-2021 Morwenn
* SPDX-License-Identifier: MIT
*/
#include <algorithm>
#include <forward_list>
#include <iterator>
#include <vector>
#include <catch2/catch.hpp>
#include <cpp-sort/probes/exc.h>
#include <cpp-sort/utility/size.h>
#include <testing-tools/distributions.h>
#include <testing-tools/in... |
#include "stdafx.h"
#include "MonAIPresetIcons.h"
#include "MonAIPresetIcon.h"
#include "MonAIPresetOpenSuper.h"
#include "../../GameCursor.h"
void MonAIPresetIcons::OnDestroy()
{
for (auto o : m_mapi)
{
DeleteGO(o);
}
DeleteGO(m_back);
DeleteGO(m_dummy);
if (m_Nonefont != nullptr)
DeleteGO(m_Nonefont);
}... |
template <typename T>
inline Matrix<T,3,2>::Matrix() :
data{ Vector<T,2>(1,0), Vector<T,2>(0,1), Vector<T,2>(0,0) }
{
}
template <typename T>
inline Matrix<T,3,2>::Matrix(T m00, T m01, T m10, T m11, T m20, T m21) :
data{ Vector<T,2>(m00,m01), Vector<T,2>(m10,m11), Vector<T,2>(m20,m21) }
{
}
template <typen... |
/* -*-C++-*-
*/
/*
* Copyright 2016 EU Project ASAP 619706.
*
* 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 appl... |
#include "GamePch.h"
#include "UnitShield.h"
uint32_t UnitShield::s_TypeID = hg::ComponentFactory::GetGameComponentID();
void UnitShield::LoadFromXML( tinyxml2::XMLElement* data )
{
m_Color = Color( 0.29f, 0.0f, 0.59f, 1.0f );
data->QueryFloatAttribute( "r", &m_Color.x );
data->QueryFloatAttribute( "g", &m_Color.... |
//import the Servo class to be used to control the Servo
#include <Servo.h>
//constants that indicate the various pin numbers
const int SERVO_PIN = 6;
const int MOTOR_DIRECTION_PIN_1 = 2;
const int MOTOR_DIRECTION_PIN_2 = 4;
const int MOTOR_SPEED_PIN = 5;
//Servo that is used to control the servo to steer the RC car
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* 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.
*/
#include "core/pch.h"
#ifdef APPLICA... |
/*
ID: andonov921
TASK: hamming
LANG: C++
*/
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <algorithm>
#include <sstream>
#include <climits>
#include <fstream>
#include ... |
#include "controlpanel.h"
#include "openglwidget.h"
#include "paintcircle.h"
#include <QApplication>
#include <QLabel>
#include <QLineEdit>
#include <QFileDialog>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QGridLayout>
#include <QDoubleValidator>
#include <QRect>
#include <QDebug>
ControlPanel::ControlP... |
//
// Created by 杨殿生 on 2020/7/30.
//
#ifndef NATIVE_PEOPLE_H
#define NATIVE_PEOPLE_H
#include <string>
class People {
public:
std::string getString();
};
#endif //NATIVE_PEOPLE_H
|
#pragma once
#include "IState.h"
#include "MyGL.h"
#include "TextureAtlas.h"
#include "FreeType.h"
#include <string>
#include <vector>
#include <map>
#include "MenuPositionRenderer.h"
#include "Settings.h"
class MenuState
: public IState
{
public:
static const float Y_SEPARATOR;
static const float Y_OFFSET;
s... |
// Copyright 2018 Benjamin Bader
//
// 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 applicable law or agree... |
//默认构造函数创建一个含有0个元素的vector
#include<vector>
using namespace std;
int main(int argc,char** argv)
{
vector<int> intVector;
return (0);
}
//创建内置类的向量
#include<vector>
#include<string>
using namespace std;
int main(int argc,char** argv)
{
vector<string> stringVector(10,"hello");
return (0);... |
/*
main frame
last modify:2010 10 14
*/
#ifndef _MAIN_FRAME_
#define _MAIN_FRAME_
#include "wx/wx.h"
#include "wx/dateevt.h"
#include "wx/datectrl.h"
#include "wx/config.h"
#include "wx/fileconf.h"
#include "micaps-data.h"
#include <vector>
class PlotPanel;
class MyFrame: public wxFrame
{
public:
//win... |
// MFC_MiniServerAView.cpp : implementation of the CMFCMiniServerAView class
//
#include "pch.h"
#include "framework.h"
// SHARED_HANDLERS can be defined in an ATL project implementing preview, thumbnail
// and search filter handlers and allows sharing of document code with that project.
#ifndef SHARED_HANDLERS
#incl... |
#include <string>
#include <memory>
#include <wrl/client.h>
#include <d3d11on12.h>
#include <d3d12.h>
class D3D11Manager
{
Microsoft::WRL::ComPtr<struct IDXGISwapChain3> m_pSwapChain; // use this swap-chain type
Microsoft::WRL::ComPtr<struct ID3D11Device> m_pDevice;
Microsoft::WRL::ComPtr<ID3D12Device>... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2012 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"
#include "modules/widgets/OpListBox.h"
#in... |
//
// Created by chris on 13/08/2017.
//
#ifndef MINECRAFT_CLONE_GLM_H
#define MINECRAFT_CLONE_GLM_H
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/string_cast.hpp>
/*
* CONSTANTS
*/
const float PI = glm::pi<float>();
const float TWO_PI = 2 * PI;... |
#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Main.hpp>
#include <SFML/Window.hpp>
#include <SFML/Network.hpp>
#include <thread>
#include <future>
//#include <vector>
const unsigned short PORT = 8000;
const std::string IPADDRESS("192.168.1.81");//change to suit your needs
bool server = false;
std::stri... |
//算法:DP/背包
/*
二维费用01背包
有分数维 与 人数维
要满足分数<=总分的一半 , 人数<=总人数的一半
用分数替换价值
*/
#include<cstdio>
#define max(a,b) a>b?a:b
const int MARX = 1e6+10;
//===============================================
int n,ans,sum,a[MARX],f[60][MARX];
//===============================================
signed main()
{
scanf("%d",... |
#include<cstdio>
#include<iostream>
#include<map>
using namespace std;
int n,m,tot;
string a,b;
map <string,bool> s;
int main()
{
scanf("%d%d\n",&n,&m);
if(n==1 && m==1)
{
printf("1");
return 0;
}
for(int i=1;i<=n;i++)
{
getline(cin,a);
s[a]=1;
}
for(int i=1;i<=m;i++)... |
#include "stdio.h"
#include "stdlib.h"
#include "time.h"
// 適合性 : 首の長さ、1リンクあたり10cm
int calc_fitness (int indivisual, int length, int **population);
int main()
{
int **population;
int num;
int length;
int *fitness;
int i,j;
num = 10;
length = 5;
population = new int*[num];
for ( i=0; i<num; i++){
popula... |
//+------------------------------------------------------------------+
//| 4 Levels Agent Commission plugin |
//| Copyright © 2009-2010, Tools For Brokers Inc. |
//| http://www.tools4brokers.com |
//+---------------------------------... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef OPNETWORKSTATUS_H
#define OPNETWORKSTATUS_H
typedef OP_S... |
//
// George O'Neill @ University of York, 2020
//
// This file holds methods for gates
//
#ifndef GATES_H
#define GATES_H
namespace fnt{ // create unique working area
class Gate{ // object for channels
public:
Gate( char c, unsigned long long min, unsigned long long max ){ // default constructor
type = c; // set... |
#pragma once
#include "mamifere.h"
#include <iostream>
using namespace std;
#include <iostream>
std::string Mamifere::specie()
{
return "Corpul lor este acoperit cu par, blana, tepi. Dau nastere la pui vii.\n";
}
|
#include <cppunit/extensions/HelperMacros.h>
#include "cppunit/BetterAssert.h"
#include "model/DeviceDescription.h"
#include <iostream>
using namespace Poco;
using namespace std;
namespace BeeeOn {
class DeviceDescriptionTest : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(DeviceDescriptionTest);
CPPUNIT_TEST... |
/**
* @file UserWidget.cpp
* @brief 用于定义UserWidget类的实现
*/
#include "userwidget.h"
#include "scenewidget.h"
#include "mainwindow.h"
#include "setobjectlayout.h"
#include <qstackedwidget.h>
#include <QTextEdit>
#include <QLabel>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <QVBoxLayout>
#include <... |
#include <fstream>
#include <iostream>
#include <thread>
#include <vector>
#include <iomanip>
#include "omp.h"
// calcule le Nieme terme de la suite de "Fibonacci modulo 42"
// precondition : N >= 0
int FibonacciMod42(int N)
{
int f_curr = 0;
int f_prec = 1;
for (int i=1; i<=N; i++)
{
int tmp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.