text
stringlengths
3.08k
12.5k
/* * Copyright (c) 2017-2021 Triad National Security, LLC * All rights reserved. * * This file is part of the mpimemu project. See the LICENSE file at the * top-level directory of this distribution. */ #include "memnesia-sampler.h" #include <limits.h> #include <cstdlib> #include <utilit...
#include "log.h" using namespace std; Log::Log() { m_lineCount = 0; m_isAsync = false; m_writeThread = nullptr; m_deque = nullptr; m_toDay = 0; m_fp = nullptr; } Log::~Log() { if (m_writeThread && m_writeThread->joinable()) { while (!m_deque->empty()) { m_deque->flush(...
#include <bits/stdc++.h> #define int long long #define pb push_back #define sz(curr) ((int)(curr).size()) #define all(curr) (curr).begin(),(curr).end() #define mp make_pair using namespace std; const int N = 2e5 + 2; int a[N]; class SegmentTree{ int *tree , *lazy; public: SegmentTree(){ tree = new int[4 * ...
/* * Copyright (c) 2016 Dell 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 * * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARR...
// testing_colortree // test code taken from /home/snobili/main-distro/software/externals/octomap/octomap/src/testing. // this code ha been modified to test the search function (neighborhood search). // refer to original code to test colors and probabilities. #include <octomap/octomap.h> #include <octomap/ColorOcTree...
#include "toffi_mat.h" #include <Arduino.h> ToffiMat::ToffiMat(const bool startTaskTmp): ToffiLayer(startTaskTmp) { deltaTime=0; // inicializace času pro výpočet délty paramM_U=1; // poměr mezi momentu síly a déltou napětí paramA_M=1; // poměr mezi accelerací a momentem síli setLayer_date(pMU, 1,100...
#include "ScriptEngine.h" #include <cctype> #include <algorithm> #include <filesystem> #include <pybind11/functional.h> #include <pybind11/stl.h> #include <plog/Log.h> #include <Player/Player.h> #include <World/Map.hpp> #include <World/Objects/Object.hpp> #include <Shared/Global.hpp> #include <Shared/ErrorHandling....
// Contents released under the The MIT License (MIT) #include "psdisc-filesystem.h" #include "psdisc-cdvd-image.h" #include "psdisc-endian.h" #include "posix_file.h" #include "icy_assert.h" #include "icy_log.h" #include "jfmt.h" #include <functional> #include <cstring> // returns TRUE if the given sector contains C...
#include <Rcpp.h> #include <ncbi-vdb/NGS.hpp> #include <ngs/ErrorMsg.hpp> #include <ngs/ReadCollection.hpp> #include <ngs/ReadIterator.hpp> #include <ngs/Read.hpp> #include <math.h> #include <iostream> using namespace Rcpp; using namespace ngs; using namespace std; //' Read alignment //' //' This returns the aligne...
#include <barf.h> #include <Arduino.h> // new void * operator new (size_t size) { return malloc (size); } // placement new void * operator new (size_t size, void * ptr) { return ptr; } // delete void operator delete (void * ptr) { free (ptr); } #ifndef _getpid extern "C"{ int _getpid(){ return -1;} int _kill(int ...
#include "epoll_poller.h" #include <glog/logging.h> #include <sys/epoll.h> #include <sys/poll.h> #include "channel.h" static_assert(EPOLLIN == POLLIN, "EPOLLIN equals to POLLIN"); static_assert(EPOLLPRI == POLLPRI, "EPOLLPRI equals to POLLPRI"); static_assert(EPOLLOUT == POLLOUT, "EPOLLOUT equals to POLLOUT"); stati...
#include <Arduino.h> #include <stdio.h> extern "C" { #include <ps3.h> } #include "esp32-hal-bt.h" void setup() { // Too much slower and the bluetooth callback will trigger the watch dog // timer. Connect the serial TX pin of the ESP32 to D2 of the Teensy 2.0 // (Serial1 RX). Serial.begin(115200); } uint8_t ...
// This file is part of slideio project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://slideio.com/license.html. #include "slideio/imagetools/imagetools.hpp" #include <numeric> #include "slideio/slideio.hpp" #include <boost/format.hpp>...
#include "globalzntablemodel.h" #include "settings.h" #include "rpc.h" GlobalZNTableModel::GlobalZNTableModel(QObject *parent) : QAbstractTableModel(parent) { headers << QObject::tr("Rank") << QObject::tr("Address") << QObject::tr("Version") << QObject::tr("Status") << QObject::tr("Active") << QOb...
/** @file dji_memory.cpp * @version 3.3 * @date Jun 15 2017 * * @brief * Implement memory management for OSDK library * * @copyright 2016-17 DJI. All right reserved. * * * @attention * It is not necessary to include dji_memory.hpp in any custom code file. * The functions in this file are not API fun...
/** * $Id: df1b2bet.cpp 789 2010-10-05 01:01:09Z johnoel $ * * Author: <NAME> * Copyright (c) 2008, 2009, 2010 Regents of the University of California */ #include <df1b2fun.h> #include "../linad99/betacf_val.hpp" df1b2variable betacf(const df1b2variable& a,const df1b2variable& b, double x, int MAXIT); df1b2variab...
#include "TeGLVertexArrayObjectManager.h" #include "TeGLVertexBuffer.h" #include "RenderAPI/TeVertexDeclaration.h" #include "TeGLGpuProgram.h" #include "TeGLHardwareBufferManager.h" #define VBO_BUFFER_OFFSET(i) ((char *)NULL + (i)) namespace te { GLVertexArrayObject::GLVertexArrayObject(GLuint handle, UINT64 vert...
#include "tss.hpp" extern std::uint64_t ist1_stack_top; extern std::uint64_t ist2_stack_top; core::x64::interrupts::tss::tss(gdt& in_gdt) { // Zero out the reserved fields. _our_tss.reserved1 = (std::uint32_t)0; _our_tss.reserved2 = (std::uint64_t)0; _our_tss.reserved3 = (std::uint64_t)0; _our_tss...
#include "DeployWorker.h" #include "RuntimeError.h" #include <string.h> #include <limits.h> #include <stdexcept> using namespace fsevent; using namespace std::placeholders; const static long kMaxRedeployInterval = 64; const static long kDelayUnit = 1000; // ms DeployWorker::DeployWorker() : queue_(1024), schedu...
#include <TscaGpio.h> namespace tsyncgpio { namespace components { TscaGpio::TscaGpio(_component_conf &config, riaps::Actor &actor) : TscaGpioBase(config, actor), m_hasJoined(false) { _logger->set_level(spd::level::info); _logger->set_pattern("[%H:%M:%S] %v"); ...
/* Class Helmholtz implements a period-length detector using <NAME>'s Specially Normalized AutoCorrelation function (SNAC). Licensed under three-clause BSD license. <NAME>, Feb 2012. */ #include <stdlib.h> #include <math.h> #include "Helmholtz_dsp.h" Helmholtz::Helmholtz(int framearg, int overlaparg, t_float b...
// license:BSD-3-Clause // copyright-holders:<NAME>, <NAME> /********************************************************************* formats/esq8_dsk.c Formats for 8-bit Ensoniq synthesizers and samplers Disk is PC MFM, 40 tracks, single (Mirage) or double (SQ-80) sided, with 6 sectors per track. S...
#include "core/scene/serializer.h" #include "core/scene/components.h" #include <fstream> // encode/decode self-defined types namespace YAML { template<> struct convert<glm::vec3> { static Node encode(const glm::vec3& rhs) { Node node; node.push_back(rhs.x); node.push_back(rhs.y); node.push_back(rhs.z)...
#include<GL/gl.h> #include<GL/glu.h> #include<GL/glut.h> #include<math.h> #include<cmath> #include<iostream> #include<string.h> using namespace std; int NUM_DISKS; void restart(); void display(); void mouse(int btn,int mode,int x,int y); void createGLUTMenus2(); void initialize(); void printfptext(char, int, int, int...
#include "../include/dnnetwork.h" #include "../include/image_opencv.h" #include "../include/utils.h" struct filtered_detection_list_darknet { int class_name_idx; float probability; }; static image mat_to_image(const cv::Mat& mat) { int w = mat.cols; int h = mat.rows; int c = mat.channels(); im...
/* Based on: salsa20-merged.c version 20051118 <NAME> Public domain. Modified by <NAME> 2012. Public domain. */ #include <string.h> // for memcpy #include <stdexcept> #include "ecrypt-portable.h" #include "salsa20.h" #define SALSA_WORD_SIZE_BITS 64 #define ROTATE(v,c) (ROTL32(v,c)) #define PLU...
#include "DebLog.h" #include "Application.h" #include "mdWindow.h" #include "mdRender.h" #include "Brofiler/Brofiler.h" mdRender::mdRender() : Module() { name = "renderer"; background.r = 0; background.g = 0; background.b = 0; background.a = 100; } // Destructor mdRender::~mdRender() {} // Called before render...
#include <cstdio> #include <algorithm> #define N 20020 #define ll long long using namespace std; inline int read(){ int x=0,f=1;char ch=getchar(); while(ch>'9'||ch<'0')ch=='-'&&(f=0)||(ch=getchar()); while(ch<='9'&&ch>='0')x=(x<<3)+(x<<1)+ch-'0',ch=getchar(); return f?x:-x; } namespace __segment_tree { int lz...
/**************************************************************************** * * Copyright (c) 2018-2021 <NAME>. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions o...
// // Copyright (C) 2019 Bluzelle // // 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...
/* * Software License Agreement (BSD License) * * Copyright (c) 2011, <NAME>, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must reta...
/////////////////////////////////////////////////////////////////////////////// // FILE : WallpaperChanger.cpp // SYNOPSIS : Implementation file for console WIN32 application to change // the Windows desktop background to one randomly selected image // file each time an interval has elap...
// Copyright <NAME> 2015 // 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) #include <cpl/graph/edmonds_karp_max_flow.hpp> #include <gtest/gtest.h> #include <cpl/graph/directed_graph.hpp> // d...
/* Authors: <NAME> Copyright: Copyright (c) 2020 Microsoft Research 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 rights to use, copy, modify...
/* Copyright 2014 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 in writing, software dist...
#include "PhysicsSceneApp.h" #include "Texture.h" #include "Font.h" #include "Input.h" #include "Plane.h" #include <Gizmos.h> PhysicsSceneApp::PhysicsSceneApp() { } PhysicsSceneApp::~PhysicsSceneApp() { } bool PhysicsSceneApp::startup() { // increase the 2D line count to maximize the number of objects we can draw...
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2007-2015, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // ...
#include "../k_eigenvalue_solver.h" #include "ChiMesh/MeshHandler/chi_meshhandler.h" #include "ChiTimer/chi_timer.h" #include "chi_mpi.h" #include "chi_log.h" extern ChiMPI& chi_mpi; extern ChiLog& chi_log; using namespace LinearBoltzmann; //################################################################### /**S...
#include "libpstack/dwarf.h" #include "libpstack/global.h" #include "libpstack/elf.h" #include "libpstack/proc.h" #include <iostream> CoreProcess::CoreProcess(Elf::Object::sptr exec, Elf::Object::sptr core, const PstackOptions &options, Dwarf::ImageCache &imageCache) : Process(std::move(exec), std::make_s...
/** * A class to advertise BLE Beacons */ #include <algorithm> #include "MicroBit.h" #include "pxt.h" #include "ble/GapAdvertisingData.h" #include "SwgeBeaconService.h" namespace { const uint8_t SWGE_LOCATION_BEACON_PAYLOAD[] = { 0x83, 0x01, // manufacturer's id: 0x0183 0x0A, // type of beacon (location beaco...
/********************************************************************************** * MIT License * * * * Copyright (c) 2017 <NAME> <<EMAIL>> * * ...
/* ==== Author: <NAME> (<EMAIL>) Visual Geometry Group, Department of Engineering Science University of Oxford ==== Copyright: The library belongs to <NAME> and the University of Oxford. No usage or redistribution is allowed without explicit permission. */ #include "proto_db_file.h" #include <algorithm> #include <...
#include "../../include/shmaps/shmaps.hh" #include <random> class FooStats { public: FooStats() { } FooStats(int k, int b, float rev) : k(k), b(b), rev(rev) { } FooStats(const FooStats &fs) : k(fs.k), b(fs.b), rev(fs.rev) { } FooStats(FooStats &fs) : k(fs.k), b(fs.b), rev(fs.rev) { ...
// // main.cpp // entree // // Created by MPB on 5/27/13. // Copyright (c) 2015 Quadrivio Corporation. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are permitted // provided that the following conditions are met: // // Redistributions of source code m...
#include "effectstreemodel.h" #include <QJsonArray> #include <QJsonDocument> #include <QMimeData> #include <effectfactory.h> #include <QIcon> EffectsTreeModel::EffectsTreeModel(EffectGroup &rootEffect, QObject *parent) : QAbstractItemModel(parent), mRootEffect(rootEffect), mGroupIcon() { } QModelInde...
/* ISC License Copyright (c) 2021, <NAME> <<EMAIL>> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AU...
/* * Copyright (C) 2015 The Android Open Source Project * * 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 app...
// Prob: https://www.techiedelight.com/print-all-pairs-of-anagrams/ /*******************************************************************************************************/ #include<bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define ull unsigned long long #define pb push_back #de...
#include <cstring> #include <cassert> #include <iostream> #include <memory> using namespace std; ////////////////////////////////////////////////// // 'unique_ptr' is a smart pointer that claims // exclusive ownership over a pointer. It's meant // to be a replacement for the (now deprecated) // 'auto_ptr' class. /...
// Copyright 2013-2019 Stanford University // // 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 ...
/* * various filters for ACELP-based codecs * * Copyright (c) 2008 <NAME> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of th...
/** * Copyright Soramitsu Co., Ltd. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ #include <boost/program_options.hpp> #include <libp2p/log/configurator.hpp> #include "application/impl/app_configuration_impl.hpp" #include "blockchain/block_storage.hpp" #include "blockchain/block_tree.hpp" #include ...
/** @file p6HotSpot.cc @ingroup Power6Properties @brief Power6 specific property @author <NAME> @verbatim Revision: $Revision$ Revision date: $Date$ Committed by: $Author$ This file is part of the Periscope Tuning Framework. See http://www.lrr.in.tum.de/periscope for d...
#include <maxminddb.h> #include <string> #include "GarrysMod/Lua/Interface.h" #define META_NAME "GeoIPDB" #define META_ID 242 using namespace GarrysMod; bool grab_table_member(lua_State *state, const char *key, MMDB_entry_s *entry, const char *entry_key_1, const char *entry_key_2, const char *entry_key_3) { MMDB_en...
#include "SDL/SDL_ttf.h" #include <sstream> #include <iostream> #include <string> #include "playground.h" #include "sound.h" using namespace std; extern SDL_Event event; extern SDL_mutex *pg_mutex; //mutex for accessing key queues extern bool quit; //global variable //The attributes of the screen const int SCREE...
// servo #include <Servo.h> static Servo myservo1; static Servo myservo2; static Servo myservo3; #define HOLDING_ANGLE 40 #define HOLDING_ANGLE2 36 #define FALLING_ANGLE 22 #define FALLING_ANGLE2 52 #define FALLING_TIME 1000 #define HOLDING_TIME 200 // my tasks extern Task holdingkey1_task; extern Task fallingke...
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include "OnnxPrediction.h" #include "onnxruntime_session_options_config_keys.h" #include <vector> // Uses the onnxruntime to load the model // into a session. // OnnxPrediction::OnnxPrediction(std::wstring& onnx_model_fi...
#include "di_graph.h" #include "di_reachability.h" #include "di_paths.h" #include "di_depth_first_order.h" #include "di_topological.h" #include "di_cc.h" #include "di_cycle.h" //#include "two_color.h" #include "common/utils.h" #include <iostream> using namespace graph; static void PrintPath(DiPaths &path, int v) { ...
#include<bits/stdc++.h> using namespace std; #define fi first #define se second #define SZ(x) ((int)x.size()) #define lowbit(x) x&-x #define pb push_back #define ls (u<<1) #define rs (u<<1|1) #define ALL(x) (x).begin(),(x).end() #define UNI(x) sort(ALL(x)),x.resize(unique(ALL(x))-x.begin()) #define GETPOS(c,x) (lower_b...
// Copyright (c) 2017-2020, Lawrence Livermore National Security, LLC and // other Axom Project Developers. See the top-level COPYRIGHT file for details. // // SPDX-License-Identifier: (BSD-3-Clause) #include "axom/config.hpp" #include "axom/slic/interface/slic.hpp" #include "axom/slic/core/UnitTestLogger.hpp" using a...
#include <cmath> #include <span> #include <vector> #include "../Helpers.h" #include "Inventory.h" #include "ItemGenerator.h" #include "../SDK/ItemSchema.h" static float generateWear() noexcept { float wear; if (const auto condition = Helpers::random(1, 10000); condition <= 1471) wear = Helpers::rando...
/* * Copyright 2015 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * */ #include <VisualBench/VisualBenchmarkStream.h> #include <VisualBench/WrappedBenchmark.h> #include "GMBench.h" #include "SkOSFile.h" #include "SkPath.h" #include "SkPictureR...
#define WIN32_LEAN_AND_MEAN #include <windows.h> #include <WinSock2.h> #include <WS2tcpip.h> #include <array> #include <iostream> #include <pthread.h> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include "ClientThread.h" #define DEFAULT_BUFLEN 512 #define DEFAULT_PORT "27015" #define NUM...
/* Author: <NAME> (<EMAIL>) */ #define _FILE_OFFSET_BITS 64 #define _THREAD_SAFE #define BOOST_GRAPH_USE_NEW_CSR_INTERFACE #define BOOST_NO_CXX11_NULLPTR #include <utility> #include <vector> #include <iostream> #include <boost/graph/graph_traits.hpp> #include <boost/graph/compressed_sparse_row_graph.hpp> #include <...
#include "Game.h" bool Game::isWinner(State board, Blank player) { if (board[0] == player && board[0] == board[1] && board[1] == board[2]) return true; else if (board[3] == player && board[3] == board[4] && board[4] == board[5]) return true; else if (board[6] == player && board[6] == board[7] && boa...
/* http://www.petesqbsite.com/sections/tutorials/tuts/vbe3.pdf */ #include <system/components/vesa.h> #include <system/system.h> using namespace CactusOS; using namespace CactusOS::common; using namespace CactusOS::system; using namespace CactusOS::core; uint16_t* RealPTRToAddr(Real_Pointer ptr){ return (uint16_...
#include "Game.h" #include "TextureManager.h" #include "GameObject.h" #include "MyButton.h" #include "Level.h" Game::Game() {} Game::~Game() {} Level* level; int l = 1; int lastHearts; int cScore = 0; bool startLevel = false; bool playPushed = false; GameObject* asteroidsTitle; MyButton* buttonP...
/* origin: FreeBSD /usr/src/lib/msun/src/e_sqrt.c */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunSoft, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freel...
#include "game.h" #include <iostream> #include <string> using namespace std; int main() { /* in a real game, this would be needed but it got tedious to type in a new name * after every test * * string p_name; * cout << "New game of Shang-hai\n\n"; * cout << "Enter your name: "; * c...
#include "BufferPool.h" #include <unistd.h> #include <sys/syscalls.h> #include <driver/DmaBuffer.h> #include <algorithm> #include <cstdio> #include <cstring> using namespace libdriver; /// Region of virtual memory space for buffer pools static uintptr_t kIoBufferMappingRange[2] = { // start 0x60809000000, ...
#include "lmdb_creator.hpp" #include "caffe/util/io.hpp" LMDataBase::LMDataBase(string lmdb_path, size_t dat_channels, size_t dat_size) : datum_channels(dat_channels), datum_size(dat_size), num_inserts(0) { // Set database environment mkdir(static_cast<const char *>(lmdb_path.c_str()), 0744); // Create LMDB ...
/* * 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 may ...
// Standard system includes #include <assert.h> #include <errno.h> // -EINVAL, -ENODEV #include <netdb.h> // gethostbyname #include <sys/poll.h> #include <sys/types.h> // connect #include <sys/socket.h> // connect #include <trace.h> #define MY_TRACE_PREFIX "EthernetServer" extern "C" { #include "string.h" } #...
// Copyright 2022 <NAME> #include <vector> #include <string> #include <cstring> #include "include/numeric_interval.h" using std::vector; NamericInterval::NamericInterval() : left_border(0), right_border(0), left_include(true), right_include(true) {} NamericInterval::NamericInterval(int left_border_, int righ...
/****************************************************************************** * SOFA, Simulation Open-Framework Architecture, development version * * (c) 2006-2017 INRIA, USTL, UJF, CNRS, MGH * * * ...
#include "SpiUart.h" // See section 8.10 of the datasheet for definitions // of bits in the Enhanced Features Register (EFR) #define EFR_ENABLE_CTS 1 << 7 #define EFR_ENABLE_RTS 1 << 6 #define EFR_ENABLE_ENHANCED_FUNCTIONS 1 << 4 // See section 8.4 of the datasheet for definitions // of bits in the Line Control Reg...
/* * ZSUMMER_11X License * ----------- * * ZSUMMER_11X is licensed under the terms of the MIT license reproduced below. * This means that ZSUMMER_11X is free software and can be used for both academic * and commercial purposes at absolutely no cost. * * * ====================================================...
/** \file \brief The implementation for the BodyCustomizer class \author <NAME> */ #ifdef _WIN64 #define NOT_USE_BOOST_ATOMIC #endif #include "BodyCustomizerInterface.h" #include "Body.h" #include <cnoid/FileUtil> #include <map> #include <set> #include <cstdlib> #include <iostream> #include <boost/tokenizer....
#include "Land.hpp" #include "Building.hpp" #include "constants.hpp" #include "utilities.hpp" #include <stddef.h> Land::Land() { borderRoad = NULL; borders = new std::list<float*>(); buildings = new std::list<Building*>(); } Land::~Land() { borderRoad = NULL; borders->clear(); delete borders; buildings...
#include <Arduino.h> #include <WiFi.h> #include <DNSServer.h> //Local DNS Server used for redirecting all requests to the configuration portal #include <WebServer.h> //Local WebServer used to serve the configuration portal #include <Preferences.h> #include <WiFiManager.h> #include "Adafruit_Sensor.h" #in...
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <assert.h> #include <ctype.h> #include <errno.h> #include <limits.h> #define LENGTH 128 typedef enum { STR2INT_SUCCESS, STR2INT_OVERFLOW, STR2INT_UNDERFLOW, STR2INT_INCONVERTIBLE } str2int_e...
// Copyright 2020 <NAME> #include <mpi.h> #include <random> #include <vector> #include "../../../modules/task_3/tronin_d_fox_matrix_multiplication/fox_matrix_multiplication.h" std::vector<double> getRandomVector(size_t size) { std::random_device random_device; std::mt19937 rand_gen(random_device()); std::u...
#include <stdlib.h> #include <stdint.h> #include <math.h> int get_red(uint64_t color) { return (color) & 0xff; } int get_green(uint64_t color) { return (color >> 8) & 0xff; } int get_blue(uint64_t color) { return (color >> 16) & 0xff; } int get_alpha(uint64_t color) { return (color >> 24) & 0xff; } int clamp255_0(int...
//Author: AwfulCrawler // // All rights reserved. // // 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 copyright notice, this list of // conditions and the ...
// // Game.cpp // Snake // // Created by X on 16.05.18. // #include "Game.hpp" #include <algorithm> #include <iostream> Game::Game(SDL_Point playground_top_left, SDL_Point playground_dimensions, SDL_Point score_top_left, SDL_Point score_dimensions, int tile_size) :mIsRu...
// // Created by youdonghai on 15/10/16. // #include <iostream> #include <cmath> #include <algorithm> #include "Search.h" #include "FaceCube.h" #include "CoordCube.h" std::mutex Search::tlk; int Search::phase1_done = 0; int Search::phase2_done = 0; uint8_t Search::result_moves[31] = {}; uint8_t Search::result_move_l...
/* Jits.cpp - Library to connect with JSON IoT Server. Created by <NAME> Released into the public domain. https://github.com/luisfog/jits */ #include "Arduino.h" #include "Jits.h" #include "AES.h" #include "Base64.h" #include "Ethernet.h" Jits::Jits(String server, int port, String connectionKey, String aesKey) ...
// //////////////////////////////////////////////////////// // # Title // Prime triples and geometric sequences // // # URL // https://projecteuler.net/problem=518 // http://euler.stephan-brumme.com/518/ // // # Problem // Let `S(n) = sum{a+b+c}` over all triples `(a,b,c)` such that: // // - `a`, `b`, and `c` are prime...
#include "shapescene.h" #include "square.h" #include "sinwave.h" #include "text.h" #include "squarewithtext.h" #include <QThread> #include <QMouseEvent> #include <QGraphicsSceneEvent> #include <QTextStream> #include <QInputDialog> #include <QMessageBox> #include <QDebug> #include <exception> ShapeSce...
/* Author: <NAME> * Algorithm: Prims Minimum Spanning Tree for Adjacency List Representation Algorithm */ /* MST-PRIM(G, w, r): * 1 for each u belonging to V[G] * 2 do key[u] <- Infinity * 3 parent[u] <- NIL * 4 key[r] <- 0 * 5 Q <- V[G] * 6 while Q != Empty * 7 do u <- EXTRACT-MIN(Q) * 8 for each v belongi...
//sudo chmod 0666 /dev/ttyUSB1 //$ Command to find serial port reqd : ls /sys/bus/usb-serial/devices/ -ltrah // #include <stdio.h> /* Standard input/output definitions */ #include <iostream> #include <string.h> /* String function definitions */ #include <unistd.h> /* UNIX standard function definitions ...
// DrawTile // 该示例使用TileData,演示多个tile图片在一张纹理上 #include<hgl/type/StringList.h> #include<hgl/graph/TextureLoader.h> #include<hgl/graph/TileData.h> #include"VulkanAppFramework.h" #include<hgl/graph/VKTexture.h> #include<hgl/graph/VKSampler.h> #include<hgl/math/Math.h> using namespace hgl; using namespace hgl::graph; ...
// Copyright (c) 2011 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // A simple daemon to detect, mount, and eject removable storage devices. #include <glib.h> #include <glib-unix.h> #include <libudev.h> #include ...
/********************************************************************************* MIT License Copyright (c) 2016 Microsoft 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, i...
#include "helpers.h" // Convert miles per hour to meters per second double mph_to_mps(double mph) { return mph * 0.44704; } // Convert meters per second to miles per hous double mps_to_mph(double mps) { return mps * 2.23694; } // Braking distance based on physics // See here: https://en.wikipedia.org/wiki/Braking_...
/* * StringTools.cpp * * Created on: Jun 16, 2010 * Author: TF */ #include "StringTools.h" std::list<std::string> splitString(const std::string &str, char delim) { std::list<std::string> strList; std::stringstream ss(str); std::string item; while(getline(ss, item, delim)) strList.push_back(item); re...
#include <iostream> #include <unordered_map> using namespace std; /** * A trie is a tree-like data structure whose nodes store the * letters of an alphabet. By structuring the nodes in a particular * way, words and strings can be retrieved from the structure by * traversing down a branch path of the tree. * ...
#include "zynq_driver.h" #include <sys/mman.h> #include <unistd.h> #include <fcntl.h> #include <assert.h> #include <stdio.h> #define ZYNQ_BASE_PADDR 0x43C00000L #define TSI_OUT_FIFO_DATA 0x00 #define TSI_OUT_FIFO_COUNT 0x04 #define TSI_IN_FIFO_DATA 0x08 #define TSI_IN_FIFO_COUNT 0x0C #define SYSTEM_RESET 0x10 #defin...
#include "wheelchair.h" /* Intializes the right encoder */ QEI wheelS(D9, D10, NC, 1200); /* Set pull-up resistors to read analog signals into digital signals */ DigitalIn pt3(D10, PullUp); DigitalIn pt4(D9, PullUp); /* Initializes Left encoder */ QEI wheel (D7, D8, NC, 1200); /* Set pull-up ...
/***************************************************************************** ** DARWIN: A FRAMEWORK FOR MACHINE LEARNING RESEARCH AND DEVELOPMENT ** Distributed under the terms of the BSD license (see the LICENSE file) ** Copyright (c) 2007-2017, <NAME> ** All rights reserved. ** *************************************...