text
string
size
int64
token_count
int64
#include "joystick.h" #include "log.h" #include <QTimer> // Linux headers #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> /* Standard C++ API does not allow to read char device file in unblocking mode, * so used Linux API */ #define JOYSTICK_FILE "/dev/input/js0" #define READ_DATA_I...
1,717
621
#include "../../comms/comm_headers.h" #include <sorts/comb_sort.h> #define THIS_FILE "comb_sort.cpp" #define LOG_TAG "SORTS-COMB" TGSTK_EXPORT SortCombObject::SortCombObject(SortVTable & vTable, float factor) : SortObject(vTable) { this->factor = factor; if (factor <= 1) { mlog_e(LOG_TA...
2,168
686
#include "Fruit.h" Fruit::Fruit(const QString &name, const double &price, const double &num) :name(name),price(price),num(num) { } QString Fruit::getName() const { return name; } double Fruit::getPrice() const { return price; } double Fruit::getNum() const { return num; }
294
111
// Copyright (c) 2021 <dev@brigid.jp> // This software is released under the MIT License. // https://opensource.org/licenses/mit-license.php #include <brigid/error.hpp> #include "test_common.hpp" #include <exception> #include <iomanip> #include <iostream> #include <vector> #include <netinet/in.h> #include <netinet/t...
4,271
1,486
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: vector<TreeNode *> generateTrees(int n) { vector<TreeNode *> v; generateTrees(1,n,v); ...
1,068
345
// Created on: 1996-03-08 // Created by: Robert COUBLANC // Copyright (c) 1996-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GN...
2,296
775
/** File : MazeRunner.cpp Author : Menashe Rosemberg Created : 2019.04.02 Version: 20190402.12 Check all spaces reachable in a maze from a random start place BSD License Copyright (c) 2019 TheArquitect (Menashe Rosemberg) rosemberg@ymail.com Redistribution and use in source...
2,928
1,133
#include "Timer.h" // // public // Timer::Timer(Units units) { _default_length = 0; _length = 0; _units = units; _is_active = false; _start_time = 0; } Timer::Timer(unsigned long default_length, Units units) { _default_length = default_length; _length = 0; _units = units; _is_active = false; _...
1,299
516
#include <iostream> using namespace std; int count_0 = 0, count_1 = 0; int main(void) { int a, b; cin >> a >> b; cout << a + b << endl; return 0; }
155
72
#include <bits/stdc++.h> using namespace std; void selection_sort(int A[], int l, int r) { for (int i = l; i < r; ++i) { int p = i; for (int j = i + 1; j <= r; ++j) if (A[j] < A[p]) p = j; swap(A[i], A[p]); } } int main() { return 0; }
309
136
// RUN: %clang_cc1 -std=c++11 -triple i386-apple-darwin9 -fsyntax-only -verify -fclang-abi-compat=7 %s // expected-no-diagnostics using size_t = decltype(sizeof(0)); template <typename T, size_t Preferred> struct check_alignment { using type = T; static type value; static_assert(__alignof__(value) == Preferred...
829
305
#pragma once #include "Ant.hpp" class WeightGraph; class Node; class PheromonWeight{ public: PheromonWeight(){} virtual ~PheromonWeight()=default; protected: virtual void leavePheromon(IWeightGraph &mGraph, Node lastNode, Node position, double weight); // virtual void leavePheromon(WeightGraph &mGrap...
419
133
#define BOOST_TEST_MODULE transaction_finality_status #include <boost/test/included/unit_test.hpp> #include <eosio/chain_plugin/trx_finality_status_processing.hpp> #include <eosio/testing/tester.hpp> #include <eosio/chain/block_header.hpp> #include <eosio/chain/genesis_state.hpp> #include <eosio/chain/name.hpp> #inc...
46,577
19,992
#include "gmSlotBase.hpp" #include "gmSlotInput.hpp" #include "gmSlotOutput.hpp" #include "gmNodeEditor.hpp" #include "gmNodeConnector.hpp" #include "gmSlotInputBase.hpp" #include "gmSlotOutputBase.hpp" #include "gmSlotConstraints.hpp" #include "gmAsync.hpp" namespace gm { namespace Slot { Base::Base(...
5,095
1,397
/* Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". */ class Solution { public: string reverseString(string s) { int start = 0; int end = s.size()-1; while(start < end) { swap(s[start++], s[end--]); } ...
344
112
 #ifdef __CDT_PARSER__ #undef __CUDA_RUNTIME_H__ #include <cuda_runtime.h> #endif #include <cuda_runtime.h> #include <math.h> #include <string.h> #include "utils.h" #include "operation_batched.h" #ifndef max #define max(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min(a,b) (((a) <...
5,087
1,769
// This file has been generated by Py++. #ifndef TransformFeedbackBufferBinding_hpp__pyplusplus_wrapper #define TransformFeedbackBufferBinding_hpp__pyplusplus_wrapper void register_TransformFeedbackBufferBinding_class(); #endif//TransformFeedbackBufferBinding_hpp__pyplusplus_wrapper
287
80
/* BAREOS® - Backup Archiving REcovery Open Sourced Copyright (C) 2000-2012 Free Software Foundation Europe e.V. Copyright (C) 2011-2016 Planets Communications B.V. Copyright (C) 2013-2017 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of...
42,488
16,284
#ifndef LAS2OCI_HPP_INCLUDED #define LAS2OCI_HPP_INCLUDED #include "oci_wrapper.h" #include <stdlib.h> // god-awful hack because of GDAL/GeoTIFF's shitty include structure #define CPL_SERV_H_INCLUDED #include <liblas/liblas.hpp> #include <boost/cstdint.hpp> #include <boost/concept_check.hpp> #include <string> #i...
1,446
604
/* Copyright 2019, Adrien Destugues, pulkomandy@pulkomandy.tk. * Distributed under the terms of the MIT License. */ #include <arch/platform.h> status_t arch_platform_init(struct kernel_args *kernelArgs) { return B_OK; } status_t arch_platform_init_post_vm(struct kernel_args *kernelArgs) { return B_OK; } sta...
407
159
// C++ program to print all the cycles // in an undirected graph //CONCEPT-use colors #include <bits/stdc++.h> using namespace std; const int N = 100000; // variables to be used // in both functions vector<int> graph[N]; vector<int> cycles[N]; // Function to mark the vertex with // different colors for diff...
1,903
860
#include "infra/csvreader.h" namespace inf { CsvReader::CsvReader(const fs::path& filename) : _charset(detect_character_set(filename)) , _dataset(gdal::VectorDataSet::open(filename, gdal::VectorType::Csv)) , _layer(_dataset.layer(0)) { } int32_t CsvReader::column_count() const { return _layer.layer_definition().f...
2,752
997
// // GestureRecognizers.hpp // SmoothDrawing // // Created by Benny Khoo on 21/10/2015. // // #ifndef GestureRecognizers_hpp #define GestureRecognizers_hpp #include <stdio.h> #include <array> using namespace cocos2d; class VelocityCalculator { public: using time_point = std::chrono::high_resolution_clo...
9,526
2,658
#include <iostream> #include <string> using namespace std; int** data; string a ,b; int max ( int a , int b ){ if ( a > b ) return a; return b; } int ss ( int ina , int inb ) { if ( ina == a.size() or inb==b.size() ) return 0; if ( data[ina][inb]!=-1 ) return data[ina][inb]; if ( a[ina]==b[inb]...
766
366
#pragma once #include "vec.hpp" //Helper for generating matrices //All rotations and fovs are in radians //Matrix storage template<typename T, usz W, usz H> struct TMatStorage { union { T f[W * H]; T m[W][H]; Vec<T, W> axes[H]; }; constexpr inline TMatStorage(): f{} {} template<typename ...args> const...
14,422
6,551
/*! * Copyright (c) 2021 Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See LICENSE file in the project root for * license information. */ #include "FreeForm2ExternalData.h" #include <string> #include "FreeForm2Type.h" #include "TypeImpl.h" #include "TypeManager.h" FreeForm2::Exter...
1,542
479
#ifndef _TCUANDROIDWINDOW_HPP #define _TCUANDROIDWINDOW_HPP /*------------------------------------------------------------------------- * drawElements Quality Program Tester Core * ---------------------------------------- * * Copyright 2014 The Android Open Source Project * * Licensed under the Apache License, Ve...
2,360
900
/* $Id: elink.cpp 196493 2010-07-06 00:37:12Z dicuccio $ * =========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software/database is a "United States Government Work" under...
4,257
1,456
/************************************************************************* * MultiLibrary - https://danielga.github.io/multilibrary/ * A C++ library that covers multiple low level systems. *------------------------------------------------------------------------ * Copyright (c) 2014-2022, Daniel Almeida * All righ...
7,484
2,796
#ifndef N_QUEENS_HPP_INCLUDED #define N_QUEENS_HPP_INCLUDED #include <bits/stdc++.h> using namespace std; class Solution { private: vector<vector<string>> result; vector<string> createBoard(int n); bool checkColumn(const vector<string> &board,const int &row,const int & column); bool ch...
644
230
#include <bases.h> // Bases::toBase16, toBase36 #include <cmath> // std::ceil, std::log2 #include <stdexcept> // std::range_error #include <string> // std::string #include <vector> // std::vector namespace { char const BASE_16_CHARS[] = "0123456789abcdef"; char const BASE_36_CHARS[] = "012...
7,863
2,912
// ArduinoJson - arduinojson.org // Copyright Benoit Blanchon 2014-2018 // MIT License #include <ArduinoJson.h> #include <catch.hpp> TEST_CASE("JsonArray::add()") { DynamicJsonDocument doc; JsonArray _array = doc.to<JsonArray>(); SECTION("int") { _array.add(123); REQUIRE(123 == _array[0].as<int>()); ...
3,301
1,265
#include "CppUTestExt/MockSupport.h" #include "socket.hh" #include <stdexcept> Socket::Socket(const char * device) { mock().actualCall("socket_constructor") .withStringParameter("device", device); if(!mock().returnBoolValueOrDefault(true)) { throw std::runtime_error("forced creation failure"); } } Socket::~So...
2,285
743
/* * serverMgr.hpp * * Created on: Oct 8, 2015 * Author: romeo */ #ifndef INCLUDE_FLEXIBITY_JSONRPC_SERVERMGR_HPP_ #define INCLUDE_FLEXIBITY_JSONRPC_SERVERMGR_HPP_ #include "flexibity/jsonrpc/jsonRpcSerial.hpp" #include "flexibity/jsonrpc/jsonRpcWebsocketClient.hpp" #include "flexibity/genericMgr.hpp" nam...
1,687
663
/// /// \file Crc16Ccitt1021.hpp /// \author Geoffrey Hunter <gbmhunter@gmail.com> (www.mbedded.ninja) /// \edited n/a /// \created 2017-06-10 /// \last-modified 2018-01-25 /// \brief Contains the Crc16Ccitt1021 class. /// \details /// See README.rst in root dir for more info. #ifndef MN_SER...
717
329
/* Minimum Cost of ropes ===================== There are given N ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths. The task is to connect the ropes with minimum cost. Example 1: Input: n = 4 arr[] = {4, 3, 2, 6} Output: 29 Explan...
2,024
774
// // Created by Jerry on 2021/5/15. // #include "IndexOutOfBoundException.h" #include <cstring> const char *IndexOutOfBoundException::DEFAULT_NAME = "Index out of bound!"; IndexOutOfBoundException::IndexOutOfBoundException(const string& name) { char* origin = const_cast<char*>(name.data()); this->name = stat...
769
252
#include <chrono> #include <random> #include "argparse/argparse.hpp" #include "rmi/models.hpp" #include "rmi/rmi.hpp" #include "rmi/util/fn.hpp" #include "rmi/util/search.hpp" using key_type = uint64_t; using namespace std::chrono; std::size_t s_glob; ///< global size_t variable /** * Measures lookup times of @p...
12,579
4,467
#pragma once #include <Windows.h> #include <TlHelp32.h> #include <string> #include "Offsets.hpp" #include <map> class ReplicantHook { private: DWORD _pID; uintptr_t _baseAddress; uintptr_t actorPlayable; bool _hooked; offsets _offsets; int _version; std::map<std::string, uintptr_t> _inventory; int gold; std::...
2,605
941
/* Rafael Díaz Medina A01024592 David Benjamin Ruiz A01020825 https://www.boost.org/doc/libs/1_55_0/libs/graph/example/ https://www.boost.org/doc/libs/1_55_0/libs/graph/example/dfs-example.cpp https://www.boost.org/doc/libs/1_55_0/libs/graph/example/kruskal-example.cpp https://www.boost.org/doc/libs/1_55_0/libs/g...
12,213
5,276
#pragma once #include <cstdint> #include "../utils/general.hpp" namespace stm32::rg { /** * The special-purpose program status registers, xPSR */ DEFINE_REG(ApplicationProgramStatusRegister, { RESERVE(27); ///< bits[26:0] bool Q : 1; ///< bit[27] ///< Set to 1 if a SSAT or USAT instruct...
4,275
1,247
#include "saber/funcs/impl/arm/saber_softmax.h" #include "saber/funcs/impl/arm/neon/impl/neon_mathfun.h" namespace anakin{ namespace saber{ void softmax_basic(const float* din, float* dout, \ const int axis_size, const int inner_num, \ const int outer_num, const int compute_size) { #pragma omp parallel for ...
23,906
10,048
// Guitar Zero solution // Written in C++ by Jobby Johns // UCF 2007 High School Programming Contest /* The solution is very simple. Get the number of score changes. Start the * score at 0. Then, get each score change one at a time and adjust the score * accordingly. Once all the score changes are done, ou...
1,259
513
#pragma once #include <string> #include <SDL2/SDL_ttf.h> ///////// /// TODO /// liberar la fuente en el destructor class eFont{ public: eFont(const char* str, int size); ~eFont(); inline TTF_Font* getSDLFont() const { return sdl_font; }; private: ...
358
128
#pragma once #include <cstdint> namespace principia { namespace astronomy { constexpr std::uint64_t KSPStockSystemFingerprint = 0x54B6323B3376D6F3; constexpr std::uint64_t KSPStabilizedSystemFingerprint = 0xB57B58F9CF757C62; } // namespace astronomy } // namespace principia
286
120
/* * * ECOS - Embedded Conic Solver * Copyright (C) [2012-2015] A. Domahidi [domahidi@embotech.com], * Automatic Control Lab, ETH Zurich & embotech GmbH, Zurich, Switzerland. * * Copyright [2017] Max Planck Society. All rights reserved. * * This program is free software: you can redistribute it and/or modify *...
21,721
8,293
#include "gtest/gtest.h" #include "core/common.h" #include "core/utils.h" #include "core/parser/fmla/fmla_parser.h" #include "apps/clones/clone_generation.h" namespace { TEST(CloneGen, GenerateCloneGodel) { ltsy::BisonFmlaParser parser; auto p = parser.parse("p"); auto q = parser.parse("q"...
14,159
5,014
/* Copyright 2013-present Barefoot Networks, 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 w...
15,108
4,503
#include "pipeline.h" //#include "colourmap.h" //#include <opencv2/viz.hpp> int main(int argc, char* argv[]) { // ######### EuRoC ######### //std::string dataset_path_left = "data/EuRoC/MH1/cam0/data/%10d.png"; //std::string dataset_path_right = "data/EuRoC/MH1/cam1/data/%10d.png"; // ######### E...
1,552
689
/* @copyright Louis Dionne 2014 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #include <boost/hana/ext/std/integral_constant.hpp> #include <boost/hana/core/datatype.hpp> #include <type_traits> using namespace boost::hana;...
1,181
434
#include "../multi_array.hpp" #include <iostream> #include <numeric> template<typename Container> void print(Container c) { std::cout << c.size() << '\n'; for(auto&& v : c) std::cout << v << ' '; std::cout << '\n'; } int main() { eb::multi_array<int, 3, 2, 2> arr1{0}; eb::multi_array<int,...
878
457
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * * This application is open source and may be redistributed and/or modified * freely and without restriction, both in commericial and non commericial applications, * as long as this copyright notice is maintained. * * This application is d...
27,241
8,396
#include <string> #include "acmacs-base/argv.hh" #include "acmacs-base/filesystem.hh" #include "acmacs-chart-2/chart.hh" #include "acmacs-chart-2/factory-import.hh" // ---------------------------------------------------------------------- void find_ace_files(const fs::path& source_dir, std::vector<fs::path>& ace_fil...
2,823
932
/* Copyright (c) 2012 Mike Ryan 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, distribute, subli...
34,652
13,707
/* * Copyright (c) 2020 Pavlo Lavrenenko * * 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, pu...
2,248
736
// 통나무 건너뛰기 #include <iostream> #include <string> #include <vector> #include <cassert> #include <cmath> #include <algorithm> #include <list> using namespace std; vector<int> input; int N; int logJumping() { sort(input.begin(), input.end()); list<int> reorder; for (int i=0; i<N; i++) { int e = input[i]; ...
1,259
506
#include <tests/doctest.h> #include <iostream> #include <sstream> #include <chrono> #include <string> #include <lpython/bigint.h> using LFortran::TRY; using LFortran::Result; using LFortran::BigInt::is_int_ptr; using LFortran::BigInt::ptr_to_int; using LFortran::BigInt::int_to_ptr; using LFortran::BigInt::string_to...
6,612
3,015
/* Tiniest Analytics - v1.1 - MIT License (i.e. can use it for whatever purpose) Version history: v1.1 - 2017/12/15 - changed to C-style C++ Original authors: Mihai Dragomir, email:dmc@pixelshard.com Mihai Gosa, email:pintea@inthekillhouse.com twitter: @gosamihai */ #include "google_analytics.h" #incl...
3,804
1,553
//============================================================================ #if defined(__arm64__) //============================================================================ #include "Javelin/Assembler/arm64/Assembler.h" #include "Javelin/Assembler/JitMemoryManager.h" #include <algorithm> #include <stdint.h>...
30,276
13,113
//Copyright (c) 2021 Sanat Raorane #include<iostream> #include"student.h" using namespace std; void student::read(student arrayA[],int num){ for(int i=0;i<num;i++){ cout<<"\n\n"; //Lines for spacing cout<<"Enter details for student "<<(i+1)<<endl; cout<<"Enter Name:"<<endl; cin.syn...
1,203
444
/* * Copyright (C) 2014 The Android Open Source Project * * 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 app...
26,301
9,398
#include <gtest/gtest.h> #include <vector> // See main.cc TEST(SolutionTest, NaiveAndFast) { std::vector<int> a{1, 2, 3}; std::vector<int> b{1, 2, 3}; ASSERT_EQ(a.size(), b.size()); for (size_t i = 0; i < a.size(); ++i) { EXPECT_EQ(a[i], b[i]); } }
264
135
// FrictionOperator.cpp // // Breannan Smith // Last updated: 09/22/2015 #include "FrictionOperator.h" #include "scisim/Constraints/Constraint.h" FrictionOperator::~FrictionOperator() {} // TODO: Despecialize from smooth void FrictionOperator::formGeneralizedSmoothFrictionBasis( const unsigned ndofs, const unsigned...
2,393
808
#ifndef INPUT_H_INCLUDED #define INPUT_H_INCLUDED class Input { private: int reference; String alias; public: Input(int reference, String alias); int getReference(); String getAlias(); void serialPrint(); }; #endif
242
87
#include <cstdio> int a, b; int sum(int lo, int hi) { if (lo < 1) lo = 1; if (lo > hi) return 0; if (lo == hi) return lo; return (hi*(hi+1) - (lo-1)*lo)/2; } int solve() { int x = a % 2 == 0 ? a / 2 : (a - 1) / 2; int y = b % 2 == 0 ? b / 2 - 1 : (b - 1) / 2; return sum(x, y)*2 + y - x +...
515
260
// ========================================================== // FreeImage 3 Test Script // // Design and implementation by // - Herv� Drolon (drolon@infonie.fr) // // This file is part of FreeImage 3 // // COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY // OF ANY KIND, EITHER EXPRESSE...
4,524
1,730
// This is an open source non-commercial project. Dear PVS-Studio, please check it. // PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com /* * Copyright (c) 2018 - 2019, MetaHash, Oleg Romanenko (oleg@romanenko.ro) * * Licensed under the Apache License, Version 2.0 (the "License"); * y...
3,167
1,027
/********************************************************************* ** Author: Wei-Chien Hsu ** Date: 04/09/18 ** Description: Asks the user enters width and height, and output the Area. *********************************************************************/ #include <iostream> using ...
582
157
// tutorial02.c // A pedagogical video player that will stream through every video frame as fast as it can. // // Code based on FFplay, Copyright (c) 2003 Fabrice Bellard, // and a tutorial by Martin Bohme (boehme@inb.uni-luebeckREMOVETHIS.de) // Tested on Gentoo, CVS version 5/01/07 compiled with GCC 4.1.1 // With up...
5,636
2,313
#include "resource.h" bool PythonResource::Start() { return true; } bool PythonResource::Stop() { return Impl::Stop(); } bool PythonResource::OnEvent(const alt::CEvent *ev) { return Impl::OnEvent(ev); } void PythonResource::OnTick() { Impl::OnTick(); } void PythonResource::OnCreateBaseObject(alt::...
510
180
#include "../include/sockio.h" SockIO::SockIO(QTcpSocket* a_socket, QObject* parent) : QObject(parent) , m_socket{ a_socket } { connect(m_socket, &QTcpSocket::readyRead, this, &SockIO::onReadyRead); } bool SockIO::hasMessages() { return !m_messageQueue.isEmpty(); } Message SockIO::nextMessage() { if (!hasMessag...
1,668
652
#ifndef __PIC_8259_HPP_INCLUDED__ #define __PIC_8259_HPP_INCLUDED__ #include <drivers/pic/pic.hpp> #include <utils.hpp> namespace drivers { class PIC8259 : public IPIC { uint8_t m_picMasterMask; uint8_t m_picSlaveMask; public: void init(); bool registerLegacyIrq(uint8_t irq, ...
536
219
/** * @copyright * Copyright (c) 2017 - SLD Group @ Columbia University. All Rights Reserved. * * This file is part of Mnemosyne. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of sourc...
6,043
1,945
/****************************************************************************** * Copyright 2018 The Apollo 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 ...
1,326
392
#pragma once #include <fstream> #include <memory> #include <chrono> #include <random> #include <vector> #include <thread> #include <boost/asio.hpp> #include <boost/bind.hpp> #include <boost/shared_ptr.hpp> class Server { public: Server(int port); ~Server(); bool send(std::string& data); bool receive(std::strin...
935
365
/* ** ** $Filename: b3TxSaveInfo.cc $ ** $Release: Dortmund 2001, 2016 $ ** $Revision$ ** $Date$ ** $Author$ ** $Developer: Steffen A. Mork $ ** ** Blizzard III - File format encoder ** ** (C) Copyright 2001 - 2021 Steffen A. Mork ** All Rights Reserved ** ** */ /*************************************************...
2,047
740
// Autogenerated from CppHeaderCreator on 7/27/2020 3:10:08 PM // Created by Sc2ad // ========================================================================= #pragma once #pragma pack(push, 8) // Begin includes // Including type: System.Enum #include "System/Enum.hpp" #include "utils/il2cpp-utils.hpp" // Completed in...
2,811
843
#include <iostream> #include <vector> using namespace std; int main(void) { int n, first, last, current, sz; bool increasing; while (cin >> n) { if (n == 0) break; increasing = true; vector<int> points; for (int i = 0; i < n; i++) { cin >> ...
1,743
522
#include <bits/stdc++.h> #define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL) using namespace std; const int N = 100 + 5; const int MOD = 1e9 + 7; int n, k, m, sol; set<pair<int, pair<int, pair<int, int> > > > s; bool ok, vis[N][N]; map<pair<int, int>, int> mp; void check(int i, int j){ if(i <= 0...
1,586
706
#include <iostream> using namespace std; int t, k; string s; int main() { cin >> t; for (int T=1; T<=t; ++T) { cin >> s >> k; int cnt = 0; int n = s.length(); for (int i=0; i<=n-k; ++i) { if (s[i] == '-') { cnt++; for (int j=i; j<i+k; ++j) s[j] = s[j] == '+' ? '-' : '+'; } } bool fl...
551
314
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include <vector> #include <numeric> #include <cmath> #include <cstring> #include <algorithm> #include <functional> #include <random> #include <thread> #include <atomic> #include <chrono> #include <ctime> #include <iostream> #include "macros.h" #include "Buff...
71,364
21,530
#include "macros.h" #include <assert.h> #include "math/GLMatrix.h" FLAKOR_NS_BEGIN MatrixStack* modelviewStack; MatrixStack* projectionStack; MatrixStack* textureStack; MatrixStack* currentStack = NULL; static unsigned char initialized = 0; #ifdef __cplusplus extern "C" { #endif void lazyInitialize() { if (!...
4,011
1,236
#include "init_struct.hpp" #include "swapchain_vulkan.hpp" #include "image_view_vulkan.hpp" #include "result.hpp" namespace gfx { inline namespace v1 { namespace vulkan { uint32_t swapchain_implementation::current_image() const noexcept { return _current_image; } void swapchain_implementation::present() { if...
9,577
3,446
#include <vector> #include <random> class Solution { public: std::vector<int> arr_; std::random_device dev_; std::mt19937 rng_; std::vector<std::uniform_int_distribution<int>> dists_; std::vector<int> res_; Solution(std::vector<int>& nums) : arr_(nums), dev_(), rng_(dev_()), res_(nums) { ...
1,044
368
// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "distributedcomputingdialog.h" #include "ui_distributedcomputingdialog.h" #include "addressbookpage.h" #include "ad...
4,919
1,666
#include <bits/stdc++.h> using namespace std; int main() { cout << 9 << '\n'; }
83
36
/*Header-MicMac-eLiSe-25/06/2007 MiccMac : Multi Image Correspondances par Methodes Automatiques de Correlation eLiSe : ELements of an Image Software Environnement www.micmac.ign.fr Copyright : Institut Geographique National Author : Marc Pierrot Deseilligny Contributors : Gregoire Maillet, Did...
8,537
3,493
#ifndef WEBSOCKET_SERVER_OUT_WEATHER_STATUS_PACKET_HH #define WEBSOCKET_SERVER_OUT_WEATHER_STATUS_PACKET_HH #include <array> namespace amadeus { enum class WebSocketSessionFlag : std::uint8_t; #pragma pack(push, 1) namespace out { /// \brief Defines the WeatherStatusPacket which is sent by the server if a /// WebSock...
831
275
#ifndef ALIGNED_MMALLOC_HPP #define ALIGNED_MMALLOC_HPP /*============================================================================= allocator.hpp - Platform independent aligned memory allocation. Created on: 06-December-2011 Author: Ken Herdy Description: TODO - Wrap routines inside a class scope and/or...
831
311
/* test_array_derivatives.cpp - Test derivatives of array expressions Copyright (C) 2017 European Centre for Medium-Range Weather Forecasts Author: Robin Hogan <r.j.hogan@ecmwf.int> Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided t...
4,010
1,651
// Copyright (c) 2015-2016, ETH Zurich, Wyss Zurich, Zurich Eye // 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 // ...
9,908
3,241
/*---------------------------------------------------------------------------*\ Copyright (C) 2011 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of CAELUS. CAELUS is free software: you can redistribute it and/or modify it under...
3,198
1,117
#include "applicationdata.h" ApplicationData::ApplicationData() { }
70
21
// -*- mode: c++; c-file-style: "k&r"; c-basic-offset: 4 -*- /*********************************************************************** * * store/benchmark/retwisClient.cc: * Retwis benchmarking client for a distributed transactional store. * **********************************************************************/ ...
11,149
3,652
// // Created by Marco Bassaletti on 18-03-21. // #include "InvalidCommandSyntaxException.h"
94
38
/**************************************************************************** * Author: Michael S. Lewis * * Date: 6/3/2016 * * Description: RequireSpace.hpp is the RequireSpace class declaration * * (interface) file (for Final Project "DOS Boat"). * * A Require S...
1,144
325
#include <iostream> using std::cout; using std::endl; template<class T, int a> class X { public: T valX[a]; }; template<class T, int a> class Y { X<T, a> valY; public: void Set(T t) { valY.valX[0] = t; } void ShowFirst() { cout << valY.valX[0] << endl; } }; int main() { Y<double, 3> y; y.Set(0.8); y.ShowFi...
360
176
#include <chrono> #include <cmath> #include "softrender.hpp" struct rect_t { softrender::point_t pos{ 0, 0 }; int w{ 0 }; int h{ 0 }; }; using microsecond_t = decltype(std::chrono::duration_cast<std::chrono::microseconds>( std::chrono::seconds(1)) .count()); auto fo...
1,836
665
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do // this in one cpp file #include "catch.hpp" #include <GraphMol/RDKitBase.h> #include <GraphMol/RDKitQueries.h> #include <GraphMol/Chirality.h> #include <GraphMol/FileParsers/FileParsers.h> #include <GraphMol/Smiles...
4,508
2,056
#include <bits/stdc++.h> #define fi first #define se second #define maxk 17 #define maxn 100003 #define mod 1000000007 using namespace std; typedef pair<int,int> pi; int s; int comb[maxk][maxk]; pi dp[maxn][maxk]; int f( int ind , int step , int rem ) { if( ind == step ) return 1; if( dp[rem][ind].se == step + 1...
973
493