doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
92c470fd-c1cc-4277-9c4c-c66dc3798547 | {
"language": "C++"
} | ```c++
#include "aboutwindow.h"
#include "ui_aboutwindow.h"
aboutWindow::aboutWindow(QString version, QWidget *parent) : QDialog(parent), ui(new Ui::aboutWindow)
{
ui->setupUi(this);
ui->labelCurrent->setText(version);
m_version = version.replace(".", "").toInt();
QNetworkAccessManager *m = new ... | ```c++
#include "aboutwindow.h"
#include "ui_aboutwindow.h"
aboutWindow::aboutWindow(QString version, QWidget *parent) : QDialog(parent), ui(new Ui::aboutWindow)
{
ui->setupUi(this);
ui->labelCurrent->setText(version);
m_version = version.replace(".", "").toInt();
QNetworkAccessManager *m = new ... |
736564e4-c119-4441-97b0-db882f411bbe | {
"language": "C++"
} | ```c++
#include "enfa.h"
#include <string>
namespace tinygrep {
namespace enfa {
std::string EpsilonNFA::to_graph() const {
return "";
}
} // namespace enfa
} // namespace tinygrep
```
Complete function for parsing epsilon-NFA -> .gv file. | ```c++
#include "enfa.h"
#include <string>
#include <sstream>
namespace tinygrep {
namespace enfa {
// The default scale of a generated graph.
const unsigned int DEFAULT_PNG_SIZE = 10;
const std::string LABEL_BEGIN = " [label=\"",
LABEL_END = "\"]",
EDGE_ARROW = " -> ",
... |
144a42ab-390d-40a5-86d4-4feb9fec71b8 | {
"language": "C++"
} | ```c++
#include <gtest/gtest.h>
#include <rapidxml_utils.hpp>
#include "llvm/compiler.hpp"
#include "parser/xmlParser.hpp"
class LLVMCompilerTest: public ::testing::Test {
protected:
XMLParser xpx = XMLParser();
inline rapidxml::file<> xmlFile(std::string path) {
#define Q(x) #x
#define QUOTE(x) Q(x)
... | ```c++
#include <gtest/gtest.h>
#include <rapidxml_utils.hpp>
#include "llvm/compiler.hpp"
#include "parser/xmlParser.hpp"
class LLVMCompilerTest: public ::testing::Test {
protected:
XMLParser xpx = XMLParser();
inline rapidxml::file<> xmlFile(std::string path) {
path = DATA_PARENT_DIR + ("/" + path);
... |
2f21f58a-194e-4389-bad3-83531c8e0c57 | {
"language": "C++"
} | ```c++
#include "Timer.hpp"
using namespace HomieInternals;
Timer::Timer()
: _initialTime(0)
, _interval(0)
, _tickAtBeginning(false) {
}
void Timer::setInterval(uint32_t interval, bool tickAtBeginning) {
_interval = interval;
_tickAtBeginning = tickAtBeginning;
this->reset();
}
bool Timer::check() const {
... | ```c++
#include "Timer.hpp"
using namespace HomieInternals;
Timer::Timer()
: _initialTime(0)
, _interval(0)
, _tickAtBeginning(false) {
}
void Timer::setInterval(uint32_t interval, bool tickAtBeginning) {
_interval = interval;
_tickAtBeginning = tickAtBeginning;
this->reset();
}
bool Timer::check() const {
... |
6996ab67-1fcc-46b2-804f-1d6a43e1d597 | {
"language": "C++"
} | ```c++
// Copyright (c) 2007-2009 Paul Hodge. All rights reserved.
#include "circa.h"
namespace circa {
namespace range_function {
void evaluate(Term* caller)
{
unsigned int max = as_int(caller->input(0));
Branch& branch = as_branch(caller);
resize_list(branch, max, INT_TYPE... | ```c++
// Copyright (c) 2007-2009 Paul Hodge. All rights reserved.
#include "circa.h"
namespace circa {
namespace range_function {
void evaluate(Term* caller)
{
int max = as_int(caller->input(0));
Branch& branch = as_branch(caller);
resize_list(branch, max, INT_TYPE);
... |
3bb6578d-b501-4cbf-85a3-fd4d1ecdf2c3 | {
"language": "C++"
} | ```c++
#include "box2dbaseitem.h"
#include <Box2D/Box2D.h>
float Box2DBaseItem::m_scaleRatio = 32.0f;
Box2DBaseItem::Box2DBaseItem(GameScene *parent )
: GameItem(parent)
, m_initialized(false)
, m_synchronizing(false)
, m_synchronize(true)
{
}
bool Box2DBaseItem::initialized() const
{
return m_i... | ```c++
#include "box2dbaseitem.h"
#include "util.h"
#include <Box2D/Box2D.h>
float Box2DBaseItem::m_scaleRatio = 32.0f;
Box2DBaseItem::Box2DBaseItem(GameScene *parent )
: GameItem(parent)
, m_initialized(false)
, m_synchronizing(false)
, m_synchronize(true)
{
}
bool Box2DBaseItem::initialized() con... |
f798dc9e-fa50-4f88-9805-1ff5edc3034a | {
"language": "C++"
} | ```c++
#include "MediaSessionManager.h"
using namespace ::com::kurento::kms;
using namespace ::com::kurento::kms::api;
void task() {
}
MediaSessionManager::MediaSessionManager() {
}
MediaSessionManager::~MediaSessionManager() {
}
MediaSessionManager *MediaSessionManager::getInstance() {
static shared_ptr<MediaSes... | ```c++
#include "MediaSessionManager.h"
using namespace ::com::kurento::kms;
using namespace ::com::kurento::kms::api;
void task() {
}
MediaSessionManager::MediaSessionManager() {
}
MediaSessionManager::~MediaSessionManager() {
}
MediaSessionManager *MediaSessionManager::getInstance() {
static MediaSessionManager... |
935d1a92-5f34-4848-8aa9-be22cbf07596 | {
"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 "ppapi/tests/test_case.h"
#include <sstream>
std::string TestCase::MakeFailureMessage(const char* file,
... | ```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 "ppapi/tests/test_case.h"
#include <sstream>
std::string TestCase::MakeFailureMessage(const char* file,
... |
afb62feb-223f-41c0-aa26-2f83fe31df92 | {
"language": "C++"
} | ```c++
/*
* Copyright 2015 - 2016 gtalent2@gmail.com
*
* 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 "strops.hpp"
int ox_strcmp(const char *str1, c... | ```c++
/*
* Copyright 2015 - 2016 gtalent2@gmail.com
*
* 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 "strops.hpp"
int ox_strcmp(const char *str1, c... |
af4d0ed8-a540-4c9c-8acf-1e2b1ce9b520 | {
"language": "C++"
} | ```c++
/* Copyright © 2001-2018, Canal TP and/or its affiliates. All rights reserved.
This file is part of Navitia,
the software to build cool stuff with public transport.
Hope you'll enjoy and contribute to this project,
powered by Canal TP (www.canaltp.fr).
Help us simplify mobility and open public transpor... | ```c++
/* Copyright © 2001-2018, Canal TP and/or its affiliates. All rights reserved.
This file is part of Navitia,
the software to build cool stuff with public transport.
Hope you'll enjoy and contribute to this project,
powered by Canal TP (www.canaltp.fr).
Help us simplify mobility and open public transpor... |
7a3ebda2-bf24-42a1-bd53-0839a4b39a89 | {
"language": "C++"
} | ```c++
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <stdlib.h>
#include <QtGlobal>
int main(int argc, char *argv[])
{
//TODO: Run this on Qt versions which support it...
//QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(arg... | ```c++
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <stdlib.h>
#include <QtGlobal>
int main(int argc, char *argv[])
{
//TODO: Run this on Qt versions which support it...
//QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(arg... |
a2b986a8-6829-4d4a-8f74-2ba24b2b57ae | {
"language": "C++"
} | ```c++
#include "zg01_fsm.h"
// max time between ZG01 bits, until a new frame is assumed to have started
#define ZG01_MAX_MS 3
// all of the state of the FSM
typedef struct {
uint8_t *buffer;
int num_bits;
unsigned long prev_ms;
} fsm_t;
static fsm_t fsm;
static fsm_t *s = &fsm;
// resets the FSM
stati... | ```c++
#include "zg01_fsm.h"
// max time between ZG01 bits, until a new frame is assumed to have started
#define ZG01_MAX_MS 2
// all of the state of the FSM
typedef struct {
uint8_t *buffer;
int num_bits;
unsigned long prev_ms;
} fsm_t;
static fsm_t fsm;
static fsm_t *s = &fsm;
// resets the FSM
stati... |
46a554ac-22d6-4b8d-a2b3-80ad4ef16ab5 | {
"language": "C++"
} | ```c++
#include "locale.hpp"
#include <cstring>
#include <clocale>
#include <algorithm>
#undef min
#undef max
namespace locale {
std::vector<std::pair<std::string_view, std::string_view>> ListLocales() {
std::vector<std::pair<std::string_view, std::string_view>> ret;
ret.reserve(std::size_t(ELocale::MAXLocale));... | ```c++
#include "locale.hpp"
#include <cstring>
#include <clocale>
#include <algorithm>
#undef min
#undef max
namespace locale {
std::vector<std::pair<std::string_view, std::string_view>> ListLocales() {
std::vector<std::pair<std::string_view, std::string_view>> ret;
ret.reserve(std::size_t(ELocale::MAXLocale));... |
d55d9ff7-ed3d-4aca-ad54-6c1d43c7b6e1 | {
"language": "C++"
} | ```c++
#include "AssetLoader.h"
namespace fse
{
AssetLoader::AssetLoader() {
}
AssetLoader::~AssetLoader()
{
}
sf::Texture& AssetLoader::getTexture(std::string path)
{
if (textureMap.count(path)) //Texture is already loaded
{
textureCounter[path]++;
}
else
{
loadTexture(path);
}
return t... | ```c++
#include "AssetLoader.h"
namespace fse
{
AssetLoader::AssetLoader() {
}
AssetLoader::~AssetLoader()
{
}
sf::Texture& AssetLoader::getTexture(std::string path)
{
if (textureMap.count(path)) //Texture is already loaded
{
textureCounter[path]++;
}
else
{
loadTexture(path);
}
return t... |
24dcd304-6828-4e07-b4b5-cb28579911c0 | {
"language": "C++"
} | ```c++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/test/test_suite.h"
#include "media/base/media.h"
class TestSuiteNoAtExit : public base::TestSuite {
public:
TestSuiteNoAtExi... | ```c++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/test/main_hook.h"
#include "base/test/test_suite.h"
#include "media/base/media.h"
class TestSuiteNoAtExit : public base::TestSu... |
dfc2e048-3025-4558-b677-bda480eb9bae | {
"language": "C++"
} | ```c++
// RUN: %clangxx_asan %s -o %t
// RUN: %t 2>&1 | FileCheck %s
#include <sanitizer/common_interface_defs.h>
#include <stdio.h>
char *sink[1000];
int main() {
int idx = 0;
for (int i = 0; i < 17; i++)
sink[idx++] = new char[131];
for (int i = 0; i < 42; i++)
sink[idx++] = new char[24];
__saniti... | ```c++
// Printing memory profiling only works in the configuration where we can
// detect leaks.
// REQUIRES: leak-detection
//
// RUN: %clangxx_asan %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s
#include <sanitizer/common_interface_defs.h>
#include <stdio.h>
char *sink[1000];
int main() {
int idx = 0;
for (int ... |
902178d8-4a42-4be1-a7a3-c176372893de | {
"language": "C++"
} | ```c++
// RUN: %llvmgxx %s -S -emit-llvm -O2 -o - | ignore grep _Unwind_Resume | \
// RUN: wc -l | grep {\[02\]}
struct One { };
struct Two { };
void handle_unexpected () {
try
{
throw;
}
catch (One &)
{
throw Two ();
}
}
```
Fix this test for gcc-4.2. | ```c++
// RUN: %llvmgxx %s -S -emit-llvm -O2 -o - | ignore grep _Unwind_Resume | \
// RUN: wc -l | grep {\[23\]}
struct One { };
struct Two { };
void handle_unexpected () {
try
{
throw;
}
catch (One &)
{
throw Two ();
}
}
``` |
7815d798-b95f-4bc6-a992-df258868f51c | {
"language": "C++"
} | ```c++
/*
* The MIT License (MIT)
*
* Copyright (c) 2017 Nathan Osman
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights ... | ```c++
/*
* The MIT License (MIT)
*
* Copyright (c) 2017 Nathan Osman
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights ... |
9e33ffb3-6595-462d-b531-a0e5be25e55c | {
"language": "C++"
} | ```c++
#include "rapidcheck/detail/FrequencyMap.h"
namespace rc {
namespace detail {
FrequencyMap::FrequencyMap(const std::vector<std::size_t> &frequencies)
: m_sum(0) {
m_table.reserve(frequencies.size());
for (auto x : frequencies) {
m_sum += x;
m_table.push_back(m_sum);
}
}
std::size_t Frequency... | ```c++
#include "rapidcheck/detail/FrequencyMap.h"
#include <algorithm>
namespace rc {
namespace detail {
FrequencyMap::FrequencyMap(const std::vector<std::size_t> &frequencies)
: m_sum(0) {
m_table.reserve(frequencies.size());
for (auto x : frequencies) {
m_sum += x;
m_table.push_back(m_sum);
}
}
... |
701cf329-1ac7-4760-99c3-448b658d40fc | {
"language": "C++"
} | ```c++
#include "Fido/GeneticAlgo.h"
#include <math.h>
std::vector<double> getPopulationFitness(const std::vector<net::NeuralNet> &population) {
std::vector<double> fitnesses;
for(net::NeuralNet network : population) {
double totalError = 0;
for(double input = 1; input < 4; input++) {
totalError += ... | ```c++
#include "Fido/GeneticAlgo.h"
#include <math.h>
std::vector<double> getPopulationFitness(const std::vector<net::NeuralNet> &population) {
std::vector<double> fitnesses;
for(net::NeuralNet network : population) {
double totalError = 0;
for(double input = 1; input < 4; input++) {
totalError += ... |
967f475f-4032-4b54-b4b4-f91149fdc410 | {
"language": "C++"
} | ```c++
#include <fstream>
#include <iostream>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <algorithm>
using namespace std;
int main() {
ifstream fin("bcount.in");
ofstream fout("bcount.out");
int num_cows, num_queries;
fin >> num_cows >> num_queries;
vector<arra... | ```c++
#include <fstream>
#include <array>
#include <vector>
using namespace std;
int main() {
ifstream fin("bcount.in");
ofstream fout("bcount.out");
int num_cows, num_queries;
fin >> num_cows >> num_queries;
vector<array<int, 3>> totals(num_cows + 1);
for (int i = 0; i < num_cows; i++) {
int cow;
fin >>... |
d7a578c8-4dc2-4842-8267-00b8458a0ebd | {
"language": "C++"
} | ```c++
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by... | ```c++
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by... |
1b450588-4d2e-48e1-b690-d3ee310bfac2 | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -verify -std=c++11 %s
// Unlike in C++98, C++11 allows unions to have static data members.
union U1 {
static constexpr int k1 = 0;
static const int k2 = k1;
static int k3 = k2; // expected-error {{non-const static data member must be initialized out of line}}
static constexpr double ... | ```c++
// RUN: %clang_cc1 -verify -std=c++11 %s
// Unlike in C++98, C++11 allows unions to have static data members.
union U1 {
static constexpr int k1 = 0;
static const int k2 = k1;
static int k3 = k2; // expected-error {{non-const static data member must be initialized out of line}}
static constexpr double ... |
bfac8cd5-77ad-42e6-8fda-ffa6b8fc6150 | {
"language": "C++"
} | ```c++
#include <nekit/deps/easylogging++.h>
#include <nekit/stream_coder/detail/stream_coder_manager.h>
#include <nekit/stream_coder/stream_processor.h>
namespace nekit {
namespace stream_coder {
template <class T>
ActionRequest StreamProcessor<T>::Negotiate() {
return impl_->Negotiate();
}
template <class T>
Buf... | ```c++
#include <nekit/deps/easylogging++.h>
#include <nekit/stream_coder/detail/stream_coder_manager.h>
#include <nekit/stream_coder/stream_processor.h>
namespace nekit {
namespace stream_coder {
template <class T>
StreamProcessor<T>::StreamProcessor() {
impl_ = new T();
}
template <class T>
StreamProcessor<T>::~... |
cffec393-71e8-4d8d-930e-92f4c45f8723 | {
"language": "C++"
} | ```c++
//===- MCFixup.cpp - Assembly Fixup Implementation ------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... | ```c++
//===- MCFixup.cpp - Assembly Fixup Implementation ------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... |
c2c0d1c8-5578-4af5-8c2e-0eaa30ca6b65 | {
"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/renderer/renderer_main_platform_delegate.h"
#include "base/debug_util.h"
// This is a no op class because we do not have a 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/renderer/renderer_main_platform_delegate.h"
#include "base/debug_util.h"
// This is a no op class because we do not have a s... |
55abbe68-5628-4b94-ab0a-ddd78df28c90 | {
"language": "C++"
} | ```c++
#include "surface.h"
namespace batoid {
#pragma omp declare target
Surface::Surface() :
_devPtr(nullptr)
{}
Surface::~Surface() {}
bool Surface::timeToIntersect(
double x, double y, double z,
double vx, double vy, double vz,
double& dt
) const {
... | ```c++
#include "surface.h"
namespace batoid {
#pragma omp declare target
Surface::Surface() :
_devPtr(nullptr)
{}
Surface::~Surface() {}
bool Surface::timeToIntersect(
double x, double y, double z,
double vx, double vy, double vz,
double& dt
) const {
... |
b1c78353-0088-4f79-b471-8c53e3da0099 | {
"language": "C++"
} | ```c++
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "JSITracing.h"
namespace facebook {
namespace jsi {
void addNativeTracingHooks(Runtime &rt) {
assert(false && "u... | ```c++
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "JSITracing.h"
namespace facebook {
namespace jsi {
void addNativeTracingHooks(Runtime &rt) {
// Unimplemented
}... |
6f384491-7fb7-4256-8f38-02890b5ab7b5 | {
"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.
//
//===---------------------------------... |
8a8197e7-431d-4547-a1e9-0de8623d317e | {
"language": "C++"
} | ```c++
#include <object/centralized-slots.hh>
namespace object
{
CentralizedSlots::content_type*
CentralizedSlots::content_ =
new CentralizedSlots::content_type();
CentralizedSlots::loc_index_type&
CentralizedSlots::loc_index_ =
CentralizedSlots::content_->get<0>();
CentralizedSlots::obj_index_... | ```c++
#include <object/centralized-slots.hh>
namespace object
{
// Allocated dynamically to avoid static destruction order
// fiasco. Some objects could indeed be destroyed after the hash
// table is destroyed.
CentralizedSlots::content_type*
CentralizedSlots::content_ =
new CentralizedSlots::content_... |
41c7b460-d819-46d7-a628-2fc17d787649 | {
"language": "C++"
} | ```c++
// $Header: /home/cvsroot/yaz++/zoom/zrs.cpp,v 1.5 2003-07-02 10:25:13 adam Exp $
// Z39.50 Result Set class
#include "zoom.h"
namespace ZOOM {
resultSet::resultSet(connection &c, const query &q) : owner(c) {
ZOOM_connection yazc = c._getYazConnection();
rs = ZOOM_connection_search(yazc, q._getYazQuery... | ```c++
// $Header: /home/cvsroot/yaz++/zoom/zrs.cpp,v 1.6 2003-09-22 13:04:52 mike Exp $
// Z39.50 Result Set class
#include "zoom.h"
namespace ZOOM {
resultSet::resultSet(connection &c, const query &q) : owner(c) {
ZOOM_connection yazc = c._getYazConnection();
rs = ZOOM_connection_search(yazc, q._getYazQuery... |
9beae1bb-7da6-44af-8aa1-9f5f7c3257b6 | {
"language": "C++"
} | ```c++
// kmfoldernode.cpp
#include "kmfolderdir.h"
//-----------------------------------------------------------------------------
KMFolderNode::KMFolderNode(KMFolderDir* aParent, const QString& aName)
//: KMFolderNodeInherited(aParent)
{
mType = "node";
mName = aName;
mParent = aParent;
mDir = FALSE;
se... | ```c++
// kmfoldernode.cpp
#include "kmfolderdir.h"
//-----------------------------------------------------------------------------
KMFolderNode::KMFolderNode(KMFolderDir* aParent, const QString& aName)
//: KMFolderNodeInherited(aParent)
{
mType = "node";
mName = aName;
mParent = aParent;
mDir = FALSE;
}
//... |
cf53a39e-07c4-439f-9446-9804fed3ee74 | {
"language": "C++"
} | ```c++
// Day2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int main()
{
std::ifstream Input("Input.txt");
if (!Input.is_open())
{
std::cout << "Error opening File!" << std::endl;
return 0;
}
std::string Line;
uint64_t WrappingPaper = 0;
while (std::getline(Input, Li... | ```c++
// Day2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int main()
{
std::ifstream Input("Input.txt");
if (!Input.is_open())
{
std::cout << "Error opening File!" << std::endl;
return 0;
}
std::string Line;
uint64_t WrappingPaper = 0;
uint64_t Ribbon = 0;
while (... |
1bcdb3ff-6a22-413b-80b9-13f4db46f3bb | {
"language": "C++"
} | ```c++
/**
* \file
* \brief board::lowLevelInitialization() implementation for NUCLEO-F103RB
*
* \author Copyright (C) 2016 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
*
* \par License
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of t... | ```c++
/**
* \file
* \brief board::lowLevelInitialization() implementation for NUCLEO-F103RB
*
* \author Copyright (C) 2016 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
*
* \par License
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of t... |
8ddebb2b-2da9-4ec2-b7a1-799079d6a93e | {
"language": "C++"
} | ```c++
#include <QCoreApplication>
#include "qtyamltest.h"
#define RUN(klass) \
do { \
klass *obj = new klass(); \
status |= QTest::qExec(obj, argc, argv); \
delete obj; \
} while(0)
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
Q_UNUSED(app);
int st... | ```c++
#include <QCoreApplication>
#include "qtyamltest.h"
#define RUN(klass) \
do { \
klass obj; \
status |= QTest::qExec(&obj, argc, argv); \
} while(0)
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
Q_UNUSED(app);
int status = 0;
RUN(HighLevelTests);
... |
a63a3cfb-502e-4b8b-a251-435be9b1b28c | {
"language": "C++"
} | ```c++
#include <sstream>
#include <gtest/gtest.h>
#include <errors.h>
#include <iostreamsocket.h>
#define TEST_CLASS IOStreamSocketTest
#define INIT_DATA ("dat_data_tho")
#define INIT_LEN (12)
class TEST_CLASS : public testing::Test {
protected:
TEST_CLASS() : in(INIT_DATA), sock(in, out) { }
std::stringstre... | ```c++
#include <sstream>
#include <gtest/gtest.h>
#include <errors.h>
#include <iostreamsocket.h>
#define TEST_CLASS IOStreamSocketTest
#define INIT_DATA ("dat data tho")
#define INIT_LEN (12)
class TEST_CLASS : public testing::Test {
protected:
TEST_CLASS() : in(INIT_DATA), sock(in, out) { }
std::stringstre... |
f4f9ecf6-5804-40c8-8ffd-6a8dbde8a007 | {
"language": "C++"
} | ```c++
// External Depdendencies
#include "../../../lib/jnipp/jnipp.h"
// Module Dependencies
#include "../include/app.h"
#include "../include/eventqueue.h"
namespace native
{
namespace ui
{
// Static Variable Initialisations
thread_local int EventQueue::_exitCode = 0;
bool EventQueue... | ```c++
// External Depdendencies
#include "../../../lib/jnipp/jnipp.h"
// Module Dependencies
#include "../include/app.h"
#include "../include/eventqueue.h"
namespace native
{
namespace ui
{
// Static Variable Initialisations
thread_local int EventQueue::_exitCode = 0;
bool EventQueue... |
23da6c87-0b00-418a-b2a4-f61976393f53 | {
"language": "C++"
} | ```c++
#include "gflags/gflags.h"
DEFINE_string(race_id, "", "");
DEFINE_bool(continuous_integration, true, "");
DEFINE_double(safe_angle, 60.0, "");
DEFINE_int32(handicap, 0, "");
DEFINE_bool(check_if_safe_ahead, true, "");
DEFINE_int32(answer_time, 10, "Time limit for answer in ms");
DEFINE_bool(bump_with_turbo, f... | ```c++
#include "gflags/gflags.h"
DEFINE_string(race_id, "", "");
DEFINE_bool(continuous_integration, true, "");
DEFINE_double(safe_angle, 60.0, "");
DEFINE_int32(handicap, 0, "");
DEFINE_bool(check_if_safe_ahead, true, "");
DEFINE_int32(answer_time, 10, "Time limit for answer in ms");
DEFINE_bool(bump_with_turbo, t... |
b6e6b605-a2c2-4640-95e5-6310b47c0231 | {
"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 "base/test_file_util.h"
#include "base/logging.h"
namespace file_util {
bool EvictFileFromSystemCache(const FilePath& file) {
// ... | ```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 "base/test_file_util.h"
#include "base/logging.h"
namespace file_util {
bool EvictFileFromSystemCache(const FilePath& file) {
// ... |
624e48ce-2313-4638-81b2-893edbcd8d77 | {
"language": "C++"
} | ```c++
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/extension_apitest.h"
#include "net/base/mock_host_resolver.h"
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Jav... | ```c++
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/extension_apitest.h"
#include "net/base/mock_host_resolver.h"
// Disabled, http://crbug.com/63589.
IN_PROC... |
a8a0aa69-4d8f-4a70-9313-27ce7e4e582b | {
"language": "C++"
} | ```c++
//
// TableLookupOsc.cpp
// Tonic
//
// Created by Nick Donaldson on 2/8/13.
//
#include "TableLookupOsc.h"
namespace Tonic {
namespace Tonic_{
TableLookupOsc_::TableLookupOsc_() :
phase_(0.0)
{
modFrames_.resize(kSynthesisBlockSize, 1);
lookupTable_ = SampleTable(kSynthes... | ```c++
//
// TableLookupOsc.cpp
// Tonic
//
// Created by Nick Donaldson on 2/8/13.
//
#include "TableLookupOsc.h"
namespace Tonic {
namespace Tonic_{
TableLookupOsc_::TableLookupOsc_() :
phase_(0.0)
{
modFrames_.resize(kSynthesisBlockSize, 1);
lookupTable_ = SampleTable(kSynthes... |
7957f7c8-48d9-4497-8f24-4980a4414f13 | {
"language": "C++"
} | ```c++
//Copyright (c) 2018 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
#include "MockSocket.h"
namespace cura
{
MockSocket::MockSocket()
{
}
void MockSocket::connect(const std::string& address, int port) { /* Do nothing. */ }
void MockSocket::listen(const std::string& address, ... | ```c++
//Copyright (c) 2018 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.
#include "MockSocket.h"
namespace cura
{
MockSocket::MockSocket()
{
}
void MockSocket::connect(const std::string&, int) { /* Do nothing. */ }
void MockSocket::listen(const std::string&, int) { /* Do nothing.... |
83c1eede-452a-4e0b-989f-fc85b127f116 | {
"language": "C++"
} | ```c++
#include "ros/ros.h"
#include "servo_msgs/KrsServoDegree.h"
#include "krs_servo_driver.hpp"
class KrsServoNode {
public:
KrsServoNode();
explicit KrsServoNode(ros::NodeHandle& nh);
private:
void krsServoDegreeCallback(const servo_msgs::KrsServoDegree::ConstPtr& msg);
ros::Subscriber sub;
KrsServoDr... | ```c++
#include "ros/ros.h"
#include "servo_msgs/KrsServoDegree.h"
#include "krs_servo_driver.hpp"
class KrsServoNode {
public:
KrsServoNode();
explicit KrsServoNode(ros::NodeHandle& nh);
private:
void krsServoDegreeCallback(const servo_msgs::KrsServoDegree::ConstPtr& msg);
ros::Subscriber sub;
KrsServoDr... |
6a5b5ec2-9fe1-4527-a42f-0b3409c8acb8 | {
"language": "C++"
} | ```c++
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "remoting/protocol/key_event_tracker.h"
#include "base/logging.h"
#include "remoting/proto/event.pb.h"
namespace remoting {
namespac... | ```c++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "remoting/protocol/key_event_tracker.h"
#include "base/logging.h"
#include "remoting/proto/event.pb.h"
namespace remoting {
namespac... |
99d7180c-5c92-4682-920b-6a02a0043955 | {
"language": "C++"
} | ```c++
#include <agency/new_executor_traits.hpp>
#include <cassert>
#include <iostream>
#include "test_executors.hpp"
template<class Executor>
void test()
{
using executor_type = Executor;
{
// returning void
executor_type exec;
int set_me_to_thirteen = 0;
auto f = agency::new_executor_tra... | ```c++
#include <agency/new_executor_traits.hpp>
#include <cassert>
#include <iostream>
#include "test_executors.hpp"
template<class Executor>
void test()
{
using executor_type = Executor;
{
// returning void
executor_type exec;
int set_me_to_thirteen = 0;
auto f = agency::new_executor_tra... |
326a1777-0062-44cd-9669-8d7c202c04ce | {
"language": "C++"
} | ```c++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/basictypes.h"
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
namespace nacl {
void CopyNaClCommandL... | ```c++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/basictypes.h"
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
namespace nacl {
void CopyNaClCommandL... |
f1a8e545-ac62-457c-b03d-6fa61ba77c8c | {
"language": "C++"
} | ```c++
// RUN: %clangxx_msan -m64 -O0 %s -o %t && %run %t
// RUN: %clangxx_msan -DPOSITIVE -m64 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
#include <emmintrin.h>
int to_int(double v) {
__m128d t = _mm_set_sd(v);
int x = _mm_cvtsd_si32(t);
return x;
// CHECK: WARNING: MemorySanitizer: use-of-uninitialized... | ```c++
// RUN: %clangxx_msan -m64 -O0 %s -o %t && %run %t
// RUN: %clangxx_msan -DPOSITIVE -m64 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
#include <emmintrin.h>
int to_int(double v) {
__m128d t = _mm_set_sd(v);
int x = _mm_cvtsd_si32(t);
return x;
// CHECK: WARNING: MemorySanitizer: use-of-uninitialized... |
ecc0e2bd-c7c3-40ef-97d4-7b03f3360845 | {
"language": "C++"
} | ```c++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
class Windo... | ```c++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"
class Windo... |
533a7b07-351d-4327-a020-2cb71d24faca | {
"language": "C++"
} | ```c++
#include <sol.hpp>
#include <string>
#include <iostream>
/// this example shows how to read data in from a lua table
using namespace std;
//compiles on linux with: g++ -std=c++11 -I.. table.cpp -o tables -llua
int main(int argc, char * argv[])
{
sol::state lua;
//table used as an array
lua.script("table... | ```c++
#include <sol.hpp>
#include <string>
#include <iostream>
// this example shows how to read data in from a lua table
int main() {
sol::state lua;
// table used as an array
lua.script("table1 = {\"hello\", \"table\"}");
// table with a nested table and the key value syntax
lua.script("table2 ... |
d0ef1f12-51a4-4723-bc31-eae1120e81b4 | {
"language": "C++"
} | ```c++
#include "mainwindow.h"
#include <QApplication>
QString _defaultPathAudio = "";
QString _defaultPathProjects = "";
QString _defaultPathOutput = "";
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
```
Support high-dpi scr... | ```c++
#include "mainwindow.h"
#include <QApplication>
QString _defaultPathAudio = "";
QString _defaultPathProjects = "";
QString _defaultPathOutput = "";
int main(int argc, char *argv[])
{
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round);
QApplication::... |
c587f9d2-7c8c-4ebf-8b05-633ce60a2ad7 | {
"language": "C++"
} | ```c++
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===--------------------... | ```c++
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===--------------------... |
f032cec7-5007-402c-bd7f-d547d104ac01 | {
"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.
//
//===---------------------------------... |
c4dcc338-0200-47c5-b4a5-0328741a8565 | {
"language": "C++"
} | ```c++
/** @file.cc
* π approximation
*/
#include <iostream>
#include <random>
/** Approximate π in a number of runs.
* @param N the number of runs
* @param rng the random number generator used
* @return an approximation of π
*/
double ApproximatePi(const size_t N, std::mt19937 &rng) {
static std::uniform_real... | ```c++
/** @file.cc
* π approximation
*/
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
/** Approximate π in a number of runs.
* @param N the number of runs
* @param rng the random number generator used
* @return an approximation of π
*/
double ApproximatePi(const size_t N, std::mt199... |
b654094a-c9c7-4bec-95f3-15a3eb1716b6 | {
"language": "C++"
} | ```c++
/**
* Tower Defence Pro #005
* (C) 2010 - Samuel Andersson, Björn Ekberg
*/
#ifdef _WIN32
#define _CRTDBG_MAP_ALLOC
#include <cstdlib>
#include <crtdbg.h>
#endif
#include <Core/Game.h>
#include <Core/GameEngine.h>
#include <ctime>
#include <memory>
#include <Utils/Log.h>
int main(int argc, char *argv[])
{
... | ```c++
/**
* Tower Defence Pro #005
* (C) 2010 - Samuel Andersson, Björn Ekberg
*/
#if defined(_WIN32) && (_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <cstdlib>
#include <crtdbg.h>
#endif
#include <Core/Game.h>
#include <Core/GameEngine.h>
#include <ctime>
#include <memory>
#include <Utils/Log.h>
int main(int argc... |
113a2f1e-556c-4f27-b6ad-93d20ee10cbe | {
"language": "C++"
} | ```c++
/*****************************************************************************
*
* utouch-frame - Touch Frame Library
*
* Copyright (C) 2011 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
*... | ```c++
/*****************************************************************************
*
* utouch-frame - Touch Frame Library
*
* Copyright (C) 2011 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
*... |
f235f0fb-c0ca-42f9-8c2b-9b64667b6810 | {
"language": "C++"
} | ```c++
#include "module.hh"
#include "module.hpp"
#include "logging.hpp"
using Wintermute::Module;
using Wintermute::Module;
using Wintermute::ModulePrivate;
Module::Module(const Designation& designation) : d_ptr(new ModulePrivate)
{
W_PRV(Module);
d->designation = designation;
wtrace("Module " + static_cast<st... | ```c++
#include "module.hh"
#include "module.hpp"
#include "logging.hpp"
using Wintermute::Module;
using Wintermute::Module;
using Wintermute::ModulePrivate;
Module::Module(const Designation& designation) : d_ptr(new ModulePrivate)
{
W_PRV(Module);
d->designation = designation;
wtrace("Module " + static_cast<st... |
db790d96-8b55-4b40-9e16-9eb24d04cd5d | {
"language": "C++"
} | ```c++
// RUN: %clangxx_asan -fno-rtti -DBUILD_SO1 -fPIC -shared %s -o %dynamiclib1
// RUN: %clangxx_asan -fno-rtti -DBUILD_SO2 -fPIC -shared %s -o %dynamiclib2
// RUN: %clangxx_asan -fno-rtti %s %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %r... | ```c++
// RUN: %clangxx_asan -fno-rtti -DBUILD_SO1 -fPIC -shared %s -o %dynamiclib1
// RUN: %clangxx_asan -fno-rtti -DBUILD_SO2 -fPIC -shared %s -o %dynamiclib2
// RUN: %clangxx_asan -fno-rtti %s %ld_flags_rpath_exe1 %ld_flags_rpath_exe2 -o %t
// RUN: %env_asan_opts=fast_unwind_on_malloc=0:detect_odr_violation=2 not %r... |
9d444c63-9fae-40a2-bfdd-0b5560553fd9 | {
"language": "C++"
} | ```c++
/*
** Author(s):
** - Cedric GESTES <gestes@aldebaran-robotics.com>
**
** Copyright (C) 2012 Aldebaran Robotics
*/
#include <iostream>
#include <qimessaging/qisession.h>
#include <qimessaging/session.hpp>
class QiSessionPrivate {
public:
qi::Session session;
};
QiSession::QiSession()
: _p(new QiSession... | ```c++
/*
** Author(s):
** - Cedric GESTES <gestes@aldebaran-robotics.com>
**
** Copyright (C) 2012 Aldebaran Robotics
*/
#include <iostream>
#include <qimessaging/qisession.h>
#include <qimessaging/session.hpp>
class QiSessionPrivate {
public:
qi::Session session;
};
QiSession::QiSession()
: _p(new QiSession... |
8f9b92f0-d301-4cff-97ab-3b5c0b6bb3c4 | {
"language": "C++"
} | ```c++
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "edges.hpp"
#include "sharpen.hpp"
int main() {
cv::Mat image(cv::imread("swiss.jpg"));
cv::Mat edges;
//std::cout << image.channels() << std::endl;
findEdges(image, edges);
cv::imshow("nyc.jpg", image);
... | ```c++
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "edges.hpp"
#include "sharpen.hpp"
int main(int argc, char* argv[]) {
if(argc < 2) {
std::cerr << "Please enter the name of the image file in which to find edges." << std::endl;
return 0;
}
std::string i... |
104d7a8d-cf76-4b68-8cf1-f43dd3ddb53c | {
"language": "C++"
} | ```c++
#include <iostream>
#include "CmdMessenger.h"
using namespace std;
enum
{
ksetled
};
int main(int argc, char *argv[])
{
if(argc == 2){
char op;
cmd::CmdMessenger arduino(argv[1], 9600);
cmd::Cmd led(ksetled);
cmd::Timeout timeout = cmd::Timeout::simpleTimeout(1000);
arduino.setTimeo... | ```c++
#include <iostream>
#include "CmdMessenger.h"
using namespace std;
enum
{
ksetled
};
int main(int argc, char *argv[])
{
if(argc == 2){
char op;
cmd::CmdMessenger arduino(argv[1], 115200);
cmd::Cmd led(ksetled);
cmd::Timeout timeout = cmd::Timeout::simpleTimeout(1000);
arduino.setTim... |
03de6d24-7158-4b1e-81c7-90516f880df7 | {
"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/icon_loader.h"
#include "base/message_loop.h"
#include "base/mime_util.h"
#include "base/thread.h"
#include "chrome/b... | ```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/icon_loader.h"
#include "base/message_loop.h"
#include "base/mime_util.h"
#include "base/thread.h"
#include "chrome/b... |
34d029d2-6328-4825-bfc9-6682b2cf8bd9 | {
"language": "C++"
} | ```c++
#include <sensormanagerinterface.h>
#include <datatypes/magneticfield.h>
int main()
{
SensorManagerInterface* m_remoteSensorManager;
m_remoteSensorManager = &SensorManagerInterface::instance();
return 0;
}
```
Update the sensord config test | ```c++
#include <sensormanagerinterface.h>
#include <datatypes/magneticfield.h>
#include <abstractsensor.h>
#include <abstractsensor_i.h>
int main()
{
SensorManagerInterface* m_remoteSensorManager;
m_remoteSensorManager = &SensorManagerInterface::instance();
QList<DataRange> (AbstractSensorChannelInterface... |
0f953059-d29e-44a2-86c6-57e4c1212e5f | {
"language": "C++"
} | ```c++
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/renderer_host/render_view_host_observer.h"
#include "content/browser/renderer_host/render_view_host.h"
RenderViewHo... | ```c++
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/renderer_host/render_view_host_observer.h"
#include "content/browser/renderer_host/render_view_host.h"
RenderViewHo... |
6bd61f85-cab4-45e7-a3e4-4b28809df9bc | {
"language": "C++"
} | ```c++
/*************************************************
* SHA-160 (IA-32) Source File *
* (C) 1999-2007 Jack Lloyd *
*************************************************/
#include <botan/sha1_ia32.h>
#include <botan/loadstor.h>
namespace Botan {
namespace {
extern "C"
void bo... | ```c++
/*************************************************
* SHA-160 (IA-32) Source File *
* (C) 1999-2007 Jack Lloyd *
*************************************************/
#include <botan/sha1_ia32.h>
#include <botan/loadstor.h>
namespace Botan {
namespace {
extern "C"
void bo... |
484159a3-b4f8-49b9-80f9-73837572e0a4 | {
"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/renderer/renderer_main_platform_delegate.h"
#include "base/debug_util.h"
// This is a no op class because we do not have a 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/renderer/renderer_main_platform_delegate.h"
#include "base/debug_util.h"
// This is a no op class because we do not have a s... |
66277189-22c6-448e-a25d-753361ae9546 | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-apple-darwin %s | FileCheck %s
// <rdar://problem/11043589>
struct Length {
Length(double v) {
m_floatValue = static_cast<float>(v);
}
bool operator==(const Length& o) const {
return getFloatValue() == o.getFloatValue();
}
bool operator!=(cons... | ```c++
// RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-apple-darwin %s | FileCheck %s
// <rdar://problem/11043589>
struct Length {
Length(double v) {
m_floatValue = static_cast<float>(v);
}
bool operator==(const Length& o) const {
return getFloatValue() == o.getFloatValue();
}
bool operator!=(cons... |
7aa3f41a-f94f-4b67-b9ca-3babacb5d581 | {
"language": "C++"
} | ```c++
#include "vast/sink/json.h"
#include "vast/util/json.h"
namespace vast {
namespace sink {
json::json(path p)
: stream_{std::move(p)}
{
}
bool json::process(event const& e)
{
auto j = to<util::json>(e);
if (! j)
return false;
auto str = to_string(*j);
str += '\n';
return stream_.write(str.beg... | ```c++
#include "vast/sink/json.h"
#include "vast/util/json.h"
namespace vast {
namespace sink {
json::json(path p)
: stream_{std::move(p)}
{
}
bool json::process(event const& e)
{
auto j = to<util::json>(e);
if (! j)
return false;
auto str = to_string(*j, true);
str += '\n';
return stream_.write(s... |
dad07d84-0a09-42a4-a9b1-70d8eb082000 | {
"language": "C++"
} | ```c++
#include <gtest/gtest.h>
#include <chrono>
#include <iostream>
#include <random>
#include <string>
#include <thread>
#include "priority.pb.h"
#include "prioritybuffer.h"
#define NUM_ITEMS 1000
unsigned long long get_priority(const PriorityMessage& message) {
return message.priority();
}
TEST(PriorityPro... | ```c++
#include <gtest/gtest.h>
#include <chrono>
#include <iostream>
#include <random>
#include <string>
#include <thread>
#include "priority.pb.h"
#include "prioritybuffer.h"
#define NUM_ITEMS 1000
unsigned long long get_priority(const PriorityMessage& message) {
return message.priority();
}
TEST(PriorityPro... |
246bcf62-46d2-44a5-af5c-26a3ec29c474 | {
"language": "C++"
} | ```c++
// This file is part of MicroRestD <http://github.com/ufal/microrestd/>.
//
// Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
// Mathematics and Physics, Charles University in Prague, Czech Republic.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. ... | ```c++
// This file is part of MicroRestD <http://github.com/ufal/microrestd/>.
//
// Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
// Mathematics and Physics, Charles University in Prague, Czech Republic.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. ... |
b69f8cf2-6f24-48c3-b44b-24930a088f70 | {
"language": "C++"
} | ```c++
#include "dashboardcontroller.h"
#include "serialization/result.h"
#include "infrastructure/contentservice.h"
#include <fstream>
ApiMock::DashboardController::DashboardController(ContentService* content)
: _content(content) {}
ApiMock::ResponseData ApiMock::DashboardController::get(RequestData request) {
au... | ```c++
#include "dashboardcontroller.h"
#include "serialization/result.h"
#include "infrastructure/contentservice.h"
#include <fstream>
#include <infrastructure/exceptions.h>
ApiMock::DashboardController::DashboardController(ContentService* content)
: _content(content) {}
ApiMock::ResponseData ApiMock::DashboardCon... |
33bb0201-06f5-4900-a4bb-ad447970958b | {
"language": "C++"
} | ```c++
// For conditions of distribution and use, see copyright notice in license.txt
#include "StableHeaders.h"
#include "PlatformNix.h"
#include "Framework.h"
#if !defined(_WINDOWS)
namespace Foundation
{
std::string PlatformNix::GetApplicationDataDirectory()
{
char *ppath = NULL;
... | ```c++
// For conditions of distribution and use, see copyright notice in license.txt
#include "StableHeaders.h"
#include "PlatformNix.h"
#include "Framework.h"
#if !defined(_WINDOWS)
namespace Foundation
{
std::string PlatformNix::GetApplicationDataDirectory()
{
char *ppath = NULL;
... |
3edc79ca-adde-4fab-ad13-373abcb15e5a | {
"language": "C++"
} | ```c++
/// Project-level integration tests
#include "stdafx.h"
#include <CppUnitTest.h>
using Assert = Microsoft::VisualStudio::CppUnitTestFramework::Assert;
namespace You {
namespace NLP {
namespace Tests {
TEST_CLASS(NlpTests) {
public:
};
} // namespace Tests
} // namespace NLP
} // namespace You
```
Exclude... | ```c++
/// Project-level integration tests
#include "stdafx.h"
#include <CppUnitTest.h>
using Assert = Microsoft::VisualStudio::CppUnitTestFramework::Assert;
namespace You {
namespace NLP {
namespace UnitTests {
TEST_CLASS(NlpTests) {
public:
};
} // namespace UnitTests
} // namespace NLP
} // namespace You
``` |
c05cc974-b079-4629-bfe4-b61f487f90e7 | {
"language": "C++"
} | ```c++
// Copyright eeGeo Ltd (2012-2015), All Rights Reserved
#include "SearchMenuPerformedSearchMessageHandler.h"
namespace ExampleApp
{
namespace SearchMenu
{
namespace SdkModel
{
SearchMenuPerformedSearchMessageHandler::SearchMenuPerformedSearchMessageHandler(Search::SdkModel::... | ```c++
// Copyright eeGeo Ltd (2012-2015), All Rights Reserved
#include "SearchMenuPerformedSearchMessageHandler.h"
namespace ExampleApp
{
namespace SearchMenu
{
namespace SdkModel
{
SearchMenuPerformedSearchMessageHandler::SearchMenuPerformedSearchMessageHandler(Search::SdkModel::... |
c1fdb78b-d1b3-46d6-b1e1-f1e123b57541 | {
"language": "C++"
} | ```c++
/*
*
Just playing around with binary and linear search. No idea.
*/
#include <iostream>
using namespace std;
int foo[10] = { 2, 16, 40, 77, 88, 99, 105, 120, 150 };
int n, result = 0;
int length = 10;
int sillySearch(int element) {
//Figure out array length and make first split
length = length / 2;
resul... | ```c++
/*
*
Implementing binary search
*/
#include <iostream>
using namespace std;
//get rid of fixed array
int foo[10] = { 2, 16, 40, 77, 88, 99, 105, 120, 150 };
int sillySearch(int element) {
int minIndex = 0;
int maxIndex = 10 - 1; //array.length here plz
int curElement, curIndex;
while (minIndex < maxInd... |
3bff62d5-7576-4567-be19-e8c235ac69a1 | {
"language": "C++"
} | ```c++
// Copyright (c) 2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#include <util/error.h>
... | ```c++
// Copyright (c) 2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <rpc/util.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#in... |
9fd74c81-9c47-429a-9713-4637712c313d | {
"language": "C++"
} | ```c++
#include "PermuteTestResult.h"
namespace fs_testing {
using std::ostream;
using std::string;
using std::to_string;
ostream& PermuteTestResult::PrintCrashState(ostream& os) const {
for (unsigned int i = 0; i < crash_state.size() - 1; ++i) {
os << to_string(crash_state.at(i)) << ", ";
}
os << to_strin... | ```c++
#include "PermuteTestResult.h"
namespace fs_testing {
using std::ostream;
using std::string;
using std::to_string;
ostream& PermuteTestResult::PrintCrashState(ostream& os) const {
if (crash_state.size() == 0) {
return os;
}
for (unsigned int i = 0; i < crash_state.size() - 1; ++i) {
os << to_str... |
db23a736-7789-4d99-b181-42a34f49a4a1 | {
"language": "C++"
} | ```c++
#include <string>
#include <libport/pthread.h>
#include <libport/unit-test.hh>
using libport::test_suite;
std::string truth("vim is future");
void* thread1(void* data)
{
std::string del((char *) data);
size_t pos = truth.find(del);
truth.erase(pos, pos + del.size());
return 0;
}
void* thread2(void* ... | ```c++
#include <string>
#include <libport/pthread.h>
#include <libport/unit-test.hh>
using libport::test_suite;
std::string truth("vim is future");
void* thread1(void* data)
{
std::string del((char *) data);
size_t pos = truth.find(del);
truth.erase(pos, pos + del.size());
return 0;
}
void* thread2(void* ... |
4a0b19b6-f136-4240-8d50-c495ca38d1c0 | {
"language": "C++"
} | ```c++
//
// Aspia Project
// Copyright (C) 2016-2022 Dmitry Chapyshev <dmitry@aspia.ru>
//
// This program 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 Foundation, either version 3 of the License, or
// (at your opt... | ```c++
//
// Aspia Project
// Copyright (C) 2016-2022 Dmitry Chapyshev <dmitry@aspia.ru>
//
// This program 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 Foundation, either version 3 of the License, or
// (at your opt... |
79f19afd-4cb2-4a72-9b27-28e98abfc2e6 | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -fsyntax-only -verify %s -Wmissing-noreturn
void f() __attribute__((noreturn));
template<typename T> void g(T) { // expected-warning {{function could be attribute 'noreturn'}}
f();
}
template void g<int>(int); // expected-note {{in instantiation of function template specialization 'g<int>'... | ```c++
// RUN: %clang_cc1 -fsyntax-only -verify %s -Wmissing-noreturn
void f() __attribute__((noreturn));
template<typename T> void g(T) { // expected-warning {{function could be attribute 'noreturn'}}
f();
}
template void g<int>(int); // expected-note {{in instantiation of function template specialization 'g<int>'... |
4d4749ed-050b-4601-9c74-8195271114bb | {
"language": "C++"
} | ```c++
#include "Logger.h"
#include <Effekseer.h>
#include <filesystem>
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/spdlog.h>
namespace Effekseer::Tool
{
void Logger::SetFileLogger(const char16_t* path)
{
spdlog::flush_on(spdlog::level::trace);
spdlog::set_level(spdlog::level::trace);
spdlog::trace... | ```c++
#include "Logger.h"
#include <Effekseer.h>
#if defined(_WIN32)
#include <filesystem>
#endif
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/spdlog.h>
namespace Effekseer::Tool
{
void Logger::SetFileLogger(const char16_t* path)
{
spdlog::flush_on(spdlog::level::trace);
spdlog::set_level(spdlog::le... |
000f17bd-f9b2-41a9-b101-d2c5ed749198 | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -ast-print -o - %s | FileCheck %s
extern "C" void f(void);
// CHECK: extern "C" void f()
extern "C" void v;
// CHECK: extern "C" void v
```
Replace void with int to make this a valid C++ file. | ```c++
// RUN: %clang_cc1 -ast-print -o - %s | FileCheck %s
extern "C" int f(void);
// CHECK: extern "C" int f()
extern "C" int v;
// CHECK: extern "C" int v
``` |
2821cbfb-aa03-4281-95f3-d757535c65a1 | {
"language": "C++"
} | ```c++
// Copyright (c) 2021 The Orbit 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 <gtest/gtest.h>
#include <QCoreApplication>
#include <cstdio>
#include <optional>
namespace {
// QCoreApplication objects needs to be o... | ```c++
// Copyright (c) 2021 The Orbit 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 <gtest/gtest.h>
#include <QCoreApplication>
#include <cstdio>
int main(int argc, char* argv[]) {
printf("Running main() from %s\n", _... |
c9cf584e-83b5-467c-9b4f-74f40adf936b | {
"language": "C++"
} | ```c++
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "tensor_attribute_executor.h"
#include <vespa/searchlib/tensor/i_tensor_attribute.h>
#include <vespa/searchlib/tensor/direct_tensor_attribute.h>
namespace search {
namespace features ... | ```c++
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "tensor_attribute_executor.h"
#include <vespa/searchlib/tensor/i_tensor_attribute.h>
namespace search {
namespace features {
TensorAttributeExecutor::
TensorAttributeExecutor(const s... |
4069f24a-a372-4c5c-a109-3b29c642d37c | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -std=c++14 -emit-llvm -disable-llvm-optzns -verify %s
// expected-no-diagnostics
namespace PR28795 {
template<typename T>
void func() {
enum class foo { a, b };
auto bar = [](foo f = foo::a) { return f; };
bar();
}
void foo() {
func<int>();
}
}
// Template struct c... | ```c++
// RUN: %clang_cc1 -std=c++14 -emit-llvm -o - %s
// expected-no-diagnostics
namespace PR28795 {
template<typename T>
void func() {
enum class foo { a, b };
auto bar = [](foo f = foo::a) { return f; };
bar();
}
void foo() {
func<int>();
}
}
// Template struct case:
template <class T> ... |
2b9f3d43-0b57-4d69-bbc9-aebc15d210cb | {
"language": "C++"
} | ```c++
/*
* Copyright 2014 The Imaging Source Europe GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | ```c++
/*
* Copyright 2014 The Imaging Source Europe GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... |
542eb276-0bae-422b-ae55-eb728d745107 | {
"language": "C++"
} | ```c++
#define CATCH_CONFIG_MAIN
#include <catch.hpp>
#include <ionConfig.h>
#ifdef ION_CONFIG_WINDOWS
class DebugOutBuffer : public std::stringbuf
{
public:
virtual int sync()
{
OutputDebugString(str().c_str());
str("");
return 0;
}
};
namespace Catch
{
std::ostream buffer(new... | ```c++
#define CATCH_CONFIG_MAIN
#include <catch.hpp>
#include <ionConfig.h>
#ifdef ION_CONFIG_WINDOWS
class DebugOutBuffer : public std::stringbuf
{
public:
virtual int sync()
{
OutputDebugString(str().c_str());
str("");
return 0;
}
};
namespace Catch
{
std::ostream buffer(new... |
96086307-936a-4331-9b48-3c979b7d15e5 | {
"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.
//
//===---------------------------------... |
00ae762d-a68c-4bde-be12-b42cfd9d9995 | {
"language": "C++"
} | ```c++
// Copyright 2011 Branan Purvine-Riley and Adam Johnson
//
// 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 ap... | ```c++
// Copyright 2011 Branan Purvine-Riley and Adam Johnson
//
// 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 ap... |
7c187695-e604-4f34-9622-9d8ad683414b | {
"language": "C++"
} | ```c++
#include <string>
#include <vector>
#include <unistd.h>
#include <gtest/gtest.h>
#include <scxcorelib/scxstrencodingconv.h>
#include "getusername.h"
using std::string;
using std::vector;
using SCXCoreLib::Utf16leToUtf8;
TEST(GetUserName,simple)
{
// allocate a WCHAR_T buffer to receive username
DWORD lpnSize... | ```c++
#include <string>
#include <vector>
#include <unistd.h>
#include <gtest/gtest.h>
#include <scxcorelib/scxstrencodingconv.h>
#include "getusername.h"
using std::string;
using std::vector;
using SCXCoreLib::Utf16leToUtf8;
TEST(GetUserName,simple)
{
// allocate a WCHAR_T buffer to receive username
DWORD lpnSize... |
62bb471d-fcb4-4273-91f3-5fe94cfff77b | {
"language": "C++"
} | ```c++
#include "SettingsWindow.hpp"
#include <imgui.h>
#include "../ImGui/Theme.hpp"
using namespace GUI;
SettingsWindow::SettingsWindow() {
themes.push_back("Default");
}
void SettingsWindow::Show() {
if (ImGui::Begin("Settings", &visible)) {
// Show drop down list to select theme.
if (dro... | ```c++
#include "SettingsWindow.hpp"
#include <imgui.h>
#include "../ImGui/Theme.hpp"
using namespace GUI;
SettingsWindow::SettingsWindow() {
themes.push_back("Default");
}
void SettingsWindow::Show() {
if (ImGui::Begin("Settings", &visible)) {
// Show drop down list to select theme.
if (dro... |
5c0b9d82-cdda-41c2-9e67-202d6d247c6c | {
"language": "C++"
} | ```c++
#include "Material.hpp"
#include "../Manager/Managers.hpp"
#include "../Manager/ResourceManager.hpp"
#include "../Texture/TextureAsset.hpp"
#include "../Hymn.hpp"
using namespace Component;
Material::Material(Entity* entity) : SuperComponent(entity) {
diffuse = Hymn().defaultDiffuse;
normal = Hymn().d... | ```c++
#include "Material.hpp"
#include "../Manager/Managers.hpp"
#include "../Manager/ResourceManager.hpp"
#include "../Texture/TextureAsset.hpp"
#include "../Hymn.hpp"
using namespace Component;
Material::Material(Entity* entity) : SuperComponent(entity) {
diffuse = Hymn().defaultDiffuse;
normal = Hymn().d... |
004c3af6-f29f-457a-9bd6-867f1f69bc8d | {
"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 "ppapi/cpp/directory_entry.h"
#include "ppapi/cpp/module.h"
namespace pp {
DirectoryEntry::DirectoryEntry() {
memset(&data_, 0, s... | ```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 "ppapi/cpp/directory_entry.h"
#include <string.h>
#include "ppapi/cpp/module.h"
namespace pp {
DirectoryEntry::DirectoryEntry() {
... |
62e998ba-4707-40fd-8a77-7109a2e1629d | {
"language": "C++"
} | ```c++
// RUN: %clangxx -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
#include <sanitizer/common_interface_defs.h>
#include <stdio.h>
volatile char *zero = 0;
void Death() {
fprintf(stderr, "DEATH CALLBACK EXECUTED\n");
}
// CHECK: DEATH CALLBACK EXECUTED
char global;
volatile char *sink;
__attribute__((noinli... | ```c++
// RUN: %clangxx -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
// REQUIRES: stable-runtime
#include <sanitizer/common_interface_defs.h>
#include <stdio.h>
volatile char *zero = 0;
void Death() {
fprintf(stderr, "DEATH CALLBACK EXECUTED\n");
}
// CHECK: DEATH CALLBACK EXECUTED
char global;
volatile char ... |
81e9ea24-5f9e-4035-aa11-ec0f96f7180f | {
"language": "C++"
} | ```c++
#include <iostream>
#include <silicon/backends/mhd_serve.hh>
#include <silicon/api.hh>
using namespace sl;
struct request_logger
{
request_logger(std::string x) : xx(x)
{
std::cout << "Request start!" << std::endl;
}
~request_logger()
{
std::cout << "Request end! " << xx << std::endl;
}
... | ```c++
#include <iostream>
#include <silicon/backends/mhd_serve.hh>
#include <silicon/api.hh>
using namespace sl;
struct request_logger
{
request_logger()
{
time = get_time();
std::cout << "Request start!" << std::endl;
}
~request_logger()
{
std::cout << "Request took " << (get_time() - time) <... |
3d5ed753-6780-4194-a5d0-a4e83955087b | {
"language": "C++"
} | ```c++
/**
* word.cpp
* Copyright (C) 2015 Tony Lim <atomictheorist@gmail.com>
*
* Distributed under terms of the MIT license.
*/
#include "word.h"
namespace NLP
{
Word::Word(const Token &other, set<WordType> tags, set<string> defs)
: Token::Token(other), mTypes(tags), mDefinitions(defs)
{
}
Word::Word(cons... | ```c++
/**
* word.cpp
* Copyright (C) 2015 Tony Lim <atomictheorist@gmail.com>
*
* Distributed under terms of the MIT license.
*/
#include "word.h"
namespace NLP
{
Word::Word() : Token()
{
}
Word::Word(const Token &other, set<WordType> tags, set<string> defs)
: Token::Token(other), mTypes(tags), mDefinition... |
03a4e029-c2f0-4171-a29d-9d4e176c3c90 | {
"language": "C++"
} | ```c++
#include <map>
#include <stdio.h>
#include <string>
#include <sys/utsname.h>
#include "tcp.h"
#include "udss.h"
#include "udds.h"
int main()
{
struct utsname name;
std::map<std::string, std::string> options;
options["port"] = "10000";
options["items"] = "1000000";
options["max_msg_size"] =... | ```c++
#include <map>
#include <stdio.h>
#include <string>
#include <sys/utsname.h>
#include "tcp.h"
#include "udss.h"
#include "udds.h"
int main()
{
struct utsname name;
std::map<std::string, std::string> options;
options["port"] = "10000";
options["items"] = "1000000";
options["max_msg_size"] =... |
a9707f8c-4a30-49bf-a256-2370f1863e5b | {
"language": "C++"
} | ```c++
#include <cstring>
#include "framework/gamecontroller.hh"
using namespace Framework;
GameController::GameController()
: m_keyboardState(NULL)
{
}
void GameController::SetKeyboardState(ReadingKeyboardState *state)
{
m_keyboardState = state;
}
ReadingKeyboardState *GameController::GetKeyboar... | ```c++
#include <cstddef>
#include "framework/gamecontroller.hh"
using namespace Framework;
GameController::GameController()
: m_keyboardState(NULL)
{
}
void GameController::SetKeyboardState(ReadingKeyboardState *state)
{
m_keyboardState = state;
}
ReadingKeyboardState *GameController::GetKeyboar... |
d1dd50ba-001e-46cb-aa49-01ae77723630 | {
"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 "SkRefCnt.h"
#include "SkWeakRefCnt.h"
SK_DEFINE_INST_COUNT(SkRefCnt)
SK_DEFINE_INST_COUNT(SkWeakRefCnt)
SkRefCnt::SkRefCnt(const SkRefCnt&) { }
SkRefCnt::... | ```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 "SkRefCnt.h"
#include "SkWeakRefCnt.h"
SK_DEFINE_INST_COUNT(SkRefCnt)
SK_DEFINE_INST_COUNT(SkWeakRefCnt)
#ifdef SK_BUILD_FOR_WIN
SkRefCnt::SkRefCnt(const Sk... |
0f53f269-99d1-4e88-8bcd-55651148df14 | {
"language": "C++"
} | ```c++
#include "./qimage_drawer.h"
#include <QPainter>
#include <vector>
namespace Graphics
{
QImageDrawer::QImageDrawer(int width, int height)
{
image = std::make_shared<QImage>(width, height, QImage::Format_Grayscale8);
}
void QImageDrawer::drawElementVector(std::vector<float> positions)
{
QPainter painter;
... | ```c++
#include "./qimage_drawer.h"
#include <QPainter>
#include <vector>
namespace Graphics
{
QImageDrawer::QImageDrawer(int width, int height)
{
image = std::make_shared<QImage>(width, height, QImage::Format_Grayscale8);
}
void QImageDrawer::drawElementVector(std::vector<float> positions)
{
QPainter painter;
... |
b8d34021-ea9a-4fcb-961c-44624ac8bd52 | {
"language": "C++"
} | ```c++
#include "stats.h"
void Stats::update(ReadType type, bool paired)
{
auto it = reads.find(type);
if (it == reads.end()) {
reads[type] = 1;
} else {
++it->second;
}
++complete;
if (type == ReadType::ok) {
if (paired) {
++pe;
} else {
... | ```c++
#include "stats.h"
void Stats::update(ReadType type, bool paired)
{
auto it = reads.find(type);
if (it == reads.end()) {
reads[type] = 1;
} else {
++it->second;
}
++complete;
if (type == ReadType::ok) {
if (paired) {
++pe;
} else {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.