text stringlengths 8 6.88M |
|---|
#include <iostream>
using namespace std;
int main(){
int number, rest;
cout << "Write a number: " << endl;
cin >> number;
rest = number%16;
if (rest == 0){
cout << "The number " << number << " is divisible by 16" << endl;
} else {
cout << "The number " << number << " is not divisible by 16" ... |
#include <stdlib.h>
#include <iostream>
#include <list>
#include "TFile.h"
#include "TTree.h"
#include "AngraMCPulse.h"
int main(int argc, char **argv)
{
std::cout << "Hello Mixer!" << std::endl;
AngraMCPulse aPulse;
AngraMCPulse *aPulsePointer=&aPulse;
std::list<AngraMCPulse> pulseList;
TFile f("TestList... |
#include <ntdll.h>
#include <delayimp.h>
#include <filesystem>
namespace fs = std::filesystem;
#include <xorstr.hpp>
#include <SafeInt.hpp>
#include "detours/detours.h"
#include <fnv1a.h>
#include "hooks.h"
#include "pe/module.h"
#include "pe/export_directory.h"
LONG DetourAttachApi(
pe::module *module,
const ... |
class Solution {
public:
string validIPAddress(string IP) {
istringstream iss(IP);
string t = ""; // to store substring b/w '.' (or ':')
int cnt = 0; // IPv4: cnt=4; IPv6: cnt=6
if (IP.find(':') == string::npos) { // not found ':', is IPv4
while (getline(iss, t, '.')) { ... |
namespace whiskey {
template<typename T>
std::function<T> JIT::compile(const std::string &name) {
return reinterpret_cast<T *>(onCompile(name));
}
}
|
#include <stdio.h>
#include <string>
#include <iostream>
#include <conio.h>
#include "bot_control.h"
using namespace std;
serial comm; //serial is a class type defined in these files, used for referring to the communication device
void main() {
char data; //To store the character to send
string manuel ... |
/*
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 <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "log.h"
#include "statemachine.h"
#include "utils.h"
#include "param.h"
#include "mydefs.h"
#include "check_process_script.h"
//!\brief The portal_process_watcher thread monitor the man... |
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ok() puts(ok?"Yes":"No");
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
ty... |
#include "FPS.h"
#include "Information.h"
#include <cmath>
// コンストラクタ
FPS::FPS():
TaskBase(INT_MIN, TaskName::FPS),
m2DMagnifX(1.0f /float(CWE_DEFAULT_WINDOW_SIZE_X)), m2DMagnifY(1.0f /float(CWE_DEFAULT_WINDOW_SIZE_Y)),
mTime(1.0)
{
float offsetX =-944*m2DMagnifX,
offsetY =524*m2DMagnifY;
mPos.x() =offsetX;... |
#ifndef STOOLBAR_CPP
#define STOOLBAR_CPP
#define _WIN32_IE 0x0500
#define TB_SETIMAGELIST (WM_USER + 48)
#include <windows.h>
#include <commctrl.h>
#include "SApp.h"
#include "SWindow.h"
#include "SToolbar.h"
SToolbar::SToolbar(SWindow * pWin):
SWindow(pWin->GetSApp(), TOOLBARCLASSNAME, pWin->G... |
#include <stdafx.h>
#include "ASModeling.h"
#include "GradCompute.h"
#include <lbfgsb.h>
namespace as_modeling
{
bool ASModeling::OptimizeSuccFrames(int i_frame)
{
// load the ground truth image for current frame
if (!load_captured_images(i_frame))
{
fprintf(stderr, "<-> Error : Cann... |
#pragma once
#include <string>
#include <exception>
class BaseException : public std::exception
{
public:
BaseException(_In_ const char* file, _In_ UINT lineNum) noexcept;
const char* what() const noexcept override;
const int LineNum() const noexcept;
virtual const char* GetType() const noexcept;
const char* Get... |
/* CS580 Homework 3 */
#include "stdafx.h"
#include "stdio.h"
#include "math.h"
#include "Gz.h"
#include "rend.h"
//Method declaration
void matrixMul(GzMatrix a, GzMatrix b, GzMatrix c);
void normalize(GzCoord v);
void calculateNewCood(GzCoord* co, GzCoord* newCo, GzMatrix m);
short ctoi(float color);
// new struct v... |
#pragma once
#include <iostream>
#include <vector>
#include <random>
#include <string>
#include "nndemo/FileReader.h"
namespace nndemo {
class NeuralNet {
public:
template<class URNG> NeuralNet(const std::vector<std::string>& parsed, URNG& rng) {
std::uniform_real_distribution<float> distribution(0.0, 1.0... |
#include <iostream>
#include <bits/stdc++.h>
#include <fstream>
using namespace std;
int total_cnt = 0;
void readFile()
{
fstream file;
// ofstream filewrite;
string word;
string filename = "all.last.txt";
// string writefilename = "Output-Database.txt";
file.open(filename.c_str());
cout << endl;
cou... |
#pragma once
#include "cscene.h"
class cPlayScene :
public cScene
{
public:
virtual void Init();
virtual void Update();
virtual void Render();
virtual void Release();
public:
cPlayScene(void);
~cPlayScene(void);
};
|
/*
Started by Gonzalo Pintos Cuesta on June of 2019
Author: Gonzalo Pintos Cuesta
Copyright © 2020 Gonzalo Pintos Cuesta
Last Update: June/2020
email: gonigox@gmail.com
*/
#pragma once
#include <Component.hpp>
#include <Vector3.hpp>
namespace engine
{
/**
* @brief Transfrom Component clas... |
#include "DepthRange.h"
namespace revel
{
namespace renderer
{
DepthRange::DepthRange(f32 near, f32 far)
: m_Near(near)
, m_Far(far)
{
}
f32
DepthRange::get_near() const
{
return m_Near;
}
f32
DepthRange::get_far() const
{
return m_Far;
}
void
DepthRange::set_near(f32 near)
{
m_Near = near;
}
... |
void InsertSort(int Data[], int Lenght)
{
for(int i = 1; i < Lenght; i++)
{
int j, Target = Data[i];
for(j = i - 1; j >= 0 && Data[j] > Target; j--)
{
Data[j + 1] = Data[j];
}
Data[j + 1] = Target;
}
}
|
#ifndef ENTITY_HPP
#define ENTITY_HPP
#include <SFML/Graphics.hpp>
#include "SceneNode.hpp"
class Entity : public SceneNode
{
public:
Entity() : m_velocity( 0, 0 ) {}
virtual void updateCurrent( sf::Time dt, sf::View& view );
void setVelocity( float x, float y ) { m_velocity = sf::Vector2f( x, y ); }
... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#include <sstream>
using namespace std;
class Board {
public:
bool checkWon(vector<vector<int> > board) {
int len = board.size();
for(int i = 0; i < len; ++i){
if(board[i][0] ... |
#include "roman_numerals.h"
namespace roman_numerals {
std::string convert(uint32_t decimal) {
std::string roman = "";
std::vector < std::pair<uint16_t, std::string>> numbers;
numbers.push_back(std::make_pair(1000, "M"));
numbers.push_back(std::make_pair(900, "CM"));
numbers.push_back(std::make_pair(500,... |
/*
* idevicesyslog.c
* Relay the syslog of a device to stdout
*
* Copyright (c) 2009 Martin Szulecki All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
... |
#include <cstdio>
#include <algorithm>
#include <vector>
#define X first
#define Y second
#define mp make_pair
#define pb push_back
using namespace std;
typedef pair< int, int > pii;
typedef pair< pii, pii > table;
table product( table A, table B ) {
int num1 = A.X.X * B.X.X + A.X.Y * B.X.Y;
int num2 = A.X.... |
#ifndef LEVEL3BUTTON_H
#define LEVEL3BUTTON_H
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
#include <QMediaPlayer>
#include <QGraphicsPixmapItem>
class Level3Button : public QGraphicsPixmapItem
{
friend class Menu;
private:
QGraphicsScene * level3Scene;
QMediaPlayer * level3ButtonMusic;... |
/*
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... |
//
// packet.cpp
// CRsim
//
// Created by Ji on 15/1/20.
// Copyright (c) 2015年 lj. All rights reserved.
//
#include "packet.h"
|
/*
* Copyright (C) 2007-2015 Frank Mertens.
*
* Use of this source is governed by a BSD-style license that can be
* found in the LICENSE file.
*
*/
#include <flux/Singleton>
#include <flux/toki/Registry>
namespace flux {
namespace toki {
Registry::Registry()
: languageByName_(LanguageByName::create())
{}
... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int m;
cin >> m;
int* arr = new int[n+1]();
int* input = new int[m];
for(int i=0;i<m;i++)
{
cin >> input[i];
}
for(int i=0;i<m-1;i++)
{
int start = input[i];
int end = input[i+1];
int temp = start;
if(i==0)
{
arr[star... |
/*
Copyright (c) 2012, PaynetEasy. All rights reserved.
Author: Mikhail Goryachkin
Licence: GPL
Description: syslog audit plugin.
*/
#define MYSQL_SERVER
#include <my_pthread.h>
#include <sql_priv.h>
#include <mysql/plugin.h>
#include <sql_class.h>
#include <mysql/plugin_audit.h>
#include <syslog.h> ... |
#include <bits/stdc++.h>
using namespace std;
struct node
{
node* next;
int data;
};
void print_list(node* head)
{
node *temp=head;
while(temp!=NULL)
{
cout<<temp->data<<" ";
temp=temp->next;
}
cout<<"\n";
}
node* mid_point(node* head,int n)
{
node* fast=head;
node* slow=head;
while(fast!=NULL)
... |
//**************************************************************************
//**
//** See jlquake.txt for copyright info.
//**
//** 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 ... |
/* (c) 2019 Reno Technology Academy, Multnomah University */
/*
Course: CIS108 - Introduction to Software Development
Author: Kory William Herzinger
Description: Lab Assignment #4 / Exercise #1
Security System
Purpose: Implements the mobile phone app interface
*/
#include "MobileAppInterface.h"... |
#ifndef SENSOR
#define SENSOR
#define IR 0
#define IRSHORTL 3
#define IRSHORTR 4
#define US 1
#define IRD 2
#define CHAINSIZE 5
#define COVERED 0
#define OPEN 1
#define ceiling 4.1 // maximum distance by the Sensor
#include "Arduino.h"
class Sensor {
public:
double distance = 0.0;
double speed = 0.0;
Sensor(s... |
/***********************************************************************
created: Mon Jul 27 2009
author: Paul D Turner <paul@cegui.org.uk>
*************************************************************************/
/***************************************************************************
* Copyrigh... |
/**********|**********|**********|
Program: TT04_A2_CHENG_CHIN_KHENG.cpp
Course: TCP1101 Programming Fundamentals
Year: 2017/18 Trimester 1
Name: Cheng Chin Kheng
ID: 1161101863
Email: chinkheng_98@hotmail.com
Phone: 016-4722386
**********|**********|**********/
#include <iostream>
#include <algorithm>
#... |
#include <iostream>
#include <algorithm>
using namespace std;
//최소 힙
class heap{
private:
int numOfData;
int heap_arr[100000];
public:
heap(){
numOfData = 0;
fill(heap_arr, heap_arr+100000, 0);
}
int getLeftIndex(int cur){
return cur*2;
}
int getRightIndex(int... |
//================================================================
// PROGRAMMER : 陳佳佑
// DATE : 2015-11-07
// FILENAME : HW04D036.CPP
// DESCRIPTION : This is a program to stimulate the dices.
//================================================================
#include <iostream>
using na... |
#include "qcontrolwidget.h"
void QControlWidget::updateInfo()
{
}
QControlWidget::QControlWidget(QWidget *parent) : QWidget(parent)
{
//creating
main_layout = new QVBoxLayout(this);
//setting main_layout of widget
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setLayout(m... |
inline MatConstIterator::MatConstIterator()
: m(0), elemSize(0), ptr(0), sliceStart(0), sliceEnd(0) {}
inline MatConstIterator::MatConstIterator(const Mat* _m)
: m(_m), elemSize(_m->elemSize()), ptr(0), sliceStart(0), sliceEnd(0) {
if (m && m->isContinuous()) {
sliceStart = m->ptr();
sliceEnd = slice... |
#include "span/io/IOManagerKqueue.hh"
#if UNIX_FLAVOUR == UNIX_FLAVOUR_BSD
#include <exception>
#include <map>
#include <utility>
#include <vector>
#include "span/exceptions/Assert.hh"
#include "span/fibers/Fiber.hh"
#include "glog/logging.h"
namespace span {
namespace io {
IOManager::IOManager(size_t thread... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.UI.Xaml.Interop.0.h"
#include "Windows.Foundation.0.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::UI::Xaml::Interop {
struct TypeName
{
... |
#include <iostream>
using namespace std;
int a[16], sum[16];
int f[16][16];
int n, k;
int solve (int x, int k) {
if (x<=k || x<=0 || k<0)
return 0 ;
if (k == 0)
return sum[x];
if (f[x][k] >0)
return f[x][k];
else {
int Max = 0;
... |
#pragma once
#include "../CWE/CWELib.h"
// モーション
class Motion final
{
private:
CWE::Motion mMotion;
CWE::math::Float4x4 mOldPos;
float mNowFrame;
public:
Motion(): mMotion(), mNowFrame(0.0f) {}
~Motion() {}
inline const CWE::Motion& GetMotion() const {return mMotion;}
inline CWE::Motion& GetMotion() {retur... |
#ifndef DOL_SYSTEM_H
#define DOL_SYSTEM_H
#include "OL_System.h"
#include <string>
class DOL_Production
{
private:
std::string Successor;
//
public:
//
const std::string &GetSuccessor() const
{
return Successor;
}
//
void SetSuccessor(const std::string &successor)
{
Successor = successor;
}
//
DOL_Pr... |
bool ispossible(vector<int> &a,int p,int k)
{
int sm=0;
int n=a.size();
int req_student=1;
for(int i=0;i<n;i++)
{
if(a[i]>p)
return false;
else if(sm+a[i]>p)
{
req_student++;
sm=a[i];
if(req_student>k)
return fal... |
#include <stdlib.h>
#include <stdbool.h>
#include<string.h>
#include <stdio.h>
typedef struct dnode_t {
int data;
char nama[100];
struct dnode_t
*next,
*prev;
} DListNode;
typedef struct deque_t {
DListNode
*_head,
*_tail;
unsign... |
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.01.0622 */
/* at Tue Jan 19 04:14:07 2038
*/
/* Compiler settings for ArrayMFC.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622
protocol : dce , ms_ext, c_ext, robust
... |
#include <map>
#include <iostream>
using namespace std;
class Test
{
public:
Test()
{
cout << "build" << endl;
}
~Test()
{
cout << "free" << endl;
}
Test(const Test&)
{
cout << "copy build" << endl;
}
};
int main(void)
{
Test tes;
map<string, Test... |
#include "statementitem.h"
#include "ui_statemenItem.h"
statementItem::statementItem(record billItem, QWidget *parent) :
QWidget(parent),
ui(new Ui::statementItem)
{
ui->setupUi(this);
ui->startTimeLabel->setText("开始时间:" + billItem.startTime);
ui->stopTimeLabel->setText("结束时间:" + billItem.stopTime)... |
#include "mbed.h"
#include "stdio.h"
#include <string>
#define OLED_ID 0x3C<<1
#define i2c_wait_time 1
#define SCL GPIO_PIN_RA10
#define SDA GPIO_PIN_RB14
#define MIN 16
#define HOUR 13
#define MDAY 21
#define MON 1
#define YEAR 120
//A a(&i2c);
Serial pc(USBTX, USBRX);
Serial uart(D1, D0);
DigitalOut myled(L... |
#ifndef __TIMESERIES_WRAP_JFLIB_HPP__
#define __TIMESERIES_WRAP_JFLIB_HPP__
#include <jflib/python/pair_to_tuple.hpp>
#include <jflib/python/timeseries/timeseries_add.hpp>
#include <jflib/python/timeseries/econometric_wrap.hpp>
#include <jflib/timeseries/traits/converters.hpp>
#include <jflib/timeseries/e... |
#include<stdio.h>
#include<malloc.h>
#include<stdlib.h>
struct treenode{
int data;
struct treenode *left;
struct treenode *right;
};
struct treenode *new_node(int);
int preorder(struct treenode *);
int postorder(struct treenode *);
int inorder(struct treenode *);
int main(void){
struct treenode *root;
root=new_node... |
#ifndef ADDRESS_H
#define ADDRESS_H
#include <vector>
#define PREFECTURES 47
#define PREF_FILE "./data/prefectures.csv"
#define ADDRESS_FILE "./data/address.csv"
using namespace std;
struct prefecture {
int number;
string name;
int population;
int zips;
};
struct address {
int number;
s... |
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <ctime>
#include <sstream>
#include <cmath>
#include <string>
using namespace std;
const double PI = 2. * acos(0),
M = 300., // кол-во членов в интегральной сумме
l = 12., // высота(м)
N = 750., // частота... |
1、每个节点不是红色就是黑色。
2、根节点为黑色。
3、如果节点为红色,其子节点必须为黑色。
4、任意一个节点到到NULL(树尾端)的任何路径,所含之黑色节点数必须相同。
插入(处理红红问题)
1.任何一个即将插入的新结点的初始颜色都为红色。这一点很容易理解,因为插入黑点会增加某条路径上黑结点的数目,从而导致整棵树黑高度的不平衡
2.如果父为黑,显然符合所有要求
3.父为红,叔(显然只有一个叔,因为是二叉树)为红,将两者变黑,再将祖变红(执行此才可在3的基础上满足4,但是这是针对祖为黑的情况,因为父已经为红,但是,如果祖的f
父节点为红,这就违反了红黑树的性质,需要再将上一层变黑,... |
#include <stdio.h>
#include <iterator>
struct symbol{
unsigned char printable;
unsigned char glyph[7][5];
};
struct symbol asciitable[127];
unsigned char ba[7][5] ={
{0,1,1,1,0},
{1,0,0,0,1},
{1,0,0,0,1},
{1,1,1,1,1},
{1,0,0,0,1},
{1,0,0,0,1},
{1,0,0,0,1}};
unsigned char bb[7][5]={
{1,1,1,1,0},
{1,0,0,0,1},
{1,0,0... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Devices.Geolocation.Geofencing.1.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Foundation::Collections {
#ifndef WINRT_GENERIC_096dc936_5f66_5c6e_95ce_ef5541fbf... |
#ifndef RANDOMNESS_HEADER_H
#define RANDOMNESS_HEADER_H
#ifdef USE_BOOST_RANDOM
#include <boost/random.hpp>
#else
#include <stdlib.h>
#endif
#include <vector>
#include <limits>
namespace NEAT
{
class RNG
{
#ifdef USE_BOOST_RANDOM
boost::random::mt19937 gen;
#endif
public:
... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "adjustdialog.h"
#include "ui_adjustdialog.h"
#include "SteeringBehaviors/ParamLoader.h"
#include "QGraphicsDropShadowEffect"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
dialog = n... |
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2010 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
... |
#include "LabExec.h"
#include "LabIo.h"
// // Удаление пробелов в начале строки
// void SkipSpaces (string& str) {
// while (str.length() > 0 && str[0] == ' ') {
// str = str.substr(1);
// }
// }
// Удалить n символов из начала строки
void Skip (std::string& str, int& pos, int n) {
if (str.length(... |
#include <jni.h>
#include <stdio.h>
#include <stdlib.h>
#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <vector>
#include <opencv2/imgproc/imgproc.hpp>
#include <fstream>
#include "opencv2/highgui/highgui.hpp"
using namespac... |
// Goldman Sachs
/*
A message containing letters from A to Z is being encoded to numbers using
the following mapping:
A-1, B-2, ..... Z-26
You are given a string S that determines an encoded message containing only digits.
The task is to determine the total number of ways to decode it.
Input:
2
123
13
45678
Output:
... |
#ifndef TREE_DATA_LISTENER_H
#define TREE_DATA_LISTENER_H
#include <View/EdgeVisualizer/FuGenGLView.h>
#include "Data/TreeDataPresenter.h"
class ViewRefresher : public ITreeDataListener
{
private:
FuGenGLView *GLView;
//
public:
//
virtual void OnChanged() override
{
if(GLView != nullptr)
{
GLView->updat... |
#ifndef EXAMPLE_CHESS_MENU_H
#define EXAMPLE_CHESS_MENU_H
#include "opengl/gui.h"
#include "options.h"
namespace example::chess {
class Menu final : public apeiron::opengl::Gui
{
public:
Menu(SDL_Window* window, SDL_GLContext context) : apeiron::opengl::Gui{window, context} {}
void setup(Options* options);
... |
#include "DBManager.h"
#include <mysql/mysql.h>
#include <iostream>
IMPLEMENT_SINGLETON(CDBManager);
int CDBManager::GetRowNumbs() {
MYSQL *connection = nullptr;
MYSQL conn;
MYSQL_RES *sql_result;
MYSQL_ROW sql_row;
int stat = 0;
int retval = 0;
if(mysql_init(&conn) == nullptr){
s... |
#ifndef ELEMENT_H
#define ELEMENT_H
#include <iostream>
#include <string>
#include <set>
#include <memory>
#include <rapidjson/document.h>
#include <core/types/id_type.h>
class Element {
public:
typedef std::shared_ptr<Element> Ptr;
typedef std::shared_ptr<const Element> ConstPtr;
public:
inline ... |
#pragma once
#include <ecstasy/systems/IteratingSystem.hpp>
class Canvas;
class RenderSystem : public IteratingSystem<RenderSystem> {
private:
Canvas *canvas;
public:
RenderSystem(Canvas *canvas);
void update(float deltaTime) override;
void processEntity(Entity *entity, float deltaTime) override;
};
|
#include <cmath>
#include <deque>
#include <iostream>
#include <limits>
#include <tuple>
////////////////////////////////////////////////////////////////////////////////
#include <Eigen/SparseCore>
#include <Eigen/IterativeLinearSolvers>
typedef Eigen::Matrix<double, Eigen::Dynamic, 1> vector;
typedef Eigen::SparseM... |
//
// Created by rewbycraft on 1/19/20.
//
#ifndef SIXELPING_RECEIVER_DPDK_GRPC_HELPER_H
#define SIXELPING_RECEIVER_DPDK_GRPC_HELPER_H
#include "common.h"
#include "application_configuration.h"
#include <vector>
#include "ethdev.h"
void setup_grpc(struct app_config *aconf);
void send_frame_update(struct app_config *... |
#pragma once
#include "SingletonBase.h"
#include "Image.h"
#include <map>
using namespace std;
class ImageManager : public SingletoneBase<ImageManager>
{
private:
map<string, Image*> imageList;
public :
Image* AddImage(string strKey, const TCHAR* fileName,
int width, int height, bool trans = false,
COLORREF tr... |
/**
********************************************************************************
* @File Name : stm32Hardware.h
* @Author : Jungle
* @Mail : Mail
* @Created Time : 2018/7/16 17:29:18
* @Version : V1.0
* @Last Changed : 2018/7/16 17:29:18
* @Brief : brief
**************... |
// AsioTest.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "common.h"
#include "AsioTest.h"
#include "AsioTestDlg.h"
#include "ASIOSoundSystem.h"
#include "WASAPISoundSystem.h"
#include "FileReader.h"
#include "WinMIDIController.h"
#include "Session.h"
#include "Instrument.h"
#... |
// This file has been generated by Py++.
#include "boost/python.hpp"
#include "generators/include/python_CEGUIOpenGLRenderer.h"
#include "OpenGLViewportTarget.pypp.hpp"
namespace bp = boost::python;
struct OpenGLViewportTarget_wrapper : CEGUI::OpenGLViewportTarget, bp::wrapper< CEGUI::OpenGLViewportTarget > {
O... |
#include "Disk.h"
#include "Memory.h"
#include <fstream>
#include <string>
#include <queue>
#include <sstream>
using namespace std;
Disk* hdd;
Memory* mem;
queue<unsigned int>* directory;
enum readstate { NONE, TEXT, DATA };
int* splitstr(string line)
{
stringstream ss;
string token;
int* hdr = new int[3];
int ... |
/*************************************************************************************
Daniel Stokes 1331134
**************************************************************************************/
#include <algorithm>
#include "Jitter.h"
#include "../GridUtils.h"
std::vector<Block*>& Jitter::destroy(Grid& grid)
{
... |
#pragma once
#include "CodeGen/FileWriter.h"
#include "CodeGen/SourceFile.h"
namespace vazgen {
class SourceFileWriter
{
public:
SourceFileWriter(const SourceFile& sourceFile);
SourceFileWriter(const SourceFileWriter& writer) = delete;
SourceFileWriter(SourceFileWriter&& writer) = delete;
SourceFileWrit... |
#ifndef DREDUCERCLIENT_H
#define DREDUCERCLIENT_H
#include<string>
class DummyReducerClient
{
private:
std::string reducer_ip;
int reducer_port;
int reducer_socket;
int heart_beat_socket;
int initiate_heart_beats();
public:
// DummyReducerClient(std::string reducer_ip, int reducer... |
#include "Utils/PartitionUtils.h"
#include "PDG/PDG/PDG.h"
#include "PDG/PDG/PDGNode.h"
#include "PDG/PDG/PDGEdge.h"
#include "PDG/PDG/FunctionPDG.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/CallSite.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
namespace vazgen {
PartitionUtils::F... |
#include <ros/ros.h>
#include <actionlib/client/simple_action_client.h>
#include <move_base_msgs/MoveBaseAction.h>
#include <geometry_msgs/PoseArray.h>
#include <unistd.h>
/* This node receives an arrays of goals and produces a global trajectory
* using the global planner from the move_base node, for each pair in the... |
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
cout << "goodbye moonmen" << endl;
return 0;
} |
/*
* pragmaHandling.h
*
* Created on: Nov 1, 2011
* Author: kamalsharma
*/
#ifndef ARRAYBASE_H_
#define ARRAYBASE_H_
#include <string>
#include <iostream>
using namespace std;
class ArrayInfo
{
public:
ArrayInfo(string name)
{
arrayName = name;
noDims=0;
}
void setDim(int dimIndex, int LB, int UB... |
#ifndef ICE_HPP
#define ICE_HPP
#include "AMateria.hpp"
#include "ICharacter.hpp"
class Ice : public AMateria
{
private:
public:
Ice & operator=(const Ice & right);
Ice();
Ice(const Ice & right);
virtual ~Ice();
AMateria *clone() const;
void use(ICharacter& target);
};
#endif
|
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int>b(1000007);
vector<int>v;
void sieve(int n)
{
for(int i=4;i<=n;i+=2)
b[i]=1;
for(int i=3;i*i<=n;i+=2)
{
if(b[i]==0){
for(int j=i*i;j<=n;j+=i)
{
b[j]=1;
}
}
}
for... |
// Workshop 9:
// Collection template
// 2021-03-26
// Version: 1.0
// Author: Fardad Soleimanloo
/////////////////////////////////////////////
#ifndef SDDS_COLLECTION_H_
#define SDDS_COLLECTION_H_
namespace sdds {
template <typename Temp>
class Collection {
Temp* m_data = nullptr;
int m_size =... |
/*
* This program is to illustrate inline function.
* Inline function deals with the replacing of the logic where it is called.
* Therefore it works faster than normal function.
* In this we will create function for factorial and GCD.
*/
#include <iostream>
using namespace std;
inline long long fact(long long n)... |
#ifndef BIGINTEGER_FOR_BINARY
#define BIGINTEGER_FOR_BINARY
class BigInteger{
public:
BigInteger();
BigInteger(const int& a);
BigInteger(const std::string& s);
BigInteger(const BigInteger& a);
~BigInteger();
bool operator<(const BigInteger& a) const;
const BigInteger operator-(const BigInteger& a) cons... |
/* --COPYRIGHT--,BSD
* Copyright (c) 2011, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copy... |
#include "mainwindow.h"
#include <QApplication>
#include "connection.h"
#include <QMessageBox>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QString dataname = "D:/QtTest/mvc/sqllite";
if (!conncection(dataname)) {
QMessageBox::information(nullptr, "Open DataBase!", "failed");
... |
#include <vector>
#include <string>
using namespace std;
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
TreeNode* recoverFromPreorder(string S) {
vector<pair<int, TreeNode *>> s;
TreeNode... |
#include <iostream.h>
#include <conio.h>
//Наша структура
struct node
{
int info; //Информационное поле
node *l, *r; //Левая и Правая часть дерева
};
node *tree = NULL; //Объявляем переменную, тип которой структура Дерево
/*ФУН... |
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2010 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
... |
#include<bits/stdc++.h>
using namespace std;
// this is done using additional stack
// sort stack such that the greater elements remain at top of the stack
void print_stack(stack<int>& original)
{
vector<int> temp2;
while(original.size() > 0)
{
cout << original.top() << " ";
temp2.push_back(original.top());
o... |
#include <fstream>
#include <map>
#include <string>
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
using namespace std;
using namespace std;
std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems) {
std::stringstream ss(s);
... |
/*
sapi_util.cpp
Copyright (C) 2005 Annosoft, LLC. Richardson, Texas.
All rights reserved.
Permission is hereby granted, free of charge, to use and distribute
this software and its documentation without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, su... |
// read_controls()
// Reads analog controls
void read_controls() {
// Read wave button
PORTD = B00001100;
if (analogRead(A0) > 500 && wave_flag == 0) {
wave++;
i = 0;
if (wave > 3) {
wave = 1;
}
wave_flag = 1;
} else if (analogRead(A0) < 500 && wave_f... |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
long int bil, m, n, ranking[200010], skor, cnt;
int posisi(int left, int right){
int pivot=(left+right)/2;
if((skor>=ranking[pivot])&&(skor<ranking[pivot-1])){
return p... |
/*
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.