conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Use std ostream instead of fprintf.\n" }, { "from": "human", "value": "#include <cstdlib>\n#include <iostream>\n#include <boost/asio.hpp>\n#include <boost/thread.hpp>\n#include <proxylib/proxylib.h>\n\nvoid signal_handler(int signal) {\n\tfprintf(stderr, \"Received ...
c++
chosen
[ { "from": "system", "value": "Copy logfile when crashed so users don't have to do so manually\n" }, { "from": "human", "value": "\r\n#include \"crash_reporting.h\"\r\n\r\n#include \"infrastructure/breakpad.h\"\r\n#include <fmt/format.h>\r\n#include \"platform/windows.h\"\r\n\r\nBreakpad::Breakpa...
c++
chosen
[ { "from": "system", "value": "Check that the ExtensionFunction has a callback for attempting to send a response.\n\nReview URL: http://codereview.chromium.org/63130\n\ngit-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@13406 4ff67af0-8c30-449e-8e8b-ad334ec8d88c\n" }, { "from": "human", "value"...
c++
chosen
[ { "from": "system", "value": "Switch default device type to CUDA if available; now to fix runtime errors and TODO items\n" }, { "from": "human", "value": "#include \"Context.hpp\"\n\nContext* _global_ctx = nullptr;\n\nnamespace Backend {\n void init_global_context() {\n if (!_global_ctx)\n ...
c++
chosen
[ { "from": "system", "value": "Add long types to names.\n" }, { "from": "human", "value": "\n#include \"JasonType.h\"\n\nusing JasonType = triagens::basics::JasonType;\n\n////////////////////////////////////////////////////////////////////////////////\n/// @brief get the name for a Jason type\n//...
c++
chosen
[ { "from": "system", "value": "Modify the trigger condition of PIR\n" }, { "from": "human", "value": "#include \"MiNodePIR.h\"\n\nMiNodePIR::MiNodePIR() :\npin(NULL)\n{\n this->baseId = MINODE_ID_MODULE_PIR;\n}\n\nMiNodePIR::~MiNodePIR()\n{\n if(pin) {\n delete pin;\n }\n}\n\nvoid MiNodePIR...
c++
chosen
[ { "from": "system", "value": "Fix quoting to allow shell expansion to occur for shell variables\nintroduced by the test harness' expansion of %t.\n\ngit-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@154443 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { "from": "human", "value": "// RUN: rm -rf ...
c++
chosen
[ { "from": "system", "value": "en-2015-10-03: Replace non-ASCII quotes from GCC with ASCII quotes.\n" }, { "from": "human", "value": "// C++11 code with initializers.\n//\n// g++ -std=c++11 -pedantic -fsyntax-only cpp11.cpp\n// clang++ -std=c++11 -pedantic -fsyntax-only cpp11.cpp\n\nstruct A ...
c++
chosen
[ { "from": "system", "value": "Make luna app boostable to reduce the start up time.\n" }, { "from": "human", "value": "#include <QApplication>\n#include <QDeclarativeView>\n#include <QUrl>\n\nint main(int argc, char** argv)\n{\n // FIXME: Use the (new?) harmattan booster!!\n QApplication ap...
c++
chosen
[ { "from": "system", "value": "Remove ARM XFAIL from passing test\n\ngit-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@211608 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { "from": "human", "value": "// RUN: %clangxx -O0 %s -o %t && %run %t\n// XFAIL: arm-linux-gnueabi\n\n#include <assert.h>\n#i...
c++
chosen
[ { "from": "system", "value": "Fix color conversions for android\n\nSummary: This diff fixes the color conversions for Android\n\nReviewed By: shergin\n\nDifferential Revision: D9093561\n\nfbshipit-source-id: a17e61c58be511bd463dc0b21b632dc24066b8b6\n" }, { "from": "human", "value": "/**\n * Copy...
c++
chosen
[ { "from": "system", "value": "Change code to match expectations of SeeedStudio's relaysheld v1.3\n" }, { "from": "human", "value": "#include \"Arduino.h\"\n#include \"LightModel.h\"\n\nconst byte LightModel::RED_ON = 0x1;\nconst byte LightModel::AMBER_ON = 0x2;\nconst byte LightModel::GREEN_ON =...
c++
chosen
[ { "from": "system", "value": "Initialize logging early enough to see VLOGs emitted by InitializeMediaLibraryForTesting().\n(specifically, this makes ffmpeg_stubs.cc VLOGs actually get emitted if -v=1 is specified)\n\nBUG=none\nTEST=none\n\n\nReview URL: http://codereview.chromium.org/9320048\n\ngit-svn-id: ...
c++
chosen
[ { "from": "system", "value": "Enable support for local plugins\n" }, { "from": "human", "value": "#include \"mainwindow.h\"\n#include <QApplication>\n\nint main(int argc, char *argv[])\n{\n QApplication a(argc, argv);\n\n //These things are used by QSettings to set up setting storage\n ...
c++
chosen
[ { "from": "system", "value": "[Linux] Mark ExtensionApiTest.Storage as flaky.\nBUG=42943\nTEST=none\nTBR=rafaelw\n\nReview URL: http://codereview.chromium.org/1810012\n\ngit-svn-id: http://src.chromium.org/svn/trunk/src@46083 4ff67af0-8c30-449e-8e8b-ad334ec8d88c\n\nFormer-commit-id: d24d18b9e3f4f98bd820ae1f...
c++
chosen
[ { "from": "system", "value": "Add type checking for boolean link types.\n" }, { "from": "human", "value": "/*\n * opencog/atoms/core/Checkers.cc\n *\n * Copyright (C) 2017 Linas Vepstas\n * All Rights Reserved\n *\n * This program is free software; you can redistribute it and/or modify\n * it un...
c++
chosen
[ { "from": "system", "value": "Remove spurious required field from Cylinders codec\n" }, { "from": "human", "value": "#pragma once\n\n#include \"CylindersWrapperCodec.h\"\n\nnamespace spotify\n{\nnamespace json\n{\n\nusing CylindersWrapper = noise::module::Wrapper<noise::module::Cylinders>;\n\nco...
c++
chosen
[ { "from": "system", "value": "Use an array to store the size of the types\n" }, { "from": "human", "value": "//=======================================================================\n// Copyright Baptiste Wicht 2011.\n// Distributed under the Boost Software License, Version 1.0.\n// (See accomp...
c++
chosen
[ { "from": "system", "value": "Add an eol at the end to shut gcc sup.\n\n\ngit-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@24926 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { "from": "human", "value": "//===-- llvm/CodeGen/DwarfWriter.cpp - Dwarf Framework ----------*- C++ -*-===//\n//\n// ...
c++
chosen
[ { "from": "system", "value": "[libc++] Mark lock_guard nodiscard test as unsupported in C++03\n\ngit-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@369672 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { "from": "human", "value": "//===--------------------------------------------------------------...
c++
chosen
[ { "from": "system", "value": "Fix toggle text after first video recording start.\n" }, { "from": "human", "value": "#include \"./video_recorder_controller.h\"\n#include <QDateTime>\n#include \"./video_recorder.h\"\n\nVideoRecorderController::VideoRecorderController(\n std::shared_ptr<VideoRec...
c++
chosen
[ { "from": "system", "value": "[Components] Remove the unused ZoomArea from the elements\n" }, { "from": "human", "value": "/*\n * Copyright 2011 Intel Corporation.\n *\n * This program is licensed under the terms and conditions of the\n * Apache License, version 2.0. The full text of the Apache...
c++
chosen
[ { "from": "system", "value": "Use QCoreApplication for unit tests as it should not depend on GUI stuff.\n" }, { "from": "human", "value": "#include <QApplication>\n#include \"gtest/gtest.h\"\n\nint main(int argc, char** argv)\n{\n QApplication app(argc, argv);\n ::testing::InitGoogleTest(&...
c++
chosen
[ { "from": "system", "value": "Remove an element from a list completed\n" }, { "from": "human", "value": "#include<iostream>\n\nusing namespace std;\n\nint removeElement(int A[], int n, int elem) {\n int length = n-1;\n for(int i = 0; i <= length; ++i) {\n if(A[i] == elem) {\n ...
c++
chosen
[ { "from": "system", "value": "Fix includes in integration test example.\n" }, { "from": "human", "value": "// Copyright 2019 DeepMind Technologies Ltd. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in complianc...
c++
chosen
[ { "from": "system", "value": "Test UTF-16 output of GetUserName\n" }, { "from": "human", "value": "#include <unistd.h>\n#include <gtest/gtest.h>\n#include \"getusername.h\"\n\nTEST(GetUserName,simple)\n{\n\t// allocate a WCHAR_T buffer to receive username\n\tDWORD lpnSize = 64;\n\tWCHAR_T lpBuff...
c++
chosen
[ { "from": "system", "value": "Edit: Enable output buffer in log only for Release\n" }, { "from": "human", "value": "/**\n * \\file bs_log_scribers.cpp\n * \\brief\n * \\author Sergey Miryanov\n * \\date 07.07.2009\n * */\n#include \"bs_log_scribers.h\"\n\nusing namespace std;\n\nnamespace blue_s...
c++
chosen
[ { "from": "system", "value": "Add a missing license header\n" }, { "from": "human", "value": "#include \"prng_user.hpp\"\n\nPrngUser::PrngUser(std::shared_ptr<std::mt19937> generator)\n: generator_{generator}\n{\n}\n\nstd::shared_ptr<std::mt19937> PrngUser::getGenerator() const\n{\n return gene...
c++
chosen
[ { "from": "system", "value": "refactor/test: Refactor the resolver test code\n" }, { "from": "human", "value": "#include \"net/resolver.h\"\n#include <string>\n#include <gtest/gtest.h>\n\nusing namespace net;\n\nTEST(LookupAddress, Localhost) {\n {\n std::string addr;\n error er...
c++
chosen
[ { "from": "system", "value": "Fix unused variable on outdated example\n\nChange-Id: I9e257c3123b68044b34531cd71837db9a9ef2bc8\n" }, { "from": "human", "value": "#include <string>\n#include <vector>\n#include <map>\n#include <iostream>\n\n#include <qitype/signature.hpp>\n\n//sample foo function t...
c++
chosen
[ { "from": "system", "value": "Fix warnings map to be thread-local\n\nThe map is mutated so it should be thread-local. This will make the\nwarnings printed once per core, but I guess it's not a big deal.\n" }, { "from": "human", "value": "/*\n * Copyright (C) 2015 Cloudius Systems, Ltd.\n */\n\n#...
c++
chosen
[ { "from": "system", "value": "Add command line argument support\n" }, { "from": "human", "value": "/* localsearch.cpp\n\n Ian Westrope\n Evolutionary Computation\n Spring 2015\n\n*/\n\n#include <iostream>\n#include <cstdlib>\n\n#include \"bitHelpers.h\"\n#include \"rand.h\"\n\nusing namesp...
c++
chosen
[ { "from": "system", "value": "Fix timer overflow on 16-bit int (milliseconds is an unsigned long)\n" }, { "from": "human", "value": "#include \"zg01_fsm.h\"\n\n// max time between ZG01 bits, until a new frame is assumed to have started\n#define ZG01_MAX_MS 3\n\n// all of the state of the FSM\nt...
c++
chosen
[ { "from": "system", "value": "Add couple of debug statements\n" }, { "from": "human", "value": "// ===============================\n// Slots for long running Library Tasks\n// Available under the 3-clause BSD License\n// Written by: Kris Moore <kris@pcbsd.org> FEB 2016\n// ======================...
c++
chosen
[ { "from": "system", "value": "Change invalid signature of DownloadGridcoinBlocks.\n" }, { "from": "human", "value": "#include <string>\n#include \"grcrestarter.h\"\n\n// Old VB based NeuralNet.\ndouble qtPushGridcoinDiagnosticData(std::string data);\nint RestartClient();\nbool CheckForUpgrade();...
c++
chosen
[ { "from": "system", "value": "Scale internal times for Break objects.\n" }, { "from": "human", "value": "/*\n\nThis file is part of VROOM.\n\nCopyright (c) 2015-2022, Julien Coupey.\nAll rights reserved (see LICENSE).\n\n*/\n\n#include \"structures/vroom/break.h\"\n#include \"utils/helpers.h\"\n...
c++
chosen
[ { "from": "system", "value": "Fix csv2isd to exit with 0 at --help\n" }, { "from": "human", "value": "/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- vim:set ts=4 sw=4 sts=4 noet: */\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n\n#include <cstdio>\n#include <c...
c++
chosen
[ { "from": "system", "value": "Change naming scheme for files\n" }, { "from": "human", "value": "/*\nThis file is part of Groho, a simulator for inter-planetary travel and warfare.\nCopyright (c) 2020 by Kaushik Ghose. Some rights reserved, see LICENSE\n*/\n\n#include <exception>\n#include <strin...
c++
chosen
[ { "from": "system", "value": "Update locale handling on Windows\n" }, { "from": "human", "value": "#include <system/Locale.h>\n\n#if defined(HX_WINDOWS)\n#include <windows.h>\n#elif defined(HX_LINUX)\n#include <stdlib.h>\n#include <string.h>\n#include <clocale>\n#endif\n\n\nnamespace lime {\n\t\...
c++
chosen
[ { "from": "system", "value": "Decrease sensitivity of timer test.\n" }, { "from": "human", "value": "// Copyright 2010-2014 RethinkDB, all rights reserved.\n#include \"unittest/gtest.hpp\"\n\n#include \"arch/timing.hpp\"\n#include \"concurrency/pmap.hpp\"\n#include \"unittest/unittest_utils.hpp\...
c++
chosen
[ { "from": "system", "value": "Return !0 when qt tests fail.\n" }, { "from": "human", "value": "#include <QTest>\r\n#include <QObject>\r\n\r\n#include \"uritests.h\"\r\n\r\n// This is all you need to run all the tests\r\nint main(int argc, char *argv[])\r\n{\r\n URITests test1;\r\n QTest::q...
c++
chosen
[ { "from": "system", "value": "Update Windows runner from template\n\nPicks up the recently add CoInitialize fix.\n" }, { "from": "human", "value": "#include <flutter/dart_project.h>\r\n#include <flutter/flutter_view_controller.h>\r\n#include <windows.h>\r\n\r\n#include <vector>\r\n\r\n#include \...
c++
chosen
[ { "from": "system", "value": "Add comment about suppress the warning C4251 of Visual Studio.\n" }, { "from": "human", "value": "#ifdef _WINDOWS\n\n/*\n * NOTE: Some macros must be defined in project options of Visual Studio.\n * - _CRT_SECURE_NO_WARNINGS\n * To use strncpy().\n * ...
c++
chosen
[ { "from": "system", "value": "Use Chrome's user agent string for content_shell, since some sites (i.e. Gmail) give a degraded experience otherwise.\n\nBUG=90445\nReview URL: http://codereview.chromium.org/7980044\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@102172 0039d316-1c4b-4281-b951-d872f208...
c++
chosen
[ { "from": "system", "value": "Fix main file's init function for C++, and comment out unimplemented functions." }, { "from": "human", "value": "#include \"pdfium_ruby.h\"\n\nvoid Init_pdfium_ruby (void) {\n VALUE rb_PDFium = rb_define_module(\"PDFium\");\n \n // Define `Document` and `Page` cl...
c++
chosen
[ { "from": "system", "value": "Add benchmark to write JSON into a string\n\nThe benchmark BlockToJsonVerbose only tests generating (and destroying)\nthe JSON data structure, but serializing into a string is also a\nperformance critical aspect of the RPC calls.\n\nAlso, use ankerl::nanobench::doNotOptimizeAwa...
c++
chosen
[ { "from": "system", "value": "Fix warning on startup from theme watcher\n" }, { "from": "human", "value": "#include \"theme-loader.h\"\n#include <QApplication>\n#include <QDir>\n#include <QFile>\n\n\nThemeLoader::ThemeLoader(QString path, QObject *parent)\n\t: QObject(parent), m_path(std::move(p...
c++
chosen
[ { "from": "system", "value": "Remove use of std namespace\n" }, { "from": "human", "value": "#include \"Rndm.h\"\n\nusing namespace std;\nRndm::Rndm() : _mt(_rd()) \n{\n}\n\nRndm & Rndm::rndm() \n{\n\tstatic Rndm rndm;\n\treturn rndm;\n}\n\nstd::mt19937 & Rndm::mt()\n{\n\treturn Rndm::rndm()._mt...
c++
chosen
[ { "from": "system", "value": "Convert arg string to utf8 on Windows\n" }, { "from": "human", "value": "// Copyright (c) 2014 GitHub, Inc.\n// Use of this source code is governed by the MIT license that can be\n// found in the LICENSE file.\n\n#include \"atom/browser/node_debugger.h\"\n\n#include...
c++
chosen
[ { "from": "system", "value": "Add the code to init the ActiveMQ-CPP library and shut it down when finished.\n\ngit-svn-id: 0fb8a5a922afe2085ae9a967a0cf0864fe09ecff@1005248 13f79535-47bb-0310-9956-ffa450edef68\n" }, { "from": "human", "value": "/*\n * Licensed to the Apache Software Foundation (A...
c++
chosen
[ { "from": "system", "value": "Fix compilation warning caused by use of \"auto\"\n" }, { "from": "human", "value": "#include \"threadpool.h\"\n\nThreadPool::ThreadPool(size_t size)\n{\n for (auto i=0; i<size; ++i) {\n workers.emplace_back([this] {\n for (;;) {\n ...
c++
chosen
[ { "from": "system", "value": "Add check in ultrasound sensor when reading from the serial port\n" }, { "from": "human", "value": "#include \"Sensor/UltrasoundSensor.h\"\n#include \"Data/UltrasoundData.h\"\n\nUltrasoundSensor::UltrasoundSensor(string port, int baudrate) : Sensor(\"Ultrasound Sens...
c++
chosen
[ { "from": "system", "value": "Remove erroneous check for reference params.\n" }, { "from": "human", "value": "/*\n * File.cpp\n *\n * Created on: Jun 24, 2015\n * Author: gatanasov\n */\n\n#include \"File.h\"\n#include <sstream>\n\nusing namespace std;\n\nnamespace tns\n{\n\tstring File::R...
c++
chosen
[ { "from": "system", "value": "Change catch statement to catch by reference\n" }, { "from": "human", "value": "#include <memory>\n\n#include <miniMAT/checker/Checker.hpp>\n\n#include <iostream>\n\nnamespace miniMAT {\n namespace checker {\n Checker::Checker(std::shared_ptr<std::map<std:...
c++
chosen
[ { "from": "system", "value": "Add a simple login feature\n" }, { "from": "human", "value": "#include <iostream>\n\n#include \"server.h\"\n\nServer::Server(unsigned short port) {\n\t// logging settings\n\tbottleserve.set_access_channels(websocketpp::log::alevel::all);\n\tbottleserve.clear_access_...
c++
chosen
[ { "from": "system", "value": "Convert newly-added test from -std=c++0x to -std=c++11.\n\n\ngit-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@141904 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { "from": "human", "value": "// RUN: %clang_cc1 -fsyntax-only -std=c++0x -Wc++98-compat -verify %s\n\n...
c++
chosen
[ { "from": "system", "value": "Fix relative location of bitfile\n" }, { "from": "human", "value": "#include \"libbbn-ni-r.h\"\n\n//global to hold on to session handle\nNiFpga_Session session;\nbool isOpen = false;\n\n//Initialize FPGA on loading the library -- constructor hook in header\nvoid ini...
c++
chosen
[ { "from": "system", "value": "Change constructor to set OutputFile.\n" }, { "from": "human", "value": "#include \"PlainPrinter.h\"\n\nPlainPrinterAction::PlainPrinterAction(const llvm::StringRef &filename) :\n ASTAction<PlainPrinterAction>() {\n OutputFile = std::make_shared<std::fstream>();\n...
c++
chosen
[ { "from": "system", "value": "Edit ``contents.is_inserting`` in insert modes\n" }, { "from": "human", "value": "#include <ncurses.h>\n\n#include \"../../../src/contents.hh\"\n#include \"../../../src/key_aliases.hh\"\n#include \"../../vick-move/src/move.hh\"\n\nvoid enter_insert_mode(contents& co...
c++
chosen
[ { "from": "system", "value": "Support for blksize option (RFC 2348).\n\n\ngit-svn-id: 4a4e6d3f3969003d0af9593019da3e8c357e24a8@300 6619c942-59fa-0310-bf43-a07aaa81d9ac\n" }, { "from": "human", "value": "#include \"wvtftps.h\"\n\nint main()\n{\n WvTFTPs tftps(\"/tftpboot\", 30*1000);\n\n wh...
c++
chosen
[ { "from": "system", "value": "Define this in the correct n/s\n\n\ngit-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@30671 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { "from": "human", "value": "//===-- ManagedStatic.cpp - Static Global wrapper -------------------------===//\n//\n// ...
c++
chosen
[ { "from": "system", "value": "Test formatting of special numbers\n" }, { "from": "human", "value": "// Formatting library for C++ - Grisu tests\n//\n// Copyright (c) 2012 - present, Victor Zverovich\n// All rights reserved.\n//\n// For the license information refer to format.h.\n\n#define FMT_US...
c++
chosen
[ { "from": "system", "value": "Fix compile error in TestCxxWCharT on Linux\n\ngit-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@239830 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { "from": "human", "value": "//===-- main.c --------------------------------------------------*- C++ -*-===//\n//\n/...
c++
chosen
[ { "from": "system", "value": "Handle return memory of size 0 and large offset\n" }, { "from": "human", "value": "\n#include \"Runtime.h\"\n\n#include <llvm/IR/GlobalVariable.h>\n#include <llvm/IR/Function.h>\n#include <llvm/IR/IntrinsicInst.h>\n\nnamespace dev\n{\nnamespace eth\n{\nnamespace jit...
c++
chosen
[ { "from": "system", "value": "[sanitizer] Simplify stack check in accert.cc\nSomehow on arm bots stack does not include main.\n\ngit-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@318002 91177308-0d34-0410-b5e6-96231b3b80d8\n" }, { "from": "human", "value": "// Test the handle_abort option.\n\...
c++
chosen
[ { "from": "system", "value": "[examples] Fix return type in c_api_func\n" }, { "from": "human", "value": "#include <im_str/im_str.hpp>\n\n#include <cstring>\n#include <string>\n#include <iostream>\n\nint c_api_func(const char* str) {\n\treturn std::strlen( str );\n}\n\nint main() {\n\tusing name...
c++
chosen
[ { "from": "system", "value": "Fix issue with static order creation\n" }, { "from": "human", "value": "#include \"dukbind_validation.h\"\n#include <regex>\n\nnamespace dukbind\n{\n namespace validation\n {\n static std::regex identifer_regex( \"[a-zA-Z$_][a-zA-Z0-9$_]*\" );\n\n ...
c++
chosen
[ { "from": "system", "value": "Implement automatic refreshing in ncurses::Session using halfdelay\n" }, { "from": "human", "value": "#include \"session.h\"\n\n#include <ncurses.h>\n\nnamespace ncurses\n{\n std::shared_ptr < Panel > Session::panel;\n\n void Session::init ()\n {\n /...
c++
chosen
[ { "from": "system", "value": "Reconfigure zeus for 38400 baud operation on USART1 and 3.\n" }, { "from": "human", "value": "#include \"variant/usart_platform.hpp\"\n\n#include \"hal.h\"\n\n// USART1 configuration\nstatic const SerialConfig usart1_config = {\n 115200,\n 0,\n USART_CR2_STOP1_BI...
c++
chosen
[ { "from": "system", "value": "feat(card-impl): Add code to add aura to game and battlefield\n\n" }, { "from": "human", "value": "// This code is based on Sabberstone project.\n// Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva\n// RosettaStone is hearthstone simulator using C++ w...
c++
chosen
[ { "from": "system", "value": "Change std::regex detection test to detect bug in libstdc++.\n\nlibstdc++'s std::regex has (or had) a bug in std::regex::operator=(...) that\ncaused undefined behaviour. Clang will detect this and compile the function so\nthat it crashes at runtime. This patch tried to detect t...
c++
chosen
[ { "from": "system", "value": "Fix wrong reference to header\n" }, { "from": "human", "value": "#include \"vm.hpp\"\n#include \"vm/object_utils.hpp\"\n\n#include \"capi/capi.hpp\"\n#include \"capi/include/ruby.h\"\n\nusing namespace rubinius;\nusing namespace rubinius::capi;\n\nextern \"C\" {\n ...
c++
chosen
[ { "from": "system", "value": "Add default parameters for constructor\n" }, { "from": "human", "value": "#include \"../Swarm.h\"\n#include <Eigen/Core>\n#include <pybind11/eigen.h>\n#include <pybind11/functional.h>\n#include <pybind11/pybind11.h>\n#include <pybind11/stl.h>\n\nnamespace MetaOpt\n{...
c++
chosen
[ { "from": "system", "value": "Solve some silly problems with the algorithm.\n" }, { "from": "human", "value": "#include <algorithm>\n#include <set>\nusing namespace std;\n\ntypedef set<int> si;\n/* Get the divisors of a number */\nsi divisores(int n) {\n vi d;\n int r = sqrt(n);\n\n for...
c++
chosen
[ { "from": "system", "value": "Fix multiple compilations for one file" }, { "from": "human", "value": "#include \"dependency_tree.hpp\"\n\n#include \"osal.hpp\"\n#include \"file_exist.hpp\"\n#include \"resolver.hpp\"\n#include <algorithm>\n\nResolver *DependencyTree::addTarget(const std::string &...
c++
chosen
[ { "from": "system", "value": "Add posix process popen streambufs\n" }, { "from": "human", "value": "#ifndef PIPED_PROCESS_CPP\r\n#define PIPED_PROCESS_CPP\r\n\r\n#include<iostream>\r\n\r\nclass child_process_streambuf: public std::streambuf\r\n{\r\npublic:\r\n\tvirtual int underflow() \r\n\t{\r\...
c++
chosen
[ { "from": "system", "value": "Apply naming rule to dataSet -> dataset\n" }, { "from": "human", "value": "//=======================================================================\n// Copyright (c) 2017 Adrian Schneider\n// Distributed under the terms of the MIT License.\n// (See accompanying fil...
c++
chosen
[ { "from": "system", "value": "Add 500 ms delay on boot\n\nFixes #11.\n" }, { "from": "human", "value": "#include <HX711.h>\n#include \"TimerDisplay.h\"\n#include \"GramsDisplay.h\"\n#include \"SmoothingFilter.h\"\n\n#define DISP_TIMER_CLK 2\n#define DISP_TIMER_DIO 3\n#define DISP_SCALE_CLK 8\n#d...
c++
chosen
[ { "from": "system", "value": "Disable webrtc cast api test\n\nBUG=301920\nTBR=mattm@chromium.org\n\nReview URL: https://codereview.chromium.org/58953002\n\ngit-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@232914 0039d316-1c4b-4281-b951-d872f2087c98\n" }, { "from": "human", "value": "// Copyr...
c++
chosen
[ { "from": "system", "value": "Fix after @rafaelcn did blame me crying about incorrect usage of cerr\n" }, { "from": "human", "value": "/**\n * C++ algorithm to get the sum of all prime numbers between a range of 2 and the number desired. \n */\n \n#include <iostream>\n#include <cstdlib>\n \nbool...
c++
chosen
[ { "from": "system", "value": "Add some missing includes, necessary on some platforms.\n" }, { "from": "human", "value": "#include <iostream>\n\n// Entry point for Dinit.\n\nint dinit_main(int argc, char **argv);\n\nint main(int argc, char **argv)\n{\n try {\n return dinit_main(argc, ar...
c++
chosen
[ { "from": "system", "value": "Fix for libc++ not properly declaring nan() functions.\n" }, { "from": "human", "value": "// Standard Dependencies\n#include <cmath>\n#include <random>\n\n// Module Dependencies\n#include \"../include/math.h\"\n\nnamespace native\n{\n\tstatic std::default_random_eng...
c++
chosen
[ { "from": "system", "value": "Set organization name to save settings\n" }, { "from": "human", "value": "#include <QCoreApplication>\n#include <QDebug>\n\n#include \"ganalytics.h\"\n\nclass Watcher : public QObject\n{\n Q_OBJECT\n\npublic slots:\n void onIsSendingChanged(bool sending)\n ...
c++
chosen
[ { "from": "system", "value": "Fix testPipeEventWatcher test case failed\n" }, { "from": "human", "value": "\n#include \"test_common.h\"\n\n#include <evpp/exp.h>\n#include <evpp/libevent_headers.h>\n#include <evpp/libevent_watcher.h>\n#include <thread>\n\nnamespace {\nstatic bool g_event_handler_...
c++
chosen
[ { "from": "system", "value": "Prepare bounding box transform for Ellipse\n" }, { "from": "human", "value": "#include \"SketchItemEllipse.h\"\n\n#include <QGraphicsEllipseItem>\n\nSketchItemEllipse::SketchItemEllipse(qreal x, qreal y)\n : SketchItemBezier(x, y)\n{\n addPath(QPointF(30, 0), ...
c++
chosen
[ { "from": "system", "value": "Add implementation to cache reader\n" }, { "from": "human", "value": "#include \"CacheJsonToArticleConverter.h\"\n\n\nArticleCollection& CacheJsonToArticleConverter::convertToArticle(std::string json, ArticleCollection& articleCache)\n{\n return articleCache;\n}\...
c++
chosen
[ { "from": "system", "value": "Fix some PowerPC issues in the byteswap test\n" }, { "from": "human", "value": "/*\n * Copyright 2015 - 2017 gtalent2@gmail.com\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed ...
c++
chosen
[ { "from": "system", "value": "Modify window raise on windows\n" }, { "from": "human", "value": "#include <QApplication>\n#include <QQmlApplicationEngine>\n#include <QQmlContext>\n#include <stdlib.h>\n#include <QtGlobal>\n#include <QtWidgets>\n#include <QtSingleApplication>\n\nint main(int argc, ...
c++
chosen
[ { "from": "system", "value": "Remove comment about where to put ShouldQuit.\n" }, { "from": "human", "value": "#include <algorithm>\n#include <cctype>\n#include <sstream>\n\n#include \"cons.h\"\n#include \"utils.h\"\n\nnamespace mclisp\n{\n\ntemplate<typename T>\nstd::string ContainerToString(T ...
c++
chosen
[ { "from": "system", "value": "Fix out of bounds error on Linux.\n" }, { "from": "human", "value": "#include \"polyChecksum.h\"\n\nPolyChecksum::PolyChecksum()\n{\n\t// for all possible byte values\n\tfor (unsigned i = 0; i < 256; ++i)\n\t{\n\t\tunsigned long reg = i << 24;\n\t\t// for all bits i...
c++
chosen
[ { "from": "system", "value": "Remove capturing lambda capturing of static variable\n" }, { "from": "human", "value": "#include <MinConsole.hpp>\n#include <Windows.h>\n#include <mutex>\n\nnamespace MinConsole\n{\nvoid* GetOutputHandle()\n{\n\tstatic void* Handle = nullptr;\n\tstd::once_flag Handl...
c++
chosen
[ { "from": "system", "value": "Add copyright notice required for open-sourcing\n\nTest: builds OK\nChange-Id: I1f148962d506ae697bc36f31aa8824082eea4171\n" }, { "from": "human", "value": "//dummy file, so Android Studio will 'see' these folders\n" }, { "from": "gpt", "value": "/*\n * C...
c++
chosen
[ { "from": "system", "value": "Add identifying block number in rotation test\n" }, { "from": "human", "value": "#include \"logic.cpp\"\n#include <iostream>\n#include <cstdlib>\n\nint main( void );\nvoid printCoords( block* b );\nint rotationTest( void );\n\nint main( void )\n{\n std::cout << \"R...
c++
chosen
[ { "from": "system", "value": "Include string.h instead of string\n" }, { "from": "human", "value": "#include \"unicode-utils.h\"\n#include <clocale>\n#include <stdlib.h>\n#include <string>\n\nint UnicodeUtils::characters_in_bytes(const char* string, int bytes) {\n if (bytes == 0)\n return 0;...
c++
chosen
[ { "from": "system", "value": "Update wheel diameter for Create 2\n\nNow matches the spec from iRobot.\n\nSigned-off-by: Jacob Perron <f862f167b85d41b225785c70d70808bc7337c1fe@openrobotics.org>\n" }, { "from": "human", "value": "#include \"create/types.h\"\n\nnamespace create {\n\n RobotModel::R...
c++
chosen
[ { "from": "system", "value": "Convert to std::make_shared() to avoid allocation overhead\n\nThis also tidies up the code in main() in a way that doesn't make it\nsusceptible to memory leaks.\n" }, { "from": "human", "value": "#include \"test.h\"\n#include \"test-job.h\"\n#include \"test-machine....
c++
chosen
[ { "from": "system", "value": "Create device enumerator and get default device for WASAPI\n" }, { "from": "human", "value": "// Copyright 2015-2018 Elviss Strazdins. All rights reserved.\n\n#include \"AudioDeviceWASAPI.hpp\"\n\nnamespace ouzel\n{\n namespace audio\n {\n AudioDeviceWA...
c++
chosen
[ { "from": "system", "value": "Use the GFA output format\n" }, { "from": "human", "value": "/*\n * Copyright (c) 2017-2018 Tuukka Norri\n * This code is licensed under MIT license (see LICENSE for details).\n */\n\n#include <vcf2multialign/graph_writer.hh>\n\nnamespace vcf2multialign\n{\n\t// Dum...
c++
chosen
[ { "from": "system", "value": "Support comments in Cover files\n" }, { "from": "human", "value": "#include \"CoverReader.h\"\n\n#include <fstream>\n\nNetworKit::Cover NetworKit::CoverReader::read(std::string path, NetworKit::Graph &G)\n{\n\tstd::ifstream file;\n\tfile.open(path);\n\tif (!file.goo...
c++
chosen
[ { "from": "system", "value": "Fix the not matching header file path\n\n* This commit due to commit 565888f949aabba22afad22d5d9a51568accfd32\n" }, { "from": "human", "value": "#include <stdio.h>\n\n#include \"../excercise04/make_random_data/make_random_data.hpp\"\n#include \"../excercise04/sort/q...
c++
chosen