text
string
size
int64
token_count
int64
/** * Testing for the subprocess library. * Uses the Catch2 testing library (https://github.com/catchorg/Catch2) */ #define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file #include "catch.hpp" #include "subprocess.hpp" TEST_CASE("basic echo execution", "[subprocess::exec...
5,968
2,104
#pragma once #include <QAbstractListModel> class ConversionModel final : public QAbstractListModel { Q_OBJECT Q_PROPERTY(QString sourceMsg READ sourceMsg NOTIFY sourceMsgChanged) public: ConversionModel() = delete; explicit ConversionModel(QObject *parent = nullptr); ConversionModel(const Conv...
1,446
451
#include "ArrSettings.h" #include <QSettings> void ArrSettings::SetVideoWidth(int width) { width = std::clamp(width, s_videoWidthMin, s_videoWidthMax); if (m_videoWidth != width) { m_videoWidth = width; Q_EMIT OptionsChanged(); } } void ArrSettings::SetVideoHeight(int height) { he...
2,411
874
#include "simulation/ogh.h" #include "simulation/curve.h" #include "mechanics/drive.h" #include "misc/io.h" float maximize_speed_with_throttle(float accel, float v0, float sf); float maximize_speed_without_throttle(float accel, float v0, float sf); void Curve::write_to_file(std::string prefix) { write(...
7,697
3,231
#include "foo.h" #include <iostream> void Foo::Print(std::string content){ cb_->Print(content); }
104
38
//******************************************************************************* // // Class Name : CTriggerMonitor // // Author : James Simpson (Microsoft Consulting Services) // // Description : This class represents a worker thread that performs // trigger monitoring and processing. Eac...
40,144
13,943
// Copyright (c) 2018, ZIH, // Technische Universitaet Dresden, // Federal Republic of Germany // // 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...
5,797
1,690
#include "testing.h" #include "v8toolkit/javascript.h" using namespace testing; int main(int argc, char* argv[]) { // std::cerr << fmt::format("platform::init") << std::endl; v8toolkit::Platform::init(argc, argv, "../"); // std::cerr << fmt::format("platform::init done") << std::endl; testing::InitGoog...
370
132
// Copyright 2019 Shun Kakinoki. // Reference: https://www.hackerrank.com/challenges/variable-sized-arrays/forum #include <iostream> using namespace std; int main() { int n, q; cin >> n >> q; // Create 2d Array int** a = new int*[n]; // Fill 2d Array with 1d Subarrays for (int i = 0; i < n; i++) { ...
798
347
// // Oneshot.cpp // Author: Dale Johnson // Contact: valley.audio.soft@gmail.com // Date: 5/12/2017 // // Copyright 2017 Dale Johnson // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of sourc...
2,521
923
#ifndef CUBOS_CORE_ECS_NULL_STORAGE_HPP #define CUBOS_CORE_ECS_NULL_STORAGE_HPP #include <cubos/core/ecs/storage.hpp> namespace cubos::core::ecs { /// @brief NullStorage is a Storage implementation that doesn't keep any data, made for components /// that don't hold any data and just work as tags. /// @tp...
982
348
#include "DriveSystem.h" phil::DriveSystem::DriveSystem( pal::Gpio* left_step, pal::Gpio* left_dir, pal::Gpio* right_step, pal::Gpio* right_dir, pal::Tim* us_tick, float width, float wheel_radius, float radians_per_step): WIDTH(width), WHEEL_RADIUS(wheel_radius), RADI...
6,992
2,319
/* -LICENSE-START- ** Copyright (c) 2009 Blackmagic Design ** Copyright (c) 2011 Luca Barbato ** ** Permission is hereby granted, free of charge, to any person or organization ** obtaining a copy of the software and accompanying documentation covered by ** this license (the "Software") to use, reproduce, display, distr...
19,662
6,420
#include <jni.h> extern "C" JNIEXPORT void JNICALL Java_com_jpegkit_app_MainActivity_init(JNIEnv *env, jobject obj) { }
120
52
#include<bits/stdc++.h> using namespace std; struct node { int data; node *next; }; node *head1 = NULL, *head2 = NULL, *tail1 = NULL, *tail2 = NULL ; node *temp1 = NULL, *temp2 = NULL, *temp = NULL; void createNode1(int value){ node *temp = new node; temp->data = value; if(head1==NU...
1,820
681
/** * @file decode.cpp * @author Haoxuan Zhang (zhanghx59@mail2.sysu.edu.cn) * @brief * @version 0.1 * @date 2019-12-19 * * @copyright Copyright (c) 2019 * */ #include "decode.h" #include "ifft2d.h" Mat getDecodeImg(fftPair *encode, fftPair *origin, vector<vector<float> > &vec){ int width = encode->im...
2,511
1,037
#include "datasource_c_api.h" #include "datasource_impl.hh" #include "cached_datasource.hh" #include "datasource_impl.hh" #include "feature_impl.hh" #include "geometry_datasource.hh" #include "make_geometry_datasource.hh" #include "make_raster_datasource.hh" #include "raster_datasource.hh" #include "raster_impl.hh" #...
1,703
685
#include "monolish_mpi.hpp" template <typename T> T test_sum(std::vector<T> &vec) { monolish::mpi::comm &comm = monolish::mpi::comm::get_instance(); double sum = 0; for (size_t i = 0; i < vec.size(); i++) { sum += vec[i]; } return comm.Allreduce(sum); } int main(int argc, char **argv) { if (argc !...
1,369
578
//------------------------------------------------------------// // Class for identification of pions,kaons and protons in ITS // // Prior particles population (probabilities) are taken from // // Hijing event generator. // //-----------------------------------------------------------...
16,618
8,189
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for(int i = a; i < (b); ++i) #define trav(a, x) for(auto& a : x) #define all(x) x.begin(), x.end() #define sz(x) (int)(x).size() typedef long long ll; typedef pair<int, int> pii; typedef vector<int> vi; int main() { vi shop; int n; cin >> n; rep(i,...
536
264
/** @file image_signal_processing.cpp * @brief source file for ISP pipeline * * Name : image_signal_processing.cpp * * Authors : Sayandip De (sayandip.de@tue.nl) * Sajid Mohamed (s.mohamed@tue.nl) * * Date : March 26, 2020 * * Function : run different approx...
11,970
4,277
/** * @file add_rvalue_reference.hpp * * @brief add_rvalue_reference の定義 * * @author myoukaku */ #ifndef BKSGE_FND_TYPE_TRAITS_ADD_RVALUE_REFERENCE_HPP #define BKSGE_FND_TYPE_TRAITS_ADD_RVALUE_REFERENCE_HPP #include <type_traits> namespace bksge { /** * @brief 型に右辺値参照を追加する * * @tparam ...
839
457
#include "pch.h" #include "Base64.h" namespace ChainBlocker { std::vector<unsigned char> Base64::Decode( std::string input, size_t inputLength, size_t* outputLength) { std::vector<unsigned char> output; const unsigned char* inputBuffer = reinterpret_cast<const unsigned char*>(input.c_str()); const size...
1,679
652
// // __ __ __ // / / / /__ __ ____/ /_____ ____ // / /_/ // / / // __ // ___// __ \ // / __ // /_/ // /_/ // / / /_/ / // /_/ /_/ \__, / \__,_//_/ \____/ // /____/ // // ...
644
201
/** * Copyright (c) 2017-present, Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
5,233
2,369
#include <nigiri.h> #include <vector> #include <stdexcept> #include <algorithm> #include <cassert> #include <bits/shared_ptr.h> #include "JVMForeignRuntime.h" #include "JVMPrimitives.h" #include "JVMOpParams.h" #include "JVMThread.h" #include "JVMInternalWrappers.h" namespace nigiri { namespace internal { ...
51,830
14,116
#include <algorithm> #include "texture.hpp" #include "texture_format.hpp" #include "texture_view.hpp" #include "buffer.hpp" #include "constants.hpp" namespace AgpuVulkan { inline enum VkImageType mapImageType(agpu_texture_type type) { switch (type) { case AGPU_TEXTURE_2D: return VK_IMAGE_TYPE_2D; case...
21,869
7,032
/** * @file ModeBase * @brief * @author arwtyxouymz * @date 2019-06-04 11:31:01 */ #ifndef _ModeBase_HPP #define _ModeBase_HPP #include <string> #include <vector> #include <ros/ros.h> #include "maxon_epos_driver/Device.hpp" class ControlModeBase { public: std::string name; virtual ~Con...
953
322
#include "types.h" #include "JSystem/JUT/ResFONT.h" const int JUTResFONT_Ascfont_fix12[] ATTRIBUTE_ALIGN(32) = { 0x464F4E54, 0x62666E31, 0x00004160, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x494E4631, 0x00000020, 0x0000000C, 0x0000000C, 0x000C0000, 0x00000000, 0x9FFFFFFF, 0x7FFFFFFF, 0x57...
52,229
48,658
/* * This file is part of Nand2Tetris. * * Copyright © 2013-2020 Jonathan Miller * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the...
8,178
2,551
/* * Photoconsistency-Visual-Odometry * Multiscale Photoconsistency Visual Odometry from RGBD Images * Copyright (c) 2012, Miguel Algaba Borrego * * http://code.google.com/p/photoconsistency-visual-odometry/ * * All rights reserved. * * Redistribution and use in source and binary forms, with or without ...
4,397
1,382
#include "CppMockIO/timers/backend.h" #include <mutex> #include <stdexcept> #include <cassert> #define WIN32_LEAN_AND_MEAN #include <sdkddkver.h> #include <Windows.h> namespace CppMockIO { namespace timers { namespace backend { namespace { void safe_run_action(const runnable& runnabl...
2,998
921
// moderngpu copyright (c) 2016, Sean Baxter http://www.moderngpu.com #pragma once #include "types.hxx" #include "intrinsics.hxx" BEGIN_MGPU_NAMESPACE //////////////////////////////////////////////////////////////////////////////// // reg<->shared template<int nt, int vt, typename type_t, int shared_size> MGPU_DEVI...
5,996
2,522
//////////////////////////////////////////////////////////////////////// // // Implementation of oscillations of neutrinos in matter in a // three-neutrino framework. // // coelho@lal.in2p3.fr //////////////////////////////////////////////////////////////////////// #include <iostream> #include "PMNS_Iter.h" using nam...
3,595
1,447
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "core/css/parser/CSSLazyParsingState.h" #include "core/css/parser/CSSParserTokenRange.h" #include "core/frame/UseCounter.h" namespace blink { C...
2,259
644
/* Team member: Lim Kai Xian Group: CookieZ studentID: S10195450H */ #pragma once #include "stdafx.h" #include "Queue.h" #include <string> using namespace std; Queue::Queue() { size = 0; current = 0; salt = rand() % 512;} Queue::~Queue() { while (!isEmpty()) { dequeue_back(); } current = NULL; size = NULL; }...
2,687
1,083
#include <reproc++/reproc.hpp> #include <reproc++/sink.hpp> #include <array> #include <iostream> static int fail(std::error_code ec) { std::cerr << ec.message(); return 1; } // Uses reproc++ to print CMake's help page. int main() { reproc::process process; // The `process::start` method works with any conta...
2,290
701
// SPDX-License-Identifier: BSD-2-Clause #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <assert.h> #include <sys/time.h> #include <HostLink.h> #include "heat.h" // Magnification factor when displaying heat map const int MAG = 2; // 256 x RGB colours representing heat intensities int heat[] = { ...
6,625
5,253
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: TSCHArchives.Common.proto #include "TSCHArchives.Common.pb.h" #include <algorithm> #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/extension_set.h> #include <google/protobuf/wire_format_lite.h> #include <google/protobuf/des...
178,287
67,055
#include "TrafficLightSystem.h" #include "RedState.h" TrafficLightSystem::TrafficLightSystem() { _currentState = RedState::GetInstance(); } void TrafficLightSystem::Update() { _currentState->Execute(this); } void TrafficLightSystem::ChangeState(TrafficLightState* newState) { _currentState->Exit(this); _currentSt...
367
125
#include "decimal.h" decimal::decimal() { ASSERT(_D_SIZE_>_D_PREC_); parse_string=true; memsetd(number, 0, _D_SIZE_); sign=1; trim_trailing_zeroes=true; print_precision=DECIMAL_PRECISION; rounding_mode=DEFAULT_ROUNDING; parse_string=true; } void decimal::FromString(String s) { int i=0, idx=-1, ...
12,497
6,066
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * $Id: vtkFLTKOpenGLRenderWindow.cxx,v 1.44 2005/04/27 02:47:07 xpxqx Exp $ * * Copyright (c) 2002 - 2005 Sean McInerney * All rights reserved. * * See Copyright.txt or http://vtkfltk.sourceforge.net/Copyright.html * for details. * ...
45,042
15,735
#include "BFDataManager.h" #include <utility> namespace BlackFox::Editor { BFDataManager::BFDataManager(IBFResourcesHolder::Ptr resourcesHolder) : m_resourcesHolder(std::move(resourcesHolder)) { } BFDataManager::BFDataManager(BFDataManager&& dataManager) noexcept : m_resourcesHolder(std::move(dataManager.m_re...
1,811
643
/* |---------------------------------------------------------| | ___ ___ _ _ | | / _ \ _ __ ___ _ __ |_ _|_ __ | |_ ___ _ __ | |_ | | | | | | '_ \ / _ \ '_ \ | || '_ \| __/ _ \ '_ \| __| | | | |_| | |_) | __/ | | || || | | | || __/ | | | |_ | | \___/| .__/ \...
2,757
849
#include <iostream> int main(int argc, char* argv[]) { std::cout << "Hello World Cmake Flag" << std::endl; #ifdef EX2 std::cout << "define flags EX2 succeed! " << std::endl; #endif #ifdef EX3 std::cout << "define flags EX3 succeed! " << std::endl; #endif return 0; }
287
108
// HCSR04wrapper.cpp #include "NewPing.h" // setup for max of 3 sonar readings: NewPing sonar1(0,0,0); // NewPing setup of pins and maximum distance. NewPing sonar2(0,0,0); // NewPing setup of pins and maximum distance. NewPing sonar3(0,0,0); // NewPing setup of pins and maximum distance. extern "C" void HCSR04Sonar...
3,514
1,133
#include<cstdio> #include<algorithm> using namespace std; const int MAXN=1e5; int N,a[MAXN]; int main(void) { // freopen("in.txt","r",stdin); scanf("%d",&N); for(int i=0; i<N; i++) scanf("%d",&a[i]); int cnt=0; for(int i=0; i<N; i++) { if(a[i]==i) continue; ...
574
271
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
2,318
794
// 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 "android_webview/native/intercepted_request_data_impl.h" #include "android_webview/native/input_stream_impl.h" #include "base/android/jni_an...
1,935
652
// Type.cpp // This file is part of the EScript programming language (https://github.com/EScript) // // Copyright (C) 2011-2013 Claudius Jähn <ClaudiusJ@live.de> // Copyright (C) 2012 Benjamin Eikel <benjamin@eikel.org> // // Licensed under the MIT License. See LICENSE file for details. // -----------------------------...
6,209
2,187
// CLASSIFICATION: UNCLASSIFIED #include "CoordinateSystemParameters.h" #include "CoordinateType.h" using namespace MSP::CCS; CoordinateSystemParameters::CoordinateSystemParameters() : _coordinateType( CoordinateType::geodetic ) { } CoordinateSystemParameters::CoordinateSystemParameters( MSP::CCS::CoordinateType:...
1,081
326
#include "player_input.hpp" namespace wind {} // namespace wind
65
19
#include "ch_13.6.3_cont.h" #include <string> using std::string; int main() { StrVec vec; //空StrVec string s = "some string or another"; vec.push_back(s); //调用push_back(const string&) vec.push_back("done"); //调用push_back(string&&) 字面值是右值,此处是(从"done"创建的临时string) return 0; }
282
134
#include <cl.hxx> #include <log.hxx> #include <ut/integral.hxx> #include <application.hxx> using namespace ut::literals; fractal::configuration g_config{ }; lg::severity_level g_logLevel{ }; bool g_verbose{ }; cl::handler g_handler{ cl::application_name("fractal"), cl::help_argument{ }, cl::integer_argument<u...
3,225
1,264
#include <iostream> #include <concepts> #include <type_traits> template<typename T> concept always_true = true; template<typename T> concept always_true_2 = requires { requires true; }; template<typename T> requires always_true<T> void good(T) {} // ALWAYS compiles template<typename T> requires always_true_2<T> void ...
4,450
1,669
/* Copyright (C) 2016-2021 Rubén Titos <rtitos@um.es> Universidad de Murcia GPLv2, see file LICENSE. */ #ifndef __MEM_RUBY_HTM_XACTVISUALIZER_HH__ #define __MEM_RUBY_HTM_XACTVISUALIZER_HH__ #include <ostream> #include <vector> #include "mem/ruby/profiler/annotated_regions.h" #include "mem/ruby/system/Se...
725
304
#include <bits/stdc++.h> using namespace std; const int N = 3; const char marks[2] = {'X', 'O'}; char grid[N][N]; vector<pair<int,int > > v; //This function prints the grid of Tic-Tac-Toe Game as the game progresses void print_grid() { cout << "Player 1: " << marks[0] << " vs Player 2: " << marks[1] << "\n"; ...
4,405
1,592
#include "WS2812SDCard.h" /** @brief Opens a given file and reads the frame data into the matrix display array. Note: The first row of all frame files is used to give file information. - When reading such files, skip the first row. - The led data begins on the second row. Every 6 characters is the string val...
3,926
1,155
#include<iostream> #include<cstdio> #include<cstring> using namespace std; #define mms(tpp,xgg) memset(tpp,xgg,sizeof(tpp)) typedef long long ll; const ll inf=30001; // 1.计算质数 ll prime[inf],ta[inf],pc; void pt() { for(ll i=2;i<inf;i++) { ta[i]=1; } for(ll i=2;i<inf;i++) { if(ta[i]) { prime[...
1,590
879
//#include "this/package/foo.h" #include "gtest/gtest.h" //#include "../engine/public/color.h" //#include "engine/public/color.h" #include "color.h" #include "bmp/bmp.h" namespace tinytracer { namespace { // The fixture for testing class Foo. class FooTest : public ::testing::Test { ...
1,778
550
//----------------------------------------------------------------------------- // HIMG, by Marcus Geelnard, 2015 // // This is free and unencumbered software released into the public domain. // // See LICENSE for details. //----------------------------------------------------------------------------- #include "huffma...
10,207
3,625
///////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "Studio.h" #include "ResourcesDoc.h" #include ".\resourcesdoc.h" ///////////////////////////////////////////////////////////////////////////// #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE st...
31,881
12,477
#include "server_threaded.hpp" #include "log.hpp" #include <chrono> #include <iostream> #include <regex> #include <stdexcept> #include <string> #include <thread> using tcp = boost::asio::ip::tcp; BeastKing::ServerThreaded::ServerThreaded(AppPtr app, const std::string& addr) : BeastKing::Server(app, addr) {} BeastKi...
2,054
753
/* Copyright (c) 2015, Advanced Micro Devices, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and ...
2,629
949
#include "Odom.h" void Odom::publishInitialPose(const ros::Time &time, double x, double y, double yaw) { geometry_msgs::PoseWithCovarianceStamped msg; msg.header.stamp = time; msg.header.frame_id = worldFrameId; msg.pose.pose.position.x = x; msg.pose.pose.position.y = y; ...
3,533
1,436
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Fixed.cpp :+: :+: :+: ...
4,455
1,515
#pragma once // ARKSurvivalEvolved (329.9) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "ARKSurvivalEvolved_DinoAttackStateFollowSpline_classes.hpp" namespace sdk { //--------------------------------------------------------------------------- //Parameters //------------------------------------------...
5,034
1,454
/** * Copyright (c) 2020 Filip Klembara (in2core) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * *...
6,760
2,064
/* * Copyright (c) 2003-2010 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU * General Public License as published by the Free Software * Foundation; either version 2 of the License, or...
2,771
914
#include <catch2/catch.hpp> #include <clocale> #include <jsonlint/lexer.hpp> using namespace jsonlint; TEST_CASE("Integer '0'", "[lexer]") { std::string filename = ""; std::string source = "0"; Lexer lexer{"", 0, "", 1, 1}; lexer.filename = filename; lexer.source = source; auto tokens = Tokenize(lexer); ...
5,434
2,434
#include <boost/test/unit_test.hpp> #include <string> #include <vector> #include "key.h" #include "base58.h" #include "uint256.h" #include "util.h" using namespace std; /* * make from gwangcoin/contrib/pycoin ~/Projects/gwangcoin/contrib/pycoin $ ku -nGW 1 input : 1 network ...
8,154
3,866
#include <OE_Error.h> #include <OE_TaskManager.h> #include <Events/OE_Event.h> #include <types/OE_Libs.h> using namespace std; // This is where events' error handling is happening int OE_Event::internal_call(){ /***************************/ ///generic handling if (!this->has_init_){ this->task_ ...
15,254
5,133
#include "DispatchManager.h" #include "Common.h" #include "ConfigManager.h" #include "ModuleConfig.h" DispatchManager& g_DispatchManager() { static DispatchManager* ans = new DispatchManager(); return *ans; } void DispatchManager::Register(std::string entryPointKey, std::function<int(void**)> entryPoint) { ...
1,206
377
/* Copyright (c) 2019, isaponsoft (Isao Shibuya) All rights reserved. * * Use of this source code is governed by a BSD-style license that * * can be found in the LICENSE file. */ #include <amtrs/application.hpp> #include <amtrs/.driver/android-api-android_app.hpp> #include <amtrs/...
2,597
1,029
#include "multiply.h" uint32_t multiply(uint32_t multiplicant, uint32_t multiplier) { return multiplicant * multiplier; }
127
49
/* * min_max_filter.hpp * * Created on: Oct 6, 2013 * Author: mdantone */ #ifndef MIN_MAX_FILTER_HPP_ #define MIN_MAX_FILTER_HPP_ #include "opencv2/core/core.hpp" namespace vision { class MinMaxFilter { public: static void maxfilt(cv::Mat &src, unsigned int width); static void minfilt(cv::Mat &src,...
924
299
// // Created by pzz on 2021/10/30. // #include <iostream> #include <algorithm> #include <vector> #include <stack> using namespace std; class Solution { public: int evalRPN(vector<string> &tokens) { stack<int> stack; for (const string &s: tokens) { if (s == "+" || s == "-" || s == "*"...
1,163
367
/* * File: MotionHandler.cpp * Author: Sean Watson * Date: Feb 2013 * * Description: Implementation file for MotionHandler library * * Copyright (c) 2013 Sean Watson * Licensed under the MIT license * */ #include "MotionHandler.h" MotionHandler::MotionHandler(const Accelerometer* const accel, Hardwar...
1,322
504
#include "listdialog.h" #include "editdialog.h" #include "ui_listdialog.h" // Listing 2-3: Constructor of the ListDialog class ListDialog::ListDialog(QWidget* parent) : QDialog(parent), ui(new Ui::ListDialog) { ui->setupUi(this); connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addItem())); connect(u...
1,246
439
/* @ Kingsley Chen */ #include <Windows.h> #include <conio.h> #include <process.h> #include <cmath> #include <cstdint> #include <iostream> #include "kbase\command_line.h" #include "kbase\memory\scoped_handle.h" #include "kbase\sys_info.h" const unsigned long kDefaultTimeUnit = 1000; const wchar_t kPlotSwitchName[...
3,541
1,205
#include <stdio.h> #include <vector> #include <algorithm> using namespace std; /* Leetcode */ /* Type: array */ /* 题目信息 */ /* *283. Move Zeroes Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. Example: Input: [0,1,0,3,12] Output: [...
1,879
788
#include "ResourceMesh.h" #include "ModuleResources.h" ResourceMesh::ResourceMesh(uint uid, Resource_Type type) : Resource(uid, type) { } ResourceMesh::~ResourceMesh() { } bool ResourceMesh::LoadInMemory() { bool ret = false; glGenBuffers(1, (GLuint*) &(id_vertices)); glBindBuffer(GL_ARRAY_BUFFER, id_vertices); ...
909
391
#include "vertex.h" // Represents a vertex in 3D space Vertex::Vertex (Vector4 position, Vector4 normal) : m_position(position), m_normal(normal) {} Vertex::Vertex(float x, float y, float z, float w) { m_position = Vector4(x, y, z, w); m_normal = Vector4(0, 0, 0, 0); } // Perspective divide by w component V...
1,211
470
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. #include "precomp.hpp" #include "accum.simd.hpp" #include "accum.simd_declarations.hpp" // defines CV_CPU_DISPATCH_MODES_AL...
680
299
#include "vsrtl_multiplexergraphic.h" #include "vsrtl_portgraphic.h" #include <QPainter> namespace vsrtl { MultiplexerGraphic::MultiplexerGraphic(SimComponent* c, ComponentGraphic* parent) : ComponentGraphic(c, parent) { // Make changes in the select signal trigger a redraw of the multiplexer (and its input sign...
1,437
446
#ifndef SWAMP_HPP #define SWAMP_HPP #include "cards/Land.hpp" class Swamp : public Land { public: Swamp(); Swamp(const Swamp& other) = default; ~Swamp(); Swamp& operator=(const Swamp& other) = default; std::string get_full_type() const override; Color get_color() const override; std::string get_name() const...
420
152
#include <bits/stdc++.h> using namespace std; using ll = long long; using db = long double; // or double, if TL is tight using str = string; // yay python! using pi = pair<int,int>; using pl = pair<ll,ll>; using pd = pair<db,db>; using vi = vector<int>; using vb = vector<bool>; using vl = vector<ll>; using vd = vec...
12,357
5,768
#include "pch.h" #include "LogTargetManager.h" #include <string> #include <memory> #include <cstdarg> namespace CLogger { std::vector<std::shared_ptr<ILogTarget>> LogTargetManager::m_targets; std::mutex LogTargetManager::m_mtx; DLLEXPORT void LogTargetManager::AddLogTarget(std::shared_ptr<ILogTarget> logTarget) ...
715
306
//========================================================================== // ObTools::XML: test-config.cc // // Test harness for ObTools XML configuration // // Copyright (c) 2017 Paul Clark. All rights reserved // This code comes with NO WARRANTY and is subject to licence agreement //==============================...
3,157
1,142
#ifndef __QUICK_ACTION_BAR__ #define __QUICK_ACTION_BAR__ #include <string.h> #include "sdl2/Renderer.hpp" #include "game/SceneState.hpp" #include "rogue-card/coordinates.hpp" #include "Player.hpp" class QuickActionBarScene : public SceneState { private: std::shared_ptr<SDL2Renderer> m_renderer; Player &m_player; ...
832
310
#include "NetworkManager.h" NetworkManager::NetworkManager(BearSSLClient& sslLambda, MqttClient& mqttClient, Config& config) : sslLambda(sslLambda), mqttClient(mqttClient), m_config(config) { } NetworkManager::~NetworkManager() { } int NetworkManager::init() { if (!ECCX08.begin()) { print("Could no...
4,278
1,508
class Solution { public: int maxResult(vector<int>& nums, int k) { int n = nums.size(); priority_queue<pair<int, int>> q; vector<int> ans(n, -1e9); for (int i = 0; i < n; ++i) { if (i == 0) { ans[i] = nums[i]; q.push({ans[i], i}); ...
800
270
#include<iostream> using namespace std; int main() { string s = "My name is Jimut"; system("s > file1"); return 0; }
123
50
//g = 3 //998244353, img = 86583718 //1004535809 = 479*2^21+1, img = 483363861 //469762049, img = 19610091 //tp == false means NTT^-1 void NTT(int a[], int n, bool tp) { for (int i = 0, j = 0; i < n; ++i) { if (i > j) swap(a[i], a[j]); for (int k = n >> 1; (j ^= k) < k; k >>= 1); } for (int i = 2; i <= n; i <<= ...
4,721
2,554
#define PY_SSIZE_T_CLEAN #pragma once #include <Python.h> #include "bcn.h" #include "pvrtc.h" #include "etc.h" #include "atc.h" #include "astc.h" #include "crunch.h" #include "unitycrunch.h" /* ************************************************* * * general decoder function headers * *****************************...
9,861
3,551
#ifdef PEGASUS_OS_FREEBSD #ifndef __UNIX_MOREROLEINFO_PRIVATE_H #define __UNIX_MOREROLEINFO_PRIVATE_H #endif #endif
122
68
#include "gametitle.h" #include "buttonwidget.h" #include "data_title.h" #include "gamecredits.h" #include "gamerunning.h" #include "gamebuino_fix.h" #include <cassert> namespace { uint16_t gameStartSound[] = { 0x0005, 0x178, 0x17A, 0x27C, 0x17E, 0x180, 0x286, 0x188, 0x0000 }; c...
2,555
950
#include <QtCore> #include <QtGui> #include <QtWidgets> #include "mainwindow.hpp" MainWindow::MainWindow() : dbus("org.mpris.MediaPlayer2.spotify", "/org/mpris/MediaPlayer2", "org.mpris.MediaPlayer2.Player", QDBusConnection::sessionBus()) { setWindowTitle(tr("Spotify")); ...
5,083
1,508
/*============================================================================= Copyright (c) 2011-2019 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout 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) ==...
678
267
/** BSD-3-Clause Copyright 2019 Alliance for Sustainable Energy, LLC 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 and the...
13,444
4,611