text
string
size
int64
token_count
int64
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ui->console->setReadOnly(true); ui->texture_label->clear(); ogl_layout = new QHBoxLayout(ui->frame_ogl); ogl_layout->setContentsMargins(0, 0...
7,593
2,524
/// /// Copyright 2022 PentaDevs /// Author: Taehwan Kim /// Contents: Examples of regex_error (referenced from CppReference) #include <regex> #include <iostream> int main() { try { std::regex re("[a-b][a"); } catch (const std::regex_error& e) { std::cout << "regex_error caught: " << e.wha...
466
167
/** * * Copyright (C) 2021 Mohammad Javad Dousti, Qing Xie, Mahdi Nazemi, * and Massoud Pedram. All rights reserved. * * Please refer to the LICENSE file for terms of use. * */ #include "headers/rc_utils.hpp" #include <omp.h> VALUE RCutils::calcThermalConductivity(VALUE k, VALUE thickness, ...
7,134
2,517
#include "Sky.hpp" #include <iostream> #include <cmath> // TODO: 现在是全写在Sky里,到时候得分开成各个东西。(refactor) #include <stdio.h> #include <stdlib.h> // MAKE SURE WE INITIALISE OUR VARIABLES Sky::Sky() : keyframe(-1), animateTime(0.0), animateRotation(0.0), animateTranslation(0.0), interpA(0.0), interpB(0.0), interpTime(0.0){...
1,685
706
/** Copyright Julio Marcelo Picardo 2017-18, all rights reserved. * * @project Wolfy2D - Including JMP scripting language. * @author Julio Marcelo Picardo <juliomarcelopicardo@gmail.com> */ #include "core/user_interface.h" #include "GLFW/glfw3.h" #include "imgui.h" #include "imgui_dock.h" #include "core/core.h" #i...
12,753
5,326
// RandomUsername (Nikola Jovanovic) // Fibonacci Heap // Source: CLRS, Third Edition #include <algorithm> #include <cstdlib> #include <fstream> #include <iostream> #include <string> struct Node { Node* left; Node* right; Node* parent; Node* first_child; int key; int degree; bool marked; explicit Node...
7,620
2,831
// // Created by yulong on 3/31/17. // #ifndef BYL_TEMPLATE_LIBRARY_AVL_TREE_H #define BYL_TEMPLATE_LIBRARY_AVL_TREE_H #include "byl_bst.hpp" #include <cstddef> namespace byl { template<typename T> struct avl_tree; template<typename T> struct avl_node { typedef T value_type; typedef size_t size_type;; fri...
7,301
2,537
#include "pessoa.h" Pessoa::Pessoa(QObject *parent) : QObject(parent) { } QString Pessoa::getNome() const { return nome; } void Pessoa::setNome(const QString &value) { nome = value; emit nomeChanged(nome); }
243
101
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A //// PARTICULAR PURPOSE. //// //// Copyright (c) Microsoft Corporation. All rights reserved #include "pch.h...
600
222
// Copyright (c) Zhirnov Andrey. For more information see 'LICENSE.txt' #include "Engine/Platforms/Public/Tools/GPUThreadHelper.h" namespace Engine { namespace PlatformTools { /* ================================================= FindGraphicsThread ================================================= */ ModulePtr GP...
2,174
865
#include "inifile.hpp" int main() { auto ini = util::inifile("test.ini"); if (!ini.good()) { std::cerr << ini.error() << std::endl; exit(-1); } std::cout << "default section: name = " << ini.get_string("name") << '\n'; ini.set_string("set", "string"); std::cout << "section1...
456
172
// Copyright (C) 1997 Microsoft Corporation // // dns client configuration page // // 12-22-97 sburns #ifndef CONFIGUREDNSCLIENTPAGE_HPP_INCLUDED #define CONFIGUREDNSCLIENTPAGE_HPP_INCLUDED class ConfigureDnsClientPage : public DCPromoWizardPage { public: ConfigureDnsClientPage(); pr...
974
381
#include <mjast_and.h>
22
12
// Curiously Recurring Template Pattern // static polymorphism #include <iostream> using namespace std; template <typename Child> struct Base { void interface() { static_cast<Child *>(this)->implementation(); } }; struct Derived : Base<Derived> { void implementation() { cerr << "Derived implementation\...
412
125
/* * Copyright (c) 2012-2018, Association Scientifique pour la Geologie et ses * Applications (ASGA). All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code mus...
17,711
6,217
#include <assert.h> #include <stdio.h> #include <stdint.h> #include <inttypes.h> #include <math.h> #include "primitive_roots.h" #define main HIDE_main #define tests_suite HIDE_tests_suite #define test_max_primitive_root HIDE_test_max_primitive_root #include "mul_group_mod_tests.cpp" #undef main #undef tests_suite #und...
2,835
1,305
/* // Copyright (c) 2000-2009, Texas Engineering Experiment Station (TEES), a // component of the Texas A&M University System. // All rights reserved. // The information and source code contained herein is the exclusive // property of TEES and may not be disclosed, examined or reproduced // in whole or in part withou...
4,446
1,786
/*** Included Header Files ***/ #include <feature_line.h> #include <document.h> #include <feature_point.h> #include <tree_view.h> #include <line_layer.h> #include <feature_line_action.h> #include <feature_line_controller.h> /***********************************************~********************************************...
3,943
1,296
#include <stdio.h> #include <math.h> int main() { int n1,n2,n,i; scanf("%d",&n); for (n1=2;n1<=n/2;n1++) { for (i=2;i<=sqrt(n1);i++) { if (n1%i==0) break; } if (i==(int)sqrt(n1)+1) { for (i=2,n2=n-n1;i<=sqrt(n2);i++) { if (n2%i==0) break; } ...
447
238
/* * WorkshopCmd3.cpp * * Created on: May 15, 2017 * Author: Andreas Schuster * */ #include <stdio.h> #include <iostream> #include <maya/MPxCommand.h> #include <maya/MArgList.h> #include <maya/MStatus.h> #include <maya/MSyntax.h> #include <maya/MStringArray.h> #include <maya/MGlobal.h> #include <maya/MArgDatab...
9,263
3,721
#include <bits/stdc++.h> using namespace std; void replace(char s[], char c1, char c2) { //base case if (s[0] == '\0') { return; } if (s[0] == c1) { s[0] = c2; } replace(s + 1, c1, c2); } int main() { char s[100]; cin >> s; char c1, c2; cout << "Enter char...
602
232
#include "standardpipeline.h" #include "arealfocalspotextension.h" #include "detectorsaturationextension.h" #include "poissonnoiseextension.h" #include "raycasterprojector.h" #include "spectraleffectsextension.h" namespace CTL { DECLARE_SERIALIZABLE_TYPE(StandardPipeline) /*! * Constructs a StandardPi...
16,614
4,906
#include "DefineCounters.hpp" #include "gtest/gtest.h" namespace // anonymous { template <typename T> class CounterTest : public ::testing::Test { public: typedef Count::Counter<T> Counter; }; using CounterTestTypes = ::testing::Types< char, unsigned char, short, unsigned short, int, unsigned int, ...
2,508
1,025
#pragma once // clang-format off #include <boost/test/unit_test.hpp> #include <boost/test/test_tools.hpp> // clang-format on #include <nuschl/s_exp.hpp> #include <iostream> #include <vector> std::ostream &operator<<(std::ostream &os, const std::vector<int> &vec); std::ostream &operator<<(std::ostream &os, const std...
1,448
482
// Version information for the "BasicUsageEnvironment" library // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. #ifndef _BASICUSAGEENVIRONMENT_VERSION_HH #define _BASICUSAGEENVIRONMENT_VERSION_HH #define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_STRING "2015.01.04" #define BASICUSAGEENVIRONMENT_LIBRAR...
354
148
#include <algorithm> #include <iostream> #include <fstream> #include <cstdlib> #include <cstring> #include <cstdio> #include <string> #include <vector> #include <cmath> #include <queue> #include <map> #include <set> using namespace std; int N,C,M; int cs[300001]; vector<int> cis[10001]; int cunt(i...
1,842
990
#define CATCH_CONFIG_MAIN #include <catch2.h> #include "gmath.h" TEST_CASE("vector2 calculations", "[!mayfail]") { SECTION("Sum of two vectors should provide correct output") { vec2f a = vec2f(2.0f, 1.0f) + vec2f(3.0f, 4.2f); REQUIRE(a == vec2f(5.0f, 5.2f)); } SECTION("Difference of two vectors should provi...
7,271
4,459
#include "uiinfra/logview.h" #include "ui_logview.h" #include <qevent.h> #include <qtimer.h> namespace inf::ui { static auto s_maxUpdateInterval = std::chrono::milliseconds(200); LogView::LogView(QWidget* parent) : QWidget(parent) , _ui(std::make_unique<Ui::LogView>()) , _timer(new QTimer(this)) { _ui->setupUi(...
1,028
362
/// \file tatonnement.hpp /// /// \brief Implements the tâtonnement process (hill climbing), implemented as a /// numerical optimisation. /// /// \authors Maarten P. Scholl /// \date 2018-02-02 /// \copyright Copyright 2017-2019 The Institute for New Economic Thinking, /// Oxford Martin...
32,079
9,477
class Solution { public: void findarea(vector<vector<int>>& grid,int r,int c,int &t) { grid[r][c]=0,t++; if(r+1<grid.size()&&grid[r+1][c]) findarea(grid,r+1,c,t); if(r-1>=0&&grid[r-1][c]) findarea(grid,r-1,c,t); if(c+1<grid[0].size()&&grid[r][c+1]) ...
842
329
#include "reader.h" #include "../../../math/geometry/coordinates/vol/vol.h" #include "../../../tcp/Socket.h" #include <rec/robotino/api2/Com.h> #include <stdlib.h> #include <math.h> #include <unistd.h> #include <string> #include <cstring> #include <iostream> int KinectReader::readPosition(unsigned int average) { ...
3,258
1,185
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> int main() { char a,b; a = 'a'; b = 'b'; putchar(a); putchar('\n'); putchar(b); printf("\n%c\n%c", a,b); }
174
93
// // Copyright Sundeep S. Sangha 2013 - 2017. // 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) #ifndef DATA_PATTERN_SQLITE_SQLITE_ITERATOR_TCC #define DATA_PATTERN_SQLITE_SQLITE_ITERATOR_TC...
1,359
515
#include <cstdio> #include <ctime> inline int f1(int a, int b) { a++; a += b; b += a; return a + b; } int f2(int a, int b) { a++; a += b; b += a; return a + b; } int main(void) { clock_t t1, t2; printf("Calculating time...\n"); t1 = clock(); for (int i = 0; i < 10000000; i++) f1(100, 100); t1 = clock...
584
318
#include "tools/Process.h" #include "tools/Debug.h" #include "tools/PathTools.h" #include "platform/Platform.h" #include <vector> namespace engine { Process::Process( const std::string& executable, const std::string& arguments, const std::string& workingDirectory, OnProcessMessage o...
3,890
1,125
#include "DB.h" #include "JsonConfig.h" #include "Util.h" #include "LogUtil.h" #include "SePlatForm.h" #include <signal.h> bool bStopServer = false; void OnSignal(int sig) { switch (sig) { case SIGINT: case SIGTERM: #ifdef SF_PLATFORM_WIN case SIGBREAK: #else case SIGPIPE: #endif { CLOG_ERR << "Master Serve...
1,118
505
/************************************************************************************************************************************ Copyright 2017 Autodesk, Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You ...
1,337
407
/**************************************************************************** ** Meta object code from reading C++ file 'basketview.h' ** ** Created by: The Qt Meta Object Compiler version 67 (Qt 5.14.0) ** ** WARNING! All changes made in this file will be lost! *********************************************************...
4,983
1,980
#ifndef Generator_hpp #define Generator_hpp #include "BFSSearcher.hpp" #include "DFSSearcher.hpp" #include <sstream> #include "Puzzle.hpp" /** * Success functor that checks if the node has the required depth */ struct BranchDepthCheck { private: int goalDepth; public: BranchDepthCheck(int goalDepth) : goalDept...
898
328
#include "alta_participante.h" #include "ui_alta_participante.h" #include "qpixmap.h" alta_participante::alta_participante(GUI *guiP, QWidget *parent) : QDialog(parent), ui(new Ui::alta_participante), gui(guiP) { ui->setupUi(this); QPixmap pix(":/images/Heros64.png"); ui->label_logo->setPixmap(pix...
1,661
644
#include <iostream> #include <algorithm> #include <vector> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; void rightTree( TreeNode *root, int &depth, int cur_depth, vector<int> &result){ if (root) { if (depth...
1,253
455
#include "utils/stl_utils.hpp" #include <gmock/gmock.h> TEST(STLUtilesTest, RemoveDuplicates) { std::vector<std::string> strVec = {"s1", "s4", "s1", "s2", "", "s3", "s3"}; auto iter = redfish::stl_utils::firstDuplicate(strVec.begin(), strVec.end()); EXPECT_EQ(*iter, "s3"); redfish::stl_utils...
541
251
#include <bits/stdc++.h> using namespace std; int participants,budget,hotles,weeks; int price, bed; int finalCost; bool isAvail = false; long long n,a,b; int main(int argc, char *argv[]) { scanf("%lld", &n); for (int i = 0; i<n; i++) { scanf("%lld%lld", &a,&b); if (a > b) { printf(">\n"); } else if (a < b...
380
185
#include <cstdio> #include <algorithm> const int N = 100000 + 10; const int M = 1000000 + 10; using namespace std; int Read() { int x = 0;char ch = getchar(); while (ch < '0' || '9' < ch) ch = getchar(); while ('0' <= ch && ch <= '9') x = x * 10 + ch - 48,ch = getchar(); return x; } int c[N],next[N],f[...
1,402
634
#include "message.h" #include "gmatrix.h" void MsgQueue::Send() { MSGQUEUE::iterator it = _queue.begin(); for(; it != _queue.end(); ++it) gmatrix::HandleMessage(*it); _queue.clear(); }
206
77
#include "act_map_exp/planner_base.h" #include <rpg_common/main.h> RPG_COMMON_MAIN { ros::init(argc, argv, "planner_base"); ros::NodeHandle nh; ros::NodeHandle pnh("~"); act_map_exp::PlannerBase<act_map::GPTraceVoxel> planner(nh, pnh); ros::spin(); return 0; }
280
135
// // graphX - geometry - shapes - sphere.hpp // #pragma once #include "Ishape.hpp" namespace graphX::geometry { struct Sphere : IShape { public: Sphere(const vec3f& center_, float radius_) : center{center_}, radius{radius_} { } public: bool ray_intersect(const vec3f&...
486
156
#pragma once #include "TemUnt/Direction.hh" namespace TemUnt { enum class Direction { North = 0, South = 1, East = 2, West = 3 }; } //namespace TemUnt
160
74
/* * Player - One Hell of a Robot Server * Copyright (C) 2000 Brian Gerkey et al. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your o...
32,750
11,712
/*~-------------------------------------------------------------------------~~* * Copyright (c) 2014 Los Alamos National Security, LLC * All rights reserved. *~-------------------------------------------------------------------------~~*/ #include <cinchdevel.h> #include <flecsi/utils/reflection.h> struct test_typ...
920
293
// // Created by clamber on 21.03.2016. //
44
27
#include "../stitch/file.h" #include "../testing/testing.h" #include <thread> #include <chrono> #include <iostream> #include <sstream> #include <cstring> #include <sys/types.h> #include <sys/stat.h> using namespace Stitch; using namespace std; using namespace Testing; static bool test_basic() { Test test; ...
5,779
1,974
/** * Swaggy Jenkins * Jenkins API clients generated from Swagger / Open API specification * * OpenAPI spec version: 1.1.1 * Contact: blah@cliffano.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually...
6,732
2,349
#include <algorithm> #include <sstream> #include "raft_impl.h" #include "replicate_tracker.h" #include "time_utils.h" #include "hassert.h" #include "mem_utils.h" using namespace std; namespace { using namespace raft; inline void assert_role(const RaftImpl& raft_impl, RaftRole expected_role) { hassert(raft_impl....
55,115
18,406
#include "../algorithms/sorting.h" #include "../tools/_fasta.h" int main (int argc, char * const argv[]) { if (argc != 3) { cout << "Encode a genome's fasta sequences using the Burrows-Wheeler algorithm." << endl; cout << "Usage: ./burrows_wheeler /infile.fa /outfile.fa" << endl; exit(0); } ReadSlam::FastA::...
364
158
//================================================================== /// XCConfig.cpp /// /// Created by Davide Pasca - 2022/01/21 /// See the file "license.txt" that comes with this project for /// copyright info. //================================================================== #include "GTVersions.h" #include "X...
2,148
752
// // sql_lexer.h // csv db // // BSD 3-Clause License // Copyright (c) 2015, Lars-Christian Fürstenberg // 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 sou...
16,339
5,481
// Copyright 2022 Open Source Robotics Foundation, 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 appli...
3,828
1,307
/******************************************************** Stanford Driving Software Copyright (c) 2011 Stanford University All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions...
10,256
3,745
#pragma once #include <algorithm> #include "..\shared\KTrace.hxx" #include "..\shared\Kini.hxx" #include "..\shared\KSlre.hxx" class KAutoLogon { private: /*============================================================================== * var *============================================================...
1,899
747
#include "SingnedDistanceOutlineTextShader.h" void SignedDistanceOutlineTextShader::loadAllToUniform(const std::shared_ptr<GUITextModel> model) { SignedDistanceTextShader::loadAllToUniform(model); loadToUniform(location_outlineColor, model->getMaterial()->getProperties().color2); loadToUniform(location_outlineWidt...
1,216
384
#pragma once #include <queue> #include <graph/graph.hpp> #include <graph/properties.hpp> #include <graph/static_graph.hpp> namespace graph { template <typename ColorMapTag, typename V, typename E> struct GenerateBFSGraph {}; template <typename ColorMapTag, typename... P1s, typename... P2s> struct GenerateBFSGra...
4,263
1,530
#include "step_tileset.hpp" #include <doctest.h> #include <string_view> #include "step_exception.hpp" #include "step_test_utils.h" using namespace step; inline static constexpr std::string_view prefix = "resource/tileset/"; TEST_SUITE("Tileset") { TEST_CASE("Parsing external tileset") { const auto tileset...
6,622
2,376
// --------------------------------------------------------------------------- // // The general purpose cross platform C/C++ framework // // S x A c c e l e r a t e // // Home: https://www.sxlib.de // License: Apache 2 // Authors: see src/AUTHOR...
1,410
528
#pragma once #include <blobs-ipmid/blobs.hpp> #include <memory> #include <string> #include <unordered_map> #include <vector> #ifdef __cplusplus extern "C" { #endif /** * This method must be declared as extern C for blob manager to lookup the * symbol. */ std::unique_ptr<blobs::GenericBlobInterface> createHandler(...
2,582
831
// Copyright 2020 The Abseil Authors. // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agr...
2,706
948
#pragma once #include <memory> #include "vector.hh" namespace transform { template <class T> class Vector4 : public Vector<4, T> { private: typedef Vector<4, T> super; public: Vector4() : super() {} // default construct Vector4(const T x, const T y, const T z, const T w); // member construct Ve...
1,435
691
#include "AudioPlatformDevice.h" #include "AudioAnalogType.h" #include "audio_custom_exp.h" #define LOG_TAG "AudioPlatformDevice" #ifndef ANDROID_DEFAULT_CODE #include <cutils/xlog.h> #ifdef ALOGE #undef ALOGE #endif #ifdef ALOGW #undef ALOGW #endif ALOGI #undef ALOGI #ifdef ALOGD #undef ALOGD #endif #ifdef ALOGV #und...
22,450
8,411
#include "stdafx.h" #include "procoTcpSettings.h" #include "procoMsg.h" #include "procoMsgHelper.h" #include "procoClientThread.h" #include "CmdLineExec.h" using namespace ProtoComm; //****************************************************************************** //************************************************...
4,347
1,061
#include "DashboardLayout.h" void DashboardLayout::Setup(){ switch(layoutID){ case LAYOUT_SINGLE: Serial.println("use default single widget dashboard"); widget[0] = new DashboardWidget(Int2(10,10),Int2(470,310),GAUGE_TYPE_BAR,INPUT_ANALOG1); widgetCount = 1; break; case LAY...
2,205
850
#include <iostream> using namespace std; bool printArray(string* arr, int length){ if(arr == NULL){ return false; } for(int i = 0; i < length; i++){ cout << arr[i] << endl; } return true; } int main() { string arrMonth[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Au...
598
238
//// Copyright (c) 2018 Silvio Mayolo //// See LICENSE.txt for licensing details #ifndef SERIALIZE_HPP #define SERIALIZE_HPP #include "Instructions.hpp" #include "Assembler.hpp" /// \file /// /// \brief Serialization structures and helpers. /// serialize_t, on its own, is an incomplete type. Any type which is /// s...
9,590
2,856
#include <bits/stdc++.h> using namespace std; #define MM 102 int dp[MM][MM][3],arr[MM][MM]; //moved up, down, right char c; int main(){ while(1){ int m,n; scanf("%d%d",&m,&n); if(m == 0) break; for(int i = m; i > 0; i--){ scanf("%c",&c); //nl ...
3,208
1,405
#include "stdafx.h" #include "Image.h" #ifdef __ist_with_gli__ #include "gli/gli.hpp" #include "gli/gtx/loader.hpp" #endif // __ist_with_gli__ namespace ist { struct BMPHEAD { char B; char M; int32 file_size; int16 reserve1; int16 reserve2; int32 offset; BMPHEAD() ...
29,324
11,604
#include<bits/stdc++.h> using namespace std; /* Start of commonly used datatypes and constructs*/ using L = long long; #define FOR(i, s, e) for(L i = s; i<e; ++i) #define RFOR(i, s, e) for(L i = s; i>e; --i) #define F first #define S second #define SZ(container) ((int)container.size()) #define ALL(container) containe...
1,793
785
#include "__zz_cib_StlDependencyTest-decl.h" #include "__zz_cib_StlDependencyTest-export.h" #include "__zz_cib_StlDependencyTest-ids.h" #include "__zz_cib_StlDependencyTest-mtable.h" namespace __zz_cib_ { namespace __zz_cib_Class263 { const __zz_cib_MethodTable* __zz_cib_GetMethodTable(); }} namespace __zz_cib_ { name...
2,215
1,013
/* * Copyright (C) 2021 Frank Mertens. * * Distribution and use is allowed under the terms of the zlib license * (see cc/LICENSE-zlib). * */ #include <cc/pulse/InputStream> #include <cc/Format> #include <cc/DEBUG> #include <pulse/stream.h> #include <cassert> namespace cc::pulse { struct InputStream::State: pub...
3,128
1,001
#pragma once #include <thread> namespace mh { inline static const std::thread::id main_thread_id = std::this_thread::get_id(); inline bool is_main_thread() { return main_thread_id == std::this_thread::get_id(); } }
224
84
// Copyright 2018 The Cockroach Authors. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by the Apache License, ...
751
257
#include "gtest/gtest.h" #include <glaze/definition/Material.h> #include <glaze/brushes/GL_Desktop_Brush.h> #include "glaze_test/utility.h" using namespace std; using namespace glaze::definition; using namespace glaze; TEST(Box_Test, test_test) { auto code = load_shader("colored.vertex"); Materia...
835
327
/* * omnis.xcomp.widget * =================== * * widget.cpp * Widget library implementation * * Bastiaan Olij */ #include "widget.h" #ifdef iswin32 /* not yet supported */ #else #include "monitor_mac.h" #endif qshort mainlib::major() { return OMNISSDK; }; qshort mainlib::minor() { return 124; }; E...
7,356
2,780
// Copyright 2020 The Fuchsia 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 "storage/buffer/vmoid_registry.h" #include <gmock/gmock.h> #include <gtest/gtest.h> namespace storage { namespace { using ::testing::_; TEST(V...
1,008
423
/*Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm should run in O(n) time and uses constant space. Analysis: If we can use another array flag, we can assign flag[A[i]-1] = A[i] to present its occurrence.And get the...
1,834
693
// Copyright 2016 The Fuchsia Authors // // 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 agreed...
3,684
1,191
/* * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless...
3,303
1,176
/* Copyright © 2017-2019, Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable Energy, LLC. See the top-level NOTICE for additional details. All rights reserved. SPDX-License-Identifier: BSD-3-Clause */ #ifndef HELICS_CPP98_ENDPOINT_HPP_ #define HELICS_CPP98_ENDPOINT_HPP_ #p...
5,151
1,618
// ============================================================================ // // = LIBRARY // ULib - c++ library // // = FILENAME // ldap.cpp // // = AUTHOR // Stefano Casazza // // ============================================================================ #include <ulib/url.h> #include <ulib/ldap/ldap...
22,104
8,317
// Gmsh - Copyright (C) 1997-2019 C. Geuzaine, J.-F. Remacle // // See the LICENSE.txt file for license information. Please report all // issues on https://gitlab.onelab.info/gmsh/gmsh/issues. #include "GmshConfig.h" #include "discreteRegion.h" #include "MVertex.h" #include "GModelIO_GEO.h" #include "Geo.h" #include "...
3,334
1,244
#undef UNICODE #include <iostream> #include <Windows.h> #include <TlHelp32.h> LPCSTR Banner = \ "Usage>\n DLLInj.exe name notepad.exe DLLInj.dll\n DLLInj.exe pid 2323 DLLInj.dll"; DWORD FindProcess(DWORD PID, LPCSTR ProcessName, LPCSTR Mode) { HANDLE Snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, FALSE); ...
8,114
2,661
// // Copyright (c) 2013 Caitlin Potter and Contributors // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, t...
6,616
2,394
#include "ofApp.h" #include "photon.h" //-------------------------------------------------------------- void ofApp::setup() { ofSetWindowTitle("Annoianoids"); //ofSetLogLevel(OF_LOG_VERBOSE); ofSetFrameRate(60); ofEnableAlphaBlending(); ofEnableSmoothing(); ofSetWindowShape(1280, 960); mas...
19,351
7,220
#include "CTML.h" #include "dirent.h" bool add_files_to_doc(std::string folderPath, CTML::Node* containerNode) { DIR *directory = NULL; // open the folder path directory = opendir(folderPath.c_str()); // return false if it doesn't exist if (directory == NULL) { std::cout << "Directory not found!\n"; return fa...
2,684
916
#include "log.h" Info::Info() { } QString Info::Info
57
28
#include "ServerProtocol.h" #include "../../utils/Utils.h" namespace HttpServer { ServerProtocol::ServerProtocol( Socket::Adapter &sock, const ServerSettings &settings, ServerControls &controls ) noexcept : sock(sock), settings(settings), controls(controls) { } ServerProtocol::ServerPro...
4,487
1,856
#ifndef _S_VECTOR_CENTER_HPP_ #define _S_VECTOR_CENTER_HPP_ #include "sfield.hpp" #include "utility/tinyformat.hpp" #include "algebra/array/multi_array.hpp" #include <limits> namespace carpio{ template<St DIM, class FIELD> class SVectorCenter_{ public: typedef SIndex_<DIM> Index; typedef SGrid_<DIM> GridB...
2,434
899
/******************************************************************************* * Video encoding example *******************************************************************************/ int main(int argc, char** argv) { AVCodec *codec = NULL; AVCodecContext *codecCtx= NULL; AVFormatContext *pFor...
3,139
1,155
#include <optional> #include <string> #include <iostream> #include <vector> #include <algorithm> #include <range/v3/view/transform.hpp> #include <range/v3/view/filter.hpp> // We can define a range facade that allows using std::optional // as if it was a proper range (as in range-v3 library). // If the optional is emp...
1,442
501
/* * TestCase.cpp * * Created on: 2018/05/06 * Author: iizuka */ #include "test_utils/TestCase.h" #include "test_utils/TestGroup.h" #include "test_utils/TestGroupActions.h" #include "test_utils/Check.h" #include "test_utils/TestEnv.h" #include "test_utils/TestParams.h" #include "base/UnicodeString.h" #incl...
3,951
1,521
#include <iostream> #include <dirac_quda.h> #include <dslash_quda.h> #include <blas_quda.h> namespace quda { DiracDomainWall::DiracDomainWall(const DiracParam &param) : DiracWilson(param, 5), m5(param.m5), kappa5(0.5 / (5.0 + m5)), Ls(param.Ls) { } DiracDomainWall::DiracDomainWall(con...
6,463
2,741
// Copyright (c) 2018 David Nadaski. All Rights Reserved. #include "CoverSystem/CoverSubsystem.h" #include "EngineUtils.h" #include "Tasks/NavmeshCoverPointGeneratorTask.h" #if DEBUG_RENDERING #include "DrawDebugHelpers.h" #endif // PROFILER INTEGRATION // DEFINE_STAT(STAT_GenerateCover); DEFINE_STAT(STAT_GenerateC...
7,914
2,923