text stringlengths 8 6.88M |
|---|
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#include "vehiculecontroller.h"
|
/*
* SPDX-FileCopyrightText: (C) 2013-2022 Daniel Nicoletti <dantti12@gmail.com>
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef CLEARSILVER_P_H
#define CLEARSILVER_P_H
#include "clearsilver.h"
#include "view_p.h"
#include <ClearSilver/ClearSilver.h>
namespace Cutelyst {
class ClearSilverPrivate : public View... |
// graphic.cpp - graphic support
// (c) 1997 Michael Fink
#include "graphic.h"
#include <mem.h>
#include <assert.h>
graphic::graphic()
{
start = (byte far*)(0xa000 << 16);
xres = 320;
yres = 200;
is_on = false;
}
graphic::~graphic()
{
if (is_on)
off();
}
void graphic::on()
{
asm {
mov ax, 0x13;
... |
#include "Global.h"
#include "LZ78C.h"
#include "LZ78D.h"
#include "LZWC.h"
#include "LZWD.h"
#include "LZ77C.h"
#include "LZ77D.h"
struct Config {
string inputFile;
string outputFile;
string mode;
int level;
int wb, wl;
string algo;
int originalFileSize;
} config;
struct option options[] =
{
{"input", requir... |
#include "window.h"
namespace graphics
{
void* CreateWindow(const uint16_t width, const uint16_t height, const std::string title)
{
if(!glfwInit())
return nullptr;
GLFWwindow* window = glfwCreateWindow(width, height, title.c_str(), nullptr, nullptr);
if(!window)
return nullptr;
glfwMa... |
#include <iostream>
class Stos
{
public:
Stos(){
top = NULL;
}
~Stos()
{
while(top!=NULL) {
Elem* stary=top;
top=top->poprz;
delete stary;
}
}
void push(int e)
{
Elem* nowy=new Elem;
nowy->dane=e;
nowy->poprz=top;
top=nowy;
}
virtual int pop()
{
i... |
/********************************************************************************
** Form generated from reading UI file 'Widget.ui'
**
** Created by: Qt User Interface Compiler version 5.8.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************... |
#pragma once
#include <iostream>
class Token
{
public:
enum class Type {
Number,
Operator
};
Token(Type type, const char value);
Token(Type type, const std::string value);
friend std::ostream& operator<<(std::ostream& stream, const Token& token);
friend std::ostream& operator<<(std::ostream& stream, const Ty... |
//Copyright 2015-2016 Tomas Mikalauskas. All rights reserved.
#include <stdafx.h>
#include <TywLib\math\GLXMath.h>
#include <TywLib\geometry\JointTransform.h>
#include <TywLib\geometry\VertData.h>
#include <TywLib\utilities\templates.h>
#include <TywLib\utilities\EngineVariables.h>
#include <TywLib\utilities\EngineStri... |
#pragma once
#include <fstream>
#include <memory>
#include <xmorphy/tag/PhemTag.h>
#include <xmorphy/utils/Misc.h>
#include <xmorphy/utils/UniString.h>
#include <xmorphy/build/BuildDefs.h>
namespace X
{
class PhemDict
{
private:
InnerPhemDictPtr dict;
InnerCounterPhemDictPtr fdict;
InnerCounterPhemDictPtr b... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "total_main.h"
#include "QMessageBox"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
socket = new QTcpSocket(this);
connect(socket,SIGNAL(readyRead()),this,SLOT(sockReady(... |
/*
Name : Toroid Calculator
Author: Ben Rockhold
Date: 02/20/15
Description: Calculate the volume and surface area for each toroid in a given set.
*/
#include <iostream>
#include <math.h>
using namespace std;
// Function accepts r,R for a torus, and returns its volume
float torus_volume(float r,float R){
ret... |
class Solution {
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
int len1 = nums1.size(), len2 = nums2.size();
// Make sure n1 <= n2
if (len1 > len2) return findMedianSortedArrays(nums2, nums1);
// find the indx at nums1 and nums2 that the val... |
// Adjaceent Matrix
// Used only when the n and m values are small
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
int adj[n+1][n+1];
for(int i=0;i<m;i++){
int u,v;
cin>>u>>v;
adj[u][v]=1;
adj[v][u]=1;
}
return 0;
} |
// $Id: postfix_writer.h,v 1.5 2016/03/18 13:03:56 ist169481 Exp $ -*- c++ -*-
#ifndef __ZU_SEMANTICS_PF_WRITER_H__
#define __ZU_SEMANTICS_PF_WRITER_H__
#include <string>
#include <vector>
#include <iostream>
#include <cdk/symbol_table.h>
#include <cdk/ast/binary_expression_node.h>
#include <cdk/emitters/basic_postfix... |
#include<iostream>
#include<cstdlib>
#include<limits.h>
using namespace std;
int random(int min,int max){
return rand()%(max-min+1)+min;
}
int min(int a,int b){
return a<b?a:b;
}
void randerizar(int **M,int r,int c){
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
M[i][j]=random(0,min(r*c,INT_MAX));
}... |
// 476. Number Complement
// Given a positive integer num, output its complement number. The complement strategy is to flip the bits of its binary representation.
// Example 1:
// Input: num = 5
// Output: 2
// Explanation: The binary representation of 5 is 101 (no leading zero bits), and its complement is 010. So ... |
#include "explicit_solver.h"
#include "crank-nicholson_solver.h"
#include "exact_solver.h"
#include "laasonen_simple_implicit_solver.h"
#include <iostream>
#include <vector>
ExplicitSolver::ExplicitSolver() { firstStepSolver = &defaultFirstStepSolver; };
void ExplicitSolver::solveRegularMeshes(
double pdeltaX, do... |
// meshdict.h
//
////////////////////////////////////////////////////////////////////////
#if !defined(__MESHDICT_H)
#define __MESHDICT_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "..\fwlib\factory.h"
#include "..\fwlib\fwunknown.h"
#include "meshplus.h"
#include <map>
#inclu... |
#include <conio.h>
#include <iostream>
#include <locale.h>
#include <queue>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
// Bibliotecas exclusicas para o calcuro de temperatura.
#define ZEROABSC -273.15
#define ZEROABSF -459.67
// Todas as funções tilizadas
void Cursor... |
//
// Created by nickolay on 26.11.2020.
//
#ifndef HUAWEIROUTER_ASYNCVAR_H
#define HUAWEIROUTER_ASYNCVAR_H
#include <mutex>
template <typename T>
class AsyncVar {
public:
AsyncVar(){
targetVar = T();
};
AsyncVar(T t){
targetVar = t;
};
T get(){
T result;
mutex.lo... |
#include <iostream>
#include <memory>
#include "subclass_registry.hpp"
/* Base Class */
class Base {
public:
virtual void impl_me() = 0;
virtual ~Base() = default;
};
/* Subclasses */
class Subclass1 : public SubclassRegistrar<Base, Subclass1> {
public:
Subclass1() { /* CANNOT be `= default` */ }
void impl_... |
#include "system/pr2_eih_system.h"
const int T = TIMESTEPS;
inline double uniform(double low, double high) {
return (high - low)*(rand() / double(RAND_MAX)) + low;
}
void init_obstacles_and_objects(pr2_sim::Camera& cam,
std::vector<geometry3d::Triangle>& obstacles, std::vector<Gaussian3d>& obj_gaussians) {
Matri... |
/*
* CartesianPlane.cpp
*
* Created on: Mar 23, 2012
* Author: wjones
*/
#include "CartesianPlaneUtilities.h"
namespace CoordinateComponents
{
template<typename T>
CartesianPlaneUtilities<T>::CartesianPlaneUtilities()
{
}
template<typename T>
CartesianPlaneUtilities<T>::~CartesianPlaneUtilities()
{
}
... |
#include "arduinoFFT.h"
#define SAMPLES 1024 //Must be a power of 2
#define SAMPLING_FREQUENCY 50000 //Hz
#define REFRESH_RATE 10 //Hz
#define ARDUINO_IDE_PLOTTER_SIZE 500
arduinoFFT FFT = arduinoFFT();
unsigned long sampling_period_us;
unsigned long useconds_sampling;
unsigned long refresh... |
#pragma once
#include "base/printable.h"
#include "base/vec/vec3.h"
#include <cstdint>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <vector>
#include <string>
namespace ant {
/**
* @brief The Detector_t struct is the minimal base class for all detectors
*/
struct Detector_t : printable_... |
#pragma once
//FocusVisitor.h
#ifndef _FOCUSVISITOR_H
#define _FOCUSVISITOR_H
#include "Visitor.h"
class CDC;
class CPaintDC;
class CRect;
class FocusVisitor :public Visitor {
public:
FocusVisitor(CDC *dc = 0, CRect *rect = 0);
FocusVisitor(const FocusVisitor& source);
virtual ~FocusVisitor();
FocusVisitor& oper... |
#pragma once
#include <functional>
#include <memory>
#include <tudocomp/io.hpp>
#include <tudocomp/Algorithm.hpp>
#include <tudocomp/Decompressor.hpp>
namespace tdc {
/// \brief Base for data compressors.
class Compressor: public Algorithm {
public:
static inline constexpr TypeDesc type_desc() {
return ... |
#include <fstream>
#include <iostream>
#include <boost/format.hpp>
#include "externals.h"
#include "typedValue.h"
#include "stack.h"
#include "word.h"
#include "context.h"
#ifdef _WIN32
#include <Windows.h>
#else
#include <dlfcn.h>
#endif
void InitDict_IO() {
Install(new Word(".",WORD_FUNC {
if(inContext.DS.si... |
#include "Game.h"
#ifdef __linux__
//linux code goes here
#include <SDL2/SDL_image.h>
#elif _WIN32
//windows code goes here
#include <SDL_image.h>
#endif
#include <stdio.h>
#include "TextureManager.h"
#include "InputHandler.h"
#include "GameObjectFactory.h"
#include "MainMenuState.h"
#include "PlayState.h"
#... |
#pragma once
#include "Hitable.h"
#include "AABB.h"
class bvh_node : public hitable
{
public:
bvh_node();
bvh_node(hitable** l, int n, float time0, float time1);
virtual bool hit(const ray& r, float & tmin, float & tmax, hit_record& rec) const override;
bool bounding_box(float t0, float t1, aabb& box) const ove... |
/*
* SPDX-FileCopyrightText: (C) 2015-2022 Daniel Nicoletti <dantti12@gmail.com>
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef VIEWJSON_P_H
#define VIEWJSON_P_H
#include "view_p.h"
#include "viewemail.h"
#include <SimpleMail/mimepart.h>
#include <SimpleMail/sender.h>
#include <SimpleMail/server.h>
#include <... |
#include "hash.hpp"
using namespace std;
int main()
{
hashTable tavola(30);
for (size_t i = 0; i < 5000; i++)
{
tavola.hashInsert(i);
}
tavola.displayHash();
} |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.UI.ApplicationSettings.2.h"
WINRT_EXPORT namespace winrt {
namespace Windows::UI::ApplicationSettings {
template <typename H> struct impl_CredentialCommandCredentialDeleted... |
#pragma once
#include <string>
#include <vector>
class Path {
public:
static const char *separator;
static const char *dotdot;
static const char *dot;
explicit Path(std::string pathname);
Path(Path const &root, std::string const &pathname);
Path();
struct Stat {
ino_t inum; ... |
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup() {
int i;
//ofSetFullscreen(true);
for (i = 0; i < NUM; i++) {
b[i].init(i);
}
}
//--------------------------------------------------------------
void ofApp::update() {
for (int i = 0; i < NUM; i++) {
b[... |
#include "pool.h"
World* World::instance = nullptr;
std::vector<vec2> World::Data;
std::vector<std::thread> World::Threads;
std::vector<std::pair<std::function<void(vec2)>, vec2>> World::Jobs;
std::mutex World::Mutex;
std::atomic<bool> World::Run = true;
void World::StartThreads()
{
for (int i = 0; i < 5; i++) {
T... |
#include "ProcessFactory.h"
ProcessFactory::ProcessFactory()
{
}
void ProcessFactory::createNewProcess()
{
BullyProcess* newThread = new BullyProcess();
MessageRouter::getInstance()->attach(newThread);
newThread->start();
}
|
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
int N,W,H,M,V;
vector <pii> matrix[505];
vector <pii> graph[505];
int dist[505];
void dijkstra(int s, int out);
int main ()
{
char ch;
cin >> N;
cin >> W;
cin >> H;
V = N*N;
map <char,int> m;
for (int i ... |
#include "Juice.h"
#include <iostream>
void Juice::drink()
{
std::cout << "[Juice] drink() Called" << std::endl;
}
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkRenderTimerLog.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software ... |
//
// Created by glumes on 2021/2/24.
//
#include <VKDeviceManager.h>
#include "VKBufferManager.h"
#include <VKDefine.h>
#include <CommonUtils.h>
void VKBufferManager::createBuffer(VKDeviceManager * deviceInfo, VkDeviceSize size, VkBufferUsageFlags usage,
VkMemoryPropertyFlags prope... |
//
// Created by 梁栋 on 2019-04-28.
//
#include <vector>
#include <iostream>
#include <algorithm>
#include <unordered_map>
using namespace std;
class Solution {
public:
void subsetsBase(vector<int>& nums, vector<vector<int>>& res, int s, vector<int>& cur){
int last_index = -1;
for(int i=s;i<nums.size... |
#include <iostream>
#include "Hoge.hpp"
namespace Hoge {
Hoge::Hoge(): value(0) {}
Hoge::Hoge(char ch): value(ch) {}
void Hoge::huga(){ value++; }
}
/*
//usage
int main() {
Hoge::Hoge h1(1);
std::cout << 0 << std::endl;
std::cout << (int)h1.value << std::endl;
h1.huga();
std::cout << (int)h1.value << s... |
// DialogOsziOptions.cpp: Implementierungsdatei
//
#include "stdafx.h"
#include "Application\DigitalSimulatorApp.h"
#include "Application\i18n\ResourceTranslater.h"
#include "Application\Configuration\ParameterManager.h"
#include "Application\Dialogs\ColorSpaceDialog/ColorPickerDlg.h"
#include "DialogOsziO... |
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package
#include <gtest/gtest.h>
#include "data/pybind_manager.h"
#include "proto/detail/exception.h"
namespace jactorio::data
{
class PybindManagerTest : public testing::Test
{
protected:
void SetUp() ove... |
// Copyright 2020-2021 Russ 'trdwll' Treadwell <trdwll.com>. All Rights Reserved.
#pragma once
#include "Core/SteamGameServerStats.h"
#include "SteamBridgeUtils.h"
USteamGameServerStats::USteamGameServerStats()
{
OnGSStatsReceivedCallback.Register(this, &USteamGameServerStats::OnGSStatsReceived);
OnGSStatsStoredC... |
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include "sqlite_functions.h"
#include "detect_circle.h"
#include "sort_functions.h"
#include "remove_background.h"
#define NAME "Computer Vision"
void gaussian(int, void *);
void median(int, void *);
void tr... |
//
// state_test.h
// design_pattern
//
// Created by jack on 14-8-10.
// Copyright (c) 2014年 jack. All rights reserved.
//
#ifndef __design_pattern__state_test__
#define __design_pattern__state_test__
#include <iostream>
#include "state.h"
#endif /* defined(__design_pattern__state_test__) */
|
#pragma once
//ShiftHomeKey.h
#ifndef _SHIFTHOMEKEY_H
#define _SHIFTHOMEKEY_H
#include "KeyAction.h"
class ShiftHomeKey :public KeyAction {
public:
ShiftHomeKey(Form *form = 0);
ShiftHomeKey(const ShiftHomeKey& source);
~ShiftHomeKey();
ShiftHomeKey& operator=(const ShiftHomeKey& source);
virtual void OnKeyDown... |
#include<iostream>
using namespace std;
int main()
{
int arr[]={0,0,0,0,0,0,0};
int *ptr,*start;
ptr=arr+sizeof(ptr)+4;
start=arr;
int c=0;
while(start!=ptr)
{
if(*start==0)
c++;
*start++;
}
cout<<c;
}
|
#pragma once
#include "InputModule.h"
#include "Rtypes.h"
#include <vector>
#include "TMath.h"
#define GTreeTrack_MAX 128
namespace ant {
namespace analysis {
namespace input {
class ParticleInput: public BaseInputModule {
protected:
std::string name;
Int_t nParticles = 0;
Double_t... |
#include <iostream>
using namespace std;
#define MAXSIZE 50
typedef int KeyType;
typedef struct
{
KeyType key;
} ElemType;
typedef struct
{
ElemType *R;
int length;
} SSTable;
void Create(SSTable &T)
{
int i;
T.R = new ElemType[MAXSIZE + 1];
cin >> T.length;
for (i = 1; i <= T.length; i+... |
class Solution {
public:
string minNumber(vector<int>& nums) { // 本题和力扣179基本相同,也是字符串处理,自定义排序
if(nums.empty()) return "";
if(nums.size() == 1) return to_string(nums[0]);
vector<string> result;
for(int i : nums) result.push_back(to_string(i));
sort(result.begin(), result... |
vector<int> highestRight(vector<int> A,int n){
vector<int> v;
int right = A[n-1];
v.push_back(right);
for(int i=n-2;i>=0;i--){
if(A[i]>right){
v.push_back(A[i]);
right = A[i];
}
else
v.push_back(right);
}
reverse(v.begin(),v.end());
... |
#pragma once
#include "Player.h"
#include "JustImage.h"
class Player1 : public Player
{
public:
static Player1* Instance()
{
if (s_pInstance == 0) {
TheTextureManager::Instance()->load("assets/1pAnim/walkAnim.png", "player1", TheGame::Instance()->getRenderer()); //1P Player
s_pInstance = new Player1(new Load... |
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <vector>
using namespace std;
class FEMesh;
class FEVTKimport
{
public:
FEVTKimport();
~FEVTKimport(void);
FEMesh* Load(const char* szfile);
protected:
bool BuildMesh();
FEMesh* errf(const char* sz, ...);
void Close();
private:... |
/*
* @lc app=leetcode.cn id=139 lang=cpp
*
* [139] 单词拆分
*
* https://leetcode-cn.com/problems/word-break/description/
*
* algorithms
* Medium (43.22%)
* Likes: 306
* Dislikes: 0
* Total Accepted: 34K
* Total Submissions: 78.8K
* Testcase Example: '"leetcode"\n["leet","code"]'
*
* 给定一个非空字符串 s 和一个包含非... |
#pragma once
#include "Wall.h"
class Map
{
friend class Tank;
friend class Bullet;
friend class Buff;
private:
public:
Element* map[HEIGHT][WIDTH / 2] = {};
Map() {}
void createWall();
};
|
#include <iostream>
#include <string.h>
#include <algorithm>
using namespace std;
int w[3410], d[3410], dp[12900];
int main(){
int n, m;
cin >> n >> m;
for(int i = 1; i <= n; ++i){
cin >> w[i];
cin >> d[i];
}
for(int i = m; i >= 0; --i){
if(w[1] <= i){
... |
/*
* Copyright 2016-2017 Flatiron Institute, Simons Foundation
*
* 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 ... |
#pragma once
#include "utils.hpp"
#include <vector>
#include <thread>
#include <cstdlib>
#include <functional>
#include "zmq_base.hpp"
class Proxy : public ZMQBase {
public:
Proxy() {}
~Proxy() {}
/**
* Responsible for connecting multiple frontends and backends
*/
void proxy_main(
int front_soc... |
#include "RakNetworkFactory.h"
#include "RakPeerInterface.h"
#include "Router.h"
#include "ConnectionGraph.h"
#include "FileOperations.h"
#include "RakMemoryOverride.h"
#include "DS_List.h"
void* MyMalloc (size_t size)
{
return malloc(size);
}
void* MyRealloc (void *p, size_t size)
{
return realloc(p... |
#ifndef WORLD_STATE_CONFIG_HPP
#define WORLD_STATE_CONFIG_HPP
#include <stdlib.h>
#include <stdio.h>
#if (RELEASE_MODE == 1)
#define IS_CONSTANT const
#else
#define IS_CONSTANT
#endif
#define configure_begin(namespace__) namespace namespace__ {
#define configure_end() ... |
#include "key_manager.h"
/*
* Returns the users private key for encryption/decryption.
* If a key does not already exist, a new one is created and
* stored
*/
void get_key(const std::string &name, full_key *key)
{
short tmp_key = -1;
std::ifstream f(name.c_str());
if(f.good())
{
std::stri... |
/*
* vecMatricExample.cpp
*
* These are the values for the input matrix:
* 0.707107 0 -0.707107 0
* -0.331295 0.883452 -0.331295 0
* 0.624695 0.468521 0.624695 0
* 4.000574 3.00043 4.000574 1
*
* Given the input matrix, the inverse matrix computed by our code should match
*the following values:
* 0.707107 -0... |
#pragma once
#include <unordered_set>
namespace pdg {
class PDG;
} // namespace pdg
namespace llvm {
class Function;
}
namespace vazgen {
class PartitionUtils
{
public:
using FunctionSet = std::unordered_set<llvm::Function*>;
static FunctionSet computeInInterface(const FunctionSet& functions,
... |
#include "spellmodel.h"
#include "spell.h"
SpellModel::SpellModel(QObject *parent)
: QAbstractListModel(parent), m_spell(nullptr)
{
}
SpellList *SpellModel::spell() const
{
return m_spell;
}
void SpellModel::setSpell(SpellList *spell){
beginResetModel();
if (m_spell)
m_spell->disconnect(thi... |
/*
* CybTrackerInterator.h
*
* Created on: Feb 4, 2010
* Author: brunorasales
*/
#ifndef CYBTRACKERINTERATOR_H_
#define CYBTRACKERINTERATOR_H_
#include <string>
#include "cybParameters.h"
#include "cybInterator.h"
#include "cybTracker.h"
#ifdef CYBOPTICALTRACKER_H
#include "cybHaarTracker.h"
#include "... |
int leftMotorEna = 9;
int leftMotorIn1 = 8;
int leftMotorIn2 = 7;
int rightMotorIn3 = 10;
int rightMotorIn4 = 12;
int rightMotorEnb = 11;
int motorSpeed = 254;
//int turnSpeed = 230;
int turnDelay = 10;
int appValue;
void setup() {
// put your setup code here, to run once:
pinMode(leftMotorIn1, ... |
/*
* This module holds the functions to create an AST, mainly the functions that
* create various nodes for that AST.
*
*/
#include "ast.h"
#include "node_util.h"
/* Creates a program node, a program node is the root node of a program. It
* can contain any number of chilren.
*/
node_ptr create_program_node... |
/*
* slam_node.cpp
*
* Created on: Apr 28, 2014
* Author: phil
*/
#include "SlamNode.h"
#include <ros/ros.h>
#include "obcore/base/Logger.h"
int main(int argc, char** argv)
{
ros::init(argc, argv, "slam_node");
LOGMSG_CONF("slamlog.log", obvious::Logger::file_off|obvious::Logger::screen_off, DBG_DEB... |
// Rational No. class for overloading + & <<
#include <iostream>
using namespace std;
class Rational {
private:
int num;
int den;
public:
Rational(int n=1, int d=1){
num = n;
den = d;
}
void display() {
cout << num << "/" << den << endl;
}
friend Rational operator+(Rational r1, Rational r2);
frien... |
#ifndef Wall_H
#define Wall_H
#include "GameObject.hpp"
namespace Dungeon {
namespace Entities {
class Wall : public GameObject {
public:
Wall(int x, int y, int vx, int vy)
: GameObject(x, y, vx, vy)
{}
void update(const InteractionData_t& interactionData, const Map* map);
... |
#include <iostream>
#include <cmath>
#include <string>
#include <cstdlib>
#include <vector>
#include <sstream>
#include <iomanip>
#include "student.h"
#include "roster.h"
//initialize constructor
Roster::Roster() {
rosterSize = 0;
}
//constructor with parameters that initializes the size of a Roster... |
#include <iostream>
using namespace std;
/**
* Suponha que para cada aluno de sua sala exista uma ficha contendo a
* matricula e a idade do aluno. Supondo que exista 50 alunos, faca
* uma algoritmo que determine quantos desses alunos tem idade maior que 20.
*/
int main ()
{
int mat, idade, cont=0;
for (in... |
#ifndef _USER
#define _USER
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
class User
{
private:
unsigned int m_id;
unsigned int m_borrowedCount;
unsigned int m_arraySize;
string m_firstName;
string m_lastName;
string* m_borrowedBooksList;
bool resizeArray();
public:
User();
... |
#include "core.h"
#include "uiwidget-spacer.h"
UIWidgetSpacer::UIWidgetSpacer()
{
}
UIWidgetSpacer::~UIWidgetSpacer()
{
} |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
srand(time(nullptr));
//TASK 01//
const int SIZE = 10;
char arr[SIZE]{};
int count = 0;
cout << "Enter symb\n";
for (int i = 0; i < SIZE; i++)
{
cout << "arr[" << i << "] - ";
cin >> arr[i];
if (arr[i] >= 'A'... |
#ifndef __DUI_WINDOW_H__
#define __DUI_WINDOW_H__
#include "DUILib.h"
#include "DUIAtl.h"
#include "DUIBitBuffer.h"
#include "DUIImage.h"
DUI_BGN_NAMESPCE
class DUILIB_API CDUIWindowBase: public CWindowImpl<CDUIWindowBase>
{
public:
DECLARE_WND_CLASS(DUI_WND_CLASS)
BEGIN_MSG_MAP(CDUIWindowBase)
MESSAGE_HANDLER(... |
#pragma once
#include "std_header.h"
namespace texture {
class texture2D {
private:
int width, height;
GLuint texture;
std::string type;
public:
texture2D(GLuint texture_number, int width, int height);
//获取纹理绑定编号
const GLuint & getTexture() const;
const int & getWidth() const;
const int & getHeight... |
/***************************************************************************
* Software License Agreement (BSD License) *
* Copyright (C) 2017 by Florian Beck <florian.beck@tuwien.ac.at> *
* *
* Redistr... |
#ifndef STATUS_RESOURCE_H
#define STATUS_RESOURCE_H
#include <httpserver.hpp>
class status_resource
: public httpserver::http_resource<status_resource>
{
httpserver::http_response *make_GET_response(
const httpserver::http_request &);
void print_cache_stats(std::ostringstream &res);
public:
... |
#pragma once
#include "VCoreBase.h"
//////////////////////////////////////////////////////////////////////////
class VName
{
public:
static constexpr uint64_t EMPTY_HANDLE = uint64_t(0xFFffFFff);
using HashT = uint64_t;
struct Instance
{
char* mString;
//size_t mLength;
};
inline static uint64_t MakeHand... |
#include<bits/stdc++.h>
using namespace std;
struct SegmentTree{
int val;
int s,e;
SegmentTree* l;
SegmentTree* r;
int init(int* a,int start,int end){
s = start;
e = end;
if(s!=e){
l = new SegmentTree;
r = new SegmentTree;
return val = min(l->init(a,s,(s+e)/2),r->init(a,(s+e)/2+1,e));
... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "base.h"
WINRT_WARNING_PUSH
#include "internal/Windows.Foundation.3.h"
#include "internal/Windows.Storage.3.h"
#include "internal/Windows.Storage.Streams.3.h"
#include "internal/Windo... |
#include "ViivaOhjain.h"
#include "tilastot.h"
#include "Vaiheet.h"
void ViivaOhjain::setup(string hakemisto_, string tallennusHakemisto_) {
pankki.lataaArkisto(hakemisto_);
hakemisto = hakemisto_;
tallennusHakemisto = tallennusHakemisto_;
nykyinenPolku = 0;
polkuLaskuri = 0;
//luodaan hakemis... |
#pragma once
#include <SFML\Graphics.hpp>
#include "LevelManager.h"
#include "EntityManager.h"
#include "../display/DisplayGrid.h"
#include "../load/LoadFile.h"
class ScreenManager : public sf::RenderTexture, public LoadFile
{
struct sfEntity
{
sf::Shape* shape;
sf::Text text;
bool visible = true;
//sf::Spri... |
/***********************************************************************
created: 13/4/2004
author: Paul D Turner
purpose: Implementation of MultiColumnList widget base class
*************************************************************************/
/****************************************************************... |
#include <iostream>
using namespace std;
void main() {
int a[3];
int b[3];
int cnt_s = 0;
int cnt_b = 0;
for (int i = 0; i < 3; i++) {
cin >> a[i];
}
for (int i = 0; i < 3; i++) {
cin >> b[i];
}
for (int i = 0; i < 3; i++) {
if (a[i] == b[i]) {
cnt_s++;
}
}
for (int i = 0; i < 3; i++) {
for (in... |
#include <bits/stdc++.h>
#include <cassert>
#define rep(i, N) for (int i = 0; i < (N); ++i)
#define rep2(i, a, b) for (ll i = a; i <= b; ++i)
#define rep3(i, a, b) for (ll i = a; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define nl '\n'
#define endl '\n'
#define all(c)... |
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
struct Node {
char type;
Node *lc, *rc;
Node() { lc = rc = NULL; }
Node(char _type, Node* _lc = NULL, Node* _rc = NULL)
: type(_type)
, lc(_lc)
, rc(_rc) {}
};
int n;
string s;
No... |
#pragma once
class Vector3
{
public:
Vector3();
Vector3(float e0, float e1, float e2);
float X() const { return e[0]; }
float Y() const { return e[1]; }
float Z() const { return e[2]; }
float R() const { return e[0]; }
float G() const { return e[1]; }
float B() const { return e[2];... |
#ifndef DOODLEBUG_HPP
#define DOODLEBUG_HPP
#include "Critter.hpp"
class Doodlebug : public Critter
{
private:
int stepsToStarve;
public:
Doodlebug();
void move(int type);
void breed();
void starve();
};
#endif
|
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::ApplicationModel::Email {
struct IEmailAttachment;
struct IEmailAttachment2;
struct IEmailAttachmentFactory;
struct IEmailAttachmentFac... |
#pragma once
#ifndef __GAMEOBJECT__
#define __GAMEOBJECT__
#include <string>
struct GameObject {
std::string name;
float x;
float y;
float z;
};
struct GameForSendingToUnityObject {
char* name;
float x;
float y;
float z;
};
struct playerInformation {
float hitAccuracy, numberOfChargedAttacks, numberOfTimes... |
#include <iostream>
#include <random>
#include "TrafficLight.h"
/* Implementation of class "MessageQueue" */
template <typename T>
T MessageQueue<T>::receive()
{
// DONE: FP.5a : The method receive should use std::unique_lock<std::mutex> and _condition.wait()
// to wait for and receive new messages and pull ... |
//
// Created by Will Smith on 3/15/18.
//
#ifndef SPRING2018_SHOPPINGCART_H
#define SPRING2018_SHOPPINGCART_H
#include <string>
#include <vector>
#include "ItemToPurchase.h"
using namespace std;
class ShoppingCart {
private:
string customerName;
string currentDate;
vector < ItemToPurchase > cartItems;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.