doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
0eeadca5-50dd-4bf6-b7f1-9016b91cc595
{ "language": "C++" }
```c++ #include <stdio.h> #include <Logging.h> #include <ZipFile.h> int main() { v::Log::Level = v::Log::LogLevel_Trace; v::Log::Debug("Creating zip file"); { v::ZipFile zip; zip.Read("meow.zip"); s::StackArray<v::ZipEntry> entries; zip.GetEntries(entries); for (auto &entry : entries) { v::Log::De...
```c++ #include <stdio.h> #include <Logging.h> #include <ZipFile.h> int main() { v::Log::Level = v::Log::LogLevel_Trace; v::Log::Debug("Reading zip file test.zip"); try { v::ZipFile zip; zip.Read("test.zip"); s::StackArray<v::ZipEntry> entries; zip.GetEntries(entries); for (auto &entry : entries) { ...
af2e84ac-1838-40f7-af8e-3140d7a673f5
{ "language": "C++" }
```c++ /* This file is part of python_mapnik (c++/python mapping toolkit) * Copyright (C) 2005 Artem Pavlenko, Jean-Francois Doyon * * Mapnik 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...
```c++ /* This file is part of python_mapnik (c++/python mapping toolkit) * Copyright (C) 2005 Artem Pavlenko, Jean-Francois Doyon * * Mapnik 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...
1c74c066-3deb-4902-80a9-1aa3fb415dd5
{ "language": "C++" }
```c++ // Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved. // Please see the AUTHORS file for details. Use of this source code is governed // by a BSD license that can be found in the LICENSE file. #include "allocators/page_heap.h" #include "common.h" #include "log.h" #include "system-allo...
```c++ // Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved. // Please see the AUTHORS file for details. Use of this source code is governed // by a BSD license that can be found in the LICENSE file. #include "allocators/page_heap.h" #include "common.h" #include "log.h" #include "system-allo...
067b050a-fd4d-4b15-9fc5-2962cfb7d066
{ "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. // //===------------------------------------------------...
c819774d-a44c-4eeb-9e4e-4b07bd5ea8c1
{ "language": "C++" }
```c++ // RUN: rm -rf %t // RUN: %clang_cc1 -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/submodules %s -verify __import_module__ std.vector; __import_module__ std.typetraits; // expected-error{{no submodule named 'typetraits' in module 'std'; did you mean 'type_traits'?}} __import_module__ std.vector.compa...
```c++ // RUN: rm -rf %t // RUN: %clang_cc1 -Eonly -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/submodules %s -verify // RUN: %clang_cc1 -fmodule-cache-path %t -fauto-module-import -I %S/Inputs/submodules %s -verify __import_module__ std.vector; __import_module__ std.typetraits; // expected-error{{no submo...
20c65fd2-9440-4c99-bc5b-3d14d0f1718f
{ "language": "C++" }
```c++ #include <QGuiApplication> #include <QQmlApplicationEngine> #include <QQmlContext> #include "applications.h" #include "iconprovider.h" #include "process.h" /** * @todo: Config file in ~/.config/qmldmenu/ * @todo: SHIFT(ENTER) for sudo * @todo: TAB For command (term /{usr}/bin/) / app (.desktop) mode */ int ...
```c++ #include <QGuiApplication> #include <QQmlApplicationEngine> #include <QQmlContext> #include <QtQml> #include "applications.h" #include "iconprovider.h" #include "process.h" /** * @todo: Config file in ~/.config/qmldmenu/ * @todo: SHIFT(ENTER) for sudo * @todo: TAB For command (term /{usr}/bin/) / app (.deskt...
e93e9489-9e9c-4c3e-9e2a-3dc99f665a36
{ "language": "C++" }
```c++ /** @file main.cpp * @brief Главный файл сервера репозитория * */ #include <QCoreApplication> #include <QTextCodec> #include "server.h" int main(int argc, char *argv[]) { QTextCodec *codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForCStrings(codec); QCoreApplication app(argc, argv); in...
```c++ /** @file main.cpp * @brief Главный файл сервера репозитория * */ #include <QCoreApplication> #include <QTextCodec> #include <QFile> #include "server.h" int main(int argc, char *argv[]) { QTextCodec *codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForCStrings(codec); QCoreApplication app(...
1dbc97e0-845e-478c-9eb8-e6939df1fb72
{ "language": "C++" }
```c++ #include <QGuiApplication> #include <QQuickView> #include "sailfishapplication.h" Q_DECL_EXPORT int main(int argc, char *argv[]) { QScopedPointer<QGuiApplication> app(Sailfish::createApplication(argc, argv)); QScopedPointer<QQuickView> view(Sailfish::createView("main.qml")); Sailfish::showVie...
```c++ #include <QGuiApplication> #include <QQuickView> #include <QQmlContext> #include "sailfishapplication.h" #include "servercomm.h" Q_DECL_EXPORT int main(int argc, char *argv[]) { QScopedPointer<QGuiApplication> app(Sailfish::createApplication(argc, argv)); QScopedPointer<QQuickView> view(Sailfish::crea...
b681f9a8-0f22-4459-ac45-209f07274fb7
{ "language": "C++" }
```c++ //===-- llvm/CodeGen/GlobalISel/EmptyFile.cpp ------ EmptyFile ---*- C++ -*-==// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- llvm/CodeGen/GlobalISel/EmptyFile.cpp ------ EmptyFile ---*- C++ -*-==// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
e206e993-0745-4fc8-9031-cd19caced19a
{ "language": "C++" }
```c++ #include "OptionsManager.h" #include <fstream> #include <iostream> #include <boost/filesystem.hpp> #include <spotify/json.hpp> #include "codecs/OptionsCodec.h" #include "logging/Logging.h" OptionsManager::OptionsManager(std::string optionsFilename) { loadOptions(optionsFilename); } void OptionsManager:...
```c++ #include "OptionsManager.h" #include <fstream> #include <iostream> #include <boost/filesystem.hpp> #include <spotify/json.hpp> #include "codecs/OptionsCodec.h" #include "logging/Logging.h" OptionsManager::OptionsManager(std::string optionsFilename) { loadOptions(optionsFilename); } void OptionsManager:...
a6a13195-bb7d-4491-a8f1-9e94e3e99e96
{ "language": "C++" }
```c++ // Copyright eeGeo Ltd (2012-2015), All Rights Reserved #include "WatermarkDataFactory.h" namespace ExampleApp { namespace Watermark { namespace View { WatermarkDataFactory::WatermarkDataFactory(const std::string& appName, ...
```c++ // Copyright eeGeo Ltd (2012-2015), All Rights Reserved #include "WatermarkDataFactory.h" namespace ExampleApp { namespace Watermark { namespace View { WatermarkDataFactory::WatermarkDataFactory(const std::string& appName, ...
427a5506-7637-4515-83d4-639b070823b8
{ "language": "C++" }
```c++ #include "catch.hpp" #include "matrix.h" TEST_CASE( "Test matrix", "[matrix]" ) { matrix<int> m0; REQUIRE( m0.rows() == 0 ); REQUIRE( m0.columns() == 0 ); matrix<int> m3_4(3,4); REQUIRE( m3_4.rows() == 3 ); REQUIRE( m3_4.columns() == 4 ); matrix<int> m_init_2 = {}; REQUIRE( m_init_2.rows() == ...
```c++ #include "catch.hpp" #include "matrix.h" TEST_CASE( "Test default constructor", "[matrix][constructors]" ) { matrix<int> m0; REQUIRE( m0.rows() == 0 ); REQUIRE( m0.columns() == 0 ); } TEST_CASE( "Test size constructor", "[matrix][constructors]" ) { matrix<int> m3_4(3,4); REQUIRE( m3_4.rows() == 3 ); ...
239e18a6-bccf-4571-a8ef-d0e4e6819039
{ "language": "C++" }
```c++ #include <stdlib.h> #include <v8.h> #include <nan.h> #include <node.h> using namespace node; using namespace v8; extern "C" void init (Handle<Object>); NAN_METHOD(Random) { NanScope(); NanReturnValue(NanNew<Number>(rand()/((double)RAND_MAX + 1))); } NAN_METHOD(Rand) { NanScope(); NanReturnValue(NanN...
```c++ #include <stdlib.h> #include <v8.h> #include <nan.h> #include <node.h> #include <cstdlib> using namespace node; using namespace v8; extern "C" void init (Handle<Object>); NAN_METHOD(Random) { NanScope(); NanReturnValue(NanNew<Number>(rand()/((double)RAND_MAX + 1))); } NAN_METHOD(Rand) { NanScope(); ...
f58d34da-8ba6-4f5d-a3cf-42d5d00f2e69
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -fsyntax-only -verify %s #define NODEREF __attribute__((noderef)) void Func() { int NODEREF i; // expected-warning{{'noderef' can only be used on an array or pointer type}} int NODEREF *i_ptr; // There should be no difference whether a macro defined type is used or not. auto __attri...
```c++ // RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-linux-gnu %s #define NODEREF __attribute__((noderef)) void Func() { int NODEREF i; // expected-warning{{'noderef' can only be used on an array or pointer type}} int NODEREF *i_ptr; // There should be no difference whether a macro defined type is us...
ceeb6243-991c-407b-b99d-6350fb594482
{ "language": "C++" }
```c++ /** * \file register_loader_saver_lcp.cpp * Defines IO for a GCSA LCPArray from stream files. */ #include <vg/io/registry.hpp> #include <gcsa/gcsa.h> #include <gcsa/algorithms.h> namespace vg { namespace io { using namespace std; using namespace vg::io; void register_loader_saver_lcp() { Registry::r...
```c++ /** * \file register_loader_saver_lcp.cpp * Defines IO for a GCSA LCPArray from stream files. */ #include <vg/io/registry.hpp> #include <gcsa/gcsa.h> #include <gcsa/algorithms.h> namespace vg { namespace io { using namespace std; using namespace vg::io; void register_loader_saver_lcp() { std::uint32...
90194735-1564-40f5-ae4a-96a2707c9c04
{ "language": "C++" }
```c++ /* * Copyright 2019 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contri...
```c++ /* * Copyright 2019 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contri...
7c76897d-2f20-4236-a226-5310e6372927
{ "language": "C++" }
```c++ #include "junior-simple.h" #include <vector> namespace junior { std::vector<window> windows; window& create_window(const wchar_t* title) { windows.push_back(window(title)); return windows.back(); } inline window& main_window() { return windows.front(); } void draw_line(con...
```c++ #include "junior-simple.h" #include <vector> #include <Windows.h> namespace junior { std::vector<window> windows; window& create_window(const wchar_t* title) { ShowWindow(GetConsoleWindow(), SW_HIDE); windows.push_back(window(title)); return windows.back(); } inline window& main_...
5e9accb6-e878-41a1-8ab1-078581674178
{ "language": "C++" }
```c++ // This code is based on Sabberstone project. // Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva // Hearthstone++ is hearthstone simulator using C++ with reinforcement learning. // Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon #include <Rosetta/Actions/Targeting.hpp> #include <Ros...
```c++ // This code is based on Sabberstone project. // Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva // Hearthstone++ is hearthstone simulator using C++ with reinforcement learning. // Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon #include <Rosetta/Actions/Targeting.hpp> #include <Ros...
5ddbe7dc-4dea-4004-849d-f8881221a4e4
{ "language": "C++" }
```c++ class Solution { public: int removeDuplicates(vector<int>& nums) { if(nums.size()==0) return 0; for(int i=0;i<nums.size()-1;i++){ int j=i+1; while(nums[j]==nums[i] && j<nums.size()){ j++; } nums.erase(nums.begin()+i+1,nums.begin(...
```c++ class Solution { public: int removeDuplicates(vector<int>& nums) { if(nums.size()==0) return 0; for(int i=0;i<nums.size()-1;i++){ int j=i+1; while(nums[j]==nums[i] && j<nums.size()){ j++; } nums.erase(nums.begin()+i+1,nums.begin(...
b28ec07d-8eba-4740-9de4-9b8336c5adb7
{ "language": "C++" }
```c++ // main.cpp // This file is part of the EScript programming language. // See copyright notice in EScript.h // ------------------------------------------------------ #ifdef ES_BUILD_APPLICATION #include <cstdlib> #include <iostream> #include <string> #include "../EScript/EScript.h" using namespace EScript; int...
```c++ // main.cpp // This file is part of the EScript programming language. // See copyright notice in EScript.h // ------------------------------------------------------ #ifdef ES_BUILD_APPLICATION #include <cstdlib> #include <iostream> #include <string> #include <utility> #include "../EScript/EScript.h" int main(i...
af5caa52-b80c-48b8-94e3-d4ea2a40ec81
{ "language": "C++" }
```c++ #include <pthread.h> #include <stdlib.h> #include <stdio.h> void *Thread1(void *p) { *(int*)p = 42; return 0; } void *Thread2(void *p) { *(int*)p = 44;; return 0; } void *alloc() { return malloc(99); } void *AllocThread(void*) { return alloc(); } int main() { void *p = 0; pthread_t t[2]; p...
```c++ #include <pthread.h> #include <stdlib.h> #include <stdio.h> void *Thread1(void *p) { *(int*)p = 42; return 0; } void *Thread2(void *p) { *(int*)p = 44; return 0; } void *alloc() { return malloc(99); } void *AllocThread(void* arg) { return alloc(); } int main() { void *p = 0; pthread_t t[2]; ...
524d0653-4186-4301-8a85-299caea48e9a
{ "language": "C++" }
```c++ /* * (C) 2016 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ #include "tests.h" #if defined(BOTAN_HAS_PUBLIC_KEY_CRYPTO) #include <botan/workfactor.h> #endif namespace Botan_Tests { class PK_Workfactor_Tests : public Text_Based_Test { public: PK_Workfacto...
```c++ /* * (C) 2016 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ #include "tests.h" #if defined(BOTAN_HAS_PUBLIC_KEY_CRYPTO) #include <botan/workfactor.h> #endif namespace Botan_Tests { #if defined(BOTAN_HAS_PUBLIC_KEY_CRYPTO) class PK_Workfactor_Tests : public Text_Base...
5ea71824-c75b-40b2-91e1-3f6a8653daac
{ "language": "C++" }
```c++ #include "various.hpp" #include <fstream> #include <iostream> #include <memory> std::string utils::slurp_file(std::string const& path) { std::ifstream file = std::ifstream(path); if (!file.is_open()) { std::cerr << "Failed to open \"" << path << "\"" << std::endl; return std::string(""); } fi...
```c++ #include "various.hpp" #include "core/Log.h" #include <fstream> #include <iostream> #include <memory> std::string utils::slurp_file(std::string const& path) { std::ifstream file = std::ifstream(path); if (!file.is_open()) { LogError("Failed to open \"%s\"", path.c_str()); return std::string(""); ...
98b5910c-bd3a-4204-b91f-d8412a7d14f7
{ "language": "C++" }
```c++ // // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // Error.cpp: Implements the gl::Error class which encapsulates an OpenGL error // and optional error message. #include "libGLESv2/...
```c++ // // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // Error.cpp: Implements the gl::Error class which encapsulates an OpenGL error // and optional error message. #include "libGLESv2/...
14dd2704-2375-40a9-81db-9dff21d55a25
{ "language": "C++" }
```c++ #include "catch.hpp" #include "libx6adc.h" TEST_CASE("board present", "[get_num_devices]"){ SECTION("at least one board present"){ unsigned numDevices; get_num_devices(&numDevices); REQUIRE( numDevices >= 1); } } TEST_CASE("board temperature is sane", "[get_logic_temperature]"){ connect_x6(0); S...
```c++ #include "catch.hpp" #include "libx6adc.h" TEST_CASE("board present", "[get_num_devices]"){ SECTION("at least one board present"){ unsigned numDevices; get_num_devices(&numDevices); REQUIRE( numDevices >= 1); } } TEST_CASE("board temperature is sane", "[get_logic_temperature]"){ connect_x6(0); S...
28c9018a-2f04-4e4d-8bff-acd62810bffc
{ "language": "C++" }
```c++ // https://github.com/KubaO/stackoverflown/tree/master/questions/lineedit-frame-37831979 #include <QtWidgets> #include <QtUiTools> const char ui[] = R"EOF( <ui version="4.0"> <class>Form</class> <widget class="QWidget" name="Form"> <layout class="QFormLayout" name="formLayout"> <item row="0" column=...
```c++ // https://github.com/KubaO/stackoverflown/tree/master/questions/lineedit-frame-37831979 #include <QtWidgets> #include <QtUiTools> const char ui[] = R"EOF( <ui version="4.0"> <class>Form</class> <widget class="QWidget" name="Form"> <layout class="QFormLayout" name="formLayout"> <item row="0" column=...
fb695f4e-7b09-4375-9eb4-2f85f50fde21
{ "language": "C++" }
```c++ #include "./labels.h" #include <vector> std::function<void()> Labels::subscribe(std::function<void(const Label &)> subscriber) { int erasePosition = subscribers.size(); subscribers.push_back(subscriber); return [this, erasePosition]() { subscribers.erase(subscribers.begin() + erasePosition); }; }...
```c++ #include "./labels.h" #include <vector> std::function<void()> Labels::subscribe(std::function<void(const Label &)> subscriber) { int erasePosition = subscribers.size(); subscribers.push_back(subscriber); return [this, erasePosition]() { subscribers.erase(subscribers.begin() + erasePosition); }; }...
a5a9d2e6-3d0a-43f3-ac74-5640e0cca776
{ "language": "C++" }
```c++ // Intercept the implicit 'this' argument of class member functions. // // RUN: %clangxx_xray -g -std=c++11 %s -o %t // RUN: rm log-args-this-* || true // RUN: XRAY_OPTIONS="patch_premain=true verbosity=1 xray_logfile_base=log-args-this-" %run %t // // XFAIL: freebsd || arm || aarch64 || mips // UNSUPPORTED: pow...
```c++ // Intercept the implicit 'this' argument of class member functions. // // RUN: %clangxx_xray -g -std=c++11 %s -o %t // RUN: rm log-args-this-* || true // RUN: XRAY_OPTIONS="patch_premain=true verbosity=1 xray_logfile_base=log-args-this-" %run %t // // XFAIL: FreeBSD || arm || aarch64 || mips // UNSUPPORTED: pow...
037880d3-772b-4e32-a1e8-6b47e10aea15
{ "language": "C++" }
```c++ /* * openvrupdateslavecallback.cpp * * Created on: Dec 18, 2015 * Author: Chris Denham */ #include "openvrupdateslavecallback.h" void OpenVRUpdateSlaveCallback::updateSlave(osg::View& view, osg::View::Slave& slave) { if (m_cameraType == LEFT_CAMERA) { m_device->updatePose(); } osg::Vec3 posit...
```c++ /* * openvrupdateslavecallback.cpp * * Created on: Dec 18, 2015 * Author: Chris Denham */ #include "openvrupdateslavecallback.h" void OpenVRUpdateSlaveCallback::updateSlave(osg::View& view, osg::View::Slave& slave) { if (m_cameraType == LEFT_CAMERA) { m_device->updatePose(); } osg::Vec3 posit...
143c18f3-786d-4b4a-99e6-45702885ac42
{ "language": "C++" }
```c++ /Od /I "P:\PROJEKTE\GERTICO\Win32VC80\ACE+TAO-5.6.5" /I "C:\FHG\GERTICO" /I "..\..\..\..\LevelTwo\common\include" /I "..\..\..\..\LevelCommonIEEE\include" /I "..\..\..\..\LevelCommonIEEE\include\RTI_1516" /I "..\..\..\..\LevelTwo\phase_III" /D "_WIN32_" /D "WIN32" /D "_UT_DEBUG" /D "_NDEBUG" /D "_CONS...
```c++ /Od /I "P:\PROJEKTE\GERTICO\Win32VC80\ACE+TAO-5.6.5" /I "C:\FHG\GERTICO" /I "..\..\..\..\LevelTwo\common\include" /I "..\..\..\..\LevelCommonIEEE\include" /I "..\..\..\..\LevelCommonIEEE\include\RTI_1516" /I "..\..\..\..\LevelTwo\phase_III" /D "_WIN32_" /D "WIN32" /D "_UT_DEBUG" /D "_NDEBUG" /D "_CONS...
a2e1dbf0-d7ef-40ad-bdda-d5109ca8a14d
{ "language": "C++" }
```c++ // Copyright (c) 2008-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/history/history_publisher.h" #include "base/utf_string_conversions.h" namespace history { const char* const Hi...
```c++ // Copyright (c) 2008-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/history/history_publisher.h" #include "base/utf_string_conversions.h" namespace history { const char* const Hi...
529c102b-51c4-4367-8827-dd7f98660f3c
{ "language": "C++" }
```c++ // Copyright (c) 2013 GitHub, Inc. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ATOM_BROWSER_API_ATOM_API_RECORDED_OBJECT_ #define ATOM_BROWSER_API_ATOM_API_RECORDED_OBJECT_ #include "browser/api/atom_api_recorded_object.h"...
```c++ // Copyright (c) 2013 GitHub, Inc. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ATOM_BROWSER_API_ATOM_API_RECORDED_OBJECT_ #define ATOM_BROWSER_API_ATOM_API_RECORDED_OBJECT_ #include "browser/api/atom_api_recorded_object.h"...
3885f11b-766b-4953-9f11-aa459d1c8df7
{ "language": "C++" }
```c++ #include <iostream> #include <string> #include <memory> #include <Lexer.hpp> #include <Parser.hpp> #include <Visitors.hpp> int main() { std::string input_line; double ans = 0; std::cout << "miniMAT: It's like MATLAB, but smaller." << std::endl; std::cout << "Copyright (C) 2014 Federico Menoz...
```c++ #include <iostream> #include <string> #include <memory> #include <Lexer.hpp> #include <Parser.hpp> #include <Visitors.hpp> int main() { std::string input_line; double ans = 0; std::cout << "miniMAT: It's like MATLAB, but smaller." << std::endl; std::cout << "Copyright (C) 2014 Federico Menoz...
5a72f9bd-0530-4cb9-88a0-5bbb8c0b81c8
{ "language": "C++" }
```c++ // RUN: rm -rf %t // RUN: %clang_cc1 -I%S/Inputs/PR21547 -verify %s // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I%S/Inputs/PR21547 -verify %s #include "Inputs/PR21547/FirstHeader.h" //expected-no-diagnostics ``` Add -emit-llvm-only to the regression test for PR21547.
```c++ // RUN: rm -rf %t // RUN: %clang_cc1 -I%S/Inputs/PR21547 -verify %s // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I%S/Inputs/PR21547 -verify %s // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I%S/Inputs/PR21547 -emit-llvm-only %s #include "Inputs/PR215...
814c2216-89f3-406f-8fa9-3508fd6987f3
{ "language": "C++" }
```c++ // Copyright (c) 2014 Andrew Toulouse. // Distributed under the MIT License. #include <iostream> #include <fstream> #include <libOL/File.h> int main(int argc, const char * argv[]) { std::ifstream ifs("/Users/toulouse/code/lol/lmao/rofl/22923174.rofl", std::ios::binary); libol::File file = libol::Fil...
```c++ // Copyright (c) 2014 Andrew Toulouse. // Distributed under the MIT License. #include <iostream> #include <fstream> #include <libOL/File.h> #include <libOL/Chunks.h> int main(int argc, const char * argv[]) { std::ifstream ifs("/Users/toulouse/code/lol/lmao/rofl/22923174.rofl", std::ios::binary); lib...
01186391-d524-4332-aae5-171827b44df3
{ "language": "C++" }
```c++ #define CAF_TEST_NO_MAIN #include <caf/test/unit_test_impl.hpp> #include "vast/announce.h" int main(int argc, char** argv) { vast::announce_types(); return caf::test::main(argc, argv); } ``` Increase low default ulimit -n of 256 on Mac OS
```c++ #define CAF_TEST_NO_MAIN #include <caf/test/unit_test_impl.hpp> #include "vast/announce.h" #include "vast/config.h" #ifdef VAST_MACOS #include <sys/resource.h> // setrlimit #endif namespace { bool adjust_resource_limits() { #ifdef VAST_MACOS auto rl = ::rlimit{4096, 8192}; auto result = ::setrlimit(RLIMI...
4b481e74-b7a3-4e3b-9b38-8bb997766233
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -fsyntax-only -verify %s // RUN: cp %s %t // RUN: %clang_cc1 -fixit -x c++ %t // RUN: FileCheck -input-file=%t %s void f(int a[10][20]) { // CHECK: delete[] a; delete a; // expected-warning {{'delete' applied to a pointer-to-array type}} } ``` Fix a test case where FileCheck is used to t...
```c++ // RUN: %clang_cc1 -fsyntax-only -verify %s // RUN: cp %s %t // RUN: %clang_cc1 -fixit -x c++ %t // RUN: %clang_cc1 -E -o - %t | FileCheck %s void f(int a[10][20]) { // CHECK: delete[] a; delete a; // expected-warning {{'delete' applied to a pointer-to-array type}} } ```
50ce89f7-0bd8-40f7-8023-9dd7d8fc4db2
{ "language": "C++" }
```c++ // REQUIRES: x86-64-registered-target // RUN: %clang -cc1 -triple x86_64-apple-darwin10 -g -fno-limit-debug-info -S %s -o %t // RUN: FileCheck %s < %t //CHECK: .asciz "G" //CHECK-NEXT: .long 0 //CHECK-NEXT: Lpubtypes_end1: class G { public: void foo(); }; void G::foo() { } ``` Update test fo...
```c++ // REQUIRES: x86-64-registered-target // RUN: %clang -cc1 -triple x86_64-apple-darwin10 -g -fno-limit-debug-info -S %s -o %t // RUN: FileCheck %s < %t // FIXME: This testcase shouldn't rely on assembly emission. //CHECK: Lpubtypes_begin1: //CHECK: .asciz "G" //CHECK-NEXT: .long 0 //CHECK-NEXT: L...
d69e51a9-0736-4133-bc3a-076a83418625
{ "language": "C++" }
```c++ #include <string.h> #include <stdlib.h> #include <stdio.h> #include <3ds.h> #include "constants.h" #include "patches.h" #define log(...) fprintf(stderr, __VA_ARGS__) int main(int argc, char** argv) { gfxInitDefault(); consoleInit(GFX_TOP, NULL); GetVersionConstants(); PatchSrvAccess(); svcBackdoo...
```c++ #include <string.h> #include <stdlib.h> #include <stdio.h> #include <3ds.h> #include "constants.h" #include "patches.h" #define log(...) fprintf(stderr, __VA_ARGS__) int main(int argc, char** argv) { gfxInitDefault(); consoleInit(GFX_TOP, NULL); GetVersionConstants(); PatchSrvAccess(); // ONLY UNCOMM...
1ce2044a-cfd7-41bb-a171-76cfba94d37e
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -std=c++11 -verify %s // rdar://12240916 stack overflow. namespace rdar12240916 { struct S2 { S2(const S2&); S2(); }; struct S { // expected-note {{not complete}} S x; // expected-error {{incomplete type}} S2 y; }; S foo() { S s; return s; } struct S3; // expected-note {{forwa...
```c++ // RUN: %clang_cc1 -std=c++11 -verify %s // rdar://12240916 stack overflow. namespace rdar12240916 { struct S2 { S2(const S2&); S2(); }; struct S { // expected-note {{not complete}} S x; // expected-error {{incomplete type}} S2 y; }; S foo() { S s; return s; } struct S3; // expected-note {{forwa...
09d050e4-5a6f-44ad-978a-17cd04f8e8cf
{ "language": "C++" }
```c++ /* * Copyright (C) 2017 Incognito * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or a...
```c++ /* * Copyright (C) 2017 Incognito * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or a...
04f1a395-3e22-44f2-8caa-bc7cc87c8d2f
{ "language": "C++" }
```c++ // Regression test for http://llvm.org/bugs/show_bug.cgi?id=21621 // This test relies on timing between threads, so any failures will be flaky. // RUN: LSAN_BASE="use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -std=c++11 -o %t // RUN: %run %t #include <thread> #include <chrono> void func() { std::...
```c++ // Regression test for http://llvm.org/bugs/show_bug.cgi?id=21621 // This test relies on timing between threads, so any failures will be flaky. // RUN: LSAN_BASE="use_stacks=0:use_registers=0" // RUN: %clangxx_lsan %s -o %t // RUN: %run %t #include <assert.h> #include <pthread.h> #include <stdlib.h> #include <un...
ffa1c257-38f1-44de-ab62-c4f6d0b527b5
{ "language": "C++" }
```c++ /// \file main.cpp #include "HelloTriangleApplication.hpp" #include "VDeleter.hpp" // waf-generated header #include "config.hpp" #define DOCTEST_CONFIG_IMPLEMENT #include "doctest.h" #define GLFW_INCLUDE_VULKAN #include <GLFW/glfw3.h> #include <iostream> #include <string> int main(int argc, char* argv[]...
```c++ /// \file main.cpp #include "HelloTriangleApplication.hpp" #include "VDeleter.hpp" // waf-generated header #include "config.hpp" #define DOCTEST_CONFIG_IMPLEMENT #include "doctest.h" #define GLFW_INCLUDE_VULKAN #include <GLFW/glfw3.h> #include <iostream> #include <string> int main(int argc, char* argv[]...
b18d9cf8-bd37-4b79-825c-28f6a9712d89
{ "language": "C++" }
```c++ #include "ReQL-test.hpp" #include "catch.h" using namespace ReQL; TEST_CASE("Connection", "[c++][connect]") { Connection conn = connect(); REQUIRE(conn.isOpen()); } TEST_CASE("Expr", "[c][expr]") { SECTION("string") { _ReQL_Op_t string; const uint32_t size = 12; uint8_t buf[size] = "Hell...
```c++ #include "ReQL-test.hpp" #include "catch.h" #include <limits> using namespace ReQL; TEST_CASE("Connection", "[c++][connect]") { Connection conn = connect(); REQUIRE(conn.isOpen()); } TEST_CASE("Expr", "[c][expr]") { SECTION("number") { _ReQL_Op_t num; const double val = 42.0; _reql_numb...
baa6b327-4121-48a0-afa9-b097cb13ecd3
{ "language": "C++" }
```c++ #include <cppunit/BriefTestProgressListener.h> #include <cppunit/CompilerOutputter.h> #include <cppunit/extensions/TestFactoryRegistry.h> #include <cppunit/TestResult.h> #include <cppunit/TestResultCollector.h> #include <cppunit/TestRunner.h> #include "Suite.h" #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 #define...
```c++ #include <cppunit/BriefTestProgressListener.h> #include <cppunit/CompilerOutputter.h> #include <cppunit/extensions/TestFactoryRegistry.h> #include <cppunit/TestResult.h> #include <cppunit/TestResultCollector.h> #include <cppunit/TestRunner.h> #include "Suite.h" #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 #define...
ee14b72d-6581-4795-b45e-8adf4d608c39
{ "language": "C++" }
```c++ // // main.cpp // MacGPusher // // Created by Nyxouf on 6/23/13. // Copyright (c) 2013 MacGeneration. All rights reserved. // #include "global.hpp" #include "MMGAPNSConnection.hpp" #include "MMGDevice.hpp" #include "MMGPayload.hpp" int main(int argc, const char* argv[]) { // Create a device object const...
```c++ // // main.cpp // MacGPusher // // Created by Nyx0uf on 6/23/13. // Copyright (c) 2013 MacGeneration. All rights reserved. // #include "global.hpp" #include "MMGAPNSConnection.hpp" #include "MMGDevice.hpp" #include "MMGPayload.hpp" int main(int argc, const char* argv[]) { // Create a device object const...
05ff9bd2-c9a9-4257-992e-ecad01d39849
{ "language": "C++" }
```c++ // Copyright (C) 2017 Elviss Strazdins // This file is part of the Ouzel engine. #ifdef _WIN32 #define NOMINMAX #include <winsock2.h> #else #include <sys/socket.h> #include <netinet/in.h> #include <poll.h> #endif #include "Network.hpp" #include "utils/Log.hpp" namespace ouzel { namespace network { ...
```c++ // Copyright (C) 2017 Elviss Strazdins // This file is part of the Ouzel engine. #ifdef _WIN32 #define NOMINMAX #include <winsock2.h> #else #include <sys/socket.h> #include <netinet/in.h> #include <poll.h> #endif #include "Network.hpp" #include "utils/Log.hpp" namespace ouzel { namespace network { ...
0c8a44f8-6a94-433c-b60d-7dcb5644518a
{ "language": "C++" }
```c++ #include "Database.h" #include <iostream> #include <sqlite3.h> #include <string> #include <vector> using namespace std; Database::Database(string filename) { char filenameCharArray[100]; strcpy(filenameCharArray, filename.c_str()); sqlite3_open(filenameCharArray, &db); } Database::~Database() { sqlite3...
```c++ #include "Database.h" #include <iostream> #include <sqlite3.h> #include <string> #include <vector> using namespace std; Database::Database(string filename) { char filenameCharArray[100]; strcpy(filenameCharArray, filename.c_str()); sqlite3_open(filenameCharArray, &db); } Database::~Database() { sqlite3...
af29ebcc-2fc2-4a86-9d3e-b841125d765a
{ "language": "C++" }
```c++ #include <QtGui> #include "mdi_background.h" void QMdiAreaWBackground::resizeEvent(QResizeEvent *reEvent) { size = reEvent->size(); resize(size); QMdiArea::resizeEvent(reEvent); } void QMdiAreaWBackground::resize(QSize& size) { setBackground(i.scaled(size));//,Qt::KeepAspectRati...
```c++ #include <QtGui> #include "mdi_background.h" void QMdiAreaWBackground::resizeEvent(QResizeEvent *reEvent) { size = reEvent->size(); resize(size); QMdiArea::resizeEvent(reEvent); } void QMdiAreaWBackground::resize(QSize& size) { /* XXX Conversion of image to the ARGB32 format is placed here because of setBa...
bedcd472-df7a-4273-9443-faca1fbf7a8c
{ "language": "C++" }
```c++ #include <cstring> #include <Bull/Core/Log/Log.hpp> #include <Bull/Core/Support/Win32/Windows.hpp> #include <Bull/Core/System/Win32/ClipboardImpl.hpp> namespace Bull { namespace prv { void ClipboardImpl::flush() { if(OpenClipboard(nullptr)) { Emp...
```c++ #include <cstring> #include <Bull/Core/Exception/Throw.hpp> #include <Bull/Core/Support/Win32/Win32Error.hpp> #include <Bull/Core/Support/Win32/Windows.hpp> #include <Bull/Core/System/Win32/ClipboardImpl.hpp> namespace Bull { namespace prv { void ClipboardImpl::flush() { if(...
fdd766dc-3484-49ce-ad09-8aaa7f3f2761
{ "language": "C++" }
```c++ //======================================================================= // Copyright Baptiste Wicht 2013-2014. // 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 2013-2014. // 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) //=========================================...
6339a861-6566-4933-b549-73ec9aac51fa
{ "language": "C++" }
```c++ #define BOOST_TEST_MODULE Gridcoin Test Suite #include <boost/test/unit_test.hpp> #include "db.h" #include "main.h" #include "wallet.h" CWallet* pwalletMain; CClientUIInterface uiInterface; extern bool fPrintToConsole; extern void noui_connect(); struct TestingSetup { TestingSetup() { fPrintToDeb...
```c++ #define BOOST_TEST_MODULE Gridcoin Test Suite #include <boost/test/unit_test.hpp> #include "db.h" #include "main.h" #include "wallet.h" CWallet* pwalletMain; CClientUIInterface uiInterface; extern bool fPrintToConsole; extern void noui_connect(); struct TestingSetup { TestingSetup() { fPrintToDeb...
b2d89df4-4c5c-44ea-8d68-8eaf19397ded
{ "language": "C++" }
```c++ #include <Arduino.h> //TODO(edcoyne): remove this when it is present upstream. // Currently this is needed to use std::string on Arduino. namespace std{ void __throw_out_of_range(const char* str) { panic(); } } ``` Change function to weak declaration
```c++ #include <Arduino.h> //TODO(edcoyne): remove this when it is present upstream. // Currently this is needed to use std::string on Arduino. namespace std{ void __attribute__((weak)) __throw_out_of_range(const char* str) { panic(); } } ```
0025c3b7-2b24-4c72-a6af-06828483c543
{ "language": "C++" }
```c++ #include <omp.h> #include "proctor/detector.h" #include "proctor/proctor.h" #include "proctor/scanning_model_source.h" using pcl::proctor::Detector; //using pcl::proctor::ProctorMPI; using pcl::proctor::Proctor; using pcl::proctor::ScanningModelSource; Detector detector; Proctor proctor; int main(int argc, c...
```c++ #include <omp.h> #include "proctor/detector.h" #include "proctor/proctor.h" #include "proctor/scanning_model_source.h" using pcl::proctor::Detector; //using pcl::proctor::ProctorMPI; using pcl::proctor::Proctor; using pcl::proctor::ScanningModelSource; Detector detector; Proctor proctor; int main(int argc, c...
6471abef-2a1f-4745-8fe3-a3db72861e14
{ "language": "C++" }
```c++ /****************************************************************************** nomlib - C++11 cross-platform game engine Copyright (c) 2013, Jeffrey Carpenter <jeffrey.carp@gmail.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provide...
```c++ /****************************************************************************** nomlib - C++11 cross-platform game engine Copyright (c) 2013, Jeffrey Carpenter <jeffrey.carp@gmail.com> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provide...
fa21aa09-1f9a-450d-861e-5ef9936701b7
{ "language": "C++" }
```c++ #include <emscripten/bind.h> #include "libcellml/logger.h" using namespace emscripten; EMSCRIPTEN_BINDINGS(libcellml_logger) { class_<libcellml::Logger>("Logger") .function("addIssue", &libcellml::Logger::addIssue) .function("removeAllIssues", &libcellml::Logger::removeAllIssues) ...
```c++ #include <emscripten/bind.h> #include "libcellml/logger.h" using namespace emscripten; EMSCRIPTEN_BINDINGS(libcellml_logger) { class_<libcellml::Logger>("Logger") .function("addIssue", &libcellml::Logger::addIssue) .function("removeAllIssues", &libcellml::Logger::removeAllIssues) ...
970d900d-fc4f-40d6-b8a7-73083a697dda
{ "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/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" #if defined...
```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/command_line.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_switches.h" #if defined...
60955c06-43c3-45c7-956e-a64181bfe9df
{ "language": "C++" }
```c++ #include <gtest/gtest.h> #ifndef NDEBUG #define NDEBUG #endif #define SM_ALWAYS_ASSERT #include <sm/assert_macros.hpp> TEST(SmCommonTestSuite,testAssertMacrosAlwaysAssert) { SM_DEFINE_EXCEPTION(Exception, std::runtime_error); EXPECT_THROW( SM_ASSERT_TRUE_DBG(Exception, false, ""), Exception); } ``` Add an...
```c++ #include <gtest/gtest.h> #ifndef NDEBUG #define NDEBUG #endif #ifndef SM_ALWAYS_ASSERT #define SM_ALWAYS_ASSERT #endif #include <sm/assert_macros.hpp> TEST(SmCommonTestSuite,testAssertMacrosAlwaysAssert) { SM_DEFINE_EXCEPTION(Exception, std::runtime_error); EXPECT_THROW( SM_ASSERT_TRUE_DBG(Exception, false...
13f026bd-a468-46f0-b1aa-54a885c3871d
{ "language": "C++" }
```c++ /** * Appcelerator Titanium Mobile * Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ #include "NativeLabelObject.h" #include <bb/cascades/Color> #include <QCol...
```c++ /** * Appcelerator Titanium Mobile * Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ #include "NativeLabelObject.h" #include <bb/cascades/Color> #include <QCol...
65a9618b-6625-4392-b3d0-b14ae9f1c52f
{ "language": "C++" }
```c++ // Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/browser_process.h" #include "chrome/browser/printing/print_job_manager.h" #include "ui/base/l10n/l10n_util.h" Browse...
```c++ // Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/browser_process.h" #include "chrome/browser/printing/print_job_manager.h" #include "ui/base/l10n/l10n_util.h" Browse...
6c16d3f7-37cb-462c-9312-068527baf816
{ "language": "C++" }
```c++ #include <algorithm> #include "env.hh" #include "parse_args.hh" #include "consumer.hh" using namespace std; using namespace boost::filesystem; int main(int argc, char** argv) { argc--; argv++; vector<path> files; string playlist; parse_args(argc, argv, files, playlist); Consumer cons...
```c++ #include <algorithm> #include "env.hh" #include "parse_args.hh" #include "consumer.hh" using namespace std; using namespace boost::filesystem; int main(int argc, char** argv) { argc--; argv++; vector<path> files; string playlist; parse_args(argc, argv, files, playlist); Consumer cons...
ff915102-1d6c-4a35-abb9-8381ac71ad0f
{ "language": "C++" }
```c++ #include "perf_precomp.hpp" using namespace std; using namespace cv; using namespace perf; typedef TestBaseWithParam< pair<string, string> > ImagePair; pair<string, string> impair(const char* im1, const char* im2) { return make_pair(string(im1), string(im2)); } PERF_TEST_P(ImagePair, OpticalFlowDual_TVL1...
```c++ #include "perf_precomp.hpp" using namespace std; using namespace cv; using namespace perf; typedef TestBaseWithParam< pair<string, string> > ImagePair; pair<string, string> impair(const char* im1, const char* im2) { return make_pair(string(im1), string(im2)); } PERF_TEST_P(ImagePair, OpticalFlowDual_TVL1...
658582c7-e0fa-4d60-90f3-52e1dc6529a2
{ "language": "C++" }
```c++ #include "bitfield.h" #include "canutil_lpc17xx.h" #include "canutil.h" #include "canwrite.h" #include "log.h" #include <stdbool.h> void copyToMessageBuffer(uint64_t source, uint8_t* a, uint8_t* b) { for(int i = 0, j = 4; i < 3 && j < 8; i++, j++) { a[i] = nthByte(source, i); b[i] = nthByte(...
```c++ #include "bitfield.h" #include "canutil_lpc17xx.h" #include "canutil.h" #include "canwrite.h" #include "log.h" #include <stdbool.h> void copyToMessageBuffer(uint64_t source, uint8_t* a, uint8_t* b) { for(int i = 0, j = 4; i < 4 && j < 8; i++, j++) { a[3 - i] = nthByte(source, j); b[3 - i] = ...
74a2d31c-160d-453e-ba3f-bec6614a2387
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -fsyntax-only -Wconditional-uninitialized -fsyntax-only %s -verify class Foo { public: Foo(); ~Foo(); operator bool(); }; int bar(); int baz(); int init(double *); // This case flags a false positive under -Wconditional-uninitialized because // the destructor in Foo fouls about the mi...
```c++ // RUN: %clang_cc1 -fsyntax-only -Wconditional-uninitialized -fsyntax-only %s -verify class Foo { public: Foo(); ~Foo(); operator bool(); }; int bar(); int baz(); int init(double *); // This case flags a false positive under -Wconditional-uninitialized because // the destructor in Foo fouls about the mi...
8e4f98a3-85ed-4d01-89c7-5f964c5a52e8
{ "language": "C++" }
```c++ #include <QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } ``` Enable HiDPI for the demo app.
```c++ #include <QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } ```
7d60efa2-8c0b-4607-8f6d-ba9d5da812da
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s // // Ensure that when we use builtins in C++ code with templates that compute the // valid immediate, the dead code with the invalid immediate doesn't error. typedef short __v8hi __attribute__((__vector_size__(16))); template <int Imm> __...
```c++ // RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s // // Ensure that when we use builtins in C++ code with templates that compute the // valid immediate, the dead code with the invalid immediate doesn't error. // expected-no-diagnostics typedef short __v8hi __attribute__((__vector_size__(16...
08ec6c70-69fb-45de-bc57-fe6f4db1f963
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -fsyntax-only -verify %s class Base { }; class Derived1 : public Base { }; class Derived2 : public Base { }; void f0(volatile Base *b, Derived1 *d1, const Derived2 *d2) { if (b > d1) return; if (d1 <= b) return; if (b > d2) return; if (d1 >= d2) // expected-error{{compari...
```c++ // RUN: %clang_cc1 -fsyntax-only -verify %s class Base { }; class Derived1 : public Base { }; class Derived2 : public Base { }; void f0(volatile Base *b, Derived1 *d1, const Derived2 *d2) { if (b > d1) return; if (d1 <= b) return; if (b > d2) return; if (d1 >= d2) // expected-error{{compari...
559abe63-8746-4f1a-9bd2-5ef1b94bf9f3
{ "language": "C++" }
```c++ #include <Halide.h> #include <stdio.h> using namespace Halide; int main(int argc, char **argv) { Func f; Var x; ImageParam input(Float(32), 1); f(x) = input(cast<int>(round(0.3f * ceil(0.4f * floor(x * 22.5f))))); f.infer_input_bounds(10); Image<float> in = input.get(); int cor...
```c++ #include <Halide.h> #include <stdio.h> using namespace Halide; int main(int argc, char **argv) { Func f; Var x; ImageParam input(Float(32), 1); f(x) = input(cast<int>(ceil(0.3f * ceil(0.4f * floor(x * 22.5f))))); f.infer_input_bounds(10); Image<float> in = input.get(); int corr...
34219067-ba85-4ff0-a51d-aa861aba3590
{ "language": "C++" }
```c++ #define CATCH_CONFIG_RUNNER #include <catch.hpp> #include <iostream> #include <mipp.h> int main(int argc, char* argv[]) { std::cout << "MIPP tests" << std::endl; std::cout << "----------" << std::endl << std::endl; std::cout << "Instr. type: " << mipp::InstructionType << std::endl; s...
```c++ #define CATCH_CONFIG_RUNNER #include <catch.hpp> #include <iostream> #include <mipp.h> int main(int argc, char* argv[]) { std::cout << "MIPP tests" << std::endl; std::cout << "----------" << std::endl << std::endl; std::cout << "Instr. type: " << mipp::InstructionType << std::endl; s...
3a006b4c-058c-4914-b14e-648c78e62864
{ "language": "C++" }
```c++ // Copyright (c) 2013, Zeex // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions...
```c++ // Copyright (c) 2013, Zeex // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions...
43ef384b-72a6-4e92-9d01-c54d2711076a
{ "language": "C++" }
```c++ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> using namespace vespalib; void testDebug() { TEST_DEBUG("lhs.out", "rhs.out"); EXPECT_EQUAL("a\n" "b\n" "c\n", ...
```c++ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> using namespace vespalib; void testDebug() { TEST_DEBUG("lhs.out", "rhs.out"); EXPECT_EQUAL(string("a\n" "b\n" ...
0324d68f-eb81-486b-b4ea-b1e07f39ee55
{ "language": "C++" }
```c++ // Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/metrics/variations/variations_request_scheduler.h" namespace chrome_variations { namespace { // Time between seed f...
```c++ // Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/metrics/variations/variations_request_scheduler.h" namespace chrome_variations { namespace { // Time between seed f...
9b344075-0e7d-4cbc-9cb9-8c2d287cbd4c
{ "language": "C++" }
```c++ // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" #include "webkit/tools/test_...
```c++ // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" #include "webkit/tools/test_...
271c96e0-78de-450f-8be7-bac75962fb0c
{ "language": "C++" }
```c++ // RUN: c-index-test -test-load-source all -c %s -fsyntax-only -target x86_64-apple-darwin9 -fcoroutines-ts -std=c++1z -I%S/../SemaCXX/Inputs | FileCheck %s #include "std-coroutine.h" using std::experimental::suspend_always; using std::experimental::suspend_never; struct promise_void { void get_return_object...
```c++ // RUN: c-index-test -test-load-source all -c %s -fsyntax-only -target x86_64-apple-darwin9 -fcoroutines-ts -std=c++1z -I%S/../SemaCXX/Inputs | FileCheck %s #include "std-coroutine.h" using std::experimental::suspend_always; using std::experimental::suspend_never; struct promise_void { void get_return_object...
057c1233-3567-4bd6-97fe-bb5288eaacff
{ "language": "C++" }
```c++ #include "main_state.hpp" #include "system_movement.hpp" #include "system_draw.hpp" #include "entityx/entityx.h" #include <SDL2/SDL.h> MainState::MainState(Game *game) : m_game(game) {} MainState::~MainState(){} int MainState::init() { m_systems.add<MovementSystem>(); m_systems.add<DrawSystem>(m_game); ...
```c++ #include "main_state.hpp" #include "system_movement.hpp" #include "system_draw.hpp" #include "entityx/entityx.h" #include <SDL2/SDL.h> MainState::MainState(Game *game) : m_game(game) {} MainState::~MainState(){} int MainState::init() { m_systems.add<MovementSystem>(); m_systems.add<DrawSystem>(m_game); ...
e8f43ba4-b70f-487a-8a72-5d6835ab7781
{ "language": "C++" }
```c++ /////////////////////////////////////////////////////////////////////// // File: dotproduct.h // Description: Native dot product function. // // (C) Copyright 2018, Google Inc. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the Lic...
```c++ /////////////////////////////////////////////////////////////////////// // File: dotproduct.h // Description: Native dot product function. // // (C) Copyright 2018, Google Inc. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the Lic...
9b8a2241-ac28-48be-91db-c18f7afa8a68
{ "language": "C++" }
```c++ // This is the starting point // #include <iostream> int main() { std::string greeting("Welcome to RGrep-CPP"); std::cout << greeting << std::endl; std::string firstInputString; std::string secondInputString; std::cout << "Enter the first string" << std::endl; std::cin >> firstInputStri...
```c++ // This is the starting point // #include <iostream> #include <fstream> #include <sstream> int main() { std::string greeting("Welcome to RGrep-CPP"); std::cout << greeting << std::endl; std::string firstInputString; std::string secondInputString; std::cout << "Enter the first string" << std...
c2defca8-7854-4434-b0d8-62c002f97939
{ "language": "C++" }
```c++ //===- llvm/System/Darwin/Path.cpp - Linux Path Implementation --*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by Reid Spencer and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===-----------...
```c++ //===- llvm/System/Darwin/Path.cpp - Linux Path Implementation --*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by Reid Spencer and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===-----------...
48e604c2-1eb5-475a-b2ca-a2066c38cf78
{ "language": "C++" }
```c++ /* * DialogPassword.cpp * * Created on: 01.01.2017 * Author: felix */ #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QLabel> #include <QtWidgets/QVBoxLayout> #include <frontend/DialogPassword.h> namespace Flix { DialogPassword::DialogPassword(QWidget *parent, Qt::WindowFlags flags): QDial...
```c++ /* * DialogPassword.cpp * * Created on: 01.01.2017 * Author: felix */ #include <QtWidgets/QHBoxLayout> #include <QtWidgets/QLabel> #include <QtWidgets/QVBoxLayout> #include <frontend/DialogPassword.h> namespace Flix { DialogPassword::DialogPassword(QWidget *parent, Qt::WindowFlags flags): QDial...
7e1cb9e3-9213-44ac-bc06-efb4c5faf439
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -std=c++11 -verify %s using size_t = decltype(sizeof(int)); void operator "" wibble(const char *); // expected-warning {{user-defined literal suffixes not starting with '_' are reserved; no literal will invoke this operator}} void operator "" wibble(const char *, size_t); // expected-warning ...
```c++ // RUN: %clang_cc1 -std=c++11 -verify %s using size_t = decltype(sizeof(int)); void operator "" wibble(const char *); // expected-warning {{user-defined literal suffixes not starting with '_' are reserved; no literal will invoke this operator}} void operator "" wibble(const char *, size_t); // expected-warning ...
ff1550e3-ea8d-4840-b236-2203a5c27c93
{ "language": "C++" }
```c++ /* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ struct GrGLInterface; const GrGLInterface* GrGLDefaultInterface() { return NULL; } ``` Include GrGLInterface.h instead of forward declaring, since we have to get...
```c++ /* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "GrGLInterface.h" const GrGLInterface* GrGLDefaultInterface() { return NULL; } ```
d5246c64-31c2-4ab1-b262-1768a6125830
{ "language": "C" }
```c #include "filters_api.h" static PF_FILTER_RESULT demo_filter_keyboard_event(connectionInfo* info, void* param) { proxyKeyboardEventInfo* event_data = (proxyKeyboardEventInfo*) param; return FILTER_PASS; } static PF_FILTER_RESULT demo_filter_mouse_event(connectionInfo* info, void* param) { proxyMouseEventInfo*...
```c #include "filters_api.h" static PF_FILTER_RESULT demo_filter_keyboard_event(connectionInfo* info, void* param) { proxyKeyboardEventInfo* event_data = (proxyKeyboardEventInfo*) param; return FILTER_PASS; } static PF_FILTER_RESULT demo_filter_mouse_event(connectionInfo* info, void* param) { proxyMouseEventInfo*...
0c243b95-d16c-41d1-85df-a538546bc5eb
{ "language": "C" }
```c #import <Foundation/Foundation.h> @class WKInterfaceController; @class FakeInterfaceController; @protocol TestableWKInterfaceController <NSObject> - (void)awakeWithContext:(id)context; - (void)willActivate; - (void)didDeactivate; @optional - (void)pushControllerWithName:(NSString *)name context:(id)context;...
```c #import <Foundation/Foundation.h> @class WKInterfaceController; @class FakeInterfaceController; @protocol TestableWKInterfaceController <NSObject> - (void)awakeWithContext:(id)context; - (void)willActivate; - (void)didDeactivate; @optional - (NSArray *)sent_messages; - (void)pushControllerWithName:(NSString...
6208cb7b-ffde-4505-a0f5-dd76f4b2e201
{ "language": "C" }
```c ``` Add chapter 1 extra exercises
```c #include <stdio.h> main() { float fahr, celsius; float lower, upper, step; lower = 0; upper = 300; step = 20; celsius = lower; printf("%6s\t%3s\n", "celsius", "fahr"); while (celsius <= upper) { fahr = celsius * (9.0/5.0) + 32.0; printf("%6.1f\t%3.0f\n", celsius...
57113805-32e7-4e35-8184-408a19f6477b
{ "language": "C" }
```c // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/vespalib/util/threadstackexecutorbase.h> namespace proton { class ExecutorThreadingServiceStats { public: using Stats = vespalib::ThreadStackExecutorBase::Stats...
```c // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <cstddef> #include <vespa/vespalib/util/executor_stats.h> namespace proton { /* * This class contains executor stats for the executors used by a * document db. */ class...
3f964a1b-fdb1-4076-a69c-943a02a3a5a2
{ "language": "C" }
```c #include "test_parser.h" void one_or_more_one(void **state) { grammar_t *grammar = grammar_init( non_terminal("One"), rule_init( "One", one_or_more( terminal("11") ) ), 1 ); parse_t *result = parse("11", grammar); assert_non_null(result); assert_int_equal(result->...
```c #include "test_parser.h" void one_or_more_one(void **state) { grammar_t *grammar = grammar_init( non_terminal("One"), rule_init( "One", one_or_more( terminal("11") ) ), 1 ); parse_result_t *result = parse("11", grammar); assert_non_null(result); assert_true(is_succ...
6a754a78-80d1-447c-ad6c-c34aef5c35f2
{ "language": "C" }
```c #include <stdio.h> #include "jpeglib.h" #include <setjmp.h> struct error_mgr2 { struct jpeg_error_mgr pub; /* "public" fields */ jmp_buf setjmp_buffer; /* for return to caller */ }; typedef struct error_mgr2 * error_ptr2; /* * Here's the routine that will replace the standard error_exit method: */ void ...
```c #include <stdio.h> #include "jpeglib.h" #include <setjmp.h> struct error_mgr2 { struct jpeg_error_mgr pub; /* "public" fields */ jmp_buf setjmp_buffer; /* for return to caller */ }; typedef struct error_mgr2 * error_ptr2; /* * Here's the routine that will replace the standard error_exit method: */ void ...
7da46789-8546-433d-976d-a893fe97e781
{ "language": "C" }
```c #pragma once #ifdef bool #undef bool #endif typedef char bool; #define true 1 #define false 0 typedef struct carp_thread* carp_thread_t; typedef void(*carp_thread_routine)(void* arg); typedef struct carp_library* carp_library_t; /* Init/shutdown */ void carp_platform_init(); void carp_platform_shutdown(); ...
```c #pragma once #ifdef bool #undef bool #endif typedef int bool; #define true 1 #define false 0 typedef struct carp_thread* carp_thread_t; typedef void(*carp_thread_routine)(void* arg); typedef struct carp_library* carp_library_t; /* Init/shutdown */ void carp_platform_init(); void carp_platform_shutdown(); /...
9f6d0b99-1c66-4eb0-9461-90fd2a8b36b9
{ "language": "C" }
```c //Copyright (c) 2020 Ultimaker B.V. //CuraEngine is released under the terms of the AGPLv3 or higher. #ifndef FMATRIX3X3_H #define FMATRIX3X3_H namespace cura { class Point3; class FPoint3; class FMatrix3x3 { public: double m[3][3]; FMatrix3x3(); Point3 apply(const FPoint3& p) const; }; } //...
```c //Copyright (c) 2020 Ultimaker B.V. //CuraEngine is released under the terms of the AGPLv3 or higher. #ifndef FMATRIX3X3_H #define FMATRIX3X3_H namespace cura { class Point3; class FPoint3; /*! * A 3x3 linear transformation matrix. */ class FMatrix3x3 { public: /*! * The matrix data, row-endian. * * ...
2ee38744-a2d9-4035-8389-5911b5eacb4a
{ "language": "C" }
```c #ifndef TEST_LINEAR_HASH_H_ #define TEST_LINEAR_HASH_H_ #include <stdio.h> #include <string.h> #include <limits.h> #include "../../../planckunit/src/planck_unit.h" #include "../../../../dictionary/linear_hash/linear_hash.h" #ifdef __cplusplus extern "C" { #endif void runalltests_linear_hash(); #ifdef __cplus...
```c #ifndef TEST_LINEAR_HASH_H_ #define TEST_LINEAR_HASH_H_ #include <stdio.h> #include <string.h> #include <limits.h> #include <math.h> #include "../../../planckunit/src/planck_unit.h" #include "../../../../dictionary/linear_hash/linear_hash.h" #ifdef __cplusplus extern "C" { #endif void runalltests_linear_hash()...
d4fafc48-b8f2-4910-aebb-20d7ffa0bc35
{ "language": "C" }
```c // RUN: clang-cc -emit-llvm %s -o - typedef short __v4hi __attribute__ ((__vector_size__ (8))); void f() { __v4hi A = (__v4hi)0LL; } __v4hi x = {1,2,3}; __v4hi y = {1,2,3,4}; typedef int x __attribute((vector_size(16))); int a() { x b; return b[2LL]; } ``` Fix silly mistake in test.
```c // RUN: clang-cc -emit-llvm %s -o - typedef short __v4hi __attribute__ ((__vector_size__ (8))); void f() { __v4hi A = (__v4hi)0LL; } __v4hi x = {1,2,3}; __v4hi y = {1,2,3,4}; typedef int vty __attribute((vector_size(16))); int a() { vty b; return b[2LL]; } ```
e202f019-a0fb-4602-8785-1f8951f4374c
{ "language": "C" }
```c ``` Add GET message integration test - Make unit testing write fuller test objects - Make the number of buckets/keys in dummy object configurable - Add several helper functions like comparing binaries and objects - Improve error reporting in testing async callbacks
```c /********************************************************************* * * test_log.c: Riak C Unit Testing logger * * Copyright (c) 2007-2014 Basho Technologies, Inc. All Rights Reserved. * * This file is provided to you under the Apache License, * Version 2.0 (the "License"); you may not use this file *...
9388b11b-af4f-4c1b-bfbf-9df7c0088b86
{ "language": "C" }
```c #import <Foundation/Foundation.h> #import <GHUnit/GHUnit.h> //#import <SenTestingKit/SenTestingKit.h> #define COCOAGIT_REPO @"." #define TEST_RESOURCES_PATH @"../../UnitTests/Resources/" #define DOT_GIT TEST_RESOURCES_PATH @"dot_git/" #define DELTA_REF_PACK TEST_RESOURCES_PATH @"packs/cg-0.2.5-deltaref-be5a15ac5...
```c #import <Foundation/Foundation.h> #import <GHUnit/GHUnit.h> //#import <SenTestingKit/SenTestingKit.h> #define COCOAGIT_REPO @"." #define TEST_RESOURCES_PATH @"../../UnitTests/Resources/" #define TEST_FIXTURES_PATH TEST_RESOURCES_PATH @"fixtures/" #define DOT_GIT TEST_RESOURCES_PATH @"dot_git/" #define DELTA_REF_...
1d8b5b4c-a4e5-4a9b-938a-ef566d8d4929
{ "language": "C" }
```c ``` Set one LED group on for light aiming
```c /** * "Aim lights" light script * * Turn on all the lights for 30 seconds so they can be aimed */ // Copied from todbot // format of light script lines: duration, command, arg1,arg2,arg3 typedef struct _blinkm_script_line { uint8_t dur; uint8_t cmd[4]; // cmd,arg1,arg2,arg3 } blinkm_script_line; // s...
386a6771-3177-4d49-ba11-9a81c3f5e073
{ "language": "C" }
```c ``` Add definition for Physical Presence storage flag.
```c /** @file Define the variable data structures used for physical presence storage data. Copyright (c) 2016, Intel Corporation. All rights reserved. <BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distr...
6beb5ab8-a7ef-4379-beed-551c17547920
{ "language": "C" }
```c #include <stdio.h> #include <string.h> char* find(char *haystack, char needle); int main(){ char input[401]={'\0'}, symbol, *result; fgets(input, 401, stdin); symbol=getchar(); result=find(input, symbol); if(result!=NULL){ printf("%ld", result - input); } else{ printf("-1"); } return 0; } ...
```c #include <stdio.h> #include <string.h> char* find(char *haystack, char needle); int main(){ char input[401]={'\0'}, symbol, *result; fgets(input, 401, stdin); symbol=getchar(); result=find(input, symbol); if(result!=NULL){ printf("%d", (int)(result - input)); } else{ printf("-1"); } return 0;...
45885132-aeb4-4a7d-b26d-cffb09174afa
{ "language": "C" }
```c /* * example2.c * * Created on: 3 May 2016 * Author: nick */ #include "ndm.h" #include <mpi.h> #include <stdio.h> void recvFunction(void*, NDM_Metadata); int main(int argc, char* argv[]) { int provided; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided); ndmInit(); char uuid[10]; ...
```c /* * example2.c * * Created on: 3 May 2016 * Author: nick */ #include "ndm.h" #include <mpi.h> #include <stdio.h> void recvFunction(void*, NDM_Metadata); void additiveRecvFunction(void*, NDM_Metadata); int main(int argc, char* argv[]) { int provided; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTI...
c9c1a4ea-b3d1-4d39-8e31-9defd27e75f8
{ "language": "C" }
```c #ifndef __JniHelpersCommon_h__ #define __JniHelpersCommon_h__ // Disable some annoying compiler warnings #if WIN32 #pragma warning(disable: 4996) // "Security" warnings for vsnprintf #endif #if WIN32 #define EXPORT __declspec(dllexport) #else #define EXPORT #endif #include <jni.h> #define kTypeInt "I" #define ...
```c #ifndef __JniHelpersCommon_h__ #define __JniHelpersCommon_h__ // Disable some annoying compiler warnings #if WIN32 #pragma warning(disable: 4996) // "Security" warnings for vsnprintf #endif #if WIN32 #define EXPORT __declspec(dllexport) #else #define EXPORT #endif #include <jni.h> #define kTypeInt "I" #define ...
721d7f90-923d-4dc5-9f22-48b5496083ee
{ "language": "C" }
```c ``` Add calibration file for board J2 (MAV102)
```c /* * conf_imu_rev4.h * * Created: 20/11/2013 22:21:49 * Author: sfx */ #ifndef CONF_IMU_REV4_H_ #define CONF_IMU_REV4_H_ #define RAW_GYRO_X 0 #define RAW_GYRO_Y 1 #define RAW_GYRO_Z 2 #define RAW_ACC_X 0 #define RAW_ACC_Y 1 #define RAW_ACC_Z 2 #define RAW_COMPASS_X 2 #define RAW_COMPASS_Y 0 #define RA...
c4b8db5c-76f0-4e02-ab5c-f0552ce72cd6
{ "language": "C" }
```c ``` Put SynapticsSHM back into the driver to be able to use synclient -m once again
```c /* * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without * fee, provided that the above copyright notice appear in all copies * and that both that copyright notice and this permission notice * appear in supporting documentation,...