blob_id
stringlengths
40
40
content_id
stringlengths
40
40
repo_name
stringlengths
5
114
path
stringlengths
5
318
language
stringclasses
5 values
extension
stringclasses
12 values
length_bytes
int64
200
200k
license_type
stringclasses
2 values
content
stringlengths
143
200k
e023ab910d678f7d8ffd0fe23870e2474aab32f0
d609448bcdc0c1cbb2fa4bbedc4af782925d55af
Atom-Heart/Leetcode
/Tree/C++/199-Binary-Tree-Right-Side-View.cpp
C++
cpp
1,005
no_license
/** * 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...
55b964c2ba76efe8bac584fa8a5280b985225671
02d4a67632039e942ba8d1331a8f820495ab9328
riveridea/algorithm
/leetcode/stack/385.mini-parser.cpp
C++
cpp
3,437
no_license
/* * @lc app=leetcode id=385 lang=cpp * * [385] Mini Parser * * https://leetcode.com/problems/mini-parser/description/ * * algorithms * Medium (31.32%) * Total Accepted: 26.9K * Total Submissions: 85.8K * Testcase Example: '"324"' * * Given a nested list of integers represented as a string, implement a...
e78bd8bd31186b3a1cdc0d963c328f452ff5ef43
492ae628fdc06092f883bf2ff74313e111068ee8
HighOptik/MyBrawler
/MyBrawler/Intermediate/Build/Win64/UE4Editor/Inc/MyRPG/MyRPGGameModeBase.gen.cpp
C++
cpp
2,744
no_license
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved. /*=========================================================================== Generated code exported from UnrealHeaderTool. DO NOT modify this manually! Edit the corresponding .h files instead! ==============================================================...
d0c7df9c2b8d6e676fc40ca2c4a98df93b9e3dc3
f5ff5961454b178b2583c80e7bad4f70f43ad5da
pratiksaha/practice
/mathematical/clockangle.cpp
C++
cpp
604
no_license
//Program to find angle between hour and minute hands #include<iostream> #include<cmath> using namespace std; int min(int x, int y) { return (x < y)? x: y; } int calcAngle(int h, int m) { if (h <0 || m < 0 || h >12 || m > 60){ cout<<"wrong input"<<endl; return -1; } h %= 12...
9d3112e2b1432a9c52d5c03d8968b3dd7113e005
db39ad58cdb09aab69911581246bf289a49ce9af
winksaville/fuchsia
/garnet/bin/developer/tiles/main.cc
C++
cc
2,582
permissive
// 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 <fuchsia/ui/policy/cpp/fidl.h> #include <fuchsia/ui/scenic/cpp/fidl.h> #include <lib/async-loop/cpp/loop.h> #include <lib/async-loop/default.h> #i...
d085574093bdb8ed4e93cc65398360b970f9b7fc
6bb6fe24efedb17247c43f2e41ab1bcf132a1367
amacias10/CSC-17A
/Lab/IntroLab/helloWorld/main.cpp
C++
cpp
428
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: main.cpp * Author: nick * * Created on February 14, 2019, 11:59 AM */ #include <iostream> #include <cstdlib> usin...
c639bce78dc5651b7363c8664c2fdef46410ddcb
896cfaf6309287107ef1576d8e0d14dc7b957cb2
deleisha/neopegasus
/src/Providers/ManagedSystem/NTPService/NTPService_Stub.cpp
C++
cpp
6,445
permissive
//%LICENSE//////////////////////////////////////////////////////////////// // // Licensed to The Open Group (TOG) under one or more contributor license // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with // this work for additional information regarding copyright ownership. // Each contributor lice...
34bc9647f0ab8f33906a002c72b2e78ce9a8416c
c024303fb5139799bce5703c170a8917cdf683e1
HamzaFarooqArif/CC-Course
/csvManager/ConsoleApplication1/ConsoleApplication1.cpp
C++
cpp
3,651
no_license
#include <iostream> #include <string> #include <vector> #include <fstream> #include <sstream> using namespace std; class csvManager { public: int maxRows; int maxCols; vector<vector<string>> fileContent; csvManager() { maxRows = 0; maxCols = 0; } bool read(string filePath...
4231de18b165fa403b71965a91c80c8f3cd0cd0d
2c36d199f077554663baca49193a0fac14989625
WeenyJY/year17
/stage1/Cplusplus/Reference/Containers/unordered_multiset/unordered_multisetBucketCheck.cpp
C++
cpp
827
no_license
// file : unordered_multisetBucketCheck.cpp // size_type bucket(const key_type& k) const; // Locate element's bucket // Returns the bucket number where the element with value k is loated. #include <iostream> #include <string> #include <unordered_set> using namespace std; int main() { unordered_multiset<strin...
cc3f2bfbf1952c1aa65a3b744c86bf2cc485acc9
d6db6df9112fc0cbc9965ffe6e80198bbebf1538
ArthurTorrente/ArmyV2
/ArmyV2/include/Factory/ExtractorFactory.hpp
C++
hpp
780
no_license
#ifndef _EXTRACTORFACTORY_H_ #define _EXTRACTORFACTORY_H_ #include <sstream> #include "Extractor/IExtractor.hpp" namespace Factory { namespace ex { /** * Make a float extractor with stringstream */ FloatExtractorUPtr getFloatExtractor(std::stringstream& code); /** ...
13bee3142e65e1ba23b198050e04117a5d308331
94df0935315a4c0d07a372492f0d51bbcd7d008d
darefish/RegressionForest
/RegressionForest/MultiResponseNode.cpp
C++
cpp
2,035
no_license
#include "MultiResponseNode.h" #include "RegressionForestCommon.h" #include "common/HiveCommonMicro.h" #include "common/ProductFactory.h" using namespace hiveRegressionForest; hiveOO::CProductFactory<CMultiResponseNode> theCreator(KEY_WORDS::MULTI_RESPONSES_NODE); CMultiResponseNode::CMultiResponseNode() { } CMulti...
f51854e40dbe20fcebcabc62f2b8fccfeb414a11
bdea6ff9415e97324208afbdeaabcce66f305158
rhzx3519/leetcode
/c++/77. Combinations.cpp
C++
cpp
560
no_license
class Solution { public: vector<vector<int>> combine(int n, int k) { vector<vector<int>> res; vector<int> nums; dfs(0, n, k, nums, res); return res; } void dfs(int idx, int n, int k, vector<int>& nums, vector<vector<int>>& res) { if (idx == n) { ...
db47665c88c9896594fb5285a7ad7d6be2e10996
c1ef7c83ff96f8422b856e30ba6ae58745af1308
AnastasiyaLitvinova/Cpp-homework-1-sem
/27.11.2018/String5.cpp
C++
cpp
3,173
no_license
#include <iostream> using namespace std; const int M = 256; void getWords(char*); void stringDelete(char*, char*); void replaceString(char*, char*, char*, char*); void displayArray(char*); int SubstringPlase(char*, char*, int); int main() { char string[M] = "Hello, world !"; char substring[M] = ...
5a2b9eafd025d15af2c017b67433a0428c346976
fb2415310d0604577222287841944bab37209f3e
NewShon/WinAPI
/lab_4/class_work/first_application.cpp
C++
cpp
4,230
no_license
#include <windows.h> #include <tchar.h> #include "resource.h" #define WIDTH 500 #define HEIGHT 300 #define CLOSE_TIMER 1 #define COLOR_TIMER 2 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpszCmdLine, int nCmdShow) { WNDCLA...
b4500eb9af59e0e54f4fc85785d67c117914c53b
f5b8a33edc7840af4cac399ef9bb313427e5967b
SweeneyChoi/ogre
/Samples/Compute/src/Compute.cpp
C++
cpp
4,188
permissive
/* ----------------------------------------------------------------------------- This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info, see http://www.ogre3d.org/ Copyright (c) 2000-2014 Torus Knot Software Ltd Also see acknowledgements in Readme.html You may use this sample...
c724f281a930ed7db51005d85ff8da5d1e2cb4f8
94e12bdbddadf90e56029178180ccc41531b5f66
fancyzg/leetcode
/Combination_Sum.cpp
C++
cpp
1,818
no_license
//File Name : Combination Sum .cpp //Author : Avanty //Date : 2014/6/23 10:07PM //Decription : //Combination Sum Total Accepted: 12591 Total Submissions: 47955 My Submissions //Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to ...
0c5b561718529afe6e6ea689b9d3c449e1e57db8
2d16600590e1d801def2862fa1abd82a2d576332
Tencent/mars
/mars/comm/jni/util/comm_function.cc
C++
cc
20,727
permissive
// Tencent is pleased to support the open source community by making Mars 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 Licens...
984cb6ba6989f9ab2781851362bc7197f5852ff2
f4817cc2b82b835c6c6df6c19278fa9fa52bcb8b
paracelso93/GiocoDeiPianeti
/src/Spaceship.cpp
C++
cpp
8,355
permissive
#include "Spaceship.h" void Spaceship::setup(Star *startingStar, Planet *startingPlanet, int maxFuel, std::string name, float x, float y, std::string texturePath, SpaceShipTypes type, int offset, float speed, int cost) { this->mCurrentStar = startingStar; this->mCurrentPlanet = startingPlanet; this->mMaxFu...
dbd8652881a777c326dd9693088dae84a9582cd5
06e72209d5a126b41a1f9747efd73a5089d89514
jiaqiwang969/dune-course-material
/iwr-course-2021/release-build/dune-common/dune/common/simd/test/vctest_mask_BinaryOpsVectorScalar_float.cc
C++
cc
319
no_license
// generated from vctest_mask.cc.in by cmake -*- buffer-read-only:t -*- vim: set readonly: #include <config.h> #include <dune/common/simd/test/vcvectortest.hh> namespace Dune { namespace Simd { template void UnitTest::checkBinaryOpsVectorScalar<Vc::Mask<float> >(); } // namespace Simd } // namespace Dune
d549d13f725779b0872a0060433404fcca1c59d3
73d44dae0144f28fa5ea3989d665a99b01737fdf
tarunlahrod/Data-Structures
/Reversing a linked list.CPP
C++
cpp
3,728
no_license
//------------------REVERSING A LINKED LIST-----------------------// /* Reversing a linked list does not mean to print the node -> data in reversed order, it actually means to reversing the links For reversing a linked list, we have two approaches 1. Iterative 2. Recursive */ #include <...
c766c6e914ae1d062abef0f46ce4005c6451c170
9bf0b7de71ff8afa67b0e1e2cf76c7c25118d1a4
musdasch/PG-HF-ICT
/task_14_1.cpp
C++
cpp
1,429
permissive
/** * Task 14.1 is to writhe a game in which you * can guess a number in six attempts. * If you guess wrong the program has too hint * if the given number is below or above the * hidden number. * * @author Tim Voegtli * @version 1.0 */ #include <iostream> #include <ctime> using std::cout; using std::cin; usi...
13d838261648c9c3e18e3e32f669e1111b00d0e0
51c9dbe9cedacc579c7d8e4f1b3c4c60e3f1c666
penaarsenio/csc103
/todo_s/todo_17_3.cpp
C++
cpp
580
no_license
#include<iostream> using std::cin; using std::cout; void merge(int* L, size_t nL, int* R, size_t nR, int* S) { while(nL>0 && nR>0) { if(*L<*R) { *S=*L; L++;nL--; } else *S=*R;; R++;nR--; S++; } while(nL>0) { *S=*L; L++;nL--; S++; } while(nR>0) { ...
33ebfaab24a8aeed150d2f336e7292915ce457fc
c12c50ad626aaf8e8d97aa5c1a323338bc6a6f30
MarkOates/fullscore
/.removed/include/fullscore/ui/PlotterList/Actions/MoveCursorDown.hpp
C++
hpp
373
no_license
#pragma once #include <fullscore/actions/Base.h> namespace UI::PlotterList { class Widget; } namespace UI::PlotterList::Actions { class MoveCursorDown : public Action::Base { private: UI::PlotterList::Widget *widget; public: MoveCursorDown(UI::PlotterList::Widget *widget); ~MoveCurs...
9405ff2811b841253b0579bbd87bb2a5fdc5a420
ad6c5658e42917f6514631082e3ed24ee8b1e43f
AugF/code_rep
/ali_8_28/fun1.cpp
C++
cpp
601
no_license
#include <bits/stdc++.h> using namespace std; typedef long long lolo; const int maxn = 1e6 + 5; int cnt[11], n; int m, ans; void dfs(int u, int cur) { if (u == n) { if (cur % m) ++ ans; return; } for (int i = u > 0?0: 1; i < 10; ++ i) { if (cnt[i] > 0) { -- cnt[i]; ...
72a293b3e8c44acf19b7a19ee9b37ac367d24b1a
09c4a7a69c789cf46baffb78ee2bcc0d86e38914
romainfrancois/sass
/src/libsass/src/cssize.cpp
C++
cpp
18,490
permissive
#include "sass.hpp" #include <iostream> #include <typeinfo> #include <vector> #include "cssize.hpp" #include "context.hpp" namespace Sass { Cssize::Cssize(Context& ctx) : ctx(ctx), traces(ctx.traces), block_stack(BlockStack()), p_stack(std::vector<Statement_Ptr>()) { } Statement_Ptr Cssize::pare...
41da5182598a21f82a58eb1106573d9ce97b7da5
fa10a5287ef390d0a7495c9c032e9b857490819e
giang631125/shape_manager_v2
/circle.cpp
C++
cpp
1,837
no_license
#include "circle.h" #include <fstream> // class_circle::class_circle() { } class_circle::~class_circle() { } void class_circle::import_data() { cout<<"Name: "; cin>>name; cout<<"Import radius: "; cin>>radius; diameter = 2*radius; } void class_circle::show_data() { cout <<setw(15)<<"C...
b6b5d2a686f76ae4e85072779d62b3fe70dcc815
fd9c793b19f0de60be0e5769f1277f93f776b8d5
gligneul/Lua-Low-Level
/src/llltableset.cpp
C++
cpp
5,589
permissive
/* ** LLL - Lua Low Level ** September, 2015 ** Author: Gabriel de Quadros Ligneul ** Copyright Notice for LLL: see lllcore.h ** ** llltableset.cpp */ #include "lllcompilerstate.h" #include "lllruntime.h" #include "llltableset.h" #include "lllvalue.h" extern "C" { #include "lprefix.h" #include "lgc.h" #include "llimi...
136ed1b7c929dba4a97add053f5971ce87927ada
9e829d5a12b7474c8b50839460d01ba801d89450
patrickbags/MaximizePerformanceMathEvaluator
/Postfix_Evaluator_Strategy.cpp
C++
cpp
6,157
no_license
#include "Postfix_Evaluator_Strategy.h" #include<iostream> #include<fstream> #include<time.h> #include<typeinfo> /*Implementation of Postfix_Evaluator_Strategy Concrete strategy*/ Postfix_Evaluator_Strategy::Postfix_Evaluator_Strategy() { } Postfix_Evaluator_Strategy::~Postfix_Evaluator_Strategy() { } void Postfix_...
7a0c41716a5477194bba315807bcc2a2c76f0c03
efbececbff5142c4b276dc53a0dff291ee01fc20
KDE/okular
/autotests/mainshelltest.cpp
C++
cpp
28,476
no_license
/* SPDX-FileCopyrightText: 2014 Albert Astals Cid <aacid@kde.org> SPDX-License-Identifier: GPL-2.0-or-later */ // clazy:excludeall=qstring-allocations #include <QTest> #include <config-okular.h> #include <KConfigGroup> #include <KLineEdit> #include <KRecentFilesAction> #if HAVE_DBUS #include <QDBusConnecti...
330502eb2a9c2861fab98e2694d251cc245fd20e
faa6884339ecc8e598bff45484e2c4f353731574
wavs/pfe-2011-scia
/GlobeFactory/src/ui/user_interface.hh
C++
hh
847
no_license
//////////////////////////////////////////////////////////////////////////////// // Filename : user_interface.hh // Authors : Creteur Clement // Last edit : 05/02/10 - 17h26 // Comment : //////////////////////////////////////////////////////////////////////////////// #ifndef UI_USER_INTERFACE_HH #define UI_...
82b6f0fbf2e6786b9fa4c346d1682b31a7e1496e
6d176c53ed0ee99585f7f7133247e16405c74444
anirudhsaxena13/stackbasic
/stack.cpp
C++
cpp
1,313
no_license
#include<stdio.h> #include<iostream> #include<conio.h> using namespace std; struct Node { int info; Node *link; }; Node *top; void push(); void pop(); void disp(); int main() { int ch; top=NULL; do { cout<<"Press 1 for push"<<endl; cout<<"Press 2 for pop...
8ef64ea777e6c54b5753cb12f42b6ef891f8b650
8722dcb39b9e3bdb7a3f97078f444f73f9dd2051
HaloZero/swift
/stdlib/public/runtime/Metadata.cpp
C++
cpp
111,054
permissive
//===--- Metadata.cpp - Swift Language ABI Metadata Support ---------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/L...
bccbfc94b42ea002414d61b2d6c31ecc236f41fa
55132d5a36598677397cef7cf71368137717eefa
calvetalex/My_GKrellm
/include/Parser.hpp
C++
hpp
595
no_license
/* ** EPITECH PROJECT, 2020 ** cpp_rus3_2019 ** File description: ** Parser to get config class */ #ifndef PARSER_HPP_ #define PARSER_HPP_ #include <list> #include <string> class Parser { public: Parser(); Parser(const Parser &); ~Parser(); Pars...
b5314648609561c1f8133d0c3ab5def06d126749
59065630d0d2ce8b68bc2e24958de9295066c8b5
yeto-unal/CMPE226
/Binarysearchtree.cpp
C++
cpp
7,169
no_license
# include <iostream> # include <cstdlib> using namespace std; struct nod//node declaration { int info; struct nod *l; struct nod *r; }*r; class BST { public://functions declaration void search(nod *, int); void find(int, nod **, nod **); void insert(nod *, nod *); void del(int); ...
c30afb348e2f15520d53d7707241e3b11b924b11
ccc3fb761e5164adf9ba55635a7049304b7a991f
dew-x/VoxelWorld
/VoxelWorld/VoxelWorld/Utils.cpp
C++
cpp
717
no_license
#include "Utils.h" #include <stdio.h> //sprintf #include <iostream> Utils::Utils() { } Utils::~Utils() { } /** * Converts a vector into a string * @param dataVector is the vector * @return the string representation */ std::string Utils::vecToString(glm::vec3 & dataVector) { char temp[100]; sprintf_s(temp, "(%.2...
3f68733caddd881b8e4612aad951c1af3f54e62b
54c6d16dca15107abf44e3360abce5526378959d
valeriyr/Hedgehog
/framework/core/commands_manager/ih/cm_icommand.hpp
C++
hpp
960
no_license
#ifndef __CM_ICOMMAND_HPP__ #define __CM_ICOMMAND_HPP__ /*---------------------------------------------------------------------------*/ #include "intrusive_base/ib_ibase.hpp" /*---------------------------------------------------------------------------*/ namespace Framework { namespace Core { namespace CommandsMan...
be9e31e2a68f894bfa9ee82a4cb2d59b31c0b73c
08f8a5aa90d4aea6e6d9ab72a0f6058769a43a7e
AnomalousMedical/CMake-OldFork
/Source/cmCommandsForBootstrap.cxx
C++
cxx
669
permissive
/*============================================================================ CMake - Cross Platform Makefile Generator Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This...
018bf64ccf00e4284a6d3b9ff41f247f80ecd876
4efe5df897cdcd72452fa559ac4b6e855ddf63be
joaopedroxavier/Competitive-Programming
/codeforces/444div2/b.cpp
C++
cpp
1,908
no_license
#include <bits/stdc++.h> using namespace std; #define topper top //XDDDDDDD #define mp make_pair #define pb push_back #define db(x) cerr << #x << " == " << x << endl; #define _ << " " << typedef long long ll; typedef vector<int> vi; typedef pair<int,int> ii; const long double EPS = 1e-9; const int N=1e5+5; const ...
f0bdc78ee8ee412729417d4586e1ce9a69542fe2
c0f151053d7db4a125125d71d4ee033c8b620df2
makandok/mapnik-vector-tile
/src/vector_tile_geometry_decoder.hpp
C++
hpp
12,761
no_license
#ifndef __MAPNIK_VECTOR_TILE_GEOMETRY_DECODER_H__ #define __MAPNIK_VECTOR_TILE_GEOMETRY_DECODER_H__ #include "vector_tile.pb.h" #include "pbf_reader.hpp" #include <mapnik/util/is_clockwise.hpp> //std #include <algorithm> namespace mapnik { namespace vector_tile_impl { // NOTE: this object is for one-time use. Onc...
60849c0532e4d66f007c363cd099d313a6338a23
ce5e25e73f2792495493ecc4652658dee1da65a6
jensmark/INF3320-Group-1
/src/exercise/ex16/Ray.hpp
C++
hpp
1,293
no_license
#ifndef _RAY_HPP__ #define _RAY_HPP__ #include <glm/glm.hpp> /** * The ray class holds the state information of a ray in our ray-tracer: * point of origin and direction */ class Ray { public: Ray(glm::vec3 origin, glm::vec3 direction) { this->origin = origin; this->direction = direction; de...
f15cbeadd56405f745cef62d371491fa23c278ab
0b2f4dc1381bd083b899aec293e53303856bcb33
ma2ai/drake-franka-driver
/src/robot_msgs/pause_cmd.hpp
C++
hpp
4,921
permissive
/** THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT MODIFY * BY HAND!! * * Generated by lcm-gen **/ #ifndef __robot_msgs_pause_cmd_hpp__ #define __robot_msgs_pause_cmd_hpp__ #include <lcm/lcm_coretypes.h> #include <string> namespace robot_msgs { class pause_cmd { public: /// microseconds since the epoch ...
9283624d0dd53fb6e2dc95a2c01be793a469b1be
dd2093be4b76d6030af8f38489c7ce857e743b4b
ghidra/IogramSource
/ThirdParty/iogram_components/Widget_ColorSlider.cpp
C++
cpp
5,444
no_license
// // Copyright (c) 2016 - 2017 Mesh Consultants Inc. // 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, mod...
53267d885df31d63219c165642a623f75c50e770
d980cbecb933ef292d95ab9db86b703900f8d302
smuehlst/llvm-mos
/llvm/lib/Target/MOS/MOSFrameLowering.cpp
C++
cpp
12,293
permissive
//===-- MOSFrameLowering.cpp - MOS Frame Information ----------------------===// // // Part of LLVM-MOS, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===-----------------------------------...
f29ea656a7f5595a067ccbc4b7d528e0949a1c89
63912d3d264cd494671314448baa8f12b5e34730
stempelmeyer/CS-1336-Programming-Fundamentals
/HW4_Ex1.cpp
C++
cpp
2,015
no_license
// Author: Sarah Tempelmeyer // Course: CS1336.003 // Date: 9/27/2017 // Assignment: Lecture Homework #4 Exercise #1 // Compiler: Visual C++ Community 2017 // Description: // This program demonstrates how we can use algebraic // properties to calculate the amount in savings give...
98809ccf7395dc3b5786df4000fd1bd7133de39e
5e798b5eecc42aebde143253d43639751f414e56
pablomvb/misaplicaciones
/Documentos/qt_proyectos/captureUrl/scaner.cpp
C++
cpp
6,282
no_license
#include "scaner.h" #include <QDebug> #include <QCoreApplication> #include <QThread> Scaner::Scaner(QObject *parent) : QObject(parent) { contador = 0; input = new QTextStream(stdin); dataOutCreateScript = ""; initProcessSubItems = false; } void Scaner::setIdScript(QString id) { idScript = id; ...
7fa254528c108419f38954c5068723dadbf4770b
c9e85d0bad61c93fec39bccaafb451685efe6516
neilbu/osrm-backend
/include/osrm/matrix_parameters.hpp
C++
hpp
1,490
permissive
/* Copyright (c) 2016, Project OSRM contributors 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 f...
e434722af5e67c157e3721eadfba2feb95cd9163
84ac342780216cb4ac99a4f09b2480b1c5ae0760
emanueljuliano/Competitive_Programming
/cf/usp_tryouts_2018/f.cpp
C++
cpp
2,260
no_license
#include <bits/stdc++.h> using namespace std; #define _ ios_base::sync_with_stdio(0);cin.tie(0); #define endl '\n' #define f first #define s second #define pb push_back typedef long long ll; typedef pair<int, int> ii; typedef tuple<ll, int, int> T;; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3f; c...
34c70aadb4e9b2f12fd553de11934143301c2f63
7917425adfc2bf00118264b44b6385585aaa0c6d
pauladams8/chromium
/ash/ambient/autotest_ambient_api_unittest.cc
C++
cc
1,917
permissive
// Copyright 2020 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 "ash/public/cpp/autotest_ambient_api.h" #include "ash/ambient/ambient_controller.h" #include "ash/ambient/test/ambient_ash_test_base.h" #include...
8c2016a078cbb060f8974f124f0a0cf5c2c1bb72
87d5cb640b9a5c8b3b0631bc98b5a401339d2c17
lodyagin/bare_cxx
/tests.HIDE/utilities/optional/optional.bad_optional_access/derive.pass.cpp
C++
cpp
787
permissive
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------...
8b95aaf3e050e5047021ffff1c8f9fb5a206297f
20ebaa3374ff0dfa2dfa503c66da3f0571a39e5b
Pink-Dragon-Labs/DnGServerSource
/roommgr/bspellbag.cpp
C++
cpp
1,945
no_license
/* BSpellBag class author: Stephen Nichols */ #include "bspellbag.hpp" #include "roommgr.hpp" BSpellBag::BSpellBag ( WorldObject *obj ) : WorldObjectBase ( obj ) { type = _BSPELLBAG; } BSpellBag::~BSpellBag() { } void BSpellBag::copy ( WorldObjectBase *theBase ) { BSpellBag *base = (BSpellBag *)theBase; Linke...
27657668d6da7eaaa7e03c7c6a7c8c1789fbecd8
4b1a7df9c7181a832b2b2a62f3d3add9af52e972
lemony33/QuadCore
/Graphics Simulator/Texture.cpp
C++
cpp
2,292
no_license
#include "texture.h" #include "stb_image.h" #include <cassert> #include <iostream> using QuadCore::Texture; Texture::Texture(const std::string& fileName) { int width, height, numComponents; unsigned char* imageData = stbi_load((fileName).c_str(), &width, &height, &numComponents, 4); if (imageData == NULL) std::...
210cf215540e5b127d6a15c81eed67f0de021751
43ce73b4dece5048f6292b39789c97c55694d652
flykule/Mandelbrot-IPC
/mandelbrot-worker/workerwidget.cpp
C++
cpp
614
no_license
#include "workerwidget.h" #include <QVBoxLayout> WorkerWidget::WorkerWidget(QWidget *parent) : QWidget(parent), mStatus(this), mWorker(), mWorkerThread(this), mRefreshTimer() { QVBoxLayout *layout = new QVBoxLayout(this); layout->addWidget(&mStatus); mWorker.moveToThread(&mWorkerThread); connect(&m...
5177ae9225b79214cccd650bf5f058c4cd79d9e1
793044398e68819abcb9ba38a7c52274ddf3dc84
yaoling1997/desktop
/question/BZOJ/2434/x.cpp
C++
cpp
2,173
no_license
#include<cstdio> #include<cstdlib> #include<algorithm> #include<cstring> #include<queue> using namespace std; const int maxn= 5e5,sig= 30; struct node{ int ch[sig+1]; int v,fa,last; vector<int> X; }; struct query{ int x,y; }; node a[maxn]; query que[maxn]; vector<int> G[maxn],g[maxn]; char s[maxn]; int B[maxn],F[ma...
7dd0250c9ef3b960af1f2496398c6fe2ffee7cf0
c660d3ee991d5db103c3302063fc5142ed75addc
luotuoqingshan/acm
/vjgroup训练/小学生容斥/I.cpp
C++
cpp
1,528
no_license
#include <cstdio> #include <algorithm> #include <iostream> #include <cstring> #include <cmath> using namespace std; int n,m; const int maxn = 400000 + 5; int a[maxn]; int b[maxn]; int cnt; int divi[maxn]; int main(){ int T; cin >> T; while(T--){ cin >> n >> m; cnt = 0; memset(a,0,sizeof(a)); memset(b,0,s...
1af806adb680a0da0dd5a8ca83dc8c4d6e7f7876
40f37d1b4f1e16828f42b94a7fad71ec44a98e87
phyamal/CompPhys
/Cpp/Cpp14/Strou/iostream_ch38/ptr2bin.cpp
C++
cpp
3,512
permissive
/** * @file : ptr2bin.cpp * @brief : smart ptr to binary file (i.e. output, File I/O) * @details : smart ptr to binary file * @author : Ernest Yeung <ernestyalumni@gmail.com> * @date : 20171231 * @ref : http://en.cppreference.com/w/cpp/io/basic_fstream * Ch. 38 Bjarne Stroustrup, The C++ Programmin...
74f855a8c37355da8373915a99f9832d77419776
4464aaac87bcb09a4c3f9791ef999547c11fa68e
slowfranklin/synology-ds
/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/include/boost/bimap/container_adaptor/vector_adaptor.hpp
C++
hpp
4,253
no_license
// Boost.Bimap // // Copyright (c) 2006-2007 Matias Capeletto // // 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) /// \file container_adaptor/vector_adaptor.hpp /// \brief Container adaptor to easily build a std:...
f274976a67a8af2c9bf4c964676080a81bf30a2e
2b6e1b673660d4629322388cf2aaeb8f6a9b168f
pieceof/vj
/vj/Intense_training_team/greedy/c.cpp
C++
cpp
991
no_license
#include <cstdio> #include <iostream> #include <cstring> #include <string> #include <algorithm> using namespace std; const int inf = 0x3f3f3f3f; const int maxn = (int) 1e6 + 7; typedef long long ll; int visited[maxn]; struct node { int p, d; }; bool cmp(node a, node b) { return a.p > b.p; ...
1b481ca6dc2210c5fe9d2ce86f19794bed226ba3
3d2f0e3dc05250e6920f2d79ff8c421f1f7b60bd
karunmatharu/Android-4.4-Pay-by-Data
/external/jmonkeyengine/engine/src/bullet-native/com_jme3_bullet_collision_shapes_BoxCollisionShape.cpp
C++
cpp
2,336
permissive
/* * Copyright (c) 2009-2010 jMonkeyEngine * 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 ...
9f2bb2dfb2cf47e9b939baa97c9a247f68eb4db0
7fd08ea2ced668b0c3b5bf3edbc68ebab32222e6
thiagoolmarques/DIE-engine
/textfile.cpp
C++
cpp
1,395
permissive
// Copyright (c) 2012-2018 hors<horsicq@gmail.com> // // 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, mod...
6a3131859a648fc2b52f58300c76ceec452ac9ee
37804293d66a8519f002ff1a111e65f7c9fbc8a2
taniho0707/libmouse
/Graph.cpp
C++
cpp
9,515
permissive
#include "Graph.h" using namespace std; Graph::Graph() : WEIGHT_STRAIGHT(90), WEIGHT_DIAGO(63) { nodes = new std::array<Node*, 1986>; for (int i=0; i<(1984+2); ++i) { nodes->at(i) = new Node(i); } resetCosts(); } Graph::~Graph(){ for (int i=0; i<(1984+2); ++i) { delete nodes->at(i); } delete nodes; } ...
ce654bfbb35b2e12342c3d5db5a1c75df512be24
24f9aaf39fbe827c8513d47fc6549ca4a160a0e7
CU-0xff/juliet-cpp
/000/073/739/CWE124_Buffer_Underwrite__CWE839_listen_socket_82_goodG2B.cpp
C++
cpp
1,443
no_license
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE124_Buffer_Underwrite__CWE839_listen_socket_82_goodG2B.cpp Label Definition File: CWE124_Buffer_Underwrite__CWE839.label.xml Template File: sources-sinks-82_goodG2B.tmpl.cpp */ /* * @description * CWE: 124 Buffer Underwrite * BadSource: listen_socket Read data using a...
c881c3fe713e7828725a7489c8fcf61b2e272ce1
15c5c48bee86f4bfe4b071c75a5a36d72acbbeb5
duchuan1/DAT2C
/Protocol/SCdt_Transmit.cpp
C++
cpp
10,509
no_license
//#include <boost/algorithm/string/trim.hpp> //#include <boost/lexical_cast.hpp> //#include <boost/scoped_array.hpp> #include <boost/date_time/posix_time/time_formatters.hpp> #include "SCdt_Transmit.h" #include "../FileSystem/Markup.h" #include "../PublicSupport/Dat2cPublicAPI.h" #include "../DataBase/PriStation.h" na...
b3d82202948c7d2eacc4aa41fda47d66b5464d6f
46b506f0f783f8bfeaf28c7999520d4cf9e2ba61
resilencelyn/3-5AxisRobot
/hcinstruction/icautorunrevise.cpp
C++
cpp
7,666
no_license
#include <QIntValidator> #include "icautorunrevise.h" #include "ui_icautorunrevise.h" #include "icinstructparam.h" #include "iccommands.h" #include "iccommandprocessor.h" #include <QKeyEvent> ICAutoRunRevise::ICAutoRunRevise(QWidget *parent) : QDialog(parent), ui(new Ui::ICAutoRunRevise) { ui->...
9458afee217cc28a5f3568198f685987e14b4e58
60bbc0f1ef782d549d5385fcead9ea3f48263693
mcwchitos/rt-template
/src/ray_generation.cpp
C++
cpp
2,757
permissive
#include "ray_generation.h" #define STBI_MSC_SECURE_CRT #define STB_IMAGE_WRITE_IMPLEMENTATION #include "stb_image_write.h" RayGenerationApp::RayGenerationApp(short width, short height) : width(width), height(height) { } RayGenerationApp::~RayGenerationApp() { } void RayGenerationApp::SetCamera(float3 position, f...
fc4cf0af8cf75487523ae20fc5417217be385c93
1f138d5c1661e2de447d740ec8d085373c05cba8
ttrsato/mak127focuser
/M5Stack_plus_telescope/src/main.cpp
C++
cpp
10,675
permissive
/* Description: This exmpale can display the encoder gear reading of the PLUS Module and the state of the keys. */ #include <Arduino.h> #include <Ticker.h> #include <M5Stack.h> const int IN1 = 16; const int IN2 = 17; const int IN3 = 21; const int IN4 = 22; const int ECA = 35; const int ECB = 36; con...
0efd5c545d46ea8ecd487365ba062b997dfcc027
7db80c25695f6e78ae632588007384906a3deeb8
kystyn/ui
/QtSrc/gui/image/qpixmap_win.cpp
C++
cpp
16,039
no_license
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:L...
fb99acb0dd01fcb6edc31ee68381ca17209824ff
a95ae57ac6b9132d531482452eb4fc40eb94b2c1
wenyan4work/SimToolbox
/Sylinder/SylinderSystem.cpp
C++
cpp
59,985
permissive
#include "SylinderSystem.hpp" #include "MPI/CommMPI.hpp" #include "Util/EquatnHelper.hpp" #include "Util/GeoUtil.hpp" #include "Util/IOHelper.hpp" #include "Util/Logger.hpp" #include <cmath> #include <cstdio> #include <fstream> #include <memory> #include <random> #include <vector> #include <vtkCellData.h> #include <...
72f0fbc496df5e7199efb84b1992e06856c0adad
a6bf5ae68678fd471e40a86433cb53a7d5053c2b
liushengxi13689209566/Data-structures-algorithm
/Brush-the-questions/春招/刷题/石子游戏.cpp
C++
cpp
1,121
no_license
#include <bits/stdc++.h> using namespace std; /* class Solution { public: bool stoneGame(vector<int> &p) { int len = p.size(); vector<int> dp(len, 0); for (int i = 0; i < len; i++) { } } }; */ class Solution { public: bool stoneGame(vector<int> &p) { ...
f32ccca08a1f7e50be17ad64d46cd13fd6ccfdfc
cfa5cecddccd3d9eb699bfe1bcdd62de29c02db9
VijayNandakumarkumar/CodingPractise
/devc_v2/Google/1146_snapshot_array.cpp
C++
cpp
2,655
no_license
/* 1146. Snapshot Array Implement a SnapshotArray that supports the following interface: SnapshotArray(int length) initializes an array-like data structure with the given length. Initially, each element equals 0. void set(index, val) sets the element at the given index to be equal to val. int snap() takes a snapsho...
5d2905e8291797450fcf5a4f308e65479caa6c29
0c6ad3000e895a4455d3a91a5b83a174b8e908c0
ric2b/Vivaldi-browser
/chromium/gpu/command_buffer/service/shader_translator_unittest.cc
C++
cc
23,233
permissive
// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "gpu/command_buffer/service/shader_translator.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gl/gl_bindings.h" #include "ui/gl/gl_version_info.h" name...
0b1ce3ca4485d98aaab39181cac3f58278776a94
00e961f40d0bb31aaf7926315ccd3fe25c9e7c94
dhndrx/Parallel-Programming
/Project2/collatz_MPI.cpp
C++
cpp
2,060
no_license
#include <cstdio> #include <algorithm> #include <sys/time.h> #include <mpi.h> static int collatz(const long upper,int my_rank, int comm_sz) { // compute sequence lengths int maxlen = 0; //cyclic assignment of iterations for (int i = my_rank+1; i <= upper; i += comm_sz){ long val = i; int le...
769d4696632dcf272237044f82c6ebef2b99905f
000b80b2a70272d2897d92c0f8e1e51a9e10e4d1
BGCX261/zhhx-useful-code-svn-to-git
/trunk/testwave/testwave/wave-test.cpp
C++
cpp
10,340
no_license
 #ifdef WIN32 #include "stdafx.h" #include <windows.h> #include <mmsystem.h> #include <mmreg.h> #include <msacm.h> WAVEFORMATEX wfx; #define MAX_IN_BUFFERS 32 #define USED_IN_BUFFERS 6 #define MAX_OUT_BUFFERS 32 #define USED_OUT_BUFFERS 32 unsigned int waveoutDeviceID = WAVE_MAPPER; WAVEHDR waveHdrOut[MAX_OUT_BUF...
087685b02af9bf23880197572870812813c92591
aaae89419b4962aa5b638593456d887a9b8ee144
slac-epics/bacnet
/epics2bacnetApp/src/BacNetBuffer.cpp
C++
cpp
16,667
no_license
/* * BacNetBuffer.cpp * * Created on: Aug 29, 2011 * Author: 8w4 */ #include "BacNetBuffer.h" #include "common.h" BacNetBuffer::BacNetBuffer() { memset(this->buffer, 0, 2500); ptrBuff = buffer; } BacNetBuffer::~BacNetBuffer() { } uint8_t *BacNetBuffer::getPointerToBuffer(){ return buffer; } size_t ...
f667a7b3e81458f151dadfeb03af4ab9796033ee
0e21e85710cea61fd42d8f25dd0a70b7ddda8ab9
ljq1206/skepu2-clang-win64
/skepu2-examples/include/skepu2/impl/timer.hpp
C++
hpp
5,395
no_license
#ifndef SKEPU_TIMING_H___ #define SKEPU_TIMING_H___ #include <time.h> #include <windows.h> //#include <unistd.h> #include <stdlib.h> #include <stdint.h> #include <vector> #include <cmath> #define HAVE_CLOCK_GETTIME // #define CLOCK_MONOTONIC namespace skepu2 { class Timer { public: void start() { skepu_clo...
be32ace1fe64da676604a1a4ad8f9f9c8f350be5
45da3c5b59d68ec88863afae0bba290408a6acf0
PenfreeTseng/WebKit
/Source/ThirdParty/ANGLE/src/tests/gl_tests/VulkanExternalImageTest.cpp
C++
cpp
54,530
permissive
// // Copyright 2019 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // VulkanExternalImageTest.cpp : Tests of images allocated externally using Vulkan. #include "test_utils/ANGLETest.h" #include "common/debug....
dfd5d4dda196898f63d19988aee4cad9ddd615f2
63c00373ad2fef96e58cf23d40edb70a190a7951
unidevop/sjtu-project-pipe
/ sjtu-project-pipe/thirdparties/VTK.Net/src/Rendering/vtkOpenGLActorDotNet.cxx
C++
cxx
3,369
permissive
// managed includes #include "vtkDotNetConvert.h" #include "vtkOpenGLActorDotNet.h" #include "vtkMapperDotNet.h" #include "vtkRendererDotNet.h" // native includes #include "strstream" #include "vtkOpenGLActor.h" #include "vtkMapper.h" #include "vtkObject.h" #include "vtkRenderer.h" using namespace Sy...
78ec108297843e4c271d6dd07f5b53811a35375c
37cda46bc61d44a69f7c6d74440d9d70941da37f
dongdong-2009/02_PGS-1
/02_FW/01_USM/02_EEPROM_RW/EEPROM_RW/main.cpp
C++
cpp
204
no_license
/* * EEPROM_RW.cpp * * Created: 2017-02-01 오후 5:27:01 * Author : myeom */ #include <avr/io.h> int main(void) { /* Replace with your application code */ while (1) { } }
128707a1c8ca8c5d813a2893efd1c1ed1d772aa7
d693f49e7148c78b4b2bca4d58feb161ff02e180
mogumbo/ogre
/RenderSystems/GLSupport/src/EGL/OgreEGLSupport.cpp
C++
cpp
14,496
permissive
/* ----------------------------------------------------------------------------- This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info, see http://www.ogre3d.org/ Copyright (c) 2008 Renato Araujo Oliveira Filho <renatox@gmail.com> Copyright (c) 2000-2014 Torus Knot Softwa...
1819d96214c9a3292a856de826381495b808e474
687d957a5013c17987bd0b5365533a730181ceda
Shifat-Nayme/Codeforces
/Mike and palindrome.cpp
C++
cpp
576
no_license
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); string s; cin>>s; int len = s.length(); //cout<<"len="<<len<<endl; int cnt=0,j=0; for(int i=len-1; i>=len/2; i--) { if(s[i]!=s[j]) { cnt+...
e64cb4bc58ca97bf8ba3bcd2d34d6c0e080e9a2c
f8a74c0e121f695e99297215b288b0f29b8bb691
realmelan/leetcode
/solutions/encode.cpp
C++
cpp
4,102
no_license
// encode.cpp // leetcode // // Created by Song Ding on 11/6/19. // Copyright © 2019 Song Ding. All rights reserved. // #include "common.h" using namespace std; namespace encode { /* // TODO: copy problem statement here 471. Encode String with Shortest Length Given a non-empty string, encode the string such that i...
d2e5796b38db2fbb52fba3a2ae38de31fcc64143
0b1e5a1425ca4542168359dbde88243f4ace52eb
SgtFlame/indiezen
/Zen/Spaces/ObjectModel/I_ElementType.hpp
C++
hpp
1,728
no_license
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ // Zen Spaces // // Copyright (C) 2001 - 2009 Tony Richards // // Licensed under the Games by Sarge Publishing License - See your licensing // agreement for terms and conditions. // // Do not redistribute this source code. // // ...
a8f47063b6ed9aaa71a49ad7e9fe1a4075f50c47
eca0e5438e1d5047cfcfdcf5b45c11209afc5746
hackcraft-de/linwarrior
/source/de/hackcraft/world/sub/cityscape/rPadmap.cpp
C++
cpp
12,604
permissive
#include "rPadmap.h" #include "de/hackcraft/io/Texfile.h" #include "de/hackcraft/psi3d/GLS.h" #include "de/hackcraft/world/Entity.h" std::string rPadmap::cname = "PADMAP"; unsigned int rPadmap::cid = 7855; int rPadmap::sInstances = 0; std::map<int, long> rPadmap::sTextures; std::vector<int> rPadmap::sSpiral[2]; ...
6288c4a5b0f2f93285ddc5bda9c5ed15c8ba2f98
a5c0c3c5a86ab28b1a9aa01a1a0547e8159bb471
Becavalier/playground-libuv
/start_up.cc
C++
cc
317
permissive
#include <iostream> #include <cstdlib> #include <uv.h> using namespace std; int main(int argc, char **argv) { uv_loop_t *loop = (uv_loop_t*) malloc(sizeof(uv_loop_t)); uv_loop_init(loop); cout << ("Now quitting!\n") << endl; uv_run(loop, UV_RUN_DEFAULT); uv_loop_close(loop); free(loop); return 0; }
553c72f76588b71609de2feeca6e146055cc0e05
16c7052bd00da9dc3c1a1e5e63a482ace00a0c67
serpheroth/tungsten
/src/json2xml/JsonXmlConverter.hpp
C++
hpp
19,566
permissive
#ifndef JSONXMLCONVERTER_HPP_ #define JSONXMLCONVERTER_HPP_ #include "primitives/InfiniteSphere.hpp" #include "primitives/TriangleMesh.hpp" #include "primitives/Sphere.hpp" #include "primitives/Quad.hpp" #include "materials/ConstantTexture.hpp" #include "materials/CheckerTexture.hpp" #include "materials/BitmapTexture...
70b2e05bea95d5cfcf9c028cb371bc75c8ce5460
0c89b4a1711885c36c0a6ebf036878740a43b7bc
NeoniteDev/Osmium
/Osmium/SDK/FN_Combined_Horde_functions.cpp
C++
cpp
2,007
no_license
// Fortnite (4.5-CL-4159770) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "../SDK.hpp" namespace SDK { //--------------------------------------------------------------------------- //Functions //--------------------------------------------------------------------------- // Function Combined_Horde.Co...
e6ac3057874aa18293c5033e1621d1c2d4c09540
fb741be17f17fcaae5e44c7f5f05ba7c4175df00
psdhanesh7/Competitive-Coding
/momosMarket.cpp
C++
cpp
896
no_license
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int *prices = new int[n]; // vector<pair<int, int>> prices; int price; for(int i = 0; i < n; i++){ cin >> prices[i]; // prices.push_back( make_pair(price, i)); } int q; cin >> q; ...
c656b77912e33a4257542fecc5b697de3086bbcd
0522cf76e86ebb40a3c201b2afc21ac13fce758e
kaitai-io/formats-kaitai-io.github.io
/standard_midi_file/src/cpp_stl_98/standard_midi_file.cpp
C++
cpp
13,405
permissive
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild #include "standard_midi_file.h" #include "kaitai/exceptions.h" standard_midi_file_t::standard_midi_file_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent, standard_midi_file_t* p__root) : kaitai::kstruct(p__io) { ...
53fac2490a19a414fcb2864a4f53b4e264dd7a72
8aa21b6b62ad30e01049c7c608077b54f4aceab3
mutty320/cpp-snake-game
/C++ snake game using SFML/oop2_project_mordechai_schwarz_meir_marzel/src/LostMode.cpp
C++
cpp
3,035
no_license
#include "LostMode.h" #include <iostream> //----------------------------------------------------------- LostMode::LostMode() { this->m_font.loadFromFile("C:/Windows/Fonts/david.ttf"); this->m_backgroundTexture.loadFromFile("lost.png"); this->m_score = nullptr; //Initially Pointing to Nothing ...
5ae7170539d4228a4b5cf6a5e84bceba34378256
9eab2ee0064d2e45be31068ffe9fbf3749c3def6
hjk41/parameter_server
/src/test/shared_array_test.cc
C++
cc
2,258
permissive
#include "gtest/gtest.h" #include "util/shared_array_inl.h" #include "util/resource_usage.h" using namespace PS; TEST(SArray, Ctor) { std::vector<int> a = {1, 4, 3, 2}; SArray<int> sa; sa.copyFrom(a.begin(), a.end()); { SArray<uint32> sb(sa); EXPECT_EQ(sa.pointer().use_count(), 2); } EXPECT_EQ(sa.po...
e0e9a8058fae3cbd2a49d7f51f7ff7e59b76663a
afc5704cedc28aff841c5fe5617c712bee71d64d
concatime/dinit-fork
/include/ll.hpp
C++
hpp
3,034
no_license
#ifndef LL_HPP #define LL_HPP // Simple single- and doubly-linked list implementation, where the contained // element includes the list node. This allows a single item to be a member of // several different kinds of list, without requiring dynamic allocation of // nodes for the different lists. // // To accomplish thi...
de5a2c7578a071b0bc6e0b7714e2c0672465a76a
377747cd7cbc32f5a664edb5f24dd7eafc28cf09
frazierde12/Sample-C-Code-for-Classes
/Fraction.cpp
C++
cpp
671
no_license
#include <iostream> #include "Fraction.h" using namespace std; Fraction::Fraction() { num = 1; den = 1; } Fraction::Fraction(int n, int d) { num = n; den = d; } // overload the + operator Fraction Fraction::operator+(const Fraction& otherFraction) const { // num = a // den = b // otherFraction.num =...
16f9ae1cb6293e5a1a355f9e0ed78a4a456e3283
9a66bf746791a7bfa1c2b9800ae01dd092254931
ccquan/C-program-exercises
/7.12-10个等长的字符排序.cpp
C++
cpp
659
no_license
#include <stdio.h> #include <string.h> void handle(char str[][10], int n) { int i, j; char temp[10]; // ÅÅÐò£¬Ã°ÅÝ for(i = 0; i < n - 1; i++) { for(j = i; j < n; j++) { if(strcmp(str[i], (str[j])) > 0) { strcpy(temp, str[i]); strcpy(str[i], str[j]); strcpy(str[j], temp); } } } } int ...
7ad4607b3e99ae48deb38b66358a8d16fcc4a37e
86dfb094d5ca8a5a5ffeef4092475129a065238e
ali01/galadriel
/scope/param_scope.cpp
C++
cpp
686
no_license
#include "param_scope.h" /* code_generator includes */ #include <code_generator/location_includes.h> ParamScope::ParamScope(Scope::Ptr _parent_scope) : Scope(_parent_scope) { node_functor_ = NodeFunctor::NodeFunctorNew(this); } void ParamScope::NodeFunctor::operator()(VarDecl *_d) { Location::Offset off = scope_...
b5960f45c6bd81b842a2e6a2369fc0e34aba3723
56e4a6c0d1f295d85218f4ff03ad6603b016140d
Alprog/Qomplex
/source/ket_vector2.cpp
C++
cpp
538
permissive
#include <iostream> #include "ket_vector2.h" bra_vector2 ket_vector2::hermitian_conjugate() { return bra_vector2{ v1.conjugate(), v2.conjugate() }; } Real ket_vector2::norm() { auto complex = this->hermitian_conjugate() * (*this); if (complex.imaginary.value != 0) { throw std::exception("sca...
fa19367758a5b119f067a34beb88ca40f3f24306
6ff6322323110d876594bc34f6474350c90caec3
vespa-engine/vespa
/searchcore/src/tests/proton/index/index_writer/index_writer_test.cpp
C++
cpp
4,153
permissive
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/searchcore/proton/index/index_writer.h> #include <vespa/document/fieldvalue/document.h> #include <vespa/searchcore/proton/test/mock_index_manager.h> #include <vespa/searchlib/test/doc_builder.h> #in...
a542d29340166000822b4989c8afeed523c34a72
3d197246ba07a2bc543dce44ea4be2b0e62badd4
Const5215/Leetcode
/20180716/769.cpp
C++
cpp
291
no_license
class Solution { public: int maxChunksToSorted(vector<int>& arr) { int mx = 0, res = 0; for (int i = 0; i < arr.size(); i++) { if (arr[i] > mx) mx = arr[i]; if (mx <= i) res++; } return res; } };
72950ec131c5b1b9a0f0c14b122488f0d9b0b4e6
f2926c6d39c3caa66ea675c2f30b79aa517ef4bc
sjang1594/UMSL
/CS6420/project1/porter_duff.cpp
C++
cpp
3,779
no_license
/* Author : Seungho Jang * Class : CS6420 * Reference : http://ssp.impulsetrain.com/porterduff.html */ #include "porter_duff.hpp" // Key for commandline parser const char* keys = "{help h | | Print help message }" "{@image1 | <none> | input image1 }" "{@image2 | <none> | input image2 }" "{mask1 | | mask 1 }...
74454efaf13862ebc6c4ba6ec936b3e69999bf48
b26da9a5dda95379d9590761ed1a996d575cec90
LittleDrogon/MFC-Examples
/iocpframework/include/Basic.hpp
C++
hpp
299
no_license
#ifndef __NETWORK_BASIC_HPP #define __NETWORK_BASIC_HPP #include <winsock2.h> #include <mswsock.h> #include <WS2tcpip.h> #include <windows.h> #pragma comment(lib, "ws2_32") #pragma comment(lib, "mswsock") #include <map> #include <memory> #include <functional> #include <algorithm> #endif
b6f1dcc6766e3d31adf107d6118105a8a5941130
bcec8ba9108c491bec474134142c1ef98edb095e
alfredoav2/ComputoGrafico
/ComputoGrafico/CGE/Graphic/Mesh.cpp
C++
cpp
1,984
no_license
#include "Mesh.h" Mesh::Mesh() { VAO = 0; VBO = 0; IBO = 0; indexCount = 0; } void Mesh::CreateMesh(GLfloat *vertices, unsigned int *indices, unsigned int numOfVertices, unsigned int numOfIndices, unsigned int vSize) { indexCount = numOfIndices; glGenVertexArrays(1, &VAO); glBindVertex...
550b168cc051e246f951333dabb70e66fd2ee923
39ded3d0139a3248270caefbe27416b147089c59
Nimish-Jain/DSA-Practice
/Dynamic Programming/424. LongestRepeatingSubsequence.cpp
C++
cpp
734
no_license
//Code :: Nimish Jain #include<bits/stdc++.h> #define endl "\n" using namespace std; int LCS(string x, string y, int m, int n) { int dp[m + 1][n + 1]; for (int i = 0; i < m + 1; i++) { for (int j = 0; j < n + 1; j++) { if (i == 0 or j == 0) dp[i][j] = 0; } } for (int i = 1; i < m + 1; i++) { for (in...