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
8f5ab95e617b6fcffd86a7abcf27fd48750e4328
C++
louisfghbvc/Leetcode
/Two Pointers/777. [Like] Swap Adjacent in LR String.cpp
UTF-8
1,017
3.25
3
[]
no_license
// record index, and is easy to calculate the L must can be sliding // also R // O(N) class Solution { public: // start = {(R, 0), (L, 3), (R, 4), (R, 6), (L, 8) } // end = {(R, 1), (L, 2), (R, 5), (R, 6), (L, 7) } vector<pair<char, int>> filterLR(string &s){ vector<pair<char, int>> res; ...
true
449d434faa80ad33a0b1cd2a6e6cc4632897d045
C++
michaelcullimore/CS1410Lab1
/Project1/roots.cpp
UTF-8
1,113
3.53125
4
[]
no_license
//Michael Cullimore //CS1410 - Brinkerhoff //Lab1 - Roots #include <cmath> #include <conio.h> #include <iostream> using namespace std; int main () { double a, b, c, d, x1, x2; cout << "===***===*** Lab 1 - Roots ***===***===\n"; cout << "A quadratic equation is given as ax^2 + bx + c = 0.\nThis program gives roo...
true
378f2e5db8fe996206285be42e53dcf954eb678b
C++
EinsVision/ModernCpp
/m11_2.cpp
UHC
658
3.125
3
[]
no_license
#include "projects.h" #include "m11_2_Teacher.h" #include "m11_2_Student.h" void Projects_11::m11_2() { // 11.2 ⺻ (2) is-a relationship Teacher t1("Prof. J"); t1.setName("Prof. H"); std::cout << t1.getName() << std::endl; t1.printStatus(); // ü ϴ //Ǽ ߰ ϸ ڽ class ִ. t1.teach(); std::cout << std::endl; ...
true
4e017bcc20291fee54d0e58af9e1b6e6b46e1de3
C++
yvesbou/cpp_course_code
/Exercise05/Task01/Source.cpp
UTF-8
2,507
3.734375
4
[]
no_license
// // Created by Yves Boutellier on 20.11.20. // #include <iostream> #include <string> #include <sstream> #include <regex> #include "pset.h" using namespace std; int main(int argc, char* argv[]) { string dictfile; string textfile; string word; string str; int pos; smatch matches; //match_...
true
d8e1d6953d73bd015016e99ae82e1bef3546f09c
C++
mat-kalinowski/Sorting-Algorithms
/Select/main.cpp
UTF-8
2,388
3.34375
3
[]
no_license
#include <iostream> #include <string.h> #include <string> #include <math.h> #include <stdlib.h> #include "Select.h" #include "RandomSelect.h" #include "MedianSelect.h" using namespace std; void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } void printUsage(){ cout << endl; cout << " US...
true
e5ea1eb88f923263a43c5786ea8870ab8fc3802b
C++
intrepid249/Bootstrap-ShooterGame
/ShooterGame/include/Components/AIController.h
UTF-8
842
2.96875
3
[ "MIT" ]
permissive
#pragma once #include <Components\CComponent.h> #include <map> #include <Nodes\Node.h> #include <memory> class IAIState; /** State machine component for the AI controlling mechanics. This is the "brain" behind the AI*/ class AIController : public Node, public CComponent { public: AIController(); ~AIController(); ...
true
f191939f0b1f6158df58f2b04de1ffca5915258b
C++
iwtbam/leetcode
/code/lt1201.cpp
UTF-8
1,073
3.296875
3
[]
no_license
// https://leetcode-cn.com/problems/ugly-number-iii/ // ugly number iii class Solution { public: int nthUglyNumber(int n, int a, int b, int c) { long long lcm_ab = lcm(a, b); long long lcm_bc = lcm(b, c); long long lcm_ac = lcm(a, c); long long lcm_abc = lcm(lcm_ab, c); ...
true
beb8c75cadc07b3cdae01837e0761ed00809d7ec
C++
IvoWams/Engine
/global/Camera.cpp
UTF-8
291
2.71875
3
[]
no_license
#include <global/Camera.h> Camera::Camera(){ position = new Vector(0,0,0); target = new Vector(1,0,0); // just look somewhere } Camera::~Camera(){ delete position; delete target; } Vector* Camera::getPosition(){ return position; } Vector* Camera::getTarget(){ return target; }
true
b0ae93a37b8ce0c204ae2b9829acebc1088f73e6
C++
yzq986/cntt2016-hw1
/TC-SRM-586-div1-250/immortalCO/PiecewiseLinearFunction.cpp
UTF-8
805
2.90625
3
[]
no_license
#include <vector> using namespace std; #define check(a) (tmp = (a)) > ans ? ans = tmp : 0 int n, v[60]; int count(int x) { int ret = 0; for(int i = 1; i <= n - 1; ++i) if((v[i - 1] <= x && x <= v[i]) || (v[i] <= x && x <= v[i - 1])) ++ret; for(int i = 1; i <= n - 2; ++i) if(v[i] ...
true
42d2bb2ee4e91cd585242bc005ecba8f94faa408
C++
hehichens/Mini-PhotoShop
/change_background.cpp
UTF-8
5,040
2.515625
3
[ "Apache-2.0" ]
permissive
#include <opencv2/opencv.hpp> //#include <opencv2/xfeatures2d.hpp> //#include<opencv2/face.hpp> #include<iostream> #include<math.h> #include <string> #include<fstream> #include "big_eye.h" // using namespace cv::face; using namespace cv; using namespace std; //using namespace cv::xfeatures2d; /* * Implementation N...
true
576497f4770cef3675bbfdb951ca6e16c1321f06
C++
offscale/liboffkv
/tests/unit_tests.cpp
UTF-8
13,559
2.828125
3
[ "CC0-1.0", "MIT", "Apache-2.0" ]
permissive
#include "test_client_fixture.hpp" #include <liboffkv/liboffkv.hpp> #include <chrono> #include <mutex> #include <thread> #include <iostream> TEST_F(ClientFixture, key_validation_test) { const auto check_key = [](const std::string &path) { liboffkv::Key{path}; }; ASSERT_THROW(check_key(""), ...
true
b3b43c7aca3e38828802261938b216dc6b3a5b56
C++
yukina0102/Aigis_IR
/src/SqlData.h
UTF-8
3,393
2.84375
3
[]
no_license
#ifndef SQLDATA_H #define SQLDATA_H #include "common.h" typedef class CSqlData * SqlData; typedef class CSqlRecord * SqlRecord; //DB側で指定される型名をプログラム内の型に変換 typedef const int INTEGER; typedef const _TCHAR * TEXT; class CSqlData { public: typedef enum { TYPE_INTEGER = 0, TYPE_TEXT, }ColumnType; private...
true
ca20118fbba473669f73cf6ac7b40374222ed293
C++
lydrainbowcat/tedukuri
/配套光盘/例题/0x10 基本数据结构/0x17 二叉堆/数据备份/CTSC2007/BZOJ1150 数据备份.cpp
UTF-8
1,639
2.8125
3
[]
no_license
//Author:XuHt #include <cstdio> #include <iostream> #include <algorithm> using namespace std; const int N = 100006; struct L { int d, prv, nxt, th; } p[N]; struct H { int D, tp; } h[N]; int tot = 0; void up(int i) { while (i > 1) { if (h[i].D < h[i>>1].D) { swap(h[i], h[i>>1]); swap(p[h[i].tp].th, p[h[i>>1]...
true
7d51839268f1f69ca3f01ba37cb52851e4d7e24b
C++
Marcotte07/Scrabble
/Scrabble/computer_player.cpp
UTF-8
18,462
3.015625
3
[]
no_license
#include "computer_player.h" #include "exceptions.h" #include "formatting.h" #include "move.h" #include "place_result.h" #include "rang.h" #include "tile_kind.h" #include <algorithm> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <sstream> #include <stdexcept> #inc...
true
4b7a57042e2dec2a4e2d5c20e3e94acc10b9f68b
C++
dannosliwcd/PointQuery
/src/CountyRecord.h
UTF-8
590
2.875
3
[ "MIT" ]
permissive
#ifndef COUNTYRECORD_H #define COUNTYRECORD_H #include <string> #include <iosfwd> struct CountyRecord { std::string m_state; std::string m_county; float m_latitude; float m_longitude; static CountyRecord FromString(const std::string& countyRecordString); static void CheckValidHeader(const std::st...
true
7b2e4c692d8b9dec179e0661b79eec34d5a097eb
C++
alexandraback/datacollection
/solutions_5756407898963968_0/C++/beerscout/A.cpp
UTF-8
1,071
3.296875
3
[]
no_license
#include <array> #include <iostream> #include <algorithm> typedef std::array<int, 4> Guess; Guess read_guess() { int row; std::cin >> row; for ( int i = 1; i < row; ++i ) for ( int j = 1; j <= 4; ++j ) { int dummy; std::cin >> dummy; } Guess r; for ( int i = 0; i != 4; ++i ) st...
true
682216f9e9d4d1b0ebce9a995f87fabdae443666
C++
doitliao/algorithms
/notebook/geometry_2d.cc
UTF-8
4,338
3.546875
4
[]
no_license
#include <cmath> #include <vector> #include <iostream> using namespace std; namespace geometry{ template < typename T> class Point{ public: T x,y; Point():x(0), y(0){} Point(T x, T y):x(x), y(y){} Point operator+(const Point& rhs){ return Point(x + rhs.x, y + rhs.y); } Point operator-(const Point&...
true
15a16f8c4ea196a05046801ff10edd7b7b713bcd
C++
dmitry64/evolution-system
/simulationsystem.cxx
UTF-8
2,160
2.796875
3
[]
no_license
#include "simulationsystem.hpp" SimulationSystem::SimulationSystem() {} SimulationSystem::~SimulationSystem() { waitForSimulation(); } void SimulationSystem::init() {} void SimulationSystem::runSimulation() { std::cout << "Simulation start..." << std::endl; _hasWork.store(true); _actorsAccessMutex.unloc...
true
9a1c5b7dceb58b4edffaee09028479ad92a052c5
C++
ej2xu/LeetCode
/105construct-binary-tree-from-preorder.cc
UTF-8
1,847
2.96875
3
[]
no_license
class Solution { public: TreeNode* buildTree(vector<int>& preorder, vector<int>& inorder) { for (int &x: inorder) inorderm[x] = &x; return gentree(&preorder[0], &*preorder.end(), &inorder[0], &*inorder.end()); } private: unordered_map<int, int*> inorderm; TreeNode* gentree(int *pl, int *ph, int *i...
true
043cdea8b356627b1e03fb4625b3f1e26e7ca32d
C++
xiaoxi-s/STL
/test/correctness/algorithm_binary_search_test.cpp
UTF-8
2,517
2.9375
3
[]
no_license
#include <gtest/gtest.h> #include <stdlib.h> #include "../../src/algorithms/sstl_binary_operations.hpp" namespace algorithm_binary_search_test { TEST(binary_search_int_test, return_value_test) { int n = 10; int array[] = {0, 1, 2, 3, 4, 15, 17, 20, 24, 30}; int query_val[] = {-5, -4, -2, -1, 10, 16, 23, 27, 40...
true
b0f131748cd4ddfeacd5f9cd893b3de704e5ad5c
C++
chenjianlong/books-code
/head-first-design-pattern/cpp/templatemethod/barista/tea_with_hook.cpp
UTF-8
747
3.046875
3
[]
no_license
/* $Id$ */ #include <iostream> #include <string> #include <cctype> #include "tea_with_hook.h" using std::cin; using std::cout; using std::endl; using std::string; Tea_With_Hook::Tea_With_Hook() { } Tea_With_Hook::~Tea_With_Hook() { } void Tea_With_Hook::brew() { cout << "Steeping the tea" << endl; } void Tea_Wit...
true
d0cb480cf97c58332b73928d0ca59cab429ec569
C++
YuxingLiu/CarND-Kidnapped-Vehicle-Project
/src/particle_filter.cpp
UTF-8
8,468
2.5625
3
[]
no_license
/* * particle_filter.cpp * * Created on: Dec 12, 2016 * Author: Tiffany Huang */ #include <random> #include <algorithm> #include <iostream> #include <numeric> #include <math.h> #include <iostream> #include <sstream> #include <string> #include <iterator> #include "particle_filter.h" using namespace std; ...
true
9bdb7ebf5ac99d5939804c452bef3621b1317754
C++
uchihaitachi08/daily_code
/c++/array_rotation.cpp
UTF-8
625
3.453125
3
[]
no_license
#include<iostream> #include<string> #include<vector> using namespace std; void rotate_array_temp(vector<int>*arr,int n,int d){ int* temp; temp = new int[d]; for(int i=0;i<d;i++){ temp[i] = (*arr)[i]; } for(int i=d;i<n;i++){ (*arr)[i-d] = (*arr)[i]; } int j = 0; for(int i=n-d;i<n;i++){ (*arr)[i] = temp[j];...
true
e39e19cbe550a60ef76beef79b7c56f24d0f766a
C++
AntiqueTraider/special-for-alick
/laba_sort1/laba_sort1/Source.cpp
UTF-8
2,622
3.34375
3
[]
no_license
#include<iostream> #include <string> #include<conio.h> #include<fstream> #include<stack> using namespace std; struct Somebody { string name; int nomber; }; struct List { Somebody man; List *next; }; void FirstBuf(Somebody *arr, int i, List *head, List *other); void SecondBuf(Somebody *arr, int i, Lis...
true
143635d6ec94be74707372a03422925340496120
C++
squirrelClare/algorithm_cplusplus
/excise/TestDemo21/main.cpp
UTF-8
1,058
2.71875
3
[]
no_license
#include <QCoreApplication> #include<QFile> #include<QDebug> #include<QDir> static bool copyFileToPath(QString sourceDir,QString toDir, bool coverFileIfExist) { toDir.replace('\\','/'); if (sourceDir==toDir){ return true; } if (!QFile::exists(sourceDir)){ return false; } QDir *c...
true
02809d484480b938cf9b22e04e30d88a6d9fe75e
C++
chunchou/ACM
/数据结构/splay/SGU 187 Twist and whirl - want to cheat.cpp
GB18030
3,716
2.6875
3
[]
no_license
/* ĿУm䷭ת֮ splay򵥲 */ #include <set> #include <map> #include <cmath> #include <queue> #include <stack> #include <string> #include <vector> #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; typedef unsigned long long ull; #define debug puts("her...
true
b626ef324d7767368a3ce8829b4fcbe430a6d007
C++
caidongyun/tray
/commons/include/MRE_Windows.h
UTF-8
1,670
2.671875
3
[ "Apache-2.0" ]
permissive
#ifndef MRE_WINDOWS_H #define MRE_WINDOWS_H #include <Windows.h> #include "InternalCriticalSection.h" #include <string> class CGuidCreator { public: #ifdef UNICODE static std::wstring CreateGuidString(void) { GUID guid; CoCreateGuid(&guid); RPC_WSTR rpcStr; UuidToStringW( &guid, &rpcStr ); wcha...
true
10e5d5ef8fe773c1728cb5719217a061e9bf9961
C++
eotkd4791/Algorithms
/SW Academy/BFS&DFS/SW1868.cpp
UTF-8
2,091
2.5625
3
[]
no_license
#include <iostream> #include <queue> #include <utility> #include <cstring> using namespace std; int dx[] = {0,0,-1,1,1,1,-1,-1}; int dy[] = {1,-1,0,0,1,-1,1,-1}; char field[303][303]; bool check[303][303]; queue<pair<int,int> > q; int T,n; inline bool OOB(int xx, int yy) { return 0 <= xx && xx < n && n > yy && yy >= ...
true
a41de6e0ee7b383ad2dcc7c8ed1cac3d47a976bb
C++
TheBaxes/medellin-covid-simulation
/src/common.h
UTF-8
1,958
2.6875
3
[ "Apache-2.0" ]
permissive
#ifndef __CS267_COMMON_H__ #define __CS267_COMMON_H__ #include <vector> #include <tuple> inline int min( int a, int b ) { return a < b ? a : b; } inline int max( int a, int b ) { return a > b ? a : b; } // // saving parameters // const float VEL_HUMAN = 1.39; // 1.38 m/s const float MOVEMENT_DELTA = 80; //...
true
f50355a74988670466f5adf0bc00a17848916257
C++
MatTerra/simuladorCamadaFisica
/src/CamadaFisica.cpp
UTF-8
3,404
2.5625
3
[]
no_license
#include "CamadaFisica.hpp" #include "CamadaEnlace.hpp" void CamadaFisicaReceptora(bitStream fluxoBrutoDeBits) { int tipoDeDecodificacao = CODIFICAO_ESCOLHIDA; std::string mensagemDecodificada; mostrarProcessamentoCamadaFisicaReceptora(fluxoBrutoDeBits); switch (tipoDeDecodificacao) { case CO...
true
07c5bcdbbb06b86bb33cf7b77befd5ac988a4b77
C++
mamacker/DogDoor
/DogDoor.ino
UTF-8
2,979
2.625
3
[]
no_license
#include <Arduino.h> #include <ESP8266WiFi.h> #include "fauxmoESP.h" #define WIFI_SSID "*****" #define WIFI_PASS "*****" #define SERIAL_BAUDRATE 115200 #define DEBUG_FAUXMO_VERBOSE true #define ON_PIN 12 #define OPEN_PIN 13 fauxmoESP fauxmo; int doorOpen; #define REBOOT_TIME 345600000 // 1000 * 60 * 60...
true
d5428296fe39e50172005607a65a057191c9e115
C++
DragonJoker/StarMap
/StarMapTestApp/StarMapTestApp.NativeActivity/Engine.h
UTF-8
2,251
2.65625
3
[]
no_license
#pragma once #include <StarMapLib/ScreenEvents.h> #include <StarMapLib/StarMap.h> #include <AndroidUtils/AndroidWindow.h> class Window : public utils::AndroidWindow { public: Window( utils::AndroidApp const & parent , ANativeWindow * window , render::ByteArray const & state ); ~Window(); private: /** *\bri...
true
4968f95ff75cf7edee9ad25b064d9929c8615a3c
C++
swayamxd/noobmaster69
/SPOJ/AGGRCOW/Swayamdeepta/aggressive_cows.cpp
UTF-8
1,911
3.375
3
[]
no_license
/*We can use binary search in the function . We first of all sort the stalls. Then we always keep cow 1 in stall 1 and then proceed by finding the lower_bound in array of stalls for last_stall+dist. If the lower_bound doesn't point to the end then we can accomodate one more cow.And then check how many cows can we acco...
true
31a092a7df6f2f425635c99d79c8e1e47a7dad1e
C++
sykim9587/Linux_src
/cpp_accel/ch11_vector_all/allocator.cpp
UTF-8
1,238
3.65625
4
[]
no_license
#include <iostream> #include <string> #include <memory> //allocator using std::allocator; using std::cout; using std::endl; using std::string; int main () { /* origianl method using new and delete string *pArr = new string[5]; //not really necessary, since constructor is called later. //that's why we w...
true
024b12e84182a39381eb7afd2b01ba4099521d1d
C++
davorzdralo/math_wars
/GreenEnemy.cpp
UTF-8
1,421
2.703125
3
[]
no_license
#include "GreenEnemy.h" #include "GameWindow.h" #include "Explosion.h" #include "Point.h" GreenEnemy::GreenEnemy(GameWindow* parent, const Point& location) : Enemy(parent, location, "resources/green.png", 1.0f, 0.0f, 0.13, (double) rand() / RAND_MAX * 90, 0.6f) { rotationPerUpdate = 5; this->parent = parent; } ...
true
fb988b78687df3b3336e2fb2abf2776c1e6b1e23
C++
RaBarBarS/wyszukiwanieMotywowWSekwencjach
/Źródło.cpp
WINDOWS-1250
25,567
2.875
3
[]
no_license
#include "pch.h" #include "header.h" #include <string> #include <fstream> #include <iostream> vector <vertex> vertexesList; vector <vector <int>> nextList; vector <string> seqList; vector <int> maxMotyw; //prawo,lewo,wierzchoki ktre nale int window; int deletion; int vertexID = 0; int seqNumber; int minim...
true
255301e1d88cfa435d35445cc572513ab6b86e70
C++
NPIPHI/v8Inspector
/src/SafeQueue.h
UTF-8
1,278
3.25
3
[]
no_license
// // Created by 16182 on 12/14/2020. // #ifndef V8DEBUGGER_SAFEQUEUE_H #define V8DEBUGGER_SAFEQUEUE_H #include <queue> #include <mutex> #include <condition_variable> #include <optional> // A threadsafe-queue. template <class T> class SafeQueue { public: SafeQueue(): q(), m(), c(){} // Add an element to the...
true
96797fd9ce7e772d11e704460a5f4f5419754489
C++
swd543/projects
/Codes/poly.cpp
UTF-8
1,575
3.140625
3
[]
no_license
#include "libs/bugabox.cpp" #define max 10 #define end 999999 struct polynomial { struct node { int x_degree,y_degree,z_degree,coeff; node *next; }; node *head,*p; void traverseTo(int a) { p=head; for(int i=0;i<a;i++) if(p->next!=NULL) p=p->next; else break; } bool isXYZ() { return t...
true
e42df72443428a88b0ba9f63c6e12cbd95699a64
C++
littesss/test_code
/Test/project_sync_22/ut/utfopen.cpp
UTF-8
741
2.546875
3
[]
no_license
/************************************************************************* > File Name: utfopen.cpp > Created Time: Sun 27 Aug 2017 17:23:23 PDT ************************************************************************/ #include <iostream> using namespace std; #include <stdio.h> int main() { FILE * fp = NULL; ...
true
f5a7c52e52967d258000d87a3c8b09ce2a89c7e7
C++
sillyatom/OpenGL
/OpenGL/Base/Primitives/Cube.cpp
UTF-8
1,021
2.640625
3
[]
no_license
// // Cube.cpp // OpenGL_1 // // Created by Sillyatom on 23/09/17. // Copyright © 2017 SillyatomGames. All rights reserved. // #include <GL/glew.h> #include "Cube.h" unsigned int Cube::_VAO = -1; unsigned int Cube::_VBO = -1; size_t Cube::_size = 0; Cube::Cube(const float *vertices, size_t size) { _size = (...
true
34f2820b836cd4fc0d07909daa6c126ef6c25e2c
C++
Sorades/DataStructure
/DataStructure/ex8/AdjGraph.cpp
GB18030
2,072
3.015625
3
[]
no_license
#include <iostream> #define maxV 5 #define INF 0x3f3f3f3f using namespace std; typedef char infoType; int a[maxV][maxV] = {0, 8, INF, 5, INF, INF, 0, 3, INF, INF, INF, INF, 0, INF, 6, INF, INF, 9, 0, INF, INF, INF, INF, INF, 0}; typede...
true
7d9062e0c52933a2d8b632bf266cef90b6255787
C++
Roooooobin/Leetcode-Problems
/meituan-sort strings/main.cpp
UTF-8
1,070
2.875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; vector<string> a; bool cmp(string a, string b){ if(a == "") return true; if(b.find(a) == 0 && a != b) return true; if(a.find(b) == 0 && a != b) return false; return a > b; } void qsort(int l, int r){ if(l >= r) return; int i = l, j = r; string...
true
6650081b92bb985596500cd9a861dc851c96b852
C++
robinlzw/GameEngine2
/src/lights/spotlight.cpp
UTF-8
3,566
2.578125
3
[]
no_license
#pragma once #include <GLFW/glfw3.h> #include <glad/glad.h> #include <iostream> #include <glm/glm.hpp> #include "../engine/logger.h" #include "../engine/context.h" #include "../engine/renderObject.cpp" #include "../engine/shader.cpp" #include "../shape/cube.cpp" class Spotlight : public RenderObject { public: bool...
true
96e83802fdaff9b9cecfea78e59258cacb22382c
C++
Pangeamt/nectm
/tools/mosesdecoder-master/phrase-extract/filter-rule-table/ForestTsgFilter.h
UTF-8
1,887
2.515625
3
[ "LicenseRef-scancode-warranty-disclaimer", "LGPL-2.1-only", "LGPL-2.0-or-later", "GPL-1.0-or-later", "LGPL-2.1-or-later", "LicenseRef-scancode-other-copyleft", "GPL-2.0-only", "Apache-2.0" ]
permissive
#pragma once #include <istream> #include <ostream> #include <string> #include <vector> #include <boost/shared_ptr.hpp> #include <boost/unordered_map.hpp> #include <boost/unordered_set.hpp> #include "syntax-common/numbered_set.h" #include "syntax-common/tree.h" #include "syntax-common/tree_fragment_tokenizer.h" #inc...
true
81b426fd5781e58d2e5bc344821244ae0d462eac
C++
David-Whiteford/Tofu-Of-Doom
/Tofu-of-Doom/ProjectileEnemy.h
UTF-8
985
2.53125
3
[]
no_license
#pragma once #include <SFML/Graphics.hpp> #include <SFML/OpenGL.hpp> #include "DisplayScale.h" #include <stdlib.h> #include "Globals.h" class ProjectileEnemy : public GameObject { public: ProjectileEnemy(sf::RenderWindow& t_window); ~ProjectileEnemy(); void init(sf::Vector2f startPosition, sf::Vector2f moveDire...
true
66177831405d3c959ac801224c9b7963018668b1
C++
RajB07/DS-Algo-Problem-Solving
/Code Forces/1560/B.cpp
UTF-8
444
2.875
3
[]
no_license
// https://codeforces.com/contest/1560/problem/B #include <iostream> using namespace std; int main() { int t; int a, b, c, half_n, n; cin >> t; while (t--) { cin >> a >> b >> c; half_n = abs(a - b); n = 2 * half_n; if (a > n || b > n || c > n) cout << -1...
true
12be7ad1fd6d9ac4063c5b989665319f95232e47
C++
AntoniaShalamanova/Programming-Basic-With-C-Plus-Plus
/MyExam.05.11.2017/WireNet.cpp
UTF-8
728
2.90625
3
[]
no_license
// WireNet.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; int main() { int place_length, place_width; double net_height, net_price, net_weight; cin >> place_length >> place_width >> net_height >> net_price ...
true
0cef67754211c51a60cab61d739288cf352d5879
C++
xueqing/CodeForces
/A-level/A59-Word.cpp
UTF-8
440
2.796875
3
[]
no_license
#include <iostream> #include <stdio.h> #include <string.h> #include <ctype.h> //islower,toupper,tolower func using namespace std; int main() { int i, len, nl=0, nu=0; char u[101]={}, l[101]={}; scanf("%s", l); len = strlen(l); memcpy(u, l, len+1); for(i=0; i<len; i++) { if(islower(l[i])) { nl++; u[i] = ...
true
fa6174de7d84e2de48edfd6befe49bc009aed78e
C++
khuevu/battlecity-online
/server/src/bt_server.h
UTF-8
1,037
2.796875
3
[]
no_license
#ifndef INCLUDED_BATTLETANK_SERVER #define INCLUDED_BATTLETANK_SERVER #include <string> #include <vector> #include <bt_socket.h> #include <bt_player.h> namespace bt { class Server { public: /** * @brief: Start game server at the specified port */ Server(int port); /** * @brief: Wait for...
true
b948669f125fbb3033fa202ca7e6dcb9ec379751
C++
1119-2916/vim-snippet
/dinic.cpp
UTF-8
2,504
2.65625
3
[]
no_license
/* * 有効辺を貼る * 辺の重みが最大流量になる */ struct Dinic { int n, s, t; vector<int> level, prog, que; vector< vector< Flow > > cap, flow; vector< vector < int > > g; Flow inf; Dinic(const Graph &graph) : n(graph.size()), cap(n, vector<Flo...
true
ad118109d5e9a04f2989b023b7517d314465694a
C++
42kevinzheng/Cpp-11
/CSCE240/hw6/src/median.cc
UTF-8
560
2.640625
3
[]
no_license
/* Copyright 2019 Kevin Zheng hw6*/ #include <median.h> namespace csce240 { Median::Median() {} void Median::Collect(double datum) { ok.push_back(datum); } double Median::Calculate() const { std::vector<double> vec; int n = ok.size(); for (int i = 0; i < n; ++i) { vec.push_back(ok[i]); } if (vec.empty()) { return 0;...
true
3ba1828569de1d387dbcef6d009cdabf3ed42dbc
C++
joshpersaud/RSA-encryption-algorithm
/RSA.cpp
UTF-8
5,050
3.34375
3
[]
no_license
#include<iostream> #include<stdlib.h> #include<stdio.h> #include<math.h> #include<string.h> using namespace std; int primeFirstElement, primeSecondElement; int dp, e, rf, objectFlag; // Encrypt and decrypt number with temporary long int encryptValue[50], decryptValue[50], temporaryValue[50], j; // Encrypt and decryp...
true
f046697a8398d16f62906ad2773ca0f7280a5cd9
C++
bayertom/detectproj
/libalgo/source/structures/line/PolyLine.hpp
UTF-8
4,788
2.71875
3
[]
no_license
// Description: Polyline definition // Copyright (c) 2010 - 2013 // Tomas Bayer // Charles University in Prague, Faculty of Science // bayertom@natur.cuni.cz // This library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published // by the Fr...
true
7c7ce5b41f5fea6bafd16f41a33e9b5940e87f1f
C++
junaidnz97/Competitive-Programming
/HACKEREARTH/Practice/Aryas_Stunts.cpp
UTF-8
1,103
2.734375
3
[]
no_license
#include<bits/stdc++.h> using namespace std; vector<int>warriors(10001); int maxs=0,sums=0,id=0; int dfs(vector<vector<int> >&g,vector<int>&visited,int i) { visited[i]=1; sums=sums+warriors[i]; //cout<<i<<endl; if(maxs<warriors[i]) { maxs=warriors[i]; id=i; } else if(maxs==warriors[i]) { id=min(id,i)...
true
9ed620ccb3de6c7a0027d8e92b25522d17546ce2
C++
GaryOu101/CS100_FALL2020
/lab-07---factory-pattern-mogr002-gou004-lab7/mult.hpp
UTF-8
546
3.078125
3
[]
no_license
#ifndef __MULT_HPP__ #define __MULT_HPP__ #include "op.hpp" using namespace std; class Mult: public Base { public: Mult(Base* leftOp, Base* rightOp):Base(){ leftNum = leftOp -> evaluate(); rightNum = rightOp -> evaluate(); leftStr = leftOp -> stringify(); rightStr = rightOp -> stringify(); } virtu...
true
6a69bcfee2d780c646468d4c0ffe4e3fbda3339d
C++
JiangKevin/FishEngine
/Engine/Source/FishEngine/Asset/Resources.cpp
UTF-8
901
2.515625
3
[ "MIT" ]
permissive
#include <FishEngine/Resources.hpp> #include <boost/algorithm/string.hpp> namespace FishEngine { AssetType Resources::GetAssetType(Path const & extension) { auto ext = boost::to_lower_copy(extension.string()); //auto ext = path.extension(); if (ext == ".jpg" || ext == ".png" || ext == ".jpeg" || ext == ".tga" ...
true
f8ff8b642533326d50939a12e212e2635df0dbcc
C++
markwhittyunsw/MTRN2500-T3-2019-Week-10-Lectures
/stack.h
UTF-8
2,178
3.84375
4
[ "MIT" ]
permissive
#ifndef STACK_H #define STACK_H #include <iostream> using namespace std; #define MEMORY_ALLOCATION_FAILED -1 // Class template template <class T> class Stack { private: int Size; T* StackPointer; int Top; int ErrorCode; public: Stack(); Stack(int size); ~Stack(); bool Push(const T& ...
true
dbbdc9fffc827390bcdf5f6adde48eb185472bd5
C++
Taurus-Chao/TreeIncpp
/Tree_c++/source.cpp
UTF-8
883
2.875
3
[]
no_license
#include"MytreeFun.h" #include<iostream> #include<list> using namespace std; int main() { MytreeFun t1; t1.insertIterative(6); t1.insertIterative(4); t1.insertIterative(8); t1.insertIterative(3); t1.insertIterative(5); t1.insertIterative(7); t1.insert(9); //t1.insert(11); //cout << endl; //t1.printLevelOrd...
true
0b010aa086b79f09186eade985382903f3b6da93
C++
Zedidle/myDataStructures
/Tree/AVL/AVLTreeNode.cpp
UTF-8
1,363
3.34375
3
[]
no_license
// Created by Kadir Emre Oto on 06.08.2018. #include "AVLTreeNode.h" template <class T> AVLTreeNode<T>::AVLTreeNode(T value) : value(value) { count = 1; height = 1; left = nullptr; right = nullptr; } template <class T> void AVLTreeNode<T>::updateValues() { // count 等于 两个子节点的count相加 + 加上根结点自己; count = (left !...
true
632eda9d0912995f6d7994a1c1b018e30ec9534e
C++
yury-dymov/legacy_l2auth
/catx/catxfunc.cpp
UTF-8
2,242
2.65625
3
[]
no_license
#include "catxfunc.h" namespace CatX { bool Func::mycmp (const CatX::String & str1, const CatX::String & str2, const unsigned int segm) { if (str2.length () <= str1.length () - segm) { for (unsigned int i = 0; i < str2.length (); ++i) { if (str1[segm + i] != str2[i]) { return true;...
true
9c228d7182b4ac6a80332a4fe39b7a944b17637f
C++
PMRocha/Laig
/segunda entrega/LAIGvs10/src/Node.h
UTF-8
1,323
2.609375
3
[]
no_license
#ifndef NODE_H #define NODE_H #include "Appearance.h" #include "Transformation.h" #include "SceneObject.h" #include "Animation.h" #include <iostream> class Node { string id; pair<string,Appearance*> nodeAppearance; vector<Transformation* > transformations; vector<SceneObject*> objects; vector<string> childNodeIds;...
true
b842e57f01f829aa92efae3e1f3fdb7f66dacf46
C++
desy-cms/analysis
/Analysis/MssmHbb/src/Measurement.cpp
UTF-8
1,597
2.703125
3
[]
no_license
#include "Analysis/MssmHbb/interface/Measurement.h" Measurement::Measurement() : median_(0), plus1G_(0), minus1G_(0), plus2G_(0), minus2G_(0){}; Measurement::Measurement(const double& median) : median_(median), plus1G_(0), minus1G_(0), plus2G_(0), minus2G_(0) {}; Measurement::Measurement(const double& median, const ...
true
bab0ce23d77420562ea38f537ebc1d99190c2b17
C++
justAburger/week10ex1
/Item.h
UTF-8
813
3.453125
3
[]
no_license
#pragma once #include<iostream> #include<string> #include<algorithm> class Item { public: Item(std::string, std::string, double); ~Item(); double totalPrice() const; //returns _count*_unitPrice bool operator <(const Item& other) const; //compares the _serialNumber of those items. bool operator >(const Item& oth...
true
e94d63eecd8c16f72074a4668bef43d4b69afd68
C++
hyperrhelen/ECS40
/Project5/appointment.cpp
UTF-8
2,044
3.453125
3
[]
no_license
// Helen Chac && Gabriel Chan #include <cstring> #include <iostream> #include <iomanip> #include "appointment.h" using namespace std; Appointment::Appointment() : subject(NULL) , location(NULL) { } // Appointment() Appointment::Appointment(const char* s) : location(NULL) { subject = new char[strlen(s) + 1]; s...
true
badbc555940faf5d14a01e4c3bb1f47dc89e1c2d
C++
AlexAlestra100/Alexander-College-Projects
/Data Structures & Algorithms/InsertSearch/InsertSearch.cpp
UTF-8
2,638
3.71875
4
[]
no_license
/* Alexander Alestra Prof. Sabzevary CISP 430 03-29-2020 */ #include <iostream> #include <string> #include <fstream> using namespace std; string names[10]; struct node { string name; node* next; }; void AddN(node* head, string val) { node* nn = new node; nn->name = val; nn->next = head; head...
true
5b2be7e302aaae51f398b0527e2f925cdde9e09f
C++
wired7/COMP477
/NoiseTexture.h
UTF-8
3,481
3.25
3
[]
no_license
#pragma once // Std. Includes #include <string> #include <fstream> #include <sstream> #include <iostream> #include <vector> #include "glm.hpp" enum noiseType{ STATIC , WOOD , RANDOM ,CLOUDS , MARBLE}; using namespace std; class NoiseTexture{ public: float **noise; glm::vec3 **colors; NoiseTexture(int...
true
5688b4c9dd98f0f2e16c22a51cd0a3dc38ad29d7
C++
Lumpros/Zombie-Survival
/GameActor.cpp
UTF-8
1,027
3.078125
3
[]
no_license
#include "GameActor.h" bool PZS::GameActor::HandleCollisionWithBarrier(SDL_Rect rect) noexcept { if (abs(hitbox.x - rect.x) > 200) return false; SDL_Rect intersection; if (SDL_IntersectRect(&hitbox, &rect, &intersection)) { if (intersection.w <= intersection.h) { if (hitbox.x < rect.x) hi...
true
b9e8a9c3989129c251dfeb1ba4e3fbcfc5d64632
C++
vinnilla/USC_IntroToCplusplus_Work
/monopolyConsole/Monopoly/action.cpp
UTF-8
320
2.765625
3
[]
no_license
//action.cpp #include "action.h" #include <string> using namespace std; void Action::populate(string text1, string text2, string text3) { text[0] = text1; text[1] = text2; text[2] = text3; return; } void Action::retrieve(string Array[]) { Array[0] = text[0]; Array[1] = text[1]; Array[2] = text[2]; return; }
true
c57e91ddaea0020966041161cbe8b70216547d05
C++
Outerskyb/baekjoon
/7226/main.cpp
UHC
1,914
3.046875
3
[]
no_license
#include <iostream> #include <queue> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); priority_queue<int> q1; priority_queue<int, vector<int>, greater<int>> q2; int ac = 0, dc = 0, in = 0; int T; cin >> T; while (T--) { int k; ...
true
81f8aef2657519fb19a3a711607375bf9bf477fc
C++
thanhchinguyenpk/mario_scene
/05-ScenceManager/GameObject.h
UTF-8
3,260
2.625
3
[]
no_license
#pragma once #include <Windows.h> #include <d3dx9.h> #include <vector> #include "Sprites.h" #include "Animations.h" using namespace std; #define ID_TEX_BBOX -100 // special texture to draw object bounding box class CGameObject; typedef CGameObject * LPGAMEOBJECT; struct CCollisionEvent; typedef CCollisionEven...
true
41eab5bda81b19a30cca113058861f13e28013f1
C++
Devang-25/100DaysOfCode
/nandini3698/Day15/activityselc.cpp
UTF-8
1,633
3.078125
3
[]
no_license
// Geeksforgeeks\Must_do_questions\Greedy Problem-Activity Selection /*Given N activities with their start and finish times. Select the maximum number of activities that can be performed by a single person, assuming that a person can only work on a single activity at a time. Note : The start time and end time of two...
true
100b2109605239aba1099f20e5bca7c8420b34ce
C++
zois-tasoulas/algoExpert
/medium/minNumberOfCoinsForChange.cpp
UTF-8
901
3.296875
3
[]
no_license
#include <iostream> #include <vector> int minNumberOfCoinsForChange(std::vector<int> denominations, int n); int main() { int n{78}; std::vector<int> denominations{5, 1, 10, 50, 25}; std::cout << minNumberOfCoinsForChange(denominations, n) << std::endl; return 0; } int minNumberOfCoinsForChange(std:...
true
120a90cbaf75e4501af109db3a5af1b6b27b4fc1
C++
earljohn004/phonenumber_cpp_exercise
/test/phonedata_model_unit_test.cpp
UTF-8
12,167
2.921875
3
[]
no_license
/** * phonedata_model unit test source - version 1.00 * -------------------------------------------------------- * Created June 2021, * @author Earl John Abaquita (earl.abaquita@outlook.com) * * Description: * contains the unit tests for phonedata_model cpp * **/ #include "common_debug.h" #include "common_def...
true
eb6819eb7c1c779fea079049fc7b93ac47236927
C++
tommitah/cpp_mini_projects
/optimizations/opttest.cpp
UTF-8
171
3.03125
3
[]
no_license
#include <iostream> int main() { double value = 1; while(value < 1000000000000000000) { value += value / (1 / value); } std::cout << value; return 0; }
true
e2a112c2f5f60d6d060646ade01943e3438419bd
C++
tejasborkar74/ProblemSolvingIB-
/Backtracking/Generate_all_Parentheses_II.cpp
UTF-8
401
2.921875
3
[]
no_license
vector<string> ans; void solve(int open,int close,string temp,int n) { if(open>n)return; if(open==n && close==n) { ans.push_back(temp); } if(close>open) { return; } solve(open+1,close,temp + "(",n); solve(open,close+1,temp+")",n); } vector<string> Solution::gener...
true
85f3ff74e7198edcd6d462b119cd7c4be2e747e8
C++
MFC1989/acm
/1166/1166.cpp
UTF-8
1,428
2.75
3
[]
no_license
// 1166.cpp : Defines the entry point for the console application. // //#include "stdafx.h" #include <iostream> #include <cassert> #include <algorithm> #include <map> #include <vector> using namespace std; inline unsigned int factors(unsigned int n) { unsigned int i = 2, k = 0, m = n, count = 1; while (m != 1) { ...
true
db248698391cfca2d285e5159be593d7bbd96cdd
C++
czchen/programming-exercise
/LeetCode/rotate-array/rotate-array-0.cpp
UTF-8
756
2.953125
3
[]
no_license
class Solution { public: int get_gcd(int x, int y) { int z = y % x; if (z == 0) { return x; } return get_gcd(z, x); } void rotate(vector<int>& nums, int k) { if (k == 0) return; int pos = 0; int tmp = nums[pos]; int gcd = get_gc...
true
a761128ba8ae04f2e9d9b16b3e690d24d699fb36
C++
rayburgemeestre/processfighter
/src/states/challenged.cpp
UTF-8
1,457
2.640625
3
[]
no_license
#include "states/challenged.h" #include "states/countdown.h" #include <iostream> #include <SFML/Graphics.hpp> #include <sstream> #include "utils/menu.h" #include "states.h" #include "messages.h" #include "global_game_state.h" extern int window_width; extern int window_height; challenged::challenged(global_game_stat...
true
d6742e01bbeea0b5472c853306397257019761a8
C++
julienmcollins/DTD
/QuiteGoodMachine/Source/GameManager/Public/Timers/SecondsTimer.cpp
UTF-8
1,651
2.875
3
[]
no_license
#include "QuiteGoodMachine/Source/GameManager/Private/Timers/SecondsTimer.h" #include <stdio.h> #include <SDL2/SDL.h> // Initialize timer SecondsTimer::SecondsTimer() : delta_(0), is_paused_(false), is_started_(false) {} // Start timer function void SecondsTimer::Start() { if (is_started_) { return; }...
true
d00b4e70db2a97c5fb5d58e40ad80beac9d3dbb5
C++
project-arcana/arcana-samples
/tests/pm/topo-fuzzer.cc
UTF-8
5,392
2.546875
3
[ "MIT" ]
permissive
#include <nexus/monte_carlo_test.hh> #include <iostream> #include <polymesh/Mesh.hh> #include <polymesh/debug.hh> #include <polymesh/objects.hh> #include <polymesh/properties.hh> #include <typed-geometry/tg-std.hh> namespace { struct Mesh3D { pm::unique_ptr<pm::Mesh> mesh; pm::vertex_attribute<tg::pos3> pos...
true
bd66ca934e9ab96a456e1f996adb8e46f1288041
C++
perfumez/BusReminder
/ReminderScreen/Settings.cpp
UTF-8
2,789
2.59375
3
[]
no_license
#include "Settings.h" #include <codecvt> #include <boost/locale/encoding_utf.hpp> using namespace kudd; namespace { #if 0 // convert UTF-8 string to wstring std::wstring utf8_to_wstring(const std::string& str) { std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv; return myconv.from_by...
true
6f1fdd9d69094e253e32d95fbafaabf768b74a35
C++
domenipavec/Coursera-DiscreteOptimization
/coloring/lsSolver-unfeasible.cpp
UTF-8
6,085
2.78125
3
[ "MIT" ]
permissive
/* * lsSolver-unfeasible.cpp * * Copyright 2014 Domen <domen.ipavec@z-v.si> * * See LICENSE. * */ #include "lsSolver.hpp" #include <algorithm> #include <iostream> #include <stdlib.h> typedef std::pair<uint16_t, uint16_t> colorPair; typedef std::vector<colorPair> pairList; bool sortFunctionDesc(colorPair ...
true
dabef9016469d7340dabc02968c87168faaf9b39
C++
nileshkadam222/C-AND-CPP
/c++/clasnobjects/PH2.CPP
UTF-8
540
3.53125
4
[]
no_license
#include<iostream.h> #include<conio.h> class math { private: float a,b,c; public: void getdata() { cout<<"Enter two numbers: "; cin>>a>>b; } int sum() { c=a+b; return(c); } int sub() { c=a-b; return(c); } float div() { c=a/b; return(c); } int mul() { c=a*b; return(c); } }; ...
true
da66fae4ee38530912db2cba8e9b2f9079f8b4a1
C++
yutatanaka/TestProgram
/コンスト.cpp
SHIFT_JIS
618
3.109375
3
[]
no_license
// RXg #include <stdio.h> // NX class Hoge { const int* const func(const int a)const; // constɏĂ΁As\ // constɏĂ΁Aւs\ // const̒ŏĂ΁AȂ // consťɏĂ΁AoϐȂ }; Hoge h; void main() { int a = 10; int b = 20; const int max = 200;// 萔 int* const pa = &a; // AhX̍Đݒ肪oȂ const int* pb = &b; // gȂ getchar(); }
true
2944668abd22c2786771143d9d8a10d7b4855d36
C++
rodrigobmg/Cloudberry-Kingdom-Port
/Core/src/Content/FilesystemPc.cpp
UTF-8
1,694
3.03125
3
[]
no_license
#include <Content/FilesystemPc.h> #include <Content/File.h> #include <fstream> /** * File implementation for Pc. */ class FilePc : public File { std::fstream fs_; unsigned int size_; private: /// No copying. FilePc( const FilePc & ) { } /// No assignment. FilePc &operator = ( const FilePc & ) { return *...
true
3b2cde4e56b7af64c32dd6ce7159f6b1d4979ce4
C++
vineetsinghrana/gfg_dsa_selfplaced
/Searching/problems/__sqrtOfNo.cpp
UTF-8
1,497
3.546875
4
[]
no_license
// { Driver Code Starts //Initial Template for C #include<stdio.h> // } Driver Code Ends //User function Template for C long long int floorSqrt(long long int x) { // Your code goes here // Base cases if (x == 0 || x == 1) return x; // Do Binary Search for floor(sqrt(x)) int start...
true
68bc954eb1a2a276fc9071924360782b45945fc4
C++
Mo-Dabao/mooc_cpp_bupt
/unit02/oj1/main.cpp
UTF-8
143
2.609375
3
[]
no_license
#include <iostream> #include <string> int main() { int n; std::cin >> n; for (int x = 1; x <= n; x++) { std::cout << x; } return 0; }
true
d08647459a054c485fe12827ec0265913a9e3cfd
C++
SPReddy224/C-Advance
/submission-c++-arif/20th.cpp
UTF-8
408
3.125
3
[]
no_license
#include<stdio.h> /*#include<iostream> using namespace std; int main() { int a, b, c; cout << "enter the value of a" << endl; cin >> a; cout << "enter the value of b" << endl; cin >> b; cout << "enter the value of c" << endl; cin >> c; if (a < b) { cout << " the value of A is less than B " << endl; } els...
true
172d54717b14d1c2b646fe253a4a936dd63a3662
C++
BagasMuharom/FantasyWorld
/Util/Util.cpp
UTF-8
20,338
3.375
3
[]
no_license
#include "Util.h" #include "GL/glut.h" #include <math.h> #include <vector> #include <iostream> #include <array> using namespace std; Vector3::Vector3(){} Vector3::Vector3(float x, float y, float z) { this->x = x; this->y = y; this->z = z; } float Vertex::globalScaleX = -1; float Vertex::globalScaleY = -...
true
bc31da4567ea5d0c305d37035ee8a5a296dd72b4
C++
nongeneric/tinytasks
/tests.cpp
UTF-8
4,285
2.9375
3
[]
no_license
#include <catch2/catch.hpp> #include "task/Task.h" #include "task/Scheduler.h" #include <numeric> #include <random> using namespace task; TEST_CASE("simple_tasks") { Scheduler::init(); auto addInts = [](int a, int b) { return a + b; }; auto getInt = []{ return 10; }; auto getI...
true
05ea4655cd380a960289620b4d7c6fa55d73ea72
C++
y42sora/soraSRM
/00001-00500/SRM494/Div2/PaintingTest.cpp
UTF-8
3,036
3.234375
3
[]
no_license
#include "Painting.h" #include <iostream> #include <vector> using std::cerr; using std::cout; using std::endl; using std::vector; class PaintingTest { static void assertEquals(int testCase, const int& expected, const int& actual) { if (expected == actual) { cout << "Test case " << testCase <<...
true
296198d6cb7b0794e43bc3fc47923cfc06567793
C++
erdincay/MyRobot
/Manager.cc
UTF-8
1,888
2.953125
3
[]
no_license
#include "Manager.h" const int defaultListenPort = 9002; const int defautBroadCastPort = 9000; using namespace std; Manager::Manager(boost::asio::io_service & io_service) :CommPoint(io_service, defaultListenPort), curPt_(boost::posix_time::microsec_clock::local_time()) { } Manager::~Manager() { } int Manager::A...
true
e7e8067b78707220ef6d04c5a4063d7661e59ad8
C++
Derecho-Project/derecho
/src/core/notification.cpp
UTF-8
5,612
2.75
3
[ "BSD-3-Clause" ]
permissive
#include "derecho/core/notification.hpp" #include <cstring> #include <memory> namespace derecho { NotificationMessage::NotificationMessage( uint64_t type, uint8_t* const buffer, std::size_t size, bool owns_buffer) : message_type(type), size(size), body(buffer), owns_body(owns_buffer) { if(size > ...
true
acb18418e7c8c8eb9ee25550bffcb5f037a4f771
C++
piyushnbali/competitive-coding
/Siddhesh/Leetcode/LinkedListCycleII.cpp
UTF-8
1,051
3.140625
3
[]
no_license
// FLOYD'S ALGORITHM // LINK:: https://youtu.be/9YTjXqqJEFE /* APPROACH:: FIRST FIND OUT IF THERE IS A CYCLE ... REFER TO LINKED LIST CYCLE SOLUTION IF THERE IS A CYCLE :: MOVE FIRST PTR TO START AND KEEP SCND PTR WHERE IT IS NOW KEEP MOVING FORWARD EACH PTR... THE POINT WHERE THEY MEET WILL BE THE P...
true
bf2ccc084d96aac99c876e4e47e2e9a626c54012
C++
SimonvBez/MRB_Due
/MRB_Due/servo-driver-pca9685.hpp
UTF-8
3,477
3.234375
3
[]
no_license
/// @file #ifndef SERVO_DRIVER_PCA9685_HPP #define SERVO_DRIVER_PCA9685_HPP #include "hwlib.hpp" /// \brief /// PCA9685 16 Channel Servo Driver /// \details /// This class implements an interface to a 16 Channel Servo Driver. /// The interface is I²C. /// The driver chip is PCA9685. /// /// The Vcc pin is used to ...
true
2d5c30250b946317f209fcd176e2ce1c289d09bd
C++
Niraka/ThirdYearProject
/Source/CollisionsSystem/Vector2D.cpp
UTF-8
6,185
3.875
4
[]
no_license
#include "Vector2D.h" /** Constructs a new Vector2D and sets both the X and Y components to a default of 0. */ Vector2D::Vector2D() { m_fX = 0; m_fY = 0; } /** Constructs a new Vector2D and sets both the X and Y components to the given value. @param fBoth The value. */ Vector2D::Vector2D(float fBoth) { m_fX = fB...
true
64a766435c13598c5d7a9d05696883234671b3f1
C++
Niadus/cst211-data-structures
/DataStructures/array2d_p.hpp
UTF-8
881
2.671875
3
[]
no_license
#ifndef ARRAY2D_P_HPP #define ARRAY2D_P_HPP #include "adt_exception.hpp" #include "i_array2d.hpp" template<class T> class array2d_p : public i_array2d<T> { public: T select(int row, int column) const override; T& select(int row, int column) override; //row<T> operator[](int row) const override; /...
true
96457b6e77758abff84d1178b284eb159d1d80ff
C++
sirAdarsh/CP-files
/PRACTICE/489-C.cpp
UTF-8
1,294
2.765625
3
[]
no_license
/*----- || Hare Krishna || -----*/ /* "WHY DO WE FALL, BRUCE?" */ #include<bits/stdc++.h> #define ll long long #define endl '\n' #define elif else if #define PI 3.1415926535897932384 #define MOD 1000000007 using namespace std; string s; int t; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); ...
true
6a4f3a0b62ebd76f1378af5a684c584e62bed95c
C++
RodrigoNazar/SEP_2018-2
/Lab_7/AVR/USART_3/USART_3.ino
UTF-8
1,594
3.03125
3
[]
no_license
/*************************************************** * This is an example program to demonstrate the * successful implementation of the USART's * receive functions. * * Connect your developer board to a PC and configure * a terminal emulator with the appropriate baud rate * in order to see the test message below...
true
e63e0bef0f463e5c8aaa7c92ff118e906936b49c
C++
drheli/hal
/src/netlist/netlist_factory.cpp
UTF-8
3,037
2.5625
3
[ "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
#include "netlist/netlist_factory.h" #include "core/log.h" #include "core/program_arguments.h" #include "netlist/event_system/event_controls.h" #include "netlist/gate_library/gate_library_manager.h" #include "netlist/hdl_parser/hdl_parser_dispatcher.h" #include "netlist/netlist.h" #include "netlist/persistent/netlist_...
true