doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
0ada1d3f-30f5-4848-b2ca-229f78ec5165
{ "language": "C++" }
```c++ #include "UpdaterWindow.h" #include "../3RVX/3RVX.h" #include "../3RVX/Logger.h" #include "../3RVX/CommCtl.h" #include "../3RVX/NotifyIcon.h" #include "resource.h" UpdaterWindow::UpdaterWindow() : Window(L"3RVX-UpdateWindow") { HRESULT hr = LoadIconMetric( Window::InstanceHandle(), MAKEINTR...
```c++ #include "UpdaterWindow.h" #include "../3RVX/3RVX.h" #include "../3RVX/Logger.h" #include "../3RVX/CommCtl.h" #include "../3RVX/NotifyIcon.h" #include "resource.h" UpdaterWindow::UpdaterWindow() : Window(L"3RVX-UpdateWindow") { HRESULT hr = LoadIconMetric( Window::InstanceHandle(), MAKEINTR...
485d57ed-7cfd-4ac5-91cd-869c8c162b17
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/class1.cpp // RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/class2.cpp // RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s // CHECK: class1.cpp:5:8: warning: type 'B' has incompatible definitions in different transl...
```c++ // XRUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/class1.cpp // XRUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/class2.cpp // XRUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s // CHECK: class1.cpp:5:8: warning: type 'B' has incompatible definitions in different tra...
93699479-c9df-44c8-8871-d8c7d5cdeea2
{ "language": "C++" }
```c++ /* * test_setupTunnel.cpp * * Created on: 24 sep. 2015 * Author: Jesper */ #ifdef _MOCK_ #include "gtest/gtest.h" #include "../src/setupTunnel.h" class test_setupTunnel : public ::testing::Test { protected: virtual void SetUp() {} virtual void TearDown() {} }; #endif ``` Test is running, but the...
```c++ /* * test_setupTunnel.cpp * * Created on: 24 sep. 2015 * Author: Jesper */ #ifdef _MOCK_ #include "gtest/gtest.h" #include "../src/setupTunnel.h" class test_setupTunnel : public ::testing::Test { protected: virtual void SetUp() {} virtual void TearDown() {} }; TEST(test_setupTunnel, handleSetupTu...
56063b25-f4a3-440e-a3bc-9fa41478c0c5
{ "language": "C++" }
```c++ #include "CShader.h" CShader * CompileVertFragShader(string const VertexShaderSource, string const FragmentShaderSource) { ion::GL::VertexShader * VertexShader = new ion::GL::VertexShader; VertexShader->Source(VertexShaderSource); if (! VertexShader->Compile()) std::cerr << "Failed to compile ve...
```c++ #include "CShader.h" CShader * CompileVertFragShader(string const VertexShaderSource, string const FragmentShaderSource) { ion::GL::VertexShader * VertexShader = new ion::GL::VertexShader; VertexShader->Source(VertexShaderSource); if (! VertexShader->Compile()) std::cerr << "Failed to compile ve...
ee3721ce-9027-4e83-8607-5e24be47d8af
{ "language": "C++" }
```c++ #include <boost/test/unit_test.hpp> #include "Werk/OS/Hardware.hpp" BOOST_AUTO_TEST_SUITE(HardwareTest) BOOST_AUTO_TEST_CASE(TestGetPageSize) { uint64_t pageSize = werk::getPageSize(); //Anything less than 4K won't be adequate anyway BOOST_REQUIRE(pageSize >= 4 * 1024); //And memory should come in at l...
```c++ #include <boost/test/unit_test.hpp> #include "Werk/OS/Hardware.hpp" BOOST_AUTO_TEST_SUITE(HardwareTest) BOOST_AUTO_TEST_CASE(TestGetPageSize) { uint64_t pageSize = werk::getPageSize(); //Anything less than 4K won't be adequate anyway BOOST_REQUIRE(pageSize >= 4 * 1024); //And pages should come in at le...
5d304de2-eda4-498c-8e2d-e2f71de474db
{ "language": "C++" }
```c++ #include <iostream> using namespace std; int main(void) { int a, b; cin >> a >> b; cout << static_cast<double>(a) / b << endl; return 0; }``` Deal with the situation when the second integer is 0 using run_time exception covered in this chapter.
```c++ #include <iostream> #include <string> using std::string; using std::cin; using std::cout; using std::endl; int main () { int a=0, b=0; cout<<"Please input two integers: "; while (cin>>a>>b) { try{ if (b==0) { throw std::runtime_error("One of the two integers is 0...
ac595c94-0c7a-4d30-9dd5-851a6ccd6481
{ "language": "C++" }
```c++ #include <memory> #include "Vec2i.h" #include "IMapElement.h" #include "CActor.h" #include "CWizard.h" namespace WizardOfGalicia { CWizard::CWizard() : CActor() { view = '^'; team = Team::HEROES; hp = 5; attack = 4; defence = 1; magicEnergy = 20; } void CWizard::update(std::share...
```c++ #include <memory> #include "Vec2i.h" #include "IMapElement.h" #include "CActor.h" #include "CWizard.h" namespace WizardOfGalicia { CWizard::CWizard() : CActor() { view = '^'; team = Team::HEROES; hp = 5; attack = 4; defence = 1; magicEnergy = 20; } void CWizard::update(std::share...
d5806ef2-64c7-4b04-9fae-b0c2d1145a42
{ "language": "C++" }
```c++ #include "aquila/global.h" #include "aquila/ml/Dtw.h" #include <unittestpp.h> #include <vector> SUITE(Dtw) { TEST(DistanceToItself) { const std::size_t SIZE = 3; double arr1[SIZE] = {0, 1, 2}, arr2[SIZE] = {1, 2, 3}; std::vector<double> v1(arr1, arr1 + SIZE), v2(arr2, arr2 + SIZ...
```c++ #include "aquila/global.h" #include "aquila/ml/Dtw.h" #include <unittestpp.h> #include <vector> SUITE(Dtw) { TEST(DistanceToItself) { const std::size_t SIZE = 3; double arr1[SIZE] = {0, 1, 2}, arr2[SIZE] = {1, 2, 3}; std::vector<double> v1(arr1, arr1 + SIZE), v2(arr2, arr2 + SIZ...
1db6e634-5298-472a-8541-7338ff826b77
{ "language": "C++" }
```c++ //===----------------------------------------------------------------------===// // // Peloton // // transaction_manager_factory.h // // Identification: src/backend/concurrency/transaction_manager_factory.h // // Copyright (c) 2015-16, Carnegie Mellon University Database Group // //===---...
```c++ //===----------------------------------------------------------------------===// // // Peloton // // transaction_manager_factory.h // // Identification: src/backend/concurrency/transaction_manager_factory.h // // Copyright (c) 2015-16, Carnegie Mellon University Database Group // //===---...
104a4aba-9e71-4c59-b954-4712b9b883b8
{ "language": "C++" }
```c++ #include "ButtonPress.h" #include <assert.h> ButtonPress::ButtonPress(int pinNum, void(*callback)(void)) : m_pinNum(pinNum), m_callback(callback) { assert(m_callback != NULL); pinMode(m_pinNum, INPUT_PULLUP); // Assume pin state at init is the "unpressed" state m_unpressedPinState = digitalRead(m_pinNum)...
```c++ #include "ButtonPress.h" #include <assert.h> ButtonPress::ButtonPress(int pinNum, void(*callback)(void)) : m_pinNum(pinNum), m_callback(callback) { assert(m_callback != NULL); pinMode(m_pinNum, INPUT_PULLUP); // Assume pin state at init is the "unpressed" state m_unpressedPinState = digitalRead(m_pinNum)...
6ef72bac-eacb-4ded-a08e-f8b8d3549126
{ "language": "C++" }
```c++ #include "open_loop.h" OpenLoop::OpenLoop() { joySub = n.subscribe("joystick", 1, &OpenLoop::joyCallback, this); tauPub = n.advertise<geometry_msgs::Wrench>("control_forces", 1); } void OpenLoop::joyCallback(const joystick::Joystick &joy_msg) { geometry_msgs::Wrench tau; tau.force.x = joy_msg....
```c++ #include "open_loop.h" OpenLoop::OpenLoop() { joySub = n.subscribe("joystick", 1, &OpenLoop::joyCallback, this); tauPub = n.advertise<geometry_msgs::Wrench>("control_forces", 1); } void OpenLoop::joyCallback(const joystick::Joystick &joy_msg) { geometry_msgs::Wrench tau; tau.force.x = joy_msg....
d3273759-12f6-4c0e-8136-6897daf3ff99
{ "language": "C++" }
```c++ #include "textures/constant_texture.h" ConstantTexture::ConstantTexture(const Colorf &color) : color(color){} Colorf ConstantTexture::sample(const DifferentialGeometry &) const { return color; } Colorf ConstantTexture::sample(const TextureSample &sample) const { return color; } ``` Clean up unused param war...
```c++ #include "textures/constant_texture.h" ConstantTexture::ConstantTexture(const Colorf &color) : color(color){} Colorf ConstantTexture::sample(const DifferentialGeometry&) const { return color; } Colorf ConstantTexture::sample(const TextureSample&) const { return color; } ```
5ca9e163-d504-4425-8d07-5a7081476119
{ "language": "C++" }
```c++ #include "LedController.hpp" #include <algorithm> #include <bitset> LedController::LedController(std::ostream& stream) : out{stream} { } void LedController::runProgram(const Instructions& instructions) { for (const auto& instruction : instructions) { runInstruction(instruction); } } void ...
```c++ #include "LedController.hpp" #include <algorithm> #include <bitset> LedController::LedController(std::ostream& stream) : out{stream} { } void LedController::runProgram(const Instructions& instructions) { for (const auto& instruction : instructions) { runInstruction(instruction); } } void ...
5b289642-1728-4aa1-9d55-11c6c71a99ab
{ "language": "C++" }
```c++ #include "catch.hpp" #include "ReverseInteger.hpp" TEST_CASE("Reverse Integer") { Solution s; SECTION("Sample test") { REQUIRE(s.reverse(123) == 321); REQUIRE(s.reverse(-123) == -321); } } ``` Update Problem 7 test case
```c++ #include "catch.hpp" #include "ReverseInteger.hpp" TEST_CASE("Reverse Integer") { Solution s; SECTION("Sample test") { REQUIRE(s.reverse(123) == 321); REQUIRE(s.reverse(-123) == -321); } SECTION("Overflow test") { REQUIRE(s.reverse(-2147483648) == 0); REQUIRE(s.reverse(2147483647) == ...
9c1f95d9-b0f4-4a76-a1b9-88a3a9c5a2b1
{ "language": "C++" }
```c++ #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization ("unroll-loops") #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for (__typeof(a) i=(a); i<(b); ++i) #define iter(it,c) for (__typeof((c).begin()) \ it = (c).begin(); it != (c).end(); ++it) typedef pair<i...
```c++ #pragma GCC optimize("Ofast","unroll-loops") #pragma GCC target("avx2,fma") #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for (__typeof(a) i=(a); i<(b); ++i) #define iter(it,c) for (__typeof((c).begin()) \ it = (c).begin(); it != (c).end(); ++it) typedef pair<int, int> ii; typedef vector<int...
0d8172ca-e98c-48b5-9850-12b4bcde2998
{ "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 "chrome/renderer/renderer_main_platform_delegate.h" #include "base/debug_util.h" // This is a no op class because we do not have a s...
```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 "chrome/renderer/renderer_main_platform_delegate.h" #include "base/debug_util.h" // This is a no op class because we do not have a s...
038c0bc8-4e5f-4e6c-9c82-2e6bffda2470
{ "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 ...
dcf797f3-c596-4d36-b96f-9261ad31d8de
{ "language": "C++" }
```c++ // // Created by monty on 26/09/16. // #include <string> #include <cstdarg> #ifdef __ANDROID__ #include <android/log.h> #else #include <cstdio> #endif #include "Logger.h" namespace odb { void doLog(const char *format, va_list args) { char buffer[255]; std::vsnprintf(buffer, 255, format,...
```c++ // // Created by monty on 26/09/16. // #include <string> #include <cstdarg> #include <cstring> #ifdef __ANDROID__ #include <android/log.h> #else #include <cstdio> #endif #include "Logger.h" namespace odb { void doLog(const char *format, va_list args) { char buffer[255]; return; ...
71c3834e-4727-4445-8cd7-2abe00f311f9
{ "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 "chrome/browser/extensions/extension_apitest.h" IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Storage) { ASSERT_TRUE(RunExtensionTest("s...
```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 "chrome/browser/extensions/extension_apitest.h" // Started failing with r29947. WebKit merge 49961:49992. IN_PROC_BROWSER_TEST_F(DISA...
984fa1bc-4053-431f-aef4-427f1ecc7516
{ "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 "components/translate/core/common/language_detection_details.h" namespace translate { LanguageDetectionDetails::LanguageDetectionDetails...
```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 "components/translate/core/common/language_detection_details.h" namespace translate { LanguageDetectionDetails::LanguageDetectionDetails...
631c3a1e-01ff-44f3-9f3a-142451b28bb0
{ "language": "C++" }
```c++ #include "powerdhcp.hh" namespace PowerDHCP { Logging theL; pthread_rwlock_t Logger::d_lock = PTHREAD_RWLOCK_INITIALIZER; const char* Logger::LEVEL[] = { "DEBUG", "INFO", "NOTICE", "WARNING", "ERROR", "CRITICAL" }; std::string stringerror() { std::string ret;...
```c++ #include "powerdhcp.hh" namespace PowerDHCP { Logger theL; pthread_rwlock_t Logger::d_lock = PTHREAD_RWLOCK_INITIALIZER; const char* Logger::LEVEL[] = { "DEBUG", "INFO", "NOTICE", "WARNING", "ERROR", "CRITICAL" }; std::string stringerror() { std::string ret; ...
63acac9e-aad2-4f67-9718-72a3f333469f
{ "language": "C++" }
```c++ /* * Copyright (C) 2017 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
```c++ /* * Copyright (C) 2017 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
19c0e0e0-2649-4cc3-8340-0d20ce74342e
{ "language": "C++" }
```c++ #include "PythonModule.h" //#include "agent_finder_api.h" using namespace opencog; DECLARE_MODULE(PythonModule); PythonModule::PythonModule() : Module() { logger().info("[PythonModule] constructor"); do_load_py_register(); } PythonModule::~PythonModule() { logger().info("[PythonModule] destructo...
```c++ #include "PythonModule.h" #include "agent_finder_api.h" using namespace opencog; DECLARE_MODULE(PythonModule); PythonModule::PythonModule() : Module() { logger().info("[PythonModule] constructor"); do_load_py_register(); } PythonModule::~PythonModule() { logger().info("[PythonModule] destructor"...
6c7f128c-9c86-4531-b9c4-4d78d74bcf2d
{ "language": "C++" }
```c++ #include "JobTree.h" #include "plow.h" #include <QStringList> #include <QString> namespace Plow { namespace Gui { JobTree::JobTree(QWidget *parent) : QWidget(parent) { layout = new QVBoxLayout(this); QStringList header; header << "Job" << "Cores" << "Max" << "Waiting"; treeWidget = new QTree...
```c++ #include "JobTree.h" #include "plow.h" #include <QStringList> #include <QString> namespace Plow { namespace Gui { JobTree::JobTree(QWidget *parent) : QWidget(parent) { layout = new QVBoxLayout(this); QStringList header; header << "Job" << "Cores" << "Max" << "Waiting"; treeWidget = new QTree...
ff8a5b29-5b36-442c-a389-9a5f715013c9
{ "language": "C++" }
```c++ #include <ngraph.h> #include <PCU.h> #include <engpar_support.h> #include "buildGraphs.h" #include "../partition/Diffusive/engpar_diffusive_input.h" #include "../partition/Diffusive/src/engpar_queue.h" int main(int argc, char* argv[]) { MPI_Init(&argc,&argv); EnGPar_Initialize(); agi::Ngraph* g; if (arg...
```c++ #include <ngraph.h> #include <PCU.h> #include <engpar_support.h> #include "buildGraphs.h" #include "../partition/Diffusive/engpar_diffusive_input.h" #include "../partition/Diffusive/src/engpar_queue.h" int main(int argc, char* argv[]) { MPI_Init(&argc,&argv); EnGPar_Initialize(); agi::Ngraph* g; if (arg...
a81efd90-e098-4255-b2f1-b73cede4f8ed
{ "language": "C++" }
```c++ //===-- WebAssemblyTargetInfo.cpp - WebAssembly Target Implementation -----===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- WebAssemblyTargetInfo.cpp - WebAssembly Target Implementation -----===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
bdf7da04-938c-422c-ad6d-699b565d072f
{ "language": "C++" }
```c++ /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* * Main authors: * Guido Tack <guido.tack@monash.edu> */ /* 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, You can obtain one at http:...
```c++ /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* * Main authors: * Guido Tack <guido.tack@monash.edu> */ /* 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, You can obtain one at http:...
fa84c220-b810-49d4-a579-4cb09349424a
{ "language": "C++" }
```c++ /* -*- C++ -*-; c-basic-offset: 4; indent-tabs-mode: nil */ /* * Implementation for OFLogHandler class. * * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which ...
```c++ /* -*- C++ -*-; c-basic-offset: 4; indent-tabs-mode: nil */ /* * Implementation for OFLogHandler class. * * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which ...
e1241e11-f23c-4d74-b595-de0f45046510
{ "language": "C++" }
```c++ #include <QGuiApplication> #include <QQmlApplicationEngine> #include <QQmlContext> #include <QDebug> #include <Qt> #include "QZXingFilter.h" #if defined(Q_OS_IOS) /// Reference for iOS entry point: /// http://stackoverflow.com/questions/25353686/you-are-creating-qapplication-before-calling-uiapplicationmain-...
```c++ #include <QGuiApplication> #include <QQmlApplicationEngine> #include <QQmlContext> #include <QDebug> #include <Qt> #include "QZXingFilter.h" int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QGuiApplication app(argc, argv); QQmlApplicationEngine engine; ...
15e3bfe6-98d1-4002-b437-70cdd7dba029
{ "language": "C++" }
```c++ #include "OneWire.h" static OneWireMock* gOneWireMock = NULL; OneWireMock* oneWireMockInstance() { if( !gOneWireMock ) { gOneWireMock = new OneWireMock(); } return gOneWireMock; } void releaseOneWireMock() { if( gOneWireMock ) { delete gOneWireMock; gOneWireMock = NUL...
```c++ #include "OneWire.h" static OneWireMock* gOneWireMock = NULL; OneWireMock* oneWireMockInstance() { if( !gOneWireMock ) { gOneWireMock = new OneWireMock(); } return gOneWireMock; } void releaseOneWireMock() { if( gOneWireMock ) { delete gOneWireMock; gOneWireMock = NUL...
134d72ac-37b2-4de6-8c13-3df06cd24b0e
{ "language": "C++" }
```c++ #include "Game/CannonBall.h" CannonBall::CannonBall(const QPixmap & pixmap, QVector2D velocity, QVector2D position, Player owner, QGraphicsItem * parent) : Entity(pixmap, owner, parent), m_initialVelocity(velocity), m_initialPosition(position), m_gravity(9.8), m_timeSinceShot(0) { setScale(0.1); setPos(m_init...
```c++ #include "Game/CannonBall.h" CannonBall::CannonBall(const QPixmap & pixmap, QVector2D velocity, QVector2D position, Player owner, QGraphicsItem * parent) : Entity(pixmap, owner, parent), m_initialVelocity(velocity), m_initialPosition(position), m_gravity(9.8), m_timeSinceShot(0) { setScale(0.1); setPos(m_init...
8f49df12-aefe-4bfd-aea8-76f1e3ebb9fd
{ "language": "C++" }
```c++ //===- Dominators.cpp - Implementation of dominators tree for Clang CFG ---===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===--------------------...
```c++ //===- Dominators.cpp - Implementation of dominators tree for Clang CFG ---===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===--------------------...
286e24b8-fab2-4949-bbac-7499629723cc
{ "language": "C++" }
```c++ #include "mbed.h" #include "test_env.h" int main() { MBED_HOSTTEST_TIMEOUT(20); MBED_HOSTTEST_SELECT(serial_nc_rx_auto); MBED_HOSTTEST_DESCRIPTION(Serial NC RX); MBED_HOSTTEST_START("MBED_37"); Serial *pc = new Serial(USBTX, USBRX); char c = pc->getc(); delete pc; // This sho...
```c++ #include "mbed.h" #include "test_env.h" int main() { MBED_HOSTTEST_TIMEOUT(20); MBED_HOSTTEST_SELECT(serial_nc_rx_auto); MBED_HOSTTEST_DESCRIPTION(Serial NC RX); MBED_HOSTTEST_START("MBED_37"); Serial *pc = new Serial(NC, USBRX); char c = pc->getc(); delete pc; // This should...
4a8b229c-0c59-44fb-9357-73db0f902542
{ "language": "C++" }
```c++ #include <linux/limits.h> #include <stdlib.h> #include <sys/stat.h> #include "MagpieString.h" #include "Path.h" namespace magpie { namespace path { char separator() { return '/'; } gc<String> real(gc<String> path) { char absolute[PATH_MAX]; realpath(path->cString(), absolute); ...
```c++ // TODO(bob): PATH_MAX isn't actually part of POSIX. Need to do something // smarter here. #ifdef __linux__ #include <linux/limits.h> #else #include <limits.h> #endif #include <stdlib.h> #include <sys/stat.h> #include "MagpieString.h" #include "Path.h" namespace magpie { namespace path { char separat...
f75d0db0-b1ba-422b-a0be-502cb3126a3d
{ "language": "C++" }
```c++ #include "filesystem.h" #include "remotefileops.h" #include <QtCore/QCoreApplication> #include <QtCore/QDebug> #define DEBUG_FILESYSTEM 0 struct FileSystemPrivate { FileSystemPrivate(FileOps* ops) { m_fileOps = ops; } FileOps* m_fileOps; }; FileSystem::FileSystem(FileOps* ops) :...
```c++ #include "filesystem.h" #include "remotefileops.h" #include <QtCore/QCoreApplication> #include <QtCore/QDebug> #define DEBUG_FILESYSTEM 0 struct FileSystemPrivate { FileSystemPrivate(FileOps* ops) { m_fileOps = ops; } FileOps* m_fileOps; }; FileSystem::FileSystem(FileOps* ops) :...
9f8c27c3-3c30-4bbf-9f07-81af952835a7
{ "language": "C++" }
```c++ #include <QApplication> #include <QQmlApplicationEngine> #include <QtQml> #include <QQmlFileSelector> #include "screenvalues.h" static QObject *screen_values_provider(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return new ScreenValues(); } int main(int a...
```c++ #include <QApplication> #include <QQmlApplicationEngine> #include <QtQml> #include <QQmlFileSelector> #include "screenvalues.h" static QObject *screen_values_provider(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return new ScreenValues(); } int main(int a...
edb4fe3b-411e-425c-a9b7-39ce9fadc473
{ "language": "C++" }
```c++ // Copyright (c) 2016-2019 The Gulden developers // Authored by: Willem de Jonge (willem@isnapp.nl) // Distributed under the GULDEN software license, see the accompanying // file COPYING #include "extendwitnessdialog.h" #include <qt/_Gulden/forms/ui_extendwitnessdialog.h> #include "wallet/wallet.h" #include "G...
```c++ // Copyright (c) 2016-2019 The Gulden developers // Authored by: Willem de Jonge (willem@isnapp.nl) // Distributed under the GULDEN software license, see the accompanying // file COPYING #include "extendwitnessdialog.h" #include <qt/_Gulden/forms/ui_extendwitnessdialog.h> #include "wallet/wallet.h" #include "g...
34ca3b21-8834-445a-9984-95af53f6a085
{ "language": "C++" }
```c++ #include "app.hpp" #include "gui.hpp" namespace rack { void RackScrollWidget::step() { Vec pos = gRackWidget->lastMousePos; // Scroll rack if dragging cable near the edge of the screen if (gRackWidget->wireContainer->activeWire) { float margin = 20.0; float speed = 15.0; if (pos.x <= margin) offs...
```c++ #include "app.hpp" #include "gui.hpp" namespace rack { void RackScrollWidget::step() { Vec pos = gMousePos; Rect viewport = getViewport(box.zeroPos()); // Scroll rack if dragging cable near the edge of the screen if (gRackWidget->wireContainer->activeWire) { float margin = 20.0; float speed = 15.0; ...
fb59e37b-0714-4a2d-80ab-0ada2060afe7
{ "language": "C++" }
```c++ #include "SavePreferences.h" SavePreferences::SavePreferences() { } // Called just before this Command runs the first time void SavePreferences::Initialize() { Preferences::GetInstance()->Save(); } // Called repeatedly when this Command is scheduled to run void SavePreferences::Execute() { } // Make this re...
```c++ #include "SavePreferences.h" SavePreferences::SavePreferences() { this->SetRunWhenDisabled(true); } // Called just before this Command runs the first time void SavePreferences::Initialize() { Preferences::GetInstance()->Save(); } // Called repeatedly when this Command is scheduled to run void SavePreference...
dfcc8e8d-0a0b-456f-ba90-2a3f81dc870d
{ "language": "C++" }
```c++ #include "SVGImage.h" #define NANOSVG_IMPLEMENTATION #include <nanosvg.h> #include <nanovg.h> // XXX This is bad, but easy. #define NANOVG_GL_IMPLEMENTATION #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #include <GLES2/gl2platform.h> #include <nanovg_gl.h> #include <nanovg.c> SVGImage::SVGImage() : _nanoS...
```c++ #include "SVGImage.h" #define NANOSVG_IMPLEMENTATION #include <nanosvg.h> #include <nanovg.h> // XXX This is bad, but easy. #define NANOVG_GL_IMPLEMENTATION #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #include <GLES2/gl2platform.h> #include <nanovg_gl.h> #include <nanovg.c> SVGImage::SVGImage() : _nanoS...
de65efcc-ac91-4b86-8833-87374f024a5f
{ "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...
91f09aa1-a50c-4188-950e-1e249a655da0
{ "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. // //===---------------------------------...
8e36fc78-28ff-486c-b4e4-17664ad9e249
{ "language": "C++" }
```c++ #include "MainWindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); QApplication::setApplicationName("ofProjectGenerator"); QApplication::setApplicationVersion("0.5.1"); QApplication::setOrganizationName("Furkanzmc"); MainWindow w; w.show(); ...
```c++ #include "MainWindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); QApplication::setApplicationName("ofProjectGenerator"); QApplication::setApplicationVersion("0.5.2"); QApplication::setOrganizationName("Furkanzmc"); MainWindow w; w.show(); ...
06196086-4c4c-4dfb-9680-a6ff8d040a12
{ "language": "C++" }
```c++ // Copyright (c) 2012 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 "ui/gfx/linux_util.h" #include "base/basictypes.h" #include "testing/gtest/include/gtest/gtest.h" namespace gfx { TEST(LinuxUtilTes...
```c++ // Copyright (c) 2012 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 "ui/gfx/linux_util.h" #include "base/basictypes.h" #include "testing/gtest/include/gtest/gtest.h" namespace gfx { TEST(LinuxUtilTes...
87c585fa-7c5a-48fb-bdec-791a89d089c5
{ "language": "C++" }
```c++ #include "variantmap.h" namespace MolCore { // === VariantMap ========================================================== // /// \class VariantMap /// \brief The VariantMap class provides a map between string keys /// and variant values. // --- Construction and Destruction -----------------------------...
```c++ #include "variantmap.h" namespace MolCore { // === VariantMap ========================================================== // /// \class VariantMap /// \brief The VariantMap class provides a map between string keys /// and variant values. // --- Construction and Destruction -----------------------------...
21e8c615-9f0c-4ddf-bf9a-49a9508fe11e
{ "language": "C++" }
```c++ #include <iostream> #include <array> #include <asio/steady_timer.hpp> #include <asio.hpp> #include <thread> #include "node/raft_node.h" using namespace std; std::vector<raft_node_endpoint_t> peers{ {1ul, "localhost", 12345, 13001}, {2ul, "localhost", 12346, 13002}, {3ul, "localhost", 12...
```c++ #include <iostream> #include <array> #include <asio/steady_timer.hpp> #include <asio.hpp> #include <thread> #include "node/raft_node.h" using namespace std; std::vector<raft_node_endpoint_t> peers{ {1ul, "localhost", 12345, 13001}, {2ul, "localhost", 12346, 13002}, {3ul, "localhost", 12...
3bbe5a58-8b02-4109-9766-17714e7f2f54
{ "language": "C++" }
```c++ /// \file main.cpp #include "HelloTriangleApplication.hpp" #define DOCTEST_CONFIG_IMPLEMENT #include "doctest.h" #include <cstdlib> #include <ostream> #include <stdexcept> int main(int argc, char* argv[]) // NOLINT(bugprone-exception-escape) { ////////////////////////////// Testing Stuff //// doctest:...
```c++ /// \file main.cpp #include "HelloTriangleApplication.hpp" #define DOCTEST_CONFIG_IMPLEMENT #include "doctest.h" #include <cstdlib> #include <ostream> #include <stdexcept> int main(int argc, char* argv[]) { /////////////////////////////////////////////////////////////// Testing Stuff doctest::Context ...
2c1c3c38-3ea2-4edd-9eda-6d8340df711b
{ "language": "C++" }
```c++ // Copyright 2015 Las Venturas Playground. All rights reserved. // Use of this source code is governed by the MIT license, a copy of which can // be found in the LICENSE file. #include "bindings/script_prologue.h" namespace bindings { // NOTE: Line breaks will be removed from these scripts before their execut...
```c++ // Copyright 2015 Las Venturas Playground. All rights reserved. // Use of this source code is governed by the MIT license, a copy of which can // be found in the LICENSE file. #include "bindings/script_prologue.h" namespace bindings { // NOTE: Line breaks will be removed from these scripts before their execut...
93193282-48f4-4de4-8b81-3a53a4ad1cdc
{ "language": "C++" }
```c++ // Copyright (c) 2012 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/browser/renderer_host/render_widget_host_view.h" #include "base/logging.h" // static void RenderWidgetHostView::GetDefaultS...
```c++ // Copyright (c) 2012 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/browser/renderer_host/render_widget_host_view.h" #include "base/logging.h" // static void RenderWidgetHostViewBase::GetDefa...
d36c84e5-369b-48e3-bf04-880c71fb5829
{ "language": "C++" }
```c++ #include "stdafx.h" #include "ScriptLoader.h" #include <boost\filesystem.hpp> #include <sstream> namespace fs = boost::filesystem; using namespace fs; ScriptLoader::ScriptLoader(JsContextRef* context) { this->context = *context; } ScriptLoader::~ScriptLoader() { } void ScriptLoader::LoadScripts() { path ...
```c++ #include "stdafx.h" #include "ScriptLoader.h" #include <boost\filesystem.hpp> #include <sstream> namespace fs = boost::filesystem; using namespace fs; ScriptLoader::ScriptLoader(JsContextRef* context) { this->context = *context; } ScriptLoader::~ScriptLoader() { } void ScriptLoader::LoadScripts() { path ...
63ae4e8f-b4b3-4c56-9513-6406daecd530
{ "language": "C++" }
```c++ #include "greentea-client/greentea_serial.h" SingletonPtr<GreenteaSerial> greentea_serial; GreenteaSerial::GreenteaSerial() : mbed::RawSerial(USBTX, USBRX, MBED_CONF_PLATFORM_STDIO_BAUD_RATE) {}; ``` Enable flow control in Greentea
```c++ #include "greentea-client/greentea_serial.h" /** * Macros for setting console flow control. */ #define CONSOLE_FLOWCONTROL_RTS 1 #define CONSOLE_FLOWCONTROL_CTS 2 #define CONSOLE_FLOWCONTROL_RTSCTS 3 #define mbed_console_concat_(x) CONSOLE_FLOWCONTROL_##x #define mbed_console_concat(x) mbed_console_c...
3e7e90d0-c0e2-4a2c-81d1-dc9beadcd82b
{ "language": "C++" }
```c++ //===----------------------- cxa_bad_cast.pass.cpp ------------------------===// // // 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++ //===----------------------- cxa_bad_cast.pass.cpp ------------------------===// // // 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. // //===---------------------------------...
2670bf6c-6b27-4010-aa51-9fc862980d39
{ "language": "C++" }
```c++ #include "CacheJsonToArticleConverter.h" #include <json/json.h> #include "WalkerException.h" #include "Article.h" ArticleCollection& CacheJsonToArticleConverter::convertToArticle(std::string json, ArticleCollection& articleCache) { Json::Reader reader; Json::Value document; bool success = reader.p...
```c++ #include "CacheJsonToArticleConverter.h" #include <json/json.h> #include "WalkerException.h" #include "Article.h" ArticleCollection& CacheJsonToArticleConverter::convertToArticle(std::string json, ArticleCollection& articleCache) { Json::Reader reader; Json::Value document; bool success = reader.p...
1e5110b6-ed57-47d6-842f-56ecb44b7f49
{ "language": "C++" }
```c++ /* * Copyright (c) 2015 Daniel Kirchner * * 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...
```c++ /* * Copyright (c) 2015 Daniel Kirchner * * 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...
7c523f21-2d1f-4282-91a3-cfe1957e4949
{ "language": "C++" }
```c++ #include "TextureHolder.hpp" TextureHolder::TextureHolder() { } void TextureHolder::load(Textures id, const std::string &fileName) { std::unique_ptr<sf::Texture> texture(new sf::Texture); texture->loadFromFile(fileName); m_textureMap.insert(std::make_pair(id, std::move(texture))); } sf::Texture&...
```c++ #include "TextureHolder.hpp" TextureHolder::TextureHolder() { } void TextureHolder::load(Textures id, const std::string &fileName) { std::unique_ptr<sf::Texture> texture(new sf::Texture); if (!texture->loadFromFile(fileName)) { throw std::runtime_error("TextureHolder::load - Failed to load...
c77c32e5-6c6f-4126-93d6-afe6b73032d3
{ "language": "C++" }
```c++ /// // // LibSourcey // Copyright (c) 2005, Sourcey <https://sourcey.com> // // SPDX-License-Identifier: LGPL-2.1+ // /// @addtogroup base /// @{ #include "scy/pipe.h" using std::endl; namespace scy { Pipe::Pipe(uv::Loop* loop) : Stream(loop, new uv_pipe_t) { } Pipe::~Pipe() { } void Pipe::init(b...
```c++ /// // // LibSourcey // Copyright (c) 2005, Sourcey <https://sourcey.com> // // SPDX-License-Identifier: LGPL-2.1+ // /// @addtogroup base /// @{ #include "scy/pipe.h" using std::endl; namespace scy { Pipe::Pipe(uv::Loop* loop) : Stream(loop, new uv_pipe_t) { } Pipe::~Pipe() { } void Pipe::init(b...
d2bfe5f8-f4cc-4ec1-b341-bc38278875bc
{ "language": "C++" }
```c++ #include <gloperate/stages/ColorGradientPreparationStage.h> #include <gloperate/base/ColorGradientList.h> #include <gloperate/tools/ColorGradientPreparation.h> namespace gloperate { ColorGradientPreparationStage::ColorGradientPreparationStage() { addInput("gradients", gradients); addInput("pixmapSize"...
```c++ #include <gloperate/stages/ColorGradientPreparationStage.h> #include <gloperate/base/ColorGradientList.h> #include <gloperate/tools/ColorGradientPreparation.h> namespace gloperate { ColorGradientPreparationStage::ColorGradientPreparationStage() { addInput("gradients", gradients); addInput("pixmapSize"...
b36d2685-3624-45a1-826a-8150356b1aa9
{ "language": "C++" }
```c++ #include "network_config.hpp" #include <fstream> #include <string> namespace phosphor { namespace network { namespace bmc { void writeDHCPDefault(const std::string& filename, const std::string& interface) { std::ofstream filestream; filestream.open(filename); filest...
```c++ #include "network_config.hpp" #include <fstream> #include <string> namespace phosphor { namespace network { namespace bmc { void writeDHCPDefault(const std::string& filename, const std::string& interface) { std::ofstream filestream; filestream.open(filename); filest...
d1b433fc-6c46-442c-8645-fbf772847b34
{ "language": "C++" }
```c++ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2013 Mayank Madan <maddiemadan@gmail.com> // #include "KmlDurationTagHandler...
```c++ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2013 Mayank Madan <maddiemadan@gmail.com> // #include "KmlDurationTagHandler...
ba8795dc-9791-4adc-ba5b-83412136e47c
{ "language": "C++" }
```c++ #include "SkTypeface.h" // ===== Begin Chrome-specific definitions ===== uint32_t SkTypeface::UniqueID(const SkTypeface* face) { return NULL; } void SkTypeface::serialize(SkWStream* stream) const { } SkTypeface* SkTypeface::Deserialize(SkStream* stream) { return NULL; } // ===== End Chrome-specific de...
```c++ #include "SkTypeface.h" // ===== Begin Chrome-specific definitions ===== uint32_t SkTypeface::UniqueID(const SkTypeface* face) { return 0; } void SkTypeface::serialize(SkWStream* stream) const { } SkTypeface* SkTypeface::Deserialize(SkStream* stream) { return NULL; } // ===== End Chrome-specific defin...
ae470cb6-8a32-4fea-97f3-5c01a633deb8
{ "language": "C++" }
```c++ #include <qpiekey.h> #include <QSizePolicy> #include <QPainter> #include <QPaintEvent> QPieKey::QPieKey(QWidget *parent) : QWidget(parent) { bitmap = new QBitmap(40,40); QPainter painter(bitmap); bitmap->clear(); painter.drawEllipse(0, 0, 40, 40); setFixedSize(40, 40); setMask(*bitmap);...
```c++ #include <qpiekey.h> #include <QSizePolicy> #include <QPainter> #include <QPaintEvent> #define SIZE 60 QPieKey::QPieKey(QWidget *parent) : QWidget(parent) { bitmap = new QBitmap(SIZE*2,SIZE*2); QPainter painter(bitmap); setFixedSize(SIZE*2, SIZE*2); bitmap->clear(); painter.setBrush(Qt::c...
aed324fc-0683-493c-bea2-10b671566275
{ "language": "C++" }
```c++ #include <iostream> #include <gtest/gtest.h> int main(int argc, char* argv[]) try { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } catch (...) { std::cout << "Exception during testing. Exiting...\n"; return 1; } ``` Remove exception handler - this was not needed
```c++ #include <iostream> #include <gtest/gtest.h> int main(int argc, char* argv[]) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } ```
23d01040-21e4-40df-8a42-c49146ef39f2
{ "language": "C++" }
```c++ #include "models/bucket.h" #include "views/session_view.h" SessionView::SessionView(Session* session, QWidget* parent) : QWidget(parent), m_session(session) { m_hostFileSystem = new QFileSystemModel(this); m_hostFileSystem->setRootPath(QDir::rootPath()); m_hostBrowser = new QTreeView; m_hostBrowser->se...
```c++ #include "models/bucket.h" #include "views/session_view.h" SessionView::SessionView(Session* session, QWidget* parent) : QWidget(parent), m_session(session) { m_hostFileSystem = new QFileSystemModel(this); QString rootPath = m_hostFileSystem->myComputer().toString(); m_hostFileSystem->setRootPath(rootPat...
44542a71-6c1b-4f6e-bd1c-6cf052d9be7f
{ "language": "C++" }
```c++ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "transport_latch.h" #include <vespa/vespalib/util/stringfmt.h> using vespalib::make_string; using storage::spi::Result; namespace proton { TransportLatch::TransportLatch(uint32_t cn...
```c++ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "transport_latch.h" #include <vespa/vespalib/util/stringfmt.h> using vespalib::make_string; using storage::spi::Result; namespace proton { TransportLatch::TransportLatch(uint32_t cn...
d5ac3266-78a9-4ff9-8a14-3a26393bb4fa
{ "language": "C++" }
```c++ // Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon // We are making my contributions/submissions to this project solely in our // personal capacity and are not conveying any rights to any intellectual // property of any third parties. #include <Rosetta/Cards/Cards.hpp> #include <Rosetta/Enchants/E...
```c++ // Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon // We are making my contributions/submissions to this project solely in our // personal capacity and are not conveying any rights to any intellectual // property of any third parties. #include <Rosetta/Cards/Cards.hpp> #include <Rosetta/Enchants/E...
c2ca6799-ff26-4d2d-9128-da53d1d748a1
{ "language": "C++" }
```c++ #include "test_env.h" #if defined(TARGET_K64F) AnalogIn in(A0); AnalogOut out(A5); #elif defined(TARGET_KL25Z) AnalogIn in(PTC2); AnalogOut out(PTE30); #elif defined(TARGET_KL05Z) AnalogIn in(PTB11); // D9 AnalogOut out(PTB1); // D1 #elif defined(TARGET_KL46Z) AnalogIn in(PTB0); AnalogOut out(PTE30); #else...
```c++ #include "test_env.h" #if defined(TARGET_K64F) AnalogIn in(A0); AnalogOut out(DAC0_OUT); #elif defined(TARGET_KL25Z) AnalogIn in(PTC2); AnalogOut out(PTE30); #elif defined(TARGET_KL05Z) AnalogIn in(PTB11); // D9 AnalogOut out(PTB1); // D1 #elif defined(TARGET_KL46Z) AnalogIn in(PTB0); AnalogOut out(PTE30); ...
f8e70988-e76b-46c6-8cc1-fb666258c9b5
{ "language": "C++" }
```c++ #include <tgmath.h> typedef struct { float f; int i; } my_untagged_struct; double multiply(my_untagged_struct *s) { return s->f * s->i; } double multiply(my_untagged_struct *s, int x) { return multiply(s) * x; } int main(int argc, char **argv) { my_untagged_struct s = { .f = (floa...
```c++ #include <cmath> typedef struct { float f; int i; } my_untagged_struct; double multiply(my_untagged_struct *s) { return s->f * s->i; } double multiply(my_untagged_struct *s, int x) { return multiply(s) * x; } int main(int argc, char **argv) { my_untagged_struct s = { .f = (float)a...
89b68818-080d-4691-ad06-02143749709a
{ "language": "C++" }
```c++ // Copyright (C) 2015 Elviss Strazdins // This file is part of the Ouzel engine. #include "Camera.h" namespace ouzel { Camera::Camera() { } Camera::~Camera() { } void Camera::setZoom(float zoom) { _zoom = zoom; if (_zoom < 0.1f) ...
```c++ // Copyright (C) 2015 Elviss Strazdins // This file is part of the Ouzel engine. #include "Camera.h" namespace ouzel { Camera::Camera() { } Camera::~Camera() { } void Camera::setZoom(float zoom) { _zoom = zoom; if (_zoom < 0.1f) ...
d249a9d1-8db6-4bda-8132-837997516ff3
{ "language": "C++" }
```c++ #include "LanguageTranslator.h" #include "Logger.h" #include "StringUtils.h" LanguageTranslator::LanguageTranslator(std::wstring langFileName) { CLOG(L"Loading skin XML: %s", langFileName.c_str()); std::string u8FileName = StringUtils::Narrow(langFileName); tinyxml2::XMLError result = _xml.LoadFile...
```c++ #include "LanguageTranslator.h" #include "Logger.h" #include "StringUtils.h" LanguageTranslator::LanguageTranslator() { } LanguageTranslator::LanguageTranslator(std::wstring langFileName) { CLOG(L"Loading language XML: %s", langFileName.c_str()); std::string u8FileName = StringUtils::Narrow(langFileN...
7c7dfb69-5361-4597-8bde-e9ea930032cc
{ "language": "C++" }
```c++ #include <stdbool.h> bool is_triangle(const int side_a, const int side_b, const int side_c) { /* Get the triangular inequality state from length of the sides */ if(side_a + side_b > side_c && side_b + side_c > side_a && side_c + side_a > side_b) return true; /* This is a triangle */ return false; /*...
```c++ #include <stdbool.h> bool triangular_inequality(const int a, const int b, const int c) { if(a + b > c && b + c > a && c + a > b) return true; return false; } ```
1b4f963c-70a3-4427-8c5c-cf73f23c8479
{ "language": "C++" }
```c++ // RUN: clang-cc %s template <typename T> struct Num { T value_; public: Num(T value) : value_(value) {} T get() const { return value_; } template <typename U> struct Rep { U count_; Rep(U count) : count_(count) {} friend Num operator*(const Num &a, const Rep &n) { Num x = 0; ...
```c++ // RUN: clang-cc -emit-llvm-only %s template <typename T> struct Num { T value_; public: Num(T value) : value_(value) {} T get() const { return value_; } template <typename U> struct Rep { U count_; Rep(U count) : count_(count) {} friend Num operator*(const Num &a, const Rep &n) { N...
259fbea3-b442-4793-abf0-fac6e540142f
{ "language": "C++" }
```c++ // Copyright (c) 2012 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/extensions/api/system_info_cpu/cpu_info_provider.h" namespace extensions { bool CpuInfoProvider::QueryCpuTimePerProc...
```c++ // Copyright (c) 2012 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/extensions/api/system_info_cpu/cpu_info_provider.h" #include <cstdio> #include <iostream> #include "base/file_util.h...
f98e8d6d-689e-4a02-bf55-be29715ea394
{ "language": "C++" }
```c++ #include <iostream> #include <thread> void call_from_thread() { std::cout << "Hello, World" << std::endl; } int main() { //Launch a thread std::thread t[5]; for(int i = 0; i < 5; i++){ t[i] = std::thread(call_from_thread); } for(int i = 0; i < 5; i++){ t[i].join(); } ...
```c++ #include <thread> #include <iostream> #include <vector> void hello(){ std::cout << "Hello, world" << std::endl; } int main(){ std::vector<std::thread> threads; for(int i = 0; i < 5; ++i){ threads.push_back(std::thread(hello)); } for(auto& thread : threads){ thread.join(); ...
5f1ca157-fa0d-4d67-816a-ad4115744b04
{ "language": "C++" }
```c++ // Copyright 2021 The Pigweed 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 ...
```c++ // Copyright 2021 The Pigweed 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 ...
159ea874-58b2-4ec3-9625-5d7d1aa6c6a7
{ "language": "C++" }
```c++ #include <gtest/gtest.h> #include <teraranger_hub/teraranger_one.h> class HubParserTest : public ::testing::Test{ protected: uint8_t input_buffer[BUFFER_SIZE] = {0x54,0x48,0x08,0xa7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0b};//expected result is one 2.22 meter measurement }; ...
```c++ #include <gtest/gtest.h> #include <teraranger_hub/teraranger_one.h> #include <teraranger_hub/helper_lib.h> class HubParserTest : public ::testing::Test{ protected: uint8_t input_buffer[BUFFER_SIZE] = {0x54,0x48,0x08,0xa7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0b};//expected re...
8d3a8fd9-7c90-4fb7-9c1b-be4484a7705e
{ "language": "C++" }
```c++ #include "codearea.h" #include <algorithm> namespace openlocationcode { const double kLatitudeMaxDegrees = 90; const double kLongitudeMaxDegrees = 180; CodeArea::CodeArea(double latitude_lo, double longitude_lo, double latitude_hi, double longitude_hi, size_t code_length) { latitude_lo_ ...
```c++ #include "codearea.h" #include <algorithm> namespace openlocationcode { const double kLatitudeMaxDegrees = 90; const double kLongitudeMaxDegrees = 180; CodeArea::CodeArea(double latitude_lo, double longitude_lo, double latitude_hi, double longitude_hi, size_t code_length) { latitude_lo_ ...
afba97ea-7191-4f6f-943f-af265cbda55c
{ "language": "C++" }
```c++ #include <gmi_mesh.h> #include <gmi_null.h> #include <apfMDS.h> #include <apfMesh2.h> #include <apfConvert.h> #include <apf.h> #include <PCU.h> int main(int argc, char** argv) { assert(argc==3); MPI_Init(&argc,&argv); PCU_Comm_Init(); PCU_Protect(); gmi_register_mesh(); gmi_register_null(); int* c...
```c++ #include <gmi_mesh.h> #include <gmi_null.h> #include <apfMDS.h> #include <apfMesh2.h> #include <apfConvert.h> #include <apf.h> #include <PCU.h> int main(int argc, char** argv) { assert(argc==3); MPI_Init(&argc,&argv); PCU_Comm_Init(); PCU_Protect(); gmi_register_mesh(); gmi_register_null(); int* c...
4a55d3e7-7dce-4846-a618-a7bf36aead82
{ "language": "C++" }
```c++ // Copyright (c) 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 "base/test_file_util.h" #include "base/logging.h" namespace file_util { bool EvictFileFromSystemCache(const FilePath& file) { // ...
```c++ // Copyright (c) 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 "base/test_file_util.h" #include "base/logging.h" namespace file_util { bool EvictFileFromSystemCache(const FilePath& file) { // ...
7e683b52-52d1-4b62-8227-ca834b14d638
{ "language": "C++" }
```c++ #include <gtest/gtest.h> #include "../src/awg.hpp" #include "../src/pulseTrain.hpp" class AWGConstructors : public ::testing::Test { protected: }; class AWGAcessors : public ::testing::Test { protected: }; int main(int argc, char * argv[] ) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS...
```c++ #include <gtest/gtest.h> #include "../src/awg.hpp" #include "../src/pulseTrain.hpp" TEST(AwgClass, ComPort) { awg testAwg; EXPECT_EQ(std::string("COM1"),testAwg.comPort()); testAwg.comPort(2); EXPECT_EQ(std::string("COM2"),testAwg.comPort()); testAwg.comPort("com1"); EXPECT_EQ(std::string("com1"),tes...
754f6d8a-7044-438f-adef-d97ee8a1c917
{ "language": "C++" }
```c++ #include <unordered_map> #include <mutex> #include "../os.h" #include "test_lib.h" #include "../../../intercom-cpp/src/cominterop.h" #include "../../../intercom-cpp/src/activator.h" using intercom::Activator; void InitializeRuntime() { } void UninitializeRuntime() { } intercom::HRESULT CreateInstance( int...
```c++ #include <unordered_map> #include <mutex> #include "../os.h" #include "test_lib.h" #include "../../../intercom-cpp/src/cominterop.h" #include "../../../intercom-cpp/src/activator.h" using intercom::Activator; void InitializeRuntime() { } void UninitializeRuntime() { } intercom::HRESULT CreateInstance( int...
e5e442ef-485d-4442-b63b-8a30c52c6540
{ "language": "C++" }
```c++ //------------------------------------------------------------------------------ // rewriter.cpp // Simple tool that parses an input file and writes it back out; used // for verifying the round-trip nature of the parse tree. // // File is under the MIT license; see LICENSE for details //-------------------------...
```c++ //------------------------------------------------------------------------------ // rewriter.cpp // Simple tool that parses an input file and writes it back out; used // for verifying the round-trip nature of the parse tree. // // File is under the MIT license; see LICENSE for details //-------------------------...
c3d2eaf3-9966-426f-9486-0505e5a81a6c
{ "language": "C++" }
```c++ /* <one line to give the program's name and a brief idea of what it does.> Copyright (C) 2013 David Edmundson <D.Edmundson@lboro.ac.uk> This program 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...
```c++ /* <one line to give the program's name and a brief idea of what it does.> Copyright (C) 2013 David Edmundson <D.Edmundson@lboro.ac.uk> This program 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...
44a2e508-1ccd-477e-b433-bc13b068de75
{ "language": "C++" }
```c++ #define CATCH_CONFIG_MAIN #include "./catch.hpp" ``` Add cleanup to the entire database on test exit.
```c++ #define CATCH_CONFIG_RUNNER #include "./catch.hpp" #include "./ReQL.hpp" int main(int argc, char **argv) { int result = Catch::Session().run(argc, argv); ReQL::Connection conn; ReQL::wait({}) .funcall({ ReQL::func({ 1.0, ReQL::db({std::string("rethinkdb")}) .table({std::string("d...
c5b4e617-0cb4-463a-a621-82fa7e71152a
{ "language": "C++" }
```c++ #include "FortWrap.h" #include <algorithm> // For count #include <iostream> int main(void) { // Set up v = [1,2,3,4] std::vector<int> v(4); for (int i=0; i<v.size(); i++) v[i] = i+1; if (FortFuncs::array_in(&v) != 10) return 1; std::vector<int> v2(10); FortFuncs::array_out(&v,&v2); i...
```c++ #include "FortWrap.h" #include <algorithm> // For count #include <iostream> int main(void) { // Set up v = [1,2,3,4] std::vector<int> v(4); for (int i=0; i<v.size(); i++) v[i] = i+1; if (FortFuncs::array_in(&v) != 10) return 1; std::vector<int> v2(10); FortFuncs::array_out(&v,&v2); i...
16e9bc71-9c35-400a-8d8b-f2103ae5337f
{ "language": "C++" }
```c++ #include "MessageBuilder.hpp" #include "common/LinkParser.hpp" #include "singletons/Emotes.hpp" #include "singletons/Resources.hpp" #include "singletons/Theme.hpp" #include <QDateTime> namespace chatterino { MessageBuilder::MessageBuilder() : message(new Message) { } MessagePtr MessageBuilder::getMessag...
```c++ #include "MessageBuilder.hpp" #include "common/LinkParser.hpp" #include "singletons/Emotes.hpp" #include "singletons/Resources.hpp" #include "singletons/Theme.hpp" #include <QDateTime> namespace chatterino { MessageBuilder::MessageBuilder() : message(new Message) { } MessagePtr MessageBuilder::getMessag...
151c726f-aa37-4636-87f3-fa07babbfa4d
{ "language": "C++" }
```c++ #include "stdafx.h" #include <dukat/animationmanager.h> namespace dukat { Animation* AnimationManager::add(std::unique_ptr<Animation> animation) { auto anim = animation.get(); animations.push_back(std::move(animation)); if (!anim->is_running()) { anim->start(); } return anim; } void Animatio...
```c++ #include "stdafx.h" #include <dukat/animationmanager.h> namespace dukat { Animation* AnimationManager::add(std::unique_ptr<Animation> animation) { auto anim = animation.get(); animations.push_back(std::move(animation)); if (!anim->is_running()) { anim->start(); } return anim; } void Animatio...
477f2b88-ae86-4070-b49d-2ab548f9665e
{ "language": "C++" }
```c++ #include "game.h" #include "button.h" #include "screen.h" #include "led.h" #include "timer.h" #include "const.h" #include "logger.h" #include "helper.h" #include "controller.h" namespace game { namespace { const unsigned long GAME_TIME = 3000; unsigned long endTime; unsigned int buttons...
```c++ #include "game.h" #include "button.h" #include "screen.h" #include "led.h" #include "timer.h" #include "const.h" #include "logger.h" #include "helper.h" #include "controller.h" namespace game { namespace { const unsigned long GAME_TIME = 3000; unsigned long endTime; unsigned int buttons...
30ab30b0-21a7-4635-8604-08db80c6ffaa
{ "language": "C++" }
```c++ #include "YarpStateDirector.hpp" const int rd::YarpStateDirector::DEFAULT_RATE_MS = 100; rd::YarpStateDirector::YarpStateDirector(rd::State *state) : StateDirector(state), RateThread(DEFAULT_RATE_MS) { } bool rd::YarpStateDirector::Start() { RD_DEBUG("Starting StateDirector for id %s\n", state->getState...
```c++ #include "YarpStateDirector.hpp" const int rd::YarpStateDirector::DEFAULT_RATE_MS = 100; rd::YarpStateDirector::YarpStateDirector(rd::State *state) : StateDirector(state), RateThread(DEFAULT_RATE_MS) { } bool rd::YarpStateDirector::Start() { RD_DEBUG("Starting StateDirector for id %s\n", state->getState...
b302509f-5da8-4c15-9894-609e4bd59988
{ "language": "C++" }
```c++ /* */ #include <synext.hpp> #include "../parse/common.hpp" class CExpanderFile: public ExpandProcMacro { ::std::unique_ptr<TokenStream> expand(const Span& sp, const AST::Crate& crate, const ::std::string& ident, const TokenTree& tt, AST::Module& mod) override { return box$( TTStreamO(TokenT...
```c++ /* */ #include <synext.hpp> #include "../parse/common.hpp" class CExpanderFile: public ExpandProcMacro { ::std::unique_ptr<TokenStream> expand(const Span& sp, const AST::Crate& crate, const ::std::string& ident, const TokenTree& tt, AST::Module& mod) override { return box$( TTStreamO(TokenT...
b0e9f5cb-c58b-4179-b8d5-891a7364fdc1
{ "language": "C++" }
```c++ #include <cstddef> #include <string> // Emulates the standard std::string literal ("..."s) from C++14. Since 's' is // reserved by the standard, we have to use '_s' instead of 's'. std::string operator "" _s(const char *str, std::size_t length) { return std::string(str, length); } int main() { std::str...
```c++ #include <cstddef> #include <string> // Emulates the standard std::string literal ("..."s) from C++14. Since 's' is // reserved by the standard, we have to use '_s' instead of 's'. std::string operator "" _s(const char *str, std::size_t length) { return std::string(str, length); } int main() { std::str...
15aee235-9634-4419-a4c1-e50a2c2710c0
{ "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 "chrome/browser/in_process_webkit/webkit_thread.h" #include "testing/gtest/include/gtest/gtest.h" TEST(WebKitThreadTest, ExposedInChr...
```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 "chrome/browser/in_process_webkit/webkit_thread.h" #include "testing/gtest/include/gtest/gtest.h" TEST(WebKitThreadTest, DISABLED_Exp...
fcfe39d0-b695-444c-aee1-c8c4c766d881
{ "language": "C++" }
```c++ #include <stdlib.h> #include <cppfs/system.h> namespace cppfs { namespace system { std::string homeDir() { return std::string(getenv("HOME")); } std::string configDir(const std::string & application) { #if defined(SYSTEM_WINDOWS) return std::string(getenv("APPDATA")) + "\\" + application; #elif de...
```c++ #include <stdlib.h> #include <cppfs/system.h> namespace cppfs { namespace system { std::string homeDir() { #if defined(SYSTEM_WINDOWS) return std::string(getenv("HOMEPATH")); #else return std::string(getenv("HOME")); #endif } std::string configDir(const std::string & application) { #if defined(SYSTEM_WI...
2de80b62-4f46-4cea-917f-f05dd1d0d823
{ "language": "C++" }
```c++ #include "Queue.h" #include "gtest/gtest.h" /* The Queue data structure * Public interface: * enqueue() * dequeue() * size() * clear() * begin() * end() : one pass the last item * empty() */ class QueueTest : public testing::Test { protected: // SetUp() & TearDown() are virtual functions from testti...
```c++ #include "Queue.h" #include "gtest/gtest.h" /* The Queue data structure * Public interface: * enqueue() * dequeue() * size() * clear() * begin() * end() : one pass the last item * empty() */ class QueueTest : public testing::Test { protected: // SetUp() & TearDown() are virtual functions from testti...
df2a3a2b-0535-44ab-99e2-465292879260
{ "language": "C++" }
```c++ #include "configuration.hh" namespace vick { char QUIT_KEY = 0; int TAB_SIZE = 1; void (*PUSH_BACK_CHANGE)(contents&, std::shared_ptr<change>) = 0; std::string DELIMINATORS = ""; bool use_colors() {return true;} void init_conf() {} void add_listeners() {} void add_commands( std::map<std::string, ...
```c++ #include "configuration.hh" namespace vick { char QUIT_KEY = 0; int TAB_SIZE = 1; void (*PUSH_BACK_CHANGE)(contents&, std::shared_ptr<change>) = nullptr; std::string DELIMINATORS = ""; bool use_colors() {return true;} void init_conf() {} void add_listeners() {} void add_commands( std::map<std::string, ...
b958a5ae-021b-468a-9bf2-4741f6d9fd4a
{ "language": "C++" }
```c++ /* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required...
```c++ /* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required...
5ff4f500-932a-43a0-a170-1454d08a0bb7
{ "language": "C++" }
```c++ // // Copyright (c) 2012-2013 The ANGLE 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. // // ShaderExecutable9.cpp: Implements a D3D9-specific class to contain shader // executable implementation details. #include "l...
```c++ // // Copyright (c) 2012-2013 The ANGLE 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. // // ShaderExecutable9.cpp: Implements a D3D9-specific class to contain shader // executable implementation details. #include "l...
fbd56711-5111-4256-b840-d678049bd9d5
{ "language": "C++" }
```c++ #include "buffers.h" #include "strutil.h" #include "log.h" void processQueue(ByteQueue* queue, bool (*callback)(uint8_t*)) { uint8_t snapshot[QUEUE_MAX_LENGTH(uint8_t)]; queue_snapshot(queue, snapshot); if(callback == NULL) { debug("Callback is NULL (%p) -- unable to handle queue at %p\r\n",...
```c++ #include "buffers.h" #include "strutil.h" #include "log.h" void processQueue(ByteQueue* queue, bool (*callback)(uint8_t*)) { uint8_t snapshot[QUEUE_MAX_LENGTH(uint8_t)]; queue_snapshot(queue, snapshot); if(callback == NULL) { debug("Callback is NULL (%p) -- unable to handle queue at %p\r\n",...
1b99e547-30ea-4fe7-9be8-5f369ddb6132
{ "language": "C++" }
```c++ #include <optimisationProblem/benchmark/sphereFunction.hpp> #include <cmath> using std::sqrt; using std::pow; #include <armadillo> using arma::norm; namespace hop { SphereFunction::SphereFunction(const unsigned int &numberOfDimensions) : BenchmarkProblem(numberOfDimensions) { } double SphereFunction::...
```c++ #include <optimisationProblem/benchmark/sphereFunction.hpp> #include <cmath> using std::sqrt; using std::pow; #include <armadillo> using arma::norm; namespace hop { SphereFunction::SphereFunction(const unsigned int &numberOfDimensions) : BenchmarkProblem(numberOfDimensions) { } double SphereFunction::...
962921dc-10bd-4a31-b4f6-7f5e372941d4
{ "language": "C++" }
```c++ #include "stdafx.h" #include "CppUnitTest.h" #include "datastore.h" using Assert = Microsoft::VisualStudio::CppUnitTestFramework::Assert; using DataStore = You::DataStore::DataStore; namespace YouDataStoreTests { TEST_CLASS(DataStoreApiTest) { public: DataStore sut; TEST_METHOD(DataStore_Post_Basic_Test) {...
```c++ #include "stdafx.h" #include "CppUnitTest.h" #include "datastore.h" using Assert = Microsoft::VisualStudio::CppUnitTestFramework::Assert; using DataStore = You::DataStore::DataStore; namespace YouDataStoreTests { const std::wstring TASK_ID = L"id"; const std::wstring DESCRIPTION = L"desc"; const std::wstring...
e0469005-ac3f-40b9-a9b9-15fd063ee034
{ "language": "C++" }
```c++ // RUN: %clangxx_asan -O0 %s -Fe%t 2>&1 // 'cat' is used below to work around FileCheck buffering bug which makes this // test flaky. FIXME: file an issue. // RUN: not %run %t 2>&1 | cat | FileCheck %s --check-prefix=CHECK #include <windows.h> DWORD WINAPI thread_proc(void *context) { int subscript = -1; ...
```c++ // RUN: %clangxx_asan -O0 %s -Fe%t 2>&1 // 'cat' is used below to work around FileCheck buffering bug which makes this // test flaky. FIXME: file an issue. // RUN: not %run %t 2>&1 | cat | FileCheck %s #include <windows.h> DWORD WINAPI thread_proc(void *context) { int subscript = -1; volatile char stack_b...