blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
117
path
stringlengths
3
268
src_encoding
stringclasses
34 values
length_bytes
int64
6
4.23M
score
float64
2.52
5.19
int_score
int64
3
5
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
text
stringlengths
13
4.23M
download_success
bool
1 class
15534749519aabcfc7d234de833df1ba2d5a3a53
C++
thrimbor/Hurrican
/Hurrican/src/triggers/Trigger_LaFassSpawner.cpp
UTF-8
1,828
2.546875
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
// -------------------------------------------------------------------------------------- // Der LaFassSpawner // // Spawnt in bestimmten Abständen (Value2) das LaFass =) // -------------------------------------------------------------------------------------- #include "Trigger_LaFassSpawner.hpp" #include "stdafx.hpp"...
true
96005248bdbf5e3387e67290b0ee67afa7626128
C++
VAR-solutions/Algorithms
/Dynamic Programming/Egg Dropping Puzzle/cpp/eggDroppingPuzzle.cpp
UTF-8
1,018
3.453125
3
[ "MIT" ]
permissive
// A Dynamic Programming based C++ Program for the Egg Dropping Puzzle # include <stdio.h> # include <limits.h> int max(int a, int b) { return (a > b)? a: b; } int eggDrop(int n, int k) { int eggFloor[n+1][k+1]; int res; int i, j, x; for (i = 1; i <= n; i++) { eggFloor[i...
true
b0e2a40370d31db0943f7adbd5cb0eb26f74d4eb
C++
mtulio/kb
/Faculdade/2008-1_-_III/Estrutura_de_Dados_I/projetos/pilha/ProgramaPrincipal.cpp
UTF-8
1,632
3.03125
3
[ "Apache-2.0" ]
permissive
#include<iostream> #include<string> #include<stdlib.h> //#include"no.h" #include"Pilha.h" using namespace std; int main() { char palavra[]="subinoonibus"; cout<<" Digite a palavra: "; cin>>palavra; //verificando o tamanho da palavra pra usar no proximo loop int tamanho=0; for(int i=0;(pal...
true
ad62869cd5541d8989f55444345dffbb2609bff0
C++
pandakkkk/DataStructures-Algorithms
/Trees/Binary Tree/110. Balanced Binary Tree.cpp
UTF-8
1,105
2.5625
3
[]
no_license
/* ____ _ _ _ _ __ __ _ _ _ | _ \(_)___| |__ __ _| |__ | |__ | \/ | __ _| | |__ ___ | |_ _ __ __ _ | |_) | / __| '_ \ / _` | '_ \| '_ \ | |\/| |/ _` | | '_ \ / _ \| __| '__/ _` | | _ <| \__ \ | | | (_| | |_) | | | | | | | | (_| | | | | | (_) | |_| | | (_| | |_| \_\...
true
a11bd9808f21bf10d2f7cf200e5845fe55facd9f
C++
graninas/cpp_stm_free
/cpp_stm/stm/stmf/stmf.h
UTF-8
8,197
3.0625
3
[ "BSD-3-Clause" ]
permissive
#ifndef STM_STMF_STMF_H #define STM_STMF_STMF_H #include "../types.h" #ifdef STM_DEBUG #include <iostream> #endif namespace stm { namespace stmf { // STM methods template <typename A, typename Next> struct NewTVar { A val; std::string name; std::function<Next(TVar<A>)> next; static NewTVar<Any, Ne...
true
e78be0f9daa3f34f7f896988de1cea165149051a
C++
klaoude/Whala
/Whala/Hud.cpp
UTF-8
913
2.578125
3
[]
no_license
#include "Hud.h" #include <KlaoudeEngine\RessourceManager.h> #include "Player.h" Hud::Hud(float w, float h) { m_hudTexture = KlaoudeEngine::RessourceManager::getTexture("Textures/hud.png").id; m_rectTexture = KlaoudeEngine::RessourceManager::getTexture("Textures/whitePixel.png").id; m_width = w; m_height = h; m...
true
d21117afd565ab35d532ca3638f39bf4098f6244
C++
jianxinzhu/Polymorphism
/PayRoll/SalaryEmployee.hpp
UTF-8
583
2.90625
3
[]
no_license
/* name: jianxin zhu date: aug/16/2020 */ #ifndef SALARYEMPLOYEE_H #define SALARYEMPLOYEE_H #include"Employee.h" class SalaryEmployee :public Employee { public: SalaryEmployee(const std::string&, const std::string&, const std::string&,const Date&, double = 0, double = 0); virtual ~SalaryEmployee() = default; voi...
true
b421ab2ccb9c0237bfbd9204d0e17603c9ac2060
C++
seancui/ECE244-Circuit-Solver
/NodeList.cpp
UTF-8
2,656
3.6875
4
[]
no_license
//this file contains function definitions for NodeList class #include "NodeList.h" #include <iomanip> NodeList::NodeList(){ nodeHead = NULL; } void NodeList::insertNode(int nodeNum_){ Node* cur = nodeHead; Node* prev; if(cur == NULL){ //if there are no nodes in list Node* node = new Node(node...
true
9883d842a15936ce4181151f28c7b8fd55a79ef3
C++
M-Schenk-91/forschungsseminar2018
/cpp/processing/tracking/Trackable.cpp
UTF-8
6,419
2.71875
3
[]
no_license
#include "Trackable.h" #include "TrackableTypes.h" #include "../datastructures/document.h" #include "../datastructures/stamp.h" #include "../datastructures/hand.h" #include "../datastructures/touch.h" #include "../../math/smath.h" Trackable::Trackable(uint8_t type_id, std::string const & name) : m_type_id(type_id), ...
true
9504a32cc4a4257a7dddb3ea3fcd5138264584c1
C++
zjpgitte/project
/http服务器/Httpserver.hpp
UTF-8
920
2.75
3
[]
no_license
#pragma once #include <iostream> #include <pthread.h> #include "Sock.hpp" #include "Protocol.hpp" class HttpServer{ private: int _lsock; // listen sock short _port; public: HttpServer(short port) :_lsock(-1) ,_port(port) { } void InitServer(){ _lsock = Sock::Sock...
true
87dc5edd35b302eb097d436e406dc6702207a1b8
C++
Wait021/Course-Reviwe
/面向对象程序设计/《C++程序设计基础教程》电子教案/《C++程序设计基础教程》第08章_电子教案/第八章习题课/Array2Link/ex08B03.cpp
GB18030
336
3.015625
3
[]
no_license
// ex08B03.cpp ϰ8B(3)⣨㵹ã #include <iostream> #include "Array2Link.h" using namespace std; void Reverse(Node *&head) { if(head==NULL) return; Node *p, *rest; rest=head->next; head->next = NULL; while(rest) { p = rest; rest = rest->next; p->next = head; head = p; } }
true
e0dac4e461641f695328aaeb1b891c402e7c159a
C++
HekpoMaH/Olimpiads
/e-maxx/Euler_function/uva11327.cpp
UTF-8
615
2.703125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int phi(int x){ int result=x; for(int i=2;i*i<=x;i++){ if(x%i==0){ while(x%i==0)x/=i; result-=result/i; } } if(x>1)result-=result/x; return result; } int gcd(int a,int b){ return b==0 ? a : gcd(b,a%b); } int main(){ long lon...
true
782cc4fc15e46878d8c6d3ca62b6fad31a91b28b
C++
pedropaulovc/UFSC
/ED/ListaInvertida/Indexador/ChaveSecundaria/IndexadorChaveSecundaria.h
UTF-8
1,020
2.59375
3
[]
no_license
/** TÍTULO: Implementação buscador textual usando listas invertidas ALUNOS: Pedro Paulo Vezzá Campos - 09132033 e Felipe dos Santos Silveira - 09132014 MATÉRIA: INE5408 PRAZO: 12 de julho de 2010 PROPÓSITO: Este programa é uma implementação do enunciado do projeto de implementação II,...
true
7a594b0d5f8cae6cbfa21a6208c9c849cf1bbf7f
C++
harukishima/BookStore
/18120256/Menu.cpp
UTF-8
1,254
2.65625
3
[]
no_license
#include "Menu.h" Menu::Menu() { } void Menu::guestMenu() { cout << "1. Dang nhap" << endl; cout << "2. Tim sach" << endl; cout << "3. Hien thi tat ca sach" << endl; cout << "4. Dang ki" << endl; cout << "0. Exit" << endl; } void Menu::userMenu() { cout << "1. Mua sach" << endl; cout << "2. Cap nhat don hang"...
true
b9db30da8a72e4e72e39c39b8045fbaf13a1d7de
C++
AppStackCC/APS_EZTASK
/aps_eztask.cpp
UTF-8
2,225
2.671875
3
[]
no_license
/* aps_eztask.cpp AppStack easy task for Arduino ======= WEBSITE ======= https://www.facebook.com/appstack.in.th http://www.appstack.in.th <-------------------------------------------------------------------> @Author - ultra_mcu@Piak Studiolo LEGO eiei @Date - 2015/01/07 , Ver...
true
d4e6d7319ca394db243c57f86f036d1307a5f54b
C++
TimE-CU/CSCI-3302
/lab4_base/lab4_base.ino
UTF-8
7,967
2.671875
3
[]
no_license
// UPDATED 10/10 #include <sparki.h> #define ROBOT_SPEED 0.0278 #define MIN_CYCLE_TIME .100 #define AXLE_DIAMETER 0.0865 #define FWD 1 #define NONE 0 #define BCK -1 // Screen size #define SCREEN_X_RES 128. #define SCREEN_Y_RES 64. // Map size #define NUM_X_CELLS 12 #define NUM_Y_CELLS 6 // Start line is 18", 2" fro...
true
af71555dd8c9336f1595accb8a994280681fb7a1
C++
ranea/Bachelor-Projects
/ProcesamientoImagenes/contraste.cpp
UTF-8
2,948
3.5
4
[ "MIT" ]
permissive
/*************************************************************************** * Fichero: contraste.cpp * * Formato: contraste <fichOri> <fichDest> <min> <max> * <fichOri> nombre del fichero que contiene la imagen original * <fichDest> nombre del fichero que contiene la imagen que se pretende llegar * ...
true
673934e75d563eebf487a6febdb9721991fe22be
C++
SimKyuSung/Algorithm
/BeakJoon C++ Algorithm/15639.Rick.cpp
UTF-8
459
3.34375
3
[]
no_license
/// 15639.Rick #include <iostream> #include <string> #define endl '\n' using namespace std; const int n = 6; string rick[] = { "Give you up", "Let you down", "Run around and desert you", "Make you cry", "Say goodbye", "Tell a lie and hurt you" }; int main() { ios::sync_with_stdio(false); cin.tie(0); string inp...
true
22b8378510bc60e00a0642287d46d52fa380a112
C++
cattigers/SAINT2
/src/main/config.h
UTF-8
8,410
2.9375
3
[]
no_license
#ifndef CONFIG_H_INCLUDED #define CONFIG_H_INCLUDED #include <iostream> #include <string> #include "param_list.h" /// @breief Program version number. #define SAINT2_VERSION "1.1" // forward declarations class Runner; class Sequence; extern bool reverseSaint; /// @brief Class for managing program configuration info...
true
09fbb6b9cdf69203e2a4f4e4756a89c6141580fe
C++
j-wreford/jw-paint-tool
/jw-paint-tool/core/ui/component/TextField.cpp
UTF-8
2,170
3.03125
3
[]
no_license
#include "TextField.h" paint_tool::TextField::TextField( const std::string &id, const SIZE &size, const std::wstring &placeholder, const std::string &font_attr_set_id ) : ValueComponent<std::wstring>(id, L""), placeholder(placeholder) { registerObserver(this); // observes itself so that it may update the l...
true
cd88349f9dad87dd06a543781c6866f8a5effbc6
C++
khinbaptista/OpenGL
/TemplateOpenGL/Font2D.h
UTF-8
502
2.578125
3
[]
no_license
#pragma once #include <glm/glm.hpp> #include <SDL.h> #include "Sprite.h" class Font2D { private: glm::vec2 dimensions; int charactersPerLine; int lineCount; Sprite *sprite; public: Font2D(void); Font2D(Sprite *sprite, int charactersPerLine, int lineCount, int characterWidth = -1, int characterHeight = -1); ~F...
true
2b23b1aed89653edc1638082b03fd482d55ec4f2
C++
NeilZhy/Review
/平衡二叉树/AVL树/AVLTree.h
GB18030
4,917
3.53125
4
[]
no_license
#include<iostream> using namespace std; template<class K,class V> struct AVLTreeNode { AVLTreeNode(K key = 0,V value = 0) :_left(NULL) , _right(NULL) , _parent(NULL) , _bf(0) , _key(key) , _value(value) { } AVLTreeNode<K, V>* _left; AVLTreeNode<K, V>* _right; AVLTreeNode<K, V>* _parent; int _bf; K _key;...
true
5d23aabe895cbb808a8cace539874b395b4a600c
C++
MimusTriurus/QtVideoStreamer
/lib/static/FpsChecker/FpsChecker.cpp
UTF-8
942
2.5625
3
[]
no_license
#include "FpsChecker.h" int64 FpsChecker::getTimeTicks( ) const { return _sumTime; } double FpsChecker::getTimeMicro( ) const { return getTimeMilli( ) * 1e3; } double FpsChecker::getTimeMilli( ) const { return getTimeSec( ) * 1e3; } double FpsChecker::getTimeSec( ) const { return ( double )getTimeT...
true
4f3a38ecd8f2e8a642a87e9ad8644beb62cbb995
C++
mingpuwu/Daily-development
/alg/trie/trie.cpp
UTF-8
2,304
3.671875
4
[]
no_license
/* 前缀树,字典树 */ #include <string> #include <iostream> #include <vector> #include <memory.h> #define MaxNum 26 using namespace std; struct Node { int pass = 0; int end = 0; char c = 0; Node *next[MaxNum] = {nullptr}; Node(int p, int e,char c) { this->pass = p; this->end = e; ...
true
4cfe5dbb6145e5cdb30546ee9f63b0cf6124d739
C++
hello-choulvlv/hello-world
/OpenGL/source/法线贴图/OpenGL.cpp
GB18030
4,279
2.515625
3
[]
no_license
// #include <GL/glew.h> #include<engine/GLContext.h> #include<engine/GLProgram.h> #include<engine/TGAImage.h> #include<engine/Geometry.h> #include<engine/Shape.h> #include<engine/Sprite.h> #include<engine/GLShadowMap.h> //Common Data Struct struct UserData { GLProgram *object; GLuin...
true
01e343566bac213845f76f7939ac0f6f38e0f8a6
C++
Loqaritm/catsay
/catsay.cpp
UTF-8
4,236
3.0625
3
[]
no_license
#include <string> #include <iostream> #include <sstream> #include <ctime> #include <string> #include <fstream> std::string eightBall(){ std::string answers[] = {"maybe", "yes", "no", "could be", "go for it", "you bet", "dont even", "possible", "420"}; int lenOfAnswers = sizeof(answers)/sizeof(answers[0]); ...
true
c5887c9b6df13c2231c442e5ebac167d48f2e6aa
C++
CoupalLee/dlinkedlist
/DLinkedList.cpp
UTF-8
1,558
3.703125
4
[]
no_license
/* * DLinkedList.cpp * * Created on: Mar 26, 2018 * Author: kareembrathwaite-henry */ #include"Node.cpp" #include <iostream> #include <ostream> template <class TYPE> class DLinkedList { private: DLinkedList(const DLinkedList &); Node<TYPE> *head; public: DLinkedList(){ head = new Node<TYPE>(0,...
true
807603fac3ff7c678494534215e8cadfa1b43a8e
C++
shileiyu/nui
/nui/base/ref.h
UTF-8
3,477
3.078125
3
[]
no_license
#ifndef NUI_BASE_REF_COUNT_H_ #define NUI_BASE_REF_COUNT_H_ #include <nui/nui.h> namespace nui { class RefCountBase { protected: RefCountBase() : ref_count_(1) { memset(tag_, 0, kTagCapcity); strncpy_s(tag_, "RefCntObj", kMaxTagSize); } virtual ~RefCountBase() {}; void D...
true
87938275e1451f6ea7a6126f4077ab61c3e197eb
C++
cmeta/WrittenDigitRecognizer
/src/util.cpp
UTF-8
2,368
3.046875
3
[ "MIT" ]
permissive
/* * Author: alexanderb * Adapted into CImg dependency by Michael Wang */ #include "util.h" void Util::DisplayImage(CImg<float>& img) { //Display image img.display(); } //----------------------------------------------------------------------------------------------- void Util::DisplayMat(CImg<float>&...
true
a7134508009b135cf836347c21d447874ea27850
C++
XenofoR/gameengine
/engine/Include/MemoryAllocator.h
UTF-8
636
2.546875
3
[]
no_license
#pragma once #include "MemPool.h" #include "MemStack.h" class MemoryAllocator { public: MemoryAllocator(bool p_customer_Al_the_croc); ~MemoryAllocator(); template <class T> MemPool<T>* CreatePool(unsigned int p_numBlocks, unsigned int p_alignment, bool p_shared) { MemPool<T>* pool = new MemPool<T>(p_numBlock...
true
e2aa684547d1581f0fb1988ec8591143f5257f14
C++
flwmxd/Simplification
/main.cpp
UTF-8
1,728
2.984375
3
[]
no_license
/////////////////////////////////////////////////// // // Hamish Carr // January, 2018 // // ------------------------ // main.cpp // ------------------------ // /////////////////////////////////////////////////// #include <QApplication> #include "GeometricWindow.h" #include "GeometricController.h" #include <stdio.h> ...
true
3c2ac393913f1418124d12de8b9a9470c845e416
C++
ORNL-Fusion/xolotl
/xolotl/core/include/xolotl/core/advection/AdvectionHandler.h
UTF-8
2,087
3.21875
3
[ "BSD-3-Clause" ]
permissive
#ifndef ADVECTIONHANDLER_H #define ADVECTIONHANDLER_H // Includes #include <xolotl/core/Constants.h> #include <xolotl/core/advection/IAdvectionHandler.h> namespace xolotl { namespace core { namespace advection { /** * This class realizes the IAdvectionHandler interface responsible for all * the physical parts for t...
true
a03e4dd75ce930180424c9f20a5a75776a697586
C++
Und3rMySk1n/ood
/lab04_factory/libpainter/Ellipse.h
UTF-8
470
2.859375
3
[]
no_license
#pragma once #include "Shape.h" class CEllipse : public CShapeImpl<CShape, CShape, CEllipse> { public: CEllipse(Color color, Vertex center, float horizontalRadius, float verticalRadius); Vertex GetCenter() const; float GetHorizontalRadius() const; float GetVerticalRadius() const; void Draw(ICanvas &...
true
d24806a3c8397b0d00aaf602e1ff5807843a5945
C++
kopaka1822/ObjToHrsfConverter
/ObjSingleIndexBufferConverter/FileHelper.h
UTF-8
273
3.125
3
[]
no_license
#pragma once #include <string> // attempts to retrieve the file directory inline std::string getDirectory(const std::string &filepath) { if (filepath.find_last_of("/\\") != std::string::npos) return filepath.substr(0, filepath.find_last_of("/\\")) + "\\"; return ""; }
true
a3b1e78f917be334ca5f913bea36b3a7aeabf07c
C++
gunishmatta/Daily-Programming-Practice
/Basics and Implementations/c++ stl/priorityqueue.cpp
UTF-8
716
3.296875
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int main() { priority_queue<int> q; q.push(-1); q.push(100); q.push(30); q.push(20); q.push(-100); q.push(0); cout<<"Top of PQ is "<<q.top()<<endl; //Greatest element since it arranges in descending order cout<<"size of PQ is "<<q.size()<<endl; q.pop(); cout<<"Top of PQ...
true
ef84cc91ee436532b789339ba280468aca266586
C++
alcornwill/logic_simulator
/createcommand.cpp
UTF-8
1,212
2.734375
3
[]
no_license
#include "createcommand.h" #include "mygraphicsscene.h" #include "mainwindow.h" CreateCommand::CreateCommand(Component *_component, Component *_parent) { component = _component; parent = _parent; setText("create component"); } CreateCommand::~CreateCommand() { // create/delete commands can hold the la...
true
95a0d6752b9a90f6d36e2b145cebfe0e855cca9f
C++
lizhenghong66/open_spiel
/open_spiel/games/landlord/landlord_hand.cc
UTF-8
1,425
2.515625
3
[ "Apache-2.0", "LicenseRef-scancode-generic-cla" ]
permissive
// Copyright 2018 Google 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
true
8f902b743e2118587bb92ec662f633eafd6e8054
C++
yuzhishuo/cpp
/leetcode/35.search-insert-position.cpp
UTF-8
1,249
3.421875
3
[ "Apache-2.0" ]
permissive
/* * @lc app=leetcode.cn id=35 lang=cpp * * [35] 搜索插入位置 * * https://leetcode-cn.com/problems/search-insert-position/description/ * * algorithms * Easy (43.24%) * Total Accepted: 40.9K * Total Submissions: 94.6K * Testcase Example: '[1,3,5,6]\n5' * * 给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返回它将会被按顺...
true
bbeb5a394d84345235e185751eed37cdb30988d2
C++
asok00000/qzues
/qzueslineedit.cpp
UTF-8
804
2.53125
3
[ "MIT" ]
permissive
#include "qzueslineedit.h" QZuesLineEdit::QZuesLineEdit(QWidget *parent) : QLineEdit(parent), m_isContentChanged(false), m_originContent(""), m_isFirstSet(true) { } QZuesLineEdit::~QZuesLineEdit() { } bool QZuesLineEdit::getContentChanged() const { return m_isContentChanged; } void QZuesLineEdit::setContentChan...
true
68df7ea9693c25dec009acb47fb7ad93b46d0ff4
C++
jaanvirbains/Pac-Man
/main.cpp
UTF-8
4,980
2.765625
3
[]
no_license
//Jaanvir, Go Diego, Go, and Kaanstantinople #include <iostream> #include <stdio.h>//ALLOWS USER TO INPUT FUNCTIONS FROM A USER THROUGH USE OF CONTROLLER (TMP FILE, PRINT, OPEN AND SCAN) #include <windows.h>//GET ASNY KEY DEFINES MOVEMENT #include <vector> using namespace std; char dab_map[18][32]; char map[...
true
06128943dbf509d35026346e6203c10d0a4b4aa7
C++
FedericoAmura/Taller2016C1TP4MegamanInicia
/editor/Workspace.cpp
UTF-8
3,762
2.78125
3
[]
no_license
// // Created by marcos on 23/05/16. // #include <iostream> #include <gdkmm.h> #include "Workspace.h" #include "../entities.h" #define SIZE_TRANSFORM 15.5 typedef Glib::RefPtr<Gdk::Pixbuf> Pixbuf; typedef drawing_map_t::iterator p_iter; Workspace::Workspace(Level* level) : level(level) { screen_width = ...
true
30b4888bffe17f215aaa7fabc3f55c530fa17f36
C++
yuunikorn/mouse-playground
/2019 micromouse/micromouseV4/a_blink.ino
UTF-8
469
2.921875
3
[]
no_license
/* Basics Blink command for hardware testing * * Functions that can be called: * --> Setup: * BlinkSetup(); * * --> Loop: * BlinkCommand(); */ void BlinkSetup(){ pinMode(LED_BUILTIN, OUTPUT); } void BlinkCommand(){ digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(1...
true
841902f1577dad9eabb343e798e9dc464d43814c
C++
dhryniuk/Markov-Chain-Monte-Carlo-in-CPP
/binomial.cpp
UTF-8
407
2.921875
3
[]
no_license
#include "headers/binomial.h" bool binomial::positive_support() { return true; } binomial::binomial(int number, float success) : n{number}, p{success} { std::binomial_distribution<int> dis{n,p}; }; binomial::~binomial() {}; int binomial::sample(std::mt19937 generator) { return dis(generato...
true
d61e2a26c3d6a399caae53b877cfdd02a12531ad
C++
Morseee/police-egypt
/police/src/Image.cpp
UTF-8
1,251
2.84375
3
[]
no_license
/* * Image.cpp * * Created on: Apr 27, 2012 * Author: amro */ #include<cstdlib> #include<cstdio> #include<cmath> #include<string> #include "Image.h" Image::Image(std::string filename) { FILE *image = fopen(filename.c_str() , "rb"); unsigned char c; for(int i=0;i<18;i++) { fscanf(image,"%c",&c); } ...
true
1b2d0ae1c2ba6eefb735c6a4526b0f086f3d2b2a
C++
asvgit/hw_third
/main.cpp
UTF-8
2,786
3.390625
3
[]
no_license
#include <map> #include "lib.h" #include <memory> constexpr int magic_num = 10; using factorial = util::fact<magic_num>; template<typename T, typename _Alloc = std::allocator<T>> class List { struct Node { T m_data; Node *next = nullptr; List *m_parent; Node(const T &val, List *parent) : m_data(val), next...
true
5c06aa33ec96ced787fa0103b65332f9e29ab6f2
C++
peutykeure/randomshapegenerator
/src/Rectangle.cpp
UTF-8
461
2.828125
3
[]
no_license
#include "Rectangle.h" #include "Color.h" #include "Shape.h" Rectangle::Rectangle(int x, int y, int r, int g, int b, int w, int h):Shape(x,y,r,g,b),_width(w),_height(h) { _moveMultiplier = 1; } void Rectangle::draw(sf::RenderWindow *win) const { int r,g,b; this->fill.getRGB(r,g,b); sf::RectangleSha...
true
5aebe6f57dc77bf8a1b648bb90b7062be006cc2e
C++
Haar-you/kyopro-lib
/Mylib/Number/Prime/miller_rabin.cpp
UTF-8
1,290
2.71875
3
[]
no_license
#pragma once #include <cstdint> #include <initializer_list> #include "Mylib/Misc/int128.cpp" namespace haar_lib { namespace miller_rabin_impl { uint128_t power(uint128_t a, uint128_t b, uint128_t p) { uint128_t ret = 1; while (b > 0) { if (b & 1) ret = ret * a % p; a = a * a % p; ...
true
cfc8fd9332f0459b03bab96e57e73dfd1aabbf5b
C++
HaydenSansum/ReVera
/reVera_CarreMagique/src/ofApp.cpp
UTF-8
5,039
3.078125
3
[]
no_license
#include "ofApp.h" // USER FUNCTIONS //-------------------------------------------------------------- float ofApp::calcAngle(ofVec2f A, ofVec2f B, ofVec2f C){ // Test angles ofVec2f first_line = A - B; ofVec2f second_line = C - B; float l1_angle = atan2(first_line.y, first_line.x); float l2_a...
true
a74361db65e76aa26e71a0c69d72de2f72f4dcad
C++
yohokuno/nb
/CBomb.h
SHIFT_JIS
1,504
2.890625
3
[]
no_license
#ifndef _INC_CBOMB_H_ #define _INC_CBOMB_H_ class CBomb:public CObj { public: CBomb(CPlayer *pPlayer); virtual ~CBomb(); virtual void StepFrame(); virtual void Render(); static void LoadImage(); void Explode(); // virtual bool ColPlayer(CPlayer *pl){pl->SetOffIceFlag();return false;}; virtual bool OnPlayer(C...
true
76646a2cacb96b5ec32dfb9be3d28f56a754c3ba
C++
agentcox/TheAgencyRazorOne
/Listpriv.cpp
UTF-8
17,452
3.015625
3
[ "MIT" ]
permissive
//-------------------------------------------------------------------------------------------- // Project: The Capricorn Document by Team V // Team: Charles Cox, Dave Kondor, Dave Wilson, Hideki Saito, Paul Sequeira, Wyatt Jackson // Desc: Linked List Library - Private Implementation // Authors: Dave Wilson (init...
true
d664521bf15c2057e3d4bea00bc41dd45b76ed80
C++
djeemie2000/PlatformPlayground
/Common/libraries/Midi/CVMidiHandler.h
UTF-8
1,320
2.65625
3
[]
no_license
#ifndef CVMIDIHANDLER_H_INCLUDE #define CVMIDIHANDLER_H_INCLUDE #include <mbed.h> #include "MidiHandler.h" #include "VoltageOut.h" class CVMidiHandler : public MidiHandler { public: CVMidiHandler(VoltageOut& cvPitch, VoltageOut& cvVelocity, DigitalOut& gateOut) : m_cvPitch(cvPitch) , m_cvVelocity(cvVelocity) ...
true
dc6701dbf5549179d9050cf03fcb583fe392e1f7
C++
HugoRamc/Distribuidosc-
/Parcial1/Practica1/programa1_2.cpp
UTF-8
870
3.75
4
[]
no_license
//Equipo 1 //Ejercicio 2: //Un error común difícil de detectar es dividir dos tipos de datos entero s o un entero con //un tipo flotante. Elabore un programa para imprimir el resultado de una división entre dos enteros //y de un entero con un flotante y determine cuál es el error que ocurre #include <iostream> usi...
true
4116b7bf2fa73b90f033e6525dc374f272dbbdc2
C++
lpan18/3D-Chair-Generator
/ObjBuffer.cpp
UTF-8
10,979
2.90625
3
[]
no_license
#include <Eigen/Geometry> #include <string> #include <iostream> #include <fstream> #include <sstream> #include "ObjBuffer.h" // Read Obj file to ObjBuffer ObjBuffer ObjBuffer::readObjFile(string filename) { string line; int vn = 0, fm = 0; // Read the file and get the numbers of vertices and faces. ifstream fin(...
true
676b9e0bd9789b03a413f76a373ce059144bf53c
C++
OuO-language/ouolang
/ouo/mpc.cpp
UTF-8
93,653
2.71875
3
[ "MIT" ]
permissive
#include "mpc.h" /* ** State Type */ static mpc_state_t mpc_state_invalid(void) { mpc_state_t s; s.pos = -1; s.row = -1; s.col = -1; return s; } static mpc_state_t mpc_state_new(void) { mpc_state_t s; s.pos = 0; s.row = 0; s.col = 0; return s; } static mpc_state_t *mpc_stat...
true
424e5086924897ec689d0dc2039fdf59f9badf87
C++
ttyang/sandbox
/sandbox/SOC/2007/signals/libs/glv/include/glv_core.h
UTF-8
17,656
2.59375
3
[ "BSL-1.0" ]
permissive
#ifndef INC_GLV_CORE_H #define INC_GLV_CORE_H /* Graphics Library of Views (GLV) - GUI Building Toolkit See COPYRIGHT file for authors and license information */ #include "glv_rect.h" #include "glv_observer_pattern.h" #include "glv_color.h" #include "glv_draw.h" #include <map> #include <string> #include <list> nam...
true
71bbc9760be45407474528c1777d44547f758ea1
C++
IHC1998/LARC
/sensorCor/sensorCor.ino
UTF-8
1,554
3
3
[]
no_license
//PINOS SENSOR DE COR int S2 = 9; //9 //2 int S3 = 10; //10 //4 int OUT = 8; //8 //7 int red; int green; int blue; void color() { // ----- OBS: Os valores dessa tabela irão variar dependendo da luminosidade do local. ------ /* Tabela de Valores do RGB das Cores COR | RED | GREEN | BLUE | ...
true
d2abef4c75d4c22fb20c23447c7103761b971eea
C++
Mottelz/Conquest
/StrategyDriver.cpp
UTF-8
3,567
2.859375
3
[]
no_license
#include "StrategyPattern.h" #include "Player.h" #include "Startup.h" #include <ctime> #include "GameObserver.h" using namespace std; int main() { //LOAD THE MAP Map * map; MapLoader maploader; string mapFile = "maps/World.map"; map = new Map(mapFile); maploader.readMapFile(mapFile, *map); //CREATE PLAYERS ...
true
ce6a920c5765f66b1945a1d54f871c6370d0ea76
C++
m80126colin/Judge
/before2020/ZeroJudge/ZJ b030.cpp
UTF-8
549
2.625
3
[]
no_license
#include <iostream> #include <string> using namespace std; int main() { bool ox_1,ox_2; int a[128],b[128],i; string n; while (getline(cin,n)) { ox_1=ox_2=1; for (i=127;i;i--) a[i]=b[i]=0; for (i=0;i<n.size();i++) a[n[i]]++; getline(cin,n); for (i=0;i<n.size();i++) b[n[i]]++; for (i=65;i<=...
true
2b9fdd5d3fda5f66f9de566cf04a72ff9173a866
C++
ibillxia/xleetcode
/2012/20120327SpiralMatrix2.cpp
UTF-8
852
2.84375
3
[]
no_license
#include<iostream> #include<vector> #include<stack> #include<queue> #include<string> #include<map> #include<algorithm> #include<cstdio> #include<cstring> #include<cmath> using namespace std; #define FOR(i,n) for(int i=0;i<n;i++) class Solution { public: vector<vector<int> > generateMatrix(int n){ vector<vector<int>...
true
46f597d11c0b3123e57a33ec579e94731696ea4c
C++
GreenHackersOTC/C
/HelloWorld/HelloWorld/helloworld.cpp
UTF-8
301
2.5625
3
[ "MIT" ]
permissive
#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<time.h> int genRandom(int n); int main() { int k; time_t t; srand((unsigned)time(&t)); for(k=0;k<100;k++) { printf("%d\n",genRandom(21)); } getch(); } int genRandom(int n) { int i=0; i=rand(); i=(i%n)+1; return i; }
true
6d9afaddbc3d3c47ab46ffc55adba0507a0f8b36
C++
drlongle/leetcode
/algorithms/problem_1676/other.cpp
UTF-8
458
3.21875
3
[]
no_license
class Solution { public: TreeNode* lowestCommonAncestor(TreeNode* root, vector<TreeNode*> &nodes) { unordered_set<TreeNode*> nodeSet(begin(nodes), end(nodes)); return lca(root, nodeSet); } TreeNode* lca(TreeNode* root, unordered_set<TreeNode*> &nodes) { if (!root || nodes.count(root...
true
8b0f8bd48731a208ce92067be3281651286364c2
C++
aguetlein/FootballManager
/src/core/PlayerInfo.cpp
UTF-8
1,433
3.015625
3
[]
no_license
#include "PlayerInfo.h" #include <exception> #include <stdexcept> namespace fm { namespace core { PlayerInfo::PlayerInfo() : fFirstName(), fLastName(), fAge(0) { } PlayerInfo::PlayerInfo(std::string firstName, std::string lastName, int age) : fFirstName(firstName), fLastName(lastName), fAge(age) { ...
true
52ad1277391ab6f71821ba53c1d8a43024477a73
C++
wangfyy/dsa
/关于算法竞赛的不完全解决方案/02-树 #/1-二叉树的遍历 #/##重建二叉树 专题.cpp
UTF-8
9,556
3.296875
3
[]
no_license
重建二叉树 ---后序中序-------------------------------------------------------------------------- 【一】PAT-A 170304 原题 D //给出一个树的中序和后序遍历结果,求它的Z字型层序遍历,也就是偶数层从左往右,奇数层从右往左遍历 // 8 // 12 11 20 17 1 15 8 5 中序 // 12 20 17 11 15 8 5 1 后序 // 1 11 5 8 17 12 20 1 zigzagging sequence #include <cstdio> #include <queue> using name...
true
9e4d2f28f1f09d970caeb43e333217f1d1040189
C++
dtbinh/Psycho
/tree.cpp
UTF-8
8,163
2.890625
3
[]
no_license
/** Psychopath - Board Game Copyleft (C) <2008> <Olivier Perriquet> (Game conception) Copyright (C) <2015> <Robache Alexis, Sévin Léo-Paul> (AI conception and implementation> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Licens...
true
a566ed9a6689e65d3cb1d64ffadf48f9b409376c
C++
Andersama/obs-voicemeeter
/circle-buffer.h
UTF-8
4,611
2.59375
3
[]
no_license
#include <util/bmem.h> #include <util/platform.h> #include <util/threading.h> #include <util/circlebuf.h> #include <sstream> #include <string> #include <vector> #include <algorithm> #include <functional> #include <windows.h> #include <util/windows/WinHandle.hpp> #define CAPTURE_INTERVAL INFINITE #define NSEC_PER_SEC ...
true
384c1ce43a7ef67aca4e02ec44b41ffe7d4c0556
C++
kikozzz/cs211-extra-task-1
/main.cpp
UTF-8
2,639
2.984375
3
[]
no_license
#include <cassert> #include <cmath> #include "extra-task-1.h" #include <cfloat> #include<iostream> using namespace std; int main() { //Task 1 assert(fabs(seconds_difference(1800.0, 3600.0) - 1800.0) < DBL_EPSILON); assert(fabs(seconds_difference(3600.0, 1800.0) - (-1800.0)) < DBL_EPSILON); assert(fabs(sec...
true
f7b67b60ad0ecb68bcd2c28b3cf284cc085e6e4d
C++
MysticalNobody/Light
/Light/Background.cpp
UTF-8
1,466
2.796875
3
[]
no_license
#include "Background.h" int Background::getWidth() { return bgSprite[0].getGlobalBounds().width; } void Background::setSprite(int x, int lay) { layer = lay; xPos = x; std::string path; for (int i = 0; i < 4; i++) { path = "Images/Background/" + std::to_string(layer) + "/" + std::to_string(i) + ".png"; if (lay...
true
085371e45c3611928674690fd7d205717e0aae17
C++
duttaANI/AL_Lab
/Interview Bit/Dynamic Prog/Min Jumps Array.cpp
UTF-8
1,341
2.59375
3
[]
no_license
#define ar array int Solution::jump(vector<int> &A) { int n=A.size(),jumps=0,reach=0,maxJump=0; for(int i=0;i<n-1;i++){ maxJump=max(maxJump,i+A[i]); if(i==reach){ jumps++; reach=maxJump; } } if(reach<n-1) return -1; return jumps; // int start...
true
dd2db619ec407f99afd1e48da4ff3f8af54de57c
C++
jTitor/cmscParallelProcessing
/src/Primitives/AABB.h
UTF-8
1,209
3.34375
3
[]
no_license
#pragma once #include "../Math/Vec3.h" namespace Graphics { /** Represents an axis-aligned bounding box. */ class AABB { private: void init(const Vec3& pCenter, const Vec3& pHalfExtents); //The center of the box. Vec3 center; //The distance from the center to //the given axis' edge on the box. Vec3 ...
true
91c2779e3b47254cad04b1df43ed8fd4ba9255de
C++
hmkwizu/LRover
/Rover/Classes/LGPS.cpp
UTF-8
771
2.671875
3
[]
no_license
// // LGPS.cpp // Rover // // Created by Luka Gabric on 05/08/15. // Copyright (c) 2015 Luka Gabric. All rights reserved. // #include "LGPS.h" LGPS::LGPS() { _gps = new TinyGPS(); _ss = new SoftwareSerial(10, 11); _ss->begin(9600); } void LGPS::readGPSData() { unsigned long start = millis(); ...
true
0d089026382eb784ac53aa365042b47584d67a32
C++
Astreos/mobile_robots
/userFiles/ctrl/ctrl_interface/specific/Gr3Ctrl.hh
UTF-8
587
2.671875
3
[]
no_license
/*! * \author Nicolas Van der Noot * \file Gr3Ctrl.hh * \brief Gr3Ctrl class */ #ifndef _GR3_CTRL_HH_ #define _GR3_CTRL_HH_ #include "Controller.hh" #include "CtrlStruct_gr3.h" /*! \brief Group 3 controller */ class Gr3Ctrl: public Controller { public: Gr3Ctrl(int robot_id, int nb_opp); ...
true
84b6cf8773954189ddc1946318f42678fc99b2dd
C++
ytazz/Scenebuilder
/src/sbcalc.cpp
UTF-8
15,896
2.8125
3
[ "MIT" ]
permissive
#include <sbcalc.h> #include <sbmessage.h> #include <sbtokenizer.h> namespace Scenebuilder{; real_t Calc::unit_length = 1.0; real_t Calc::unit_rotation = 1.0; real_t Calc::unit_mass = 1.0; real_t Calc::unit_time = 1.0; Calc::Calc(){ Reset(); } void Calc::Reset(){ terms.clear(); root =...
true
28b6b13011745e5cc330f67b432e9ee67f8e335b
C++
DustinsCode/CPP_Overload_hw
/main.cpp
UTF-8
2,048
3.390625
3
[]
no_license
/** * Class Writing & Operand Overloading HW * * @author Dustin Thurston * @date 10/8/2017 **/ #include <string> #include <vector> #include <ctime> #include <iostream> #include "Concert.h" using namespace std; int main(int argc, char** args){ vector<string> friends(2); friends[0] = "Ian"; friends[1] = "...
true
290e6b1e3e52d776434feaedd094324f4efa8044
C++
wyuzyf/BoostTest
/BoostTest/BoostTest/BoostTest.cpp
GB18030
3,855
3.375
3
[]
no_license
/* #include <boost/lexical_cast.hpp> #include <iostream> using namespace std; int main() { using boost::lexical_cast; int a = lexical_cast<int>("123"); double b = lexical_cast<double>("123.0123456789"); string s0 = lexical_cast<string>(a); string s1 = lexical_cast<string>(b); cout << "number: " << ...
true
dbf792f96302bb20c491d430ba7ca508607ed9f8
C++
Denk-Development/Airplane-Cabin-Pressure-Control
/MotorController/MotorController.ino
UTF-8
1,477
3.046875
3
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
const int pwm = 3; // PWM control for motor outputs 1 and 2 const int dir = 2; // direction control for motor outputs 1 and 2 const int motorSlowPin = 5, forwardControlPin = 7, backwardControlPin = 6; const int slowSpeed = 200, // in [0,1000] fastSpeed = 1000; // in [0, 1000] uint8_t motorSpeed = 200; // in...
true
28e7f7b923f65e715dc2d2cd5125c1e360e7f71b
C++
LARG/spl-release
/core/vision/BlobDetector.cpp
UTF-8
24,953
2.59375
3
[ "BSD-2-Clause" ]
permissive
#include "BlobDetector.h" BlobDetector::BlobDetector(DETECTOR_DECLARE_ARGS, ColorSegmenter& segmenter) : DETECTOR_INITIALIZE, color_segmenter_(segmenter) { verticalPoint = color_segmenter_.verticalPoint; verticalPointCount = color_segmenter_.verticalPointCount; horizontalPoint = color_segmenter_.horizontalPoin...
true
a7fe0a51c8534d8d2853fe74d2f711f66e1aa255
C++
ey97/CMP202-assessment
/CMP202/Deck.cpp
UTF-8
1,428
3.40625
3
[]
no_license
#include "Deck.h" Deck::Deck() { for (int j = 1; j < 5; j++) { for (int i = 1; i < 14; i++) { Card* c = new Card; c->setRank(i); c->setSuit(j); deck52.push_back(*c); delete c; } } standardDeck = true; shuffle(); changeDeckType(); } Deck::~Deck() { // delete currentDeck; } Deck::Deck(int...
true
4bd4f672afbdceef933cc23d177cfb693b07495f
C++
Pywwo/rtype
/commons/network/datagram/BinaryDatagram.hpp
UTF-8
1,559
2.75
3
[]
no_license
/* ** EPITECH PROJECT, 2018 ** rtype ** File description: ** BinaryDatagram.hpp */ /* Created the 20/11/2019 at 15:10 by jbulteau */ #ifndef RTYPE_BINARYDATAGRAM_HPP #define RTYPE_BINARYDATAGRAM_HPP #include "RtypeDatagram.hpp" /*! * @namespace rtype * @brief Main namespace for all rtype project */ namespace rty...
true
c0ca12a7256c9df9245f53ef9778fa03b4897dff
C++
iocodz/coj-solutions
/codes/raulcr-p3912-Accepted-s1134547.cpp
UTF-8
260
2.78125
3
[ "MIT" ]
permissive
#include <bits/stdc++.h> using namespace std; string A; int main() { cin >> A; for(int i = 0 ; i < A.size() ; i++) if(A[i] == 'i'){ cout << "N"; return 0; } cout << "S"; return 0; }
true
7a9fd7cccfccd46d6acba926a787c2a6ec72b66e
C++
BuiltInParris/CS172
/Homework 3/Data_Generator.cpp
UTF-8
12,097
3.265625
3
[]
no_license
//---------------------------------------------------------------------------- // // Data_Generator program // Type: Program // // This program is designed to create a class skeleton based on user input. // Author: Stevie Parris // Date: 4/19/2014 // // Modified: // //----------------------------------------...
true
a8c275962b496a577443ce96f7bbfa63ccb1bd7b
C++
lukeulrich/alignshop-qt
/defunct/SymbolColorScheme.h
UTF-8
1,902
2.734375
3
[]
no_license
/**************************************************************************** ** ** Copyright (C) 2010 Agile Genomics, LLC ** All rights reserved. ** Primary author: Luke Ulrich ** ****************************************************************************/ #ifndef SYMBOLCOLORSCHEME_H #define SYMBOLCOLORSCHEME_H #in...
true
9a17d9b531f065154e30f5416a9c5f4a453d4dc2
C++
zcphoenix2016/ZenOfDesignPatterns
/LSP/C++/Rifle.hpp
UTF-8
210
2.59375
3
[]
no_license
#pragma once #include <iostream> #include "AbstractGun.hpp" class Rifle : public AbstractGun { public: virtual void shoot() override { std::cout << "Rifle shooting ..." << std::endl; } };
true
a3d3cb40671a77164faf2e93ff71de996cdbebed
C++
Loks-/competitions
/hackerrank/practice/mathematics/fundamentals/even_odd_query.cpp
UTF-8
658
2.890625
3
[ "MIT" ]
permissive
// https://www.hackerrank.com/challenges/even-odd-query #include "common/stl/base.h" #include "common/vector/read.h" int main_even_odd_query() { int N, Q, x, y; cin >> N; vector<int> vx = nvector::Read<int>(N); vx.insert(vx.begin(), 1); cin >> Q; for (; Q; --Q) { cin >> x >> y; bool b = (x > y) ? ...
true
fafd9a42566298a89c2db8c9c860ad971cc0ba70
C++
chloekek/zeglo
/zeglor/value.hpp
UTF-8
919
2.890625
3
[]
no_license
#pragma once #include <boost/range/iterator_range.hpp> namespace zeglor { // Every value is an instance of this abstract class. The compiler generates // more subclasses of this class, so you should not blindly cause the layout // (including the vtable layout) of the base class to be changed. class va...
true
affdd72621ffcf480b9f0dd7c724701229e480de
C++
Red9/server-core
/rnctools/src/FilterExponentialMovingAverage.cpp
UTF-8
389
2.953125
3
[ "MIT" ]
permissive
#include "FilterExponentialMovingAverage.hpp" FilterExponentialMovingAverage::FilterExponentialMovingAverage(double alpha_) { alpha = alpha_; smoothed = NAN; } double FilterExponentialMovingAverage::process(double value) { if (isnan(smoothed)) { smoothed = value; } else { smoothed = al...
true
23f80ccfb9fdbe9315f10af08201929d2977dd3d
C++
jknery/projetos-gerais-cpp
/source-code-c/05_15_imprime_digitos_num.cpp
ISO-8859-1
1,267
3.984375
4
[]
no_license
/* Programa que imprime separadamente os digitos de um inteiro, da esquerda para a direita e da direita para a esquerda */ #include <stdio.h> #include <stdlib.h> void imprime_digitos_do_numero(int); void imprime_digitos_invertidos(int); int num_inv(int); int main() { int num; printf("Programa que impr...
true
334f2365760f094c3a88b689098da4e4463ed093
C++
gaurav324/Codejam
/practice/2009_qualification/alien.cc
UTF-8
1,989
3.15625
3
[]
no_license
// All the includes. #include <deque> #include <iostream> #include <regex> #include <sstream> #include <string> #include <unordered_map> #include <vector> // Commons. using namespace std; #define pb push_back #define pf push_front #define popb pop_back #define popf pop_front // Loops. #define fori(n) for(int i=0; i<n...
true
0cc32574690154b316c15f404bf97d55a3bd2bc7
C++
jxt8029/Simplex_Fall_2017
/12_MeshClass - Copy/AppClass.cpp
UTF-8
4,416
2.578125
3
[ "MIT" ]
permissive
#include "AppClass.h" void Application::InitVariables(void) { ////Change this to your name and email //m_sProgrammer = "Alberto Bobadilla - labigm@rit.edu"; ////Alberto needed this at this position for software recording. //m_pWindow->setPosition(sf::Vector2i(710, 0)); //Make MyMesh object (array) m_pMesh = new...
true
4fb746da9c18b09e9bfd65a396df3be2c3b94d47
C++
kletska/HSE-Course
/module-1/homework/Geometry/hierarchy/point.cpp
UTF-8
2,254
3.359375
3
[]
no_license
#include "point.h" #include <cmath> bool doubleEq(double a, double b) { const double eps = 1e-6; return abs(a - b) < eps; } Point::Point(double x, double y) : x(x), y(y) {} Point::Point(const Vector& v) : x(v.x), y(v.y) {} bool operator==(const Point& a, const Point& b) { return doubleEq(a.x, b.x) && doubleE...
true
1946a109c6200f668127d5d3ad54f9ed78688ce0
C++
u14e/Program-Design-and-Algorithms
/week7/assign_1/t2.cpp
UTF-8
1,180
3.65625
4
[]
no_license
/* * 分数求和: * 输入n个分数并对他们求和,用约分之后的最简形式表示 * eg. q/p = x1/y1 + x2/y2 +....+ xn/yn * 5/6已经是最简形式,3/6需要规约为1/2, 3/1需要规约成3,10/3就是最简形式 * 输入: * 第一行的输入n,代表一共有几个分数需要求和 接下来的n行是分数 * eg. 2 * 1/2 * 1/3 * 输出: 输出只有一行,即归约后的结果 * eg. 5/6 */ #include <iostream> using namespace std; in...
true
864673ef69b042069dd0927f69c9a1eaf335b42c
C++
sfindeisen/prgctst
/oi/9/1-komiwojazer-baltazar/komi.cpp
UTF-8
5,299
2.671875
3
[]
no_license
#include <iostream> #include <queue> #include <cstring> const int MaxN = 30000; const int MaxPow2 = 15; // 2^15 is enough const int MaxM = 5000; const unsigned int Pow2[1 + MaxPow2] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000}; typedef st...
true
2b39bc35b0d71b631ce623715ad0703a03468642
C++
ole-aarnseth/CPP_Oblig2_bondesjakk
/class_board.h
UTF-8
632
2.875
3
[]
no_license
// Navn: Ole Aarnseth // Studentnr: s180482 #ifndef CLASS_BOARD_H #define CLASS_BOARD_H #include <vector> #include <string> namespace gameboard{ // These are the marks used for the board typedef enum{EMPTY, X, O} t_mark; // These are used as gamestatus-indicators returned by the boardStatus-funkction typedef e...
true
9db4c7fb68d1ea7bf2d311d7639fb8c00c394be3
C++
OpenLoco/OpenLoco
/src/Core/include/OpenLoco/Core/Exception.hpp
UTF-8
2,687
2.9375
3
[ "MIT" ]
permissive
#pragma once #include <exception> #include <fmt/format.h> #include <string> #include <string_view> namespace OpenLoco::Exception { namespace Detail { // TODO: Make this consteval for C++20 constexpr std::string_view sanitizePath(std::string_view path) { #if defined(OPENLOCO_PROJECT_PAT...
true
8d995b537d8342341f41fb94a61eee3ee417ebf3
C++
rustamNSU/Final_test
/Task3.cpp
UTF-8
1,403
3.859375
4
[]
no_license
#include <iostream> #include <thread> #include <mutex> class SingletonThreadSafe{ private: static SingletonThreadSafe* singleton_; static std::mutex mutex_; int value_; SingletonThreadSafe(int value): value_(value){} public: SingletonThreadSafe(SingletonThreadSafe &other) = delete; void opera...
true
acd82812add18d31e677f538d9c9987f77c8eb41
C++
Kaktusryak/GitOOP
/OOP5/OOP5/OOP5.cpp
UTF-8
3,650
3.03125
3
[]
no_license
// OOP5.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. // #include <iostream> #include <string> using namespace std; class First//перший клас { public: string Text;//текст First(string intext)//конструктор з присвоєння значення тексту { Text = in...
true
7abbcb3c6609ebeab56098cc4cba1321d9f32f0d
C++
ZiluZhang/LeetCode-Solutions
/647.cpp
UTF-8
661
3.703125
4
[]
no_license
// Palindromic Substrings // 每一个位置当做中间位置,往两边,如果相等就++ // 注意函数参数是int &型,传参的时候还是myint class Solution { public: int countSubstrings(string s) { int res = 0; int len = s.length(); for(int i = 0; i < len; i++) { checkPalindromic(s, res, i, i, len); checkPalindromic(s, res...
true
ba0a5f060bb3595c454a99f801f6c9afa2a74b35
C++
SparksEG/LintCode
/LintCode/02_尾部的零.cpp
GB18030
1,468
3.546875
4
[]
no_license
#include <iostream> using namespace std; //#define myself // * @param n: A long integer // * @return: An integer, denote the number of trailing zeros in n! #ifdef myself long long trailingZeros(long long n) { // write your code here, try to do it without arithmetic operators. int numa, numb; numa = numb = 0; int...
true
b881e023af7e60697e7005608ef1239e280f32d5
C++
floghos/Estructura-de-Datos
/Boletines/Lab4/LinkedStack.h
UTF-8
220
2.75
3
[]
no_license
#include "StackADT.h" struct node { int data; node *next; }; class LinkedStack: public StackADT { private: int _size; node *_top; public: LinkedStack(); void push(int data); int pop(); bool isEmpty(); };
true
7cff969dcc92ff0e633237f6ade2b849cc1f3a3d
C++
ruirodriguessjr/C
/Exercicios Internet Repetição/Soma Impar de Intervalo.cpp
WINDOWS-1250
1,006
3.703125
4
[]
no_license
//35. Faca um programa que some os numeros impares contidos em um intervalo definido //pelo usu ario. O usu ario define o valor inicial do intervalo e o valor final deste intervalo //e o programa deve somar todos os numeros mpares contidos neste intervalo. Caso o //usu ario digite um intervalo inv alido (comecando por ...
true
297bdb320d922196dbeae1f31e4e5e46837286d3
C++
adisabolic/currencies_converter
/DisjunktniSkupStablo.cpp
WINDOWS-1250
4,047
3.171875
3
[]
no_license
#include "DisjunktniSkupStablo.h" #include <iostream> using namespace std; /* Dodaje novi odnos dvije valute. Provjerava da li mozda ni jedna valuta ne postoji dosad u stablima, da li samo jedna ili ako obje postoje u slucaju da su u razlicitim stablima vrsi uniju ta dva stabla tako sto zalijepi stablo manje v...
true