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
c8ebd8ce7112c93eedae017460503ed47d5bdd6b
C++
abhidurg/CSE_331_Algorithms_Data_Structures
/cse331project01/QuickSort.h
UTF-8
2,261
3.6875
4
[]
no_license
/* * File: QuickSort.h * Author: Abhiram Durgaraju * * Created on September 24, 2017, 8:56 PM */ #ifndef _QUICKSORT_H_ #define _QUICKSORT_H_ #include <vector> #include "InsertionSort.h" #include <cstdlib> using namespace std; /*This function takes 3 inputs: the vecfor reference, the starting index, and the ...
true
9ccf3fd0847375a03d4bb972facb54601cefe925
C++
extinctCoder/arduinoBoard
/serialCommunication.ino
UTF-8
505
2.734375
3
[]
no_license
int data = -1; void setup() { pinMode(13, OUTPUT); Serial.begin(9600); digitalWrite(13, HIGH); } void loop() { if(Serial.available()) { data=Serial.read(); if(data=='1'){ Serial.println("turning led on"); digitalWrite(13, HIGH); Serial.println("led on"); } else if(data=...
true
82f4d840464111c79b5e385082da1e16b8f526b8
C++
lambertwang/tensor_stuff
/src/nodeOperations/dotproduct.h
UTF-8
555
2.703125
3
[]
no_license
/** * DotProduct Class Header * */ #ifndef __DOTPRODUCT_H__ #define __DOTPRODUCT_H__ #include "node/tensorNode.h" class DotProduct: public TensorNode { protected: std::string getDefaultTag(); public: /** * Constructor for a DotProduct */ DotProduct(std::initializer_list<const Tensor...
true
ca26a6a4936183365b9d50f8b92ca70e03c7d7db
C++
simplegsb/gazengine
/GazEngine-OpenGL/gazengine/scene/OpenGLCamera.cpp
UTF-8
2,312
2.84375
3
[]
no_license
#include <windows.h> #include <GL/gl.h> #include <GL/glu.h> #include "OpenGLCamera.h" using namespace std; OpenGLCamera::OpenGLCamera() : farClippingDistance(1000.0f), frameHeight(0.0f), frameWidth(0.0f), nearClippingDistance(0.1f), node(NULL) { } float OpenGLCamera::getFarClippingDistance() const { return f...
true
bb789c4c1dbbbba70b33fba268be4fa41c0419c5
C++
azevedog/reativos
/azevedog/Exercicio3.ino
UTF-8
2,161
2.875
3
[]
no_license
/**API CLIENTE/SERVIRDOR*/ void init_(); void button_listen(int pin); void timer_set(int ms); void button_changed(int pin, int v); void timer_expired(void); /**GERADOR DE EVENTOS*/ struct listElem { int pin; int lastVal; struct listElem* next; }; typedef struct listElem LIST; LIST* btnList = NULL; void butto...
true
200864358c2f7774dcba683cdb87af4ce4298716
C++
jimsrobot/btcontrol
/BTControl/BTControl.ino
UTF-8
13,096
2.671875
3
[]
no_license
/************************************** * * REFLOW OVEN BLUETOOTH CONTROLLER * **************************************** The reflow profile has a number of stages, these are built on the android device and the profile is sent to the board where it gets saved into the EEPROM To run the profile you can press the but...
true
00a2ade0c2f2cf208a8bf1152e976ee26102044e
C++
CAMILA125/C
/exercicios_lista_5/vogal_ou_consoante.cpp
WINDOWS-1252
674
3.046875
3
[]
no_license
/* Escreva um programa em C que leia uma letra e indique se ela uma vogal ou consoante. Utilize uma estrutura de caso para resolver este problema. */ #include<stdio.h> #include<locale.h> #include<conio.h> int main() { setlocale(LC_ALL,""); char letra; printf ("\nEscreva uma letra do alfabeto: "); ...
true
0499293711ff4e2e888f75120e1e366adb69fddc
C++
SolansPuig/Knapsack-Public-Cryptosystem
/recursive_subset_sum.cpp
UTF-8
1,588
2.9375
3
[]
no_license
#include <iostream> // #define ITEMS 30 // #define WEIGHT 75 // // #if ITEMS == 2 // int value[ITEMS] = {9, 3}; // #endif // #if ITEMS == 4 // int value[ITEMS] = {9, 3, 5, 7}; // #endif // #if ITEMS == 10 // int value[ITEMS] = {9, 3, 5, 7, 5, 9, 8, 9, 7, 3}; // #endif // #if ITEMS == 20 // int value[ITEMS] = {9, 3, 5,...
true
0515c68eb35c176fc6671ca370efa5c7ce99ded9
C++
wilseypa/warped2-models
/models/wildfire/wildfire.hpp
UTF-8
5,233
3.03125
3
[ "MIT", "GPL-3.0-only" ]
permissive
//Implementation of a WildFire Simulation #ifndef WILDFIRE_HPP_DEFINED #define WILDFIRE_HPP_DEFINED #include <string> #include <vector> #include "warped.hpp" /* Status of the fire */ enum cell_status_t { UNBURNT, BURNING, BURNT_OUT }; WARPED_DEFINE_LP_STATE_STRUCT(CellState) { cell_status_t bur...
true
a9d126199033065dbfc41992b07d6e1ce49d529f
C++
wolfen601/SoftwareQuality
/part3/login.cpp
UTF-8
1,665
3.796875
4
[]
no_license
#include <iostream> #include <string> #include <sstream> #include <fstream> using namespace std; string* findUser(string username); string removePadding(string token); //function asks user to enter their existing username, then calls the findUser function //if the function does not return null the currentUser vector...
true
9e7eb05adce078cfef5be7e549ae0bf575cd1d9a
C++
walkupup/hybrid-astar-planner
/test.cpp
UTF-8
509
2.6875
3
[]
no_license
#include "include/Planner.hpp" State getStartState(); State getTargetState(); int main(){ Map *map = new Map(); State *start = new State(700, 100, 36);// getStartState(); State *target = new State(100, 600, 18);// getTargetState(); Planner astar; astar.plan(*start, *target, *map); delete map; delete start;...
true
fb209498d59e1ea3f8fe6e6b53c7aa2467901d36
C++
rjxircgz/programming
/IT 211 - Data Structures/ProgrammingExercise7/main.cpp
UTF-8
581
2.59375
3
[]
no_license
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <conio.h> #include "queue.h" void main() { Q *a=NULL; Q2 *b=NULL; int c; for(int n=1;n<=4;n++) { printf("enter P%d:",n); scanf("%d",&c); enqueue(&a,c); enqueue(&b,n); } printf("enter time quantum: "); ...
true
f0753c565a1b4999de9ec9842b40f3731932a366
C++
Alerrom/programming_2_sem_ITMO
/laba6.cpp
UTF-8
9,752
3.28125
3
[]
no_license
#include <iostream> #include <vector> #include <map> #include <fstream> #include <sstream> /* Some tips: colors WWW WWW WWW OOO GGG RRR BBB OOO GGG RRR BBB OOO GGG RRR BBB YYY YYY YYY sides: U L F R B D 0 1 2 3 4 5 side: 0 1 2 7 x 3 6 5 4 Now every side is uint32_t: ...
true
bc7901bf55335d848a6db9961d5ce833ab0ead6d
C++
tihmstar/rb3converter
/rb3converter/main.cpp
UTF-8
3,204
2.640625
3
[]
no_license
// // main.cpp // rb3converter // // Created by tihmstar on 14.12.20. // #include <iostream> #include "ConvertMogg.hpp" #include "ConvertPNG.hpp" #include "ConvertMid.hpp" #include "STFS.hpp" #include "dtaParser.hpp" #include <libgeneral/macros.h> #include <getopt.h> #include "songsManager.hpp" static struct optio...
true
4fd2fe672e52872b53076b00cd0b9648eecd5e08
C++
Kahila/oop_cpp
/basicOOP/basic.h
UTF-8
1,234
3.421875
3
[]
no_license
#ifndef BASIC_H_INCLUDED #define BASIC_H_INCLUDED #include <cstdlib> #include <sstream> #include <iostream> using namespace std; struct RGBColor { int intRed; int intBlue; int intGreen; }; enum StatusCode {SUCCESS,FAIL}; ///the class that will be used for abstraction class Image { pu...
true
e91b014673165bfeb38eb8733b26cc6e868d6703
C++
tectronics/cashplusplus
/accountmodel.cpp
UTF-8
2,394
2.546875
3
[]
no_license
#include "accountmodel.h" #include "cashplusplus.h" AccountModel::AccountModel(QObject* parent) : QSqlRelationalTableModel(parent, QSqlDatabase::database(CashPlusPlus::DB_NAME)) { setTable("accounts"); setEditStrategy(OnRowChange); setSort(1, Qt::AscendingOrder); setRelation(2, QSqlRelation("accoun...
true
0d021fbcdcd6215cd50b64f7e162ac6676d3e1eb
C++
Angelay2/2020-6-3
/OJ.cpp
GB18030
875
3.6875
4
[]
no_license
//#include <stdio.h> //#include <stdlib.h> //#include <iostream> //#include <vector> // //using std::cout; //using std::endl; //using std::vector; //using std::string; //// ֻ(byte short int long float double boolean char)͸ͣͰ ///* //1. ֻһε //һǿ飬ijԪֻһ⣬ÿԪؾΡҳǸֻһεԪء( Χfor) //*/ //// õvector͵ĵ //class Solution{ //public: // ...
true
d5d842783a1a5321e70602fdb87d5ba9bcf9dc17
C++
Mityai/contests
/camps/lksh-2014/day7/build-tree.cpp
UTF-8
1,173
2.84375
3
[]
no_license
#include <iostream> #include <cstdio> #include <cstdlib> typedef long long ll; using namespace std; struct TNode { int L, R; int key; }; TNode tree[1000000]; int a[30000]; void buildTree(int root, int L, int R) { tree[root].L = L; tree[root].R = R; if (R - L == 1) { tree[root].key = a...
true
cf67259a46e282309df753b5b4f610560a902acb
C++
mapenghui/guessGame
/guessGameTest/guessGame.h
UTF-8
1,982
3.828125
4
[]
no_license
/** *Date:2016-06-27 *Author:Joe *Function:Guess the number the program generates randomly **/ #include<iostream> #include<stdlib.h> #include<time.h> using namespace std; /** *generate a random integer number between 0 and 19. *input:null *output:randomNumber **/ int randomNumber; int generateRanomNumber() { ...
true
91fd8b9380e882a46be381e1588d0de07b5f579e
C++
mequint/Cpp-Samples
/Quintessence/Sandbox/src/TestState.cpp
UTF-8
4,074
2.546875
3
[ "MIT" ]
permissive
#include "TestState.h" #include <iostream> #include "qe/Animation/SpriteLoader.h" #include "qe/Context.h" #include "qe/ECS/SystemManager.h" #include "qe/State/StateManager.h" #include "qe/Resource/FontManager.h" #include "qe/Resource/TextureManager.h" #include "qe/Utilities/Utilities.h" #include "qe/Window/Window.h" ...
true
7143ed9a6b5ed38a61b0f3fd375cc25eaec54f62
C++
Jeff-CCH/simpleBlockchain
/blockchain.cpp
UTF-8
1,104
3.140625
3
[]
no_license
#include "blockchain.h" BlockChain::BlockChain(uint32_t difficulty) : difficulty(difficulty) { genFirstBlock(); cout << "init BlockChain complete\n"; } void BlockChain::genFirstBlock() { Block firstBlock(0, "This is Genisis Block\n"); firstBlock.sHashPrev = "0"; firstBlock.mine(this->difficulty); ...
true
e57e544d459633e620fb0f286add087583b50610
C++
Krishtof-Korda/CarND-Path-Planning-Project-Submission
/src/OtherVehicle.h
UTF-8
994
2.59375
3
[]
no_license
// Self-driving Car Engineer Nanodegree - Udacity // OtherVehicle.hpp // path_planning // // Created by Krishtof Korda on 04/Nov/17. // #ifndef OtherVehicle_h #define OtherVehicle_h #include <stdio.h> #include <vector> #include "tools.h" #include "structs.h" #include <utility> //#include "cost_functions.h" using...
true
5af9255c718decbf40c78c290b69acc4147fa211
C++
EdipTac/PandemicGame
/Pandemic/TextualCard.h
UTF-8
636
3.5625
4
[]
no_license
#pragma once #include "Card.h" // Represents a card with a custom name and description class TextualCard : virtual public Card { public: // Constructs a card with a given name and description TextualCard(std::string name, std::string description); // Virutal destructor to make class abstract virtual ~TextualCar...
true
0a28bd19f4a3d6cd84275fa7b47ef49bdb27dd8e
C++
shunjilin/SlidingTilesPuzzle
/src/open/open_array.hpp
UTF-8
2,080
3.515625
4
[ "MIT" ]
permissive
#ifndef OPEN_ARRAY_HPP #define OPEN_ARRAY_HPP #include <array> #include <vector> #include <optional> /* Array-based Open list that allows 3 level tie-breaking [min f, max g, LIFO] */ template <typename Node, int MAX_MOVES> struct OpenArray { int min_f = MAX_MOVES; int max_g = -1; size_t size = 0; ...
true
06e4003672b12fe5bdfd011b622f9ab1db7be4db
C++
pbarragan/mechIdentPartLocalStick
/setupUtils.cpp
UTF-8
70,321
2.5625
3
[]
no_license
//Setup Utilities #include "setupUtils.h" #include "logUtils.h" #include "translator.h" #include "actionSelection.h" #include "fileUtils.h" #include "globalVars.h" // Global variables #include <iostream> // DELETE #define _USE_MATH_DEFINES #include <math.h> // cos, sin #include <algorithm> // std::find_if #include <...
true
5a0db6fc2625224fe377567c9eaa9618f878f9b4
C++
olwal/microdollar
/src/Templates.h
UTF-8
1,947
3.15625
3
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
/* MicroDollar: $1 Gesture Recognizer C++ port with optimizations for embedded hardware | Alex Olwal (www.olwal.com) Gesture template classes, specified as a C++ Template to allow use of different data types for data (e.g., int or float). This allows portability between 8-bit microcontrollers and more advanced...
true
a343db7f600c1d19f9c73ff87c79faad9fa23a48
C++
Phoenix-RK/Leetcode
/38. Count and Say.cpp
UTF-8
1,724
3.59375
4
[]
no_license
//Phoenix_RK /* The count-and-say sequence is a sequence of digit strings defined by the recursive formula: countAndSay(1) = "1" countAndSay(n) is the way you would "say" the digit string from countAndSay(n-1), which is then converted into a different digit string. To determine how you "say" a digit string, split ...
true
620af9f4ed73bbf353e4ebaf375cd36109dd0342
C++
atulk471/Hacktoberfest2021
/Convert_time_in_words.cpp
UTF-8
1,224
3.15625
3
[]
no_license
#include <bits/stdc++.h> using namespace std; string timeInWords(int h, int m) { vector<string> v = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "twenty one",...
true
65b70e17d070667b98fd2b8e1fab9e58bcc85959
C++
leighpauls/cs343
/assignment_4/q2Santa.cc
UTF-8
906
2.703125
3
[]
no_license
#include "q2Santa.h" #include "q2Yielder.h" Santa::Santa(Workshop& wrk, Printer& prt) : mWorkshop(wrk), mPrinter(prt) {} void Santa::main() { randomYield(10); mPrinter.print(SANTA_ID, Printer::Starting); for (;;) { randomYield(3); mPrinter.print(SANTA_ID, Printer::Napping); Workshop::Status status =...
true
580c4626bb643eb9966cb02a89799365e2cb8058
C++
ellynhan/programmers
/functionDev.cpp
UTF-8
542
2.859375
3
[]
no_license
#include <vector> using namespace std; vector<int> solution(vector<int> progresses, vector<int> speeds) { vector<int> answer; while(!progresses.empty()){ for(int i=0; i<progresses.size(); i++){ progresses[i]+=speeds[i]; } int result=0; while(*progresses.begin()>=100...
true
65aaa794249cc4481a69c8a4b57f7c010f56243c
C++
BornaBiro/Inkplate6P
/examples/Inkplate_Simple_Backlight/Inkplate_Simple_Backlight.ino
UTF-8
1,385
3.265625
3
[]
no_license
#include "Inkplate6Plus.h" //Include Inkplate library Inkplate display(INKPLATE_1BIT); //Create an object on Inkplate class int b = 31; //Variable that holds intensity of the backlight void setup() { Serial.begin(115200); //Set up a serial communication of 115200 baud ...
true
f32bc7cf00e3abc0fd699ce733cbdf8976cee733
C++
satsukisahi/AtCoder
/01solved/AGC-C/agc002-c.cpp
UTF-8
494
2.546875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) int main() { ll n , l ; cin >> n >> l ; vector<ll> a(n+1); vector<ll> ans; rep(i, n){ cin >> a[i+1]; } rep(i,n){ if(a[i]+a[i+1]>=l){ for(ll j=i;j>0;j--)ans.push_back(j); for(ll j=i+1;j<n...
true
e840aa63a02d77278965a9571a82ba3b511b70d9
C++
PsichiX/XenonCore2
/XenonFramework2/XenonFramework2/XeFramework/Singleton.inl
UTF-8
697
2.625
3
[]
no_license
#include "MemoryManager.h" template< class T > T* Singleton< T >::instance = 0; template< class T > T& Singleton< T >::use() { if( !Singleton< T >::instance ) #if defined( XMM_MEMORY_TRACING_MODE ) Singleton< T >::instance = MemoryManager::__newDebug< T >( __FILE__, __LINE__ ); #else Singleton< T >::instance = M...
true
4bb1caddf8406b661b2dd087a65721e57ddcaecd
C++
zhanghua0926/GifImageSource
/GifImage/Shared/Vector4F.h
UTF-8
676
2.734375
3
[ "MIT" ]
permissive
#pragma once namespace GifImage { public ref class Vector4F sealed { float m_x; float m_y; float m_z; float m_w; public: Vector4F(float x, float y,float z, float w) :m_x(x), m_y(y),m_z(z),m_w(w) { } property float X { float get() { return m_x; } void set(float value) { m_x = value;...
true
816379cf26c23cacf31a78aa1ccf0400d628e274
C++
liuxinyu123/effective_cpp
/item3/textblock.h
UTF-8
292
2.515625
3
[]
no_license
#ifndef _TEXTBLOCK_H_ #define _TEXTBLOCK_H_ #include <string> class TextBlock { public: TextBlock (const std::string &s = ""); TextBlock (const TextBlock &tb); char& operator[] (std::size_t i); const char& operator[] (std::size_t i) const; private: std::string text; }; #endif
true
d181c92e34da71eee59d61cb6d87325dc32eb37b
C++
wfystx/LeetCodeDailyPractice
/HashMap/290WordPattern.cpp
UTF-8
437
2.734375
3
[]
no_license
class Solution { public: bool wordPattern(string pattern, string str) { unordered_map<char,int> m1; unordered_map<string,int> m2; istringstream in(str); int i = 0, n = pattern.size(); for (string word; in >> word; ++i) { if (i == n || m1[pattern[i]] != m2[word]) ...
true
2195cc3902850fab54f09c572bfac5d3643403d4
C++
Amoners/cc0
/src/toolchain/core/CodeDom/BlockExpression.cpp
UTF-8
1,040
2.671875
3
[ "BSD-2-Clause" ]
permissive
#include "BlockExpression.h" #include <stdlib.h> #include "ExpressionVisitor.h" #include <core/Type/VoidType.h> BlockExpression::BlockExpression() : Expression(Expression::Block), _scope(NULL) { _expressions = new std::vector<Expression *>(); //FIXME: memory leak! } BlockExpression::~BlockExpression(...
true
ec5f8d6e4985b93da6f637b14feb42eb4f1c50bb
C++
Shashank-Ojha-bot/DSA-Topicwise-Questions
/Arrays/MaxDifference.cpp
UTF-8
729
3.28125
3
[]
no_license
//Naive Solution:TC- theta(N^2) #include<bits/stdc++.h> using namespace std; //int MaxDifference(int arr[],int n) //{ // int res=arr[1]-arr[0]; // for(int i=0;i<n;i++) // { // for(int j=i+1;j<n;j++) // { // res=max(res,arr[j]-arr[i]); // } // } // return res; //} //int main() //{ // int arr[]={2,3,10,6,4,8,1}; //...
true
4f05292d6bb46852623b54787cc22ed9704b6e5a
C++
gnachman/fish-shell
/builtin_set.cpp
UTF-8
20,330
2.640625
3
[]
no_license
/** \file builtin_set.c Functions defining the set builtin Functions used for implementing the set builtin. */ #include "config.h" #include <stdlib.h> #include <stdio.h> #include <wchar.h> #include <wctype.h> #include <sys/types.h> #include <termios.h> #include <signal.h> #include <vector> #include <algorithm> #incl...
true
ce6d33d3b7ceeca740604dafca0fc6f5dbc51453
C++
JenSperry/181DatabaseP4
/qe/qe.cc
UTF-8
13,071
2.796875
3
[]
no_license
#include "qe.h" Filter::Filter(Iterator* input, const Condition &condition) { iter = input; cond = condition; } // ... the rest of your implementations go here RC Filter::getNextTuple(void *data) { void* tempData = malloc(4096); void* value = malloc (4096); bool condTrue; vector<Attribute> attr; getAttrib...
true
1678f68cd5bb4214408d89642f7638590ae32d7d
C++
RodrigoHolztrattner/Wonderland
/Wonderland/Wonderland/Editor/Modules/TextureCollecion/TextureCollectionString.cpp
UTF-8
1,748
2.78125
3
[ "MIT" ]
permissive
//////////////////////////////////////////////////////////////////////////////// // Filename: FluxMyWrapper.cpp //////////////////////////////////////////////////////////////////////////////// #include "TextureCollectionString.h" TextureCollection::TextureCollectionString::TextureCollectionString() { // Set the initi...
true
6bf370c825bd8bf514195a1f8217fc1ba452ba0b
C++
yaoguilv/Alex
/Cal/Al/src/C2/U3/Quick.cpp
UTF-8
1,358
3.53125
4
[]
no_license
#include "C2/U3/Quick.h" void Quick::sort(Comparable ** a, int arrLen) { // Eliminate dependence on input. sort(a, 0, arrLen - 1); } void Quick::sort(Comparable ** a, int lo, int hi) { if(hi <= lo) return; int j = partition(a, lo, hi); // Sort left part a[lo .. j-1]. sort(a, lo, j - 1); /...
true
4e5ba43b45921d380528b7668e58b6851075c2ce
C++
Personal-Learnings/CPP_Learning_CodeLite
/Workspace/InheritanceSectionChallenge/Account.h
UTF-8
585
3.328125
3
[]
no_license
#ifndef ACCOUNT_H #define ACCOUNT_H #include <iostream> #include <string> using namespace std; class Account { friend ostream &operator<<(ostream &os, const Account &account); private: static constexpr const char *DEFAULT_NAME = "Unnamed Account"; static constexpr const double DEFAULT_BALANCE = 0.0;...
true
9699f716370ce5676dc4e7e7c4e78842c0699f34
C++
Kishorehere/Spider_Task_v2.0
/MERGE_SO.CPP
UTF-8
973
3.28125
3
[]
no_license
//NAME: ELANTHAMIZHAN A R - 103118023 //Merging two array //First array given in ascending order //Second array given in descending order #include<iostream.h> #include<conio.h> void merge(int [],int,int [],int,int []); void main() { int a[10],b[10],c[10]; int s1,s2; clrscr(); cout<<"\nEnter the siz...
true
6aa63da565b831255a65474995d68be4c7d56888
C++
cfs6/DSandAlgorithm
/jianzhiOffer/PermutationCombinationBYDP.cpp
GB18030
1,576
3.34375
3
[]
no_license
//һַ,ֵӡַַС //ַabc,ӡַa,b,cгַabc,acb,bac,bca,cabcba //̬滮 #include<iostream> #include<vector> #include<string> #include<algorithm> using namespace std; void addchar(char c, vector<string> &res) { vector<string> res2 = res; int ressize = res2.size(); int strlength = res2[0].length(); res.clear(); fo...
true
bf10f9a301a9dc93a7b4edd8775476adf3964895
C++
MakeevVlad/Crystall-growth-simulation
/Functions.cpp
UTF-8
21,027
2.640625
3
[]
no_license
#include <vector> #include <iostream> #include <algorithm> #include <cmath> #include <ctime> #include <random> #include <fstream> #include <string> #include <omp.h> #include "Functions.h" //Функция, сохраняющая данные в файл для дальнейшей отрисовки void collect_data(Field& field) { std::ofstream...
true
a15040547fa3d64d750461694dcb9fbffe343c73
C++
Tomerfi1210/Dave
/Project/PlayerMove.cpp
UTF-8
2,709
2.796875
3
[]
no_license
#include "PlayerMove.h" #include "GameObject.h" #include "ResourceManager.h" #include "Dave.h" #include <iostream> //TODO move from here static int count = 0; PlayerMove::PlayerMove(Dave& dave) : m_moveHands(false), m_dave(dave) { m_speed = 0.7f; m_moves.emplace(sf::Keyboard::Right, [&]() {m_step.x = { m_sp...
true
e39b5a9360a9e0d8984c595f0f10f83aa7221e0a
C++
the-sword/autoscan-windows
/seven_dof_arm_test/src/add_collision_objct.cpp
UTF-8
7,955
2.5625
3
[]
no_license
// 包含API的头文件 #include <moveit/move_group_interface/move_group.h> #include <moveit/planning_scene_interface/planning_scene_interface.h> #include <moveit_msgs/AttachedCollisionObject.h> #include <moveit_msgs/CollisionObject.h> int main(int argc, char **argv) { ros::init(argc, argv, "add_collision_objct"); ros::...
true
5c37719d83270cfa807e71664ed080f109d87a3f
C++
adityanjr/code-DS-ALGO
/CodeForces/Complete/900-999/910A-TheWayToHome.cpp
UTF-8
592
2.734375
3
[ "MIT" ]
permissive
#include <iostream> #include <vector> int main(){ long n, d; std::cin >> n >> d; std::string s; std::cin >> s; std::vector<long> v; for(long p = 0; p < s.size(); p++){if(s[p] == '1'){v.push_back(p);}} std::vector<long> w(v.size(), n + 1); w[0] = 0; for(long from = 0; from < v.size(); from++){ ...
true
30bad955c8016a30bfdcbcdac96c81f646a6e5c3
C++
amclauth/Euler
/C++/Euler (C++)/src/problems/P031xP040/P037.cpp
UTF-8
4,642
3.65625
4
[]
no_license
#include "../../base/problem.h" #include "../../util/prime.h" #include <vector> /** * P037<br> * The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, * and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right...
true
fffd114b24a4af7b2123b97fbb0aedd91dece0a2
C++
InsightSoftwareConsortium/ITK
/Modules/Numerics/Statistics/test/itkSampleTest3.cxx
UTF-8
5,454
2.515625
3
[ "IJG", "Zlib", "LicenseRef-scancode-proprietary-license", "SMLNJ", "BSD-3-Clause", "BSD-4.3TAHOE", "LicenseRef-scancode-free-unknown", "Spencer-86", "LicenseRef-scancode-llnl", "FSFUL", "Libpng", "libtiff", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-other-permissive", ...
permissive
/*========================================================================= * * Copyright NumFOCUS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.o...
true
a2f15079694a23c486781a52a94daca9460cba59
C++
algorithmstudy4/sw_test
/s_coding/1992_쿼드트리.cpp
UTF-8
1,749
3.453125
3
[]
no_license
//1992 쿼드 트리 //https://www.acmicpc.net/problem/1992 #include <iostream> #include <string> using namespace std; int arr[64][64]; //1.현재 구간에 있는 구간들이 0 으로만 또는 1로만 이루어져 있으면 해당숫자 출력 //2.1번 조건이 성립하지 않으면 ( 출력하고 2->1->4->3 사분면 순서로 구간을 잘라 재귀호출 후 )출력 //3.기저사례는 구간의 크기가 1일 경우 , 구간의 크기가 1이면 해당 숫자 출력 void compress(int n,int y,int...
true
8ba20b0d360a2fcdb73dd50b8a13d1530eb2aaea
C++
indjev99/Competitive-Programming-Problems
/transmission/system/manager.cpp
UTF-8
4,030
2.65625
3
[ "MIT" ]
permissive
#include <iostream> #include <iomanip> #include <stdlib.h> #include <vector> #include <signal.h> static int n,d,k,seed,m,m2,n2; static std::vector<bool> data; static std::vector<bool> message; static std::vector<bool> deletions; static std::vector<bool> corruptedMessage; static std::vector<bool> reconstructedData; st...
true
03a0a0d7a93fc29b5c1b457d2f9dbe8752a31601
C++
Mazbah/UVA-OJ
/uva-11945.cpp
UTF-8
507
2.625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; void printcomma(int n){ if(n<1000){ cout<<n; return; } printcomma(n/1000); printf(",%03d",n%1000); } int main() { int n,i,j; double sum,a,r; cin>>n; setlocale(LC_ALL,"en_US.UTF-8"); for(i=1;i<=n;i++){ ...
true
544e47adff0fdb5d6a779ac2ec05178b7dcf4e89
C++
JMang0321/designPattern
/adaptor/stack_class/stack.h
UTF-8
292
3.328125
3
[]
no_license
#pragma once #include <vector> using namespace std; class Stack { public: Stack() {} virtual void pop() { if (m_num.size() <= 0) return; else m_num.erase(m_num.end()); } virtual void push(int num) { m_num.push_back(num); } private: vector<int> m_num; };
true
47182f7e5ab747e12b1efaf471851dfa6f986f37
C++
wenxinz/C-PrimerPlus
/chapter15/ex4.cpp
UTF-8
1,888
3.09375
3
[]
no_license
#include <iostream> #include "sales.h" int main(){ using std::cout; using std::cin; using std::endl; double vals1[12]={1220,1100,1122,2212,1232,2334, 2884,2393,3302,2922,3002,3544}; double vals2[12]={12,11,22,21,32,34, 28,29,33,29,32,35}; Sales sales1(...
true
c361aea72230d7b2a9bdb0aafa792599607c252c
C++
da-phil/SDC-Controls-PID
/src/PID.h
UTF-8
1,378
2.703125
3
[ "MIT" ]
permissive
#ifndef PID_H #define PID_H class PID { public: /* * Errors */ double p_error; double i_error; double d_error; /* * Coefficients */ double Kp; double Ki; double Kd; int skip_initial_samples; int sample_count; bool twiddle_enable; double rmse_sum; double rmse_best; double twiddle_...
true
bc9fd3f7b592080191fcc42c921913670d8f1def
C++
BackupTheBerlios/robotm6
/robot2005/src/devices/real/motorIsa_05.cpp
ISO-8859-1
5,831
2.546875
3
[]
no_license
#include "implementation/motorIsa.h" #ifdef TEST_MAIN #include <signal.h> #include <stdlib.h> #endif #include "HCTLControl.h" #include "log.h" // ============================================================================ // ============================== class MotorIsa ========================== // ==============...
true
b60d4aaac93828c5a9f2586e749f03561700d4aa
C++
LightGrand/nmos-cpp
/Development/nmos/log_manip.h
UTF-8
805
2.5625
3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
#ifndef NMOS_LOG_MANIP_H #define NMOS_LOG_MANIP_H #include "nmos/slog.h" #include "nmos/model.h" namespace nmos { // Log a model in abbreviated form (relying on logging of utility::string_t, from nmos/slog.h) inline slog::log_statement::manip_function put_model(const model& model) { return slog::l...
true
46da765426d05d31e031e8858691cb11d2e2dd43
C++
MarcoDuesentrieb/pad-ex01
/ex01/async.cpp
UTF-8
9,009
3.109375
3
[]
no_license
#include <benchmark/benchmark.h> // google benchmark #include <algorithm> #include <future> #include <iostream> #include <random> #include <thread> #include <type_traits> #include <utility> #include <vector> using ElementType = int; using Ex1VectorType = std::vector<ElementType>; //----------------------------------...
true
422c708fa0872c1d9188c25b56b2df06af8aa414
C++
sriharsha00/Sriharsha-s-Projects
/Coding Assingment/cart.h
UTF-8
1,038
3.671875
4
[]
no_license
#ifndef CART_H #define CART_H /* This is a header file of cart class. This header file includes cart class definitions */ #include "item.h" #include <vector> class GroceryCart { public: void insertItem(Item); // inserts a item into this function by using push_back function. void deleteItem(Item)...
true
d2b86f236fdd55b3c331e7cf01ebe19bcd1c5b9d
C++
WadeZeak/C_and_Cpp
/cpp基础/new&delete/newdelete/对象数组.cpp
GB18030
464
3.078125
3
[]
no_license
#include<stdlib.h> #include<iostream> using namespace std; class MyClass1 { private: int *p; int len; public: MyClass1()//ʱʼ { cout << "MyClass " << endl; } ~MyClass1()//ɾʱͷڴ { cout << "MyClass " << endl; } }; void mainghf() { MyClass1 *p = new MyClass1[10]; //ͿֱdeleteӵҪ[ ] delete []p...
true
ff48d4d36601c8ea87127760d1183ad06ece011c
C++
DennisRoos/Advent2019
/template.cpp
UTF-8
485
2.734375
3
[]
no_license
#include <iostream> #include <fstream> #include "stdafx.h" #include <iostream> #include <iomanip> #include <fstream> using namespace std; int main(int argc, char * argv[]) { ifstream infile; infile.open("data.txt"); if (infile.is_open()) { int num; int answer; while (infile >> num) { ...
true
ceb514c0e0d3f2d3bf64d626c47ee8fe46d952db
C++
wangscript007/XLib-1
/Source/XLib.Containers.CyclicQueue.h
UTF-8
3,167
3.265625
3
[]
no_license
#pragma once #include "XLib.Types.h" #include "XLib.Debug.h" #include "XLib.Util.h" namespace XLib { struct CyclicQueueStoragePolicy abstract final { struct InternalHeap abstract final {}; struct External abstract final {}; template <uint32 storageSize> struct InternalStatic abstract final {}; }; templa...
true
37c1bf73ca755c56a444162d7e2c7b3e6a1e49a5
C++
Patrickjusz/CPP
/keylogger-fud/Autorun.cpp
UTF-8
3,213
2.515625
3
[]
no_license
/* TODO: * + Dodać obsługe innego autostartu gdy nie dodano klucza do rejestru */ #include "Autorun.h" Autorun::Autorun(string keyloggerFileNameIn) { this->config = new Config(); this->keyloggerFileName = keyloggerFileNameIn; this->newWinApix = new newWinApi(); } bool Autorun::addAutostart() { HK...
true
fbce1ec972b820551586d1a817b76f1683bcf06c
C++
rasto2211/nanopore-read-align
/src/hmm.h
UTF-8
6,544
3.09375
3
[]
no_license
#pragma once #include <vector> #include <cmath> #include <memory> #include <random> #include <typeinfo> #include <json/value.h> #include "log2_num.h" #include "gtest/gtest_prod.h" // Transition from one state to another. struct Transition { int to_state_; Log2Num prob_; friend inline std::ostream& operator<<(...
true
1cfc0f811efbd9901620db4ef95964a2fe4855a6
C++
montanker/GamePhysics
/FinalProject/FinalProject/ParticleContact.h
UTF-8
693
2.609375
3
[]
no_license
#ifndef PARTICLECONTACT_H #define PARTICLECONTACT_H #include "Particle.h" const Color CONTACT_COLOR = Color(1.0f, 0.0f, 0.0f); const float CONTACT_WIDTH = 5.0f; class ParticleContact { public: ParticleContact(){}; double calculateSeparatingVelocity(); void resolve(float duration); void init(); void draw(); Pa...
true
e63b8c279ba61d05391ef38b7f06e0533cabe296
C++
lineCode/cpp-lazy
/include/Lz/Enumerate.hpp
UTF-8
4,502
3.6875
4
[ "MIT" ]
permissive
#pragma once #include <vector> #include <array> #include "detail/BasicIteratorView.hpp" #include "detail/EnumerateIterator.hpp" namespace lz { template<class Iterator, class IntType> class Enumerate final : public detail::BasicIteratorView<detail::EnumerateIterator<Iterator, IntType>> { pu...
true
8c341105beacf5fa64eed1566991c11e3d6db8f7
C++
JakubMakaruk/UMCS
/ALGORYTMY/ALGORYTMY 2018-1/algorytm9.cpp
UTF-8
1,470
2.9375
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int liczbaZestawowDanych; cin >> liczbaZestawowDanych; for(int i=0; i<liczbaZestawowDanych; i++) { long int koszt=0; int element1, element2; long int liczbaProgramow; int pierw...
true
43136721171cacae685dbe6fe4572b4f5bf074dd
C++
sency90/allCode
/jongmanbook/510-1.cc
UTF-8
2,250
2.953125
3
[]
no_license
#include <stdio.h> #include <algorithm> int r[201], p[201]; using namespace std; int gcd(int b, int l) {return (l==0)?b:gcd(l,b%l);} //X = max(put[i]/recipe[i])라 하자. 즉 X는 비율중의 최대를 의미한다. //우리는 모든 p[i]/r[i]가 X라는 비율보다 크거나 같도록 v[i]만큼 마법약을 추가해야 한다. //즉, X<=Y 이면서, 모든 i에 대해 Y=(p[i]+v[i])/r[i] 를 만족하는 최소 Y를 알고 싶은 것이다. (문제의 조건에 ...
true
6039d564f1973cdc246f148a1a9a41e910cc05fb
C++
lil7abt/study_notes
/Cpp_Primer_Plus/CH16_STL_Code/Eg_initializer_list/ilist.cpp
UTF-8
348
3.40625
3
[]
no_license
#include <iostream> #include <initializer_list> double sum(std::initializer_list<double> il); double average(const std::initializer_list<double> &ril); int main() { using std::cout; cout<<"List 1: sum = "<<sum({2,3,4}) <<", ave = "<<average({2,3,4})<<'\n'; std::initializer_list<double> dl={1.1, 2....
true
04d5032b385e4757a9f8c9699263b02e849f9d19
C++
aconstlink/natus
/device/components/button.hpp
UTF-8
2,999
2.796875
3
[ "MIT" ]
permissive
#pragma once #include "../component.hpp" namespace natus { namespace device { namespace components { enum class button_state { none, pressed, pressing, released, num_keys }; ...
true
ce794d76863bb332319cbbd43107ba0aa4ebdd9d
C++
SoilRos/dune-copasi
/dune/copasi/grid/mark_stripes.hh
UTF-8
2,806
2.75
3
[]
no_license
#ifndef DUNE_COPASI_GRID_MARK_STRIPES_HH #define DUNE_COPASI_GRID_MARK_STRIPES_HH #include <dune/grid/uggrid.hh> #include <list> namespace Dune::Copasi { /** * @brief Mark stripes for refinement * @details If a cube element is surrounded by non-cubes in oposite sides * such cube is understood...
true
e0c30f64f59550a026ac1145eb670ca2acb803bd
C++
ahbab15/Multiplug
/main.cpp
UTF-8
9,493
2.53125
3
[]
no_license
#include<windows.h> #include <GL/glut.h> #include <stdlib.h> #include <GL/gl.h> #include <GL/glu.h> #include <math.h> static GLfloat spin = 0.0; static float tx = 0.0; static float ty = 0.0; int on,off; void DrawCircle(float cx, float cy, float rx,float ry, int num_segments) { glBegin(GL_TRIANGL...
true
af22dbe3028777fe7bf26e3658ca7f79c210091d
C++
Ian-Fund/2430-GW1
/Personnel.h
UTF-8
525
2.578125
3
[]
no_license
// // Created by mathbot on 2/1/18. // #ifndef GW1_PERSONNEL_H #define GW1_PERSONNEL_H #include <stdio.h> #include <string> using namespace std; class Personnel { public: Personnel(int ssn, char name, char city, int year, long salary); Personnel(); void readFromFilePersonnel(); void size(); voi...
true
e2b00fdeb1f22aab547fef4f2a92a4f59ac31f62
C++
arrows-1011/CPro
/AOJ/Volume05/0577.cpp
UTF-8
506
2.546875
3
[]
no_license
#include <iostream> using namespace std; int main(){ int n,mat[200][3],point[200]={0}; cin >> n; for(int i = 0 ; i < n ; i++) for(int j = 0 ; j < 3 ; j++) cin >> mat[i][j]; for(int i = 0 ; i < n ; i++){ for(int j = 0 ; j < 3 ; j++){ int cnt = 0; for(int l = 0 ; l < n ; l++){ if...
true
32118a542a664aa801bd3efd2879ca52429d1e29
C++
hannesSchuerer/Pong
/Ball.cpp
UTF-8
3,836
2.703125
3
[]
no_license
#include "Ball.hpp" Ball::Ball() { if (!m_texture.loadFromFile("Sprites/PongBall.png")) { std::cerr << "Cant load player" << std::endl; } else { m_sprite.setTexture(m_texture); } m_sprite.setOrigin(m_sprite.getGlobalBounds().height / 2, m_sprite.getGlobalBounds().width / 2); m_direction = sf::Vector2f(1....
true
a5515451c2d48463fc72b4c61920a2caa4775bb4
C++
kevinnhuynh/CPSC441-ACNS
/ChatHistory.cpp
UTF-8
1,124
3.015625
3
[]
no_license
//NOTCOMPLETED //saving objects in files adapted from https://www.geeksforgeeks.org/readwrite-class-objects-fromto-file-c/ #include "ChatHistory.h" #include <string> int ChatHistory::channelIDCounter=0; ChatHistory::ChatHistory(string access, string type):FileInfo(access,access){ this->channelType = type; ...
true
7f8a1d583a91007e225aa85967b80c3ad071733e
C++
Manav-Aggarwal/competitive-programming
/HackerRank/IsFibo.cpp
UTF-8
775
3.390625
3
[]
no_license
#include <iostream> using namespace std; bool isFibo(unsigned long long int a); void Caller(unsigned long long int test); int main() { unsigned int noOfTestCases; cin >> noOfTestCases; while (noOfTestCases--) { unsigned long long int num = 0; cin >> num; Caller(num); } ...
true
758ae0955a5ff88412a79735d55e02fae919155c
C++
rathoresrikant/interviewbit
/Linked Lists/list_cycle.cpp
UTF-8
1,014
3.65625
4
[]
no_license
/* List Cycle Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Try solving it using constant additional space. Example : Input : ______ | | \/ | 1 -> 2 -> 3 -> 4 Return the node corresponding to node 3. *...
true
014322b33960a6d4bef0f537000b3aab3bbe3b92
C++
pulcherriman/Programming_Contest
/AtCoder/ABC/000-099/ABC082/abc082_a.cpp
UTF-8
239
2.671875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; constexpr int lcm(int a,int b){return b?lcm(b,a%b):a;} constexpr int gcd(int a,int b){return a*b/lcm(a,b);} int main(void){ float a,b; cin>>a>>b; cout<<(int)ceil((a+b)/2)<<endl; }
true
a568eeaf8b7ea0be8174bb2304b1e4df7d631e6c
C++
josephjaspers/ARCHIVED-BlackCat_NeuralNetworks-Version-2
/Include/BlackCatTensors_dependencies/Scalar.h
UTF-8
4,615
2.890625
3
[]
no_license
/* * Scalar.h * * Created on: Aug 15, 2017 * Author: joseph */ #ifndef SCALAR_H_ #define SCALAR_H_ #include "LinearAlgebraRoutines.h" #include "BC_MathematicsDeviceController.h" #include <iostream> template <typename number_type, typename TensorOperations = CPU> class Scalar { template <typename t, typen...
true
0f7ba1dc868162ce34399d60ae4d01ec5517a494
C++
bradley27783/TheCivilWarOfMalibu
/Game/read.cpp
UTF-8
4,061
3.0625
3
[]
no_license
#include <iostream> #include <string> using namespace std; #include "libsqlite.hpp" void read::military_Units(){ string sqliteFile = "civilwarofMalibu.db"; try{ sqlite::sqlite db( sqliteFile ); auto cur = db.get_statement(); cur->set_sql( "SELECT * FROM military_Unit...
true
113e378878287cad99636ef64c1faa3490385d8b
C++
takaakit/design-pattern-examples-in-cpp
/structural_patterns/proxy/ProxyPrinter.h
UTF-8
944
2.625
3
[ "CC0-1.0" ]
permissive
// ˅ // ˄ #ifndef STRUCTURAL_PATTERNS_PROXY_PROXYPRINTER_H_ #define STRUCTURAL_PATTERNS_PROXY_PROXYPRINTER_H_ // ˅ #include <string> #include "structural_patterns/proxy/Printer.h" class RealPrinter; using namespace std; // ˄ // ProxyPrinter forwards requests to RealPrinter when appropriate. class ProxyPrinter : ...
true
eebbef7e584c479d35919921c09593a26e8d4214
C++
NutBandera/MagicTGB
/MagicTGB/Tile.h
UTF-8
263
2.671875
3
[]
no_license
#pragma once #include "Actor.h" class Tile : public Actor { public: Tile(string filename, float x, float y, Game* game); Tile(string filename, float x, float y, int lifeSeconds, Game* game); int lifeSeconds = 0; int getLifeSeconds(); void reduceLife(); };
true
95073d910d9190be3d5e3c74bc6fc7b3f0088ecb
C++
asarium/imageloader
/test/src/util.cpp
UTF-8
2,273
3
3
[ "MIT" ]
permissive
#include "util.h" #include <cstdio> namespace { void* IMGLOAD_CALLBACK mem_realloc(void* ud, void* mem, size_t size) { return realloc(mem, size); } void IMGLOAD_CALLBACK mem_free(void* ud, void* mem) { free(mem); } size_t IMGLOAD_CALLBACK std_read(void* ud, uint8_t* buf, ...
true
a870abfb164423fa0bf3a4f00405bd8f8d147aff
C++
eVillain/StruggleBox
/StruggleBox/Engine/Rendering/TextAtlasCache.cpp
UTF-8
987
2.828125
3
[]
no_license
#include "TextAtlasCache.h" #include "TextAtlas.h" #include "Log.h" const TextAtlasID TextAtlasCache::NO_ATLAS_ID = 0; TextAtlasCache::TextAtlasCache() : m_nextTextAtlasID(1) { } TextAtlasID TextAtlasCache::addTextAtlas(TextAtlas* texture, const std::string& name) { const TextAtlasID prevID = getTextAtlasID(name)...
true
793b7fe8fe408ce035cf47d6c3cd87384b38d8ad
C++
sawfly/straustrup
/src/4.3.cpp
UTF-8
1,374
3.53125
4
[]
no_license
#include <iostream> int main() { enum E1 {first}; enum E2 {second, third, fourth, fifth, sixth, sevens, eights, ninth, tenth}; std::cout << "Size of bool: " << "\t\t\t" << sizeof(bool) << '.' << '\n'; std::cout << "Size of char: " << "\t\t\t" << sizeof(char) << '.' << '\n'; std::cout << "Size of w...
true
184e74597ea343e866aa2252d170a0a8ff41e142
C++
snoplus/snogoggles
/src/Frames/Frames2d/Projections/ProjectionBase.hh
UTF-8
2,325
2.59375
3
[]
no_license
//////////////////////////////////////////////////////////////////////// /// \class Viewer::Frames::ProjectionBase /// /// \brief Base frame for projections /// /// \author Phil Jones <p.g.jones@qmul.ac.uk> /// /// REVISION HISTORY:\n /// 21/02/12 : P.Jones - First Revision, new file. \n /// /// \detail All pro...
true
5dfb1d8c02964b7d5d5685719995f4908e642bb0
C++
Sriram4361/MRND_Summer_Team2
/SummerCourseDay1/SummerCourseDay1/stringCompress.cpp
UTF-8
620
2.890625
3
[]
no_license
#include"stringCompress.h" void stringCompression() { char* str = (char *)calloc(sizeof(char),100); printf("enter the string:\n"); scanf_s("%s", str,100); int ind1 = 0, ind2 = 0, count = 1; while (str[ind2+1] != '\0') { if (str[ind2] == str[ind2+1]) { count++; } else if (count > 1) { str[ind1] = s...
true
a690ed0174dc790fef13823d3bacf37026e54463
C++
Zend0r-ai/BattleCity
/app/inc/booster.h
UTF-8
742
2.515625
3
[]
no_license
#pragma once #include "Framework.h" #include "player.h" #include "displayableObject.h" class Booster : public DisplayableObject { public: Booster(int posX, int posY) : DisplayableObject(ModelType::EXTRA_LIFE, posX, posY) { sprite_ = createSprite("../../app/resources/ExtraLife.TGA"); isVisible_ = fa...
true
c1beeba993c64d90678ff65edaa7782f087c1502
C++
daniel-perry/rt
/src/gl/TInstance.cc
UTF-8
2,195
3.0625
3
[ "MIT" ]
permissive
/* Daniel Perry * for cs6620 - spring 2005 * started 4 April 2005 */ /* TInstance - transformed instance class * */ #include "TInstance.h" #include "hpoint.h" #include "Material.h" #include "matrix.h" TInstance::TInstance( Primitive * o , Material * mat , const matrix & m ) :original(o), transform_matrix(m), ma...
true
b49ba4ff33eb3729809928eb84133519a6108c29
C++
Keepen/DP
/dp2.cpp
UTF-8
2,098
4.125
4
[]
no_license
//问题描述: // 在一个数组中,给定一个目标数字S,求在该数组中能否找到几个数的和刚好等于目标数字 // 能:true;不能:false //思路: // 还是要与不要的原则 // 如果要当前数字 :就看前i - 1个数字能否拼成 S - v[i] // 如果不要当前数字:就看前 i - 1个数字能否拼成 S #include <iostream> #include <vector> using namespace std; //递归版本 bool isOK(vector<int>& v, int i, int s){ if(s == 0){ return true; } ...
true
9631b6ad80f9ab7afecf2ee7a55d45f2517fc998
C++
teri-leblanc/LoadedDiceGame
/RollTheDice/Die.h
UTF-8
692
3.015625
3
[]
no_license
/* * File: Die.h * Author: Terianne Bolding * * Created on November 20, 2015, 11:28 AM */ #ifndef DIE_H #define DIE_H #include <cstdlib> #include <string> #include <vector> class Die { public: Die(); Die(std::string _identifier, int _numberSides); Die(const Die& orig); int GetNumberSides() con...
true
9acfa9bfcba3dd9f38a95b251a0606eb83e621e5
C++
H3r3zy/nanotekspice
/Src/Component/Component/OrGate.cpp
UTF-8
988
2.578125
3
[]
no_license
/* ** EPITECH PROJECT, 2018 ** cpp_nanotekspice ** File description: ** Created by sahel.lucas-saoudi@epitech.eu, */ #include "OrGate.hpp" nts::OrGate::OrGate(nts::OrGate const &data) { _pin_number = data._pin_number; _pinsArgument = data._pinsArgument; _pins = data._pins; _res = data._res; } nts::OrGate& nts::O...
true
a81d997578339831ce0d233d10b379059c3aad7d
C++
hovatterz/Ludum-Dare-28
/src/movement_system.cpp
UTF-8
3,221
2.671875
3
[]
no_license
#include <map> #include "events.h" #include "faction_member.h" #include "health.h" #include "rng.h" #include "spatial.h" #include "turn_taker.h" #include "movement_system.h" struct Direction { int x, y; Direction() : x(0), y(0) {} Direction(int x, int y) : x(x), y(y) {} }; static std::map<Action, Direction> mo...
true
59d05eef8c683572c194eba16d2958819cf15cf4
C++
paulohbmatias/ICG
/Trabalho Individual/mygl.h
UTF-8
8,269
3.515625
4
[]
no_license
#ifndef _MYGL_H_ #define _MYGL_H_ #include "definitions.h" #include <math.h> //***************************************************************************** // Defina aqui as suas funções gráficas //***************************************************************************** class cor //Classe com as componentes RGBA...
true
66732faf5269ae859f7c2946ff8a2fe0aeed393d
C++
sanyamdtu/interview_questions
/graphs/mother_vertex.cpp
UTF-8
662
3.046875
3
[]
no_license
void dfs(vector<int> g[], int vis[], int src, stack<int> &s) { for (auto i : g[src]) { if (vis[i] == 0) { vis[i] = 1; dfs(g, vis, i, s); } } s.push(src); } int findMother(int n, vector<int> g[]) { int vis[n]; memset(vis, 0, sizeof(vis)); stack...
true
5636faf622bec622a027b6504968857d6e5fd3d3
C++
ZidongLiu/leet_code_Solution
/main.cpp
UTF-8
483
2.59375
3
[]
no_license
#include <vector> #include <set> #include <algorithm> #include <iostream> #include <string> #include <iomanip> #include <map> #include <cmath> #include <unordered_set> #include <limits> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NUL...
true
d135b8287534756077fa046404c4877d3451161b
C++
TomLott/cpp
/day00/ex01/phonebook.class.cpp
UTF-8
1,648
2.703125
3
[]
no_license
#include "phonebook.hpp" PhoneBook::PhoneBook() { exist = 0; } PhoneBook::~PhoneBook(){} void PhoneBook::setFirstName(std::string &s) { PhoneBook::_firstName = s; } void PhoneBook::setLastName(std::string &s){ this->_lastName = s;} void PhoneBook::setNickname(std::string &s){ this->_nickname = s;} void PhoneB...
true