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
99d547af89e8c63953c3d1cbf545f8ab6a8480ce
C++
driador/dawnoftime
/src/mining.cpp
UTF-8
7,999
2.703125
3
[]
no_license
/**************************************************************************/ // mining.cpp - mine command, Kal /*************************************************************************** * The Dawn of Time v1.69s.beta6 (c)1997-2010 Kalahn * * >> A number of people have contributed to the Dawn c...
true
5819b315caa72a70cffcaeea67aac75f69369e6b
C++
Giymo11/cgue18-heikousen
/src/jojo_utils.hpp
UTF-8
1,399
2.5625
3
[]
no_license
// // Created by giymo11 on 3/11/18. // #pragma once #include <vector> #include <iostream> #include <functional> // Wrapper functions for aligned memory allocation // There is currently no standard for this in C++ that works across all platforms and vendors, so we abstract this void *alignedAlloc(size_t size, size_...
true
cc6cc89a04e2f5a75e91bf59f4997c3bb2a7001f
C++
ACES-DYPCOE/Data-Structure
/Vector/C++/Sum of Elements in Vector.cpp
UTF-8
513
3.21875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main() { int n; cout<<"Enter no. of Elements : "; cin>>n; vector<int> v; int a; cout<<"Enter the Elements : "; for(int i=0;i<n;i++) { cin>>a; v.push_back(a); } cout << "\n...
true
93f7bb8b3a3d65a4428c52fcc02021cdcb8e45c1
C++
tthheusalmeida/URI_Online_Judge
/C++/1143.cpp
UTF-8
241
2.875
3
[]
no_license
#include <iostream> #include <cmath> using namespace std; int main(){ int N; cin >> N; for ( int i = 0 ; i < 1 ; i++ ){ for ( int j = 1 ; j <= N ; j ++){ cout << j << " " << pow(j,2) << " " << pow(j,3) << endl; } } return 0; }
true
9f1841aec5229df54d74dc4a67ddab67259feb01
C++
Tansen25/Graphics-Engine
/GraphicsObject.cpp
UTF-8
7,180
2.640625
3
[]
no_license
#include "GraphicsObject.h" GraphicsObject::GraphicsObject() { this -> shaderID = FLAT; this -> blend = false; this -> colorGrowX = true; this -> colorGrowY = true; this -> colorGrowZ = true; this -> scaleGrowX = true; this -> scaleGrowY = true; this -> scaleGrowZ = true; this -> transl...
true
c90523bde81cc4b431f59b150fba553a43051660
C++
lyjeff/Object-Oriented-Programming-Class
/itsa/mm08.cpp
UTF-8
254
3.15625
3
[]
no_license
#include <iostream> #include <iomanip> #include <math.h> using namespace std; // 計算 i 次方的值 int main() { int num_1, num_2, result; cin >> num_1 >> num_2; result = pow((num_1 + num_2), 2); cout << result << endl; return 0; }
true
4e8c19ec10a208d299f17539f29caeb54bda18b1
C++
fenganli/Leetcode
/PascalTriangle.cpp
UTF-8
420
3.015625
3
[]
no_license
class Solution { public: vector<vector<int> > generate (int numRows) { vector<vector<int> > returnVec; if (numRows == 0) return returnVec; for (int i = 0; i < numRows; i++) { vector<int> vec; for (int j = 0; j <= i; j++) if (j == 0 || j == i) vec.push_back(1); else vec.push_back(r...
true
8bb327045b7d0bf56e664cd5453934c58090d4fb
C++
arnab000/Problem-Solving
/codeforces/1152/B.cpp
UTF-8
1,172
2.53125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int f(int n){ int i=1,x=0; while(n>0){ if(!(n&1)) x=i; i++; n>>=1; } return x; } int main(){ int n,i,l=0,k=0,m=0; cin>>n; vector<int>v; int p=n,sura=0,x=0; while(p>0){ if(!(p&1)) x=...
true
98f68c79a58fe2c077c6b9236f2664557dfbecd2
C++
wolfogre-archives/ProgramDesignTraining
/1935/main.cpp
UTF-8
588
2.90625
3
[]
no_license
#include<iostream> #include<vector> #include<algorithm> #include<cmath> using namespace std; int main() { int n; while (cin >> n) { vector<long> a; vector<long> b; for (int i = 0; i < n; ++i) { int num; cin >> num; a.push_back(num); b.push_back(num); } int max_value = 0; sort(b.begin(...
true
e8018b28ce66e67113c04fa7571fec480da8bf9b
C++
LITturtlee/Programming-Practice
/PAT/乙级/1038.cpp
UTF-8
475
2.671875
3
[]
no_license
#include <iostream> #include <sstream> #include <string> #include <vector> #include <unordered_map> using namespace std; int main(){ unordered_map<int,int> log; int N,K; cin >> N; for(int i=0;i<N;i++){ int grade=0; cin>>grade; log[grade]++; } cin>>K; for(int i=0;i<K...
true
708c4f354d8b769529f1d9741ab55eb0f0e145c3
C++
gstariarch/g-zipper
/include/Gzipper.hpp
UTF-8
4,874
2.640625
3
[]
no_license
#ifndef GZIPPER_H_ #define GZIPPER_H_ #include <iostream> #include <cinttypes> #include "BitStream.hpp" #include "LookbackOutputStream.hpp" // decompress namespace Gzipper { // STRUCTS /** * Extract info from gzip header */ struct gzip_header { unsigned short id; unsigned char compression_method; unsign...
true
71dcaa88addbebf32e72bb600e9af98e9d3f6c3e
C++
jared-two-foxes/foundation
/include/logger/logger.hpp
UTF-8
1,050
3.171875
3
[]
no_license
#ifndef FOUNDATION_LOGGER_HPP__ #define FOUNDATION_LOGGER_HPP__ #include <string> #include <ostream> class Logger { public: virtual ~Logger() {} virtual void write( std::string const& line ) = 0; }; class BasicLogger : public Logger { private: std::ostream& stream; public: BasicLogger(std::ostream& os); v...
true
1868304be7f014ba54cddc42727990c1f0e40463
C++
pjames6/Piranha_ColorSwirl
/Piranha_ColorSwirl.ino
UTF-8
1,087
2.875
3
[]
no_license
int redPin = 9; int greenPin = 10; int bluePin = 11; int redVal = 255; int greenVal = 1; int blueVal = 1; int i = 0; int wait = 10; int DEBUG = 0; void setup() { pinMode(redPin, INPUT); pinMode(greenPin, INPUT); pinMode(bluePin, INPUT); if (DEBUG) { Serial.begin(9600); } } void loop() { i +...
true
3615a759fdbf094e4dd48167234942efbce96c61
C++
Sygmei/11Zip
/src/elzip_fs_fallback.cpp
UTF-8
3,983
2.671875
3
[ "MIT" ]
permissive
#if defined _WIN32 #include <fileapi.h> #else #include <sys/stat.h> #include <sys/types.h> #endif #include <fstream> #include <iostream> #include <string> #include <tinydir/tinydir.h> #include <elzip.hpp> #include <unzipper.hpp> template <typename V> inline bool isInList(V term, const std::vector<V>& list1) { f...
true
455c289f6cab8e27bfdde2e6f2b15d3075a55a62
C++
pltanguay/projects
/Polytechnique Montréal/Software Engeering - unit testing and other school labs/TP5/tests/main.cpp
UTF-8
365
2.5625
3
[]
no_license
// Librairies CppUnit nécessaires #include <cppunit/ui/text/TestRunner.h> #include "Test.hpp" int main(int argc, char** argv) { // On crée un TestRunner qui va encadrer le roulement des tests, ainsi que // l'affichage des résultats de ceux-ci. CppUnit::TextUi::TestRunner runner; runner.addTest(Test::s...
true
f31454591cfc7109550a6af88d717734ffe05595
C++
manolismih/OJsolutions
/australia (orac.amt.edu.au)/janitor.cpp
UTF-8
894
2.59375
3
[]
no_license
#include <cstdio> int rows,cols,q,ans,pista[15][100005], dir[5][2]={{1,0},{0,1},{-1,0},{0,-1},{0,0}}; bool check(int r, int c) { for (int i=0; i<4; i++) if (pista[r+dir[i][0]][c+dir[i][1]] > pista[r][c]) return false; return true; } int main() { freopen("janitorin.txt","r",stdin); freopen("janito...
true
c7143251178bb730483d8b141ad57d7a88141f77
C++
jpvanoosten/LearningDirectX12
/DX12Lib/inc/dx12lib/DescriptorAllocation.h
UTF-8
3,351
2.671875
3
[ "MIT" ]
permissive
#pragma once /* * Copyright(c) 2018 Jeremiah van Oosten * * 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, cop...
true
2a33053d75039c43a1b656299f1a0a9239bc2458
C++
mdasifchand/DE
/src/birdsEye.cpp
UTF-8
9,711
2.515625
3
[]
no_license
// // Created by asif on 16.09.19. // #include "birdsEye.h" cv::Mat birdsEye::birdsEyeFunction(cv::Mat plotted_image) { int alpha_ = 20, beta_ = 90, gamma_ = 90; int f_x = m_camera_fx, dist_ = 500; int f_y = m_camera_fy; // cv::namedWindow("BirdsEye", 1); // cv::createTrackbar("Alpha", "BirdsEye", &al...
true
01e1371c0ec683031ab98f90bd4f8865fa87a775
C++
IgorFroehner/grafo_oo
/Node.cpp
UTF-8
968
3.359375
3
[]
no_license
#include "Node.hpp" #include "Edge.hpp" #include <iostream> unsigned int Node::proxId{0}; Node::Node(){ id = proxId++; } unsigned int Node::getId(){ return id; } void Node::addEdge(Edge* e){ edges.push_back(e); } const std::list<Edge*>& Node::getEdges(){ return edges; } void Node::removerEdge(Node...
true
3e557c3f16233547fc66ca9a1c5ffca9cd258694
C++
sugyan/atcoder
/abc148/c/main.cpp
UTF-8
214
2.84375
3
[]
no_license
#include <iostream> using namespace std; int gcd(long long a, long long b) { return a == 0 ? b : gcd(b % a, a); } int main() { long long a, b; cin >> a >> b; cout << a / gcd(a, b) * b << endl; }
true
ab096c6e90a8c6a2ae59e386a4f13e705ef1cf51
C++
awellock/SchoolFall2012
/os/SecondProject/pManger.cpp
UTF-8
10,300
2.6875
3
[]
no_license
#include <cstdio> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <cstdlib> #include <iostream> #include <fstream> #include <vector> #include <math.h> #include "QueueArray.cpp" using namespace std; struct com { char type; char cmd; int pid; int value; int Time; int rid; }; struct pcb{...
true
0c37c4bb23245a7994ada4d12ef458e9b72a4745
C++
uHappyLogic/testEngine
/src/Game.cpp
UTF-8
22,444
2.578125
3
[]
no_license
/* * Game.cpp * * Created on: Jan 18, 2014 * Author: lucas */ #include "Game.h" #include "misc/Colors.h" #include "misc/materials.h" #include "misc/pugi/pugixml.hpp" map_UID_pGameState Game::gameStates; MessagesHandler* Game::messagesHandler; GameState* Game::actualGameState; Timer* Game::gameMainTimer ;...
true
33f16768e0a5abe0e375f96a7aac4f38b0b715e6
C++
gradido/gradido_login_server
/src/cpp/JSONInterface/JsonUpdateUserInfos.cpp
UTF-8
3,984
2.96875
3
[]
no_license
#include "JsonUpdateUserInfos.h" #include "../SingletonManager/SessionManager.h" #include "../SingletonManager/LanguageManager.h" Poco::JSON::Object* JsonUpdateUserInfos::handle(Poco::Dynamic::Var params) { /* 'session_id' => $session_id, 'email' => $email, 'update' => ['User.first_name' => 'first_name', 'User.la...
true
65347d2dae59d850b5250c22e0053dc8c14893d5
C++
3DTK/3DTK
/include/slam6d/bkdIndexed.h
UTF-8
3,506
2.875
3
[]
no_license
/** @file * @brief Representation of an optimized Bkd tree. * * A Bkd-tree is like a kd-tree, but preserves balance and space * utilization when inserting new or removing old points. * It is therefore dynamicaly updated by handling multiple, * logarithmic ordered kd-trees. * * See: * Procopiuc, O., Agar...
true
15935e82d4d205f2b9d2e4df0a6feaae35efb55f
C++
lee-m/UniProject
/feasibility tests/lexers/HandLexer/src/CLexicalScanner.cpp
UTF-8
10,786
3.015625
3
[]
no_license
//------------------------------------------------------------------------------------------ // File: CLexicalScanner.cpp // Desc: Implementation of the hand written scanner // Auth: Lee Millward //------------------------------------------------------------------------------------------ //our headers #include "CLexic...
true
ae9d589a0dbae3aeb4d7b25241ff71aae01d3d0f
C++
orsoromeo/contactWrenchSet
/tests/provaIpopt/src/OptimizationProblem.cpp
UTF-8
3,034
2.59375
3
[]
no_license
#include <OptimizationProblem.h> OptimizationProblem::OptimizationProblem() {} OptimizationProblem::~OptimizationProblem() {} void OptimizationProblem::init(bool soft_constraint) { // Getting the dimension of the decision vector // state_dimension_ = 4; // constraint_dimension_ = 2; ...
true
d9fc71ac1b3660813cad87082780e51f84a7f5f1
C++
lnfernal/buildoland-3
/common-source/Grounds/GameGrounds.cpp
UTF-8
2,420
2.953125
3
[]
no_license
#include "GameGrounds.h" #include <limits> #include "Ground.h" #include "StaticGround.h" #include "GameGrounds/GroundError.h" #include "GameGrounds/GroundDirt.h" #include "GameGrounds/GroundStone.h" #include "GameGrounds/GroundSand.h" #include "GameGrounds/GroundGrass.h" #include "GameGrounds/GroundWater.h" #include...
true
d6596df71f6a2ca31e3f3ddef15a43998a9f7482
C++
stfuchs/university
/ML-class/MLUtils/include/MLUtils/features.h
UTF-8
2,393
2.78125
3
[]
no_license
#include <Eigen/Dense> namespace MLUtils { typedef Eigen::MatrixXd Mat; typedef Eigen::VectorXd Vec; typedef Eigen::RowVectorXd RowVec; /* 0: 1, x0, x1, x2, x3; 5: x0x0, x0x1, x0x2, x0x3; 9: x1x1, x1x2, x1x3; 12: x2x2, x2x3; 14: x3...
true
abddedb33e9b70d8952b4015411057fe538b64c4
C++
noonelikechu/shearlet
/reconstruction/gadgetron/CS_LAB_Gadget/src/LAP_GADGET/LAPRegistrationGadget.cpp
UTF-8
7,355
2.53125
3
[ "BSD-2-Clause" ]
permissive
/* file name : LAPRegistrationGadget.cpp author : Thomas Kuestner (thomas.kuestner@med.uni-tuebingen.de) version : 1.0 date : 15.01.2018 description : implementation of the class LAPRegistrationGadget - only 4D data (x,y,z,t) provided */ #include "LAPRegistrationGadget.h" #include "SomeFunctions.h" using nam...
true
a446f35d11634a8258362a3f3f10c9ec8da337c7
C++
minhtriet/frozenlake
/Board.h
UTF-8
869
2.734375
3
[]
no_license
#include <vector> #include <map> #include <queue> #include "Point.cpp" class Board { private: bool is_inside(const Point& location); std::queue<Point> schedule; public: std::vector<std::vector<float>> best_value; std::vector<std::vector<Point>> best_policy; int width; ...
true
9566a759c60438c0dee176761e9dda512abd19ef
C++
eldritchabstraction/simulation
/Tanker.h
UTF-8
2,600
3.40625
3
[]
no_license
/* A Tanker is a ship with a large corgo capacity for fuel. It can be told an Island to load fuel at, and an Island to unload at. Once it is sent to the loading destination, it will start shuttling between the loading and unloading destination. At the loading destination, it will first refuel then wait until its carg...
true
722b07708f4d656331b514c81183512ef3eb1382
C++
ompugao/opengl_examples
/phony_starfox/branches/murooka/object.h
UTF-8
575
2.890625
3
[]
no_license
#ifndef __OBJECT_H__ #define __OBJECT_H__ #include "vector.h" #include <cmath> extern const double RADIAN; class Object { protected: VECTOR position; VECTOR direction; VECTOR up; VECTOR v; double h_angle; double v_angle; double h_omega; double v_omega; double r; virtual void move() = 0; void set_position(...
true
dec07a4d362a7683856e521a9fb75801effff1c7
C++
zhongpuwu/DataStructA
/Stop.cpp
UTF-8
4,022
3.25
3
[]
no_license
//============================================== // 停车场问题 //---------------------------------------------- // 作者:武重甫 // 学号:17032430 // 修订:2017年10月 //============================================== #include <iostream> using namespace std; #include "Move.h" bool Jump(int &t) { cout << "请输入您要跳转的时间:"; cin >> t; ...
true
0380698afe0f0a7100a78d3dba7706842b6e2133
C++
helcl42/mi-gen
/MI-GEN/strom.cpp
UTF-8
22,299
2.859375
3
[]
no_license
/* strom.cpp */ #include "strom.h" #include "gener.h" #include "util.h" #define DEBUG_OPT extern FILE* debugPrint; // konstruktory a destruktory Var::Var(int a, bool rv) { addr = a; rvalue = rv; } Numb::Numb(int v) { value = v; } int Var::getAddr() const { return addr; } bool Var::isRValue() cons...
true
617820258da44367a2786def98aefb38b611d1b1
C++
Leodicap99/leetcode
/Array/1423. Maximum Points You Can Obtain from Cards.cpp
UTF-8
618
2.859375
3
[]
no_license
Source:- https://leetcode.com/problems/maximum-points-you-can-obtain-from-cards/discuss/597883/Javascript-and-C%2B%2B-solutions int maxScore(vector<int>& cardPoints, int k) { int n=cardPoints.size(); int sum=0,ans=0; deque<int> dq; for(int i=n-k;i<n;i++) { ...
true
67330d77b06b361c6cb4f98739b668ad21ae1da5
C++
engineerkatie/geohashing
/sql/src/cpp/SqliteQuery.cpp
UTF-8
1,598
2.625
3
[]
no_license
#include "SqliteDb.hpp" #include "SqliteResults.hpp" #include "SqliteQuery.hpp" #include <iostream> using std::cout; using std::cerr; using std::endl; void SqliteQuery::nuke(void) { if (q) { sqlite3_finalize(q); //std::cerr << "Finalize Query " << q << std::endl; } } SqliteQuery::SqliteQuery(...
true
5ac16f68e5a94c64af5e56bcb539dc9ce1f22e22
C++
Terune/Cooktalk_system_server
/stack.h
UTF-8
1,899
3.9375
4
[]
no_license
#pragma once #include <cstddef> template <typename Object> class Stack { protected: // 리스트의 노드 // struct Node { Object obj; Node* next; }; typedef Node* NodePtr; public: Stack(); virtual ~Stack(); void push(const Object& o); void pop(); Object& top(); ...
true
23f95140bb223924a446be2378734b65774c868e
C++
osmpradeep/wifitimerwithrtc
/timer_auto_priority_mode_esp8285_update_20_7_19/Rtc_custom.ino
UTF-8
1,581
2.703125
3
[]
no_license
void read_rtc_Time_date() { // Reset the register pointer Wire.beginTransmission(rtc); Wire.write(0x10); Wire.endTransmission(); Wire.requestFrom(rtc, 7); // A few of these need masks because certain bits are control bits rtc_second = bcdToDec(Wire.read()); rtc_minute = bcdToDec(Wi...
true
c63052dfdbaa614246cba58b461ef0aa8f4bc04c
C++
ronee12/Code-Library
/My_code/Online judge solutions/Codeforces/102.2A.cpp
UTF-8
626
2.53125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int main() { int r1,r2,c1,c2,d1,d2; int a,b,c,d; cin>>r1>>r2>>c1>>c2>>d1>>d2; set<int>l; a=(r1-d2+c1)/2; if(a>0&&a<10) l.insert(a); b=(r1+d2-c1)/2; if(b>0&&b<10) l.insert(b); c=(d2-r1+c1)/2; if(c>0&&c<10) l.inse...
true
ff5930b6020e7bb166116e1b8b18763c281cdad1
C++
IzYoBoiJay/ASCII-Space-Shooter
/include/Enemy.h
UTF-8
907
3.09375
3
[]
no_license
/* * Author: Jhun-Thomas Calahatian * Program Description / Purpose: Enemy.h header file for the ASCII space shooter that handles the enemy objects and enemy-related chance events. */ #ifndef ENEMY_H #define ENEMY_H #include "Entity.h" #include "Item.h" class Enemy: public Entity { private: //Enemy bullet p...
true
90b485912450523ae5f6cfef1e82b6d2e909336c
C++
computerphilosopher/dfa
/CompilerHomework/main.cpp
UTF-8
8,750
3.171875
3
[]
no_license
#include <iostream> #include <fstream> #include <vector> #include <string> #include <cstring> #include "table_driven.h" using namespace std; /* 파일을 문자열의 벡터로 바꾸어주는 클래스*/ class Tokenizer { private: vector <string> tokens; string filePath; public: Tokenizer(string filePath) { this->filePath = filePath; } ...
true
302092d341851debe7c9641102f33abcb578cd77
C++
JustinYuu/PAT-Basic
/1091.cpp
UTF-8
468
2.765625
3
[]
no_license
#include <iostream> #include <cstdio> using namespace std; int main() { int m,k; int n,res; cin>>m; for(int i=0;i<m;++i) { cin>>k; for(n=1;n<10;++n) { res=k*k*n; if(res%10==k||res%100==k||res%1000==k) { cou...
true
b2ce2c43472c7141206d5636c55f1a68a20102e8
C++
GabeOchieng/ggnn.tensorflow
/program_data/PKU_raw/23/165.c
UTF-8
303
2.765625
3
[]
no_license
void main() { char a[100][10]={'\0'},c; int i,j; i=0;j=0; c='A'; while(c!='\n') { scanf("%c",&c); if(c!=' '&&c!='\n') { a[i][j]=c; j=j+1; } else if(c==' ') { i=i+1; j=0; } } for(j=i;j>0;j=j-1) { printf("%s ",a[j]); } printf("%s",a[0]); }
true
7f84511133950f417aecce893562b9d2e3ad3de7
C++
NaomyTiaraDewi/sorting
/sorting.cpp
UTF-8
647
2.859375
3
[]
no_license
/* 1717051007-Oktaviana 1717051021-Brenda Natalia 1717051033-Cahyani Ramadhani 1717051045-Naomy Tiara Dewi Link : https://github.com/oktaviana1007/sorting/edit/master/sorting.cpp */ #include <iostream> using namespace std; void selection(int a[],int x){ for(int i=0;i<x;i++){ for(int j=i+1;j<x;j++){ ...
true
51a7bf213a63c9387d1c250eb1832733180311e3
C++
Junhyung-Choi/CPP_TRAINING
/Chapter01/3/Question1_3_2.cpp
UTF-8
375
2.59375
3
[]
no_license
#include <iostream> int SimpleFunc(int a = 10) { return a + 1; } int SimpleFunc(void) { return 10; } // Compileation is performed because the condition of function overloading is statisfied. // However if a fucntion is called without passing an argument as follows, // a compile error occurs whenever both fun...
true
d6a4bf1848f63b509247540125bb98a851d8ad1f
C++
yoannfleurydev/univ2016-2017
/cplusplus/tp/tp3/Hiring.h
UTF-8
321
2.828125
3
[]
no_license
#ifndef TP3_HIRING_H #define TP3_HIRING_H #include "Employee.h" class Hiring : public Employee { public: inline Hiring(int idNumber = 0, const char * ch = "") : Employee(ch), idNumber(idNumber) {} void put_ident(int i); virtual void print() override; private: int idNumber; }; #endif //TP3_HIRING_H...
true
60dfb947eea36b7a86cf69c4d5ac924d497a3f92
C++
WhiteCatFly/Student-Code-RUC
/The third Homework/何宗炎-2017201974/HashValueSet.h
UTF-8
411
2.578125
3
[]
no_license
#ifndef HashValueSet_Hzy_H_ #define HashValueSet_Hzy_H_ #include "Hzydef.h" #include <bits/stdc++.h> class HashValueSet { private: LL Value1, Value2 ; public: HashValueSet(LL v1, LL v2) : Value1(v1), Value2(v2) {} ~HashValueSet() {} bool operator < (const HashValueSet p) const { if(Value1 == ...
true
c5ac614967d990688edf9e70221e8a6c89816cd4
C++
zhangshy/opencvStepByStep
/src/testMethod.cpp
UTF-8
22,778
2.65625
3
[]
no_license
#include <iostream> #include "testMethod.h" #include "mathTest.h" #include "histRedistribute.h" using namespace std; namespace zsyTestMethod { string getTestMethodVersion() { return "libtestMethod.so version0.2"; } /** 一般按加权的方法转换,R , G ,B 的比一般为3:6:1将图片转化为灰度图片 */ Mat changRGB2Gray(const Mat src) { //取得像素点的行...
true
e686f6c203783398edd3f10ac23c7616431680bd
C++
Jaybro/pico_tree
/examples/pico_understory/pico_understory/cover_tree.hpp
UTF-8
8,068
2.5625
3
[ "MIT" ]
permissive
#pragma once #include <pico_tree/internal/point_wrapper.hpp> #include <pico_tree/internal/search_visitor.hpp> #include <pico_tree/internal/space_wrapper.hpp> // Use this define to enable a simplified version of the nearest ancestor tree // or disable it to use the regular one from "Faster Cover Trees". // // Testing ...
true
42757299732c0310a19c1586cac14306fad682db
C++
drew-gross/Google-AI-contest
/NoPlanetsOwnedByPlayerException.h
UTF-8
392
2.53125
3
[]
no_license
#ifndef NO_PLANETS_OWNED_BY_PLAYER #define NO_PLANETS_OWNED_BY_PLAYER #include <stdexcept> #include "Planet.h" class NoPlanetsOwnedByPlayerException : public std::runtime_error { public: NoPlanetsOwnedByPlayerException(Player newPlayer); ~NoPlanetsOwnedByPlayerException() throw(); Player GetPlayer();...
true
606e92936c01a4b6a6810fb666ba9b01697eb4d7
C++
TomaszP17/SPOJ
/SM_01_00 - Szyfr.cpp
UTF-8
565
2.671875
3
[]
no_license
#include <iostream> #include <cmath> using namespace std; int main() { int i, l, testy; char wyraz; cin >> testy; cin.get(wyraz); while (testy--) { i = 4; l = 0; while (cin.get(wyraz)) { if (wyraz == '\n') break; if (i == -1) ...
true
4b781a5da0b099ff85cee2df700a3c1a36b32081
C++
jinyoung0612/Algorithm
/BOJ/brute-force/2503.cpp
UTF-8
1,544
2.625
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> #include <cstring> using namespace std; #define MAX 1001 int N; bool check[10]; int result[4]; int answer=0; vector< pair<string, pair<int, int> > > v; int Strike(string a, string b){ int cnt=0; for(int i=0; i<3; i++){ if(a[i]==b[i]){ ...
true
edf6960b1d8c32aa4823cc4b34dabb56295282e1
C++
BadgerTechnologies/octomap_mapping
/octomap_server/src/SensorUpdateKeyMapHashImpl.cpp
UTF-8
11,411
2.578125
3
[]
no_license
#include <octomap_server/SensorUpdateKeyMapHashImpl.h> #include <cstring> namespace octomap_server { SensorUpdateKeyMapHashImpl::SensorUpdateKeyMapHashImpl(size_t initial_capacity, double max_load_factor) : max_load_factor_(max_load_factor) { initializeNodeCache(initial_capacity); calculateTableCapacity(); ta...
true
bdcc249960b9d4587ca3c093320d7ebeaa0f50ac
C++
dashjay/learn_cpp
/chapter7/7.14_ellipsis_arguments.cpp
UTF-8
776
3.46875
3
[]
no_license
#include <cstdarg> #include <iostream> // should never use ellipsis // ..... never double findAverage(int count, ...) { double sum = 0; va_list list; va_start(list, count); for (int arg = 0; arg < count; ++arg) { sum += va_arg(list, int); } va_end(list); return sum / count; } do...
true
8341c4b9eda4736720395bd6f0fba91b21aa7103
C++
gabrielnascimentost/trabalhoGrafos2020.3
/Edge.cpp
UTF-8
1,856
3.5
4
[]
no_license
#include "Edge.h" #include <iostream> using namespace std; /************************************************************************************************** * Defining the Edge's methods (definindo metodos das arestas) ************************************************************************************************...
true
2d1fe6055143a29e4b514168c51e8ad387e5666a
C++
Leyla475/3
/Source.cpp
UTF-8
5,430
3.578125
4
[]
no_license
#include <iostream> #include <algorithm> #include <vector> #include <iterator> #include <chrono> #include <random> class IntSequence { private: int value; public: IntSequence(int initialValue) : value(initialValue) {} int operator() () { return value++; } }; template <typename...
true
73ebac687567e0424f524a35a93959193d7cc2ab
C++
lamb-j/intro-graphics
/project1/project1B/project1B.cxx
UTF-8
5,001
3.171875
3
[]
no_license
#include <iostream> #include <vtkDataSet.h> #include <vtkImageData.h> #include <vtkPNGWriter.h> #include <vtkPointData.h> using std::cerr; using std::endl; double ceil441(double f) { return ceil(f-0.00001); } double floor441(double f) { return floor(f+0.00001); } vtkImageData *NewImage(int width, int height) { ...
true
d8124574032b60e597eb14dfabfcae0c13e234f7
C++
josephjaspers/OldProjects
/cpp/UNMAINTAINED-Matrix-Vector-Library3.0-CPP/Matrix/Matrix.h
UTF-8
1,950
3.03125
3
[]
no_license
#ifndef Matrix_h #define Matrix_h #include <iostream> #include <vector> #include <fstream> #include <ostream> using namespace std; class Matrix { int l; int w = 1; int n; double** theMatrix; bool initialized = true; public: //Constructors Matrix(); Matrix(unsigned int length, unsigned int width); Matrix(co...
true
8a5a4fc38c9ed9bc6a72f95109ca54f28b380c23
C++
lyandut/MyTravelingPurchaser
/MyTravelingPurchaser/TPPLIBInstance/TPPLIBInstance.h
GB18030
1,767
2.546875
3
[]
no_license
#pragma once #include <string> #include <algorithm> #include <fstream> #include <sstream> #include <functional> #include <cctype> #include <cmath> #include "../Main/TPPCommon.h" class TPPLIBInstance { public: std::string name; std::string comment; std::string instance_type; std::string edge_weight_type; std::st...
true
94c66069b3bbb1cb985157e01100f00ca0e0d392
C++
batinkov/emtf_cell
/cactusprojects/emtf/hal_pciexpr/busAdapter/pciexpr/src/common/PCIExprLinuxBusAdapter.cc
UTF-8
12,981
2.578125
3
[]
no_license
#include "hal/PCIExprLinuxBusAdapter.hh" #include <sstream> #include <iomanip> HAL::PCIExprLinuxBusAdapter::PCIExprLinuxBusAdapter() throw (HAL::BusAdapterException) try : PCIBusAdapterInterface(), pciBus_(){} catch ( xpci::exception::IOError &e ) { std::string err = std::string( e.what() ); thr...
true
d07855189437b32fdae6fe49ebdc83429d2ee45f
C++
ITShadow/practiceCode
/topic/LeetCode/0692topKFrequent.cpp
UTF-8
1,614
3.265625
3
[]
no_license
/* 给一非空的单词列表,返回前 k 个出现次数最多的单词。 返回的答案应该按单词出现频率由高到低排序。如果不同的单词有相同出现频率,按字母顺序排序。 示例 1: 输入: ["i", "love", "leetcode", "i", "love", "coding"], k = 2 输出: ["i", "love"] 解析: "i" 和 "love" 为出现次数最多的两个单词,均为2次。 注意,按字母顺序 "i" 在 "love" 之前。   示例 2: 输入: ["the", "day", "is", "sunny", "the", "the", "the", "sunny", "is", "is"], k = ...
true
f27b0009db9eba7b4114fc6072ff7ecf525bd1f3
C++
bessszilard/Udemy-Learn-Advanced-Cpp-Programming
/src/L47_Initializer_Lists.cpp
UTF-8
544
3.65625
4
[ "MIT" ]
permissive
//L47_Initializer_Lists.cpp #include <iostream> #include <vector> #include <initializer_list> using namespace std; class Test { public: Test(initializer_list<string> texts) { for(auto value : texts) { cout << value << endl; } } void print(initializer_list<string> texts) { ...
true
82f5982252a955929650c66c1d830b77f8ecef88
C++
ibokuri/libvmm
/tests/kvm/vm.cpp
UTF-8
13,678
2.546875
3
[ "MIT" ]
permissive
#define CATCH_CONFIG_MAIN #include <catch2/catch.hpp> #include "vmm/kvm/kvm.hpp" TEST_CASE("VM creation") { REQUIRE_NOTHROW(vmm::kvm::System{}.vm()); } TEST_CASE("vCPU creation") { auto kvm = vmm::kvm::System{}; auto vm = kvm.vm(); const auto kvm_max_vcpus = kvm.check_extension(KVM_CAP_MAX_VCPUS); ...
true
49dad42b05322ac2e1aaa433ff9f594e78dc3ba9
C++
yi-juchung/lanarts
/src/objects/GameInst.h
UTF-8
2,762
2.734375
3
[]
no_license
/* *GameInst.h: * Base object of the game object inheritance heirarchy * Life cycle of GameInst initialization: * ->Constructor * ->GameState::add_instance(obj) called * ->GameInstSet::add_instance(obj) called from GameState::add_instance, sets id * ->GameInst::init(GameState) called from GameState::a...
true
96d744daa986221c4c173e8189898e1e5d7571b0
C++
SiChiTong/sclagv
/odom_tutorial/src/odom_pose.cpp
UTF-8
2,787
2.59375
3
[]
no_license
#include <ros/ros.h> #include <geometry_msgs/PoseStamped.h> #include <nav_msgs/Odometry.h> #include <tf/transform_broadcaster.h> #include "tf2/LinearMath/Quaternion.h" #include "tf2/LinearMath/Matrix3x3.h" #include <string> #define RAD2DEG 57.295779513 /** * This tutorial demonstrates receiving ZED odom and pose me...
true
44c3b9f4061de99df6cc9c50e68e3d2408357eb9
C++
darksworm/hksel
/src/config/ConfigBuilder.h
UTF-8
318
2.609375
3
[ "MIT" ]
permissive
#pragma once #include "Config.h" class ConfigBuilder { private: Config* config; public: ConfigBuilder() { config = new Config(); } ConfigBuilder& setIsDebug(bool isDebug) { config->isDebug = isDebug; return *this; } Config* build() { return config; } };
true
ea1821128df972441f62aaa98f702bdd72ed398f
C++
walkccc/LeetCode
/solutions/1631. Path With Minimum Effort/1631.cpp
UTF-8
1,316
2.984375
3
[ "MIT" ]
permissive
struct T { int i; int j; int d; T(int i, int j, int d) : i(i), j(j), d(d) {} }; class Solution { public: int minimumEffortPath(vector<vector<int>>& heights) { const int m = heights.size(); const int n = heights[0].size(); const vector<int> dirs{0, 1, 0, -1, 0}; auto compare = [](const T& a, ...
true
4419fa498e02667aa3f995e4c50ca433938ce139
C++
abhiramrp/LoShuSquare
/Player.h
UTF-8
2,561
3.109375
3
[]
no_license
/****************************************************************** CIS 22B Lab6: Header File - This class initiaties the base Lo Shu game. Author: Abhiram Rishi Prattipati Date: March 22, 2019 *******************************************************************/ #ifndef PLAYER_H_INCLUDED #def...
true
fc68244b8e3c66d58cc0101ba0cd5b7b95ebccea
C++
ng29/My-Codes
/stl-containers/stack.cpp
UTF-8
1,092
4.40625
4
[]
no_license
/* Stack is very specific container, it allows to store multiple values But only one that is on top is accessible (via std::stack.top() function) You can of course pop value from the top of the stack */ #include <stack> #include <iostream> template <typename T> void prints(std::stack<T> s) { // We have to copy ou...
true
0bf92d1272d8840b16c8aa89c7fa8751ab28530e
C++
MazenAli/HTFI
/htucker/oldtools/indexmapper.h
UTF-8
704
2.609375
3
[]
no_license
#ifndef LAWA_HTUCKER_TENSOR_H #define LAWA_HTUCKER_TENSOR_H 1 //wrapps a discrete function into a tensor, i.e. #include <fima/HTucker/dimensionindex.h> template <typename T> class tensor{ public: typedef T (*funpoint)(DimensionIndex); funpoint f; int dimension; DimensionIndex minval,maxval; ...
true
d4e327b906b2d568ec573b010ac3cae60a63eaa8
C++
GJnghost/ACM-Template-by-forever97
/Graph-Theory/Steine-Tree.cpp
UTF-8
13,865
2.8125
3
[]
no_license
// 斯坦纳树:只用包含关键点的最小生成树 /* * Problem: 给出一张图,要求i属于1~d号点与n-i+1号点对应连通,求最小边权和 * Solution: f[i][msk]表示i为根,关键点连通状态为msk时候的最小代价 * Ans[msk]表示连通态为msk时最小代价,如果对应点同时连通或不连通则可以更新 */ // Demo1 #include <bits/stdc++.h> using namespace std; const int N = 10005; const int MOD = 1e9 + 7; int n, m, d, x, y, z; int nxt[N << 1], g[N], v[N <...
true
9a819aac1ca05e2b10aaaa64321a52ce71f19d99
C++
likstepan/source
/mediatek/source/frameworks/libs/a3m/engine/facility/api/a3m/colour.h
UTF-8
4,121
3.015625
3
[]
no_license
/***************************************************************************** * * Copyright (c) 2010 MediaTek Inc. All Rights Reserved. * -------------------- * This software is protected by copyright and the information contained * herein is confidential. The software may not be copied and the information * con...
true
805c84106f1b5987203345c248abbfb6db7c89ab
C++
ganeshredcobra/CPP
/Array_Pointer/std_Vector/vector_bools/main.cpp
UTF-8
267
3.5
4
[]
no_license
#include <vector> #include <iostream> int main() { std::vector<bool> array { true, false, false, true, true }; std::cout << "The size is: " << array.size() << '\n'; for (auto const &element: array) std::cout << element << ' '; return 0; };
true
b65df3d5c18f3dea6d39b800463f8755e5b18f00
C++
itsprathvi/3rd_sem_B_E
/oops/pointer1.cpp
UTF-8
644
4.03125
4
[]
no_license
//Program to demonstrate the function that returns this pointer. #include<iostream> #include<string.h> using namespace std; class person{ char name[20]; float age; public: person(char *s,float a) { strcpy(name,s); age=a; } person greater(person x) { if(x.age>=age) return x; else retur...
true
d95188cc9e9f34d0bfa64bbdf180d71f98946921
C++
AlvesCPP/000.CPP_Intro
/CPP_Intro/main.cpp
UTF-8
565
3.109375
3
[]
no_license
#include <iostream> #include <stdlib.h> #include <string> int main() { int nInteger = 0; double dblDouble = 0.0f; char cChar = 'a'; bool blnBoolean = 1; std::string strString = "Bob"; //Output std::cout << "Hellow world!" << std::endl; //Input std::cin >> nInteger; //Output std::cout << "Valeur de l'en...
true
4f9bd2203388d2109ea0f7b88b70d00346fe17a2
C++
maximilianop/prog08_mpp647
/directory.h
UTF-8
2,658
3.671875
4
[]
no_license
// // Created by paxm on 4/24/19. // #ifndef PROJECT_8_DIRECTORY_H #define PROJECT_8_DIRECTORY_H #include <string> #include <vector> #include <stdio.h> #include <stdlib.h> #include <queue> // I decided to set it up by using 1 class called directory which holds all the information about all the files in that director...
true
093b91f8bd0e59690e21a7c296b50d4d9eca9986
C++
bubleegames/Project2_Zelda
/Motor2D/ShopManager.h
UTF-8
1,609
2.578125
3
[]
no_license
#ifndef _SHOPMANAGER_H_ #define _SHOPMANAGER_H_ #include <vector> #include "Item.h" class UI_Image; class UI_Text; class UI_Window; class Player; class Animator; struct item_info { Item* item = nullptr; UI_Image* item_image = nullptr; }; struct shop { UI_Image* background = nullptr; vector<item_info> items;...
true
52f4601e6fcab24ba9bff30e3c8fc8805ea7e688
C++
logicalclick/web
/cpp/2014/diana/game_file.cpp
UTF-8
734
2.75
3
[ "MIT" ]
permissive
#include <iostream> #include <stdlib.h> #include <time.h> using namespace std; int main() { int x; int n; int cnt; srand (time(NULL)); x = 1 + rand()%100; cout<<"Poznai chisloto"<<endl<<endl; cnt=0; while(cnt<5) { cout<<"Dai svoeto predlojenie:"; cin >> n; if(n > x) ...
true
114823f0230705cf53ef3b18fc1171bc59cd058b
C++
xryuseix/SA-Plag
/test/training_data/plag_original_codes/07_064_plag.cpp
UTF-8
778
2.6875
3
[ "MIT" ]
permissive
// 引用元 : https://atcoder.jp/contests/abc130/submissions/5962060 // 得点 : 300 // コード長 : 304 // 実行時間 : 1 #include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; typedef long long ll; // vector vの中のn以下の数で最大のものを返す int bs(vector<ll> &v, ll x){ int ok = -1; //これがx以下 int ng = v.s...
true
e3c885ec8864feb5f1361bc35493ec8ced6bc75a
C++
ForeverDavid/postwimp
/extlibs/headers/PolyVoxCore/PolyVoxCore/PagedVolume.h
UTF-8
18,890
2.703125
3
[]
no_license
/******************************************************************************* Copyright (c) 2005-2009 David Williams This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted t...
true
f19bf57d7fa3fde7096f42a1371ebc7b81b008db
C++
gulraeezgulshan/arduino-workshop
/project29_writing_data_to_memory_card/writing_data_to_memory_card/writing_data_to_memory_card.ino
UTF-8
973
3.34375
3
[]
no_license
// Project 29 - Writing Data to the Memory Card int b = 0; #include <SD.h> void setup() { Serial.begin(9600); Serial.print("Initializing SD card..."); pinMode(10, OUTPUT); // check that the microSD card exists and is usable if (!SD.begin(8)) { Serial.println("Card failed, or not present"); // stop s...
true
142957b0e003763ee05a0ec4267c61b24d29393f
C++
Dwijesh522/AI_assn_5
/The_Cannon/assn5_ml/minimax_ids.cpp
UTF-8
6,747
3.171875
3
[ "MIT" ]
permissive
#include <iostream> #include "classes.h" #include<cmath> #include "functions.h" #include <algorithm> #include <exception> using namespace std; // assumption - board result(board& s, const int soldier_r, const int soldier_c, const int target_r, const int target_c, action_type action_t, action_by whose_action) // ...
true
6322bb824744a58433d15129ade10792b39c121b
C++
shenfy/imgpp
/src/include/imgpp/glhelper.hpp
UTF-8
1,396
2.703125
3
[ "MIT" ]
permissive
#ifndef IMGPP_GLHELPER_HPP #define IMGPP_GLHELPER_HPP /*! \file glhelper.hpp */ #include <imgpp/texturedesc.hpp> namespace imgpp { namespace gl { /*! \enum Profile \brief Specifies gl context version */ enum Profile: uint8_t { ES20, // no sRGB ES30, // has swizzle GL32, GL33, // has swizzle }; /*! \stru...
true
d077b754e110aa1a169c31a288e073a73d03e945
C++
caitouwww/probable-octo-doodle
/leetcode top 100/002两数相加.cpp
UTF-8
1,606
3.203125
3
[]
no_license
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* addTwoNumbe...
true
37fea33ae77f21e5dc4c25855b9289debcd20d05
C++
jventura10/Ventura_Javier_CSC5_Summer2017
/Hmwk/Assignment_1/Gaddis_8thEd_Chap2_Prog_Prob15_TrianglePattern/main.cpp
UTF-8
877
3.5625
4
[]
no_license
/* * File: main.cpp * Author: Javier Ventura * Purpose: Using the character selected, program will make a triangle shape * Created on June 23, 2017, 9:29 PM */ //Include Libraries Here #include <iostream> using namespace std; int main(int argc, char** argv) { //Declare all Variables Here char key; ...
true
51253bd052c472cad43d22a80dfac94d3fac107c
C++
bstelly/IntroToCpp
/Functions Assignment 2/Source.cpp
UTF-8
1,170
4.5625
5
[]
no_license
#include <iostream> //1. Create a function for each of the following math operators. They must return a value. // and take in at least two argument. Once all the functions have been created you will need to // invoke them and print out the return. //a. Addition //b. Subtraction //c. Multliplication //d. Divisi...
true
2b0d32718f092ff7d5414628e363eb371492e542
C++
andywu1998/C_and_Cpp
/C++primerplus/第十一章:使用类/计算时间/mytime0.cpp
UTF-8
843
3.546875
4
[ "MIT" ]
permissive
#include <iostream> #include <cstdio> #include "mytime0.h" Time::Time(int h = 0, int m = 0):hours(h), minutes(m) { } Time::Time(const Time &t) { this->hours = t.hours; this->minutes = t.minutes; } Time Time::operator+(const Time &other)const { Time t; int t_minutes = this->minutes + other.minutes; t.minutes ...
true
f10c5689c8a65e37e5bda67804f29e6f57b744e2
C++
sammyne/LeetCodeCpp
/621-Task-Scheduler/main.cpp
UTF-8
3,383
3.375
3
[]
no_license
#include <algorithm> #include <iostream> #include <tuple> #include <vector> using namespace std; class Solution { public: static int leastIntervalV2(vector<char> &tasks, int n) { // priority queue // the 1st element is the length of freeze zone of the task // the 2nd element is the frequen...
true
063066efdff298be9905c3a2ccc3dfdad266c628
C++
getopenmono/mono_framework
/src/display/ui/text_label_view.h
UTF-8
14,091
2.78125
3
[ "MIT" ]
permissive
// This software is part of OpenMono, see http://developer.openmono.com // and is available under the MIT license, see LICENSE.txt #ifndef __mono__text_label_view__ #define __mono__text_label_view__ #include <deprecated.h> #include "view.h" #include "mn_string.h" #include <font_interface.h> #include <gfxfont.h> #incl...
true
6199a86a66b8692c8f86954bf813fd6e69702e33
C++
kandabi/OpenFTP
/OpenFTP Server/sources/worker_manager.cpp
UTF-8
653
2.703125
3
[ "LGPL-3.0-only", "LGPL-2.0-or-later", "Apache-2.0", "GPL-1.0-or-later", "GPL-3.0-only" ]
permissive
#include "stdafx.h" #include "worker_manager.h" WorkerThread::WorkerThread(const QString& filePath, QSslSocket* _socket) : socket(_socket) { qFile.setFileName(filePath); size = qFile.size(); } void WorkerThread::run() { QByteArray fileData; if (!qFile.open(QIODevice::ReadOnly) || !qFile.isReadabl...
true
8bbcb86825ab9500b4d4c9996790ee1a6969a5e9
C++
gaitee1/TanvirGaiteeara_48102
/Homework/Assignment_1/Gaddis_7thEd_Chap2_Prob8_TotalPurchase/main.cpp
UTF-8
1,716
3.65625
4
[]
no_license
/* * File: main.cpp * Author: Gaitee ara Tanvir * Created on September 18, 2016, 10:14 AM * Purpose: Calculate the subtotal of the sale, the amount of sales tax, and the total. */ //System Libraries #include <iostream> //Input/Output objects using namespace std; //Name-space used in the System Library //U...
true
4719100d8a05c4d5cdaf95f76fdb36aee30d9606
C++
Cyber-SiKu/nowcoder
/64-OR127/64-1.cpp
UTF-8
1,157
3.375
3
[]
no_license
#include <iostream> #include <vector> using namespace std; class Solution { private: vector<int> outs; public: Solution(const vector<int>& data); ~Solution(); friend ostream& operator<<(ostream& os, const Solution& s); }; Solution::Solution(const vector<int>& data) { for (size_t i = 0, e = data....
true
e7aa6ecbb48e47491ae66b344fa4f80edd8c2a14
C++
Chaomin702/cmserver
/cmver/threadpoll.cpp
UTF-8
1,215
3.15625
3
[ "MIT" ]
permissive
#include "threadPoll.h" ThreadPoll::ThreadPoll(size_t queueSize, size_t pollSize) : empty_(mutex_) , full_(mutex_) , queueSize_(queueSize) , pollSize_(pollSize) , isStarted_(false){} ThreadPoll::~ThreadPoll(){ if (isStarted_) stop(); } void ThreadPoll::start(){ if (isStarted_) return; isStarted_ = true; f...
true
f48e0e9fa25f617d05d3c3d41e92e84b50c3db66
C++
ayoubserti/asio
/samples/hello-world/main.cc
UTF-8
2,187
2.546875
3
[]
no_license
#include <iostream> #include <functional> #include <memory> #define ASIO_STANDALONE 1 #include "asio.hpp" using namespace std; using namespace asio; using TcpEndPoint = ip::tcp::endpoint; using TcpSocket = ip::tcp::socket; using namespace std::placeholders; class Reciever; template<class T> void Handler(shared_...
true
809d195315d7e9f3f3f669413601b1778501b1d4
C++
vincent-picaud/LinearAlgebra
/test/LinearAlgebra/dense/memory_chunk_aliasing_p.cpp
UTF-8
2,912
2.890625
3
[]
no_license
#include "LinearAlgebra/dense/memory_chunk_aliasing_p.hpp" #include "LinearAlgebra/dense/matrix.hpp" #include "LinearAlgebra/dense/matrix_view.hpp" #include "LinearAlgebra/dense/vector.hpp" #include "LinearAlgebra/dense/vector_view.hpp" #include <gtest/gtest.h> using namespace LinearAlgebra; TEST(Memory_Chunck_Alias...
true
224dee7ba17bf25f7120f1dae5c63845bc0ef526
C++
singerinsky/omgserver
/soccer_ai/entity_manager.cpp
UTF-8
599
2.6875
3
[]
no_license
#include "../common/head.h" #include "entity_manager.h" EntityManager::EntityManager(void) : _map(64) { } void EntityManager::enregister(GameEntity *entity) { std::pair<MapIter, bool> insert_result; insert_result = _map.insert(Map::value_type(entity->get_id(), entity)); LOG_IF(FATAL, insert_result.secon...
true
361ccbf3a7f9cc1cb98208441ac1edad1cbd04ca
C++
Merfoo/CS-162
/assignments/Maze/Maze/Game.cpp
UTF-8
3,309
2.875
3
[]
no_license
#include "Game.h" #include <iostream> #include <string> #include <stdlib.h> #include "Util.h" #include "Player.h" #include "Swan.h" using namespace std; using namespace Util; Game::Game() { m_gameSteps = 0; m_levelsLength = 0; m_levels = 0; m_actors = 0; } Game::~Game() { if (m_levels != 0)...
true
ec80ec0de4cabc7f497dfbd58a7b5521a8111db3
C++
mshiihara/openal_sample
/WaveFileLoadSample/WaveFile.h
SHIFT_JIS
960
2.640625
3
[]
no_license
#pragma once #include <stdio.h> #include <Windows.h> #include "type.h" class WaveFile { private: // `Nʂׂ̒l static const uint32 CHUNK_RIFF_TAG = 'FFIR'; static const uint32 CHUNK_FMT_TAG = ' tmf'; static const uint32 CHUNK_DATA_TAG = 'atad'; // RIFF`N͒ʏ̃`NɃtH[}bg񂪂‚ struct RIFFHeader { uint32 tag; uint32 si...
true
422a5e951bcdf1ec3ffc7cd6ef64f1632d2b9c91
C++
beibeisongs/C-HomeworkInMyUniversityLife
/Struct-Huffman-MinHeap/Heap.h
UTF-8
4,447
3.46875
3
[]
no_license
#ifndef __HP_H__ #define __HP_H__ #include<iostream> #include"HuffmanTree.h" using namespace std; enum BOOL {False, True}; template<class T, class E> class MinHeap { public: MinHeap(int sz); // 构造函数:建立空堆 MinHeap(E arr[], int n); // 构造函数:通过一个数组 ~MinHeap() { // 析构函数 delete[] heap; } bool Insert(E x); // ...
true
0890fb61cbc4fa89b71336b2281b006c58125090
C++
piyush1146115/Competitive-Programming
/Intra University Contest/MBSTU individual contest on bin search 29 march, 2017/D - Calm Down.cpp
UTF-8
1,007
2.53125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; #define eps 1e-7 #define sq(x) x*x #define pi acos(-1) int main() { int test; scanf("%d", &test); double n, r; for(int tc = 1; tc <= test; tc++){ scanf("%lf %lf", &r, &n); double a, b, c; double lo = 0.0, hi = r, mid; ...
true