text
string
size
int64
token_count
int64
#include <iostream> #include "DataFormats/Math/interface/SSEVec.h" int main() { #ifdef CMS_USE_SSE { mathSSE::Vec4<float> yAxis(-0.0144846, 0.932024, -0.362108); mathSSE::Vec4<float> zAxis(-0.204951, 0.351689, 0.913406); auto xAxis = ::cross(yAxis, zAxis); const mathSSE::Vec4<float> correctXAxis(0....
1,374
701
class Solution { public: int missingNumber(vector<int>& arr) { int diff=abs(arr[arr.size()-1]-arr[0])/arr.size(); if(arr[0]>arr[1]){ diff=0-diff; } for(int i=0;i<arr.size();i++){ if(arr[i]!=arr[0]+diff*i){ return arr[0]+diff*i; } } return 0; ...
324
133
#ifndef IMPL_HUD_NODE_H #define IMPL_HUD_NODE_H #include <osgEarth/Controls> #include <Inner/ImplSceneNode.hpp> /** * 实现IHudNode所有的接口 */ template <typename T> class ImplHudNode:public ImplSceneNode<T> { public: CONSTRUCTOR(ImplHudNode,ImplSceneNode<T>) protected: void SetControlNode(osgEarth::Controls::Con...
3,138
1,109
/* * Copyright (C) 2015 Southern Storm Software, Pty Ltd. * * 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, ...
1,948
806
#include "src/array_models/interface/i_array_state_subscription.h" #include <gtest/gtest.h> namespace pos { TEST(IArrayStateSubscription, Register_) { } TEST(IArrayStateSubscription, Unregister_) { } } // namespace pos
223
81
/* Дан целочисленный массив из 30 элементов. Элементы массива могут принимать целые значения от 0 до 10000 включительно. Опишите на естественном языке или на // одном из языков программирования алгоритм, позволяющий найти и вывести произведение двузначных элементов массива, с суммой цифр не кратной 6. Гарантируется,...
955
388
/*========================================================================= medInria Copyright (c) INRIA 2013. All rights reserved. See LICENSE.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ====...
6,687
2,469
#include "Timing/TimingAnalyzer/plugins/CommonUtils.hh" #include "DataFormats/EcalDetId/interface/EcalSubdetector.h" namespace oot { /////////////////////////// // Object Prep Functions // /////////////////////////// void ReadInTriggerNames(const std::string & inputPaths, std::vector<std::string> & pathNames,...
29,999
11,403
#ifndef PLACEHOLDER_HPP #define PLACEHOLDER_HPP #include <mgcpp/expressions/forward.hpp> namespace mgcpp { struct placeholder_node_type; template <size_t PlaceholderID, typename ResultType> using placeholder_node = generic_expr<placeholder_node_type, PlaceholderID, ...
527
146
#pragma once /// You may optionally configure this in rsked.json like: /// { ... /// "Inet_checker" : { /// "enabled" : true, /// "status_path" : "/run/user/1000/netstat", /// "refresh" : 60 /// }, ... /// /// Without configuration, it will be enabled with reasonable defaults. /// /* Par...
1,622
526
//================================================================================================== /*! @file @copyright 2016 NumScale SAS Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ //===========================...
604
203
#include <iostream> using namespace std; template <class Something> void testMe(Something& val) { cout << "This is an lval!\n"; } template <class Something> void testMe(const Something&& val) { cout << "This is an rval!\n"; } int& dummyRef(int& thing) { return thing; } int dummy(int& thing) { return thing; } s...
1,026
388
// Copyright (c) 2019 Álvaro Ceballos // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt #ifndef CYNODELIC_METAFLAGS_DETAIL_STRING_PARSING_HELPER_HPP #define CYNODELIC_METAFLAGS_DETAIL_STRING_PARSING_HELPER_HPP #include <cstd...
5,687
2,341
#include "Jcoord.h" coord::coord() { x=0; y=0; z=0; } coord::coord(int a, int b, int c) { x=a; y=b; z=c; } int& coord::A() { if (a==X) return x; if (a==Y) return y; if (a==Z) return z; }
197
119
#include "Settings.h" namespace ph { Settings::Settings() { } void Settings::Load() { } void Settings::Save() { } }
126
51
#include "LiftStringPot.h" #include <RobotMap.h> #include <Config.h> LiftStringPot::LiftStringPot(int pin) : Subsystem("LiftStringPot"), LiftStringPotPin(pin) { //LiftStringPotPin = new AnalogInput(pin); } void LiftStringPot::InitDefaultCommand() {} double LiftStringPot::GetHeight() { #ifdef PRACTICE_BOT double he...
1,230
475
// *************************************************************************** // // Generated automatically by genwrapper. // Please DO NOT EDIT this file! // // *************************************************************************** #include <osgIntrospection/ReflectionMacros> #include <osgIntrospection/Type...
1,576
499
// generate by pypp <https://github.com/mugwort-rc/pypp> // original source code: SPK_GLLineTrailRenderer.h #include <RenderingAPIs/OpenGL/SPK_GLLineTrailRenderer.h> #include <Core/SPK_Group.h> #include <boost/python.hpp> class GLLineTrailRendererWrapper : public SPK::GL::GLLineTrailRenderer, pub...
5,425
1,802
/****************************************************************** HueLight plugin Features: - Control Philips Hue light. http://www.github.com/rlisle/Patriot Example code used from https://www.digikey.com/en/maker/blogs/2019/how-to-post-data-using-the-particle-photon Written by Ron Lisle BSD license, check l...
2,675
894
class Solution { public: int majorityElement(vector<int> &nums) { sort(nums.begin(), nums.end()); int ele = nums[0], count = 0; for (auto i : nums) { if (i == ele) { count++; if (count > (nums.size() / 2)) ...
482
145
/* * cmdline.cpp * Command Line */ #include <algorithm> #include <Util/CommandLine.hpp> #ifdef WINDOWS #include <Windows.h> #include <io.h> #include <fcntl.h> #endif namespace Util { CommandLine::CommandLine(int argc, char* argv[]) : flags() { for(int i = 1; i < argc; ++i) { // Parse arguments starting...
2,371
1,046
class Solution { public: vector<int> pourWater(vector<int>& heights, int count, int pos) { int n = (int)heights.size(); for (int k = 0; k < count; k++) { // drop to x int minIndex = pos, minHeight = heights[pos]; int i = pos; while (i - 1 >= 0 && heights[i] >= heights[i -...
916
310
/* BSD 3-Clause License Copyright (c) 2022, Stable Cloud Computing, Inc. 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 copyright notice, this list of conditions ...
12,678
5,999
/*------------------------------------------------------------------------- * drawElements Quality Program Tester Core * ---------------------------------------- * * Copyright 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file exce...
2,784
1,022
#include "stdafx.h" #include "ConflictSolver.h" #include "json_utils.h" namespace ravendb::client::serverwide { void to_json(nlohmann::json& j, const ConflictSolver& cs) { using ravendb::client::impl::utils::json_utils::set_val_to_json; set_val_to_json(j, "ResolveByCollection", cs.resolve_by_collection); set_...
657
271
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll MX = pow(10, 9) + 1; ll res = -1; void dfs(int pointer, int n, int k, int comb, vector<ll> &x, vector<ll> &y, vector<int> &a) { if((int)a.size() == comb) { ll ax, bx, ay, by; ax = ay = -1 * MX; bx = by = MX; ...
1,415
595
#include <iostream> #include <vector> #include <map> #include <string> #include <stack> using namespace std; // Given a non-empty binary tree, find the maximum path sum. // For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connections....
1,523
535
#include <cstdlib> #include <cstdio> #include <fstream> #include <iostream> #include <assert.h> using namespace std; #include <math.h> #include <TStyle.h> #include "TImage.h" #include "TAttImage.h" #include "MECanvasHolder.hh" ClassImp(MECanvasHolder); MECanvasHolder::MECanvasHolder() : fCanvas(0), fWelcomePav...
11,900
5,130
// SPDX-License-Identifier: MIT // This file is part of `openmm-dlext`, see LICENSE.md #include "cxx11utils.h" #include "DLExtKernelFactory.h" #include "DLExtKernels.h" #include "openmm/OpenMMException.h" #include "openmm/cpu/CpuPlatform.h" #include "openmm/reference/ReferencePlatform.h" #ifdef OPENMM_BUILD_CUDA_LIB...
1,460
513
/************************************************************************************** Floyd-Warshall algorithm finding shortest distance between all pairs of vertices in graph. Works in O(N^3) Based on problem 95 from informatics.mccme.ru http://informatics.mccme.ru/mod/statements/view.php?id=...
1,516
575
#include "RISCVSTypeInstruction.h" class CRISCVSBInstruction : public CRISCVSTypeInstruction{ public: CRISCVSBInstruction(uint32_t addr, uint32_t raw, std::shared_ptr< CHardwareRegister< uint32_t > > pc, std::vector< std::shared_ptr< CHardwareRegister< uint32_t > > > &regs, std::shared_ptr< CMemoryDevice >...
3,560
1,264
/**************************************************************************** * Copyright (c) 2012-2020 by the ArborX authors * * All rights reserved. * * * * This ...
2,689
880
#include <exodus/program.h> //for the sake of multivalue gurus new to exodus programming this is written //with multivalue-mimicking "everything is a global function" syntax //instead of exodus's OO-style syntax "xxx.yyy().zzz()" var filename="myclients"; programinit() function main() { if (not connect()) ...
5,890
1,908
#include <enum_set/type_set.hpp> #include <iostream> #include <string> #include <vector> // Define an option as a "strong enum". struct option { class A; class B; class C; }; // Define a set of options as a `type_set`. using option_set = enum_set::type_set< option::A, option::B, ...
1,565
504
/* Deep_Learning_Handler_plugin.cpp * This is a test plugin, you can use it as a demo. * 2017-11-29 : by YourName */ #include "v3d_message.h" #include <vector> #include "Deep_Learning_Handler_plugin.h" #include <iostream> #include <qfileinfo.h> #include <qdir.h> #include <v3d_interface.h> #include <string> #include...
8,366
2,843
#include "txtfile.h" // std includes #include <fstream> // mirage includes #include "macros.h" #include "strutil.h" namespace mirage { TxtFile::TxtFile(const std::string & filePath) : m_filePath(filePath), m_lines() { // Read the file into memory std::ifstream file(m_filePath); if (file.is_open() == fa...
800
347
/*########################################################################################## Crafterra Library 🌏 [Planning and Production] 2017-2022 Kasugaccho 2018-2022 As Project [Contact Us] wanotaitei@gmail.com https://github.com/AsPJT/Crafterra [License] Distributed under the CC0 1.0. https://creat...
32,935
14,957
#include <cstring> #include <iostream> char s[12]; char vocale[] = "aeiou"; int n, st[12], p[12]; void afis() { for (int i = 1; i <= n; ++i) { std::cout << s[st[i]]; } std::cout << '\n'; } bool valid(int k) { if (strchr("aeiou", s[st[k]]) && st[k] != k - 1) return false; return true; } void bkt(int k...
993
471
#include "NetAdr.hpp" CNetAdr::CNetAdr() = default; CNetAdr::~CNetAdr() = default; bool CNetAdr::IsLocal() const { return false; // TODO }; INetAdr::Type CNetAdr::GetType() const { return INetAdr::Type::Temp; };
216
96
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
3,568
1,343
#include "joint_trajectory_data.h" #include <cmath> #include <functional> #include <exception> using namespace std; namespace sweetie_bot { namespace hmi { unsigned int JointTrajectoryData::crc(const std::vector<double>& positions) { size_t crc = 0; std::hash<double> hash_fn; for(auto it = positions.begin(); ...
13,126
4,651
#include "GameTickManager.h" #include "Engine/World.h" #include "Engine/Engine.h" #include "ActiveState.h" #include "BuildingState.h" #include <iostream> #include "Utility.h" #include "Runtime/Engine/Classes/Kismet/GameplayStatics.h" // Sets default values AGameTickManager::AGameTickManager() { // Set this actor t...
4,459
1,728
// Copyright 2020 The TensorFlow Runtime 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 ...
1,846
523
#include <cassert> #include <string> #include <vector> #include "eddis.h" size_t eddis :: min(size_t x, size_t y, size_t z) { if (x < y) return x < z ? x : z; else return y < z ? y : z; } size_t eddis::editDist(const string& A, const string& B) { size_t NA = A.size(); ...
882
391
// // Created by Josh Levy-Kramer on 02/04/2020. // #include <iostream> #include <typeinfo> // ---- remove_reference // Overload for a normal type, type reference and rvalue type reference template <typename T> struct remove_reference { using type = T; }; template <typename T> struct remove_reference<T&> { u...
2,704
965
#include <iostream> #include "ClientS3ORAM.hpp" #include "iostream" #include "Utils.hpp" using namespace std; int main(int argc, char **argv) { int choice; cout << "SERVER READY? (Press ENTER to Continue)"; cin.ignore(); cin.ignore(); cin.clear(); cout << endl; ClientS3ORAM* client = new Clien...
3,113
886
#ifndef TASTR_AST_EXPRESSION_TYPE_NODE_HPP #define TASTR_AST_EXPRESSION_TYPE_NODE_HPP #include "ast/KeywordNode.hpp" #include "ast/TypeNode.hpp" namespace tastr { namespace ast { class ExpressionTypeNode final: public TypeNode { public: explicit ExpressionTypeNode(KeywordNodeUPtr keyword) : TypeNode(),...
1,931
577
#include "tests.h" using namespace cust_lib; using namespace std::chrono; bool test_cases::test_vertices(Graph* search_obj) { /* Number of Vertices in dataset/1987.csv. Calculated in excel. */ int num_vertices = 238; vector<Vertex> vertices = search_obj->getVertices(); return vertices.size() == num_ver...
3,197
1,263
// Copyright (c) FIRST and other WPILib contributors. // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. #include "Robot.h" #include <iostream> #include <math.h> using namespace std; void Robot::RobotInit() { PlaceShuffl...
24,270
9,089
#include "getExpr.hpp" #include "../../loader/interpreter/tverification.hpp" #include "../../loader/interpreter/verification.inl" #include "../../loader/interpreter/verifier.hpp" #include "../../frame/thread.hpp" #include "../node.inl" namespace wrd { WRD_DEF_ME(getExpr) const node& me::getFrom() const { ...
1,965
666
#include "MyVolumesWidget.h" #include <QtGui> MyVolumesWidget::MyVolumesWidget(MyVolumesModel *model, QWidget *parent) : QWidget(parent) { m_volumesModel = model; int first = 1; // index of the first "real" volume (0 is a dummy) QBoxLayout *layout = new QHBoxLayout(this); // construct the left si...
4,060
1,223
#ifndef PIMPL_PTR_HH_ #define PIMPL_PTR_HH_ #endif /* PIMPL_PTR_HH_ */
73
46
// 알약 #include <iostream> #include <vector> using namespace std; int main(void) { int t, i, j; cin >> t; vector<vector<long long>> a(31,vector<long long> (31)); for(i = 1; i <= 30; i++) a[0][i] = 1; for(i = 1; i <= 30; i++) { for(j = 0; j <= 30 - i; j++) { if(j == 0) a[i][j] = a[i-1][1]; else a[i][j]...
425
256
#pragma once #include <cstdint> #include "SorterFile.hpp" #include "unknown_sqlite_int64.hpp" namespace NWNXLib { namespace API { // Forward class declarations (defined in the source file) struct MergeEngine; struct SortSubtask; struct IncrMerger { SortSubtask* pTask; MergeEngine* pMerger; sqlite_int6...
427
169
extern "C" const char* hello() { return "Hello from the JNI!"; }
68
24
// Problem Link : https://leetcode.com/problems/delete-node-in-a-linked-list/ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: void deleteNode(ListNode* node) { //copy the no...
879
330
#include "../../../../RS-MET/Misc/APE Scripts/rapt_for_ape.cpp" // relative path from "Audio Programming Environment/includes" #include <effect.h> // or maybe we should use generator.h? //================================================================================================= // The core DSP object templat...
4,108
1,340
#include <bvh/bvh.hpp> #include <bvh/leaf_collapser.hpp> #include <bvh/locally_ordered_clustering_builder.hpp> #include <bvh/parallel_reinsertion_optimizer.hpp> #include <btrc/core/volume/bvh.h> #include <btrc/utils/enumerate.h> BTRC_BEGIN namespace { constexpr int TRAVERSAL_STACK_SIZE = 16; bvh::Vector3<f...
9,277
3,507
/* * Copyright 2017 Hiroaki Mizuguchi * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
7,089
3,913
/************************************************************************** * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors ...
6,879
2,482
/** Copyright 2015 Emil Maskovsky 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 agree...
9,864
3,110
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* libncurses.cpp :+: :+: :+: ...
992
275
#include <cstdio> #include <gltfpp.h> int main(int argc, char **argv) { gltfpp::glTF g; nlohmann::json j(argv[1]); from_json(j, g); printf("%s", g.asset.copyright->c_str()); }
181
87
#include <gtest/gtest.h> #include <iostream> #include <assert.h> #include <algorithm> #include <random> #include "spaND.h" #include "mmio.hpp" #include "cxxopts.hpp" #include <Eigen/SparseCholesky> using namespace std; using namespace Eigen; using namespace spaND; bool VERB = false; int N_THREADS = 4; int RUN_MANY ...
41,955
15,109
//////////////////////////////////////////////////////////////// // ComToys(TM) Copyright 1999 Paul DiLascia // If this code works, it was written by Paul DiLascia. // If not, I don't know who wrote it. // #include "StdAfx.h" #include "COMtoys/ComToys.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE ...
2,531
943
#include "../header/generator.h" queue<char>* Generator::constructPass(queue<char>* generated, unsigned length) { int choice; for (unsigned i = 0; i < length; i++) { usleep(5); choice = rand() % 6; if (choice < 2) { generated->push(computeCapitol()); } ...
1,235
395
/* * tbx RISC OS toolbox library * * Copyright (C) 2010-2012 Alan Buckley All Rights Reserved. * * 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 withou...
2,101
798
/** * GeoDa TM, Copyright (C) 2011-2015 by Luc Anselin - all rights reserved * * This file is part of GeoDa. * * GeoDa 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, o...
2,927
1,175
/* * @Author: Zeyuan Shang * @Date: 2015-12-28 01:30:58 * @Last Modified by: Zeyuan Shang * @Last Modified time: 2015-12-28 01:31:04 */ #include <iostream> #include <vector> using namespace std; vector<vector<int>> build_graph(int N, int M) { vector<vector<int>> graph(N, vector<int>(N, -1)); int x, y, r...
1,285
537
/* * Tencent is pleased to support the open source community by making Pebble available. * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the Lic...
2,252
780
/* Sum all even numbers of fibonacci until 4000000 */ #include <iostream> using namespace std; int main(){ int a = 0; int b = 1; int c; int sum = 0; do{ c = a + b; a = b; b = c; if(b % 2 == 0) //check if number is even sum += b; }while(b <= 4000000); cout << sum; //return sum of all even number...
333
164
#include "mesh_transformer.h" Mesh_Transformer::Mesh_Transformer(Mesh& mesh, Segmentation_Provider& sp): m_mesh(mesh), m_sp(sp) { } Mesh_Transformer::~Mesh_Transformer() = default; void Mesh_Transformer::splitMeshAtObject(int objectId) { std::vector<unsigned int> newIndices; ...
2,235
778
#ifndef COMMON #define COMMON #include <iostream> #include <string> class Foo { private: uint64_t key_; public: void setKey(uint64_t key); uint64_t getKey(); std::string toString() const { return "< Foo, key: " + std::to_string(key_) + " > "; }; }; #endif
274
113
// -- BEGIN LICENSE BLOCK ---------------------------------------------- // Copyright 2020 FZI Forschungszentrum Informatik // Created on behalf of Universal Robots A/S // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may ob...
9,422
2,831
#include "mgos.h" #include "mgos_mqtt.h" #include "mgos_wifi.h" static void timer_cb(void *arg) { static bool s_tick_tock = false; LOG(LL_INFO, ("%s uptime: %.2lf, RAM: %lu, %lu free", (s_tick_tock ? "Tick" : "Tock"), mgos_uptime(), (unsigned long) mgos_get_heap_size(), (unsigned long) mgos_get...
3,285
1,410
// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2016 Francisca Gil Ureta <gilureta@cs.nyu.edu> // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http...
5,066
1,775
class Solution { public: int insertBits(int N, int M, int i, int j) { bitset<32> b_N( N ); bitset<32> b_M( M ); for ( int x = i, y = 0 ; x <= j; x++, y++ ){ b_N[x] = b_M[y]; } return b_N.to_ulong(); } };
290
119
#include <bits/stdc++.h> using namespace std; long long n; int main(){ //set up inputs and dp arrays cin>>n; long long items[n+1]; for(int i = 1;i<=n;i++){ cin>>items[i]; } long long dp[n+1] = {}; dp[1] = items[1]; for(int q = 2;q<=n;q++){ dp[q] = max(...
411
195
/** * @author Dominic Steinhauser */ #ifndef _THESEUS_GAME_HIGHSCORE_H #define _THESEUS_GAME_HIGHSCORE_H #include "../engine/scene.hpp" #include "../gameobjects/textfield.hpp" #include <memory> #include <vector> #include <string> namespace theseus { namespace scenes { class Highscore : public engine::Scene ...
1,049
338
#pragma once #include <memory> #include "Window.hpp" #include "Editor/Editor.hpp" #include "Events/Event.hpp" namespace oryon { class Application { public: Application(int argc, char** argv); Window& getWindow() { return * _window; } void run(); void onEvent(Event& e); private: std::unique_ptr<...
400
160
#include<iostream> #include<conio.h> using namespace std; void print_right_triangle(int, char = '*'); void main() { int a; char c,q; cout << "Enter a size " << endl; cin >> a; cout << "you want to enter char ans in (Y/N) " << endl; cin >> c; if (c == 'y'||c=='Y') { cout << "Enter a char '@,#,$...
614
283
#include <stdio.h> #include <stdint.h> #include <assert.h> #include <iostream> #include <iomanip> #define SDL_MAIN_HANDLED #include <SDL2/SDL.h> #include <glad/glad.h> #include <SDL2/SDL_opengl.h> //#include <GL/gl.h> typedef int32_t i32; typedef uint32_t u32; typedef int32_t b32; #define WinWidth 1280 #define WinH...
3,168
1,194
/*============================================================================= NifTK: A software platform for medical image computing. Copyright (c) University College London (UCL). All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY o...
6,616
2,742
#define OLC_PGE_APPLICATION #include "Engine.h"
48
21
// Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "string_utils.h" #include <cerrno> #include <cstddef> #include "base/logging.h" #include "gtest/gtest.h" namespace base { TEST(StringUtilsTest...
1,499
642
#pragma once #include "Types.hpp" struct axis { real_t winsize, gridsize, shift, thickness; real_t lborder, rborder; private: void reborder(); public: axis(real_t winsize, real_t thickness, real_t shift = 0.); real_t bold() const; void set_grid(real_t diff); void set_shift(real_t diff); void set_s...
384
166
/* Copyright (c) 1999 - 2010, Vodafone Group Services Ltd 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 condit...
5,273
1,721
#include "FModSoundInstance.h" #include "FModLoader.h" using namespace Sexy; FModSoundInstance::FModSoundInstance() { mStream = NULL; mChannelNum = 0; } FModSoundInstance::~FModSoundInstance() { Release(); } void FModSoundInstance::Release() { } void FModSoundInstance::SetVolume(double theVolume) { } void FM...
682
258
// 2014-2019, ETH Zurich, Integrated Systems Laboratory // Authors: Christian Stieger #include "testTools.h" #include "test_cpxItr_all.h" #include "test_cpxItr_all.cc" using namespace lm__; // tests template<> void test_cpxItr_all<0>::test_all_dereference() { // c_reItr { // lambda to generate const random ran...
1,300
648
#include "addglopeningbalance.h" #include "ui_addglopeningbalance.h" AddGLOpeningBalance::AddGLOpeningBalance(QWidget *parent) : QWidget(parent), ui(new Ui::AddGLOpeningBalance) { ui->setupUi(this); loadform(); } AddGLOpeningBalance::~AddGLOpeningBalance() { delete ui; } void AddGLOpeningBalance...
8,699
2,908
/* * Copyright 2006, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: * Stephan Aßmus <superstippi@gmx.de> */ #include "ReversePathCommand.h" #include <stdio.h> #include <Catalog.h> #include <Locale.h> #include "VectorPath.h" #undef B_TRANSLATION_CONTEXT #define B_...
789
306
//--------------------------------------------------------------------------- // PROJECT : TEST-DOG // FILENAME : html_reporter.hpp // DESCRIPTION : Concrete HTML reporting class. // COPYRIGHT : Andy Thomas (C) //--------------------------------------------------------------------------- //--------...
27,800
9,972
#include "Oscillator.h" double Oscillator::mSampleRate = 44100.0; // Default, could be set to 48000.0 for better quality void Oscillator::setMode(OscillatorMode mode) { mOscillatorMode = mode; } void Oscillator::setFrequency(double frequency) { mFrequency = frequency; updateIncrement(); } void Oscillator::setSa...
2,549
1,218
#ifndef NEPOMUK_GTFS_READ_CSV_HPP_ #define NEPOMUK_GTFS_READ_CSV_HPP_ #include <boost/filesystem/path.hpp> #include <boost/optional.hpp> #include <string> #include "gtfs/dataset.hpp" namespace nepomuk { namespace gtfs { struct CSVDiscSource { boost::filesystem::path agency; boost::filesystem::path calendar;...
1,099
371
#define ALLEGRO_INCLUDE_MATH_H #include "allegro.h" #include "math2d.h" #include "math.h" #ifndef M_PI #define M_PI 3.14159265358979323846 #endif void correct_angle(float *ang) { if(*ang >= 360.0) while(*ang >= 360.0) *ang -= 360.0; else if(*ang < 0.0) while(*ang < 0.0) *ang += 360.0; } ...
1,362
671
// Copyright (C) 2021 Arthur LAURENT <arthur.laurent4@gmail.com> // This file is subject to the license terms in the LICENSE file // found in the top-level of this distribution #pragma once #include "Image.hpp" namespace storm::image { ///////////////////////////////////// ///////////////////////////////////...
14,725
4,329
//===========================================================================// // Purpose : Supporting methods for the TO_Output_c post-processor class. // These methods support formatting and sending a metrics email. // // Private methods include: // - SendMetricsEmail_ // - Bu...
7,150
1,952
// http://geeksquiz.com/search-an-element-in-a-linked-list-iterative-and-recursive #include "linkedList.h" bool search(node *head, int x){ if(head == NULL) return 0; if(head->data == x) return true; return search(head->next, x); } int main(){ node* head = NULL; int x = 21; /* Use push() to...
545
231
#include "Decoder.h" #include "json.hpp" #include "Common.h" using json = nlohmann::json; Decoder::Decoder() {} std::string Decoder::decode(std::string encodedIrJsonStr) { json encodedIrJson; REMOTE_COMMON remoteCommon; std::string encodedIrData; //memset(&remoteCommon, 0, sizeof(remoteCommon)); ...
5,970
1,968
#include "SequenceMode.h" std::shared_ptr<std::vector<size_t>> SequenceMode::get_order(size_t size) { auto order = std::make_shared<std::vector<size_t>>(); for (size_t i = 0; i < size; i++) { order->push_back(i); } return order; } SequenceMode::SequenceMode() {}
278
109