text
string
size
int64
token_count
int64
// Problem: https://leetcode.com/problems/basic-calculator-ii/ #include <string> #include <vector> #include <limits> #include "utils.h" namespace basic_calculator_2 { class Solution { public: // Note: The expression must be valid and contain only the following // characters: '0'-'9', '+', '-', '*', '/', ' '....
5,587
1,992
#include<iostream> #include<cstring> class Gun { private: int bullet; public: Gun(int bnum) : bullet(bnum) { } void Shot() { std::cout << "BBANG!" << std::endl; bullet--; } }; class Police : public Gun { private: int handcuffs; public: Police(int bnum, int bcuff) : Gun(bnum), handcuffs(bcuff) { } void P...
479
228
#if defined AEH_WITH_SDL2 && defined AEH_WITH_IMGUI #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) #define _CRT_SECURE_NO_WARNINGS #endif #ifdef _MSC_VER #pragma warning(disable : 4121) // alignment of a member was sensitive to packing #endif #include "imgui_sdl_binding.hh" #include <imgui.h> // SDL,GL3...
21,041
8,722
class Solution { public: vector<string> fullJustify(vector<string>& words, int maxWidth) { vector<string> res; // num reprents the number of words in every row // cur is the current sum of lengths of added words int num, cur; for (int i = 0; i < words.size(); i += n...
943
292
/* write a program that performs LL COMPOUND assignment operations on an integer*/ #include"iostream" #include"conio.h" using namespace std; main() { int a=10; cout<<" Values of a "<<a<<endl; a+=5; cout<<"Values of a+=5 : "<<a<<endl; a-=5; cout<<"Values of a-=5 : "<<a<<endl; a*=2; cout<...
463
210
// ================================================================================================= // This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This // project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max- // width of 100 char...
2,657
815
version https://git-lfs.github.com/spec/v1 oid sha256:03e7fef2ca71e571577cdf63f979796b3db5d2d1dc938db5c767359822f146d4 size 1652
129
91
#include "Display.hh" #include "AICore.hh" bool Display::iaIsPlaying() { if (!this->checkNbPlayer(this->gameloop.getWormsPlayer())) return (false); int idTeam = this->listPlayers[this->gameloop.getWormsPlayer()][0]; int idWorms = this->listPlayers[this->gameloop.getWormsPlayer()][1]; if (this->gameloop.getW...
14,463
6,305
#include <glm/gtc/matrix_transform.hpp> #include "FuncUnitl.h" #include <fbxsdk.h> namespace lly_util { GLenum to_usage(lly::VertexUsage usage) { switch (usage) { case lly::VertexUsage::STATIC_DRAW: return GL_STATIC_DRAW; case lly::VertexUsage::STATIC_COPY: return GL_STATIC_COPY; case lly::VertexUsage::ST...
8,860
4,111
/** @file feedforward_impl.inl @brief FeedForward layer implementation <p>(c) 2016, stefan.berke@modular-audio-graphics.com</p> <p>All rights reserved</p> <p>created 1/19/2016</p> */ #define MNN_TEMPLATE template <typename Float, class ActFunc> #define MNN_FEEDFORWARD FeedForward<Float, ActFunc> MN...
11,658
4,010
// // Created by bddwy on 2021/1/26. // #include "CANRegistration.h" //CANCommunication CANCommunication::CAN1Communication;
127
58
//======================================================================= // Copyright Baptiste Wicht 2011-2016. // Distributed under the MIT License. // (See accompanying file LICENSE or copy at // http://opensource.org/licenses/MIT) //======================================================================= #ifndef E...
548
167
/* * Copyright 2009-2017 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...
1,716
530
/* Copyright (c) 2015-2019 Xavier Leclercq 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, me...
7,584
2,357
#include "packedfont16.h" #include "mutablebitmapbase.h" using namespace WoopsiUI; // // pixeldata is an array of u16 values, each of which represents // a single pixel. // void PackedFont16::renderChar( const u16* pixelData, u16 pixelsPerRow, MutableBitmapBase* bitmap, u16 colour, s16 x, s16 y, u16 clipX1,...
1,430
617
#ifndef OBJECTS_OBJMGR_IMPL___ANNOT_FINDER__HPP #define OBJECTS_OBJMGR_IMPL___ANNOT_FINDER__HPP /* $Id: annot_finder.hpp 103491 2007-05-04 17:18:18Z kazimird $ * =========================================================================== * * PUBLIC DOMAIN NOTICE * National Cen...
2,999
946
#include <qlist.h> #include <qpixmap.h> #include <qfileinfo.h> #include <qfile.h> #include <qtemporaryfile.h> namespace { template<typename T> void write(QFile& f, const T t) { f.write((const char*)&t, sizeof(t)); } } bool savePixmapsToICO(const QList<QPixmap>& pixmaps, const QString& path) { static_ass...
2,053
786
// // Created by Liferov Ilia (liferili) on 5/12/16. // #include <fstream> #include <sstream> #include <deque> #include "HtmlDOM.h" #include "DoctypeNode.h" #include "PairTagNode.h" #include "SingleTagNode.h" #include "CommentNode.h" #include "TextNode.h" #include "ErrorTagNode.h" #include <algorithm> #include "String...
9,597
2,684
/** @file MeshDrawable.cpp Copyright 2016 Computational Topology Group, University of Kaiserslautern 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/...
4,296
1,374
#include <cmath> #include <vector> #include <iostream> #include <fstream> #include <stdlib.h> #include <thread> #include "public.h" using namespace std; /* ACTIVATION FUNCTIONS ------------------- */ float relu(float x) { if (x > 0) { return x; } return 0; } float reluD(float x) { if (x > 0) { return 1...
13,142
5,546
// // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // #include "core/inspector/InspectorTracingAgent.h" #include "core/frame/LocalFrame.h" #include "core/inspector/IdentifiersFactory.h" #include "core/...
4,227
1,337
#ifndef __BASECLS_HPP__ #define __BASECLS_HPP__ /*++ Copyright (C) 2000 Microsoft Corporation All rights reserved. ...
2,206
595
#include <iostream> #include "constants.h" int main(){ std::cout << "Constant pi have value:\t\t" << Constants::pi << "\n"; std::cout << "Constant avogadro have value:\t" << Constants::avogadro << "\n"; std::cout << "Constant my_gravity have value:\t" << Constants::my_gravity << "\n"; return 0; }
306
116
#include "threadeventshelper.h" #include <QMutexLocker> #include "SharedModule/internal.hpp" ThreadEvent::ThreadEvent(ThreadEvent::FEventHandler handler, const AsyncResult& result) : m_handler(handler) , m_result(result) {} void ThreadEvent::call() { try { m_handler(); m_result.Resolve(tr...
3,563
1,204
// Generated by using Rcpp::compileAttributes() -> do not edit by hand // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 #include <RcppEigen.h> #include <Rcpp.h> using namespace Rcpp; // runExactTSNE_wrapper Rcpp::List runExactTSNE_wrapper(NumericMatrix X, int no_dims, bool verbose, int max_iter, NumericMatri...
3,549
1,483
//----------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- #include "stdafx.h" #include <boost/test/unit_test.hpp> #include "Common/FabricGlobals.h" using ...
1,944
488
#include "HoughForestOptionsLoader.h" #include "HoughForestOptions.h" #include "HDException.h" #include "HDLibLog.h" #include "Utils.h" #include <fstream> HoughForestOptionsLoader::HoughForestOptionsLoader(const std::string & _strConfigFileName, HoughForestOptions & _options) : m_options(_options), m_strConfigFileN...
5,315
1,913
#include <cassert> #include <algorithm> #include "cflw音频_xa2.h" namespace cflw::音频::xa2 { using 多媒体::FindChunk; using 多媒体::ReadChunkData; //============================================================================== // 辅助函数 //============================================================================== void f销毁声音(...
5,398
3,388
#include <utils/Errors.h> #include <utils/Log.h> #include "IWakeonVoice.h" namespace wakeonvoice { enum { START_LISTEN, STOP_LISTEN, START_ENROLL, STOP_ENROLL, ENABLE_DEBUG, SET_ENROLLTIMES, SET_SECURITYLEVEL, REGISTER_LISTENER, }; status_t BnWakeonVoice::onTransact( uint32_t code, const Parcel &...
3,755
1,717
//--------------------------------- // 2016/10/29 #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #include <stdbool.h> #include <time.h> #include <unistd.h> #include <fcntl.h> #include <wiringPi.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <linux/i2c-dev.h> #include "Infrared...
3,501
1,665
// ==================================================================== // This file is part of FlexibleSUSY. // // FlexibleSUSY 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 Licens...
14,360
6,703
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Fixed.class.cpp :+: :+: :+: ...
1,625
516
#include "Map.h" #include <Game.h> #include <Common\ResourceMgr.h> #include <Common\Random.h> #include "PlayScene.h" #include "Objects\Entities\Player.h" #include "Rooms\Room.h" #include "Rooms\BossRoom.h" #include "Rooms\FinalBossRoom.h" #include "Rooms\TreasureRoom.h" #include "Rooms\ZombieRoom.h" #include "Room...
10,202
4,954
// // Created by mi on 2021/4/8. // #include "Environment.h" Environment *Environment::GetInstance() { static Environment s_Environment; if (EnvStatus::Initialize == s_Environment.m_CurrentStatus) { s_Environment.InitCaps(); } return &s_Environment; } Environment::Environment() : m_Vers...
1,083
370
#include "CVTagImageResult.h" #include "../../../../Bundle.h" #include "../../../../AnyArray.h" namespace EasyCpp { namespace Net { namespace Services { namespace Microsoft { namespace Cognitive { CVTagImageResult::CVTagImageResult() { } CVTagImageResult::~CVTagImageResult() ...
1,174
542
// Generated by Haxe 4.2.0-rc.1+cb30bd580 #include <hxcpp.h> #ifndef INCLUDED_EReg #include <EReg.h> #endif HX_DEFINE_STACK_FRAME(_hx_pos_359fe5fd855fee60_28_new,"EReg","new",0x8b859e81,"EReg.new","/usr/local/lib/haxe/std/cpp/_std/EReg.hx",28,0x5a2fdacd) HX_LOCAL_STACK_FRAME(_hx_pos_359fe5fd855fee60_36_match,"EReg","...
5,229
2,605
#include "gincu/gtexture.h" namespace gincu { GTexture::GTexture() { } GTexture::GTexture(const std::shared_ptr<GTextureData> & data) : data(data) { } GSize GTexture::getSize() const { return this->data->getSize(); } bool GTexture::isValid() const { return (this->data && this->data->isValid()); } } //namespa...
331
133
#pragma once #include"tree_walk.hpp" namespace ParticleSimulator{ /////////////////////////////////////////////////// // // FUNCTIONS OF WALK+FORCE WITH DOUBLE BUFFERING // /////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// ...
109,845
40,319
#include "savemenu.h" #include "../../profile/ui/savemenu.h" #include "../../profile/games/chlcc/savemenu.h" #include "../../renderer2d.h" #include "../../mem.h" #include "../../profile/scriptvars.h" #include "../../inputsystem.h" #include "../../ui/widgets/button.h" // #include "../../ui/widgets/chlcc/saveentrybutton...
2,007
767
#pragma once #include "core/serialize.hpp" #include "core/draw_systems/draw_system_identifier.hpp" class DrawSystem; struct DrawSystemPreference { std::size_t playerLowerLimit; DrawSystemIdentifier drawSystem; DrawSystemPreference() = default; DrawSystemPreference(std::size_t playerLowerLimit, DrawS...
1,457
418
#pragma once #ifndef FILE_WRITER_INCLUDED #define FILE_WRITER_INCLUDED #include "USRP_server_settings.hpp" #include "USRP_server_diagnostic.hpp" #include "USRP_server_memory_management.hpp" #include "USRP_server_network.hpp" #include <ctime> #include "H5Cpp.h" #include "H5CompType.h" using namespace H5; class H5_file_...
2,371
708
// :copyright: (c) 2017 Alex Huszagh. // :license: FreeBSD, see LICENSE.md for more details. /** * C++ bindings for libxlsxwriter worksheets. */ #pragma once #include "chart.hpp" #include "common.hpp" #include "format.hpp" #include <deque> #include <xlsxwriter/worksheet.h> namespace xlsxwriter { // ENUMS // -...
6,887
2,202
// Gathering mcint results from files and summarizing results // usage: ./mcint_fromfile.x <n_procs> // where n_procs are the number of processors used in mcint simulation using namespace std; #include <cmath> #include <iostream> // std io #include <iomanip> // std io #include <fstream> // file io #include <sstream>...
3,745
1,482
#include<iostream> using namespace std; int area(int); int area(int,int); float area(float,float); int main() { int s,l,b; float bs,ht; cout<<"Enter side of a square: "; cin>>s; cout<<"Enter length and breadth of rectangle: "; cin>>l>>b; cout<<"Enter base and height of triangle: "; cin>>bs>>ht; cout<<"Area of ...
579
239
#pragma once #include <stdint.h> #define NAT_INT_MIN INT64_MIN #define NAT_INT_MAX INT64_MAX namespace Natalie { using nat_int_t = int64_t; }
147
66
#include <algorithm> #include <iostream> #include <string> #include <vector> #include "config.h" #include "shift.h" namespace shift { Shift::Shift() : work_{false} , code_{} , span_{} {}; Shift::Shift(const std::string &code, const std::vector<span_t> &span) : work_{!span.empty()} , code_{co...
3,349
1,209
#include <iostream> #include <fstream> #include <string> #include <vector> #include <algorithm> #include <queue> #include <set> #include <string.h> using namespace std; int main(){ int a, b, maxGCD = 1; scanf("%d %d", &a, &b); for(int i = 1; i <= b; i++){ int lower = a/i; if(a%i != 0) lower++;...
537
226
#include "../factorial.hpp" #include <gtest/gtest.h> struct FactorialTests: ::testing::Test{ int* x; virtual void SetUp() override { x = new int(0); } int getX(){ return *x; } void setX(int y){ *x = y; } virtual void TearDown() override { delete x; ...
668
280
#include "tcppacket.h" PacketDB<TcpPacket> TcpPacket::_packetdb; PacketDB<TcpAck> TcpAck::_packetdb;
106
54
#include "pch.h" #include "opencv2/opencv.hpp" using namespace cv; using namespace std; int main() { Mat im1 = imread("./image/S0.png",IMREAD_GRAYSCALE); Mat im2 = imread("./image/K0.png",IMREAD_GRAYSCALE); Mat im3 = imread("./image/S4.png",IMREAD_GRAYSCALE); double m1 = matchShapes(im1, im1, CONTOURS_MATCH...
679
302
#include "MonoCallbackScheduler.h" #include "MonoPluginPrivatePCH.h" bool MonoCallbackScheduler::AddTickableObject(MonoObject * obj) { if(obj == nullptr) return false; MonoClass * ObjectClass = mono_object_get_class(obj); TickObject Data; Data.removed = false; Data.Obj = obj;...
1,942
667
/* * Copyright 2021 Niket Naidu. 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...
2,789
903
#include <mlcmst_solver.hpp> #include <utility> namespace MLCMST { MLCMST_Solver::~MLCMST_Solver() = default; MLCMST_Solver::Result::Result( std::optional<network::MLCST> mlcmst, std::optional<double> lower_bound, double wall_time, bool finished ) : mlcst(std::move(mlcmst)), lower_bound(std::move(lower_b...
376
146
// author: a.voss@fh-aachen.de #include <iostream> using namespace std; int main() { cout << endl << "--- " << __FILE__ << " ---" << endl << endl; string s{"Beispiel"}; // (A) cout << "01| s='" << s << "'" << endl; // (B) cout << "-----" << endl; cout << "02| s+s...
3,297
1,277
#include "fps_mapper/RichPointMsg.h" #include "fps_mapper/StampedCloudMsg.h" #include <ros/ros.h> #include "txt_io/message_writer.h" #include "tf/transform_listener.h" #include "fps_ros_msgs.h" using namespace fps_mapper; using namespace std; txt_io::MessageWriter writer; tf::TransformListener* _listener = 0; voi...
1,332
515
/* Detect if two integers have opposite signs */ #include<iostream> #include<stdio.h> using namespace std; bool checkOppositeSign(int a, int b){ return ( (a^b) < 0); } int main() { cout<<checkOppositeSign(3,-4)<<endl; return(0); }
240
96
// Copyright 2016 The Fuchsia Authors // Copyright (c) 2008-2014 Travis Geiselbrecht // // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT /** * @file * @brief Kernel timer subsystem * @defgroup timer Timers * * The ...
19,179
6,596
#include "xlog.h" #ifdef OS_WIN #include <windows.h> #endif #include <include/xservice_intf.h> namespace x { LogService* _logService = new LogService(); LogIocService* _logIocService = new LogIocService(); LogMngService* _logMngService = new LogMngService(); LogService::LogService(){ isSync_ = true; level_ = LOG_L...
4,088
1,765
#include <iostream> #include <vector> using namespace std; vector<int> graph[100001] = {}; int check[100001] = {}; int parents[100001] = {}; void dfs(int start) { check[start] = 1; for(int i = 0; i < graph[start].size(); i++) { int node = graph[start][i]; if(check[node]) continue; p...
780
331
/** * Copyright (c) 2021 OceanBase * OceanBase Database Proxy(ODP) is licensed under Mulan PubL v2. * You can use this software according to the terms and conditions of the Mulan PubL v2. * You may obtain a copy of Mulan PubL v2 at: * http://license.coscl.org.cn/MulanPubL-2.0 * THIS SOFTWARE IS PROVIDED ...
3,297
1,181
// Copyright 2018 Krystian Stasiowski #include "Button.h" Button::Button(unsigned x, unsigned y, Color textcolor, Color backgroundcolor, Color selectedtextcolor, Color selectedbackgroundcolor, Color activatedtextcolor, const std::string& text, const std::string& selectedtext, const std::string& activatedtext, const s...
3,636
1,124
// OJ: https://leetcode.com/problems/counting-bits // Author: github.com/lzl124631x // Time: O(N) // Space: O(1) class Solution { public: vector<int> countBits(int num) { vector<int> ans(num + 1); for (int i = 1; i <= num; i *= 2) { ans[i] = 1; for (int j = 1; j < i && i + j <= num; ++j) ans[i + j...
369
171
#pragma once #include "../store/store.hpp" #include <string> void save_file(std::string path, Store& store); void open_file(std::string path, Store& store);
161
56
/** * @file CListenerA.cpp * @author cuiwl<cwllinux@126.com> * */ /** version history: 2016-09-21 0.1.0 cuiwl initial implementation **/ #include "../../Include/listener/CListenerA.h" namespace observer_pattern { const char* CListenerA::spLogPrefix = "CListenerA"; // constructor / destr...
574
212
#include "grmath.h" vec3 random_in_unit_disk() { while (true) { auto p = vec3(random_double_range(-1, 1), random_double_range(-1, 1), 0); if (p.lengthSquared() >= 1) continue; return p; } } vec3 random_unit_vector() { auto a = random_double_range(0, 2 * maths::Pi); auto z = ran...
1,449
588
// Copyright Dominic Koepke 2019 - 2022. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) #ifndef SL_UTILITY_FUNCTIONAL_HPP #define SL_UTILITY_FUNCTIONAL_HPP #pragma once #include <concept...
5,904
2,410
// #pragma once // #ifdef NIEDERREITER_EXPORTS // #define NIEDERREITER_API __declspec(dllexport) // #else // #define NIEDERREITER_API __declspec(dllimport) // #endif // extern "C" NIEDERREITER_API void calcc ( ); // extern "C" NIEDERREITER_API void calcv ( int px[], int b[], int v[], int v_max ); // extern "C" NIEDE...
1,905
747
// Fill out your copyright notice in the Description page of Project Settings. #include "Widget_KeyInputItem.h" #include "Components/TextBlock.h" #include "Components/Image.h" void UWidget_KeyInputItem::NativeConstruct() { Super::NativeConstruct(); m_pKeyText = Cast<UTextBlock>(GetWidgetFromName(TEXT("KeyText")));...
1,708
714
typedef long long ll; const ll kMod = 1000000007LL; class Solution { public: int numberOfWays(int num_people) { // convert it to a smaller problem vector<ll> memo(num_people + 1, 0); return static_cast<int>(helper(num_people, &memo)); } private: ll helper(int n, vector<ll> *...
625
246
/* * hog_extractor.cpp * * Created on: Mar 22, 2012 * Author: Juergen Gall, mdantone */ #include <deque> #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include "hog_extractor.h" #include "cpp/vision/min_max_filter.hpp" using namespace std; using namespace cv; namespace vi...
8,259
4,026
/* WIZnet IoT Shield Cat.M1 Sample code for Arm MBED * Copyright (c) 2019 WIZnet Co., Ltd. * SPDX-License-Identifier: Apache-2.0 */ /* * 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 ...
12,145
4,542
#include "../../../../utilities/catch.hpp" #include "numpp/structures/matrices/dense.hpp" TEST_CASE( "dense matrix functions tests", "[mathemathical][matrix][dense][constexpr]" ){ constexpr numpp::matrix::dense<double, 4, 5> matrix{ 1.2, -4.5, 12412.3, 12512., 294.2352, 2, 5.35, -412.3, 12, 0, -34, 0, 0, 0,...
729
366
/** @file Stopwatch.cpp @maintainer Morgan McGuire, http://graphics.cs.williams.edu @created 2005-10-05 @edited 2009-03-14 Copyright 2000-2009, Morgan McGuire. All rights reserved. */ #include "G3D/Stopwatch.h" #include "G3D/System.h" namespace G3D { Stopwatch::Stopwatch(const std::string& myName) : ...
3,382
1,224
#include <unity.h> #include <etl/message_bus.h> #include "button_messages.h" #include "ButtonPressingDetector.h" #include "assertions/MessageBusVerifier.h" ButtonPressingDetector *inLoopProcessor; etl::imessage_bus *bus; assertions::MessageBusVerifier *busVerifier; void emits_loop_initiated_message_every_time_durin...
4,122
1,406
/* * Copyright (c) 2015 Samsung Electronics Co., Ltd. * * 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...
15,222
4,278
/* This file is part of SAIL (https://github.com/smoked-herring/sail) Copyright (c) 2020 Dmitry Baryshev The MIT License 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 with...
3,127
1,213
#include "Configurations.hpp" #include "PlacementCost.hpp" #include "HittingSet.hpp" using namespace IdempotentRegion; void HittingSet::computeHitCountMap(PathsTy &Paths) { HitCountMap.clear(); for (const auto &Path : Paths) for (const auto &Point : Path) HitCountMap[Point]++; } void HittingSet::remov...
3,013
1,120
// 572 Subtree of Another Tree // https://leetcode.com/problems/subtree-of-another-tree // version: 1; create time: 2019-12-30 11:34:15; /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL)...
811
310
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
9,047
2,808
// Copyright (c) 2015 // Author: Chrono Law #include <std.hpp> using namespace std; #include <boost/smart_ptr.hpp> using namespace boost; ////////////////////////////////////////// struct counted_data { // ... int m_count = 0; ~counted_data() { cout << "dtor" << endl; } }; void intrusive...
1,270
478
/*############################################################################ # Copyright (c) 2020 Source Simian : https://github.com/sourcesimian/uICAL # ############################################################################*/ #include <sstream> #include "uICAL/cppstl.h" #include "uICAL/types.h" #include "uI...
5,591
1,787
/***************************************************************************** * * * PLAST : Parallel Local Alignment Search Tool * * Version 2.3, released November 2015 * * ...
4,806
1,229
#include <iostream> #include <time.h> #include <stdlib.h> #include "arrayops.h" #include "dsutils.h" using namespace std; void allocateArray(int size) { if (arr) { delete[] arr; } arr = new int[size]; n = size; } void createArray(int st, int end, int incr) { int size = (end - st) / incr + 1;...
2,490
918
#include <gtest/gtest.h> #include <ctype.h> TEST(ctype, isalpha) { EXPECT_TRUE(isalpha('a')); EXPECT_TRUE(isalpha('z')); EXPECT_FALSE(isalpha(' ')); EXPECT_FALSE(isalpha('1')); EXPECT_FALSE(isalpha('@')); }
228
101
#include <os.h> #include <x86.h> /* Stack pointer */ extern u32 * stack_ptr; /* Current cpu name */ static char cpu_name[512] = "x86-noname"; /* Detect the type of processor */ char* Architecture::detect(){ cpu_vendor_name(cpu_name); return cpu_name; } /* Start and initialize the architecture */ void Architectu...
6,608
3,055
#include "InterceptorTest.h" using namespace std; using namespace BWAPI; void InterceptorTest::onStart() { BWAssert(Broodwar->isMultiplayer()==false); BWAssert(Broodwar->isReplay()==false); Broodwar->enableFlag(Flag::UserInput); Broodwar->sendText("show me the money"); int correctCarrierCount = 2; int corre...
2,021
692
class Solution { public: int compareVersion(string v1, string v2) { int n = v1.size(), m = v2.size(); for (int i = 0, j = 0; i < n || j < m; ) { int a = i, b = j; while (a < n && v1[a] != '.') a ++; while (b < m && v2[b] != '.') b ++; int x = a == i ? ...
580
223
#include <netprotocol.h> N::CiosDiscovery:: CiosDiscovery (void) : UdpDiscovery ( ) , neighbors (NULL) { setParameter ( "Myself" , false ) ; } N::CiosDiscovery::~CiosDiscovery (void) { if ( NotNull(neighbors) ) { if ( neighbors->Used <= 0 ) { delete neighbor...
6,444
1,484
#include <iostream> #include <vec_mat.h> int main( int argc, char *argv[] ) { using namespace std ; cout << "\\documentclass[border=1mm]{standalone}" << endl << "\\input{../src/header.tex}" << endl ; const char * tex = R"tex( \tikzisometrico \begin{tikzpicture}[scale=1.4,isometricXYZ] ...
852
388
/* $Id$ */ /* * Copyright (c) 2010 .SE (The Internet Infrastructure Foundation) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above...
34,154
18,025
#include "../include/Code_highlighting.h" #include "../include/EasyCodingEditor.h" using namespace cht; using namespace edt; edt::easyhtmleditor e1; //设置颜色 void Code_highlighting::Set_color(int wr,int wg,int wb,int br,int bg,int bb){ printf("\033[38;2;%d;%d;%dm\033[48;2;%d;%d;%dm",wr,wg,wb,br,bg,bb); /...
2,213
1,203
#include <bits/stdc++.h> using namespace std; struct Node{ int data; Node* next; Node(int d){ data=d; next=NULL; } }; int main() { Node *head=new Node(10); head->next=new Node(5); head->next->next=new Node(20); head->next->next->next=new Node(15); head->next->next->next->next=...
340
145
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <sstream> #include <vector> #include <iomanip> #include <cmath> const long long MOD = 1LL*186583*587117; using namespace std; typedef long long LL; typedef pair<int,int> pii; LL fact[10000010],res[10000010]; LL mulmod(LL a,LL b) { ...
1,016
477
#include "Proxy.h" int Proxy::playerId; int Proxy::playerNetworkGameObjectId; int Proxy::teamNumber;
101
36
#include <catch2/catch.hpp> #include "core/gui/widgets/Panel.h" #include "core/gui/widgets/VerticalLayout.h" #include "core/gui/widgets/Button.h" #include "TestsUtils.h" TEST_CASE("[Panel]") { auto vLayout = ire::core::gui::VerticalLayout::create({ 200, 200 }); auto button = ire::core::gui::Button::create(); v...
1,560
650
/** simple.cpp Purpose: Example of using polylidar in C++ @author Jeremy Castagno @version 05/20/19 */ #include <Rcpp.h> using namespace Rcpp; #include <iostream> #include <sstream> // std::istringstream #include <vector> #include <string> #include <fstream> #include <iomanip> #include "include...
3,417
1,208
#include "vk_common.h" namespace vulkan { GpuRenderPipeline::GpuRenderPipeline(GpuDevice* device, ngfx::RenderPipelineDesc const& desc) : GpuPipelineBase(device) { create_info_.stageCount; create_info_.pStages; create_info_.pVertexInputState; create_info_.pInputAssemblyState; create_info_.pTessellationSt...
1,016
399
#include "eurobeat.h" #include <errno.h> #include <stdlib.h> #include <string.h> #include <cstdbool> #include <iostream> #include <vector> #include <linux/can.h> #include "portaudio.h" #include <sndfile.h> #include "audioutil.h" #include "canutil.h" #include "util.h" #define CUT_MUSIC_DIR "/home/tc/cutmusic/" #de...
6,500
2,935
#include "Finger.h" Finger::Finger() { } Finger::Finger(const Point& finger_tip_point, FingerType type) { this->location = Location(finger_tip_point); this->roi = Rect(Point(location.get().x - width / 2, location.get().y - height / 4), Size(width, height)); this->type = type; } /// Extracts finger from image by...
460
174
// ========================================================================== // // File : hwlib-doxygen-char-io.hpp // Part of : C++ hwlib library for close-to-the-hardware OO programming // Copyright : wouter@voti.nl 2017-2019 // // Distributed under the Boost Software License, Version 1.0. // (See accompanyin...
8,951
2,515