doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
a545704b-caa1-4cdb-b6f4-e34868c596be
{ "language": "C++" }
```c++ #include "MOLPUpdateComputation.hpp" MOLPUpdateComputation::MOLPUpdateComputation(MOLP a, MOLP b) : molpA(a), molpB(b) { } bool noDominance() { return (molpA.empty() || molpB.empty() || molpA.isInA1AreaOf(molpB) || molpB.isInA1AreaOf(molpA)); } void MOLPUpdateComputation::initI...
```c++ #include "MOLPUpdateComputation.hpp" MOLPUpdateComputation::MOLPUpdateComputation(MOLP a, MOLP b) : molpA(a), molpB(b) { } bool MOLPUpdateComputation::noDominance() { return (molpA.empty() || molpB.empty() || molpA.isInA1AreaOf(molpB) || molpB.isInA1AreaOf(molpA)); } void MOLPU...
837b5044-04e3-470b-bf0e-c37b023da912
{ "language": "C++" }
```c++ #include <Ab/Config.hpp> #include <Ab/Memory.hpp> #include <Ab/Test/BasicTest.hpp> #include <gtest/gtest.h> namespace Ab { namespace Test { class TestMemory : public BasicTest {}; TEST_F(TestMemory, initAndKill) { Memory m; ASSERT_EQ(m.init(Memory::defaultConfig()), MemoryError::SUCCESS); m.kill(); } } /...
```c++ #include <Ab/Config.hpp> #include <Ab/Memory.hpp> #include <Ab/Test/BasicTest.hpp> #include <gtest/gtest.h> namespace Ab { namespace Test { class TestMemory : public BasicTest {}; TEST_F(TestMemory, initAndKill) { Memory m; ASSERT_EQ(m.init(Memory::defaultConfig()), MemoryError::SUCCESS); m.kill(); } TEST...
4ed9f5dc-1fcb-4243-ba7e-fdfb23e5bc66
{ "language": "C++" }
```c++ /** * \file heuristic.cc * * * * \author Ethan Burns * \date 2008-10-13 */ #include "util/fixed_point.h" #include "heuristic.h" Heuristic::Heuristic(const SearchDomain *d) : domain(d), weight(fp_one) {} Heuristic::~Heuristic() {} void Heuristic::set_weight(float weight) { weight = fp_one * weight; }...
```c++ /** * \file heuristic.cc * * * * \author Ethan Burns * \date 2008-10-13 */ #include "util/fixed_point.h" #include "heuristic.h" Heuristic::Heuristic(const SearchDomain *d) : domain(d), weight(fp_one) {} Heuristic::~Heuristic() {} void Heuristic::set_weight(float wt) { weight = fp_one * wt; } fp_typ...
8f02e373-aff9-4841-b4c1-163dd3006693
{ "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 > 1000000); // Omni Core v0.0.10.0 } /** * The following tests ar...
c90f3541-ecee-461f-8834-eb782bd242a4
{ "language": "C++" }
```c++ #include <string> #include <config/config.h> #include <config/config_type_pointer.h> #include <config/config_value.h> ConfigTypePointer config_type_pointer; bool ConfigTypePointer::set(ConfigValue *cv, const std::string& vstr) { if (pointers_.find(cv) != pointers_.end()) return (false); Config *config = ...
```c++ #include <string> #include <config/config.h> #include <config/config_type_pointer.h> #include <config/config_value.h> ConfigTypePointer config_type_pointer; bool ConfigTypePointer::set(ConfigValue *cv, const std::string& vstr) { if (pointers_.find(cv) != pointers_.end()) return (false); /* XXX Have a mag...
082f5a5d-9b56-48b7-aaa5-bf946e356541
{ "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) //==============================================...
c7b4357e-8611-42b1-b38f-6e86e1954c38
{ "language": "C++" }
```c++ /* ** © 2014 by Philipp Dunkel <pip@pipobscure.com> ** Licensed under MIT License. */ void FSEvents::emitEvent(const char *path, UInt32 flags, UInt64 id) { if (!handler) return; NanScope(); v8::Local<v8::Value> argv[] = { NanNew<v8::String>(path), NanNew<v8::Number>(flags), NanNew<v8::Number>(...
```c++ /* ** © 2014 by Philipp Dunkel <pip@pipobscure.com> ** Licensed under MIT License. */ void FSEvents::emitEvent(const char *path, UInt32 flags, UInt64 id) { if (!handler) return; NanScope(); v8::Local<v8::Value> argv[] = { NanNew<v8::String>(path), NanNew<v8::Number>(flags), NanNew<v8::Number>(...
1ad726f9-3b90-4e4a-8043-292566e4f997
{ "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...
20debbc3-e72c-43ca-94ee-3d6afe1819f8
{ "language": "C++" }
```c++ #include "./Sphere.hpp" #include "./misc.hpp" #include <algorithm> #include <cmath> namespace yks { Optional<float> intersect(const vec3& origin, float radius, const Ray& r) { const vec3 o = r.origin - origin; const vec3 v = r.direction; float t1, t2; const int solutions = solve_quadratic(dot(v, v), ...
```c++ #include "./Sphere.hpp" #include "./misc.hpp" #include <algorithm> #include <cmath> namespace yks { Optional<float> intersect(const vec3& origin, float radius, const Ray& r) { const vec3 o = r.origin - origin; const vec3 v = r.direction; float t1, t2; const int solutions = solve_quadratic(dot(v, v), ...
623a693f-f71b-43bc-aa04-572058bd155e
{ "language": "C++" }
```c++ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "free_list.h" #include <cassert> namespace vespalib::datastore { FreeList::FreeList() : _free_lists() { } FreeList::~FreeList() { assert(_free_lists.empty()); } void FreeList::attach(Buf...
```c++ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "free_list.h" #include <algorithm> #include <cassert> namespace vespalib::datastore { FreeList::FreeList() : _free_lists() { } FreeList::~FreeList() { assert(_free_lists.empty()); } void...
40863a2f-691b-43a2-91a4-c30db671a58a
{ "language": "C++" }
```c++ #include "filefinder.h" #if ! defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 600 #define _XOPEN_SOURCE 600 /* Get nftw() and S_IFSOCK declarations */ #endif #include <ftw.h> namespace{ std::vector<node> *nodes; int dirTree(const char *pathname, const struct stat *sbuf, int type, struct FTW *ftwb){ ...
```c++ #include "filefinder.h" #if ! defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 600 #define _XOPEN_SOURCE 600 /* Get nftw() and S_IFSOCK declarations */ #endif #include <ftw.h> namespace{ std::vector<node> *nodes; int dirTree(const char *pathname, const struct stat *, int type, struct FTW *ftwb){ std...
ead976db-ba6e-4e31-8f49-c1e306072d04
{ "language": "C++" }
```c++ #include <string> #include <vector> #include <unistd.h> #include <gtest/gtest.h> #include <scxcorelib/scxstrencodingconv.h> #include "getusername.h" TEST(GetUserName,simple) { // allocate a WCHAR_T buffer to receive username DWORD lpnSize = L_cuserid; WCHAR_T lpBuffer[lpnSize]; BOOL result = GetUserName(lp...
```c++ #include <string> #include <vector> #include <unistd.h> #include <gtest/gtest.h> #include <scxcorelib/scxstrencodingconv.h> #include "getusername.h" class GetUserNameTest : public ::testing::Test { protected: DWORD lpnSize; std::vector<WCHAR_T> lpBuffer; BOOL result; std::string userName; GetUserNameTest(...
c7b2ef48-91f7-40b0-a666-5420e6cb4fa0
{ "language": "C++" }
```c++ #include "KVProxy.h" #include "KVProxy_p.h" #include <iostream> KVProxy::KVProxy(QObject *parent, unsigned short port) : QObject(parent), p("127.0.0.1", port) { // Make the poll timer tell the proxy to poll; this will be started with // a timeout of 0, so it will effectively poll on every event loop tick co...
```c++ #include "KVProxy.h" #include "KVProxy_p.h" #include <iostream> #include <string> KVProxy::KVProxy(QObject *parent, unsigned short port) : QObject(parent), p("127.0.0.1", port) { // Make the poll timer tell the proxy to poll; this will be started with // a timeout of 0, so it will effectively poll on every e...
1c316882-7267-44e0-80cb-2d21c8c88d38
{ "language": "C++" }
```c++ #include <QGuiApplication> #include <QQuickView> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQuickView view; view.setSource(QUrl::fromLocalFile("GameWindow.qml")); view.show(); return app.exec(); } ``` Add import path to gamewindow example
```c++ #include <QGuiApplication> #include <QQuickView> #include <QDeclarativeEngine> #include <QDir> int main(int argc, char *argv[]) { QByteArray data = "1"; qputenv("QML_IMPORT_TRACE", data); QGuiApplication app(argc, argv); QQuickView view; view.engine()->addImportPath("../../imports"); ...
631ec41e-a85d-4f07-bd4a-ed9fa57bc57e
{ "language": "C++" }
```c++ //Precompiled header are used in this project #include "stdafx.h" //Include Annwvyn Engine. #include <Annwvyn.h> //Every Annwvyn classes are in the Annwvyn namespace using namespace Annwvyn; //Include our level/stages here #include "myLevel.hpp" AnnMain() //The application entry point is "AnnMain()". return ...
```c++ //Precompiled header are used in this project #include "stdafx.h" //Include Annwvyn Engine. #include <Annwvyn.h> //Every Annwvyn classes are in the Annwvyn namespace using namespace Annwvyn; //Include our level/stages here #include "myLevel.hpp" AnnMain() //The application entry point is "AnnMain()". return ...
a48ad41f-b370-4503-bdcf-b20876adab1b
{ "language": "C++" }
```c++ #include <string> #include <fstream> #include <streambuf> #include "exceptions.h" #include "file_utils.h" namespace file_utils { std::vector<unicode> read_lines(const unicode& filename) { unicode contents = read(filename); return unicode(contents).split("\n"); } unicode read(const unicode& filename)...
```c++ #include <string> #include <fstream> #include <streambuf> #include "exceptions.h" #include "file_utils.h" namespace file_utils { std::vector<unicode> read_lines(const unicode& filename) { unicode contents = read(filename); return unicode(contents).split("\n"); } unicode read(const unicode& filename)...
9e1929a5-4353-41b1-ad53-6d07422383ba
{ "language": "C++" }
```c++ // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ppapi/tests/mojo/test_mojo.h" #include "third_party/mojo/src/mojo/public/cpp/system/message_pipe.h" REGISTER_TEST_CASE(Mojo); TestMojo...
```c++ // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ppapi/tests/mojo/test_mojo.h" #include "third_party/mojo/src/mojo/public/cpp/system/message_pipe.h" REGISTER_TEST_CASE(Mojo); TestMojo...
6213b873-3a37-4b4d-9e41-75608db86341
{ "language": "C++" }
```c++ #include <mettle.hpp> using namespace mettle; struct my_type {}; namespace my_namespace { struct another_type {}; } suite<> test_type_name("type_name()", [](auto &_) { _.test("primitives", []() { expect(type_name<int>(), equal_to("int")); expect(type_name<int &>(), regex_match("int\\s*&")); ex...
```c++ #include <mettle.hpp> using namespace mettle; struct my_type {}; namespace my_namespace { struct another_type {}; } suite<> test_type_name("type_name()", [](auto &_) { _.test("primitives", []() { expect(type_name<int>(), equal_to("int")); expect(type_name<int &>(), regex_match("int\\s*&")); ex...
814cc817-0df1-4fe0-ae54-0c494c1d00c3
{ "language": "C++" }
```c++ #include "About.h" #include "../../3RVX/Updater.h" #include "../resource.h" void About::Initialize() { INIT_CONTROL(LBL_TITLE, Label, _title); std::wstring version = Updater::MainAppVersionString(); _title.Text(L"3RVX " + version); } void About::LoadSettings() { } void About::SaveSettings() { ...
```c++ #include "About.h" #include "../Updater.h" #include "../resource.h" void About::Initialize() { INIT_CONTROL(LBL_TITLE, Label, _title); std::wstring version = Updater::MainAppVersionString(); _title.Text(L"3RVX " + version); } void About::LoadSettings() { } void About::SaveSettings() { } ```
9baa1858-ccf8-4b76-b98b-1d7a8991d562
{ "language": "C++" }
```c++ // Copyright (c) 2015-2017 William W. Fisher (at gmail dot com) // This file is distributed under the MIT License. #include "ofp/driver.h" #include "ofp/unittest.h" using namespace ofp; class MockChannelListener : public ChannelListener { public: void onChannelUp(Channel *channel) override {} void onChan...
```c++ // Copyright (c) 2015-2017 William W. Fisher (at gmail dot com) // This file is distributed under the MIT License. #include "ofp/driver.h" #include "ofp/unittest.h" using namespace ofp; class MockChannelListener : public ChannelListener { public: void onChannelUp(Channel *channel) override {} void onChan...
5a48e1f1-8c8a-48aa-a6d8-bd701f686c98
{ "language": "C++" }
```c++ #include "sieve.h" #include <cmath> namespace { bool is_prime(int n) { if (n % 2 == 0) { return false; } const int max_factor = static_cast<int>(std::sqrt(n)); for (int probe = 2; probe <= max_factor; ++probe) { if (n % probe == 0) { return false; } } ...
```c++ #include "sieve.h" #include <algorithm> #include <list> #include <numeric> namespace sieve { std::vector<int> primes(int n) { std::vector<int> result; std::list<int> candidates(n-1); std::iota(candidates.begin(), candidates.end(), 2); while (!candidates.empty()) { const int next = candi...
c1b35ed9-1195-42b4-b9ad-876008906b02
{ "language": "C++" }
```c++ #include <gloperate/painter/Painter.h> namespace gloperate { Painter::Painter(const std::string & name, ResourceManager & resourceManager, const std::string & relDataPath) : Object(name) , m_resourceManager(resourceManager) , m_relDataPath(relDataPath) , m_backgroundColor(1.0, 1.0, 1.0) { } Painter::~Paint...
```c++ #include <gloperate/painter/Painter.h> namespace gloperate { Painter::Painter(const std::string & name, ResourceManager & resourceManager, const std::string & relDataPath) : Object(name) , m_resourceManager(resourceManager) , m_relDataPath(relDataPath) , m_backgroundColor(0.0, 0.0, 0.0) { } Painter::~Paint...
8fef5d31-5527-40e7-9450-3a5fdd5d723c
{ "language": "C++" }
```c++ /* * Copyright 2014 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifdef SK_BUILD_FOR_ANDROID #include "SkPicturePlayback.h" #endif #include "SkPictureRecorder.h" SkCanvas* SkPictureRecorder::beginRecording(int width, int height, ...
```c++ /* * Copyright 2014 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ // Need to include SkTypes first, so that SK_BUILD_FOR_ANDROID is defined. #include "SkTypes.h" #ifdef SK_BUILD_FOR_ANDROID #include "SkPicturePlayback.h" #endif #inclu...
849751e7-9cea-46f5-b8f8-e06ed3c3180a
{ "language": "C++" }
```c++ #include "blif_lexer.hpp" #include "blif_lexer.gen.hpp" //For blifparse_lex_*() extern YY_DECL; //For blifparse_lex() namespace blifparse { Lexer::Lexer(FILE* file, Callback& callback) : callback_(callback) { blifparse_lex_init(&state_); blifparse_set_in(file, state_); } Lexer::~Lexer() { bli...
```c++ #include "blif_lexer.hpp" //Windows doesn't have unistd.h, so we set '%option nounistd' //in blif_lexer.l, but flex still includes it in the generated //header unless YY_NO_UNISTD_H is defined to 1 #define YY_NO_UNISTD_H 1 #include "blif_lexer.gen.hpp" //For blifparse_lex_*() extern YY_DECL; //For blifparse_...
2456e0e9-3f62-4d74-bd4e-831ed1ea0a00
{ "language": "C++" }
```c++ #include <ncurses.h> #include "../../../src/contents.hh" #include "../../../src/key_aliases.hh" #include "../../vick-move/src/move.hh" void enter_insert_mode(contents& contents, boost::optional<int>) { char ch; contents.is_inserting = true; while((ch = getch()) != _escape) { contents.cont[c...
```c++ #include <ncurses.h> #include "../../../src/contents.hh" #include "../../../src/key_aliases.hh" #include "../../vick-move/src/move.hh" void enter_insert_mode(contents& contents, boost::optional<int>) { char ch; contents.is_inserting = true; while((ch = getch()) != _escape) { contents.cont[c...
802bd950-6a5a-43bc-b6a0-32381b699cc3
{ "language": "C++" }
```c++ #include "Penguin.h" void Penguin::processEvents(SDL_Event* a_event) { if (a_event->type == SDL_KEYDOWN) { switch (a_event->key.keysym.sym) { case SDLK_LEFT: { } break; case SDLK_RIGHT: { } break; } } } void Penguin::update(float a_deltaT) { } void Penguin::startJump() { if (m...
```c++ #include "Penguin.h" void Penguin::processEvents(SDL_Event* a_event) { if (a_event->type == SDL_KEYDOWN) { switch (a_event->key.keysym.sym) { case SDLK_LEFT: { } break; case SDLK_RIGHT: { } break; } } } void Penguin::update(float a_deltaT) { } void Penguin::startJump() { if (m...
d6dae575-a00a-464d-b30f-4ca8609b55b8
{ "language": "C++" }
```c++ // Copyright 2020 The Google Research Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applica...
```c++ // Copyright 2020 The Google Research Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applica...
4ed18e75-fd72-42b3-a638-54ded00ebe62
{ "language": "C++" }
```c++ #include "msglistener.h" #include <ei_connect.h> namespace Mailbox { MsgListener::MsgListener(int fd, QObject *parent) : QThread(parent), m_fd(fd) { } void MsgListener::run() { } } // namespace Mailbox ``` Add Basic Message Recieve implementation
```c++ #include "msglistener.h" #include <ei_connect.h> namespace Mailbox { MsgListener::MsgListener(int fd, QObject *parent) : QThread(parent), m_fd(fd) { } void MsgListener::run() { int length; erlang_msg msg; ei_x_buff buff; ei_x_new(&buff); length = ei_xreceive_msg_tmo(m_fd, &msg,...
77cef9ba-8af1-4072-866b-3d52f821d588
{ "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 "content/browser/renderer_host/render_view_host_observer.h" #include "content/browser/renderer_host/render_view_host.h" RenderViewHo...
```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 "content/browser/renderer_host/render_view_host_observer.h" #include "content/browser/renderer_host/render_view_host.h" RenderViewHo...
11b1cbf1-af2c-4a5f-bfeb-d71d8d981962
{ "language": "C++" }
```c++ /* Copyright 2020 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 2020 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...
1dcc821f-e7b7-4e4c-8d11-fb778f6bef2e
{ "language": "C++" }
```c++ #include <algorithm> #include "url.h" #include "agent.h" #include "directive.h" namespace Rep { Agent& Agent::allow(const std::string& query) { directives_.push_back(Directive(escape(query), true)); sorted_ = false; return *this; } Agent& Agent::disallow(const std::str...
```c++ #include <algorithm> #include "url.h" #include "agent.h" #include "directive.h" namespace Rep { Agent& Agent::allow(const std::string& query) { directives_.push_back(Directive(escape(query), true)); sorted_ = false; return *this; } Agent& Agent::disallow(const std::str...
3de6c32b-e5b0-4e40-b90b-832948421e61
{ "language": "C++" }
```c++ // Copyright 2015 Adam Grandquist #include "./test.hpp" #include "./ReQL.hpp" void consume(ReQL::Cursor<ReQL::Result> cursor) { for (auto && : cursor) {} } ``` Add blank name for loop syntax.
```c++ // Copyright 2015 Adam Grandquist #include "./test.hpp" #include "./ReQL.hpp" void consume(ReQL::Cursor<ReQL::Result> cursor) { for (auto &&_ : cursor) {} } ```
394c534d-b5fd-4538-8d4c-818cf0c7baf6
{ "language": "C++" }
```c++ // AUTOGENERATED FILE - DO NOT MODIFY! // This file generated by Djinni from wallet.djinni #include "CosmosConfigurationDefaults.hpp" // my header namespace ledger { namespace core { namespace api { std::string const CosmosConfigurationDefaults::COSMOS_DEFAULT_API_ENDPOINT = {"http://lite-client-0e27eefb-403...
```c++ // AUTOGENERATED FILE - DO NOT MODIFY! // This file generated by Djinni from wallet.djinni #include "CosmosConfigurationDefaults.hpp" // my header namespace ledger { namespace core { namespace api { std::string const CosmosConfigurationDefaults::COSMOS_DEFAULT_API_ENDPOINT = {"https://cosmos.coin.staging.aws...
dc9f5644-d3d7-4bbc-9a53-470a4b22d883
{ "language": "C++" }
```c++ // // Created by Alex Gurung // #include "helper.h" void testnums(unsigned long long int hail){ unsigned long long int orghail = hail; while(hail!= 0){ hail = testHail(hail); //Within helper.h file, testHail returns the next hailstone number, or 0 if you get to 4 } cout << orghail << end...
```c++ // // Created by Alex Gurung // #include "helper.h" void testnums(unsigned long long int hail){ unsigned long long int orghail = hail; while(hail!= 0){ hail = testHail(hail); //Within helper.h file, testHail returns the next hailstone number, or 0 if you get to 4 } cout << orghail << end...
fe03126f-2895-4a11-9d56-ef0274381bc1
{ "language": "C++" }
```c++ #include <cstring> #include "Vector.h" Vector::Vector() { capacity = 8; data = new int[8]; } void Vector::add(int value) { size += 1; if (size > capacity) { reserve(capacity * 2); } data[size - 1] = value; } void Vector::reserve(int newCapacity) { capacity = newCapacity; int* newData = new...
```c++ #include <cstring> #include "Vector.h" Vector::Vector() { capacity = 8; data = new int[8]; } void Vector::add(int value) { size += 1; if (size > capacity) { reserve(capacity * 2); } data[size - 1] = value; } void Vector::reserve(int newCapacity) { capacity = newCapacity; int* newData = new...
c07bffbe-ea8f-4b0f-8b0c-64f445304edf
{ "language": "C++" }
```c++ /** ****************************************************************************** * @file main.c * @author Ac6 * @version V1.0 * @date 01-December-2013 * @brief Default main function. ****************************************************************************** */ #include "s...
```c++ /** ****************************************************************************** * @file main.c * @author Ac6 * @version V1.0 * @date 01-December-2013 * @brief Default main function. ****************************************************************************** */ #include "s...
54144307-6142-4dda-8032-b14a379adf34
{ "language": "C++" }
```c++ /* * DesktopNetworkAccessManager.cpp * * Copyright (C) 2009-11 by RStudio, Inc. * * This program is licensed to you under the terms of version 3 of the * GNU Affero General Public License. This program is distributed WITHOUT * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, * MERCHA...
```c++ /* * DesktopNetworkAccessManager.cpp * * Copyright (C) 2009-11 by RStudio, Inc. * * This program is licensed to you under the terms of version 3 of the * GNU Affero General Public License. This program is distributed WITHOUT * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, * MERCHA...
2c4a19ea-55d2-48a8-bfad-166a428d28a9
{ "language": "C++" }
```c++ // Check that --gc-sections does not throw away (or localize) parts of sanitizer // interface. // RUN: %clang_asan -m64 %s -Wl,--gc-sections -o %t // RUN: %clang_asan -m64 %s -DBUILD_SO -fPIC -o %t-so.so -shared // RUN: %t 2>&1 #ifndef BUILD_SO #include <assert.h> #include <dlfcn.h> #include <stdio.h> #include ...
```c++ // Check that --gc-sections does not throw away (or localize) parts of sanitizer // interface. // RUN: %clang_asan %s -Wl,--gc-sections -o %t // RUN: %clang_asan %s -DBUILD_SO -fPIC -o %t-so.so -shared // RUN: %t 2>&1 // REQUIRES: asan-64-bits #ifndef BUILD_SO #include <assert.h> #include <dlfcn.h> #include <s...
f35d23e5-044f-4232-9c08-53d9d36a514d
{ "language": "C++" }
```c++ #include <iostream> using namespace std; int main() { int a[100][100]; int d[100][100]; a = d; for (int k = 0; k < n; k++) { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { d[i][j] = min(d[i][j], d[i][k] + d[k][j]); } } } }``` Update Floyd with input output
```c++ #include <iostream> using namespace std; int main() { int n = 4; int a[n][n]; int d[n][n]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cin >> a[i][j]; d[i][j] = a[i][j]; } } for (int k = 0; k < n; k++) { for (int i = 0; i < n; i++) { for (int j = 0;...
6c7b34c6-fdc5-40e9-995e-c3f58143ce27
{ "language": "C++" }
```c++ /** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "SimplifyCFG.h" #include "ControlFlow.h" #include "DexClass.h" #include "IRCode.h" #include "Walkers.h" void Sim...
```c++ /** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "SimplifyCFG.h" #include "ControlFlow.h" #include "DexClass.h" #include "IRCode.h" #include "Walkers.h" void Sim...
95320af6-e071-4ad5-9298-d7503de572e2
{ "language": "C++" }
```c++ /* -*- mode:linux -*- */ /** * \file closed_list.cc * * * * \author Ethan Burns * \date 2008-10-09 */ #include <map> #include "state.h" #include "closed_list.h" void ClosedList::add(const State *s) { m[s->hash()] = s; } const State *ClosedList::lookup(const State *c) const { // this is stupid: appar...
```c++ /* -*- mode:linux -*- */ /** * \file closed_list.cc * * * * \author Ethan Burns * \date 2008-10-09 */ #include <map> #include "state.h" #include "closed_list.h" void ClosedList::add(const State *s) { m[s->hash()] = s; } const State *ClosedList::lookup(const State *c) const { map<int, const State *>:...
839267bb-d86e-4d13-ac83-69b5e24d5e2f
{ "language": "C++" }
```c++ /************************************************** * Source Code for the Original Compiler for the * Programming Language Wake * * EarlyBailoutMethodInvecation.cpp * * Licensed under the MIT license * See LICENSE.TXT for details * * Author: Michael Fairhurst * Revised By: * ************************...
```c++ /************************************************** * Source Code for the Original Compiler for the * Programming Language Wake * * EarlyBailoutMethodInvecation.cpp * * Licensed under the MIT license * See LICENSE.TXT for details * * Author: Michael Fairhurst * Revised By: * ************************...
e1ad44b3-beaa-4095-9cca-d3bb4c7b6d7c
{ "language": "C++" }
```c++ /* * #%L * %% * Copyright (C) 2011 - 2013 BMW Car IT GmbH * %% * 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...
```c++ /* * #%L * %% * Copyright (C) 2011 - 2013 BMW Car IT GmbH * %% * 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...
9c0ce2eb-5360-4b22-86af-185b8451cfba
{ "language": "C++" }
```c++ // REQUIRES: shell // MSYS doesn't emulate umask. // FIXME: Could we introduce another feature for it? // REQUIRES: shell-preserves-root' // RUN: umask 000 // RUN: %clang_cc1 -emit-llvm-bc %s -o %t // RUN: ls -l %t | FileCheck --check-prefix=CHECK000 %s // CHECK000: rw-rw-rw- // RUN: umask 002 // RUN: %clang_...
```c++ // REQUIRES: shell // MSYS doesn't emulate umask. // FIXME: Could we introduce another feature for it? // REQUIRES: shell-preserves-root // RUN: umask 000 // RUN: %clang_cc1 -emit-llvm-bc %s -o %t // RUN: ls -l %t | FileCheck --check-prefix=CHECK000 %s // CHECK000: rw-rw-rw- // RUN: umask 002 // RUN: %clang_c...
db64e3f4-48cd-49cd-8fd1-99d153f27df3
{ "language": "C++" }
```c++ // Copyright 2019 The SwiftShader 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 req...
```c++ // Copyright 2019 The SwiftShader 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 req...
17fc850c-b3f5-494c-933a-543f57466864
{ "language": "C++" }
```c++ // Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/browser.h" #include "chrome/browser/pref_service.h" #include...
```c++ // Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/browser.h" #include "chrome/browser/pref_service.h" #include...
59a7db04-4394-43c5-8329-d7af57aaeb2b
{ "language": "C++" }
```c++ /** * Copyright 2014 Truphone */ #include "XmppHarness.h" #include "CommandFactory.h" #include "XmppResourceStore.h" #include "XmppHelpCommand.h" #include "XmppPresenceCommand.h" #include "XmppConnectCommand.h" #include "XmppMessageCommand.h" namespace truphone { namespace test { namespace cascades { Xmp...
```c++ /** * Copyright 2014 Truphone */ #include "XmppHarness.h" #include "CommandFactory.h" #include "XmppResourceStore.h" #include "XmppHelpCommand.h" #include "XmppPresenceCommand.h" #include "XmppConnectCommand.h" #include "XmppMessageCommand.h" #include "XmppDisconnectCommand.h" namespace truphone { namespace ...
c13ec3a2-9653-4a35-8071-336023596318
{ "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/metrics/metrics_service.h" #include <string> #include "base/base64.h" #include "testing/gtest/include/gtest/gtest.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 file. #include <ctype.h> #include <string> #include "chrome/browser/metrics/metrics_service.h" #include "testing/gtest/include/gtest/gtest.h" // E...
3a3ac6f6-f871-437a-818e-d5441d07bbcc
{ "language": "C++" }
```c++ #include "PoissonDiskSampling.h" PoissonDiskSampling::PoissonDiskSampling(int pointWidth, int pointHeight, double pointMinDist, double pointCount) : m_width(pointWidth), m_height(pointHeight), m_minDist(pointMinDist), m_pointCount(pointCount), m_cellSize(m_minDist / 1.414214f), m_gridWidth(ceil(m_width / ...
```c++ #include "PoissonDiskSampling.h" #include <random> PoissonDiskSampling::PoissonDiskSampling(int pointWidth, int pointHeight, double pointMinDist, double pointCount) : m_width(pointWidth), m_height(pointHeight), m_minDist(pointMinDist), m_pointCount(pointCount), m_cellSize(m_minDist / 1.414214f), m_gridWi...
1ea025ae-6752-4859-86bc-f456e30c8479
{ "language": "C++" }
```c++ #include "main_action_planner_node.hpp" int main(int argc, char** argv) { ros::init(argc, argv, "test_action_planner_node"); ros::NodeHandle nh {"~"}; StateChecker status {nh}; while (ros::ok()) { auto posture_key = status.getPostureKey(); RequestPosture* rp_p = RequestPostureFactory::get(postu...
```c++ #include "main_action_planner_node.hpp" int main(int argc, char** argv) { ros::init(argc, argv, "test_action_planner_node"); ros::NodeHandle nh {}; StateChecker status {nh}; while (ros::ok()) { auto posture_key = status.getPostureKey(); RequestPosture* rp_p = RequestPostureFactory::get(posture_...
209dbddc-d9d8-4baa-adaa-48a325cf7883
{ "language": "C++" }
```c++ /*========================================================================= Program: Converter Base Class Language: C++ Copyright (c) Brigham and Women's Hospital. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNE...
```c++ /*========================================================================= Program: Converter Base Class Language: C++ Copyright (c) Brigham and Women's Hospital. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNE...
7f7e6c1e-7bc7-4f08-804c-f8426f641afc
{ "language": "C++" }
```c++ #include "robot_editor.h" #include "robot_preview.h" #include <cstdlib> RobotEditor::RobotEditor() { main_window_ui_.setupUi(&main_window_); robot_preview_ = new RobotPreview(main_window_ui_.rvizFrame); QObject::connect(main_window_ui_.actionExit, SIGNAL(triggered()), this, SLOT(exitTrigger())); QObject:...
```c++ #include "robot_editor.h" #include "robot_preview.h" #include <cstdlib> RobotEditor::RobotEditor() { main_window_ui_.setupUi(&main_window_); robot_preview_ = new RobotPreview(main_window_ui_.rvizFrame); QObject::connect(main_window_ui_.actionExit, SIGNAL(triggered()), this, SLOT(exitTrigger())); QObject:...
b38dbdb1-5f80-4d71-98ef-196787ca91ae
{ "language": "C++" }
```c++ #include <QtQuick> #include <sailfishapp.h> #include <QScopedPointer> #include <QQuickView> #include <QQmlEngine> #include <QGuiApplication> #include "factor.h" void loadTranslations() { QString langCode = QLocale::system().name().mid(0, 2); const QString Prefix("sailfactor_"); if (QFile::exists(...
```c++ #include <QtQuick> #include <sailfishapp.h> #include <QScopedPointer> #include <QQuickView> #include <QQmlEngine> #include <QGuiApplication> #include "factor.h" static void loadTranslations() { QString langCode = QLocale::system().name().mid(0, 2); const QString Prefix("sailfactor_"); if (QFile::...
b464e119-6da7-4c73-a1c5-6bfb72306ac0
{ "language": "C++" }
```c++ #include <functional> #include <QApplication> #include <QMenu> #include <QObject> #include <QSystemTrayIcon> #include <QTranslator> #include "piemenu.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); app.setQuitOnLastWindowClosed(false); QTranslator translator; translator.lo...
```c++ #include <functional> #include <QApplication> #include <QMenu> #include <QObject> #include <QSystemTrayIcon> #include <QTranslator> #include "piemenu.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); app.setQuitOnLastWindowClosed(false); QTranslator translator; translator.lo...
d6da4945-b41b-489c-b6f3-ea71d93846a0
{ "language": "C++" }
```c++ ShipBlockPacket::ShipBlockPacket(uint8_t ip1, uint8_t ip2, uint8_t ip3, uint8_t ip4, uint16_t port) { static const uint8_t ipBits[] = { ip1, ip2, ip3, ip4}; memcpy(this->ipaddr, ipBits, sizeof(ipBits)); this->port = port; } ShipBlockPacket::~ShipBlockPacket() { delete[] ipaddr; } PacketData Shi...
```c++ #include <string.h> #include "ShipBlockPacket.h" ShipBlockPacket::ShipBlockPacket(uint8_t ip1, uint8_t ip2, uint8_t ip3, uint8_t ip4, uint16_t port) { static const uint8_t ipBits[] = { ip1, ip2, ip3, ip4}; memcpy(this->ipaddr, ipBits, sizeof(ipBits)); this->port = port; } ShipBlockPacket::~ShipBloc...
3b71944b-3969-482b-888f-31f9f945e580
{ "language": "C++" }
```c++ //===-- AVRMCAsmInfo.cpp - AVR asm properties -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- AVRMCAsmInfo.cpp - AVR asm properties -----------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
b220af74-405a-43d7-8423-c7c7488548bb
{ "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...
24dd6587-dedf-4bcc-abb0-70f7b784610b
{ "language": "C++" }
```c++ #include "Flax/WindowsFiberImpl.h" #include <cassert> #include <Windows.h> namespace flax { WindowsFiberImpl::WindowsFiberImpl(Fiber* fiber, FiberMainFunction mainFunction, bool isMainFiber) : address(nullptr), mainFiber(isMainFiber), fiberAndMain(fiber, mainFunction) { assert(fiber && mainFunction); ...
```c++ #include "Flax/WindowsFiberImpl.h" #include <cassert> #include <Windows.h> namespace flax { WindowsFiberImpl::WindowsFiberImpl(Fiber* fiber, FiberMainFunction mainFunction, bool isMainFiber) : address(nullptr), mainFiber(isMainFiber), fiberAndMain(fiber, mainFunction) { assert(fiber && mainFunction); ...
6600fcd2-c830-4612-8ad8-a5644395bd8d
{ "language": "C++" }
```c++ /* * Copyright (c) 2007 Digital Bazaar, Inc. All rights reserved. */ #include <iostream> #include "db/database/sqlite3/Sqlite3Connection.h" #include "db/database/sqlite3/Sqlite3Statement.h" using namespace std; using namespace db::database; using namespace db::database::sqlite3; Sqlite3Connection::Sqlite3...
```c++ /* * Copyright (c) 2007 Digital Bazaar, Inc. All rights reserved. */ #include <iostream> #include "db/database/sqlite3/Sqlite3Connection.h" #include "db/database/sqlite3/Sqlite3Statement.h" using namespace std; using namespace db::database; using namespace db::database::sqlite3; Sqlite3Connection::Sqlite3...
e20820a3-9fe4-452d-a39f-affad8bb34f7
{ "language": "C++" }
```c++ // RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s // REQUIRES: asan-32-bits #include <malloc.h> int main() { while (true) { void *ptr = malloc(200 * 1024 * 1024); // 200MB } // CHECK: failed to allocate } ``` Fix allocator OOM test on Windows.
```c++ // RUN: %clang_cl_asan -O0 %s -Fe%t // RUN: not %run %t 2>&1 | FileCheck %s // REQUIRES: asan-32-bits #include <malloc.h> int main() { while (true) { void *ptr = malloc(200 * 1024 * 1024); // 200MB } // CHECK: allocator is terminating the process instead of returning 0 } ```
93fcf8de-88d8-4162-9f7a-395d5d34651c
{ "language": "C++" }
```c++ // Copyright (c) 2015 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "realsense/enhanced_photography/enhanced_photography_extension.h" #include <string> #include "realsense/enhanced_photography/enhanced_p...
```c++ // Copyright (c) 2015 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "realsense/enhanced_photography/enhanced_photography_extension.h" #include <string> #include "base/at_exit.h" #include "realsense/enhan...
3ceda4c9-0db5-4905-8946-495f93c28316
{ "language": "C++" }
```c++ //===-- sanitizer_allocator.cc --------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- sanitizer_allocator.cc --------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
9809a78f-08b2-4390-ae70-cbd40e331b80
{ "language": "C++" }
```c++ #include <ros/ros.h> #include <geometry_msgs/Twist.h> namespace quadrotor_obstacle_avoidance { int main(int argc, char *argv[]){ ros::init(argc, argv, "quadrotor_obstacle_avoidance"); ros::NodeHandle node; ros::Publisher cmd_pub = node.advertise<geometry_msgs::Twist>("cmd_vel", 10); g...
```c++ #include <ros/ros.h> #include <geometry_msgs/Twist.h> int main(int argc, char *argv[]){ ros::init(argc, argv, "quadrotor_obstacle_avoidance"); ros::NodeHandle node; ros::Publisher cmd_pub = node.advertise<geometry_msgs::Twist>("cmd_vel", 10); ros::Duration(1).sleep(); geometry...
9b41ce92-eea8-495c-8055-e176b430383c
{ "language": "C++" }
```c++ #include <iostream> #include <string> using namespace std; typedef struct { String nome; String cpf; float saldo; } Conta; float get_saldo( Conta &conta ) { return conta.saldo; } void set_saldo( Conta &conta ) { conta.saldo; } int main() { Conta conta; init_conta( conta ); r...
```c++ #include <iostream> #include <string> using namespace std; typedef struct { String nome; String cpf; float saldo; } Conta; int main() { Conta conta; init_conta( conta ); return 0; } ```
f6bf27bc-8f1d-463f-b4dc-093773aa0941
{ "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/common/thumbnail_support.h" #include "base/command_line.h" #include "chrome/common/chrome_switches.h" #if defined(OS_WIN) #i...
```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/common/thumbnail_support.h" #include "base/command_line.h" #include "chrome/common/chrome_switches.h" #if defined(OS_WIN) #i...
9e323f16-f7c5-4bab-bfc3-fd6da9e15475
{ "language": "C++" }
```c++ // AMX profiler for SA-MP server: http://sa-mp.com // // Copyright (C) 2011-2012 Sergey Zolotarev // // 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.apach...
```c++ // AMX profiler for SA-MP server: http://sa-mp.com // // Copyright (C) 2011-2012 Sergey Zolotarev // // 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.apach...
3981e4c0-a5ca-4ffd-a8b2-4c71875ae944
{ "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. */ struct GrGLInterface; const GrGLInterface* GrGLDefaultInterface() { return NULL; } ``` Include GrGLInterface.h instead of forward declaring, since we have to get...
```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 "GrGLInterface.h" const GrGLInterface* GrGLDefaultInterface() { return NULL; } ```
62fafe78-39da-4601-8290-c72f24eae686
{ "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 "remoting/jingle_glue/ssl_adapter.h" #if defined(OS_WIN) #include "third_party/libjingle/source/talk/base/ssladapter.h" #else #includ...
```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 "remoting/jingle_glue/ssl_adapter.h" #if defined(OS_WIN) #include "third_party/libjingle/source/talk/base/ssladapter.h" #else #includ...
a3ad5386-3ad4-42ac-ba37-27bb3fbfd634
{ "language": "C++" }
```c++ #include "Emulator.hpp" int main(const int argc, char* argv[]) { Emulator emulator; emulator.run(); }``` Add basic command line argument parsing.
```c++ #include <iostream> #include <string> #include <stdexcept> #include <limits> #include "Emulator.hpp" void printHelpMessage() { std::cout << "A NES emulator. Takes .nes files.\n\n" << "Usage: turbones [options] <path-to-rom-file>\n\n" << "Options:\n" << "\t-h --help\n" ...
cb7a2127-5d77-4b57-8e63-4301d263a359
{ "language": "C++" }
```c++ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastos/fastos.h> #include <vespa/log/log.h> #include "multi_value_mapping2.h" #include "multi_value_mapping2.hpp" #include <vespa/vespalib/stllike/string.h> LOG_SETUP(".searchlib.at...
```c++ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/fastos/fastos.h> #include <vespa/log/log.h> #include "multi_value_mapping2.h" #include "multi_value_mapping2.hpp" #include <vespa/vespalib/stllike/string.h> #include "multivalue.h" #...
d8a77b11-38d9-4c56-b15a-55e30d222409
{ "language": "C++" }
```c++ #include <QString> #include <QtTest> #include <execinfo.h> #include <signal.h> #include <unistd.h> #include <TestRunner> #include <QtQuickTest/quicktest.h> #include "aconcurrenttests.h" #include "aconcurrent.h" void dummy() { // Dummy function. It is not called. // It just prove it won't create any dupl...
```c++ #include <QString> #include <QtTest> #include <TestRunner> #include <QtQuickTest/quicktest.h> #include "aconcurrenttests.h" #include "aconcurrent.h" void dummy() { // Dummy function. It is not called. // It just prove it won't create any duplicated symbols auto worker = [](int value) { retu...
b9facdc3-a3c0-4b3b-859b-4f8c87f8c249
{ "language": "C++" }
```c++ // This program is free software licenced under MIT Licence. You can // find a copy of this licence in LICENCE.txt in the top directory of // source code. // #include "../include/turing_machine.hpp" using namespace turingmachine; class do_nothing final: public tm_abstract_problem { public: const char *n...
```c++ // This program is free software licenced under MIT Licence. You can // find a copy of this licence in LICENCE.txt in the top directory of // source code. // #include "../include/turing_machine.hpp" using namespace turingmachine; class do_nothing final: public tm_abstract_problem { public: const char *n...
62d5f58c-13fd-475c-92ed-0c2401e7389f
{ "language": "C++" }
```c++ #include <lua.hpp> #include <luwra.hpp> #include <iostream> using namespace luwra; // You may add custom specializations of luwra::Value in order to retrieve them from the stack. template <> struct Value<char> { /** * Retrieve the value at position `n`. */ static inline char Read(State* state, int n) {...
```c++ #include <lua.hpp> #include <luwra.hpp> #include <iostream> using namespace luwra; // You may add custom specializations of luwra::Value in order to retrieve them from the stack. template <> struct Value<char> { /** * Retrieve the value at position `n`. */ static inline char Read(State* state, int n) {...
b2ba7173-918b-4d28-a81b-1d8537b2aca2
{ "language": "C++" }
```c++ #include <CppUnit/framework/TestSuite.h> #include <CppUnit/textui/TestRunner.h> #include <TestCases/Socket/SocketTest.h> #include <TestCases/Thread/ThreadTest.h> #include <TestCases/IO/Socket/InetAddrTest.h> using namespace vpr; int main (int ac, char **av) { TestRunner runner; //----------------------...
```c++ #include <CppUnit/framework/TestSuite.h> #include <CppUnit/textui/TestRunner.h> #include <TestCases/Socket/SocketTest.h> #include <TestCases/Thread/ThreadTest.h> #include <TestCases/IO/Socket/InetAddrTest.h> //using namespace vpr; int main (int ac, char **av) { TestRunner runner; //--------------------...
d60b706d-fd0f-42ac-965f-ccdb7fbbebf9
{ "language": "C++" }
```c++ // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" #if defined(HOST_OS_MACOS) #include <errno.h> // NOLINT #include...
```c++ // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include "platform/globals.h" #if defined(HOST_OS_MACOS) #include <errno.h> // NOLINT #include...
39edc167-b3a1-4e4b-b327-cb3adb70eefc
{ "language": "C++" }
```c++ #include "ReQL-test.hpp" #include "catch.h" using namespace ReQL; TEST_CASE("Connection", "[c++][connect]") { Connection conn = connect(); REQUIRE(conn.isOpen()); }``` Add string c constructor test.
```c++ #include "ReQL-test.hpp" #include "catch.h" using namespace ReQL; TEST_CASE("Connection", "[c++][connect]") { Connection conn = connect(); REQUIRE(conn.isOpen()); } TEST_CASE("Expr", "[c][expr]") { SECTION("string") { _ReQL_Op_t string; const uint32_t size = 12; uint8_t buf[size] = "Hell...
272a3cb0-839a-46f9-9cdd-1500fecac8cb
{ "language": "C++" }
```c++ // Copyright (c) 2011 - 2019, GS Group, https://github.com/GSGroup // Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, // provided that the above copyright notice and this permission notice appear in all copies. // THE SOFTWARE IS PROVIDED "A...
```c++ // Copyright (c) 2011 - 2019, GS Group, https://github.com/GSGroup // Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, // provided that the above copyright notice and this permission notice appear in all copies. // THE SOFTWARE IS PROVIDED "A...
57d0f550-e777-4b3e-910d-7d57e5569323
{ "language": "C++" }
```c++ // Copyright (C) 2016 Elviss Strazdins // This file is part of the Ouzel engine. #include "RendererOGLOSX.h" namespace ouzel { namespace graphics { bool RendererOGLOSX::init(const WindowPtr& window, uint32_t newSampleCount, Tex...
```c++ // Copyright (C) 2016 Elviss Strazdins // This file is part of the Ouzel engine. #include "RendererOGLOSX.h" namespace ouzel { namespace graphics { bool RendererOGLOSX::init(const WindowPtr& window, uint32_t newSampleCount, Tex...
9ad77235-9cf2-4e8f-ac03-85611d59950b
{ "language": "C++" }
```c++ #include "parsertest.h" #include "fileast.h" #include "scanner.h" #include "myexception.h" #include <QtTest/QtTest> ParserTest::ParserTest(QObject *parent) : QObject(parent) { } void ParserTest::initTestCase() { } void ParserTest::cleanupTestCase() { } void ParserTest::dummySuccess() { } Q_DECLARE_METATYP...
```c++ #include "parsertest.h" #include "fileast.h" #include "parser.h" #include "scanner.h" #include "myexception.h" #include <QtTest/QtTest> ParserTest::ParserTest(QObject *parent) : QObject(parent) { } void ParserTest::initTestCase() { } void ParserTest::cleanupTestCase() { } void ParserTest::dummySuccess() { ...
5fd4ce54-38de-4606-9b5f-2be4306dfcd9
{ "language": "C++" }
```c++ #include <iostream> #include <Sequence/variant_matrix/msformat.hpp> #include <Sequence/summstats.hpp> int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cerr.tie(nullptr); std::cout.setf(std::ios::fixed); std::cout.precision(6); std::cout << "pi\tS\tD\tthetaH\tH\...
```c++ #include <iostream> #include <Sequence/variant_matrix/msformat.hpp> #include <Sequence/summstats.hpp> int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cerr.tie(nullptr); std::cout.setf(std::ios::fixed); std::cout.precision(6); std::cout << "pi\tS\tD\ttH\n"; ...
3d4044cd-a5af-48aa-a773-66a42aff98d8
{ "language": "C++" }
```c++ #include "casexponent.h" // CasExpression CasExponent::getE(){ // return e; } ``` Fix problem with broken }
```c++ #include "casexponent.h" // CasExpression CasExponent::getE(){ // return e; //} ```
f06c042e-e7aa-497f-be5d-0f707166f1aa
{ "language": "C++" }
```c++ // Regression test for http://llvm.org/bugs/show_bug.cgi?id=21621 // This test relies on timing between threads, so any failures will be flaky. // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS="log_pointers=1:log_threads=1" %run %t #include <assert.h> #include <pthread.h> #include <stdlib.h> #include <unistd....
```c++ // Regression test for http://llvm.org/bugs/show_bug.cgi?id=21621 // This test relies on timing between threads, so any failures will be flaky. // RUN: %clangxx_lsan %s -o %t // RUN: LSAN_OPTIONS="log_pointers=1:log_threads=1" %run %t #include <assert.h> #include <pthread.h> #include <stdio.h> #include <stdlib.h...
b1c9f211-0df9-42a5-9e4d-9183d33aa3a4
{ "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. // //===---------------------------------...
09dcde18-281e-40ec-9c6e-dfbda733c715
{ "language": "C++" }
```c++ #include <iostream> #include <system_error> #include "controllers/main/MainModule.hpp" #include "network/bsdsocket/Manager.hpp" #include "network/sniffer/SnifferManager.hpp" int main() { tin::controllers::main::ControllerQueue ctrlQueue; tin::network::bsdsocket::ManagerQueue netManagerQueue; tin::...
```c++ #include <iostream> #include <system_error> #include "controllers/main/MainModule.hpp" #include "network/bsdsocket/Manager.hpp" #include "network/sniffer/Manager.hpp" #include "network/sniffer/events/ChangeFilter.hpp" int main() { tin::controllers::main::ControllerQueue ctrlQueue; tin::network::bsdsoc...
6cfbce0e-4b5d-4b24-8c78-fa8fe0e2fba3
{ "language": "C++" }
```c++ #include <lug/System/Exception.hpp> #include <sstream> lug::System::Exception::Exception(const char *typeName, const std::string &description, const char* file, const char* function, uint32_t line) : _typeName{typeName}, _description{description}, _file{file}, _function{function}, _line{line} {} const std:...
```c++ #include <lug/System/Exception.hpp> #include <sstream> lug::System::Exception::Exception(const char *typeName, const std::string &description, const char* file, const char* function, uint32_t line) : _typeName{typeName}, _description{description}, _file{file}, _function{function}, _line{line} {} const std:...
0b461d7a-e5ea-4be0-be5b-d780bd1373cb
{ "language": "C++" }
```c++ #include "imageprovider.h" matrix::ImageProvider::ImageProvider() : QQuickImageProvider{QQuickImageProvider::Pixmap} { if (!default_image_.load(":/img/res/img/default.png")) { default_image_ = QPixmap{256, 256}; default_image_.fill(QColor{"#ff00ff"}); } } QPixmap matrix::ImageProvider::requestPix...
```c++ #include "imageprovider.h" matrix::ImageProvider::ImageProvider() : QQuickImageProvider{QQuickImageProvider::Pixmap} { if (!default_image_.load(":/img/res/img/default.png")) { default_image_ = QPixmap{256, 256}; default_image_.fill(QColor{"#ff00ff"}); } } QPixmap matrix::ImageProvider::requestPix...
4df20f67-9856-453c-bd82-3c5354d2a49b
{ "language": "C++" }
```c++ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "config.h" FNET_Config::FNET_Config() : _minEventTimeOut(0), _pingInterval(0), _iocTimeOut(0), _maxInputBufferSize(0x10000), _maxOutputBufferSize(0x10000),...
```c++ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "config.h" FNET_Config::FNET_Config() : _minEventTimeOut(0), _pingInterval(0), _iocTimeOut(0), _maxInputBufferSize(0x10000), _maxOutputBufferSize(0x10000),...
3df048e6-768d-4b19-8937-833998c17c37
{ "language": "C++" }
```c++ #include "map.h" #include "screen.h" #include <sstream> Map CreateMap(int seed) { return GenerateRandomMap(std::mt19937(seed)); } int GameMain() { SetTitle("Map test"); int seed = 1; Map map = CreateMap(seed); Screen screen; while(true) { screen.Clear(); std::ost...
```c++ #include "map.h" #include "screen.h" #include <sstream> Map CreateMap(int seed) { return GenerateRandomMap(std::mt19937(seed)); } int GameMain() { SetTitle("Map test"); int seed = 1; Map map = CreateMap(seed); Screen screen; while(true) { screen.Clear(); std::ost...
cab6aa1a-9408-46fe-a6cf-055f70059e2b
{ "language": "C++" }
```c++ #include "Interpreter.hpp" #include "modules/error-handler/ErrorHandler.hpp" tkom::Interpreter::Interpreter(const std::vector<std::string>& arguments) { try { modules::ErrorHandler::error("Hello world!"); } catch (std::exception& e) {} modules::ErrorHandler::warning("Hello worl...
```c++ #include "Interpreter.hpp" #include "modules/error-handler/ErrorHandler.hpp" #include "modules/lexer/Lexer.hpp" #include <iostream> using Interpreter = tkom::Interpreter; using ErrorHandler = tkom::modules::ErrorHandler; using Lexer = tkom::modules::Lexer; Interpreter::Interpreter(const std::vector<std::stri...
d704eff4-c50d-44e4-a657-47dc726ff12b
{ "language": "C++" }
```c++ #include <qapplication.h> #include <MainApplication/Gui/MainWindow.hpp> #include <Core/CoreMacros.hpp> #ifdef OS_LINUX #include <X11/Xlib.h> #endif int main(int argc, char** argv) { #ifdef OS_LINUX XInitThreads(); #endif QApplication app(argc, argv); QSurfaceFormat format; format.setVersion(...
```c++ #include <qapplication.h> #include <MainApplication/Gui/MainWindow.hpp> #include <Core/CoreMacros.hpp> int main(int argc, char** argv) { QApplication app(argc, argv); QSurfaceFormat format; format.setVersion(4, 4); format.setProfile(QSurfaceFormat::CoreProfile); format.setSamples(0); f...
704bdea0-07a3-4b82-b469-dfd26e53279f
{ "language": "C++" }
```c++ #include <stdio.h> // Make sure ASan doesn't hang in an exec loop if DYLD_INSERT_LIBRARIES is set. // This is a regression test for // https://code.google.com/p/address-sanitizer/issues/detail?id=159 // RUN: %clangxx_asan -m64 %s -o %t // RUN: %clangxx -m64 %p/../SharedLibs/darwin-dummy-shared-lib-so.cc \ // RU...
```c++ #include <stdio.h> // Make sure ASan doesn't hang in an exec loop if DYLD_INSERT_LIBRARIES is set. // This is a regression test for // https://code.google.com/p/address-sanitizer/issues/detail?id=159 // RUN: %clangxx_asan -m64 %s -o %t // RUN: %clangxx -m64 %p/../SharedLibs/darwin-dummy-shared-lib-so.cc \ // RU...
1cc4d54e-80ea-4efb-bbc7-717dde127465
{ "language": "C++" }
```c++ /* * Copyright (c) Facebook, Inc. and its 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 by...
```c++ /* * Copyright (c) Facebook, Inc. and its 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 by...
0c173505-dbb4-4573-8e1c-859fb15dd7c7
{ "language": "C++" }
```c++ #include <boost/assert.hpp> #include "worker.h" #include "requests.pb.h" bool traffic::MessageWorker::process(std::string &result, void *data, size_t size) { (void) result; request::Request request; request.ParseFromArray(data, size); if (request.has_statistic()) return process_statistics(); else if...
```c++ #include <boost/assert.hpp> #include "worker.h" #include "requests.pb.h" bool traffic::MessageWorker::process(std::string &result, void *data, size_t size) { (void) result; request::Request request; request.ParseFromArray(data, size); switch (request.Payload_case()) { case request::Request::kStatisti...
9f92d0e5-95fe-40e5-8c30-9a382a444265
{ "language": "C++" }
```c++ #include "gtest/gtest.h" #include "Models/ChisqModel.hpp" #include "Models/PosteriorSamplers/ZeroMeanGaussianConjSampler.hpp" #include "Models/StateSpace/DynamicRegression.hpp" #include "Models/StateSpace/StateModels/LocalLevelStateModel.hpp" #include "Models/StateSpace/StateModels/SeasonalStateModel.hpp" #incl...
```c++ #include "gtest/gtest.h" #include "Models/ChisqModel.hpp" #include "Models/PosteriorSamplers/ZeroMeanGaussianConjSampler.hpp" #include "Models/StateSpace/DynamicRegression.hpp" #include "Models/StateSpace/StateModels/LocalLevelStateModel.hpp" #include "Models/StateSpace/StateModels/SeasonalStateModel.hpp" #incl...
498b8a94-25e9-4142-8a94-73eeceec1105
{ "language": "C++" }
```c++ #include "UnixExecutablePathValidator.h" using namespace clt::filesystem::entities; using namespace clt::filesystem::entities::validators; bool UnixExecutablePathValidator::isPathValid(const Path& path, std::vector<ValidatorBrokenRules> & brokenRules) const { //TODO: must be a file with executable right retur...
```c++ #include "UnixExecutablePathValidator.h" using namespace clt::filesystem::entities; using namespace clt::filesystem::entities::validators; bool UnixExecutablePathValidator::isPathValid(const Path& path, std::vector<ValidatorBrokenRules> & brokenRules) const { if (!path.exists()) { brokenRules.push_back(Vali...
9c3396da-da07-4604-89e1-6c277241202b
{ "language": "C++" }
```c++ /** @file * * A brief file description * * @section license License * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licens...
```c++ /** @file * * A brief file description * * @section license License * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licens...
d84febe5-a543-44a3-b74d-fc1a86b83bd2
{ "language": "C++" }
```c++ #include <iostream> int main(int argc, char *argv[]) { if (argc != 2) { std::cerr << "You must specify exactly a single input filename." << std::endl; exit(EXIT_FAILURE); } } ``` Implement index building for pairwise levenshtein
```c++ #include <iostream> #include <fstream> int main(int argc, char *argv[]) { if (argc != 2) { std::cerr << "You must specify exactly a single input filename." << std::endl; exit(EXIT_FAILURE); } std::ifstream file(argv[argc - 1]); std::ofstream index("index.plain"); index << fi...
e5144f82-4090-45f8-befe-88efdcbef66b
{ "language": "C++" }
```c++ #include <iostream> /* This program computes fibo using * and optimization of the matrix way */ /*REFERENCES * https://en.wikipedia.org/wiki/Fibonacci_number#Matrix_form * http://www.geeksforgeeks.org/program-for-nth-fibonacci-number/ */ using namespace std; const int MAX = 1000; int f[MAX] = {0}; i...
```c++ #include <iostream> /* This program computes fibo using * and optimization of the matrix way */ /*REFERENCES * This method is contributed by Chirag Agarwal. * https://en.wikipedia.org/wiki/Fibonacci_number#Matrix_form * http://www.geeksforgeeks.org/program-for-nth-fibonacci-number/ */ using namespace st...
61f87aba-438c-4896-be88-c8d248e7b8e5
{ "language": "C++" }
```c++ #include "math_container.h" using std::complex; /******************************************************/ /*solve the equation cosh(x)=exp(y), input y, return x*/ /******************************************************/ complex<double> coshx_eq_expy(double y) { complex<double> ey={exp(y),0}; return log(...
```c++ #include "math_container.h" using std::complex; /******************************************************/ /*solve the equation cosh(x)=exp(y), input y, return x*/ /******************************************************/ complex<double> coshx_eq_expy(double y) { complex<double> ey={exp(y),0}; complex<dou...
9dbcbd28-f38b-469f-8b19-2f85c117af54
{ "language": "C++" }
```c++ // Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" #include "chrome/browser/ui/touch/frame/touch_browser_frame_view.h" #...
```c++ // Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" #include "base/command_line.h" #include "chrome/browser/ui/panels/pan...