text
stringlengths
8
6.88M
/* This file is part of SMonitor. Copyright 2015~2016 by: rayx email rayx.cn@gmail.com SMonitor is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later ver...
#include "test-tool.hpp" #include <iostream> #include <string> #include <vector> /** * Testing material. Int_array_base have two children classes: * one behaves as expected, the other does not. */ struct Int_array_base { std::size_t m_size; std::vector<int> m_vec; Int_array_base(std::vecto...
#include "cvimagewidget.h" #include "tabwidget.h" using namespace cv; using namespace std; Rect getZoomx2Rect(Point2f p, int width, int height){ Rect r; int x_pos = (int)(p.x * 100) / 20; int y_pos = (int)(p.y * 100) / 20; // w y h r.width = 0.6 * width; r.height = 0.6 * height; // x e ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2007 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 SVG_SUPPORT #include "modules/s...
// Copyright (c) 2012-2015 The Bitcoin Core developers // Copyright (c) 2018-2019 The NavCoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <coins.h> #include <main.h> #include <memusage.h> #include <...
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <fstream> #include <boost/lexical_cast.hpp> using namespace std; using namespace boost; class Neuron; // crtp template<typename Self> struct SomeNeurons { template<typename T> void connect_to(T &other); }; struct Neuron : SomeNeu...
#include <vector> #include <string> #include <iostream> #include <fstream> #include <sstream> #include <list> #include <algorithm> #include <sstream> #include <set> #include <cmath> #include <map> #include <stack> #include <queue> #include <stdio.h> #include <string.h> using namespace std; class PalindromeGame { publ...
#pragma once #include <QAbstractTableModel> #include <QList> class User; class UsersModel : public QAbstractTableModel { public: UsersModel(QObject *parent = nullptr); // QAbstractItemModel interface int rowCount(const QModelIndex &parent) const override; int columnCount(const QModelIndex &parent) c...
// Sharna Hossain // CSC 111 // Lab 5 | loan.cpp #include <iostream> using namespace std; int main() { char graduated, employed; double income; const double MIN_INCOME = 30000.0; cout << "Are you employed? (T/F): "; cin >> employed; cout << "Have you graduated? (T/F): "; cin >> graduated;...
#include "Note.h" /************************************************************** *** Note *** ***************************************************************/ string* Note::ids = new string [5]; unsigned int Note::nbId =0; unsigned int Note::nbMaxId =5; static It...
#include "aeGameObject.h" namespace aeEngineSDK { aeGameObject::aeGameObject() { m_xName = "New GameObject"; m_xTransform.m_pGameObject = this; } aeGameObject::aeGameObject(const String & GO) { m_xName = GO; m_xTransform.m_pGameObject = this; } aeGameObject::aeGameObject(const aeGameObject & GO) { ...
/* Arduino --> ThingSpeak Channel via Ethernet The ThingSpeak Client sketch is designed for the Arduino and Ethernet. This sketch updates a channel feed with an analog input reading via the ThingSpeak API (https://thingspeak.com/docs) using HTTP POST. The Arduino uses DHCP and DNS for a simpler network setup. ...
// 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. #include "gtest/gtest.h" #include "CryptoNoteCore/TransactionApi...
// // Created by nikita on 12/27/19. // #ifndef SERVER_CONNECTION_H #define SERVER_CONNECTION_H #include <thread> #include <queue> #include "../server_epoll/server.h" #include "../taskqueue.h" struct connection { using on_new_message_t = std::function<void (std::string)>; using on_disconnect_t = std::functio...
#include<iostream> #include<vector> #include<algorithm> using namespace std; #define maxn 1200000 int possible[maxn], n, mod = 1000000007; vector<int> divisors[maxn]; int main() { for(int i = 1; i < maxn; i++){ for(int j = i; j < maxn; j += i) divisors[j].push_back(i); reverse(divisors[i].begin(), divisors...
class ItemDocument: CA_Magazine { scope = 2; count = 1; type = 256; displayName = $STR_EPOCH_DOCUMENT; model = "\z\addons\dayz_epoch\models\doc_generic.p3d"; picture = "\z\addons\dayz_epoch\pictures\equip_doc_generic_ca.paa"; descriptionShort = $STR_EPOCH_DOCUMENT_DESC; sfx = "document"; class ItemActions ...
#include <iostream> #include <unistd.h> #include <plib.h> #include <Vec.h> #include <matrix.h> matrix<double> lowq2DenMat(fourVec ein,fourVec eout) { double cos_t,sin_t; matrix<double> R(2,2); matrix<double> Rinv(2,2); matrix<double> Rot(2,2); matrix<double> Rotinv(2,2); matrix<double> denMat(2,2); matri...
#include <conio.h> #include <iostream.h> #include <stdio.h> void main () { clrscr(); int A[5],i; printf("Enter values: "); for (i=0; i<5; i++) { printf("\nA[%d]: ",i); scanf("%d",&A[i]); } printf("\n\nSequential Display"); for (i=0; i<5; i++) printf("\n\nA[%d]: %d",i,A[i]); printf("\n\nRevers...
#include <stdio.h> #include <string.h> #include <iostream> #include <string> #include <windows.h> //definindo constantes #define MAX_CHAR 18 #define MAX_PAL 10 #define MAX_MAT 30 #define AZUL 9 #define VERMELHO 12 #define VERDE 10 #define BRANCO 15 #define AMARELO 6 #define ROXO 13 #define CINZA 8 #define BEGE 14 typ...
#include "gl_framework.h" #include <sstream> #include <map> #include <string> #include "command/glGetIntegerv.h" #include "command/glDeleteTextures.h" #include "command/glBindTexture.h" #include "command/glTexImage2D.h" #include "command/glBlendFunc.h" #include "command/glGetError.h" #include "command/glGenTextures.h"...
/** * created: 2013-4-7 22:53 * filename: FKHashDBPool * author: FreeKnight * Copyright (C): * purpose: */ //------------------------------------------------------------------------ #pragma once //------------------------------------------------------------------------ #include "FKDBConnPool.h" #include "../...
/* * Academic License - for use in teaching, academic research, and meeting * course requirements at degree granting institutions only. Not for * government, commercial, or other organizational use. * File: ctcdf_terminate.c * * MATLAB Coder version : 3.3 * C/C++ source code generated on : 24-Apr-20...
#ifndef _PushOutCard_H_ #define _PushOutCard_H_ #include "BaseProcess.h" class PushOperateResult :public BaseProcess { public: PushOperateResult(); virtual ~PushOperateResult(); virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket,Context* pt) ; virtual int doResponse(CDLSocketHan...
#pragma once #include "system.hpp" #include "Collision/collisionbody.h" #include "Collision/collisionentity.h" #include "Collision/sat_able.h" #include "Collision/point_able.h" #include "Collision/aabb_able.h" #include "Collision/aabbbox.h" #include "Collision/line.h" #include "Collision/circle.h" #include "Collision...
#include "grid.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include "define.h" enum direction { FRONT = 1, RIGHT, BACK, LEFT}; //コンストラクタ Grid::Grid() { } //デストラクタ Grid::~Grid() { } //乱数により壁か道かを決定する char choiceWallOrPath() { int choice = (rand() % 2) + 1; switch (choice) { case 1: return '#'; c...
// Example 7.1 Functors. Lambda expressions. // Created by Oleksiy Grechnyev 2017 #include <iostream> #include <functional> #include <memory> using namespace std; //============================== /// PrintOp that uses std::function static void printOp(function<int(int, int)> op) { cout << "printOp: op(7, 3) = " ...
#include <iostream> #include <iomanip> #include <cmath> #include <ctime> #include "diceroller.h" void DiceRoller::diceroll(){ std::cout << "This function prints out six rolled die." << std::endl; std::srand(std::time(NULL)); //seed = # of seconds since Jan 1 1970 double face; for(int i ...
#pragma once #include "reg.h" #include <iostream> // 本类不属于硬件操作的一部分 // 模拟硬件的数据输入和输出功能 class CData_io { public: CData_io(char fileIn[], char fileOut[]); // 初始化 int getData_1Frame(CReg RAx, int frameLen); // 取一帧数据 void outData_1Frame(CReg RAx, int frameLen); ...
/* * Copyright (c) 2021 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_DETAIL_EMPTY_SORTER_H_ #define CPPSORT_DETAIL_EMPTY_SORTER_H_ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <array> #include <cstddef> #in...
#include "include/Render/bioluminescentfluidrenderer.h" #include <QOpenGLContext> #include <QOpenGLFunctions> BioluminescentFluidRenderer::BioluminescentFluidRenderer(int _w, int _h) : FluidRenderer(_w, _h) { m_colour = glm::vec3(0.2f, 0.9f, 0.4f); } BioluminescentFluidRenderer::~BioluminescentFluidRenderer(...
#include <string> #ifndef _Client_h #define _Client_h class Client { public: Client(int id, std::string name, std::string prenom, int reservenumbers); int getId(); std::string getName(); std::string getPrenom(); int getReservenumbers(); void set_Client(int id = 0, int reservenumbers = -1, std::string name = "Indi...
#include "adapter.hpp" void client(ITarget *p) { p->Do(); } int main(int argc, char const *argv[]) { Adaptee old; Adapter adapter(&old); AnotherAdapter ano; client(&adapter); client(&ano); return 0; }
#include "ros/ros.h" #include <iostream> #include "geometry_msgs/PoseStamped.h" #include "std_msgs/Float64.h" std_msgs::Float64 vel1; std_msgs::Float64 vel2; ros::Publisher give_vel; ros::Publisher give_vel2; void msgCallback(const geometry_msgs::PoseStamped::ConstPtr& PoseStamped) { //ROS_INFO("Point x = %f", P...
// Created on: 1993-09-07 // Created by: Christian CAILLET // 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 ...
#include <bits/stdc++.h> #define loop(i,s,e) for(int i = s;i<=e;i++) //including end point #define pb(a) push_back(a) #define sqr(x) ((x)*(x)) #define CIN ios_base::sync_with_stdio(0); cin.tie(0); #define ll long long #define ull unsigned long long #define SZ(a) int(a.size()) #define read() freopen("input.txt...
#include "H/KBscancodes.h" #include "H/printf.h" #include "H/IDT.h" #include "H/sound.h" #include "H/Memory.h" #include "H/Heap.h" #include "H/Colors.h" #include "H/typedefs.h" #include "H/vga.h" #include "H/Font.h" #include "H/serial.h" #include "H/3D.h" //#include "H/2D.h" #include "H/mouse.h" //#include "H/Time.h" #...
// // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2010-2012 Alessandro Tasora // All rights reserved. // // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file at the top level of the distribution // and at http://projectchrono.org/license-chrono.txt. //...
#include<bits/stdc++.h> using namespace std; main() { int s, v1, v2, t1, t2; while(cin>>s>>v1>>v2>>t1>>t2) { int first , second; first = (s*v1) + (2*t1); second = (s*v2)+ (2*t2); if(first<second)printf("First\n"); else if(first>second)printf("Second\n"); else ...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> #define INF 0x3f3f3f3f #define eps 1e-8 #define pi acos(-1.0) using namespace std; typedef long long L...
#ifndef CoinConf_H #define CoinConf_H #include "BaseCoinConf.h" #include "Player.h" class CoinConf : public BaseCoinConf { public: public: static CoinConf* getInstance(); virtual ~CoinConf(); virtual bool GetCoinConfigData(); CoinCfg* getCoinCfg() { return &m_coincfg; } private: CoinCfg m_coincfg; CoinConf...
#include <iostream> #include <queue> #include <cstdlib> using namespace std; // Node class class Node { public: Node() { mData = -1; mParent = NULL; mLeft = NULL; mRight = NULL; } ~Node() {} int data() { return mData; } void setData(int data) { mData = data; } Node* left() { return mLeft; } voi...
#pragma once #include "Ficha.h" #include <math.h> #include"glut.h" class Peon :public Ficha { public: Peon(); virtual ~Peon(); void Mueve(); virtual void SetColor(Color col); virtual void SetRadio(float rad); virtual void SetPos(float ix, float iy); //////////////////////// virtual int GetPosX(); virtual in...
#include <iostream> #include <cstring> #include <vector> #define MAX 81 #define MAX_T 6401 int n, m, map[MAX][MAX], d[MAX_T]; int dx[6] = {-1, -1, 0, 0, 1, 1}, dy[6] = {-1, 1, -1, 1, -1, 1}; std::vector<int> adj[MAX_T]; bool check[MAX_T]; bool dfs(int x) { if(check[x]) { return false; } check[x...
#ifndef __WPP__QT__QGuiApplication_H__ #define __WPP__QT__QGuiApplication_H__ #include <QGuiApplication> #include "Wpp.h" namespace wpp { namespace qt { class QGuiApplication : public ::QGuiApplication { Q_OBJECT private: bool m_keyboardWasAnimating; public: #ifdef Q_QDOC QGuiApplication(int &argc, char **argv);...
/* * @lc app=leetcode.cn id=125 lang=cpp * * [125] 验证回文串 */ // @lc code=start #include<iostream> #include<string> using namespace std; class Solution { public: bool isPalindrome(string s) { string sgood; for(char ch:s) { if(isalnum(ch)) { sgood+...
//my solution class Solution { public: vector<string> fullJustify(vector<string>& words, int maxWidth) { vector<string> res; for(int i = 0; i < words.size(); ){ string str = words[i]; int len = words[i].size(), j; for(j = i+1; j < words.size(); ++j){ ...
extern "C" { #include <iconv.h> } #include <array> #include <cstddef> #include <cstdlib> #include <iostream> #include <string> #include <system_error> class iconv_desc { private: iconv_t iconvd_; public: iconv_desc(const std::string& tocode, const std::string& fromcode) { iconvd_ = iconv_open(tocode.c_str()...
#include "stdio.h" int main(){ int T; char a[1000][1000]; int i,j,n,m,k; scanf("%d",&T); while(T--){ scanf("%d%d%d",&n,&m,&k); for(i=0;i<n;i++){ for(j=0;j<m;j++) scanf("%c",a[i][j]); } } }
#include <iostream> #include <fstream> #include <string> #include "BiDirectionalList.h" #include "Parallelepiped.h" void AddByPerimeter(BiDirectionalList<Parallelepiped>& list, Parallelepiped tmp) { bool found = 0; BiDirectionalList<Parallelepiped>::Node* element; for (int i = 0; i < list.Size(); i++){ ...
////////////////////////////////////////////////////////////////////////// // // pgAdmin 4 - PostgreSQL Tools // // Copyright (C) 2013 - 2017, The pgAdmin Development Team // This software is released under the PostgreSQL Licence // // TabWindow.cpp - Implementation of the custom tab widget // /////////////////////////...
#pragma once #include <gsl/span> #include <vector> #include "PticaGovorunCore.h" #include "VoiceActivity.h" namespace PticaGovorun { /// Parameters to sphinx_fe utility. struct SphinxVadParams { float WindowLength = 0.025625; // ms, -wlen, for SampleRate=16000 corresponds to 16k*this=410 samples int FrameRate =...
#pragma once #include "../../Toolbox/Toolbox.h" #include "../Vector/Vector3.h" #include "../Matrix/Matrix4x4.h" // https://www.3dgep.com/understanding-quaternions/ namespace ae { /// \ingroup math /** * Represent a rotation around an axis in 3D space. */ class AERO_CORE_EXPORT Quaternion { public: /** ...
#pragma once #include <iberbar/Paper2d/Node.h> namespace iberbar { namespace RHI { class ITexture; } namespace Renderer { class CTrianglesCommand; } namespace Paper2d { class __iberbarPaper2dApis__ CGridTerrain : public CNode { public: struct UGridPaletteNode { CColor4B Color; CRe...
#pragma once /* watchdog callback: resets the hardware timer if a "read" action over ble is done */ // watchdog switch. true for enable, false for disable bool enable_wd = false; const int wdtTimeout = 120000; //time in ms to trigger the watchdog hw_timer_t *timer = NULL; // initialise hardware timer // r...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2012 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #ifndef OP_RICH_MENU_WINDOW_H #define OP_RICH_MENU_WINDOW_H #in...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 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 "adjunct/quick_toolkit/widgets/Qu...
#include "../User.h" #define PROCESS(name, Name, type, parameterType) \ User::Builder& User::Builder::set##Name(parameterType name) { \ m_##name = name;\ return *this; \ } #include "UserBuilderXMacros.h" #undef PROCESS User User::Builder::build() const { User user; #define PROCESS(name, Name, type, par...
#include "color.h" const Color Color::INVISIBLE(0,0,0,0); Color::Color() : _red(255), _green(0), _blue(0), _alpha(0) {} Color::Color(const unsigned char red, const unsigned char green, const unsigned char blue) :Color(red, green, blue, 255) {} Color::Color(const unsigned char red, const unsigned char ...
/* * typedefs.h * * Created on: Mar 4, 2015 * Author: robmrk */ #ifndef TYPEDEFS_H_ #define TYPEDEFS_H_ #include "defines.h" #include <omp.h> #include <iostream> #include <cstdlib> #include <cstddef> #include <cctype> #include <iomanip> #include <cmath> #include <cstring> #include <fstre...
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define FOR(i,n) for(ll i=0;i<n;i++) #define FOR1(i,n) for(ll i=1;i<n;i++) #define FORn1(i,n) for(ll i=1;i<=n;i++) #define FORmap(i,mp) for(auto i=mp.begin();i!=mp.end();i++) #define vll vector<ll> #define vs vector<string> #define pb(x) push_...
/* BEGIN LICENSE */ /***************************************************************************** * SKFind : the SK search engine * Copyright (C) 1995-2005 IDM <skcontact @at@ idm .dot. fr> * $Id: unicodemodule.cpp,v 1.1.2.2 2005/02/17 15:29:24 krys Exp $ * * Authors: Arnaud de Bossoreille de Ribou <debossoreille...
#include "_pch.h" #include "MObjCatalog.h" using namespace wh; using namespace wh::object_catalog; using namespace wh::object_catalog::model; //------------------------------------------------------------------------- //------------------------------------------------------------------------- MPathItem::MPathItem(c...
////////////////////////////////////////////////////////////////////// ///Copyright (C) 2011-2012 Benjamin Quach // //This file is part of the "Lost Horizons" video game demo // //"Lost Horizons" is free software: you can redistribute it and/or modify //it under the terms of the GNU General Public License as published ...
#include <iostream> #include <string> #include <vector> using namespace std; void reverseStr(string& str) { int n = str.length(); for (int i = 0; i < n / 2; i++) swap(str[i], str[n - i - 1]); } string multiply(string num1, string num2) { int len1 = num1.size(); int len2...
#include "monitor_connection_p.hpp" #include "server_p.hpp" #include "rapidjson/stringbuffer.h" #include "rapidjson/prettywriter.h" #include <boost/bind.hpp> namespace ioremap { namespace thevoid { monitor_connection::monitor_connection(boost::asio::io_service &io_service) : m_io_service(io_service), m_socket(i...
#include<iostream> using namespace std; int arr[1000001]; int n,k; void kflip() { int max=-1; int l=0,r=0,start=0,end=0,z=0; while(l<=r && r!=n) { if(arr[r]==1) { int c=r-l+1; if(c>max) { max=c; start=l; end=r; } } else if(arr[r]==0) {int c; if(z<=k) { z=z+1; c=r-l+1;...
#ifndef SIMCONSTANTS_H #define SIMCONSTANTS_H namespace Simulation { // Universe size static const float MIN_XY_WORLDPOS = -10000.0f; static const float MAX_XY_WORLDPOS = 10000.0f; // Universe content static const int MAX_WORLDS = 1000; static const int MAX_SOLARSYSTEMS = 500; static const int MAX_WO...
// // Created by stanislav on 23.11.18. // #include <iostream> #include <array> using namespace std; int main() { int n = 0; cin >> n; int arr[n]; for (int i = 0; i < n; ++i) { cin >> arr[i]; } int count=0; int indexlS=0; int lastseqLengh=0; for (int j = 0; j < n; ++j) { ...
/* This file is part of SMonitor. Copyright 2015~2016 by: rayx email rayx.cn@gmail.com SMonitor is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later ver...
#include <iostream> #include <vector> #include "Utils.h" using namespace std; using namespace utils; template <class Iterator, typename CollectionType> void IsHeap(Iterator last, std::vector<CollectionType> const& collection) { if (last == end(collection)) { cout << "This collection is a heap" << endl << ...
#include<iostream> using namespace std; class Simple { public: Simple() {mIntPtr=new int();} ~Simple() {delete mIntPtr;} void setIntPtr(int inInt) {*mIntPtr=inInt;} void go() {cout<<"Hello there "<<endl;} protected: int* mInPtr; }; void doSomething(Simple*& outSimplePtr) { ...
/*In this lets see about pointer in class concept in C++ Program.*/ /*pointer to a c++ class is as same as the conceptof pointer to a Structure.*/ /*to access member of a pointer to a class member access operator -> has used*/ /*including preprocessor / headerfile in the program*/ #include <iostream> #include <st...
/* ***** 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 ****** */ // GDCM #include <gdcmWriter.h> // fwComEd #include <fwComEd/fieldHelper/...
#ifndef __BST_H #define __BST_H #include <string> #include <vector> using namespace std; template <class T> struct bst_node { string value; T key; bst_node<T> *left; bst_node<T> *right; bst_node<T> *parent; bst_node(string val,T key1) { this->valu...
#include "msg_0x3d_soundorparticleeffect_stc.h" namespace MC { namespace Protocol { namespace Msg { SoundOrParticleEffect::SoundOrParticleEffect() { _pf_packetId = static_cast<int8_t>(0x3D); _pf_initialized = false; } SoundOrParticleEffect::SoundOrParticleEffect(int32_t _effectId, int32_t _x, int8_t _y, int32_t _z...
#include<bits/stdc++.h> long long int as[1000000]; using namespace std; main() { long long int n, c; while(cin>>n>>c) { long long int x, i, t=1; for(i=1; i<=n; i++) cin>>as[i]; for(i=2; i<=n; i++) { if(as[i]-as[i-1]>c)t=1; // else if(t==0)t=2; ...
#ifndef HASH_MAP_INTERNAL_CHAINING_HPP #define HASH_MAP_INTERNAL_CHAINING_HPP // Pedro Escoboza // A01251531 // TCB1004.500 // 21/11/2020 #include <vector> #include <list> #include <memory> /** * Implementation a hash table of constant size. * * @param T Type of the entry value * @param K Type of the entry key ...
#ifndef _IEEE_FLOAT_HPP_ #define _IEEE_FLOAT_HPP_ #include <string.h> namespace fmt { template<class Dest, class Source> inline Dest bit_cast(const Source& source) { static_assert((sizeof(Dest) == sizeof(Source)), "(sizeof(Dest) == sizeof(Source)"); Dest dest; memmove(&dest, &source, sizeof(dest)); return d...
#ifndef _MSG_0X2A_REMOVEENTITYEFFECT_STC_H_ #define _MSG_0X2A_REMOVEENTITYEFFECT_STC_H_ #include "mcprotocol_base.h" namespace MC { namespace Protocol { namespace Msg { class RemoveEntityEffect : public BaseMessage { public: RemoveEntityEffect(); RemoveEntityEffect(int32_t _entityId, int32_t _effectId); size_t s...
#include "widget.h" void Widget::initializeGL() { glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set the screen color to black glEnable(GL_DEPTH_TEST); // Enable depth test glEnable(GL_CULL_FACE); // Cut the back side of the cube initShaders(); ...
// // Created by Administrator on 2021/1/22. // #ifndef BILIRTMP_JAVACALLHELPER_H #define BILIRTMP_JAVACALLHELPER_H #include <jni.h> //标记线程 因为子线程需要attach #define THREAD_MAIN 1 #define THREAD_CHILD 2 class JavaCallHelper { public: JavaCallHelper(JavaVM *_javaVM, JNIEnv *_env, jobject &_jobj); v...
#pragma once /* * Wrapper around libfreenect2 to use a kinect and write images out as files * Basing this impl off of libfreenect2's Protonect.cpp */ #include <cstddef> #include <cstdint> #include <filesystem> #include <future> #include <optional> #include <queue> #include <thread> #include <libfreenect2/frame_lis...
#pragma once #if defined ROSS_DEBUG #include <cassert> #include <limits> #endif namespace ross { typedef double real_t; typedef int64_t integer_t; typedef size_t size_t; constexpr real_t kPI = 3.14159265358979323846; constexpr real_t kPI_4 = 0.785398163397448309616; template<typename T> ...
#ifndef APPLICATION_REGISTRATIONCMD_H #define APPLICATION_REGISTRATIONCMD_H #include <iostream> #include "BaseCmd.h" #include "Commands/CmdCreator/Commands.h" #include "ChatObjects/UserInfo.h" // Command for registration class RegistrationCmd : public BaseCmd { public: ~RegistrationCmd() override = default; ...
template<class T> double romberg(const T&f,double a,double b,double eps=1e-6){ vector<double>t; double h=b-a,last,curr,x,k1,k2,temp; int k=1,i=1; t.emplace_back(h*(f(a)+f(b))/2); do { last=t.back(); curr=0; x=a+h/2; for(int j=0;j<k;++j) curr+=f(x),x+=h; curr=(...
#include "ntrajectory.h" /* NearestTrajectory :: NearestTrajectory(uint q, const kdTree& t, uint p) : Nearest(q, t, p), trajectory_points(p) { } void NearestTrajectory :: Add_Point(uint index) { const IOVector& bucket_point = kdtree[index]; const fp distance = Distance(query_point, bucket_poin...
/* You are given a generic tree. You have to replace each node with its depth value. You just have to update the data of each node, there is no need to return or print anything. Input format : The first line of input contains data of the nodes of the tree in level order form. The order is: data for root node, number o...
#include <iostream> #include <stdio.h> #include <glm/glm.hpp> #include <display.h> #include <text_renderer.h> #include <camera.h> #include <gameobject.h> #include <input_handler.h> #include <gui_objects.h> #define WIDTH 800 #define HEIGHT 500 glm::vec4 purple(1.0f,0.0f,1.0f,1.0f); glm::vec4 black(0.0f,0.0f,0.0f,1.0f)...
/* * HeartbeatServiceClient.cc * * Created on: Nov 18, 2017 * Author: cis505 */ #include "ServerToServerClient.h" vector<WriteCommandRequest> ServerToServerClient::AskForLog(int seqNum) { ClientContext context; LogRequest request; // TODO: set seqNum request.set_sequencenum(seqNum); unique_ptr<Clie...
// rplidarReader.cpp : Defines the exported functions for the DLL application. // #include "stdafx.h" #include "..\ultra_simple\RplidarClass.h" #include <chrono> #include <thread> #include <iterator> #include <vector> #include <algorithm> #include "c:/usr/include/gregutils/Sqlbuilder.h" #include "/usr/include/...
#ifndef __Config__ #define __Config__ #include <wx/fileconf.h> class Config { private: wxFileConfig *config; public: Config(wxString filename); void WriteData(const wxString &key, const wxString &value); void ReadData(const wxString &key, wxString *str); ~Config(); }; #endif // __Config__
#include "needs/seekfoodai.hpp" #include "components/item.hpp" #include "components/foodstuff.hpp" #include "components/position.hpp" #include "components/ai/pathai.hpp" #include "needs/needs.hpp" namespace needs { int SeekFoodAI::start(ai::AI* ai) { return update(ai); } int SeekFoodAI::update(ai:...
// // HEAP.hpp // ADT // // Created by Jalor on 2020/12/25. // Copyright © 2020 Jalor. All rights reserved. // #ifndef HEAP_hpp #define HEAP_hpp #include <iostream> #include <ctime> #include <cstdlib> using namespace std; const int MAX = 10; class Heap { private: int a[MAX+1] = {0}; void Sift(int,int);/...
#include<cstdio> #include<iostream> #include<string> using namespace std; int main() { char s[]="D:\\My Documents\\chengxu\\Useful function\\清除无用文件\\clear.plg"; if(remove(s)) cout<<"Can not delete!\n"; }
//--------------------------------------------------------- // // Project: dada // Module: core // File: Object.h // Author: Viacheslav Pryshchepa // // Description: // //--------------------------------------------------------- #ifndef DADA_CORE_OBJECT_H #define DADA_CORE_OBJECT_H #incl...
#ifndef MD5_H #define MD5_H #include<iostream> #include<string> #define F( X ,Y ,Z ) (( X & Y ) | ( (~X) & Z )) #define G( X ,Y ,Z ) (( X & Z ) | ( Y & (~Z) )) #define H( X ,Y ,Z ) (X ^ Y ^ Z) #define I( X ,Y ,Z ) (Y ^ ( X | (~Z) )) #define FF(a ,b ,c ,d ,Mj ,s ,ti ) (a = b + ( (a + F(b,c,d) + Mj + ti) << s)) ...
// 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. #include "Chaingen.h" #include "Common/CommandLine.h" #include ...
#include "u_can_i_up_app_MainActivity.h" #include <string.h> #include <jni.h> JNIEXPORT jstring JNICALL Java_u_can_i_up_app_MainActivity_getLocation(JNIEnv* env, jobject thiz){ return env->NewStringUTF("LOC!"); }
#ifndef FakeMarkerPublisher_h #define FakeMarkerPublisher_h #include <ros/ros.h> #include <tf/transform_listener.h> #include <tf/transform_broadcaster.h> class FakeMarkerPublisher { public: FakeMarkerPublisher(); bool initialize(); enum RunResult { SUCCESS = 0, FAILED_TO_INITIALIZE }; int run(); p...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #ifndef OP_PLUGIMISSINGBAR_H #define OP_PLUGIMISSINGBAR_H...