doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
92c7bb82-2569-45a9-8ae5-7d3885c025d0 | {
"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.
// Calculate Crc by calling CRC method in LZMA SDK
#include "courgette/crc.h"
extern "C" {
#include "third_party/lzma_sdk/7zCrc.h"
}
namespa... | ```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 "courgette/crc.h"
#ifdef COURGETTE_USE_CRC_LIB
# include "zlib.h"
#else
extern "C" {
# include "third_party/lzma_sdk/7zCrc.h"
}
#en... |
1be2286b-0099-462e-b2d7-2fb6e7b10e70 | {
"language": "C++"
} | ```c++
// coding: utf-8
#include "hardware.hpp"
// system tick timer
ISR(TIMER2_COMPA_vect)
{
xpcc::Clock::increment();
}
// main function \o/
int
main(void)
{
// set the led pins
initializeLeds();
RedLedPin::setOutput();
GreenLedPin::setOutput();
BlueLedPin::setOutput();
LightSensorPin::setInput();
// set ... | ```c++
// coding: utf-8
#include "hardware.hpp"
// system tick timer
ISR(TIMER2_COMPA_vect)
{
xpcc::Clock::increment();
}
// main function \o/
int
main(void)
{
// set the led pins
initializeLeds();
RedLedPin::setOutput();
GreenLedPin::setOutput();
BlueLedPin::setOutput();
LightSensorPin::setInput();
// set ... |
317f0258-ec03-4192-a8f1-351bdc2c477b | {
"language": "C++"
} | ```c++
// FIXME: Disabled until catch IRgen change lands.
// RUNX: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fcxx-exceptions -fexceptions -fno-rtti -DTRY | FileCheck %s -check-prefix=TRY
// RUNX: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fcxx-exception... | ```c++
// FIXME: Disabled until catch IRgen change lands.
// RUNX: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fcxx-exceptions -fexceptions -fno-rtti -DTRY | FileCheck %s -check-prefix=TRY
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fcxx-exceptions... |
51a1c222-a0b3-4f52-a922-d3ed18dce6a9 | {
"language": "C++"
} | ```c++
#include <iostream>
#include <unistd.h>
int age = 23;
int main()
{
sleep(2);
std::cout << "I am Adrian.\n" << "Age: " << age << "\n";
return 0;
}```
Add newline at the end of the file | ```c++
#include <iostream>
#include <unistd.h>
int age = 23;
int main()
{
sleep(2);
std::cout << "I am Adrian.\n" << "Age: " << age << "\n";
return 0;
}
``` |
46fb7244-ee72-4dc1-bee0-daf4bd79c2a7 | {
"language": "C++"
} | ```c++
/*
* SOPMQ - Scalable optionally persistent message queue
* Copyright 2014 InWorldz, LLC
*
* 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/L... | ```c++
/*
* SOPMQ - Scalable optionally persistent message queue
* Copyright 2014 InWorldz, LLC
*
* 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/L... |
7290b3d6-059f-4d97-bbc1-ad89cb2536d8 | {
"language": "C++"
} | ```c++
// Copyright (C) 2015 Jack Maloney. All Rights Reserved.
//
// This Source Code Form is subject to the terms of the Mozilla Public License,
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "voltz-internal.h"
double StartupTime;
... | ```c++
// Copyright (C) 2015 Jack Maloney. All Rights Reserved.
//
// This Source Code Form is subject to the terms of the Mozilla Public License,
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "voltz-internal.h"
#include <ctime>
#incl... |
80c8a128-33dd-4182-ad14-f4f5ad58de8c | {
"language": "C++"
} | ```c++
#include<iostream>
int main()
{
int value1 = 0, value2 = 0;
std::cin >> value1 >> value2;
std::cout << "The product of " << value1 << " and " << value2 << " equals " << value1 + value2 << std::endl;
return 0;
}
```
Fix * instead of + | ```c++
#include<iostream>
int main()
{
int value1 = 0, value2 = 0;
std::cin >> value1 >> value2;
std::cout << "The product of " << value1 << " and " << value2 << " equals " << value1 * value2 << std::endl;
return 0;
}
``` |
d72f964f-716f-4aaa-ac12-70574b8a0e04 | {
"language": "C++"
} | ```c++
/*
* Copyright (c) 2003-2016 Rony Shapiro <ronys@pwsafe.org>.
* All rights reserved. Use of the code is allowed under the
* Artistic License 2.0 terms, as specified in the LICENSE file
* distributed with this code, or available from
* http://www.opensource.org/licenses/artistic-license-2.0.php
*/
/**
* \file W... | ```c++
/*
* Copyright (c) 2003-2016 Rony Shapiro <ronys@pwsafe.org>.
* All rights reserved. Use of the code is allowed under the
* Artistic License 2.0 terms, as specified in the LICENSE file
* distributed with this code, or available from
* http://www.opensource.org/licenses/artistic-license-2.0.php
*/
/**
* \file W... |
003525e6-210f-4999-af9c-23935f2e19d1 | {
"language": "C++"
} | ```c++
#include "output.h"
Output output;
float a = 123.0;
int b = 79;
unsigned int c = 24;
int main()
{
float d = b;
float e = c;
output << (int) a; // CHECK: 0x0000007b
output << (unsigned int) a; // CHECK: 0x0000007b
output << (int) d; // CHECK: 0x0000004f
// output << (int) e; // XXX should be 0x18,... | ```c++
#include "output.h"
Output output;
float a = 123.0;
int b = 79;
unsigned int c = 24;
unsigned int f = 0x81234000;
int main()
{
float d = b;
float e = c;
float g = f;
output << (int) a; // CHECK: 0x0000007b
output << (unsigned int) a; // CHECK: 0x0000007b
output << (int) d; // CHECK: 0x0000004f
ou... |
432fcf93-c628-4f2c-8a15-7af834a57e43 | {
"language": "C++"
} | ```c++
// Check the value profiling instrinsics emitted by instrumentation.
// RUN: %clangxx %s -o - -emit-llvm -S -fprofile-instr-generate -mllvm -enable-value-profiling -fexceptions -target %itanium_abi_triple | FileCheck %s
void (*foo) (void);
int main(int argc, const char *argv[]) {
// CHECK: [[REG1:%[0-9]+]] =... | ```c++
// Check the value profiling instrinsics emitted by instrumentation.
// RUN: %clang_cc1 %s -o - -emit-llvm -fprofile-instrument=clang -mllvm -enable-value-profiling -fexceptions -fcxx-exceptions -triple %itanium_abi_triple | FileCheck %s
void (*foo) (void);
int main(int argc, const char *argv[]) {
// CHECK: ... |
573b0d38-5f92-4717-843a-95f2a310db5f | {
"language": "C++"
} | ```c++
//------------------------------------------------------------------------------
// HTTPFileSystemTest.cc
// Test HTTP file system functionality.
//------------------------------------------------------------------------------
#include "Pre.h"
#include "UnitTest++/src/UnitTest++.h"
#include "Core/Core.h"
#incl... | ```c++
//------------------------------------------------------------------------------
// HTTPFileSystemTest.cc
// Test HTTP file system functionality.
//------------------------------------------------------------------------------
#include "Pre.h"
#include "UnitTest++/src/UnitTest++.h"
#include "Core/Core.h"
#incl... |
c2448990-6a41-4fc1-a0ba-f61ccf5d5b7c | {
"language": "C++"
} | ```c++
#include <Halide.h>
#include <sys/time.h>
using namespace Halide;
double currentTime() {
timeval t;
gettimeofday(&t, NULL);
return t.tv_sec * 1000.0 + t.tv_usec / 1000.0f;
}
int main(int argc, char **argv) {
Func f, g, h; Var x, y;
h(x) = x;
g(x) = h(x-1) + h(x+1);
f(x, y) = ... | ```c++
#include <Halide.h>
using namespace Halide;
int main(int argc, char **argv) {
Func f, g, h; Var x, y;
h(x) = x;
g(x) = h(x-1) + h(x+1);
f(x, y) = (g(x-1) + g(x+1)) + y;
h.root();
g.root();
if (use_gpu()) {
f.cudaTile(x, y, 16, 16);
g.cudaTile(x, 128);
... |
08451528-c44c-45fc-80cf-e664acad9317 | {
"language": "C++"
} | ```c++
#include "fish_detector/common/species_dialog.h"
#include "ui_species_dialog.h"
namespace fish_detector {
SpeciesDialog::SpeciesDialog(QWidget *parent)
: QDialog(parent)
, ui_(new Ui::SpeciesDialog) {
ui_->setupUi(this);
}
void SpeciesDialog::on_ok_clicked() {
}
void SpeciesDialog::on_cancel_clicked()... | ```c++
#include "fish_detector/common/species_dialog.h"
#include "ui_species_dialog.h"
namespace fish_detector {
SpeciesDialog::SpeciesDialog(QWidget *parent)
: QDialog(parent)
, ui_(new Ui::SpeciesDialog) {
ui_->setupUi(this);
}
void SpeciesDialog::on_ok_clicked() {
accept();
}
void SpeciesDialog::on_canc... |
629420cb-4ae6-4586-8872-fb10a10d3dee | {
"language": "C++"
} | ```c++
/* ****************************************************************************
*
* Copyright (c) Microsoft Corporation.
*
* This source code is subject to terms and conditions of the Apache License, Version 2.0. A
* copy of the license can be found in the License.html file at the root of this distri... | ```c++
/* ****************************************************************************
*
* Copyright (c) Microsoft Corporation.
*
* This source code is subject to terms and conditions of the Apache License, Version 2.0. A
* copy of the license can be found in the License.html file at the root of this distri... |
98dc3d50-e570-48dc-ae43-1bfe30f13504 | {
"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)
//==============================================... |
6aebeea7-b463-4496-8cf5-9939437985ad | {
"language": "C++"
} | ```c++
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file is part of the wikidata_cpp project:
* https://github.com/radupopescu/wikidata_cpp
*/
... | ```c++
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file is part of the wikidata_cpp project:
* https://github.com/radupopescu/wikidata_cpp
*/
... |
4d49c126-d45f-49b8-a8c5-c529fc2b1c0e | {
"language": "C++"
} | ```c++
#include <ros/ros.h>
#include <sensor_msgs/Imu.h>
int main(int argc, char **argv) {
// Initialize ROS
ros::init(argc, argv, "test_imu");
ros::NodeHandle nh;
// Create a publisher object
ros::Publisher imuPub = nh.advertise<sensor_msgs::Imu>("imu/data",1);
// Create an Imu message object
sensor_ms... | ```c++
#include <ros/ros.h>
#include <sensor_msgs/Imu.h>
int main(int argc, char **argv) {
// Initialize ROS
ros::init(argc, argv, "test_imu");
ros::NodeHandle nh;
ros::NodeHandle private_nh("~");
// Create variables for yaw rate
double yawRate;
if(!private_nh.getParam("rate", yawRate)) {
yawRate = ... |
6d828323-d6b8-4803-8adb-574a0da0240a | {
"language": "C++"
} | ```c++
/// \file main.cpp
#include "HelloTriangleApplication.hpp"
#include "VDeleter.hpp"
// waf-generated header
#include "config.hpp"
#define DOCTEST_CONFIG_IMPLEMENT
#include "doctest.h"
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <iostream>
#include <string>
int main(int argc, char* argv[]... | ```c++
/// \file main.cpp
#include "HelloTriangleApplication.hpp"
#include "VDeleter.hpp"
// waf-generated header
#include "config.hpp"
#define DOCTEST_CONFIG_IMPLEMENT
#include "doctest.h"
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <iostream>
#include <string>
int main(int argc, char* argv[]... |
dd0f5603-30cb-4544-916b-2f088cefc8aa | {
"language": "C++"
} | ```c++
#include <QtQuick>
#include <sailfishapp.h>
#include <QScopedPointer>
#include <QQuickView>
#include <QQmlEngine>
#include <QGuiApplication>
#include "factor.h"
int main(int argc, char *argv[])
{
// For this example, wizard-generates single line code would be good enough,
// but very soon it won't be ... | ```c++
#include <QtQuick>
#include <sailfishapp.h>
#include <QScopedPointer>
#include <QQuickView>
#include <QQmlEngine>
#include <QGuiApplication>
#include "factor.h"
int main(int argc, char *argv[])
{
QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));
QScopedPointer<QQuickView> view... |
ddde65df-f4ee-4860-955c-a134626c1972 | {
"language": "C++"
} | ```c++
//===--------------------- LLDBAssert.cpp ------------------------*- C++-*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... | ```c++
//===--------------------- LLDBAssert.cpp ------------------------*- C++-*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... |
4dc232a0-81ad-4563-aa98-c396f3710c12 | {
"language": "C++"
} | ```c++
#if defined(WIN32) && !defined(_DEBUG)
#pragma comment(linker, "/SUBSYSTEM:WINDOWS /entry:mainCRTStartup")
#endif
#include "Application.h"
#include <memory>
#include <gloperate-qtapplication/Viewer.h>
int main(int argc, char * argv[])
{
Application app(argc, argv);
std::unique_ptr<gloperate_qtapp... | ```c++
#if defined(WIN32) && !defined(_DEBUG)
#pragma comment(linker, "/SUBSYSTEM:WINDOWS /entry:mainCRTStartup")
#endif
#include "Application.h"
#include <memory>
#include <gloperate-qtapplication/Viewer.h>
#include <widgetzeug/dark_fusion_style.hpp>
int main(int argc, char * argv[])
{
Application app(argc... |
afdc6987-bbb8-4185-b89d-f2eeb01746ea | {
"language": "C++"
} | ```c++
#include <cstdlib>
#include <string.h>
#include <iostream>
int main() {
#ifdef __APPLE__
const char* name = "DYLD_LIBRARY_PATH";
#else
const char* name = "LD_LIBRARY_PATH";
#endif
const char* cetLDPathValue = getenv("CETD_LIBRARY_PATH");
int res = setenv("DYLD_LIBRARY_PATH", cetLDPathValue, 1);
cons... | ```c++
#include <cstdlib>
#include <string.h>
#include <iostream>
int main() {
#ifdef __APPLE__
const char* name = "DYLD_LIBRARY_PATH";
#else
const char* name = "LD_LIBRARY_PATH";
#endif
const char* cetLDPathValue = getenv("CETD_LIBRARY_PATH");
int res = setenv(name, cetLDPathValue, 1);
if (res != 0) {
... |
a73a894b-b0d8-4641-b7b9-cc1869f9f056 | {
"language": "C++"
} | ```c++
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*
* 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 app... | ```c++
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
*
* 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 app... |
87cfc5ed-ec91-4a1e-818e-64c560770f6c | {
"language": "C++"
} | ```c++
// The main caffe test code. Your test cpp code should include this hpp
// to allow a main function to be compiled into the binary.
#include "caffe/caffe.hpp"
#include "caffe/test/test_caffe_main.hpp"
namespace caffe {
#ifndef CPU_ONLY
cudaDeviceProp CAFFE_TEST_CUDA_PROP;
#endif
}
#ifndef CPU_ONLY
using caf... | ```c++
#include "caffe/caffe.hpp"
#include "caffe/test/test_caffe_main.hpp"
namespace caffe {
#ifndef CPU_ONLY
cudaDeviceProp CAFFE_TEST_CUDA_PROP;
#endif
}
#ifndef CPU_ONLY
using caffe::CAFFE_TEST_CUDA_PROP;
#endif
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
caffe::GlobalInit(&ar... |
cff893c4-58b2-4e5c-8a74-770fb0330d4f | {
"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 "../client/gles2_lib.h"
#include "../common/thread_local.h"
namespace gles2 {
namespace {
gpu::ThreadLocalKey g_gl_context_key;
} //... | ```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 "../client/gles2_lib.h"
#include "../common/thread_local.h"
namespace gles2 {
// TODO(kbr): the use of this anonymous namespace core ... |
7c9f6fab-aa86-4f70-8416-40afd2d6f41b | {
"language": "C++"
} | ```c++
#include "dafs/node.hpp"
namespace dafs
{
Node::Node()
: slot_minus(dafs::Root("p-minus")),
slot_zero(dafs::Root("p-zero")),
slot_plus(dafs::Root("p-plus"))
{
}
dafs::Partition&
Node::GetPartition(Slot slot)
{
switch (slot)
{
case... | ```c++
#include "dafs/node.hpp"
namespace dafs
{
Node::Node()
: slot_minus(dafs::Root("p-minus")),
slot_zero(dafs::Root("p-zero")),
slot_plus(dafs::Root("p-plus"))
{
}
dafs::Partition&
Node::GetPartition(Slot slot)
{
switch (slot)
{
case... |
8c54b047-3c4c-4ef0-a340-1dbca3c4c6c3 | {
"language": "C++"
} | ```c++
#include <iostream>
static constexpr unsigned getSequenceLength(unsigned number) noexcept
{
unsigned length = 0;
while (number != 1) {
if ((number & 1) == 0) {
number >>= 1;
} else {
number = 3 * number + 1;
... | ```c++
#include <iostream>
static constexpr unsigned getSequenceLength(unsigned number) noexcept
{
unsigned length = 0;
while (number != 1) {
if ((number & 1) == 0) {
number >>= 1;
} else {
number = 3 * number + 1;
... |
1f900a26-607f-4e89-aa39-d6162dd32c0d | {
"language": "C++"
} | ```c++
// This code is based on Sabberstone project.
// Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva
// RosettaStone is hearthstone simulator using C++ with reinforcement learning.
// Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon
#include <Rosetta/Conditions/SelfCondition.hpp>
#includ... | ```c++
// This code is based on Sabberstone project.
// Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva
// RosettaStone is hearthstone simulator using C++ with reinforcement learning.
// Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon
#include <Rosetta/Conditions/SelfCondition.hpp>
#includ... |
8d9b6231-96ef-4950-a53d-ddc5e0f5a9dc | {
"language": "C++"
} | ```c++
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include <stdio.h>
#include "Arduino.h"
extern "C" {
size_t _write(int handle, const unsigned char *buf, size_t bufSize)
{
/* Check for the com... | ```c++
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include <stdio.h>
#include "Arduino.h"
asm(".global _printf_float");
asm(".global _scanf_float");
extern "C" {
size_t _write(int handle, const unsigned c... |
e911fbcf-675a-49d5-9447-e938cc24cb6a | {
"language": "C++"
} | ```c++
#include "gtest\gtest.h"
#include "TiledFixture.h"
TEST_F(TiledFixture, map_attributes_should_be_parsed)
{
ASSERT_EQ("1.0", _parsedMap->get_version());
ASSERT_EQ("1.0.3", _parsedMap->get_tiledVersion());
ASSERT_EQ(Orientation::ORTOGNAL, _parsedMap->get_orientation());
ASSERT_EQ(RenderOrder::RIG... | ```c++
#include "gtest\gtest.h"
#include "TiledFixture.h"
TEST_F(TiledFixture, map_attributes_should_be_parsed)
{
ASSERT_EQ("1.0", _parsedMap->get_version());
ASSERT_EQ("1.0.3", _parsedMap->get_tiledVersion());
ASSERT_EQ(Orientation::ORTOGNAL, _parsedMap->get_orientation());
ASSERT_EQ(RenderOrder::RIG... |
0978aced-c297-4c7e-b061-d0819d0eb35d | {
"language": "C++"
} | ```c++
#include "About.h"
#include "../resource.h"
#include "../Updater/Updater.h"
#include "../Updater/Version.h"
void About::Initialize() {
INIT_CONTROL(LBL_TITLE, Label, _title);
std::wstring version = Updater::MainAppVersionString();
_title.Text(L"3RVX " + version);
}
void About::LoadSettings() {
}... | ```c++
#include "About.h"
#include "../resource.h"
#include "../Updater/Updater.h"
#include "../Updater/Version.h"
void About::Initialize() {
INIT_CONTROL(LBL_TITLE, Label, _title);
std::wstring version = Updater::MainAppVersion().ToString();
_title.Text(L"3RVX " + version);
}
void About::LoadSettings()... |
f1384b74-175b-4689-b831-1b2b078c95e7 | {
"language": "C++"
} | ```c++
// Copyright (C) 2017 Elviss Strazdins
// This file is part of the Ouzel engine.
#include "ApplicationLinux.h"
int main(int argc, char* argv[])
{
ouzel::ApplicationLinux application(argc, argv);
return application.run();
}
```
Fix engine initialization on Linux | ```c++
// Copyright (C) 2017 Elviss Strazdins
// This file is part of the Ouzel engine.
#include "EngineLinux.h"
int main(int argc, char* argv[])
{
ouzel::EngineLinux engine(argc, argv);
return engine.run();
}
``` |
b07e0b4d-300f-4068-921a-d0d169ad9cbd | {
"language": "C++"
} | ```c++
// Copyright (c) 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "xwalk/dbus/dbus_manager.h"
#include <glib.h>
#include <string>
#include "base/bind.h"
#include "base/strings/stringprintf.h"
#include "... | ```c++
// Copyright (c) 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "xwalk/dbus/dbus_manager.h"
#include <glib.h>
#include <string>
#include "base/bind.h"
#include "base/strings/stringprintf.h"
#include "... |
8b4f8a58-a598-4fb5-94f7-59382f0d9d90 | {
"language": "C++"
} | ```c++
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
#include "Suite.h"
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define... | ```c++
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
#include "Suite.h"
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define... |
6d9e5db2-deb5-4890-a502-1cef8c7f574c | {
"language": "C++"
} | ```c++
// Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.
#include "config.h"
#include "PluginData.h"
#include "PluginInfoStore.h"
#undef LOG
#include "webkit/glue/glue_util.h"
#include "webkit/glue... | ```c++
// Copyright (c) 2008, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list o... |
3ed0b374-1f96-4818-90fb-4d3e6c8c0bc9 | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
struct X1 {
X1();
};
struct X2 {
X2();
~X2();
};
void vararg(...);
void f(X1 x1, X2 x2) {
vararg(x1); // okay
vararg(x2); // expected-error{{cannot pass object of non-trivial type 'X2' through variadic function; call will abort at runtime}}
}
... | ```c++
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
struct X1 {
X1();
};
struct X2 {
X2();
~X2();
};
struct X3 {
X3(const X3&) = default;
};
struct X4 {
X4(const X4&) = default;
X4(X4&);
};
void vararg(...);
void f(X1 x1, X2 x2, X3 x3, X4 x4) {
vararg(x1); // OK
vararg(x2); // expected-e... |
a6889992-f128-4619-972a-f4ce5b2c203e | {
"language": "C++"
} | ```c++
#include "ExecutableLauncherUnix.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>
#include <cstdlib>
using namespace clt::filesystem::operations;
void ExecutableLauncherUnix::execute(const entities::Path & path)
{
pid_t cpid;
cpid = fork();
switc... | ```c++
#include "ExecutableLauncherUnix.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>
#include <cstdlib>
using namespace clt::filesystem::operations;
void ExecutableLauncherUnix::execute(const entities::Path & path)
{
pid_t cpid;
cpid = fork();
switc... |
d51e6c20-e929-4c9c-b00e-af25cd9f0aa3 | {
"language": "C++"
} | ```c++
#include "heapsort.hpp"
#include "heap.hpp"
#include "swap.hpp"
void heapsort(int *data, const int size_of_data)
{
binary_max_heap(data, size_of_data - 1);
do_heapsort(data, size_of_data - 1);
}
void do_heapsort(int *data, const int end)
{
if(end <= 0) return;
int k = 0;
swap(data[k], dat... | ```c++
#include "heapsort.hpp"
#include "heap.hpp"
#include "swap.hpp"
void heapsort(int *data, const int size_of_data)
{
convert_to_binary_max_heap(data, size_of_data);
do_heapsort(data, size_of_data - 1);
}
void do_heapsort(int *data, const int end)
{
if(end <= 0) return;
int k = 0;
swap(data[k... |
236e9df6-e651-4483-be04-3a507745a7c2 | {
"language": "C++"
} | ```c++
#define BOOST_TEST_MODULE Bitcoin Test Suite
#include <boost/test/unit_test.hpp>
#include "db.h"
#include "txdb.h"
#include "main.h"
#include "wallet.h"
CWallet* pwalletMain;
CClientUIInterface uiInterface;
extern bool fPrintToConsole;
extern void noui_connect();
struct TestingSetup {
CCoinsViewDB *pcoin... | ```c++
#define BOOST_TEST_MODULE Bitcoin Test Suite
#include <boost/test/unit_test.hpp>
#include "db.h"
#include "txdb.h"
#include "main.h"
#include "wallet.h"
CWallet* pwalletMain;
CClientUIInterface uiInterface;
extern bool fPrintToConsole;
extern void noui_connect();
struct TestingSetup {
CCoinsViewDB *pcoin... |
0449117c-d335-4b2c-b230-5da072346148 | {
"language": "C++"
} | ```c++
#include "mock/unittest_utils.hpp"
#include <stdlib.h>
#include "errors.hpp"
#include <boost/bind.hpp>
#include "arch/timing.hpp"
#include "arch/runtime/starter.hpp"
#include "utils.hpp" // randint
namespace mock {
temp_file_t::temp_file_t(const char *tmpl) {
size_t len = strlen(tmpl);
fi... | ```c++
#include "mock/unittest_utils.hpp"
#include <stdlib.h>
#include "errors.hpp"
#include <boost/bind.hpp>
#include "arch/timing.hpp"
#include "arch/runtime/starter.hpp"
#include "utils.hpp" // randint
namespace mock {
temp_file_t::temp_file_t(const char *tmpl) {
size_t len = strlen(tmpl);
fi... |
2c321b54-52f0-4c75-8f67-085f573bbd1f | {
"language": "C++"
} | ```c++
#include "lua.h"
extern "C"
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
__declspec(dllimport)
#endif
int luaopen_luapbintf(lua_State* L);
int main() {
void * p = static_cast<void*>(luaopen_luapbintf);
return 0;
}
```
Fix error: invalid static_cast from type ‘int(lua_State*... | ```c++
#include "lua.h"
extern "C"
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
__declspec(dllimport)
#endif
int luaopen_luapbintf(lua_State* L);
int main() {
int (*pFun)(lua_State*);
pFun = luaopen_luapbintf;
return 0;
}
``` |
a5f48ce4-1ba1-47b2-944c-4e85ce8b4218 | {
"language": "C++"
} | ```c++
/* Copyright 2022 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 2022 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... |
a5276724-effe-4a1d-947c-7e0d40104be3 | {
"language": "C++"
} | ```c++
#include <scriptzeug/ScriptContext.h>
#include <scriptzeug/Backend/AbstractScriptContext.h>
#include "BackendDuktape/DuktapeScriptContext.h"
#ifdef LIBZEUG_USE_V8
#include "BackendJavaScript/JSScriptContext.h"
#endif
using namespace reflectionzeug;
namespace scriptzeug
{
ScriptContext::ScriptContext(cons... | ```c++
#include <scriptzeug/ScriptContext.h>
#include <scriptzeug/Backend/AbstractScriptContext.h>
#include "BackendDuktape/DuktapeScriptContext.h"
#ifdef LIBZEUG_USE_V8
#include "BackendJavaScript/JSScriptContext.h"
#endif
using namespace reflectionzeug;
namespace scriptzeug
{
ScriptContext::ScriptContext(cons... |
29736d53-27ce-4c35-a6fa-a4b86a8f1420 | {
"language": "C++"
} | ```c++
//
// Copyright (c) 2002-2010 The ANGLE 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.
//
// debug.cpp: Debugging utilities.
#include "common/debug.h"
#include <stdio.h>
#include <stdarg.h>
namespace gl
{
void trac... | ```c++
//
// Copyright (c) 2002-2010 The ANGLE 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.
//
// debug.cpp: Debugging utilities.
#include "common/debug.h"
#include <stdio.h>
#include <stdarg.h>
static bool trace_on = t... |
cf7ff78a-3519-40b4-a371-42441b84b8f9 | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -emit-llvm-only -verify %s
// PR6641
extern "C" int printf(const char *, ...);
struct Foo {
Foo() : iFoo (2) {
printf("%p\n", this);
}
int iFoo;
};
typedef Foo (*T)[3][4];
T bar() {
return new Foo[2][3][4];
}
T bug(int i) {
return new Foo[i][3][4];
}
void pr(T a) {
for (int i ... | ```c++
// RUN: %clang_cc1 %s -triple x86_64-unknown-unknown -emit-llvm -o - | FileCheck %s
// PR6641
extern "C" int printf(const char *, ...);
struct Foo {
Foo() : iFoo (2) {
printf("%p\n", this);
}
int iFoo;
};
typedef Foo (*T)[3][4];
T bar() {
return new Foo[2][3][4];
}
T bug(int i) {
return new Foo[i][... |
0a2f2f8d-25a2-4f34-9c4b-a9827b27febd | {
"language": "C++"
} | ```c++
// Copyright 2015, University of Freiburg,
// Chair of Algorithms and Data Structures.
// Author: Björn Buchhold (buchhold@informatik.uni-freiburg.de)
#include <algorithm>
#include "DocsDB.h"
#include "../global/Constants.h"
// _____________________________________________________________________________
void ... | ```c++
// Copyright 2015, University of Freiburg,
// Chair of Algorithms and Data Structures.
// Author: Björn Buchhold (buchhold@informatik.uni-freiburg.de)
#include <algorithm>
#include "DocsDB.h"
#include "../global/Constants.h"
// _____________________________________________________________________________
void ... |
1ae7cd32-4dc0-4404-9c9a-401cf8e21a2f | {
"language": "C++"
} | ```c++
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "config.h"
#include "webkit/extensions/v8/playback_extension.h"
namespace extensions_v8 {
const char* kPlaybackExtensionName = ... | ```c++
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "config.h"
#include "webkit/extensions/v8/playback_extension.h"
namespace extensions_v8 {
const char* kPlaybackExtensionName = ... |
f1054173-444f-4b93-b5e0-4a5771ae9cb8 | {
"language": "C++"
} | ```c++
#include "gtest/gtest.h"
TEST(TestValues, Length)
{
ASSERT_TRUE(false);
}
```
Test the ability to compare value types. | ```c++
#include "gtest/gtest.h"
TEST(TestValues, Length)
{
ASSERT_TRUE(false);
Meters myFirstLength();
Meters mySecondLength(1.53);
Centimeters myThirdLength(153.0);
// Test equality between mySecondLength and myThirdLength.
}
``` |
ae48417c-ad86-4c49-abca-3f79cedeb022 | {
"language": "C++"
} | ```c++
#include <platform_config.hpp>
#include <hal_config.hpp>
namespace platform {
MPU6000 imu(&SPID1, &mpu6000_spicfg);
DefaultMultirotorVehicleSystem system(&imu, &imu);
void init() {
// Initialize platform HAL
i2cPlatformInit();
pwmPlatformInit();
spiPlatformInit();
usartPlatformInit();
// Initial... | ```c++
#include <platform_config.hpp>
#include <hal_config.hpp>
namespace platform {
MPU6000 imu(&SPID1, &mpu6000_spicfg);
DefaultMultirotorVehicleSystem system(&imu, &imu);
void init() {
// Initialize platform HAL
i2cPlatformInit();
pwmPlatformInit();
spiPlatformInit();
usartPlatformInit();
// Initial... |
78296738-aa66-41bc-81c9-caa1f03eead2 | {
"language": "C++"
} | ```c++
#include <omp.h>
#include "dispar.h"
#include "tournament.h"
template<typename T>
matrix createRandomTournamentPool(T container,
const size_t nbGroup,
const size_t poolSize) {
std::bitset<1> bs(container.size());
matrix pools(nbGroup);... | ```c++
#include <omp.h>
#include "dispar.h"
#include "tournament.h"
template<typename T>
matrix createRandomTournamentPool(T container,
const size_t nbGroup,
const size_t poolSize) {
std::vector<bool> bs(size);
matrix pools(nbGroup);
siz... |
e20dde44-e62c-43ca-94cc-6dbab19a4b1b | {
"language": "C++"
} | ```c++
#include "mediain.hpp"
MediaIn::MediaIn()
{
}
int MediaIn::frameCount(void) const
{
return -1;
}
int MediaIn::frameCounter(void) const
{
return -1;
}
void MediaIn::frameCounter(int frameCount)
{
(void)frameCount;
}
bool MediaIn::getDepthMat(cv::Mat &depthMat)
{
(void)depthMat;
return false;
}
doub... | ```c++
#include "mediain.hpp"
MediaIn::MediaIn()
{
}
int MediaIn::frameCount(void) const
{
return -1;
}
int MediaIn::frameCounter(void) const
{
return -1;
}
void MediaIn::frameCounter(int frameCount)
{
(void)frameCount;
}
bool MediaIn::getDepthMat(cv::Mat &depthMat)
{
depthMat = Mat(); // return empty mat to i... |
00076a6f-627b-433d-91d3-0ca90b310a76 | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-inline-call -analyzer-store region -verify %s
struct A {
int x;
A(int a) { x = a; }
int getx() const { return x; }
};
void f1() {
A x(3);
if (x.getx() == 3) {
int *p = 0;
*p = 3; // expected-warning{{Dereference of null pointer}}... | ```c++
// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-inline-call -analyzer-store region -verify %s
// XFAIL: *
struct A {
int x;
A(int a) { x = a; }
int getx() const { return x; }
};
void f1() {
A x(3);
if (x.getx() == 3) {
int *p = 0;
*p = 3; // expected-warning{{Dereference of nu... |
5d8667b5-dc03-438e-9ef3-8a1647abdc76 | {
"language": "C++"
} | ```c++
/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkNullCanvas.h"
#include "SkCanvas.h"
#include "SKNWayCanvas.h"
SkCanvas* SkCreateNullCanvas() {
// An N-Way canvas forwards calls to N canvas's. When ... | ```c++
/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkNullCanvas.h"
#include "SkCanvas.h"
#include "SKNWayCanvas.h"
SkCanvas* SkCreateNullCanvas() {
// An N-Way canvas forwards calls to N canvas's. When ... |
982335dc-fad5-4979-87da-6d885d4e29fb | {
"language": "C++"
} | ```c++
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2016 Couchbase, Inc
*
* 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
*
* ... | ```c++
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2016 Couchbase, Inc
*
* 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
*
* ... |
9b943266-83fa-432f-b12f-4d00930d3b2a | {
"language": "C++"
} | ```c++
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/extension_apitest.h"
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Storage) {
ASSERT_TRUE(RunExtensionTest("s... | ```c++
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/extension_apitest.h"
#if defined(OS_WIN)
// Always fails on Windows after r110181: http://crbug.com/104419... |
e5cd5dc4-8aad-4107-a2cd-73f1a8706de4 | {
"language": "C++"
} | ```c++
// friend class as template parameter
// originally found in package 'zipios'
// typechecking results:
// errors: 0
// warnings: 0
// error: k0069.cc:15:12: internal error: found dependent type `Friend' in non-template
// ERR-MATCH: internal error: found dependent type `[^(].*?' in non-template
templat... | ```c++
// friend class as template parameter
// originally found in package 'zipios'
// typechecking results:
// errors: 0
// warnings: 0
// error: k0069.cc:15:12: internal error: found dependent type `Friend' in non-template
// ERR-MATCH: internal error: found dependent type `.*?' in non-template
template< c... |
48c875f0-37d8-429e-929d-f7f3c310c895 | {
"language": "C++"
} | ```c++
#include "o2gft.h"
#include "o2google.h"
static const char *GftScope = "https://www.googleapis.com/auth/fusiontables";
static const char *GftEndpoint = "https://accounts.google.com/o/oauth2/auth";
static const char *GftTokenUrl = "https://accounts.google.com/o/oauth2/token";
static const char *GftRefreshUrl = "... | ```c++
#include "o2gft.h"
#include "o2google.h"
static const char *GftScope = "https://www.googleapis.com/auth/fusiontables";
O2Gft::O2Gft(QObject *parent): O2Google(parent) {
setScope(GftScope);
}
``` |
235f1d07-79e0-448d-a100-175ddcaafbe9 | {
"language": "C++"
} | ```c++
/*************************************************
* Mutex Source File *
* (C) 1999-2006 The Botan Project *
*************************************************/
#include <botan/mutex.h>
namespace Botan {
/*************************************************
* Mutex_Hold... | ```c++
/*************************************************
* Mutex Source File *
* (C) 1999-2006 The Botan Project *
*************************************************/
#include <botan/mutex.h>
namespace Botan {
/*************************************************
* Mutex_Hold... |
df9e73dc-639d-4518-bb85-d2d17ece21fd | {
"language": "C++"
} | ```c++
#include "Config.hpp"
#include <fstream>
#ifndef INSTALL_PREFIX
#error CMake has not defined INSTALL_PREFIX!
#endif
Json::Value Config::getQuorumNode()
{
return loadFile(INSTALL_PREFIX + "/lib/tor-onions/quorum.json");
}
Json::Value Config::getMirror()
{
return loadFile(INSTALL_PREFIX + "/lib/tor-oni... | ```c++
#include "Config.hpp"
#include "Log.hpp"
#include <fstream>
#ifndef INSTALL_PREFIX
#error CMake has not defined INSTALL_PREFIX!
#endif
Json::Value Config::getQuorumNode()
{
return loadFile(INSTALL_PREFIX + "/lib/tor-onions/quorum.json");
}
Json::Value Config::getMirror()
{
return loadFile(INSTALL_PRE... |
373a065d-face-4e86-baa1-9f1e2d00820f | {
"language": "C++"
} | ```c++
#include <iostream>
#include <gtest/gtest.h>
#include <GLFW/glfw3.h>
static void error_callback(int error, const char* description)
{
FAIL() << "GLFW Failed (" << error << "): " << description;
}
TEST(GLFWTests, BuildInvisibleWindow)
{
GLFWwindow* window;
glfwSetErrorCallback(error_callback);
if (!glf... | ```c++
#include <iostream>
#include <gtest/gtest.h>
#include <GLFW/glfw3.h>
static void error_callback(int error, const char* description)
{
FAIL() << "GLFW Failed (" << error << "): " << description;
}
TEST(GLFWTests, BuildInvisibleWindow)
{
GLFWwindow* window;
glfwSetErrorCallback(error_callback);
if (!glf... |
4a9a2489-299b-45ee-a259-694c6b296194 | {
"language": "C++"
} | ```c++
#include <sstream>
#include <boost/format.hpp>
#include "Colors.h"
#include "Trace.h"
Trace::Trace()
{
}
Trace::~Trace()
{
}
/* Add an instruction in the trace */
void Trace::addInstruction(Inst *instruction)
{
this->instructions.push_back(instruction);
}
/* Returns the instructions list in the trace... | ```c++
#include <sstream>
#include <boost/format.hpp>
#include "Colors.h"
#include "Trace.h"
Trace::Trace()
{
}
Trace::~Trace()
{
}
/* Add an instruction in the trace */
void Trace::addInstruction(Inst *instruction)
{
this->instructions.push_back(instruction);
}
/* Returns the instructions list in the trace... |
9424c6a2-dcfa-48ec-b5cc-a0a8f3cd2203 | {
"language": "C++"
} | ```c++
#include <exception>
//#if (__GLIBCXX__ / 10000) == 2014
namespace std {
inline bool uncaught_exception() noexcept(true)
{ return current_exception() != nullptr; }
} // namespace std
//#endif
#define CATCH_CONFIG_MAIN
#include <catch.hpp>
```
Remove GCC fix that is not needed | ```c++
#define CATCH_CONFIG_MAIN
#include <catch.hpp>
``` |
1f6e6fb9-a7ab-4e49-87d7-8a434c019169 | {
"language": "C++"
} | ```c++
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/common/profile_management_switches.h"
#include "base/command_line.h"
#include "base/metrics/field_trial.h"
#include "chrome/commo... | ```c++
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/common/profile_management_switches.h"
#include "base/command_line.h"
#include "base/metrics/field_trial.h"
#include "chrome/commo... |
337406f4-d382-4699-bfe2-a59ce400408a | {
"language": "C++"
} | ```c++
// This code is based on Sabberstone project.
// Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva
// RosettaStone is hearthstone simulator using C++ with reinforcement learning.
// Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon
#include <Rosetta/Actions/Generic.hpp>
#include <Rosett... | ```c++
// This code is based on Sabberstone project.
// Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva
// RosettaStone is hearthstone simulator using C++ with reinforcement learning.
// Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon
#include <Rosetta/Actions/Generic.hpp>
#include <Rosett... |
ee0673be-13b5-459e-ac7b-5f6a8e9aae7f | {
"language": "C++"
} | ```c++
// RUN: %clangxx -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
// REQUIRES: stable-runtime
// XFAIL: ubsan
// FIXME(dliew): Make this test work on Darwin with LSan
// XFAIL: darwin && lsan
#include <sanitizer/common_interface_defs.h>
#include <stdio.h>
volatile char *zero = 0;
void Death() {
fprintf(std... | ```c++
// RUN: %clangxx -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
// REQUIRES: stable-runtime
// XFAIL: ubsan
// FIXME: On Darwin, LSAn detects the leak, but does not invoke the death_callback.
// XFAIL: darwin && lsan
#include <sanitizer/common_interface_defs.h>
#include <stdio.h>
volatile char *zero = 0;
v... |
2eb96259-bbec-4638-a75f-d6be3169d178 | {
"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... |
2f5307c3-7de0-4330-8345-f546b19bb261 | {
"language": "C++"
} | ```c++
//
// Copyright 2020 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... | ```c++
//
// Copyright 2020 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
0660c60b-aecc-44b7-b911-6093d123309d | {
"language": "C++"
} | ```c++
#include <systemlib/mixer/mixer.h>
#include <systemlib/err.h>
#include "../../src/systemcmds/tests/tests.h"
int main(int argc, char *argv[]) {
warnx("Host execution started");
char* args[] = {argv[0], "../../ROMFS/px4fmu_common/mixers/IO_pass.mix",
"../../ROMFS/px4fmu_common/mixers/FMU_quad_w.mix"};
t... | ```c++
#include <systemlib/mixer/mixer.h>
#include <systemlib/err.h>
#include "../../src/systemcmds/tests/tests.h"
int main(int argc, char *argv[]) {
int ret;
warnx("Host execution started");
char* args[] = {argv[0], "../ROMFS/px4fmu_common/mixers/IO_pass.mix",
"../ROMFS/px4fmu_common/mixers/FMU_quad_w.mix"... |
7cfc0fd9-6c0c-4a30-8551-02f276976f2d | {
"language": "C++"
} | ```c++
// local
#include "Object.hpp"
#include "core/utils/exceptions.h"
using namespace corryvreckan;
Object::Object() : m_detectorID(), m_timestamp(0) {}
Object::Object(std::string detectorID) : m_detectorID(detectorID), m_timestamp(0) {}
Object::Object(double timestamp) : m_detectorID(), m_timestamp(timestamp) {}... | ```c++
// local
#include "Object.hpp"
#include "core/utils/exceptions.h"
using namespace corryvreckan;
Object::Object() : m_detectorID(), m_timestamp(0) {}
Object::Object(std::string detectorID) : m_detectorID(detectorID), m_timestamp(0) {}
Object::Object(double timestamp) : m_detectorID(), m_timestamp(timestamp) {}... |
3aa3af52-59a8-4fbf-83ad-ed192db301f5 | {
"language": "C++"
} | ```c++
#include "window_configuration.h"
const char *kFlutterWindowTitle = "taqo_client";
const unsigned int kFlutterWindowWidth = 1280;
const unsigned int kFlutterWindowHeight = 720;
```
Fix window title and initial size | ```c++
#include "window_configuration.h"
const char *kFlutterWindowTitle = "Taqo";
const unsigned int kFlutterWindowWidth = 1024;
const unsigned int kFlutterWindowHeight = 768;
``` |
dede44ea-8112-4ab4-9c35-96ab35eed752 | {
"language": "C++"
} | ```c++
/**
* \file PancakeTest.cpp
*
* Some simple tests to make sure the pancake domain works properly.
*
* \author eaburns
* \date 18-01-2010
*/
#include "pancake/PancakeTypes.hpp"
#include "pancake/PancakeState.hpp"
#include <stdlib.h>
int main(void)
{
boost::array<Pancake, 14> cakes;
for (unsigned int ... | ```c++
/**
* \file PancakeTest.cpp
*
* Some simple tests to make sure the pancake domain works properly.
*
* \author eaburns
* \date 18-01-2010
*/
#include "pancake/PancakeTypes.hpp"
#include "pancake/PancakeState.hpp"
#include <stdlib.h>
int main(void)
{
boost::array<Pancake, 14> cakes;
for (unsigned int ... |
195e8831-1dda-440e-909c-87694a548dd4 | {
"language": "C++"
} | ```c++
/*
Copyright 2008 Brain Research Institute, Melbourne, Australia
Written by Robert E. Smith, 04/08/14.
This file is part of MRtrix.
MRtrix is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foun... | ```c++
/*
Copyright 2008 Brain Research Institute, Melbourne, Australia
Written by Robert E. Smith, 04/08/14.
This file is part of MRtrix.
MRtrix is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foun... |
191e5b54-ae14-4d28-93af-a6e7dc07aab4 | {
"language": "C++"
} | ```c++
#include "stdafx.h"
using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
//
// General Information about an assembly is controlled through the following
// ... | ```c++
#include "stdafx.h"
using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
//
// General Information about an assembly is controlled through the following
// ... |
3ba105e2-9a9d-4b59-8c2a-5a5743fef5aa | {
"language": "C++"
} | ```c++
#include <unistd.h>
#include <event/event_callback.h>
#include <event/event_main.h>
#include <io/stream_handle.h>
class Sink {
LogHandle log_;
StreamHandle fd_;
Action *action_;
public:
Sink(int fd)
: log_("/sink"),
fd_(fd),
action_(NULL)
{
EventCallback *cb = callback(this, &Sink::read_complet... | ```c++
#include <unistd.h>
#include <event/callback_handler.h>
#include <event/event_callback.h>
#include <event/event_handler.h>
#include <event/event_main.h>
#include <io/stream_handle.h>
class Sink {
LogHandle log_;
StreamHandle fd_;
CallbackHandler close_handler_;
EventHandler read_handler_;
public:
Sink(i... |
79d8bb6c-cf69-431c-bdb1-a38e77c941a9 | {
"language": "C++"
} | ```c++
#include <iostream>
int main() {
std::cout << "Hello, compiler!\n\n";
std::cout <<
#if defined(__clang__)
"Clang " << __clang_version__ <<
#elif defined(__ICC) || defined(__INTEL_COMPILER)
"Intel " << __INTEL_COMPILER <<
#elif defined(__GNUC__) || defined(__GNUG__)
"GCC " << __VERSION__ <<
#elif ... | ```c++
#include <iostream>
//toggle to check for boost version
#define CHECK_BOOST_VERSION 0
#if CHECK_BOOST_VERSION
#include <boost/version.hpp>
#endif
int main() {
std::cout << "Hello, compiler!\n\n";
std::cout <<
#if defined(__clang__)
"Clang " << __clang_version__ <<
#elif defined(__ICC) || defined(__IN... |
f3b67aa7-bc3f-4e3b-a76f-52b2b8abc8db | {
"language": "C++"
} | ```c++
// RUN: c-index-test -test-load-source all -triple x86_64-apple-darwin10 -fasm-blocks -Wno-microsoft %s 2>&1 | FileCheck %s
// Test that we diagnose when the application hasn't initialized LLVM targets
// supporting the MS-style inline asm parser.
void Break() {
__asm { int 3 }
}
// CHECK: error: MS-style in... | ```c++
// REQUIRES: x86-registered-target
// RUN: c-index-test -test-load-source all -fasm-blocks -Wno-microsoft %s 2>&1 | FileCheck %s
// Test that we diagnose when the application hasn't initialized LLVM targets
// supporting the MS-style inline asm parser.
void Break() {
__asm { int 3 }
}
// CHECK: error: MS-sty... |
c11fba89-c372-41d9-b2ca-4ca3b0706d0c | {
"language": "C++"
} | ```c++
#include "gen.h"
#include "interface.h"
#include <iostream>
int main(int argc, char *argv[])
{
Generate Gen;
std::string Args;
int i;
for (i = 1; i < argc; i++) {
if (argv[i] != NULL)
Args = argv[1];
if (argv[i] == NULL) {
}
if ((Args == "-new") || (Args == "--new") || (Args == "-n")) {
Gen.G... | ```c++
#include <iostream>
#include "gen.h"
#include "interface.h"
int main(int argc, char *argv[])
{
Generate Gen;
std::string Args;
int i;
for (i = 1; i < argc; i++) {
if (argv[i] != NULL)
Args = argv[1];
if (argv[i] == NULL) {
}
if ((Args == "-new") || (Args == "--new") || (Args == "-n")) {
Gen.G... |
60c5f771-9f5f-4729-a904-f20556baee40 | {
"language": "C++"
} | ```c++
#include "playerHUD.hpp"
#include "player.hpp"
#include <sstream>
#include <SFML/Graphics/RenderWindow.hpp>
namespace aw
{
PlayerHUD::PlayerHUD()
{
m_font.loadFromFile("data/fonts/visitor1.ttf");
m_displaySpeed.setFont(m_font);
m_displaySpeed.setColor(sf::Color::White);
m_displaySpeed.setCharacterS... | ```c++
#include "playerHUD.hpp"
#include "player.hpp"
#include <sstream>
#include <SFML/Graphics/RenderWindow.hpp>
namespace aw
{
PlayerHUD::PlayerHUD()
{
m_font.loadFromFile("data/fonts/visitor1.ttf");
m_displaySpeed.setFont(m_font);
m_displaySpeed.setColor(sf::Color::White);
m_displaySpeed.setCharacterS... |
934bc692-f959-44d5-bb69-874c30f62fef | {
"language": "C++"
} | ```c++
// Copyright 2014 Toggl Desktop developers.
#include "./client.h"
#include <sstream>
namespace kopsik {
std::string Client::String() {
std::stringstream ss;
ss << "ID=" << id_
<< " local_id=" << local_id_
<< " name=" << name_
<< " wid=" << wid_
<< " guid=" << guid_;
return ss.str();
}
void Cl... | ```c++
// Copyright 2014 Toggl Desktop developers.
#include "./client.h"
#include <sstream>
#include <cstring>
namespace kopsik {
std::string Client::String() {
std::stringstream ss;
ss << "ID=" << id_
<< " local_id=" << local_id_
<< " name=" << name_
<< " wid=" << wid_
<< " guid=" << guid_;
return s... |
e8c36907-0227-49bd-8c1c-821dd21e35ff | {
"language": "C++"
} | ```c++
//
// simple_item.cc
// GameEngine
//
// Created by Jon Sharkey on 2010-04-30.
// Copyright 2010 Sharkable. All rights reserved.
//
#include "gameengine/entities/simple_item.h"
#include "gameengine/resource_loader.h"
using std::vector;
SimpleItem::SimpleItem()
: Animatable(),
sprite_(0) {
}
Si... | ```c++
//
// simple_item.cc
// GameEngine
//
// Created by Jon Sharkey on 2010-04-30.
// Copyright 2010 Sharkable. All rights reserved.
//
#include "gameengine/entities/simple_item.h"
#include "gameengine/resource_loader.h"
using std::vector;
SimpleItem::SimpleItem()
: Animatable(),
sprite_(0) {
}
Si... |
9ebb17a3-e4a6-46f3-a082-e3c452abdd9b | {
"language": "C++"
} | ```c++
// C++11 passing exceptions around using std::exception_ptr
#include <exception>
#include <thread>
#include <iostream>
#include <cassert>
std::exception_ptr g_stashed_exception_ptr;
auto bad_task() -> void
{
try
{
std::thread().detach(); // Oops !!
}
catch ( ... )
{
g_stashed_exception_ptr =... | ```c++
// C++11 passing exceptions around using std::exception_ptr
#include <exception>
#include <thread>
#include <iostream>
#include <cassert>
std::exception_ptr g_stashed_exception_ptr;
void bad_task()
{
try
{
std::thread().detach(); // Oops !!
}
catch ( ... )
{
g_stashed_exception_ptr = std::cu... |
bf7533ad-68d3-436b-9685-8ade97cee1ee | {
"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_function.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
void Extension... | ```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_function.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
void Extension... |
4cab3d87-c607-4ac7-bb93-e9506b828404 | {
"language": "C++"
} | ```c++
#include <cpp/tasks.hh>
namespace cpp
{
void cpp_generator()
{
assert(ast::program_ast && "No ast to transform to cpp");
std::cout << "#include <repy/repy.hh>" << std::endl;
CodeGenerator cgen(std::cout);
cgen.visit(ast::program_ast);
cgen.generate_main();
... | ```c++
#include <cpp/tasks.hh>
namespace cpp
{
void cpp_generator()
{
assert(ast::program_ast && "No ast to transform to cpp");
CodeGenerator cgen(std::cout);
cgen.visit(ast::program_ast);
cgen.generate_main();
}
void header_generator()
{
assert(ast::progr... |
a269d8c9-4149-454c-aadb-49741affc215 | {
"language": "C++"
} | ```c++
//===-- MCAsmInfoCOFF.cpp - COFF asm properties -----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... | ```c++
//===-- MCAsmInfoCOFF.cpp - COFF asm properties -----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... |
5150e041-a9bd-4ad1-9c9d-2ebc2f49ba14 | {
"language": "C++"
} | ```c++
#include <iostream>
#include <vector>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
// printes the hex (in ascii) of an ascii message
int main(int argc, char* argv[])
{
if(argc < 2) {
cerr << "Usage: " <... | ```c++
#include <iostream>
#include <vector>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
// printes the hex (in ascii) of an ascii message
int main(int argc, char* argv[])
{
if(argc < 1 || (argc>=2 && strcmp(argv[1],... |
178eaebf-98b0-4a07-a760-57d91b63186a | {
"language": "C++"
} | ```c++
#include "audioutil.h"
#include <QFileInfo>
namespace AudioUtil {
QStringList audioExtensions = { "wav", "aif", "ogg", "flac", "iff", "svx" };
bool isAudioFileName(QString file)
{
return audioExtensions.contains(QFileInfo(file).suffix().toLower());
}
QString audioFileFilter()
{
QString f = "Audio Fil... | ```c++
#include "audioutil.h"
#include <QFileInfo>
namespace AudioUtil {
QStringList audioExtensions = { "wav", "caf", "aif", "ogg", "flac", "iff", "svx" };
bool isAudioFileName(QString file)
{
return audioExtensions.contains(QFileInfo(file).suffix().toLower());
}
QString audioFileFilter()
{
QString f = "Au... |
e9eb3b6a-f68a-4d07-93ae-b0cbcec72783 | {
"language": "C++"
} | ```c++
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: echo '[{"directory":".","command":"clang++ '$(llvm-config --cppflags all)' -c %s","file":"%s"}]' > %t/compile_commands.json
// RUN: remove-cstr-calls %t %s | FileCheck %s
#include <string>
namespace llvm { struct StringRef { StringRef(const char *p); }; }
void f1(con... | ```c++
// RUN: rm -rf %t
// RUN: mkdir %t
// RUN: echo '[{"directory":".","command":"clang++ '$(llvm-config --cppflags all)' -c %s","file":"%s"}]' > %t/compile_commands.json
// RUN: remove-cstr-calls %t %s | FileCheck %s
// XFAIL: *
#include <string>
namespace llvm { struct StringRef { StringRef(const char *p); }; }
... |
23e2bdec-2f71-46d5-9209-49acb49fca25 | {
"language": "C++"
} | ```c++
#include "tests-base.hpp"
#include "utf8rewind.h"
int main(int argc, char** argv)
{
const char* input = "Hello World!";
static const size_t output_size = 256;
char output[output_size];
wchar_t output_wide[output_size];
const char* input_seek;
size_t converted_size;
int32_t errors;
mems... | ```c++
#include "tests-base.hpp"
int main(int argc, char** argv)
{
::testing::InitGoogleTest(&argc, argv);
int result = RUN_ALL_TESTS();
if (result != 0)
{
std::cout << "Press any key to continue.";
int wait = 0;
std::cin >> wait;
}
return result;
}``` |
d827a23c-8da6-475f-9af5-db7c3cf989bf | {
"language": "C++"
} | ```c++
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/histogram.h"
#include "net/base/net_test_suite.h"
#if defined(OS_WIN)
#include "net/socket/ssl_client_socket_nss_factory.h"
#end... | ```c++
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "build/build_config.h"
#include "base/histogram.h"
#include "net/base/net_test_suite.h"
#if defined(OS_WIN)
#include "net/socket/ssl_c... |
7d43e8ce-f41c-4396-af22-535a9916e569 | {
"language": "C++"
} | ```c++
#include "texture.h"
spectrum SolidColor::at_point(const IntersectionView& isect) const
{
return color;
}
spectrum SolidColor::at_coord(const Vec2& uv) const
{
return color;
}
Checkerboard2D::Checkerboard2D(spectrum a, spectrum b, int gsx, int gsy)
: c1(a), c2(b), grid_size_x(gsx), grid_size_y(gsy > 0 ?... | ```c++
#include "texture.h"
spectrum SolidColor::at_point(const IntersectionView& isect) const
{
return color;
}
spectrum SolidColor::at_coord(const Vec2& uv) const
{
return color;
}
Checkerboard2D::Checkerboard2D(spectrum a, spectrum b, int gsx, int gsy)
: c1(a), c2(b), grid_size_x(gsx), grid_size_y(gsy > 0 ?... |
619d4315-e98c-4c75-8f85-9bfb382ebdf3 | {
"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.
//
//===---------------------------------... |
708ab67e-4c43-43e4-92a0-e8eb2639f8bf | {
"language": "C++"
} | ```c++
// RUN: %clangxx_asan %s -o %t && %run %t | FileCheck %s
#include <stdio.h>
static void foo() {
printf("foo\n");
}
int main() {
return 0;
}
__attribute__((section(".preinit_array")))
void (*call_foo)(void) = &foo;
__attribute__((section(".init_array")))
void (*call_foo_2)(void) = &foo;
__attribute__((s... | ```c++
// RUN: %clangxx_asan %s -o %t && %run %t | FileCheck %s
#include <stdio.h>
int c = 0;
static void foo() {
++c;
}
static void fini() {
printf("fini\n");
}
int main() {
printf("c=%d\n", c);
return 0;
}
__attribute__((section(".preinit_array")))
void (*call_foo)(void) = &foo;
__attribute__((section(... |
f5ef5cb6-a61c-4f22-bf3a-d6b4c2c573c4 | {
"language": "C++"
} | ```c++
#include "QGVGraphPrivate.h"
QGVGraphPrivate::QGVGraphPrivate(Agraph_t *graph)
{
setGraph(graph);
}
void QGVGraphPrivate::setGraph(Agraph_t *graph)
{
_graph = graph;
}
Agraph_t* QGVGraphPrivate::graph() const
{
return _graph;
}
```
Call agclose when clearing the graph | ```c++
#include "QGVGraphPrivate.h"
QGVGraphPrivate::QGVGraphPrivate(Agraph_t *graph)
: _graph (NULL)
{
setGraph(graph);
}
void QGVGraphPrivate::setGraph(Agraph_t *graph)
{
if (_graph != NULL)
agclose(_graph);
_graph = graph;
}
Agraph_t* QGVGraphPrivate::graph() const
{
return _graph;
}
``` |
ea9d139e-377d-4c8e-9ad0-0ffad702a895 | {
"language": "C++"
} | ```c++
/*
* Copyright (C) 2008, 2009 Nokia Corporation.
*
* Contact: Marius Vollmer <marius.vollmer@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* T... | ```c++
/*
* Copyright (C) 2008, 2009 Nokia Corporation.
*
* Contact: Marius Vollmer <marius.vollmer@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* T... |
5a3a1d58-9d24-441b-af4f-4d938e08e20c | {
"language": "C++"
} | ```c++
#include "stdafx.h"
#include "internal/internal_datastore.h"
#include "internal/constants.h"
#include "datastore.h"
namespace You {
namespace DataStore {
DataStore& DataStore::get() {
static DataStore ds;
return ds;
}
Transaction DataStore::begin() {
return Internal::DataStore::get().begin();
}
void DataS... | ```c++
#include "stdafx.h"
#include "internal/internal_datastore.h"
#include "internal/constants.h"
#include "datastore.h"
namespace You {
namespace DataStore {
DataStore& DataStore::get() {
static DataStore ds;
return ds;
}
Transaction DataStore::begin() {
return Internal::DataStore::get().begin();
}
void DataS... |
7edea067-f0cb-4fb4-879a-9b62884db542 | {
"language": "C++"
} | ```c++
#include "perf_precomp.hpp"
using namespace std;
using namespace cv;
using namespace perf;
using namespace testing;
using std::tr1::make_tuple;
using std::tr1::get;
CV_ENUM(Mat_Type, CV_8UC1, CV_8UC3, CV_32FC1, CV_32FC3)
typedef TestBaseWithParam< tr1::tuple<Size, int, Mat_Type> > TestBilateralFilter;
PERF_T... | ```c++
#include "perf_precomp.hpp"
using namespace std;
using namespace cv;
using namespace perf;
using namespace testing;
using std::tr1::make_tuple;
using std::tr1::get;
CV_ENUM(Mat_Type, CV_8UC1, CV_8UC3, CV_32FC1, CV_32FC3)
typedef TestBaseWithParam< tr1::tuple<Size, int, Mat_Type> > TestBilateralFilter;
PERF_T... |
cceb8b92-473d-4eda-8552-b329d49e677c | {
"language": "C++"
} | ```c++
#include <ncurses.h>
#include "lightsout.hpp"
namespace roadagain
{
lightsout::lightsout(int width, int height) : width(width), height(height)
{
lights = new bool*[height + 2]();
for (int i = 0; i < height + 2; i++){
lights[i] = new bool[width + 2]();
}
}
lightsout::~lightsout()
{
;
}... | ```c++
#include <ncurses.h>
#include "lightsout.hpp"
namespace roadagain
{
board::board(int width, int height) : width(width), height(height)
{
lights = new bool*[height + 2]();
for (int i = 0; i < height + 2; i++){
lights[i] = new bool[width + 2]();
}
}
board::~board()
{
;
}
}
``` |
6d4a9922-fa79-479b-9aa5-de751435335b | {
"language": "C++"
} | ```c++
#include <common/buffer.h>
#include <event/action.h>
#include <event/callback.h>
#include <event/event_system.h>
#include <io/pipe.h>
#include <xcodec/xcodec.h>
#include <xcodec/xcodec_encoder.h>
#include <xcodec/xcodec_encoder_pipe.h>
XCodecEncoderPipe::XCodecEncoderPipe(XCodec *codec)
: PipeSimple("/xcodec... | ```c++
#include <common/buffer.h>
#include <event/action.h>
#include <event/callback.h>
#include <event/event_system.h>
#include <io/pipe.h>
#include <xcodec/xcodec.h>
#include <xcodec/xcodec_encoder.h>
#include <xcodec/xcodec_encoder_pipe.h>
XCodecEncoderPipe::XCodecEncoderPipe(XCodec *codec)
: PipeSimple("/xcodec... |
ba35a87b-098e-4d33-a928-91edaa7efda7 | {
"language": "C++"
} | ```c++
#include "ofp/unittest.h"
#include "ofp/hello.h"
using namespace ofp;
TEST(hello, HelloBuilder1) {
HelloBuilder msg{ProtocolVersions{1, 2, 3, 4}};
MemoryChannel channel{99};
msg.send(&channel);
EXPECT_EQ(0x10, channel.size());
EXPECT_HEX("0400-0010-00000001 00010008-0000001E", channel.data(),
... | ```c++
#include "ofp/unittest.h"
#include "ofp/hello.h"
using namespace ofp;
TEST(hello, HelloBuilder1) {
HelloBuilder msg{ProtocolVersions{1, 2, 3, 4}};
MemoryChannel channel{99};
msg.send(&channel);
EXPECT_EQ(0x10, channel.size());
EXPECT_HEX("0400-0010-00000001 00010008-0000001E", channel.data(),
... |
f7ef7e99-81fa-4503-afd2-e5c573e9c387 | {
"language": "C++"
} | ```c++
#include <map>
#include <ncurses.h>
#include <string>
#include "file_contents.hh"
#include "mode.hh"
#include "show_message.hh"
#include "prefix.hh"
prefix::prefix(std::string message)
: message(message) { }
void prefix::push_back(char ch, std::function<void(contents&, boost::optional<int>)> fun) {
th... | ```c++
#include <map>
#include <ncurses.h>
#include <string>
#include "file_contents.hh"
#include "mode.hh"
#include "show_message.hh"
#include "prefix.hh"
prefix::prefix(std::string message)
: message(message) { }
void prefix::push_back(char ch, std::function<void(contents&, boost::optional<int>)> fun) {
th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.