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
e273ae14f46a8538a05b780a4564e6da810addf0
C++
kevinbyrom/FootballPoC
/src/Gamelib Source/Actions.cpp
UTF-8
2,270
3.125
3
[]
no_license
#include <windows.h> #include "Gamelib.h" void ACTIONS::Pop() { ///////////////////////////////////////////////// // // // Used to POP the top action off of the stack // // // ///////////////////////////////////////////////// // Return if there are no actions if (NumActions == ...
true
0101e313fc8c69d28c5395e080774e9c09c761e2
C++
DoDoENT/jtorch
/TorchLib/Source/Linear.cpp
UTF-8
2,690
2.734375
3
[]
permissive
#include <math.h> // for fabsf, floor, log10, pow #include <stddef.h> // for NULL #include <stdexcept> // for runtime_error #include "Linear.hpp" #include "Tensor.hpp" // for Tensor, TO_TENSOR_PTR #include "TorchData.hpp" // for TorchData, TorchDataType #define SAFE_DELETE(x) if (x != NULL) {...
true
4cfeca5d3df95c5a9cea5e43a83020acb17448c4
C++
Young-Murloc/1day1quiz
/1일1문제/0414땅따먹기.cpp
UHC
1,897
3.5625
4
[]
no_license
/* Ա Ϸ մϴ. Ա (land) N 4 ̷ ְ, ĭ ֽϴ. 1 ྿ , 4ĭ ĭ 鼭 ; մϴ. , Ա ӿ ྿ , ؼ Ư Ģ ֽϴ. , | 1 | 2 | 3 | 5 | | 5 | 6 | 7 | 8 | | 4 | 3 | 2 | 1 | ־ٸ, 1࿡ ׹° ĭ (5) , 2 ׹° ĭ (8) ϴ. , ִ ִ밪 returnϴ solution Լ ϼ ּ. , 1 ׹° ĭ (5), 2 ° ĭ (7), 3 ù° ĭ (4) 16 ְ ǹǷ 16 return ϸ ˴ϴ. ̳ α׷ / bottom to top / ...
true
fe6527714a33151cc65b44fd9f5d6c0a2b37868e
C++
HanLab-BME-MTU/extern
/mex/include/wildmagic-5.7/include/Wm5TriangleKey.inl
UTF-8
1,732
2.578125
3
[ "BSD-2-Clause" ]
permissive
// Geometric Tools, LLC // Copyright (c) 1998-2011 // Distributed under the Boost Software License, Version 1.0. // http://www.boost.org/LICENSE_1_0.txt // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt // // File Version: 5.0.0 (2010/01/01) //------------------------------------------------------...
true
b542e81164272a40ac552d58300cb80087e5d88c
C++
fruitbox12/WorldSimulator
/actorlevel.h
UTF-8
558
2.953125
3
[]
no_license
#pragma once #include "actor.h" #include "level.h" // OOP: Multiple Inheritance: ActorLevel "IS A(N)" Actor and "IS A" Level class ActorLevel : public Actor, public Level { private: public: ActorLevel(); ActorLevel(int id, string name, string description, int rows, int cols, bool moveable); ~Acto...
true
d2ccc3e4ec173cd5eacc1c73748e7724bb2179db
C++
Mukki/Soccer-Simulator
/Class/Joueur.h
UTF-8
598
2.75
3
[]
no_license
#pragma once #ifndef JOUEUR_H_ #define JOUEUR_H_ #include <string> #include "Parcours.h" #include "Sportif.h" #include <vector> using namespace std; class Joueur : public Sportif { protected: float taille; float poids; string villeNaissance; vector<Parcours> vect_parcours; public: Joueur(); Joueur(string nom,...
true
44c25b9375a0e408e61ac174e28864592be6f633
C++
cies96035/CPP_programs
/Kattis/AC/npuzzle.cpp
UTF-8
436
2.9375
3
[]
no_license
#include<iostream> using namespace std; char puzzle; int sum; int main() { cin.tie(0); ios_base::sync_with_stdio(0); for(int i = 0; i < 4; i++){ for(int j = 0; j < 4; j++){ cin >> puzzle; if(puzzle != '.'){ puzzle -= 'A'; sum += std::abs...
true
d1a55345f8cb77a408a30d591e0d85e8fa500fd7
C++
ayushkhanduri/dsa-algo
/Platforms/LeetCode/implement-strStr.cpp
UTF-8
774
3.3125
3
[]
no_license
//https://leetcode.com/problems/implement-strstr/ // 100% #include "iostream" #include "string" using namespace std; int strStr(string haystack, string needle) { int hayStackSize = haystack.size(), needleSize = needle.size(), index = -1; if ( !needleSize ) { return 0; } for (int i = 0 ; i < hayStackSize ; i ++)...
true
5281be892d373d735e0808168bc46b44d507d896
C++
Sverda/Prosterno
/Prosterno/Game.h
WINDOWS-1250
1,741
3.375
3
[]
no_license
#pragma once #include"GameBase.h" #include"Board.h" #include"Player.h" #include"AI.h" #include<ctime> #include<iostream> using namespace std; // Zarzdza oglnym przebiegiem gry i jest porednikiem pomidzy main a systemem gry. template <typename P, typename E> // P - player, E - enemy class Game: public GameBase { priva...
true
3a497b88efad8e928216322bece5b413a0428912
C++
Gouldian0120/serverclienttcp
/cpp_libraries/utilities/compressing.h
UTF-8
466
2.75
3
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
#pragma once #include <vector> namespace compressing { class compressor { public: static std::vector<unsigned char> compression(const std::vector<unsigned char>& original_data); static std::vector<unsigned char> decompression(const std::vector<unsigned char>& compressed_data); public: static void set_block...
true
bc6a7d86dbc2f59bb76e968de27cfeb051a94193
C++
huynguyenqc/AI-LogicalAgent-Project
/2_1/Source/CNF.h
UTF-8
1,628
2.875
3
[]
no_license
#ifndef CNF_INCLUDED #define CNF_INCLUDED #include <vector> #include <set> #include <string> #include <map> #include <fstream> #include <iterator> #include "Proposition.h" #define OR_OP '|' #define AND_OP '&' #define NOT_OP '~' #define BEGIN_KB "KB" #define END_KB "ENDKB" struct PComp { bool operator () (const...
true
13c593390152a5ea2258146165a6df2487b8c807
C++
Pekkari/cpp-samples
/Module_1/vector_strings/src/vector_strings.cpp
UTF-8
1,557
3.59375
4
[]
no_license
#include "vector_strings.hpp" #include <iostream> #include <vector> enum command { ADD, PRINT, REMOVE, QUIT, }; command str2cmd(std::string input_cmd){ if (input_cmd == "PRINT") return PRINT; else if (input_cmd == "ADD") return ADD; else if (input_cmd == "REMOVE") ...
true
43fa9b1b37cda844517ab6703101692f5049908b
C++
CodeShark/CryptoLedger
/src/LevelDBModel.cpp
UTF-8
2,493
2.8125
3
[]
no_license
#include "LevelDBModel.h" using namespace leveldb; using namespace std; using namespace CryptoLedger; LevelDBModel::~LevelDBModel() { close(); } void LevelDBModel::open(const string& dbname) { if (db_) throw runtime_error("DB is already open."); Options options; options.create_if_missing = true; ...
true
b64e1d67df940ebcb2928d68af6b875a8bc2fc40
C++
yixinx/Go-Game
/computer go 2.0/computer go 2.0/stone.cpp
UTF-8
2,623
2.8125
3
[]
no_license
#include "new_board.h" #include <cstdio> #include <time.h> #include <cstdlib> #include <cstring> #include <process.h> #include <windows.h> #include <iostream> #include <shellapi.h> #include <math.h> using namespace std; stone::stone(int r, int c, board_t * new_board) { row = r; col = c; color = ...
true
d8c9e20b2c1bcb8a386a61f59fd62ff2af5cb33e
C++
Zebsi235/RemoteControl
/Command.h
UTF-8
441
2.796875
3
[]
no_license
////////////////////////////////////////// // Workfile : Command.h // Author : Michael Enzelsberger // Date : 09.01.2021 // Description : Interface for commands. ////////////////////////////////////////// #ifndef COMMAND_H #define COMMAND_H #include <memory> class Command { public: //pure virtual interface virtual...
true
7f56f1697ed5675ff4d974f6eb8cdbfb58900417
C++
BirgandLab/flowProportionalSampler
/Chronodot_time_adjust/Chronodot_time_adjust.ino
UTF-8
1,147
3.0625
3
[]
no_license
// Date, time and temperature functions using // a Chronodot RTC connected via I2C and Wire lib #include <Wire.h> #include "Chronodot.h" Chronodot RTC; void setup () { Serial.begin(9600); Serial.println("Initializing Chronodot."); Wire.begin(); RTC.begin(); RTC.adjust(DateTime(__DATE__, __TIME_...
true
fcec244466867dabd8a0f61a4d38c024cce6cc8e
C++
yangdechuan/algo-notebook
/数据结构/Trie.cpp
UTF-8
1,639
4.03125
4
[]
no_license
/* Trie(we pronounce 'try'),也叫前缀树。 参考:LeetCode 208. Implement Trie (Prefix Tree) */ #include<cstring> #include<string> using namespace std; struct TrieNode { int isEnd; TrieNode* links[26]; TrieNode() { isEnd = 0; memset(links, NULL, sizeof(links)); } }; class Trie { public: Trie...
true
0e3f5e314b2e6819b33f564b1196e37935721b2a
C++
rabaugart/biptest
/test-boost/tprocess/tprocess.cpp
UTF-8
1,686
2.625
3
[]
no_license
// // Starts mercurial (hg summary) and reads the revision number // #include <iostream> #include <regex> #include <boost/program_options.hpp> #include <boost/filesystem.hpp> #include <boost/process.hpp> namespace po = boost::program_options; namespace bfs = boost::filesystem; namespace pr = boost::process; int main...
true
04042379a0cc38b97bdb0d9d96d6a1e0dd507154
C++
aosipov91/rawEngine
/src/renderer/shader.cpp
UTF-8
4,925
2.65625
3
[]
no_license
#include "shader.h" namespace renderer { GLuint load_program(const char *path1, const char *path2, const char *path3) { GLuint shader1 = load_shader(GL_VERTEX_SHADER, path1); GLuint shader2 = load_shader(GL_FRAGMENT_SHADER, path2); GLuint shader3 = load_shader(GL_GEOMETRY_SHADER, path3); ...
true
b6161bcf9df713c7afea418e8520f6d745d6a4b0
C++
maidahahmed/Algorithmic-Toolbox-San-Diego
/Go in depth with each topic/_0_1_KnapSack/_0_1_KnapSack.cpp
UTF-8
2,227
3.359375
3
[ "MIT" ]
permissive
//___________________________________________________________________ // 0-1 Knapsack Problem // Given weights and values of n items, // we need to put these items in a knapsack of capacity W // to get the maximum total value in the knapsack Without Breaking any item(whole OR Nothing) // 1- the Naive Solution (Recur...
true
c04870fee0342b99844833dcc02732a5182e0dd6
C++
MitkoConev/FMI-notes-for-programming
/Object-oriented-programming/week8/main.cpp
UTF-8
1,082
3.0625
3
[]
no_license
#include <iostream> #include <vector> #include "FMIPerson.h" #include "Asistant.h" #include "Lector.h" #include "Student.h" #include "task.cpp" int main() { /* std::vector<FMIPerson*> fmiList; fmiList.push_back(new Asistant()); fmiList.push_back(new Lector()); fmiList.push_back(new Student()); ...
true
e3bc78117a28646ac692f30940c7d1a7489b06bd
C++
adamjoniec/splitscreen
/main.cpp
UTF-8
3,020
2.921875
3
[]
no_license
#include <iostream> #include "arguments.h" #include "windowmanager.h" using namespace std; void printConfiguration(Arguments arguments) { cout << "\n " << MINIMIZE_AT_START_LONG << ", " << MINIMIZE_AT_START_SHORT << " (" << (arguments.minimizeAtStart ? "true" : "false") << ")"; /*cout << "\...
true
30e0ff0d7ed0180c250476e9b83dc226ce994fb7
C++
gkovaig/MedGP
/medgpc/src/mean/c_meanfunc.cpp
UTF-8
1,652
2.625
3
[ "BSD-3-Clause" ]
permissive
/* ------------------------------------------------------------------------- This is the function file for top mean function class. All other mean functions can inherit these functions. ------------------------------------------------------------------------- */ #include <iostream> #include <vector> #include <math.h> #...
true
768f30b90c714e3c20ea73b6c09239a3da3253a6
C++
kimsj0302/algorithm_study
/BOJ/2446.cpp
UTF-8
418
3.328125
3
[]
no_license
#include<iostream> #include<algorithm> using namespace std; void print_n(int n) { for (int i = 0; i < n; i++) { printf("*"); } } void print_b(int n) { for (int i = 0; i < n; i++) { printf(" "); } } int main() { int n; cin >> n; for (int i = n; i > 0; i--) { print_b(n - i); print_n(i*2-1); printf("\n"...
true
86a741ec57e6e628aac54974d0f8a1355a857a83
C++
LeFiz/Fizplex
/src/rhs_scaler_test.cc
UTF-8
984
2.703125
3
[]
no_license
#include "rhs_scaler.h" #include "gtest/gtest.h" namespace fizplex { TEST(RhsScalerTest, AlreadyScaledVectorIsUnchanged) { DVector v = {1.0, -1.0, 0.5, -0.5}; RhsScaler rs(v.max_abs()); rs.scale(v); EXPECT_EQ(v, DVector({1.0, -1.0, 0.5, -0.5})); rs.unscale(v); EXPECT_EQ(v, DVector({1.0, -1.0, 0.5, -0.5}))...
true
b0027eef65aa450bf156e7620ccb066c26ac7411
C++
igokul95/country_state_city_selection
/country_state_citiy_selection/country.h
UTF-8
840
2.859375
3
[]
no_license
#ifndef COUNTRY_H #define COUNTRY_H #include <QObject> #include <QVector> #include "state.h" #include "city.h" struct CountryItem { QString name; States* states; City* cities; }; class Countries : public QObject { Q_OBJECT Q_PROPERTY(int activeCountry READ activeCountry WRITE activeCountry) ...
true
f9a6f1ab80d93e4cad7ea4825f59642def94d3b8
C++
Oscarntnz/IG
/P2/malla.cc
UTF-8
10,384
2.8125
3
[]
no_license
#include "aux.h" #include "malla.h" // ***************************************************************************** // // Clase Malla3D // // ***************************************************************************** Malla3D::~Malla3D(){ v.clear(); f.clear(); a.clear(); a_2.clear(); c_i.clear(); ...
true
f00e312ac4d7683dee44b30e8d43e85b27bc714e
C++
asdlei99/public-note
/c&cpp/qt/learnQt2/16/mySelection/spinbxdelegate.h
UTF-8
1,694
2.734375
3
[]
no_license
#ifndef SPINBXDELEGATE_H #define SPINBXDELEGATE_H #include <QItemDelegate> #include <QSpinBox> class SpinBxDelegate : public QItemDelegate { public: SpinBxDelegate(QWidget *parent=0):QItemDelegate(parent){} //view利用该委托函数进行编辑器的创建, view会自动销毁编辑器的指针 QWidget *createEditor(QWidget *parent, const QStyleOptionVie...
true
7d361d7f0018d95309de4cfa68ece5ef27cd9f9b
C++
antonskvortsov10/Adventure-game
/Adv Proj/AdvProj/hero.cpp
UTF-8
1,950
2.859375
3
[]
no_license
#include "hero.h" void Hero::setMoney(int num) { money += num; emit moneyChanged(money); } void Hero::setHealth(int num) { health += num; if (health <= 0) { this->healthChanged(0); emit heroDead(); emit hero_dead(); } else emit healthChange...
true
53a2f9aa27434277c75a084de443c60ae5267e86
C++
liangzelang/CPP_Primer_Plus
/chapter_7/ex7.8b/ex7.8b/main.cpp
UTF-8
713
3.765625
4
[]
no_license
#include <iostream> const int Seasons = 4; const char * Sname[4] = {"Spring", "Summer", "Fall", "Winter"}; void fill(double *); void show(const double *); struct Expense { double ar[Seasons]; }; int main() { using namespace std; Expense expense; fill(expense.ar); show(expense.ar); system("pause"); return 0; } ...
true
e459b142b7ae857bc5a21bd1143a052f5676265f
C++
Scrumplesplunge/kano
/src/kano/code.cc
UTF-8
1,709
2.734375
3
[]
no_license
export module kano.code; export import <variant>; export import <vector>; export namespace kano::code { enum class builtin_type { boolean, int32, }; struct pointer_type; struct function_type; using type_type = std::variant<builtin_type, pointer_type, function_type>; struct type { template <typename T> type(...
true
f0d4704500aac5c1c155b6af450769fd32768bff
C++
andyspb/cpp-test
/src/lge/antipattern.h
UTF-8
559
2.65625
3
[]
no_license
/* * test_antipattern.h * * Created on: Jan 15, 2016 * Author: andy */ #ifndef SRC_LGE_ANTIPATTERN_H_ #define SRC_LGE_ANTIPATTERN_H_ #include <stdio.h> namespace anti_pattern { class Base { public: int* pointer_to_data_; }; class Derived : public Base { public: Derived() { data_ = 10; point...
true
51415160f69c882957e68debb61e72a26534c02c
C++
dotkt/aDLL
/dlldiscovery/loadintomemory.cpp
UTF-8
1,399
2.921875
3
[ "MIT", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
#include "adll.h" /* ** LoadIntoMemory() is the function that loads the image of the executable or DLL ** that is going to be analyzed in the search of imported DLLs. This function returns ** the pointer that is pointing to the begining of the image. */ LPVOID LoadIntoMemory(LPCWSTR EPath) { HANDLE hFile; PV...
true
a762e0e5211bf1cba9744fc7b29fa5915f0bb8c9
C++
biafrag/Sistemas-Reativos---INF1350
/Tarefa3_2/app/event_driven.ino
UTF-8
1,337
2.515625
3
[]
no_license
#include "event_driven.h" #include "app.h" #include "pindefs.h" bool debounce[3] = {true,true,true}; bool lastState[3] = {HIGH,HIGH,HIGH}; float timeDebounce[3] = {600,600,600}; bool buttonsUsed[3]= {false,false,false}; bool stateButton = false; int buttons[3] = {BUT1,BUT2,BUT3}; unsigned long old = 0; void button_li...
true
cadc336c7b605d4eb9236363d8004266e70301a4
C++
C6H8O7/DirectX-animation
/DirectXAnim/Sprite.h
UTF-8
1,007
2.609375
3
[]
no_license
/** * Header Sprite * * @author Fabsther * @since 03/05/2010 * @version 1.0 */ #ifndef SPRITE__H #define SPRITE__H #include <d3dx9.h> #include <d3dx9tex.h> #include "helper.h" class Sprite { public: LPD3DXSPRITE m_pSprite; LPDIRECT3DTEXTURE9 m_pTexture; RECT *m_pRect; D3DXVECTOR2 *m_pCenter; fl...
true
5706d22b7e485247c242ef744a86d46160fa093b
C++
ms303956362/myexercise
/Cpp/cppprimer/1/test.cpp
UTF-8
483
3.078125
3
[]
no_license
#include <iostream> #include <functional> class Defer { // func std::function<void(void)> f_; public: Defer(std::function<void(void)>& f): f_(f) {} ~Defer() { f_(); } }; void test() { int a = 0; std::function<void(void)> f = [&]() { std::cout << "[end]: a=" << a << std::en...
true
5170cb09e9c3c001dd08cbd2582d894aec9bc24f
C++
Hrishikesh-Thakkar/Competitive-Programming
/108A.cpp
UTF-8
714
2.640625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; if(s[0]=='0' && (s[1]>='6' && s[1]<='9')) cout<<"10:01"<<endl; else if(s[0]=='1' && (s[1]>='6' && s[1]<='9')) cout<<"20:02"<<endl; else { int sec=s[1]-'0'; int first=(s[1]-s[3]); int second=(s[0]-s[4]); sec++;...
true
5bea059cdd5c78dffa71d79cee3afb9035491e05
C++
Augusto-Salda/Algoritmos_y_Estructura_de_datos
/Pila_Dinámica.cpp
UTF-8
2,493
3.703125
4
[]
no_license
#include <iostream> using namespace std; struct Puntero{ int Dato; Puntero *Sig; }; class CPila{ private: Puntero *Temp; Puntero *X; public: void ingresar(int); void sacar(); bool vacia(); void imprimir(); int etope(); CPila(); ~CPila(); }; CPila::CPil...
true
4984911e597d423d62b89a9d80b16b61cc4ff543
C++
shpp-ekondratyev/cs-b-fractals
/Sierpinski/src/sierpinski.cpp
UTF-8
1,389
3.453125
3
[]
no_license
/* * File: sierpinski.cpp * --------------------------- * */ #include <iostream> #include "gwindow.h" #include <cmath> using namespace std; /* Function prototypes */ void drawTriangle(GWindow window, GPoint top, double EDGE_LENGTH, int cycleCount); /* Global variables/constants */ const double EDGE_LENGTH = 314...
true
de07f3ff1f882e12eb00a4e31343dfca4876b509
C++
nazarov-yuriy/contests
/gvzhf/p18/p1889.cpp
UTF-8
1,354
3.21875
3
[]
no_license
#include <iostream> #include <unordered_map> #include <set> using namespace std; int main() { int n, id = 0; cin >> n; unordered_map<string, int> ids; int langs[1001]; ids["unknown"] = id++; for (int i = 0; i < n; i++) { string str; cin >> str; if (!ids.count(str)) ids[...
true
66528de09ec0d3cff4e39ed75cc391642dea02cb
C++
qkrwjdtn1236/C-Language-Algorithm
/소수/4/main.cpp
UHC
419
3.640625
4
[]
no_license
#include <iostream> //2 100 Ҽ ϰ Ҽ Ȯ ϱ; using namespace std; int main() { int i,j; int num = 0; for(i = 2;i<=100;i++) { for(j = 2;j<i;j++) { if(i%j == 0) break; } if(i == j) num++; } cout<<"2 100 Ҽ : "<<num<<endl; cout<<"Ҽ Ȯ : "<<(num/99.0)*100<<'%'<<endl; return 0; } ...
true
ab460f19ca189fb54d2c5e0506b353710802fa01
C++
saswatsk/Comprehensive-C
/STL And DS & Algo/Arrays/Programs/Program to add two numbers stored in a 2 arrays/main.cpp
UTF-8
1,452
3.71875
4
[]
no_license
// program to add 2 numbers in 2 arrays #include<iostream> using namespace std; // main function to add the arrays void addArrays(int arr1[], int arr2[], int arr3[], int n1, int n2, int n3) { int carry = 0; int count = 0; int temp = 0; // for the entire len of arr3 which is always one more than max(n1...
true
52c9190d0bfba63448d725f626d1da78777d7df5
C++
VictorBusk/E3PRJ3-Gruppe1
/DevKit/Semesterprojekt3/plannerdialog.cpp
UTF-8
1,570
2.75
3
[]
no_license
/*! * @file light.cpp * @brief Displaying and managing dialog-UI input * @author Victor Busk (201409557@post.au.dk) */ #include "plannerdialog.h" #include "ui_plannerdialog.h" #include <QWidget> /*! * @brief Sets up dialog startup * @param[in] parent QWidget UI setup. *...
true
67427d74644f934ea4b0e086e1460234f90a63e8
C++
VoyakinH/OOP
/Lab_01/operations.cpp
UTF-8
2,447
3.09375
3
[]
no_license
#include "operations.h" //#include <math.h> //#include "defines.h" //#include "object.h" static void move_point(point_t &point, const struct move &mo) { point.x += mo.dx; point.y += mo.dy; point.z += mo.dz; return; } int move_object(object_t &object, const struct move &mo) { int err = check_object...
true
323c716ebf24baec511f311678b1bcebc86431bd
C++
shtanriverdi/Full-Time-Interviews-Preparation-Process
/Weekly Questions/173. Binary Search Tree Iterator.cpp
UTF-8
1,329
3.6875
4
[]
no_license
// Question Link ---> https://leetcode.com/problems/binary-search-tree-iterator/ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), rig...
true
ca23bd791b7846ed59b54a1ffeed6fa8fc5fd857
C++
rafaelacruzmarques/SIN-142---Projeto---Final
/main.cpp
UTF-8
586
3.046875
3
[]
no_license
#include <iostream> #include<stdio.h> #include "funcoes.h" //define o número de linhas e colunas da matriz de vetores #define LINHAS 6 #define COLUNAS 1000000 int main() { //alocacao das linhas da matriz int** matriz = (int**) malloc(LINHAS*sizeof(int*)); //alocacao das colunas da matriz for(int n = 0; n < LINHAS...
true
c340b556f24e2f11f7c5236d4c8c797bcb5fd295
C++
x4nemi/proyecto_videojuego
/civilizacion.h
UTF-8
1,846
3.484375
3
[]
no_license
#ifndef CIVILIZACION_H #define CIVILIZACION_H #include <vector> #include <string> #include <algorithm> #include <iostream> #include <iomanip> #include <fstream> using namespace std; class Civilizacion{ private: string nombre; int x; int y; float puntuacion; public: Civ...
true
5a8b26fd1b37c72bf358f341b7814e168211a364
C++
alexswin/IntegerRiddleSolver
/main.cpp
UTF-8
3,068
3.40625
3
[]
no_license
#include <iostream> #include <set> #include <map> #include <vector> #include <cmath> using namespace std; /* Paul and steve are two perfect logicians. They have been told there are two integers x and y such that 1 < x < 1 and x + y < 100, but have not been told what x and y are exactly. Steve is given the value of x...
true
4171a355a16f32d9d65dc75262cb35ae0e13817a
C++
liquidmetal/dwa-hacks
/MapLoader.h
UTF-8
826
2.609375
3
[]
no_license
#pragma once #include <vector> #include "Vector.h" using namespace math; class MapLoader { public: bool** loadMap(char* filename); bool** loadVDBMap(char* filename); Vec2f getStartPosition(); Vec2f getEndPosition(); unsigned int getNumRows(); unsigned int getNumCols(); float** getSDF(); //...
true
c99c946069d97a7abb3faa2e93ebc5caae9e6ff9
C++
0xc0dec/solo
/src/solo/lua/SoloLuaMathApi.cpp
UTF-8
11,580
2.546875
3
[ "Zlib" ]
permissive
/* * Copyright (c) Aleksey Fedotov * MIT license */ #include "math/SoloRadians.h" #include "math/SoloDegrees.h" #include "math/SoloVector2.h" #include "math/SoloVector3.h" #include "math/SoloVector4.h" #include "math/SoloQuaternion.h" #include "math/SoloMatrix.h" #include "math/SoloRay.h" #include "Sol...
true
32c0cc639275d214f7914f1cf2163ae91d578c64
C++
benjaminulmer/subdivision-framework
/skeleton/InputHandler.cpp
UTF-8
2,889
2.8125
3
[]
no_license
#include "InputHandler.h" Camera* InputHandler::camera; RenderEngine* InputHandler::renderEngine; Program* InputHandler::program; int InputHandler::mouseOldX; int InputHandler::mouseOldY; bool InputHandler::moved; // Must be called before processing any SDL2 events void InputHandler::setUp(Camera* camera, RenderEngin...
true
31e358677fe37c9e80f634e26299eaf51c693e59
C++
ashish1500616/Programming
/4.Interview-Bit/Searching/kth_smallest_element_in_an_array.cpp
UTF-8
687
3.34375
3
[]
no_license
// Unsorted Read Only Array Find the Kth Minimum. bool helper(const vector<int> &A, int v, int B) { int cnt = 0; for (auto x : A) { if (x <= v) { cnt++; } } if (cnt >= B) { return 1; } return 0; } int Solution::kthsmallest(const vector<int> &A...
true
122745d6a48b3a40633d09451151e6e9a19122ea
C++
MicrosoftDocs/cpp-docs
/docs/atl/codesnippet/CPP/programming-with-ccombstr-atl_3.cpp
UTF-8
648
3.609375
4
[ "CC-BY-4.0", "MIT" ]
permissive
// The wrong way to do it BSTR * MyBadFunction() { // Create the CComBSTR object CComBSTR bstrString(L"Hello World"); // Convert the string to uppercase HRESULT hr; hr = bstrString.ToUpper(); // Return a pointer to the BSTR. ** Bad thing to do ** return &bstrString; } // The correct way to do it H...
true
850b868da8b917b7181d29cbd2c1f1152f48c569
C++
monowireless/Act_samples
/act2/act2.cpp
UTF-8
596
2.765625
3
[]
no_license
#include <TWELITE> const uint8_t PIN_DO1 = 18; int iLedCounter = 0; /*** the setup procedure (called on boot) */ void setup() { pinMode(PIN_DO1, OUTPUT); digitalWrite(PIN_DO1, LOW); // TURN DO1 ON Timer0.begin(10); // 10Hz Timer Serial << "--- act2 (using a timer) ---" << crlf; } /*** loop procedu...
true
1ee3e234c2fb47e6ff65b67f5d0ea6e4f4aa8d3c
C++
ajinkyakulkarni/CommodityADS2016Code
/Utils/Utils.h
UTF-8
5,277
3.15625
3
[]
no_license
#ifndef UTILS_H #define UTILS_H #include <new> #include <cassert> #include <limits> #include <utility> #include "Debug.h" using namespace std; namespace igmdk{ struct EMPTY{}; template<typename ITEM> ITEM* rawMemory(int n = 1) {return (ITEM*)::operator new(sizeof(ITEM) * n);} void rawDelete(void* array){::operator...
true
a72d96fd126c8fc9a2b94dc90e0334f6d4c1e0c6
C++
Crawping/fishjam-template-library
/Temp/STL/STLTester/STLMemoryTester.h
GB18030
2,452
2.875
3
[]
no_license
#pragma once #include <cppunit/extensions/HelperMacros.h> /********************************************************************************************************* * C++üԷΪ * ʽ( CComPtr) -- ҪԴάüͬʱṩüĹӿ * ʽ( shared_ptr) -- ԴûκҪ,ȫʽüָԴⲿάü * * STLṩָauto_ptrԽ׳쳣ʱڴй© * auto_ptr ڿʱָȨתƣָᱻΪNULLͨ const auto_pt...
true
c55b69108261954b60dee860ce40c085b8fb3c7a
C++
antmicro/verible
/common/util/range.h
UTF-8
3,825
2.546875
3
[ "Apache-2.0" ]
permissive
// Copyright 2017-2020 The Verible Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law o...
true
ab6f2402420300a6f1e3794eaceff5975c4b9733
C++
motis-project/net
/example/https_example.cc
UTF-8
2,971
2.578125
3
[ "MIT" ]
permissive
#include <iostream> #include "net/http/client/https_client.h" using namespace net::http::client; // CMakeLists.txt example (i.e. for GCC/Clang) /* cmake_minimum_required(VERSION 2.6) project(request) add_subdirectory(net EXCLUDE_FROM_ALL) include_directories(net/include) add_executable(request main.cc) target_link_...
true
700df545385522d6c581a66aec561f78347187db
C++
JohnLonginotto/ACGTrie
/acgtrie/c_mikhail_acgtrie/DnaBase.cpp
UTF-8
6,716
2.6875
3
[]
no_license
#include "StdAfx.h" #include "DnaTrieBuilder.h" int CSequenceUp2Bit::GetLength() const { int zeroBitCount = 0; unsigned int curBlock; assert(sizeof(TSequenceUp2BitStorage) == 8); // This method implemented for 8-byte codes assert((up2BitCode >> 32) == ((int *)&up2BitCode)[1]); // Sometimes ...
true
5dac27fe2b883c9cd5eda71eab0fb1d0311d587b
C++
kmgumienny/Systems-Programming
/Event Driven Simulation/Banking Simulation Files/event.cpp
UTF-8
944
3.5
4
[]
no_license
//event.cpp - kmgumienny #include <stdio.h> #include <stdlib.h> #include <iostream> #include <queue> #include "event.h" /* * getEvent creates an event and takes the first thing from the * queue an assigns it to the new event, running it through the action * method. The queue then gets rid of that event. Used in si...
true
b493ca6b40c2c85cf93c07ea098c8d94094c58ee
C++
king7282/algorithm
/boj/Others/1267.cpp
UTF-8
325
2.921875
3
[]
no_license
#include <stdio.h> int main(void) { int n; scanf("%d", &n); int M = 0, Y = 0; for (int i = 1; i <= n; i++) { int input; scanf("%d", &input); Y += (input / 30 + 1) * 10; M += (input / 60 + 1) * 15; } if (Y < M) printf("Y %d\n", Y); else if (Y > M) printf("M %d\n", M); else printf("Y M %d\n", ...
true
94fa0c56ed9725ddfcbb6c07f8c5849c8aa55143
C++
kailasspawar/DS-ALGO-PROGRAMS
/Trees/BinTree/ConvertGivenBTtoItsSumTree.cpp
UTF-8
577
3.1875
3
[]
no_license
#include<iostream> #include"Bintree.h" using namespace std; int toSumTree(bnode root) { if(root==NULL) return 0; int old_val = root->data; root->data = toSumTree(root->left) + toSumTree(root->right); return root->data + old_val; } int main() { bnode root = NULL; root = newNode(10); root->lef...
true
247c3687f6d9dbbb54775934ffce6e2b3845f318
C++
Erecorn/Brasseur_Corentin_Test_Technique
/Bronze(versionAvecAideDuGitPresentDansLeRapport).cpp
UTF-8
5,916
2.75
3
[]
no_license
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <math.h> using namespace std; /***** Var global *****/ /**********************/ /*******fonction*******/ void addCP(int nextCheckpointX, int nextCheckpointY, vector<vector<int>>* vectorCP, vector<int>* actualCP, bool* lis...
true
9007b28d889a50e1a29333908ec2acdd4b3eae67
C++
samkit993/competitve_prog
/codechef/COOLING.cpp
UTF-8
952
2.65625
3
[]
no_license
#include<iostream> #include<cstdio> #include<stack> #include<vector> #include<algorithm> using namespace std; int main(){ int tCases; scanf("%d",&tCases); for(int p=0;p<tCases;++p){ int n; scanf("%d",&n); vector<int> pies(n,0); vector<int> racks(n,0); for(int i=0;i<n...
true
a51426b40e3590d629c4d7859cbc3be6b27a25fd
C++
ETLang/Sharpish
/Build/include/Rational.h
UTF-8
2,131
3.140625
3
[ "MIT" ]
permissive
#pragma once namespace CS { struct Rational { int32_t Num; uint32_t Den; Rational() { } Rational(const Rational& copy) : Num(copy.Num), Den(copy.Den) { } Rational(int32_t x) : Num(x), Den(1) { } Rational(int32_t num, uint32_t den) : Num(num), Den(den) { } template<int Precision = 8> static Ration...
true
c66545326c3f6f8667054c8bc3c19d12deb77a7e
C++
nervmaster/Graphs
/grafo.cpp
UTF-8
10,709
3.03125
3
[]
no_license
#include "grafo.h" // PUBLICOS Grafo::Grafo(int nvertice) { this->nvertice = nvertice; this->nvertice_atual = nvertice; listaVertice = new Vertice*[nvertice]; //Cria um array com os todos os objetos vertice }//Construtor int Grafo::novoVertice(int id, string nome) { //Cria um novo vertice com seu nome if(l...
true
822b859ee7de1682b848d2110710966dc71c9cae
C++
Sourav9063/Cpp-All-codes
/cpp prac/Bubble sort with steps.cpp
UTF-8
1,804
2.625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; // __int64 variable; cin cout diye // __uint64 variable; #define lli long long int //lld #define ulli unsigned long long int //llu #define db double //lf #define Ld long double //Lf #define pf printf #define sf scanf #define nl printf("\n") #define plf(a) printf("%lld",a) #...
true
3c93ac3beb4e991eb7ab9edacf12a90ab5df6dc0
C++
sammiiT/leetcode
/greedy/945. Minimum Increment to Make Array Unique.cpp
UTF-8
1,600
3.578125
4
[]
no_license
//===類似題=== 946. Validate Stack Sequences 2233. Maximum Product After K Increments //===思路1==== (*)依據題意, 每一個數加1, 代表一個movement, 求總共的movement, 讓數列每一個數值不相等 (*)利用map<int,init>; (value, count) -不用unordered_map<int,int>, 因為不會對key作排列;會出錯 1.遍歷數列,並用map<int,int>記錄每一個數出現的個數 2.遍歷map<int,int>,若數值出現的次數大於1 - 多於的個數累加到 [a.first+1]的個數中...
true
b8876f39c6d787a026ed32ced2f81ca7ed285607
C++
SoltiHo/LeetRepository
/Validate_Binary_Search_Tree/Validate_Binary_Search_Tree/Validate_Binary_Search_Tree.h
UTF-8
1,593
3.765625
4
[]
no_license
// Given a binary tree, determine if it is a valid binary search tree(BST). // // Assume a BST is defined as follows : // // The left subtree of a node contains only nodes with keys less than the node's key. // The right subtree of a node contains only nodes with keys greater than the node's key. // Both the left and...
true
5394ab3b043e4e1cda3c68917041d270fbf872d9
C++
gabrieldinse/Neat
/Neat/src/Neat/Graphics/Cameras/Camera2D.h
UTF-8
2,518
2.5625
3
[ "Apache-2.0" ]
permissive
#pragma once #include "Neat/Graphics/Cameras/Camera.h" #include "Neat/Core/Log.h" namespace Neat { enum class KeepAspect { Height, Width }; class Camera2D { public: Camera2D(const Vector2F& position, float size, KeepAspect keepAspect = KeepAspect::Height); Camera& getC...
true
1db484d684d4a8c91898096a2b4d959ea72fdcee
C++
KacperCichosz96/Ball-trajectory-calculation
/BallTrajectoryCalc/funcs.cpp
UTF-8
1,303
2.859375
3
[]
no_license
#include "defs.h" void display_all(const cv::Mat* imgs, std::string name, bool to_save) { std::string temp_name; for (int i = 0; i < 3; i++) { temp_name = name + " " + std::to_string(i + 1); cv::namedWindow(temp_name); cv::imshow(temp_name, imgs[i]); if(to_save) cv::imwrite((temp_name +".jpg"), imgs[i])...
true
c553013739027fed51849ee5819e0bc77944b2e9
C++
iroot900/Algorithm-Practice-300-Plus
/187 Repeated DNA Sequences.cpp
UTF-8
1,031
2.78125
3
[]
no_license
class Solution { public: vector<string> findRepeatedDnaSequences(string s) { unordered_map<int,pair<int,int>> seqDict; int n=s.size(); vector<string> result; if(n<10) return result; int last=0; for(int i=0;i<10;i++) { last=last*4+tran(s[i]...
true
e258e3fffcb458169717b786f55b592c84b68298
C++
sagarsubedi/competitive_notes_cpp
/multiset.cpp
UTF-8
1,617
4
4
[]
no_license
#include <iostream> #include <set> using namespace std; typedef multiset<int>::iterator It; int main(){ // elements are ordered // can store multiple same element // once values are inserted, they can't be modified // associative container. Refer by key or value (both are same) // elements are re...
true
e33d0497a48a80b46161e9d898d158fe10a3e68a
C++
Slavq/MarchingCubesSlavq
/Plugins/Voxel/Source/Voxel/Private/VoxelNetworking.cpp
UTF-8
3,817
2.546875
3
[ "MIT" ]
permissive
#include "VoxelPrivatePCH.h" #include "VoxelNetworking.h" AVoxelTcpSender::AVoxelTcpSender(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { SenderSocket = NULL; ShowOnScreenDebugMessages = true; } void AVoxelTcpSender::EndPlay(const EEndPlayReason::Type EndPlayReason) { Super::EndPlay(EndP...
true
06e5ee974fb77f2aa8292731adf9810155132812
C++
codeljs/hello-world
/TestDataType.cpp
GB18030
338
3.25
3
[]
no_license
#include<iostream> using namespace std; int main() { //list initialization; int x{ 1 };//ʹ1.0ʽ cout << x << endl; //static_cast cout << 1 / 2 << endl; cout << static_cast <double> (1 / 2) << endl; cout << static_cast<double>(1) / 2 << endl; cout << 1.0f / 2.f << endl; return 0; }
true
9b154fd79e7fc505c6af47e6ffd4e2eb0b8a728a
C++
lausai/UVa
/2_stars/880.cpp
UTF-8
476
2.78125
3
[]
no_license
#include <cstdio> #include <cmath> using namespace std; unsigned long long AddN(unsigned long long n) { return (n * (n+1)) / 2; } int main() { unsigned long long n = 0; while (scanf("%llu", &n) != EOF) { unsigned long long i = sqrt((long double)n * 2); while (AddN(i) < n) ...
true
2b9be747ff0409ed09d2a02dbddca54f32dff165
C++
orihehe/Codeforces
/Codeforces Round #570 (Div. 3)/H - Subsequences (hard version).cpp
UTF-8
1,197
2.59375
3
[]
no_license
/* dp[인덱스][길이] - 현재 인덱스의 글자를 마지막으로 하는 x길이의 subsequence개수를 저장 이것은 x-1길이의 가장 가까운 a,b,c,...,y,z로 끝나는 개수의 합과 같다 */ #include <cstdio> #include <algorithm> #include <cstring> #define ll long long using namespace std; /* 🐣🐥 */ ll dp[101][101]; bool use[26]; char st[101]; int main() { int n; ll kk, ans = 0, cnt = 0; sca...
true
90a35acaba01dfb25166b7e52aa278707630c1e4
C++
DanielCorreia21/CGJ-TeamProject
/TeamProject/Matrix3d.h
UTF-8
2,735
3.3125
3
[]
no_license
#pragma once #include <string> #include "Matrix2d.h" #include "Vector3d.h" /* AUTHORS * Group: 11 * Bernardo Pinto - 98734 * Daniel Correia - 98745 */ class Matrix3d { private: float values[3][3]; public: //Constructors Matrix3d(float columnMajorArray[9]); Matrix3d(float matrix[3][3]); //---------------------- ...
true
eef20ae93f49d94be1191d993fa6d9e2583c52c4
C++
AntonBaracuda/caesar3_source
/basic.cpp
UTF-8
6,359
2.546875
3
[]
no_license
#include "variables.h" #include "basic.h" int fun_getStringWidth(const char *str, int fontId) { unsigned __int8 c; // [sp+4Ch] [bp-14h]@12 signed int letterSpacing; // [sp+50h] [bp-10h]@3 signed int spaceWidth; // [sp+54h] [bp-Ch]@3 int stringWidth; // [sp+58h] [bp-8h]@1 signed int maxlen; // [sp+5...
true
52393b23db577c665ee567079218fc88725b6af9
C++
MarkOates/beary2d
/src/world_screen.cpp
UTF-8
3,202
2.53125
3
[]
no_license
#include <beary2d/world_screen.h> #include <beary2d/map.h> #include <beary2d/player.h> #include <beary2d/entity.h> #include <beary2d/tile_layer.h> NewWorldScreen::NewWorldScreen(Display *display, Player *player) : BScreen(display, "world_screen") , level(NULL) , camera(0, 0, display->width(), display->height())...
true
06660a439b14cfa7412e12135f7f94e050d3ec07
C++
funkey/cohear
/InheritanceMatchDelegateStrategy.h
UTF-8
3,736
2.828125
3
[ "MIT" ]
permissive
#ifndef COHEAR_INHERITANCE_MATCH_DELEGATE_STRATEGY_H__ #define COHEAR_INHERITANCE_MATCH_DELEGATE_STRATEGY_H__ #include "Delegate.h" #include "CallbackDescription.h" #include "detail/SignalTraits.h" #include "ExactMatchDelegateStrategy.h" namespace chr { /** * A get-delegate-strategy, that creates a delegate from a ...
true
a6058f340e837d05126388f82563c1c202006ee1
C++
divinedev/GWEN
/gwen/src/Controls/HorizontalSlider.cpp
UTF-8
1,878
2.53125
3
[ "MIT" ]
permissive
/* GWEN Copyright (c) 2010 Facepunch Studios See license in Gwen.h */ #include "Gwen/Controls/Slider.h" #include "Gwen/Controls/HorizontalSlider.h" using namespace Gwen; using namespace Gwen::Controls; using namespace Gwen::ControlsInternal; GWEN_CONTROL_CONSTRUCTOR( HorizontalSlider ) { m_SliderBar->SetHorizo...
true
7f98b619de9262912c42257c1930735b11354e15
C++
Twiebs/practice_tracking_tool
/json_serialize.cpp
UTF-8
1,745
2.9375
3
[]
no_license
#include "thirdparty/json.hpp" #include <fstream> void SerializeTaskList(const TaskList& taskList) { nlohmann::json json; json["lastAccessTime"] = 0; for (size_t i = 0; i < taskList.tasks.size(); i++) { auto& task = taskList.tasks[i]; json["tasks"][i]["name"] = task.name; json["tasks"][i]["descripti...
true
4881d0af3167ab9b1aabeba56ed845573710f27f
C++
saulocalixto/UriJudge
/desafio_bino.cpp
UTF-8
711
3.40625
3
[]
no_license
#include <iostream> using namespace std; int main() { int quant_num; cin >> quant_num; int numeros[quant_num], laco, mult2 = 0, mult3 = 0, mult4 = 0, mult5 = 0; for(laco = 0; laco < quant_num; laco++) { cin >> numeros[laco]; if (numeros[laco] % 2 == 0) mult2++; ...
true
31849f4a55249fdac2ea2a5ed84c0419e57b6dc8
C++
God-father1/C-CC-
/recursion/printarray.cpp
UTF-8
586
3.5625
4
[]
no_license
// { Driver Code Starts #include <iostream> using namespace std; void printArrayRecursively(int arr[],int n); int main() { int T; cin>>T; while(T--) { int N; cin>>N; int arr[N]; for(int i=0;i<N;i++) cin>>arr[i]; printArrayRecursively(arr,N); cout<<endl; } return 0; }//...
true
07b1545397aa04008e9ada828ceb647d2dec409c
C++
hafewa/MoonEngine
/ToyBox/Coroutine.h
GB18030
1,945
2.9375
3
[ "MIT" ]
permissive
#pragma once #include<memory> #include<functional> #include<queue> #include<unordered_map> #include<windows.h> #define yield_return() Coroutine::get_current_coroutine()->yield() enum class CoroutineState { init, running, suspend, term }; // Based on: https://github.com/Taoist-Yu/Coroutine_Win. class Coroutine : ...
true
d7ba1c79715e9e0cd195463e1ef122c9ed0a8c77
C++
ph4r05/polynomial-distinguishers-cpp
/DataSource/DataSourceDecim.cpp
UTF-8
1,567
2.546875
3
[]
no_license
// // Created by Dusan Klinec on 21.06.16. // #include <sstream> #include "DataSourceDecim.h" #define DECIM_DEFAULT_IV_LEN 16 #define DECIM_DEFAULT_KEY_LEN 16 DataSourceDecim::DataSourceDecim(unsigned long seed, int rounds) { this->m_gen = new std::minstd_rand((unsigned int) seed); this->m_rounds = (unsigned)...
true
36a2802fbed72805e2d355041a0e9fed1a0b1030
C++
rohanpillai/bit-torrent
/src/parser.cpp
UTF-8
6,319
2.9375
3
[]
no_license
#include <parser.h> using namespace std; bool isString(char *str) { if ((((int) str[0]) > 47) && (((int) str[0]) < 58)) { return true; } return false; } string getValue(char *str, char **next) { ostringstream oss; while ((*str) != ':') { oss << (*str); str++; } str++; int size = stoi(oss....
true
33ec6cf4cd4c9bfa9b71f82f9dc79cb35be4aad5
C++
retrobrain/qChess
/Chess/chesspiece.cpp
UTF-8
2,871
3.046875
3
[]
no_license
#include "chesspiece.h" ChessPiece::ChessPiece(QObject *parent) : QObject(parent) { } ChessPiece::ChessPiece(const PieceType &type, const PieceColor &color) : QObject(), m_type(type), m_color(color), m_bFirstMoveMade(false) { switch (m_type) { case PieceType::Knight: m_...
true
6c1d24e81bb864bd0db01b25c4fd37d8fb35a3b4
C++
sashank-tirumala/mechatronics_lab_project
/17_ButtonLCD_Count/17_ButtonLCD_Count.ino
UTF-8
2,027
3.203125
3
[]
no_license
/* Button Turns on and off a light emitting diode(LED) connected to digital pin 13, when pressing a pushbutton attached to pin 2. The circuit: - LED attached from pin 13 to ground - pushbutton attached to pin 2 from +5V - 10K resistor attached to pin 2 from ground - Note: on most Arduinos there is al...
true
89212cb221f506e88d5c8f00e2a20aa0545e1f46
C++
brunoassish/poorSnake
/snake_.h
UTF-8
1,280
3.078125
3
[]
no_license
#pragma once #include "entity.h" #include "screen.h" class Snake : public Entity { private: unsigned short int length; Entity mytail[15]; bool tail[15]; public: Snake () { setPos(30,30); setLength(3); for (int i = 0; i < 3; i++) mytail[i] = new Entity(position.x...
true
0052ed80ec3cac68a51b394c8b7e833af40e48cd
C++
nicoperetti/TAP-2016
/UVA/10646.cc
UTF-8
962
3.203125
3
[]
no_license
#define toDigit(c) c-'0' #include <cstdio> #include <iostream> #include <vector> #include <string> using namespace std; int value(string card) { if (isdigit(card[0])) { return toDigit(card[0]); } else { return 10; } } int main() { int TC; int i; // iterator int index_pile; ...
true
0fd3fcc3488544cac210d151ca00ce00342b9705
C++
saranshrawat/Data-structure-and-algorithms
/strings/strings 1st/longest recurring subsequce in a string.cpp
UTF-8
590
3.171875
3
[]
no_license
//dynamic programming --- length of longest recurring subsequecne #include<iostream> #include<vector> #include<string> using namespace std; void lrs(string s) { int n=s.length(); int arr[n][n]={}; for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++) { if(s[i-1]==s[j-1] &&i!=j) //this...
true
2019f43a7dc29fb7846d1e73cd86946195dbb742
C++
l1021635438/Game_zinx
/customer/Player/aoi.cpp
UTF-8
3,220
2.671875
3
[]
no_license
#include "aoi.h" AOIMgr *AOIMgr::pxAoiMgr = NULL; Grid::Grid(int _gid, int _minx, int _maxx, int _miny, int _maxy):Gid(_gid), MinX(_minx), MaxX(_maxx), MinY(_miny), MaxY(_maxy) { } void Grid::Add(PlayerRole * _player) { players.push_back(_player); } void Grid::Remove(PlayerRole * _player) { playe...
true
d72d108655cdf6bb6ed0ed7d69af588abf7499ba
C++
Bifido/NetworkingProgramming
/ProfSolution/netlib/BitStream.h
UTF-8
2,851
2.84375
3
[]
no_license
// // BitStream.h // superasteroids // // Created by Cristian Marastoni on 31/05/14. // // #pragma once #include <string.h> #include "NetTypes.h" #include <string> class BitStream { public: BitStream(); BitStream(uint8 *data, size_t size, bool read=false); BitStream(const uint8 *data, size_t size); ...
true
0efde6015feb13190adf169b17512c432467d049
C++
HassanDhariwal/my_programs-
/time calculation/funcations/Level 1/program 5/5.cpp
UTF-8
294
3
3
[]
no_license
#include<iostream>//take nothing retrun nothing void whether(); using namespace std; int main() { whether(); } void whether() { int a; cout<<"enter a number for whether even and odd:"; cin>>a; if(a%2==0) // cout<<"Even no is"<<" : "<<a<<endl; else cout<<"odd no is"<<" : "<<a<<endl; }
true
ef08c48ec73e0ce48fada8a211bcec38f170656f
C++
Uxell/SimulatedAnnealing_JobShop
/cpp_code/task.cpp
UTF-8
290
2.765625
3
[ "MIT" ]
permissive
#include "task.h" Task::Task() {} void Task::setMachineId(int machine_id) { this->machine_id = machine_id; } void Task::setDuration(int duration) { this->duration = duration; } int Task::getMachineId() { return this->machine_id; } int Task::getDuration() { return this->duration; }
true
34ba0cea7f95c7ece0a22abe8ba588682196edda
C++
harababurel/homework
/sem5/pkc/classpher/util/factorization.cc
UTF-8
501
2.546875
3
[]
no_license
#include "factorization.h" #include "ntl_hash.h" namespace f11n { Factorization Factorization::operator&(const Factorization& other) const { Factorization common; for (const auto& factor : factors()) { const auto& base = factor.first; const auto& exponent = factor.second; if (other.Contains(base)) {...
true
0069368256bba9a573e1a8fd94e6e3b7d3a07fea
C++
0llamh/university
/Object Oriented Programming/assignments/assignment3/time.cpp
UTF-8
7,993
3.5625
4
[]
no_license
#include <iostream> #include <iomanip> #include "time.h" using namespace std; //FRIEND FUNCTIONS bool operator<(const Time& t1, const Time& t2) { //ALL BOOL FUNCTIONS ARE DEFINED USING THIS ONE. ALL OTHER //BOOLS HAVE REFERENCE BACK TO HERE JUST TO MAKE BUG FIXING EASIER if (t1.day < t2.day) return t...
true
f27b9db5de039b833e3777e59a70616cc20dddb8
C++
Harkaan/imPROVE
/Engine/TextureCache.cpp
ISO-8859-1
721
3.171875
3
[]
no_license
#include "TextureCache.h" #include <iostream> namespace Engine { TextureCache::TextureCache() { } TextureCache::~TextureCache() { } Texture TextureCache::getTexture(std::string texturePath) { //Cherche la texture dans le cache auto mit = _textureMap.find(texturePath); //Si la texture recherche n'est p...
true