text
stringlengths
3.08k
12.5k
// Copyright (c) 2014-2016 Dropbox, 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 agr...
/** * 思路不清晰者挂得惨 * 1. 首先是考虑各种左边界,要取一个最小值 * 2. 记录的maxlen需要考虑到自己的儿子(考虑分治的过程) */ #include <cstdio> #include <climits> #include <cstring> #include <algorithm> using namespace std; #define TO_WHITE 1 #define TO_BLACK 2 struct Node { Node(int _left, int _right) : left(_left), right(_right), maxl...
#include "CMakeMsc.hpp" #include "CMakeListsWriter.hpp" #include "CMakeConfigTemplateWriter.hpp" #include "CMakeSubDirRegistering.hpp" using namespace proj2cmake; const char* cmake::cmakeTypeCaption(vcx::ConfigurationType type) { switch(type) { case vcx::ConfigurationType::Application: return "APP"; ...
#include "mspch.h" #include "Moss/Moss.h" #include "glm/glm.hpp" #include "glm/gtx/transform.hpp" #include "imgui/imgui.h" #include <memory> #include "Platform/OpenGL/OpenGLShader.h" #include "glm/gtc/type_ptr.hpp" class ExampleLayer : public Moss::Layer { public: ExampleLayer() :Layer("Example"), m_Camera(-1.6f, ...
#include "WaveTableGenerator.h" #include <math.h> #include "util/mathutil.h" bool WaveTableGenerator::addSine(WaveTable& wavetable, float amplitude, int mult, float phaseShift) { float nyquist = wavetable.getSampleRate() * 0.5; size_t size = wavetable.getSize(); float* tempBuffer = wavetable.getTempBuffer...
#include <iostream> #include <iomanip> #include <fstream> #include <vector> #include <memory> #include <chrono> #include <sys/mman.h> #include <getopt.h> #include "xrt.h" #include "ert.h" #include "xclbin.h" struct task_info { unsigned boh; unsigned exec_bo; ert_start_kernel_...
#include <string> #include <random> #include <fstream> #include <benchmark/benchmark.h> #include <hdr_histogram.h> #include "benchmark.hpp" #include "fixtures/common_fixture.hpp" #include "fixtures/viper_fixture.hpp" #include "fixtures/faster_fixture.hpp" #include "fixtures/crl_fixture.hpp" #include "fixtures/dash_fi...
/* How to play game music files with Music_Player (requires SDL library) Run program with path to a game music file. Left/Right Change track Space Pause/unpause E Normal/slight stereo echo/more stereo echo -/= Adjust tempo 1-9 Toggle channel on/off 0 Reset tempo and turn cha...
// Copyright (C) 2019 <NAME> and Artificial Necessity // This code distributed under zlib, see LICENSE.txt for terms. #include "hinge_energy.hpp" // Align xs[4] - xs[3] to xs[1] - xs[0] and return in new space std::vector<Eigen::Vector3d> get_aligned(const std::vector<Eigen::Vector3d>& xs) { Eigen::Vector3d e1 ...
#include <assert.h> #include <string.h> #include <iostream> #include "libplatform/libplatform.h" #include "v8.h" #include "vm.h" #include "erlang_v8.h" #include "debug.h" #include "packet.h" using namespace v8; using namespace std; class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { public: ...
/* * Copyright 2017 Maeve Automation * * 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, merge, publis...
/******************************************************************* Copyright(c) 2016, <NAME> All rights reserved. Distributed under the BSD license. (See accompanying file LICENSE.txt at https://github.com/zhedahht/CodingInterviewChinese2/blob/master/LICENSE.txt) *****************************************************...
// // main.cpp // // This program implements the function, listMnemonics(), which generates // all possible letter combinations that correspond to a given phone number // represented as a string of digits. The combinations should be English // words. // // The letters are assumed to be mapped to the keypad as follows:...
/** * @file llfloaterscriptdebug.cpp * @brief Chat window for showing script errors and warnings * * $LicenseInfo:firstyear=2006&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under...
#include "stdafx.h" #include "tube.h" #define DEFAULT_INTERVAL 40 #define SEARCH_PARAM 7 #define DISTORTION_GRADIENT_THRESHOLD 2.5 #define ALPHA_1 0.8 #define ALPHA_2 0.5 #define BETA 1.0 Tube::Tube() : m_interval(DEFAULT_INTERVAL) , m_distortion(0.0) { } Tube::~Tube() { } void Tube::Create(const Deque<st...
// Copyright © 2021 <NAME>. All Rights Reserved. #include "gtest/gtest.h" #include "lib/common/multitype_map.hpp" #include "lib/common/ostream.hpp" #include "lib/common/serialize.hpp" #include "lib/common/tagged_tuple.hpp" #include "lib/data/field.hpp" #include "lib/data/vec.hpp" #include "lib/internal/flat_ptr.hpp" ...
#include "NTSCD.h" #include "Function.h" #include "Block.h" namespace llvm { class Function; } #include <algorithm> #include <functional> #include <queue> #include <unordered_set> #include <ostream> #include "dg/util/debug.h" using namespace std; namespace dg { namespace llvmdg { namespace legacy { NTSCD::NTS...
#include "software_rasterizer/precompiled.h" #include "font.h" #define STB_TRUETYPE_IMPLEMENTATION #pragma warning(push) #pragma warning(disable : 4100) /* unreferenced formal parameter */ #pragma warning(disable : 4365) /* signed/unsigned mismatch */ #include <stb/stb_truetype.h> #pragma warning(pop) #include <stdi...
/** *----------------------------------------------------------------------------- * Title : UDP Client Class * ---------------------------------------------------------------------------- * File : Client.h * Created : 2017-01-07 * Last update: 2017-01-07 * -----------------------------------------...
// // Cloth.cpp // Drawing // // Created by <NAME> on 10/03/2014. // Copyright (c) 2014 <NAME>. All rights reserved. // #include "Cloth.h" #include "World_Utilities.h" #define GRAVITY_FORCE Vector2(0.1, -20) #define CLOTH_LEVEL 1 #define WIDTH 32 using namespace std::placeholders; void Cloth::sp...
/* Copyright (c) 2007-2015 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Found...
/* S T I T C H . C P P * BRL-CAD * * Copyright (c) 2016-2022 United States Government as represented by * the U.S. Army Research Laboratory. * * 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 a...
#pragma once #include "unstd/DynamicArray.hpp" #include "unstd/unstdlib.hpp" #include <algorithm> namespace { template <typename T> inline bool is_power_of_two(T n) { return (n & (n - 1)) == 0; } template <typename T> struct DefaultHash { static u32 hash(u32 x) { static_assert(sizeof(T) == 0, "Defa...
#include "ping.hpp" Php::Value Phping::ping(Php::Parameters& params){ //Host, device, callback, count, sequence number //==================================== std::string host = params[0]; Php::Value retVal = true; m_ping(host,params[3],params[2]); return retVal; } std::string Phping::m_getDevi...
/* GWEN Copyright (c) 2010 <NAME> See license in Gwen.h */ #include "UnitTest.h" #include "Gwen/Platform.h" #include "Gwen/Controls/TreeControl.h" using namespace Gwen; #define ADD_UNIT_TEST( name )\ GUnit* RegisterUnitTest_##name( Gwen::Controls::TabControl* tab );\ RegisterUnitTest_##name( m_TabControl )->Se...
// Copyright (c) 2007-2020, <NAME> aka Hrissan // Licensed under the MIT License. See LICENSE for details. #include <iostream> #include <set> #include <crab/crab.hpp> static const char HTML[] = R"zzz( <!DOCTYPE HTML> <html><head> <script type = "text/javascript"> function WebSocketTest() { ...
#include <iostream> #include <fstream> #include <string> #include <array> #include <deque> #include <bitset> #include <vector> #include <cstdint> #include <unordered_set> using u32 = uint32_t; using u64 = uint64_t; struct Game { std::array<std::vector<u32>, 2> playerHands; }; void part1(const Game& game) { s...
/* * CameraParamsSetup.cpp * * function: store all information of one camera * save/read all parameters to/from file * * author: <NAME> */ #include "CameraParamsSetup.h" #include "Logger.h" #include <opencv2/imgproc.hpp> #include <opencv2/calib3d.hpp> #include <time.h> #include <iostream> #include ...
#include "mailnotification.h" char* MailNotification::payload_text = NULL; MailNotification::MailNotification(string from, string to, string cc, string subject, string message) { this->from = from; this->to = to; this->cc = cc; this->subject = subject; this->message = message; this->curl = cur...
/* * Interplay C93 demuxer * Copyright (c) 2007 <NAME> <<EMAIL>> * * 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 the License,...
// This file is distributed under the BSD 3-Clause License. See LICENSE for details. #include <string> #include "inou_def.hpp" #include "lgraph.hpp" Inou_def_options_pack ::Inou_def_options_pack() { } Inou_def::Inou_def() { fmt::print("DEBUG:: Inou_def class created\n"); }; void Inou_def::set_def_info(Def_info &...
#include "core.h" #include "d3d9texture.h" #include "configmanager.h" #include "idatastream.h" #include "mathcore.h" #include <d3d9.h> #include <ddraw.h> // For DDSURFACEDESC2 D3D9Texture::D3D9Texture( IDirect3DDevice9* D3DDevice ) : m_Texture( NULL ) , m_D3DDevice( D3DDevice ) { } D3D9Texture::D3D9Texture( IDirect3...
/* * MetaCall Library by Parra Studios * A library for providing a foreign function interface calls. * * Copyright (C) 2016 - 2020 <NAME> <<EMAIL>> * * 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 th...
/** * Puma - CityEngine Plugin for Rhinoceros * * See https://esri.github.io/cityengine/puma for documentation. * * Copyright (c) 2021 Esri R&D Center Zurich * * 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 ...
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; enum Direction { DOWN, RIGHT, UP, LEFT }; const int MAX_DOTS = 100; // maximum possible dots for maze void mazeTraversal( char [][ 12 ], const int, const int, int, int, int ); void mazeGenerator( char [][ 12 ], int *, int * ); void printMaze...
#include "ROSUnit_BroadcastData.hpp" ROSUnit_BroadcastData* ROSUnit_BroadcastData::_instance_ptr = NULL; ROSUnit_BroadcastData::ROSUnit_BroadcastData(ros::NodeHandle& t_main_handler) : ROSUnit(t_main_handler){ _pos_prov_pub = t_main_handler.advertise<geometry_msgs::PointStamped>("body_position", 10); _ori_pro...
// Copyright (c) 2015 Elements of Programming Interviews. All rights reserved. #include <cassert> #include <iostream> #include <limits> #include <memory> #include "./BST_prototype_shared_ptr.h" using std::cout; using std::endl; using std::make_shared; using std::numeric_limits; using std::shared_ptr; shared_ptr<BST...
// hiptext - Image to Text Converter // By <NAME> #include "hiptext/termprinter.h" #include <cstring> #include <iostream> #include <glog/logging.h> const int TermPrinter::kReset = 0; const int TermPrinter::kBoldOn = 1; const int TermPrinter::kBoldOff = 22; const int TermPrinter::kItalicOn = 3; const int TermPrinter...
/* Copyright (c) 2021, <NAME>. All rights reserved. */ /* SPDX-License-Identifier: MIT */ #include <fstream> #include <iostream> #include <string> int64_t test_with_original_code(const std::string &data) { std::fstream input("input"); std::string instr; std::string arg0, arg1; uint8_t data_index = 0; ...
#include "stdafx.h" #include "functions.h" #include <rhinoSdkCageObject.h> #include <string> #include <fstream> #include <sstream> #include <string> #include <array> typedef std::size_t SizeType; typedef std::size_t IndexType; int GetVectorFromMatrixIndices(const SizeType NumberPerRow, const SizeType NumberPerColumn...
#include "ofxAudioEngine.h" ofxAudioEngine::ofxAudioEngine():buffer_counter{0},state{State::kStop} {} ofxAudioEngine::~ofxAudioEngine(){ stream.close(); } void ofxAudioEngine::setup(const int buffer_size, const int sample_rate) { buffer_data.assign(buffer_size,0.f); auto device_list = stream.getDeviceL...
#include <esp32-hal-log.h> #include "EspSdWrapper.h" #include "esp_vfs.h" #include "esp_vfs_fat.h" #include "sdmmc_cmd.h" #include "diskio.h" #include "FatHelpers.h" using namespace std; bool EspSdWrapper::init(uint8_t miso, uint8_t mosi, uint8_t clk, uint8_t cs) { sdmmc_host_t host = SDSPI_HOST_DEFAULT(); h...
/* ============================================================================ Copyright (c) 2011-2014, Institute for Microelectronics, Institute for Analysis and Scientific Computing, TU Wien. ----------------- ViennaSHE - Th...
#include <iostream> #include <cstring> #include <bitset> #include "ip.h" #include "ethernet.h" #include "icmp.h" #include "arp.h" #include "in.hpp" #include "pk_buff.h" /* * rfc 791 * https://tools.ietf.org/html/rfc791 */ /* IP Options */ namespace IPOptions { static constexpr uint8_t EOOL = 0x0; static constexp...
#include <float.h> #include <cmath> #include "get_floor_Hf.h" #include "normalize2dpts.h" #include <Eigen/Geometry> using namespace Eigen; PoseData get_floor_Hf(MatrixXd &p1, MatrixXd &p2, Matrix3d &R1, Matrix3d &R2, double f1) { int nbr_coeffs = 21; int nbr_unknowns = 6; // Save copies of the inverse ro...
/* * Copyright 2003-2007, <NAME>, <EMAIL>. * Distributed under the terms of the MIT License. */ #include "Handle.h" #include <boot/platform.h> #include <util/kernel_cpp.h> #include <unistd.h> #include <errno.h> #include <dirent.h> #include <limits.h> #include <string.h> #include <stdio.h> // we're using some l...
// day_13.cpp : This file contains the 'main' function. Program execution begins and ends there. #include <iostream> #include <fstream> #include <vector> #include <string> #include <chrono> #include <unordered_map> #include <algorithm> #include <functional> #include <optional> struct Point { int x, y; Point (int...
#include "oscillator.h" Oscillator::Oscillator() { printf("osc create!\n"); printf("oscPiFP: %x\n", oscPiFP.GetRawVal()); adsr.setRates((int32_t)0, (int32_t)0, (int32_t)0); adsr.setLevels((int32_t)0, (int32_t)0, (int32_t)0); accumulator = (int32_t)0; accumulatorFP = (int32_t)0; freqFP = (int32_t)0; tuningWord ...
#include "ode23.hpp" ODE23::ODE23(TimeIntegrableRHS& rhs, const TimeIntegratorOptions& opts) : TimeIntegrator(rhs, opts), controller_(opts) { k1_rhs_ = rhs.createSolutionState(); k2_rhs_ = rhs.createSolutionState(); k3_rhs_ = rhs.createSolutionState(); k4_rhs_ = rhs.cr...
//HEADING: BINARY SEARCH ALGORITHM// //PROBLEM STATEMENT: /* TO CHECK WHETHER A SORTED ARRAY CONTAINS GIVEN ELEMENT(INTEGER). IF THE ELEMENT IS PRESENT RETURN ITS INDEX. ELSE RETURN -1. */ //SOLUTION-1: (BRUTE_FORCE) --> O(n) int search1(int arr[], int key) { int n = sizeof(arr)/sizeof(arr[0]); f...
/* Copyright (c) 2003-2012 Sony Pictures Imageworks Inc., et al. 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 retain the above copyright notice, this list of co...
#include "web_client_ssl.h" #include <iostream> #include <boost/beast/version.hpp> #include <boost/asio/connect.hpp> #include <boost/asio/ip/tcp.hpp> #include <boost/asio/ssl/error.hpp> #include <boost/asio/ssl/stream.hpp> WebClientSsl::WebClientSsl(boost::asio::io_context& ioc, boost::asio::ssl::context& ctx) : ...
/* * 16-bit timer 1 used for timekeeping as well as arbitrary timeouts. * Complex stuff. * * Licensed under AGPLv3. */ #include "timer1.h" #include <avr/interrupt.h> #include <avr/io.h> #ifndef NULL #define NULL 0 #endif void timer_init(void) { TCCR1A = 0x00; TCCR1B = 0x01; TIMSK1 = 0x01; } static...
#include <stdio.h> #include <string.h> #include <fcntl.h> #include <sys/stat.h> #include <time.h> #include <stdlib.h> #include <unistd.h> //getuid() #include <sys/types.h> // getuid() #include <iostream> #include "lucky7.h" char DATAFILE[] = "/var/lucky7.txt"; // File to store players data using namespace std; // Gl...
/*This file is part of the FEBio source code and is licensed under the MIT license listed below. See Copyright-FEBio.txt for details. Copyright (c) 2019 University of Utah, The Trustees of Columbia University in the City of New York, and others. Permission is hereby granted, free of charge, to any person obtaining ...
/* * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The OpenAirInterface Software Alliance licenses this file to You under * the Apache License...
#include "tutorial/sandBox/sandBox.h" #include "igl/edge_flaps.h" #include "igl/collapse_edge.h" #include "Eigen/dense" #include <functional> #include <math.h> #define EPSILON 0.1f SandBox::SandBox() { } void SandBox::Init(const std::string& config) { std::string item_name; std::ifstream nameFileout; doubletemp...
//<NAME> #include<bits/stdc++.h> using namespace std; typedef pair<int,int> II; typedef vector< II > VII; typedef vector<int> VI; typedef vector< VI > VVI; typedef long long int LL; typedef unsigned long long int ULL; #define PB push_back #define MP make_pair #define F first #define S second #define SZ(...
/* * BlueprintEntry.cpp * * Created on: Apr 3, 2011 * Author: kyle */ #include "BlueprintEntry.h" #include "server/zone/objects/resource/ResourceContainer.h" #include "server/zone/objects/installation/factory/FactoryObject.h" #include "server/zone/packets/tangible/TangibleObjectDeltaMessage3.h" #include "se...
#include <Wire.h> #include "TSL2581.h" /************************************************************************** Writes a register and an 8 bit value over I2C **************************************************************************/ void WaveShare_TSL2581::Write8(byte reg, unsigned long value) { Wire.beginTran...
/******************************************************************************* * Copyright 2021 * * 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/LICENS...
// Copyright 2021 <NAME>. All rights reserved. // Use of this source code is governed by the MIT license that can be found in // the LICENSE file. #include <algorithm> // for count #include <array> // for array #include <cassert> // for assert #include <cmath> // for abs #include <cstddef> // for size_t #i...
#include <assert.h> #include <sstream> #include <iostream> #include "LDgammaTracker.h" #include "packet.h" constexpr std::array<int, 6> LDgammaTracker::Ns, LDgammaTracker::Ts; constexpr std::array<int, 4> LDgammaTracker::telemetry_t, LDgammaTracker::telemetry_gamma; uint64_t telemetryStatistics[15][28]; uint64_t bas...
#include <iostream> #include <fstream> #include <sstream> #include <cstdlib> #include <cstring> #include "SDL2/SDL2_framerate.h" #include "SDL2/SDL_messagebox.h" #include "Renderer.h" #include "RenderModel.h" #include "test.h" #include "EntityManager.h" #include "Stage.h" void showHelp() { SDL_MessageBoxButtonD...
/* Minetest Copyright (C) 2010-2013 kwolekr, <NAME> <<EMAIL>> This program 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 the License, or (at your option) any later version. This pr...
#include <iostream> #include <cassert> #include <boost/graph/adjacency_list.hpp> #include <boost/graph/push_relabel_max_flow.hpp> const int debug_level = 0; #define DEBUG(min_level, x) \ if (debug_level >= min_level) \ { \ std::cerr << x << std::endl; \ } typedef boost::a...
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> #include<vector> using namespace std; #define ll long long #define mem(Arr,x) memset(Arr,x,sizeof(Arr)) const int maxN=301000; const int maxM=maxN<<1; const int maxBit=20; const int inf=2147483647; int n; int edgecnt=0,Head[m...
/* Copyright (c) 2010-2013 <NAME> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and ...
#include "Matrix.hpp" // matching chosen_y if 0 or with the biggest positive relation column[0]/column[i] static real_t ChooseBestRow(const Matrix &M, const size_t x) { real_t theta(0); size_t chosen_y = 0; for(size_t another_y = 1; another_y < M.Height(); ++another_y) { if(M[another_y][x] <= real_t(0)) { cont...
/** * @file * @brief [Word Break Problem](https://leetcode.com/problems/word-break/) * @details * Given a non-empty string s and a dictionary wordDict containing a list of * non-empty words, determine if s can be segmented into a space-separated * sequence of one or more dictionary words. * * Note: * The same ...
#include <cstdio> #include <vector> #include <string> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include "ratbreeder.hh" #include "dna.pb.h" #include "configrange.hh" using namespace std; void print_range( const Range & range, const string & name ) { printf( "Optimizing for...
// LCM example program for interacting with PCL data // In this case it pushes the data back out to LCM in // a different message type for which the "collections" // renderer can view it in the LCM viewer // mfallon aug 2012 #include <stdio.h> #include <inttypes.h> #include <lcm/lcm.h> #include <iostream> #include <p...
#include "Mask.h" #include "Image.h" #include "Utility.h" #include "Features.h" #include "pRandomForest.h" #include "dlib/cmd_line_parser.h" #include "dlib/image_io.h" #include <vector> #include <string> #include <iostream> using namespace std; struct Options { int fft_width = 512; int fft_step = 256; int hi_pas...
// // begin license header // // This file is part of Pixy CMUcam5 or "Pixy" for short // // All Pixy source code is provided under the terms of the // GNU General Public License v2 (http://www.gnu.org/licenses/gpl-2.0.html). // Those wishing to use Pixy source code, software and/or // technologies under different lice...
#include <iostream> #include <string> #include <vector> #include <iomanip> using namespace std; class Book { public: string bookname; double price; int number; Book(const string&, const double&, const int&); void display() const; void borrow(); void restore(); }; void display_stock(const vector<Book>&); voi...
/* * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free ...
/*--------------------------------------------------------------*/ /* filename - tresfile.cpp */ /* */ /* function(s) */ /* TResourceFile member functio...
#include "GUI/Toolbar.h" #include "GUI/NodeWindow.h" #include "Nodes/StartNode.h" #include "ApplicationState.h" #include "Dialogue.h" #include "FileIO/InsertScriptParser.h" #include "FileIO/TranslationParser.h" #define NPC_PREFIX "npc_" #ifdef _WIN32 #include "dirent/dirent.h" #else #include <dirent.h> #endif inline...
/**********************************************************************************/ /* */ /* File: MeshObject.cpp */ /* Author: <EMAIL> ...
/*<NAME>*/ #include <iostream> #include <numeric> #include <fstream> #include <climits> #include <cstring> #include <cstdio> #include <cmath> #include <queue> #include <list> #include <map> #include <set> #include <stack> #include <deque> #include <vector> #include <string> #include <cstdlib> #include <cassert> #includ...
/* ____ _____ _ _ | __ )| ____| | / \ | _ \| _| | | / _ \ | |_) | |___| |___ / ___ \ |____/|_____|_____/_/ \_\ The platform for ultra-low latency audio and sensor processing http://bela.io A project of the Augmented Instruments Laboratory within the Centre for Digital Music at Queen M...
/*! * minter_tx. * signature_data.cpp * * \date 2019 * \author <NAME> (<EMAIL>) * \link https://github.com/edwardstock */ #include "minter/tx/signature_data.h" #include "minter/tx/utils.h" #include <algorithm> #include <cassert> #include <iostream> minter::signature_single_data::signature_single_data(const...
#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <uv.h> #include "absl/strings/numbers.h" #include "absl/strings/str_format.h" #include "heyp/encoding/binary.h" #define DEFAULT_BACKLOG 2048 namespace heyp { names...
/* * Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. * * 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 ...
/* Copyright (c) 2012 KrossX <<EMAIL>> * License: http://www.opensource.org/licenses/mit-license.html MIT License */ #include "General.h" #include "playstation_codes.h" #include "playstation_devices.h" #include "Input.h" DualShock2::DualShock2(_Settings &config) : DualShock(config, 21) { memset(pressureButton, 0x...
#include "AABB_triangles.h" #include <glm/glm.hpp> sTriAABB::sTriAABB() { // Clear the vertex values to zeros this->verts[0] = this->verts[1] = this->verts[2] = glm::vec3(0.0f); this->calculateID(0, 0); this->CalcLongestSide(); return; } sTriAABB::sTriAABB( glm::vec3 v0, glm::vec3 v1, glm::vec3 v2 ) { this->ve...
#include <geometry/camera.h> #include <geometry/camera_functions.h> #include <iostream> Camera Camera::CreatePerspectiveCamera(double focal, double k1, double k2) { Camera camera; camera.type_ = ProjectionType::PERSPECTIVE; camera.affine_ << focal, 0, 0, focal; camera.distortion_ << k1, k2, 0, 0, 0; return c...
#include <array> #include "neopixel.hpp" #include "util.hpp" //#define DEBUG #ifdef DEBUG extern "C" { uint16_t debug_cnt1, debug_cnt2, debug_cnt3; } #endif namespace { std::array<uint8_t, NeoPixel::NumBufferSize> s_pwm_dat; } namespace { //#pragma GCC optimize( "Ofast" ) void conv_rgb2pwm( uint8_t* p, const uint8_...
// // main.cpp // EchoErrorCorrection // // Created by <NAME> on 08/09/13. // #include <vector> #include <string> #include <sstream> #include <ctime> #include <stdexcept> #include <iomanip> #include "Sequence.hpp" #include "RandomisedAccess.hpp" #include "Options.hpp" #include "MessageLogger.hpp" #include "HashKme...
/* * This file is a part of the open source stm32plus library. * Copyright (c) 2011,2012,2013 <NAME> <www.andybrown.me.uk> * Please see website for licensing terms. */ #include "config/stm32plus.h" #include "config/net.h" #include "config/timing.h" #include "config/usart.h" using namespace stm32plus; using names...
#pragma once #include <vkn/core.hpp> #include <vkn/device.hpp> namespace vkn { /** * Holds all data related the vulkan swapchain, including images and * image views. May only be built using the inner builder class. */ class swapchain final { static constexpr size_t expected_image_count = 3u...
#include "Arduino.h" #include "SoftwareSerial.h" // slowwire START *********************************************************************************************** // global variables #define slowwire_TIMEOUT 120 // do not change #define slowwire_MAX_SENSORS 2 // Max number of Slowwire sensors conected ...
#include <stdio.h> #include "PIDLib.h" double PIDController::nowMs() { // tps tp = clock::now(); auto current_time = clock::now(); auto duration_in_seconds = dsec(current_time.time_since_epoch()); return duration_in_seconds.count(); } double PIDController::conv( double signal, double h[], int sizeOfH ) { doubl...
#include <iostream> #include <ctime> #include <stdlib.h> #include <fstream> #include <sys/stat.h> using namespace std; //First Main Class will be inheritted by other classes class Quiz{ public: virtual void question(string answer){ string answer_one = "Physical"; try{ if(answer == "Physical"){ co...
//-------------------------------------------------------------------------------------------------- // // File: m+m/m+mBaseAdapterService.cpp // // Project: m+m // // Contains: The class definition for the minimal functionality required for an m+m // adapter service. // // Written by: <NAME...
#include "Audio.h" #include "Logger.h" #include <IconsFontAwesome4.h> #include <float.h> extern "C" { #include "lauxlib.h" } #define TAG "[AUD] " hc::Audio::Audio(Desktop* desktop) : View(desktop) , _sampleRate(0.0) , _fifo(nullptr) , _mute(false) , _wasMuted(false) , _rateControlDelta(...
/** * LFU * === * * Cache: Least frequently used in O(1) time (if no map conflicts & rehashing). * * head_ tail_ * | | * v v * | prev_; LinkedHashSet; next_; | | | | | | | | * * Not...
#include "feeder.h" #include <arpa/inet.h> #include <signal.h> #include <unistd.h> using namespace cnrf; static Feeder *feeder = nullptr; void handle_sig(__attribute__((unused)) int sig) { fprintf(stderr, "Got SIGINT/SIGTERM, stopping...\n"); if (feeder != nullptr) feeder->stop(); } void help() { fprint...
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<time.h> const int oo = 2000000000; const int MAXN = 100000+10; const int BLOCKSIZE = 200; const int MAXBLOCK = MAXN/BLOCKSIZE*2+100; void swap(int &a,int &b){a^=b;b^=a;a^=b;} int min(int a,int b){return a<b?a:b;} int freelist[MAXBLOCK]; ...
/* The Forgotten Client Copyright (C) 2020 <NAME> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, includin...