text
string
size
int64
token_count
int64
#include <iostream> #include <conio.h> #include <stdlib.h> using namespace std; class student { char name[100]; int id,age; public: void getdata() { cout<<"\nEnter name: "; cin>>name; cout<<"Enter id: "; cin>>id; cout<<"Enter age: "; cin>>age; } v...
724
287
/* Copyright ©1994-1996, Juri Munkki All rights reserved. File: CSoundMixer.c Created: Friday, December 23, 1994, 08:25 Modified: Tuesday, August 20, 1996, 00:20 */ #include "CSoundMixer.h" #include "CBasicSound.h" #include "CSoundHub.h" #include "Memory.h" #include "System.h" #define DONT_USE_M...
14,476
5,061
#include "index_buffer.h" #include "staging_buffer.h" #include "gfx/graphics.h" #include "gfx/buffers/command_buffer.h" IndexBuffer::IndexBuffer(const void* data, VkDeviceSize count, IndexType index_type, VmaMemoryUsage memory_usage) : Buffer(count * indexTypeSize(index_type), VK_BUFFER_USAGE_TRANSFER_DST_BIT | V...
1,114
431
// CharacterCounting.cpp // Programa para contar los caracteres contenidos en un string #include <iostream> #include <stdlib.h> #include <stdio.h> #include <string.h> int main() { char str[100]; int i, j, n, k, o; i=0; j=0; k=0; o=0; puts("Introduce una frase"); gets(str); n=strlen(str); while(str[i...
780
376
#include "gui/qrsystemtray.h" #include <QtCore/qdebug.h> #include <QtCore/qmap.h> #include <QtWidgets/qsystemtrayicon.h> #include <QtWidgets/qaction.h> #include <QtWidgets/qmenu.h> #include <QtWidgets/qapplication.h> #include "db/qrtblsystemtray.h" #include "db/qrtblframeconfig.h" NS_CHAOS_BASE_BEGIN class QrSyste...
3,002
1,068
#include "MainWindow.h" #include "CrcCheck.h" #include <QSerialPort> #include <QSerialPortInfo> #include <QStandardPaths> #include <QMessageBox> #include <QSettings> #include <QFileInfo> #include <QDebug> #include <QTimer> #include <QDir> #include <QDomDocument> #include <QDateTime> #include <QStandardItemModel> #incl...
17,283
6,274
#include <iostream> class A { public: void fun() { std::cout << "Hello" << std::endl; } }; int main() { A a; void (A::* f_ptr) () = &A::fun; (a.*f_ptr)(); }
181
82
#include "PG/physics/PhysicsWorld.h" #include "PG/physics/PhysicsBody.h" #include "PG/app/GameConstants.h" #include "PG/entities/TilePositionCalculator.h" #include "PG/core/RectUtils.h" #include "PG/core/PointUtils.h" #include "PG/core/SizeUtils.h" #include "PG/core/MathsUtils.h" #include <array> namespace PG { name...
6,140
2,354
#include <apex/sqlite/connection.hpp> #include <apex/sqlite/memory.hpp> #include <apex/sqlite/table.hpp> #include <apex/sqlite/error.hpp> #include <apex/core/memory.hpp> #include <apex/memory/out.hpp> #include <sqlite3.h> namespace apex::sqlite { void default_delete<sqlite3>::operator () (sqlite3* ptr) noexcept { s...
1,269
450
/** @author heweibright@gmail.com * @date 2021/9/3 11:06 * Copyright (c) All rights reserved. */ #include <iostream> #include <unistd.h> #include <cstdlib> #include <cstring> #include <sys/socket.h> #include <arpa/inet.h> const int BUF_SIZE = 1024; void error_handling(const char *msg) { std::cerr << msg <<...
1,669
692
// This file is part of the Robotic Template Library (RTL), a C++ // template library for usage in robotic research and applications // under the MIT licence: // // Copyright 2020 Brno University of Technology // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and ass...
17,150
6,225
/************************************************************** * * 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 y...
10,700
3,072
// Copyright 2018 The Chromium OS 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 <brillo/flag_helper.h> #include <brillo/syslog_logging.h> #include "bluetooth/common/dbus_daemon.h" #include "bluetooth/newblued/newblue.h" #...
784
281
/* A Harshad or Niven number is a number that is divisible by the sum of its digits. 201 is a Harshad number because it is divisible by 3 (the sum of its digits.) When we truncate the last digit from 201, we get 20, which is a Harshad number. When we truncate the last digit from 20, we get 2, which is also a Harshad ...
2,899
942
// $Id: Incoming_Message_Queue.cpp 91628 2010-09-07 11:11:12Z johnnyw $ #include "tao/Incoming_Message_Queue.h" #include "tao/Queued_Data.h" #include "tao/debug.h" #include "ace/Log_Msg.h" #include "ace/Malloc_Base.h" #if !defined (__ACE_INLINE__) # include "tao/Incoming_Message_Queue.inl" #endif /* __ACE_INLINE__ *...
2,027
849
/* Amine Rehioui Created: November 05th 2011 */ #include "ShootTest.h" #include "Kamikaze.h" namespace shoot { DEFINE_OBJECT(Kamikaze); DEFINE_OBJECT(KamikazeSettings); //! constructor KamikazeSettings::KamikazeSettings() : m_fDuration(1.5f) { } //! serializes the entity to/from a PropertyStream void...
1,921
811
// GaugeConnect.cpp #include <MSFS/MSFS.h> #include <MSFS/MSFS_WindowsTypes.h> #include <MSFS/Legacy/gauges.h> #include <SimConnect.h> #include <cstring> #include "GaugeConnect.h" struct Expression { bool valid; double value; char* expression; UINT32 expr_len; Expression(void) : valid(false), ex...
7,324
3,241
#include "EntTeleportAction.hpp" namespace ub { EntTeleportAction::EntTeleportAction(World* world, glm::vec2 destination) : ScriptAction(world), m_destination(destination) { } void EntTeleportAction::Initialize() { } void EntTeleportAction::Update(float dt) { m_world->MoveEnt(1, m_destination); m_...
341
137
#include "../common.h" #include "AddMessageTest1.h" #include "AddMessageTest2.h" #include "ConcurrencyTest1.h" #include "ConcurrencyTest2.h" #include "FindMessageTest1.h" Test *MessageQueueTestSuite() { TestSuite *testSuite = new TestSuite(); testSuite->addTest(AddMessageTest1::suite()); testSuite->addTest(AddMe...
559
209
#include <iostream> using namespace std; int main() { int qtdNumbers, sum; string number; bool stopped; while(cin >> qtdNumbers >> number) { sum = 0; while(qtdNumbers--) { sum +=(number[qtdNumbers] - '0'); } if(sum % 3 == 0) { cout << sum...
420
144
#ifndef ELF_HPP_ #define ELF_HPP_ #include <mm/vmm.hpp> #include <string.hpp> #include <fs/fd.hpp> namespace elf { constexpr size_t elf_signature = 0x464C457F; constexpr size_t elf64 = 0x2; constexpr size_t ei_class = 0x4; constexpr size_t ei_data = 0x5; constexpr size_t ei_version = 0x6; constexpr size_t ei_osabi ...
2,142
1,019
#include <iostream> using namespace std; int main() { int length, width, height; double percetage; cin >> length >> width >> height >> percetage; double volumeInSM = length * width * height; double liters = volumeInSM / 1000; double unusedLiters = liters * percetage / 100.0; double used...
387
139
#include "StdAfx.h" #include "UIGuildBankForm.h" #include "uiform.h" #include "uilabel.h" #include "uiformmgr.h" #include "uigoodsgrid.h" #include "NetProtocol.h" #include "uiboxform.h" #include "uiEquipForm.h" #include "UIGoodsGrid.h" #include "uiItemCommand.h" #include "uiform.h" #include "uiBoatForm.h" #include "pa...
9,001
4,485
//----------------------------------------------------------------------------------------------------------------------------- // Copyright (c) 2018 Juho Lepistö // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated // documentation files (the "Software"), ...
4,597
1,082
#include <Ledger.h> #include <LedgerSessionData.h> #include <LedgerSession.h> #include <LedgerCommands.h> Ledger::Ledger() { // libLedger one-time setup? } std::unique_ptr<LedgerSession> Ledger::LoadJournal(const std::string& fname) { std::unique_ptr<LedgerSession> sess; WithInstance([&] (Ledger& instance...
1,843
612
// Copyright (c) 2020 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 "windows.h" #include "base/at_exit.h" #include "base/command_line.h" #include "base/files/file_path.h" #include "base/logging.h" #include "b...
2,294
714
/* This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copy...
3,746
1,349
#include "idf/MadCatz.hh" namespace idf { MadCatz::MadCatz() : forwardBackwardPivot(0, 1023, 511), leftRightPivot(0, 1023, 511), twist(0, 255, 127), leftThrottle(0, 255, 127), rightThrottle(0, 255, 127), trigger(0, 1), button2(0, 1), button3(0, 1), button4(0, 1), button5(0, 1),...
1,180
518
#pragma once // ------------------------------------------------------------------------------------- #include <type_traits> #include <cassert> // ------------------------------------------------------------------------------------- template<typename Value> class OverridingList { public: OverridingList() ...
1,002
271
/* * Copyright 2008 Search Solution Corporation * Copyright 2016 CUBRID Corporation * * 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-...
1,593
509
#pragma once #include "Base.hh" #include "Player.hh" #include "Vehicle.hh" #include "Util.hh" #include "TextDraw.hh" #include "Pickup.hh" namespace Zion { class GameMode { public: virtual void OnPlayerInteriorChange(Player *player, int newInterior, int oldInterior) {} virtual void O...
2,085
544
#include "pch.h" #include "ZenUnitTestUtils/TestingNonDefaults.h" namespace ZenUnit { TestResult TestingNonDefaultTestResult() noexcept { const FullTestName fullTestName("Non", "Default", 0); TestResult constructorFailTestResult = TestResult::ConstructorFail(fullTestName, TestPhaseResult()); ...
558
160
#include "c10/cuda/CUDAStream.h" #include "torch/csrc/jit/runtime/custom_operator.h" #include "torch/torch.h" #include "core/runtime/runtime.h" #include "core/util/prelude.h" namespace trtorch { namespace core { namespace runtime { std::vector<at::Tensor> execute_engine(std::vector<at::Tensor> inputs, c10::intrusiv...
2,563
946
#ifndef ZEN_LEXGEN_NODES_HPP #define ZEN_LEXGEN_NODES_HPP #include <list> #include <memory> #include "zen/string.hpp" #include "zen/dllist.hpp" namespace zen { namespace lexgen { template<typename T> using SPtr = std::shared_ptr<T>; enum class NodeType { rule, ref_expr, char_expr, ...
2,025
691
#ifndef _CGP_WORKER_HPP__ #define _CGP_WORKER_HPP__ #include "ComponentTransform.hpp" #include "Map.hpp" #include "Gameplay/CGPResource.hpp" #include "Gameplay/Income.hpp" #include <vector> namespace Cookie { namespace ECS { class Coordinator; } namespace Resources { class Prefab; class Map; } namespac...
2,301
894
#include "InterpreterCommandMov.h" SKALANG_BYTECODE_INTERPRETER_COMMAND_DECLARE(MOV)(ExecutionContext& context, const Operand& left, const Operand& right) { return context.getCell(left); }
192
68
// _ _____ __________ // | | / / _ | / __/_ __/ Visibility // | |/ / __ |_\ \ / / Across // |___/_/ |_/___/ /_/ Space and Time // // SPDX-FileCopyrightText: (c) 2019 The VAST Contributors // SPDX-License-Identifier: BSD-3-Clause #include "vast/system/read_query.hpp" #include "vast/fw...
5,221
1,641
/* This file belongs to Ashes. See LICENSE file in root folder. */ #ifndef ___AshesPP_RenderPass_HPP___ #define ___AshesPP_RenderPass_HPP___ #pragma once #include "RenderPassCreateInfo.hpp" namespace ashes { /** *\brief * Describes a render pass (which can contain one or more render subpasses). */ class RenderPa...
4,000
1,437
#include "impch.h" #include "RenderContext.h" #include "Framework/Utils.h" #include "Descriptor.h" namespace Immortal { namespace D3D12 { Device *RenderContext::UnlimitedDevice = nullptr; DescriptorAllocator RenderContext::shaderVisibleDescriptorAllocator{ DescriptorPool::Type::ShaderResourceView, Descripto...
14,176
5,053
/* bpred-tage.cpp: TAgged GEometric-history length predictor [Seznec and Michaud, JILP 2006] */ /* * __COPYRIGHT__ GT */ #define COMPONENT_NAME "tage" #ifdef BPRED_PARSE_ARGS if(!strcasecmp(COMPONENT_NAME,type)) { int num_tables; int bim_size; int table_size; int tag_width; int first_length; int last_le...
11,675
4,829
/* main.c */ #include <Carbon/Carbon.h> #include "main.h" #include "ExAPBitmapARGB32.h" void Initialize(void); /* function prototypes */ void EventLoop(void); void MakeWindow(void); void MakeMenu(void); void DoEvent(EventRecord *event); void DoMenuCommand(long menuResult); void DoAboutBox(void); void D...
6,895
2,106
/******************************************************************************* * Copyright 2018 IBM Corp. 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 * * ht...
8,180
2,967
// CG1_2DVector.cpp: implementation of the CG1_2DVector class. // ////////////////////////////////////////////////////////////////////// #include "CG1_2DVector.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////...
1,786
555
#include <bits/stdc++.h> using namespace std; struct Node{ int c; int num; Node* fa; bool operator < (const Node &x)const{ return x.num < num; } }num[100]; int t, str_len, fa_index; int val[100]; long long ans; string str; int main(){ ios::sync_with_stdio(false); cin.tie(0); ...
1,902
748
// saurabhraj042 class Solution { public: int maxArea(vector<int>& A) { int i = 0,j = A.size()-1; int mx = j * min( A[i],A[j] ); while( i < j ) { if( (j-i) * min( A[j],A[i] ) > mx) mx=(j-i)*min(A[j],A[i]); if( A[i] < A[j])...
387
162
// RUN: pp-trace -callbacks '*,-FileChanged,-MacroDefined' %s -- | FileCheck --strict-whitespace %s #pragma clang diagnostic push #pragma clang diagnostic pop #pragma clang diagnostic ignored "-Wformat" #pragma clang diagnostic warning "-Wformat" #pragma clang diagnostic error "-Wformat" #pragma clang diagnostic fatal...
5,238
2,155
#define DLL_EXPORT #include "Exports.h" #include "Plugins/IPostEffectFactory.h" #include "Factories.h" namespace Core { namespace Plugin { CPostEffectFactory_Bloom* Bloom = nullptr; CPostEffectFactory_Hdr* Hdr = nullptr; CPostEffectFactory_MotionBlur* MotionBlur = nullptr; CPostEffectFactory_SSAO* Ssao = null...
849
397
#include "msg_handler.hpp" #include <iostream> void MessageHandler::error(const std::string& msg, unsigned lineNum) { std::cerr << "Error, line " << lineNum + m_lineOffset << ": " << msg << std::endl; } void MessageHandler::warning(const std::string& msg, unsigned lineNum) { std::cerr << "Warning, line " <<...
376
126
#include "tas_hooks.h" #include "tas_logger.h" #include "tas_input_handler.h" #include "randomizer.h" #include "halo_engine.h" #include "render_d3d9.h" // Function Defs typedef HRESULT(__stdcall* GetDeviceState_t)(LPDIRECTINPUTDEVICE*, DWORD, LPVOID*); typedef HRESULT(__stdcall* GetDeviceData_t)(LPDIRECTINPUTDEVICE*, ...
10,309
4,231
/* This program is my experiment. Create a global function and return an object. Also, make this as friend function. */ #include <iostream> using namespace std; class Test { private: protected: public: int a; int b; int c; friend Test fun(); // Though function doesn't belongs to this class but is ...
1,201
401
#ifndef PYTHONIC_INCLUDE_NUMPY_ISSCALAR_HPP #define PYTHONIC_INCLUDE_NUMPY_ISSCALAR_HPP #include "pythonic/include/utils/functor.hpp" #include "pythonic/include/types/traits.hpp" #include "pythonic/include/types/str.hpp" #include <type_traits> namespace pythonic { namespace numpy { template <class E> c...
418
177
#include "uber-profile-requestor.h" UberProfileRequestor::UberProfileRequestor(QObject *parent) : UberRequestor(parent){ connect(this, SIGNAL(profileChanged(Profile*)), this, SLOT(setProfile(Profile*))); } void UberProfileRequestor::fetchProfileFromNetwork(){ makeNetworkCall( U...
1,583
412
#include <Arduino.h> #include "HT1621_universal.h" const uint8_t csPin = 14; //Chip selection output const uint8_t wrPin = 27; //Read clock output const uint8_t dataPin = 26; //Serial data output HT1621_universal lcd(csPin, wrPin, dataPin); void setup() { lcd.init(); lcd.HT1621_all_on(16); delay(1000...
712
377
#pragma once #include <iostream> #include <vector> //#include <thread> namespace PrimeGenerator { long integerSqrt(long num); std::vector<long> findPrimes(long start, std::size_t num, long* lastCurrLimit, long end=-1); }
244
100
#include "Beon.hpp" // Window parameters int windowWidth = 1980; int windowHeight = 1080; static bool running = true; //Get a handle on our light //GLuint LightID = glGetUniformLocation(mShader.ID, "LightPosition_worldspace"); // Forward declaration of functions void cleanup(); // Create window manag...
7,796
3,121
#include "home.h" using namespace roo_display; // Image file ic_sharp_18_home_sensor_door 18x18, 4-bit Alpha, RLE, 60 bytes. static const uint8_t ic_sharp_18_home_sensor_door_data[] PROGMEM = { 0x80, 0xC3, 0x00, 0x18, 0x06, 0x30, 0x16, 0x06, 0xFB, 0x06, 0x60, 0x6F, 0xB0, 0x66, 0x06, 0xFB, 0x06, 0x60, 0x6F, 0xB0,...
1,773
1,285
// Copyright 2018 The Crashpad Authors. 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 required by ...
4,645
1,585
#define NNNN #include <./hoge.h> #ifdef VVVVVVV int vvvvv; #endif namespace jjjjj { #include <field.h> }
108
60
// Autogenerated from CppHeaderCreator on 7/27/2020 3:10:42 PM // Created by Sc2ad // ========================================================================= #pragma once #pragma pack(push, 8) // Begin includes #include "utils/typedefs.h" // Including type: System.Object #include "System/Object.hpp" #include "utils/i...
8,596
2,933
#pragma once #include <jln/mp/utility/conditional.hpp> #include <jln/mp/utility/always.hpp> #include <jln/mp/number/number.hpp> #include <jln/mp/functional/call.hpp> namespace jln::mp { /// \ingroup functional /// A conditional expression. /// \treturn \value template<class Pred, class TC, class FC = always<...
680
247
#include "FieldParser.h" #include <algorithm> namespace zxing { namespace oned { namespace rss { static const int VARIABLE_LENGTH = 99999; struct DigitData { std::string digit; int variableLength; int length; }; static const DigitData TWO_DIGIT_DATA_LENGTH[] { // "DIGITS", new Integer(LENGTH) // ...
7,135
3,200
#ifndef PIECEFACTORY_HH #define PIECEFACTORY_HH #include <QJsonObject> #include <string> #include <vector> /** * @file * @brief Singleton class that creates pieces. */ namespace Logic { /** * @brief Singleton class for creating pieces. * * The factory is requested to read JSON file, after which it will reques...
1,198
362
#ifndef INTERLINCK_CORE_SYNTAX_IWITHSIMPLIFIEDWIDTHANDPOSITION_H #define INTERLINCK_CORE_SYNTAX_IWITHSIMPLIFIEDWIDTHANDPOSITION_H #include "interlinck/interlinck_global.hpp" #include "interlinck/Core/Text/TextSpan.hpp" #include "interlinck/Core/Types.hpp" namespace interlinck::Core::Syntax { /** * @brief Interface ...
1,413
447
/* Copyright (c) 2009-2016, Jack Poulson All rights reserved. This file is part of Elemental and is under the BSD 2-Clause License, which can be found in the LICENSE file in the root directory, or at http://opensource.org/licenses/BSD-2-Clause */ extern "C" { void EL_BLAS(sger) ( const BlasInt* m, c...
8,835
3,547
/** * @author Moe_Sakiya sakiya@tun.moe * @date 2018-11-24 14:58:37 * */ #include <iostream> #include <string> #include <algorithm> #include <set> #include <map> #include <vector> #include <stack> #include <queue> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> using namespace std; ...
1,111
539
#pragma once #include "../Standard.hpp" #include <utility> #include <initializer_list> namespace lw { template<class T, size_t SIZE> class Array { private: T m_pData[SIZE]; public: constexpr Array() : m_pData{} { } constexpr Array(const std::initializer_list<T>& il) { static_assert(il.end() ...
1,281
672
#include "mocks.h" namespace Envoy { namespace Grpc { MockRpcChannelCallbacks::MockRpcChannelCallbacks() {} MockRpcChannelCallbacks::~MockRpcChannelCallbacks() {} MockRpcChannel::MockRpcChannel() {} MockRpcChannel::~MockRpcChannel() {} } // Grpc } // Envoy
261
92
#include <iostream> #include <stack> using namespace std; #define MAX 0x7FFFFFFF int PARTITION(int p,int j); stack<int> s; //栈s,存储较大的部分的编号 int *A; //待分类的数据(1:n) int main() { int n = 0,i = 0,j = 0; int p = 0,q = 0,x = 0,y = 0; cout<<"输入待分类数据个数:"; cin>>n; A = (int *)malloc(sizeof(int) * (...
1,426
649
#include "stdafx.h" #include "ValuesFactory.h" namespace bv { // *********************** // ValueBoolPtr ValuesFactory::CreateValueBool ( const std::string & name ) { return std::make_shared< ValueBool >( name ); } // *********************** // ValueBoolPtr ValuesFactory::Cr...
3,847
1,212
/* * Copyright (c) 2008 Christian Benjamin Ries * License: MIT * Website: https://github.com/cbries/tetrisgl */ #include "functions.h" #include <GL/gl.h> void Enter2DMode( int startx, int starty, int width, int height ) { glPushAttrib(GL_ENABLE_BIT); glDisable(GL_DEPTH_TEST); glDisable(GL_CULL_FACE); glDi...
881
361
// Design an algorithm and write code to remove the duplicate characters in a string. #include <iostream> #include <string> #include <unordered_map> int main() { std::string input = "aabbccd"; std::string output = ""; std::unordered_map<char, int> numberOfInstances; for (int i = 0; i < input.length(); ++i) { c...
549
201
#include "pch.h" #include "LidarWrapper.h" #include "rplidar_cmd.h" using namespace rp::standalone::rplidar; LidarWrapper::Wrapper::Wrapper() { } bool LidarWrapper::Wrapper::connect(const char* com, _u32 baud) { drv = RPlidarDriver::CreateDriver(0x0); if (!drv) { return false; } r...
967
362
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
1,056
370
#ifndef TRACKABLE_HPP #define TRACKABLE_HPP namespace onepass { namespace core { template<class T> class Trackable { private: unsigned id_; time_t created_; time_t accessed_; friend class boost::serialization::access; public: T val_; Trackable() : id_(0) ...
1,350
430
#include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <cstring> #include <string.h> #include <stdio.h> #include <cmath> #include <limits> #include <assert.h> #include "class-internals.h" #include "codegen/il2cpp-codegen.h" #include "UnityEngine_UI_UnityEngine_UI...
48,489
23,301
#pragma once #include <doctest/doctest.h> #include <chineseroom/split.hpp> TEST_CASE("splitting string '1,2,,3,'") { auto const splitted = chineseroom::split(std::string{"1,2,,3,"}, ','); REQUIRE(splitted.size() == 3); REQUIRE(splitted[0] == "1"); REQUIRE(splitted[1] == "2"); REQUIRE(splitted[2] == "3"); }...
646
295
// // Events/Source.cpp // This file is part of the "Dream" project, and is released under the MIT license. // // Created by Samuel Williams on 9/12/08. // Copyright (c) 2008 Samuel Williams. All rights reserved. // // #include "Source.hpp" #include "Loop.hpp" #include <fcntl.h> #include <iostream> #include <un...
4,987
1,925
#include "precompiledHeader.h" #include "mainWindowTetris.h" #include "ui_mainWindowTetris.h" #include "tetrixwindow.h" MainWindowTetris::MainWindowTetris(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindowTetris) { ui->setupUi(this); TetrixWindow *window = new TetrixWindow; QHBoxLayout *layo...
2,172
766
#include "ESODatabaseModel.h" #include <ESOData/Database/ESODatabase.h> ESODatabaseModel::ESODatabaseModel(const esodata::ESODatabase* database, QObject* parent) : QAbstractItemModel(parent), m_database(database) { } ESODatabaseModel::~ESODatabaseModel() = default; int ESODatabaseModel::columnCount(const QModelInde...
1,191
417
/* * Copyright (c) 2018 AppDynamics LLC and its affiliates * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
11,445
4,286
#include <bits/stdc++.h> using namespace std; #define ll long long #define gc getchar int a[500005]; bool v[500005]; int read(int i) { char c = gc(); while((c<'0' || c>'9') && c!='?' && c!='-') c = gc(); bool sig = 1; if(c=='?') { v[i] = 1; return 0; } if(c=='-') { c = gc(); sig = 0; } int ret = 0; whil...
1,899
942
#include "http_client.h" namespace coroutines_ts { task<std::vector<std::string>> request_uris(HttpClient& http_client, const std::vector<std::string>& uris_to_request) { (void)http_client; (void)uris_to_request; co_return std::vector<std::string>{{"42"}}; } }
302
111
#pragma once #include <QReadWriteLock> #include <QSharedPointer> #include <QThread> #include <QtSerialPort> class QFile; class QElapsedTimer; class SerialPlayer : public QThread { public: explicit SerialPlayer(QObject *parent = nullptr); virtual ~SerialPlayer() override; void start(); void stop(); void re...
1,165
403
#include "Rio.h" Rio::Rio() {} float Rio::embalsado_pantano(const string& pantano) const { return buscar_pantano(pantano).vol(); } float Rio::embalsado_total() const { DiccionarioHash<string, Pantano>::ConstIterator ipantano = _pantanos.cbegin(); DiccionarioHash<string, Pantano>::ConstIterator ifin ...
1,049
415
// // AYA version 5 // // 文字コード変換クラス Ccct // // 変換部分のコードは以下のサイトで公開されているものを利用しております。 // class CUnicodeF // kamoland // http://kamoland.com/comp/unicode.html // #if defined(WIN32) || defined(_WIN32_WCE) # include "stdafx.h" #endif #include <string.h> #include <clocale> #include <string> #include...
18,342
8,434
#pragma once #include <glow/common/gltypeinfo.hh> #include <glow/common/macro_join.hh> #include <glow/common/nodiscard.hh> #include <glow/common/non_copyable.hh> #include <glow/common/property.hh> #include <glow/common/shared.hh> #include <glow/gl.hh> #include <glow/util/LocationMapping.hh> #include "NamedObject.hh...
10,429
2,961
#include "common.h" class Solution { public: string longestPalindrome(string s) { int start = 0, max_len = 1; for(int i = 0; i < s.size(); i++){ int len1 = expandAroundCenter(s, i, i); int len2 = expandAroundCenter(s, i, i+1); int len = std::max(len1, len2); if(std::max(len1, len2) > ...
1,092
423
#ifndef WARP_POINT_2D #define WARP_POINT_2D #pragma once #include <pcl/registration/warp_point_rigid.h> #include <boost/shared_ptr.hpp> namespace pcl { namespace registration { /** \brief @b WarpPoint2D enables 3D (1D rotation around yaw + 2D translation) * transformations for points. * * \note The class ...
1,739
610
/************************************************************************ * DICOMLIB * Copyright 2003 Sunnybrook and Women's College Health Science Center * Implemented by Trevor Morgan (morgan@sten.sunnybrook.utoronto.ca) * * See LICENSE.txt for copyright and licensing info. ******************************************...
769
275
#include <iostream> using namespace std; int main() { int a=1; int &b=a; int c=b; b=2; cout<<"a="<<a<<",b="<<b<<",c="<<c<<endl; int d[]={1,2,3,4,5}; int(&e)[5]=d; for(int i=0;i<sizeof(d)/sizeof(d[0]);i++) { e[i]=e[i]*10+e[i]; } for(int i=0;i<sizeof(d)/sizeof(...
389
194
/* * nvbio * Copyright (c) 2011-2014, NVIDIA CORPORATION. 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,...
2,881
1,040
#pragma once #include<vector> /** * @brief 全方位木DP */ template<typename T,typename F,typename Fix> struct reroot{ std::vector<std::vector<long long>>g; std::vector<int>p_list; std::vector<T>p_table; std::vector<bool>p_checked; std::vector<map<int,T>>table; std::vector<T>ans; T e; F f;...
1,648
696
#include "operations.hpp" #include <QVBoxLayout> #include <QHBoxLayout> #include "operation.hpp" CSVDoc::Operations::Operations() { /// \todo make widget height fixed (exactly the height required to display all operations) setFeatures (QDockWidget::NoDockWidgetFeatures); QWidget *widgetContainer = new ...
1,963
577
#include "huaweicloud/evs/v2/model/ListSnapshotsRequest.h" namespace HuaweiCloud { namespace Sdk { namespace Evs { namespace V2 { namespace Model { ListSnapshotsRequest::ListSnapshotsRequest() { offset_ = 0; offsetIsSet_ = false; limit_ = 0; limitIsSet_ = false; name_ = ""; nameIsSet_ = f...
10,720
3,584
# include <bits/stdc++.h> # define F first # define S second # define mp make_pair // everything go according to my plan # define pb push_back # define sz(a) (int)(a.size()) # define vec vector // shimkenttin kyzdary, dzyn, dzyn, dzyn... # define y1 Y_U_NO_y1 # define left Y_U_NO_left # define right Y_U...
2,332
1,081
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. // See: https://groups.google.com/forum/#!topic/nodejs/onA0S01INtw #ifdef BUILDING_NODE_EXTENSION #include <node.h> #endif #include "call-task.h" #include <module/core-modules/napa/call-context-wrap.h> #include <napa/log...
2,417
751
/** File : Is_Number.cpp Author : Menashe Rosemberg Created : 2019.02.19 Version: 20190219.1 Check if a string is a number Copyright (c) 2019 TheArquitect (Menashe Rosemberg) rosemberg@ymail.com Redistribution and use in source and binary forms, with or without modification...
1,892
677
// Pickup.cpp #include <Engine/World.h> #include "../include/RealTournament/Pickup.h" ////////////////////// /// Reflection /// BUILD_REFLECTION(real_tournament::Pickup); namespace real_tournament { /////////////////// /// Methods /// void Pickup::on_collision(Entity& entity, const CollisionData& /*data...
847
351
#include "primitive.h" Bounds3 Primitive::worldBounds() {} bool Primitive::checkRayIntersectionPredicate(Ray* ray) {} bool Primitive::checkRayIntersection(Ray* ray, SurfaceInteraction* surfaceInteraction) {} GeometricPrimitive::GeometricPrimitive(Shape* shape) { this->shape = shape; } GeometricPrimitive::~Geometri...
820
269
#pragma once #include "stdafx.h" #include "Log.h" class Message { enum MsgType { Error, Warning, Info, Question, }; public: static void ShowError( HWND parent, const std::wstring& msg, const std::wstring& title = L"Error" ) { Show( msg, title, Error, parent...
1,124
370