text
stringlengths
8
6.88M
//===-- gcn-isa.inc - AMD Graphics Core Next ISA ----------------*- C++ -*-===// // // TODO (Zhongliang): Add a license. // //===----------------------------------------------------------------------===// /// /// \file /// \brief This file contains AMD's Graphics Core Next ISA. /// //===--------------------------------...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> using namespace std; double f[1010][1010]; bool vis[1010][1010]; double dfs(int n,int m) { if (n =...
/******************************************************************************** This file contains various fuctions ********************************************************************************/ /******************************************************************************** converts latitude from Adafruit ...
/* Helper functions to test flags/bits and improve readability of code I couldn't inline these functions in data_both.h because they require globals defined later Xenkan 2010-12-05 */ #ifdef HOST #include "data_both.h" // for object and player structs #include "function_host.h" // for OBJlist bool object::IsStack...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2009 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_DOMJILWIDGET_H #define DOM_DOMJILWIDGET_H #ifdef DOM_JI...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Date...
#include <iostream> #include "TimeMe.hpp" //namespace fs = boost::filesystem; int main() { std::cout << "Hello, World!" << std::endl; TimeMe(10000); return 0; }
#include "bits/stdc++.h" using namespace std; const int maxn = 6e5 + 20; const int sigma_size = 3; struct Node { int cnt; bool isEnd; Node *next[sigma_size]; } trie[maxn]; typedef Node Trie; int cnt_node = 0; void insert_Trie (char *str, Trie *root) { root -> cnt ++; if (str...
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCursesWidget.h" cmCursesWidget::cmCursesWidget(int width, int height, int left, int top) { this->Field = new_field(height, width, top, left, 0, 0); set_fie...
#include <stdio.h> #include <iostream> #include <math.h> #include <algorithm> #include <memory.h> #include <set> #include <map> #include <queue> #include <deque> #include <string> #include <string.h> #include <vector> typedef long long ll; typedef long double ld; typedef unsigned long long ull; const ld PI = acos(-1.)...
// // Created by 张哲华 on 19/09/2017. // #include "ThreadKlt.h" #include <android/log.h> using namespace threads; ThreadKlt::~ThreadKlt() { worker_thread_.join(); } void ThreadKlt::start() { worker_thread_ = thread(&ThreadKlt::worker, this); } void ThreadKlt::worker() { pthread_setname_np(pthread_self(), T...
#include <iostream> #include <string> using namespace std; int main(){ string w; int i = 0; while(true){ getline(cin, w); i++; if(!w.compare("#")){ break; }else{ cout << "Case " << i << ": "; if(!w.compare("HELLO")){ c...
/* ** EPITECH PROJECT, 2019 ** BABEL ** File description: ** server */ #include "server.hpp" Server::Server(boost::asio::io_context& io_context): _io_context(io_context), _acceptor(io_context, boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), 3653)) { _db = new Database(); waitForConnection(); ...
#include <iberbar/Poster/ResourcesManager.h> #include <iberbar/Poster/Surface.h> #include <iberbar/Utility/String.h> #include <iberbar/Utility/Net/EasyWebRequestFactory.h> #include <iberbar/Utility/Net/EasyWebRequest.h> iberbar::Poster::CResourcesManager::~CResourcesManager() { m_textureScale9s.Clear(); m_surfaces...
// Multiplication using recursion without using multiplication (*) operator #include<iostream> using namespace std; int mul(int a,int b){ if(a>0 && b<0) { swap(a,b); } else if(a<0 && b<0) { a=-a; b=-b; } if(b>0) { return (a+mul(a,b-1)); } } int main() { int a,b; ...
#pragma once #include "GtObject.h" class Gt2DActor : public GtObject { GnDeclareRTTI; public: const static gint OBJECT_TYPE = 1; private: Gn2DActorPtr mpsActor; GnSimpleString mGATFileName; GnSimpleString mGMFileName; Gt2DSequence* mModifySequence; GnTMap<guint32, Gt2DSequencePtr> mpGtSequences; public: Gt2D...
/* ============================= * | Name: Abhishek Mantha | * | Email: amantha@usc.edu | * | GitHub: abmantha | * | Date Submitted: 2/3/15 | * | HW 2 | * ============================== * * Filename: alisttest.cpp * * Test file for the alistint.h and alistint....
#include <stdlib.h> #include <iostream> #include <sys/ipc.h> #include <sys/shm.h> using namespace std; int main() { int id = shmget(69, 0x1000, 0666); if(id != -1){ shmctl(id, IPC_RMID, 0); } else cout << "Deletion failed" << endl; return 0; }
#include <MemoryManager.h> using namespace breakout; constexpr size_t GLOBAL_POOL_SIZE = sizeof(size_t) * 10000; MemoryManager::MemoryManager() { m_globalAllocator = std::make_shared<LinearAllocator>(GLOBAL_POOL_SIZE); } MemoryManager::~MemoryManager() { } MemoryManager& MemoryManager::Get() { static MemoryMana...
#pragma once #include "zombie.h" class zombie_type2 : public zombie { public: zombie_type2(BaseEngine* pEngine); ~zombie_type2(void); };
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you...
int Semafor1[] = { 11,12,13}; int Semafor_Chodci[] = {10,9}; int Semafor3[] = {6,7,8}; int aktivni_semafor = 0; int tlacitko1 = 4 ; int tlacitko2 = 5; long interval = 10000; long cas = 0; void RozsvitZelenou(int semafor[]){ digitalWrite(semafor[2],1); digitalWrite(semafor[1],1); digitalWrite(semafo...
#include <iostream> using namespace std; int binarySearch(int a[],int n, int key) { int start = 0, end = n-1; int mid; while(start<=end) { mid = (start + end) / 2; if(a[mid] == key) return mid; // Elements present in left side. else if(a[mid]> key) { ...
#include "PNGOutput.h" #include <cellogram/State.h> #include <cellogram/laplace_energy.h> namespace cellogram { PNGOutput::PNGOutput(const double scale) : scale_(scale) { } void PNGOutput::save() { #ifdef CELLOGRAM_WITH_PNG writer_.close(); #else writer_ << "</svg>\n"; std::ofstream out(name_.c_str()); ...
#include <bits/stdc++.h> using namespace std; struct tNode{ int data; tNode *left; tNode *right; tNode(int x):data(x),left(NULL),right(NULL){} }; class Solution{ public: //递归 int leaf_count(tNode *root){ if(!root){ return 0; } if(!root->left && !root->right){...
//This is a header file intended to be used with the G12 data stream. //Corrections were derived from the p pi_plus pi_minus exclusive reaction //Input: EC inner energy, EC outer energy, U, V, W, and Sector //Output: Pass or fail //Updated: February 27, 2014 //Corrections were done by Michael C. Kunkel //mkunkel@jlab...
#include "ColorProgram.hpp" #include "gl_compile_program.hpp" #include "gl_errors.hpp" Load< ColorProgram > color_program(LoadTagEarly); ColorProgram::ColorProgram() { //Compile vertex and fragment shaders using the convenient 'gl_compile_program' helper function: program = gl_compile_program( //vertex shader: ...
// Created on: 1993-11-16 // Created by: Laurent BOURESCHE // 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> using namespace std; /* Preprocess : O(n*m*logn*logm) we create a table[ 1+logn ][ n ][ 1+logm ][ m ] Each box of the table[ 1+logn ][ n ] is a sparse table of size [ 1+logm ][ m ] Let us see what table[ jr ][ ir ][ jc ][ ic ] actually contains: It contains the minimum element ...
/* * Mutex.h * * Created on: Oct 5, 2014 * Author: dangnq */ #ifndef MUTEX_H_ #define MUTEX_H_ class CMutex { public: CMutex(); ~CMutex(); // void lock(); void unlock(); public: bool m_bCreated; private: pthread_mutex_t m_pMutex; }; class CMutexLocker{ public: CMutexLocker...
/** * @author Michael Krebs (AMVALOR) * @date 25.01.2017 * @version 1 */ #ifndef LVOX3_COMPUTETHEORITICALS_H #define LVOX3_COMPUTETHEORITICALS_H #include "lvox3_worker.h" #include "mk/tools/lvox3_gridtype.h" #include "ct_itemdrawable/ct_scene.h" #include "ct_itemdrawable/ct_grid3d.h" #include "ct_ite...
#include <iostream> using namespace std; bool find(int v, int arr[]) { for(int i=0; i<6; ++i) if(arr[i]==v) return true; return false; } int main() { int n; cin >> n; int dice[n][6]; for(int i=0; i<n; ++i) for(int j=0; j<6; ++j) cin >> dice[i][j]; int max=0; if(n==1) { //One digit for(int i=...
// This file provides the details of implements of member functions #include <iostream> #include "Stock20.h" void Stock::buy(long num, double price) { if (num < 0) { std::cout << "Number of shares purchased can't be negative. " << company_ << " Transaction is aborted.\n"; } else { shares_ += num; share_val...
#ifndef ROGUE_ATTACK_H #define ROGUE_ATTACK_H #include "Attack.h" #include "../unit/Unit.h" class RogueAttack : public Attack { public: RogueAttack(Unit* instance); virtual void attack(Unit* enemy); }; #endif // ROGUE_ATTACK_H
#include <assert.h> #include <fcntl.h> #include <sys/socket.h> #include <unistd.h> #include <iostream> #include <memory> #include <vector> #include "base/callback.h" #include "base/check.h" #include "base/scheduling/task_loop_for_io.h" #include "base/threading/simple_thread.h" #include "gtest/gtest.h" namespace base...
#ifndef __TEST_PARTITIONS_HPP__ #define __TEST_PARTITIONS_HPP__ #include "test_optimal_partition.hpp" #endif
// Core library - MCU-based #include "Energia.h" #ifndef DHT22_430_Library_h #define DHT22_430_Library_h //// /// @brief Number of timing transitions needed to keep track of 2 * number bits + extra /// #define MAXTIMINGS 85 /// /// @brief Uncomment for debug print /// #define DEBUG /// /// @brief Class for DHT22 se...
#ifndef WIDGET_H #define WIDGET_H #include <QWidget> #include "landwidget.h" #include "enter.h" #include "browse.h" #include "sort.h" #include "database.h" #include "admin.h" namespace Ui { class Widget; } class Widget : public QWidget { Q_OBJECT public: explicit Widget(QWidget *parent = nullptr); ~Widg...
#include <QtGui> #include <QPainterPath> #include "uicurve.h" #include "uirectangle.h" typedef UiRectangle* pUiRectangle; UiCurve::UiCurve(QWidget *parent):UiElement(parent) { resize(parent->size()); activeColour = false; points = new pUiRectangle[4]; setMouseTracking(true); } void UiCurve::change() { update()...
#pragma once #include "GameObject.h" #include "Timer.h" #include "AudioComponent.h" class Lever : public GameObject { private: std::wstring m_theTexture; std::wstring m_sound; DirectX::BoundingBox* m_playerBoundingBox; DirectX::BoundingBox leverTriggerBox; bool activated; bool canUseLever; //Model defaultLev...
// KC Text Adventure Framework - (c) Rachel J. Morris, 2012 - 2013. zlib license. Moosader.com #include "GameIO.h" #include "Utils.h" #include <cstdlib> #include <fstream> #include <ctime> void GIO::Init() { InitIOLog(); } void GIO::Close() { CloseIOLog(); } void GIO::Out( std::string text ) { std::cout...
// --------------------- graphm.h ----------------------------------------- // // Shyawn Karim, CSS 343 // Created: October 26, 2015 // Last Modified: Novemeber 12, 2015 // -------------------------------------------------------------- // Purpose: Implement Dijkstra's shortest path algorithm by reading in a /...
#pragma once #include <glm/glm.hpp> namespace Game { glm::uint32 LoadShaders(const char* vertexSrc, const char* fragmentSrc); }
#include <ros.h> #include <geometry_msgs/Vector3.h> #define LOOPTIME 100 char commandArray[4]; char sT='{'; //send start byte byte sA = 0; //send device address + command byte byte sH = 0; //send high byte byte sL = 0; //send low byte char sP='}'; //send stop byte byte rT = 0; //receive start byte byte rA = 0;...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen ** */ #ifndef SSLAUTORETR_H #define SSLAUTOR...
// logging.cxx #include "config.h" #include "common.h" #include "logging.h" #include "tips.h" #include "richeditole.h" static HWND OutputWnd=NULL; static void logdisp_WriteWnd(char MText[]); static void logdisp_WriteDbg(char MText[]); const int maxchars=1024; const int maxlines=32000; static HBRUSH hbrush=NULL; vo...
#include <iostream> #include <vector> #include <queue> #define INF 1000000000 #define MAX 20001 using namespace std; int v, e, init; class Vertex{ public: int idx; int dist; int post; vector<pair<int, int>> edges; Vertex(int i = 0, int d = INF, int p = 0) :idx(i), dist(d), post(p) {} bool o...
// // Created by liaocanzhong on 2019-08-07. // #include <jni.h> #include <iostream> #include <zxing/common/Counted.h> #include <zxing/Binarizer.h> #include <zxing/MultiFormatReader.h> #include <zxing/ReaderException.h> #include <zxing/common/GlobalHistogramBinarizer.h> #include <zxing/common/HybridBinarizer.h> #includ...
#include<bits/stdc++.h> using namespace std; typedef unsigned long long int ll; int main() { ll l=0,t=0,k,m = 0,x = 0,c=0,n; string s,s1=""; cin>>s>>k; n = s.size(); s1 += s; sort(s1.begin(),s1.end()); reverse(s1.begin(),s1.end()); while(1) { c = 0,x = s[t] - '0'; ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2011 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen ** */ #include "core/pch.h" #ifdef _URL_EXTE...
#include "mysql.h" QStringList list_column = {"id","name","password","building","room","idcard","college","class"}; void MySqlInit(){ QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL"); db.setHostName("123.207.165.95"); db.setPort(3306); db.setDatabaseName("abc"); db.setUserName("root"); d...
//#include <atcoder/all> #include <bits/stdc++.h> #include <math.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; using Graph = vector<vector<int>>; typedef long long ll; typedef pair<int, int> P; const int MO...
#include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> #include<math.h> void main () { int gd=DETECT,gm; int h,k,a,b,theta,x1,y1,x,y,run; float n= 3.14159; do { initgraph(&gd,&gm,"C:\\TURBOC3\\BGI"); n=n/180; printf("enter the center (h,k)\n==> "); sc...
/* -*- mode: c++; tab-width: 4; c-basic-offset: 4 -*- */ group "layout.gcpm"; require init; include "modules/doc/frm_doc.h"; include "modules/layout/box/box.h"; include "modules/layout/box/blockbox.h"; include "modules/layout/content/content.h"; include "modules/layout/content/multicol.h"; include "modules/layout/se...
#include <iostream> #include <sstream> #include <cstdlib> #include <cstdio> #include <vector> #include <queue> #include <deque> #include <stack> #include <list> #include <map> #include <iomanip> #include <set> #include <climits> #include <ctime> #include <complex> #include <cmath> #include <string> #in...
// Created on: 1995-03-06 // Created by: Laurent PAINNOT // Copyright (c) 1995-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 GN...
#pragma once /* The following code demonstrates how it can be used with the procps library where two pointers need to be managed PROCTAB and proc_t. Two functions free_proc_tab and free_proc are defined to handle the specific cleanup operations associated with corresponding procps functions openproc and readproc. T...
#include<bits/stdc++.h> using namespace std; #define MOD 1000000007 #define pb push_back #define mp make_pair #define fi first #define se second typedef long long ll; //Union Find taken from geeks for geeks vector<int> in(1000100,0),out(1000100,0); vector<bool> c(100010,false); struct subset { int parent,rank; }; ...
// Created on: 2000-09-08 // Created by: data exchange team // Copyright (c) 2000-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...
#include "Interaccion.h" #include <stdlib.h> #include "freeglut.h" #include "ETSIDI.h" void Interaccion::rebotee(Esfera &e, Pared plat) { Vector2D dir; float dif = plat.distancia(e.posicion, &dir) - e.radio; if (dif <= 0.0f) { Vector2D v_inicial = e.velocidad; e.velocidad = v_inicial - dir * 2.0 ...
#pragma once #include <dia2.h> #include <stdio.h> #include <fstream> #include "ntdll.h" #include <iostream> #include <vector> #include <map> using namespace std; class getAddress { public: map<DWORD, LPCWSTR> addressToName; public: getAddress(void); ~getAddress(void); PVOID GetProcAddrFromKe...
/* loop through the ADCs printing their values in a round-robin fashion * User ADC inputs are on 0-3 (GPIO 26-29), the temperature sensor is on ADC 4 */ #include <stdio.h> #include "pico/stdlib.h" #include "hardware/gpio.h" #include "hardware/adc.h" int main() { stdio_init_all(); adc_init(); int i; for(i=0; ...
// Helena Ruiz Ramirez (A01282531) , Gilberto Alejandro Castillo Perez (A00821306) // 12/marzo/2018 // Proyecto 2: Alumno header #ifndef Alumno_h #define Alumno_h using namespace std; class Alumno{ private: int matricula; string carrera; string nombre; public: // Constructores Alumno(); Alum...
#pragma once #include "utils/log.hpp" #define ROUTE_TLOG __TLOG << setw(20) << "[ROUTE] " #define ROUTE_DLOG __DLOG << setw(20) << "[ROUTE] " #define ROUTE_ILOG __ILOG << setw(20) << "[ROUTE] " #define ROUTE_ELOG __ELOG << setw(20) << "[ROUTE] "
// Fill out your copyright notice in the Description page of Project Settings. #include "SurvivalCharacter.h" #include "SurvivalController.h" #include "Blueprint/UserWidget.h" // Sets default values ASurvivalCharacter::ASurvivalCharacter() { // Set this character to call Tick() every frame. You can turn this off ...
#pragma once template <class T> struct ICollection //: IEnumerable<T> { virtual T Get(size_t index) const = 0; virtual size_t GetCount() const = 0; };
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <assert.h> #include <gtest/gtest.h> // Problem 1.2 void Reverse(char* str) { if (str != nullptr) { // count num of chars unsigned int arraySize = 0; unsigned int curIndex = 0; while (str[curIndex] != '\0') { ...
//--------------------------------------------------------------------------- #include <windows.h> #include <stdio.h> #pragma hdrstop #include "CtrlHandler.h" //--------------------------------------------------------------------------- #pragma package(smart_init) bool CtrlHandler( DWORD fdwCtrlType ) { switch( ...
#pragma once #include <string> #include <map> #include <memory> #include <stdexcept> #include <utility> class trie_iterator; class base_trie { public: using iterator = trie_iterator; using value_type = int; using key_type = std::string; protected: using node_key = key_type::value_type; }; cl...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) Opera Software ASA 2002 - 2006 * * Table of instruction names. * * @author modules/ecmascript/carakan/src/scripts/es_instructionhandlers.cpp.py */ #include "core/pch.h" #include "modules/...
#ifndef OtherUnderscoreSub_P_HPP #define OtherUnderscoreSub_P_HPP #include <QObject> class OtherUnderscoreSubPrivate : public QObject { Q_OBJECT public: OtherUnderscoreSubPrivate(); ~OtherUnderscoreSubPrivate(); }; #endif
#include "aePerlin.h" namespace aeEngineSDK { PerlinNoise::PerlinNoise() { // Initialize the permutation vector with the reference values p = { 151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142, 8,99,37,240,21,10,23,190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117, 35...
// floyd-warshall algorithm to find all pairs shortest path // g[i][j] should be initialized to INF before accepting the edge weights as input ll g[MAXN][MAXN]; int n; void floyd_warshall(){ for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ for(int k = 0; k < n; k++){ if(g[j][k] > g[j][i]+g[i][k]){ ...
#ifndef THREAD_POOL_MYIDENTIFY_1985 #define THREAD_POOL_MYIDENTIFY_1985 #include <pthread.h> #include <boost/function.hpp> namespace threadpool { typedef boost::function<void()> task_type; #ifdef __cplusplus extern "C" { #endif bool init_thread_pool(int thread_num = 0); void destroy_thread_pool(); ...
// // jsonHelper.cpp // simpleJson // // Created by brainelectronics on 19.05.20. // Copyright (c) 2020 brainelectronics. All rights reserved. // #include "jsonHelper.h" // Utility function to create a node in memory struct Node* getNode() { // calloc space for 1 Node and set 0 to all of them return ((str...
#include "qPosition.h" namespace qEngine { qPosition::qPosition(void) : m_fXPos(0), m_fYPos(0), m_fZPos(0), m_fXRotation(0), m_fYRotation(0), m_fZRotation(0), m_fXScale(0), m_fYScale(0), m_fZScale(0), m_bBillboard(false), m_matCombine1(NULL), m_matCombine2(NULL) { move(0.0f,0.0f,0.0f); rotate(0.0f,0.0f...
#pragma once #include <map> #include "CosmoBasis.hpp" #include "Helper.hpp" #include "ARES_interface.hpp" #include "CAMB_interface.hpp" #include "Global21cmInterface.hpp" // CAREFUL, WITH THIS TEMPLATIZATION ONLY USE 1 CPP FILE!!!! class ModelInterface : public CosmoBasis { public: ModelInterface(map<st...
#pragma once #include <thread> #include <dt/df/core/base_node.hpp> #include <dt/df/core/graph_manager.hpp> #include <opencv2/core.hpp> #include <opencv2/videoio.hpp> #include "../bounded_buffer.hpp" #include "../slots/mat.hpp" namespace dt::df::plugin::opencv { class VideoWriterNode final : public BaseNode { public: ...
// Created on: 1991-04-15 // Created by: Philippe DAUTRY // 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 GN...
using namespace std; namespace hw2{ class node{ public: bool getState(); bool updateState(int numNeighbors); bool setState(bool isAlive); node(bool isAlive); node(); private: bool alive; }; }
// // Created by 邦邦 on 2022/4/26. // #ifndef MYSQLORM_DBA1_TEST_HPP #define MYSQLORM_DBA1_TEST_HPP #include "sql/dql.h" class dbA1_test:public bb::dql{ dbA1_test(){ if(run_() != 0){ bb::Log::obj().error("mode创建的时候出现问题"); } update_(); } public: static dbA1_test &obj(){ ...
#pragma once #include "IKObject.h" struct IKInstanceInfo { StrID name; float length; }; class IKComponent : public hg::IComponent { public: virtual int GetTypeID() const { return s_TypeID; } hg::IComponent* MakeCopyDerived() const; public: static uint32_t s_TypeID; public: IKComponent(); void LoadFromXML(tinyx...
#include "Person.h" #include <iostream> #include <cstdlib> #include <ctime> using std::cout; using std::cin; using std::endl; /*Person*/ void Person::Show() const { cout << "Category: Person\n"; Data(); } void Person::Data() const { cout << "Name: " << fname << " ," << lname << endl; } void Person::Get() { cout <...
/* * rosserial Ultrasound Example * * This example is for the Maxbotix Ultrasound rangers. */ #include <ros.h> #include <ros/time.h> #include <sensor_msgs/Range.h> ros::NodeHandle nh; sensor_msgs::Range range_msg; ros::Publisher pub_range( "/ultrasound", &range_msg); const int trigPin = 3; const int echoPin...
#include <math.h> #include "mt19937ar.h" // we use a function from mt19937ar.c below #include "BoxMuller.h" // has the definitions of the functions and constants used in BoxMuller.c double genrand_std_normal(void){ static int iset = 0; //retain values between calls static double gset; double v...
/* * Nixie_Display_Backplane by Jonathan Zepp - @DaJMasta * Version 3.3 - April 1, 2017 * For the Not Your Average Nixie Clock project * * Programmed to an arduino nano in the backplane, this software reads the required sensors and controls the driver boards. Includes * an RTC, a temperature and humidity sensor...
#include "Menu.h" #include "..\RobotException.h" #define MIM_STYLE 0x00000010 #define MIM_MENUDATA 0x00000008 #define MSN_NOTIFYBYPOS 0x08000000 Menu::Menu(std::string itemText, bool popupMenu) : MenuItem(itemText, 0), owner(NULL) { MENUINFO menuInfo; if(popupMenu) menuHandle = CreatePopupMenu(); ...
#ifndef AGV_CHASSIS_H #define AGV_CHASSIS_H #include "FreeRTOS.h" #include "PID.h" #include <main.h> #include "motor.h" #include "math.h" #include "autoInfantryConfig.h" extern CAN_HandleTypeDef hcan1; extern CAN_HandleTypeDef hcan2; extern Motor_GM6020 SteerMotor[4]; extern Motor_C620 Wheel[4]; ...
/* * EmailRepositoryImpl.h * * Created on: Nov 11, 2017 * Author: cis505 */ #ifndef BE_SERVER_EMAILREPOSITORYIMPL_H_ #define BE_SERVER_EMAILREPOSITORYIMPL_H_ #include <iostream> #include <memory> #include <string> #include "BigTable.h" #include "../common/EmailRepository.grpc.pb.h" #include <grpc++/grpc++...
/* -*- 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. */ #include "core/pch.h" #ifdef OP_GLOB_SUPPORT #include "modules...
#pragma once #include "StopMotionStones.h" #include "ofMain.h" class StopMotionStonesAct { public: StopMotionStonesAct(); ~StopMotionStonesAct(); void setup(); void update( unsigned long long millis ); void draw(); StopMotionStones stones; float transparency; };
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #define length 25000 using namespace std; class FIFO_Element { friend class FIFO; char text[length]; FIFO_Element *next; // inicjalizacja tablicy char danego obiektu napisem z konsoli FIFO_Element(char text_oryg[length]) { if (text_oryg != NULL) { unsigne...
#pragma once #include <limits> #include <vector> #include <ostream> #include <algorithm> #include <utility> //using namespace std::rel_ops; namespace oineus { struct VREdge { size_t x; size_t y; bool operator==(const VREdge& other) const { return x == other.x and y == other.y; } ...
// // Created by 송지원 on 2020/06/04. // #include <iostream> #include <vector> #include <string> using namespace std; int main() { string input; vector<int> alpha(26); cin >> input; for(int i=0; i<input.length(); i++) { //printf("%d\n", input.at(i) - 'a'); alpha[input.at(i) - 'a']++; ...
/* Copyright 2016 Vladimir Lysyy (mrbald@github) 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 ...
#ifndef EXPLOSION_H #define EXPLOSION_H #include "ParticleEmitter.h" namespace Platy { namespace Game { class Explosion final : public ParticleEmitter { public: Explosion( const float& aParticleMaxSize, const sf::Vector2f& aPosition, const sf::Color& aColor, const size_t& aParticleCount, ...
#include <iostream> #include <vector> #include <queue> using namespace std; class Node{ public: int inDegree = 0; bool next[501] = {false, }; Node(){} }; void topologySort(Node node[], int n){ queue<int> q; vector<int> ret; for(int i = 1; i <= n; i++){ if(node[i].inDegree == 0){ ...
#include "TextureMapping.h" TextureMapping::TextureMapping(char* fileName) :filename(fileName) { if (!LoadGLTextures()) { printf("error\n"); return; } glEnable(GL_TEXTURE_2D); glShadeModel(GL_SMOOTH); glClearDepth(1.0f); glDepthFunc(GL_LEQUAL); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NI...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; 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) #ifndef MBOXSTOREMANAGER_H #defin...
#include<bits/stdc++.h> using namespace std; void freq(string str) { string word; map<string , int>fc; stringstream ss(str); while(ss >> word) { fc[word]=fc[word]+1; } map<string , int>::iterator i; for(i=fc.begin(); i!=fc.end(); i++) { cout<<(*i).first<<": "<<(*i).s...