text stringlengths 8 6.88M |
|---|
#include <iostream>
#include <string>
#include "queue.hpp"
int main(int argc, char* argv[])
{
std::string usage_str = "usage: problem NUMBER RULE\n\n"
"NUMBER\t the number of children in the game.\n"
"RULE\t the elimination rule\n";
// If the argument pattern isn't good, then print usage
if (argc != 3)... |
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
int min(int a,int b)
{
return (a<b?a:b);
}
int max(int a,int b)
{
return (a>b?a:b);
}
void qsort_first(vector<int>& nums, int l , int r, long long& sum)
{
if (r <= l)
{
return;
}
int tmp;
... |
/*
* Modification.cpp
*
* Created on: 27 mai 2014
* Author: florent
*/
#include "Modification.h"
namespace Calcul {
Modification::Modification(Action* ac, int tDep, int tArr): act(ac), tDepart(tDep), tArrive(tArr) {
// TODO Auto-generated constructor stub
}
Modification::~Modification() {
// TODO Auto... |
#include<bits/stdc++.h>
#include"print.h"
using namespace std;
void bubbleSort()
{
string s;
cout<<"Enter the file name: ";
cin>>s;
ifstream f(s);
int n;
f>>n;
int a[n];
for(int i=0;i<n;i++)
{
f>>a[i];
}
f.close();
bool flag=1,check=1;
for(int j=n-1;flag;j--... |
#include <bits/stdc++.h>
using namespace std;
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 100005
#define INF 0x3f3f3f3f
#define DEVIATION 0.00000005
typedef long long LL;
struct BITree{
long long tree[MAXN+10];
void init(){
memset(tree,0,sizeof(tree));
}
int lowbit(int k){
... |
#include <Poco/Logger.h>
#include "util/HavingThreadPool.h"
using namespace std;
using namespace Poco;
using namespace BeeeOn;
HavingThreadPool::HavingThreadPool():
m_minThreads(1),
m_maxThreads(16),
m_threadIdleTime(5 * Timespan::SECONDS)
{
}
HavingThreadPool::~HavingThreadPool()
{
}
void HavingThreadPool::set... |
#include <iostream>
#include <stdlib.h>
#include "tinyxml2.h"
#include "backend/Day.h"
using namespace tinyxml2;
#ifndef XMLCheckResult
#define XMLCheckResult(a_eResult) if (a_eResult != XML_SUCCESS) { printf("Error: %i\n", a_eResult); return a_eResult; }
#endif
bool checkDate(const char* day = 0, const cha... |
#include "rotate_state_subscriber.h"
CRotateStateSubscriber::CRotateStateSubscriber() :
m_pOnDataAvailable(nullptr)
{
}
CRotateStateSubscriber::~CRotateStateSubscriber()
{
}
bool CRotateStateSubscriber::ValidData()
{
return (m_sampleInfo.valid_data == DDS_BOOLEAN_TRUE);
}
DataTypes::Uuid CRotateStateSubscri... |
#include "Mat3.h"
namespace Move
{
Mat3::Mat3():
m00( 0.0f ), m01( 0.0f ), m02( 0.0f ), m10( 0.0f ), m11( 0.0f ), m12( 0.0f ), m20( 0.0f ), m21( 0.0f ), m22( 0.0f )
{}
Mat3::Mat3(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22):
m00( m00 ), m01( m01 ... |
#include "RoomManager.h"
#include "PacketAccumulator.h"
#include "RelayServer.h"
static const long long TICKRATE = 30;
void RoomManager::createRoom(PacketAccumulator& packetAccumulator, std::array<char, HASH_LENGTH> room) {
const std::lock_guard<std::mutex> roomLock(m_roomMutex);
// clean up dead threads he... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "TestCharacter.h"
#include "Components/SkeletalMeshComponent.h"
#include "GameFramework/Actor.h" //framerworks
#include "Kismet/GameplayStatics.h" //gmaeplaystatics for restarting the game
// Sets default values
ATestCha... |
#pragma once
class SphericalBody {
private:
float m_mass; // In KG
float m_radius; // In KM
public:
SphericalBody(const float mass, const float radius)
: m_mass(mass), m_radius(radius) {}
inline float get_mass() const { return m_mass; }
inline float get_radius() const { return m_radius; }
inline vo... |
#include <iostream>
#include <vector>
using namespace std;
int main(int argc, const char *argv[])
{
vector< int > iv1(10,-1);
vector< int > iv2(3,9);
cout << "Before:" << endl
<< "iv1:" << iv1.size() << endl
<< "iv2:" << iv2.size() << endl;
//iv1 = iv2;
vector< int >::iterator iter1 = iv2.begin();
v... |
#include "texture_data.h"
#define STB_IMAGE_IMPLEMENTATION
#include <stb/stb_image.h>
TextureData::TextureData():
width(0), height(0), channels(0), size(0), pixels(nullptr)
{
}
TextureData::~TextureData()
{
if (pixels)
stbi_image_free(pixels);
}
stbi_uc* TextureData::load(const char* resource, int reqComp)
{
... |
// Sum of digits of Number using recursion
#include <iostream>
using namespace std;
int sum(int n)
{
if(n < 10) return n;
return n % 10 + sum(n/10);
}
int main()
{
int n;
cout<<"Enter a number ";
cin>>n;
cout<<"\nSum of digits ";
cout<<sum(n);
return 0;
}
|
#include "Particle.h"
std::vector < std::shared_ptr <Particle> > Particle::particle;
Particle::Particle(float a, float h, std::string name, float speed)
{
if (name == "BasicEnemy") teksture.loadFromFile("Images/Particles/BasicEnemy.png");
if (name == "EnemyTank") teksture.loadFromFile("Images/Particles/EnemyTank.p... |
#include "field.hh"
#include <iostream>
#include "alpha-beta-ki.hh"
void print_position(pos p) {
std::cout << p.a << " " << p.b << std::endl;
}
void print_move(move m) {
std::cout << "move:" << std::endl;
print_position(m.a);
if(is_valid_pos(m.b))
print_position(m.b);
if(is_valid_pos(m.c))
print_position(m.c... |
#ifndef __UISPRITE_H__
#define __UISPRITE_H__
enum UIIMAGE { UI_BOTTOM, UI_ENDBACK, UI_ENDBOX,
UI_YES_NORMAL, UI_YES_OVER, UI_YES_CLICK,
UI_NO_NORMAL, UI_NO_OVER, UI_NO_CLICK,
UI_MAX };
class UISprite
{
D3DXVECTOR3 m_vPos;
D3DXVECTOR3 m_vRot;
D3DXVECTOR3 m_vScale;
D3DXMATRIX ... |
#include <iostream>
#include <forward_list>
#include <vector>
using namespace std;
/*
* Runs O(n)
*
*/
void partition(forward_list<int>& flist, int value) {
forward_list<int>::iterator prev {};
auto current = flist.begin();
bool seen_greater_than_or_equal_value = false;
while (current != flist.e... |
#include <iostream>
#include <iterator>
using namespace std;
inline void _swap(int& num1, int& num2)
{
int temp;
temp = num1;
num1 = num2;
num2 = temp;
}
void InsertionSort(int* (&arr), int size)
{
int index;
for (int i = 1; i < size; i++)
{
index = i;
for (int j = i; j >= 0; j--)
{
... |
#ifndef MYINPUTPANELCONTEXT_H
#define MYINPUTPANELCONTEXT_H
#include <QtGui/QInputContext>
class MyInputPanelContext : public QInputContext
{
Q_OBJECT
public:
MyInputPanelContext();
~MyInputPanelContext();
bool filterEvent(const QEvent* event);
QString identifierName();
QString langua... |
#define COMPILATION_FAILED (-1)
RandomState rng;
Asset compile_progam(const char *file)
{
const char *source = read_entire_file(file);
if (!source)
{
Asset asset;
asset.shader.program = COMPILATION_FAILED;
return asset;
}
const char *preamble = "#version 130\n";
#define NUM_SHADER_PARTS 3
const char *vert... |
/* -*- 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.
*
* @author Arjan van Leeuwen (arjanl)
*/
#include "core/pch.h"
#... |
/*
* Main.cpp
*
* Created on: 2021. 6. 9.
* Author: dhjeong
*/
#include "test/source.cpp"
#include <vector>
#include <string>
int main(void) {
test test;
test.run();
std::vector<std::string> strList;
strList.push_back("test");
for (int i=0; i<strList.size(); i++) {
}
}
|
#include <iostream>
typedef long long ll;
using namespace std;
ll n, q, k, a[100000], first, second, firstEnd, secondEnd, temp;
bool alwaysK;
string Q;
void findLongestTwo()
{
ll end = n, j, current;
first = second = current = 0;
if (a[n - 1] == 1 && a[0] == 1)
for (j = n - 1; j >= 0; j--)
... |
#ifndef WORLD_H
#define WORLD_H
#include "nbt.h"
#include "chunk.h"
#include "types.h"
#include <unordered_map>
class World {
protected:
std::unordered_map<int32, std::unordered_map<int32, Chunk> > chunks;
public:
World(std::string file);
World();
World(nbttag w);
};
#endif |
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <cstdlib>
#include <vector>
#include <iterator>
#include <algorithm>
std::vector<std::string> split(std::string toSplit, const char delimiter)
{
std::stringstream ss(toSplit);
std::string token;
std::vector<std::string>... |
/*!
* \file transition.h
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Header file for transition function
*/
#ifndef TRANSITION_H_
#define TRANSITION_H_
#include "./mpre.h"
#include "./mpost.h"
#include "./state.h"
#include "./memorymodel.h"
#include "./con... |
#include "ip_filter.h"
#include <gtest/gtest.h>
#include <vector>
#include <random>
#include <limits>
TEST(split_string, without_TAB) {
// Arrange
std::string str{""};
// Act
std::vector<std::string> keeper = split(str);
// Assert
ASSERT_EQ(keeper.size(), 1);
}
TEST(split_string, one_TAB)... |
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* I... |
#include "stdafx.h"
#include "level.h"
level::level()
{
}
level::~level()
{
}
HRESULT level::init(void)
{
return E_NOTIMPL;
}
void level::release(void)
{
}
void level::renderFloor(void)
{
}
void level::renderWall(void)
{
}
|
#include "dds_uuid.h"
#include "sim_drill_objective_publisher.h"
CSimDrillObjectivePublisher::CSimDrillObjectivePublisher()
{
}
CSimDrillObjectivePublisher::~CSimDrillObjectivePublisher()
{
}
bool CSimDrillObjectivePublisher::Initialize()
{
CDdsUuid uuid;
uuid.GenerateUuid();
uuid.ExportUuid(m_pDataInst... |
#include "AbstractBaseController.h"
#include <QDebug>
#include <QFile>
namespace wpp
{
namespace qt
{
AbstractBaseController::AbstractBaseController()
: waitingRequestCount(0)
{
if ( !childControllers.empty() )
{
for ( QList<QObject *>::const_iterator it = childControllers.constBegin();
it != childControll... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ShrubberyCreationForm.hpp :+: :+: :+: ... |
/*
* service.cpp
* Copyright: 2018 Shanghai Yikun Electrical Engineering Co,Ltd
*/
#include "yikun_common/service/service.h"
#include <tf/tf.h>
#include <memory>
#include <nav_msgs/Odometry.h>
namespace yikun_common {
Service::Service(ros::NodeHandle &nh)
: nh_(nh),started_(false),global_frame_id_("map"),base_... |
// DisplayDeviceFinger.h: interface for the DisplayDeviceFinger class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DISPLAYDEVICEFINGER_H__2023312B_2262_4CED_92C0_3CF406645864__INCLUDED_)
#define AFX_DISPLAYDEVICEFINGER_H__2023312B_2262_4CED_92C0_3CF406645864__INCLUDE... |
/*!
* @author Nicholas Kidd
*/
#include "wali/Common.hpp"
#include "wali/DefaultWorklist.hpp"
#include "wali/wfa/WFA.hpp"
#include "wali/wfa/State.hpp"
#include "wali/wfa/TransFunctor.hpp"
#include "wali/wfa/Trans.hpp"
#include "wali/wfa/WeightMaker.hpp"
#include "wali/regex/AllRegex.hpp"
#include "wali/wpds/GenKeyS... |
/// \file NiCfConstants.hh
/// \brief Definition of constants.
#ifndef NiCfConstants_h
#define NiCfConstants_h 1
#include "globals.hh"
constexpr G4int kDensityNiO = 6.67; // in g/cm3
#endif
|
#pragma once
#include <vector>
#include "AAModel.h"
#include "AACamera.h"
class AAScene
{
public:
AAScene();
~AAScene();
const AACamera* getAciveCamera() const;
const std::vector<AAModel*> getModels() const;
virtual void update() = 0;
protected:
AACamera* camera;
std::vector<AAModel*> objects;
};
|
//信号量
#include <xr_util.h>
namespace xr
{
struct semaphore_t
{
sem_t sem;
int init()
{
if (0 != sem_init(&this->sem, 0, 0))
{
perror("semaphore initialization failed");
return FAIL;
}
return SUCC;
}
inline void wait()
{
::sem_wait... |
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <math.h>
#include<cmath>
#include "mclmcr.h"
#include<complex>
#include <cuComplex.h>
#include<stdlib.h>
#include <stdio.h>
#include <iostream>
#include <windows.h>
//#include<complex.h>
using namespace std;
//cudaError_t theta_calculate_WithCu... |
//: C10:Statinit.cpp
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
// Zasieg inicjatora skladowej statycznej
#include <iostream>
using namespace std;
int x = 100;
class WithStatic {
sta... |
#include "stdafx.h"
#include "SecondStage.h"
#include "Random.h"
#include "ThirdStage.h"
#include "GameManager.h"
SecondStage::SecondStage() : damageTimer(0, .25f), wispNum(10)
{
background = new ZeroSprite("Resource/UI/Background/background.png");
ui = new UIManager();
for (int i = 0; i < 10; i++)
{
Wisp* wi... |
#ifndef __SERENDEROBJECT_H__
#define __SERENDEROBJECT_H__
#include "SEMath.h"
class SERenderService;
template <class T> class SERenderServiceInternals;
struct SEROType
{
typedef enum {MODEL_RO, PRIMITIVE_RO, CAMERA_RO, LIGHT_RO, FONT_RO, NUM_ROS} tRenderObject;
};
template <class T> class SERenderObject
{
fri... |
#pragma once
#include "GameObject.h"
#include "OBJLoader.h"
#include <xnamath.h>
class Car
{
private:
XMFLOAT3 pos;
public:
int number;
GameObject wheelFrontLeft;
GameObject wheelFrontRight;
GameObject wheelBackLeft;
GameObject wheelBackRight;
GameObject carBody;
ID3D11ShaderResourceView* g_wheelText... |
// Created on: 1993-01-09
// Created by: CKY / Contract Toubro-Larsen ( TCD )
// 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
/... |
#include "global.h"
void emit(int t, int tval) {
switch(t) {
case '+': case '-': case '*': case '/':
printf("%c\n", t); break;
case DIV:
printf("DIV\n"); break;
case MOD:
printf("MOD\n"); break;
case NUM:
printf("%d\n", tval); break;
case ID:
printf("%s\n", symtable[tval].lexptr); break;
... |
/* Big Easy Driver motor controller firmware. Input a runtime and watch her go!
By Mike Bardwell based on code from Toni Klopfenstein and Tom Igoe
Successfull tested up to 100 seconds of runtime
*/
String inString = ""; // string to hold input
long timer, runtime; // Motor hold time variables
//Declare motor pi... |
#ifndef JUGADOR_H
#define JUGADOR_H
#include "Padre.h"
#include "Plataforma.h"
#include "PlataformaInvisible.h"
#include "Enemigo.h"
#include "Bomba.h"
class Jugador : public Padre
{
public:
int xvel, yvel, xacc, yacc, xCamara, yCamara, cVel, cVel2, score;
bool suelo, saltando, colD, moviendo, game... |
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2011.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/conv... |
/**
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: Tiffany Huang
*/
#include "particle_filter.h"
#include <math.h>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <random>
#include <string>
#include <vector>
#include "helper_functions.h"
using std::string;... |
// Created on: 1995-12-01
// Created by: EXPRESS->CDL V0.2 Translator
// Copyright (c) 1995-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 te... |
/* -*- Mode: c++; tab-width: 4; 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.
*/
#include "core/pch.h"
#ifdef INTERNAL_SPELLCHECK_SUPPORT
#ifndef SPC_USE_HUNSPELL_ENG... |
#ifndef ANDROIDPERMISSIONS_H
#define ANDROIDPERMISSIONS_H
#include <QObject>
#include <QtAndroid>
class AndroidPermissions : public QObject
{
Q_OBJECT
public:
explicit AndroidPermissions(QObject *parent = nullptr);
// Q_INVOKABLE bool requestAndroidPermissions();
Q_INVOKABLE void requestAndroidPe... |
using namespace std;
class Encryptor{
private:
string cylines; //Cyphered Data
string password; //Password
int N; //Number of Characters Encrypted (Times Looped)
int TAP; //Total ASCII Password
int OAL; //Original ASCII Letter
int ACL; //Algorithm ... |
#include <iberbar/RHI/D3D9/Texture.h>
#include <iberbar/RHI/D3D9/Device.h>
iberbar::RHI::D3D9::CTexture::CTexture( CDevice* pDevice )
: ITexture()
, m_pDevice( pDevice )
, m_pD3DTexture( nullptr )
{
m_pDevice->AddRef();
}
iberbar::RHI::D3D9::CTexture::~CTexture()
{
D3D_SAFE_RELEASE( m_pD3DTexture );
UNKNOWN_S... |
#include "filtreEnter.h"
FiltreEnter::FiltreEnter()
{
}
FiltreEnter::~FiltreEnter()
{
}
bool FiltreEnter::eventFilter( QObject * inObj, QEvent * inEvent )
{
if ( inEvent->type() == QEvent::KeyPress )
{
QKeyEvent * keyEvent = static_cast<QKeyEvent *>( inEvent );
if ( keyEvent->key() == Qt::Key_Re... |
/*
* 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.
*/
#pragma once
#include <folly/io/SocketOptionMap.h>
#include <folly/net/NetOps.h>
#include <quic/common/QuicAsyncUDPSocketWrapper... |
#ifndef GRAPHICS_H
#define GRAPHICS_H
namespace gg
{
class Graphics
{
public:
Graphics(int width, int height);
~Graphics();
void clear(float r, float g, float b) const;
static int screenWidth;
static int screenHeight;
static float aspectRatio;
private:
void init();
};
}
#endif |
/*=================================================================================================
Author: Renato Farias (renatomdf@gmail.com)
Created on: April 13th, 2012
Updated on: June 12th, 2012
About: This is a simple CPU implementation of the Jump Flooding algorithm from the paper "Jump
Flooding in GPU With App... |
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <memory.h>
#include <math.h>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#include <numeric>
#include <sstream>
typ... |
#pragma once
#include <string>
#include "Inconstructible.h"
#include "Vector.h"
#include "VirtualMethod.h"
#include "WeaponInfo.h"
struct ClientClass;
class Matrix3x4;
enum class WeaponId : short;
enum class WeaponType;
class Collideable {
public:
INCONSTRUCTIBLE(Collideable)
VIRTUAL_METHOD(const Vector&, ... |
#include <random>
#include <vector>
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
constexpr int N_repeat = 100000;
constexpr int N_play_max = 10000;
ofstream file("count.txt");
if (!file.is_open())
{
cout << "open file failed" << endl;
return -... |
#include<bits/stdc++.h>
using namespace std;
int random_number()
{
return rand()%100+1;
}
int people_guess(int x)
{
int n;
cout<<"Enter your number: ";
cin>>n;
if(n<x)
{
cout<<"Your number is small"<<endl;
}
else if(n>x)
{
cout<<"Your number is big"<<endl;
}
... |
#include <bits/stdc++.h>
using namespace std;
bool op(char c);
int result(int a, int b, char c);
int main()
{
stack<int>pilha;
stack<char>opera;
int ret, cont, ff;
string s;
while(getline(cin, s))
{
cont = ff = ret = 0;
for(int i=0;i<s.size();i++)
{
if(s[i]!='... |
/*
Copyright (c) 2016, Los Alamos National Security, LLC
All rights reserved.
Copyright 2016. Los Alamos National Security, LLC. This software was produced under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National Laboratory (LANL), which is operated by Los Alamos National Security, LLC for the ... |
#include <iostream>
#include <numeric>
using namespace std;
int main() {
int b, k;
cin >> b >> k;
int a[k];
for (int i = 0; i < k; ++i) cin >> a[i];
if (b & 1) {
cout << (accumulate(a, a + k, 0) & 1 ? "odd" : "even") << endl;
} else {
cout << (a[k - 1] & 1 ? "odd" : "even") <... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2007 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"
#include "modules/encodings/encoders/utf1... |
#define BOOST_SP_DISABLE_THREADS
#include <iostream>
#include <iomanip>
#include <dax/Types.h>
#include "Point3D.h"
#include "tests/RandomPoints3D.h"
#include "PointLocator.h"
// main
int main(void)
{
// first generate a bunch of random points
RandomPoints3D random;
random.setExtent(0, 3, 0, 3, 0, 3);
... |
#include"conio.h"
#include"stdio.h"
void main(void)
{
int a,b;
clrscr();
for(a=3; a<=19; a+=3)
printf("%d ",a);
getch();
} |
#include <iostream>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <fstream>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <climits>
#include <stack>
#include <map>
#include <set>
using namespace std;
int const MAXN = 4100;
int... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* Copyright (C) Opera Software ASA 2002 - 2006
*
* Code analyzer.
*
* @author Jens Lindstrom
*/
#ifndef ES_ANALYZER_H
#define ES_ANALYZER_H
#include "modules/ecmascript/carakan/src/compiler/es_code.h"
c... |
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmEnableLanguageCommand.h"
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
bool cmEnableLanguageCommand(std::vector<std::string> const& args,
... |
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2012-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/stri... |
/**
* Project: ows-qt-console
* File name: main_window.cpp
* Description: this source file describes the program's main window
*
* @author Mathieu Grzybek on 2012-04-30
* @copyright 2012 Mathieu Grzybek. All rights reserved.
* @version $Id: code-gpl-license.txt,v 1.2 2004/05/04 13:19:30 garry Exp $
*
* @see Th... |
# The Tizen .spec assumes that Emacs is not installed and therefore
# the lisp files don't get installed. When emacs is installed on the
# host, the .spec derived build rules fail. To remove the host
# environment dependency, disable the check for emacs as done before
# in http://patchwork.openembedded.org/patch/40467/... |
// HelpDialog.cpp : implementation file
//
#include "stdafx.h"
#include "Pinger.h"
#include "HelpDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// HelpDialog dialog
HelpDialog::H... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2006 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"
#include "InfoPanel.h"
#include "adjunct/... |
#pragma once
#include "Nodes/UnaryOperations/UnaryOperationNode.hpp"
#include "Utils/NotNull.hpp"
#include <memory>
template<class Type>
struct IUnaryOperationNodesFactory
{
virtual std::unique_ptr<UnaryOperationNode<Type>> create(NotNull<ComputationNode<Type>> input) = 0;
};
|
#include <simplecpp>
Polygon::Polygon(Composite* owner)
: Sprite(canvas_width()/2, canvas_height()/2, owner){
init(NULL, 0);
}
Polygon::Polygon(const double x, const double y, const double points[][2],
int no, Composite *owner)
: Sprite(x,y,owner){
init(points,no);
}
void Polygon::reset(const double x, c... |
class Solution {
public:
bool isPalindrome(int x) {
vector <int> v;
int res=0;
if( x == 0) return true;
while(x) {
res = x%10;
x = x/10;
if ( res < 0) return false;
else {
v.push_back(res);
}
// co... |
/*
Name: С�״����
Copyright:
Author: Hill bamboo
Date: 2019-08-19 16:14
Description: С�״����
�ܽ
��������
1. �ù��������Ż�ʱ��ûŪ�������˳����Ϊ��j���������㣬��������ˣ�
Ӧ���Ǵ�����ǰ�㣬������ֵ�Ų��ᱻ����
2. dp���ij�ʼ��
*/
#include <bits/stdc++.h>
using namespace std;
const int maxn = 200 + 10;
const int maxm = 1e5 + 10;
bool... |
#pragma once
#include <iberbar/RHI/D3D9/Headers.h>
#include <iberbar/RHI/ShaderReflection.h>
namespace iberbar
{
namespace RHI
{
namespace D3D9
{
class CShaderReflectionBuffer;
class CShaderReflectionVariable;
class CShaderReflectionType;
class CShaderReflection;
class CShaderReflectionMember;
... |
#pragma once
#include <iostream>
#include "Employee.h"
using namespace std;
class PartTimeEmployee : public Employee
{
private:
double payRate,hoursWorked;
public:
// Default Constructor
PartTimeEmployee() : Employee() {
payRate = 0.0;
hoursWorked = 0.0;
}
// Constructor
PartTimeEmployee(... |
#include "../InfoRetrival.h"
int main(){
InfoRetrival ir = InfoRetrival();
std::string ip = "45.101.33.45";
std::cout << "calculating geographical location of ip: " << ip << std::endl;
std::string result = ir.getCountry(ip);
std::cout << "In the end, got " << result;
}
|
#ifndef KATAKANA_H
#define KATAKANA_H
#include "mot.h"
class Katakana : public Mot
{
public:
Katakana( const string & inHiraKata, const string & inRoumaji );
virtual ~Katakana();
};
#endif
|
#include "../head/QRCodeDrawer.h"
QRCodeDrawer::QRCodeDrawer() {
outer_frame_width = 100;//外层宽边框
frame_wid = 10;//内层细边框
currentX = frame_wid+ outer_frame_width;
currentY = frame_wid+ outer_frame_width;//二维码内容区起始处为内外边框之和
rect_len = 10;//二维码单位长方形边长为10像素
code_col = 64;
code_row = 64;//二维码为64行64列
data_index = 0;//初... |
//*-- Author :
//////////////////////////////////////////////////////////////////////////
//
// THcScintillatorPlane
//
//////////////////////////////////////////////////////////////////////////
#include "THcScintillatorPlane.h"
ClassImp(THcScintillatorPlane)
//______________________________________________________... |
#ifndef RX_THREAD_H
#define RX_THREAD_H
#include <QtCore>
class Rx_thread : public QThread
{
Q_OBJECT
public:
explicit Rx_thread(QObject *parent = 0);
protected:
void run();
void timerEvent(QTimerEvent *);
signals:
void Rx_flag(QString);
void Motion_stop();
public slots:
private:
int m_id;
... |
/**************************************************************************/
/*!
@file MQ135.h
@author G.Krocker (Mad Frog Labs)
@license GNU GPLv3
First version of an Arduino Library for the MQ135 gas sensor
TODO: Review the correction factor calculation. This currently relies on
the datasheet but the informat... |
// Created on: 1997-10-29
// Created by: Roman BORISOV
// 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 GNU ... |
// Copyright (c) 2019 The NavCoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "daopage.h"
#include "timedata.h"
DaoPage::DaoPage(const PlatformStyle *platformStyle, QWidget *parent) :
QWidget(p... |
/******************************************************
mqtt based networking
*****************************************************/
#pragma once
namespace Qwerty
{
//sub listener used by Qwerty::Listener
class SubActionListener : public virtual mqtt::iaction_listener
{
public:
SubActionListener(const std::... |
#include <iostream>
using namespace std;
int main()
{
int n,arr[40],count=0,x;
cin>>n>>x;
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
for(int i=0;i<n;i++)
{
if(x==arr[i])
{
count++;
}
}
cout<<"The count is:"<<count<<endl;
return 0;
}
|
#ifndef _MODESHIPVSTOWER_
#define _MODESHIPVSTOWER_
#include "GamePlayDemo.h"
//#include "TypeDef.h"
//#define theModeShipVsTower ModeShipVSTower::getInstance()
class ModeShipVSTower : public GamePlayDemo
{
protected:
// time to survive
float m_fTimeToSurvive;
// time before defeat... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "SYCharacter.h"
#include "GameFramework/PlayerController.h"
#include "SYPlayerController.generated.h"
/**
*
*/
UCLASS()
class SYCHARACTER_API ASYPlayerController : public APlayerController
{
GENERAT... |
#include "base.hpp"
#include <iostream>
/* hello */
Base::Base() {
std::cout << "Base constructed" << std::endl;
}
|
#include "AnalyticSolver.h"
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
using namespace std;
void AnalyticSolver::analyticSolution(matrix &m, int iterations)
{
double x = 0.0;
double y = 0.0;
double x_step = 1.0 / (m.getNumberOfColumns() - 1);
double y_step = 1.0 / (m.... |
#include "mypushbutton.h"
#include<QPushButton>
#include <QDebug>
#include <QPropertyAnimation>
MyPushButton::MyPushButton(QString normalImg, QString pressImg)
{
normalImgPath = normalImg;
pressedImgPath = pressImg;
QPixmap pixmap;
bool ret = pixmap.load(normalImgPath);
if(!ret)
{
qDebu... |
#include <cstdio>
#include <queue>
#define rep(x,n) for(x=n;x<13;x++)
using namespace std;
bool judge(int a[]){
queue<int> q;
q.push(a[0]);
int c=0,find[20]={0};
for(int i=0;i<5;i++){
find[a[i]]=1;
}
if(a[0]==3&&a[1]==6&&a[2]==7&&a[3]==8&&a[4]==11){
printf("test\n");
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.