text
string
size
int64
token_count
int64
/////////////////////////////////////////////////////////////////////////////// // Copyright Christopher Kormanyos 2021. // 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) // #include <test/test_uintwide_t_n_ba...
610
252
//===--- CheckerRegistration.cpp - Registration for the Analyzer Checkers -===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
5,102
1,537
/********************************************************************************* * OKVIS - Open Keyframe-based Visual-Inertial SLAM * Copyright (c) 2015, Autonomous Systems Lab / ETH Zurich * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the ...
15,920
5,759
#include <cstdint> #include <cstdio> #include "FreeRTOS.h" #include "task.h" #include "config.hpp" #include "L0_LowLevel/LPC40xx.h" #include "L2_Utilities/debug_print.hpp" #include "L2_Utilities/macros.hpp" #include "L2_Utilities/rtos.hpp" namespace { void LedToggle(void * parameters) { DEBUG_PRINT("Setting up ...
3,287
1,165
// Copyright Neil Groves 2009. 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) // // // For more information, see http://www.boost.org/libs/range/ // #ifndef BOOST_RANGE_ALGORIT...
4,736
1,523
/* * Copyright 1999-2019 Alibaba Cloud 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 applicab...
10,953
3,160
/*! \file ray-inl.hpp \author Sho Ikeda Copyright (c) 2015-2018 Sho Ikeda This software is released under the MIT License. http://opensource.org/licenses/mit-license.php */ #ifndef NANAIRO_RAY_INL_HPP #define NANAIRO_RAY_INL_HPP #include "ray.hpp" // Standard C++ library #include <array> #include <limits...
1,844
713
/* A Bison parser, made by GNU Bison 2.5. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publi...
181,258
90,375
#include "game.h" bool isQuit = false; WindowRef window; AGLContext context; #define SND_SIZE 8192 static AudioQueueRef audioQueue; void soundFill(void* inUserData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffer) { void* frames = inBuffer->mAudioData; UInt32 count = inBuffer->mAudioDataBytesCapacity / 4; ...
8,122
2,612
/* Edit by Christina */ #include "LogisticRegression.hpp" namespace husky{ namespace mllib{ /* train a logistic regression model with even weighted instances. */ void LogisticRegression::fit(const Instances& instances){ if(this->mode == MODE::GLOBAL){ ...
22,796
6,425
/* Pattern to Word Bijection https://binarysearch.com/problems/Pattern-to-Word-Bijection Given two strings s and p, return whether s follows the pattern in p. That is, return whether each character in p can map to a non-empty word such that it maps to s. Constraints n ≤ 100,000 where n is the length of s Example 1 I...
993
323
/* By: facug91 From: http://coj.uci.cu/contest/cproblem.xhtml?pid=3285&cid=1453 Name: Toby and Strange Function Date: 05/06/2015 */ #include <bits/stdc++.h> #define time alkjdhasjldh3289rhau9dty #define EPS 1e-9 #define DEBUG(x) cerr << "#" << (#x) << ": " << (x) << endl const double P...
1,023
501
/* * Copyright (c) 2009, Benjamin Peter <BenjaminPeter@arcor.de> * 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 * ...
4,221
1,383
/* * String.cpp * * Created on: Feb 19, 2015 * Author: mailmindlin */ #include "String.h" #include "../algorithm.h" #include "../limits.h" #include "../memory.h" #include "../Math.h" #include "../strlen.h" #include "Double.h" #include "Integer.h" #include "Long.h" String::String(const String& str) : siz...
8,738
3,411
// // Created by lishunan on 4/19/16. // #ifndef HOSTSVC_RPCCHANNEL_H #define HOSTSVC_RPCCHANNEL_H #include "HostSvcCommon.hpp" #include <unordered_map> using namespace google::protobuf; namespace GkcHostSvc { using messageHandler = function<void(RPCResponse)>; class Connection : public protobuf::RpcChannel { ...
4,254
1,720
// Copyright (c) 2005-2014 Code Synthesis Tools CC // // This program was generated by CodeSynthesis XSD, an XML Schema to // C++ data binding compiler. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Fre...
20,939
7,159
class Solution { public: int l(struct node* h){ int c; while(h){ h=h->next; ++c; } return c; } struct node *reverse (struct node *head, int k) { if(l(head)<k) return head; struct node *prev=0; struct node *next=...
565
185
#include "querier/BaseChunkSeriesSet.hpp" #include "base/Logging.hpp" #include "index/PostingSet.hpp" #include <unordered_set> namespace tsdb { namespace querier { // BaseChunkSeriesSet loads the label set and chunk references for a postings // list from an index. It filters out series that have labels set that shou...
2,122
648
// Copyright 2019 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,046
755
// Copyright (c) 2012-2017 VideoStitch SAS // Copyright (c) 2018 stitchEm #pragma once #include "liveaudioprocessfactory.hpp" class LiveAudioProcessorDelay : public LiveAudioProcessFactory { public: explicit LiveAudioProcessorDelay(const VideoStitch::Ptv::Value* config); ~LiveAudioProcessorDelay() = default; ...
703
214
// All content Copyright (C) 2018 Genomics plc #ifndef VCF_FILTERDESC_HPP #define VCF_FILTERDESC_HPP #include "common.hpp" #include <iostream> namespace wecall { namespace vcf { struct FilterDesc { /// Basic constructor from constituent data /// /// @param id Filter ID. /// @p...
915
259
#include "shellprv.h" #include "ids.h" #include "ftadv.h" #include "ftcmmn.h" #include "ftaction.h" #include "ftassoc.h" const static DWORD cs_rgdwHelpIDsArray[] = { // Context Help IDs IDC_FT_CMD_ACTION, IDH_FCAB_FT_CMD_ACTION, IDC_FT_CMD_EXETEXT, IDH_FCAB_FT_CMD_EXE, IDC_FT_C...
11,378
4,349
/************************************************************************** Contains implementation for Worker class and its JobQueue subclass, which handle job queues and stealing. Author: Jake McLeman **************************************************************************/ #include <algorithm> #i...
2,975
1,001
/* * Portions Copyright (c) 1993-2015 NVIDIA Corporation. All rights reserved. * Please refer to the NVIDIA end user license agreement (EULA) associated * with this source code for terms and conditions that govern your use of * this software. Any use, reproduction, disclosure, or distribution of * this software and re...
6,080
2,150
// BEGINLICENSE // // This file is part of helPME, which is distributed under the BSD 3-clause license, // as described in the LICENSE file in the top level directory of this project. // // Author: Andrew C. Simmonett // // ENDLICENSE #include "catch.hpp" #include "helpme.h" TEST_CASE("check that updates of kappa an...
15,069
6,678
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second typedef long long ll; typedef long double ld; typedef pair<int, int> pi; typedef pair<long long, long long> pl; const int MOD = 1e9 + 7; const ll INF = 1e18; const double EPS = 1e-6; int N; ll X, Y, Z; priority_queue...
1,152
548
// Copyright (c) 2009-2013 University of Twente // Copyright (c) 2009-2013 Michael Weber <michaelw@cs.utwente.nl> // Copyright (c) 2009-2013 Maks Verver <maksverver@geocities.com> // Copyright (c) 2009-2013 Eindhoven University of Technology // // Distributed under the Boost Software License, Version 1.0. // (See accom...
4,163
1,471
#include "modio.h" #include <iostream> int main(void) { modio::Instance modio_instance(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b"); volatile static bool finished = false; auto wait = [&]() { while (!finished) { modio_instance.sleep(10); modio_instance.process(); } }...
984
372
#include "todo.hpp" #include "zero_copy_value.hpp" #include "sample.h" // dummy service routines that simulate background threads or threadpools that actually complete the async tasks void dummy_service_routine(todo td) { this_thread::sleep_for(chrono::milliseconds(200)); td.resolve(); td.wake(); } void...
5,983
2,136
#include <cppunit/extensions/HelperMacros.h> #include <Poco/File.h> #include "cppunit/BetterAssert.h" #include "cppunit/FileTestFixture.h" #include "core/FilesystemDeviceCache.h" #include "model/DevicePrefix.h" using namespace Poco; namespace BeeeOn { class FilesystemDeviceCacheTest : public FileTestFixture { CP...
4,904
2,313
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include <vector> #include "doctest.h" #include "util.h" using namespace std; class Solution { public: bool isOneBitCharacter(vector<int>& bits) { if(bits.size() < 2) { return !bits[0]; } if(bits[bits.size() - 2] == 0) return true; else { ...
1,094
504
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=8 sts=4 et sw=4 tw=99: * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ...
57,609
19,674
#include "common.h" #include "LoadVehicle.h" #include "PassengerVehicle.h" #include "EmergencyEquipment.h" #include "EmergecyVehicle.h" #include "Decision.h" #include <list> using namespace std; // temparorily commented. /* int main() { // the vehicle list. Decision::VehicleList vehicleList; // create Vehicles. ...
1,059
440
#include "FileView.h" #include <wx/stc/stc.h> #include <wx/textfile.h> enum { MARGIN_LINE_NUMBERS }; static wxString keywordsList; static bool keywordsLoaded=false; // rgb_bkgrnd=RGB( 0x22,0x55,0x88 ); // rgb_string=RGB( 0x00,0xff,0x66 ); // rgb_ident=RGB( 0xff,0xff,0xff ); // rgb_keyword=RGB( 0xaa,0xff,0xff ); /...
2,965
1,318
/* // Copyright (c) 2018 Intel 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-2.0 // // Unless required by applicable law or...
2,343
795
#include "mex.h" #include <string.h> // for memset /* * Choose variables for coarse grid * Greedy algorithm * * After selection, * * \sum_{j\in coarse} c_ij > beta \sum_j c_ij for all i * * Starting with an empty coarse set, we sequentially add variables from fine * That their \sum_{j\in coarse} c_ij (to ...
3,568
1,340
#ifndef PYTHONIC_NUMPY_TRANSPOSE_HPP #define PYTHONIC_NUMPY_TRANSPOSE_HPP #include "pythonic/utils/proxy.hpp" #include "pythonic/utils/numpy_conversion.hpp" #include "pythonic/utils/nested_container.hpp" #include "pythonic/types/ndarray.hpp" #include "pythonic/types/numpy_type.hpp" #include "pythonic/__builtin__/Value...
2,754
923
#include "DataFormats/EcalDetId/interface/ESDetId.h" #include "DataFormats/EcalDigi/interface/ESDataFrame.h" #include "SimDataFormats/CaloHit/interface/PCaloHit.h" #include "SimCalorimetry/CaloSimAlgos/interface/CaloHitResponse.h" #include "SimCalorimetry/CaloSimAlgos/interface/CaloTDigitizer.h" #include "SimCalorimetr...
1,828
733
/* Copyright (C) 2016-2017 INRA * * 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, publish, dis...
9,636
3,096
/* * This file belongs to the Galois project, a C++ library for exploiting parallelism. * The code is being released under the terms of the 3-Clause BSD License (a * copy is located in LICENSE.txt at the top-level directory). * * Copyright (C) 2018, The University of Texas at Austin. All rights reserved. * UNIVER...
10,787
3,771
#pragma once #include "types.hpp" struct Grid { // Number of grid points int Nx; int Ny; int Nz; // Starting grid points int Nx0; int Ny0; int Nz0; // Length of domain in this grid // Domain in this grid is [L0,L0+L] FLOAT Lx; FLOAT Ly; FLOAT Lz; FLOAT Lx0; FLOAT Ly0; FLOAT Lz0; ...
388
184
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. 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 ...
28,858
8,311
/* combines coil images using sensitivity maps to retain phase. usage: o = combcoils(m, s) input: m : coil images. [x y z coils images] s : sensitivity maps. [x y z coils] output: o : single combined image. [x y z] */ #include "mex.h" #include <math.h> #define X plhs[0] #define M prhs[0] #define S prhs[1...
2,279
980
/** * Copyright Soramitsu Co., Ltd. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ #ifndef IROHA_WSVRESTORER_HPP #define IROHA_WSVRESTORER_HPP #include "common/result.hpp" namespace iroha { namespace ametsuchi { class Storage; /** * Interface for World State View restoring from the ...
864
288
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------...
2,486
829
/// \author Tim Quelch #include <algorithm> #include <chrono> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <png++/png.hpp> #include <random> #include <tuple> #include "maze.h" namespace mazes { namespace detail { /// Holds the x y coordinates of a point in the maze ...
19,369
5,789
/* * 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 ...
3,365
1,120
// Copyright 2021 D-Wave Systems 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 applicab...
20,360
6,873
/* Copyright 2017 Nervana Systems 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 law or agreed to in writin...
1,009
309
// Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #include <config.h> #include <eval/dependenc...
11,876
3,691
/* Copyright (c) 2017, Arvid Norberg 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, this list of conditions and the f...
2,720
1,003
#include "Color.h" #include "Colorf.h" #include <assert.h> #include "config.h" //----------------------------------------------------------------------------- namespace pix { inline static uint8_t convertColorFloatToByte( float src ) { float f = src; if ( f < 0.f ) f = 0.f; else if ( f > 1.f ) ...
842
330
class Solution { public: int max(int a, int b) { if(a > b) return a; else return b; } int lengthOfLongestSubstring(string s) { if(s.length() == 0) return 0; set<char> set; int left = 0, right = 0, length = 0; while(right < s.length()) { if(set.find...
596
187
//============================================================================== // Copyright 2003 - 2011 LASMEA UMR 6602 CNRS/Univ. Clermont II // Copyright 2009 - 2011 LRI UMR 8623 CNRS/Univ Paris Sud XI // Copyright 2012 - 2014 MetaScale SAS // // Distributed under the Boost Softw...
4,311
1,366
#include "ndnph/app/ping-client.hpp" #include "ndnph/app/ping-server.hpp" #include "ndnph/keychain/ec.hpp" #include "ndnph/keychain/null.hpp" #include "mock/bridge-fixture.hpp" #include "mock/mock-key.hpp" #include "mock/mock-transport.hpp" #include "test-common.hpp" namespace ndnph { namespace { TEST(Ping, Client) ...
3,460
1,342
// // OCCAM // // Copyright (c) 2011-2016, SRI International // // 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, ...
7,879
2,666
#include <catch2/catch.hpp> #include "../../share/json_helper.hpp" #include "manipulator/types.hpp" #include <pqrs/json.hpp> TEST_CASE("simple_modifications.json") { auto json = krbn::unit_testing::json_helper::load_jsonc("../../../src/apps/PreferencesWindow/Resources/simple_modifications.json"); for (const auto&...
474
168
#include "openvslam/data/bow_vocabulary.h" namespace openvslam { namespace data { namespace bow_vocabulary_util { void compute_bow(data::bow_vocabulary* bow_vocab, const cv::Mat& descriptors, data::bow_vector& bow_vec, data::bow_feature_vector& bow_feat_vec) { #ifdef USE_DBOW2 bow_vocab->transform(util::converter...
539
215
#include "MeshManager.h" #include "BufferManager.h" #include "MaterialManager.h" #include "SkeletonManager.h" #include "Resources/Mesh.h" #include "Resources/Material.h" #include "FileSystem/FileReader.h" #include "FileSystem/DirectoryHelper.h" #include "Renderer/IRenderer.h" #include "Physics/Physics.h" #include...
14,499
6,564
#ifndef SCREAM_STD_META_HPP #define SCREAM_STD_META_HPP /* * Emulating c++1z features * * This file contains some features that belongs to the std namespace, * and that are likely (if not already scheduled) to be in future standards. * However, we have limited access to c++1z standard on target platforms, * ...
5,036
1,685
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. #include "IntroTutorialsPrivatePCH.h" #include "LevelEditor.h" #include "SDockTab.h" #include "EditorTutorial.h" #if WITH_EDITORONLY_DATA namespace { void GatherEditorTutorialForLocalization(const UObject* const Object, FPropertyLocalizationDataGatherer& P...
4,133
1,333
/** * Copyright (c) 2017-present, Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #include <cstdlib> #include <memory> #include <random> #include <unistd.h> #include <f...
11,094
3,534
#pragma once class IEncoder; class EncodingRenderer { public: EncodingRenderer( std::shared_ptr<IEncoder> encoder, ComPtr<ID3D11Device> pD3DDevice, ComPtr<ID3D11DeviceContext> pImmediateContext, boost::rational<int32_t> refreshRate ); void renderEncoding( ID3D11ShaderResourceView* srv ); private: ...
1,200
493
// Copyright 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 <algorithm> #include <string> #include <vector> #include "chrome/browser/enterprise/connectors/connectors_prefs.h" #include "chrome/browser/ente...
3,377
1,052
#ifndef TIME_TASK_HPP #define TIME_TASK_HPP ////////////////////////////////////////////////////// // INCLUDES ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// // FORWARD DECLARATIONS ////////////////////////////////////////////////////// /////////////////...
850
226
/* * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free ...
3,243
1,073
/* The structure of the class is as follows class _stack{ stack<int> s; int minEle; public : int getMin(); int pop(); void push(int); }; */ /*returns min element from stack*/ stack<int> st; int _stack :: getMin() { if(s.empty()){ while(!st.empty()){ st.pop(); } } ...
1,027
389
// // ASTExpr.cpp // Emojicode // // Created by Theo Weidmann on 03/08/2017. // Copyright © 2017 Theo Weidmann. All rights reserved. // #include "ASTExpr.hpp" #include "Analysis/FunctionAnalyser.hpp" #include "Compiler.hpp" #include "Functions/Initializer.hpp" #include "MemoryFlowAnalysis/MFFunctionAnalyser.hpp" #...
6,191
1,808
// Copyright 2015 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 <stddef.h> #include <stdint.h> #include <utility> #include "base/auto_reset.h" #include "base/bind.h" #include "base/callback.h" #include "base/...
19,043
5,929
/*************************************************************************** * * $Id: StMemoryInfo.hh,v 1.5 2013/01/17 14:40:04 fisyak Exp $ * * Author: Thomas Ullrich, June 1999 *************************************************************************** * * Description: * *************************************...
1,554
555
/* +------------------------------------------------------------------------+ | Mobile Robot Programming Toolkit (MRPT) | | http://www.mrpt.org/ | | | | Cop...
31,795
12,523
/* Copyright(c) 2016-2021 Panos Karabelas 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, publish, distrib...
14,936
4,605
#include "logical_camera_plugin/logical_camera_plugin.hh" #include <gazebo/physics/Link.hh> #include <gazebo/physics/Model.hh> #include <gazebo/physics/World.hh> #include <gazebo/sensors/Sensor.hh> #include <gazebo/sensors/SensorManager.hh> #include "std_msgs/String.h" #include "logical_camera_plugin/logicalImage.h" ...
9,920
3,678
// nanorange/algorithm/min_element.hpp // // Copyright (c) 2018 Tristan Brindle (tcbrindle at gmail dot com) // 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 NANORANGE_ALGORITHM_MIN_ELEMENT_HPP_INCLUDED #def...
2,028
710
#include <iostream> using namespace std; #define FOR(i, a, b) for(int (i) = (a); (i) <= (b); (i)++) int main() { int M, P, L, E, R, S, N; int pre_M; int pre_L; int pre_P; while (cin >> M && cin >> P && cin >> L && cin >> E && cin >> R && cin >> S && cin >> N) { FOR(i, 0, N - 1) { ...
632
258
/* * Copyright (C) 2019 Open Source Robotics Foundation * * 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 appl...
3,179
982
#include<iostream> #include<iomanip> using namespace std; int main(){ double x[100]; int i; for(i=0;i<100;i++)cin >> x[i]; for(i=0;i<100;i++){ if(x[i]<=10){ cout << "A[" << i << "] = " << fixed << setprecision(1) << x[i] << endl; } } return 0; }
268
146
#include <windows.h> #include <stdio.h> #define THREADCOUNT 2 HANDLE ghMutex; DWORD WINAPI WriteToDatabase( LPVOID ); int main( void ) { HANDLE aThread[THREADCOUNT]; DWORD ThreadID; int i; // Create a mutex with no initial owner ghMutex = CreateMutex( NULL, // default se...
2,670
765
#include "file_util.hpp" auto read_file(std::string_view path) -> std::string { std::ifstream file{path.data()}; if (!file.is_open()) { spdlog::error("Cannot open file {}\n", path); std::fflush(stdout); } std::stringstream ss; // read file's buffer contents into streams ss << file.rdbuf(); ret...
336
126
#ifndef Rect_hpp #define Rect_hpp #include "SDL.hpp" #include <vector> #include <utility> namespace SDL { using namespace std::rel_ops; struct Size { int w, h; }; using Point = SDL_Point; using Rect = SDL_Rect; using Points = std::vector<Point>; using Rects = std::vector<Rect...
1,782
668
// system include files #include <memory> // user include files #include "Calibration/EcalCalibAlgos/interface/ECALpedestalPCLHarvester.h" #include "CondCore/DBOutputService/interface/PoolDBOutputService.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" #include "C...
11,793
4,957
/** Given pointers start and end that point to the first and past the last element of a segment inside an array, reverse all elements in the segment. */ void reverse(int* start, int* end) { int * tempEnd = end-1; while(start < tempEnd) { int temp = *start; *start = *te...
1,313
577
#include <omwmm/extractor.hpp> #include <filesystem> #include <memory> #include <string> #include <string_view> #include <unordered_map> #include <algorithm> #include <cctype> #include <7zpp/7zpp.h> #include <omwmm/exceptions.hpp> using SevenZip::SevenZipLibrary; using SevenZip::SevenZipExtractor; using SevenZipStr...
1,773
618
// <copyright file="Exceptions.cpp" company="Microsoft Corporation"> // Copyright (C) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE.txt in the project root for license information. // </copyright> #include "stdafx.h" using namespace std; wstring win32_error::format_messag...
665
230
// // Created by ubuntu on 2021/4/16. // #include <iostream> #include "insert_demo.h" void InsertDemo::InsertMap() { MElement element; element.name = "element1"; map_.insert(std::make_pair("key_element1", element)); } void InsertDemo::ShowMap() { std::map<std::string, MElement>::iterator it; for...
648
228
//===- Set.cpp - MLIR PresburgerSet Class ---------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===---------------------------...
12,586
4,100
/** * @file */ #pragma once #include "src/type/Type.hpp" #include "src/type/EmptyType.hpp" namespace birch { /** * Typed expression or statement. * * @ingroup common */ class Typed { public: /** * Constructor. * * @param type Type. */ Typed(Type* type); /** * Type. */ Type* type; }; }...
321
128
#include <stdio.h> #include <iostream> #include <fstream> #include <stdlib.h> #include "common.h" #define MAX_BUF 512 int main(int argc, char *argv[]) { if(argc != 2) { printf("Usage: %s <file>\n", argv[0]); exit(1); } std::ifstream fin(argv[1]); if(!fin) { println("Error open...
624
255
/*! \file ramsesio.cxx * \brief this file contains routines for ramses snapshot file io * * \todo need to check if amr file quantity ngrid_current is actually the number of cells in the file as * an example fortran code I have been given seems to also use the ngridlevel array, which stores the number of cells * a...
61,762
21,777
/* * Copyright (c) 2017-present Orlando Bassotto * * 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, m...
4,432
1,521
#include<iostream> #include<map> using namespace std; int main(){ int answerNum; cin>>answerNum; map<int,int> correctAnswerNum; int payment=0; while(answerNum--){ int questionID; bool correct,withExplanaion; cin>>questionID>>correct>>withExplanaion; if(correct){ if(withExplanaion) pa...
632
263
// Copyright 2015 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 <string> #include "base/callback_helpers.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ui/brows...
8,237
2,471
class Solution { public: int maximumUniqueSubarray(vector<int>& nums) { const int N = nums.size(); const int MAX_ELEM = *max_element(nums.begin(), nums.end()); int answer = 0; vector<bool> vis(MAX_ELEM + 1, false); for(int i = 0, j = 0, sum = 0; j < N; ++j){ ...
624
212
/* Copyright 2017 The TensorFlow 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 applicable law or a...
1,581
463
#include "pch.hpp" #include "Renderer.hpp" namespace Sq { Renderer::OrthographicCameraMatrix* Renderer::m_RendererElements = new Renderer::OrthographicCameraMatrix; void Renderer::Begin(OrthographicCamera& camera) { m_RendererElements->ViewProjectionMatrix = camera.GetViewProjectionMatrix(); } void Renderer...
568
190
//************************************************************************************************** // // OSSIM Open Source Geospatial Data Processing Library // See top level LICENSE.txt file for license information // //*****************************************************************************************...
4,804
1,465
// Copyright Epic Games, Inc. All Rights Reserved. /*=========================================================================== Generated code exported from UnrealHeaderTool. DO NOT modify this manually! Edit the corresponding .h files instead! ========================================================================...
17,243
6,072
// Copyright Carl Philipp Reh 2006 - 2019. // 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 SGE_CG_PARAMETER_DETAIL_CHECK_TYPE_HPP_INCLUDED #define SGE_CG_PARAMETER_DETAIL_CHECK_TYPE_...
1,065
448
#include "my_object.hpp" #define SOL_CHECK_ARGUMENTS 1 #include <sol.hpp> namespace my_object { sol::table open_my_object(sol::this_state L) { sol::state_view lua(L); sol::table module = lua.create_table(); module.new_usertype<test>("test", sol::constructors<test(), test(int)>(), "value", &test::value ...
745
275
// Autogenerated from CppHeaderCreator on 7/27/2020 3:10:44 PM // Created by Sc2ad // ========================================================================= #pragma once #pragma pack(push, 8) // Begin includes // Including type: Zenject.PlaceholderFactoryBase`1 #include "Zenject/PlaceholderFactoryBase_1.hpp" // Incl...
8,420
2,873