doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
f29c86ad-3bb3-48c4-92ed-158281148f2d
{ "language": "C++" }
```c++ #include "wav_embedding_agent.hh" void WAV_embedding_agent::embed() { // TODO: implement } void WAV_embedding_agent::save() const { // TODO: implement } std::vector<unsigned> WAV_embedding_agent::message_to_masks(const std::string& msg, Mask_type mask_type) { // TODO: implement // do fun things until ...
```c++ #include "wav_embedding_agent.hh" void WAV_embedding_agent::embed() { // TODO: implement } void WAV_embedding_agent::save() const { // TODO: implement } std::vector<unsigned> WAV_embedding_agent::message_to_masks(const std::string& msg, Mask_type mask_type) { // TODO: implement // do fun things until ...
c6278a84-bcfb-4aca-8928-e8d2ebad1c3d
{ "language": "C++" }
```c++ /* * Copyright (C) 2019 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 o...
```c++ /* * Copyright (C) 2019 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 o...
d6c7a6f4-9e0f-48b1-9762-46736ab1a6e5
{ "language": "C++" }
```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...
```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...
0cb2667a-daa0-4815-9264-526e54b28b7b
{ "language": "C++" }
```c++ /* * Qumulus UML editor * Author: Frank Erens * */ #include "Diagram.h" #include "Style.h" QUML_BEGIN_NAMESPACE_UD Diagram::Diagram(QString name, double resolution) : mName(name), mResolution(resolution) { auto s = new Style; setLocalStyle(s); s->setFontName("sans-serif"); ...
```c++ /* * Qumulus UML editor * Author: Frank Erens * */ #include "Diagram.h" #include "Style.h" QUML_BEGIN_NAMESPACE_UD constexpr static float kFontSize = #ifdef Q_OS_MAC 12.0; #else 10.0; #endif Diagram::Diagram(QString name, double resolution) : mName(name), mResolution(resol...
accd8f64-313e-4c73-8363-45c4ad04a97d
{ "language": "C++" }
```c++ //===-- IsInf.cpp ---------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===-...
```c++ //===-- IsInf.cpp ---------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===-...
06242303-74ed-4b3f-915a-9f7274ef48db
{ "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/public/utility/utility_thread.h" #include "base/lazy_instance.h" #include "base/threading/thread_local.h" namespace content...
```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/public/utility/utility_thread.h" #include "base/lazy_instance.h" #include "base/threading/thread_local.h" namespace content...
b00666d5-4b1a-4809-8237-ea602bc94284
{ "language": "C++" }
```c++ /* * ConnectedComponents.cpp * * Created on: Dec 16, 2013 * Author: cls */ #include <set> #include "ConnectedComponents.h" #include "../structures/Partition.h" #include "../auxiliary/Log.h" namespace NetworKit { ConnectedComponents::ConnectedComponents(const Graph& G) : G(G), numComponents(0) { } ...
```c++ /* * ConnectedComponents.cpp * * Created on: Dec 16, 2013 * Author: cls */ #include <set> #include "ConnectedComponents.h" #include "../structures/Partition.h" #include "../auxiliary/Log.h" namespace NetworKit { ConnectedComponents::ConnectedComponents(const Graph& G) : G(G), numComponents(0) { } ...
62c57780-59c4-453b-a6eb-cac874166978
{ "language": "C++" }
```c++ #include "Halide.h" #include <stdio.h> #include <thread> using namespace Halide; int main(int argc, char **argv) { // Test if the compiler itself is thread-safe. This test is // intended to be run in a thread-sanitizer. std::vector<std::thread> threads; for (int i = 0; i < 1000; i++) { ...
```c++ #include "Halide.h" #include <stdio.h> #include <future> using namespace Halide; static std::atomic<int> foo; int main(int argc, char **argv) { // Test if the compiler itself is thread-safe. This test is // intended to be run in a thread-sanitizer. std::vector<std::future<void>> futures; for (...
5bd66bc9-6f4b-49b8-a2f9-98d731ef5951
{ "language": "C++" }
```c++ #include "Runtime.h" #include <llvm/IR/GlobalVariable.h> #include <llvm/IR/Function.h> #include <llvm/IR/IntrinsicInst.h> namespace dev { namespace eth { namespace jit { Runtime::Runtime(RuntimeData* _data, Env* _env) : m_data(*_data), m_env(*_env), m_currJmpBuf(m_jmpBuf) {} bytes Runtime::getReturnData(...
```c++ #include "Runtime.h" #include <llvm/IR/GlobalVariable.h> #include <llvm/IR/Function.h> #include <llvm/IR/IntrinsicInst.h> namespace dev { namespace eth { namespace jit { Runtime::Runtime(RuntimeData* _data, Env* _env) : m_data(*_data), m_env(*_env), m_currJmpBuf(m_jmpBuf) {} bytes Runtime::getReturnData(...
a0bcaf62-280e-4407-9cf7-c6fe5dfb85b8
{ "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 "net/base/network_change_notifier_helper.h" #include <algorithm> #include "base/logging.h" namespace net { namespace internal { Net...
```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 "net/base/network_change_notifier_helper.h" #include <algorithm> #include "base/logging.h" namespace net { namespace internal { Net...
2111814d-5f58-4a76-8073-5ed93b84823e
{ "language": "C++" }
```c++ #include "geocoder.h" #include <stdio.h> using namespace std; int main(int argc, char *argv[]) { if (argc < 3) { printf("USAGE: %s <geodb> <expression>\n", argv[0]); return 1; } GeoCoder g(argv[1]); pair<float, float> *latlng = g.get_latlng(argv[2]); printf("%f, %f\n"...
```c++ #include "geocoder.h" #include <stdio.h> using namespace std; int main(int argc, char *argv[]) { if (argc < 3) { printf("USAGE: %s <geodb> <expression>\n", argv[0]); return 1; } GeoCoder g(argv[1]); pair<float, float> *latlng = g.get_latlng(argv[2]); if (latlng) ...
f156ac7c-f8d0-434f-b280-28533926e5c8
{ "language": "C++" }
```c++ #include "CMeshComponent.h" #include "CGLGraphicsEngine.h" CMeshComponent::CMeshComponent(CMesh * Mesh, ion::GL::Program * Shader) { this->Mesh = Mesh; this->Shader = Shader; } void CMeshComponent::Update(CSceneNode * Node) {} void CMeshComponent::Draw(CSceneNode * Node, IGraphicsEngine *...
```c++ #include "CMeshComponent.h" #include "CGLGraphicsEngine.h" CMeshComponent::CMeshComponent(CMesh * Mesh, ion::GL::Program * Shader) { this->Mesh = Mesh; this->Shader = Shader; } void CMeshComponent::Update(CSceneNode * Node) {} void CMeshComponent::Draw(CSceneNode * Node, IGraphicsEngine *...
3b8278e7-a316-4223-ab4f-0b555f7c9da0
{ "language": "C++" }
```c++ #include <iostream> #include <vector> #include <CL/cl.hpp> void checkErr(cl_int err, const char *name) { if (err == CL_SUCCESS) return; std::cerr << "[ERROR] In " << name << ", with code: " << err << std::endl; exit(1); } int main(int argc, char **argv) { cl_int err; std::vector<cl::Platform> platform...
```c++ #include <iostream> #include <vector> #include <CL/cl.hpp> #define TOKENPASTE(x, y) x ## y #define TOKENPASTE2(x, y) TOKENPASTE(x, y) #ifndef TARGET_PLATFORM # define TARGET_PLATFORM GPU #endif #define CONCAT(A, B) A ## B #define GET_TARGET_PLATFORM TOKENPASTE2(CL_DEVICE_TYPE_, TARGET_PLATFORM) void checkEr...
ae879e74-5386-44ae-8e8e-6492291994a4
{ "language": "C++" }
```c++ #include "ram.h" #include "memorymap.h" #include <cstring> #include <cassert> RAM::RAM(uint8_t * const ram, size_t size) : ram(ram), size(size) { assert(size == MemoryMap::RAM_MIRROR_START); (void)std::memset(ram, 0U, size); } RAM::~RAM() { } // -------------------------------------------------------...
```c++ #include "ram.h" #include "memorymap.h" #include <cstring> #include <cassert> // ---------------------------------------------------------------------------------------------- // RAM::RAM(uint8_t * const ram, size_t size) : ram(ram), size(size) { assert(size > 0); (void)std::memset(ram, 0U, size); } //...
b8f56d41-456d-4c29-8919-e7630119f25f
{ "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() { ...
0ab989f4-7798-4267-9095-cb1453f7a130
{ "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. // //===---------------------------------...
829ba126-47ec-4af4-bfbd-161035ea552a
{ "language": "C++" }
```c++ #include <iomanip> #include <iostream> double sqrtt(int n) { double result = 1 / 6; for (int i = 0; i < n; i++) { result = 1 / (6 + result); } return result + 3; } int main() { int n; while (std::cin >> n) { std::cout << std::fixed << std::setprecision(10) << sqrtt(n)...
```c++ #include <iomanip> #include <iostream> double sqrtt(int n) { double result = 0.0; for (int i = 0; i < n; i++) { result = 1 / (6 + result); } return result + 3; } int main() { int n; while (std::cin >> n) { std::cout << std::fixed << std::setprecision(10) << sqrtt(n) ...
b8055d90-d92a-44a7-b285-22cd4f821566
{ "language": "C++" }
```c++ // RUN: %clangxx_msan -O0 %s -o %t && %run %t // RUN: %clangxx_msan -DPOSITIVE -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-value /...
```c++ // RUN: %clangxx_msan -O0 %s -o %t && %run %t // RUN: %clangxx_msan -DPOSITIVE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s // REQUIRES: x86_64-supported-target #include <emmintrin.h> int to_int(double v) { __m128d t = _mm_set_sd(v); int x = _mm_cvtsd_si32(t); return x; // CHECK: WARNING: MemorySani...
26f55f8a-55e5-4e52-9854-1f505aa0974a
{ "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 "base/bind.h" #include "base/test/launcher/unit_test_launcher.h" #include "base/test/test_suite.h" int main(int argc, char** argv) { ...
```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 "base/bind.h" #include "base/test/launcher/unit_test_launcher.h" #include "base/test/test_suite.h" #include "ui/gl/gl_surface.h" int ...
f855be82-b447-44d2-bdc9-9b9eda11d628
{ "language": "C++" }
```c++ #include "state_machine.hpp" namespace kg { void StateMachine::startState(StateRef newState, bool isReplacing) { if (isReplacing && !_states.empty()) { _states.pop(); } if (!isReplacing) { _states.top()->pause(); } _states.push(std::move(newS...
```c++ #include "state_machine.hpp" namespace kg { void StateMachine::startState(StateRef newState, bool isReplacing) { if (!_states.empty()) { if (isReplacing) { _states.pop(); } else { _states.top()->pause(); } } _states...
87193b05-0dc4-4277-958a-c8be9a5d85f8
{ "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...
3fe9bf84-76fe-411f-82e0-d3d7458141c5
{ "language": "C++" }
```c++ #include <QFile> #include "randomgenerator.h" QT_BEGIN_NAMESPACE_CERTIFICATE /*! \class RandomGenerator \brief The RandomGenerator class is a tool for creating hard random numbers. The RandomGenerator class provides a source of secure random numbers using the system's random source (/dev/random on UN...
```c++ #include <QFile> #include <gnutls/gnutls.h> #include <gnutls/crypto.h> #include "randomgenerator.h" QT_BEGIN_NAMESPACE_CERTIFICATE /*! \class RandomGenerator \brief The RandomGenerator class is a tool for creating hard random numbers. The RandomGenerator class provides a source of secure random number...
ba06cf5f-3cd9-4e31-95c2-ec4169b35750
{ "language": "C++" }
```c++ #include "V3DBatchModelGroup.h" #ifndef VFRAME_NO_3D #include "V3DCamera.h" #include "V3DShader.h" V3DBatchModelGroup::V3DBatchModelGroup(V3DObject* BaseObject, unsigned int MaxSize) : VGroup(MaxSize) { baseObject = BaseObject; } void V3DBatchModelGroup::Destroy() { VSUPERCLASS::Destroy(); delete baseObjec...
```c++ #include "V3DBatchModelGroup.h" #ifndef VFRAME_NO_3D #include "V3DCamera.h" #include "V3DShader.h" V3DBatchModelGroup::V3DBatchModelGroup(V3DObject* BaseObject, unsigned int MaxSize) : VGroup(MaxSize) { baseObject = BaseObject; } void V3DBatchModelGroup::Destroy() { VSUPERCLASS::Destroy(); delete baseObjec...
cf084119-ccdf-4b4f-a974-5d47da1aab9a
{ "language": "C++" }
```c++ #include <sh.h> #include <stdio.h> int main(void) { MCU_sw ic; ic.led.set(); //ic.Uart.putch('H'); //ic.Uart.putch('e'); //ic.Uart.putch('l'); //ic.Uart.putch('l'); //ic.Uart.putch('o'); ic.stdio.setio(&ic.Uart); icprintf("Hello world from printf\n"); while (1) { if (ic.buttons.b1....
```c++ #include <sh.h> #include <stdio.h> int main(void) { MCU_sw ic; ic.led.set(); ic.stdio.setio(&ic.Uart); icprintf("Hello world from printf\n"); while (1) { if (ic.buttons.b1.isOn() != ic.buttons.b2.isOn()) { ic.led.clr(); ic.relay.r1.set(); } else { ic.led.set(); ic.re...
c238fefb-d436-4fb4-8ec2-a9fe7dc8a0b8
{ "language": "C++" }
```c++ // Native C++ Libraries #include <iostream> #include <string> // C++ Interpreter Libraries #include <Console.h> ``` Add the rest of the standard C++ code to main file.
```c++ // Native C++ Libraries #include <iostream> #include <string> // C++ Interpreter Libraries #include <Console.h> using namespace std; int main() { } ```
2b19f9d2-3207-440f-a7c6-3938022740e4
{ "language": "C++" }
```c++ #include "./mouse_wheel_transition.h" #include <QDebug> MouseWheelTransition::MouseWheelTransition(QObject *object, QState *sourceState) : QEventTransition(object, QEvent::Scroll, sourceState) { } MouseWheelTransition::~MouseWheelTransition() { } bool MouseWheelTransition::eventTest(QEvent *event) { qWarn...
```c++ #include "./mouse_wheel_transition.h" #include <QDebug> MouseWheelTransition::MouseWheelTransition(QObject *object, QState *sourceState) : QEventTransition(object, QEvent::Wheel, sourceState) { } MouseWheelTransition::~MouseWheelTransition() { } bool MouseWheelTransition::eventTest(QEvent *event) { qWarni...
d98a7d2e-9d1d-4378-b179-92515c7fc052
{ "language": "C++" }
```c++ #include <QApplication> #include <QQmlApplicationEngine> #include <QQmlContext> #include <stdlib.h> #include <QtGlobal> #include <QtWidgets> #include <QtSingleApplication> int main(int argc, char *argv[]) { QtSingleApplication app(argc, argv); QQmlApplicationEngine engine; app.setWindowIcon(QIcon("r...
```c++ #include <QApplication> #include <QQmlApplicationEngine> #include <QQmlContext> #include <stdlib.h> #include <QtGlobal> #include <QtWidgets> #include <QtSingleApplication> int main(int argc, char *argv[]) { QtSingleApplication app(argc, argv); if (app.isRunning()) { return 0; } QQmlAppli...
c397c6e6-175d-434d-931d-b2605aaf428f
{ "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. // /*++ Module Name: common.c Abstract: Implementation of the common mapping functions. --*/ #include "pal/palinternal.h" #include "pal/dbg...
```c++ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // /*++ Module Name: common.c Abstract: Implementation of the common mapping functions. --*/ #include "pal/palinternal.h" #include "pal/dbg...
bce49a35-63d7-4a4d-84d5-55817cd2c9c2
{ "language": "C++" }
```c++ //---------------------------- sparse_decomposition.cc --------------------------- // Copyright (C) 1998, 1999, 2000, 2001, 2002 // by the deal.II authors and Stephen "Cheffo" Kolaroff // // This file is subject to QPL and may not be distributed // without copyright and license information. Please...
```c++ //---------------------------- sparse_decomposition.cc --------------------------- // Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 // by the deal.II authors and Stephen "Cheffo" Kolaroff // // This file is subject to QPL and may not be distributed // without copyright and license information. ...
d797cbb1-c74a-4dde-88ba-dd9e404ace9d
{ "language": "C++" }
```c++ // Nikita Kouevda // 2013/11/02 #include <cmath> #include "prime.hpp" using namespace std; bool isPrime(long int n) { if (n == 2 || n == 3) { return 1; } else if (n < 2 || n % 2 == 0 || n % 3 == 0) { return 0; } for (long int i = 5, max = sqrt(n) + 1; i < max; i += 6) { if (n % i == 0 ||...
```c++ // Nikita Kouevda // 2013/11/02 #include <cmath> #include "prime.hpp" using namespace std; bool isPrime(long int n) { if (n == 2 || n == 3) { return true; } else if (n < 2 || n % 2 == 0 || n % 3 == 0) { return false; } for (long int i = 5, max = sqrt(n) + 1; i < max; i += 6) { if (n % i ...
70c981bd-47d5-491c-9422-5e20f22f92f3
{ "language": "C++" }
```c++ /* * * Copyright (C) 2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "source/loader/driver_discovery.h" #include "source/inc/ze_util.h" #include <iostream> #include <sstream> #include <string> namespace loader { static const char *knownDriverNames[] = { MAKE_LIBRARY_NAME("ze_i...
```c++ /* * * Copyright (C) 2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "source/loader/driver_discovery.h" #include "source/inc/ze_util.h" #include <iostream> #include <sstream> #include <string> namespace loader { static const char *knownDriverNames[] = { MAKE_LIBRARY_NAME("ze_i...
c9399853-6f51-4b27-ab5f-df034a83aa91
{ "language": "C++" }
```c++ #include "Game.hpp" #include <Arduino.h> namespace { constexpr uint32_t MsPerUpdate = 200; } // namespace namespace arduino_pong { void Game::run() { while(true) { uint32_t start = millis(); gameField_.update(); gameField_.render(renderer_); int32_t delayValue = s...
```c++ #include "Game.hpp" #include <Arduino.h> namespace { constexpr uint32_t MsPerUpdate = 30; } // namespace namespace arduino_pong { void Game::run() { while(true) { uint32_t start = millis(); gameField_.update(); gameField_.render(renderer_); int32_t delayValue = st...
4fba9e0e-e502-489b-b888-c0c8119c6e02
{ "language": "C++" }
```c++ #include <logging/Logger.h> #include <graphics/GlfwContext.h> #include <graphics/GlfwWindow.h> #include <graphics/Renderer.h> #include <gamemodel/GameState.h> #include <input/Input.h> int main(int argc, char ** argv) { Logger::initSystem(argc, argv); GlfwContext glfwContext(Logger::glfwErrorCallb...
```c++ #include <memory> #include <logging/Logger.h> #include <graphics/GlfwContext.h> #include <graphics/GlfwWindow.h> #include <graphics/Renderer.h> #include <gamemodel/GameState.h> #include <input/Input.h> int main(int argc, char ** argv) { Logger::initSystem(argc, argv); GlfwContext glfwContext(Logger:...
12ce3d70-e5c5-4f7e-a61c-b7e2bffd005e
{ "language": "C++" }
```c++ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2009 Andrew Manson <g.real.ate@gmail.com> // #include "KmlTagWriter.h" #in...
```c++ // // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2009 Andrew Manson <g.real.ate@gmail.com> // #include "KmlTagWriter.h" #in...
8d1ee098-d8f8-4614-a9c9-34c1bbe302eb
{ "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 "net/base/network_change_notifier_helper.h" #include <algorithm> #include "base/logging.h" namespace net { namespace internal { Net...
```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 "net/base/network_change_notifier_helper.h" #include <algorithm> #include "base/logging.h" namespace net { namespace internal { Net...
0afcc768-30f4-49e6-9c92-43610e5998a7
{ "language": "C++" }
```c++ // // FormulaEngine Project // By Mike Lewis - 2015 // // Project entry point routine // #include "Pch.h" #include "Tests.h" #include "Simulation.h" // This is Microsoft-specific for _TCHAR and _tmain. // The entry point can be trivially rewritten for other // compilers/platforms, so I'm not...
```c++ // // FormulaEngine Project // By Mike Lewis - 2015 // // Project entry point routine // #include "Pch.h" #include "Tests.h" #include "Simulation.h" // This is Microsoft-specific for _TCHAR and _tmain. // The entry point can be trivially rewritten for other // compilers/platforms, so I'm not...
1bf6ba33-509f-437e-82ad-b3b1de1ef308
{ "language": "C++" }
```c++ //===-- main.cpp ------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- main.cpp ------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
5b24ca06-8ff2-47d2-89e6-39e3cf30c278
{ "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 // //===--------------------...
4f2ad85c-7e65-4cdd-8d70-96b694b95b9c
{ "language": "C++" }
```c++ // generic C #include <cassert> #include <cstdlib> // Google Test library #include <gtest/gtest.h> // uArchSim modules #include "../elf_parser.h" static const char * valid_elf_file = "./mips_bin_exmpl.out"; //static const char * valid_section_name = ".data"; // // Check that all incorect input params of the ...
```c++ // generic C #include <cassert> #include <cstdlib> // Google Test library #include <gtest/gtest.h> // uArchSim modules #include "../elf_parser.h" static const char * valid_elf_file = "./mips_bin_exmpl.out"; //static const char * valid_section_name = ".data"; // // Check that all incorect input params of the ...
4d4de36b-fc60-4aee-804a-9190f39ed19d
{ "language": "C++" }
```c++ #include "MirandaContact.h" #include <exception> #include <sstream> #include <m_contacts.h> #include <m_core.h> std::wstring MirandaContact::GetUID(HANDLE contactHandle) { auto contactInfo = CONTACTINFO(); contactInfo.hContact = contactHandle; contactInfo.dwFlag = CNF_UNIQUEID | CNF_UNICODE; if (CallServ...
```c++ #include "MirandaContact.h" #include <exception> #include <sstream> #include <m_contacts.h> #include <m_core.h> std::wstring MirandaContact::GetUID(HANDLE contactHandle) { auto contactInfo = CONTACTINFO(); contactInfo.hContact = contactHandle; contactInfo.dwFlag = CNF_UNIQUEID | CNF_UNICODE; if (CallServ...
988f4ae9-e847-4209-af26-2f9191521113
{ "language": "C++" }
```c++ #include "findCollidingNames.h" #include "symtab.h" #include "stringutil.h" /* Goal: * Find symbols that have names which already exist and munge those. * Strategy: * Keep track of all function symbols, type symbols and variable symbols in vector structures. * Search those structures for colliding names and...
```c++ #include "findCollidingNames.h" #include "symtab.h" #include "stringutil.h" /* Goal: * Find symbols that have names which already exist and munge those. * Strategy: * Keep track of all function symbols, type symbols and variable symbols in vector structures. * Search those structures for colliding names and...
bd5211f1-7da5-441a-b253-dedda623d44b
{ "language": "C++" }
```c++ #include "buffers.h" #include "strutil.h" #include "log.h" void processQueue(ByteQueue* queue, bool (*callback)(uint8_t*)) { uint8_t snapshot[QUEUE_MAX_LENGTH(uint8_t)]; queue_snapshot(queue, snapshot); if(callback == NULL) { debug("Callback is NULL (%p) -- unable to handle queue at %p\r\n",...
```c++ #include "buffers.h" #include "strutil.h" #include "log.h" void processQueue(ByteQueue* queue, bool (*callback)(uint8_t*)) { uint8_t snapshot[queue_length(queue)]; queue_snapshot(queue, snapshot); if(callback == NULL) { debug("Callback is NULL (%p) -- unable to handle queue at %p\r\n", ...
d81b2480-2603-48ab-956a-6b1b2a9d3462
{ "language": "C++" }
```c++ // Conventions: // O is the stack pointer (post-decrement) // B is the (so far only) return register // C is the (so far only) argument register // N is the relative-jump temp register #ifndef ARGUMENT #define ARGUMENT 10 #endif #include "common.th" _start: prologue // sets up base/stack po...
```c++ // Conventions: // O is the stack pointer (post-decrement) // B is the (so far only) return register // C is the (so far only) argument register // N is the relative-jump temp register #ifndef ARGUMENT #define ARGUMENT 10 #endif #include "common.th" _start: prologue // sets up base/stack po...
ee9487ad-5745-43ff-b408-bbf6999c187b
{ "language": "C++" }
```c++ #include <QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); app.setAttribute(Qt::AA_UseHighDpiPixmaps); QIcon appIcon; appIcon.addFile(":/Icons/AppIcon32"); appIcon.addFile(":/Icons/AppIcon128"); app.setWindowIcon(appIcon); Main...
```c++ #include <QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); // Retina display support for Mac OS, iOS and X11: // http://blog.qt.digia.com/blog/2013/04/25/retina-display-support-for-mac-os-ios-and-x11/ // // AA_UseHighDpiPixmaps attribute...
afab7954-dbbd-4edf-af5d-660171341c44
{ "language": "C++" }
```c++ //===-- main.cpp ------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- main.cpp ------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
2c649d33-0007-497f-b801-1615489495bc
{ "language": "C++" }
```c++ #include "logging.h" #include <boost/log/utility/setup/console.hpp> namespace logging = boost::log; using boost::log::trivial::severity_level; severity_level gLoggingThreshold; long get_curlopt_verbose() { return gLoggingThreshold <= boost::log::trivial::debug ? 1L : 0L; } void logger_init() { gLoggingThr...
```c++ #include "logging.h" #include <boost/log/utility/setup/console.hpp> namespace logging = boost::log; using boost::log::trivial::severity_level; severity_level gLoggingThreshold; long get_curlopt_verbose() { return gLoggingThreshold <= boost::log::trivial::debug ? 1L : 0L; } void logger_init() { gLoggingThr...
ef19a380-4510-4a13-b0a2-9ff134f962ab
{ "language": "C++" }
```c++ #include "spritesheet_importer.h" #include "halley/core/graphics/sprite/sprite_sheet.h" #include "halley/tools/file/filesystem.h" #include "halley/bytes/byte_serializer.h" #include "halley/file_formats/yaml_convert.h" using namespace Halley; void SpriteSheetImporter::import(const ImportingAsset& asset, IAssetC...
```c++ #include "spritesheet_importer.h" #include "halley/core/graphics/sprite/sprite_sheet.h" #include "halley/tools/file/filesystem.h" #include "halley/bytes/byte_serializer.h" #include "halley/file_formats/yaml_convert.h" using namespace Halley; void SpriteSheetImporter::import(const ImportingAsset& asset, IAssetC...
81e1b696-1350-4b2e-ad51-fbb9e476c9b9
{ "language": "C++" }
```c++ #include <cstdint> #include <Mapper0.h> uint8_t Mapper0::readPrg(uint16_t addr) { int index = addr % cartMemory.prg.size(); return cartMemory.prg[index]; } uint8_t Mapper0::readChr(uint16_t addr) { int index = addr % cartMemory.chr.size(); return cartMemory.chr[index]; } void Mapper0::writeCh...
```c++ #include <cstdint> #include <Mapper0.h> uint8_t Mapper0::readPrg(uint16_t addr) { if (addr >= 0x8000) { int index = addr % cartMemory.prg.size(); return cartMemory.prg[index]; } else if (addr >= 0x6000) { int index = addr % 0x2000; return cartMemory.ram[index]; } else { return 0; }...
3e302a37-aa4d-47dd-80ff-a97277084589
{ "language": "C++" }
```c++ #include "stdafx.h" #include "ExampleState.h" ExampleState::ExampleState() { // Create an example object to display on screen std::unique_ptr<ExampleObject> player(new ExampleObject()); object_manager_.Add(std::move(player)); // SFML will play audio in a seperate thread so we dont have to worry about t...
```c++ #include "stdafx.h" #include "ExampleState.h" ExampleState::ExampleState() { // Create an example object to display on screen std::unique_ptr<ExampleObject> player(new ExampleObject()); object_manager_.Add(std::move(player)); // SFML will play audio in a seperate thread so we dont have to worry about t...
80e287ab-3c97-45a2-ba49-a832f1560a84
{ "language": "C++" }
```c++ #ifdef __WAND__ target[name[item.o] type[object]] #endif #include "item.h" #include "macro.h" #include "commentprocessor.h" #include <herbs/intformat/intformat.h> #include <herbs/exceptionmissing/exceptionmissing.h> Herbs::String Doxymax::Item::expand(const Macro& macro,CommentProcessor& processor) { if(mac...
```c++ #ifdef __WAND__ target[name[item.o] type[object]] #endif #include "item.h" #include "macro.h" #include "commentprocessor.h" #include <herbs/intformat/intformat.h> #include <herbs/exceptionmissing/exceptionmissing.h> Herbs::String Doxymax::Item::expand(const Macro& macro,CommentProcessor& processor) { if(mac...
5d6a2210-1d2c-4284-bdc1-313d2c52ea69
{ "language": "C++" }
```c++ #include "paxos/logging.hpp" #include "paxos/sender.hpp" #include <boost/asio/io_service.hpp> using boost::asio::ip::tcp; BoostTransport::BoostTransport() : io_service_(), socket_(io_service_) { } BoostTransport::~BoostTransport() { socket_.close(); } void BoostTransport::Connect(std::stri...
```c++ #include "paxos/logging.hpp" #include "paxos/sender.hpp" #include <boost/asio/io_service.hpp> using boost::asio::ip::tcp; BoostTransport::BoostTransport() : io_service_(), socket_(io_service_) { } BoostTransport::~BoostTransport() { socket_.close(); } void BoostTransport::Connect(std::stri...
04a85c20-5747-4dd6-9c9e-94412552d900
{ "language": "C++" }
```c++ #include "Tab.h" #include "UIContext.h" Tab::Tab() { } Tab::~Tab() { delete _ctxt; } DLGPROC Tab::TabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { unsigned short nCode, ctrlId; switch (message) { case WM_INITDIALOG: _hWnd = hDlg; _ctxt = new UIContext(hDlg); ...
```c++ #include "Tab.h" #include "UIContext.h" Tab::Tab() { } Tab::~Tab() { delete _ctxt; } DLGPROC Tab::TabProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { unsigned short nCode, ctrlId; switch (message) { case WM_INITDIALOG: _hWnd = hDlg; _ctxt = new UIContext(hDlg); ...
cf595bb1-c9e4-4a22-ba94-b178b5ec1048
{ "language": "C++" }
```c++ // // Copyright © 2016 D.E. Goodman-Wilson. All rights reserved. // #include <gtest/gtest.h> #include <slack/slack.h> #include <cpr/cpr.h> #include "environment.h" ::Environment* env; int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); env = dynamic_cast<::Environment*>(::testin...
```c++ // // Copyright © 2016 D.E. Goodman-Wilson. All rights reserved. // #include <gtest/gtest.h> #include <slack/slack.h> #include <cpr/cpr.h> #include "environment.h" ::Environment* env; int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); if(!std::getenv("SLACK_TOKEN")) { ...
dded7fab-04f2-402d-8fb5-1fb51fc2bf6a
{ "language": "C++" }
```c++ // Copyright (c) 2016 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 "wallet/test/wallet_test_fixture.h" #include "rpc/server.h" #include "wallet/db.h" #include "wallet/wallet.h" Wa...
```c++ // Copyright (c) 2016 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 "wallet/test/wallet_test_fixture.h" #include "rpc/server.h" #include "wallet/db.h" #include "wallet/wallet.h" Wa...
778a5b9e-1b09-4585-bcc4-e78177eeaf2a
{ "language": "C++" }
```c++ // ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All right reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top leve...
```c++ // ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All right reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top leve...
2b51faeb-2ad6-471d-9d9b-e44fdcd6d92d
{ "language": "C++" }
```c++ #include <iostream> #include <vector> #include <fstream> #include "../include/args.h" #include "errors/RuntimeError.h" #include "execution/Program.h" #include "loader/ProgramReader.h" int main(int argc, char **argv) { args::ArgumentParser parser("thinglang's runtime environment"); args::HelpFlag help(...
```c++ #include <iostream> #include <vector> #include <fstream> #include "../include/args.h" #include "errors/RuntimeError.h" #include "execution/Program.h" #include "loader/ProgramReader.h" int main(const int argc, const char **argv) { args::ArgumentParser parser("thinglang's runtime environment"); args::H...
a29ea9ae-d8a2-4055-ad44-3395707795e0
{ "language": "C++" }
```c++ //============================================================================= // ■ ASM76/ASM76.cpp //----------------------------------------------------------------------------- // 全局变量与实用函数。 //============================================================================= #include "ASM76.hpp" namespace ASM...
```c++ //============================================================================= // ■ ASM76/ASM76.cpp //----------------------------------------------------------------------------- // 全局变量与实用函数。 //============================================================================= #include "ASM76.hpp" namespace ASM...
fffede56-7720-494b-a35b-cf2162289347
{ "language": "C++" }
```c++ static void (*real_one) (); static void stub(){} /* in CheatSheetTest.cpp */ #include "CppUTest/TestHarness.h" /* Declare TestGroup with name CheatSheet */ TEST_GROUP(CheatSheet) { /* declare a setup method for the test group. Optional. */ void setup () { /* Set method real_one to stub. Automatically ...
```c++ static void (*real_one) (); static void stub(){} /* in CheatSheetTest.cpp */ #include "CppUTest/TestHarness.h" /* Declare TestGroup with name CheatSheet */ TEST_GROUP(CheatSheet) { /* declare a setup method for the test group. Optional. */ void setup () { /* Set method real_one to stub. Automatically ...
3702e8fd-09da-4b6b-80d4-257fdbea5448
{ "language": "C++" }
```c++ #include "Image.h" namespace hm { Image::Image() { } Image::Image(std::string filename, SDL_Renderer* renderer) { loadImage(filename, renderer); } void Image::loadImage(std::string filename, SDL_Renderer* renderer) { // Unload a previous image. if(texture != nullptr) { SDL_DestroyTexture...
```c++ #include "Image.h" namespace hm { Image::Image() { } Image::Image(std::string filename, SDL_Renderer* renderer) { loadImage(filename, renderer); } void Image::loadImage(std::string filename, SDL_Renderer* renderer) { // Unload a previous image. if(texture != nullptr) { SDL_DestroyTexture...
3f39a479-6206-4f70-93db-a9586e2f42e7
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" IN_PROC_BR...
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" IN_PROC_BR...
13352f63-562a-42be-9268-2d43a9a0e77a
{ "language": "C++" }
```c++ #include <iostream> #include <StringObserverImpl.h> void StringObserverImpl::update() { char* cur_value = mSubject->getValue(); std::cout << "Current string value is now '" << cur_value << "'\n"; delete cur_value; } ``` Use vprDEBUG instead of std::cout to print the current string value.
```c++ #include <vpr/Util/Debug.h> #include <StringObserverImpl.h> void StringObserverImpl::update() { char* cur_value = mSubject->getValue(); vprDEBUG(vprDBG_ALL, vprDBG_CRITICAL_LVL) << "Current string value is now '" << cur_value << "'\n" << vprDEBUG_FLUSH; delete cur_value; } ```
9257c4a1-5ccc-4d9e-806c-fa0677d317f0
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -fsyntax-only -std=c++0x -verify %s namespace PR10622 { struct foo { const int first; foo(const foo&) = default; }; void find_or_insert(const foo& __obj) { foo x(__obj); } } ``` Expand test of C++0x [class.copymove]p15 to make sure we're actually calling the copy construc...
```c++ // RUN: %clang_cc1 -fsyntax-only -std=c++0x -verify %s namespace PR10622 { struct foo { const int first; foo(const foo&) = default; }; void find_or_insert(const foo& __obj) { foo x(__obj); } struct bar : foo { bar(const bar&) = default; }; void test_bar(const bar &obj) { bar o...
615b0f72-f851-4885-b22c-8a5b4393380b
{ "language": "C++" }
```c++ #include "extensions.h" #include "extensions/accelerometer.h" #include "extensions/debugconsole.h" #include "extensions/deviceinfo.h" #include "extensions/hash.h" #include "extensions/notification.h" #ifdef Q_WS_S60 #include "extensions/camera.h" #include "extensions/memorywatcher.h" #endif #include <QWebFrame...
```c++ #include "extensions.h" #include "extensions/accelerometer.h" #include "extensions/debugconsole.h" #include "extensions/deviceinfo.h" #include "extensions/geolocation.h" #include "extensions/hash.h" #include "extensions/notification.h" #ifdef Q_WS_S60 #include "extensions/camera.h" #include "extensions/memorywa...
08b460b4-db15-4250-a543-73a7672862da
{ "language": "C++" }
```c++ #include "tgbot/Bot.h" #include "tgbot/EventBroadcaster.h" #if __cplusplus < 201402L namespace std { template<class T> struct _Unique_if { typedef unique_ptr<T> _Single_object; }; template<class T> struct _Unique_if<T[]> { typedef unique_ptr<T[]> _Unknown_bound; }; templa...
```c++ #include "tgbot/Bot.h" #include "tgbot/EventBroadcaster.h" #if __cplusplus == 201103L namespace std { template<typename T> inline std::unique_ptr<T> make_unique() { return std::unique_ptr<T>(new T()); } } #endif namespace TgBot { Bot::Bot(std::string token, const HttpClient& httpClient) ...
776bbf3e-11f6-452c-b288-3c6bf12a366e
{ "language": "C++" }
```c++ //===- bugpoint.cpp - The LLVM BugPoint utility ---------------------------===// // // This program is an automated compiler debugger tool. It is used to narrow // down miscompilations and crash problems to a specific pass in the compiler, // and the specific Module or Function input that is causing the problem...
```c++ //===- bugpoint.cpp - The LLVM BugPoint utility ---------------------------===// // // This program is an automated compiler debugger tool. It is used to narrow // down miscompilations and crash problems to a specific pass in the compiler, // and the specific Module or Function input that is causing the problem...
cb707826-5c57-4686-94b2-7ee708869202
{ "language": "C++" }
```c++ // RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s #include <string.h> extern "C" __declspec(dllexport) int test_function() { char buff[6] = "Hello"; memchr(buff, 'z', 7); // CHECK: AddressSanitizer: stack-buffer-overf...
```c++ // RUN: %clang_cl_asan -O0 %p/dll_host.cc -Fe%t // RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll // RUN: not %run %t %t.dll 2>&1 | FileCheck %s // On windows 64-bit, the memchr function is written in assembly and is not // hookable with the interception library. There is not enough padding before // the function and...
a8fc568e-f653-4ef3-b06f-94a55c114733
{ "language": "C++" }
```c++ #include <stdio.h> #include <stdlib.h> int *list; int size; int sum; int main(void) { size = 9; sum = 15; list = (int *)malloc(sizeof(int) * size); list[0] = 1; list[1] = 5; list[2] = 8; list[3] = 3; list[4] = 7; list[5] = 12; list[6] = 11; list[7] = 2; list[8] ...
```c++ #include <stdio.h> #include <stdlib.h> void trim_out_of_range(void); int shift_right(const int idx, const int sum = 0); int shift_down(const int idx, const int sum = 0); int *list; int size; int sum; int main(void) { printf("Enter n= "); scanf("%d", &size); list = (int *)malloc(sizeof(int) * size); ...
eb72cd97-480c-464b-a5ad-5727c608ade0
{ "language": "C++" }
```c++ #include "Genes/Stacked_Pawns_Gene.h" #include <memory> #include <string> #include "Game/Board.h" #include "Game/Piece.h" #include "Game/Color.h" #include "Genes/Gene.h" double Stacked_Pawns_Gene::score_board(const Board& board, Color perspective, size_t) const { double score = 0.0; auto own_pawn = ...
```c++ #include "Genes/Stacked_Pawns_Gene.h" #include <memory> #include <string> #include "Game/Board.h" #include "Game/Piece.h" #include "Game/Color.h" #include "Genes/Gene.h" double Stacked_Pawns_Gene::score_board(const Board& board, Color perspective, size_t) const { double score = 0.0; auto own_pawn = ...
c0ad130e-ba28-4644-a568-c6f5ba1c517e
{ "language": "C++" }
```c++ #include "common.h" #include "Integrator.h" #include "IntegrableProperty.h" #include "EventManager.h" void Integrator::Update(DeltaTicks &dt) { accumulator += dt; if(accumulator.Seconds() > 1.0f) { accumulator.SetSeconds(1.0f); } alphaMicroseconds = static_cast<uint32_t>(accumulator.Seconds() * 1000000.0f); ...
```c++ #include "common.h" #include "Integrator.h" #include "IntegrableProperty.h" #include "EventManager.h" void Integrator::Update(DeltaTicks &dt) { accumulator += dt; if(accumulator.Seconds() > 1.0f) { accumulator.SetSeconds(1.0f); } while(accumulator >= timestep) { Tick(timestep.Seconds()); accumulator -= ...
e4c6432b-b83f-498d-9078-a12a9b892a5e
{ "language": "C++" }
```c++ // // Copyright © 2015 Slack Technologies, Inc. All rights reserved. // #include "slack/http.h" namespace slack { namespace http { std::function<response(std::string url, params)> get; std::function<response(std::string url, params)> post; } //namespace http } //namespace slack ``` Use CPR by default now.
```c++ // // Copyright © 2015 Slack Technologies, Inc. All rights reserved. // #include "slack/http.h" #include <cpr.h> namespace slack { namespace http { std::function<response(std::string url, params)> get = [](std::string url, slack::http::params params) -> slack::http::response { cpr::Parameters p; for (...
41548423-3308-497c-b430-dbec94bb05a1
{ "language": "C++" }
```c++ #include <QTest> #include <QObject> #include "uritests.h" // This is all you need to run all the tests int main(int argc, char *argv[]) { URITests test1; QTest::qExec(&test1); } ``` Return !0 when qt tests fail.
```c++ #include <QTest> #include <QObject> #include "uritests.h" // This is all you need to run all the tests int main(int argc, char *argv[]) { bool fInvalid = false; URITests test1; if (QTest::qExec(&test1) != 0) fInvalid = true; return fInvalid; } ```
9cf3d76b-712d-4db8-9a57-92392f209c98
{ "language": "C++" }
```c++ // RUN: %clang -g -S -emit-llvm %s -o - | FileCheck %s namespace A { #line 1 "foo.cpp" namespace B { int i; } } // CHECK: [[FILE:![0-9]*]]} ; [ DW_TAG_file_type ] [{{.*}}/test/CodeGenCXX/debug-info-namespace.cpp] // CHECK: [[VAR:![0-9]*]] = {{.*}}, metadata [[NS:![0-9]*]], metadata !"i", {{.*}} ; [ DW_TAG_var...
```c++ // RUN: %clang -g -S -emit-llvm %s -o - | FileCheck %s namespace A { #line 1 "foo.cpp" namespace B { int i; } } // CHECK: [[FILE:![0-9]*]] {{.*}}debug-info-namespace.cpp" // CHECK: [[VAR:![0-9]*]] = {{.*}}, metadata [[NS:![0-9]*]], metadata !"i", {{.*}} ; [ DW_TAG_variable ] [i] // CHECK: [[NS]] = {{.*}}, met...
24514d25-d99f-4d9b-bc79-85f153c1b281
{ "language": "C++" }
```c++ /* * modules.cpp * StatusSpec project * * Copyright (c) 2014 thesupremecommander * BSD 2-Clause License * http://opensource.org/licenses/BSD-2-Clause * */ #pragma once #include "stdafx.h" #include "modules.h" void ModuleManager::UnloadAllModules() { for (auto iterator = modules.begin(); iterato...
```c++ /* * modules.cpp * StatusSpec project * * Copyright (c) 2014 thesupremecommander * BSD 2-Clause License * http://opensource.org/licenses/BSD-2-Clause * */ #pragma once #include "stdafx.h" #include "modules.h" void ModuleManager::UnloadAllModules() { for (auto iterator = modules.begin(); iterato...
54421dea-ee83-4d77-b40e-05e7ea1035dd
{ "language": "C++" }
```c++ // RUN: clang -fsyntax-only -verify %s class A { }; class B1 : A { }; class B2 : virtual A { }; class B3 : virtual virtual A { }; // expected-error{{duplicate 'virtual' in base specifier}} class C : public B1, private B2 { }; class D; class E : public D { }; // expected-error{{base class has incomplete ty...
```c++ // RUN: clang -fsyntax-only -verify %s class A { }; class B1 : A { }; class B2 : virtual A { }; class B3 : virtual virtual A { }; // expected-error{{duplicate 'virtual' in base specifier}} class C : public B1, private B2 { }; class D; // expected-note {{forward declaration of 'class D'}} class E : public...
0d393f96-0f86-4e9e-a8a0-4496744e6f68
{ "language": "C++" }
```c++ void build(Solution &s) { auto &tgbot = s.addTarget<StaticLibraryTarget>("reo7sp.tgbot", "1.2.0"); { tgbot += Git("https://github.com/reo7sp/tgbot-cpp", "v{M}.{m}"); tgbot += cpp11; tgbot.Public += "org.sw.demo.boost.property_tree"_dep; tgbot.Public += "org.sw.demo.opens...
```c++ void build(Solution &s) { auto &tgbot = s.addTarget<StaticLibraryTarget>("reo7sp.tgbot", "1.2.0"); { tgbot += Git("https://github.com/reo7sp/tgbot-cpp", "v{M}.{m}"); tgbot += cpp11; tgbot.Public += "org.sw.demo.boost.property_tree"_dep; tgbot.Public += "org.sw.demo.opens...
df127648-7f29-47c0-810d-3ac89b9f9dd1
{ "language": "C++" }
```c++ #include "Log.h" #include <boost/date_time/posix_time/posix_time.hpp> Log * g_Log = nullptr; static const char * g_LogLevelStr[eNumLogLevels] = { "error", // eLogError "warn", // eLogWarning "info", // eLogInfo "debug" // eLogDebug }; void LogMsg::Process() { output << boost::posix_time::second_clock...
```c++ #include "Log.h" #include <boost/date_time/posix_time/posix_time.hpp> Log * g_Log = nullptr; static const char * g_LogLevelStr[eNumLogLevels] = { "error", // eLogError "warn", // eLogWarning "info", // eLogInfo "debug" // eLogDebug }; void LogMsg::Process() { output << boost::posix_time::second_clock...
42e8c264-1e4f-4b19-8662-cffdfb3e37ad
{ "language": "C++" }
```c++ /* * Copyright (c) Meta Platforms, Inc. and 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 ...
```c++ /* * Copyright (c) Meta Platforms, Inc. and 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 ...
e40f2270-5b8e-4c03-b847-cdb1bdaa9d62
{ "language": "C++" }
```c++ #include "../src/pugixml.hpp" #if PUGIXML_VERSION != 1120 #error Unexpected pugixml version #endif ``` Fix version check in test
```c++ #include "../src/pugixml.hpp" #if PUGIXML_VERSION != 1130 #error Unexpected pugixml version #endif ```
ee6118aa-b812-47ac-8c01-4bb262226596
{ "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) //==============================================...
b90946c6-8cd2-41f9-b399-d370cb4718f7
{ "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/system_monitor.h" namespace base { void SystemMonitor::ProcessWmPowerBroadcastMessage(int event_id) { PowerEvent po...
```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/system_monitor.h" namespace base { void SystemMonitor::ProcessWmPowerBroadcastMessage(int event_id) { PowerEvent po...
ab654ec6-f8d2-4372-996c-3336169e1e93
{ "language": "C++" }
```c++ #include <ShObjIdl.h> #include <atlbase.h> #include <wchar.h> int wmain(int argc, wchar_t* argv[]) { HRESULT hr = S_OK; if (argc < 2) { hr = E_INVALIDARG; wprintf(L"Supply an app ID (AppUserModelId) for the application to launch."); return hr; } const wchar_t* appId...
```c++ #include <ShObjIdl.h> #include <wchar.h> HRESULT CreateAAM(IApplicationActivationManager*& aam) { return CoCreateInstance(CLSID_ApplicationActivationManager, nullptr, CLSCTX_LOCAL_SERVER, IID_PPV_ARGS(&aam)); } HRESULT ActivateApp(IApplicationActivationManager* aam, const wchar_t* appId) { unsigned lon...
ad3457e4-8df0-4d9e-8f18-290dc05ee163
{ "language": "C++" }
```c++ // // Copyright 2012 Francisco Jerez // // 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 to use, copy, modify, merge, ...
```c++ // // Copyright 2012 Francisco Jerez // // 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 to use, copy, modify, merge, ...
586bc212-4ccc-475d-aacd-46b6a850fc90
{ "language": "C++" }
```c++ /* * Darwin SecRandomCopyBytes EntropySource * (C) 2015 Daniel Seither (Kullo GmbH) * * Botan is released under the Simplified BSD License (see license.txt) */ #include <botan/internal/darwin_secrandom.h> #include <Security/Security.h> #include <Security/SecRandom.h> namespace Botan { /** * Gather entropy fro...
```c++ /* * Darwin SecRandomCopyBytes EntropySource * (C) 2015 Daniel Seither (Kullo GmbH) * * Botan is released under the Simplified BSD License (see license.txt) */ #include <botan/internal/darwin_secrandom.h> #include <Security/Security.h> #include <Security/SecRandom.h> namespace Botan { /** * Gather entropy fro...
cd96d7c8-d1ec-4d03-a60e-7dc14fcf1ad6
{ "language": "C++" }
```c++ // Copyright (c) 2015 Klaralvdalens Datakonsult AB (KDAB). // All rights reserved. Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "debug.h" #include <QString> #include <QDebug> #include <iostream> std::ostream& operator<<(std::ostream& stream, co...
```c++ // Copyright (c) 2015 Klaralvdalens Datakonsult AB (KDAB). // All rights reserved. Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include "debug.h" #include <QString> #include <QDebug> #include <iostream> std::ostream& operator<<(std::ostream& stream, co...
cda60e67-c869-4073-8cd4-11eb3cd6cd7d
{ "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 "cameo/runtime/app/cameo_main_delegate.h" #include "content/public/app/content_main.h" #if defined(OS_WIN) #include "content/public/app/...
```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 "cameo/runtime/app/cameo_main_delegate.h" #include "content/public/app/content_main.h" #if defined(OS_WIN) #include "content/public/app/...
0359c6eb-3f30-4546-a10e-056267f267cf
{ "language": "C++" }
```c++ // Copyright 2016 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 "ozone/ui/desktop_aura/desktop_factory_ozone_wayland.h" #include "ozone/ui/desktop_aura/desktop_screen_wayland.h" #include "ozone/ui/desk...
```c++ // Copyright 2016 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 "ozone/ui/desktop_aura/desktop_factory_ozone_wayland.h" #include "ozone/ui/desktop_aura/desktop_screen_wayland.h" #include "ozone/ui/desk...
d7522fdd-e131-4a9d-861b-ea047dff3d19
{ "language": "C++" }
```c++ #include <QString> #include <QDir> #include <QtCore> #include <iostream> int main(int argc, char** argv) { //QCoreApplication app(argc, argv); QDir dir; dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); dir.setSorting(QDir::Size | QDir::Reversed); QString path = argv[1]; d...
```c++ #include <QString> #include <QDir> #include <QtCore> #include <iostream> int main(int argc, char** argv) { QCoreApplication app(argc, argv); QDir dir; dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); dir.setSorting(QDir::Size | QDir::Reversed); QString path = argv[1]; dir...
837ca749-0d6a-41ea-94b7-4af4ce714bfc
{ "language": "C++" }
```c++ #include <Ab/Config.hpp> #include <Ab/LinearMemory.hpp> #include <gtest/gtest.h> namespace Ab::Test { TEST(LinearMemoryTest, InitAndKill) { LinearMemory m; } TEST(LinearMemoryTest, GrowThreeTimes) { LinearMemory m; for (std::size_t i = 0; i < 3; i++) { m.grow(); } } TEST(LinearMemoryTest, AssignToMemory...
```c++ #include <Ab/Config.hpp> #include <Ab/LinearMemory.hpp> #include <gtest/gtest.h> namespace Ab::Test { TEST(LinearMemoryTest, InitAndKill) { LinearMemory m; } TEST(LinearMemoryTest, GrowThreeTimes) { LinearMemoryConfig cfg; cfg.page_count_min = 0; cfg.page_count_max = 3; LinearMemory m(cfg); for (std::si...
5d90959f-f394-42c6-9e0f-042fe358a63a
{ "language": "C++" }
```c++ #include "stdafx.h" #include "TimeUtilities.h" #include <time.h> namespace SDK { namespace Utilities { void SleepSeconds(ulong i_seconds) { clock_t now = clock(); clock_t limit = now + i_seconds * CLOCKS_PER_SEC; while ( limit > now ) now = clock(); } void SleepMiliseconds(ulong ...
```c++ #include "stdafx.h" #include "TimeUtilities.h" #include <time.h> #ifdef _WIN32 #include <windows.h> #else #include <unistd.h> #endif namespace SDK { namespace Utilities { void SleepSeconds(ulong i_seconds) { SleepMiliseconds(i_seconds*1000); } void SleepMiliseconds(ulong i_milise...
e1178383-9966-4c09-bc66-31ca8b6acc40
{ "language": "C++" }
```c++ //===- lib/ReaderWriter/ELF/AMDGPU/AMDGPURelocationHandler.cpp -----------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------...
```c++ //===- lib/ReaderWriter/ELF/AMDGPU/AMDGPURelocationHandler.cpp -----------===// // // The LLVM Linker // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------...
d26537ef-64c6-4afb-a871-4d15679ad7b5
{ "language": "C++" }
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "remoting/host/capturer.h" namespace remoting { Capturer::Capturer() : width_(0), height_(0), pixel_format_(PixelFor...
```c++ // Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "remoting/host/capturer.h" namespace remoting { Capturer::Capturer() : width_(0), height_(0), pixel_format_(PixelFor...
63b450b9-11d0-446b-a9ee-f51dd5c906a1
{ "language": "C++" }
```c++ #include "AbstractUniformImplementation.h" #include <globjects/globjects.h> #include "BindlessUniformImplementation.h" #include "LegacyUniformImplementation.h" namespace glo { AbstractUniformImplementation::AbstractUniformImplementation() { } AbstractUniformImplementation::~AbstractUniformImplementation() {...
```c++ #include "AbstractUniformImplementation.h" #include <globjects/globjects.h> #include "BindlessUniformImplementation.h" #include "LegacyUniformImplementation.h" namespace glo { AbstractUniformImplementation::AbstractUniformImplementation() { } AbstractUniformImplementation::~AbstractUniformImplementation() {...
6a1c7a17-fa2f-4912-9972-587a13398282
{ "language": "C++" }
```c++ #include "hackypassabilityagent.h" #include <QQuickItem> #include <QQuickWindow> #include "quickentity.h" #include "utils.h" HackyPassabilityAgent::HackyPassabilityAgent() : mGridItem(nullptr) { } bool HackyPassabilityAgent::isPassable(const QPointF &pos, AbstractEntity *entity) { if (!mGridItem) ...
```c++ #include "hackypassabilityagent.h" #include <QQuickItem> #include <QQuickWindow> #include "quickentity.h" #include "utils.h" HackyPassabilityAgent::HackyPassabilityAgent() : mGridItem(nullptr) { } bool HackyPassabilityAgent::isPassable(const QPointF &pos, AbstractEntity *entity) { if (!mGridItem) ...
297456c8-4ebe-421d-b878-21c1e76cfa95
{ "language": "C++" }
```c++ #include "Client.hh" #include <string> #include "Socket.hh" #include "http/Response.hh" #include "http/Request.hh" #include "methods/Get.hh" #include "Config.hh" ss::Client::Client(Socket* socket) : socket(socket) { auto request = get_request(); http::Response response; response.headers["protocol"] = "HTTP/...
```c++ #include "Client.hh" #include <string> #include "Socket.hh" #include "http/Response.hh" #include "http/Request.hh" #include "methods/Get.hh" #include "Config.hh" ss::Client::Client(Socket* socket) : socket(socket) { auto request = get_request(); http::Response response; response.headers["protocol"] = "HTTP/...
dec02eee-3913-481e-b832-51f20e230826
{ "language": "C++" }
```c++ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied war...
```c++ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied war...
b9320868-7ad7-49b7-8f21-ab3e01b6b6ae
{ "language": "C++" }
```c++ #include <iostream> //Thomas' Prototypes //Hannah's Prototypes int atomic_distance (int distance); //Kate's Prototype: defines atomic distance as integer int (main) { using nedit file... create new input "hannah's test changes" } ``` Update to Kate's First Function Prototype
```c++ #include <iostream> //Thomas' Prototypes //Hannah's Prototypes int atomic_distance (int x, int y, int z); //Kate's Prototype: defines atomic distance as combination of x, y, z coordinates int (main) { using nedit file... create new input "hannah's test changes" } ```
09b03c4e-aed8-4ece-99db-7051f635f997
{ "language": "C++" }
```c++ // Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/native_library.h" #include <dlfcn.h> #include "base/file_path.h" #include "base/logging.h" namespace base { // static Native...
```c++ // Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/native_library.h" #include <dlfcn.h> #include "base/file_path.h" #include "base/logging.h" namespace base { // static Native...
306d4feb-356a-45be-ae10-b8e6a2c40828
{ "language": "C++" }
```c++ #include "KAI/Console/Console.h" #include <iostream> #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include <Windows.h> #endif using namespace std; USING_NAMESPACE_KAI //static Color _color; int main(int argc, char **argv) { KAI_UNUSED_2(argc, argv); cout << "pyro v0.1" << endl; Console console; console....
```c++ #include <KAI/Console/Console.h> #include <iostream> using namespace std; USING_NAMESPACE_KAI int main(int argc, char **argv) { KAI_UNUSED_2(argc, argv); cout << "KAI v0.1" << endl; Console console; console.SetLanguage(Language::Pi); // the higher the number, the greater the verbosity of debug output ...
213a0c98-496d-45de-9d8d-c045956ae0c9
{ "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/Models/Enchantment.hpp> #include <Ros...
```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/Models/Enchantment.hpp> #include <Ros...
fcb2bfc1-82eb-470b-9a2f-ff07ac4eee51
{ "language": "C++" }
```c++ #include <boost/log/trivial.hpp> #include <boost/program_options.hpp> #include <dsnutil/log/init.h> namespace po = boost::program_options; int main(int argc, char** argv) { dsn::log::init(); try { po::options_description descr; descr.add_options()("help,?", "Display list of valid argu...
```c++ #include <iostream> #include <boost/log/trivial.hpp> #include <boost/program_options.hpp> #include <dsnutil/log/init.h> #include <build-bot/bot.h> namespace po = boost::program_options; int main(int argc, char** argv) { dsn::log::init(); std::string configFile; try { po::options_descript...