doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
c0983da3-9294-4c71-a954-0765e0c877ee
{ "language": "C++" }
```c++ #include "../../base/SRC_FIRST.hpp" #include "../../testing/testing.hpp" #include "../writer.hpp" #include "../../base/macros.hpp" UNIT_TEST(MemWriterEmpty) { vector<char> data; { MemWriter< vector<char> > writer(data); } TEST(data.empty(), (data)); } UNIT_TEST(MemWriterSimple) { vector<char> da...
```c++ #include "../../base/SRC_FIRST.hpp" #include "../../testing/testing.hpp" #include "../writer.hpp" #include "../file_writer.hpp" #include "../../base/macros.hpp" UNIT_TEST(MemWriterEmpty) { vector<char> data; { MemWriter< vector<char> > writer(data); } TEST(data.empty(), (data)); } UNIT_TEST(MemW...
70a799ae-743b-418c-b4ba-0ed25aa837ad
{ "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 "base/test/launcher/unit_test_launcher.h" namespace base { int LaunchUnitTests(int argc, char** argv, ...
```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 "base/test/launcher/unit_test_launcher.h" namespace base { int LaunchUnitTests(int argc, char** argv, ...
3d6360de-48ae-42ca-901b-e8456a067d59
{ "language": "C++" }
```c++ /* * Author: Laurent Goderre */ #include <stdio.h> #include <Arduino.h> #include "Target.h" //------------------------------------- // TODO: CALIBRATE THESE FOR SERVOS const int servoOffPosition = 150; const int servoOnPosition = 400; //------------------------------------- const String showingStr = "Showin...
```c++ /* * Author: Laurent Goderre */ #include <stdio.h> #include <Arduino.h> #include "Target.h" //------------------------------------- // TODO: CALIBRATE THESE FOR SERVOS const int servoOffPosition = 150; const int servoOnPosition = 400; //------------------------------------- const String showingStr = "Showin...
21538573-24f3-4ee7-a406-6a3fae219bf2
{ "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/net/async_dns_field_trial.h" #include "base/metrics/field_trial.h" #include "build/build_config.h" #include "chrome/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/net/async_dns_field_trial.h" #include "base/metrics/field_trial.h" #include "build/build_config.h" #include "chrome/c...
77d8bc36-2fb5-477a-88e8-f7c1645af9d9
{ "language": "C++" }
```c++ #include "common/application_info.h" namespace brightray { std::string GetApplicationName() { return std::string(); } std::string GetApplicationVersion() { return std::string(); } } ``` Set the user agent string correctly on Windows
```c++ #include "common/application_info.h" #include "base/file_version_info.h" #include "base/memory/scoped_ptr.h" #include "base/utf_string_conversions.h" namespace brightray { std::string GetApplicationName() { auto info = make_scoped_ptr(FileVersionInfo::CreateFileVersionInfoForModule(GetModuleHandle(nullptr))...
e10bd763-d47c-4b7c-8689-136cc8e59450
{ "language": "C++" }
```c++ #include <ncurses.h> #include <string> using namespace std; void menuShow(); void menuAdd(int pos, string str); void menuDone(); int main() { /* * init term */ initscr(); cbreak(); noecho(); clear(); /* * init title */ menuShow(); refresh(); while(...
```c++ #include <ncurses.h> #include <string> using namespace std; void menuShow(string title); void menuAdd(int pos, string str); void menuDone(); int main() { /* * init term */ initscr(); cbreak(); noecho(); clear(); /* * init title */ menuShow("TERMINAL QUEST")...
563fe1a1-541b-4ebf-be2c-46512c032a7b
{ "language": "C++" }
```c++ /* Copyright (c) 2010 David Bender assigned to Benegon Enterprises LLC * See the file LICENSE for full license information. */ #include <errno.h> #include "posix.hh" FD_Reader::FD_Reader(int fd) throw() : _fd(fd), _errno(0) { } FD_Reader::~FD_Reader() throw(){ /* Assume file is read only; don't really care...
```c++ /* Copyright (c) 2010 David Bender assigned to Benegon Enterprises LLC * See the file LICENSE for full license information. */ #include <errno.h> #include <unistd.h> #include "posix.hh" FD_Reader::FD_Reader(int fd) throw() : _fd(fd), _errno(0) { } FD_Reader::~FD_Reader() throw(){ /* Assume file is read onl...
43c58f56-4bd7-432d-9f44-b5968b8785bd
{ "language": "C++" }
```c++ #include "Transform.h" BEGIN_NAMESPACE_CA_DRAWING Transform::Transform() : position(0, 0) , scale(1, 1) , angle(0) { } Transform::~Transform() { } //########################################################################### void Transform::addTransform(const Transform& other) { position += other...
```c++ #include "Transform.h" BEGIN_NAMESPACE_CA_DRAWING Transform::Transform() : position(0, 0) , scale(1, 1) , angle(0) { } Transform::~Transform() { } //########################################################################### void Transform::addTransform(const Transform& other) { position += other...
52162124-b8ce-4fb9-891b-441395e2d6b0
{ "language": "C++" }
```c++ /************************************************************************************* * Copyright (C) 2012 by Alejandro Fiestas Olivares <afiestas@kde.org> * * * * This program is free software; you can redistrib...
```c++ /************************************************************************************* * Copyright (C) 2012 by Alejandro Fiestas Olivares <afiestas@kde.org> * * * * This program is free software; you can redistrib...
a015387d-984c-4491-b4f1-f72d62d1ebdc
{ "language": "C++" }
```c++ // Copyright 2014 Toggl Desktop developers. #include <windows.h> #include <psapi.h> #pragma comment(lib, "psapi.lib") #include <time.h> #include <string> static const int kFilenameBufferSize = 255; template <class string_type> inline typename string_type::value_type *WriteInto(string_type *str, size_t...
```c++ // Copyright 2014 Toggl Desktop developers. #include <windows.h> #include <psapi.h> #pragma comment(lib, "psapi.lib") #include <time.h> static const int kFilenameBufferSize = 255; template <class string_type> inline typename string_type::value_type *WriteInto(string_type *str, size_t length_with_null)...
84c48eab-bf4f-4508-8636-2aa482848cef
{ "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,...
2a6ab6f5-1047-4194-a3ce-995f10306555
{ "language": "C++" }
```c++ //===-- Passes.cpp - Target independent code generation passes ------------===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===-...
```c++ //===-- Passes.cpp - Target independent code generation passes ------------===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===-...
2bf3c50a-0c17-4a2d-b74c-c3fc92d3d2f9
{ "language": "C++" }
```c++ // csamisc_anonymousnamespaceinheader.t.cpp -*-C++-*- // ----------------------------------------------------------------------------- // Copyright 2011 Dietmar Kuehl http://www.dietmar-kuehl.de // Distributed under the Boost Software License, Version 1.0. (See file // L...
```c++ // csamisc_anonymousnamespaceinheader.t.cpp -*-C++-*- // ----------------------------------------------------------------------------- // Copyright 2011 Dietmar Kuehl http://www.dietmar-kuehl.de // Distributed under the Boost Software License, Version 1.0. (See file // L...
f54239bd-6bcc-4404-900c-fdd0cdf09346
{ "language": "C++" }
```c++ #include "omnicore/version.h" #include "config/bitcoin-config.h" #include <string> #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_SUITE(omnicore_version_tests) BOOST_AUTO_TEST_CASE(version_comparison) { BOOST_CHECK(OMNICORE_VERSION > 900300); // Master Core v0.0.9.3 } /** * The following tests ar...
```c++ #include "omnicore/version.h" #include "config/bitcoin-config.h" #include <string> #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_SUITE(omnicore_version_tests) BOOST_AUTO_TEST_CASE(version_comparison) { BOOST_CHECK(OMNICORE_VERSION > 900300); // Master Core v0.0.9.3 } /** * The following tests ar...
c77f4d08-4398-4dd5-9df8-dd77211db8f2
{ "language": "C++" }
```c++ #include <memory> #include "view.h" #include "dummyfrequencyprovider.h" #include "frequencyprovider.h" #include <emscripten.h> #include <SDL/SDL.h> extern "C" { EMSCRIPTEN_KEEPALIVE int run_fmv_with_frequency_provider(int width, int height) { std::shared_ptr<FMV::FrequencyProvider> provider(F...
```c++ #include <array> #include <memory> #include "view.h" #include "frequencyprovider.h" #include <emscripten.h> #include <SDL/SDL.h> namespace { class ModifiableFrequencyProvider : public FMV::FrequencyProvider { public: static std::array<float, 255> frequencyData; p...
9568bbde-c16f-4086-8e01-25eac232aa73
{ "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/glue/resource_loader_bridge.h" #include "net/http/http_response_headers.h" namespace webkit_glu...
```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/glue/resource_loader_bridge.h" #include "webkit/glue/webappcachecontext.h" #include "net/http/ht...
77a2a263-59fc-464e-8328-f82b9ccbbd76
{ "language": "C++" }
```c++ /* * Copyright 2008 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can * be found in the LICENSE file. */ // Portable interface for browser interaction - API invariant portions. #include "base/rand_util_c.h" #include "native_client/src/in...
```c++ /* * Copyright (c) 2011 The Native Client Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ // Portable interface for browser interaction - API invariant portions. #include "base/rand_util_c.h" #include "native_client/sr...
0691590b-6a6b-4072-8a0e-ef80916ca5ef
{ "language": "C++" }
```c++ // Copyright 2016 The 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 <memory> #include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_string.h" #include "xfa/fde/css/cfde_csssyntaxparser.h" #include "x...
```c++ // Copyright 2016 The 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 <memory> #include "core/fxcrt/cfx_retain_ptr.h" #include "core/fxcrt/fx_string.h" #include "xfa/fde/css/cfde_csssyntaxparser.h" #include "x...
e5ddff43-ad77-4dd4-94f2-a7e4c7f53b3e
{ "language": "C++" }
```c++ // Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon // We are making my contributions/submissions to this project solely in our // personal capacity and are not conveying any rights to any intellectual // property of any third parties. #include <Rosetta/Enchants/Power.hpp> namespace RosettaStone {...
```c++ // Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon // We are making my contributions/submissions to this project solely in our // personal capacity and are not conveying any rights to any intellectual // property of any third parties. #include <Rosetta/Enchants/Power.hpp> namespace RosettaStone {...
1ceb4c3a-f140-4f37-ae31-d4925cb703c2
{ "language": "C++" }
```c++ #include "mjolnir/directededgebuilder.h" namespace valhalla { namespace mjolnir { // Default constructor DirectedEdgeBuilder::DirectedEdgeBuilder() : speed_(0), length_(0) { } // Sets the length of the edge in kilometers. void DirectedEdgeBuilder::length(const float length) { length_ = length; } ...
```c++ #include "mjolnir/directededgebuilder.h" namespace valhalla { namespace mjolnir { // Default constructor DirectedEdgeBuilder::DirectedEdgeBuilder() : DirectedEdge() { } // Sets the length of the edge in kilometers. void DirectedEdgeBuilder::length(const float length) { length_ = length; } // Sets the end...
804bccd1-c97d-4bc4-9e45-90573425e9d0
{ "language": "C++" }
```c++ #include "Genes/Pawn_Advancement_Gene.h" #include <string> #include "Game/Board.h" #include "Pieces/Piece.h" #include "Utility.h" Pawn_Advancement_Gene::Pawn_Advancement_Gene() : Gene(0.0) { } Pawn_Advancement_Gene::~Pawn_Advancement_Gene() { } double Pawn_Advancement_Gene::score_board(const Board& board, C...
```c++ #include "Genes/Pawn_Advancement_Gene.h" #include <string> #include "Game/Board.h" #include "Pieces/Piece.h" #include "Utility.h" Pawn_Advancement_Gene::Pawn_Advancement_Gene() : Gene(0.0) { } Pawn_Advancement_Gene::~Pawn_Advancement_Gene() { } double Pawn_Advancement_Gene::score_board(const Board& board, C...
3ceb92c2-946c-4c16-94e9-5c3d95337f78
{ "language": "C++" }
```c++ /* * glc_declarativeview.cpp * * Created on: 22/04/2013 * Author: laumaya */ #include <QGLWidget> #include <GLC_Context> #include "glc_declarativeview.h" GLC_DeclarativeView::GLC_DeclarativeView(QWidget *pParent) : QDeclarativeView(pParent) { QDeclarativeView::setViewport(new QGLWidget(new...
```c++ /* * glc_declarativeview.cpp * * Created on: 22/04/2013 * Author: laumaya */ #include <QGLWidget> #include <GLC_Context> #include "glc_declarativeview.h" GLC_DeclarativeView::GLC_DeclarativeView(QWidget *pParent) : QDeclarativeView(pParent) { QDeclarativeView::setViewport(new QGLWidget(new...
b5359b40-831b-4e38-a186-a93987e90747
{ "language": "C++" }
```c++ #include <iostream> #include <Python.h> #include "character.h" using namespace std; static int error(const std::string & message){ std::cout << message << std::endl; //PyErr_Print(); return -1; } int main(int argc, char ** argv){ if (argc > 1){ Py_Initialize(); /* NO...
```c++ #include <iostream> #include <Python.h> #include "character.h" using namespace std; static int error(const std::string & message){ std::cout << message << std::endl; //PyErr_Print(); return -1; } int main(int argc, char ** argv){ if (argc > 1){ Py_Initialize(); /* NO...
e3945c8d-3dce-467f-a313-48cd44c5e1ee
{ "language": "C++" }
```c++ // Copyright (c) 2012 Cloudera, Inc. All rights reserved. // // This file contains the main() function for the state store process, // which exports the Thrift service StateStoreService. #include <glog/logging.h> #include <gflags/gflags.h> #include "sparrow/state-store-service.h" #include "util/cpu-info.h" DE...
```c++ // Copyright (c) 2012 Cloudera, Inc. All rights reserved. // // This file contains the main() function for the state store process, // which exports the Thrift service StateStoreService. #include <glog/logging.h> #include <gflags/gflags.h> #include <iostream> #include "common/status.h" #include "sparrow/state-...
f67b5b75-5ac2-458f-84ef-8285c4c3070b
{ "language": "C++" }
```c++ // Copyright 2014-present Bill Fisher. All rights reserved. #include "ofp/mptablestats.h" #include "ofp/writable.h" #include "ofp/constants.h" #include "ofp/log.h" #include "ofp/validation.h" using namespace ofp; void MPTableStatsBuilder::write(Writable *channel) { UInt8 version = channel->version(); if ...
```c++ // Copyright 2014-present Bill Fisher. All rights reserved. #include "ofp/mptablestats.h" #include "ofp/writable.h" #include "ofp/constants.h" #include "ofp/log.h" #include "ofp/validation.h" using namespace ofp; void MPTableStatsBuilder::write(Writable *channel) { UInt8 version = channel->version(); if ...
0d26fb4e-92fb-4337-ae83-8904749872ae
{ "language": "C++" }
```c++ /* * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required...
```c++ /* * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required...
1fc1e5cd-c783-4596-9fae-713cfd2b56b6
{ "language": "C++" }
```c++ /************************************************************************************* * Copyright (C) 2012 by Alejandro Fiestas Olivares <afiestas@kde.org> * * * * This program is free software; you can redistrib...
```c++ /************************************************************************************* * Copyright (C) 2012 by Alejandro Fiestas Olivares <afiestas@kde.org> * * * * This program is free software; you can redistrib...
d6666075-7b9d-46d1-80ff-40d508eb8451
{ "language": "C++" }
```c++ #include "sampling.h" namespace { static constexpr float M_2PI = 2.f * M_PI; } namespace sampling { __thread static xorshift64star<float> uniform{4}; std::pair<Vec, float> hemisphere() { // draw coordinates float u1 = uniform(); float u2 = uniform(); // u1 is cos(theta) auto z = u1; ...
```c++ #include "sampling.h" namespace { static constexpr float M_2PI = 2.f * M_PI; __thread static xorshift64star<float> uniform{4}; } namespace sampling { std::pair<Vec, float> hemisphere() { // draw coordinates float u1 = uniform(); float u2 = uniform(); // u1 is cos(theta) auto z = u1; ...
7b847e07-7aa0-43c3-be3f-30c0fe6d1530
{ "language": "C++" }
```c++ #include <cppcutter.h> #include "tuishogi.cpp" namespace tuishogi { void test_isMated(void) { using namespace osl; NumEffectState state((SimpleState(HIRATE))); bool mated = isMated(state); cut_assert_false(mated); } } // namespace tuishogi ``` Add a test of "showState()"
```c++ #include <cppcutter.h> #include "tuishogi.cpp" namespace tuishogi { void test_showState(void) { // Arrange using namespace osl; std::stringbuf string_out; std::streambuf* std_out = std::cout.rdbuf(&string_out); NumEffectState state((SimpleState(HIRATE))); const char* expected = "\ P1-KY-KE-GI-KI-O...
b0203f87-3f59-4ca7-ac58-69de84cf0689
{ "language": "C++" }
```c++ // RUN: %llvmgxx -S %s -o - struct QChar {unsigned short X; QChar(unsigned short); } ; struct Command { Command(QChar c) : c(c) {} unsigned int type : 4; QChar c; }; Command X(QChar('c')); ``` Make this testcase harder, to test the read case as well.
```c++ // RUN: %llvmgxx -S %s -o - struct QChar {unsigned short X; QChar(unsigned short); } ; struct Command { Command(QChar c) : c(c) {} unsigned int type : 4; QChar c; }; Command X(QChar('c')); void Foo(QChar ); void bar() { Foo(X.c); } ```
fcd67569-0077-45f8-8248-ade7bb60b4d1
{ "language": "C++" }
```c++ // Copyright (C) 2018 Elviss Strazdins // This file is part of the Ouzel engine. #include "ModelData.hpp" #include "core/Engine.hpp" #include "utils/Utils.hpp" namespace ouzel { namespace scene { bool ModelData::init(Box3 newBoundingBox, const std::vector<uint32_t> ...
```c++ // Copyright (C) 2018 Elviss Strazdins // This file is part of the Ouzel engine. #include "ModelData.hpp" #include "core/Engine.hpp" #include "utils/Utils.hpp" namespace ouzel { namespace scene { bool ModelData::init(Box3 newBoundingBox, const std::vector<uint32_t> ...
05c6fcd8-c9c2-4d1a-94ed-e684ecd69a4f
{ "language": "C++" }
```c++ // RUN: %clang_cc1 %s -emit-llvm-only -o - // https://bugs.llvm.org/show_bug.cgi?id=38356 // We only check that we do not crash. // ASAN increases stack usage, so we are hitting stack overflow before reaching // recursive template instantiation limit. // XFAIL: darwin && asan template <typename a, a b(unsigne...
```c++ // RUN: %clang_cc1 %s -emit-llvm-only -o - // https://bugs.llvm.org/show_bug.cgi?id=38356 // We only check that we do not crash. // This test can exceed stack usage in some configurations, so unless we can // properly handle that don't run it. // REQUIRES: thread_support template <typename a, a b(unsigned), i...
f0bc3505-43f5-421c-80a5-87cc16cb4cb3
{ "language": "C++" }
```c++ #include "server.h" using namespace std; void thread_loop(UserHandler * handler) { while (!handler->isReady()) { usleep(10000); } try { handler->loop(); } catch (...) { try { JsonDict answer; JsonString s = JsonString("Unknown error"); ...
```c++ #include "server.h" using namespace std; void thread_loop(UserHandler * handler) { while (!handler->isReady()) { usleep(10000); } try { handler->loop(); } catch (...) { try { JsonDict answer; answer.add("Error", new JsonString("Unknown error...
305c7306-1ac2-4fe0-a13b-b834da200b0c
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -emit-llvm-only -triple %itanium_abi_triple -fdump-record-layouts %s 2>/dev/null \ // RUN: | FileCheck %s union A { int f1: 3; A(); }; A::A() {} union B { char f1: 35; B(); }; B::B() {} // CHECK:*** Dumping AST Record Layout // CHECK-NEXT: 0 | union A // CHECK-NEXT: ...
```c++ // RUN: %clang_cc1 -emit-llvm-only -triple %itanium_abi_triple -fdump-record-layouts %s 2>/dev/null \ // RUN: | FileCheck %s union A { int f1: 3; A(); }; A::A() {} union B { char f1: 35; B(); }; B::B() {} // CHECK:*** Dumping AST Record Layout // CHECK-NEXT: 0 | union A // CHECK-NEXT: ...
7f3fd944-e067-4e26-a497-eafbf2a11cf8
{ "language": "C++" }
```c++ /* 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 <csignal> #include <ncurses.h> #include <cstdlib> #include "signals.hh" extern "C" void myexit(i...
```c++ /* 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 <csignal> #include <ncurses.h> #include <cstdlib> #include "signals.hh" extern "C" { static void...
56c1c705-1230-4812-aac7-5fd788531009
{ "language": "C++" }
```c++ // RUN: CINDEXTEST_EDITING=1 LIBCLANG_DISABLE_CRASH_RECOVERY=1 c-index-test -test-load-source-reparse 2 none -remap-file-0=%S/Inputs/reparse-issue.h,%S/Inputs/reparse-issue.h-0 -remap-file-1=%S/Inputs/reparse-issue.h,%S/Inputs/reparse-issue.h-1 -- %s 2>&1 | FileCheck %s #include "Inputs/reparse-issue.h" // CHEC...
```c++ // RUN: env CINDEXTEST_EDITING=1 LIBCLANG_DISABLE_CRASH_RECOVERY=1 c-index-test -test-load-source-reparse 2 none -remap-file-0=%S/Inputs/reparse-issue.h,%S/Inputs/reparse-issue.h-0 -remap-file-1=%S/Inputs/reparse-issue.h,%S/Inputs/reparse-issue.h-1 -- %s 2>&1 | FileCheck %s #include "Inputs/reparse-issue.h" // ...
04f95fe1-c67d-45aa-aa3f-5b09fce3f185
{ "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...
4562c7b2-add3-4330-a439-bd580da2faca
{ "language": "C++" }
```c++ #include <stdio.h> #include <string.h> /* memcpy() */ #include <stdlib.h> /* rand() */ #include "quick.hpp" #include "swap.hpp" void quick(int *data, const int size_of_data) { return quick(data, 0, size_of_data - 1); } void quick(int *data, const int start, const int end) { int size = end - start + 1;...
```c++ #include <stdio.h> #include <string.h> /* memcpy() */ #include <stdlib.h> /* rand() */ #include "quick.hpp" #include "swap.hpp" void quick(int *data, const int size_of_data) { return quick(data, 0, size_of_data - 1); } void quick(int *data, const int start, const int end) { if(start >= end) return; /*...
565b6d90-f0d9-4b73-909c-36e8c466cd8d
{ "language": "C++" }
```c++ #include <botan/botan.h> #include <botan/ecdsa.h> #include <memory> #include <iostream> using namespace Botan; int main() { try { std::auto_ptr<RandomNumberGenerator> rng( RandomNumberGenerator::make_rng()); EC_Domain_Params params = get_EC_Dom_Pars_by_oid("1.3.132.8"); ...
```c++ #include <botan/botan.h> #include <botan/ecdsa.h> #include <memory> #include <iostream> using namespace Botan; int main() { try { std::auto_ptr<RandomNumberGenerator> rng( RandomNumberGenerator::make_rng()); EC_Domain_Params params = get_EC_Dom_Pars_by_oid("1.3.132.0.8"); ...
e1be5f0c-3d1b-4faa-9536-7d463517b9bf
{ "language": "C++" }
```c++ #include "sparse_matrix.hpp" // SparseMatrix #include "parser.hpp" // getRows, parsePuzzle int main(int argc, char **argv) { std::string puzzle = "-----------0-\n" "-----------00\n" "----00--0000-\n" "00000000000--\n" "00000000000--\n" "0000000000---\n" "00000000-----\n" "0000000...
```c++ #include "sparse_matrix.hpp" // SparseMatrix #include "parser.hpp" // getRows, parsePuzzle constexpr char puzzle28[] = "-00--0000-\n" "00--000000\n" "00--000000\n" "000--00000\n" "00000--000\n" "000000--00\n" "000000--00\n" "-0000--00-"; constexpr char puzzle42[] = "-----------0-\n" ...
f7f1fd9f-1d5f-429f-91a7-921164d5d1b6
{ "language": "C++" }
```c++ #include "wallet/test/wallet_test_fixture.h" #include "rpc/server.h" #include "wallet/db.h" #include "wallet/wallet.h" WalletTestingSetup::WalletTestingSetup(const std::string& chainName): TestingSetup(chainName) { bitdb.MakeMock(); bool fFirstRun; pwalletMain = new CWallet("wallet_test.dat");...
```c++ // Copyright (c) 2016 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 "wallet/test/wallet_test_fixture.h" #include "rpc/server.h" #include "wallet/db.h" #include "wallet/wallet.h" Wa...
6e354a0d-5e6c-4904-9eba-f23989a97b6b
{ "language": "C++" }
```c++ /* * Copyright (c) Meta Platforms, Inc. and affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required ...
```c++ /* * Copyright (c) Meta Platforms, Inc. and affiliates. * * 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 ...
76cb5b36-5280-49ba-bbe0-480b0eabfee1
{ "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" #if defined(OS_LINUX) // See http://crbug.com/42943. #define MAYBE_Storage FLAKY_Stor...
85b11a8d-c9b4-4a8d-b5a0-3599f12c6e25
{ "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" #if defined(OS_WIN) // Always fails on Windows after r110181: http://crbug.com/104419...
de00036e-9ebd-4ed8-b4d4-e8e0969148a6
{ "language": "C++" }
```c++ /* * Copyright Regents of the University of Minnesota, 2016. This software is released under the following license: http://opensource.org/licenses/ * Source code originally developed at the University of Minnesota Interactive Visualization Lab (http://ivlab.cs.umn.edu). * * Code author(s): * Dan Orban (d...
```c++ /* * Copyright Regents of the University of Minnesota, 2016. This software is released under the following license: http://opensource.org/licenses/ * Source code originally developed at the University of Minnesota Interactive Visualization Lab (http://ivlab.cs.umn.edu). * * Code author(s): * Dan Orban (d...
42799fd9-9c8e-4654-8590-e118177f0e25
{ "language": "C++" }
```c++ #include <iostream> using namespace std; struct node { int val = 0; node * l = nullptr; node * r = nullptr; }; inline node* build(node *head, int value){ node *son = new node; son->val = value; if (head == nullptr) return son; node * aux = head, * nxt = head; while(nxt != nullptr){ aux = nxt;...
```c++ #include <bits/stdc++.h> using namespace std; struct node{ int val; node *left; node *right; node( int v ){ val = v; left = nullptr; right = nullptr; } node* insert(node *n, int val){ if(n == nullptr ) return new node(val); if(n->val > val) n->left = insert(n->left, val); else n->right = inser...
84cdbc79-7f13-46a6-9c79-76dee056572d
{ "language": "C++" }
```c++ #include <gloperate/input/AbstractEventProvider.h> #include <gloperate/input/AbstractEvent.h> #include <gloperate/navigation/AbstractMapping.h> namespace gloperate { AbstractEventProvider::AbstractEventProvider() { } AbstractEventProvider::~AbstractEventProvider() { for (AbstractMapping * mapping : m_...
```c++ #include <gloperate/input/AbstractEventProvider.h> #include <gloperate/input/AbstractEvent.h> #include <gloperate/navigation/AbstractMapping.h> namespace gloperate { AbstractEventProvider::AbstractEventProvider() { } AbstractEventProvider::~AbstractEventProvider() { // Unregister from mappings //...
ba75768e-ce39-4239-95b3-717ccbbaeba5
{ "language": "C++" }
```c++ //===- tools/seec-trace-view/Annotations.cpp ------------------------------===// // // SeeC // // This file is distributed under The MIT License (MIT). See LICENSE.TXT for // details. // //===----------------------------------------------------------------------===// /// /// \f...
```c++ //===- tools/seec-trace-view/Annotations.cpp ------------------------------===// // // SeeC // // This file is distributed under The MIT License (MIT). See LICENSE.TXT for // details. // //===----------------------------------------------------------------------===// /// /// \f...
da2d92ff-a95b-4607-9386-99c522f00216
{ "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...
c1c96e36-cab4-4ea0-b52f-4b49d52935d0
{ "language": "C++" }
```c++ #include "webview.h" #include <QPaintEvent> WebView::WebView(QWidget *parent) : QWebView(parent) , inLoading(false) { connect(this, SIGNAL(loadStarted()), this, SLOT(newPageLoading())); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(pageLoaded(bool))); } void WebView::paintEvent(QPaintEv...
```c++ #include "webview.h" #include <QPaintEvent> #include <QWebFrame> WebView::WebView(QWidget *parent) : QWebView(parent) , inLoading(false) { connect(this, SIGNAL(loadStarted()), this, SLOT(newPageLoading())); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(pageLoaded(bool))); page()->set...
0ac3da71-3533-47c7-84e9-1d7a228b587b
{ "language": "C++" }
```c++ #include <iostream> #include <vector> #include <assert.h> using namespace std; class ImageDithering { public: int count(string dithered, vector<string> screen) { unsigned d[26]; for (int i = 0; i < 26; i++) { d[i] = 0; } for (unsigned i = 0; i < dithered.length(); i++) { d[dithered...
```c++ #include <iostream> #include <vector> #include <assert.h> using namespace std; class ImageDithering { public: int count(string dithered, vector<string> screen) { unsigned d[26]; for (int i = 0; i < 26; i++) { d[i] = 0; } for (unsigned i = 0; i < dithered.length(); i++) { d[dithered...
3e8a75ac-d2f2-45e4-8556-5ca6f3d7d376
{ "language": "C++" }
```c++ #include <libclientserver.h> ScopedLock::ScopedLock(Mutex *m) { m_mutex = m; m_mutex->Lock(); m_locked = true; } ScopedLock::ScopedLock(Mutex *m, std::function<void()> ErrorHandler) : m_mutex(m) { if (m->TryLock()) { ErrorHandler(); } m_locked = true; } ScopedLock::~Scoped...
```c++ #include <libclientserver.h> ScopedLock::ScopedLock(Mutex *m) : m_mutex(m) { m_mutex->Lock(); m_locked = true; } ScopedLock::ScopedLock(Mutex *m, std::function<void()> ErrorHandler) : m_mutex(m) { if (m->TryLock()) { ErrorHandler(); } m_locked = true; } ScopedLock::~Scoped...
80516692-8738-4543-b3b6-49153aca0911
{ "language": "C++" }
```c++ ll rotatingCalipers(){ int ans = 0; int i = 0, j = dn.size()-1; while(i < (int)up.size() - 1 || j > 0){ // Entrou aqui: up[i] e dn[j] eh um antipodal pair ans = max(ans, dist2(up[i],dn[j])); if(i == (int)up.size()-1) j--; else if(j == 0) i++; else{ // Verifica qual o menor angulo a ser ro...
```c++ ll rotatingCalipers(){ int ans = 0; int i = 0, j = dn.size()-1; while(i < (int)up.size() - 1 || j > 0){ // Entrou aqui: up[i] e dn[j] eh um antipodal pair ans = max(ans, dist2(up[i],dn[j])); if(i == (int)up.size()-1) j--; else if(j == 0) i++; else{ // Verifica qual o menor angulo a ser ro...
86538ff6-aceb-42e9-8b4c-ad2b3ebec55c
{ "language": "C++" }
```c++ /* mbed Microcontroller Library * Copyright (c) 2021 ARM Limited * Copyright (c) 2021 Embedded Planet, Inc. * SPDX-License-Identifier: Apache-2.0 * * 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 o...
```c++ /* mbed Microcontroller Library * Copyright (c) 2021 ARM Limited * Copyright (c) 2021 Embedded Planet, Inc. * SPDX-License-Identifier: Apache-2.0 * * 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 o...
a390b509-e9bb-4181-8f14-48c93f915b8f
{ "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...
52039da3-26b7-45f0-85dc-e4a1262d6ce1
{ "language": "C++" }
```c++ #include "capu/util/ConsoleLogAppender.h" #include "capu/util/LogMessage.h" #include "capu/os/Console.h" #include <stdio.h> namespace capu { ConsoleLogAppender::~ConsoleLogAppender() { } void ConsoleLogAppender::logMessage(const LogMessage& logMessage) { m_logMutex.lock(); ...
```c++ #include "capu/util/ConsoleLogAppender.h" #include "capu/util/LogMessage.h" #include "capu/os/Console.h" #include "capu/os/Time.h" #include <stdio.h> namespace capu { ConsoleLogAppender::~ConsoleLogAppender() { } void ConsoleLogAppender::logMessage(const LogMessage& logMessage) { m_...
e10330db-d950-4df9-9ed7-ae4d989b158b
{ "language": "C++" }
```c++ #include <cstdint> #include <Magick++/Blob.h> #include <Magick++/Image.h> #include "utils.cc" #define FUZZ_ENCODER_STRING_LITERAL_X(name) FUZZ_ENCODER_STRING_LITERAL(name) #define FUZZ_ENCODER_STRING_LITERAL(name) #name #ifndef FUZZ_ENCODER #define FUZZ_ENCODER FUZZ_ENCODER_STRING_LITERAL_X(FUZZ_IMAGEMAGICK_E...
```c++ #include <cstdint> #include <Magick++/Blob.h> #include <Magick++/Image.h> #include "utils.cc" #define FUZZ_ENCODER_STRING_LITERAL_X(name) FUZZ_ENCODER_STRING_LITERAL(name) #define FUZZ_ENCODER_STRING_LITERAL(name) #name #ifndef FUZZ_ENCODER #define FUZZ_ENCODER FUZZ_ENCODER_STRING_LITERAL_X(FUZZ_IMAGEMAGICK_E...
974fd4e0-2dae-4087-b58c-6902f0ac417d
{ "language": "C++" }
```c++ #include <stdio.h> #include "../excercise04/make_random_data/make_random_data.hpp" #include "../excercise04/sort/quicksort.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...
```c++ #include <stdio.h> #include "../excercise04/make_random_data/make_random_data.hpp" #include "../excercise04/sort/quicksort.hpp" int quickselection(const int k, int *data, const int start, const int end) { if(start >= end) return data[start]; int pivot = partition(data, start, end); int p = pivot -...
b41bb949-fa83-414d-b97a-05bbaba02790
{ "language": "C++" }
```c++ /* * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All co...
```c++ /* * Copyright (c) 2020 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All co...
9906eda9-c3ae-498d-b60a-43bf65e14eb7
{ "language": "C++" }
```c++ #include "findTypeVariables.h" #include "type.h" #include "symbol.h" #include "symtab.h" FindVariableType::FindVariableType(Vec<VariableType*>* init_variableTypes) { variableTypes = init_variableTypes; } void FindVariableType::preProcessSymbol(Symbol* symbol) { if (dynamic_cast<TypeSymbol*>(symbol)) { ...
```c++ #include "findTypeVariables.h" #include "type.h" #include "symbol.h" #include "symtab.h" FindVariableType::FindVariableType(Vec<VariableType*>* init_variableTypes) { found = false; variableTypes = init_variableTypes; } void FindVariableType::preProcessSymbol(Symbol* symbol) { if (dynamic_cast<TypeSymbol*...
d19173b6-1501-4b23-95ae-d9ae2c0464cd
{ "language": "C++" }
```c++ #include "./SDACalculatePositions.h" SDACalculatePositions::SDACalculatePositions(const char* name, const char* title, const char* in_file_suffix, const char* out_file_suffix, const double threshold, const double positionCut) : JPetCommonAnalysisModule( name, title, in_file_suffix, out_f...
```c++ #include "./SDACalculatePositions.h" SDACalculatePositions::SDACalculatePositions(const char* name, const char* title, const char* in_file_suffix, const char* out_file_suffix, const double threshold, const double positionCut) : JPetCommonAnalysisModule( name, title, in_file_suffix, out_f...
141b2208-c110-43eb-b17e-5f288dd010de
{ "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 ...
a172a770-2020-4844-bbfe-078c53a08a6b
{ "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. // //===---------------------------------...
35158b53-b2d4-4d9b-b3be-b67bbd550a90
{ "language": "C++" }
```c++ #include "generator.h" #include <iostream> #include <fstream> using namespace Mugen; CharacterGenerator::CharacterGenerator(const std::string & filename): filename(filename){ } CharacterGenerator::~CharacterGenerator(){ } void CharacterGenerator::output(const std::string & file){ Mugen::PythonStream out...
```c++ #include "generator.h" #include <iostream> #include <fstream> using namespace Mugen; CharacterGenerator::CharacterGenerator(const std::string & filename): filename(filename){ } CharacterGenerator::~CharacterGenerator(){ } void CharacterGenerator::output(const std::string & file){ Mugen::PythonStream out...
087b96de-5190-4343-abbd-f8197941192b
{ "language": "C++" }
```c++ // Copyright 2019 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 "quic/masque/masque_utils.h" namespace quic { ParsedQuicVersionVector MasqueSupportedVersions() { QuicVersionInitializeSupportForIetfD...
```c++ // Copyright 2019 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 "quic/masque/masque_utils.h" namespace quic { ParsedQuicVersionVector MasqueSupportedVersions() { QuicVersionInitializeSupportForIetfD...
154df5cf-6808-4091-8793-b06e3b81d844
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -pedantic -fixit %s -o - | %clang_cc1 -fsyntax-only -pedantic -Werror -x c++ - /* This is a test of the various code modification hints that are provided as part of warning or extension diagnostics. All of the warnings will be fixed by -fixit, and the resulting file should compile cl...
```c++ // RUN: %clang_cc1 -pedantic -Wall -fixit %s -o - | %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -x c++ - /* This is a test of the various code modification hints that are provided as part of warning or extension diagnostics. All of the warnings will be fixed by -fixit, and the resulting file should ...
97b3b0c3-3991-4d1f-96e3-43ede5864318
{ "language": "C++" }
```c++ #include<ros/ros.h> #include<ics3/ics> #include<servo_msgs/IdBased.h> ics::ICS3* driver {nullptr}; ros::Publisher pub; void move(const servo_msgs::IdBased::ConstPtr& msg) { servo_msgs::IdBased result; result.id = msg->id; try { result.angle = driver->move(msg->id, ics::Angle::newDegree(msg->angle)); ...
```c++ #include<ros/ros.h> #include<servo_msgs/IdBased.h> #include<ics3/ics> ics::ICS3* driver {nullptr}; ros::Publisher pub; void move(const servo_msgs::IdBased::ConstPtr& msg) { servo_msgs::IdBased result; result.id = msg->id; try { result.angle = driver->move(msg->id, ics::Angle::newDegree(msg->angle)); ...
30449eb6-3e8d-4f2f-853e-a65c35a080f8
{ "language": "C++" }
```c++ // Copyright eeGeo Ltd (2012-2015), All Rights Reserved #include "WatermarkDataFactory.h" namespace ExampleApp { namespace Watermark { namespace View { WatermarkDataFactory::WatermarkDataFactory(const std::string& appName, ...
```c++ // Copyright eeGeo Ltd (2012-2015), All Rights Reserved #include "WatermarkDataFactory.h" namespace ExampleApp { namespace Watermark { namespace View { WatermarkDataFactory::WatermarkDataFactory(const std::string& appName, ...
44ae3677-c2b2-4449-b707-63d492f84be3
{ "language": "C++" }
```c++ // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/app_modal_dialog_queue.h" #include "chrome/browser/browser_list.h" void AppModalDialogQueue::AddDialog(AppModal...
```c++ // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/app_modal_dialog_queue.h" #include "chrome/browser/browser_list.h" void AppModalDialogQueue::AddDialog(AppModal...
b7c0b807-06df-4fb4-9547-1a4a485421c0
{ "language": "C++" }
```c++ #include<ros/ros.h> #include<servo_msgs/IdBased.h> #include<ics3/ics> ics::ICS3* driver {nullptr}; ros::Publisher pub; void move(const servo_msgs::IdBased::ConstPtr& msg) { servo_msgs::IdBased result; try { result.angle = driver->move(msg->id, ics::Angle::newDegree(msg->angle)); result.id = msg->id...
```c++ #include<ros/ros.h> #include<servo_msgs/IdBased.h> #include<ics3/ics> ics::ICS3* driver {nullptr}; ros::Publisher pub; void move(const servo_msgs::IdBased::ConstPtr& msg) { servo_msgs::IdBased result; try { result.angle = driver->move(msg->id, ics::Angle::newDegree(msg->angle)); result.id = msg->id...
751cce36-9211-4b1e-96eb-e6c2076b634f
{ "language": "C++" }
```c++ /** * Appcelerator Titanium - licensed under the Apache Public License 2 * see LICENSE in the root folder for details on the license. * Copyright (c) 2009 Appcelerator, Inc. All Rights Reserved. */ #include <kroll/kroll.h> #include "../app_binding.h" namespace ti { void AppBinding::Restart(const ValueList...
```c++ /** * Appcelerator Titanium - licensed under the Apache Public License 2 * see LICENSE in the root folder for details on the license. * Copyright (c) 2009 Appcelerator, Inc. All Rights Reserved. */ #include <kroll/kroll.h> #include "../app_binding.h" namespace ti { void AppBinding::Restart(const ValueList...
9f3ebe92-b6b4-43bc-803f-88b3357157a6
{ "language": "C++" }
```c++ #include <wangle/client/persistence/test/TestUtil.h> namespace wangle { std::string getPersistentCacheFilename() { char filename[] = "/tmp/fbtls.XXXXXX"; int fd = mkstemp(filename); close(fd); EXPECT_TRUE(unlink(filename) != -1); return std::string(filename); } } ``` Handle tmp dir on Android
```c++ /* * Copyright (c) 2016, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #incl...
6adcfda6-2b73-4751-bf3d-0ed05ba88206
{ "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...
4ea51481-7464-4e8e-9f3b-0d125db0e71f
{ "language": "C++" }
```c++ #include <kernel/rng.hpp> #include <kernel/cpuid.hpp> #include <kernel/os.hpp> #include <arch.hpp> #include <kprint> extern "C" void intel_rdrand(uint64_t*); extern "C" void intel_rdseed(uint64_t*); static void fallback_entropy(uint64_t* res) { uint64_t clock = (uint64_t) res; // this is horrible, better so...
```c++ #include <kernel/rng.hpp> #include <kernel/cpuid.hpp> #include <kernel/os.hpp> #include <arch.hpp> #include <kprint> extern "C" void intel_rdrand(uint64_t*); extern "C" void intel_rdseed(uint64_t*); static void fallback_entropy(uint64_t* res) { uint64_t clock = (uint64_t) res; // this is horrible, better so...
baafd81e-9364-41c3-9bb3-6e98a7e1a518
{ "language": "C++" }
```c++ // RUN: clang -fsyntax-only -verify %s namespace A { // expected-error {{error: previous definition is here}} int A; void f() { A = 0; } } void f() { A = 0; } // expected-error {{error: unexpected namespace name 'A': expected expression}} int A; // expected-error {{error: redefinition of 'A' as diff...
```c++ // RUN: clang -fsyntax-only -verify %s namespace A { // expected-error {{error: previous definition is here}} int A; void f() { A = 0; } } void f() { A = 0; } // expected-error {{error: unexpected namespace name 'A': expected expression}} int A; // expected-error {{error: redefinition of 'A' as different k...
87ef70cf-b535-46ea-b5f9-11eeb22691c7
{ "language": "C++" }
```c++ #include <unistd.h> #include <gtest/gtest.h> #include "getusername.h" TEST(GetUserName,simple) { // allocate a WCHAR_T buffer to receive username DWORD lpnSize = 64; WCHAR_T lpBuffer[lpnSize]; BOOL result = GetUserName(lpBuffer, &lpnSize); // GetUserName returns 1 on success ASSERT_EQ(1, result); // g...
```c++ #include <string> #include <vector> #include <unistd.h> #include <gtest/gtest.h> #include <scxcorelib/scxstrencodingconv.h> #include "getusername.h" using std::string; using std::vector; using SCXCoreLib::Utf16leToUtf8; TEST(GetUserName,simple) { // allocate a WCHAR_T buffer to receive username DWORD lpnSize...
87df39f1-a7d2-42ab-b1c3-8a549a65250b
{ "language": "C++" }
```c++ //===-- ubsan_init_standalone.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- ubsan_init_standalone.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
941e5eb2-0973-4423-875d-4cb8c7fc7aad
{ "language": "C++" }
```c++ #include "binary_threshold.h" namespace TooManyPeeps { BinaryThreshold::BinaryThreshold(const cv::Mat& original, cv::Mat& result, int threshold) : ProcessFilter(original, result) { this->threshold = threshold; } BinaryThreshold::BinaryThreshold(cv::Mat& image, int threshold) : BinaryThreshol...
```c++ #include "binary_threshold.h" namespace TooManyPeeps { BinaryThreshold::BinaryThreshold(const cv::Mat& original, cv::Mat& result, int threshold) : ProcessFilter(original, result) { this->threshold = threshold; } BinaryThreshold::BinaryThreshold(cv::Mat& image, int threshold) : BinaryThreshol...
058502bc-077e-4d86-889b-392bc2b01711
{ "language": "C++" }
```c++ /** * Appcelerator Titanium - licensed under the Apache Public License 2 * see LICENSE in the root folder for details on the license. * Copyright (c) 2009, 2010 Appcelerator, Inc. All Rights Reserved. */ #include "../network_status.h" #include <SystemConfiguration/SCNetworkReachability.h> namespace ti { v...
```c++ /** * Appcelerator Titanium - licensed under the Apache Public License 2 * see LICENSE in the root folder for details on the license. * Copyright (c) 2009, 2010 Appcelerator, Inc. All Rights Reserved. */ #include "../network_status.h" #include <SystemConfiguration/SCNetworkReachability.h> namespace ti { s...
a452f6c6-da21-49ec-8f8e-9bfd2fa4a328
{ "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 "common/content_client.h" #include "common/application_info.h" #include "base/stringprintf.h" #include "base/string_util.h"...
```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 "common/content_client.h" #include "common/application_info.h" #include "base/stringprintf.h" #include "base/string_util.h"...
8e6e4099-3472-4782-9526-18fe0e82b3dd
{ "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...
7e596a0f-402a-4a6b-894b-62b4839f639f
{ "language": "C++" }
```c++ #include <patlms/util/remove_file.h> #include <patlms/util/detail/cant_remove_file_exception.h> #include <string> #include <cstring> #include <cerrno> #include <boost/log/trivial.hpp> using namespace std; namespace util { void RemoveFile(const std::string &path, detail::SystemInterfacePtr system) { BOOST_L...
```c++ #include <patlms/util/remove_file.h> #include <patlms/util/detail/cant_remove_file_exception.h> #include <string> #include <cstring> #include <cerrno> #include <boost/log/trivial.hpp> using namespace std; namespace util { void RemoveFile(const std::string &path, detail::SystemInterfacePtr system) { BOOST_L...
0ae3e558-eb3a-4c8d-b4ac-d87f3b6720c1
{ "language": "C++" }
```c++ // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>. // // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of // Mathematics and Physics, Charles University in Prague, Czech Republic. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. ...
```c++ // This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>. // // Copyright 2016 Institute of Formal and Applied Linguistics, Faculty of // Mathematics and Physics, Charles University in Prague, Czech Republic. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. ...
56135478-76f4-4150-b923-850d8b968a1c
{ "language": "C++" }
```c++ #include "impl_send_posture.hpp" #include "servo_msgs/KrsServoDegree.h" std::map<std::string, const SendPosture*> SendPostureFactory::sends; const SendPosture* SendPostureFactory::get(const std::string& name, ros::NodeHandle& nh) { std::map<std::string, const SendPosture*>::const_iterator found_it = sends.f...
```c++ #include "impl_send_posture.hpp" #include "algorithm" #include "servo_msgs/KrsServoDegree.h" std::map<std::string, const SendPosture*> SendPostureFactory::sends; const SendPosture* SendPostureFactory::get(const std::string& name, ros::NodeHandle& nh) { std::map<std::string, const SendPosture*>::const_itera...
a27606ae-3f93-4bb0-83e3-224c1fa9a4ea
{ "language": "C++" }
```c++ #include "reg_language_translator.h" #include "orz/types.h" namespace Reg { namespace Internal { // TODO: Centralize (de)serialization the same way as for keyboard events boost::optional<LanguageTranslator::external_type> LanguageTranslator::get_value(internal_type const sval) { if (sval == "English") ...
```c++ #include "reg_language_translator.h" #include "orz/types.h" namespace Reg { namespace Internal { // TODO: Centralize (de)serialization the same way as for keyboard events boost::optional<LanguageTranslator::external_type> LanguageTranslator::get_value(internal_type const sval) { if (sval == "English") ...
5a062085-79ad-4568-b767-a856e30d90e0
{ "language": "C++" }
```c++ #include "./mesh_node.h" #include <string> #include "./graphics/gl.h" MeshNode::MeshNode(std::string assetFilename, int meshIndex, std::shared_ptr<Graphics::Mesh> mesh, Eigen::Matrix4f transformation) : assetFilename(assetFilename), meshIndex(meshIndex), mesh(mesh), t...
```c++ #include "./mesh_node.h" #include <string> #include "./graphics/gl.h" MeshNode::MeshNode(std::string assetFilename, int meshIndex, std::shared_ptr<Graphics::Mesh> mesh, Eigen::Matrix4f transformation) : assetFilename(assetFilename), meshIndex(meshIndex), mesh(mesh), t...
9115e305-d546-448d-910b-79cfe79d9eeb
{ "language": "C++" }
```c++ #include <fstream> #include <iostream> #include "person.pb.h" //#include "../pb2json.h" #include <pb2json.h> using namespace std; int main(int argc,char *argv[]) { // Test 1: read binary PB from a file and convert it to JSON ifstream fin("dump",ios::binary); fin.seekg(0,ios_base::end); size_t len = fin.te...
```c++ #include <fstream> #include <iostream> #include "person.pb.h" //#include "../pb2json.h" #include <pb2json.h> using namespace std; int main(int argc,char *argv[]) { // Test 1: read binary PB from a file and convert it to JSON ifstream fin("dump",ios::binary); fin.seekg(0,ios_base::end); size_t len = fin.te...
ecd373e0-542d-4df1-8d71-f206e59861b8
{ "language": "C++" }
```c++ #include "log4qt/dailyfileappender.h" #include "log4qt/simplelayout.h" #include <QTemporaryDir> #include <QtTest/QtTest> using Log4Qt::DailyFileAppender; class DailyFileAppenderTest : public QObject { Q_OBJECT private Q_SLOTS: void init(); void cleanup(); void testFileCreation(); private: ...
```c++ #include "log4qt/dailyfileappender.h" #include "log4qt/loggingevent.h" #include "log4qt/simplelayout.h" #include <QTemporaryDir> #include <QtTest/QtTest> using Log4Qt::DailyFileAppender; class DailyFileAppenderTest : public QObject { Q_OBJECT private Q_SLOTS: void init(); void cleanup(); vo...
7c7a0013-0389-48ae-8891-d27f0615d632
{ "language": "C++" }
```c++ #include <fstream> #include "rang.hpp" int main() { std::cout << rang::fg::blue << "\nShould be blue"; std::ofstream out("out.txt"); std::streambuf *coutbuf = std::cout.rdbuf(); std::cout.rdbuf(out.rdbuf()); std::string word = "not blue"; std::cout << "START " << rang::fg::blue << word << " END"; std::...
```c++ #define CATCH_CONFIG_MAIN #include "catch.hpp" #include "rang.hpp" #include <fstream> #include <string> std::string RCB(std::string input) { std::ofstream out("out.txt"); std::streambuf *coutbuf = std::cout.rdbuf(); std::cout.rdbuf(out.rdbuf()); std::cout << rang::fg::blue << input << rang::style::reset;...
769a7338-0148-46e5-8af2-8895ba1f58c7
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "remoting/host/event_executor_mac.h" namespace remoting { EventExecutorMac::EventExecutorMac(Capturer* capturer) : EventExecutor(c...
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "remoting/host/event_executor_mac.h" #include "remoting/protocol/messages_decoder.h" namespace remoting { EventExecutorMac::EventEx...
baf941e7-fe41-44ab-b640-3fcd2407faa1
{ "language": "C++" }
```c++ // Copyright (c) 2011 The Native Client 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 "native_client/src/shared/platform/nacl_check.h" #include "native_client/tests/ppapi_test_lib/test_interface.h" namespace { // ...
```c++ // Copyright (c) 2011 The Native Client 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 <unistd.h> #include "native_client/src/shared/platform/nacl_check.h" #include "native_client/tests/ppapi_test_lib/test_interface...
933d7d34-3e61-4ca0-bfa7-66d1807b895d
{ "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. // //===---------------------------------...
f1d9ba76-d143-41f9-85c6-f1650d785932
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fcxx-exceptions -fexceptions -fno-rtti -DTRY | FileCheck %s -check-prefix=TRY // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fcxx-exceptions -fexceptions -fno-rtti -DTHROW | FileCheck %s -chec...
```c++ // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fcxx-exceptions -fexceptions -fno-rtti -DTRY | FileCheck %s -check-prefix=TRY // FIXME: Disabled until catch IRgen change lands. // RUNX: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fcxx-exceptions...
a76e2c90-2db0-40e5-a175-a372958ad433
{ "language": "C++" }
```c++ #include <fastarduino/soft_uart.h> constexpr const board::InterruptPin RX = board::InterruptPin::D0_PD0_PCI2; #define PCI_NUM 2 REGISTER_UART_PCI_ISR(RX, PCI_NUM) // Buffers for UARX static const uint8_t INPUT_BUFFER_SIZE = 64; static char input_buffer[INPUT_BUFFER_SIZE]; int main() { board::init(); ...
```c++ #include <fastarduino/soft_uart.h> constexpr const board::InterruptPin RX = board::InterruptPin::D0_PD0_PCI2; #define PCI_NUM 2 REGISTER_UARX_PCI_ISR(RX, PCI_NUM) // Buffers for UARX static const uint8_t INPUT_BUFFER_SIZE = 64; static char input_buffer[INPUT_BUFFER_SIZE]; int main() { board::init(); ...
a353ee93-a84a-4e82-afc6-b5c483b9dbe9
{ "language": "C++" }
```c++ // RUN: %clang_cc1 %s -fsyntax-only -verify -Wmissing-noreturn -Wno-unreachable-code // A destructor may be marked noreturn and should still influence the CFG. namespace PR6884 { struct abort_struct { abort_struct() {} // Make this non-POD so the destructor is invoked. ~abort_struct() __attribute__((n...
```c++ // RUN: %clang_cc1 %s -fsyntax-only -verify -Wmissing-noreturn -Wno-unreachable-code // A destructor may be marked noreturn and should still influence the CFG. namespace PR6884 { struct abort_struct { abort_struct() {} // Make this non-POD so the destructor is invoked. ~abort_struct() __attribute__((n...
b6fdee43-0440-4151-abe1-56f7c647aff2
{ "language": "C++" }
```c++ #include <log4cpp/Category.hh> #include <log4cpp/Appender.hh> #include <log4cpp/OstreamAppender.hh> #include <log4cpp/Layout.hh> #include <log4cpp/PatternLayout.hh> #include <log4cpp/Priority.hh> #include "LoggerFactory.h" using namespace Log; bool LoggerFactory::isCreated = false; log4cpp::Category *LoggerFa...
```c++ #include <log4cpp/Category.hh> #include <log4cpp/Appender.hh> #include <log4cpp/OstreamAppender.hh> #include <log4cpp/Layout.hh> #include <log4cpp/PatternLayout.hh> #include <log4cpp/Priority.hh> #include "LoggerFactory.h" using namespace Log; bool LoggerFactory::isCreated = false; log4cpp::Category *LoggerFa...
2682e31c-2dd8-41a5-8894-e0cbf72c918d
{ "language": "C++" }
```c++ // This code is in the public domain -- castano@gmail.com #include "FileSystem.h" #include <nvcore/nvcore.h> #if NV_OS_WIN32 #include <direct.h> #else #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #endif using namespace nv; bool FileSystem::exists(const char * path) { #i...
```c++ // This code is in the public domain -- castano@gmail.com #include "FileSystem.h" #include <nvcore/nvcore.h> #if NV_OS_WIN32 #include <direct.h> #else #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #endif using namespace nv; bool FileSystem::exists(const char * path) { #i...
749a27aa-9139-46d2-81c1-965871d546f2
{ "language": "C++" }
```c++ // Copyright (c) 2013, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. #include <atomic> #incl...
```c++ // Copyright (c) 2013, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. #include <atomic> #incl...
775bcfc6-8bd6-4a9f-a324-aa46ce19c6c1
{ "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...
383df735-77a5-4b07-b9f7-40d5b524f809
{ "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. // //===---------------------------------...