doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
e64e2e85-027f-4237-a253-c890d7a48b4d
{ "language": "C++" }
```c++ /*************************************************************************** * @file The code is for the exercises in C++ Primmer 5th Edition * @author @Yue Wang @gupenghu * @date 29.11.2014 * @remark ***************************************************************************/ //! //! E...
```c++ /*************************************************************************** * @file The code is for the exercises in C++ Primmer 5th Edition * @author @Yue Wang @gupenghu * @date 29.11.2014 * @remark ***************************************************************************/ //! //! E...
964a37bb-67f7-4b30-8c26-ebea79f25017
{ "language": "C++" }
```c++ /* * Copyright 2016 - 2021 gary@drinkingtea.net * * 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://mozilla.org/MPL/2.0/. */ #include <nostalgia/core/core.hpp> #include "app.hpp"...
```c++ /* * Copyright 2016 - 2021 gary@drinkingtea.net * * 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://mozilla.org/MPL/2.0/. */ #include <nostalgia/core/core.hpp> #include "app.hpp"...
08f5da23-ce1d-45eb-ae9c-6942d4db5596
{ "language": "C++" }
```c++ #include <miopen/hipoc_kernel.hpp> #include <miopen/errors.hpp> #include <hip/hip_hcc.h> namespace miopen { void HIPOCKernelInvoke::run(void* args, std::size_t size) const { HipEventPtr start = nullptr; HipEventPtr stop = nullptr; void *config[] = { HIP_LAUNCH_PARAM_BUFFER_POINTER, args, ...
```c++ #include <miopen/hipoc_kernel.hpp> #include <miopen/errors.hpp> #include <hip/hip_hcc.h> namespace miopen { void HIPOCKernelInvoke::run(void* args, std::size_t size) const { HipEventPtr start = nullptr; HipEventPtr stop = nullptr; void *config[] = { HIP_LAUNCH_PARAM_BUFFER_POINTER, args, ...
b9d53f54-2314-479a-89c9-6ba34530fbb5
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -fsyntax-only -std=c++17 -pedantic -verify %s // RUN: %clang_cc1 -fsyntax-only -std=c++2a -Wc++17-compat-pedantic -verify %s struct A {}; int (A::*pa)() const&; int use_pa = (A().*pa)(); #if __cplusplus <= 201703L // expected-warning@-2 {{invoking a pointer to a 'const &' member function on...
```c++ // RUN: %clang_cc1 -fsyntax-only -std=c++17 -pedantic -verify %s // RUN: %clang_cc1 -fsyntax-only -std=c++2a -Wc++17-compat-pedantic -verify %s struct A {}; int (A::*pa)() const&; int use_pa = (A().*pa)(); #if __cplusplus <= 201703L // expected-warning@-2 {{invoking a pointer to a 'const &' member function on...
39b77ac8-c3ce-4708-adf5-d49e609dff37
{ "language": "C++" }
```c++ #include "../../valhalla/mjolnir/signbuilder.h" using namespace valhalla::baldr; namespace valhalla { namespace mjolnir { // Constructor with arguments SignBuilder::SignBuilder(const uint32_t idx, const Sign::Type& type, const uint32_t text_off...
```c++ #include "../../valhalla/mjolnir/signbuilder.h" using namespace valhalla::baldr; namespace valhalla { namespace mjolnir { // Constructor with arguments SignBuilder::SignBuilder(const uint32_t idx, const Sign::Type& type, const uint32_t text_off...
7699fad6-75e9-4e09-9a07-0851f7bb74c3
{ "language": "C++" }
```c++ // Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #include "Bitstrip.h" Bitstrip::Bitstrip(std::wstring bitmapName, int x, int y, int units) : Meter(bitmapName, x, y, units) { _rect.Height = _bitmap->GetHeight() / _units; } void Bitstrip::...
```c++ // Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #include "Bitstrip.h" Bitstrip::Bitstrip(std::wstring bitmapName, int x, int y, int units) : Meter(bitmapName, x, y, units) { _rect.Height = _bitmap->GetHeight() / _units; } void Bitstrip::...
94d533ae-45fa-4909-9681-e5ad20f997c6
{ "language": "C++" }
```c++ // RUN: %clang -flimit-debug-info -emit-llvm -g -S %s -o - | FileCheck %s // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A" // CHECK-NOT: DIFlagFwdDecl // CHECK-SAME: ){{$}} class A { public: int z; }; A *foo (A* x) { A *a = new A(*x); return a; } // CHECK: !DIComposi...
```c++ // RUN: %clang -flimit-debug-info -emit-llvm -g -S %s -o - | FileCheck %s // RUN: %clang -flimit-debug-info -emit-llvm -g -S %s -o - | FileCheck --check-prefix=CHECK-C %s // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A" // CHECK-NOT: DIFlagFwdDecl // CHECK-SAME: ){{$}} class...
6bb1fd31-db53-4b35-ae84-52bc8f353543
{ "language": "C++" }
```c++ // Copyright (c) 20109 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" #include "net/base/mock_host_resolver.h" // This test failed at times on the Vista d...
```c++ // Copyright (c) 20109 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" #include "net/base/mock_host_resolver.h" // EXTREMELY flaky, crashy, and bad. See ht...
2f4b8980-9473-4725-ac33-92a20b6cc221
{ "language": "C++" }
```c++ #include <pcl/point_types.h> #include <pcl/io/pcd_io.h> #include <pcl/kdtree/kdtree_flann.h> #include <pcl/surface/mls.h> int main (int argc, char** argv) { // Load input file into a PointCloud<T> with an appropriate type pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ> ()); /...
```c++ #include <pcl/point_types.h> #include <pcl/io/pcd_io.h> #include <pcl/kdtree/kdtree_flann.h> #include <pcl/surface/mls.h> int main (int argc, char** argv) { // Load input file into a PointCloud<T> with an appropriate type pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ> ()); /...
7826003b-8fc1-4443-85e7-2da45a6bf071
{ "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-CHROMIUM file. #include "browser/browser_main_parts.h" #include "browser/browser_context.h" #include "browser/web_ui_controller_factory.h" #include ...
```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-CHROMIUM file. #include "browser/browser_main_parts.h" #include "browser/browser_context.h" #include "browser/web_ui_controller_factory.h" #include ...
5a6c9432-aad5-4e21-8f81-642a1c73189b
{ "language": "C++" }
```c++ // Copyright (c) 2018 The PIVX developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <boost/test/unit_test.hpp> #include <tinyformat.h> #include <utilmoneystr.h> #include "masternode-budget.h" BOOST_AUT...
```c++ // Copyright (c) 2018 The PIVX developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "masternode-budget.h" #include "tinyformat.h" #include "utilmoneystr.h" #include <boost/test/unit_test.hpp> BOOST_AU...
319b1c1c-e999-4ea2-a4b2-12741d2a42df
{ "language": "C++" }
```c++ // // Created by Chris Richards on 27/04/2016. // #include <iomanip> #include <sstream> #include "DbfColumn.h" #include "DbfUtils.h" const int kDbfFieldDescriptorSize = 32; DbfColumn::DbfColumn(std::istream &stream, int index) : index_(index) { read(stream); } void DbfColumn::read(std::istream &s...
```c++ // // Created by Chris Richards on 27/04/2016. // #include <iomanip> #include <sstream> #include "DbfColumn.h" #include "DbfUtils.h" const int kDbfFieldDescriptorSize = 32; DbfColumn::DbfColumn(std::istream &stream, int index) : index_(index) { read(stream); } void DbfColumn::read(std::istream &s...
38462063-76ba-4373-b79a-a873beb9093d
{ "language": "C++" }
```c++ #include "myapplication.h" #include "eventdispatcher_libevent.h" #include "msghandler.h" int main(int argc, char** argv) { #if QT_VERSION < 0x050000 qInstallMsgHandler(messageHandler); #else qInstallMessageHandler(messageHandler); #endif #if QT_VERSION >= 0x050000 QCoreApplication::setEventDispatcher(new Ev...
```c++ #include "myapplication.h" #include "eventdispatcher_libevent.h" #include "msghandler.h" #include "qt4compat.h" int main(int argc, char** argv) { #if QT_VERSION < 0x050000 qInstallMsgHandler(messageHandler); #else qInstallMessageHandler(messageHandler); #endif #if QT_VERSION >= 0x050000 QCoreApplication::se...
a46eb73a-3f96-4878-9b18-b0dea302f162
{ "language": "C++" }
```c++ #include <QtQuick> #include <sailfishapp.h> #include <QScopedPointer> #include <QQuickView> #include <QQmlEngine> #include <QGuiApplication> #include "factor.h" int main(int argc, char *argv[]) { // For this example, wizard-generates single line code would be good enough, // but very soon it won't be ...
```c++ #include <QtQuick> #include <sailfishapp.h> #include <QScopedPointer> #include <QQuickView> #include <QQmlEngine> #include <QGuiApplication> #include "factor.h" void loadTranslations() { QString langCode = QLocale::system().name().mid(0, 2); const QString Prefix("sailfactor_"); if (QFile::exists(...
050b5307-368a-4841-b6aa-113d65123a13
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s struct S { virtual void final() final; virtual void override() override; virtual void n() new; }; ``` Add more parser tests for the override control keywords.
```c++ // RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s struct S { virtual void final() final; virtual void override() override; virtual void n() new; int i : 3 new; int j new; }; struct T { // virt-specifier-seq is only valid in member-declarators, and a function definition is not a member-declarato...
c862a216-aab8-4d02-a4a0-d8f7cc1e084b
{ "language": "C++" }
```c++ // Copyright (c) 2009-2010 Satoshi Nakamoto // 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 <util/validation.h> #include <consensus/validation.h> #include <...
```c++ // Copyright (c) 2009-2010 Satoshi Nakamoto // 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 <util/validation.h> #include <consensus/validation.h> #include <...
08da95cc-98e7-4003-b356-5dfa97bdde87
{ "language": "C++" }
```c++ //#include "InstructionParser.h" #include <string> #include <stdexcept> #include "gtest/gtest.h" class InstructionParser { public: class UnknownInstruction : public std::runtime_error { public: UnknownInstruction(const std::string& msg) : std::runtime_error{msg} {} }; void parseInstructions...
```c++ //#include "InstructionParser.h" #include <string> #include <stdexcept> #include "gtest/gtest.h" class InstructionParser { public: class UnknownInstruction : public std::runtime_error { public: UnknownInstruction(const std::string& msg) : std::runtime_error{msg} {} }; void parseInstructions...
50ce1bd6-b457-4c0f-b601-e71ee5c754fc
{ "language": "C++" }
```c++ #include "mainwindow.h" #include <QApplication> #include <QDialog> #include <QGridLayout> #include <QLayout> #include <QDebug> #include "application.h" int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName("JASP"); QCoreApplication::setOrganizationDomain("jasp-stats.org"); QCoreApplicati...
```c++ #include "mainwindow.h" #include <QApplication> #include <QDialog> #include <QGridLayout> #include <QLayout> #include <QDebug> #include "application.h" int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName("JASP"); QCoreApplication::setOrganizationDomain("jasp-stats.org"); QCoreApplicati...
2c964b3a-a003-46d0-a1c8-ae7284795ed6
{ "language": "C++" }
```c++ #include "bundle.h" #include "exec.h" int main(int argc, char *argv[]) { bool enable_assert = true; unsigned short debug_port = 0; run_from_bundle(argv[0], enable_assert, debug_port, argc, argv); return 0; } ``` Use GetModuleFileName on win32 to get exe name
```c++ #include "bundle.h" #include "exec.h" #ifdef _WIN32 #include <windows.h> #endif int main(int argc, char *argv[]) { bool enable_assert = true; unsigned short debug_port = 0; const char *exe = argv[0]; #ifdef _WIN32 char buf[MAX_PATH]; GetModuleFileName(NULL, buf, sizeof(buf)); ...
dcb697b1-99bc-4be0-8828-a46c87200aed
{ "language": "C++" }
```c++ #include <iostream> #include <yaml-cpp/yaml.h> int main() { YAML::Emitter out; out << "Hello, World!"; std::cout << "Here's the output YAML:\n" << out.c_str(); return 0; } ``` Change the test application to one that works.
```c++ #include <cassert> #include <yaml-cpp/yaml.h> int main() { YAML::Node node = YAML::Load("[1, 2, 3]"); assert(node.IsSequence()); return 0; } ```
2d2e2fe9-b1e8-421c-9979-956ba48b4eec
{ "language": "C++" }
```c++ //======================================================================= // Copyright Baptiste Wicht 2011. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) //==============================================...
```c++ //======================================================================= // Copyright Baptiste Wicht 2011. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) //==============================================...
2f3edf9b-60bf-4500-9dc9-0144a79de9e2
{ "language": "C++" }
```c++ #include <stdio.h> #include "../excercise04/make_random_data/make_random_data.hpp" #include "../excercise04/sort/quick.hpp" int main(void) { int k; printf("Enter k= "); scanf("%d", &k); { } return 0; } ``` Add body of solution of prob 3
```c++ #include <stdio.h> #include "../excercise04/make_random_data/make_random_data.hpp" #include "../excercise04/sort/quick.hpp" int get_index_smallest(const int k, int *data, const int start, const int end) { if(k < 0 || k > end) return -1; /* Base case */ int p = partition(data, start, end); if(k == ...
9d62679f-c28f-4c39-a9f0-28be61cc9b52
{ "language": "C++" }
```c++ #include "ext_mongo.h" namespace HPHP { // PHP Exceptions and Classes HPHP::Class* MongoException::cls = nullptr; HPHP::Class* MongoConnectionException::cls = nullptr; HPHP::Class* MongoCursorTimeoutException::cls = nullptr; HPHP::Class* MongoDuplicateKeyException::cls = nullptr; HPHP::Class* MongoExecutionTim...
```c++ #include "ext_mongo.h" namespace HPHP { // PHP Exceptions and Classes HPHP::Class* MongoException::cls = nullptr; HPHP::Class* MongoConnectionException::cls = nullptr; HPHP::Class* MongoCursorException::cls = nullptr; HPHP::Class* MongoCursorTimeoutException::cls = nullptr; HPHP::Class* MongoDuplicateKeyExcept...
7c911ef2-d847-4192-9b20-86f31a6bfc46
{ "language": "C++" }
```c++ #include <stdio.h> int main(void) { return 0; } ``` Add a body of prob 6
```c++ #include <stdio.h> #define MAX_LOOP 10000 double formula(const double x, const double k) { return (x * x) / ((2 * k - 1) * (2 * k)); } int main(void) { double x; printf("Enter x= "); scanf("%lf", &x); double cosx = 1, sinx = x; int k = 2; while(k < MAX_LOOP) { ...
9154852f-e1cf-4f25-993a-d5f2c1f6f969
{ "language": "C++" }
```c++ #include <type/class.hh> namespace type { Class::Class(const std::string& name) : name_(name) {} Class::~Class() {} const std::string& Class::name_get() const { return name_; } ast::Ast* Class::component_get(const std::string& name) { return content...
```c++ #include <type/class.hh> namespace type { Class::Class(const std::string& name) : name_(name) {} Class::~Class() {} const std::string& Class::name_get() const { return name_; } ast::Ast* Class::component_get(const std::string& name) { return content...
b009350d-780e-442d-b5cb-7059817e98c3
{ "language": "C++" }
```c++ #include "parserPrivate.h" complexType getNumber(std::string string, bool negative, bool &a) { complexType complex; char haveI = 0; size_t size = string.size(); double value; if(string.at(0) == 'i') { haveI++; string.erase(0, 1); size--; } if(string.at(size-1) == 'i') { haveI++; string.era...
```c++ #include "parserPrivate.h" complexType getNumber(std::string string, bool negative, bool &a) { complexType complex; size_t size = string.size(); double value; char haveI = 0; bool isComplex; if(string.at(0) == 'i') { haveI++; string.erase(0, 1); size--; } if(string.at(size-1) == 'i') { haveI...
fb3e49e7-af25-4b6f-b186-2e9259988764
{ "language": "C++" }
```c++ #include <iostream> #include <gtest/gtest.h> TEST(sizeof, test1) { char str1[10]; char str2[] = "Hello World!"; EXPECT_EQ(10, sizeof(str1)); EXPECT_EQ(13, sizeof(str2)); } TEST(memcpy, test1) { int a[] = {1, 2, 3}; int b[3]; memcpy(b, a, sizeof(int) * 3); EXPECT_EQ(1, b[...
```c++ #include <iostream> #include <gtest/gtest.h> TEST(sizeof, test1) { char str1[10]; char str2[] = "Hello World!"; EXPECT_EQ(10, sizeof(str1)); EXPECT_EQ(13, sizeof(str2)); } TEST(memcpy, test1) { int a[] = {1, 2, 3}; int b[3]; memcpy(b, a, sizeof(int) * 3); EXPECT_EQ(1, b[...
1c2293e3-fb05-42c7-a45f-5f1f61356430
{ "language": "C++" }
```c++ // #include <stdio.h> int main() { int n; scanf("%d", &n); int *A = new int[n]; for (int i = 0; i < n; ++i) { scanf("%d", &A[i]); } int sum = 0; int i = 0; L0: if (A[i] % 2 == 0) { left0: sum += A[i]; } else { right0: sum -= A[i]; } printf("%d", sum); if (A[i] % 2 == 0)...
```c++ // Let's call this CFG the 'butterfly'. // It looks like this: // // A // ,. / \,-, // | B1 B2 | // | \ / | // | C | // | / \ | // | D1 D2 | // `-`\ /`-` // E // // Where the edges between B1-D1 and B2-D2 are actually 'back-edges' which is to // say the direction is from D1 to B1 and from D2 to B...
ab274351-0c54-472e-8744-d1866a423e19
{ "language": "C++" }
```c++ #include <map> int main() { typedef std::map<int, int> ContainerType; typedef std::pair<bool, ContainerType::iterator> EmplaceReturnType; ContainerType m; // pair move constructor EmplaceReturnType aResult = m.emplace(std::make_pair(int(1), int(2))); bool aValid = (aResult.first) && ((*(aResult.se...
```c++ #include <map> #include <iostream> int main() { typedef std::map<int, int> ContainerType; typedef std::pair<ContainerType::iterator, bool> EmplaceReturnType; ContainerType m; // pair move constructor EmplaceReturnType aResult = m.emplace(std::make_pair(int(1), int(2))); bool aValid = (aResult.seco...
02759a2c-dee8-4872-90e5-dd011da0ed6e
{ "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/sync/glue/chrome_report_unrecoverable_error.h" #include "base/rand_util.h" #include "build/build_config.h" #if defin...
```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/sync/glue/chrome_report_unrecoverable_error.h" #include "base/rand_util.h" #include "build/build_config.h" #if defin...
a981c52e-4dbe-44b1-9887-d6705de13b15
{ "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/sync/glue/chrome_report_unrecoverable_error.h" #include "base/rand_util.h" #include "build/build_config.h" #if defin...
```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/sync/glue/chrome_report_unrecoverable_error.h" #include "base/rand_util.h" #include "build/build_config.h" #if defin...
8d3c7069-7029-40f7-84e8-670d4fee5a79
{ "language": "C++" }
```c++ #ifndef _WIN32 #include <specs/specs.h> go_bandit([]() { describe("colorizer: ", [&]() { describe("colors enabled", [&]() { bandit::detail::colorizer colorizer; it("can set color to green", [&]() { AssertThat(colorizer.green(), Equals("\033[1;32m")); }); it("set color to ...
```c++ #include <specs/specs.h> go_bandit([]() { describe("colorizer: ", [&]() { #if !defined(_WIN32) || defined(BANDIT_CONFIG_COLOR_ANSI) describe("colors enabled", [&]() { bandit::detail::colorizer colorizer; it("can set color to green", [&]() { AssertThat(colorizer.green(), Equals("\033[1...
482294a5-becb-4fec-863b-6861e550ca24
{ "language": "C++" }
```c++ #include <common/buffer.h> #include <event/action.h> #include <event/callback.h> #include <event/event_system.h> #include <io/pipe.h> #include <xcodec/xcodec.h> #include <xcodec/xcodec_encoder.h> #include <xcodec/xcodec_encoder_pipe.h> XCodecEncoderPipe::XCodecEncoderPipe(XCodec *codec) : PipeSimple("/xcodec...
```c++ #include <common/buffer.h> #include <event/action.h> #include <event/callback.h> #include <event/event_system.h> #include <io/pipe.h> #include <xcodec/xcodec.h> #include <xcodec/xcodec_encoder.h> #include <xcodec/xcodec_encoder_pipe.h> XCodecEncoderPipe::XCodecEncoderPipe(XCodec *codec) : PipeSimple("/xcodec...
c7c76ff2-3f52-4481-ae77-1f4636330f28
{ "language": "C++" }
```c++ #include <chrono> #include <iostream> #include <thread> #include "AHRS.h" #include "WPILib.h" /* * This program is used to measure the frequency of NavX errors. * * It prints a stream of millisecond timestamps corresponding to the last good * sensor read. Any errors noted by the NavX library are printed to...
```c++ #include <chrono> #include <iostream> #include <thread> #include "AHRS.h" #include "WPILib.h" /* * This program is used to measure the frequency of NavX errors. * * It prints a stream of millisecond timestamps corresponding to the last good * sensor read. Any errors noted by the NavX library are printed to...
d3b1a9de-fd7f-45b2-a5b6-bc73e2640c39
{ "language": "C++" }
```c++ #include "views.h" using namespace std; namespace rviews { void login(JsonValue * message, ServerHandler * handler) { JsonDict * dictMessage = JDICT(message); if (dictMessage == NULL) { throw BadRequest("Malformatted request. Need a JSON dict"); } bool success = getBool(dictMessage, ...
```c++ #include "views.h" using namespace std; namespace rviews { void login(JsonValue * message, ServerHandler * handler) { JsonDict * dictMessage = JDICT(message); if (dictMessage == NULL) { throw BadRequest("Malformatted request. Need a JSON dict"); } bool success = getBool(dictMessage, ...
7e7d8236-8401-45c6-b361-3b77635bc7a5
{ "language": "C++" }
```c++ // RUN: %clang_cc1 %s -triple i386-pc-windows-msvc19.0.0 -emit-obj \ // RUN: -debug-info-kind=line-tables-only -fms-extensions class __declspec(dllexport) A { A(int * = new int) {} }; // CHECK: define {{.*}}void @"\01??_FA@@AAEXXZ" // CHECK-SAME: !dbg ![[SP:[0-9]+]] // CHECK-NOT: {{ret }} // CHECK: call x8...
```c++ // RUN: %clang_cc1 %s -triple i386-pc-windows-msvc19.0.0 -emit-llvm \ // RUN: -debug-info-kind=line-tables-only -fms-extensions -o - | FileCheck %s class __declspec(dllexport) A { A(int * = new int) {} }; // CHECK: define {{.*}}void @"\01??_FA@@AAEXXZ" // CHECK-SAME: !dbg ![[SP:[0-9]+]] // CHECK-NOT: {{ret...
d0307c04-072d-4ef7-ab01-5188273e415d
{ "language": "C++" }
```c++ // RUN: rm -rf %t // RUN: %clang -Wunused-local-typedef -c -x objective-c++ -fcxx-modules -fmodules -fmodules-cache-path=%t -I %S/Inputs %s 2>&1 | FileCheck %s -check-prefix=CHECK_1 // RUN: %clang -Wunused-local-typedef -c -x objective-c++ -fcxx-modules -fmodules -fmodules-cache-path=%t -I %S/Inputs %s 2>&1 | Fi...
```c++ // RUN: rm -rf %t // RUN: %clang -Wunused-local-typedef -c -x objective-c++ -fcxx-modules -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -o /dev/null 2>&1 | FileCheck %s -check-prefix=CHECK_1 // RUN: %clang -Wunused-local-typedef -c -x objective-c++ -fcxx-modules -fmodules -fmodules-cache-path=%t -I %S/Inputs...
6f5dfda0-a486-4db3-91f8-4eb0ebba8192
{ "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. // //===---------------------------------...
a0e4d59e-7ae8-4675-bcdf-bb72e01f8131
{ "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 "config.h" #include "webkit/extensions/v8/playback_extension.h" namespace extensions_v8 { const char* kPlaybackExtensionName = ...
```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 "config.h" #include "webkit/extensions/v8/playback_extension.h" namespace extensions_v8 { const char* kPlaybackExtensionName = ...
bc191a8d-e921-411e-bc3d-fc5b14053373
{ "language": "C++" }
```c++ #include "ics3/parameter.hpp" ics::Parameter ics::Parameter::stretch() noexcept { static const Parameter STRETCH(0x01, 1, 127); return STRETCH; } ics::Parameter ics::Parameter::speed() noexcept { static const Parameter SPEED(0x02, 1, 127); return SPEED; } ics::Parameter ics::Parameter::current() noexc...
```c++ #include "ics3/parameter.hpp" ics::Parameter ics::Parameter::stretch() noexcept { static const Parameter STRETCH(0x01, 1, 127); return STRETCH; } ics::Parameter ics::Parameter::speed() noexcept { static const Parameter SPEED(0x02, 1, 127); return SPEED; } ics::Parameter ics::Parameter::current() noexc...
19fe90d0-34c0-47d0-a6f0-332bc43c0992
{ "language": "C++" }
```c++ #include <stdio.h> #include <time.h> #include <stdlib.h> #include <deque> #define MEM_SIZE (1<<20) #define CACHE_SIZE (1<<8) #define DATA_SIZE (1<<8) using namespace std; int main() { // Variables used int dir, cmd, op; unsigned char dat, wait; // Plant the seed srand(time(0)); // Infinit Loop while...
```c++ #include <stdio.h> #include <time.h> #include <stdlib.h> #include <bitset> #include <deque> #define MEM_SIZE (1<<20) #define CACHE_SIZE (1<<8) using namespace std; enum{ read, write }; int main() { // Variables used int dir, cmd, op; unsigned char dat, wait; // Memory simulated unsigned char rawMemor...
b5ca9e42-8fac-48e4-92c2-0a8c35bad2b2
{ "language": "C++" }
```c++ // RUN: cat %s > %t.cpp // RUN: clang-rename -offset=170 -new-name=hector %t.cpp -i -- // RUN: sed 's,//.*,,' %t.cpp | FileCheck %s // REQUIRES: shell namespace A { int foo; // CHECK: int hector; } int foo; // CHECK: int foo; int bar = foo; // CHECK: bar = foo; int baz = A::foo; // CHECK: baz = A::hector; void...
```c++ namespace A { int foo; // CHECK: int hector; } // RUN: cat %s > %t.cpp // RUN: clang-rename -offset=18 -new-name=hector %t.cpp -i -- // RUN: sed 's,//.*,,' %t.cpp | FileCheck %s int foo; // CHECK: int foo; int bar = foo; // CHECK: bar = foo; int baz = A::foo; // CHECK: baz = A::hector; void fun1() { struct {...
d7a9ffe9-8a69-4a89-adf5-81a5431047a0
{ "language": "C++" }
```c++ //===-- SparcMCAsmInfo.cpp - Sparc asm properties -------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- SparcMCAsmInfo.cpp - Sparc asm properties -------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
ccb2aaa2-fbca-4512-9e67-892d66dc7b0d
{ "language": "C++" }
```c++ #include <gtest/gtest.h> #include <Eigen/Core> #include <Eigen/Geometry> #include "Integrator.h" #include "StateVector.h" TEST(StateTest, Instantiation) { using MyStateVector = UKF::StateVector< IntegratorRK4, UKF::Field<1, Eigen::Vector2f>, UKF::Field<2, Eigen::Vector3f>, UK...
```c++ #include <gtest/gtest.h> #include <Eigen/Core> #include <Eigen/Geometry> #include "Integrator.h" #include "StateVector.h" TEST(StateTest, Instantiation) { enum MyFields { LatLon, Altitude, Velocity, Attitude }; using MyStateVector = UKF::StateVector< IntegratorRK4, UKF::Field<LatL...
07478462-a523-4c08-9ac1-24d52a7c5699
{ "language": "C++" }
```c++ #include "DSTemperature.h" DSTemperature::DSTemperature(byte pin) { _wire = new OneWire(pin); _addresses = (DSAddress*)malloc(sizeof(DSAddress)); } void DSTemperature::begin(void) { DSAddress addr; while (_wire->search(addr.value)) { if (OneWire::crc8(addr.value, 7) == addr.value[7]) { res...
```c++ #include "DSTemperature.h" DSTemperature::DSTemperature(byte pin) { _wire = new OneWire(pin); _addresses = (DSAddress*)malloc(sizeof(DSAddress)); } void DSTemperature::begin(void) { DSAddress addr; while (_wire->search(addr.value)) { if (OneWire::crc8(addr.value, 7) == addr.value[7]) { if ...
3f4aac3d-3a55-4249-a257-83fa916b1aa8
{ "language": "C++" }
```c++ /* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "GrGLConfig.h" #include "GrGLInterface.h" void GrGLClearErr(const GrGLInterface* gl) { while (GR_GL_NO_ERROR != gl->fGetError()) {} } void GrGLCheckErr...
```c++ /* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "GrGLConfig.h" #include "GrGLInterface.h" void GrGLClearErr(const GrGLInterface* gl) { while (GR_GL_NO_ERROR != gl->fGetError()) {} } void GrGLCheckErr...
37934759-0f52-4618-b8e8-693b5e19b7a4
{ "language": "C++" }
```c++ #include <iostream> #include <vector> #include <adios2.h> #ifdef ADIOS2_HAVE_MPI #include <mpi.h> #endif int main(int argc, char *argv[]) { int rank = 0; int size = 1; #ifdef ADIOS2_HAVE_MPI MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); ...
```c++ #include <iostream> #include <vector> #include <adios2.h> #ifdef ADIOS2_HAVE_MPI #include <mpi.h> #endif int main(int argc, char *argv[]) { int rank = 0; #ifdef ADIOS2_HAVE_MPI int size = 1; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); ...
95499e16-109f-4559-914d-265d3400b406
{ "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/sync/glue/chrome_report_unrecoverable_error.h" #include "base/rand_util.h" #include "build/build_config.h" #if defin...
```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/sync/glue/chrome_report_unrecoverable_error.h" #include "base/rand_util.h" #include "chrome/common/chrome_constants.h...
75805c54-b9cf-4dcd-b272-63e5b35ac9ea
{ "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/native_library.h" #include <dlfcn.h> #include "base/file_path.h" #include "base/logging.h" namespace base { // static Native...
```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/native_library.h" #include <dlfcn.h> #include "base/file_path.h" #include "base/logging.h" namespace base { // static Native...
f7946792-badf-4c04-b385-d96fbd08f6db
{ "language": "C++" }
```c++ #include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } ``` Set local to C. Maybe not the best longterm solution.
```c++ #include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); std::locale::global( std::locale( "C" ) ); MainWindow w; w.show(); return a.exec(); } ```
b0c16b78-df32-4a54-b888-5b7bad4eda2b
{ "language": "C++" }
```c++ #include "ui.hpp" #include "window.hpp" namespace rack { Tooltip::Tooltip() { } void Tooltip::draw(NVGcontext *vg) { // Wrap size to contents box.size.x = bndLabelWidth(vg, -1, text.c_str()); box.size.y = bndLabelHeight(vg, -1, text.c_str(), INFINITY); bndTooltipBackground(vg, 0.0, 0.0, box.size.x, box...
```c++ #include "ui.hpp" #include "window.hpp" namespace rack { Tooltip::Tooltip() { } void Tooltip::draw(NVGcontext *vg) { // Wrap size to contents box.size.x = bndLabelWidth(vg, -1, text.c_str()) + 10.0; box.size.y = bndLabelHeight(vg, -1, text.c_str(), INFINITY); bndTooltipBackground(vg, 0.0, 0.0, box.size...
d9428b7f-9aa2-4bcf-83ff-ceacbc0c6fcc
{ "language": "C++" }
```c++ #include "zcash/JoinSplit.hpp" #include <iostream> int main(int argc, char **argv) { if(argc != 3) { std::cerr << "Usage: " << argv[0] << " provingKeyFileName verificationKeyFileName" << std::endl; return 1; } std::string pkFile = argv[1]; std::string vkFile = argv[2]; aut...
```c++ #include "zcash/JoinSplit.hpp" #include <iostream> #include "sodium.h" int main(int argc, char **argv) { if (sodium_init() == -1) { return 1; } if(argc != 3) { std::cerr << "Usage: " << argv[0] << " provingKeyFileName verificationKeyFileName" << std::endl; return 1; } ...
0f274b48-b71a-4da8-9cc1-3a4031159182
{ "language": "C++" }
```c++ #include "visionnage.h" #include "mainwindow.h" #include <QDebug> #include <QException> Visionnage::Visionnage(MainWindow *parent, Projet *projet, int nPreviousImage) : QThread(parent), _parent(parent), _projet(projet), _nPreviousImage(nPreviousImage), _initFrame(parent->getNbFrame()), ...
```c++ #include "visionnage.h" #include "mainwindow.h" #include <QDebug> #include <QException> Visionnage::Visionnage(MainWindow *parent, Projet *projet, int nPreviousImage) : QThread(parent), _parent(parent), _projet(projet), _nPreviousImage(nPreviousImage), _initFrame(parent->getNbFrame()), ...
9249ef72-51a6-4341-9436-d32e22a81f2f
{ "language": "C++" }
```c++ // Copyright 2015 Matt Heard // http://mattheard.net // matt@mattheard.net // @mattheard #include <opencv2/opencv.hpp> #include <iostream> #include <string> using cv::Mat; Mat buildLookUpTable(const int divideWith) { return Mat(); } int main(int argc, char **argv) { using std::string; const int e...
```c++ // Copyright 2015 Matt Heard // http://mattheard.net // matt@mattheard.net // @mattheard #include <opencv2/opencv.hpp> #include <iostream> #include <string> using cv::Mat; Mat buildLookUpTable(const int divideWith) { const int rows = 1; const int cols = 256; const int type = CV_8U; const Mat t...
f854c13c-0c6c-4cd1-a1fe-52a6505aec79
{ "language": "C++" }
```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 "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" #include "chrome/browser/ui/touch/frame/touch_browser_frame_view.h" #...
```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 "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" #include "base/command_line.h" #include "chrome/browser/ui/panels/pan...
62583710-ae08-4004-b650-f0a96c3df049
{ "language": "C++" }
```c++ // RUN: not %clang_cc1 -triple i686-pc-win32 -emit-llvm -fno-rtti %s 2>&1 | FileCheck %s // CHECK: error: v-table layout for classes with non-virtual base classes that override methods in virtual bases is not supported yet struct A { virtual int foo() { return a; } int a; }; struct B : virtual A { B() : ...
```c++ // RUN: not %clang_cc1 -triple i686-pc-win32 -emit-llvm-only -fno-rtti %s 2>&1 | FileCheck %s // CHECK: error: v-table layout for classes with non-virtual base classes that override methods in virtual bases is not supported yet struct A { virtual int foo() { return a; } int a; }; struct B : virtual A { B...
7d15d3a9-4375-4a99-a0c5-28a56cdfd16a
{ "language": "C++" }
```c++ #include "nucleus/Config.h" #include "nucleus/Files/FilePath.h" #if OS(POSIX) #include <unistd.h> #endif namespace nu { #if OS(POSIX) FilePath getCurrentWorkingDirectory(Allocator* allocator) { char buf[PATH_MAX] = {0}; const char* result = ::getcwd(buf, PATH_MAX); return FilePath{String{result, String...
```c++ #include "nucleus/Config.h" #include "nucleus/Files/FilePath.h" #if OS(POSIX) #include <unistd.h> #elif OS(WIN) #include "nucleus/Win/WindowsMixin.h" #endif namespace nu { FilePath getCurrentWorkingDirectory(Allocator* allocator) { #if OS(POSIX) char buf[PATH_MAX] = {0}; const char* result = ::getcwd(buf...
693d9047-fa8c-4dbb-a0f5-a24cc899acd8
{ "language": "C++" }
```c++ #include "Bootstrapper.hpp" #include <functional> #include <lua-cxx/LuaValue.hpp> #include <lua-cxx/loaders.hpp> #include <lua-cxx/userdata.hpp> #include "LuaPainter.hpp" #include "LuaFont.hpp" Bootstrapper::Bootstrapper() : _lua(), _desktop(_lua), _rainback(_lua) { _rainback.setWidget(&_desk...
```c++ #include "Bootstrapper.hpp" #include <functional> #include <lua-cxx/LuaValue.hpp> #include <lua-cxx/loaders.hpp> #include <lua-cxx/userdata.hpp> #include "LuaPainter.hpp" #include "LuaFont.hpp" Bootstrapper::Bootstrapper() : _lua(), _desktop(_lua), _rainback(_lua) { _rainback.setWidget(&_desk...
45d2d7ec-b3a6-4d1e-af24-634409688c96
{ "language": "C++" }
```c++ #include <QApplication> #include <QQmlApplicationEngine> #include <QQmlContext> #include <stdlib.h> #include <QtGlobal> #include <QtWidgets> #include <QtSingleApplication> int main(int argc, char *argv[]) { QtSingleApplication app(argc, argv); if (app.isRunning()) { return 0; } QQmlAppli...
```c++ #include <QApplication> #include <QQmlApplicationEngine> #include <QQmlContext> #include <stdlib.h> #include <QtGlobal> #include <QtWidgets> #include <QtSingleApplication> int main(int argc, char *argv[]) { // Only allow a single instance running. QtSingleApplication app(argc, argv); if (app.sendMes...
70283f4b-1de0-4fe9-aa71-1095b5258d3b
{ "language": "C++" }
```c++ #include "math_container.h" using std::complex; /******************************************************/ /*solve the equation cosh(x)=exp(y), input y, return x*/ /******************************************************/ complex<double> coshx_eq_expy(double y) { complex<double> ey={exp(y),0}; complex<dou...
```c++ #include "math_container.h" using namespace std; /******************************************************/ /*solve the equation cosh(x)=exp(y), input y, return x*/ /******************************************************/ complex<double> coshx_eq_expy(double y) { complex<double> ey={exp(y),0}; complex<do...
53f20314-d35b-4443-a980-5c662e3d7d84
{ "language": "C++" }
```c++ #ifdef __unix__ #include <iostream> #include <signal.h> #include <stdio.h> #include <unistd.h> #include "Tools.h" void StartBotProcess(const std::string& CommandLine) { FILE* pipe = popen(CommandLine.c_str(), "r"); if (!pipe) { std::cerr << "Can't launch command '" << CommandLi...
```c++ #ifdef __unix__ #include <iostream> #include <signal.h> #include <stdio.h> #include <unistd.h> #include "Tools.h" void StartBotProcess(const std::string& CommandLine) { FILE* pipe = popen(CommandLine.c_str(), "r"); if (!pipe) { std::cerr << "Can't launch command '" << CommandLi...
6264954e-b50e-4143-b332-6c2582473aea
{ "language": "C++" }
```c++ /* This file is part of VoltDB. * Copyright (C) 2008-2015 VoltDB Inc. * * 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 ri...
```c++ /* This file is part of VoltDB. * Copyright (C) 2008-2015 VoltDB Inc. * * 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 ri...
21fa43b9-69b7-4861-b502-307cb0d5f477
{ "language": "C++" }
```c++ // Copyright (c) 20109 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" #include "net/base/mock_host_resolver.h" // This test failed at times on the Vista d...
```c++ // Copyright (c) 20109 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" #include "net/base/mock_host_resolver.h" // EXTREMELY flaky, crashy, and bad. See ht...
ecbe4696-bc4c-483c-823a-2ceea39b3505
{ "language": "C++" }
```c++ /* * INTEL CONFIDENTIAL * Copyright © 2011 Intel * Corporation All Rights Reserved. * * The source code contained or described herein and all documents related to * the source code ("Material") are owned by Intel Corporation or its suppliers * or licensors. Title to the Material remains with Intel Corpora...
```c++ /* * INTEL CONFIDENTIAL * Copyright © 2011 Intel * Corporation All Rights Reserved. * * The source code contained or described herein and all documents related to * the source code ("Material") are owned by Intel Corporation or its suppliers * or licensors. Title to the Material remains with Intel Corpora...
5d5ba9c7-526d-488c-99b3-e91dc13d7555
{ "language": "C++" }
```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 "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" #include "chrome/browser/ui/touch/frame/touch_browser_frame_view.h" #...
```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 "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" #include "chrome/browser/ui/touch/frame/touch_browser_frame_view.h" #...
607689bd-aaa0-4b5b-9914-4c044e3d70a4
{ "language": "C++" }
```c++ /** * @file lrsdp.cpp * @author Ryan Curtin * * An implementation of Monteiro and Burer's formulation of low-rank * semidefinite programs (LR-SDP). */ #include "lrsdp.hpp" using namespace mlpack; using namespace mlpack::optimization; using namespace std; LRSDP::LRSDP(const size_t numSparseConstraints, ...
```c++ /** * @file lrsdp.cpp * @author Ryan Curtin * * An implementation of Monteiro and Burer's formulation of low-rank * semidefinite programs (LR-SDP). */ #include "lrsdp.hpp" using namespace mlpack; using namespace mlpack::optimization; using namespace std; LRSDP::LRSDP(const size_t numSparseConstraints, ...
7f2f1843-d55e-49f7-83ac-880229155b17
{ "language": "C++" }
```c++ #include "Logging.h" #include <SenseKit/sensekit_types.h> INITIALIZE_LOGGING namespace sensekit { void initialize_logging(const char* logFilePath) { const char TRUE_STRING[] = "true"; el::Loggers::addFlag(el::LoggingFlag::CreateLoggerAutomatically); el::Loggers::addFlag(el::L...
```c++ #include "Logging.h" #include <SenseKit/sensekit_types.h> INITIALIZE_LOGGING namespace sensekit { void initialize_logging(const char* logFilePath) { const char TRUE_STRING[] = "true"; el::Loggers::addFlag(el::LoggingFlag::CreateLoggerAutomatically); el::Loggers::addFlag(el::L...
00c517f4-c7b7-4d04-8139-e8ab8e61ffa7
{ "language": "C++" }
```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 "chrome/browser/idle_query_linux.h" #include <X11/Xlib.h> #include <X11/extensions/scrnsaver.h> namespace browser { class IdleData ...
```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 "chrome/browser/idle_query_linux.h" #include <X11/extensions/scrnsaver.h> #include "ui/base/x/x11_util.h" namespace browser { class...
917a1c4b-4a8f-41f7-85ae-a17a00dfb55d
{ "language": "C++" }
```c++ #include <iostream> #include <system_error> #include "controllers/main/MainModule.hpp" #include "network/bsdsocket/Manager.hpp" int main() { tin::controllers::main::ControllerQueue ctrlQueue; tin::network::bsdsocket::ManagerQueue netManagerQueue; tin::controllers::main::MainModule mainCtrl(ctrlQue...
```c++ #include <iostream> #include <system_error> #include "controllers/main/MainModule.hpp" #include "network/bsdsocket/Manager.hpp" #include "network/sniffer/SnifferManager.hpp" int main() { tin::controllers::main::ControllerQueue ctrlQueue; tin::network::bsdsocket::ManagerQueue netManagerQueue; tin::...
34b8dd54-3fce-4421-83e1-5a6914ff3c34
{ "language": "C++" }
```c++ // RUN: %clangxx_asan -std=c++11 %s -o %t && %run %t 2>&1 // Regression test for the versioned pthread_create interceptor on linux/i386. // pthread_attr_init is not intercepted and binds to the new abi // pthread_create is intercepted; dlsym always returns the oldest version. // This results in a crash inside pt...
```c++ // RUN: %clangxx_asan -std=c++11 -pthread %s -o %t && %run %t 2>&1 // Regression test for the versioned pthread_create interceptor on linux/i386. // pthread_attr_init is not intercepted and binds to the new abi // pthread_create is intercepted; dlsym always returns the oldest version. // This results in a crash ...
3666e3a3-c577-4c75-a77a-3369f97b4de8
{ "language": "C++" }
```c++ // RUN: rm -rf %t // RUN: %clang_cc1 -fsyntax-only -verify %s -fmodules -fmodules-cache-path=%t -I%S/Inputs/PR28438 -fimplicit-module-maps #include "a.h" #include "b2.h" #pragma clang __debug macro FOO FOO // xpected-no-diagnostics ``` Remove debugging aids from this test and fix its expectations.
```c++ // RUN: rm -rf %t // RUN: %clang_cc1 -fsyntax-only -verify %s -fmodules -fmodules-cache-path=%t -I%S/Inputs/PR28438 -fimplicit-module-maps #include "a.h" #include "b2.h" FOO // expected-no-diagnostics ```
6a249518-3767-4845-81ea-8f595ba06d89
{ "language": "C++" }
```c++ #include "game_state.hpp" #include "start_game_state.hpp" namespace Quoridor { GameState::GameState() { } GameState::~GameState() { } void GameState::handle_events(StateManager *stm, std::shared_ptr<UI::UIImpl> ui) { UI::Event ev; if (ui->poll_event(&ev)) { switch (ev) { case UI::kEnt...
```c++ #include "game_state.hpp" #include "start_game_state.hpp" namespace Quoridor { GameState::GameState() { } GameState::~GameState() { } void GameState::handle_events(StateManager *stm, std::shared_ptr<UI::UIImpl> ui) { UI::Event ev; if (ui->poll_event(&ev)) { switch (ev) { case UI::kEnt...
c629a220-8318-4c15-b104-d8cea20ae20d
{ "language": "C++" }
```c++ #include <omp.h> #include "proctor/detector.h" #include "proctor/proctor.h" #include "proctor/scanning_model_source.h" #include "proctor/basic_proposer.h" using pcl::proctor::Detector; //using pcl::proctor::ProctorMPI; using pcl::proctor::Proctor; using pcl::proctor::ScanningModelSource; using pcl::proctor::Ba...
```c++ #include "proctor/detector.h" #include "proctor/proctor.h" #include "proctor/scanning_model_source.h" #include "proctor/basic_proposer.h" using pcl::proctor::Detector; //using pcl::proctor::ProctorMPI; using pcl::proctor::Proctor; using pcl::proctor::ScanningModelSource; using pcl::proctor::BasicProposer; int ...
c6223723-6157-4c2a-9645-c7dbdd09b069
{ "language": "C++" }
```c++ #include "runtime/helpers/spy_reader.h" #include <algorithm> using std::string; static const char * spy_read(void *data, size_t *bytes_read) { SpyReader *reader = static_cast<SpyReader *>(data); string result = reader->content.substr(reader->position, reader->chunk_size); reader->position += result.size(...
```c++ #include "runtime/helpers/spy_reader.h" #include <string.h> #include <algorithm> using std::string; static const char * spy_read(void *data, size_t *bytes_read) { SpyReader *reader = static_cast<SpyReader *>(data); string result = reader->content.substr(reader->position, reader->chunk_size); reader->posi...
4bf2ed41-01dd-49fc-9276-d067d3b40970
{ "language": "C++" }
```c++ #include "game.hpp" #include "exception.hpp" #include "walk_move.hpp" #include "wall_move.hpp" namespace Quoridor { Game::Game() : board_(new Board(9, 9)), pawn_list_() { } Game::~Game() { } void Game::add_pawn(std::shared_ptr<Pawn> pawn) { board_->add_pawn(pawn); pawn_list_.push_back(pawn); } pos_t...
```c++ #include "game.hpp" #include "exception.hpp" #include "walk_move.hpp" #include "wall_move.hpp" namespace Quoridor { Game::Game() : board_(new Board(9, 9)), pawn_list_() { } Game::~Game() { } void Game::add_pawn(std::shared_ptr<Pawn> pawn) { board_->add_pawn(pawn); pawn_list_.push_back(pawn); } pos_t...
a0466a3d-d344-4a33-836e-978a55cfafc9
{ "language": "C++" }
```c++ #include "tile.hpp" #include "vector_tile.pb.h" #include <google/protobuf/io/zero_copy_stream_impl.h> namespace avecado { tile::tile(unsigned int z_, unsigned int x_, unsigned int y_) : z(z_), x(x_), y(y_), m_mapnik_tile(new mapnik::vector::tile) { } tile::~tile() { } std::string tile::get_data() const { ...
```c++ #include "tile.hpp" #include "vector_tile.pb.h" #include <google/protobuf/io/zero_copy_stream_impl.h> namespace avecado { tile::tile(unsigned int z_, unsigned int x_, unsigned int y_) : z(z_), x(x_), y(y_), m_mapnik_tile(new mapnik::vector::tile) { } tile::~tile() { } std::string tile::get_data() const { ...
c5afc5cd-6763-48d7-b8f2-9d4542a9334e
{ "language": "C++" }
```c++ #pragma once #include "TerraceWrapperCodec.h" namespace spotify { namespace json { using TerraceWrapper = noise::module::Wrapper<noise::module::Terrace>; codec::object_t<TerraceWrapper> default_codec_t<TerraceWrapper>::codec() { auto codec = codec::object<TerraceWrapper>(); codec.required...
```c++ #pragma once #include "TerraceWrapperCodec.h" namespace spotify { namespace json { using TerraceWrapper = noise::module::Wrapper<noise::module::Terrace>; codec::object_t<TerraceWrapper> default_codec_t<TerraceWrapper>::codec() { auto codec = codec::object<TerraceWrapper>(); codec.required...
fa48df9e-addd-463c-8c39-58ca53cc8030
{ "language": "C++" }
```c++ #include "EntityEditor.hpp" #include <Engine/Manager/Managers.hpp> #include <Engine/Manager/ResourceManager.hpp> #include <Engine/Geometry/Rectangle.hpp> #include "TransformEditor.hpp" using namespace GUI; EntityEditor::EntityEditor(Widget* parent) : Widget(parent) { rectangle = Managers().resourceManager...
```c++ #include "EntityEditor.hpp" #include <Engine/Manager/Managers.hpp> #include <Engine/Manager/ResourceManager.hpp> #include <Engine/Geometry/Rectangle.hpp> #include "TransformEditor.hpp" using namespace GUI; EntityEditor::EntityEditor(Widget* parent) : Widget(parent) { rectangle = Managers().resourceManager...
adca7447-a21b-4aad-bd8d-e0b127a3192a
{ "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_...
7caa18d9-5af9-481c-9328-a4a21fa564c6
{ "language": "C++" }
```c++ // RUN: clang-cc -fsyntax-only -verify %s struct X { template<typename T> T& f0(T); void g0(int i, double d) { int &ir = f0(i); double &dr = f0(d); } template<typename T> T& f1(T); template<typename T, typename U> U& f1(T, U); void g1(int i, double d) { int &ir1 = f1(i); int...
```c++ // RUN: clang-cc -fsyntax-only -verify %s struct X { template<typename T> T& f0(T); void g0(int i, double d) { int &ir = f0(i); double &dr = f0(d); } template<typename T> T& f1(T); template<typename T, typename U> U& f1(T, U); void g1(int i, double d) { int &ir1 = f1(i); int...
f4bb059a-92d3-44a4-870b-83bbb66a8738
{ "language": "C++" }
```c++ #include "Timer.h" #define BOOST_TEST_MODULE TimerTest #include <boost/test/unit_test.hpp> #include <string> #include <iostream> BOOST_AUTO_TEST_CASE(timer_basic_test) { Timer timer; timer.start(); BOOST_REQUIRE(timer.is_running()); BOOST_REQUIRE(timer.get_elapsed_cpu_time() > 0.0); BOOST_REQUIRE(ti...
```c++ #include "Timer.h" #define BOOST_TEST_MODULE TimerTest #include <boost/test/unit_test.hpp> #include <string> #include <iostream> #include <unistd.h> BOOST_AUTO_TEST_CASE(timer_basic_test) { Timer timer; const int sleep_time_microsec = 40; // ad-hoc microseconds to pass unit tests. timer.start(); BOOS...
b3f3b266-53ff-4bbf-9706-3adc176533f7
{ "language": "C++" }
```c++ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// // STL #include <cassert> #include <sstream> // TravelCCM Basic #include <travelccm/service/TRAVELCCM_ServiceContext.hpp> namespace TRAVELCCM { ...
```c++ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// // STL #include <cassert> #include <sstream> // TravelCCM Basic #include <travelccm/service/TRAVELCCM_ServiceContext.hpp> namespace TRAVELCCM { ...
5837f03d-000d-46a5-850a-d63e5ae7f56c
{ "language": "C++" }
```c++ #include "audio_mixer.hpp" #include "timer.hpp" #include "vorbis_stream.hpp" #include <chrono> #include <thread> #include <cmath> using namespace Granite::Audio; using namespace std; struct SineAudio : BackendCallback { void mix_samples(float * const *channels, size_t num_frames) noexcept override { float ...
```c++ #include "audio_mixer.hpp" #include "timer.hpp" #include "vorbis_stream.hpp" #include <chrono> #include <thread> #include <cmath> using namespace Granite::Audio; using namespace std; struct SineAudio : BackendCallback { void mix_samples(float * const *channels, size_t num_frames) noexcept override { float ...
9bedb66b-cb8d-4694-b54e-95d60e41afb0
{ "language": "C++" }
```c++ /* behaviourconfig_events.cpp Copyright (c) 2006 by Thorben Kröger <thorbenk@gmx.net> Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org> ************************************************************************* * ...
```c++ /* behaviourconfig_events.cpp Copyright (c) 2006 by Thorben Kröger <thorbenk@gmx.net> Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org> ************************************************************************* * ...
3c4f5941-ee94-4741-9355-109cda4c218c
{ "language": "C++" }
```c++ #include "Bmp180.h" ``` Implement the BMP180 container class
```c++ #include "Bmp180.h" namespace rcr { namespace level1payload { Bmp180::Bmp180(void) { // Start the BMP-180. Trap the thread if no sensor is found. if (!bmp_.begin()) { Serial.println("No BMP sensor found. Program will not proceed."); while (1) { /* Trap the thread. */ } } } float Bmp180::temperat...
9e76ca04-6f0c-4627-b8b6-e933ba240bae
{ "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 "../../fpdfsdk/include/fpdfview.h" #include "../../fpdfsdk/include/fpdfdoc.h" #include "testing/gtest/i...
```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 "../../fpdfsdk/include/fpdfview.h" #include "../../fpdfsdk/include/fpdfdoc.h" #include "testing/gtest/i...
4e80f1fa-3b6c-4787-a1e2-c08657b3d5cf
{ "language": "C++" }
```c++ #include <aerial_autonomy/common/async_timer.h> #include <iostream> #include <stdexcept> AsyncTimer::AsyncTimer(std::function<void()> function, std::chrono::duration<double> timer_duration) : function_(function), timer_duration_(timer_duration), running_(false) {} AsyncTimer::~Async...
```c++ #include <aerial_autonomy/common/async_timer.h> #include <stdexcept> AsyncTimer::AsyncTimer(std::function<void()> function, std::chrono::duration<double> timer_duration) : function_(function), timer_duration_(timer_duration), running_(false) {} AsyncTimer::~AsyncTimer() { running_...
e61a2dfc-076e-455b-b31d-aa6d1396f294
{ "language": "C++" }
```c++ /* * Copyright © 2017 Collabora Ltd. * * This file is part of vkmark. * * vkmark is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 2.1 of the License, or (at your option) a...
```c++ /* * Copyright © 2017 Collabora Ltd. * * This file is part of vkmark. * * vkmark is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 2.1 of the License, or (at your option) a...
6a014ef4-07f2-4759-a592-147dad08ffac
{ "language": "C++" }
```c++ #include "Target.h" #include <cassert> #include <memory> #include "MCTargetDesc/X86MCTargetDesc.h" #include "gmock/gmock.h" #include "gtest/gtest.h" namespace exegesis { void InitializeX86ExegesisTarget(); namespace { using testing::Gt; using testing::NotNull; using testing::SizeIs; class X86TargetTest : ...
```c++ #include "Target.h" #include <cassert> #include <memory> #include "MCTargetDesc/X86MCTargetDesc.h" #include "gmock/gmock.h" #include "gtest/gtest.h" namespace exegesis { void InitializeX86ExegesisTarget(); namespace { using testing::Gt; using testing::NotNull; using testing::SizeIs; class X86TargetTest : ...
3ede8774-14db-4003-a9c0-28074c06c79f
{ "language": "C++" }
```c++ #include "runtime_internal.h" #define INLINE inline __attribute__((weak)) __attribute__((used)) __attribute__((always_inline)) __attribute__((nothrow)) __attribute__((pure)) extern "C" { INLINE float float_from_bits(uint32_t bits) { union { uint32_t as_uint; float as_float; } u; u....
```c++ #include "runtime_internal.h" #define INLINE inline __attribute__((weak)) __attribute__((used)) __attribute__((always_inline)) __attribute__((nothrow)) __attribute__((pure)) extern "C" { INLINE float float_from_bits(uint32_t bits) { union { uint32_t as_uint; float as_float; } u; u....
435f8533-2f65-4728-85c8-c779deb1d7e6
{ "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_function.h" #include "chrome/browser/extensions/extension_function_dispatcher.h" void Extension...
```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_function.h" #include "chrome/browser/extensions/extension_function_dispatcher.h" void Extension...
9f65e073-6a01-459f-8b76-e6d1b015fea3
{ "language": "C++" }
```c++ #include <ast/function-var.hh> #include <ast/any-list.hh> namespace ast { FunctionVar::FunctionVar(const yy::location& location, Var* var, ExprList* params) : Var(location) , var_(var) , params_(params) {} FunctionVar...
```c++ #include <ast/function-var.hh> #include <ast/any-list.hh> namespace ast { FunctionVar::FunctionVar(const yy::location& location, Var* var, ExprList* params) : Var(location) , var_(var) , params_(params) , def_(nullptr)...
409af124-3b3f-4ca6-82a7-8fc9624d1507
{ "language": "C++" }
```c++ /* Author: vpetrigo Task: . . . , . : ( 1000). - . */ #include <iostream> using namespace std; int main() { int a, b, c; const int p_t = 2; cin >> a >> b >> c; int sum_p = a + b + c; cout << (sum_p + p_t - 1) / p_t ...
```c++ /* Author: vpetrigo Task: . . . , . : ( 1000). - . */ #include <iostream> using namespace std; int table_count(int st); int main() { int a, b, c; cin >> a >> b >> c; cout << table_count(a) + table_count(b) + table_count(c) << e...
0a604b30-c45b-4149-ad2a-aea66a5c86f0
{ "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. // //===---------------------------------...
49886d33-44f5-4428-9a2b-f182a50edec6
{ "language": "C++" }
```c++ // Copyright 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 or agree...
```c++ // Copyright 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 or agree...
365b5810-8a98-49c1-a05b-23162c39222f
{ "language": "C++" }
```c++ #include <limits> #include "rdb_protocol/configured_limits.hpp" #include "rdb_protocol/wire_func.hpp" #include "rdb_protocol/func.hpp" namespace ql { configured_limits_t from_optargs(rdb_context_t *ctx, signal_t *interruptor, const std::map<std::string, wire_func_t> &arguments) { auto p = argum...
```c++ #include "rdb_protocol/configured_limits.hpp" #include <limits> #include "rdb_protocol/wire_func.hpp" #include "rdb_protocol/func.hpp" namespace ql { configured_limits_t from_optargs(rdb_context_t *ctx, signal_t *interruptor, const std::map<std::string, wire_func_t> &arguments) { auto p = argum...
e7501de6-225a-4239-ab7b-bd33e221897e
{ "language": "C++" }
```c++ #include <cstdio> #include "Werk/Math/SummaryStatistics.hpp" int main() { werk::SummaryStatistics<double> s; s.sample(5.0); s.sample(1.0); std::printf("Hello world! count=%llu average=%f stddev=%f", s.count(), s.average(), s.stddev()); return 0; } ``` Use correct format specifier in HelloWorld
```c++ #include <cinttypes> #include <cstdio> #include "Werk/Math/SummaryStatistics.hpp" int main() { werk::SummaryStatistics<double> s; s.sample(5.0); s.sample(1.0); std::printf("Hello world! count=%" PRIu64 " average=%f stddev=%f", s.count(), s.average(), s.stddev()); return 0; } ```
09f1c263-6db9-4011-90f8-1be083333c46
{ "language": "C++" }
```c++ #include "archive.hpp" void archive(const char* in_file, const char* out_file) { throw "Not implemented"; } void archive(const char* in_file, std::ostream& out_stream) { throw "Not implemented"; } void archive(std::istream& in_stream, std::ostream& out_stream) { throw "Not implemented"; } ``` Implement ar...
```c++ #include "archive.hpp" #include "../huffman/compress.hpp" #include<fstream> #include<vector> void archive_files(const std::vector<std::string>& filenames, std::ostream& out_stream) { std::ostreambuf_iterator<char> out_iterator(out_stream); for(auto& fn : filenames) { for(char c : fn) *out_iterator = c; ...
d3f68d11-1a3f-48d8-9e85-fd8b945df481
{ "language": "C++" }
```c++ // Test that coverage and MSVC CRT stdio work from a DLL. This ensures that the // __local_stdio_printf_options function isn't instrumented for coverage. // RUN: rm -rf %t && mkdir %t && cd %t // RUN: %clang_cl_asan -fsanitize-coverage=func -O0 %p/dll_host.cc -Fet.exe // RUN: %clang_cl_asan -fsanitize-coverage=...
```c++ // Test that coverage and MSVC CRT stdio work from a DLL. This ensures that the // __local_stdio_printf_options function isn't instrumented for coverage. // RUN: rm -rf %t && mkdir %t && cd %t // RUN: %clang_cl_asan -fsanitize-coverage=func -O0 %p/dll_host.cc -Fet.exe // RUN: %clang_cl_asan -fsanitize-coverage=...
334a0295-7570-4d64-8a69-adf52773547d
{ "language": "C++" }
```c++ // Copyright (c) 2013 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "system_info/system_info_device_orientation.h" #include "system_info/system_info_utils.h" void SysInfoDeviceOrientation::Get(picojson::...
```c++ // Copyright (c) 2013 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "system_info/system_info_device_orientation.h" #include "system_info/system_info_utils.h" void SysInfoDeviceOrientation::Get(picojson::...