text
stringlengths
3.08k
12.5k
// 实现一个简单的汇编器 #include <iostream> #include <sstream> #include <string> #include <vector> #include <map> using namespace std; enum BinIns; // 二进制指令结构体 // 指令码+操作数 struct Instruction { BinIns op; // 指令码只占一个字节 int arg; // 操作数,占四个字节 }; // 枚举类型的二进制指令集 enum BinIns { binHalt, binIn, binOut, binAdd, binSub, b...
#include <bits/stdc++.h> using namespace std; using ll=long long; // edges matter struct HLD { using CT = int; struct Edge { int u, v; CT cost; Edge() {} Edge(int _u, int _v, CT _cost) : u(_u), v(_v), cost(_cost) {} }; int n; vector<vector<int>> g; vector<Edge> e...
#pragma once #include <eosiolib/utility.hpp> #include <eosiolib/preprocessor/seq/for_each.hpp> #include <eosiolib/preprocessor/seq/enum.hpp> #include <eosiolib/preprocessor/seq/size.hpp> #include <eosiolib/preprocessor/seq/seq.hpp> #include <eosiolib/preprocessor/stringize.hpp> namespace eosio { template<typename T>...
// Testing #include <iostream> #include "src/util/ShaderProgram.h" #include "src/util/Primitives.h" #include "src/util/OrbitCamera.h" #include "externals/gl3w/include/GL/gl3w.h" #include "externals/glfw/include/GLFW/glfw3.h" #include "externals/glm/glm/glm.hpp" #include "externals/imgui/imgui.h" #include "externals/i...
// Boost.Geometry // Unit Test // Copyright (c) 2017 Oracle and/or its affiliates. // Contributed and/or modified by <NAME>, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boo...
#include "Obj3D.h" Obj3D::Obj3D(Mesh* mesh, bool isStatic) { this->mesh = mesh; this->isStatic = isStatic; } void Obj3D::initialize() { transform = glm::mat4(1); scale = glm::mat4(1); rotation = glm::mat4(1); translation = glm::mat4(1); pos = glm::vec3(0.0f, 0.0f, 0.0f); angle = 0.0f; setBoundingSphere(); ...
#include <iostream> #include <algorithm> #include <thread> #include <string> #include <set> #include <map> #include <vector> #include <cstdlib> #ifdef _WIN32 #pragma comment(lib,"ws2_32.lib") #define _WINSOCK_DEPRECATED_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #define WIN32_LEAN_AND_MEAN #include <windows.h> #incl...
/* * Copyright (C) 2022 <NAME> * * 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 following disclaim...
#include "EJBindingAudio.h" EJBindingAudio::EJBindingAudio() { } void EJBindingAudio::init(JSContextRef ctx ,JSObjectRef obj, size_t argc, const JSValueRef argv[]) { volume = 1; preload = kEJAudioPreloadNone; if( argc > 0 ) { setSourcePath(JSValueToNSString(ctx, argv[0])); } } EJBindingAudio::~EJBindingAudi...
#include <math.h> #include "driver.h" #include "ay8910.h" #include "fm.h" #define NICK_BUBLBOBL_CHANGE static int stream[MAX_2203]; static double syncTime[MAX_2203]; static struct YM2203interface *intf; static void *Timer[MAX_2203][2]; static void (*timer_callback)(int param); /* TimerHandler from fm.c */ static ...
/* * Copyright (c) 2014-2022 The Voxie Authors * * 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, mer...
#include "BIR.h" BIRFunction::BIRFunction() {} BIRFunction::BIRFunction(Location *pos, string namep, int flagsp, InvokableType *typep, string workerNamep) : BIRNode(pos), name(namep), flags(flagsp), type(typep), workerName(workerNamep) {} BIRFunction::BIRFunction(const BIRFunction ...
/*********************************************************************/ /* Copyright (c) 2013-2018, EPFL/Blue Brain Project */ /* <NAME> <<EMAIL>> */ /* All rights reserved. */ /* ...
/**********************************************************\ Original Author: <NAME> and <NAME> Created: December 3, 2009 License: Dual license model; choose one of two: New BSD License http://www.opensource.org/licenses/bsd-license.php - or - GNU Lesser General ...
/***** BEGIN LICENSE BLOCK ***** BSD License Copyright (c) 2005-2015, NIF File Format Library and Tools 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...
#include "Game.h" #include "SimpleMath.h" #include <windows.h> #include <time.h> #include "ObjectList.h" #include "GameData.h" #include "drawdata.h" using namespace DirectX; using namespace DirectX::SimpleMath; Game::Game(ID3D11Device* _pd3dDevice, HWND _hWnd, HINSTANCE _hInstance) { //seed the random number gen...
// 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...
// AccountPicGenerator.cpp : Defines the entry point for the application. // #include "AccountPicGenerator.h" unsigned char header[28] = { // Size header (size - 4, size - 8) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Header 0x31, 0x53, 0x50, 0x53, 0x18, 0xb0, 0x8b, 0x0b, 0x25, 0x27, 0x44, 0x4b, 0x92, ...
//#define SPEED_TEST #include <stdio.h> #define _USE_MATH_DEFINES #include <math.h> #include <time.h> //#include <SDL2/SDL.h> //#include <SDL2/SDL_opengl.h> #include <GL/glew.h> #include "fastmath.h" #include "Vec3.h" #include "Mat3.h" #include "quaternion.h" #include "Solids.h" #include "Shader.h" #include "GLOb...
#include "main.hpp" #include "al/area/AreaObj.h" #include "al/area/AreaObjGroup.h" #include "al/camera/CameraDirector.h" #include "al/camera/CameraPoser.h" #include "al/util.hpp" #include "al/util/LiveActorUtil.h" #include "al/util/StringUtil.h" #include "cameras/CameraPoserCustom.h" #include "debugMenu.hpp" static bo...
// Please change the following comment part into you name // #0#BEGIN# DO NOT MODIFIE THIS COMMENT LINE! // Xi // Rao // #0#END# DO NOT MODIFIE THIS COMMENT LINE! #include <stdio.h> #include <pthread.h> #include <iostream> using namespace std; // This file used for course 3500 operating system class project ...
/* M.Millard 2015/9/16 This is part of my 'teach myself RBDL+PSOPT' by implementing an RBDL model (pendulum) and finding some optimal control for it (invert pendulum such that the integral of torque squared is minimized) */ #include "PendulumModel.h" #include <rbdl/addons/luamodel/luamodel.h> #include <rbdl/...
#include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <cstdlib> #include <ctime> #include <cmath> #include <vector> #include <queue> using namespace std; int n, sn; vector <int> par[100010]; int ban[100010], num[100010]; int st[100010]; vector <int> c; vector <int> mp[100010]; vector...
/// \file uintx_math.cpp /// \brief Implementation of some useful uintx_t math functions. /// /// These math functions don't require any special access to the inner workings /// of extensible unsigned integers. They just use uintx_t operators, which /// means that none of them need be a friend to uintx_t. #include <al...
#include <iostream> #include <iomanip> #include <fstream> #include <sstream> #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include <string> #include <array> #include <algorithm> #include <math.h> /* 4TH ROUND FILE FORMAT hand0,hand1,cc0,cc1,cc2,cc3,cc4,b0,b1,b2,mean 5,6...
// ***************************************************************************** // // Copyright (c) 2020, Southwest Research Institute® (SwRI®) // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met:...
/* Copyright 2016-2020 Intel Corporation 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 w...
#include <Arduino.h> #include <ESP8266WiFi.h> #include <ArduinoJson.h> #include <set> #include <string> #include "./functions.h" #include "./mqtt.h" #define disable 0 #define enable 1 #define SENDTIME 15000 #define MAXDEVICES 60 #define JBUFFER 15+ (MAXDEVICES * 40) #define PURGETIME 600000 #define MINRSSI -70 uint8...
#include "mobile.h" #include "userInput.h" #define SMS_RATE .5 #define TEXTLIMIT 100 bool stop; void mobile::bill(void) { float tk; int sec; sec = callTime(); cout << "you have talked " << sec << " sec" << endl; tk = (float)sec * CALLRATE; credit = credit - tk; cout << "Your bill is tk. " ...
/* * Author: doe300 * * See the file "LICENSE" for the full license governing this code. */ #include <cstdlib> #include <fstream> #include <vector> #include "cpptest.h" #include "cpptest-main.h" #include "TestArithmetic.h" #include "TestEmulator.h" #include "TestGraph.h" #include "TestInstructions.h" #include "Te...
/// example3.cc: /// /// Example program to illustrate a Monte Carlo evaluation of cut /// efficiencies for a given choice of Z boson kinematics (i.e. Z pt, /// rapidity and mass), as plotted in section 6 of the accompanying /// paper. /// /// Build and run it with: /// /// make example3 ./example3 /// /// It takes...
/* * Copyright information and license terms for this software can be * found in the file LICENSE that is included with the distribution */ /** * @author mrk */ /* Author: <NAME> */ #include <iostream> #include <sstream> #include <epicsStdlib.h> #include <epicsGetopt.h> #include <epicsGuard.h> #include <pv/pvaC...
// Licensed under the MIT License. #include <string> #include <map> #include "script.h" #include "menu.h" #include "pages.h" #include "menuitemfunctions.h" int optionsInThisPage; void DrawPage(double pageIndex) { if (pageIndex == 0.0) { SetHeader("HEADER"); SetSubHeader("Sub Header"); DrawListOption("Page 1",...
/* * File: SWFReader.cpp * Author: brucewang * * Created on October 24, 2009, 8:44 PM */ #include "SWFReader.h" #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> int SWFReader::getNumberOfVariables() { return this->iVariables; } void SWFReader::AddVariableInfo( ulong...
#include <caffe/layers/memory_data_layer.hpp> #include <caffe/caffe.hpp> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <string> #include <vector> #include <iostream> #include "boost/scoped_ptr.hpp" #include "caffe/util/db.hpp" #include "caffe/uti...
#include <stdexcept> #include <Windows.h> #include <winhttp.h> #include <String.hpp> #include "HttpClient.hpp" #include "ScopeExit.hpp" class HttpError : public std::exception { public: HttpError(HttpClient* http, DWORD error_code, const std::string& message) { LPTSTR buffer{}; FormatMessage(FO...
// Copyright (c) 2018-2019 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // // Test ReplicaStateSyncImp class. #define USE_ROCKSDB 1 #include <log4cplus/configurator.h> #include <log4cplus/hierarchy.h> #include <log4cplus/loggingmacros.h> #include "blockchain/db_adapter.h" #include "consens...
// Copyright 2016 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "topaz/examples/media/vu_meter/vu_meter_view.h" #include <hid/usages.h> #include <iomanip> #include "topaz/examples/media/vu_meter/vu_meter_par...
#include "proc_watch.hpp" #include <dirent.h> #include <fstream> #include <sstream> #include <iostream> using std::this_thread::sleep_for; using ms = std::chrono::milliseconds; // Process watcher // Scans /proc/$PID/{comms, maps} and queries X server for running processes // Applies DVC rules according to rules // T...
/* * Copyright (C) 2013 Open Source Robotics Foundation * * 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 appl...
/* * Copyright (C) 2007 <NAME> * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General * Public License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRAN...
/****************************************************************************/ /*! \file Effect.cpp \author <NAME> \par email: <EMAIL> \par DigiPen login: kaan.palaz \par Course: CS246 \par FINAL PROJECT \date 12/07/2016 \brief cl /EHsc Effect.cpp EffectDriver.cpp Control.cpp user32.lib portaudio_x86.li...
#include <cv.h> #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include <stdio.h> #include <stdlib.h> #include <fstream> #include <highgui.h> using namespace cv; using namespace std; typedef unsigned int uint; Mat src, src_gray, drawing; int thresh = 100...
#include <iostream> #include <cassert> #include <array> #include <vector> #include <math.h> #include <algorithm> const int debug_level = 0; #define DEBUG(min_level, x) \ if (debug_level >= min_level) \ { \ std::cerr << x << std::endl; \ } const int max_possible_m = 3; con...
// <NAME> // Solution to https://dmoj.ca/problem/acc1p1 #include <bits/stdc++.h> using namespace std; typedef struct node* pnode; struct node{ pnode l,r; int best,pref,suf,total,comp; int prior,size,val; bool flag; node(int _val = 0){ l = r = NULL; best = pref = suf = total = comp = val = _val; prior = r...
/****************************************************************************** * * Copyright (C) 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://ww...
/** * @file llhttpretrypolicy.h * @brief Header for a retry policy class intended for use with http responders. * * $LicenseInfo:firstyear=2013&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * ...
/* * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. * * SPDX-License-Identifier: BSD-3-Clause */ #include <cstdio> #include <iostream> #include <sstream> #include "pico/stdlib.h" #include "pico/bit_ops.h" #include "pico/sample_conversion.h" typedef int (*sample_converter_fn)(int); int u16_to_u16(int s) { return ...
/*! @file @brief Implementazione della comunicazione SPI con la radio %RFM69 Il file contiene l'implementazione della classe che gestisce la comunicazione tra la radio %RFM69 e il microcontrollore. Questa classe è un membro privato della classe RFM69. */ #include "RFM69.h" // Constructor RFM69::Spi::Spi(uint8_t pi...
// // Copyright (c) 2019-2020 <NAME> (<EMAIL> at gmail dot com) // // 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 "boost/mysql/mysql.hpp" #include <boost/asio/io_service.hpp> #include <boost/system/sys...
#include <iostream> #include <vector> /////////////////////////////////////////////二分查找问题///////////////////////////////////////////// int k; int BinarySearch(int a[], int x, int low, int high) { if (low > high) { return -1; } int mid = (low + high) / 2; if (x == a[mid]) { //k = mid;...
#include "PrimaryGeneratorActionScattering.hh" #include "G4Event.hh" #include "G4ParticleTable.hh" #include "G4SIunits.hh" PrimaryGeneratorScattering::LevelScheme BuildLevelScheme() { PrimaryGeneratorScattering::LevelScheme ls; // clang-format off ls[0] = {0 * keV, {}}; ls[1509] = {1509 * keV, {{1509 *...
/** * copyright (C) 2010 * The Icecube Collaboration * * $Id: I3DOMLaunchConverterTest.cxx 94948 2012-11-04 16:21:52Z nwhitehorn $ * * @version $Revision: 94948 $ * @date $LastChangedDate: 2012-11-04 09:21:52 -0700 (Sun, 04 Nov 2012) $ * @author <NAME> <<EMAIL>> $LastChangedBy: nwhitehorn $ */ #include <I3Te...
/* BSD 3-Clause License Copyright (c) 2018, KORG 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 retain the above copyright notice, this list of cond...
//==================================================================================== // The MIT License (MIT) // // Copyright (c) 2011 Kapparock LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"...
#include <Arduino.h> #include <ESP8266WiFi.h> #include <PubSubClient.h> #include "WebOTA.h" const char* ssid = "????????"; const char* password = "??????????"; const char* mqtt_server = "192.168.0.210"; const char* clientId = "Buzzer01"; int frequency=432; //Specified in Hz int buzzPin=5; int togglePin=4; int timeO...
#include "h_head.h" #include "class_head.h" #include <limits.h> #include <assert.h> #include <algorithm> void circularSifting(); int circular_local_round_num = 1; //one_round_sifting returns the best pos to insert namespace{ void oneRoundSifting(); //sifting for one vertex //the best pos is between i and i+1 void si...
#ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdlib.h> #include <stdexcept> #include <iostream> #include <string> #include <openssl/asn1.h> #include <openssl/pem.h> #include <openssl/x509.h> #include <openssl/x509v3.h> #include <openssl/pkcs12.h> #include <openssl/err.h> #include "CertUtil.h" #include "C...
// // The tetrahedral element. Implements the basis/shape functions and their // derivatives for polynomial degrees 1 and 2. // #pragma once #include <functional> #include <vector> #include "MathTypes.hpp" #define FEM_SHAPE( handle ) [](var_type x, var_type y, var_type z) { return handle; } namespace FEM { typed...
/* Copyright (C) 2013 <NAME> 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, publish, distribute, sublicen...
/* -*- Mode:c++; eval:(c-set-style "BSD"); c-basic-offset:4; indent-tabs-mode:nil; tab-width:8 -*- */ /* This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary,...
#include "consts.h" #include "circuits/element.h" #include "matrix/matrix.h" #include <sstream> #include <cstdlib> #include <set> //TODO: not to use cout inside Element class #include <iostream> // Element::Element() { } Element::Element(string netlistLine, int &numNodes, vector<st...
/* Copyright (C) 2006 Imperial College London and others. Please see the AUTHORS file in the main source directory for a full list of copyright holders. Prof. <NAME> Applied Modelling and Computation Group Department of Earth Science and Engineering Imperial College London <EMAIL> ...
/* * MIT License * * Copyright (c) 2020 <NAME> and <NAME> * * 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...
#include "config_parser.hpp" config_parser::broker_type::broker_type () : name ("default_Mosquitto") , uri ("test.mosquitto.org") , port (1883) , port_encrypted (8883) , port_encrypted_certificate (8884) , port_ws (8080) , port_ws_encrypted (8081){}; config_parser::config_parser (std::string config_file) : config_fil...
// // baseOscillator.cpp // MIRABCN_Generator // // Created by <NAME> on 10/01/2017. // // #include "baseOscillator.h" baseOscillator::baseOscillator(int id, bool gui, ofPoint pos){ oscId = id; parameters = new ofParameterGroup(); parameters->setName("oscillator " + ofToString(id)); parameters->add...
#include "SteamServerProcess.h" #include <fstream> #include <algorithm> #include <boost/filesystem.hpp> #include <boost/process/mitigate.hpp> #include <boost/iostreams/stream.hpp> #include <iostream> #include "SteamAppInfo.h" std::string stripQuotes(const std::string& inOut) { std::string result(inOut.begin() ...
/** * Copyright (c) 2020 Horizon Robotics. All rights reserved. * @brief 人脸/人体的多路/单路 solution demo * @author zhuoran.rong(<EMAIL>) * @date */ #include <signal.h> #include <malloc.h> #include <iostream> #include <cstring> #include <thread> #include <string> #include <memory> #include "hobotlog/hobotlog.hp...
#include <myrmo/test/assert.h> #include <myrmo/hash/crc.h> #include <cmrc/cmrc.hpp> CMRC_DECLARE(test_data); static std::string get_file(const std::string &name) { auto fs = cmrc::test_data::get_filesystem(); auto file = fs.open(name); return std::string(file.begin(), file.size()); } void test_short_strings() { ...
#include "lua_tvec.h" #include "getset.h" // #include <stdio.h> #include <cstring> static int tvec_abs(lua_State *L) { TVec* vec = lua_checkTVec(L, 1); lua_pushnumber(L, vec->abs()); return 1; } static int tvec_abs2(lua_State *L) { TVec* vec = lua_checkTVec(L, 1); lua_pushnumber(L, vec->abs2()); ...
#include <netdb.h> #include <netinet/in.h> #include <pthread.h> #include <signal.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <iostream> #include <assert.h> #include <string> #include <sstream> #include <arpa/inet.h> #include <atomic> #include <chrono> u...
// License: MIT http://opensource.org/licenses/MIT /* This code was copied from https://takeda25.hatenablog.jp/entry/20101202/1291269994 and I modified it. */ #include <iostream> #include <fstream> #include <string> #include <vector> #include <unordered_map> #include "stool/include/cmdline.h" #include "../test/old_p...
/* Copyright (c) 2014, <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 of source code must retain the above copyright notice, * this list of conditions and...
#include "MicroDetectors.h" #include "StateManager.h" using namespace XBot; MicroDetectors::MicroDetectors() : unitClosestToEnemy(nullptr) { } void MicroDetectors::executeMicro(const BWAPI::Unitset & targets) { const BWAPI::Unitset & detectorUnits = getUnits(); if (detectorUnits.empty()) { return; } // NO...
/***********[Main.cc] Copyright (c) 2012-2013 <NAME>, <NAME> 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, merg...
// Copyright 2017 Mobvoi Inc. All Rights Reserved. #include <assert.h> #include <pthread.h> #include <unistd.h> #include <iostream> #include "player.h" #include "recorder.h" #include "speech_sdk.h" pthread_mutex_t mutex; pthread_cond_t cond; volatile bool in_the_session = true; static const std::string kOfflineMod...
/** * @file SteinerTreeHeuristic.cpp * @author <NAME> * @date Jul 14, 2017 */ #include <sstream> #include <boost/heap/d_ary_heap.hpp> #include "SteinerTreeHeuristic.h" using std::pair; /* * Data that is stored in one node of the heap. Contains an integer and a double. * Comparisons are made by the double, ...
#include <uWS/uWS.h> #include <iostream> #include <fstream> #include "json.hpp" #include "PID.h" #include <math.h> using namespace std; // for convenience using json = nlohmann::json; // For converting back and forth between radians and degrees. constexpr double pi() { return M_PI; } double deg2rad(double x) { return...
/****************************** Where is Poppy February, 2017 wip_static_mesh.cpp Static Mesh Loader for the mod Where is Poppy *******************************/ #include "wip_static_mesh.h" // Need to Link our class to the name (wip_StaticMesh) that hammer will read from the FGD. // This will be linked directly to...
/* This file is part of FISCO-BCOS. FISCO-BCOS 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 version. FISCO-BCOS is distri...
#pragma warning (disable : 4018) #pragma warning (disable : 4996) #pragma warning (disable : 4244) #include "stdafx.h" #include "Items_Info.h" #include <vector> #include <string> #include <iostream> #include "Items_Info.h" using namespace std; vector<ItemDefinition> itemDefs = {}; ItemDefinition getI...
#include <iostream> #include <cstring> #include "ethernet.h" #include "arp.h" #include "in.hpp" #include "pk_buff.h" /* * rfc 826 * https://tools.ietf.org/html/rfc826 */ static constexpr uint16_t ARP_ETHERNET = 0x0001; static constexpr uint16_t ARP_REQUEST = 0x0001; static constexpr uint16_t ARP_IPV4 = 0x0800; sta...
#include "Triangle.h" Triangle::Triangle() { m_vertices[0].m_position = Vector3(-1.0, 0.0, -5.0); m_vertices[1].m_position = Vector3(0.0, 1.0, -5.0); m_vertices[2].m_position = Vector3(1.0, 0.0, -5.0); m_vertices[0].m_normal = Vector3(0.0, 0.0, 1.0); m_primtype = PRIMTYPE_Triangle; } Triangle::Triangle(Vector3...
#include "graph.hpp" #include <algorithm> #include <cassert> #include <set> #include <sstream> #include <string> #include <unordered_map> #include <vector> namespace { constexpr int k_new_vertex_depth = 0; } namespace uni_course_cpp { Graph::Vertex& Graph::add_vertex() { VertexId new_vertex_id = get_new_vertex_id(...
/// @file FaceTrackerSpark.cpp /// @brief FaceTrackerSpark class implementation. // Third party libraries are linked explicitly once in the project. // #pragma comment(lib, "thirdPartyLib.lib") #include "stdAfx.h" #include "FaceTrackerSpark.h" using namespace std; #ifdef _WIN32 #pragma comment(lib, OP...
#include <mazes/kruskal.h> #include <mazes/honeycombmaze.h> #include <scenarios/layout_utils.hpp> #include <scenarios/component_hexagonal_maze.hpp> using namespace Magnum; using namespace Megaverse; HexagonalMazeComponent::HexagonalMazeComponent(Megaverse::Scenario &scenario) : ScenarioComponent{scenario} { } Hex...
/*============================================================================= LeastSquaresPackage: A software package for estimating the rotation and translation of rigid bodies. Copyright (c) University College London (UCL). All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without eve...
/* * Software License Agreement (BSD License) * * Copyright (c) 2020. Toyota Research Institute * 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 c...
/* * Copyright (c) 2019, <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 of source code must retain the above copyright notice, this * list of conditions a...
#include <cstdlib> #include <iostream> #include <vector> #include <fstream> #ifdef __APPLE__ #include <OpenCL/OpenCL.h> #elif __linux__ #include <CL/cl.h> #endif template <typename T> void ok(T rc) { if(rc != CL_SUCCESS) { std::cerr << "OpenCL function failed with " << rc << std::endl; std::abort(...
/*************************************************************** * Author: <NAME> ***************************************************************/ // Performance/accuracy settings //#define MKL (define at project level) //#define DOUBLE_PRECISION (define at project level) // Includes #define _USE_MATH_DEFINES #i...
// Copyright 2016 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/tracing/traced-value.h" #include "test/cctest/cctest.h" using v8::tracing::TracedValue; TEST(FlatDictionary) { auto value = TracedValu...
#include "iGenVar.hpp" // for global variable gVerbose #include "modules/sv_detection_methods/analyze_split_read_method.hpp" #include <seqan3/core/debug_stream.hpp> using seqan3::operator""_dna5; template <class Container> void split_string(std::string const & str, Container & cont, char const delim) { ...
#include "MapMesh.h" #include <unordered_map> #include <functional> //#define OUTPUT_TO_FILE #ifdef OUTPUT_TO_FILE #include <cstdio> #endif using namespace std; MapMesh::MapMesh() { } MapMesh::~MapMesh() { } void MapMesh::CreateFromGridMap(const char* map, int width, int height, const char* tileTypes, int nTileT...
// Copyright 2018 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "utils.h" #include <cassert> #include <optional> #include <unordered_set> namespace { static void PrintProps(const std::vector<std::string> &pr...
#include <mlpack/core.hpp> #include <mlpack/methods/amf/amf.hpp> #include <mlpack/methods/amf/update_rules/svd_batch_learning.hpp> #include <mlpack/methods/amf/init_rules/random_init.hpp> #include <mlpack/methods/amf/init_rules/average_init.hpp> #include <mlpack/methods/amf/termination_policies/validation_RMSE_terminat...
/* Copyright (c) 2012, Intel 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 must retain the above copyright notice, this list of...
// // Created by nathan on 08/06/15. // #include "raft_node.h" raft_node::raft_node(const node_id_t &uuid, std::shared_ptr<raft::config> conf) : uuid_(uuid), rpc_( this, std::make_unique<raft_network>(this, io_service_, uuid, conf->getPeers()), std::make_unique<state>(i...
#include "FileUtils.h" bool fileExists(const char* file) { struct stat buf; return (stat(file, &buf) == 0); } string timeToChar(time_t t){ int timeLen = 22; char buff[timeLen]; strftime(buff, timeLen, "%H:%M:%S, %Y-%m-%d", localtime(&t)); return string(buff); } /*time_t getLastModTime(string ...
#include <iostream> #include <vector> #include <map> #include <string> #include "timer.h" #include "crp.h" #include "ccrp.h" #include "sampler.h" #include "tdict.h" const size_t MAX_DOC_LEN_CHARS = 10000000; using namespace std; void ShowTopWordsForTopic(const map<WordID, int>& counts) { multimap<int, WordID> ms; ...