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
e75f0c167758213015f5271088dce3727b3b0c81
C++
tomcruse/algorithm
/1777순열복원.cpp
UHC
958
2.75
3
[]
no_license
#include<cstdio> #include<algorithm> #include<vector> using namespace std; int n, seg[400010], arr[100100]; int update(int pos, int val, int node, int l, int r) { if (pos<l || pos>r) return seg[node]; if (l == r) return seg[node] = val; int mid = (l + r) >> 1; return seg[node] = update(pos, val, node * 2, l, mid) +...
true
06a280b83f040c044ae300822ff0bde9dc4ef72b
C++
PlasticPack/SPAAAACE
/SPAAAACE/SPAAAACE/GameLogicComponent.h
UTF-8
1,033
2.875
3
[]
no_license
/***************************** Créé par Charles Murphy Component servant à la gestion de la logique du jeu : les points de vie, le carburant, le moteur ******************************/ #pragma once #include "Component.h" #include <vector> #include <memory> class GameLogicComponent : public Component { public: GameLo...
true
fbfcabde14b1b561e7c2e2439e25b2b5507e40da
C++
jzweig/snow-gl
/shapes/Renderable.h
UTF-8
253
2.765625
3
[]
no_license
#ifndef RENDERABLE_H #define RENDERABLE_H /** A renderable shape/object/some-dimensional figure. */ class Renderable { public: Renderable(); //! Renders this shape. virtual void render() = 0; }; #endif // RENDERABLE_H
true
12c6a897fd8c4e07bee75026e66b7cd2dd72cea0
C++
TopologicalAnalysisArsuagaLab/Minicircles
/bigvalence.cpp
UTF-8
14,071
2.9375
3
[]
no_license
//============================================================================ // Name : bigvalence.cpp // Author : Kenneth Edward Hinson // Version : // Copyright : Copyrights by Owner // Description : C++, Ansi-style //============================================================================ #i...
true
d9b827272f0b53153523cc3bb7fbdca55e9fc706
C++
georgyangelov/fireflies
/Arduino/SerialProtocol.hpp
UTF-8
1,553
2.96875
3
[]
no_license
#define SERIAL_PACKET_BUFFER_SIZE 2048 #define min(a, b) ((a) < (b) ? (a) : (b)) struct Packet { byte type; uint16 length; byte data[SERIAL_PACKET_BUFFER_SIZE]; }; class SerialProtocol { bool reading = false, packetReady = false; Packet packet; uint16 lengthLeftToRead = 0; const byte BEGIN_MARKER = 0xff,...
true
7f4a7862bc767ee1cf4444d5d6fb605062d3dfe1
C++
dwykat/practice
/week20201019-20201025/20201024/2-method1.cpp
UTF-8
1,979
3.453125
3
[]
no_license
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* addTwoNumbe...
true
a0c5cd35c58ef214fd1fd9b9b39342217c7d3598
C++
danceinthedark/BUPT-Projects
/Algorithm/第4章作业/main.cpp
GB18030
15,697
2.875
3
[]
no_license
#include <iostream> #include <sstream> #include <fstream> #include <cstring> #include <cstdlib> #include <vector> #include <climits> #include <cmath> #include <queue> #include <map> #include <algorithm> #define MAXSIZE 10000 #define Pi 3.141592657 typedef struct station { long long enodedId; double longitude,...
true
6d5912d39b4c3e4c5668dd61081e45404bec7e3e
C++
DelyanaR/OOP_20_21
/Subscribers and Publishers/Repository.hpp
UTF-8
885
3.0625
3
[]
no_license
#pragma once #include "Averager.hpp" #include "MovingAverager.hpp" #include "PeriodicSampler.hpp" #include <vector> // Repository is the single place where Subscribers will // be stored. A Repository has ownership of the Subscribers // stored inside it. // The only way to access the available Subscribers in t...
true
87553fbe56567bd43d529db42af1422ae7c204ae
C++
StefanoBelli/mallocx
/mallocx_based_allocator.cpp
UTF-8
1,153
3.203125
3
[]
no_license
#include <cstdint> #include <new> #include <string> #include <vector> #include <mallocx.h> void* operator new(std::size_t count) { void* ptr = mallocx(count); if(ptr == nullptr) throw std::bad_alloc(); return ptr; } void operator delete(void* oldptr) { freex(oldptr); } void operator delete[]...
true
39a69e8c7ee9d19a9f0ebf89a894ca24ffc5059c
C++
danilaferents/maestroofprogramming
/2018/graph/summdistances.cpp
UTF-8
2,995
3.15625
3
[]
no_license
#include<climits> using namespace std; #include <iostream> #include <vector> #include <algorithm> #include <map> /** Interface */ inline int readChar(); template <class T = int> inline T readInt(); template <class T> inline void writeInt( T x, char end = 0 ); inline void writeChar( int x ); inline void writeWord( ...
true
d228966bfbd7b80a452552b870b98f5c5122c4d5
C++
quinnc/adventofcode2018
/day7/parser.cpp
UTF-8
5,356
3.1875
3
[ "MIT" ]
permissive
#include <cstdio> #include <iostream> #include <map> #include <list> #include "parser.h" using namespace std; #if 0 list<char>::iterator Parser::InsertTask (char task, list<char>::iterator startPos) { // as long as the letters more, move to next // insert before the first letter ...
true
90c9aa2f76f2bdc4d1a5b55611565b2025749b3e
C++
t-mochizuki/cpp-study
/AtCoder/typical90/018 - Statue of Chokudai/main.cpp
UTF-8
1,183
2.625
3
[ "MIT" ]
permissive
// g++ -std=c++14 -DDEV=1 main.cpp #include <stdio.h> #include <cassert> #include <iostream> #include <fstream> #include <vector> #include <cmath> using std::cin; using std::cout; using std::endl; using std::terminate; using std::vector; #define rep(i, a, n) for (int i = (a); i < (n); ++i) #define bit(n, k) ((n >> k)...
true
36daa31d5386262041a898fd6cd561e41a7e35df
C++
akadjoker/mob2d
/libMob2D/src/SpriteManager.cpp
UTF-8
3,139
2.578125
3
[]
no_license
#include "SpriteManager.h" namespace Mob2D { SpriteManager* SpriteManager::m_pInstance = NULL; void SpriteManager::Init() { // string error = "ERROR"; pSprite error_spr(new Sprite()); sprites.insert(std::pair<string, pSprite>("ERROR", error_spr)); // Create the error sprite. error_color_array[0] = 1....
true
3ae6fd13b9153ec321cd3ce9291f86620ea84e2b
C++
kartavya96/Competitive
/SPOJ/Phidias.cpp
UTF-8
718
2.5625
3
[]
no_license
#include <iostream> #include <cstring> using namespace std; int T,W,H,N,w,h,best[620][620]; int main() { cin >> T; while (T--) { memset(best,0x3f,sizeof(best)); cin >> W >> H >> N; while (N--) { cin >> w >> h; best[w][h]=0; } for (int i=0; i<=W; i++) {...
true
8f6d27c42e832ac350938b05540d837e5c5f868c
C++
solaresjuan98/EDD-ejemplos
/ListaDoble/listadoble.cpp
UTF-8
2,418
3.265625
3
[]
no_license
#include "listadoble.h" ListaDoble::ListaDoble() { this->head=NULL; } ListaDoble::~ListaDoble(){ Nodo* aux=this->head; Nodo* tmp; while(aux!=NULL){ tmp=aux->getDerecha(); delete aux; aux=tmp; } } void ListaDoble::insertarOrdenado(Nodo *nuevo){ if(this->head==NULL){ ...
true
31171a60c93cf4acf86dc3b93b7adb58494ee55d
C++
ReemTarek/GraduationProjectfinal
/bicycle (1).cpp
UTF-8
1,493
2.640625
3
[]
no_license
#include "bicycle.h" #include <QDebug> #include<QTransform> Bicycle::Bicycle() { } QPair<QPointF, qreal> Bicycle::run(QPair<QPointF, qreal>curConfig, qreal velocity, qreal wheelsAngle) { QPointF pos = curConfig.first; qreal rotation = curConfig.second; qreal theta = qDegreesToRadians(rotation); qrea...
true
3d16380a87ebe663c7b35bc2ac41d85833420795
C++
hernandez232/FP_Tareas_00075919
/x_y.cpp
UTF-8
799
3.140625
3
[]
no_license
#include <iostream> using namespace std; int main(){ int n=0, cx=1, cy=1, l=1, x [50], y [50]; cout << "Ingrese la magnitud de la lista: "; cin >> n; cout << endl; cout << "Ingrese los numeros de la lista X:" << endl; for (int i=0; i<n; i++){ cout << "X" << cx << ": "; cin >> x[i...
true
03ca29a63cde1da1ac758624f9fe75fd63f08f8e
C++
MelisaLuciano/SistemasDistribuidos
/16/SocketDatagrama.h
UTF-8
1,070
2.640625
3
[]
no_license
#ifndef SOCKETDATAGRAMA_H_ #define SOCKETDATAGRAMA_H_ #include "PaqueteDatagrama.h" #include <sys/socket.h> #include <sys/time.h> #include <netinet/in.h> class SocketDatagrama { public: SocketDatagrama(int); // puerto local no se podrá cambiar para el proceso. Si // es cero, lo asigna el ...
true
7b0a5be41242c5aa75a76fb24eba02bd90b800a7
C++
gexchai/Papouja
/src/GUI.hpp
UTF-8
1,583
2.703125
3
[]
no_license
#ifndef GUI_HPP #define GUI_HPP #include "Resourcemanager.hpp" #include "Settings.hpp" #include <SFML/Graphics.hpp> #include <cstddef> #include <string> class MenuPoint { public: MenuPoint(); ~MenuPoint(); void SetText(const std::string& text, unsigned int size); void SetFont(const sf::Font& font); v...
true
f0ce4dd0408dc782df26a154e35e6d397e41dec3
C++
7ZONE/TheObjOfCpp
/ConsoleApplication5/ConsoleApplication5/TheStudentSystem.cpp
GB18030
9,332
3.046875
3
[]
no_license
#include<stdio.h> #include<math.h> #include <conio.h> #include <process.h> #define n 2//ѧУĿ #define m 1//ĿĿ #define w 1//ŮĿĿ #define null 0 typedef struct { int itemnum; //Ŀ int top; //ȡεĿ int range[5]; // int mark[5]; // }itemnode; //Ŀ typedef struct { int schoolnum; //ѧУ int score; //ѧУܷ int mscore; //ܷ int w...
true
e938b1b04f8c99224e8008a062a1a222f19ef2c9
C++
tigoe/BallDropGame
/ESP-to-ATTiny-TelnetClient/ESPSerialToTelnetClient/ESPSerialToTelnetClient.ino
UTF-8
3,657
3.234375
3
[]
no_license
/* This sketch makes a telnet client on port 8080 to a server It echoes any serial bytes to the server, and any server bytes to the serial port. This is a modified version of the EspWiFiTelnetClient note: the header file "settings.h" is not included in this repository. Add a new tab in Arduino, call it "sett...
true
23fb7ea95552a74b5ba401bd028ed6316fb49f20
C++
kuqadk3/CTF-and-Learning
/YUBITSEC 2017/Cryptography/175 - Simple Encryption/decode.cpp
UTF-8
341
2.609375
3
[]
no_license
#include <iostream> #include <iomanip> #include <numeric> #include <vector> #include <algorithm> #include <fstream> using namespace std; int main(){ std::fstream myfile("encrypted.txt", std::ios_base::in); int number; while(myfile >> number){ cout << (char)(number^62); } cout << endl; system("pa...
true
892165ef8557b7f59348400ee6fbfbfe3fe71d70
C++
SebastianMateo/CursoGlobant
/MathLib/MathLib/Matrix.cpp
UTF-8
1,070
3.265625
3
[]
no_license
#include "Matrix.h" template <unsigned int N> Matrix<N>::Matrix(std::array<double, N*N> values) : mMatrix(values) { } template <unsigned int N> Matrix<N>::Matrix() { } //Addition template <unsigned int N> Matrix<N>& Matrix<N>::operator+=(const Matrix<N>& rhs) { for (int i = 0; i < N * N; i++) this->mMatr...
true
17496b520a154a1719e93915b0478cda5472ebe7
C++
SaulZhang/Algorithm-Templates
/1-PAT专题训练/收拾残局/1058.cpp
UTF-8
887
2.78125
3
[]
no_license
#include <iostream> #include <algorithm> #include <string> #include <sstream> #include <vector> using namespace std; string A,B,token; vector<int> An,Bn,res; int main() { cin>>A>>B; stringstream ssA(A),ssB(B); while(getline(ssA,token,'.')){ An.push_back(stoi(token)); } while(getline(ssB,toke...
true
b0271a6fec4e93a698cc4208d9b3590b4275d957
C++
jpieper/rpicar
/holster/include/error.h
UTF-8
538
3.015625
3
[]
no_license
/* * @author Carl Saldanha <cjds92@gmail.com> * @brief An error handler */ #ifndef HOLSTER_INCLUDE_ERROR #define HOLSTER_INCLUDE_ERROR #include <optional> #include <string> class Error { public: explicit Error(const std::string& error): error_(error) {} const char* throw_error() const throw()...
true
c7be338f737a05addd108778daa479209afba781
C++
btroxell/CS30000
/One_Operand_Instr.h
UTF-8
815
2.796875
3
[]
no_license
#ifndef _ONE_OPERAND_INSTR_H_ #define _ONE_OPERAND_INSTR_H_ #include "Instruction.h" #include "Operand.h" /* 4/24/18 Brandon Troxell: TODO: Need to create a copy constructor for instructions so that when the HashTable getInstruction() returns an instruction, we can copy it and initialize an operand to be able to pas...
true
e60d9363a2a426e6e5a12b809a7c44e4d284a3c3
C++
DiogoMCampos/osmParsePOI
/src/Parser.cpp
UTF-8
4,046
2.78125
3
[]
no_license
#include "Parser.hpp" using namespace std; bool Parser::openFiles() { if (!openOSMFile() || !openPOIFile() || !isValidOSMFile()) return false; return true; } void Parser::closeFiles() { osmFile.close(); destFile.close(); } bool Parser::openOSMFile() { string filename; do { if (osmFile.fail()) { osmFi...
true
66f458de37e397ad913d944c512c5d7b992dc2b0
C++
hyejinhong/Algorithm-study
/Problem Solving/SWEA 5357 터널 속의 기차.cpp
UHC
706
3.046875
3
[]
no_license
#include <iostream> using namespace std; int main() { int t; // test case cin >> t; for (int test = 1; test <= t; test++) { int N, H; cin >> N >> H; int a[100001]; int o[100001]; for (int i = 0; i<N; i++) cin >> a[i]; for (int i = 0; i<N; i++) cin >> o[i]; int count = 0; int result = 0; ...
true
eae6ee860bd641fb52a8b2a475fbdb919b077b96
C++
sharonsitu/Quadris-CS246-F2016
/Jblock.cc
UTF-8
5,462
3.015625
3
[]
no_license
#include "Include/Jblock.h" #include <iostream> #include <vector> using namespace std; /* JBLOCK METHODS */ //Jblock cstr JBlock::JBlock(char type, int number,Board* myboard):Block(type,number,myboard){ cellArray[0] = Cell(3,0,'J',number); cellArray[1] = Cell(4,0,'J',number); cellArray[2] = Cell(4,1,'J'...
true
975edc8bef2bff9be2665df2b55e2efaa220e4d6
C++
shashankch/DataStructures-Algorithms
/balancedparanthesestack.cpp
UTF-8
690
3.625
4
[]
no_license
#include <iostream> #include <stack> #include <cstring> using namespace std; int main() { char str[100]; cin >> str; stack<char> stk; for (int i = 0; str[i] != '\0'; i++) { if (str[i] == '(') { stk.push(str[i]); } else if (str[i] == ')') { ...
true
8285a97bd65e9314b02463f43db8a322bf4e5f72
C++
sean-dougherty/cuda-edu
/dev/tests/guard/main.cpp
UTF-8
6,401
2.515625
3
[]
no_license
#define EDU_CUDA_ERR_THROW #include <eduguard.h> using namespace std; using namespace edu; using namespace edu::guard; #define expect_fail(stmt) try {stmt; cerr << __FILE__ << ":" << __LINE__ << ": Expected failure" << endl; abort();} catch(...){} //--- //--- 1D Arrays //--- void test_array() { const int N = 20;...
true
7ac62770690d1485f04a68d1d4c00ba85dc9f8f5
C++
naoki-cpp/LittleWars
/LittleWars/include/Task.h
SHIFT_JIS
537
2.609375
3
[]
no_license
#pragma once class Task { public: virtual ~Task() {} // virtual void Initialize(){} //͎ĂȂĂ //㏈ virtual void Finalize() {} //I͎ĂȂĂ //t[Ăяo virtual void Update() = 0; //XV͕KpŎ //`揈 virtual void Draw()const = 0; //`揈͕KpŎ protected: Task(){}; private: Task(Task&);//Öٕϊ̋֎~ };
true
99e0524ebd68e4cf5fb29a32ce4d6e5cfd472467
C++
lovms/code_snippets
/leetcode_solutions/curated_top_100/list/20201213_19_Remove_Nth_Node_From_End_of_List_20201201.cpp
UTF-8
3,960
3.3125
3
[ "MIT" ]
permissive
//Given the head of a linked list, remove the nth node from the end of the list and return its head. // //Follow up: Could you do this in one pass? // //  // //Example 1: // // //Input: head = [1,2,3,4,5], n = 2 //Output: [1,2,3,5] //Example 2: // //Input: head = [1], n = 1 //Output: [] //Example 3: // //Input: head = ...
true
45c5de297f67cc2a44e54a93f25a7b99946b2a8f
C++
YASHGUPTA410/Algorithm
/linearSearch.cpp
UTF-8
894
3.984375
4
[ "MIT" ]
permissive
//implementing linear search in an unsorted array //It is an example of subtractive recursive/iterative algorithm //as after every iteration size of an array decreases by 1 #include<iostream> #include<stdlib.h> using namespace std; //time complexity O(n) //searches recursively int linearSearch(int a[], int low, int hi...
true
b2bc0ae038048a2bbc7071f6f924c252d8b7a1fc
C++
Manthan-R-Sheth/CodingHub
/gfg/Leaves.cpp
UTF-8
681
3.671875
4
[]
no_license
#include<bits/stdc++.h> using namespace std; struct treenode { int data; struct treenode* left; struct treenode* right; }; struct treenode* newNode(int data) { struct treenode* node=(struct treenode*)malloc(sizeof(struct treenode)); node->left=NULL; node->right=NULL; node->data=data; return node; } void leav...
true
5e6687579a8cd6871538d27301bfccdd37d19771
C++
profeIMA/PID-UdG
/installation/Linux/sources/DrawFilledTriangle.h
UTF-8
1,871
3.453125
3
[]
no_license
#ifndef DRAWFILLEDTRIANGLE_H #define DRAWFILLEDTRIANGLE_H #include "Drawable.h" #include "RGBColor.h" #include "Figures.h" /** @brief Implementation of Drawable interface. * This class is capable of storing the information of a filled triangle and represent it on a Window drawing the figure. */ #ifdef _WIN32 class D...
true
2a9a616d20e8adb16c587adeeb0c9cc65886fb32
C++
lriki/Volkoff
/Sources/Object/Valfirle.h
SHIFT_JIS
8,363
2.546875
3
[]
no_license
//============================================================================= /*! @addtogroup @file Valfirle.h @brief @t@[wb_ @t@[pAI̒` @attention - @note - @author Hi-ra Mizuno @date 2012/02/15 @version 1.0.0 @par Copyright ...
true
63e156367aa3c2e36cb487d7f9e68595e0369500
C++
muzigef/Play-with-Algorithms
/02-Sorting-Basic/01-Selection-Sort/main.cpp
UTF-8
280
3.046875
3
[]
no_license
#include <iostream> #include "selectionSort.h" using namespace std; int main() { int arr[] = { 4, 1, 6, 3, 7, 2, 8 }; selectionSort(arr, 7); for (int i = 0; i < 7; i++) { cout << arr[i] << " "; } cout << endl; system("pause"); return 0; }
true
6e26e5852028fc96d559c7332596e5f044246c03
C++
marcoStocchi/DSPX_Fast_wavelet_transform_assisted_predictors_of_streaming_time_series
/DSPX_financial_convert.h
UTF-8
4,106
2.625
3
[ "MIT" ]
permissive
// Copyright (c) <2016> <Marco Stocchi, UNICA> // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,...
true
797db952be8191bc8546b208c23e0bb9af5d1cd2
C++
CommunicoPublic/iris
/tags/iris-0.1.23/include/net/ClientTCPSocket.hpp
UTF-8
2,025
2.53125
3
[]
no_license
/*- * Copyright (c) Iris Dev. team. All rights reserved. * See http://www.communico.pro/license for details. * */ #ifndef _CLIENT_TCP_SOCKET_HPP__ #define _CLIENT_TCP_SOCKET_HPP__ 1 #include "TCPSocket.hpp" namespace IRIS { /** @class ClientTCPSocket ClientTCPSocket.hpp <ClientTCPSocket.hpp> @brief Base cl...
true
e284c44dfa911aca1bba6f7835ae5e1872c2fdf3
C++
arjun-krishna/Graph-Coloring
/color.cpp
UTF-8
2,864
3.453125
3
[]
no_license
/* * NAME : col.cpp * AUTHOR : Arjun Krishna * usage : ./[prog_name] filename N * "filename" contains data in edge List format * N is the number of vertices in the Graph represented in "filename" * NOTE : vertices labeled from 0 to N-1 should be in filename and it won't be checked in this code. ...
true
f9d4f9c2748b328a1af0d946981d88302e77c8b0
C++
voltrevo/vortex
/src/vm/Array.cpp
UTF-8
10,401
3.484375
3
[]
no_license
#include <immer/flex_vector_transient.hpp> #include "Array.hpp" #include "LexOrder.hpp" #include "Object.hpp" #include "Value.hpp" namespace Vortex { void TransientInsert( immer::flex_vector_transient<Value>& arr, Uint64 pos, Value&& val ) { auto p = arr.persistent().insert(pos, val); arr = p....
true
431b6fe8ea4f60fd919024457fbbde655e25f07a
C++
alberiolima/Inspire-OpenLung-RCModelFirmware
/INSPIRE/INSPIRE/ARDUINO/MAIN/PRESSURE.ino
UTF-8
498
2.703125
3
[ "MIT" ]
permissive
#define CmH20_0 207.0 //A0 val @0cmH2O #define CmH2O_20 528.0 //A0 val @20cmH2O #define PRESSURE_PIN A0 //Constants const float deltaCmH2O = 20 / (CmH2O_20 - CmH20_0); float PressureGet_cmH2O() { float Pressure = (float) analogRead(PRESSURE_PIN ) - CmH20_0; return (deltaCmH2O * Pressure); } int Pressu...
true
9eed5524fdb68a0555f80452bcdda49950285a01
C++
Koldar/pathfinding-utils
/src/main/include/operators.hpp
UTF-8
1,297
3.25
3
[ "MIT" ]
permissive
#ifndef _PATHFINDING_UTILS_OPERATORS_HEADER__ #define _PATHFINDING_UTILS_OPERATORS_HEADER__ #include <cpp-utils/exceptions.hpp> #include "types.hpp" namespace pathfinding { //TODO remove superseded by std::function. Remember to create a local variable of type std::function if you want to pass a lambda /** ...
true
bc63e12cda7de94ab37d88d1cf86e8022b786720
C++
wakare/Leviathan
/src/RuntimeAttributeWatcher/InternRuntimeAttribute.h
UTF-8
1,720
2.953125
3
[ "MIT" ]
permissive
#pragma once #include "RuntimeAttribute.h" #include <sstream> namespace Util { template <typename T> class InternalAttribute : public RuntimeAttribute { public: InternalAttribute(T value); void SetName(const INTERN_STRING& name); void SetDesc(const INTERN_STRING& desc); void SetValue(const INTERN_STRING& v...
true
51948c7f23a9f9e87f77c713ee891895b29c93a6
C++
atubo/online-judge
/luogu/P3143.cpp
UTF-8
2,257
2.828125
3
[]
no_license
// https://www.luogu.org/problem/show?pid=3143 // [USACO16OPEN]钻石收藏家Diamond Collector #include <bits/stdc++.h> using namespace std; const int MAXN = 50010; int N, K; int A[MAXN], B[MAXN], C[MAXN], D[MAXN], E[MAXN], F[MAXN]; class BIT { public: // Note size needs to be power of 2 BIT(int size): N(size) { ...
true
f5a5e9743cd75766a08d2175e47abcdf417d8f5c
C++
madhavanrp/InfluenceMaximization
/InfluenceMaximization/GenerateGraphLabels.cpp
UTF-8
5,510
2.765625
3
[]
no_license
// // GenerateGraphLabels.cpp // InfluenceMaximization // // Created by Madhavan R.P on 12/15/17. // Copyright © 2017 Madhavan R.P. All rights reserved. // #include "GenerateGraphLabels.hpp" void GenerateGraphLabels::initializeDataAndGenerate(Graph *graph, float percentage, LabelSetting labelSetting) { this->...
true
bdb48ca6a73b8be33d9454d12dcaf93095dc634d
C++
Adrian94F/SDiZO_PEA
/SDiZO2d/sdizo-proj2/display.cpp
UTF-8
337
3.15625
3
[]
no_license
#include "header.h" void DisplayVec(vector<int> input, int dest) { cout << input[dest] << " "; } void DisplayEdge(vector<Edge> input) { cout << " Src: Dst: Wt:" << endl; for (int i = 0; i < input.size(); i++) cout << setw(6) << input[i].source << " " << setw(6) << input[i].dest << " " << setw(6) << input[i]....
true
4cd5faffdd1d2c19c6aca4aa259b1f61b5ee7abb
C++
hassanrwarraich/Cplusplus-small-projects-and-hws
/Lab3Partb_2/src/main.cpp
UTF-8
344
2.71875
3
[]
no_license
#include <iostream> #include "MedianHeap.h" using namespace std; int main() { MedianHeap median; cout<<median.findMedian()<<endl; median.insert(1); median.insert(2); median.insert(3); median.insert(4); median.insert(5); median.insert(6); cout<<median.findMedian()<<end...
true
c5ffa00a304b44ce4c8ac2a4420f1f3e74bcc200
C++
haiimz1234/mmCoreAndDevices
/DeviceAdapters/LightSheetManager/LightSheetDeviceManager.h
UTF-8
2,380
2.546875
3
[ "BSD-3-Clause" ]
permissive
/* * Project: Light Sheet Device Manager * License: BSD 3-clause, see license.txt * Author: Brandon Simpson (brandon@asiimaging.com) * Copyright (c) 2022, Applied Scientific Instrumentation */ #ifndef _LIGHTSHEET_DEVICE_MANAGER_H_ #define _LIGHTSHEET_DEVICE_MANAGER_H_ #include "MMDevice.h" #include "DeviceBase.h...
true
a4dc64867c5ef6a92c8c33b056217967c18d87d4
C++
SebastianEd/Laser-Ships
/Laser-Ships/Sound.cpp
UTF-8
1,162
2.796875
3
[]
no_license
#include "Sound.h" //Constructor // CSound::CSound() { m_pBMG = nullptr; m_pSoundEffect = nullptr; if (Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048) < 0) { std::cerr << "Error: " << Mix_GetError() << std::endl; } }//Constructor void CSound::CleanUp() { freeMusic(); Mix_CloseAudio(); Mix_Quit(); } /...
true
e6db101b71160f53e7c31f9511aa129b7d906275
C++
dacap/handy
/app/cursors.h
UTF-8
862
2.9375
3
[ "MIT" ]
permissive
// handy text editor // Copyright (c) 2016 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #pragma once #include "base.h" #include <vector> class Cursors { public: Cursors() { } cursor_ref add(cursor_t p) { for (cursor_ref i=0; i<m_val...
true
1d4db13ed53c5fa10656716c4d6fbdad7cab367c
C++
nikkokun/software-engineering
/HashMap/include/SortedList.h
UTF-8
5,313
3.765625
4
[]
no_license
// // Created by Nico Roble on 2019-10-07. // #ifndef HASHMAP_SORTEDLIST_H #define HASHMAP_SORTEDLIST_H #include <vector> using namespace std; class Node { private: int data; Node *next; public: int getData() const { return data; } void setData(int data) { Node::data = data; } Node *getNe...
true
af1928d1063323ff0d64b076dbaa93905dc51110
C++
zeroplusone/AlgorithmPractice
/Leetcode/246. Strobogrammatic Number.cpp
UTF-8
535
3.15625
3
[]
no_license
class Solution { public: bool isStrobogrammatic(string num) { unordered_map<char, char> m; m['0']='0'; m['1']='1'; m['6']='9'; m['9']='6'; m['8']='8'; int n=num.length(); for(int i=0;i<n/2;++i) { if(m[num[i]]!=num[n-i-1]) { ...
true
f9949c5f6db7cd5a714e7eb72091a90f4970e432
C++
surya3997/HackerRank
/Data Structures/Trees/Tree: Height of a Binary Tree/Tree: Height of a Binary Tree.cpp
UTF-8
384
3.625
4
[]
no_license
/*The tree node has data, left child and right child struct node { int data; node* left; node* right; }; */ int height(node * root) { int num1,num2; if(root==NULL) return -1; else{ num1=height(root->left); num2=height(root->right); if(num1>num2) ret...
true
66aaa31db430e091426c57964f8667242ce8499d
C++
Sine-mora/CPP_Exercises
/CourseC++/src/Structs/Structs.cpp
UTF-8
1,248
2.953125
3
[]
no_license
#include "Structs.h" Camera::Camera(int nFront, int nRear) : m_nFront{nFront}, m_nRear{nRear} { } std::ostream& operator<<(std::ostream& out, const Camera& obj) { out << "\nCamera Rear: " << obj.m_nRear << "\nCamera Front: " << obj.m_nFront << "\n"; return out; } Phone::Phone(const std::string& strName, ...
true
6a12ddfbd1239ba9bd20775b2dc2f0ab195788f7
C++
alifainur/mtech
/mqtt_relay_String.ino
UTF-8
2,418
2.546875
3
[]
no_license
#include <WiFi.h> #include <PubSubClient.h> const char* ssid = "yourSSID"; const char* password = "yourPASSWORD"; const char* mqtt_server = "broker.hivemq.com"; WiFiClient espClient; PubSubClient client(espClient); void setup_wifi(){ delay(10); // Start connecting to WiFi network Serial.println(); ...
true
f03853ffe8f6972808c73a4cecc133c29384cd1b
C++
romualdo97/opengl_studies
/022_framebuffers/code_vs_v16_2019/001_framebuffers/Box.h
UTF-8
10,711
3.03125
3
[]
no_license
#pragma once #include <glad\glad.h> // index drawing data for draw a cube unsigned int const BACK_OFFSET = 4; unsigned int const LEFT_OFFSET = 8; unsigned int const RIGHT_OFFSET = 12; unsigned int const TOP_OFFSET = 16; unsigned int const BOTTOM_OFFSET = 20; // Struct used for drawwing boxes struct Box { public: B...
true
a9be01928a880d3e62fcd17978c1e0b68006e970
C++
SquarePants1991/EZGLKit
/Classes/utils/ELFileUtil.cpp
UTF-8
2,318
2.671875
3
[]
no_license
// // Created by wangyang on 16/11/24. // #include "ELFileUtil.h" #include "ELAssets.h" #include <fstream> #include <regex> std::string ELFileUtil::stringContentOfFile(const char *filePath) { std::ifstream fileStream(filePath); std::string fileContent; std::string line; if (fileStream.is_open()) { ...
true
ed6ddd28aa0d84ea49b5891bdcb9760924beadf7
C++
bladykast/MotionCar206
/receiver-car-code.ino
UTF-8
3,051
2.890625
3
[]
no_license
#include <nRF24L01.h> #include <printf.h> #include <RF24.h> #include <RF24_config.h> //Mert Arduino and Tech YouTube Channel -- https://goo.gl/ivcZhW //Add the necessary libraries //You can find all the necessary library links in the video description #include <SPI.h> //SPI library for communicate with ...
true
b861cae3924923c277156734e5e29f7d6305c1ed
C++
tamwaiban/nextgame
/tests/Core/TestStaticVector.cpp
UTF-8
1,871
2.59375
3
[ "BSD-3-Clause", "MIT" ]
permissive
#include "stf.h" #include "Core/Defer.h" #include "Core/StaticVector.h" STF_SUITE_NAME("Core.StaticVector") /* _ _ | | | | | |_ ___ __| | ___ | __/ _ \ / _` |/ _ \ | || (_) | (_| | (_) | \__\___/ \__,_|\___/ #define CHECK_VECTOR(v, len, cap, data) \ do { \ ...
true
b8059630973fe9718de00283c216f101ae1a35cc
C++
0GU/Rain-cloud-friends
/Project1/Project1/ObjTurtle.h
SHIFT_JIS
1,334
2.515625
3
[]
no_license
#pragma once //gpwb_[ #include "GameL\SceneObjManager.h" //gpl[Xy[X using namespace GameL; //IuWFNgFT class CObjTurtle : public CObj { public: CObjTurtle(float x, float y); ~CObjTurtle() {}; void Init(); //CjVCY void Action(); //ANV void Draw(); //h[ float GetVx() { return m_vx; }; float GetPY() { return m_py...
true
4134716603882a6ec82902f81706f0760f1b011e
C++
jinay1991/spleeter
/spleeter/inference_engine/null_inference_engine.h
UTF-8
1,260
2.59375
3
[ "MIT", "CC-BY-3.0" ]
permissive
/// /// @file /// @copyright Copyright (c) 2020. MIT License /// #ifndef SPLEETER_INFERENCE_ENGINE_NULL_INFERENCE_ENGINE_H #define SPLEETER_INFERENCE_ENGINE_NULL_INFERENCE_ENGINE_H #include "spleeter/datatypes/inference_engine.h" #include "spleeter/inference_engine/i_inference_engine.h" namespace spleeter { /// @brie...
true
f1ad3444dcf178ce243576ed8294605abae82c00
C++
anigmo97/4
/IPV/PARTE 1/include/GameCharacters.h
ISO-8859-10
4,076
2.53125
3
[]
no_license
//FICHERO MODIFICADO-E1 /*///////////////////////////////////////////////////////////////////////////////////// // @file GameCharacters.h // Every different kind of character is loaded using this header // Prefix: GCHARS_ @author Ramon Molla @version 2011-08 */ #ifndef GAME_CHARACTERS #define GAME_CHAR...
true
81ce1557df4d264ff2ebee8ac62ef56433bc3f90
C++
NickGorev/made_2019_cpp
/02/allocator.cpp
UTF-8
548
3.21875
3
[]
no_license
#include "allocator.h" LinearAllocator::LinearAllocator(size_t maxSize) { storage = (char*) malloc(maxSize); storageEnd = storage; if (storage != nullptr) { storageEnd += maxSize; } head = storage; } LinearAllocator::~LinearAllocator() { free(storage); } char* LinearAllocator::alloc(s...
true
3c485ac63be5ba7b52e976a264a8ff029edd4e01
C++
miha-pavel/arduino
/Lesson2-Photosensitive Resistorr/photosensitive/photo_res_2.ino
UTF-8
614
3.015625
3
[]
no_license
int sensePin = 2; // Пин к которому подключен фоторезистор int ledPin = 12; // Пин к которому подключен светодиод void setup() { pinMode(ledPin, OUTPUT); // назначаем пин ledPin выходом } void loop() { int val = analogRead(sensePin); // Считываем значение с фоторезистора if(val < 800) digitalWrite(ledPin, HIGH...
true
1e7c7bc7a4277577b2c90c1a041d21408ba14ca9
C++
beierjy/InterviewCodes
/8_6_66_StringPathInMatrix.h
UTF-8
2,155
4
4
[]
no_license
/* 请设计一个函数,用来判断在一个矩阵中是否存在一条包含某字符串所有字符的路径。 路径可以从矩阵中的任意一个格子开始,每一步可以在矩阵中向左,向右,向上, 向下移动一个格子。如果一条路径经过了矩阵中的某一个格子,则该路径不能再进入该格子。 例如 a b c e s f c s a d e e 矩阵中包含一条字符串"bcced"的路径,但是矩阵中不包含"abcb"路径, 因为字符串的第一个字符b占据了矩阵中的第一行第二个格子之后,路径不能再次进入该格子。 */ #include <iostream> #include <cstring> using namespace std; bool hasPathCore...
true
b7d6f0170bd78c1d9c415989572a48d4e35370d0
C++
skylersaleh/ArgonEngine
/common/ArgonEngine/ArgonInit.h
UTF-8
761
2.609375
3
[ "MIT" ]
permissive
//Generated by the Argon Build System /** * @brief This file contains the declaration for the initialization functions of the engine. * @file ArgonInit.h * @author Skyler Saleh **/ #ifndef ARGON_INIT_H #define ARGON_INIT_H namespace Argon{ /// Initialize the engine and HAL. void initialize_engine(std::stri...
true
0a53b38c90171f198c81446903247e766de99037
C++
zurczi/OOP-Project
/po-projekt/kasa.cpp
WINDOWS-1250
3,527
3.078125
3
[]
no_license
#include <string> #include <iostream> #include "pracownik.hpp" #include "student.hpp" #include "programista.hpp" #include "konto.hpp" #include <vector> #include <fstream> #include "czlowiek.hpp" using namespace std; template <class Temp> class Kasa { private: vector <Temp*> konta; public: void sumujsaldo(){ int ...
true
e60d8ab3a029c49ee8038ee62c2e7aa352d60e0c
C++
stories2/OpenCV
/OpenCV/OpenCV/makefile.cpp
UHC
3,190
2.71875
3
[]
no_license
#include "highgui.h" #include "cv.h" #define pic_width 15000 #define pic_height 500 #define limit 10 struct database { float data[limit]; struct database *link; }; void load(database *,char *, int *, int *); void draw_img(IplImage *, database *, int, int); float get_y(int, float); float get_x(int, float); void ou...
true
ee4681a7f710394a5bf14889ed9c4693db5d6b9d
C++
schemp98/Cpp_Certification_Course
/Exercise/CA3/deitel_cpp10_sourcecode/deitel_cpp10_sourcecode/ch04/Fig04_10/ClassAverage.cpp
UTF-8
1,956
3.28125
3
[]
no_license
// Fig. 4.10: ClassAverage.cpp // Solving the class-average problem using counter-controlled iteration. #include <iostream> using namespace std; int main() { // initialization phase int total{0}; // initialize sum of grades entered by the user unsigned int gradeCounter{1}; // initialize grade # to be entered ...
true
bc79f2caed04005b2260570c5965ded0dc8874be
C++
Farmak09/Group-Movement
/Solution/Motor2D/Squad.h
UTF-8
544
2.515625
3
[]
no_license
#ifndef SQUAD #define SQUAD #include "p2List.h" #include "p2DynArray.h" #include "Entity.h" class Squad { public: Squad(); Squad(p2List<Entity*> &squadMembers); ~Squad(); bool Update(float dt); void StartMovement(iPoint placeClicked); void GenerateNewPaths(); bool CreateMainPath(); void CreateSecondaryPaths...
true
4f384dc6882cee5c7a977b646f7c45982e987ca6
C++
vadshos/oopHome-Work-2
/Avia/Avia/Date.h
UTF-8
1,772
3.765625
4
[]
no_license
#pragma once #include <iostream> #include <string> class Date { public: Date(int d = 0, int m = 0, int y = 0) { setDate(d, m, y); } Date(const Date& date) { setDate(date.day, date.month, date.year); } int getDay() const { return day; } int getMonth() const { ...
true
f31cfe11758b66b59f5f02ab7b6c541bd9884f24
C++
aoyandong/algorithms
/algorithms/search_recursion/word_ladder.cpp
UTF-8
2,647
3.1875
3
[]
no_license
class Solution { public: /** * @param start, a string * @param end, a string * @param dict, a set of string * @return an integer */ /* int ladderLength(string start, string end, unordered_set<string> &dict) { // write your code here // 1-way BFS, much slowe...
true
08d5c435b384492c10424b9d13e0be6a2e0d14e3
C++
AnabaenaQing/Source-Code_ShaderX_GPU-Pro_GPU-Zen
/GPU Pro5/06_Compute/Object-order Ray Tracing for Fully Dynamic Scenes/beMath/header/beMath/beSphereDef.h
UTF-8
4,966
3.046875
3
[ "MIT", "BSD-3-Clause" ]
permissive
/*****************************************************/ /* breeze Engine Math Module (c) Tobias Zirr 2011 */ /*****************************************************/ #pragma once #ifndef BE_MATH_SPHERE_DEF #define BE_MATH_SPHERE_DEF #include "beMath.h" #include "beSphereFwd.h" #include "beTuple.h" #include "beVecto...
true
e2decff9a1c22a4af9aede64a20e54aa1a5a3cbf
C++
jagolu/Universidad
/2/1_Cuatrimestre/ED/Teoria/Ejercicios_STL/Ejercicio15.cpp
UTF-8
1,029
2.984375
3
[]
no_license
#include <iostream> #include <list> #include <stdio.h> #include <stdlib.h> using namespace std; int main(int argc, char * argv[]){ pair<float, float>a; a=(make_pair(atof(argv[1]),atof(argv[2]))); list<pair<float, float> >coordenadas; float n; do{ cout<<"Coordenada 1: "; cin>>n; if(n!=0){ pair<double, ...
true
829f2bfdc7fa261bbd727be2cd490a559a8876a8
C++
tochiton/Data-Structures
/CS Lab practice/Lab1/cs163_list.cpp
UTF-8
3,616
3.46875
3
[]
no_license
#include "cs163_list.h" using namespace std; //Sum all of the data together in a LLL int list::sum_total() { //FIRST do this iteratively here. Then recursively //COMMENT out the iterative version when rewriting //the solution recursively //To solve this recursively write another //...
true
986472e68fd9895c75335ee9944cfc3596d84092
C++
HakeT2Lab/CS246-2020
/Labs/Lab10/lab10B.cpp
UTF-8
1,164
3.234375
3
[]
no_license
#include <iostream> #include <string> #include "Vector.h" #include "Node.h" #include "HashTable.h" using ulong = unsigned long; bool TwoSum(ds::Vector<ulong>& data, ulong target){ // std::cout<<"is working"; ulong sum=0; ulong sumtwo; int c=0; if(data.Length() != 0){ if(target < 1000){ for(int i =...
true
f5378e2c08dc68fda3e3ce6447a06b3d9f8f518f
C++
Seventeen-29/124_PA1
/randmst.cpp
UTF-8
5,833
3.234375
3
[]
no_license
/** *Programming Assignemnt 1, Source Code *Chris Zhu, Rakesh Nori **/ #include <algorithm> #include <iostream> #include <fstream> #include <iomanip> #include <vector> #include <string> #include <cmath> #include <climits> #include <time.h> #include <chrono> using namespace std; const double scalar = 1.8; //k(n) = scal...
true
05ca7141c1c1a4225f99de101797702c33a77a21
C++
AndrijaS37N/chess-game
/chess-game/Knight.cpp
UTF-8
506
3.21875
3
[]
no_license
#include "Knight.h" bool Knight::areSquaresLegal(int srcRow, int srcCol, int destRow, int destCol, ChessPiece* boardMove[8][8]) { // destination square is unoccupied or occupied by opposite color if ((srcCol == destCol + 1) || (srcCol == destCol - 1)) { if ((srcRow == destRow + 2) || (srcRow == destRow - 2...
true
98eaee83b2d7b00911abaddf8355f349c350f1f9
C++
enterpriseih/SkipList
/test.cc
UTF-8
5,263
3.390625
3
[]
no_license
#include "skiplist.h" #include <cassert> #include <chrono> #include <cstdio> #include <iostream> #define Log(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__) // return random = [min, max] int random_range(int min, int max) { return random() % (max - min + 1) + min; } void Test(const int max_size) { int* nums = new int...
true
4ed3d4eae710b219d3886fbb0be0cf97070f51b7
C++
nkher/ctci
/c++/Chapter 17/Question17_7.cpp
UTF-8
2,183
3.953125
4
[]
no_license
#include <iostream> #include <string> #include <vector> using namespace std; // declarations string number_to_str(int number); string number_to_str_100(int number); // global variables vector<string> digits = {"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"}; vector<string> teens = {"Eleven",...
true
c46f933332062aed07c5172ccb447a76ee1f08ea
C++
cwong907/CSCI1300
/hmwk7/getRating.cpp
UTF-8
8,160
3.609375
4
[]
no_license
// CSCI 1300 Fall 2019 // Author: Weige Wong // Recitation: 203 - Soumyajyoti Bhattacharya // Homework 7 - Problem 3 /* 1. Write a main function that has a username, title, users array, books array, users array size, and books array size 2. Write a function that takes those inputs and checks for the username in the us...
true
f4ecc0a78a6dfc1ae72e2c7f75bf74b8b056c3ef
C++
dh-wuho/myLeetCode
/C++/216_Combination_Sum_III.cpp
UTF-8
712
2.84375
3
[]
no_license
class Solution { public: vector<vector<int>> combinationSum3(int k, int n) { vector<vector<int>> res; vector<int> tmpRes; search(0, k, n, 1, tmpRes, res); return res; } void search(int depth, int k, int n, int currPos, vector<int>& tmpRes, vector<vector...
true
e441f8f94ddcdb16d5ce8ca70e4a68f78739978c
C++
briantsoi1107/1340-Project
/1340-Project/Action.h
UTF-8
651
2.578125
3
[]
no_license
#ifndef Action_h #define Action_h #include <vector> #include <string> using namespace std; class Action{ //use of class private: string itemslist[6]={ "Shuriken","Caltrop","Poison","Medicine","Book of Defensive Skills ","Book of Advanced Ninjutsu" }; public: vector<int> itemsgot = {0,1,2,3}; //dynamic meme...
true
950695636e81d27185cb56de7274e0b5eaa0998b
C++
C0nstanta/ITEA_CPP_BASE
/Lesson19_XOR_Encr_Decr/main.cpp
UTF-8
1,917
3.625
4
[]
no_license
// // main.cpp // XOR_Encrypt_Decrypt_file // // Created by admin on 15.03.2021. // #include <iostream> #include <vector> #include <fstream> using namespace std; void EncryptFunc(const string& in_file_path, string& out_file_path, short& password) { ifstream in(in_file_path); if (in) { string...
true
b0ec21cc92554d38df24107938bb876a85e47808
C++
RadStr/Music-Keyboard
/Key.h
UTF-8
2,073
3
3
[ "MIT" ]
permissive
#pragma once #include <string> #include "SDL.h" enum KeyEventType { KEY_PRESSED = 0, KEY_RELEASED = 1 }; class TimestampAndID { public: // Constructor just copies constructor arguments to properties TimestampAndID(Uint32 timestamp, size_t ID, KeyEventType keyEventType); Uint32 timestamp; ...
true
7adb688c984f8a8ededed77761b4d7509a6f3d53
C++
brunosalgado/programacao-avancada
/src/estudo-dirigido/null-flag/PessoaFactory.h
UTF-8
594
2.578125
3
[ "MIT" ]
permissive
// // Created by Bruno Salgado on 21/06/2018. // #ifndef ESTUDO_DIRIGIDO_PESSOAFACTORY_H #define ESTUDO_DIRIGIDO_PESSOAFACTORY_H #include "Pessoa.h" class PessoaFactory { private: Pessoa* _homem; Pessoa* _mulher; public: PessoaFactory(); /** * @desc retorna um clone de Homem * @return {Pe...
true
1c996c19de91965ceb2840494084e774324c4103
C++
MWidlerSchool/mwidlerschool.github.io
/CS16X/Mastermind/main.cpp
UTF-8
4,982
3
3
[]
no_license
#include "libtcod.hpp" #include "Sequence.h" #include "Game.h" #include <string> #include <Windows.h> int moveCursorLeft(int curseLoc) { if(curseLoc == 0) { return 3; } return curseLoc - 1; } int moveCursorRight(int curseLoc) { if(curseLoc == 3) { return 0; } return curse...
true
b4594faf59857fe2b5667b7b4151741edc6ecbd4
C++
yebaoshan/SimpleType
/stack/rw_mutex.inl
UTF-8
313
3
3
[]
no_license
inline RW_Mutex::RW_Mutex () { pthread_rwlock_init (&lock_, 0); } inline bool RW_Mutex::acquire_read () { return !pthread_rwlock_rdlock(&lock_); } inline bool RW_Mutex::acquire_write () { return !pthread_rwlock_wrlock(&lock_); } inline bool RW_Mutex::release () { return !pthread_rwlock_unlock (&lock_); }
true
29dbe8b62934d2f2fe5fb5ed7401d81b2b6be546
C++
shubhamvishu/Codeforces-Solutions
/greedy/chess(3A).cpp
UTF-8
2,752
3.484375
3
[]
no_license
//http://codeforces.com/problemset/problem/3/A #include <iostream> #include<math.h> using namespace std; int main() { int n=2,i=0,k,rd=0,ru=0,ld=0,lu=0,a1,a2,b1,b2; string s[2]; while(n) { cin>>s[i]; i++; n--; } a1=s[0][0]; a2=s[1][0]; b1=s[0][1]; b2=s[1][1]; if(a1<a2)...
true
b77149c3064c8fe2b2c5bf2a42ea0a732afb7611
C++
praveenagrawal/practiceCodes
/CodeChef/HELLO.cpp
UTF-8
541
2.875
3
[]
no_license
#include <iostream> #include <stdio.h> using namespace std; int main() { int T; cin>>T; while(T--) { int U,N; float D; cin>>D>>U>>N; bool advantage = false; float newCostIndex = 0; float newCost = 0; for(int i =1;i<=N;i++) { int M,C; float R; cin>>M>>R>>C; if(newCost==0) newCost = (C...
true
befbffe115a7548190912a5c07bcece3abd78241
C++
Quadrion/qgfx
/dependencies/qtl/include/qtl/complex.h
UTF-8
15,971
3.1875
3
[ "MIT" ]
permissive
#ifndef __complex_h_ #define __complex_h_ #include <math.h> namespace qtl { /// <summary> /// Represents a complex number, a + bi /// </summary> /// <typeparam name="Type"> /// Type of complex object /// </typeparam> template <typename Type> class complex { public: /// <summary> /// Construc...
true
07c31bde45317f9ed1ef405f3adaa5578ceddff7
C++
Tourki/Data-structure-projects
/ Infix Expression Calculation/main.cpp
UTF-8
4,008
3.0625
3
[]
no_license
//============================================================================ // Name : A3.cpp // Author : Hossam Tourki // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #i...
true
0b5796e9f60a5dfaf72d9f80791fca46944273f0
C++
Soulwzy/code
/C和指针6.6/C和指针6.6/6.6.cpp
UTF-8
536
3.328125
3
[]
no_license
#include <stdio.h> #include <stdlib.h> int Prime_number(int num1, int num2) { int n = 0; char* arr = (char *)malloc((num2 - num1)*sizeof(char)); for (int i = 0; i < (num2 - num1); i++) { arr[i] = 1; } for (int i = 0; i < (num2 - num1); i++) { for (int j = 2; j < i; j++) { if (i % j == 0) { arr[i...
true
b68197afab1f530c0897cafba4789cbfad7767b6
C++
tmoritaa/Reflection-Shooter-Test
/Game/Strategy/MovementStrategy/LRMovementStrategy.cpp
UTF-8
282
2.640625
3
[]
no_license
#include "LRMovementStrategy.h" LRMovementStrategy::LRMovementStrategy() : MovementStrategy() {} void LRMovementStrategy::Execute(float& velX, float& velY) { if (m_movementState < 100) { velX = 1; } else { velX = -1; } m_movementState++; m_movementState %= 200; }
true
0d2d5e59b78a877e05117b28d66db9309652a0e4
C++
kajori2000sardar/lab5_141
/lab5_q3.cpp
UTF-8
412
3.859375
4
[]
no_license
//include library #include<iostream> using namespace std; //create main int main() { //declaring variables signed int i; //ask for value cout<<"Enter a number: "; //take input cin>>i; //check whether the no. is -ve, +ve, 0 and show output; if(i>0) cout<<"Number is positive"; else if(i<0) cout<<"Num...
true
9485166d22feeb492a68983b306a34cc5da3677e
C++
mlwong/CME213-CUDA-Project
/final_project/skeleton_code/gpu_func.h
UTF-8
12,642
2.921875
3
[]
no_license
#ifndef GPU_FUNC_H_ #define GPU_FUNC_H_ #include <cuda_runtime.h> #include <helper_cuda.h> #include <helper_functions.h> struct event_pair { cudaEvent_t start; cudaEvent_t end; }; inline void check_launch(const char * kernel_name) { cudaThreadSynchronize(); cudaError_t err = cudaGetLastError(); i...
true
33719ee86e1d65814d0765f4de80e528eae6e55b
C++
andrejlevkovitch/sdl_game
/src/math_2d/include/vertex.hpp
UTF-8
407
2.875
3
[]
no_license
// vertex.hpp #pragma once #include "vector2d.hpp" #include <ostream> namespace levi { class vertex { public: vertex(); vertex(float x, float y, float z); vertex(vector2d v, float z); vertex operator+(const vertex &rhs) const; operator levi::vector2d() const; public: float x; float y; float z; }; s...
true
da565472d2d969b118c4de5b1c7960292ab753fc
C++
psydox/EsenthelEngine
/Engine/H/Math/Shapes/Edge.h
UTF-8
28,688
3.015625
3
[ "LicenseRef-scancode-other-permissive", "LicenseRef-scancode-public-domain", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
/****************************************************************************** Use 'Edge2' to handle 2D edges, Flt type Use 'Edge' to handle 3D edges, Flt type Use 'EdgeD2' to handle 2D edges, Dbl type Use 'EdgeD' to handle 3D edges, Dbl type /**********************************************************...
true