doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
fd0b19d3-7764-49f6-9ca9-f993af2e0880
{ "language": "C++" }
```c++ // Copyright 2016 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 <stddef.h> #include <stdint.h> #ifndef OTS_FUZZER_NO_MAIN #include <fstream> #include <iostream> #include <iterator> #endif #include "ope...
```c++ // Copyright 2016 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 <stddef.h> #include <stdint.h> #ifndef OTS_FUZZER_NO_MAIN #include <fstream> #include <iostream> #include <iterator> #endif #include "ope...
6bd37c27-7f1f-4431-b02f-7de7d783985a
{ "language": "C++" }
```c++ #include "halley/maths/circle.h" using namespace Halley; bool Circle::contains(Vector2f point) const { return (point - centre).squaredLength() <= radius * radius; } bool Circle::overlaps(const Circle& circle) const { const float r = radius + circle.radius; return (circle.centre - centre).squaredLength() <= ...
```c++ #include "halley/maths/circle.h" using namespace Halley; bool Circle::contains(Vector2f point) const { return (point - centre).squaredLength() <= radius * radius; } bool Circle::overlaps(const Circle& circle) const { const float r = radius + circle.radius; return (circle.centre - centre).squaredLength() <= ...
2954f0a4-0c95-4ccb-b929-6128cd33ebe3
{ "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. // //===---------------------------------...
cb12f65b-ff03-48e9-b98b-c332f4fa6ca8
{ "language": "C++" }
```c++ #include "catch.hpp" //#define KASSERT REQUIRE #include <Segment.hh> #include <cstring> #define SEGMENTSIZE 4096 SCENARIO("Memory segment representation", "[kernelheap]") { GIVEN("A memory segment") { char* memorySegment = new char[SEGMENTSIZE]; memset(memorySegment, 0x55, SEGMENTSIZE); ...
```c++ #include "catch.hpp" //#define KASSERT REQUIRE #include <Segment.hh> #include <cstring> #define SEGMENTSIZE 4096 SCENARIO("Memory segment representation", "[kernelheap]") { GIVEN("A memory segment") { char* memorySegment = new char[SEGMENTSIZE]; memset(memorySegment, 0x55, SEGMENTSIZE); ...
749e9764-12af-41aa-85cd-81b861bda2f9
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "printing/backend/print_backend.h" namespace printing { PrinterBasicInfo::PrinterBasicInfo() : printer_status(0) {} PrinterBasicInf...
```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 "printing/backend/print_backend.h" namespace printing { PrinterBasicInfo::PrinterBasicInfo() : printer_status(0), is_defau...
c7e84221-dcaf-4fe9-97ef-7c37543361bd
{ "language": "C++" }
```c++ #include "ewk_settings_private.h" #include "net/http/http_stream_factory.h" void Ewk_Settings::setSpdyEnabled(bool flag) { net::HttpStreamFactory::set_spdy_enabled(flag); } void Ewk_Settings::setCurrentLegacyFontSizeMode(tizen_webview::Legacy_Font_Size_Mode mode) { m_currentLegacyFontSizeMode = mode; ...
```c++ #include "ewk_settings_private.h" #include "net/http/http_stream_factory.h" void Ewk_Settings::setSpdyEnabled(bool flag) { net::HttpStreamFactory::set_spdy_enabled(flag); } void Ewk_Settings::setCurrentLegacyFontSizeMode(tizen_webview::Legacy_Font_Size_Mode mode) { m_currentLegacyFontSizeMode = mode; #i...
eea4b85b-09b0-4eb1-a3bd-a4bf0ed9137e
{ "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/webui/print_preview_ui.h" #include "base/values.h" #include "chrome/browser/profiles/profile.h" #include "chrome/b...
```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/webui/print_preview_ui.h" #include "base/values.h" #include "chrome/browser/profiles/profile.h" #include "chrome/b...
5556e0dd-f872-4ba0-92b5-5b6302da9001
{ "language": "C++" }
```c++ #include <nstd/Debug.h> #include <nstd/Variant.h> void_t testVariant() { // test default constructor { Variant var; ASSERT(var.isNull()); ASSERT(var.toBool() == false); } // test boolean constructor { Variant var(true); ASSERT(var.toBool() == true); } // test map constructor...
```c++ #include <nstd/Debug.h> #include <nstd/Variant.h> void_t testVariant() { // test default constructor { Variant var; ASSERT(var.isNull()); ASSERT(var.toBool() == false); } // test boolean constructor { Variant var(true); ASSERT(var.toBool() == true); } // test map constructor...
e9b1b1c2-597c-4ebd-8446-365cf0b050bc
{ "language": "C++" }
```c++ #include "square.h" #include <gtest/gtest.h> TEST(TestSuite, squareTwo) { const double ret = square(2); ASSERT_EQ(4, ret); } TEST(TestSuite, squareFour) { const double ret = square(4.1); ASSERT_EQ(16.81, ret); } // Run all the tests that were declared with TEST() int main(int argc, char **argv){ tes...
```c++ #include "square.h" #include <gtest/gtest.h> TEST(TestSuite, squareTwo) { const double ret = square(2); ASSERT_EQ(5, ret); } TEST(TestSuite, squareFour) { const double ret = square(4.1); ASSERT_EQ(16.81, ret); } // Run all the tests that were declared with TEST() int main(int argc, char **argv){ tes...
ee8ffd68-27fb-4ef8-b8d2-f3d3caa07b62
{ "language": "C++" }
```c++ #include "HaxeRuntime.h" #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS #endif #include "PrintfCaptureTypes.h" #include "CoreMinimal.h" #include "uhx/expose/HxcppRuntime.h" #include <stdlib.h> #include <stdio.h> #include <stdarg.h> #include <string.h> #if PLATFORM_WINDOWS && !defined(vsnprintf) #define vsnpr...
```c++ #include "HaxeRuntime.h" #include "uhx/NoDeprecateHeader.h" #include "PrintfCaptureTypes.h" #include "CoreMinimal.h" #include "uhx/expose/HxcppRuntime.h" #include <stdlib.h> #include <stdio.h> #include <stdarg.h> #include <string.h> #if PLATFORM_WINDOWS && !defined(vsnprintf) #define vsnprintf _vsnprintf #end...
afbc1d28-f6fb-44a5-bfb6-a81cd8e00874
{ "language": "C++" }
```c++ #include "Person.h" #include <gtest/gtest.h> TEST(GreeterTests, PersonGetNameTest) { Person p{"Woz"}; ASSERT_STREQ(p.getName().c_str(), "Woz"); } ``` Add UT for invalid param in ctor
```c++ #include "Person.h" #include <stdexcept> #include <gtest/gtest.h> TEST(GreeterTests, PersonValidCtorTest) { ASSERT_NO_THROW({ Person p{"Alexa"}; }); } TEST(GreeterTests, PersonInvalidCtorTest) { ASSERT_THROW({ Person p{""}; }, std::invalid_argument); } TEST(GreeterTests, PersonGetNameT...
8faaa07e-662e-448a-9c72-9dc828b3f012
{ "language": "C++" }
```c++ /* Copyright (C) 2010 by Frank Richter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distribu...
```c++ /* Copyright (C) 2010 by Frank Richter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distribu...
2cf68363-94bc-4311-ba65-5719e94ecb41
{ "language": "C++" }
```c++ #include "Logger.h" #include <string> void Logger::Start() { #ifdef ENABLE_3RVX_LOGTOFILE /* Disable buffering */ setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); FILE *out, *err; _wfreopen_s(&out, L"3RVX_Log.txt", L"w", stdout); _wfreopen_s(&err, L"3RVX_Log.txt", L"w...
```c++ #include "Logger.h" #include <string> void Logger::Start() { #ifdef ENABLE_3RVX_LOGTOFILE /* Disable buffering */ setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); FILE *out, *err; _wfreopen_s(&out, L"3RVX_Log.txt", L"w", stdout); _wfreopen_s(&err, L"3RVX_Log.txt", L"w...
9e804875-193c-49de-a8af-6cb4dd4e5aa6
{ "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/chromeos/status_area_button.h" #include "app/gfx/canvas.h" #include "app/gfx/skbitmap_operations.h" #include "app/res...
```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/chromeos/status_area_button.h" #include "app/gfx/canvas.h" #include "app/gfx/skbitmap_operations.h" #include "app/res...
0e61d6fe-5aa7-48d8-b678-a73c3d1f4352
{ "language": "C++" }
```c++ #include "generator.h" int main() { QStringList l; l << "kernel_metamodel.xml" << "basicbehaviors_metamodel.xml" << "trace.xml" << "requirements_metamodel.xml" << "class_metamodel.xml" << "usecase_metamodel.xml" << "sequence_metamodel.xml" //<< "communication_metamodel.xml" << "statemachines_metam...
```c++ #include "generator.h" int main() { QStringList l; l << "kernel_metamodel.xml" << "basicbehaviors_metamodel.xml" << "trace.xml" << "requirements_metamodel.xml" << "class_metamodel.xml" << "usecase_metamodel.xml" << "sequence_metamodel.xml" //<< "communication_metamodel.xml" << "statemachines_metam...
03756b0d-0e1f-4cac-88a1-459c564a5c84
{ "language": "C++" }
```c++ //------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //--------------------------------------------------...
```c++ //------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //--------------------------------------------------...
11bbae13-6a62-452a-af5a-d142b9c60b67
{ "language": "C++" }
```c++ //! @file test-getfullyqualifiedname.cpp //! @author George Fleming <v-geflem@microsoft.com> //! @brief Unit tests for GetFullyQualifiedName #include <stdio.h> #include <gtest/gtest.h> #include "getfullyqualifiedname.h" //! Test fixture for GetComputerNameTest class GetFullyQualifiedNameTest : public ::testing...
```c++ //! @file test-getfullyqualifiedname.cpp //! @author George Fleming <v-geflem@microsoft.com> //! @brief Unit tests for GetFullyQualifiedName #include <stdio.h> #include <gtest/gtest.h> #include "getfullyqualifiedname.h" //! Test fixture for GetComputerNameTest class GetFullyQualifiedNameTest : public ::testing...
9a7b6746-2db7-462c-84d0-0a462fdfccb1
{ "language": "C++" }
```c++ #include "compiler/build_tables/item_set_closure.h" #include <algorithm> #include <set> #include "tree_sitter/compiler.h" #include "compiler/build_tables/follow_sets.h" #include "compiler/build_tables/item.h" #include "compiler/prepared_grammar.h" namespace tree_sitter { using std::set; using rules::ISy...
```c++ #include "compiler/build_tables/item_set_closure.h" #include <algorithm> #include <set> #include "tree_sitter/compiler.h" #include "compiler/build_tables/follow_sets.h" #include "compiler/build_tables/item.h" #include "compiler/prepared_grammar.h" namespace tree_sitter { using std::set; using rules::ISy...
f5ccc5f6-1805-4f0c-9d79-3e634391674e
{ "language": "C++" }
```c++ /* This file is part of the KDE project * Copyright (C) 2010 Casian Andrei <skeletk13@gmail.com> * * This library 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 ...
```c++ /* This file is part of the KDE project * Copyright (C) 2010 Casian Andrei <skeletk13@gmail.com> * * This library 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 ...
cb8acd3a-12ec-4daf-af4f-0e87a1744b74
{ "language": "C++" }
```c++ /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable l...
```c++ /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable l...
8329f39c-6fbd-46d8-ba8a-df573cb4cbe0
{ "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. // //===---------------------------------...
46984046-3799-4fdb-8579-10727fc8ce20
{ "language": "C++" }
```c++ #include "hierarchical_viewer.hpp" HierarchicalViewer::HierarchicalViewer(QWidget *parent) : QTreeWidget(parent) { /* Placeholders for testing purposes */ setColumnCount(1); setHeaderLabel("Executable file"); QTreeWidgetItem *filename = addRoot("hacker.out"); QTreeWidgetItem *elf_header = ad...
```c++ #include "hierarchical_viewer.hpp" HierarchicalViewer::HierarchicalViewer(QWidget *parent) : QTreeWidget(parent) { /* Placeholders for testing purposes */ headerItem()->setHidden(true); QTreeWidgetItem *elf_header = addRoot("ELF Header"); QTreeWidgetItem *pht = addRoot("Program Header Table"); ...
b718ebda-e09d-4992-84dd-dd055cb8796d
{ "language": "C++" }
```c++ #include "Genes/King_Protection_Gene.h" #include <string> #include "Genes/Gene.h" #include "Game/Board.h" #include "Game/Color.h" #include "Game/Square.h" #include "Moves/Move.h" double King_Protection_Gene::score_board(const Board& board, Piece_Color perspective, size_t, double) const noexcept { auto squ...
```c++ #include "Genes/King_Protection_Gene.h" #include <string> #include "Genes/Gene.h" #include "Game/Board.h" #include "Game/Color.h" #include "Game/Square.h" #include "Moves/Move.h" double King_Protection_Gene::score_board(const Board& board, Piece_Color perspective, size_t, double) const noexcept { auto squ...
dd8e44de-fa6f-4eee-8108-5ec527c466da
{ "language": "C++" }
```c++ /* Copyright libCellML Contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing,...
```c++ /* Copyright libCellML Contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing,...
953a9324-885d-4b58-a050-2b0a34798519
{ "language": "C++" }
```c++ #include "qobjectfinalizer.h" #include <QVariant> #include "getvalue.h" #include "pushvalue.h" #include "toqobject.h" #include "convert.h" duk_ret_t dukpp03::qt::qobjectfinalizer(duk_context* ctx) { QVariant* v = dukpp03::Finalizer<dukpp03::qt::BasicContext>::getVariantToFinalize(ctx); dukpp03::qt::Basi...
```c++ #include "qobjectfinalizer.h" #include <QVariant> #include "getvalue.h" #include "pushvalue.h" #include "toqobject.h" #include "convert.h" duk_ret_t dukpp03::qt::qobjectfinalizer(duk_context* ctx) { QVariant* v = dukpp03::Finalizer<dukpp03::qt::BasicContext>::getVariantToFinalize(ctx); dukpp03::qt::Basi...
2fbdc104-09ce-4036-a8e7-1a74416cca29
{ "language": "C++" }
```c++ //===----------------------------------------------------------------------===// // // PelotonDB // // simple_optimizer.cpp // // Identification: /peloton/src/optimizer/simple_optimizer.cpp // // Copyright (c) 2016, Carnegie Mellon University Database Group // //===-----------------------...
```c++ //===----------------------------------------------------------------------===// // // PelotonDB // // simple_optimizer.cpp // // Identification: /peloton/src/optimizer/simple_optimizer.cpp // // Copyright (c) 2016, Carnegie Mellon University Database Group // //===-----------------------...
8cded2af-ecf6-4172-9e9c-b2950ffd6440
{ "language": "C++" }
```c++ //===----------------------------------------------------------------------===// // // PelotonDB // // simple_optimizer.cpp // // Identification: /peloton/src/optimizer/simple_optimizer.cpp // // Copyright (c) 2016, Carnegie Mellon University Database Group // //===-----------------------...
```c++ //===----------------------------------------------------------------------===// // // PelotonDB // // simple_optimizer.cpp // // Identification: /peloton/src/optimizer/simple_optimizer.cpp // // Copyright (c) 2016, Carnegie Mellon University Database Group // //===-----------------------...
1c13a921-fd9f-4ab8-9ccd-9b1600cf973d
{ "language": "C++" }
```c++ // FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // RUN: %clangxx -fsanitize=undefined %s -O1 -o %t // Regular run. // RUN: %run %t -4 2> %t.out // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.out // Good log_path. // RUN: rm -f %t.log.* // RUN: %env_ubsan_opts...
```c++ // FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android // The globs below do not work in the lit shell. // REQUIRES: shell // RUN: %clangxx -fsanitize=undefined %s -O1 -o %t // Regular run. // RUN: %run %t -4 2> %t.out // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t....
7e0593f9-627d-4828-a544-fab84da610fd
{ "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_logging.h" #include "base/logging.h" #include "googleurl/src/gurl.h" namespace renderer_logging { // Sets...
```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_logging.h" #include "base/logging.h" #include "googleurl/src/gurl.h" namespace renderer_logging { // Sets...
f36ea35a-6e31-4e87-9bc6-140f3a5a0c24
{ "language": "C++" }
```c++ #include "fileplugin.h" #include "direngine.h" #ifdef Q_OS_WIN #include "fileenginewin.h" #endif #include "fileenginefallback.h" FilePlugin::FilePlugin(QObject *parent) : AbstractFileEnginePlugin(parent) { } QStringList FilePlugin::schemes() const { return QStringList() << "file" << "qrc"; } Abstract...
```c++ #include "fileplugin.h" #include "syncdirengine.h" #ifdef Q_OS_WIN #include "fileenginewin.h" #endif #include "fileenginefallback.h" #include <QIO/SyncDirEngineWrapper> FilePlugin::FilePlugin(QObject *parent) : AbstractFileEnginePlugin(parent) { } QStringList FilePlugin::schemes() const { return QStr...
3217fcb2-8cc5-4905-9dc5-49f1cefb552a
{ "language": "C++" }
```c++ #include <caf/set_scheduler.hpp> #include "vast.h" #include "vast/filesystem.h" #include "vast/logger.h" #include "vast/serialization.h" #include "framework/unit.h" int main(int argc, char* argv[]) { // Work around CAF bug that blocks VAST in our "distributed" actor unit test // when using less than three...
```c++ #include <caf/set_scheduler.hpp> #include "vast.h" #include "vast/filesystem.h" #include "vast/logger.h" #include "vast/serialization.h" #include "framework/unit.h" int main(int argc, char* argv[]) { // Because we use several blocking actors in the unit tests, we need at least // some real parallelism to ...
50318cc7-767d-4e4f-95e1-b621bcf8c4cc
{ "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/i18n/icu_util.h" namespace icu_util { bool Initialize() { return true; } } // namespace icu_util ``` Build Fix for Win: M...
```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/i18n/icu_util.h" namespace base { namespace i18n { BASE_I18N_EXPORT bool InitializeICU() { return true; } } // namespace i...
dd1892ac-6124-4de8-a637-4cb2104d9987
{ "language": "C++" }
```c++ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied w...
```c++ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied w...
03c68388-83b5-478f-b484-1f310d73f309
{ "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. // //===---------------------------------...
d731d89f-2e30-4f06-8973-a8275fb95cdf
{ "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/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" // Flaky, h...
```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/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" // Times ou...
6c73ccef-4b58-4d42-be60-d7e5f84d1bb9
{ "language": "C++" }
```c++ #include "NMakefile.hpp" #include <configure/Build.hpp> #include <configure/Filesystem.hpp> #include <configure/quote.hpp> #include <configure/Node.hpp> namespace configure { namespace generators { bool NMakefile::is_available(Build& build) { return build.fs().which("nmake") != boost::none; } std::stri...
```c++ #include "NMakefile.hpp" #include <configure/Build.hpp> #include <configure/Filesystem.hpp> #include <configure/quote.hpp> #include <configure/Node.hpp> namespace configure { namespace generators { bool NMakefile::is_available(Build& build) { return build.fs().which("nmake") != boost::none; } std::stri...
d4830c06-8a0b-44c6-9d0a-cddf0756c8e9
{ "language": "C++" }
```c++ #include <ros/ros.h> #include <tf/transform_broadcaster.h> int main(int argc, char** argv){ ros::init(argc, argv, "static_tf_node"); ros::NodeHandle n; ros::Rate r(100); tf::TransformBroadcaster broadcaster; while(n.ok()){ broadcaster.sendTransform( tf::StampedTransform( tf::Transform( ...
```c++ #include <ros/ros.h> #include <tf/transform_broadcaster.h> int main(int argc, char** argv){ ros::init(argc, argv, "static_tf_node"); ros::NodeHandle n; ros::Rate r(100); tf::TransformBroadcaster broadcaster; while(n.ok()){ broadcaster.sendTransform( tf::StampedTransform( tf::T...
1bc6bbf6-90dc-4083-932d-b235de2518a2
{ "language": "C++" }
```c++ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "retrytransienterrorspolicy.h" #include <vespa/messagebus/errorcode.h> namespace mbus { RetryTransientErrorsPolicy::RetryTransientErrorsPolicy() : _enabled(true), _baseDelay(...
```c++ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "retrytransienterrorspolicy.h" #include <vespa/messagebus/errorcode.h> namespace mbus { RetryTransientErrorsPolicy::RetryTransientErrorsPolicy() : _enabled(true), _baseDelay(...
14942530-0390-4b43-ae4f-063abb8ae99a
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -S -emit-llvm -o %t.ll %s -triple x86_64-apple-darwin10 // RUN: %clang_cc1 -std=c++11 -S -emit-llvm -o %t-c++11.ll %s -triple x86_64-apple-darwin10 // RUN: diff %t.ll %t-c++11.ll // rdar://12897704 struct sAFSearchPos { unsigned char *pos; unsigned char count; }; static volatile ...
```c++ // RUN: %clang_cc1 -std=c++11 -S -emit-llvm -o - %s -triple x86_64-apple-darwin10 | FileCheck %s // RUN: %clang_cc1 -S -emit-llvm -o %t.ll %s -triple x86_64-apple-darwin10 // RUN: %clang_cc1 -std=c++11 -S -emit-llvm -o %t-c++11.ll %s -triple x86_64-apple-darwin10 // RUN: diff %t.ll %t-c++11.ll // rdar://1289...
f228fa30-7138-4635-82a5-b75dbb4986c3
{ "language": "C++" }
```c++ // Check that we detect malloc/delete mismatch only if the approptiate flag // is set. // RUN: %clangxx_asan -g %s -o %t 2>&1 // RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=1 %t 2>&1 | \ // RUN: %symbolize | FileCheck %s // No error here. // RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=0 %t #include <stdlib.h> stati...
```c++ // Check that we detect malloc/delete mismatch only if the approptiate flag // is set. // RUN: %clangxx_asan -g %s -o %t 2>&1 // RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=1 %t 2>&1 | \ // RUN: %symbolize | FileCheck %s // No error here. // RUN: ASAN_OPTIONS=alloc_dealloc_mismatch=0 %t #include <stdlib.h> stati...
b17a89c0-8e7d-4165-a7ed-39b1fcc964b3
{ "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 "testing/gtest/include/gtest/gtest.h" #include "base/basictypes.h" #include "net/http/http_auth_handler_basic.h" namespace net ...
```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 "testing/gtest/include/gtest/gtest.h" #include "base/basictypes.h" #include "net/http/http_auth_handler_basic.h" namespace net ...
d8e564cc-f4a5-4097-b05b-3db5a9a4602a
{ "language": "C++" }
```c++ // Copyright 2015 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/sessions/session_restore_delegate.h" #include "base/metrics/field_trial.h" #include "chrome/browser/sessions/session_rest...
```c++ // Copyright 2015 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/sessions/session_restore_delegate.h" #include "base/metrics/field_trial.h" #include "chrome/browser/sessions/session_rest...
090ee102-931f-4bcd-990a-53ee8adaced5
{ "language": "C++" }
```c++ #include "ofxHapImageSequence.h" ofxHapImageSequence::ofxHapImageSequence() { } ofxHapImageSequence::ofxHapImageSequence(ofDirectory& directory) { load(directory); } ofxHapImageSequence::ofxHapImageSequence(const std::string& path) { load(path); } ofxHapImageSequence::~ofxHapImageSequence() { } vo...
```c++ #include "ofxHapImageSequence.h" ofxHapImageSequence::ofxHapImageSequence() { } ofxHapImageSequence::ofxHapImageSequence(ofDirectory& directory) { load(directory); } ofxHapImageSequence::ofxHapImageSequence(const std::string& path) { load(path); } ofxHapImageSequence::~ofxHapImageSequence() { } vo...
5e5fb117-b1c7-4c42-9750-858ff5950b89
{ "language": "C++" }
```c++ #include <iostream> class MyClass { public: MyClass(int value) : m_fixedValue(value) {} const int m_fixedValue; static const int m_fixedStaticValue; }; const int MyClass::m_fixedStaticValue = 9; int main() { const MyClass myInstance(9); std::cout << myInstance.m_fixedValue << std::endl; const_ca...
```c++ #include <iostream> class MyClass { public: MyClass(int value) : m_fixedValue(value) {} const int m_fixedValue; static const int m_fixedStaticValue; }; const int MyClass::m_fixedStaticValue = 9; int main() { const MyClass myInstance(9); std::cout << myInstance.m_fixedValue << std::endl; const_ca...
303a9340-3f3e-47e6-9d71-ada15106788d
{ "language": "C++" }
```c++ // Copyright 2004-present Facebook. All Rights Reserved. #include <stdio.h> #include <string.h> #include "osquery/database.h" namespace osquery { namespace tables { QueryData genArp() { Row r; QueryData results; FILE *proc_arp_fd; char *line = nullptr; size_t length; int ret; // We are already...
```c++ // Copyright 2004-present Facebook. All Rights Reserved. #include <stdio.h> #include <string.h> #include <boost/algorithm/string.hpp> #include <boost/algorithm/string/split.hpp> #include "osquery/database.h" namespace osquery { namespace tables { QueryData genArp() { Row r; QueryData results; FILE *pr...
15cf5e83-eeb2-4c84-9310-5dbb177e904b
{ "language": "C++" }
```c++ #include <thread> #include <atomic> #include <iostream> #include <vector> struct AtomicCounter { std::atomic<int> value; void increment(){ ++value; } void decrement(){ --value; } int get(){ return value.load(); } }; int main(){ AtomicCounter counter; ...
```c++ #include <thread> #include <atomic> #include <iostream> #include <vector> struct AtomicCounter { std::atomic<int> value; AtomicCounter() : value(0) {} void increment(){ ++value; } void decrement(){ --value; } int get(){ return value.load(); } }; int m...
45dfd0a3-30d4-43f6-be9e-7b65a46c04a3
{ "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/web_applications/web_app.h" namespace web_app { namespace internals { bool CreatePlatformShortcut( const FilePat...
```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/web_applications/web_app.h" namespace web_app { namespace internals { bool CreatePlatformShortcut( const FilePat...
6b16c6f8-8e40-4402-b6ab-5b7f8fe482e3
{ "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/dropdown_bar_host.h" #include "base/logging.h" #include "ui/aura/window.h" #include "ui/views/widget/widget....
```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/ui/views/dropdown_bar_host.h" #include "base/logging.h" #include "ui/aura/window.h" #include "ui/views/widget/widget....
3b4e7fde-063c-4f30-abce-b1f620010772
{ "language": "C++" }
```c++ /* * Copyright 2003-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
```c++ /* * Copyright 2003-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless require...
1ced81bb-73f1-4443-927b-3fb72abed1d0
{ "language": "C++" }
```c++ //===-- XCoreTargetObjectFile.cpp - XCore object files --------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- XCoreTargetObjectFile.cpp - XCore object files --------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
ff068101-7d8f-4ea6-9fa9-4034801f5624
{ "language": "C++" }
```c++ /* * QueryModule.cc * * Load the query subsystem as a module. * Copyright (c) 2008 Linas Vepstas <linas@linas.org> */ #include <opencog/query/PatternSCM.h> #include "QueryModule.h" using namespace opencog; DECLARE_MODULE(QueryModule); QueryModule::QueryModule(CogServer& cs) : Module(cs), _pat(NULL) { } ...
```c++ /* * QueryModule.cc * * Load the query subsystem as a module. * Copyright (c) 2008 Linas Vepstas <linas@linas.org> */ #include <opencog/query/PatternSCM.h> #include "QueryModule.h" using namespace opencog; DECLARE_MODULE(QueryModule); QueryModule::QueryModule(CogServer& cs) : Module(cs), _pat(NULL) { } ...
806fcc07-f380-4ff1-9645-627e9f4934d7
{ "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/views/controls/textfield/textfield_controller.h" namespace views { TextfieldController::IsCommandIdEnabled(int command_id) const...
```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/views/controls/textfield/textfield_controller.h" namespace views { bool TextfieldController::IsCommandIdEnabled(int command_id) ...
3b2e5bb7-5845-4a8e-9a1c-176718a222ab
{ "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, Bookmarks) { // TODO(erikkay) no initial 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" // TODO(brettw) bug 19866: this test is disabled because it is flaky. IN_PROC_BROWSER...
a3920670-08fe-4ecb-90f9-91658d7dd2b7
{ "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" #include "chrome/browser/browser.h" #include "chrome/browser/pref_service.h" #include...
```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" #include "chrome/browser/browser.h" #include "chrome/browser/pref_service.h" #include...
1dcfa3d8-b145-4b60-8664-2166dacfa3bd
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" #if defined...
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" #if defined...
b6d22f64-c2d5-428f-942c-b46c4c2a4653
{ "language": "C++" }
```c++ // Copyright 2017, Dawid Kurek, <dawikur@gmail.com> #include "lel/operation/unary.hpp" #include "gtest/gtest.h" TEST(unary_test, logical_not_can_be_used_in_constexpr) { std::logical_not<> logical_not; static_assert(logical_not(false), ""); } TEST(unary_test, indirection_can_be_used_in_constexpr) { LeL...
```c++ // Copyright 2017, Dawid Kurek, <dawikur@gmail.com> #include "lel/operation/unary.hpp" #include "gtest/gtest.h" TEST(unary_test, logical_not_can_be_used_in_constexpr) { std::logical_not<> logical_not; static_assert(logical_not(false), ""); } ```
e28a141a-a5f9-40c0-896f-73ec9c289d82
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/common/net/test_url_fetcher_factory.h" TestURLFetcher::TestURLFetcher(int id, const GURL& url,...
```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 "chrome/common/net/test_url_fetcher_factory.h" TestURLFetcher::TestURLFetcher(int id, const GURL& url,...
dd180e56-4ef3-4019-9cc0-4df957dd0349
{ "language": "C++" }
```c++ // Validate multiple reads #include <sstream> #include <string> int main() { std::istringstream stream{"John Smith 32"}; std::string first_name; std::string family_name; int age; if (stream >> first_name && stream >> family_name && stream >> age) { // Use values } } // Ensure that multiple...
```c++ // Validate multiple reads #include <sstream> #include <string> int main() { std::istringstream stream{"Chief Executive Officer\n" "John Smith\n" "32"}; std::string position; std::string first_name; std::string family_name; int age; if (std::getline...
76347bc2-7162-4412-a768-abf709a96416
{ "language": "C++" }
```c++ void sink(...); int source(); // --- accept --- struct sockaddr { unsigned char length; int sa_family; char* sa_data; }; int accept(int, const sockaddr*, int*); void sink(sockaddr); void test_accept() { int s = source(); sockaddr addr; int size = sizeof(sockaddr); int a = accept(s, &addr, &size);...
```c++ void sink(...); int source(); // --- accept --- struct sockaddr { unsigned char length; int sa_family; char* sa_data; }; int accept(int, sockaddr*, int*); void sink(sockaddr); void test_accept() { int s = source(); sockaddr addr; int size = sizeof(sockaddr); int a = accept(s, &addr, &size); si...
080ed2fc-ecd5-47a4-b902-c83ea5065ea2
{ "language": "C++" }
```c++ /** @example user_touche.cpp Touche example. See <a href="https://github.com/damellis/ESP/wiki/%5BExample%5D-Touché-swept-frequency-capacitive-sensing">documentation on the wiki</a>. */ #include <ESP.h> BinaryIntArraySerialStream stream(115200, 160); TcpOStream oStream("localhost", 5204); GestureRecognitionP...
```c++ /** @example user_touche.cpp Touche example. See <a href="https://github.com/damellis/ESP/wiki/%5BExample%5D-Touché-swept-frequency-capacitive-sensing">documentation on the wiki</a>. */ #include <ESP.h> BinaryIntArraySerialStream stream(115200, 160); TcpOStream oStream("localhost", 5204); GestureRecognitionP...
2863c0b8-84e8-4364-a494-1b24a7ac9a2e
{ "language": "C++" }
```c++ // request symbols #include "cling/Interpreter/Interpreter.h" #include "cling/Interpreter/CValuePrinter.h" #include "cling/Interpreter/DynamicExprInfo.h" #include "cling/Interpreter/InterpreterCallbacks.h" #include "cling/Interpreter/LookupHelper.h" #include "cling/Interpreter/ValuePrinter.h" #include "cling/Int...
```c++ // request symbols #include "cling/Interpreter/Interpreter.h" #include "cling/Interpreter/CValuePrinter.h" #include "cling/Interpreter/DynamicExprInfo.h" #include "cling/Interpreter/InterpreterCallbacks.h" #include "cling/Interpreter/LookupHelper.h" #include "cling/Interpreter/ValuePrinter.h" #include "cling/Int...
2071631d-a0f7-4a40-83b2-31997869973c
{ "language": "C++" }
```c++ #include "RandomGenerator.h" RandomGenerator::RandomGenerator() { // reset random seed - to generate different values each time. std::srand(time(0)); } RandomGenerator::~RandomGenerator() { std::cout << "Random deleted" << std::endl; } int RandomGenerator::getRandomNumber(int min, int max, bool in...
```c++ #include "RandomGenerator.h" RandomGenerator::RandomGenerator() { // reset random seed - to generate different values each time. std::srand(time(0)); } RandomGenerator::~RandomGenerator() { std::cout << "Random deleted" << std::endl; } int RandomGenerator::getRandomNumber(int min, int max, bool in...
551c35bf-468d-46aa-80ec-fafbc59981e8
{ "language": "C++" }
```c++ /* Copyright (c) 2009 Stephen Kelly <steveire@gmail.com> */ #include "include.h" #include <QStringList> #include <QtPlugin> #include "parser.h" #include "template.h" #include <QDebug> IncludeNodeFactory::IncludeNodeFactory() { } Node* IncludeNodeFactory::getNode(const QString &tagContent, Parser *p) {...
```c++ /* Copyright (c) 2009 Stephen Kelly <steveire@gmail.com> */ #include "include.h" #include <QStringList> #include <QtPlugin> #include "parser.h" #include "template.h" #include <QDebug> IncludeNodeFactory::IncludeNodeFactory() { } Node* IncludeNodeFactory::getNode(const QString &tagContent, Parser *p) {...
5b4c9799-7abd-41ec-ac01-2544cfbf35a8
{ "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. // //===---------------------------------...
0d41219a-c718-4548-94d5-49ea42b66d53
{ "language": "C++" }
```c++ // Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 #include <svdpi.h> #include <cassert> #include "cosim.h" #include "spike_cosim.h" extern "C" { void *spike_cosim_init(const char *isa_string, svBitVecVal *start...
```c++ // Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 #include <svdpi.h> #include <cassert> #include "cosim.h" #include "spike_cosim.h" extern "C" { void *spike_cosim_init(const char *isa_string, svBitVecVal *start...
2acccf6e-96bd-4aff-b540-c61828fbd3fd
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s template<class X> class B { public: explicit B(X* p = 0); }; class A { public: A(int value) : m_a_value(value) {}; A(int value, A* client_A) : m_a_value (value), m_client_A (client_A) {} virtual ~A() {} private: int...
```c++ // RUN: %clang_cc1 -emit-llvm -g -triple x86_64-apple-darwin %s -o - | FileCheck %s template<class X> class B { public: explicit B(X* p = 0); }; class A { public: A(int value) : m_a_value(value) {}; A(int value, A* client_A) : m_a_value (value), m_client_A (client_A) {} virtual ~A() {} private: int...
33e0e766-5d07-48e1-a0e0-7c6f0290cf3d
{ "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" // This test is disabled. See bug 25746 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISA...
11178f1f-3e9d-4aa2-a2b5-b5bc6bea3d25
{ "language": "C++" }
```c++ /****************************************************** * This is CIR-KIT 3rd robot control driver. * Author : Arita Yuta(Kyutech) ******************************************************/ #include "cirkit_unit03_driver.hpp" int main(int argc, char** argv) { ros::init(argc, argv, "Third_robot_driver_node"); ...
```c++ /****************************************************** * This is CIR-KIT 3rd robot control driver. * Author : Arita Yuta(Kyutech) ******************************************************/ #include "cirkit_unit03_driver.hpp" int main(int argc, char** argv) { ros::init(argc, argv, "cirkit_unit03_driver_node")...
13823b00-7e56-49e5-b3d5-e29e9acfdebb
{ "language": "C++" }
```c++ // Copyright 2013 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/profiles/avatar_menu.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include...
```c++ // Copyright 2013 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/profiles/avatar_menu.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include...
ee979f65-abf7-4e0c-8704-e9f28edeee71
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/ui_test_utils.h" #includ...
```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 "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/ui_test_utils.h" #includ...
c48bdb81-eb9e-405c-8a97-92c6e9d14fb2
{ "language": "C++" }
```c++ // Copyright (c) 2014 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 "xwalk/experimental/native_file_system/virtual_root_provider.h" #include <tzplatform_config.h> #include <map> #include <string> Virtua...
```c++ // Copyright (c) 2014 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 "xwalk/experimental/native_file_system/virtual_root_provider.h" #include <tzplatform_config.h> #include <map> #include <string> Virtua...
87ee1261-73bb-43d0-8611-be00a2e6647d
{ "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 2011 Daniel Marth <danielmarth@gmx.at> // A QML-interface of Marble for the Meego o...
```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 2011 Daniel Marth <danielmarth@gmx.at> // A QML-interface of Marble for the Meego o...
7fe82631-cf4e-4299-9732-b8dff1a173ba
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/ui_test_utils.h" #includ...
```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 "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/ui_test_utils.h" #includ...
760406e2-ab45-423a-b884-90c2079f75d8
{ "language": "C++" }
```c++ #include "package_manager/packagemanagerconfig.h" #include <boost/log/trivial.hpp> void PackageConfig::updateFromPropertyTree(const boost::property_tree::ptree& pt) { CopyFromConfig(type, "type", pt); CopyFromConfig(os, "os", pt); CopyFromConfig(sysroot, "sysroot", pt); CopyFromConfig(ostree_server, "o...
```c++ #include "package_manager/packagemanagerconfig.h" #include <boost/log/trivial.hpp> void PackageConfig::updateFromPropertyTree(const boost::property_tree::ptree& pt) { CopyFromConfig(type, "type", pt); CopyFromConfig(os, "os", pt); CopyFromConfig(sysroot, "sysroot", pt); CopyFromConfig(ostree_server, "o...
c051e941-5b91-407b-8899-ea6d52cd1728
{ "language": "C++" }
```c++ // Regression test for a crash in getpwnam_r and similar interceptors. // RUN: %clangxx -O0 -g %s -o %t && %run %t #include <assert.h> #include <pwd.h> #include <signal.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> int main(void) { struct passwd pwd; struct passwd *pwdres; char buf[100...
```c++ // Regression test for a crash in getpwnam_r and similar interceptors. // RUN: %clangxx -O0 -g %s -o %t && %run %t #include <assert.h> #include <errno.h> #include <pwd.h> #include <signal.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> int main(void) { struct passwd pwd; struct passwd *pwd...
59429aa9-7698-4cbc-93f7-27540d31f9fc
{ "language": "C++" }
```c++ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "executor_metrics.h" namespace proton { void ExecutorMetrics::update(const vespalib::ThreadStackExecutorBase::Stats &stats) { maxPending.set(stats.queueSize.max()); accepted....
```c++ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "executor_metrics.h" namespace proton { void ExecutorMetrics::update(const vespalib::ThreadStackExecutorBase::Stats &stats) { maxPending.set(stats.queueSize.max()); accepted....
640cdb87-6f22-4765-a6b5-8b0075464f3e
{ "language": "C++" }
```c++ // Copyright 2015-2020 Elviss Strazdins. All rights reserved. #include <cstdlib> #include <shellapi.h> #include "SystemWin.hpp" #include "EngineWin.hpp" #include "../../utils/Log.hpp" int WINAPI WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPSTR, _In_ int) { try { int argc; LPWSTR* ...
```c++ // Copyright 2015-2020 Elviss Strazdins. All rights reserved. #include <cstdlib> #include <shellapi.h> #include "SystemWin.hpp" #include "EngineWin.hpp" #include "../../utils/Log.hpp" int WINAPI WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPSTR, _In_ int) { try { int argc; std::uni...
2d8f6d98-49ad-435d-8369-94f0012807fd
{ "language": "C++" }
```c++ #include "aquila/global.h" #include "aquila/source/generator/SineGenerator.h" #include "aquila/transform/FftFactory.h" #include "aquila/tools/TextPlot.h" int main() { // input signal parameters const std::size_t SIZE = 64; const Aquila::FrequencyType sampleFreq = 2000; const Aquila::FrequencyTyp...
```c++ #include "aquila/global.h" #include "aquila/source/generator/SineGenerator.h" #include "aquila/transform/FftFactory.h" #include "aquila/tools/TextPlot.h" int main() { // input signal parameters const std::size_t SIZE = 64; const Aquila::FrequencyType sampleFreq = 2000, f1 = 125, f2 = 700; Aquil...
2a81fc48-2414-462d-9251-2dace478414b
{ "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 "chromecast/media/cma/backend/media_pipeline_device.h" #include "chromecast/media/cma/backend/audio_pipeline_device_default.h" #include "...
```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 "chromecast/media/cma/backend/media_pipeline_device.h" #include "chromecast/media/cma/backend/audio_pipeline_device_default.h" #include "...
d7aa91f5-4583-4c45-a08d-ffebea979b91
{ "language": "C++" }
```c++ #include "MicroBit.h" extern "C" { void mp_run(void); void microbit_display_event(void); } static void event_listener(MicroBitEvent evt) { if (evt.value == MICROBIT_DISPLAY_EVT_ANIMATION_COMPLETE) { microbit_display_event(); } } void app_main() { uBit.MessageBus.listen(MICROBIT_ID...
```c++ #include "MicroBit.h" extern "C" { void mp_run(void); void microbit_display_event(void); } static void event_listener(MicroBitEvent evt) { if (evt.value == MICROBIT_DISPLAY_EVT_ANIMATION_COMPLETE) { microbit_display_event(); } } void app_main() { /* // debugging: print memory ...
03826a02-0bca-4085-be96-a9ea0173aba7
{ "language": "C++" }
```c++ // Copyright 2010-2014 The CefSharp Project. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "Stdafx.h" #include "JavascriptPropertyWrapper.h" #include "JavascriptObjectWrapper.h" #include "CefAppWrapper.h" usi...
```c++ // Copyright 2010-2014 The CefSharp Project. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "Stdafx.h" #include "JavascriptPropertyWrapper.h" #include "JavascriptObjectWrapper.h" #include "CefAppWrapper.h" usi...
871f2cbf-1dd9-4336-bc49-991b0dfdaadb
{ "language": "C++" }
```c++ // ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All right reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top leve...
```c++ // ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All right reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top leve...
936f06e5-bc7e-48e1-915f-20ee1d9a82ee
{ "language": "C++" }
```c++ // // C++ Implementation: requesttask // // Description: // // // Author: SUSE AG (C) 2004 // // Copyright: See COPYING file that comes with this distribution // // #include "gwfield.h" #include "request.h" #include "response.h" #include "requesttask.h" RequestTask::RequestTask( Task * parent ) : Task( pare...
```c++ // // C++ Implementation: requesttask // // Description: // // // Author: SUSE AG (C) 2004 // // Copyright: See COPYING file that comes with this distribution // // #include "gwfield.h" #include "request.h" #include "response.h" #include "requesttask.h" RequestTask::RequestTask( Task * parent ) : Task( pare...
9995e007-26ec-47d3-8da5-8defe5b37f7d
{ "language": "C++" }
```c++ #include "SDL.h" #include "resources/imageresource.h" namespace Zabbr { /** * Constructor. * * @param name The name of the image. * @param surface The surface of the image. */ ImageResource::ImageResource(std::string name, SDL_Surface* surface) : SDLSurfaceResource(name, surface) { ...
```c++ #include "SDL.h" #include "SDL_image.h" #include "resources/imageresource.h" namespace Zabbr { /** * Constructor. * * @param name The name of the image. * @param surface The surface of the image. */ ImageResource::ImageResource(std::string name, SDL_Surface* surface) : SDLSurfaceRes...
a1b34079-f4b1-4f4b-bef4-5ce7ad47adfb
{ "language": "C++" }
```c++ #include "../test.h" #include <cstdlib> class StrdupTest : public TestBase { public: StrdupTest() : TestBase("strdup") { } virtual void* Parse(const char* json) const { return strdup(json); } virtual char* Stringify(void* userdata) const { return strdup((char*)userdata); } vi...
```c++ #include "../test.h" #include <cstdlib> class StrdupTest : public TestBase { public: StrdupTest() : TestBase("strdup") { } virtual void* Parse(const char* json) const { return strdup(json); } virtual char* Stringify(void* userdata) const { return strdup((char*)userdata); } vi...
e60012ca-483c-4bc1-9ed3-e2c36211a2e4
{ "language": "C++" }
```c++ #ifdef STAN_OPENCL #include <stan/math/prim/mat.hpp> #include <stan/math/prim/arr.hpp> #include <gtest/gtest.h> TEST(ErrorHandlingOpenCL, checkThrows) { const char* function = "test_func"; const char* msg = "test"; EXPECT_THROW(stan::math::throw_openCL(function, msg), std::domain_error); } #else #include ...
```c++ #ifdef STAN_OPENCL #include <stan/math/prim/mat.hpp> #include <stan/math/prim/arr.hpp> #include <gtest/gtest.h> TEST(ErrorHandlingOpenCL, checkThrows) { const char* function = "test_func"; cl::Error e(-5, "CL_OUT_OF_RESOURCES"); EXPECT_THROW(stan::math::check_ocl_error(function, e), std::system_error); } ...
5d2fcb37-4445-4bb4-84b6-287d3b8665dd
{ "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. // //===---------------------------------...
deb7e900-71f1-4b08-bf17-f4336e73a0b8
{ "language": "C++" }
```c++ /* * var_len_pool_test.cpp - Test suite for varrable lengthed allocation pool */ #include "test_suite.h" #include "../src/VarLenPool.h" /* * VarLenPoolBasicTest() - This function allocates a series of memory * using an increasing sequence and then check * f...
```c++ /* * var_len_pool_test.cpp - Test suite for varrable lengthed allocation pool */ #include "test_suite.h" #include "../src/VarLenPool.h" /* * VarLenPoolBasicTest() - This function allocates a series of memory * using an increasing sequence and then check * f...
8be9f383-e38e-4673-a083-9fe568d95347
{ "language": "C++" }
```c++ /** TimeType.cpp Auto-generated code - do not modify. thinglang C++ transpiler, 0.0.0 **/ #include "../InternalTypes.h" #include "../../execution/Program.h" /** Methods of TimeType **/ void TimeType::__constructor__() { Program::push(Program::create<TimeInstance>()); } void TimeType::now()...
```c++ /** TimeType.cpp Auto-generated code - do not modify. thinglang C++ transpiler, 0.0.0 **/ #include "../InternalTypes.h" #include "../../execution/Program.h" /** Methods of TimeType **/ void TimeType::__constructor__() { Program::push(Program::create<TimeInstance>()); } void TimeType::now()...
9958ff25-b841-431d-95ea-11cc5763f05a
{ "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. // //===---------------------------------...
f344a673-141c-42ac-88c3-c6a52155e9c2
{ "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 "base/thread_local.h" #include <pthread.h> #include "base/logging.h" namespace base { // static void ThreadLocalPlatform::All...
```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 "base/thread_local.h" #include <pthread.h> #include "base/logging.h" namespace base { // static void ThreadLocalPlatform::All...
4a3e05f5-2182-4418-9912-c984d148a3fc
{ "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...
4de8f836-aa31-49f7-9f37-b453cb5c878f
{ "language": "C++" }
```c++ #include <iostream> #include <time.h> #include <cassert> #include "SerialPortReceiverThread.h" SerialPortReceiverThread::SerialPortReceiverThread( SerialPort& serialPort, ON_BYTE_RECEIVED onByteReceived) : serialPort(serialPort), onByteReceived(onByteReceived) { } bool SerialPortReceiverThread::run() { uin...
```c++ #include <iostream> #include <time.h> #include <cassert> #include "SerialPortReceiverThread.h" SerialPortReceiverThread::SerialPortReceiverThread( SerialPort& serialPort, ON_BYTE_RECEIVED onByteReceived) : serialPort(serialPort), onByteReceived(onByteReceived) { } bool SerialPortReceiverThread::run() { uin...
4391de2a-c977-41bb-b286-f7cd7f34c9ac
{ "language": "C++" }
```c++ /* * This file is part of the UnTech Editor Suite. * Copyright (c) 2016 - 2018, Marcus Rowe <undisbeliever@gmail.com>. * Distributed under The MIT License: https://opensource.org/licenses/MIT */ #include "mtgraphicsscenes.h" #include "mttilesetrenderer.h" #include "mttilesetresourceitem.h" #include "stampgr...
```c++ /* * This file is part of the UnTech Editor Suite. * Copyright (c) 2016 - 2018, Marcus Rowe <undisbeliever@gmail.com>. * Distributed under The MIT License: https://opensource.org/licenses/MIT */ #include "mtgraphicsscenes.h" #include "mttilesetrenderer.h" #include "mttilesetresourceitem.h" #include "stampgr...
772fc4e7-a139-426d-af23-85ab23d7e62c
{ "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" #...
930688e1-3715-4cba-bfb8-dade1baff2e0
{ "language": "C++" }
```c++ #include "OptionsFilename.h" #include <stdexcept> namespace { std::string filename; bool filenameSet = false; } const std::string& getOptionsFilename() { return filename; } void setOptionsFilename(const std::string & optionsFilename) { if (filenameSet) throw std::runtime_error("Options filenam...
```c++ #include "OptionsFilename.h" #include <stdexcept> namespace { std::string filename; bool filenameSet = false; } const std::string& getOptionsFilename() { return filename; } void setOptionsFilename(const std::string & optionsFilename) { if (filenameSet) { throw std::runtime_error("Options f...
107e51b5-d5a5-4c57-838d-5a802ec537e2
{ "language": "C++" }
```c++ // Clang on MacOS can find libc++ living beside the installed compiler. // This test makes sure our libTooling-based tools emulate this properly with // fixed compilation database. // // RUN: rm -rf %t // RUN: mkdir %t // // Install the mock libc++ (simulates the libc++ directory structure). // RUN: cp -r %S/Inp...
```c++ // Clang on MacOS can find libc++ living beside the installed compiler. // This test makes sure our libTooling-based tools emulate this properly with // fixed compilation database. // // RUN: rm -rf %t // RUN: mkdir %t // // Install the mock libc++ (simulates the libc++ directory structure). // RUN: cp -r %S/Inp...
46ae3a0d-79ff-42f2-a63d-952abdbe6fc7
{ "language": "C++" }
```c++ #include "Kontroller/Client.h" int main(int argc, char* argv[]) { Kontroller::Client client; client.setButtonCallback([](Kontroller::Button button, bool pressed) { printf("%s %s\n", Kontroller::getName(button), pressed ? "pressed" : "released"); }); client.setDialCallback([](Kontroller::D...
```c++ #include "Kontroller/Client.h" int main(int argc, char* argv[]) { const char* endpoint = argc > 1 ? argv[1] : "127.0.0.1"; Kontroller::Client client(endpoint); client.setButtonCallback([](Kontroller::Button button, bool pressed) { printf("%s %s\n", Kontroller::getName(button), pressed ? "pres...
91a89572-472b-43fe-a403-dafa49f51dc8
{ "language": "C++" }
```c++ #include <iostream> #include <wcl/tracking/LazySusan.h> using namespace std; using namespace wcl; int main(int argc, char* argv[]) { if (argc != 2) { cout << "Usage: lazy_susan [device]" << endl; return 1; } cout << "Connecting to Lazy Susan... "; LazySusan* ls = new LazySusan(argv[1]); Track...
```c++ #include <iostream> #include <wcl/tracking/LazySusan.h> using namespace std; using namespace wcl; int main(int argc, char* argv[]) { if (argc != 2) { cout << "Usage: lazy_susan [device]" << endl; return 1; } cout << "Connecting to Lazy Susan... "; LazySusan* ls = new LazySusan(argv[1]); Track...
81e0adab-0e94-494e-a013-69f1b91fb328
{ "language": "C++" }
```c++ /* * logger.cpp * */ #include "logger.h" namespace himan { HPDebugState logger::MainDebugState = himan::kInfoMsg; logger::logger() : itsDebugState(kInfoMsg), itsUserName("HimanDefaultLogger") { } logger::logger(const std::string& theUserName) : itsDebugState(MainDebugState), itsUserName(theUserName) { } lo...
```c++ /* * logger.cpp * */ #include "logger.h" namespace himan { HPDebugState logger::MainDebugState = himan::kDebugMsg; logger::logger() : itsDebugState(kInfoMsg), itsUserName("HimanDefaultLogger") { } logger::logger(const std::string& theUserName) : itsDebugState(MainDebugState), itsUserName(theUserName) { } l...