text stringlengths 8 6.88M |
|---|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 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_SUPPORT
#include "modules/svg/src/SV... |
/*
Blinkin' Rubber Duckies
Uses UNO + Ethernet + Proto shield:
* Subscribe to DiscoDucks topics at MQTT broker mosquitto
+ 'effect' Use tiny interpreter for effect strings.
+ 'speed' Use tiny interpreter for effect strings.
* MQTT - http://knolleary.net/arduino-client-for-mqtt/
This example code is i... |
#include <systemc.h>
#include "parser.h"
void Parser::parse() {
if (!reset.read()) {
state = 0;
}
switch(state) {
case 0:
if (in.read()) state = 1;
out.write(0);
break;
case 1:
state = 0;
if (in.read()) state = 2;
... |
#pragma once
struct lua_State;
namespace iberbar
{
namespace Json
{
void RegisterLuaCpp( lua_State* pLuaState );
}
}
|
//===-- kernel.h - OpenCL Kernel --------------------------------*- C++ -*-===//
//
// TODO (Zhongliang): Add a license.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief This file contains the definition of OpenCL kernel class.
///
//===-----------------------... |
#ifndef SEARCHNODE_HEADER
#define SEARCHNODE_HEADER
class SearchNode
{
SearchNode* m_parent;
unsigned int m_xpos; //x position (column number)
unsigned int m_ypos; //y position (row number)
unsigned int m_id; // node Id
unsigned int m_H; // heuristic
unsigned int m_G; // total cost
... |
#include "XyCryptoEx.h"
#include "XyCrypto.h"
#include "base64.h"
std::string XyEnCrypt(unsigned char *pData, unsigned long nLen)
{
if (NULL == pData || 0 == nLen) return "";
std::string strRet;
strRet.append((char *)pData,nLen);
int nXyLen = XyCrypt((unsigned char *)strRet.c_str(), strRet.length());
char * s... |
// Copyright (c) 2016 peposso All Rights Reserved.
// Released under the MIT license
#pragma once
#include <stdio.h>
#include <dirent.h>
#include <sys/stat.h>
#include <iterator>
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <iomanip>
#ifdef _WIN32
#include <windows.h>
#endif
na... |
/*
* 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.
*/
#include <quic/state/QuicStreamFunctions.h>
#include <quic/QuicException.h>
#include <quic/flowcontrol/QuicFlowController.h>
#i... |
#include "mainview.h"
#include "ui_mainview.h"
#include <QPushbutton>
#include <QVboxLayout>
#include <QHboxLayout>
#include <QString>
#include <QFont>
#include<QLabel>
#include "View/cardqpushbutton.h"
int NUM_COLM=8;
int NUM_ROWS=4;
MainView::MainView(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainVi... |
#include "DebugLoc.h"
#include "Metadata.h"
#include "LLVMContext.h"
using namespace LLVM;
DebugLoc::DebugLoc(llvm::DebugLoc *base)
: base(base)
, constructed(false)
{
}
inline DebugLoc ^DebugLoc::_wrap(llvm::DebugLoc *base)
{
return base ? gcnew DebugLoc(base) : nullptr;
}
DebugLoc::!DebugLoc()
{
if (constructed... |
typedef void (*sighandler_t)(int);
static sighandler_t
handle_signal (int sig_nr, sighandler_t signalhandler) {
struct sigaction neu_sig, alt_sig;
neu_sig.sa_handler = signalhandler;
sigemptyset (&neu_sig.sa_mask);
neu_sig.sa_flags = SA_RESTART;
if (sigaction (sig_nr, &neu_sig, &alt_sig) < 0)
retu... |
//
// SnappaState.h
// Snappa
//
// Created by Sam Edson on 6/14/15.
// Copyright (c) 2015 Sam Edson. All rights reserved.
//
#ifndef __Snappa__SnappaState__
#define __Snappa__SnappaState__
#include <stdio.h>
#include <ctime>
#include <string>
#include "Constants.h"
#include "SnappaEvent.h"
#include "SnappaOutp... |
#include "data.h"
/*
int main(int argc, char* argv[])
{
cout << endl << "** Creep v0.1 **" << endl;
cout << "Copyright 1999 Peter J Durrant" << endl;
cout << "email: P.J.Durrant@cs.cf.ac.uk" << endl;
cout << " URL: www.cs.cf.ac.uk/User/P.J.Durrant" << endl << endl;
if (argc != 2) {
cout << "Invalid command,... |
// Created on: 1993-10-11
// Created by: Christophe MARION
// 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
// the terms of the ... |
// Created on: 1998-05-20
// Created by: Christian CAILLET
// Copyright (c) 1998-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 ... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
//
// Copyright (C) Opera Software AS. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
#include "core/pch.h"
#include "modules/logdoc/src/html5/html5entities.h"
#in... |
#include "world.h"
#include <stdexcept>
#include <fstream>
#include <iomanip>
#include <array>
#include <iostream>
using namespace std;
// Construct the world object.
// Note that this takes in an istream (cin or an fstream), NOT a string as per the pdf
World::World(istream &input)
{
string ch;... |
/*************************************************************************************************/
/* @file aePlatformMath.h
/*
/* @brief Declares the platform mathematics class.
/*************************************************************************************************/
#pragma once
#include "aeStdHeaders.h"
... |
#ifndef TREEFACE_POST_TARGET_H
#define TREEFACE_POST_TARGET_H
#include <treecore/ClassUtils.h>
#include <treecore/RefCountObject.h>
namespace treeface
{
class PostSurface;
class PostProcess;
class PostTarget: public treecore::RefCountObject
{
public:
PostTarget();
TREECORE_DECLARE_NON_COPYABLE(PostTarget);... |
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
class NumArray {
public:
NumArray(vector<int>& nums) {
if(nums.size()==0) return;
sum.resize(nums.size());
sum[0]=nums[0];
for(int i=1;i<nums.size();i++)
sum[i]=sum[i-1]+nums[i]... |
#pragma once
#include "Types.h"
#include "Inputs.h"
#include "Constants.h"
#include "Renderer.h"
#include <SDL_mixer.h>
#include <map>
struct PlayerRankingInfo
{
int score;
std::string name;
};
class SceneManager
{
protected:
Mix_Music* soundtrack;
public:
SceneStates state;
SceneManager();
... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 10e17 // 4倍しても(4回足しても)long longを溢れない
#define rep(i,n) f... |
#ifndef _COMMAND_LINE_H_
#define _COMMAND_LINE_H_
#include <string>
#include <sstream>
using std::string;
using std::stringstream;
struct CommandLine {
enum Variant { PARAM_ESTIMATE, TRACK, FEM_TRACK };
Variant d_variant;
string d_path; // template file -- called path for backwards compatibility
string d_fil... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
int main() {
//create a functor for generating uniformly
//distributed, contiguous memory chunk sizes between 1 and
//MAX_CHUNK_SIZE bytes
constexpr int32_t MAX_CHUNK_SIZE{1000000};
std::default_random_engine randEng{};... |
// Created on: 2002-10-18
// Created by: Michael SAZONOV
// Copyright (c) 2002-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 Lesser General Public License version 2.1 ... |
class Solution {
public:
int lengthOfLongestSubstring(string s) {
unordered_map<char, int> last;
int ret=0, left=-1;
for (int i = 0; i < s.length(); ++i) {
if (last.find(s[i])!=last.end() && last[s[i]]>left) {
left = last[s[i]];
}
ret = ma... |
#include <Windows.h>
#include <iostream>
#include "PMemHelper.h"
#include "eftstructs.h"
#include "Overlay.h"
MemoryIO* memio = nullptr;
auto pRender = PRENDER::Instance();
auto gameData = EFTData::Instance();
//render function
void render_scene()
{
// clear the window alpha
d3ddev->Clear(0, NULL, D3DCLEAR_TARGET,... |
#ifndef MAGMA_AST_DECL_H
#define MAGMA_AST_DECL_H
#include "node.h"
namespace magma { namespace ast {
/// Declaration AST nodes.
class decl : public node {
};
}}
#endif // MAGMA_AST_DECL_H
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Bluetooth_module.cpp
* Author: raphael/emma
*
* Created on May 20, 2020, 9:58 AM
*/
#include "Bluetooth_module.h"
... |
#pragma once
#include"Padre.h"
using namespace System::Drawing;
using namespace std;
class PoderTeamA:public Padre
{
private:
bool tranparente;
int indice;//como no tiene pnto en la vertical solo colocamos un indice
int AnchoI;
int AltoI;
public:
PoderTeamA(int x, int y, Bitmap^bmp);
PoderTeamA(... |
#pragma once
#include"AbstractFactory.h"
#include"AbstractProductA.h"
#include"AbstractProductB.h"
class ConcreteFactory2:public AbstractFactory{
public:
ConcreteFactory2();
virtual ~ConcreteFactory2();
virtual AbstractProductA* CreateProductA();
virtual AbstractProductB* CreateProductB();
};
|
#include "pass.hpp"
PassRegistry *PassRegistry::get_pass_registry() {
static PassRegistry PassRegistryObj;
return &PassRegistryObj;
}
void PassRegistry::register_pass(const std::string &name, std::unique_ptr<Pass> &&pass) {
std::lock_guard<std::mutex> _(lock);
pass_map[name] = std::move(pass); //<- 注意... |
/*******************************************************************************
Copyright (c) 2010, Steve Lesser
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1) Redistributions of source code must retain the above c... |
#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
//基本思想:快速选择算法,只要n-k的左边是小于nums[n-k]的值,n-k的右边是大于nums[n-k]的值
//那么n-k就是我们要找的Top k,问题转化为如何切割左右数组,并找到 Top k 对应的 pivot
int target=nums.size()-k;
int left... |
/*
* Creates a new file and hard link to some existing file
* A simple program to test hard-linking
*/
#include "Kernel.h"
#include <stdlib.h>
#include <string.h>
#define BUF_SIZE 4096
int main(int argc, char ** argv)
{
char PROGRAM_NAME[8];
memset(PROGRAM_NAME, '\0', 8);
strcpy(PROGRAM_NAME, "ln");
// initi... |
// https://practice.geeksforgeeks.org/problems/k-sum-paths/1/
#include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int d){
this->data =d;
this->left = NULL;
this->right = NULL;
}
};
Node* buildTree(Node* root){
i... |
#ifndef GLOBAL_H
#define GLOBAL_H
#include "waittingpage.h"
#include "hintpage.h"
#include "aboutpage.h"
#include "gamepage.h"
#include "pausingpage.h"
#include "game/GreedySnakeGame.h"
class Global
{
public:
static WaittingPage* waittingPage;
static HintPage* hintPage;
static AboutPage* aboutPage;
st... |
#include "qviewport.h"
namespace qEngine
{
qViewport::qViewport(void) : m_fScreenWidth(0.0f), m_fScreenHeight(0.0f), m_fOrthoClipNear(0.0f),
m_fOrthoClipFar(0.0f), m_fPOV(0.0f), m_fProjClipNear(0.0f), m_fProjClipFar(0.0f)
{
}
qViewport::~qViewport(void)
{
}
void qViewport::setScreenDimensions(float fWidth... |
#include <iostream>
#include "Q03.h"
using namespace std;
Graph_DG::Graph_DG()
{
//初始化顶点数和边数
vexNum = 9; // 9
edgeNum = 15; // 15
cout << "---" << endl;
arc = new int*[vexNum];
for(int i=0; i<vexNum; i++)
{
arc[i] = new int[vexNum];
for(int j=0; j<vexNum; j++)
... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QGraphicsScene>
#include <QTimer>
#include <QFile>
#include <string.h>
#include "planeta.h"
#include "graficar.h"
#include <iostream>
#include <fstream>
#include <QDesktopWidget>
using namespace std;
namespace Ui {
class MainWindow;
}
class M... |
#ifndef BHAND_ROBOT_HAND_H
#define BHAND_ROBOT_HAND_H
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <vector>
#include <memory>
#include <functional>
#include <map>
#include <string>
#include <thread>
#include <mutex>
#include <chrono>
#include <condition_variable>
#include <urdf/model.h>
#include... |
/*
* GlobalEvent.h
*
* Created on: Jul 22, 2017
* Author: root
*/
#ifndef GLOBALEVENT_H_
#define GLOBALEVENT_H_
#include "EventSet/EventSet.h"
#include "EventSet/SubscriberSlot.h"
#include "EventSet/EventArgs.h"
#include "Singleton.h"
using namespace CommBaseOut;
class GlobalEvent : public Singleton<Glob... |
#include <assert.h>
#include <stdio.h>
#include <queue>
#include <string.h>
#include <stdlib.h>
#include <openssl/bn.h>
#include <openssl/sha.h>
#include <openssl/md5.h>
#include <time.h>
#include <inttypes.h>
#include <vector>
#include "leveldb/db.h"
#include <iostream>
// #define ANALYSIS_DB "./db/"
#define FP_SIZE 6... |
#ifndef ABB_H
#define ABB_H
#include "NODOABB.H"
class ABB
{
private:
NodoABB *raiz;
int i = 0;
void entreorden(NodoABB* aux);
void postorden(NodoABB* aux);
void preorden(NodoABB* aux);
void inserta(int v, NodoABB *&raiz);
void destructor(NodoABB* aux);
... |
#include<stdio.h>
#include<string.h>
#define EPS 1e-6
const int max1 = 512;
const int max2 = 85;
char sid[max1][max2], name[max1][max2];
int cid[max1], score[max1][5], rank[max1], removed[max1];
int n = 0;
void print_students()
{
printf("Current student num: %d\n", n);
for(int i = 0; i < n; i++) {
... |
#include "orderbook.hpp"
void Orderbook::msg_received(Exchange &source)
{
// aggregation of the data is not a cheap operation
// complexity of such aproach is really high O(n*log n)
// this will get slower with more elements in the structure
// not sure if this is the goal of the task???
auto ords... |
#ifndef COINTOSSTILE_H
#define COINTOSSTILE_H
#include <QPushButton>
class CointossTile : public QPushButton
{
Q_OBJECT
public:
explicit CointossTile(int number, bool unique, QWidget *parent = 0);
~CointossTile();
bool getUnique();
private:
int number;
bool unique;
};
#endif // COINTOSSTILE... |
#ifndef ARRAY_UNIQUE_HPP
#define ARRAY_UNIQUE_HPP
#include <set>
#include <vector>
namespace Array
{
template <typename T>
static void unique(std::vector<T> &vec)
{
std::set<int> s(vec.begin(), vec.end());
vec.assign(s.begin(), s.end());
}
}
#endif /* end of include guard : ARRAY_UNI... |
/*
A more complex python integraion from CS 210
Most code was provided by the professor, and modified to complete simple tasks
*/
#include <Python.h>
#include <iostream>
#include <Windows.h>
#include <cmath>
#include <string>
using namespace std;
/*
Description:
To call this function, simply pass the function name... |
#include "stdafx.h"
// Rich Salz wildmat function, as he defined it. Will stick to
// standards, so I have copied it from UNIX systems.
static int DoMatch(const char *text, const char *p, const char* end)
{
int matched;
for (; *p && (end?text<end:TRUE); text++, p++)
{
if (*text... |
/*
* Copyright (c) 2011 Pierre-Etienne Bougué <pe.bougue(a)gmail.com>
* Copyright (c) 2011 Florian Colin <florian.colin28(a)gmail.com>
* Copyright (c) 2011 Kamal Fadlaoui <kamal.fadlaoui(a)gmail.com>
* Copyright (c) 2011 Quentin Lequy <quentin.lequy(a)gmail.com>
* Copyright (c) 2011 Guillaume Pinot <guillaume.pino... |
// Copyright (C) 2014, 2015, 2016 Alexander Golant
//
// This file is part of csys project. This project 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... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "HighScoreSaveGame.h"
#include "ShootingGallery.h"
UHighScoreSaveGame::UHighScoreSaveGame(){
SaveSlotName = TEXT("high_score");
UserIndex = 0;
}
// Adds leading zeros to high score - Modified function from https://mylittledevb... |
#include <iostream>
using namespace std;
int main()
{
int n;
int *p = new int[50];
cout << "Enter Number Of Elements" << endl;
cin >> n;
int *pa = new int[n];
for (int i = 0; i < n; i++)
{
cin >> pa[i];
}
int max = -1;
for (int i = 0; i < n; i++)
... |
#include <exception>
#include <iostream>
#include <cmath>
#include <list>
#include <random>
#include <string>
#include <vector>
#include <cstdlib>
#include "boost/dynamic_bitset.hpp"
#include "lazy_heap.hpp"
#include "index.hpp"
#include "wfc_image.hpp"
using namespace std;
typedef boost::dynamic_bitset<> OneHotTil... |
// AppManagerDlg.h : 头文件
//
#pragma once
#include "afxcmn.h"
// CAppManagerDlg 对话框
class CAppManagerDlg : public CDialogEx
{
// 构造
public:
CAppManagerDlg(CWnd* pParent = NULL); // 标准构造函数
~CAppManagerDlg(); //析构函数
// 对话框数据
enum { IDD = IDD_APPMANAGER_DIALOG };
protected:
virtual void DoDataExchange(CDataExcha... |
#ifndef _opSofa_SOFASSTARTSRV_HPP_
#define _opSofa_SOFASSTARTSRV_HPP_
#include <iostream>
#include <fwTools/Failed.hpp>
#include <fwServices/ObjectMsg.hpp>
#include <fwGui/IActionSrv.hpp>
namespace opSofa
{
/**
* @brief Service allow to start or stop Sofa
*/
class SofaStartSrv : public ::fwGui::IActionSrv
{
... |
#pragma once
#include <string>
#include <iostream>
class CEngine
{
public:
CEngine(void);
~CEngine(void);
double getThrustMax(void);
void setupEngine(void);
int getQuantity(void){return quantity;}
std::string getName(void){return name;}
private:
int quantity;
std::string name;
double t... |
#include<stdio.h>
#include<conio.h>
#include<string.h>
using namespace std;
void replace(int de,char s[],char str1[]);
void findnreplace(char s[],char str1[],char str2[])
{
int cnt;
int length = strlen(s)-1;
int l=strlen(str1)-1;
printf("%d",l);
... |
/*
Petar 'PetarV' Velickovic
Algorithm: Z Algorithm
*/
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <complex>
#define MAX_N 1000001
using n... |
#include <iostream>
#include <vector>
using namespace std;
// helper method to determine if << operator exists for type T
// return false if unused evalues to ostream
template<typename T, typename unused = decltype(cout << T())>
std::false_type has_ostream_helper(const T&);
template<typename T>
std::true_type has_os... |
// Selection Sort Algorithm
// Time Complexity is O(n^2) Space Complexity is O(1)
// Easy to implement. Slower than Insertion Sort but faster than Bubble Sort
#include <iostream>
using namespace std;
void selectionSort(int[], int);
int main() {
int myArray[] = { 24, 67, 50, 8, 29, 116, 125, 48, 110, 82,... |
#include <iostream>
#include <cassert>
int fib(int n)
{
if (n <= 1)
return n;
return fib(n - 1) + fib(n - 2);
}
int fib_notR() {
int n1 = 0, n2 = 1, n3, i, number;
std::cout << "Enter the number of elements: ";
std::cin >> number;
std::cout << n1 << " " << n2 << " ";
for (i = 2;... |
#include<vector>
#include "Car.h"
#include "MotorBike.h"
#include "Tree.h"
#include "House.h"
using namespace std;
int main() {
vector<BaseObject*> listObj;
BaseObject* car = new Car(1, "car", 4, 5);
BaseObject* motorbike = new MotorBike(2, "motorbike", 5, 6);
BaseObject* tree = new Tree(3, "tree", 6, 7);
BaseObje... |
/***CONSTRUCTION ZONE***/
#include "Locations_Perth.h"
|
/*
Newtons Method
Prac 4
by Alan Agon
a1636896
*/
#include <iostream>
#include <cmath>
#include <assert.h>
#define TOL 1e-5
using namespace std;
double sqRoot(double a);
int main(void) {
cout << "Enter an integer number square root: ";
int a;
cin >> a;
cout << "The square root of " << a << " is " << sqRo... |
#include <iostream>
int main() {
// スラッシュ2つから始まる行はコメント
// コメントは実行されない
// std::cout << 1 + 1;
/*
複数行にまたがる場合はこんな風にコメントを書く
*/
}
|
#include<iostream>
using namespace std;
int main(){
char s[1000],a[1000];
int j=0;
cout<<"enter s:"<<endl;
cin>>s;
for(int i=0;s[i]!=0;i++){
if(s[i]<='9'&&s[i]>='0'){
a[j]=s[i];
j++;
cout<<s[i];
}
else if(s[i]=='*'||s[i]=='/'||s[i]=='+'||s[i]=='-'){
a[j]='a';
a[j+1]=s[i];
... |
#ifndef NONBREAKING_PREFIX_SET_HH
#define NONBREAKING_PREFIX_SET_HH
#include "regex.hh" // for string_type
#include <string>
#include <unordered_set>
#include <regex>
namespace moses { namespace tokenizer {
class NonbreakingPrefixSet {
public:
template <std::size_t Size> NonbreakingPrefixSet(unsigned char (&data)[S... |
#include "GrammarTree.h"
GrammarTree::GrammarTree()
{
Expression=0;
}
GrammarTree::GrammarTree(const wchar_t* Input)
{
Expression=Input;
}
void GrammarTree::GetGrammarTree()
{
GetA(Data.TreeHead);
}
void GrammarTree::SetErrorMessage(const LytWString ErrorInformation)
{
ErrorMessage=L"正则表达式出错 ... |
#include<bits/stdc++.h>
using namespace std;
bool PrimarilityTest(int n,int q,int k){
srand(time(NULL));
//Step 2:
int a = 2 + rand()%(n-4) ;
cout<<"\na = "<<a;
//Step 3:
int x = (int(pow(a,q)) %n );
if( x == 1 || x == n-1 )
return true;
for(int j=1;j<k;... |
#include <QCoreApplication>
#include "testserv.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
TestServ * tcpControl = new TestServ();
return a.exec();
}
|
/*
* settings.cpp
* deflektor-ds
*
* Created by Hugh Cole-Baker on 4/4/09.
*
*/
#include "settings.h"
#include "bar.h"
Settings* Settings::instance = NULL;
Settings& Settings::get()
{
if(instance == NULL)
{
instance = new Settings();
}
return *instance;
}
Settings::Settings() : musicOn(true), s... |
#ifndef CARD_H
#define CARD_H
#include <string>
using namespace std;
class Card{
private:
int value;
string cardName;
public:
Card(); // Default constructor
~Card();// default destructor
Card(const string, const int);
int getValue()const;
void setValue(int);
void setName(string);
string getName(... |
#include <LiquidCrystal_I2C.h>
#include <SPI.h>
#include <SD.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include "dht.h"
#include "RTClib.h"
#include "Temp.h"
#define EndStop_A0_Pin 12 //第一扇遮阳帘的收起
#define EndStop_A1_Pin 13 //第一扇遮阳帘的展开
#define EndStop_B0_Pin 8 //第二扇遮阳帘的收起
#define EndStop_B1_Pin 9 //第二扇遮阳帘的展... |
#include <ESP8266WiFi.h>
#include<SoftwareSerial.h>
#include <ArduinoJson.h>
SoftwareSerial xbee(D3, D4); //Rx, Tx
String input;
//long Flux,Vibration,Force;
// ThingSpeak Settings
const char* ssid = "SSID";
const char* password = "password";
const char* host = "api.thingspeak.com";
const char* privateKey = "thi... |
#include "global.h"
vector<Receiver> Data::read_receivers() {
char file[256];
filename(file,"receivers.dat");
FILE *in = fopen(file,"r");
if (in == NULL)
INFO("no input receivers.dat",true);
int nr;
fscanf(in,"%d",&nr);
int relative;
fscanf(in,"%d",&relative);
vector<Receiver> recs;
float tx,ty,tz;
for ... |
#include "bits/stdc++.h"
using namespace std;
int main()
{
int N; cin>>N;
int i=N;
while (i>1)
{
if (N%i==0 and i<=10 )
{
cout<<i;
return 0;
}
i--;
}
cout<<i;
return 0;
} |
// Copyright 2017 Elias Kosunen
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to ... |
#include <experimental/iterator>
#include <fstream>
#include <iostream>
#include <sstream>
#include <vector>
#include "script_utils.h"
std::string generatePythonCode(DFA dfa) {
std::stringstream builder;
std::vector<std::string> acceptors;
std::set<char> alphabet = dfa.get_alphabet();
dfa::states_t states = dfa.g... |
// Copyright (c) 2023 ETH Zurich
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#include <pika/config.hpp>
#include <pika/async_mpi/mpi_exception.hpp>
#incl... |
// Copyright 2012 Yandex
#include "ltr/learners/id3_learner.h"
|
#ifndef CREQUESTXMLMESSAGE_H
#define CREQUESTXMLMESSAGE_H
#include "CMessage.h"
#include <QObject>
//ÇëÇóXMLÏûÏ¢
class CRequestXmlMessage : public CMessage
{
Q_OBJECT
public:
CRequestXmlMessage(CMessageEventMediator* pMessageEventMediator, QObject *parent = 0);
~CRequestXmlMessage();
virtual bool packedSendMess... |
// ==============================================================
// RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2014.4
// Copyright (C) 2014 Xilinx Inc. All rights reserved.
//
// ===========================================================
#ifndef _filter_top_dummy_proc... |
//: C15:OStackTest.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
//{T} OStackTest.cpp
#include "OStack.h"
#include "../require.h"
#include <fstream>
#include <iostream>
#include <string>
... |
#include <iostream>
struct Date {
int day;
int month;
int year;
};
bool check(int day,int month) {
if(1 > month || 12 < month || 1 > day) {
return false;
}
if((1 == month || 3 == month || 5 == month || 7 == month || 8 == month || 10 == month || 12 == month) && 31 < day) {
retur... |
// -------------------------------------------------------------------
//
// basho_metrics: fast performance metrics for Erlang.
//
// inspired and partially derived from Coda Hale's 'metrics'
// Copyright (c) 2010-2001 Coda Hale
// https://github.com/codahale/metrics/blob/development/LICENSE.md
//
// Copyright (c) ... |
//------------------------------------------------------------------------------
/*
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... |
#include <Tanker/TrustchainPuller.hpp>
#include <Tanker/Client.hpp>
#include <Tanker/Crypto/Crypto.hpp>
#include <Tanker/Crypto/Format/Format.hpp>
#include <Tanker/Entry.hpp>
#include <Tanker/Errors/AssertionError.hpp>
#include <Tanker/Errors/Exception.hpp>
#include <Tanker/Log/Log.hpp>
#include <Tanker/Serialization/... |
#pragma once
#include "Viewer.hpp"
template<typename T>
class NullViewer : public Viewer<T>{
public:
inline void show(std::string_view name, T* first) override {
}
}; |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2002 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef CHANGENICK_H
#define CHANGENICK_H
#include "adjunct/q... |
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <tuple>
#include <string>
#define FILE_OUTPUT
// #define CONSOLE_OUTPUT
// definition of data types
typedef std::string Word;
typedef std::vector<Word> WordList;
typedef std::vector<WordList> Sent... |
// -------------------------------------------------------------------
//
// basho_metrics: fast performance metrics for Erlang.
//
// inspired and partially derived from Coda Hale's 'metrics'
// Copyright (c) 2010-2001 Coda Hale
// https://github.com/codahale/metrics/blob/development/LICENSE.md
//
// Copyright (c) 2... |
#include "..\Group.h"
#include "..\testMacros.h"
#include "..\exceptions.h"
using namespace mtm;
bool ConstractorGroup(){
ASSERT_EXCEPTION(Group("", 1, 1), GroupInvalidArgs);
ASSERT_EXCEPTION(Group("","",10,40,70, 1,300), GroupInvalidArgs);
ASSERT_EXCEPTION(Group("Invalid","",10,40,70, 1,300), GroupInvali... |
#ifndef MISC_INCLUDED
#define MISC_INCLUDED
int get_time_ms();
#endif // #ifndef MISC_INCLUDED
|
#include <iostream>
#include <unordered_map>
#include <bitset>
using namespace std;
// 文字コードがASCIIかUnicodeかを面接官に確認する。
// 今回はASCIIと仮定する。
// ASCIIでは128文字を収録している。
// 8ビットで256文字を扱うことができるが、
// 残り半分はメーカーや国によって異なる文字や記号が収録されている。
// 今回は質問した上で、面接官と128文字を扱うプログラムを作る。
bool is_unique(string s){
if(s.size() > 128) return false; /... |
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
vector<string> fullJustify(vector<string>& words, int maxWidth) {
//基本思想:贪心法,这是一道像公司的业务逻辑且麻烦又没有太大练习价值的题
vector<string> res;
//words_len记录当前行cur中所有单词长度,space_len记录maxWidth中除去单词长度后剩下的空格长度
//q和r用来表示每两个单词间需要填充的空格数... |
#pragma once
#ifndef _RECEIVE_PROTO_FUNC_H
#define _RECEIVE_PROTO_FUNC_H
#include "../pb/srvRes.pb.h"
#include "../cmd/ReceiveProto.h"
using namespace std;
namespace CPPClient
{
namespace Net
{
namespace Func
{
class ReceiveProto : public CPPClient::Net::Cmd::ReceiveProto
... |
/* -*- 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.
*/
#include "core/pch.h"
#ifdef XPATH_SUPPORT
#include "modules/xpath/src/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.