text
string
size
int64
token_count
int64
/** */ #include "Types.hh" #include <iostream> #include <string> namespace aingle { namespace strings { const std::string typeToString[] = { "string", "bytes", "int", "long", "float", "double", "boolean", "null", "record", "enum", "array", "map", "union", "fix...
1,326
441
#include <boost/test/unit_test.hpp> #include <boost/cstdint.hpp> #include <boost/scoped_ptr.hpp> #include <boost/archive/binary_iarchive.hpp> #include <boost/archive/binary_oarchive.hpp> #include <boost/serialization/vector.hpp> #include "heightfield.h" BOOST_AUTO_TEST_SUITE(test_triangle) BOOST_AUTO_TEST_CASE(test_...
9,846
6,090
/* Generated through 'instantiate_templates.py', do not edit manually. */ /* Read and write sparse matrices in text format: * <labels(s)> <column>:<value> <column>:<value> ... * * BSD 2-Clause License * Copyright (c) 2021, David Cortes * All rights reserved. * Redistribution and use in source a...
89,722
31,553
#include "kernel.h" #include "raster.h" #include "numericrange.h" #include "numericdomain.h" #include "columndefinition.h" #include "table.h" #include "connectorinterface.h" #include "mastercatalog.h" #include "ilwisobjectconnector.h" #include "catalogexplorer.h" #include "catalogconnector.h" #include "internalrasterco...
1,546
501
#include <algorithm> #include <spdlog/spdlog.h> #include "D3D9Hook.hpp" using namespace std; static D3D9Hook* g_d3d9_hook = nullptr; D3D9Hook::~D3D9Hook() { unhook(); } uintptr_t end_scene_jmp_ret = 0; __declspec(naked) void end_scene_hook(void) { __asm { pushad push eax call D3D9Hook::end_scene popad...
2,385
1,179
// Given a string s consisting of some words separated by some number of spaces, return the length of the last word in the string. // A word is a maximal substring consisting of non-space characters only. // Example 1: // Input: s = "Hello World" // Output: 5 // Explanation: The last word is "World" with length 5....
947
322
#include "threading.hpp" QueueHandle_t qAHRS = xQueueCreate(1, sizeof(AHRSData_t)); SemaphoreHandle_t ahrsBufferMutex = xSemaphoreCreateMutex(); boost::container::vector<void*> TaskHandle(TOTAL_TASK_SIZE); BaseType_t xTaskSendMessage(TaskIndex idx, uint32_t msg) { if (TaskHandle[idx]) return xTaskNotify(TaskHand...
579
231
#include <cstdint> #include "Bus.hpp" Bus bus; void irs() { LOG_INFO("Interrupt Detected\n"); uint8_t data5; uint8_t address10; uint8_t address11; address10 = 0; address11 = 1; bus.polling(address10, address11); data5 = 15; bus.io_write(address10, data5); } int main() { sjsu::lpc40xx::Gpio interr...
896
436
// // Created by liuzikai on 3/19/20. // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // #include "klc3/Core/Executor.h" #include "klc3/Generation/ReportFormatter.h" #define LOG_BR_FORK 0 #define LOG_SYM_ADDR_FORK 0 #define DISABLE_FORK_ON_SYM_ADDR...
40,214
12,777
//---------------------------------------------------------------------------// //! //! \file tstHDF5ArchiveTupleTypes.cpp //! \author Alex Robinson //! \brief HDF5 archive tuple type unit tests //! //---------------------------------------------------------------------------// // Std Lib Includes #include <iostrea...
13,300
4,690
#define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE operations/mutation #include <boost/test/unit_test.hpp> #include <geneial/algorithm/BaseGeneticAlgorithm.h> #include <geneial/core/fitness/Fitness.h> #include <geneial/core/fitness/FitnessEvaluator.h> #include <geneial/core/population/PopulationSettings.h> #incl...
15,286
4,862
#include <touchgfx/hal/Types.hpp> FONT_LOCATION_FLASH_PRAGMA KEEP extern const uint8_t unicodes_Asap_Regular_13_4bpp[] FONT_LOCATION_FLASH_ATTRIBUTE = { 0 // No glyphs };
172
83
#include "stdafx.h" #include "MuxedStream.h" using namespace primo::dvdbuilder::VR; MuxedStreamCB::MuxedStreamCB() { filename[0] = L'\0'; file = NULL; MainWindow = NULL; Reset(); } MuxedStreamCB::~MuxedStreamCB() { Reset(); } void MuxedStreamCB::Reset() { if (file) { fclose(file); ...
2,524
1,049
#include "PhysicsTools/CandAlgos/plugins/EventShapeVarsProducer.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "PhysicsTools/CandUtils/interface/Thrust.h" EventShapeVarsProducer::EventShapeVarsProducer(const edm::ParameterSet& cfg) { srcToken_ = consumes<edm::View<reco::Candidate> >(cfg.getP...
1,666
647
#pragma once #include <mbgl/util/noncopyable.hpp> #include <mbgl/tile/geometry_tile_data.hpp> #include <mbgl/style/layer_type.hpp> #include <mbgl/style/image_impl.hpp> #include <mbgl/renderer/image_atlas.hpp> #include <atomic> namespace mbgl { namespace gl { class Context; } // namespace gl class RenderLayer; class...
2,115
626
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* reverse...
809
251
// Graph Engine // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.md file in the project root for full license information. // #include "Storage/MTHash/MTHash.h" #include "Storage/MemoryTrunk/MemoryTrunk.h" using namespace Trinity::IO; namespace Storage { bool MTHash::...
4,440
1,361
// WeaponDispersion.cpp: разбос при стрельбе // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "items/Weapon.h" #include "inventoryowner.h" #include "actor.h" #include "inventory_item_impl.h" #include "actoreffector.h" #include "effectorshot.h" //возвращает 1, ...
2,240
883
// The Bomberman Game - Solution #include <iostream> #include <vector> std::vector<std::string> bomberMan(const int r, const int c, const int n, const std::vector<std::string> &grid) { std::vector<std::string> finalGrid1 = grid, finalGrid2, finalGrid3; for (int i{}; i < r; i++) for (int j{}; j < c; j...
1,924
709
/* @brief a simple command line parser @author guobao.v@gmail.com */ #ifndef _COMMON_CMDLINE_HPP_ #define _COMMON_CMDLINE_HPP_ #include <common/precomm.hpp> #include <algorithm> #ifdef __GNUC__ #include <cxxabi.h> #endif /** @addtogroup common @{ @defgroup cmdline cmdline - command line parser @{ ...
27,815
7,805
#include "parser.h" #include "scanner.h" #include <iostream> using namespace std; int main(int argc, char **argv) { string input, context = ""; Parser *parser; while (true) { do { if (context == "") cout << "?- "; else ...
969
279
#include "samplers/itf/simple_sampler.h" using namespace lb; SimpleSampler::SimpleSampler( const Point2d& upperLeft, const Point2d& bottomRight): Sampler(upperLeft, bottomRight) { }
196
68
/* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is also distributed with cer...
6,242
2,138
#include "pch.h" #include "layers_stack.h" engine::layers_stack::~layers_stack() { for(auto* layer : m_layers) { layer->on_detach(); delete layer; } } void engine::layers_stack::push_layer(layer* layer) { m_layers.emplace(m_layers.begin() + m_layers_insert_index, layer); m_layers_...
990
365
#ifndef Person_hpp #define Person_hpp #include <stdio.h> #include <iostream> using namespace std; class Person { public: string name; int age; bool sex; public: //默认构造函数,相当于init Person(); //带参数的构造函数,相当于带参数的init Person(const char* name , const int age , const bool sex); //析构函...
431
188
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "ResampleDataset.h" #include <algorithm> #include <numeric> namespace { std::vector<int64_t> makeIdentityPermutation(i...
1,855
645
#define _WINSOCKAPI_ #include <windows.h> #include <stdio.h> #include <list> #include "libfuncs.h" #include "logging.h" using namespace std; using namespace RSLibImpl; #define NUM_REPLICAS 5 #define MAX_CMD_LEN 256 char procTitles[NUM_REPLICAS][256]; volatile bool endTest; volatile bool endTestCompleted; bool Start...
7,051
2,079
// MIT License // // MEL - Mechatronics Engine & Library // Copyright (c) 2019 Mechatronics and Haptic Interfaces Lab - Rice University // // 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 w...
8,606
2,192
// Author: btjanaka (Bryon Tjanaka) // Problem: (UVa) 10855 #include <bits/stdc++.h> #define GET(x) scanf("%d", &x) #define GED(x) scanf("%lf", &x) typedef long long ll; using namespace std; #define SZ 5000 int b, s; char big[SZ][SZ]; char small[SZ][SZ]; char small2[SZ][SZ]; void rotate() { for (int i = 0; i < s; +...
1,119
538
#pragma once namespace TestJoinBeforeAndAfterThreadHasFinished{ void Run(); }//~namespace //==================== //Test many threads //==================== namespace TestManyThreads{ void Run(); }//~namespace //========================== //Test immediate thread exit //========================== namespace TestImmed...
415
110
#include <iostream> #include "../include/Task.h" Task::Task(std::string content_val) : content {content_val} {} std::string Task::get() { return content; }
165
59
#include <bits/stdc++.h> #define LL long long int using namespace std; string division(string a, LL b); int main(void) { int T; cin >> T; for(int i = 1; i <= T; i++){ string a; LL b; cin >> a >> b; cout << division(a, b) << endl; } return 0; } string division(st...
698
273
// This file has been generated by Py++. #include "boost/python.hpp" #include "wrap_osg.h" #include "applicationusageproxy.pypp.hpp" namespace bp = boost::python; void register_ApplicationUsageProxy_class(){ bp::class_< osg::ApplicationUsageProxy >( "ApplicationUsageProxy", bp::init< osg::ApplicationUsage::Type...
520
160
/* SCIPMEX - A MATLAB MEX Interface to SCIP * Released Under the BSD 3-Clause License: * http://www.i2c2.aut.ac.nz/Wiki/OPTI/index.php/DL/License * * Copyright (C) Jonathan Currie 2013 * www.i2c2.aut.ac.nz */ #include "scipmex.h" #include "mex.h" #include <signal.h> //Ctrl-C Detection #ifdef __cplusplus ext...
1,842
723
// // Copyright (c) 2016-present DeepGrace (complex dot invoke 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) // // Official repository: https://github.com/deepgrace/giant // #include <memory>...
1,163
358
#include<iostream> #include<string> #include<cstring> #include<fstream> #include<conio.h> #include<cstdlib> using namespace std; string tasks[100]; int total=0,ch; char yes; void display() { cout<<"Your todo List :-"<<endl; for(int i = 0;i<total;i++) { cout<<i+1<<". ...
2,657
927
#include "interface_mouse_ps2.hpp" #include "../../../mossc/_misc.hpp" #include "../../graphics/vesa/controller.hpp" #include "../../io/io.hpp" #include "../../kernel.hpp" #include "../mouse.hpp" #include "controller_ps2.hpp" namespace MOSS { namespace Input { namespace Devices { //TODO: timeout...
3,922
1,583
#include <iostream> #include <vector> #include<algorithm> using namespace std; int numberOfSubarrays(vector<int>& nums, int k) { vector<int> oddIndex; int sum = 0, index=0; oddIndex.push_back(-1); for (auto itterator = 0; itterator < nums.size(); itterator++) { if (nums[itterator] % 2 != 0...
728
288
#include "graminit.h" #include "CharStream.hpp" #include <iostream> #include "llvm/ADT/STLExtras.h" std::unique_ptr<CharStream> cs; static int gettok(){ static int lastChar = ' '; while (isspace(lastChar)) { cs->next(); lastChar = cs->getCurrent(); } if (lastChar == '#'){ co...
1,306
446
#include "KEEntityNamePool.h" #include "KEditorGlobal.h" KEEntityNamePool::KEEntityNamePool() { } KEEntityNamePool::~KEEntityNamePool() { ASSERT_RESULT(m_Pool.empty()); } bool KEEntityNamePool::Init() { UnInit(); return true; } bool KEEntityNamePool::UnInit() { m_Pool.clear(); return true; } std::string KEEnt...
2,131
857
//============================================================== // Copyright (C) 2004 Danny Chapman // danny@rowlhouse.freeserve.co.uk //-------------------------------------------------------------- // /// @file SDLApplicationbase.cpp // //==========================...
9,931
3,178
#ifdef WINDOWS #include <System/System.h> using namespace System; using namespace System::Runtime; using namespace System::Objects; using namespace System::Devices; using namespace System::IO; using namespace System::Interface; using namespace System::Graphics; #undef using #define _INITIALIZER_LIST_ #include <Wind...
17,656
6,371
#include "line.h" Line::Line() { setAdjustFlag(false); } void Line::startDraw(QGraphicsSceneMouseEvent * event) { QPen pen = this->pen(); pen.setWidth(this->width); pen.setColor(this->color); setPen(pen); startPos=event->scenePos(); } void Line::drawing(QGraphicsSceneMouseEvent ...
769
274
/* Copyright ©2013 The Regents of the University of California (Regents). All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research, and not-for-profit purposes, without fee and without a signed licensing agreement, is hereby granted, pr...
16,075
5,809
#pragma once #include <queue> #include <msw/buffer.hpp> namespace dawn { struct queue_blocks { typedef msw::range<msw::byte> block ; typedef msw::range<msw::byte const> const_block ; queue_blocks () ; ...
2,707
777
/** * Copyright (c) 2017 Melown Technologies SE * * 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...
7,250
3,121
#include <opencv/cv.h> #include <opencv/highgui.h> int main(int argc, char** argv) { int col_1, row_1; uchar b_1, g_1, r_1, b_2, g_2, r_2, b_d, g_d, r_d; IplImage* img = cvLoadImage("Theory/Scratch Pencil Photo/Input/lena.jpg"); IplImage* img1 = cvCreateImage(cvSize(img->width, img->height), img->depth, img->nCh...
1,934
974
// Use of this source code is governed by a BSD 3-Clause License // that can be found in the LICENSE file. // Author: caozhiyi (caozhiyi5@gmail.com) #include "timer_1ms.h" namespace quicx { static const TIMER_CAPACITY __timer_accuracy = TC_1MS; // 1 millisecond static const TIMER_CAPACITY __timer_capacity = TC_50M...
3,215
1,167
#include "etcd/v3/action_constants.hpp" char const * etcdv3::CREATE_ACTION = "create"; char const * etcdv3::COMPARESWAP_ACTION = "compareAndSwap"; char const * etcdv3::UPDATE_ACTION = "update"; char const * etcdv3::SET_ACTION = "set"; char const * etcdv3::GET_ACTION = "get"; char const * etcdv3::PUT_ACTION = "put"; ch...
1,893
752
#include "Where.hh" #include "printutils.hh" namespace ft = ftools; namespace fs = std::filesystem; namespace pu = printUtils; Table::Table(std::string name) { this->name = name; loadPaths(name); checkTableExists(); load_metadata(); this->reg_count = ft::getRegCount(name); this->indexes = new std::vecto...
4,823
1,710
#include "SimulationsOMP_pcp.h" #include "ParaUtil.h" #include "ParaUtilSerialSort.h" #include "ParaUtilMSDRadix16Sort.h" #define Data_Digit(num, disp, mask) (((num) >> (disp)) & (mask)) #define Data_Digit_16(num, disp) Data_Digit(num, disp, 0xF) namespace ParaUtil { namespace Internal { static constexpr uint64_t r...
5,293
1,823
#include "../../include/kit2d/scene/Stage.hpp" #include "../../include/kit2d/scene/Scene.hpp" namespace kit2d { Stage::Stage(Window& window) : window(window) { window.onUpdate([this](float deltaTime) { this->scene->update(deltaTime); }); window.onRender([this](Renderer& renderer) { this->sc...
631
217
#include <iostream> #include <vector> #include <queue> using namespace std; bool equidivision(const vector<vector<int> >& grid) { const int N = grid.size(); vector<vector<bool> > visited(N, vector<bool>(N, false)); for (int n = 0; n < N; n++) { for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) ...
1,492
597
#include "bits/stdc++.h" using namespace std; char *getTime() { chrono::time_point<chrono::system_clock> now = chrono::system_clock::now(); time_t t = chrono::system_clock::to_time_t(now); return ctime(&t); } double accountBalance = 100; mutex accountLock; void getMoney(int id, double amou...
1,015
367
#include "window.h" Window::Window (QWidget *parent) : QMainWindow (parent),ui (new Ui::Window) { ui->setupUi(this); p=0; laser=0; } Window::~Window(){ delete ui; } void Window::on_fixed_frame_clicked() { QString odometryFilename = QFileDialog::getOpenFileName(this,tr("Open ODOMETRY log file"),"...
4,026
1,536
#include <iostream> #include <algorithm> #define MAXN 101 #define MAXV 1001 using namespace std; // if you want the full pack,initialize res[0] = 0,res[1:] = -inf // or you want the maximum value, initialize res[:] = 0; //you could also use cost-effective sort to solve void orgin() { int vol[MAXN]; int val[MAXN]; ...
917
440
/** * example.cpp * * The MIT License (MIT) * * Copyright (c) 2016 Tammo Ippen * * 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...
2,841
1,073
/*************************************************************************** qgsmessagebar.cpp - description ------------------- begin : June 2012 copyright : (C) 2012 by Giuseppe Sucameli email : sucameli at f...
12,440
4,164
#include "VideoCanvas.h" #include <wx/dcbuffer.h> #include <wx/rawbmp.h> #include <opencv2/opencv.hpp> VideoCanvas::VideoCanvas(wxWindow* parent) : wxScrolledCanvas(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE) { SetBackgroundColour(*wxBLACK); SetBackgroundStyle(wxBG_STYL...
1,467
551
#include <doctest.h> #include <cpp/Version.hpp> TEST_CASE("Version.Attribute") { #if __has_cpp_attribute(carries_dependencies) #endif #if __has_cpp_attribute(deprecated) #endif #if __has_cpp_attribute(fallthrough) #endif #if __has_cpp_attribute(likely) #endif #if __has_cpp_attribute(unlikely) #endif #if __has_cpp_att...
1,252
463
/* At the annual meeting of Board of Directors of Acme Inc, every one starts shaking hands with everyone else in the room. Given the fact that any two persons shake hand exactly once, Can you tell the total count of handshakes? Input Format The first line contains the number of test cases T, T lines follow. Each li...
1,302
453
/* -*- C++ -*- */ /* * Copyright 2003-2004 The Apache Software 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 ...
4,454
1,302
/* Copyright (C) 2003-2013 by David White <davewx7@gmail.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 Free Software Foundation, either version 2 of the License, or (at your option) any later version....
4,744
1,789
/* * source code: tryandcatch.cpp * author: Lukas Eder * date: 01.01.2018 * * Descr.: * Uebung zu try and catch Fehlerbehandlung inkl. inteligentem Array */ #include <iostream> #include <array> using namespace std; int main() { //Variablen array<double, 3> preise; preise.at(0) = 1.45; ...
674
315
#ifndef INSANITY_INTERFACE_SUB_THREAD #define INSANITY_INTERFACE_SUB_THREAD #include "Constants.hpp" #include "IThread.hpp" namespace Insanity { //"Sub," in opposition to the "main" thread, represented by IApplication. class INSANITY_API ISubThread : public virtual IThread { public: //==========================...
1,209
338
#include "load_dds.hpp" #define VK_NO_PROTOTYPES #include <vulkan/vulkan.h> //#define MEAN_AND_LEAN //#define NO_MINMAX //#include <windows.h> #include <iostream> /* Can load easier and more indepth with https://github.com/Hydroque/DDSLoader Because a lot of crappy, weird DDS file loader files were fou...
16,909
7,345
#include <iostream> #include <algorithm> #include <list> #include <vector> #include <iterator> using namespace std; int iArray[5] = {1,2,3,4,5}; void Display(list<int> &a , const char* s){ cout << s << endl; copy(a.begin(),a.end(), ostream_iterator<int>(cout, " ")); cout << endl; } int main(){ list...
712
262
#include <memory> #include <odb/core.hxx> #include <odb/lazy-ptr.hxx> #include <set> #include <string> #pragma db view class StarCount{ public: int stars; int count; }; #pragma db view query("select top 1 text, last_elapsed_time from sys.dm_exec_query_stats cross apply sys.dm_exec_sql_text(sql_handle) order by last...
3,292
1,186
// 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 "src/developer/debug/zxdb/symbols/identifier.h" #include "gtest/gtest.h" #include "src/developer/debug/zxdb/common/err.h" namespace zxdb { TEST...
2,511
839
// Created by Tanuj Jain #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define pb push_back #define mp make_pair typedef long long ll; typedef pair<int,int> pii; template<class T> using oset=tree<T, null_typ...
3,456
1,898
/** This is a pretty basic command line Tic-Tac-Toe game. Its been totally done to death, but I felt like it would be a relatively easy way to apply what I've learned with C++ so far. Author: CKilburn12 (Colin Kilburn) **/ #include <bits/stdc++.h> #include <iostream> #include <algorithm> #include <vector> #include <...
10,626
3,154
#include <glad/glad.h> #include <GLFW/glfw3.h> #define STB_IMAGE_IMPLEMENTATION #include "stb/stb_image.h" #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> #include <iostream> const char* vertexShaderSource = R"( #version 330 core layout (location = 0) in vec3 pos; layo...
8,075
4,076
// // Created by huangkun on 2019/12/30. // #ifndef OPENGV2_FEATUREBASE_HPP #define OPENGV2_FEATUREBASE_HPP #include <memory> #include <Eigen/Eigen> #include <opengv2/landmark/LandmarkBase.hpp> namespace opengv2 { class FeatureBase { // TODO: inherit ObservationBase public: EIGEN_MAKE_ALIGNED_OPERA...
1,728
552
#ifndef _INCLUDE_WRAPPER #define _INCLUDE_WRAPPER #include <ISmmPlugin.h> #include "iplayerinfo.h" #if SOURCE_ENGINE <= SE_DARKMESSIAH /** * Wrap the CCommand class so our code looks the same on all engines. */ class CCommand { public: const char *ArgS() { return g_Engine->Cmd_Args(); } int ArgC() { return...
518
227
//-------------------------------------------------------------------------- // Copyright (C) 2014-2018 Cisco and/or its affiliates. All rights reserved. // // 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 Fr...
8,311
2,678
#include "SplitFit.h" SplitFit::SplitFit() { int levelH[30] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; int levels = 1; int levelW[30] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }; int levelHmin = 0; int levelRH[30] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...
3,891
2,209
#include <iostream> #include <bits/stdc++.h> using namespace std; struct dna { int pos; int key; string str; }; bool cmp(const dna &a, const dna &b) { if (a.key != b.key) { return a.key < b.key; } else { return a.pos < b.pos; } } int main() { int n, m, count; dna inv[110]; string str; cin >> n >> m...
677
371
#include "./font.hpp" #include "./vfs.hpp" #include "../utility/logger.hpp" #include "../video/texture.hpp" #include <fstream> #include <glm/gtc/constants.hpp> #include <nlohmann/json.hpp> const font_glyph_t font_t::kNullGlyph {}; void font_t::load(const std::string& directory, const std::string& name) { auto make...
2,792
1,219
#include <Red/Data/JSON/Number.h> Red::Data::JSON::Number :: Number ( double Value ): RefCounted ( 0 ), Value ( Value ) { } Red::Data::JSON::Number :: ~Number () { } Red::Data::JSON::IType :: DataType Red::Data::JSON::Number :: GetType () const { return kDataType_Number; } double Red::Data::JSON::Number :: ...
436
168
#include "ofxXTweener.h" #pragma region Easing functions /***** LINEAR ****/ float Linear::easeNone(float t, float b, float c, float d) { return c*t / d + b; } float Linear::easeIn(float t, float b, float c, float d) { return c*t / d + b; } float Linear::easeOut(float t, float b, float c, float d) { return c*t /...
10,516
4,749
#pragma once #include <wayland-server.h> #include <unordered_map> #include <vector> #include <string> namespace Awning::Protocols::WL::Data_Device { extern const struct wl_data_device_interface interface; namespace Interface { void Start_Drag(struct wl_client* client, struct wl_resource* resource, struct wl_res...
761
257
// https://github.com/vinniefalco/LuaBridge // // Copyright 2019, Dmitry Tarakanov // SPDX-License-Identifier: MIT #include "TestBase.h" struct NamespaceTests : TestBase { template <class T> T variable (const std::string& name) { runLua ("result = " + name); return result <T> (); } }; TEST_F (Namesp...
7,119
2,740
/* * Copyright 2016 The Cartographer 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
5,810
2,046
/* Copyright (c) 2017, CNRS-LAAS 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 following di...
10,699
3,943
#define DEBUG #include <omp.h> #include <cstdio> #include <cmath> #include <utility> #include <vector> #include <random> #include <chrono> #include <string> // for file writing #include <cstdlib> #include <iostream> #include <fstream> #include <unistd.h> using namespace std; unsigned int global_id = 0; const float SI...
23,631
10,934
#include "geotiff.h" #include "cpl_conv.h" // for CPLMalloc() #include "file_accessor.h" #include "gdal_frmts.h" #include "grid.h" #include "lambert_conformal_grid.h" #include "lambert_equal_area_grid.h" #include "latitude_longitude_grid.h" #include "logger.h" #include "plugin_factory.h" #include "producer.h" #include...
26,482
10,104
// Copyright (c) 2017, Baidu.com, 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applic...
24,431
8,580
#include "state_mach.h" using namespace Raft; State::State() { } State::~State() { } bool State::is_follower() { return d_state == RAFT_STATE_FOLLOWER; } bool State::is_leader() { return d_state == RAFT_STATE_LEADER; } bool State::is_candidate() { return d_state == RAFT_STATE_CANDIDATE; } void State::set(R...
404
170
#include <iostream> #include <native/native.hpp> using namespace native; using namespace http; int main() { std::shared_ptr<Loop> loop = Loop::Create(); std::shared_ptr<Server> server = Server::Create(loop); server->get("/", [](std::shared_ptr<ServerConnection> connection) -> Future<void> { // some initial ...
1,539
479
/* * * * * * * * * * * * * * * * * * * * * @author: Xingjian Bai * @date: 2020-10-11 10:31:31 * @description: * /Users/jackbai/Desktop/OI/OpenCup/e.cpp * * @notes: * g++ -fsanitize=address -ftrapv e.cpp * * * * * * * * * * * * * * * * * */ #include <bits/stdc++.h> #define F first...
5,572
3,066
// Copyright 2015 Piotr Tworek. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ozone_qt/platform/client_native_pixmap_factory_qt.h" #include "ui/ozone/common/stub_client_native_pixmap_factory.h" namespace ui { ClientNativePixmap...
437
150
// // Created by Yuki Igarashi on 2017/05/23. // #include "rbitmap.hpp" namespace utils { RBitmap::RBitmap(int size) : size_(size) { if (size > MAX_BIT_SIZE) throw "Exception: size exceed MAX_BIT_SIZE while creating bitmap. (Use longer int as Bitmap instead.)"; } void RBitmap::set_value(int symbol, size_t case...
847
309
#ifndef POLYNOMIALFIT_CPOLYFIT_HPP #define POLYNOMIALFIT_CPOLYFIT_HPP #include <vector> namespace FenestrationCommon { class PolynomialFit { public: explicit PolynomialFit(std::size_t const t_Order); // Get polynomial fit for given coefficients std::vector<double> getCoefficients(...
503
186
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-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 "pow.h" #include "arith_uint256.h" #include "chain.h" #include "primiti...
8,995
2,785
#include "renderer/CCPrimitive.h" #include "renderer/CCVertexIndexBuffer.h" NS_CC_BEGIN Primitive* Primitive::create(VertexData* verts, IndexBuffer* indices, int type) { auto result = new (std::nothrow) Primitive(); if( result && result->init(verts, indices, type)) { result->autorelease(); ...
1,982
738
/* This file is part of solidity. solidity 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 3 of the License, or (at your option) any later version. solidity is distributed in the hope that i...
12,308
4,626
#include "AsyncTCPServer_Factory.h" #include "AsyncTCPServer_Impl.h" namespace AsyncTCP { AsyncTCPServer_Factory_Ptr AsyncTCPServer_Factory::m_instance = nullptr; AsyncTCPServer_Factory_Ptr& AsyncTCPServer_Factory::getInstance() { if (m_instance == nullptr) m_instance = std::unique_ptr<AsyncTCPServe...
730
269
#include "ExtraHelpers.h" #include <QChar> #include <QDateTime> #include <QDir> #include <QFile> #include <QObject> #include <QTextStream> #include "HandlebarsParser.h" namespace Handlebars { const escape_fn fn_noEscape, fn_htmlEscape { [] (const QString& str ) { return str.toHtmlEscaped(); } }; void register...
16,941
5,381
#pragma once //------------------------------------------------------------------------------ // // Copyright 2018-2019 Fetch.AI Limited // // 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 Licen...
1,524
411
// // Created by Dan Rosser on 10/9/21. // #include "ofxOboeAndroidSoundPlayer.h" bool ofxOboeAndroidSoundPlayer::load(const std::filesystem::path& fileName, bool stream) { AudioProperties targetProperties { .channelCount = ofxOboe::getChannelCount(), .sampleRate = ofxOboe::getSampleRate()...
3,983
1,378