doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
14d2f9f5-855a-4f98-a0bd-c025c421c597
{ "language": "C++" }
```c++ // Copyright 2014 The Chromium 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 "content/renderer/scheduler/renderer_scheduler.h" #include "content/renderer/scheduler/null_renderer_scheduler.h" namespace content { R...
```c++ // Copyright 2014 The Chromium 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 "content/renderer/scheduler/renderer_scheduler.h" #include "base/command_line.h" #include "base/message_loop/message_loop_proxy.h" #inclu...
338c8c40-823d-48a1-b081-a54da64f8a8a
{ "language": "C++" }
```c++ #include "gns/test_util/random_number.h" namespace gns { namespace test_util { RandomNumber::RandomNumber(const size_t seed) : engine_(), distribution_() { } double RandomNumber::operator()() { return distribution_(engine_); } double RandomNumber::operator()(const double min, const double ...
```c++ #include "gns/test_util/random_number.h" namespace gns { namespace test_util { RandomNumber::RandomNumber(const size_t seed) : engine_(), distribution_() { engine_.seed(seed); } double RandomNumber::operator()() { return distribution_(engine_); } double RandomNumber::operator()(const d...
49b17cd9-398c-4657-bc49-2a0a1c30e7cf
{ "language": "C++" }
```c++ /** @example user_touche.cpp Touche example. */ #include <ESP.h> BinaryIntArraySerialStream stream(0, 115200, 160); GestureRecognitionPipeline pipeline; void setup() { useInputStream(stream); pipeline.addFeatureExtractionModule(TimeseriesBuffer(1, 160)); pipeline.setClassifier(SVM(SVM::POLY...
```c++ /** @example user_touche.cpp Touche example. */ #include <ESP.h> BinaryIntArraySerialStream stream(0, 115200, 160); GestureRecognitionPipeline pipeline; void setup() { useInputStream(stream); pipeline.setClassifier(SVM(SVM::POLY_KERNEL, SVM::C_SVC, false, true, true, 0.1, 1.0, 0, 0.5, 2)); ...
7a02747f-7290-47ec-8fe0-ededace826b3
{ "language": "C++" }
```c++ #include "Logger.h" #include <iostream> // // (plesslie) // posix_time_zone is just parsing the "-XX" portion and subtracting that from UTC meaning // that it isn't adjusting for daylight savings time. not sure how to fix that, and I don't // really care for now. // Logger::Logger() : ss_(), tz_(new boost::loc...
```c++ #include "Logger.h" #include <iostream> // // (plesslie) // posix_time_zone is just parsing the "-XX" portion and subtracting that from UTC meaning // that it isn't adjusting for daylight savings time. not sure how to fix that, and I don't // really care for now. // Logger::Logger() : ss_(), tz_(new boost::loc...
b6ec4155-ab1d-43ef-ba64-a8961e6434b4
{ "language": "C++" }
```c++ // PluginHelpers.cpp : Defines the exported functions for the DLL application. // #include "stdafx.h" #include "pluginhelpers.h" //////////////////////////////////////////////////////////////////////////////////////////////// using namespace Abstractspoon::Tdl::PluginHelpers; ////////////////////////////////...
```c++ // PluginHelpers.cpp : Defines the exported functions for the DLL application. // #include "stdafx.h" #include "pluginhelpers.h" //////////////////////////////////////////////////////////////////////////////////////////////// using namespace Abstractspoon::Tdl::PluginHelpers; ////////////////////////////////...
38bacf1f-a1d8-4c32-a728-cc919c0902d3
{ "language": "C++" }
```c++ /* Copyright 2020 The TensorFlow Authors. 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 required by applicable l...
```c++ /* Copyright 2020 The TensorFlow Authors. 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 required by applicable l...
219436c5-8a8b-40a1-8a8c-03a36ae21d7f
{ "language": "C++" }
```c++ #include <stdlib.h> #include <string> // include the sql parser #include "SQLParser.h" // contains printing utilities #include "sqlhelper.h" int main(int argc, char *argv[]) { if (argc <= 1) { fprintf(stderr, "Usage: ./example \"SELECT * FROM test;\"\n"); return -1; } std::string ...
```c++ #include <stdlib.h> #include <string> // include the sql parser #include "SQLParser.h" // contains printing utilities #include "sqlhelper.h" int main(int argc, char *argv[]) { if (argc <= 1) { fprintf(stderr, "Usage: ./example \"SELECT * FROM test;\"\n"); return -1; } std::string ...
bf2f4752-381a-40c0-940d-4dec47a07fe3
{ "language": "C++" }
```c++ // Copyright (c) 2009 The Chromium 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 "../client/gles2_lib.h" #include "../common/thread_local.h" namespace gles2 { namespace { gpu::ThreadLocalKey g_gl_context_key; } //...
```c++ // Copyright (c) 2009 The Chromium 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 "../client/gles2_lib.h" #include "../common/thread_local.h" namespace gles2 { // TODO(kbr): the use of this anonymous namespace core ...
b269dbe4-b0eb-4fdb-9bef-e4779369b301
{ "language": "C++" }
```c++ // This file is a part of the IncludeOS unikernel - www.includeos.org // // Copyright 2015 Oslo and Akershus University College of Applied Sciences // and Alfred Bratterud // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // ...
```c++ // This file is a part of the IncludeOS unikernel - www.includeos.org // // Copyright 2015 Oslo and Akershus University College of Applied Sciences // and Alfred Bratterud // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // ...
71da1084-0986-4879-94f1-b9252f477648
{ "language": "C++" }
```c++ // This is an open source non-commercial project. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com /*********************************************************************************** ** ** OrionApplication.cpp ** ** Copyright (C) August 2016 Hotride ...
```c++ // This is an open source non-commercial project. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com /*********************************************************************************** ** ** OrionApplication.cpp ** ** Copyright (C) August 2016 Hotride ...
0a53b9da-f36d-47e1-8d27-166ca4105b2b
{ "language": "C++" }
```c++ //C++ header - Open Scene Graph Simulation - Copyright (C) 1998-2002 Robert Osfield // Distributed under the terms of the GNU General Public License (GPL) // as published by the Free Software Foundation. // // All software using osgSim must be GPL'd or excempted via the // purchase of the Open Scene Graph Profe...
```c++ //C++ header - Open Scene Graph Simulation - Copyright (C) 1998-2002 Robert Osfield // Distributed under the terms of the GNU General Public License (GPL) // as published by the Free Software Foundation. // // All software using osgSim must be GPL'd or excempted via the // purchase of the Open Scene Graph Profe...
9c22a26c-85eb-417a-9c7e-1d0fff3cad0b
{ "language": "C++" }
```c++ #include "runtime_internal.h" #ifdef BITS_64 #define WIN32API #else #define WIN32API __stdcall #endif extern "C" { WIN32API void *LoadLibrary(const char *); WIN32API void *GetProcAddress(void *, const char *); WEAK void *halide_get_symbol(const char *name) { return GetProcAddress(NULL, name); } WEAK voi...
```c++ #include "runtime_internal.h" #ifdef BITS_64 #define WIN32API #else #define WIN32API __stdcall #endif extern "C" { WIN32API void *LoadLibraryA(const char *); WIN32API void *GetProcAddress(void *, const char *); WEAK void *halide_get_symbol(const char *name) { return GetProcAddress(NULL, name); } WEAK vo...
eb08b59a-9d2d-4df8-b736-cb02eb27eed7
{ "language": "C++" }
```c++ #include "FileOperations.h" #include <QFile> #include <QtGlobal> template <class InputIterator1, class InputIterator2> bool FileOperations::equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2) { while ((first1 != last1) && (first2 != last2)...
```c++ #include "FileOperations.h" #include <QFile> #include <QtGlobal> bool FileOperations::filesEqual(const QString& filePath1, const QString& filePath2) { bool equivalent = false; QFile file1(filePath1); QFile file2(filePath2); if (file1.exists() && file2.exists()) { fi...
b7f4519b-b1b4-4739-8a51-2cf24d6a2104
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium 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 "base/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" #if defined...
```c++ // Copyright (c) 2011 The Chromium 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 "base/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" IN_PROC_BRO...
57d19f65-8b70-4d5f-9283-37f9ee89868c
{ "language": "C++" }
```c++ /* * Copyright (C) 2009, Gostai S.A.S. * * This software is provided "as is" without warranty of any kind, * either expressed or implied, including but not limited to the * implied warranties of fitness for a particular purpose. * * See the LICENSE file for more information. */ /// \file libuco/urbi-mai...
```c++ /* * Copyright (C) 2009, Gostai S.A.S. * * This software is provided "as is" without warranty of any kind, * either expressed or implied, including but not limited to the * implied warranties of fitness for a particular purpose. * * See the LICENSE file for more information. */ /// \file libuco/urbi-mai...
41251534-e952-465a-8adb-a0e6ad26ec22
{ "language": "C++" }
```c++ #include "gpio.h" #include "nvic.h" #include "driver/timer.hpp" extern "C" void __cxa_pure_virtual() { while (1); } namespace { int counter = 0; void toggle_leds() { ++counter; auto gpio_n = 17 + (counter & 3); gpio_toggle(0, (1 << gpio_n)); } } int main(void) { nvic_init(); auto*...
```c++ #include "gpio.h" #include "nvic.h" #include "driver/timer.hpp" #include "memio.h" namespace { int counter = 0; void toggle_leds(int) { auto gpio_n = 17 + (counter++ & 3); gpio_toggle(0, (1 << gpio_n)); } } int main(void) { nvic_init(); gpio_set_option(0, (1 << 17) | (1 << 18) | (1 << 19) ...
a1f02203-dbf7-4623-82e3-f971fac06fbb
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s template<typename... Types> struct Tuple; // FIXME: Many more bullets to go // In a template-argument-list (14.3); the pattern is a template-argument. template<typename ...Types> struct tuple_of_refs { typedef Tuple<Types& ...> types; }; Tuple<int&, fl...
```c++ // RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s template<typename... Types> struct tuple; // FIXME: Many more bullets to go // In a template-argument-list (14.3); the pattern is a template-argument. template<typename ...Types> struct tuple_of_refs { typedef tuple<Types& ...> types; }; tuple<int&, fl...
a4bedfc2-9afe-47bb-9508-acd4fe480115
{ "language": "C++" }
```c++ #include <iostream> #include <limits.h> #include <thread> #include <unistd.h> int main() { char name[_POSIX_HOST_NAME_MAX + 1]; gethostname(name, sizeof(name)); std::cout << "Host name: " << name << std::endl; unsigned int cores = std::thread::hardware_concurrency(); std::cout << "Total cor...
```c++ #include <iostream> #include <limits.h> #include <thread> int main() { unsigned int cores = std::thread::hardware_concurrency(); std::cout << "Total cores: " << cores << std::endl; return 0; } ```
76053653-fc5e-4504-af67-8f35e98bd6da
{ "language": "C++" }
```c++ #include "Uniforms.h" namespace ion { namespace Graphics { template <> EValueType IUniformTyped<float>::GetType() const { return EValueType::Float; } template <> EValueType IUniformTyped<vec2f>::GetType() const { return EValueType::Float2; } template <> EVa...
```c++ #include "Uniforms.h" namespace ion { namespace Graphics { template <> EValueType IUniformTyped<float>::GetType() const { return EValueType::Float; } template <> EValueType IUniformTyped<vec2f>::GetType() const { return EValueType::Float2; } template <> EVa...
069650de-1bc4-4c8c-8567-533259e10e33
{ "language": "C++" }
```c++ #include <legato.h> #include <thread> #include <string> #include <list> #include <iostream> #ifndef MUST_BE_DEFINED #error MUST_BE_DEFINED was not defined. #endif COMPONENT_INIT { LE_INFO("Hello world, from thread 1."); std::thread newThread([]() { le_thread_InitLegatoThreadData...
```c++ #include <legato.h> #include <thread> #include <string> #include <list> #include <iostream> #ifndef MUST_BE_DEFINED #error MUST_BE_DEFINED was not defined. #endif COMPONENT_INIT { LE_INFO("Hello world, from thread 1."); std::thread newThread([]() { le_thread_InitLegatoThreadData...
35b3dcd7-30ed-43d7-9824-cda7051758f0
{ "language": "C++" }
```c++ #include "HM3Pointers.h" HM3Pointers::HM3Pointers(HM3Version version) { Setup(version); } HM3Pointers::~HM3Pointers() { } void HM3Pointers::Setup(HM3Version version) { uint8_t** difficultyPtr = nullptr; uint8_t** timePtr = nullptr; switch (version) { case HM3_GOG: m_Stats = (HM3Sta...
```c++ #include "HM3Pointers.h" struct DataAddresses { uint32_t Stats; uint32_t DifficultyPtr; uint32_t TimePtr; }; static const DataAddresses DataVersions[] { { 0x00000000, 0x00000000, 0x00000000 }, // Unknown version { 0x009B2538, 0x0081F83C, 0x0081F820 }, // Steam { 0x009B3B38, 0x0082083C, 0x008...
4df6ca6e-d691-4beb-a981-ac438dc222b5
{ "language": "C++" }
```c++ // // Copyright (c) 2018 The nanoFramework project contributors // See LICENSE file in the project root for full license information. // #include "nf_networking_sntp.h" static const CLR_RT_MethodHandler method_lookup[] = { NULL, Library_nf_networking_sntp_nanoFramework_Networking_Sntp::Start___STATIC_...
```c++ // // Copyright (c) 2018 The nanoFramework project contributors // See LICENSE file in the project root for full license information. // #include "nf_networking_sntp.h" static const CLR_RT_MethodHandler method_lookup[] = { NULL, Library_nf_networking_sntp_nanoFramework_Networking_Sntp::Start___STATIC_...
cb7edeae-9660-4ee7-a9c8-b7b406d5e461
{ "language": "C++" }
```c++ #include "Script.hpp" using namespace Component; Script::Script(Entity* entity) : SuperComponent(entity) { } Json::Value Script::Save() const { Json::Value component; return component; } void Script::Load(const Json::Value& node) { } ``` Add placeholder value to script component
```c++ #include "Script.hpp" using namespace Component; Script::Script(Entity* entity) : SuperComponent(entity) { } Json::Value Script::Save() const { Json::Value component; component["placeholderValue"] = ""; return component; } void Script::Load(const Json::Value& node) { } ```
ae3903e1-7be6-4034-9867-26be811900e3
{ "language": "C++" }
```c++ #include "Isosurface.h" Vector3D Isosurface::gradientAt(float x, float y, float z) const { const float epsilon = 0.0001; float dx = valueAt(x + epsilon, y, z) - valueAt(x - epsilon, y, z); float dy = valueAt(x, y + epsilon, z) - valueAt(x, y - epsilon, z); float dz = valueAt(x, y, z + epsilon) ...
```c++ #include "Isosurface.h" Vector3D Isosurface::gradientAt(float x, float y, float z) const { const float epsilon = 0.0001; float dx = valueAt(x + epsilon, y, z) - valueAt(x - epsilon, y, z); float dy = valueAt(x, y + epsilon, z) - valueAt(x, y - epsilon, z); float dz = valueAt(x, y, z + epsilon) ...
b8be87a4-dee7-42c7-81bb-be8e3da9736b
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium 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 "base/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" IN_PROC_BR...
```c++ // Copyright (c) 2010 The Chromium 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 "base/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" IN_PROC_BR...
2a31c261-93c6-4393-b92b-bde657d0002c
{ "language": "C++" }
```c++ #include "mettle.hpp" using namespace mettle; suite<suites_list> test_suite("test suite", [](auto &_) { _.test("create a test suite", [](suites_list &suites) { suite<> inner("inner test suite", [](auto &_){ _.test("inner test", []() {}); }, suites); expect(suites, array(&inner)); }); ...
```c++ #include "mettle.hpp" using namespace mettle; suite<suites_list> test_suite("test suite", [](auto &_) { _.test("create a test suite", [](suites_list &suites) { suite<> inner("inner test suite", [](auto &_){ _.test("inner test", []() {}); }, suites); expect(suites, array(&inner)); }); ...
c00f7a26-65c4-4593-9a17-a3b030e868c0
{ "language": "C++" }
```c++ // Copyright 2014 The Chromium 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 "content/renderer/scheduler/renderer_scheduler.h" #include "base/command_line.h" #include "base/message_loop/message_loop_proxy.h" #inclu...
```c++ // Copyright 2014 The Chromium 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 "content/renderer/scheduler/renderer_scheduler.h" #include "content/renderer/scheduler/null_renderer_scheduler.h" namespace content { R...
3d9c3fae-27d8-462b-85eb-9574a646b532
{ "language": "C++" }
```c++ /* Copyright Sven Bergström 2014 created for snow https://github.com/underscorediscovery/snow MIT license */ #ifdef HX_WINDOWS #include <windows.h> #include "SDL.h" #include "SDL_syswm.h" namespace snow { namespace platform { namespace window { void load_icon(SDL_Window*...
```c++ /* Copyright Sven Bergström 2014 created for snow https://github.com/underscorediscovery/snow MIT license */ #ifdef HX_WINDOWS #include <windows.h> #include "SDL.h" #include "SDL_syswm.h" namespace snow { namespace platform { namespace window { void load_icon(SDL_Window*...
1a16ac66-ec2e-4c84-aab2-6809c0181221
{ "language": "C++" }
```c++ // Copyright 2019 The Marl Authors // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ...
```c++ // Copyright 2019 The Marl Authors // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ...
26ec6845-16e2-42c9-a8d4-d95e0b87ea23
{ "language": "C++" }
```c++ //============================================================================ // Name : TimeSeriesStatisticsDemo.cpp // Author : Dominik Skoda <skoda@d3s.mff.cuni.cz> // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //===========================...
```c++ //============================================================================ // Name : TimeSeriesStatisticsDemo.cpp // Author : Dominik Skoda <skoda@d3s.mff.cuni.cz> // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //===========================...
de72e0fa-1750-42db-85b2-a4864c288110
{ "language": "C++" }
```c++ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===---------------------------------...
```c++ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===---------------------------------...
b1d0586a-6a24-49d3-ab98-b2989bc61fe0
{ "language": "C++" }
```c++ #include "application.h" #include "mainwindow.h" #include <QApplication> #include <QMainWindow> int main(int argc, char *argv[]) { // QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); app.setOrganizationName("lpd8-editor"); app.setApplicationName("lpd8-ed...
```c++ #include "application.h" #include "mainwindow.h" #include <QApplication> #include <QMainWindow> int main(int argc, char *argv[]) { #if QT_VERSION >= 0x050600 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif QApplication app(argc, argv); app.setOrganizationName("lpd8-editor"); ...
41dc3d2d-c6a4-4368-86e5-3d2fe5f80108
{ "language": "C++" }
```c++ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ #include "../lib.hh" #include "catch.hpp" using namespace vick; using vick::move::mvcol; TEST_CASE("mvcol", "[mvcol]") { contents contents({"asert"}); visual_setup _; mvcol(contents, 3); ...
```c++ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ #include "../lib.hh" #include "catch.hpp" using namespace vick; using vick::move::mvcol; TEST_CASE("mvcol", "[mvcol]") { contents contents({"asert"}); visual_setup _; mvcol(contents, 3); ...
86a64131-dd70-4615-ad03-1838b9f2644e
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -std=c++11 -fsyntax-only %s -verify namespace ExplicitConv { struct X { }; // expected-note 2{{candidate constructor}} struct Y { explicit operator X() const; }; void test(const Y& y) { X x(static_cast<X>(y)); X x2((X)y); X x3 = y; // expected-error{{no viable conver...
```c++ // RUN: %clang_cc1 -std=c++11 -fsyntax-only %s -verify namespace ExplicitConv { struct X { }; // expected-note 2{{candidate constructor}} struct Y { explicit operator X() const; }; void test(const Y& y) { X x(static_cast<X>(y)); X x2((X)y); X x3 = y; // expected-error{{no viable conver...
39ab0729-30dc-4fe0-ba83-63854bb69370
{ "language": "C++" }
```c++ #include <fstream> #include <VBE/system/sdl2/StorageImpl.hpp> // static std::unique_ptr<std::istream> StorageImpl::openAsset(const std::string& filename) { // Open in binary mode so Windows doesn't change LF to CRLF, // which will corrupt binary files such as images. return std::unique_ptr<std::istream>(new...
```c++ #include <fstream> #include <VBE/system/sdl2/StorageImpl.hpp> #include <VBE/system/Log.hpp> // static std::unique_ptr<std::istream> StorageImpl::openAsset(const std::string& filename) { // Open in binary mode so Windows doesn't change LF to CRLF, // which will corrupt binary files such as images. std::ifstr...
318bc932-03cc-4fb8-9ca2-d6ae8e436b45
{ "language": "C++" }
```c++ #include "common.th" // c <- multiplicand // d <- multiplier // b -> product .global imul imul: #if IMUL_EARLY_EXITS b <- c == 0 d <- d &~ b // d = (c == 0) ? 0 : d b <- d == 0 p <- @+L_done & b + p #endif o <- o - 3 h -> [o + (3 - 0)] i -> [o + (3 - 1)] j -> [o + (3 - 2)] ...
```c++ #include "common.th" // c <- multiplicand // d <- multiplier // b -> product .global imul imul: o <- o - 3 h -> [o + (3 - 0)] i -> [o + (3 - 1)] j -> [o + (3 - 2)] b <- 0 h <- 1 j <- d >> 31 // save sign bit in j d <- d ^ j // adjust multiplier d <- d - j L_top: ...
f998c51c-81e9-4975-8943-9f244700ea81
{ "language": "C++" }
```c++ #include "common.th" // c <- multiplicand // d <- multiplier // b -> product .global imul imul: #if IMUL_EARLY_EXITS b <- c == 0 d <- d &~ b // d = (c == 0) ? 0 : d b <- d <> 0 jzrel(b, L_done) #endif pushall(h,i,j) b <- 0 h <- 1 j <- d >> 31 // save sign bit in j j...
```c++ #include "common.th" // c <- multiplicand // d <- multiplier // b -> product .global imul imul: #if IMUL_EARLY_EXITS b <- c == 0 d <- d &~ b // d = (c == 0) ? 0 : d b <- d <> 0 jzrel(b, L_done) #endif pushall(h,i,j) b <- 0 h <- 1 j <- d >>> 31 // save sign bit in j d...
f72a7f21-b522-490b-b366-6603832cc33e
{ "language": "C++" }
```c++ #include "gmock/gmock.h" #include "tcframe/experimental/runner.hpp" using ::testing::Test; namespace tcframe { class FakeProblem : public BaseProblem { protected: void InputFormat() {} }; class FakeGenerator : public BaseGenerator<FakeProblem> {}; class RunnerTests : public Test { protected: int ar...
```c++ #include "gmock/gmock.h" #include "tcframe/experimental/runner.hpp" using ::testing::Test; namespace tcframe { class FakeProblem : public BaseProblem { protected: void InputFormat() {} }; class FakeGenerator : public BaseGenerator<FakeProblem> {}; class RunnerTests : public Test { protected: int ar...
d447d3b3-2af1-44dc-b187-04ecf0e2d7e5
{ "language": "C++" }
```c++ /* * Copyright 2004-2014 Cray Inc. * Other additional copyright holders may be indicated within. * * The entirety of this work is 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...
```c++ /* * Copyright 2004-2014 Cray Inc. * Other additional copyright holders may be indicated within. * * The entirety of this work is 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...
b57266de-cdd6-4232-ba11-80157b6f5c53
{ "language": "C++" }
```c++ // Copyright (c) 2009-2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <test/fuzz/fuzz.h> #include <util/bip32.h> void test_one_input(const std::vector<uint8_t>& buffer) { con...
```c++ // Copyright (c) 2009-2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <test/fuzz/FuzzedDataProvider.h> #include <test/fuzz/fuzz.h> #include <test/fuzz/util.h> #include <util/bip32...
d01787c7-bf2f-4a1b-bb4f-43bbd9de8222
{ "language": "C++" }
```c++ // Copyright (c) 2009 The Chromium 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 "base/cancellation_flag.h" #include "base/logging.h" namespace base { void CancellationFlag::Set() { #if !defined(NDEBUG) DCHECK(...
```c++ // Copyright (c) 2010 The Chromium 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 "base/cancellation_flag.h" #include "base/logging.h" namespace base { void CancellationFlag::Set() { #if !defined(NDEBUG) DCHECK_...
ce778098-9988-47ed-a5ff-7b2b180ab3c6
{ "language": "C++" }
```c++ //===- llvm/unittest/Support/TimeValueTest.cpp - Time Value tests ---------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===- llvm/unittest/Support/TimeValueTest.cpp - Time Value tests ---------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
685bc66d-341d-4ef1-b46f-7342c1f1fe4e
{ "language": "C++" }
```c++ /****************************************************************************** nomlib - C++11 cross-platform game engine Copyright (c) 2013, Jeffrey Carpenter <jeffrey.carp@gmail.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provide...
```c++ /****************************************************************************** nomlib - C++11 cross-platform game engine Copyright (c) 2013, Jeffrey Carpenter <jeffrey.carp@gmail.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provide...
d3216d55-9563-4333-8c6a-28594ca1c03b
{ "language": "C++" }
```c++ /* Copyright 2017 Google Inc. 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 required by applicable law or agreed to...
```c++ /* Copyright 2017 Google Inc. 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 required by applicable law or agreed to...
0d8fcb52-ca85-4970-8133-512e991c8f4e
{ "language": "C++" }
```c++ // This code is based on Sabberstone project. // Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva // RosettaStone is hearthstone simulator using C++ with reinforcement learning. // Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon #include <Rosetta/Actions/Generic.hpp> #include <Rosett...
```c++ // This code is based on Sabberstone project. // Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva // RosettaStone is hearthstone simulator using C++ with reinforcement learning. // Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon #include <Rosetta/Actions/Generic.hpp> #include <Rosett...
5f99eafa-29c3-450d-aa5b-9a4d29a3923d
{ "language": "C++" }
```c++ /** * Appcelerator Kroll - licensed under the Apache Public License 2 * see LICENSE in the root folder for details on the license. * Copyright (c) 2009 Appcelerator, Inc. All Rights Reserved. */ #include "utils.h" #include <cstdio> namespace UTILS_NS { namespace PlatformUtils { std::string GetFirstMACAdd...
```c++ /** * Appcelerator Kroll - licensed under the Apache Public License 2 * see LICENSE in the root folder for details on the license. * Copyright (c) 2009 Appcelerator, Inc. All Rights Reserved. */ #include "utils.h" #include <stdio.h> #include <string.h> namespace UTILS_NS { namespace PlatformUtils { std::...
9f973108-b9ab-4238-a0fb-9fad464df059
{ "language": "C++" }
```c++ #include "fnv_param.hpp" #include "fnv_algo.hpp" #include "constraint.hpp" #include "fnv_solver.hpp" #include <vector> #include <iostream> #include <boost/foreach.hpp> int main(int argc, char** argv) { const std::vector<FNVParam> fnvParams = FNVParam::getAll(); const std::vector<FNVAlgo> fnvAlgos = FNVAlgo:...
```c++ #include "fnv_param.hpp" #include "fnv_algo.hpp" #include "constraint.hpp" #include "fnv_solver.hpp" #include <vector> #include <iostream> #include <boost/foreach.hpp> int main(int argc, char** argv) { const std::vector<FNVParam> fnvParams = FNVParam::getAll(); const std::vector<FNVAlgo> fnvAlgos = FNVAlgo:...
98a8c817-ef3c-42c7-97b2-d39527a0d606
{ "language": "C++" }
```c++ /* * Copyright (c) 2015 The WebRTC 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 in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All co...
```c++ /* * Copyright (c) 2015 The WebRTC 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 in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All co...
bff66dbb-02be-457c-88e3-fc48d710fc2a
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -std=c++11 -S -emit-llvm -o - %s -triple x86_64-apple-darwin10 | FileCheck %s // RUN: %clang_cc1 -S -emit-llvm -o %t.ll %s -triple x86_64-apple-darwin10 // RUN: %clang_cc1 -std=c++11 -S -emit-llvm -o %t-c++11.ll %s -triple x86_64-apple-darwin10 // RUN: diff %t.ll %t-c++11.ll // rdar://1289...
```c++ // RUN: %clang_cc1 -std=c++11 -S -emit-llvm -o %t-c++11.ll %s -triple x86_64-apple-darwin10 // RUN: FileCheck %s < %t-c++11.ll // RUN: %clang_cc1 -std=c++98 -S -emit-llvm -o %t.ll %s -triple x86_64-apple-darwin10 // RUN: diff %t.ll %t-c++11.ll // rdar://12897704 struct sAFSearchPos { unsigned char *pos...
899ad3d9-e7f0-4947-aeb9-796100f54128
{ "language": "C++" }
```c++ #include <algorithm> #include <cctype> #include <fstream> #include <iostream> #include <string> int main(int argc, char ** argv) { std::ifstream input{argv[1]}; std::string line; std::getline(input, line); while(input) { std::for_each(std::begin(line), std::end(line), [](char c) { ...
```c++ #include <algorithm> #include <cctype> #include <fstream> #include <iostream> #include <string> int main(int argc, char ** argv) { std::ifstream input{argv[1]}; std::string line; std::getline(input, line); while(input) { std::transform(std::begin(line), std::end(line), std::begin(li...
a0b4e5a1-34af-4931-9ef5-767824c71116
{ "language": "C++" }
```c++ /** @file @brief Implementation @date 2014 @author Ryan Pavlik <ryan@sensics.com> <http://sensics.com> */ // Copyright 2014 Sensics, Inc. // // All rights reserved. // // (Final version intended to be licensed under // the Apache License, Version 2.0) // Internal Includes #include <og...
```c++ /** @file @brief Implementation @date 2014 @author Ryan Pavlik <ryan@sensics.com> <http://sensics.com> */ // Copyright 2014 Sensics, Inc. // // All rights reserved. // // (Final version intended to be licensed under // the Apache License, Version 2.0) // Internal Includes #include <og...
bd7796b6-00f4-4b3d-84a9-345773e0f14b
{ "language": "C++" }
```c++ /* * Copyright (C) 2016 Luke San Antonio * All rights reserved. */ // Include the implementation first so that it actually works. We have to do // this because our header file includes the header as well, we might as well // put the implementation here. #define TINYGLTF_LOADER_IMPLEMENTATION #define STB_IMAG...
```c++ /* * Copyright (C) 2016 Luke San Antonio * All rights reserved. */ // Include the implementation first so that it actually works. We have to do // this because our header file includes the header as well, we might as well // put the implementation here. #define TINYGLTF_LOADER_IMPLEMENTATION #define STB_IMAG...
86a367ff-8318-478b-b283-c73228035574
{ "language": "C++" }
```c++ // // Created by monty on 08/12/16. // #include <string> #include <iostream> #include <fstream> #include "IFileLoaderDelegate.h" #include "CPlainFileLoader.h" namespace Knights { std::string CPlainFileLoader::loadFileFromPath( const std::string& path ) { std::string entry; std::ifstream fileToLoad(path); ...
```c++ // // Created by monty on 08/12/16. // #include <string> #include <iostream> #include <fstream> #include "IFileLoaderDelegate.h" #include "CPlainFileLoader.h" namespace Knights { std::string CPlainFileLoader::loadFileFromPath( const std::string& path ) { std::string entry; std::ifstream fileToLoad(path); ...
b6031d12-bbe6-48c7-a930-0ed4259eb289
{ "language": "C++" }
```c++ #include "picturemodel.h" #include <QFile> PictureModel::PictureModel(QObject *parent) : MediaModel(MediaModel::Picture, parent) { QHash<int, QByteArray> roleNames = MediaModel::roleNames(); setRoleNames(roleNames); } PictureModel::~PictureModel() { } QVariant PictureModel::data(MediaInfo *mediaI...
```c++ #include "picturemodel.h" #include <QFile> #include <QImageReader> PictureModel::PictureModel(QObject *parent) : MediaModel(MediaModel::Picture, parent) { QHash<int, QByteArray> roleNames = MediaModel::roleNames(); setRoleNames(roleNames); } PictureModel::~PictureModel() { } QVariant PictureModel...
d9b351dc-aa24-435b-91d1-c2ff9f26b40d
{ "language": "C++" }
```c++ /** @example user_touche.cpp Touche example. */ #include <ESP.h> BinaryIntArraySerialStream stream(0, 115200, 160); GestureRecognitionPipeline pipeline; void setup() { useInputStream(stream); pipeline.addFeatureExtractionModule(TimeseriesBuffer(1, 160)); usePipeline(pipeline); }``` Add SVM...
```c++ /** @example user_touche.cpp Touche example. */ #include <ESP.h> BinaryIntArraySerialStream stream(0, 115200, 160); GestureRecognitionPipeline pipeline; void setup() { useInputStream(stream); pipeline.addFeatureExtractionModule(TimeseriesBuffer(1, 160)); pipeline.setClassifier(SVM(SVM::POLY...
700f8847-f972-4554-925d-cfcb42a550b5
{ "language": "C++" }
```c++ /** * Unit tests for base kernel class * @author Vyacheslav Kompan kompan.vo@phystech.edu * Copyright 2018 MIPT-MIPS */ #include "../kernel.h" // Catch2 #include <catch.hpp> TEST_CASE( "Kernel: Execute nothing") { CHECK( Kernel::create_dummy_kernel()->execute() == Trap::SYSCALL); CHECK( Kernel::cre...
```c++ /** * Unit tests for base kernel class * @author Vyacheslav Kompan kompan.vo@phystech.edu * Copyright 2018 MIPT-MIPS */ #include "../kernel.h" #include <catch.hpp> TEST_CASE( "Kernel: Execute nothing") { CHECK( Kernel::create_dummy_kernel()->execute() == Trap::SYSCALL); CHECK( Kernel::create_config...
33456940-79bb-4a82-98e2-c6292f5c300a
{ "language": "C++" }
```c++ // Copyright (c) 2014-2015 Dr. Colin Hirsch and Daniel Frey // Please see LICENSE for license or visit https://github.com/ColinH/PEGTL/ #include <string> #include <iostream> #include <pegtl.hh> namespace hello { struct prefix : pegtl::string< 'H', 'e', 'l', 'l', 'o', ',', ' ' > {}; struct name : pegtl::...
```c++ // Copyright (c) 2014-2015 Dr. Colin Hirsch and Daniel Frey // Please see LICENSE for license or visit https://github.com/ColinH/PEGTL/ #include <string> #include <iostream> #include <pegtl.hh> namespace hello { struct prefix : pegtl::string< 'H', 'e', 'l', 'l', 'o', ',', ' ' > {}; struct name : pegtl::...
2bc66689-dd5b-4917-977d-6c2351b31b4e
{ "language": "C++" }
```c++ #include "helper.h" #include "../lib/triangle.h" #include <catch.hpp> TEST_CASE("Test Triangle normal", "[triangle]") { static constexpr int NUM_SAMPLES = 100; for (int j = 0; j < NUM_SAMPLES; ++j) { Triangle triangle = random_triangle(); Vec normal = triangle.normal; // Veri...
```c++ #include "helper.h" #include "../lib/triangle.h" #include <catch.hpp> TEST_CASE("Test Triangle normal", "[triangle]") { static constexpr int NUM_SAMPLES = 100; for (int j = 0; j < NUM_SAMPLES; ++j) { Triangle triangle = random_triangle(); Vec normal = triangle.normal; // Veri...
12273a57-6e0a-40e2-8961-3116afb89f93
{ "language": "C++" }
```c++ #include "xchainer/device.h" #include <future> #include <gtest/gtest.h> #include "xchainer/error.h" namespace xchainer { TEST(DeviceTest, SetCurrentDevice) { Device cpu = {"cpu"}; Device cuda = {"cuda"}; auto device = GetCurrentDevice(); SetCurrentDevice("cpu"); ASSERT_EQ(cpu, GetCurrent...
```c++ #include "xchainer/device.h" #include <future> #include <gtest/gtest.h> #include "xchainer/error.h" namespace xchainer { // Device must be POD (plain old data) to be used as a thread local variable safely. // ref. https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables static_assert(std...
b018bf31-e76a-4dff-905d-cf2aa5d67f34
{ "language": "C++" }
```c++ // RUN: %clang -g -S -emit-llvm %s -o - | FileCheck %s namespace A { #line 1 "foo.cpp" namespace B { int i; } } // CHECK: [[FILE:![0-9]*]] {{.*}}debug-info-namespace.cpp" // CHECK: [[VAR:![0-9]*]] = {{.*}}, metadata [[NS:![0-9]*]], metadata !"i", {{.*}} ; [ DW_TAG_variable ] [i] // CHECK: [[NS]] = {{.*}}, met...
```c++ // RUN: %clang -g -S -emit-llvm %s -o - | FileCheck %s namespace A { #line 1 "foo.cpp" namespace B { int i; } } // CHECK: [[FILE:![0-9]*]] {{.*}}debug-info-namespace.cpp" // CHECK: [[VAR:![0-9]*]] = {{.*}}, metadata [[NS:![0-9]*]], metadata !"i", {{.*}} ; [ DW_TAG_variable ] [i] // CHECK: [[NS]] = {{.*}}, met...
69cf084b-86b5-40e9-b84f-985e8ad20660
{ "language": "C++" }
```c++ // // kern_start.cpp // CPUFriend // // Copyright © 2017 Vanilla. All rights reserved. // #include <Headers/plugin_start.hpp> #include <Headers/kern_api.hpp> #include "kern_cpuf.hpp" static CPUFriendPlugin cpuf; static const char *bootargOff[] { "-cpufoff" }; static const char *bootargDebug[] { "-cpu...
```c++ // // kern_start.cpp // CPUFriend // // Copyright © 2017 Vanilla. All rights reserved. // #include <Headers/plugin_start.hpp> #include <Headers/kern_api.hpp> #include "kern_cpuf.hpp" static CPUFriendPlugin cpuf; static const char *bootargOff[] { "-cpufoff" }; static const char *bootargDebug[] { "-cpu...
bd757cc1-17f7-45cf-b532-1fe38637fe21
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium 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 "remoting/host/capturer.h" namespace remoting { Capturer::Capturer() : width_(0), height_(0), pixel_format_(PixelFor...
```c++ // Copyright (c) 2010 The Chromium 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 "remoting/host/capturer.h" namespace remoting { Capturer::Capturer() : width_(0), height_(0), pixel_format_(PixelFor...
3632357b-91fa-4029-825a-a33c1fe80988
{ "language": "C++" }
```c++ #include <avr/io.h> #include <avr/interrupt.h> #include "AnalogAccel.h" volatile Axis currentAxis = X; ISR(ANALOG_COMP_vect) //To be executed once analog compare is completed { //Do stuff... } AnalogAccel::AnalogAccel() { } AnalogAccel::~AnalogAccel() { } volatile Axis& AnalogAccel::currentAxis_ = currentA...
```c++ #include <avr/io.h> #include <avr/interrupt.h> #include <util/atomic.h> #include "AnalogAccel.h" volatile Axis currentAxis = X; ISR(ANALOG_COMP_vect) //To be executed once analog compare is completed { //Do stuff... } AnalogAccel::AnalogAccel() { //Prescaler of 64 (12MHz / 64 == 187.5 kHz), //recommended v...
a6d18d5b-3bfc-48dd-a071-1c597f7030bf
{ "language": "C++" }
```c++ /* ** Copyright (C) 2012 Aldebaran Robotics ** See COPYING for the license */ #include <cstring> #include <qitype/signature.hpp> namespace qi { bool qi::Signature::isConvertibleTo(const qi::Signature& b) const { if (size() != b.size()) return false; static const char numeric[] = "bcCwWiIlLfd"; sta...
```c++ /* ** Copyright (C) 2012 Aldebaran Robotics ** See COPYING for the license */ #include <cstring> #include <qitype/signature.hpp> namespace qi { bool qi::Signature::isConvertibleTo(const qi::Signature& b) const { if (size() != b.size()) return false; static const char numeric[] = "bcCwWiIlLfd"; sta...
6134b1c8-09c5-43bb-b91b-81ee6e5f34e5
{ "language": "C++" }
```c++ #include "modem/commands.h" namespace firebase { namespace modem { bool StreamCommand::execute(const String& command, InputStream* in, OutputStream* out) { if (in == nullptr || out == nullptr) { return false; } if (command != "BEGIN_STREAM") { return false; } std...
```c++ #include "modem/commands.h" namespace firebase { namespace modem { bool StreamCommand::execute(const String& command, InputStream* in, OutputStream* out) { if (in == nullptr || out == nullptr) { return false; } if (command != "BEGIN_STREAM") { return false; } std...
e309819d-5fb9-4d1b-973f-47a649862f08
{ "language": "C++" }
```c++ #include "helpers.h" using namespace std; void sendFail(UserHandler * handler, int errorcode, string topic, string message){ JsonDict answer; JsonBool b = JsonBool(false); JsonString s = JsonString(message); answer.add("success", &b); answer.add("reason", &s); handler->writeToClient(to...
```c++ #include "helpers.h" using namespace std; void sendFail(UserHandler * handler, int errorcode, string topic, string message){ JsonDict answer; JsonBool b = JsonBool(false); JsonString s = JsonString(message); JsonInt i = JsonInt(errorcode); answer.add("success", &b); answer.add("reason"...
662a9153-1197-47fa-9eca-bb243074c976
{ "language": "C++" }
```c++ #include "python_script.h" #include <cstdio> #include <fstream> #include <iterator> #include <boost/log/trivial.hpp> #include <boost/python.hpp> #include <Python.h> using namespace boost::python; using namespace std; using namespace swganh::scripting; PythonScript::PythonScript(const string& filename) ...
```c++ #include "python_script.h" #include <cstdio> #include <fstream> #include <iterator> #include <boost/log/trivial.hpp> #include <boost/python.hpp> #include <Python.h> using namespace boost::python; using namespace std; using namespace swganh::scripting; PythonScript::PythonScript(const string& filename) ...
e42cca19-8260-45ed-b3c0-133095f070d4
{ "language": "C++" }
```c++ #include "UIUtils.h" #include <sstream> #include "Settings.h" std::vector<CPropertyPage *> UIUtils::pages = { }; CString UIUtils::Capitalize(std::wstring in) { CString cstr(in.c_str()); return UIUtils::Capitalize(cstr); } CString UIUtils::Capitalize(CString in) { CString newString(in); CStri...
```c++ #include "UIUtils.h" #include <sstream> #include "Settings.h" std::vector<CPropertyPage *> UIUtils::pages = { }; CString UIUtils::Capitalize(std::wstring in) { CString cstr(in.c_str()); return UIUtils::Capitalize(cstr); } CString UIUtils::Capitalize(CString in) { CString newString(in); CStri...
b71e80aa-ab3c-48d7-9cdf-f1d8cedf7f0f
{ "language": "C++" }
```c++ /* For symbol_thingey */ #define BOOST_CHRONO_VERSION 2 #include <boost/chrono/chrono.hpp> #include <boost/chrono/chrono_io.hpp> #define FUTURE_TRACE 0 #include <cps/future.h> #include <iostream> using namespace cps; int main(void) { auto start = boost::chrono::high_resolution_clock::now(); const int count...
```c++ /* For symbol_thingey */ #include <chrono> #define FUTURE_TRACE 0 #include <cps/future.h> #include <iostream> using namespace cps; int main(void) { auto start = std::chrono::high_resolution_clock::now(); const int count = 100000; for(int i = 0; i < count; ++i) { auto f = future<std::string>::create_share...
6097dcbc-45ff-4e4b-9d68-9abf3099ac32
{ "language": "C++" }
```c++ //===- llvm/System/AIX/Path.cpp - AIX Path Implementation -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by Reid Spencer and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===-----------...
```c++ //===- llvm/System/AIX/Path.cpp - AIX Path Implementation -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by Reid Spencer and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===-----------...
b4da0345-46be-4b33-a822-aebcd7708738
{ "language": "C++" }
```c++ #include "s3d/cv/image_operation/input_output_adapter.h" #include "s3d/cv/image_operation/image_operations.h" namespace s3d { namespace image_operation { InputOutputAdapter::InputOutputAdapter(gsl::not_null<ImageOperations*> imageOperations) : operations_{imageOperations} {} void InputOutputAdapter::setInp...
```c++ #include "s3d/cv/image_operation/input_output_adapter.h" #include "s3d/cv/image_operation/image_operations.h" namespace s3d { namespace image_operation { InputOutputAdapter::InputOutputAdapter(gsl::not_null<ImageOperations*> imageOperations) : operations_{imageOperations} {} void InputOutputAdapter::setInp...
58784da3-d253-442d-ade4-db4e0888bc04
{ "language": "C++" }
```c++ #ifdef HAVE_XIMGPROC #include "ximgproc.h" #include "SuperpixelSEEDS.h" #include "SuperpixelSLIC.h" #include "SuperpixelLSC.h" NAN_MODULE_INIT(XImgproc::Init) { SuperpixelSEEDS::Init(target); SuperpixelSLIC::Init(target); SuperpixelLSC::Init(target); } #endif // HAVE_XIMGPROC``` Check for opencv version b...
```c++ #ifdef HAVE_XIMGPROC #include "ximgproc.h" #include "SuperpixelSEEDS.h" #include "SuperpixelSLIC.h" #include "SuperpixelLSC.h" NAN_MODULE_INIT(XImgproc::Init) { SuperpixelSEEDS::Init(target); #if OPENCV_MINOR_VERSION > 0 SuperpixelSLIC::Init(target); SuperpixelLSC::Init(target); #endif } #endif // HAVE_XIM...
f6fb067c-b468-41fc-aa10-b4655645b9af
{ "language": "C++" }
```c++ // This is an open source non-commercial project. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file,...
```c++ // This is an open source non-commercial project. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file,...
d5e4e59e-107f-44ac-af47-ef0810afec6e
{ "language": "C++" }
```c++ #include "ros/ros.h" #include "std_msgs/String.h" #include "geometry_msgs/Twist.h" int main(int argc, char **argv) { ros::init(argc, argv, "publish_fromfile"); ros::NodeHandle pubFromFileHandle; ros::Publisher pubFromFileObj = pubFromFileHandle.advertise<geometry_msgs::Twist>("publish_fromfile",100); ...
```c++ // ROS includes #include "ros/ros.h" #include "geometry_msgs/Twist.h" #include "ros/console.h" #include "std_msgs/String.h" // misc includes #include "yaml-cpp/yaml.h" int main(int argc, char **argv) { // local variables for configurable params double rate_param; int msg_buffer_len=100; std::string to...
58459a34-dc7c-4c85-8c6e-a4b5ff08cb9b
{ "language": "C++" }
```c++ /* * 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"); y...
```c++ /* * 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"); y...
6b581319-9ee7-4de7-9a4d-eafbb56e2266
{ "language": "C++" }
```c++ /** Responsible for creating and destroying the mentat reference */ #include "d2tmh.h" cMentatFactory::cMentatFactory() { type = -1; } void cMentatFactory::deleteCurrent() { switch (type) { case ATREIDES: delete (cAtreidesMentat *)Mentat; break; case HARKONNEN: delete (cAtreidesMentat *)Mentat...
```c++ /** Responsible for creating and destroying the mentat reference */ #include "d2tmh.h" cMentatFactory::cMentatFactory() { type = -1; } void cMentatFactory::deleteCurrent() { switch (type) { case ATREIDES: delete (cAtreidesMentat *)Mentat; break; case HARKONNEN: delete (cHarkonnenMentat *)Menta...
68da63d0-4164-4a2a-bfbf-29b186319ff1
{ "language": "C++" }
```c++ #include "ShaderProgram.hpp" #include "Shader.hpp" ShaderProgram::ShaderProgram(std::initializer_list<const Shader*> shaders) { shaderProgram = glCreateProgram(); for (auto shader : shaders) glAttachShader(shaderProgram, shader->GetShaderID()); glLinkProgram(shaderProgram); } ShaderProgram::~ShaderProg...
```c++ #include "ShaderProgram.hpp" #include "Shader.hpp" ShaderProgram::ShaderProgram(std::initializer_list<const Shader*> shaders) { shaderProgram = glCreateProgram(); for (const Shader* shader : shaders) glAttachShader(shaderProgram, shader->GetShaderID()); glLinkProgram(shaderProgram); for (const ...
3388eb57-9ae7-483a-9b9d-dbc02ea1f36f
{ "language": "C++" }
```c++ // Copyright 2015 PDFium 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 "testing/embedder_test.h" #include "testing/gtest/include/gtest/gtest.h" class FPDFParserEmbeddertest : public EmbedderTest { }; TEST_F(FPDFPa...
```c++ // Copyright 2015 PDFium 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 "../../../testing/embedder_test.h" #include "testing/gtest/include/gtest/gtest.h" class FPDFParserEmbeddertest : public EmbedderTest { }; TEST...
46b3403a-43bf-40a3-9983-7606e57effcb
{ "language": "C++" }
```c++ // Copyright (c) 2006-2008 The Chromium 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 "chrome/browser/app_modal_dialog_queue.h" #include "chrome/browser/browser_list.h" void AppModalDialogQueue::AddDialog(AppModal...
```c++ // Copyright (c) 2006-2008 The Chromium 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 "chrome/browser/app_modal_dialog_queue.h" #include "chrome/browser/browser_list.h" void AppModalDialogQueue::AddDialog(AppModal...
cb620fd6-0442-49e4-a95a-a0845098f03a
{ "language": "C++" }
```c++ #include "AutonomousCommandGroup.h" #include "../RobotMap.h" AutonomousCommandGroup::AutonomousCommandGroup() { } ``` Set order of Autonomous Commands in CommandGroup
```c++ #include "AutonomousCommandGroup.h" #include "RaiseContainer.h" #include "DownContainer.h" #include "RaiseTrash.h" #include "DownTrash.h" #include "MoveContainer.h" #include "../RobotMap.h" AutonomousCommandGroup::AutonomousCommandGroup() { AddSequential(new RaiseTrash()); AddSequential(new DownTrash()); Ad...
f3016f8b-8dd2-4fa2-933b-2a827eb05eec
{ "language": "C++" }
```c++ // Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved. // Please see the AUTHORS file for details. Use of this source code is governed // by a BSD license that can be found in the LICENSE file. #include "allocators/global_sbrk_allocator.h" #include <sys/mman.h> // mmap #include "log....
```c++ // Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved. // Please see the AUTHORS file for details. Use of this source code is governed // by a BSD license that can be found in the LICENSE file. #include "allocators/global_sbrk_allocator.h" #include <sys/mman.h> // mmap #include "log....
024b836e-4ec3-4e20-8da1-53f135f8b55a
{ "language": "C++" }
```c++ // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include "vm/version.h" #include "vm/cpu.h" #include "vm/os.h" namespace dart { // TODO(iposv...
```c++ // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include "platform/atomic.h" #include "vm/cpu.h" #include "vm/os.h" #include "vm/version.h" na...
5f6609b6-7763-4e32-8ce3-82d6afd5834d
{ "language": "C++" }
```c++ // Test for disabling LSan at link-time. // RUN: LSAN_BASE="use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: %env_lsan_opts=$LSAN_BASE %run %t // RUN: %env_lsan_opts=$LSAN_BASE not %run %t foo 2>&1 | FileCheck %s #include <sanitizer/lsan_interface.h> int argc_copy; extern "C" { int __attri...
```c++ // Test for disabling LSan at link-time. // RUN: LSAN_BASE="use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: %env_lsan_opts=$LSAN_BASE %run %t // RUN: %env_lsan_opts=$LSAN_BASE not %run %t foo 2>&1 | FileCheck %s // // UNSUPPORTED: darwin #include <sanitizer/lsan_interface.h> int argc_copy;...
72498e68-e8e9-451d-853a-da6fa7ff05d6
{ "language": "C++" }
```c++ #include "MicroBit.h" extern "C" { void mp_run(void); void microbit_display_event(void); } static void event_listener(MicroBitEvent evt) { if (evt.value == MICROBIT_DISPLAY_EVT_ANIMATION_COMPLETE) { microbit_display_event(); } } void app_main() { /* // debugging: print memory ...
```c++ #include "MicroBit.h" extern "C" { void mp_run(void); void microbit_display_event(void); } static void event_listener(MicroBitEvent evt) { if (evt.value == MICROBIT_DISPLAY_EVT_ANIMATION_COMPLETE) { microbit_display_event(); } } void app_main() { /* // debugging: print memory ...
3064b232-86a4-4eb2-9efc-58970f6703f1
{ "language": "C++" }
```c++ #include <bts/blockchain/address.hpp> #include <bts/blockchain/pts_address.hpp> #include <bts/blockchain/types.hpp> #include <bts/utilities/key_conversion.hpp> #include <fc/crypto/elliptic.hpp> #include <fc/io/json.hpp> #include <fc/reflect/variant.hpp> #include <fc/filesystem.hpp> #include <fc/variant_object.hp...
```c++ #include <bts/blockchain/address.hpp> #include <bts/blockchain/pts_address.hpp> #include <bts/blockchain/types.hpp> #include <bts/utilities/key_conversion.hpp> #include <fc/crypto/elliptic.hpp> #include <fc/io/json.hpp> #include <fc/reflect/variant.hpp> #include <fc/filesystem.hpp> #include <fc/variant_object.hp...
3542b77f-8c19-44a4-b829-65cde42a2e99
{ "language": "C++" }
```c++ /* Copyright 2015 The TensorFlow Authors. 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 required by applicable l...
```c++ /* Copyright 2015 The TensorFlow Authors. 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 required by applicable l...
7917159d-588e-437a-a9cd-3009ca37888d
{ "language": "C++" }
```c++ #include <cstring> #include <iostream> #include <UnitTest++/UnitTest++.h> #include <UnitTest++/TestReporterStdout.h> using std::cerr; using std::endl; using std::strcmp; /* Function object returning true for a specified test name */ struct MatchTestName { const char * const tname; MatchTestName (const ...
```c++ #include <cstring> #include <iostream> #include <UnitTest++/UnitTest++.h> #include <UnitTest++/TestReporterStdout.h> using std::cerr; using std::endl; using std::strcmp; /* Function object returning true for a specified test name */ struct MatchTestName { const char * const tname; MatchTestName (const ...
fce6cc32-669b-4088-85e4-dc73e6e7b372
{ "language": "C++" }
```c++ // Copyright (C) 2012-2016 Leap Motion, Inc. All rights reserved. #include "stdafx.h" #include "MentionsVariousOtherTypes.hpp" #include <autowiring/autowiring.h> MentionsVariousOtherTypes::MentionsVariousOtherTypes(void) { AutoRequired<AutoPacketFactory>(); } ``` Remove PCH that seems to hit a rogue extern "...
```c++ // Copyright (C) 2012-2016 Leap Motion, Inc. All rights reserved. #include "MentionsVariousOtherTypes.hpp" #include <autowiring/autowiring.h> MentionsVariousOtherTypes::MentionsVariousOtherTypes(void) { AutoRequired<AutoPacketFactory>(); } ```
c9fcfcff-67e6-45f5-a019-cf44a5a29d85
{ "language": "C++" }
```c++ // Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. #include "stdafx.h" #include "auto_id.h" using namespace autowiring; // Index that will be given to the next auto_id instance. Zero is reserved. static int s_index = 1; const auto_id_block auto_id_t<void>::s_block{ 0, &typeid(void), &typ...
```c++ // Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. #include "stdafx.h" #include "auto_id.h" using namespace autowiring; // Index that will be given to the next auto_id instance. Zero is reserved. static int s_index = 1; const auto_id_block auto_id_t<void>::s_block{ 0, &typeid(void), &typ...
44e60e6b-0a27-4150-a221-a8d83537681f
{ "language": "C++" }
```c++ #include "comb.h" int main() { // for(int i=0;i<6;i++){ sweep(20*2*pi,0.7*2*pi,1,400000,1000,1/pow(10,10),0,10,16,50,600,15,0,0.001,"Gaussian"); sweep(20*2*pi,0.7*2*pi,1,400000,1000,1/pow(10,10),0,10,17,50,600,15,0,0.001,"Gaussian"); // } //gamma2(Hz),line width(GHz),sweep steps, total steps, p...
```c++ #include "comb.h" #include <ctime> int main() { fstream file1; file1.open("./Data/result.txt",ios::out | ios::trunc); file1<<"Function\t"<<"Order\t"<<"Steps\t"<<endl; for(int i=1;i<6;i++){ for(int j=1;j<4;j++){ time_t T1 = clock(),T2; sweep(20*2*pi,0.7*2*pi,1,400000,1000,1/pow(10,10),0,10,1...
91259df5-c352-4f08-a32c-49707873e8a1
{ "language": "C++" }
```c++ #include "mock/unittest_utils.hpp" #include <stdlib.h> #include "errors.hpp" #include <boost/bind.hpp> #include "arch/timing.hpp" #include "arch/runtime/starter.hpp" #include "utils.hpp" // randint namespace mock { temp_file_t::temp_file_t(const char *tmpl) { size_t len = strlen(tmpl); fi...
```c++ #include "mock/unittest_utils.hpp" #include <stdlib.h> #include "errors.hpp" #include <boost/bind.hpp> #include "arch/timing.hpp" #include "arch/runtime/starter.hpp" #include "utils.hpp" // randint namespace mock { temp_file_t::temp_file_t(const char *tmpl) { size_t len = strlen(tmpl); fi...
e7666a33-fb8f-482b-8cfd-602f3b2aeb94
{ "language": "C++" }
```c++ #include <boost/test/unit_test.hpp> #include "../uint256.h" extern void SHA256Transform(void* pstate, void* pinput, const void* pinit); BOOST_AUTO_TEST_SUITE(miner_tests) BOOST_AUTO_TEST_CASE(sha256transform_equality) { unsigned int pSHA256InitState[8] = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0...
```c++ #include <boost/test/unit_test.hpp> #include "../uint256.h" extern void SHA256Transform(void* pstate, void* pinput, const void* pinit); BOOST_AUTO_TEST_SUITE(miner_tests) BOOST_AUTO_TEST_CASE(sha256transform_equality) { unsigned int pSHA256InitState[8] = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0...
43755d25-dae0-4f19-9a0e-3554bb1d8f4d
{ "language": "C++" }
```c++ // RUN: %clangxx -shared -o /dev/null -v -fxray-instrument %s -### // RUN: %clangxx -shared -o /dev/null -v -fxray-instrument %s -### 2>&1 | \ // RUN: FileCheck %s --check-prefix=SHARED // RUN: %clangxx -static -o /dev/null -v -fxray-instrument %s -### -DMAIN // RUN: %clangxx -static -o /dev/null -v -fxray-i...
```c++ // RUN: %clangxx -shared -o /dev/null -v -fxray-instrument %s -### // RUN: %clangxx -shared -o /dev/null -v -fxray-instrument %s -### 2>&1 | \ // RUN: FileCheck %s --check-prefix=SHARED // RUN: %clangxx -static -o /dev/null -v -fxray-instrument %s -### -DMAIN // RUN: %clangxx -static -o /dev/null -v -fxray-i...
93ee8d69-6b04-4f08-b3a4-b849b601ef5f
{ "language": "C++" }
```c++ #include "ZulipAboutDialog.h" #include "ui_ZulipAboutDialog.h" #include "Config.h" #include <QFile> #include <QDebug> ZulipAboutDialog::ZulipAboutDialog(QWidget *parent) : QDialog(parent), m_ui(new Ui::ZulipAboutDialog) { m_ui->setupUi(this); QFile html(":/about.html"); if (!html.open(QIODevi...
```c++ #include "ZulipAboutDialog.h" #include "ui_ZulipAboutDialog.h" #include "Config.h" #include "ZulipApplication.h" #include "ZulipWindow.h" #include <QFile> #include <QDebug> ZulipAboutDialog::ZulipAboutDialog(QWidget *parent) : QDialog(parent), m_ui(new Ui::ZulipAboutDialog) { m_ui->setupUi(this); ...
785a0a09-3d3d-4ee0-839d-3383f02335fd
{ "language": "C++" }
```c++ #include "ProxyImage.h" #include "StringHelper.h" #include <sprite2/S2_Texture.h> namespace gum { ProxyImage::ProxyImage(int id, int w, int h, int format) { Init(id, w, h, format); } ProxyImage::~ProxyImage() { // m_id = 0; // avoid release in Image // // managed by other } void ProxyImage::Ini...
```c++ #include "ProxyImage.h" #include "StringHelper.h" #include <sprite2/S2_Texture.h> namespace gum { ProxyImage::ProxyImage(int id, int w, int h, int format) { Init(id, w, h, format); } ProxyImage::~ProxyImage() { m_id = 0; // avoid release in Image // managed by other } void ProxyImage::Init(int ...
791775ab-ecc6-4345-a560-605e9c79777f
{ "language": "C++" }
```c++ #include "HttpClient.h" #include <mbedtls/ssl.h> #include <mbedtls/x509.h> namespace ceema { CURLcode HttpClient::ssl_ctx_callback_mbedtls(CURL *curl, void *ssl_ctx, void *client_ptr) { HttpClient& client = *static_cast<HttpClient*>(client_ptr); if (client.m_cert.empty()) { ret...
```c++ #include "HttpClient.h" #include <mbedtls/ssl.h> #include <mbedtls/x509.h> namespace ceema { CURLcode HttpClient::ssl_ctx_callback_mbedtls(CURL *curl, void *ssl_ctx, void *client_ptr) { HttpClient& client = *static_cast<HttpClient*>(client_ptr); if (client.m_cert.empty()) { ret...
be3acbe4-da33-4f89-b255-913b78aabbfa
{ "language": "C++" }
```c++ #include "common.h" void siren_ary_to_xyz(VALUE ary, Standard_Real& x, Standard_Real& y, Standard_Real& z) { x = 0.0; y = 0.0; z = 0.0; Check_Type(ary, T_ARRAY); int len = RARRAY_LEN(ary); if (len > 0) { x = NUM2DBL(RARRAY_AREF(ary, 0)); } if (len > 1) { y = NUM2DBL(RARRAY_AREF(ary, 1)); ...
```c++ #include "common.h" void siren_ary_to_xyz(VALUE ary, Standard_Real& x, Standard_Real& y, Standard_Real& z) { x = 0.0; y = 0.0; z = 0.0; int len = RARRAY_LEN(ary); if (len > 0) { x = NUM2DBL(RARRAY_AREF(ary, 0)); } if (len > 1) { y = NUM2DBL(RARRAY_AREF(ary, 1)); } if (len > 2) { z = N...
9ba986df-51ea-44d7-a35b-6d733fa774e0
{ "language": "C++" }
```c++ #include "KAI/Console/Console.h" #include <iostream> #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include <Windows.h> #endif using namespace std; USING_NAMESPACE_KAI //static Color _color; int main(int argc, char **argv) { KAI_UNUSED_2(argc, argv); cout << "pyro v0.1" << endl; Console console; console....
```c++ #include <KAI/Console/Console.h> #include <iostream> using namespace std; USING_NAMESPACE_KAI int main(int argc, char **argv) { KAI_UNUSED_2(argc, argv); cout << "KAI v0.1" << endl; Console console; console.SetLanguage(Language::Pi); // the higher the number, the greater the verbosity of debug output ...
4465fa0d-31e7-44e6-8b09-cd17d3b506f5
{ "language": "C++" }
```c++ #include "Rotate.hpp" #include "../../../Libraries/bullet3/src/LinearMath/btTransform.h" #include <Scenes/Entity.hpp> #include <Engine/Engine.hpp> #include <Physics/Colliders/Collider.hpp> #include <Maths/Maths.hpp> namespace test { Rotate::Rotate(const Vector3 &direction, const int &test) : m_direction(dir...
```c++ #include "Rotate.hpp" #include <bullet/LinearMath/btTransform.h> #include <Scenes/Entity.hpp> #include <Engine/Engine.hpp> #include <Physics/Colliders/Collider.hpp> #include <Maths/Maths.hpp> namespace test { Rotate::Rotate(const Vector3 &direction, const int &test) : m_direction(direction), m_test(test),...
467c6880-3363-4476-8262-b2172d15d517
{ "language": "C++" }
```c++ #include <iostream> #include "libport/cli.hh" #include "libport/sysexits.hh" #include "libport/program-name.hh" namespace libport { void usage_error (const std::string& opt, const std::string& err) { std::cerr << program_name << ": " << opt << ": " << err << std::endl << libport::exit (EX_USAG...
```c++ #include <iostream> #include "libport/cli.hh" #include "libport/sysexits.hh" #include "libport/program-name.hh" namespace libport { void usage_error (const std::string& opt, const std::string& err) { std::cerr << program_name << ": " << opt << ": " << err << std::endl << "Try `" << ...