text stringlengths 8 6.88M |
|---|
#include "../include/Responses.h"
void Responses::Start(TgBot::Bot tgbot, TgBot::Message::Ptr message){
saveAdminId(std::to_string(message->chat->id), tgbot, message);
}
void Responses::Temperature(TgBot::Bot tgbot, TgBot::Message::Ptr message){
tgbot.getApi().sendMessage(message->chat->id, getPiTemperature());
}
... |
#include <iostream>
#include <cstring>
#include <string>
using namespace std;
// const int maxn = 1000 + 10;
// char ch[maxn];
int convert(string str, int len){
int sum = 0;
for (int i = 0; i < len; ++i)
sum = 10*sum + (str[i] - '0');// key!!!
return sum;
}
int main(){
int a;
string symb;
string t;
string ... |
#pragma once
#include "Object.h"
#include <time.h>
class Ghost : public Object
{
protected:
Vec2 initialPosition;
int lastAnimation;
int lastAnimationPowerUP;
bool dead;
float deltaTime;
clock_t lastTime;
float timeDown;
float deltaTimeRespawn;
clock_t lastTimeRespawn;
float timeDownRespawn;
public:
int dire... |
// 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 "ProcessesDataView.h"
#include <utility>
#include "App.h"
#include "Callstack.h"
#include "ModulesDataView.h"
#include "Params.h"
#include "ab... |
//
// Created by Nikita Kruk on 03.12.17.
//
#include "AbcSmcEngineSynthetic.hpp"
#include "SimulationEngineForSyntheticData.hpp"
#include <iostream>
#include <sstream>
#include <algorithm> // std::for_each
#include <boost/math/distributions/uniform.hpp>
#include <boost/math/distributions/normal.hpp>
AbcSmcEngin... |
// 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.... |
// Created on: 1994-03-14
// Created by: s: Christophe GUYOT & Frederic UNTEREINER
// Copyright (c) 1994-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 un... |
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn = 1e6 + 7;
int flag[maxn],cnt = 0;
int find(int l,int r,int tar){
int i;
for(i = l;i < r;i++){
if(flag[i]>=tar)
break;
}
if(i==r||(i==l&&flag[l]>tar)){
return tar;
}
if(flag[i]==tar){
if(i+1<r)
find(i+1,r,t... |
#include "pch.h"
#include <iostream>
#include <thread>
#include <fstream>
#include <vector>
#include <string>
#include <future>
#include "Quicksort.h"
#include "BubbleSort.h"
#include "Heapsort.h"
#include "InsertionSort.h"
#include "MergeSort.h"
#include "Swap.h"
//sortTest() will add all the scores int... |
#include <stdio.h> // basic I/O
#include <stdlib.h>
#include <sys/types.h> // standard system types
#include <netinet/in.h> // Internet address structures
#include <sys/socket.h> // socket API
#include <arpa/inet.h>
#include <netdb.h> // host to IP resolution
#include <string.h>
#include <unistd.h>
#include <iostream>
... |
#include "BaseSprite.h"
BaseSprite::BaseSprite()
{
}
BaseSprite::~BaseSprite()
{
}
void BaseSprite::run()
{
_isRunFinish = false;
auto callback = CallFunc::create([=](){
_isRunFinish = true;
});
auto move = MoveTo::create(_speed, getTagPosition());
auto act = Sequence::create(move, callback, NULL);
th... |
#ifndef GRAPHICSTEST_CIRCLE_H
#define GRAPHICSTEST_CIRCLE_H
#include "object.h"
class Circle : public Object
{
public:
float radius;
Circle(int mass, vector2d start_pos, vector2d start_vel, float radius) : radius(radius), Object(mass, start_pos, start_vel)
{
this->collider = new CircleCollider();
}
virtual v... |
// Created on: 1991-04-24
// Created by: Remi GILET
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Les... |
/********************************************************************************
This is a library for converting images already located in RAM to
lower bit-depth versions with different kinds of dithering algorithms.
WARNING: These algorithms operate on the microcontroller's RAM buffer
in order to apply chang... |
//: C16:Array2.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
// Definicja szablonu funkcji,
// niebedacej funkcja inline
#include "../require.h"
template<class T>
class Array {
enum ... |
// C++ program for implementation of Heap Sort
#include <iostream>
#include <algorithm>
using namespace std;
// A - tablica indeksowana od 0
// n -dlugosc tablicy A
// k - ilość liczb w przedziale [0,największa_liczba_w_A], UWAGA k = max_element(A)+1
void counting_sort(int A[],int n,int k){
int B[n], C[k];
f... |
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Matt Olan, Prajjwal Bhandari
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the r... |
#include <bits/stdc++.h>
using namespace std;
// Definition for singly-linked list.
struct ListNode
{
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution
{
public:
... |
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <fstream>
#include <iostream>
#include "document.h"
#include "lda.h"
#include <jni.h>
#include <android/log.h>
using namespace std;
struct corpus* read_corpus(char* corpus_name,int doc_num)
{
ifstream infile(corpus_name);
string line;
... |
#pragma once
#include <memory>
#include "QuestionViewController.h"
namespace qp
{
class IQuestionViewControllerFactory
{
public:
virtual std::unique_ptr<CQuestionViewController> CreateViewControllerForState(IQuestionStatePtr const& state) = 0;
virtual ~IQuestionViewControllerFactory(){};
};
} |
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.unoproj.g.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.UX.PropertyAccessor.h>
namespace g{namespace Uno{namespace UX{struct PropertyObject;}}}
namespace g{namespace Uno{namespace UX{stru... |
#ifndef TREEFACE_IMAGE_MANAGER_H
#define TREEFACE_IMAGE_MANAGER_H
#include "treeface/base/Common.h"
#include <treecore/Result.h>
#include <treecore/RefCountObject.h>
#include <treecore/RefCountSingleton.h>
#include <treecore/Identifier.h>
namespace treeface {
class Image;
class ImageManager: public treecore::RefCo... |
int row[101] = {0};
int ld[101] = {0};
int rd[101] = {0};
bool isValid(int i, int j, int n) {
if (row[i] || ld[i + j] || rd[i - j + n - 1])
return 0;
return 1;
}
void nextQueen(int n, int col, vector<string> board, vector<vector<string> > &ans) {
if (col == n) {
ans.push_back(board);
return;... |
#include <tr1/array>
#include <tr1/memory>
#include <iostream>
#include "Hyperbolic2d.h"
#include "Assert.h"
#include <Eigen/Dense>
#include <utility>
#include <algorithm>
using Eigen::Vector2d;
using Eigen::Matrix2d;
Hyperbolic2d::Point::Point(double x, double y) {
assert(y > 0.00000001);
coordinates[0] = x;
coor... |
// Created on: 2002-04-23
// Created by: Alexander KARTOMIN (akm)
// 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 ver... |
#include "ValueSymbolTable.h"
#include "llvm/ADT/StringRef.h"
#include "Value.h"
#include <msclr/marshal.h>
using namespace LLVM;
ValueSymbolTable::ValueSymbolTable(llvm::ValueSymbolTable *base)
: base(base)
, constructed(false)
{
}
inline ValueSymbolTable ^ValueSymbolTable::_wrap(llvm::ValueSymbolTable *base)
{
r... |
#include <cstdlib>
void Bar() {
}
void Foo() {
std::atexit(Bar);
}
int main() {
std::atexit(Foo);
}
|
#include <iostream>
using namespace std;
int num_of_possible_paths(int m, int n)
{
if (m == 1 || n == 1)
return 1;
return num_of_possible_paths(m - 1, n) + num_of_possible_paths(m, n - 1);
}
int main()
{
int m,n;
cout<<"Enter the dimension of the matrix M X N: "<<endl;
cout<<"M --> ";
... |
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <memory.h>
#include <math.h>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#include <numeric>
#include <sstream>
typ... |
#include "RootUnit.h"
#include <QDebug>
#include <QApplication>
#include <QStackedWidget>
#include <QVBoxLayout>
int main(int argc, char * argv[]) {
QApplication application(argc, argv);
RootUnit unit;
unit.resize(975, 1100);
unit.show();
return application.exec();
}
|
/*
* Copyright 2016 Freeman Zhang <zhanggyb@gmail.com>
*
* 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 by applic... |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int N,x,a,b;
cin>>N;
vector<int> v(N);
for(int i = 0; i < N ; i++)
cin>>v[i];
ci... |
#pragma once
#include "../../src/entity/gameobject.h"
namespace sge { namespace entity{
class Robot: public GameObject {
public:
enum class State {
IDLE,
WALKING_RIGHT,
WALKING_LEFT,
WALKING_DOWN,
WALKING_UP
};
private:
State m_State;
public:
Robot(graphics::Sprite *sprite);
~Robot(){}
... |
#pragma once
//本来、ヘッダにインクルードするのはだめだが
//継承する場合は防げない
//これが継承のだめなところ
#include"Scene.hpp"
namespace game {
//タイトル画面のシーン
class TitleScene:public Scene{
public:
//Updateをオーバーライドする
//overrideは付けなくても動くが
//付けたほうが美味しい
//理由はhttps://www.google.co.jpを参照
virtual void Update()final override;
};
} |
string multiply(string str1, string str2) {
int m= str1.length();
int n= str2.length();
int v[m+n];
for(int i=0 ; i<m+n ;i++)
v[i]=0;
for(int i= m-1 ; i>=0; i--)
{
for(int j= n-1; j>=0; --j)
{
int mul = (str1[i] - '0') * (str2[j]-'0... |
#include<vector>
using std::vector;
#include<algorithm>
#include<memory>
using std::shared_ptr;
#include<string>
using std::string;
#include<stack>
using std::stack;
/*
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
The brackets must close in the... |
#pragma once
#include "StateMachine.h"
#include "Enums.h"
/*
PlayerStateMachine represents the various states the player can be in
as well as its transitions.
*/
class Orientation;
class PlayerStateMachine : public StateMachine
{
public:
PlayerStateMachine();
~PlayerStateMachine();
void Start(GameObject* aOwne... |
/*
This file is part of KDevelop
Copyright 2013 Olivier de Gaalon <olivier.jg@gmail.com>
Copyright 2013 Milian Wolff <mail@milianw.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Soft... |
/**
* Peripheral Definition File
*
* WWDG - Independent watchdog
*
* MCUs containing this peripheral:
* - STM32F7xx
*/
#pragma once
#include <cstdint>
#include <cstddef>
#include "io/reg/stm32/_common/wwdg.hpp"
namespace io {
namespace base {
static constexpr size_t WWDG = 0x40002c00;
}
static Wwdg &WWDG =... |
//一眼看上去感觉很简单,试试 做完发现果然很简单. 刚开始还考虑了一下动态规划来着 还好没朝着动态规划做下去
// 50 ms 28.04 %
class Solution {
public:
int findUnsortedSubarray(vector<int>& nums) {
if(nums.size()==0){
return 0;
}
vector<int> sorted = nums;
sort(sorted.begin(),sorted.end());
int low=0;
while(low<nums.size()&... |
#pragma once
namespace Прокект {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::IO;
using namespace System::Xml;
/// <summar... |
#ifndef BASIC_ARRAY_2D_H
#define BASIC_ARRAY_2D_H
#include <iostream>
#include <iomanip>
#include <assert.h>
#include <stdlib.h>
using namespace std;
template <class T>
class BasicArray2D
{
inline unsigned int index(unsigned int, unsigned int);
public:
unsigned int rows, cols;
T *data=NULL;
Bas... |
//2018研究生上机测试
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
bool check_like(vector<int> &num)
{
int length = num.size();
for (int i = 0; i < length / 2; i++)
{
if (num[i] != num[length - i - 1])
{
return false;
}
}
int sum = 0;
for ... |
/*****************************************
* (This comment block is added by the Judge System)
* Submission ID: 16595
* Submitted at: 2015-05-09 11:49:57
*
* User ID: 94
* Username: 53064064
* Problem ID: 178
* Problem Name: The Problem with the Problem Setter(Easy ver.)
*/
#include<iostream>
... |
#pragma once
#include <SFML/Window.hpp>
#include <atomic>
#include "modules/graphics/DrawModule.h"
#include "modules/physics/PhysicsModule.h"
#include "modules/input/EventModule.h"
#include "modules/entities/EntitiesModule.h"
#include "modules/ModuleManager.h"
#include "time/GTime.h"
#include "input/implementa... |
#ifndef _CRegGetLdCode_h_
#define _CRegGetLdCode_h_
#pragma once
#include <string>
#include "CHttpRequestHandler.h"
class CRegGetLdCode : public CHttpRequestHandler
{
public:
CRegGetLdCode(){}
~CRegGetLdCode(){}
virtual int do_request(const Json::Value& root, char *client_ip, HttpResult& out);
private:
... |
#include "CDialogUtils.h"
ofstream infile;
//----------------------------------------------------------------------------------------------------------------------
LRESULT CALLBACK _HyperlinkParentProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
WNDPROC pfnOrigProc = (WNDPROC)GetProp(hWnd, PROP_O... |
#pragma once
#ifndef AUSTRIA_HPP
#define AUSTRIA_HPP
#include "Country.hpp"
/*************************************************************************
* class Austria
* This is a derived class from Country.
*************************************************************************/
class Austria : public Country... |
#ifndef _PATCH_H_
#define _PATCH_H_
#include "Mesh.h"
class Patch {
public:
Patch() : mesh(patch_vertices, patch_faces, new_vertex_boundary_markers, new_part_of_original_stroke, new_mapped_indices, new_sharp_edge, -1) {
parent_vertices = Eigen::VectorXi();
parent_faces = Eigen::VectorXi();
new_vertex_boundar... |
//
// EPITECH PROJECT, 2018
// nanotekspice
// File description:
// simulate chipsets
//
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <vector>
#include "../include/Parser.hpp"
#include "../include/Link.hpp"
#include "../include/ErrorManage.hpp"
Parser::Parser(std::string path... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* Copyright (C) 2010-2011 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef MEDIA_ELEMENT_STATE_H
#defin... |
//
// Created by drunkgranny on 11.04.16.
//
#include <iostream>
using namespace std;
void usenew()
{
int nights = 1001;
int *pt = new int; //Выделение пространства для int
*pt = 1001; //Сохранение в нем значения
cout << "nights value = ";
cout << nights << ": location " << &nights << end... |
/*
* Copyright 2012 Google Inc.
*
* 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 by applicable law or agreed to... |
/* -*- 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.
*/
#include "core/pch.h"
#include "modules/prefs/prefsmanager/pref... |
// Copyright 2011 Yandex
#include <gtest/gtest.h>
#include "ltr/data/data_set.h"
#include "ltr/data/object.h"
#include "ltr/data/feature_info.h"
#include "ltr/utility/numerical.h"
#include "ltr/parameters_container/parameters_container.h"
#include "ltr/learners/composition_learner/composition_learner.h"
#include "lt... |
#include <algorithm>
#include "../chapter2-sorting-basic/SortTestHelper.h"
using namespace std;
template <typename T>
int partition(T arr[], int l, int r) {
int v = arr[l];
int i = l;
int j = r + 1;
while (true) {
while (arr[++i] < v)
if (i >= r) break;
while (arr[--j] >... |
#pragma once
#include <Vector>
#include "Person.h"
class region
//change this to individual based rather than floats.
{
private:
std::vector<Person*> populationList;
float density;
int population;
int x; //position on the grid.
int y;
public:
region(int pop, float d, int x_n, int y_n );
~region();
void ... |
#include "WidgetRecognitionText.hh"
#include "WidgetContainer.hh"
#include "AudioStream.hh"
#include <pglabel.h>
WidgetRecognitionText::WidgetRecognitionText(PG_Widget *parent,
const PG_Rect &rect,
AudioInputController *audi... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* @author Arjan van Leeuwen (arjanl)
*/
#ifndef X11_INPUT_CONTEXT
#define X11_INPUT_C... |
#include<iostream>
#include<fstream>
#include<vector>
#include<queue>
#include<sys/time.h>
using namespace std;
struct timeval start, endf;
struct nodeComponent{
int node;
int componentId;
};
class Comparator
{
public:
bool operator()(nodeComponent& n1, nodeComponent& n2)
{
if (n1.componentI... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser.
** It may not be distributed under any circumstances.
*/
#ifndef DOM_EXTENSIONS_TABAPICACHE_H
#define DOM_EXTENSIONS_TABAPIC... |
/*
Copyright © 2006, Drollic
All rights reserved.
http://www.drollic.com
Redistribution of this software in source or binary forms, with or
without modification, is expressly prohibited. You may not reverse-assemble,
reverse-compile, or otherwise reverse-engineer this software in any way.
THIS SOFTWARE ("S... |
#include "PlayerManager.h"
#include "Actor/Controller/PlayerController/BasePlayerController.h"
#include "Actor/Character/PlayerCharacter/PlayerCharacter.h"
#include "Struct/CharacterClassInfo/CharacterClassInfo.h"
#include "Struct/EquipItemInfo/EquipItemInfo.h"
UPlayerManager::UPlayerManager()
{
static ConstructorH... |
// Created on: 1996-09-25
// Created by: Christian CAILLET
// Copyright (c) 1996-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; 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.
*
* Arjan van Leeuwen (arjanl)
*/
#include "core/pch.h"
#include "adjunct/quick_toolki... |
#ifndef _CDL_TCP_Handler_H_
#define _CDL_TCP_Handler_H_
#include "poller.h"
class CDL_TCP_Handler : public CPollerObject
{
public:
CDL_TCP_Handler(){};
virtual ~CDL_TCP_Handler(){};
public:
virtual int OnClose()=0; // 连接断开后调用 注意:如果返回1则不会删除对象只会关闭连接
virtual int OnConnected()=0; // 连接成功建立后调用
virtual... |
// Copyright 2014-2018 The Monero Developers
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
//
// Please see the included LICENSE file for more information.
#include "CryptoNote.h"
#include <vector>
namespace mnemonics
{
crypto::SecretKey mnemonicToPrivateKey(const std::string &words);
crypto::Sec... |
/*
A county collects property taxes on the assessment value of property, which is 60%
of the property's actual value. If an acre of land is valued at $10,000, its
assessment value is $60,000. The property tax is then 64 cents for each $100
of the assessment value. The tax for the acre assessed at $6,000 will be
$38.... |
#include <QPainter>
#include <QBrush>
#include <QPen>
#include <QMessageBox>
#include <QString>
#include <QMouseEvent>
#include <QDialog>
#include <algorithm>
#include "plotter.h"
#include "dialog.h"
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "sculptor.h"
Plotter::Plotter(QWidget *parent... |
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2012-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#ifndef _GDCMIO_DICOMINSTANCEWRITER_HXX_
#define _GDCMIO_DICOMINSTANCEWRIT... |
#pragma once
class Frame
{
private:
bool m_bHardWare; //고성능 타이머 지원 여부
__int64 m_nPreriodTime; //1초에 몇번카운트 하는가?
__int64 m_nLastTime; //마지막 프레임 시간
__int64 m_nCurTime; //현제 시간
__int64 m_nDeltaTime; //이전 프레임과 지난시간
double m_TimeScaleSec; //1카운트 당초.
double m_FrameDeltaSec; //한프레임 경과 초
double ... |
/****************************************************/
// Datastream Template instantiations
/****************************************************/
#ifdef _NATIVE_SSL_SUPPORT_
#endif
|
#include "http/Http.hpp"
// Handle the new request and cut the body to be processed separately
void Http::handleNewRequest()
{
std::string* buff = _read_chain.getFirst(); // OPTIMIMZATION strchr
_requestBuffer.append(*buff);
delete buff;
_read_chain.popFirst();
size_t pos;
// If the end of headers are reached
... |
#include "StaticObjectController.h"
StaticObjectController::StaticObjectController()
{
}
StaticObjectController::~StaticObjectController()
{
}
void StaticObjectController::init(LevelModel* levelModel, StaticObjectView* staticObjectView, StaticObjectLogicCalculator* staticObjectLogicCalculator, int key)
{
m_staticOb... |
#pragma once
namespace ServerEngine
{
class NetModule : public IModuleInterface
{
private:
virtual void StartModule() override;
virtual void ShutdownModule() override;
};
}
|
#ifndef NODE_H
#define NODE_H
#include <stdio.h>
#include <math.h>
#define USE_CONFIG_FILE 0 //if config files are used
#define TIERED_COMMUNITY 1 //if the communities are tiered or randomly assigned
#define TORUS_BOUNDARY 0 //if the community boundaries are torus or reflective
#define TRACE_FORMAT 0 //0: (t x y) form... |
/* Generated from orogen/lib/orogen/templates/tasks/Task.cpp */
#include "Task.hpp"
using namespace camera;
using namespace camera_ids;
using namespace base::samples;
Task::Task(std::string const& name)
: TaskBase(name)
{
}
Task::Task(std::string const& name, RTT::ExecutionEngine* engine)
: TaskBase(name, e... |
#pragma once
#include <wrl\client.h>
#include <d3d11.h>
#include <SpriteFont.h>
#include "Camera.h"
#include "Sky.h"
#include "GameEntity.h"
#include "Lights.h"
class Renderer
{
public:
Renderer(
Microsoft::WRL::ComPtr<ID3D11Device> device,
Microsoft::WRL::ComPtr<ID3D11DeviceContext> context,
Microsoft::WRL::C... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
/************************************************************************************
CHSWAVEReader Class
- WAVE File Reader Class header-
Copyright (C) 2014 HiroakiSoftware. All rights reserved.
************************************************************************************/
#pragma once
#include "CHSRIFFRead... |
/******************************************************************************
* Merge k sorted linked lists and return it as one sorted list. Analyze and
* describe its complexity.
******************************************************************************/
/**
* Definition for singly-linked list.
* struct L... |
/*
Author : AMAN JAIN
DATE: 04-07-2020
PROGRAM -> Horspool algorithm
O(n/m) time in the best case.
O(mn) time in worst case
The worst case occurs when all characters of the text and pattern are same. For example, txt[] = “AAAAAAAAAAAAAAAAAA” and pat[] = “AAAAA”.
*/
#include<bits/stdc++.h>
using namesp... |
/*
Copyright 2021 University of Manchester
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 by applicable law or agreed to in writing, s... |
#include <maya/MGlobal.h>
#include <maya/MFnPlugin.h>
#include "hi_maya.h"
MStatus initializePlugin(MObject obj)
{
MFnPlugin plugin(obj, "kingmax_res@163.com | 184327932@qq.com | iJasonLee@WeChat", "2018.07.23.01");
MStatus status;
status = plugin.registerCommand("HiMaya", HiMaya::creator);
CHECK_MSTATUS_AND_RET... |
// Copyright (c) 2013-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 as published
// by the Free Software Foundation, with spe... |
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
class Fraction;//Объявление класса (Class declaration)
Fraction operator*(Fraction left, Fraction right);//прототип ф-ии
class Fraction
{
int integer; //целая часть
int numerator;
int denominator;
public:
int get_integer()const
{
return i... |
#ifndef _PLAYER_H_
#define _PLAYER_H_
#include "cocos2d.h"
#include "extensions/cocos-ext.h"
#include "cocostudio/CocoStudio.h"
#include "ui/CocosGUI.h"
#include "AppMacros.h"
#include "FootBallCommon.h"
#include "BaseSprite.h"
USING_NS_CC;
USING_NS_CC_EXT;
using namespace ui;
using namespace cocostudio;
enum ... |
#include "applicationmanager.h"
ApplicationManager::ApplicationManager(QQmlApplicationEngine& app_engine, QObject* parent)
: QObject(parent), engine(app_engine)
{
app_engine.rootContext()->setContextProperty("app_man", this);
app_engine.load(QUrl("qrc:/app.qml"));
for (const auto obj : app_engine.rootO... |
#pragma once
#include "moves.h"
class specialMove :public moves
{
public:
specialMove();
std::string specialAbility;
void stun();
void setConfuseRay();
~specialMove();
};
|
// Copyright (c) 2012-2017 The Cryptonote developers
// 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.
#pragma once
#include <system_error>
#include <INode.h>
namespa... |
#include <iostream>
#include <ctime>
#include <string>
#include <array>
#include <vector>
#include <cmath>
#include <cstdlib>
using namespace std;
long long solve();
int main() {
clock_t start = clock();
long long result = solve();
clock_t end = clock();
cout << result << ' ' << (static_cast<double>(end) - start)... |
/**
* Write a program to implement first-fit, best-fit and
* worst-fit allocation strategies.
*
*/
#include <cstring>
#include <iostream>
#define MAX_SIZE 100
using namespace std;
void firstFit(int blockSize[], int m,
int processSize[], int n)
{
int allocation[n];
for (int i = 0; i < n; i++)... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 2003-2006 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
*/
#ifndef __X11_... |
#include<iostream>
#include<conio.h>
#include<math.h>
using namespace std;
int main()
{
int a;
int n;
cout<<"Enter the number of digits :";
cin>>n;
cout<<"Enter the number :";
cin>>a;
int sum=0;
int i,p,d;
int u=pow(a%10,n);
for(i=1;i<n;i++)
{
int z=pow(10,i);
int f=a/z%10;
p=pow(f,n-i);
sum=sum+p;
}
d=sum+u;
if(a==d)... |
#include "deleteconfirmation.h"
#include "ui_deleteconfirmation.h"
deleteConfirmation::deleteConfirmation(QWidget *parent) :
QDialog(parent),
ui(new Ui::deleteConfirmation)
{
ui->setupUi(this);
}
deleteConfirmation::~deleteConfirmation()
{
delete ui;
}
void deleteConfirmation::onYesButtonClicked()
{
... |
//
// ColorDetector.cpp
// RubikSolver
//
// Created by rhcpfan on 15/01/17.
// Copyright © 2017 HomeApps. All rights reserved.
//
#include "stdafx.h"
#include "ColorDetector.hpp"
/**
Extracts the feature vector for the SVM (6 floats: B G R H S V)
*/
std::vector<float> ColorDetector::GetPixelFeatures(const cv::... |
#include<bits/stdc++.h>
using namespace std;
#define maxn 1005
int n,m;
bool vis[maxn][maxn];
int ans;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cin>>n>>m;
if(n>m) swap(n,m);
if(n==1) cout<<m;
else if(n==2){
int ans=0;
ans+=m/4*4;
if(m%4==0)
... |
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<string.h>
#include<sys/types.h>
#include<sys/time.h>
#include"lru_clock.cc"
#include"lru_stack.cc"
#include"fifo.cc"
#include"lru_ref8.cc"
#include"optimal.cc"
#include"lfu.cc"
using namespace std;
int main(int argc, char *argv[]) {
sy... |
#include "CDistributeMessage.h"
#include "Markup.h"
#include "CMessageEventMediator.h"
#include "NetClass.h"
CDistributeMessage::CDistributeMessage(CMessageEventMediator* pMessageEventMediator, QObject *parent)
: CMessage(pMessageEventMediator, parent)
{
}
CDistributeMessage::~CDistributeMessage()
{
}
bool CDistrib... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.