text
string
size
int64
token_count
int64
#include "Core/Math/Mat4.hpp" #include "Render/D3D11Helper.hpp" #include "Resources/Mesh.hpp" #include "Resources/Texture.hpp" #include "Core/Primitives.hpp" #include "Resources/Map.hpp" #include "Render/DrawDataHandler.hpp" #include "Render/Drawers/MiniMapDrawer.hpp" #include "Render/Camera.hpp" using namespace Cooki...
5,711
2,260
#ifndef LKEEGAN_CANONICAL_DIRAC_OP_H #define LKEEGAN_CANONICAL_DIRAC_OP_H #include <random> #include "4d.hpp" #include "Eigen3/Eigen/Eigenvalues" #include "omp.h" #include "su3.hpp" // staggered space-dependent gamma matrices // for now stored as 5x doubles per site but they are just +/- signs, and g[0] // is just + e...
2,495
989
/**************************************************************************** * * Copyright (c) 2021 Vivante Corporation * * 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 ...
5,108
1,874
// Copyright Oleg Nedbaylo 2020. // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE // or copy at http://www.boost.org/LICENSE_1_0.txt #include "parser.hpp" #include <cstdlib> #include <fmt/format.h> #include <iostream> #include <rapidjson/document.h> namespace ssc2ce { Co...
3,670
1,290
#include "stdafx.h" #include "ControledLightComponent.h" #include <EtCore/Reflection/Registration.h> namespace et { namespace demo { // reflection //------------ RTTR_REGISTRATION { rttr::registration::class_<ControledLightComponent>("controled light component"); BEGIN_REGISTER_POLYMORPHIC_CLASS(ControledLight...
1,006
309
#ifndef xpack_docker_priority_queue #define xpack_docker_priority_queue #pragma push_macro("xuser") #undef xuser #define xuser mixc::docker_priority_queue::inc #include"algo/heap_root.hpp" #include"define/base_type.hpp" #include"docker/shared_array.hpp" #include"docker/transmitter.hpp" #include"dumb/mirror.hpp" #inclu...
2,386
850
#include<iostream> #include<fstream> #include<cctype> #include<cstdlib> using namespace std; char input[16]; //variable to store each line of input /* Array to manipulate the integer to genetic character conversion. For any character its array index is the corresponding value. For example 'G' has value of 2...
2,127
699
/* * 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...
2,328
737
#include <cstdint> // TODO Use SSE // http://www.myreckonings.com/Dead_Reckoning/Online/Materials/Fast_Approximation_of_Elementary_Functions.pdf extern "C" float tanf(float x) { float tan; __asm__("FPTAN;" : "=t"(tan) : "0"(x)); return tan; } extern "C" double sqrt(double x) { __asm__("sqrtsd %1, %0" : "+x"(x) : ...
624
330
#include "card.hpp" #include "duelist.hpp" #include <iostream> using namespace std; int main() { MonsterCard *dragon = new MonsterCard("Blue-Eyes White Dragon", "This legendary dragon is a powerful engine of destruction.", 3000, 2500, 10); MonsterCard *magician = new...
1,930
646
string os_name() { #ifdef _WIN32 return "win32"; #elif _WIN64 return "win64"; #elif __APPLE__ || __MACH__ || macintosh || Macintosh return "macos"; #elif __linux__ return "linux"; #elif __FreeBSD__ return "freebsd"; #elif __unix || __unix__ return "unix"; #elif __ANDR...
2,194
825
// // Created by Vitali Kurlovich on 3/22/16. // #ifndef RMVECTORMATH_PROFILER_HPP #define RMVECTORMATH_PROFILER_HPP #include <vector> #include <stack> #include <chrono> #include "ProfileCase.hpp" #include <profiler/MathStatistic.hpp> namespace profiler { class Profiler { protected: std::vector...
3,714
1,109
/* * Copyright (c) Andre 'Espyo' Silva 2013. * The following source file belongs to the open-source project Pikifen. * Please read the included README and LICENSE files for more information. * Pikmin is copyright (c) Nintendo. * * === FILE DESCRIPTION === * Ship type class and ship type-related functions. */ #...
1,476
493
#include <torch/torch.h> #include <vector> #include <iostream> #include <algorithm> #include <random> #include <cstdint> struct NegativeSampler { NegativeSampler(at::Tensor positives, int n_user, int n_item) : positives_lists(n_user) { std::cout << "C++ PyTorch extension for negative sampling created." << ...
3,012
1,095
#include "formula_evaluator.h" void TFeatureCachedTreeEvaluator::Calc(size_t treeStart, size_t treeEnd, TArrayRef<double> results) const { CB_ENSURE(results.size() == DocCount * Model.ObliviousTrees.ApproxDimension); Fill(results.begin(), results.end(), 0.0); TVector<TCalcerIndexType> indexesVec(BlockSize...
1,214
343
#include "blockchain.h" #include "block.h" namespace simplechain { Blockchain::Blockchain(int difficulty) { difficulty_ = difficulty; last_block_ = genesis_block_; } int Blockchain::difficulty() const { return difficulty_; } Block* Blockchain::last_block() const { return last_block_; } void Blockchain::AddBlo...
989
332
/* ============================================================================ * Copyright (c) 2019 BlueQuartz Software, LLC * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistribut...
5,037
1,244
#ifndef IMXRT_DRIVERS_REG_HPP_ #define IMXRT_DRIVERS_REG_HPP_ #include <imxrt1062/hardware.hpp> namespace imxdrivers { /** * @brief DSB * */ static inline void data_sync() { __DSB(); } /** * @brief Sometimes IRQ are executed so fast, that irq flag isn't cleared until ...
3,102
1,115
#include <stdlib.h> #include "opencv2/opencv.hpp" #include "opencv2/core/core.hpp" #include "opencv2/highgui/highgui.hpp" #include <string.h> #include <fstream> #include <iostream> using namespace std; using namespace cv; #define RESIZED_IMG_DIM 4800 #define RAW_DATA_SET_4800 "dataset4800.txt" #define SHUFFLE_DATA...
3,396
1,484
// This file is auto-generated, don't edit it. Thanks. #ifndef ALIBABACLOUD_PAIPLUGIN20220112_H_ #define ALIBABACLOUD_PAIPLUGIN20220112_H_ #include <alibabacloud/open_api.hpp> #include <boost/throw_exception.hpp> #include <darabonba/core.hpp> #include <darabonba/util.hpp> #include <iostream> #include <map> #include <...
319,755
109,076
// Copyright (c) 2021 Tom Hancocks // // 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, ...
1,924
643
/* * The MIT License (MIT) * * Copyright (c) 2018 Nathan Osman * * 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,...
2,135
660
#include <functional> #include <sstream> void foreachElementsInStringDelimitedBy( const std::string &input, const char delimiter, std::function<void(const std::string &)> callback) { std::stringstream ss(input); std::string token; while (std::getline(ss, token, delimiter)) { callback(token); } } ...
500
154
#include "pch.h" #include <memory> #include "../treenode.h" #include <vector> #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #include <execution> #endif struct DbEntity { int val = 0; }; bool operator==(DbEntity const& l, DbEntity const& r) { return l.val == r.val; } namespac...
31,268
13,832
#include <stdio.h> int lcm(int, int); int main() { int a, b, result; int prime[100]; printf("Enter two numbers: "); scanf("%d%d", &a, &b); result = lcm(a, b); printf("The LCM of %d and %d is %d\n", a, b, result); return 0; } int lcm(int a, int b) { static int comm...
469
193
// Copyright (c) 2018 Johannes Delport // This code is licensed under MIT license (see LICENSE for details) #include "j_plot.hpp" #ifdef USING_MATPLOTLIB namespace plt = matplotlibcpp; #endif /* Determine traces to plot from the control part of the main circuit */ void traces_to_plot(InputFile& iFile, std::vec...
28,425
13,345
#include <windows.h> #include <tchar.h> #include <crass_types.h> #include <acui.h> #include <cui.h> #include <package.h> #include <resource.h> #include <cui_error.h> #include <stdio.h> /* 接口数据结构: 表示cui插件的一般信息 */ struct acui_information MBA_cui_information = { _T("飛翔システム"), /* copyright */ _T(""), /* system */ ...
4,431
2,080
#ifdef CH_LANG_CC /* * _______ __ * / ___/ / ___ __ _ / / ___ * / /__/ _ \/ _ \/ V \/ _ \/ _ \ * \___/_//_/\___/_/_/_/_.__/\___/ * Please refer to Copyright.txt, in Chombo's root directory. */ #endif #include "AMRLevelPlutoFactory.H" #include "NamespaceHeader.H" AMRLevelPlutoFacto...
2,585
861
#include "stacker_system.h" #include "stacker_shared.h" #include "stacker_attribute_buffer.h" #include "stacker_util.h" #include "stacker_platform.h" #include "stacker_document.h" #include "stacker_layer.h" namespace stkr { static void make_font_descriptor(LogicalFont *descriptor, const char *face, unsigned size, u...
11,486
4,560
#include <string> #include "format.h" using std::string; string Format::ElapsedTime(long int seconds) { long int HH{seconds/3600}; long int H_re{seconds%3600}; long int MM{H_re/60}; long int SS{H_re%60}; string HH_str{std::to_string(HH)}; string MM_str{std::to_string(MM)}; string SS_str{...
407
170
#include <algorithm> #include <iostream> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> std::unordered_set<int> PRIMES = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 1...
4,134
2,856
/* Copyright(c) Sophist Solutions Inc. 1990-1992. All rights reserved */ #ifndef __EnableView__ #define __EnableView__ /* * $Header: /fuji/lewis/RCS/EnableView.hh,v 1.1 1992/06/20 17:33:49 lewis Exp $ * * Description: * * * TODO: * * * Notes: * * Changes: * $Log: EnableView.hh,v $ * Revision 1.1 1992/0...
1,510
565
#include "problemes.h" #include "arithmetique.h" #include "matrice.h" #include <bitset> typedef unsigned long long nombre; typedef std::vector<nombre> vecteur; namespace { long double algorithme(size_t sx, size_t sy, const std::bitset<5> &haut, const std::bitset<5> &bas) { static std::map<std::tuple<size...
2,686
946
/* * Copyright 2018 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 applica...
3,345
1,141
#include "Globals.h" #include "Application.h" #include "ModulePhysics.h" #include "math.h" ModulePhysics::ModulePhysics(Application* app, bool start_enabled) : Module(app, start_enabled) { debug = true; } ModulePhysics::~ModulePhysics() { } bool ModulePhysics::Start() { LOG("Creating Physics 2D environment"); can...
7,370
3,084
/* *************************** * * * Author: Swaraj Deep * * * *************************** */ #include <iostream> #include <vector> #include <algorithm> using namespace std; void dfs_search(vector<vector<int>> &tree, vector<bool> &visited, int vertex, int dist, int...
1,186
388
/** * Copyright 2018-2021 Dynatrace LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
5,267
1,636
#ifndef SYMBOLBBOX_H #define SYMBOLBBOX_H #include <cstdint> #include <iostream> #include <ostream> #include <string> #include "../General.hpp" struct SymbolBBox { int32_t x1; int32_t y1; int32_t x2; int32_t y2; }; [[maybe_unused]] static std::string to_string(const SymbolBBox& aObj) { std::...
880
382
/* Copyright (c) 2021 vesoft inc. All rights reserved. * * This source code is licensed under Apache 2.0 License, * attached with Common Clause Condition 1.0, found in the LICENSES directory. */ #include "kvstore/StatisticStore.h" #include <rocksdb/convenience.h> #include "base/Base.h" #include "fs/FileUtils.h" #i...
7,913
2,561
#include "LabelGrayHistogram.h" #include <qdebug.h> #include <QPen> #if _MSC_VER >= 1600 #pragma execution_character_set("utf-8") #endif #define LINEWIDTH 30 LabelGrayHistogram::LabelGrayHistogram(QWidget *parent) : QLabel(parent) { m_max =100; m_mode = -1; for(int i=0; i<2560;i++) { m_grade[...
6,196
3,026
//:>------------------------------------------------------------------ //: FILE: gl3Conductor.cc //: HISTORY: //: 1 feb 2000 version 1.00 //: 6 jul 2000 add St_l3_Coordinate_Transformer //: 27 jul 2000 add print timing //:<--------------------------------------------------------...
21,908
7,414
// // Created by vibhatha on 3/19/20. // #include "../include/library.h" #include "iostream" using namespace std; Library::Library() { } void Library::c_multiply(double *array, double multiplier, int m) { int i, j ; int index = 0 ; for (i = 0; i < m; i++) { array[index] = array[index] *...
530
201
/* Return GOOD_TEST (0) if the test was passed. Return anything other than GOOD_TEST (0) if the test was failed. */ // Common standard library headers #include <cassert> /** * @brief Return this from main if the test was passsed. */ constexpr static inline int GOOD_TEST = 0; // Include the headers you need for t...
2,025
805
// // Class: CSocket // // Description: Class for connecting to / listening for connections from remote peers // and the reading/writing of data using sockets. It supports both plain and TLS/SSL // connections and is implemented using BOOST:ASIO synchronous API calls. At present it // only has basic TLS/SSL support an...
12,069
3,295
// // MaterialBRDF.cpp // Spectral Clara Lux tracer // // Created by Fabrizio Duroni on 23/11/15. // Copyright © 2015 Fabrizio Duroni. All rights reserved. // #include "pch.h" #include "MaterialBRDF.hpp" #include "Illuminant.hpp" Spectrum<constant::spectrumSamples> MaterialBRDF::f(const Vector3D& wi, ...
3,752
1,147
#include "Log.h" #include "bx/platform.h" #include <cstdlib> #include <cstdio> static std::string logFile() { #if BX_PLATFORM_LINUX || BX_PLATFORM_OSX static const std::string LOG_FILE = "/.zumlog"; const char * home = getenv("HOME"); if (home) return std::string(home) + LOG_FILE; else return "~" + ...
2,085
855
#ifndef YAMAIL_RESOURCE_POOL_ASYNC_DETAIL_QUEUE_HPP #define YAMAIL_RESOURCE_POOL_ASYNC_DETAIL_QUEUE_HPP #include <yamail/resource_pool/error.hpp> #include <yamail/resource_pool/time_traits.hpp> #include <boost/asio/executor.hpp> #include <boost/asio/post.hpp> #include <algorithm> #include <list> #include <map> #incl...
7,577
2,599
/// Copyright(c) 2021. Anthony Parks. All rights reserved. #include "portaudiohandler.h" PortAudioHandler::PortAudioHandler() : m_result(Pa_Initialize()) { } PortAudioHandler::~PortAudioHandler() { if (m_result == paNoError) { Pa_Terminate(); } }
268
101
// Fill out your copyright notice in the Description page of Project Settings. #include "Test.h" // Sets default values for this component's properties UTest::UTest() { // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features // off to improve performa...
1,173
440
#pragma once #include "toy/Standard.hpp" #include "toy/gadget/Export.hpp" namespace toy{ namespace gadget{ // 1 -> '1' // 2 -> '2' // 11 -> 'b' // 15 -> 'f' // 16 -> [error] TOY_API_GADGET extern char IntToHexChar(int); // 1 -> '1' // 2 -> '2' // 11 -> 'B' // 15 -> 'F' // 16 -> [error] TOY_API_GADGET extern ch...
354
178
// // Author: Vladimir Migashko <migashko@gmail.com>, (C) 2013-2018 // // Copyright: See COPYING file that comes with this distribution // #pragma once namespace wfc{ namespace core{ struct config_config { bool reload_sighup = false; time_t reload_changed_ms = 0; }; }}
278
106
// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/sync/engine/build_commit_command.h" #include <set> #include <string> #include <vector> #include "chrome/browser/sync/e...
6,427
1,998
// (Class Template) Write a program to explain class template by creating a template T for a class // named pair having two data members of type T which are inputted by a constructor and a // member function get-max() return the greatest of two numbers to main. Note: the value of T // depends upon the data type specifi...
345
75
// ====================================================================== /*! * \file NFmiRect.cpp * \brief Implementation of class NFmiRect */ // ====================================================================== /*! * \class NFmiRect * * Undocumented * */ // ===============================================...
15,767
4,623
/*- * Copyright (c) 2019 TAO Zhijiang<taozhijiang@gmail.com> * * Licensed under the BSD-3-Clause license, see LICENSE for full information. * */ #include <sstream> #include <iostream> #include <scaffold/Setting.h> #include <scaffold/Status.h> namespace roo { bool Setting::init(std::string file) { cfg_fil...
3,542
1,228
#include <HTDAQStackInfo.h> //________________________________________________ HTDAQStackInfo::HTDAQStackInfo(const char * name, int stackID) : fNModules(0), fStackName(name), fStackID(stackID) {} //________________________________________________ HTDAQStackInfo::~HTDAQStackInfo() { Clear(); } //__________________...
1,736
520
// // OpenTissue, A toolbox for physical based simulation and animation. // Copyright (C) 2007 Department of Computer Science, University of Copenhagen // #include <OpenTissue/configuration.h> #include <OpenTissue/core/math/math_euler_angles.h> #define BOOST_AUTO_TEST_MAIN #include <OpenTissue/utility/utility_push_bo...
3,202
1,385
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
902
304
// Future things that could be consolidated into 1 to save code space when required: // // Combined lcd.clear() and lcd.setCursor(0, 0) -> lcd.clearHomeCursor(): savings 184 bytes // lcd.setCursor(0, r) --> lcd.setRow(r): savings 162 bytes // // ValueSetScreen // BuzzerSetRepeatsMode // ABPCopiesSetScreen #include "Co...
136,156
58,831
#include <iostream> using namespace std; int main() { int n, num, digit,r=0; cout<<"Enter the number : "; cin>>num; n = num; while(num != 0) { digit = num%10; r = (r*10) + digit; num = num/10; } if(n == r) cout<<"The given number is a palindrome number"; ...
405
147
#include "Buffer.hpp" #ifdef GFXTK_GRAPHICS_BACKEND_VULKAN #include <gfxtk/backend/vulkan/Buffer.hpp> #elif GFXTK_GRAPHICS_BACKEND_METAL #include <gfxtk/backend/metal/Buffer.hpp> #else #error target OS is not supported by any existing graphics backend! #endif gfxtk::Buffer gfxtk::Buffer::create( std::shared_p...
864
309
#pragma once #include <string> class OBSBasic; struct BasicOutputHandler { OBSOutputAutoRelease fileOutput; OBSOutputAutoRelease streamOutput; OBSOutputAutoRelease replayBuffer; OBSOutputAutoRelease virtualCam; bool streamingActive = false; bool recordingActive = false; bool delayActive = false; bool replayB...
2,091
673
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int tc, inf=1000001; cin >> tc; vector<int> isprime(inf, 1), prefix(inf); for (int i = 2; i*i < inf; i++) { if (isprime[i]) { for (int j = i*i; j < inf; j+= i) { i...
646
271
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; vector<vector<pair<int,int>>> g(n); for (int i = 0; i < n; i++) { int m; cin >> m; for (int _ = 0; _ < m; _++) { int x, y; cin >> x >> y; x--; g[i].emplace_back(x,...
879
345
#include <iostream> // cout // Подключаем свой заголовочный файл - // целью заголовочных файлов является удобное хранение набора объявлений // для их последующего использования в других программах. // поиск заголовочного файла осуществляется в папках проекта (а не в системных директориях) #include "structs.hpp" // ...
6,547
2,295
#include <string> #include <sstream> #include <iostream> using namespace std; int main(){ string mystr; float price; cout << "enter price :" << endl; getline(cin,mystr); //cin.getline(mystr); stringstream (mystr) >> price; cout << "the price is:" << price << endl; return 0; }
308
105
/* ____________________________________________________________________________ S A M 2 0 0 7 An Assembler for the MACC2 Virtual Computer James L. Richards Last Update: August 28, 2007 Last Update: January 2...
32,683
16,559
// // Copyright (c) 1999-2001 Microsoft Corporation. All rights reserved. // // Implementation of CDirectMusicScript. // #include "stdinc.h" #include "dll.h" #include "dmscript.h" #include "oleaut.h" #include "globaldisp.h" #include "activescript.h" #include "sourcetext.h" //////////////////////////////...
40,226
13,406
#include "Coraza.h" Coraza::Coraza() { } Coraza::Coraza(int pdureza, int pcantidad) { dureza = pdureza; cantidad = pcantidad;; } Coraza::Coraza(string pnombre, string pciudad, int pedad, int pdureza, int pcantidad): Soldado(pnombre, pciudad, pedad) { dureza = pdureza; cantidad = pcantidad; } int Coraza::getDur...
617
269
#include "RuleTimer.hpp" /** * */ RuleTimer::RuleTimer(RelayModuleNode* solarRelay, RelayModuleNode* poolRelay) { _solarRelay = solarRelay; _poolRelay = poolRelay; } /** * */ void RuleTimer::loop() { Homie.getLogger() << cIndent << F("§ RuleTimer: loop") << endl; _poolRelay->setSwitch(checkPoolPumpTi...
1,153
446
#include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include <stdio.h> using namespace cv; using namespace std; int main( int argc, char** argv ) { Mat src, dst; char* source_window = "Source image"; char* equalized_window = "Equalized Image"; /// Load image s...
743
273
#include "OrbitingObject.hpp" #include "Math/Matrix4.hpp" #include "Math/Quat.hpp" OrbitingObject::OrbitingObject(const Vector4& orbitAxis, const Vector4& orbitPos) : axis(orbitAxis), orbitLocation(orbitPos) { } void OrbitingObject::Update(float /*tick*/) { // constexpr float angleOffsetDeg = .005f; // Matrix4 tr...
572
223
#include "TransitScene.h" using namespace cocos2d::ui; USING_NS_CC; Scene* Transit::createScene() { // 'scene' is an autorelease object auto scene = Scene::create(); // 'layer' is an autorelease object auto layer = Transit::create(); // add layer as a child to scene scene->addChild(l...
3,343
1,074
//---------------------------------------------------------------------------// //! //! \file MonteCarlo_CellPulseHeightEstimator.hpp //! \author Alex Robinson //! \brief Cell pulse height estimator class declaration //! //---------------------------------------------------------------------------// #ifndef FACEMC_...
5,285
1,478
#include "stdafx.h" #include "RareSnesInstr.h" #include "Format.h" #include "SNESDSP.h" #include "RareSnesFormat.h" // **************** // RareSnesInstrSet // **************** RareSnesInstrSet::RareSnesInstrSet(RawFile* file, uint32_t offset, uint32_t spcDirAddr, const std::wstring & name) : VGMInstrSet(RareSnesForm...
5,206
2,465
/*============================================================================ Copyright (C) 2016 akitsu sanae https://github.com/akitsu-sanae/phylan Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt) ===============================...
6,716
2,273
#include <percy/percy.hpp> #include <cassert> #include <cstdio> #include <vector> using namespace percy; using std::vector; /******************************************************************************* Counts and prints all fences up to and including F_5 and ensures that the number is correct. ***********...
3,953
1,351
#ifndef STRUCTS_HPP #define STRUCTS_HPP #include <type_traits> #include <string> #include "vector3.hpp" #include "enums.hpp" #include "SDL.h" template<typename T> struct Bounds { //check if we initialize the vector with the right values static_assert(std::is_integral<T>::value || std::is_floating_point<T>::va...
2,240
851
#include "llvm/Support/raw_ostream.h" #include "type.h" using namespace v8; // ----- LType NodeProto<LType> LType::proto("Type"); void LType::init() { proto.addMethod("isDoubleType", &LType::isDoubleType); proto.addMethod("isFunctionType", &LType::isFunctionType); proto.addMethod("toString", &LType::toString)...
1,604
542
// Copyright 2020 <github.com/razaqq> #include <QWidget> #include <QVBoxLayout> #include <QMainWindow> #include <QWindow> #include "NativeWindow.hpp" #include "TitleBar.hpp" #include "Config.hpp" #include "FramelessWindowsManager.hpp" using PotatoAlert::NativeWindow; NativeWindow::NativeWindow(QMainWindow* mainWin...
1,564
558
/* http://en.wikipedia.org/wiki/Level_ancestor_problem Given a Binary Tree and a key, write a function that prints all the ancestors of the key in the given binary tree. For example, if the given tree is following Binary Tree and key is 7, then your function should print 4, 2 and 1. 1 / ...
1,558
547
#include <iostream> #include <fstream> #include <cstring> #include <cstdlib> #include <ctime> #include "vhsm_api_prototype/common.h" #include "vhsm_api_prototype/key_mgmt.h" #include "vhsm_api_prototype/mac.h" #include "vhsm_api_prototype/digest.h" #define BUF_SIZE 4096 #define BUF_TIME_SIZE 256 #define HEL...
20,355
7,371
#include <cstdio> int handle(char current, char previous, char twoPrevious, bool addOwnScore) { int baseScore(0); int score = 0; if (current == 'X') { baseScore = 10; } else if (current == '/') { baseScore = 10 - (previous - '0'); } else { ...
1,922
573
#include <iostream> #include <vector> #include <algorithm> using namespace std; int choice[1000000]; int visited[1000000]; int optimal_sequence(int n) { visited[0] = 0; visited[1] = 0; for (int i = 2; i <= n; i++) { int ans = INT32_MAX; int t1 = 1 + visited[i - 1]; if (t1 < ans) { ...
1,071
447
/// @file /// @brief Implement `system_tree_root`, which handles the very root of the System Tree. #include "klib/klib.h" #include "system_tree/system_tree_root.h" uint32_t system_tree_root::number_of_instances = 0; system_tree_root::system_tree_root() { KL_TRC_ENTRY; ASSERT(system_tree_root::number_of_instance...
4,155
1,789
/* * Framebuffer.cpp * * Created on: Oct 12, 2013 * Author: sam */ #include "Framebuffer.h" #include <cassert> using namespace RLLibViz; Framebuffer::Framebuffer() { } Framebuffer::~Framebuffer() { } void Framebuffer::draw(QPainter& painter) { if (points.empty() || points.size() < 1) return; QP...
608
254
/** @file dvb.cpp @brief This file is part of Kalinka mediaserver. @author ipp <ivan.murashko@gmail.com> Copyright (c) 2007-2012 Kalinka Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal ...
10,552
3,511
#include <bits/stdc++.h> #include <windows.h> using namespace std; HANDLE hOUTPUT = GetStdHandle(STD_OUTPUT_HANDLE); void yellow(){SetConsoleTextAttribute(hOUTPUT, FOREGROUND_RED | FOREGROUND_GREEN);} void white(){SetConsoleTextAttribute(hOUTPUT, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);} void red(){SetC...
5,196
2,616
#include <unistd.h> #include <cctype> #include <sstream> #include <string> #include <vector> #include "linux_parser.h" #include "process.h" using std::string; using std::to_string; using std::vector; Process::Process(int p) : pid(p), user(LinuxParser::User(p)), command(LinuxParser::Command(p)), ...
1,311
417
#include "DoubleSpinBox.h" #include <QKeyEvent> using namespace cnoid; DoubleSpinBox::DoubleSpinBox(QWidget* parent) : QDoubleSpinBox(parent) { setKeyboardTracking(false); isSettingValueInternally = false; isUndoRedoKeyInputEnabled_ = false; valueChangedByLastUserInput = false; } void DoubleSpi...
2,464
810
#include "LoginInfo.h" LoginInfo::LoginInfo() { }
51
22
#include "include/balanceHandler.h" #include "include/reactionHandler.h" #include "include/offsets.h" #include "include/Utils.h" inline const float balanceRegenTime = 6;//time it takes for balance to regen, in seconds. void balanceHandler::update() { //DEBUG("update"); /*if (garbageCollectionQueued) { collectGarba...
7,474
2,918
#include "Mesh.h" #include <glbinding/gl/gl.h> void Mesh::draw() { glBindVertexArray(m_VAO); glDrawElements(GL_TRIANGLES, m_IndicesCount * 3, GL_UNSIGNED_INT, nullptr); glBindVertexArray(0); } void Mesh::initialize(const std::vector<Vertex>& vertices, const std::vector<Triangle>& indices) { m_IndicesCount = indi...
1,138
486
#include "CursATE/Curses/Field/detail/resizePadded.hpp" #include <But/assert.hpp> namespace CursATE::Curses::Field::detail { VisibleSize resizePaddedVisibleSize(std::string const& in, size_t maxSize, size_t selectedElement) { if( in.size() <= maxSize ) return {0, selectedElement, in.size()}; if( selectedEleme...
1,130
379
#include "prpch.h" #include "Math.h" namespace Pearly { bool Math::DecomposeTransform(const glm::mat4& transform, glm::vec3& position, float& rotation, glm::vec2& scale) { glm::mat4 localMatrix(transform); // Normalize the matrix. if (glm::epsilonEqual(localMatrix[3][3], static_cast<float>(0), glm::epsilon<fl...
1,483
622
#include "device_rom.h" #include <iostream> #include <fstream> #include <string> #include <cerrno> DeviceROM::DeviceROM(uint16_t address_start, size_t region_length) { address_start_ = address_start; region_length_ = region_length; buffer_contents_ = (uint8_t*) malloc(region_length_ * sizeof(uint8_t)); } DeviceR...
2,149
876
#include <doctest/doctest.h> #include <graphidx/heap/binheap.hpp> #include <graphidx/heap/quadheap.hpp> TEST_CASE_TEMPLATE_DEFINE("heap basic", Heap, test_heap_basics) { constexpr size_t N = 6; Heap h(N); REQUIRE(h.empty()); REQUIRE_EQ(h.size(), 0); for (size_t i = 0; i < N; i++) { REQUIR...
1,197
623
#include <iostream> #include <vector> #include <cmath> using namespace std; int main() { long long int n; while(cin >> n) { if(n==0)break; long long int t=sqrt(n); if(t*t==n) cout<<"yes"<<endl; else cout<<"no"<<endl; } retur...
328
119
#pragma once #include <Logger.hpp> #include <functional> #include <optional> #include <msgpack11/msgpack11.hpp> #include <tacopie/network/tcp_socket.hpp> #include "base58/base58.hpp" namespace tacopie { int init(); void close(); } namespace ic::p2p { namespace mp = msgpack11; std::string msgpack_ty...
2,268
749
/* * Copyright (c) 2018 Samsung Electronics Co., Ltd. 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...
1,420
477