doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
e658d9c2-b872-483a-af2d-0fb15103d34e
{ "language": "C++" }
```c++ // FIXME: The standalone module still seems to cause clang to want to test for // the existence of a 'foo' directory: // RUN: mkdir %t // RUN: cp %s %t // RUN: mkdir %t/foo // RUN: cd %t // RUN: not %clang_cc1 -fmodules -fsyntax-only %s 2>&1 | FileCheck %s // CHECK: error: no matching function for call to 'foo'...
```c++ // FIXME: The standalone module still seems to cause clang to want to test for // the existence of a 'foo' directory: // RUN: rm -rf %t // RUN: mkdir %t // RUN: cp %s %t // RUN: rm -rf %t/foo // RUN: mkdir %t/foo // RUN: cd %t // RUN: not %clang_cc1 -fmodules -fsyntax-only %s 2>&1 | FileCheck %s // CHECK: error...
62e807d8-0687-4052-8b7f-70e48c78582c
{ "language": "C++" }
```c++ #include <vector> #include <boost/any.hpp> #include <v8.h> #include "JSFunctionInvokable.hpp" #include "../JSObjectScript.hpp" #include "JSInvokableUtil.hpp" namespace Sirikata { namespace JS { boost::any JSFunctionInvokable::invoke(std::vector<boost::any>& params) { /* Invoke the function handle */ ...
```c++ #include <vector> #include <boost/any.hpp> #include <v8.h> #include "JSFunctionInvokable.hpp" #include "../JSObjectScript.hpp" #include "JSInvokableUtil.hpp" namespace Sirikata { namespace JS { boost::any JSFunctionInvokable::invoke(std::vector<boost::any>& params) { /* Invoke the function handle */ ...
612d7c35-3544-409f-bfa6-249e186930b3
{ "language": "C++" }
```c++ #include "TestUpdaterOptions.h" #include "TestUtils.h" #include "UpdaterOptions.h" void TestUpdaterOptions::testOldFormatArgs() { const int argc = 6; char* argv[argc]; argv[0] = "updater"; argv[1] = "CurrentDir=/path/to/app"; argv[2] = "TempDir=/tmp/updater"; argv[3] = "UpdateScriptFileName=/tmp/updater/...
```c++ #include "TestUpdaterOptions.h" #include "TestUtils.h" #include "UpdaterOptions.h" void TestUpdaterOptions::testOldFormatArgs() { const int argc = 6; char* argv[argc]; argv[0] = strdup("updater"); argv[1] = strdup("CurrentDir=/path/to/app"); argv[2] = strdup("TempDir=/tmp/updater"); argv[3] = strdup("Upd...
9bc2abcd-fe9a-4fd0-a93d-9af05d079734
{ "language": "C++" }
```c++ #include "Item.h" using namespace node; using namespace v8; namespace node_iTunes { // Convenience function that takes an iTunesItem instance (or any subclass) // and wraps it up into the proper JS class type, and returns it. // TODO: Implement some kind of Object Cache, so if the same instance is // at...
```c++ #include "Item.h" using namespace node; using namespace v8; namespace node_iTunes { // Convenience function that takes an iTunesItem instance (or any subclass) // and wraps it up into the proper JS class type, and returns it. // TODO: Implement some kind of Object Cache, so if the same instance is // at...
8de5dfc3-3802-4448-860d-915c49e6adfe
{ "language": "C++" }
```c++ #include <cstdio> #include <cstdint> #include <string> #include <memory> #include <list> #include "boost/format.hpp" #include "packet.h" #include "exceptions.h" #include "parser.h" namespace parse4880 { PGPPacket::PGPPacket(std::string contents) : contents_(contents) { } std::shared_ptr<PGPPacket> PGPPacket...
```c++ #include <cstdio> #include <cstdint> #include <string> #include <memory> #include <list> #include "boost/format.hpp" #include "packet.h" #include "exceptions.h" #include "parser.h" namespace parse4880 { PGPPacket::PGPPacket(std::string contents) : contents_(contents) { } std::shared_ptr<PGPPacket> PGPPacket...
d42f5f97-62ed-4943-ab05-1744e2b35fc4
{ "language": "C++" }
```c++ /* Copyright 2018 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 2018 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...
21c4c156-208e-4dac-8896-6e55f66ae48b
{ "language": "C++" }
```c++ #include "xchainer/python/error.h" #include "xchainer/error.h" #include "xchainer/python/common.h" namespace xchainer { namespace py = pybind11; // standard convention void InitXchainerError(pybind11::module& m) { py::register_exception<XchainerError>(m, "XchainerError"); py::register_exception<Dev...
```c++ #include "xchainer/python/error.h" #include "xchainer/error.h" #include "xchainer/python/common.h" namespace xchainer { namespace py = pybind11; // standard convention void InitXchainerError(pybind11::module& m) { py::register_exception<XchainerError>(m, "XchainerError"); py::register_exception<Bac...
4a378f3d-2cf6-49dc-a1ae-79e11c586928
{ "language": "C++" }
```c++ #include "../include/graph/dijkstra.cpp" #include "../include/graph/weighted_graph.cpp" #include "../include/others/fast_cin.cpp" #include "../include/others/fast_cout.cpp" using Graph = WeightedGraph<long long>; int main() { int n, m, s, t; fcin >> n >> m >> s >> t; Graph rg(n); for (int i = 0; i < m;...
```c++ #include "../include/graph/dijkstra.cpp" #include "../include/graph/weighted_graph.cpp" #include "../include/others/fast_cin.cpp" #include "../include/others/fast_cout.cpp" using Graph = WeightedGraph<long long>; int main() { int n, m, s, t; fcin >> n >> m >> s >> t; Graph rg(n); for (int i = 0; i < m;...
518ef191-0a9b-4de2-9ccb-f481513b27c8
{ "language": "C++" }
```c++ #include <catch.hpp> #include <string> #include "test_data.hpp" #include "libslic3r.h" using namespace Slic3r::Test; using namespace std::literals; SCENARIO("PrintObject: object layer heights") { GIVEN("20mm cube and config that has a 3mm nozzle and a 2mm requested layer height") { auto config {Sli...
```c++ #include <catch.hpp> #include <string> #include "test_data.hpp" #include "libslic3r.h" using namespace Slic3r::Test; using namespace std::literals; SCENARIO("PrintObject: object layer heights") { GIVEN("20mm cube and config that has a 3mm nozzle and a 2mm requested layer height") { auto config {Sli...
4b4ee491-27d6-4a41-99e8-b4434d7f9d78
{ "language": "C++" }
```c++ #include "log.h" #include "ethernetutil.h" void initializeEthernet(EthernetDevice* device, Server* server, uint8_t MACAddr[], uint8_t IPAddr[]) { debug("initializing Ethernet..."); device->ptrServer = server; Ethernet.begin(MACAddr, IPAddr); device->ptrServer->begin(); } // The message ...
```c++ #include "log.h" #include "ethernetutil.h" void initializeEthernet(EthernetDevice* device, Server* server, uint8_t MACAddr[], uint8_t IPAddr[]) { debug("initializing Ethernet..."); device->ptrServer = server; Ethernet.begin(MACAddr, IPAddr); device->ptrServer->begin(); } // The message ...
d417c363-edf5-4b25-97e2-6905d5cbb368
{ "language": "C++" }
```c++ /* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "SkFontHost.h" #include "SkTypeface.h" #include "SkTypeface_win.h" //static void SkFontHost::EnsureTypefaceAccessible(const SkTypeface& typeface) { //No s...
```c++ /* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "SkFontHost.h" #include "SkTypeface.h" //static void SkFontHost::EnsureTypefaceAccessible(const SkTypeface& typeface) { //No sandbox, nothing to do. } ```
9f667610-868b-4e17-94aa-33cdd530336f
{ "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 2009 Bastian Holst <bastianholst@gmx.de> // #include "KmlRegionTagHandler.h...
```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 2009 Bastian Holst <bastianholst@gmx.de> // #include "KmlRegionTagHandler.h...
c2a6627a-5dac-4b05-9b07-731e0c664b26
{ "language": "C++" }
```c++ // Copyright (c) 2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <core_io.h> #include <primitives/transaction.h> #include <test/fuzz/fuzz.h> #include <util/strencodings.h> #inclu...
```c++ // Copyright (c) 2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <core_io.h> #include <primitives/transaction.h> #include <test/fuzz/fuzz.h> #include <util/strencodings.h> #inclu...
bdca175c-e4d8-4a40-95d6-41e8c191fd67
{ "language": "C++" }
```c++ #include "mem/st/visitor/DepBuilder.hpp" namespace mem { namespace st { namespace visitor { DepBuilder::DepBuilder () { _name = "st.DepBuilder"; } bool DepBuilder::visit (st::Symbol* sym) { printf("Visit...\n"); if (sym->isClassSymbol()) { visitClass(static_cast<st::Class*>(sym)); } r...
```c++ #include "mem/st/visitor/DepBuilder.hpp" namespace mem { namespace st { namespace visitor { DepBuilder::DepBuilder () { _name = "st.DepBuilder"; } bool DepBuilder::visit (st::Symbol* sym) { if (sym->isClassSymbol()) { visitClass(static_cast<st::Class*>(sym)); } return true; } void DepBu...
497360d7-649e-4f61-8747-2553a3d73b66
{ "language": "C++" }
```c++ #include <MetaEvent.h> #include <MetaFactory.h> #include <ratio> namespace test { namespace metaEventSuite { using namespace id::attribute; using namespace std; class MetaEventSuite : public ::testing::Test { public: ID posID = Position::value(); MetaFactory& f=MetaFactory::instance(); MetaEvent ...
```c++ #include <MetaEvent.h> #include <MetaFactory.h> #include <ratio> namespace test { namespace metaEventSuite { using namespace id::attribute; using namespace std; class MetaEventSuite : public ::testing::Test { public: ID posID = Position::value(); MetaFactory& f=MetaFactory::instance(); MetaEvent ...
22b5b20d-5788-42d6-aa5e-3810a095faa9
{ "language": "C++" }
```c++ // RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s // FIXME: align attribute print // CHECK: int x __attribute__((aligned(4, 0))); int x __attribute__((aligned(4))); // FIXME: Print this at a valid location for a __declspec attr. // CHECK: int y __declspec(align(4, 1)); __declspec(align(4)) int y...
```c++ // RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s // FIXME: align attribute print // CHECK: int x __attribute__((aligned(4, 0))); int x __attribute__((aligned(4))); // FIXME: Print this at a valid location for a __declspec attr. // CHECK: int y __declspec(align(4, 1)); __declspec(align(4)) int y...
96075dcb-9f17-4edd-98ed-0ecda51e06df
{ "language": "C++" }
```c++ // This file is part of nbind, copyright (C) 2014-2015 BusFaster Ltd. // Released under the MIT license, see LICENSE. #include <cstdio> #include "nbind/api.h" #include "Coord.h" class Nullable { public: static Coord *getCoord() { return(new Coord(60, 25)); } static Coord *getNull() { return(nullptr)...
```c++ // This file is part of nbind, copyright (C) 2014-2015 BusFaster Ltd. // Released under the MIT license, see LICENSE. #include <cstdio> #include "nbind/api.h" #include "Coord.h" class Nullable { public: static Coord *getCoord() { return(new Coord(60, 25)); } static Coord *getNull() { return(nullptr)...
ac42d707-ebe0-403d-b90c-20adba585720
{ "language": "C++" }
```c++ #include "mdist.hpp" #include "../search/idastar.hpp" #include "../search/astar.hpp" #include "../incl/utils.hpp" #include <cstdio> static void search(TilesMdist &, Search<TilesMdist> &, TilesMdist::State &); int main(int argc, char *argv[]) { TilesMdist d(stdin); // Idastar<TilesMdist, true, true> srch; Ast...
```c++ #include "mdist.hpp" #include "../search/idastar.hpp" #include "../search/astar.hpp" #include "../incl/utils.hpp" #include <cstdio> static void search(TilesMdist&, Search<TilesMdist>&, TilesMdist::State&); static Search<TilesMdist> *getsearch(int, char *[]); int main(int argc, char *argv[]) { TilesMdist d(std...
a2ad7916-0e0f-4ca6-8f5d-5e51d2c10a20
{ "language": "C++" }
```c++ /** * @copyright Copyright 2017 The J-PET Framework 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 find a copy of the License in the LICENCE file. * * Unless required by applica...
```c++ /** * @copyright Copyright 2017 The J-PET Framework 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 find a copy of the License in the LICENCE file. * * Unless required by applica...
fbc6c97d-f7e1-4619-a49d-66773d97bb21
{ "language": "C++" }
```c++ #include <cstdarg> #include <ncurses.h> static const char* mes = NULL; extern bool showing_message; bool showing_message = false; static void showmes() { int y,x,rows,_; getyx(stdscr,y,x); getmaxyx(stdscr,rows,_); move(rows-1,0); clrtoeol(); printw(mes); move(y,x); } void hook_sh...
```c++ #include <cstdarg> #include <ncurses.h> static const char* mes = NULL; extern bool showing_message; bool showing_message = false; static void showmes() { int y,x,rows,_; getyx(stdscr,y,x); getmaxyx(stdscr,rows,_); move(rows-1,0); clrtoeol(); printw("%s",mes); move(y,x); } void ho...
bccd95ee-c885-4ca4-8f30-2ab95fc324ce
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -main-file-name cxx-virtual-destructor-calls.cpp %s -o - -fprofile-instr-generate | FileCheck %s struct Member { ~Member(); }; struct A { virtual ~A(); }; struct B : A { Member m; virtual ~B(); }; // Complete dtor // CHECK: @__llvm_profil...
```c++ // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -main-file-name cxx-virtual-destructor-calls.cpp %s -o - -fprofile-instr-generate | FileCheck %s struct Member { ~Member(); }; struct A { virtual ~A(); }; struct B : A { Member m; virtual ~B(); }; // Complete dtor // CHECK: @__llvm_profile_nam...
c4841d5d-efe4-4b98-a99e-63368b2c03da
{ "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. // //===-...
6ef5abae-d1d4-4228-85c9-ad9d49ee224d
{ "language": "C++" }
```c++ // Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/native_library.h" #include <dlfcn.h> #include "base/file_path.h" #include "base/logging.h" namespace base { // static Native...
```c++ // Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/native_library.h" #include <dlfcn.h> #include "base/file_path.h" #include "base/logging.h" namespace base { // static Native...
515bae56-fa77-445c-a351-18ace04f576a
{ "language": "C++" }
```c++ #include<string> using namespace std; class CCipher { public: string decode(string cipherText, int shift) { string orig; for (char c : cipherText) { orig += 'A' + (c - 'A' - shift) % 26 ; //orig.append(); } return orig; } }; ``` Fix SRM 147, Div 2, Problem CCipher
```c++ #include<cassert> #include<string> using namespace std; class CCipher { public: string decode(string cipherText, int shift) { string orig; for (char c : cipherText) { orig += 'A' + (c - 'A' - shift + 26) % 26 ; } return orig; } }; int main() { CCipher cc; assert(cc.decode("ABCDEFG...
62126f8b-9f16-4434-91b8-21484730e628
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT="throw()" -DBAD_ALLOC="throw(std::bad_alloc)" // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC= // RUN: %clang_cc1 -std=c++1y %s -verify -fexce...
```c++ // RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT="throw()" -DBAD_ALLOC="throw(std::bad_alloc)" // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -DNOEXCEPT=noexcept -DBAD_ALLOC= // RUN: %clang_cc1 -std=c++1y %s -verify -fexce...
a6c2cc44-d3f2-4658-9be4-075737dcccd5
{ "language": "C++" }
```c++ /* * * Copyright (C) 2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "source/loader/driver_discovery.h" #include "source/inc/ze_util.h" namespace loader { static const char *knownDriverNames[] = { MAKE_LIBRARY_NAME("ze_intel_gpu", "1"), }; std::vector<DriverLibraryPath> disco...
```c++ /* * * Copyright (C) 2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "source/loader/driver_discovery.h" #include "source/inc/ze_util.h" #include <iostream> #include <sstream> #include <string> namespace loader { static const char *knownDriverNames[] = { MAKE_LIBRARY_NAME("ze_i...
c14c8103-63d1-4bf0-878d-a308692101fd
{ "language": "C++" }
```c++ // Copyright (c) 2013 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #include "atom/common/native_mate_converters/gfx_converter.h" #include "atom/common/node_includes.h" namespace { void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8:...
```c++ // Copyright (c) 2013 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #include "atom/common/native_mate_converters/gfx_converter.h" #include "atom/common/node_includes.h" namespace { void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8:...
4aded2da-663b-4f7f-86e4-d7be3dafaf98
{ "language": "C++" }
```c++ // PR1013 // Check to make sure debug symbols use the correct name for globals and // functions. Will not assemble if it fails to. // RUN: %clang_cc1 -emit-llvm -g -o - %s | FileCheck %s // CHECK: @"\01f\01oo" int foo __asm__("f\001oo"); int bar() { return foo; } ``` Modify the check line to be happier on ...
```c++ // PR1013 // Check to make sure debug symbols use the correct name for globals and // functions. Will not assemble if it fails to. // RUN: %clang_cc1 -emit-llvm -g -o - %s | FileCheck %s // CHECK: f\01oo" int foo __asm__("f\001oo"); int bar() { return foo; } ```
c4e4be56-c16f-4a7c-bb3b-2a75103dba09
{ "language": "C++" }
```c++ #include <cuda_runtime_api.h> #include <stdio.h> int main(void) { int num_devices = 0; cudaGetDeviceCount(&num_devices); if(num_devices > 0) { cudaDeviceProp properties; cudaGetDeviceProperties(&properties, 0); printf("--gpu-architecture=sm_%d%d", properties.major, properties.minor); ret...
```c++ #include <cuda_runtime_api.h> #include <stdio.h> #include <stdlib.h> void usage(const char *name) { printf("usage: %s [device_id]\n", name); } int main(int argc, char **argv) { int num_devices = 0; int device_id = 0; if(argc == 2) { device_id = atoi(argv[1]); } else if(argc > 2) { usage...
ea3c7266-0ce6-431e-8ac8-ae9d0d82752c
{ "language": "C++" }
```c++ // RUN: CINDEXTEST_EDITING=1 c-index-test -test-load-source local %s -Wuninitialized -Werror=unused 2>&1 | FileCheck -check-prefix=DIAGS %s // Make sure -Wuninitialized works even though the header had a warn-as-error occurrence. // DIAGS: error: unused variable 'x' // DIAGS: warning: variable 'x1' is uninitia...
```c++ // RUN: env CINDEXTEST_EDITING=1 c-index-test -test-load-source local %s -Wuninitialized -Werror=unused 2>&1 | FileCheck -check-prefix=DIAGS %s // Make sure -Wuninitialized works even though the header had a warn-as-error occurrence. // DIAGS: error: unused variable 'x' // DIAGS: warning: variable 'x1' is unin...
92d77ec1-32cb-47b9-8b32-d07b453b347f
{ "language": "C++" }
```c++ #include "common.th" .global putnum // putnum takes number in C, (row,col) in D,E, and field width in F putnum: pushall(h,i,j,k,l,m) h <- 0x100 h <- h << 8 // h is video base k <- d * 80 + e // k is offset into display k <- k + f // start at right side of field i...
```c++ #include "common.th" .global putnum // putnum takes number in C, (row,col) in D,E, and field width in F putnum: pushall(h,i,j,k,l,m) h <- 0x10000 // h is video base k <- d * 80 + e // k is offset into display k <- k + f // start at right side of field i <- rel(hexes) ...
52bbb845-cefd-44c6-9b5c-ab6d74c9a948
{ "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 "views/events/event.h" #include "base/logging.h" #include "ui/aura/event.h" namespace views { /////////////////////////////////////...
```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 "views/events/event.h" #include "base/logging.h" #include "ui/aura/event.h" namespace views { /////////////////////////////////////...
0fd197e3-6283-4c17-b3ba-67a96bbae47e
{ "language": "C++" }
```c++ // Nikita Kouevda // 2013/11/04 #include <iostream> #include "prime.hpp" using namespace std; int main(int argc, char *argv[]) { int i, n; char *endptr; if (argc < 2) { cerr << "usage: prime number ..." << endl; return 1; } for (i = 1; i < argc; ++i) { n = strtol(argv[i], &endptr, 10)...
```c++ // Nikita Kouevda // 2013/11/04 #include <cstdlib> #include <iostream> #include "prime.hpp" using namespace std; int main(int argc, char *argv[]) { int i, n; char *endptr; if (argc < 2) { cerr << "usage: prime number ..." << endl; return 1; } for (i = 1; i < argc; ++i) { n = strtol(ar...
7069ae93-e961-4c15-93f6-9225d725d668
{ "language": "C++" }
```c++ #include <curses.h> #include <iostream> #include "mopViewer.h" #include <string> int main() { mopViewer mopViewers; std::string fileName; int skipCount; std::cout << "Enter the MopFile Name (No need to use extension/location: "; std::cin >> fileName; std::cout <...
```c++ #include <curses.h> #include <iostream> #include "mopViewer.h" #include <string> int main() { mopViewer mopViewers; std::string fileName; int skipCount; std::cout << "Enter the MopFile Name (No need to use extension/location: "; std::cin >> fileName; std::cout <...
3950faaa-7ab0-44df-b3f6-97094c0d16a9
{ "language": "C++" }
```c++ #include <catch.hpp> #include <chi/Context.hpp> #include <chi/DataType.hpp> #include <chi/LangModule.hpp> #include <chi/NodeType.hpp> #include <chi/Support/Result.hpp> #include <chi/Fetcher/Fetcher.hpp> #include <llvm/IR/DerivedTypes.h> using namespace chi; namespace fs = boost::filesystem; TEST_CASE("Contex...
```c++ #include <catch.hpp> #include <chi/Context.hpp> #include <chi/DataType.hpp> #include <chi/LangModule.hpp> #include <chi/NodeType.hpp> #include <chi/Support/Result.hpp> #include <chi/Fetcher/Fetcher.hpp> #include <llvm/IR/DerivedTypes.h> using namespace chi; namespace fs = boost::filesystem; TEST_CASE("Contex...
9f4fdefb-982e-47ee-91fe-f9a9cf3b713d
{ "language": "C++" }
```c++ #include "includes/SWidgets/SSearchArea.hpp" #include "includes/SMainWindow.hpp" SSearchArea::SSearchArea(const QIcon & icon, SMainWindow * parent) : QLineEdit(parent), m_parent(parent), m_icon(icon) { setTextMargins(18, 0, 0, 0); connect(this, &SSearchArea::returnPressed, this, &SSearchArea::loa...
```c++ #include "includes/SWidgets/SSearchArea.hpp" #include "includes/SMainWindow.hpp" SSearchArea::SSearchArea(const QIcon & icon, SMainWindow * parent) : QLineEdit(parent), m_parent(parent), m_icon(icon) { setTextMargins(18, 0, 0, 0); connect(this, &SSearchArea::returnPressed, this, &SSearchArea::loa...
1845d3a7-02e8-4dca-9322-3f1218af2caf
{ "language": "C++" }
```c++ #include "Course.h" #include <iostream> using namespace std; int main() { // test instantiation of a Course object. cout << "Testing instantiation of a Course object:" << endl; Course course("test-0"); cout << "Created " << course.getName() << endl; cout << "All Assignments:" << endl; for (auto ...
```c++ #include "Course.h" #include <cstdio> #include <iostream> using namespace std; int main() { if (remove("test-0.sqlite") != 0) { cout << "Error with deletion of database file\n"; } else { cout << "Database file successfully deleted\n"; } // test instantiation of a Course object. cout << "Tes...
357493a1-8c0d-4ffc-b258-d64a0a2febee
{ "language": "C++" }
```c++ // Copyright 2014 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd #include "media/base/closure_thread.h" namespace media { ClosureThread::ClosureThread( ...
```c++ // Copyright 2014 Google Inc. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd #include "media/base/closure_thread.h" namespace media { ClosureThread::ClosureThread( ...
9929169c-0875-44ae-ab38-8ae7b9979479
{ "language": "C++" }
```c++ #include "catch.hpp" #include "library.hpp" #include <functional> namespace { #ifdef _WIN32 const std::string testlibname("testlib.dll"); #else const std::string testlibname("libtestlib.so"); #endif } SCENARIO("Loading a shared library") { GIVEN("library is loaded successfully") { loader::Library lib(test...
```c++ #include "catch.hpp" #include "library.hpp" #include <functional> namespace { #ifdef _WIN32 const std::string testlibname("testlib.dll"); #else const std::string testlibname("libtestlib.so"); #endif } SCENARIO("Loading a shared library") { GIVEN("library is loaded successfully") { loader::Library lib(test...
c2d650b7-cae7-4e03-a7ba-24d34908eff8
{ "language": "C++" }
```c++ #include "tcframe/aggregator.hpp" #include "tcframe/evaluator.hpp" #include "tcframe/generator.hpp" #include "tcframe/grader.hpp" #include "tcframe/os.hpp" #include "tcframe/runner.hpp" #include "tcframe/spec.hpp" #include __TCFRAME_SPEC_FILE__ using tcframe::Runner; int main(int argc, char* argv[]) { Run...
```c++ #include "tcframe/runner.hpp" #include __TCFRAME_SPEC_FILE__ using tcframe::Runner; int main(int argc, char* argv[]) { Runner<ProblemSpec> runner( __TCFRAME_SPEC_FILE__, new TestSpec(), new SimpleLoggerEngine(), new OperatingSystem(), new RunnerL...
b5cd15c0-5557-4af9-a805-a2a5a57e829e
{ "language": "C++" }
```c++ #include "include/vortex.hpp" #include "include/app.hpp" #include "include/logger.hpp" #include "common_def_priv.hpp" #include <memory> namespace vtx { struct PRIVATE_STRUCT_NAME(Vortex) { std::unique_ptr<Application> m_application; }; void Vortex::setApplication(Application &&app) { m_private->m_ap...
```c++ #include "include/vortex.hpp" #include "include/app.hpp" #include "include/logger.hpp" #include "common_def_priv.hpp" #include <memory> namespace vtx { struct PRIVATE_STRUCT_NAME(Vortex) { std::unique_ptr<Application> m_application; }; void Vortex::setApplication(Application &&app) { m_private->m_ap...
a6f28c87-f0a3-4978-96ab-5f0ab290da6d
{ "language": "C++" }
```c++ #include <iostream> #include "Room.h" #include "XMLParser.cpp" int main() { Room current_room; current_room.loadFromXMLFile("Speelveld1.0.xml"); current_room.loadMovesFromXMLFile("Bewegingen1.0.xml"); current_room.executeAllMoves("HuidigSpeelveld.txt", "ResterendeBewegingen.txt"); return 0; }``` Set...
```c++ #include <iostream> #include "Room.h" #include "XMLParser.cpp" int main() { Room current_room; current_room.loadFromXMLFile("xmlfiles/Speelveld1.0.xml"); current_room.loadMovesFromXMLFile("xmlfiles/Bewegingen1.0.xml"); current_room.executeAllMoves("HuidigSpeelveld.txt", "ResterendeBewegingen.txt"); r...
a43358fd-6ded-4aac-be3c-7b9e63c82cd9
{ "language": "C++" }
```c++ #include <QCoreApplication> #include "Network/NetworkBalancer.hpp" int main(int argc, char *argv[]) { Network::NetworkBalancer aBalancerExample = Network::NetworkBalancer(); return( 0 ); } ``` Test Runner added to check the NetworkBalancer class
```c++ #include <QCoreApplication> #include "Tests/Unit/Network/TestNetworkBalancer.hpp" #include <cppunit/extensions/HelperMacros.h> #include <cppunit/ui/text/TestRunner.h> using namespace std; using namespace CppUnit; int main(int argc, char *argv[]) { // Initialice test runner CppUnit::TextUi::TestRunner ...
573a57c8-8b57-4201-80f1-92d3a0bfa3e8
{ "language": "C++" }
```c++ /********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.refractions.net * * Copyright (C) 2001-2002 Vivid Solutions Inc. * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public...
```c++ /********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.refractions.net * * Copyright (C) 2001-2002 Vivid Solutions Inc. * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public...
d4fb1f31-877d-4671-b2ae-ddf64761079d
{ "language": "C++" }
```c++ #include "glfwApp.h" #include "linuxPlatform.h" #include "log.h" #include "map.h" #include <memory> #include <signal.h> #include <stdlib.h> using namespace Tangram; int main(int argc, char* argv[]) { auto platform = std::make_shared<LinuxPlatform>(); // Create the windowed app. GlfwApp::create(pl...
```c++ #include "glfwApp.h" #include "linuxPlatform.h" #include "log.h" #include "map.h" #include <memory> #include <limits.h> #include <signal.h> #include <stdlib.h> #include <unistd.h> using namespace Tangram; int main(int argc, char* argv[]) { auto platform = std::make_shared<LinuxPlatform>(); // Create ...
2ff388d7-7337-4c1a-81c1-37e03844cbf1
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "remoting/host/capturer.h" namespace remoting { Capturer::Capturer() : width_(0), height_(0), pixel_format_(PixelFor...
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "remoting/host/capturer.h" namespace remoting { Capturer::Capturer() : width_(0), height_(0), pixel_format_(PixelFor...
d712c418-d9fc-4f58-8639-69a62fcd80f0
{ "language": "C++" }
```c++ #include "test.h" #include "lcg.h" #include <cassert> #include <limits> template <class T> void boxmuller(T* data, size_t count) { assert(count % 2 == 0); static const T twopi = T(2.0 * 3.14159265358979323846); LCG r; for (size_t i = 0; i < count; i += 2) { T u1, u2; do { u1 = r...
```c++ #include "test.h" #include "lcg.h" #include <cassert> #include <limits> #include <algorithm> template <class T> void boxmuller(T* data, size_t count) { assert(count % 2 == 0); static const T twopi = T(2.0 * 3.14159265358979323846); LCG r; for (size_t i = 0; i < count; i += 2) { T u1, u2; u1...
31da0fe9-0fb0-4154-8d07-e7cfb7c6fccf
{ "language": "C++" }
```c++ #include <QCoreApplication> #include <QTest> #include "test_engine.hpp" int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QTest::qExec( new Test_Engine, argc, argv ); return a.exec(); } ``` Replace QCoreApplication to QAppliation for QWidget work.
```c++ #include <QApplication> #include <QTest> #include "test_engine.hpp" int main( int argc, char *argv[] ) { QApplication a( argc, argv ); QTest::qExec( new Test_Engine, argc, argv ); return a.exec(); } ```
b0b60e14-5e27-40b7-a95c-e4208a187743
{ "language": "C++" }
```c++ #include <tiramisu/tiramisu.h> using namespace tiramisu; void gen(std::string name, int size, int val0, int val1) { tiramisu::init(name); tiramisu::function *function0 = global::get_implicit_function(); tiramisu::constant N("N", tiramisu::expr((int32_t) size), p_int32, true, NULL, 0, &function0);...
```c++ #include <tiramisu/tiramisu.h> using namespace tiramisu; void gen(std::string name, int size, int val0, int val1) { tiramisu::init(name); tiramisu::function *function0 = global::get_implicit_function(); tiramisu::constant N("N", tiramisu::expr((int32_t) size), p_int32, true, NULL, 0, function0); ...
ee5a3c7b-8af8-42ca-9d94-57b05e55c6bd
{ "language": "C++" }
```c++ /*----------------------------------------*/ // Test sending messages from master. // // In this script, master sends a message (command = 0x01) // with alternating 0s and 1s for each node on the bus. // /*----------------------------------------*/ #include <stdint.h> #include <util/delay.h> #include "Multidro...
```c++ /*----------------------------------------*/ // Test sending messages from master. // // In this script, master sends a message (command = 0x01) // with alternating 0s and 1s for each node on the bus. // /*----------------------------------------*/ #include <stdint.h> #include <util/delay.h> #include "Multidro...
cd6064c0-ece5-489d-ab82-ff4144baeb39
{ "language": "C++" }
```c++ /*! \file PathToImage.cpp * \author Jared Hoberock * \brief Implementation of PathToImage class. */ #include "PathToImage.h" void PathToImage ::evaluate(const PathSampler::Result &r, const PathSampler::HyperPoint &x, const Path &xPath, float &u, ...
```c++ /*! \file PathToImage.cpp * \author Jared Hoberock * \brief Implementation of PathToImage class. */ #include "PathToImage.h" void PathToImage ::evaluate(const PathSampler::Result &r, const PathSampler::HyperPoint &x, const Path &xPath, float &u, ...
70f2fc08-f5f1-4bea-a38f-37a9fbc1520e
{ "language": "C++" }
```c++ #include <cmath> #include "lights/light.h" #include "material/blinn_phong.h" BlinnPhong::BlinnPhong(const Colorf &diffuse, const Colorf &specular, float gloss) : diffuse(diffuse), specular(specular), gloss(gloss) {} Colorf BlinnPhong::shade(const Ray &r, const HitInfo &hitinfo, const LightCache &lights) const ...
```c++ #include <cmath> #include "lights/light.h" #include "material/blinn_phong.h" BlinnPhong::BlinnPhong(const Colorf &diffuse, const Colorf &specular, float gloss) : diffuse(diffuse), specular(specular), gloss(gloss) {} Colorf BlinnPhong::shade(const Ray &r, const HitInfo &hitinfo, const LightCache &lights) const ...
9deca9b5-e138-4056-a155-940ac1626283
{ "language": "C++" }
```c++ /****************************************************** * This is CIR-KIT 3rd robot control driver. * Author : Arita Yuta(Kyutech) ******************************************************/ #include "cirkit_unit03_driver.hpp" #include <string> int main(int argc, char** argv) { ros::init(argc, argv, "cirkit_u...
```c++ /****************************************************** * This is CIR-KIT 3rd robot control driver. * Author : Arita Yuta(Kyutech) ******************************************************/ #include "cirkit_unit03_driver.hpp" #include <string> #include <utility> int main(int argc, char** argv) { ros::init(ar...
c9fc9bb2-79e2-4ffb-8395-f66a3607540b
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -main-file-name cxx-virtual-destructor-calls.cpp %s -o - -fprofile-instrument=clang | FileCheck %s struct Member { ~Member(); }; struct A { virtual ~A(); }; struct B : A { Member m; virtual ~B(); }; // Base dtor counters and profile data // CH...
```c++ // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -main-file-name cxx-virtual-destructor-calls.cpp %s -o - -fprofile-instrument=clang | FileCheck %s struct Member { ~Member(); }; struct A { virtual ~A(); }; struct B : A { Member m; virtual ~B(); }; // Base dtor // CHECK: @__profn__ZN1BD2Ev = ...
919d03be-55c8-4423-b0f5-16de6bd178e0
{ "language": "C++" }
```c++ //C++ header - Open Scene Graph Simulation - Copyright (C) 1998-2002 Robert Osfield // Distributed under the terms of the GNU General Public License (GPL) // as published by the Free Software Foundation. // // All software using osgSim must be GPL'd or excempted via the // purchase of the Open Scene Graph Profe...
```c++ //C++ header - Open Scene Graph Simulation - Copyright (C) 1998-2002 Robert Osfield // Distributed under the terms of the GNU General Public License (GPL) // as published by the Free Software Foundation. // // All software using osgSim must be GPL'd or excempted via the // purchase of the Open Scene Graph Profe...
a0db7042-484d-479e-a00c-59789178a300
{ "language": "C++" }
```c++ /** * @file equationTest.cpp * @brief equation header tester. * @author zer0 * @date 2016-08-26 */ #include <gtest/gtest.h> #include <libtbag/math/equation.hpp> using namespace libtbag; using namespace libtbag::math; TEST(equationTest, getLinearEquationWithTwoPoint) { auto e = getLinearEquationW...
```c++ /** * @file equationTest.cpp * @brief equation header tester. * @author zer0 * @date 2016-08-26 */ #include <gtest/gtest.h> #include <libtbag/math/equation.hpp> using namespace libtbag; using namespace libtbag::math; TEST(equationTest, getLinearEquationWithTwoPoint) { auto e = getLinearEquationW...
7a5ff166-d3f4-4e99-b233-91898e95da31
{ "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 "base/logging.h" #include "base/path_service.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrom...
```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 "base/logging.h" #include "base/path_service.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrom...
8b9acc1d-d973-4938-a9ae-69061b338e42
{ "language": "C++" }
```c++ // dllmain.cpp : Defines the entry point for the DLL application. #include "stdafx.h" #include "commctrl.h" #include "accctrl.h" #include "shellapi.h" #include "shlobj.h" #include "aclapi.h" #include "lm.h" #include "d2d1.h" #include "dwrite.h" BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_fo...
```c++ // dllmain.cpp : Defines the entry point for the DLL application. #include "stdafx.h" #include "commctrl.h" #include "accctrl.h" #include "shellapi.h" #include "shlobj.h" #include "aclapi.h" #include "lm.h" #include "d2d1.h" #include "dwrite.h" #include "richedit.h" #include "shlwapi.h" #include "uxtheme.h" #inc...
03881490-4c28-4cf1-964e-9216d7e7c409
{ "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 Utku Aydın <utkuaydin34@gmail.com> // #include "GeoSceneGeodata.h" #include...
```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 Utku Aydın <utkuaydin34@gmail.com> // #include "GeoSceneGeodata.h" #include...
46ecf031-ce60-4587-be10-a17f56fee888
{ "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/printing/print_error_dialog.h" namespace chrome { void ShowPrintErrorDialog() {} } // namespace chrome ``` Move 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/printing/print_error_dialog.h" void ShowPrintErrorDialog() {} ```
1d4ac7d2-8684-4fcd-8792-d4e52be425a5
{ "language": "C++" }
```c++ // Copyright (c) 2011 Timur Iskhodzhanov and MIPT students. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "gtest/gtest.h" #include "base/common.h" TEST(CheckTest, CheckTrueSucceedsTest) { CHECK(1); CHECK(42); } TEST(C...
```c++ // Copyright (c) 2011 Timur Iskhodzhanov and MIPT students. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "gtest/gtest.h" #include "base/common.h" TEST(CheckTest, CheckTrueSucceedsTest) { CHECK(1); CHECK(42); } TEST(C...
a0480373-6254-44ae-adfe-cefc036e1aec
{ "language": "C++" }
```c++ #include "ImwWindowManagerOGL.h" #include "ImwPlatformWindowOGL.h" #include "windows.h" using namespace ImWindow; ImwWindowManagerOGL::ImwWindowManagerOGL() { } ImwWindowManagerOGL::~ImwWindowManagerOGL() { Destroy(); } ImwPlatformWindow* ImwWindowManagerOGL::CreatePlatformWindow(EPlatformWindowType eType,...
```c++ #include "ImwWindowManagerOGL.h" #include "ImwPlatformWindowOGL.h" #include "windows.h" using namespace ImWindow; ImwWindowManagerOGL::ImwWindowManagerOGL() { } ImwWindowManagerOGL::~ImwWindowManagerOGL() { Destroy(); } ImwPlatformWindow* ImwWindowManagerOGL::CreatePlatformWindow(EPlatformWindowType eType,...
2c2cf770-dfa5-4336-836c-3cbb1ad005d2
{ "language": "C++" }
```c++ //======================================================================= // Copyright Baptiste Wicht 2011. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) //==============================================...
```c++ //======================================================================= // Copyright Baptiste Wicht 2011. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) //==============================================...
ed85e838-beed-4bf1-a70a-a6b0aa9f634c
{ "language": "C++" }
```c++ #include "aquila/global.h" #include "aquila/source/generator/WhiteNoiseGenerator.h" #include <unittestpp.h> #include <algorithm> #include <cstddef> #include <cstdlib> #include <ctime> SUITE(WhiteNoiseGenerator) { // sample frequency is fixed at 1 kHz Aquila::WhiteNoiseGenerator gen(1000); TEST(Does...
```c++ #include "aquila/global.h" #include "aquila/source/generator/WhiteNoiseGenerator.h" #include <unittestpp.h> #include <algorithm> #include <cstddef> #include <cstdlib> #include <ctime> SUITE(WhiteNoiseGenerator) { // sample frequency is fixed at 1 kHz Aquila::WhiteNoiseGenerator gen(1000); TEST(Does...
95909d52-bdb6-4f73-8b26-f84c0bb9938f
{ "language": "C++" }
```c++ #include "c_bmp_decoder.h" namespace Img { namespace Internal { using namespace Geom; bool BmpDataDecoder::Process() { return OnProcess(); } BmpDataDecoder::BmpDataDecoder(std::shared_ptr<Img::Surface> destination, BMPHeader header): m_header{ header }, m_destination{ destination } { ...
```c++ #include "c_bmp_decoder.h" namespace Img { namespace Internal { using namespace Geom; bool BmpDataDecoder::Process() { return OnProcess(); } BmpDataDecoder::BmpDataDecoder(std::shared_ptr<Img::Surface> destination, BMPHeader header): m_header{ header }, m_destination{ destination } { ...
8a35b7d2-58d9-4acc-93f2-dc0833a94bd2
{ "language": "C++" }
```c++ // Test that no data is collected without a runtime flag. // // RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t // // RUN: rm -rf %T/coverage-disabled // // RUN: mkdir -p %T/coverage-disabled/normal // RUN: ASAN_OPTIONS=coverage_direct=0:coverage_dir=%T/coverage-disabled/normal:verbosity=1 %run %t // RUN: not ...
```c++ // Test that no data is collected without a runtime flag. // // RUN: %clangxx_asan -fsanitize-coverage=1 %s -o %t // // RUN: rm -rf %T/coverage-disabled // // RUN: mkdir -p %T/coverage-disabled/normal // RUN: ASAN_OPTIONS=coverage_direct=0:coverage_dir=%T/coverage-disabled/normal:verbosity=1 %run %t // RUN: not ...
267a4c4d-d699-4d7d-9c77-dae90b00eb11
{ "language": "C++" }
```c++ // RUN: %clangxx -O2 %s -o %t && %run %t 2>&1 | FileCheck %s // Malloc/free hooks are not supported on Windows. // XFAIL: win32 #include <stdlib.h> #include <unistd.h> #include <sanitizer/allocator_interface.h> extern "C" { const volatile void *global_ptr; // Note: avoid calling functions that allocate memor...
```c++ // RUN: %clangxx -O2 %s -o %t && %run %t 2>&1 | FileCheck %s // Malloc/free hooks are not supported on Windows. // XFAIL: win32 #include <stdlib.h> #include <unistd.h> #include <sanitizer/allocator_interface.h> extern "C" { const volatile void *global_ptr; // Note: avoid calling functions that allocate memor...
1e8920ed-73c6-4414-b422-0bc08ea1688f
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" IN_PROC_BR...
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" IN_PROC_BR...
f561f261-ee84-4790-8598-0651eb81e370
{ "language": "C++" }
```c++ #include <iostream> #include <vector> #include <fstream> #include "errors/RuntimeError.h" #include "execution/Program.h" #include "loader/ProgramReader.h" int main(int argc, char **argv) { if (argc != 2) { std::cerr << "Usage: thingc filename.thingc" << std::endl; return 1; } aut...
```c++ #include <iostream> #include <vector> #include <fstream> #include "errors/RuntimeError.h" #include "execution/Program.h" #include "loader/ProgramReader.h" int main(int argc, char **argv) { if (argc != 2) { std::cerr << "Usage: thingc filename.thingc" << std::endl; return 1; } aut...
b5301d35-6266-45a7-bd91-dc308168b4e4
{ "language": "C++" }
```c++ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <systemlib/mixer/mixer.h> #include <systemlib/err.h> #include <drivers/drv_hrt.h> #include <px4iofirmware/px4io.h> #include "../../src/systemcmds/tests/tests.h" #include <geo/geo.h> int main(int argc, char *argv[]) { warn...
```c++ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <math.h> #include <systemlib/mixer/mixer.h> #include <systemlib/err.h> #include <drivers/drv_hrt.h> #include <px4iofirmware/px4io.h> // #include "../../src/systemcmds/tests/tests.h" #include <geo/geo.h> int main(int argc, ...
1bdb3b9a-ba20-48e9-9658-52245d5b2dc9
{ "language": "C++" }
```c++ #include <gloperate/input/MouseDevice.h> #include <gloperate/input/MouseEvent.h> #include <gloperate/input/InputManager.h> namespace gloperate { MouseDevice::MouseDevice(InputManager * inputManager, const std::string & deviceDescriptor) : AbstractDevice(inputManager, deviceDescriptor) { } MouseDevice::~Mo...
```c++ #include <gloperate/input/MouseDevice.h> #include <gloperate/input/MouseEvent.h> #include <gloperate/input/InputManager.h> namespace gloperate { MouseDevice::MouseDevice(InputManager * inputManager, const std::string & deviceDescriptor) : AbstractDevice(inputManager, deviceDescriptor) { } MouseDevice::~Mo...
a2eb5ed8-2df0-47a6-80c3-b67fa2406b18
{ "language": "C++" }
```c++ #include <iostream> #include <string> #include <utility> #include "pool.h" void Pool::add_machine(const Machine& new_machine) { const std::string& machine_name = new_machine.get_name(); std::cout << "Adding machine to pool: " << machine_name << std::endl; machines.insert(std::make_pair(machine_nam...
```c++ #include <iostream> #include <string> #include <utility> #include "pool.h" void Pool::add_machine(const Machine& new_machine) { const std::string& machine_name = new_machine.get_name(); std::cout << "Adding machine to pool: " << machine_name << std::endl; machines.insert(std::make_pair(machine_nam...
e91884d4-7489-4304-be80-d67a8ca03534
{ "language": "C++" }
```c++ #include <chrono> #include <cstdint> #include <iostream> #include <mutex> #include <sstream> #include <string> #include <thread> #include <vector> std::mutex output; void func(unsigned int value) { using std::chrono::seconds; using std::cout; using std::endl; using std::lock_guard; using std::mutex; std...
```c++ #include <chrono> #include <cstdint> #include <iostream> #include <mutex> #include <sstream> #include <string> #include <thread> #include <vector> std::mutex output; void func(unsigned int value) { using std::chrono::seconds; using std::cout; using std::endl; using std::lock_guard; using std::mutex; std...
74ca7699-eba9-43de-87a8-f2316aad3b78
{ "language": "C++" }
```c++ #include "config.h" #ifdef HAVE_ASPRINTF #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include "globit.c" #endif ``` Fix build failure with GCC <= 4.7
```c++ #include "config.h" #ifdef HAVE_ASPRINTF #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS #endif #include "globit.c" #endif ```
fb5128c7-6863-4be5-80fd-fe7cf1d554f5
{ "language": "C++" }
```c++ // __BEGIN_LICENSE__ // Copyright (C) 2006-2011 United States Government as represented by // the Administrator of the National Aeronautics and Space Administration. // All Rights Reserved. // __END_LICENSE__ #include <vw/Plate/detail/Seed.h> #include <vw/Core/Thread.h> #include <boost/cast.hpp> namespace { ...
```c++ // __BEGIN_LICENSE__ // Copyright (C) 2006-2011 United States Government as represented by // the Administrator of the National Aeronautics and Space Administration. // All Rights Reserved. // __END_LICENSE__ #include <vw/Plate/detail/Seed.h> #include <vw/Core/Thread.h> #include <vw/Core/Stopwatch.h> #include ...
bd6c99fa-46fa-489d-8c0f-45a8e07aa149
{ "language": "C++" }
```c++ // Copyright (c) 2017 Pierre Fourgeaud // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #include <bandit/bandit.h> #include "core/math/vector2.h" using namespace bandit; using namespace snowhouse; using namespace CodeHero; go_bandit([]() { describe("Vecto...
```c++ // Copyright (c) 2017 Pierre Fourgeaud // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #include <bandit/bandit.h> #include "core/math/vector2.h" using namespace bandit; using namespace snowhouse; using namespace CodeHero; go_bandit([]() { describe("Vecto...
b962f615-71ed-4aae-9a76-b00137bf301b
{ "language": "C++" }
```c++ #include <iostream> using namespace std; const int MAX = 100; struct Person { string firstName; string lastName; void input() { cout << "Enter person's first and last names separated by a space: "; cin >> firstName >> lastName; } void print() { cout << firstName << ' ' << lastName << '...
```c++ #include <iostream> using namespace std; const int MAX = 100; struct Person { string firstName; string lastName; void input() { cout << "Enter person's first and last names separated by a space: "; cin >> firstName >> lastName; } void print() { cout << firstName << ' ' << lastName << '...
7c423309-ed03-4f9b-aa85-2d6be6feb989
{ "language": "C++" }
```c++ // // Created by dar on 2/21/16. // #include "EntityFather.h" EntityFather::EntityFather(Map *map) : EntityMoving(map, 0.25, 0.25) { b2PolygonShape shape; shape.SetAsBox(0.25, 0.25); b2FixtureDef fixDef; fixDef.shape = &shape; fixDef.density = 6.0f; fixDef.friction = 0.1f; this->bo...
```c++ // // Created by dar on 2/21/16. // #include "EntityFather.h" EntityFather::EntityFather(Map *map) : EntityMoving(map, 0.25, 0.25) { b2PolygonShape shape; shape.SetAsBox(0.25, 0.25); b2FixtureDef fixDef; fixDef.shape = &shape; fixDef.density = 6.0f; fixDef.friction = 0.1f; this->bo...
0ca814c9-f681-48fd-909c-82e1e2bf0d99
{ "language": "C++" }
```c++ /* * main.cc * * Copyright (c) 2015 Masatoshi Hanai * * This software is released under MIT License. * See LICENSE. * */ #include "glog/logging.h" #include "gflags/gflags.h" #include "gtest/gtest.h" #include "leveldb/db.h" #include "leveldb/options.h" /* test files */ #include "medium/com_test.cc" #i...
```c++ /* * main.cc * * Copyright (c) 2015 Masatoshi Hanai * * This software is released under MIT License. * See LICENSE. * */ #include "glog/logging.h" #include "gflags/gflags.h" #include "gtest/gtest.h" #include "leveldb/db.h" #include "leveldb/options.h" /* test files */ #include "medium/com_test.cc" #i...
0e1e7ffd-fa81-40bc-81d0-6a09de80f8d2
{ "language": "C++" }
```c++ /* * Copyright (C) 2018 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) 2018 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...
357931dc-9bdb-4e78-986c-0b90706ac8f7
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s // CHECK: @a = global i32 10 int a = 10; // CHECK: @ar = constant i32* @a int &ar = a; void f(); // CHECK: @fr = constant void ()* @_Z1fv void (&fr)() = f; struct S { int& a; }; // CHECK: @s = global %0 { i32* @a } S s = ...
```c++ // RUN: %clang_cc1 -verify -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s // CHECK: @a = global i32 10 int a = 10; // CHECK: @ar = constant i32* @a int &ar = a; void f(); // CHECK: @fr = constant void ()* @_Z1fv void (&fr)() = f; struct S { int& a; }; // CHECK: @s = global %0 { i32* @a } S s = ...
107bb210-d8b1-4b66-9168-6c9399c053b1
{ "language": "C++" }
```c++ // Copyright eeGeo Ltd (2012-2017), All Rights Reserved #include <jni.h> #include "AndroidAppThreadAssertionMacros.h" #include "IndoorAtlasLocationManager.h" #include "IndoorAtlasLocationManagerJni.h" extern "C" { JNIEXPORT void JNICALL Java_com_eegeo_interiorsposition_indooratlas_IndoorAtlasLocationManagerJn...
```c++ // Copyright eeGeo Ltd (2012-2017), All Rights Reserved #include <jni.h> #include "AndroidAppThreadAssertionMacros.h" #include "IndoorAtlasLocationManager.h" #include "IndoorAtlasLocationManagerJni.h" extern "C" { JNIEXPORT void JNICALL Java_com_eegeo_interiorsposition_indooratlas_IndoorAtlasLocationManagerJn...
5f3c8de6-0ae2-4ffd-8848-1c6d27ffef1e
{ "language": "C++" }
```c++ /* * Copyright (c) 2011 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) 2011 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...
7bff1379-5de0-4046-a131-066912f97941
{ "language": "C++" }
```c++ #include <iostream> #include <cstdlib> #include <vector> #include <bitset> #include <cstring> #include <string> #include "rand.h" using namespace std; int main() { string cipher; getline(cin, cipher); cout << cipher << endl; } ``` Read in input and freq.txt
```c++ #include <iostream> #include <cstdlib> #include <vector> #include <bitset> #include <cstring> #include <string> #include <fstream> #include "rand.h" using namespace std; int main() { string cipher, tmp; while( getline( cin, tmp ) ) { cipher.append( tmp ); } // cout << cipher << endl; ...
9a8caa1b-0df6-4d59-99f3-ac7f3db63e18
{ "language": "C++" }
```c++ //===----------------------------------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swif...
```c++ //===----------------------------------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swif...
3725cdc1-64a6-44a0-b98d-0882a05c9931
{ "language": "C++" }
```c++ #include <iostream> using std::cin; using std::cout; int main() { char operation; cout << "Choose an operation (+, -, *, /): "; cin >> operation; double first_operand; double second_operand; cout << "Enter your operands: "; cin >> first_operand >> second_operand; double result; switch(oper...
```c++ #include <iostream> using std::cin; using std::cout; int main() { char operation; cout << "Choose an operation (+, -, *, /): "; cin >> operation; double first_operand; double second_operand; cout << "Enter your operands: "; cin >> first_operand >> second_operand; double result; switch (ope...
76ea08ff-ec26-44db-87e1-69e36129b5a3
{ "language": "C++" }
```c++ #include <boxer/boxer.h> #include <gtk/gtk.h> namespace boxer { void show(const char *message, const char *title) { gtk_init(0, NULL); GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, message); gtk_window...
```c++ #include <boxer/boxer.h> #include <gtk/gtk.h> namespace boxer { void show(const char *message, const char *title) { gtk_init(0, NULL); GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "%s", mess...
f8e5bec2-35da-4048-9c88-f461627affe1
{ "language": "C++" }
```c++ #include <gtest/gtest.h> #include "../../include/Cpu.h" // The fixture for testing class Foo. class CpuTest : public ::testing::Test { protected: CpuTest() { } ~CpuTest() override { } void SetUp() override { } void TearDown() override { } Cpu cpu; }; TEST_F(CpuTest, instruction1te...
```c++ #include <gtest/gtest.h> #include "../../include/Cpu.h" // The fixture for testing class Foo. class CpuTest : public Cpu, public ::testing::Test { protected: CpuTest() { } ~CpuTest() override { } void SetUp() override { } void TearDown() override { } }; TEST_F(CpuTest, pcNop) { run...
ab4a66f3-5899-41a8-9baa-190f6cfb14b8
{ "language": "C++" }
```c++ extern "C" { #include "packet_queue.h" #include "error.h" #include "nrf51.h" #include "nrf51_bitfields.h" } #include "CppUTest/TestHarness.h" TEST_GROUP(packet_queue) { packet_queue_t queue; void setup(void) { packet_queue_init(&queue); } void teardown(void) ...
```c++ extern "C" { #include "packet_queue.h" #include "error.h" #include "nrf51.h" #include "nrf51_bitfields.h" } #include "CppUTest/TestHarness.h" #include <limits.h> #include <string.h> TEST_GROUP(packet_queue) { packet_queue_t queue; void setup(void) { packet_queue_init(&qu...
01265fcb-cdd9-42fe-95f8-28fb443007a8
{ "language": "C++" }
```c++ #include <assert.h> #include <leveldb/iterator.h> #include <node.h> #include <v8.h> #include "iterator.h" namespace node_leveldb { async_rtn JIterator::After(uv_work_t* req) { Params *data = (Params*) req->data; data->callback->Call(data->self->handle_, 0, NULL); delete data; RETURN_ASYNC_AFTER; } a...
```c++ #include <assert.h> #include <leveldb/iterator.h> #include <node.h> #include <v8.h> #include "iterator.h" namespace node_leveldb { async_rtn JIterator::After(uv_work_t* req) { Params *data = (Params*) req->data; data->callback->Call(data->self->handle_, 0, NULL); delete data; RETURN_ASYNC_AFTER; } a...
c47d2642-a818-4ec1-ba71-1fa033de3e1a
{ "language": "C++" }
```c++ // Qt includes //#include <QHash> //#include <QVariant> // Visomics includes #include "voLog2.h" // VTK includes #include <vtkDoubleArray.h> #include <vtkMath.h> #include <vtkTable.h> namespace Normalization { //------------------------------------------------------------------------------ bool applyLog2(v...
```c++ // Qt includes //#include <QHash> //#include <QVariant> // Visomics includes #include "voLog2.h" // VTK includes #include <vtkDoubleArray.h> #include <vtkTable.h> // STD includes #include <cmath> namespace Normalization { //------------------------------------------------------------------------------ boo...
14b33464-dfd8-46cd-8607-8ce22a4a60e0
{ "language": "C++" }
```c++ #include "mainwindowcontroller.h" #include "ui_mainwindowcontroller.h" #include <QErrorMessage> #include <QStandardPaths> #include <QDir> #include <QCoreApplication> #include "kopsik_api.h" MainWindowController::MainWindowController(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindowControll...
```c++ #include "mainwindowcontroller.h" #include "ui_mainwindowcontroller.h" #include <QErrorMessage> #include <QStandardPaths> #include <QDir> #include <QCoreApplication> #include "kopsik_api.h" MainWindowController::MainWindowController(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindowControll...
227d81b2-0bb8-42dc-981b-473b1dadae12
{ "language": "C++" }
```c++ #include "Ball.h" void Ball::reset() { float resetX, resetY; resetX = displayW / 2.0; resetY = rand() % displayH; randomDirection(); setPosition(resetX, resetY); } void Ball::update() { checkForCollisions(); x += accelX; y += accelY; if (testBit(DEAD)) { res...
```c++ #include "Ball.h" void Ball::reset() { float resetX, resetY; resetX = displayW / 2.0; resetY = rand() % displayH; randomDirection(); setPosition(resetX, resetY); } void Ball::update() { checkForCollisions(); x += accelX; y += accelY; if (testBit(DEAD)) { res...
67a95727-bc94-483f-9e4d-63193695a760
{ "language": "C++" }
```c++ #include <kernel/config.h> #include <kernel/kernconf.hh> USDK_API kernconf_type kernconf = { // Default is large enough until we enable a mechanism to dynamically // reallocate task space on demand. /* .default_stack_size = */ URBI_KERNEL_STACK_SIZE * 1024, /* .minimum_stack_size = */ 4 ...
```c++ #include <kernel/config.h> #include <kernel/kernconf.hh> USDK_API kernconf_type kernconf = { // Default is large enough until we enable a mechanism to dynamically // reallocate task space on demand. /* .default_stack_size = */ URBI_KERNEL_STACK_SIZE * 1024, /* .minimum_stack_size = */ UR...
ce432d32-a2ba-4d95-afb3-52832ba59177
{ "language": "C++" }
```c++ #include "config.h" #include <stdint.h> #include <stdlib.h> #include <sys/types.h> #ifdef RBX_WINDOWS #include <winsock2.h> #else #include <sys/socket.h> #include <sys/un.h> #include <netinet/in.h> #include <netdb.h> #endif #include <sys/stat.h> #include <errno.h> #include <time.h> #include <math.h> #include "...
```c++ #include "config.h" #include <stdint.h> #include <stdlib.h> #include <sys/types.h> #include <sys/sysmacros.h> #ifdef RBX_WINDOWS #include <winsock2.h> #else #include <sys/socket.h> #include <sys/un.h> #include <netinet/in.h> #include <netdb.h> #endif #include <sys/stat.h> #include <errno.h> #include <time.h> #i...
00fdfbb9-641f-4944-adef-5779331d26ef
{ "language": "C++" }
```c++ // Native C++ Libraries #include <iostream> #include <string> // C++ Interpreter Libraries #include <Console.h> using namespace std; int main() { RESTART: string input = ""; getline(cin, input); cin.ignore(); goto RESTART; } ``` Remove console-in ignore in main source.
```c++ // Native C++ Libraries #include <iostream> #include <string> // C++ Interpreter Libraries #include <Console.h> using namespace std; int main() { RESTART: string input = ""; getline(cin, input); goto RESTART; } ```
b7d3586e-5a25-4de6-9f20-8bbb4817913a
{ "language": "C++" }
```c++ #include <QGuiApplication> #include <QQmlApplicationEngine> #include <QQmlContext> #include <QtQml> #include "applications.h" #include "iconprovider.h" #include "process.h" /** * @todo: Config file in ~/.config/qmldmenu/ * @todo: SHIFT(ENTER) for sudo * @todo: TAB For command (term /{usr}/bin/) / app (.deskt...
```c++ #include <QGuiApplication> #include <QQmlApplicationEngine> #include <QQmlContext> #include <QtQml> #include "applications.h" #include "iconprovider.h" #include "process.h" /** * @todo: Config file in ~/.config/qmldmenu/ * @todo: SHIFT(ENTER) for sudo * @todo: TAB For command (term /{usr}/bin/) / app (.deskt...
76580c47-f414-46ca-9cff-efa3248829f2
{ "language": "C++" }
```c++ /* * Copyright (C) 2008-2010, Gostai S.A.S. * * This software is provided "as is" without warranty of any kind, * either expressed or implied, including but not limited to the * implied warranties of fitness for a particular purpose. * * See the LICENSE file for more information. */ // This file *must* ...
```c++ /* * Copyright (C) 2008-2010, Gostai S.A.S. * * This software is provided "as is" without warranty of any kind, * either expressed or implied, including but not limited to the * implied warranties of fitness for a particular purpose. * * See the LICENSE file for more information. */ // This file *must* ...
67e87195-9661-43aa-a954-def562d8775f
{ "language": "C++" }
```c++ /* * Arduino JSON library * Benoit Blanchon 2014 - MIT License */ #include "CppUnitTest.h" #include "IndentedPrintDecorator.h" #include "StringBuilder.h" using namespace ArduinoJson::Internals; using namespace Microsoft::VisualStudio::CppUnitTestFramework; namespace JsonGeneratorTests { TEST_CL...
```c++ /* * Arduino JSON library * Benoit Blanchon 2014 - MIT License */ #include "CppUnitTest.h" #include "IndentedPrintDecorator.h" #include "StringBuilder.h" using namespace ArduinoJson::Internals; using namespace Microsoft::VisualStudio::CppUnitTestFramework; namespace JsonGeneratorTests { TEST_CL...
15e5c25e-95ba-4e4b-b71a-319e2355e841
{ "language": "C++" }
```c++ #include "cardreader-t.h" #include <QSignalSpy> const QString TEST_CARDNUMBER = "1234_testcard"; void CardReaderTest::initTestCase() { widget.installEventFilter(&cardReader); } void CardReaderTest::simulateRFIDReader() { QSignalSpy spy(&cardReader, SIGNAL(newCardNumber(QString))); QVERIFY(spy.isValid()); ...
```c++ #include "cardreader-t.h" #include <QSignalSpy> const QString TEST_CARDNUMBER = "1234_testcard"; void CardReaderTest::initTestCase() { widget.installEventFilter(&cardReader); } void CardReaderTest::simulateRFIDReader() { QSignalSpy spy(&cardReader, SIGNAL(newCardNumber(QString))); QVERIFY(spy.isValid()); ...