text stringlengths 8 6.88M |
|---|
#pragma once
#using <mscorlib.dll>
#include "llvm/ADT/ArrayRef.h"
#include <msclr/marshal.h>
#include <msclr/marshal_cppstd.h>
#include <string>
class utils
{
public:
inline static System::String ^manage_str(std::string str)
{
return msclr::interop::marshal_as<System::String ^>(str);
}
template <typename T>
inl... |
#include <iostream>
#include <string>
using std::string;
using std::cout; using std::endl;
int main()
{
string s("some string");
cout << s << endl;
decltype(s.size()) index = s.size();
while(index-- > 0) {
// auto &c = s[index];
// c = 'S';
s[index] = 'S';
}
cout << s... |
/*
* @lc app=leetcode.cn id=442 lang=cpp
*
* [442] 数组中重复的数据
*/
// @lc code=start
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
vector<int> findDuplicates(vector<int>& nums) {
int n = nums.size();
vector<int> ans;
for(int i=0;i<... |
#ifndef _ROUTINGTABLE_
#define _ROUTINGTABLE_
#include <map>
#include <string>
#include <vector>
#include <set>
#include <iostream>
typedef std::string routerId; // "ip_addr"
typedef std::pair<routerId, double> linkWeight; // ("src", "weight")
typedef std::map<routerId, linkWeight> costTable; //... |
#pragma once
#include <queue>
#define TRACEFILE "trace0.txt"
using namespace std;
typedef struct reservationEntry_ {
bool busy;
string op;
int vj;
int vk;
int qj;
int qk;
int state;
} reservationEntry;
class Tomasulo
{
public:
Tomasulo(int addsub_delay,
int mul_delay,
int div_delay,
int instruction_q_... |
#include "p2Defs.h"
#include "p2Log.h"
#include "j1App.h"
#include "j1Render.h"
#include "j1Textures.h"
#include "j1Map.h"
#include <math.h>
j1Map::j1Map() : j1Module(), map_loaded(false)
{
name.create("map");
}
// Destructor
j1Map::~j1Map()
{}
// Called before render is available
bool j1Map::Awake(pugi::xml_node& ... |
/**
* NOM FICHIER: main.cpp
* DESCRIPTION : Ce main permet de compter le nombre de mot
* contenu dans un fichier texte
*
* Auteur : J. Monnier
* Date: 13/01/2019
*/
#include <iostream>
#include <fstream>
#include <string.h>
#include <sstream>
#i... |
#include <iostream>
#include "Base.h"
class Square : public Base{
protected:
Base* value1;
public:
Square();
Square(Base*);
double evaluate();
};
|
#pragma once
#include "..\Defs.h"
#pragma once
class Cook
{
int ID;
ORD_TYPE type; //for each order type there is a corresponding type (VIP, Normal, Vegan)
int speed; //dishes it can prepare in one clock tick (in one timestep)
public:
Cook();
Cook(char, int);
virtual ~Cook();
int GetID() const;
ORD_TYPE G... |
#pragma once
namespace leaves { namespace pipeline
{
// input layout
class input_layout
{
public:
struct attribute
{
data_format format;
data_semantic semantic;
uint16_t offset;
};
static constexpr size_t attribute_count = 8;
using attribute_container = std::vector<attribute>;
public:
i... |
#pragma once
#include <vector>
#include "../constants.h"
using namespace std;
//Structure to hold vertex position and its number
struct Vertex{
Point p;
uint num;
};
//MVC's model class for incapsulating content of one slide
class DrawField
{
public:
DrawField();
~DrawField();
/*Getters*/
const vector... |
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void) {
ifstream cipher("Cipher.txt"); //open input stream
vector<char> values; //create
string word; //empty string to compare txt length to
while (cipher >> word) { //grab a word from the cipher, if succe... |
#include <stdio.h>
#define p printf
main()
{
int x[100],y[100];
int m=0;
p("Input the Domain and Range (numbers only)\n");
p("enter 3 pairs only\n");
for(int c = 0; c < 3; c++)
{
p("Enter Domain %d\t:\t",(1)+m++);
scanf("%d",&x[c]);
p("Enter Range %d\t:\t",m);
scanf("%d",&y[c]);
... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
#include "trains.h"
#include "ui_trains.h"
#include<QFile>
#include<QTextStream.h>
#include<QMessageBox>
#include<QStringList>
#include<QDesktopServices>
#include<QUrl>
#include<rone.h>
trains::trains(QWidget *parent) :
QDialog(parent),
ui(new Ui::trains)
{
ui->setupUi(this);
//QPixmap pix... |
#include <assert.h>
#include <math.h>
#include <algorithm>
#include <climits>
#include <functional>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
using namespace std;
const int mod = 1e9 + 7;
int x;
s... |
#include<stdio.h>
int a,b,c,s=0;
main()
{
scanf("%d %d %d",&a,&b,&c);
s=a+b+c;
printf("%d",s);
}
|
#include<string>
#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
int main(){
string a;
char ch;
while(cin >> a){
cin >> ch;
int count = -1;
int len;
len = a.length();
for(int i = 0; i < len; i ++){
if(a[i]==ch){
count=i + 1;
printf("%d ",count);
}
}
... |
#pragma once
#include <QOpenGLWidget>
#include <QOpenGLFunctions>
#include <QGLShaderProgram>
#include <mutex>
#include "IVideoCall.h"
struct AVFrame;
class XVideoWidget : public QOpenGLWidget, protected QOpenGLFunctions, public IVideoCall
{
Q_OBJECT
public:
XVideoWidget(QWidget *parent);
~XVideoWidget();
virtual ... |
#include <iostream>
#include "UndirectedGraph.hpp"
int main() {
int numberOfTestCases;
std::cin >> numberOfTestCases;
for (int j = 0; j < numberOfTestCases; j++) {
int numberOfVertices;
int numberOfEdges;
std::cin >> numberOfVertices >> numberOfEdges;
cs202::Undi... |
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Portions of this file are from JUCE.
Copyright (c) 2013 - Raw Material Software Ltd.
Please visi... |
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
**
** Copyright (C) 2006-2007 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** @author Haavard Molland haavardm@op... |
#include <iostream>
#include <vector>
using namespace std;
int main() {
int x,len=0;
vector<int> a;
cin>>x;
while(x != -1){
a.push_back(x);
len++;
cin>>x;
}
int i=1;
int start=0;
while(i<len){
if(a[i]<=a[i-1])start=i;
if(len<i-start+1)len=i-start+1;
i++;
}
... |
void setup() {
Serial.begin(31250);
}
void loop() {
Serial.write(0x9D); // Note On (14) + Channel
Serial.write(69); // Pitch
Serial.write(64); // Velocity
delay(1000);
Serial.write(0x9C); // Note On (13) + Channel
Serial.write(69); // Pitch
Serial.write(64); // Velocity
delay(1000);
}
|
#pragma once
#include "cuda_runtime.h"
#include <exception>
#include <string>
class nbody_exception : public std::exception
{
private:
std::string message;
cudaError_t cuda_error;
public:
nbody_exception(std::string message);
nbody_exception(std::string message, cudaError_t cuda_error);
~nbody_exception() throw... |
#include "CubeSixFaces.h"
#include <glm\gtx\transform.hpp>
#include <iostream>
CubeSixFaces::CubeSixFaces(void)
{
}
CubeSixFaces::~CubeSixFaces(void)
{
}
void CubeSixFaces::Initialize()
{
mSquare = Model();
//f
mSquare.VertexData.push_back(glm::vec3(-1.0f, -1.0f, 0.0f));
mSquare.VertexData.push_back(glm::vec... |
#pragma once
#include "utils/ptts.hpp"
#include "proto/config_arena.pb.h"
using namespace std;
namespace pc = proto::config;
namespace nora {
namespace config {
using arena_npc_pool_ptts = ptts<pc::arena_npc_pool>;
arena_npc_pool_ptts& arena_npc_pool_ptts_instance();
... |
#include <vector>
#include <cmath>
#include <vector>
#include "armadillo"
#include <iostream>
#include "../atom/vect3.h"
#include "unitcell.h"
using namespace std;
using namespace arma;
namespace moldycat
{
//Initialise unit cell object from specified arguments calculating transformation matrix and inver... |
#include "helloworld/hello-world.hpp"
#include <cmakepublic/cmake_public.hpp>
std::string say_goodbye() {
int val = call_cmake_public();
std::string str = std::to_string(val);
return (std::string("Goodbye from CMake Public! ") + str);
}
std::string say_hello() { return std::string("Hello, CMake s... |
#pragma once
#include <GL/glew.h>
#include <vector>
#include <glm/glm.hpp>
#include "FPSCamera.h"
#include "PostProcesser.h"
#include "Scene.h"
#include "Shader.h"
class StaticRenderer {
public:
StaticRenderer(float gamma);
virtual ~StaticRenderer();
void render(std::map<Model, std::vector<Entity*>> &ent... |
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
typedef struct {
string name;
string type;
int initialized;
i... |
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
int k;
cin>>k;
string s;
cin>>s;
int i=0,j=0,maxLength=1;
int counta=0,countb=0;
char ch;
for(int l=0;l<s.length();l++)
{
if(s[l]=='a')
counta++;
else
countb++;
}
if(counta>=countb)
ch='a';
else ch='b';
while(i<=j && j<s.leng... |
//
// ECE3090 Program 1 - Complex Number Class decaration
// Jonathan Tuck
//
// Class declaration for Complex number class
// ECE3090 Lab 1
#include <iostream>
#include <string>
class Complex {
public:
// Define your constructors here
// Constructors
Complex();
Complex(double,double);
Complex... |
/*
* @lc app=leetcode.cn id=7 lang=cpp
*
* [7] 整数反转
*/
// @lc code=start
#include<iostream>
#include<algorithm>
#include<cmath>
#include<queue>
#include<climits>
using namespace std;
class Solution {
public:
int reverse(int x) {
int rev = 0;
while(x!=0){
int pop = x % 10;
... |
#include "LinkList.h"
template<class Any>
EngineLib::LinkedList<Any>::LinkedList() {
head = new Node<Any>;
tail = new Node<Any>;
head->data = NULL;
head->next = tail;
head->prior = NULL;
tail->data = NULL;
tail->prior = head;
tail->next = NULL;
length = 0;
}
template<class Any>
EngineLib::LinkedList<Any>::~... |
#ifndef __NETWORK_REPLY_HANDLER_H__
#define __NETWORK_REPLY_HANDLER_H__
#include <QObject>
#include <QNetworkReply>
class NetworkReplyHandler : public QObject {
Q_OBJECT
public:
explicit NetworkReplyHandler(QNetworkReply* reply);
protected:
QNetworkReply* reply;
protected slots:
virtual void replyFinish... |
// syntax tree node definitions
namespace ast
{
// ...
struct deduced_variable_declaration
{
bool mut;
identifier variable;
expression initial_value;
};
typedef boost::variant<
deduced_variable_declaration,
explicit_variable_declaration,
expression
> block_member;
}
// define convers... |
#pragma once
#include <string>
/* Convert a HiROM address to a file address */
#define ROM2F(x) (x - 0xC00000)
/* Convert a file address to a HiROM address */
#define F2ROM(x) (x + 0xC00000)
class Buffer
{
public:
Buffer(bool growable);
~Buffer();
bool Alloc(DWORD size);
bool Grow(DWOR... |
#ifndef CIRCLE_H
#define CIRCLE_H
#include "figure.h"
class Circle : public Figure
{
Q_OBJECT
public:
Circle(QObject *parent = 0);
~Circle();
private:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
};
#endif // CIRCLE_H
|
#ifndef HERA_AUCTION_RESULT_H
#define HERA_AUCTION_RESULT_H
#include <unordered_map>
#include <cmath>
#include <ostream>
#include <hera/common.h>
namespace hera {
template<class Real = double>
struct AuctionResult {
Real cost {0}; // cost of the final matching
Real distance {0}; ... |
// SimpleGraphic Engine
// (c) David Gowor, 2014
//
// Core Config Header
//
// ==========
// Interfaces
// ==========
// Core Config
class core_IConfig {
public:
static core_IConfig* GetHandle(sys_IMain* sysHnd);
static void FreeHandle(core_IConfig* hnd);
virtual bool LoadConfig(const char* cfgN... |
#ifndef _SOLUTION_
#define _SOLUTION_
#include <fstream>
#include <iostream>
#include <assert.h>
class Solution
{
double y;
double * x;
int multiplicity;
int lastSet;
public:
Solution(double X, double Y, int Multiplicity): y(Y), multiplicity(Multiplicity)
{
if(multiplicity >= 1)
x =... |
// 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.... |
#ifndef GDEFINES
#define GDEFINES
/*!
File: GDefines.h
Purpose: Lists the core #defines and MACROS used by the Gateware interfaces.
Author: Lari H. Norri
Contributors: N/A
Last Modified: 9/14/2016
Copyright: 7thGate Software LLC.
License: MIT
*/
//! The core namespace to which all Gateware interfaces must belo... |
// 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 <gtest/gtest.h>
#include <filesystem>
#include "OrbitBase/Logging.h"
#include "Path.h"
#include "absl/strings/match.h"
TEST(Path, FileExistsE... |
/* -*- 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 VEGA_BACKEND_BLOCKLIST_H
#define VEGA_BACKEND_BLOCKLIS... |
#include<iostream>
#include<complex>
#include <boost/concept_check.hpp>
template <typename T>
class BinarySearchTree {
BOOST_CLASS_REQUIRE(T, boost, LessThanComparableConcept);
private:
bool has_less();
public:
void insert(T value, T parent){
if(value < parent){
std::cout << ... |
#include "landscapecollision.hpp"
#include "vectorutil.hpp"
std::vector<LandscapeCollision> checkLandscapeCollisions(const std::vector<Position>& positions, const std::vector<CollisionBox>& collisionBoxes, const CollisionMap& collisionMap)
{
std::vector<LandscapeCollision> result;
for(const auto& collisionBox... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
using namespace std;
int main(int argc, char **argv)
{
vector<int> i1;
vector<int> i2;
int randValue;
// create a vector with 10 random elements
for (int i=0; i < 10; i++) {
randValue = rand() % 100;
i1.push_back(randValu... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2002 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Alexander Remen (alexr)
*/
#include "core/pch.h"
#ifdef M2_SUP... |
#include "stdafx.h"
#include "EthernetFrame.h"
EthernetFrame::EthernetFrame(void)
{
memset(m_destination_address, 0, 6);
memset(m_source_address, 0, 6);
m_ether_type = 0;
m_mac_data = NULL;
}
EthernetFrame::EthernetFrame(BYTE* DestAddress, BYTE* SourceAddress, WORD EtherType)
{
memcpy(m_destination_address, Dest... |
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <limits>
template<typename IntType>
void printResult(const std::string& label, const IntType t)
{
std::cout << "\t" << label.c_str() << ": " << std::setw(12) << t << std::endl;
}
int main()
{
std::cout << "Divide by zero" << std::endl;
std::uint32... |
////#include <stdio.h>
////#include <iostream>
////#include <opencv2/opencv.hpp>
////#include <opencv2/features2d/features2d.hpp>
////#include <opencv2/nonfree/nonfree.hpp>
////#include <opencv2/legacy/legacy.hpp>
////#include <opencv2/core/core.hpp>
////#include <opencv2/features2d/features2d.hpp>
////#include <opencv... |
#pragma once
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#ifdef CREATEDLL_EXPORTS
#define MYDLL_DECLSPEC __declspec(dllexport)
#else
#define MYDLL_DECLSPEC __declspec(dllimport)
#endif
using namespace std;
extern "C" MYDLL_DECLSPEC void string_split(string a);
|
#pragma once
#include "TypeMapper.hh"
#include "Utils.hh"
#include <memory>
#include <string>
namespace HotaSim {
class DBManager;
struct Template {
virtual ~Template() = default;
const DBManager* dbmgr{ nullptr };
TmplId id{ -1 };
std::string name{ "" };
};
template<class T>
class TemplateObject {
... |
#include <iostream>
#include <vector>
#include <set>
/*
* Using a set instead of a vector, eliminates duplciates
* but increases insert time
*
*/
using namespace std;
template <typename T>
void power_set(const set<T>& st, set<set<T>>& result) {
result.insert(st);
if (st.size()) {
for (auto& val... |
/**
* Menyu system -
*
*
*
*/
#include <Arduino.h>
// LiquidCrystal library
#include <LiquidCrystal.h>
// Library for using single pin analog button for 5 LCD buttons
// include the AnalogMultiButton library
#include <AnalogMultiButton.h>
// Include the EEPROM library
#include <EEPROM.h>
// Menu system specifics... |
#include<iostream>
#include<conio.h>
using namespace std;
class base
{
public :
void out()
{
cout<<"base ";
}
};
class deri{
public :
void out()
{
cout<<"deri ";
}
};
int main()
{ deri dp[3];
base *bp = (base*)dp;
for (int i=0; i<3;i++)
(bp++)->out();
getch();
}
|
#ifndef KTipView_DEFINED
#define KTipView_DEFINED
#include "KViewGroup.h"
#include "KTextDrawable.h"
#include "KImageDrawable.h"
#include "KColorDrawable.h"
#include "KTextMultiLineDrawable.h"
#include "sigslot.h"
#define NO_HIDE_MENU 400
class KTipBase : public KViewGroup
{
public:
KTipBase();
virtual ~KTipBase(... |
/*
src/malloc.h -- Asynchronous memory allocation system + cache
Copyright (c) 2020 Wenzel Jakob <wenzel.jakob@epfl.ch>
All rights reserved. Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
*/
#pragma once
#include <enoki-jit/jit.h>
#include "hash.h"
... |
#pragma once
#include <stdint.h>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include "RedisClient.h"
namespace tinyredis
{
struct SRedisParam
{
std::string m_strIp;
uint16_t m_uPort16;
std::string m_strPass;
uint32_t m_uMiniSeconds;
SRedisParam(const std::string& strIp, uint1... |
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <set>
#include <stack>
#include <cstdio>
#include <cstring>
#include <climits>
#include <cstdlib>
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* Copyright (C) Opera Software ASA 2002 - 2006
*
* Bytecode compiler for ECMAScript -- overview, common data and functions
*
* @author Jens Lindstrom
*/
#ifndef ES_STATEMENTS_H
#define ES_STATEMENTS_H
#... |
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <iomanip>
using namespace std;
int main() {
int N, M, C, Q;
while (cin >> N >> M >> C >> Q) {
vector<int> v;
int t;
int* res = new int[C + 1];
for (int i = 0; i < C; i++) {
cin >> t;
v.push_back(t);
... |
// Green House Monitoring and Control Arduino with Ethernet Combination
#include "SPI.h"
#include "Ethernet.h"
#include "Servo.h"
#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht (DHTPIN, DHTTYPE);
byte mac[] = { 0xD4, 0x28, 0xB2, 0xFF, 0xA0, 0xA1};
IPAddress ip(192,168,0,190);
IPAddress gateway... |
#include "ConfigStructs.h"
void to_json(json& j, const Color& o, const Color& dummy)
{
WRITE("Color", color)
WRITE("Rainbow", rainbow)
WRITE("Rainbow Speed", rainbowSpeed)
}
void to_json(json& j, const ColorToggle& o, const ColorToggle& dummy)
{
to_json(j, static_cast<const Color&>(o), dummy);
WRI... |
/*
* Copyright [2017] <Bonn-Rhein-Sieg University>
*
* Author: Torsten Jandt
*
*/
#pragma once
#include <mir_planner_executor/actions/move/base_move_action.h>
class MockupMoveAction : public BaseMoveAction {
protected:
virtual bool run(std::string& robot, std::string& from, std::string& to);
... |
/*
filename: timestamp.h
author: Sherri Harms
last modified: 8/8/01
description: Class time_stamp interface file for serial episodes.
Values of this type is a list of events
Used in computing serial episodes and closures
A single serial moitem is a composite of several timestamps. That is, within a serial
m... |
#include <iostream>
#include <cstring>
using namespace std;
char* concat(const char* s1, const char* s2)
{
int len = strlen(s1) + strlen(s2);
char* s = new char[len+1];
strncpy(s,s1,strlen(s1)+1);
strcat(s,s2);
return s;
}
int main()
{
const char* s1 = "Hello ";
const... |
#include"convert2gray.hpp"
Gray::Gray(ros::NodeHandle n,ros::NodeHandle priv_nh):
R(0.5)
{
map_pub = n.advertise<nav_msgs::OccupancyGrid>("/image2map",100);
priv_nh.getParam("/input_image",input_path);
priv_nh.getParam("/min_num",min);
priv_nh.getParam("/max_num",max);
input_image = cv::imread("/home/amsl/Pic... |
#include "..\SDK\PluginSDK.h"
PluginSetup("ggTristana");
void loadMenu();
void loadSkills();
void combo();
void harass();
void laneclear();
void killsteal();
void draw();
void drawCircle(ISpell2 * spell);
PLUGIN_API void OnLoad(IPluginSDK * sdk);
PLUGIN_API void OnUnload();
PLUGIN_EVENT(void) onUpdate();
PLUGIN_EVEN... |
/** \file motor.cpp
\brief
*/
/*
* (C) 2013 Uwe Lippmann
*
* 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 your
* option) any later version.
*
* T... |
#include "EnemyTank.h"
#include "PowerUp.h"
EnemyTank::EnemyTank(float x, float y, int level, int id)
: BasicEnemy(id)
{
this->level = level;
switch (level)
{
case 1: hp = 10; leftWingHp = 3; rightWingHp = 3; break;
case 2: hp = 20; leftWingHp = 6; rightWingHp = 6; break;
case 3: hp = 30; leftWingHp = 9; rightW... |
void setupAHRS(){
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
Wire.begin();
Wire.setClock(400000);
//TWBR = 24; // 400kHz I2C clock (200kHz if CPU is 8MHz). Comment this line if having compilation difficulties with TWBR.
#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
Fastwire::setup(400, true);
#endi... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2005 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 SVG_DOM
#include "modules/dom/s... |
#include<cstdio>
#include<cstring>
using namespace std;
struct line
{
int be,af,we;
int ne;
}a[200011];
int head[200011];
bool vis[200011];
int dis[200011];
int num,flag=1;
void add(int bee,int aff,int wee)
{
a[++num].ne=head[bee];
a[num].be=bee;
a[num].af=aff;
a[num].we=wee;
head[bee]=num;
}
... |
// *********************** Aho-Corasik algorithm ***********************
const int maxa = 53;
const int maxn = (3 << 16);
struct node {
int end, suff, next[maxa];
} nodes[maxn];
int cnt, root;
int q[maxn];
int new_node() {
memset(nodes + cnt, -1, sizeof(node));
return cnt++;
}
vector<int> same_words[1 << 10];
void... |
class CfgMagazines
{
//External references
class CA_Magazine;
class HandGrenade;
class CA_LauncherMagazine;
//Weapon magazines
#include "Magazines\Magazines.hpp"
//Attachments
#include "Attachments\Attachments.hpp"
//Consumables: food, drinks, fish, meat, harvestable food, garlic
#include "Consumables\... |
#include "Stack.h"
#include <iostream>
using namespace std;
int main(){
Stack s;
Stack s2;
//cout << "The number of nodes is:" << Node::nodeCount << "\n";
s.push(1);
s.printStack();
s.push(2);
s.printStack();
s.push(3);
s.printStack();
s.push(4);
s.printStack();
s.push(5... |
#include "GlyphAtlas.h"
#include "Device.h"
#include "EverydayTools/Exception/CallAndRethrow.h"
#include "Keng/Graphics/Resource/ITexture.h"
#include "Keng/Graphics/Resource/Font/GlyphParameters.h"
#include "Keng/GraphicsCommon/DeviceTextureParameters.h"
#include "Keng/ResourceSystem/IResource.h"
#include "Keng/Resourc... |
#ifndef _INVENTORY_
#define _INVENTORY_
#include <iostream>
using std::string;
using std::ostream;
/*
* This class represents an Invetory of a shop
* Inventory holds
* -the name of an item
* -the price and
* -how much is left in stock
*/
class Inventory
{
private:
string m_name;
float m_price;
... |
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*-
*
* Copyright (C) 1995-2005 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef XPSCAN_H
#define XPSCAN_H
#include "modules/xpath/src/xpdefs.h"
... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
//
// $Id$
//
// Copyright (C) 1995-2000 Opera Software AS. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
//
// -------------------------------------------------... |
//====================================================================================
// @Title: ATTRIBUTES
//------------------------------------------------------------------------------------
// @Location: /game/rpg/include/cAttributesDef.h
// @Author: Kevin Chen
// @Rights: Copyright(c) 2011 Vi... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "PowerableObject.h"
#include "PoweredLight.generated.h"
/**
*
*/
UCLASS()
class HYPOXIA_API APoweredLight : public APowerableObject
{
GENERATED_BODY()
protected:
UPROPERTY(VisibleAnywhere)
UPointLightComponen... |
#include "util.h"
namespace Browser
{
std::string Util::get_register_api_message_name()
{
static std::string name("ra");
return name;
}
std::string Util::get_reject_promise_message_name()
{
static std::string name("rejp");
return name;
}
std::string Util::get_resolve_promise_message_name()
{
stati... |
#include "RPCServer.hpp"
#include "r2/src/common.hh"
using namespace r2;
// __thread struct timeval startt, endd;
RPCServer::RPCServer(int _cqSize) : cqSize(_cqSize) {
mm = 0;
UnlockWait = false;
conf = new Configuration();
mem = new MemoryManager(mm, conf->getServerCount(), 2);
mm = mem->getDmfsBaseAddre... |
#ifndef library_h
#define library_h
#include <string>
#include <ostream>
using namespace std;
class library {
public:
string author;
string category;
string status;
int num_pag;
library(string _author = "", string _category = "", string _status = "", int _num_pag = 0) {
author = _author;
category = _categor... |
#include <iostream>
#include <vector>
#include <list>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <map>
#include <string>
#include <cstdio>
#include <cstring>
using namespace std;
int main() {
int n, m;
while (cin >> n >> m) {
vector<vector<int> > v;
v.resize(n+1);
vector<int> lea... |
#ifndef FUNCPROCESS_H
#define FUNCPROCESS_H
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/shared_ptr.hpp>
#include <QObject>
#include <qwidget.h>
#include <scenewidget.h>
#include "State.h"
#include "setobjectlayout.h"
#include "computional.h"
///几个manager
#include "abstractman... |
#pragma once
template<typename T>
class Singleton {
public:
static T* Instance() {
if (!instance_) {
instance_ = new T;
}
return instance_;
}
static void Destroy() {
if (instance_) {
delete instance_;
}
}
protected:
Singleton() {}
private:
static T* instance_;
};
template<typename T> T* Sing... |
#include "opennwa/Nwa.hpp"
#include "opennwa/query/internals.hpp"
namespace opennwa
{
namespace query
{
typedef details::TransitionStorage Trans;
typedef Trans::CallIterator CallIterator;
typedef Trans::InternalIterator InternalIterator;
typedef Trans::ReturnIterator ReturnIterator;
typedef ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
**
** Copyright (C) 2004 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Morten Stenshorne
**
*/
/* This is the ... |
/*
* ServerManager.cpp
*
* Created on: Jun 29, 2017
* Author: root
*/
#include "ServerManager.h"
#include "./Log/Logger.h"
#include "SqlInterface/MysqlInterface.h"
#include "MessageStruct/ServerReturnInt.pb.h"
#include "MessageBuild.h"
ServerConHandler *ServerConHandler::m_instance = 0;
ServerConHandler::S... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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.
*/
#ifndef DOWNLOAD_EXTENSION_BAR_H
#define DOWNLOAD_EXTENSION_BAR_H
... |
#ifndef __Cell_h__
#define __Cell_h__
class Picture;
class Cell {
public:
enum CellState { uninitialized, passage, forbidden } state;
// state = uninitialized: This cell has not been visited yet.
// state = passage: This cell has been carved out; it is "passageway".
// state = forbidden: true iff this c... |
#pragma once
#include "tools\CToolCursor.h"
#include "tools/CGenericTool.h"
#include "queue"
using namespace std;
using namespace chai3d;
class cToolDelayCursor :
public cGenericTool
{
public:
cToolDelayCursor(cWorld* a_parentWorld);
~cToolDelayCursor();
//double* m_forceArray[MAX_DELAY_FRAME];
//unsigned m_f... |
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
int main() {
ll n;
cin >> n;
int ten = 10;
int x = n;
int a;
int sum = 0;
while (x > 0) {
a = x % ten;
sum += a;
x /= 10;
}
if (!(n%sum)) cout << "Yes" << endl;
else cout << "No" << endl;
}
|
#include<stdio.h>
#include<conio.h>
void reverse(char *string) {
char * end = string;
char *str = string;
char tmp;
if (str) {
while (*end) {
++end;
}
--end;
//printf("%s",end);
while (str < end) {
tmp = *str;
*str++ = *end;
*end-- = tmp;
}
puts(string);
}
}
int main()
{int a;... |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "10473"
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
int main(int argc, char const *argv[])
{
#ifdef DBG
freopen("uva" PROBLEM TESTC ".in", "r", stdin);
freopen("uva" PROBLEM ".out", "w", stdout);
#endif
string str;... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.