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
c2e3686e083a2cb7f1c628ca43b1d540e5a94aaa
C++
rahulrj/MTV
/HackerRank/STRINGS/STRINGSIMILARITY.cpp
UTF-8
2,128
2.953125
3
[]
no_license
https://www.hackerrank.com/challenges/string-similarity #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; void getZarr(string str, int Z[],int n) { //int n = str.length(); int L, R, k; // [L,R] make a window which matches with prefix of s ...
true
a45aa523e4df121e1c331e295b5ef7c50eb0be3a
C++
stefan-ewald/e_fork_UdemyCpp
/4_STLVector/Auto.cc
UTF-8
552
3.6875
4
[ "MIT" ]
permissive
#include <algorithm> #include <iostream> #include <numeric> #include <vector> int main() { std::vector<int> my_vector(10, 0); std::iota(my_vector.begin(), my_vector.end(), 0); // std::vector<int>::iterator it = my_vector.begin(); // auto it2 = my_vector.begin(); // [begin, end) for (auto it3 ...
true
6b40d6f3da7ef741b89de45aadc50ae34341401b
C++
jowr/inja
/test/src/unit-parser.cpp
UTF-8
8,197
3.171875
3
[ "MIT" ]
permissive
#include "catch.hpp" #include "nlohmann/json.hpp" #include "inja.hpp" using json = nlohmann::json; using Type = inja::Parser::Type; TEST_CASE("Parse structure") { inja::Parser parser = inja::Parser(); SECTION("Basic string") { std::string test = "lorem ipsum"; json result = {{{"type", Type::String}, {"text",...
true
ff1cadaff2f4e87d88da9996d972ecdbb6f0d69f
C++
ab9x3jhx6a/ACI_F14
/MovementSound_01/Sound_Movement/src/Particle.cpp
UTF-8
865
2.84375
3
[]
no_license
#include "Particle.h" Particle::Particle(){ //Particle(ofVec2f(0,0), ofVec2f(0,0), ofColor::white); } Particle::Particle(ofVec2f pos, ofVec2f vel, int r, int g, int b){ position = pos; velocity = vel; red = r; green = g; blue = b; destroy = false; } void Particle::draw(){ ofSetColor(red,green,blue); int...
true
ce73038c6d40bcd8d5386b363d172b3cd11032e5
C++
yumdeer/daily_practice
/vs_project/Template_/模板类的声明与实现分离/foo.tpp
UTF-8
208
2.546875
3
[]
no_license
#include "foo.h" template <typename T> Foo<T>::Foo(T num) : nums(num) { } template <typename T> void Foo<T>::doSomething(T param) { //implementation cout << nums << endl; cout << "hello " <<endl; }
true
af0252bc8cfe10959569e784fa1902bcd233dac5
C++
Yuanfeng-Wang/CSM_Cantera
/include/cantera/numerics/polyfit.h
UTF-8
3,947
2.75
3
[]
no_license
/** * @file polyfit.h C interface for Fortran DPOLFT subroutine */ /* * Copyright 2001-2003 California Institute of Technology * See file License.txt for licensing information */ #ifndef CT_POLYFIT_H #define CT_POLYFIT_H #include <vector> #include "cantera/base/ct_defs.h" namespace Cantera { //! Fits a...
true
8982959f1e7cbdae3d8a0368deabcaaa1eac413d
C++
Tali98/Lab9
/Castillo.h
UTF-8
348
2.515625
3
[]
no_license
#ifndef CASTILLO_H #define CASTILLO_H #include "Edificios.h" #include<string> using namespace std; class Castillo:public Edificios{ private: int madera; int oro; int piedra; public: Castillo(int,int,int); virtual double getCosto_Oro(); virtual double getCosto_Piedra(); virtual double getCosto_Madera(); virtua...
true
5a53f69ba11805068b3bae544ba775cc33892c0f
C++
terraKote/Engine
/src/LuaBindings/LuaSandbox.cpp
UTF-8
4,666
2.609375
3
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
#include "LuaSandbox.h" sol::state LuaSandbox::_lua; sol::function LuaSandbox::_fun_init; sol::function LuaSandbox::_fun_postinit; sol::function LuaSandbox::_fun_update; sol::function LuaSandbox::_fun_render; LuaSandbox::LuaSandbox(){} void LuaSandbox::Init(){ _lua.open_libraries(sol::lib::base, ...
true
4192b32983c79dac354e3af03683ed1a74784614
C++
DennisCarcamo/DennisCarcamo_Lab8
/pintura.cpp
UTF-8
414
2.65625
3
[]
no_license
#include "obras.h" #include "pintura.h" #include <string> #include <sstream> using std::stringstream; Pintura::Pintura(string name, string autor, string fechaIngreso, string materialLienzo, string tecnica):Obras (name,autor,fechaIngreso), materialLienzo(materialLienzo), tecnica(tecnica){ } string Pintura::toString()c...
true
939a022b5c9484d965db372aa9697cb4b4ffb1fb
C++
AlirezaMojtabavi/misInteractiveSegmentation
/Header/misExtractExternalSurface.h
UTF-8
1,009
2.515625
3
[]
no_license
#pragma once #include "logmanager.h" #include "IImage.h" #include "vtkSmartPointer.h" // The misExtractExternalSurface is used for extracting outermost surface layer of a polydata. It bounds the surface within // a sphere that it builds and connects each point on the sphere to surface [bounding box] center and extra...
true
18f1a7c58b69620148d04af72cd031d4520a85b5
C++
qori-aziz/irostech_RnD
/Percobaan_IOT/STM32/STM32F103/UDP_ENC28j60_STM32_test_RX_parisng_part2/UDP_ENC28j60_STM32_test_RX_parisng_part2.ino
UTF-8
3,119
2.765625
3
[]
no_license
#include <SPI.h> #include <UIPEthernet.h> #include <itoa.h> int recvdSize; String dataIn; String dt[10]; int i; boolean parsing = false; // -------- Do not change the section below ----------------- byte mac[] = {0x2A, 0x00, 0x22, 0x22, 0x22, 0x24}; IPAddress ip(192, 168, 1, 201); unsigned int localPort = 8888; //...
true
b4965343dd80d35cac17a1a288ad264b6f769a39
C++
Thomas-Zorroche/Space-Explorer
/src/engine/Camera.cpp
UTF-8
2,011
2.984375
3
[]
no_license
#include "engine/Camera.hpp" #include "common.hpp" Camera::Camera(float x, float z) : _Position(x, 0, z), _phi(M_PI), _theta(0), _CanTurn(true), _lastX(450.0f), _lastY(320.0f), _sensitivity(8.0f) { computeDirectionVectors(); } void Camera::Move(float deltaTime, DIRCAM direction) { glm::vec3 dir; switch (direct...
true
42f3e0ba5daa380b1793eba02d97aac1c344c0c0
C++
dualword/LagEngine
/LagEngine/src/collisions/BoundingSphere.cpp
UTF-8
1,331
2.984375
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
#include "BoundingSphere.h" using namespace Lag; BoundingSphere::BoundingSphere() : IBoundingVolume(BoundingVolumeType::SPHERE) { empty(); } BoundingSphere::BoundingSphere(const BoundingSphere &other) : IBoundingVolume(BoundingVolumeType::SPHERE), center(other.center), radius(other.radius) { } Bound...
true
bebeccb7d41c788292ecbe265a19b4c2c14bd7e0
C++
pablojor/Anyaroth
/Anyaroth/Anyaroth/Canvas.h
UTF-8
364
2.71875
3
[]
no_license
#pragma once #include "UIElement.h" #include <vector> class Canvas { private: std::vector<UIElement*> _elements; public: Canvas() {} virtual ~Canvas(); virtual void render() const; virtual void update(double deltaTime); virtual bool handleEvent(const SDL_Event& event); inline virtual void addUIElement(UIElem...
true
28c5bd12f50991499f1cd6ba731b01b4d84b4242
C++
HaikuArchives/EnglishEditorII
/sources/Hotspot.cpp
UTF-8
1,083
2.546875
3
[ "MIT" ]
permissive
/* Hotspot.cpp */ #include "Hotspot.h" #include "StyleParser.h" #include "View.h" const rgb_color Hotspot::hotspotColor = StyleParser::ParseColor("rgba(255, 130, 0, 128)"); Hotspot::~Hotspot() { } void Hotspot::FadeDocument(View* view, BPoint origin) { // I've decided I don't like this return; static const rg...
true
65a23a233a4a4320fbe37543fa505c18763a2e22
C++
kakomarina/spider3d
/t3.cpp
UTF-8
13,189
2.578125
3
[]
no_license
#include <cmath> #include <math.h> #include <iostream> #include <GL/glut.h> #include <opencv2/opencv.hpp> #include <vector> #include <string> #define SKYBOX_SIZE 30.0 //tamanho da largura e comprimento do hexaedro utilizado para o skybox #define SKYBOX_HEIGHT 30.0 //tamanho da altura do hexaedro utilizado para o skyb...
true
f98f963933beb89cff8cdde3563eb6c6c2b12d47
C++
Jekkt/ph1211GameProgClass
/NYUCodebase/NYUCodebase/main.cpp
UTF-8
5,069
2.625
3
[]
no_license
#ifdef _WINDOWS #include <GL/glew.h> #endif #include <SDL.h> #include <SDL_opengl.h> #include <SDL_image.h> #include "Matrix.h" #include "ShaderProgram.h" #ifdef _WINDOWS #define RESOURCE_FOLDER "" #else #define RESOURCE_FOLDER "NYUCodebase.app/Contents/Resources/" #endif SDL_Window* displayWindow; GLuint loadText...
true
18bcab335a2d36b8ba08b4b169212c451fc2ecee
C++
Broadroad/learnLeetcode
/24.swap-nodes-in-pairs.cpp
UTF-8
1,145
3.609375
4
[ "Apache-2.0" ]
permissive
/* * @lc app=leetcode id=24 lang=cpp * * [24] Swap Nodes in Pairs */ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; * * * Pointer-pointer pp points to the pointer to the current node. So at first, pp poi...
true
7505309b74c4aa1efc01f2f12581110614a535e2
C++
Danigabe/isosphere-game
/src/cBall.cpp
UTF-8
6,364
2.515625
3
[]
no_license
#include "cBall.h" cBall::cBall() { inGoal = false; } cBall::~cBall() { } void cBall::Render() { glPushMatrix(); glTranslatef(pos.x, pos.y, pos.z); //glDepthMask(false); glColor3f(1.0f, 0.5967f, 0.3254f); glutSolidSphere(0.5f, 20, 20); //glDepthMask(true); glPopMatrix(); } void cBall::Start() { di...
true
d337cf42d7beda6ec3e1dc268a675942765b0573
C++
grahameger/EECS398Engine
/include/StringView.h
UTF-8
830
2.828125
3
[]
no_license
#ifndef STRINGVIEW_H #define STRINGVIEW_H // Note that StringView does NOT have ownership of it's CString and thus does not // delete it when finished. // class StringView { public: StringView( ); StringView( char* CString, unsigned length, bool forwards = true ); bool Empty( ) const; un...
true
db9288ea787604bf77d307af2ebc3efb1cfb3fde
C++
Richard-coder-Nai/OJ
/acwing/1523.cpp
UTF-8
607
3.03125
3
[ "Apache-2.0" ]
permissive
#include<iostream> #include<unordered_map> #include<string> #include<vector> #include<algorithm> using namespace std; int main(void) { int n, k; cin>>n>>k; unordered_map<string, vector<int>> table; for(int i=0; i<k; i++) { int idx, Nums; cin>>idx>>Nums; for(int i=0; i<Nums; i++){ string name; cin>>n...
true
f50c6ffb887972bbf9f469569d0087c066bfa540
C++
Jungzhang/SlothServer
/Common/InfoPkg.cpp
WINDOWS-1252
813
2.515625
3
[ "MIT" ]
permissive
/************************************************************************* > File Name: InfoPkg.cpp > Author: Raiden > Mail: jungzhang@xiyoulinux.org > Created Time: Thu Sep 28 00:52:47 2017 ************************************************************************/ #include <memory> #include ...
true
68cd885e54ffdbf0e2c31599a38bf34d5a9b72ff
C++
nasrat-v/cross-platform-client-network-module
/src/ClientNetwork.cpp
UTF-8
6,761
2.53125
3
[]
no_license
#include "../../header/Network/ClientNetwork.hh" ClientNetwork::ClientNetwork() { _connected = false; } ClientNetwork::~ClientNetwork() = default; #ifdef _WIN32 void ClientNetwork::startWSA() { WSAStartup(MAKEWORD(2, 0), &_wsaData); Log::logSomething("\nInitialize windows network - WSA Startup\n"); } void Clien...
true
94aaeed9bb07c61cd81678d3d952d0affaccfb58
C++
rintujrajan/DesignPattern
/PatternsCompunded/Locomotive/main.cpp
UTF-8
3,070
2.9375
3
[]
no_license
#include <iostream> #include <thread> #include <algorithm> #include <vector> #include "Subjects\SpeedMonitor.h" #include "Subjects\GeoPosMonitor.h" #include "Observers\DataUploader.h" #include "Observers\Speaker.h" #include "Sensors\SpeedSensor.h" #include "Sensors\GPSSensor.h" #include "Controller.h" int main() {...
true
1af44846504304902bd55569faa01dde38b2c85e
C++
macl1012/leetcode-cpp-do
/106.从中序与后序遍历序列构造二叉树.cpp
UTF-8
1,582
3.296875
3
[]
no_license
/* * @lc app=leetcode.cn id=106 lang=cpp * * [106] 从中序与后序遍历序列构造二叉树 */ // @lc code=start /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: Tr...
true
82474e51e5e321d84b2aa787706ed7e52c44882c
C++
dandachok/MAI
/OOP/Lab_03/TList.cpp
UTF-8
2,616
3.21875
3
[]
no_license
#include "TList.hpp" TList::TList() { head = nullptr; size = 0; } size_t TList::GetSize() { return this->size; } bool TList::IsEmpty() { return head == nullptr; } void TList::PushIndex(size_t index, std::shared_ptr<Figure>& obj) { if(index > size) { return; } else { std::...
true
4c9f12f7b7304422ab0635ef2cc6d0ebad8e8871
C++
MathewsJosh/teoria-dos-grafos-ufjf
/aresta.cpp
UTF-8
1,733
2.953125
3
[ "MIT" ]
permissive
/** * @file aresta.cpp * @brief Arquivo do objeto aresta do projeto * * @warning Documentar sempre que possível! * @todo * @bug * @authors João Victor - 201665528AB, Matheus Casarim 201765512AB, Mathews Edwirds 201765503AB. Grupo 19 */ /******************************************************************* * ...
true
cc42f4f0e0aec248cd57b8e08d71ae62b03809bc
C++
Robro7389/Array-101
/max_consecutives_ones.cpp
UTF-8
616
3.21875
3
[]
no_license
#include<iostream> using namespace std; int main(){ //input goes here int n; cin>>n; int a[n]; for (int i = 0; i < n; i++) { cin>>a[i]; } //logic int currlen=1; int maxlen=1; for (int i =1; i < n; i++) { if (a[i]==a[i-1]) {...
true
1689cd15dcf39d05d7bd90248407fb0c12b32d44
C++
gmeligio/axon_training
/Those who can not remember the past are condemned to repeat it - DP/Solutions/cmpeguerog/D - Approximating a Constant Range/D - Approximating a Constant Range.cpp
UTF-8
2,077
2.921875
3
[ "MIT" ]
permissive
// // Created by Carlos on 5/8/2019. // Email: cmpeguerog@gmail.com // #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; #define MAX 20 #define LOG_MAX 17 template <class T> class RMQ { public: explicit RMQ(vector<T> values) { this->n = v...
true
f8a866954fed9e416b1f521d083644b5de0a1538
C++
caszhang/BackendDevelopmentEnvironment
/base/dsalgo_test/stack_test.cc
UTF-8
2,499
3.0625
3
[]
no_license
// Author: zhangguoqiang01 <80176975@qq.com> #include "gtest/gtest.h" #include "dsalgo/stack.cc" typedef struct Date { int32_t year; int32_t month; int32_t date; Date() { year = 0; month = 0; date = 0; } } Date; TEST(StackTest, TestNormal) { Stack<char> *stack = new Stac...
true
2c2402bbd0cd20a079ea780fba39629743a8b6b1
C++
davideanastasia/ORIP
/common_lib/yuvwriter.h
UTF-8
1,192
2.765625
3
[]
no_license
/* * License * * Copyright 2011 Davide Anastasia <davideanastasia@users.sourceforge.net> */ #ifndef ORIP_YUVREADER_H #define ORIP_YUVREADER_H #include <iostream> #include <fstream> #include <string> #include "framewriter.h" namespace ORIP { class YUVWriter : public FrameWriter { public: /* * ctor */ ...
true
17a9ae73d31f8fe54b1ebe3761ed291d7272f5e7
C++
cdr6934/ofParticleExperiments
/src/flickeringSquare.cpp
UTF-8
1,059
2.984375
3
[]
no_license
// // flickeringSquare.cpp // animationTest // // Created by Chris Ried on 7/10/18. // #include "flickeringSquare.hpp" #include "ofMain.h" Flicker::Flicker() { } void Flicker::setup(){ xPos = ofGetWidth()/2; yPos = ofGetHeight()/2; size = ofRandom(10); } void Flicker::draw(float radi...
true
fa5323ee2d1e0ecd821fcb847cc66adfe6332e7b
C++
anujbajpai/treeProblems
/diameter_tree.cpp
UTF-8
1,784
3.703125
4
[]
no_license
#include <iostream> #include <cstdio> #include <vector> using namespace std; struct node { int data; struct node *left, *right; }; node* createnode(int data) { node* new_node = new node(); new_node -> data = data; new_node -> left = NULL; new_node -> right = NULL; return new_node; } int ...
true
15baffe452eb65f6f1c04bd54cf25852ff976f5b
C++
Stiner/todengine
/code/tod/core/kernel.cc
UTF-8
4,988
2.921875
3
[ "MIT" ]
permissive
#include "tod/core/kernel.h" #include "tod/core/assert.h" #include "tod/core/module.h" #include "tod/core/builtinmodule.h" using namespace tod; //----------------------------------------------------------------------------- Kernel::Kernel() { String::initializeEncoding(); addModule(new BuiltinM...
true
35a0f15999721e6f448e3589530bcdb086612072
C++
gosu/gosu
/src/Image.cpp
UTF-8
4,584
2.734375
3
[ "MIT" ]
permissive
#include <Gosu/Bitmap.hpp> #include <Gosu/Buffer.hpp> #include <Gosu/Drawable.hpp> #include <Gosu/Graphics.hpp> #include <Gosu/Image.hpp> #include <Gosu/Math.hpp> #include "EmptyDrawable.hpp" #include <stdexcept> Gosu::Image::Image() { static const auto default_data_ptr = std::make_shared<EmptyDrawable>(0, 0); ...
true
2124d7fa71beb07516ac0b069cf4fb7475be81d0
C++
cdj68765/MetasqeExportPmx
/ExportPMX/MLibs/MString.cpp
UTF-8
24,919
2.921875
3
[]
no_license
#ifdef _WIN32 #define NOMINMAX #include <windows.h> #endif #include "MString.h" #include "stdio.h" #include "stdlib.h" #include "stdarg.h" #include "memory.h" #include "wchar.h" #include <algorithm> static wchar_t* null_str = L""; inline bool isHighSurrogate(wchar_t ch) { return (ch >= 0xD800) && (ch <= 0xDBFF); } ...
true
112664a4532178202ed9ad6ad4cc9bc1d9e1808a
C++
DerfOh/School-Programming-Projects
/C++/C++ Programming-II/Assignments/Assignment5/Solution/q4/main_driver.cpp
UTF-8
1,311
3.59375
4
[]
no_license
// **************************************************************** // main.cpp // // Test file to try out the User and Administrator classes. // **************************************************************** // -------------------------------- // ----- ENTER YOUR CODE HERE ----- // -------------------------------...
true
29555b410f2319bffc339a963ead0cc171574a6f
C++
eliaslawrence/uvrp-brkga
/UVRP/ProblemInstance.cpp
UTF-8
6,983
2.640625
3
[]
no_license
#include <iostream> #include <fstream> #include <cassert> #include <cmath> #include <limits> #include <algorithm> #include <iomanip> #include "ProblemInstance.h" #ifndef NDEBUG #define PI_DEBUG 1 //uncomment to switch to debug mode #endif #ifdef PI_DEBUG #define DEBUG #else #define DEBUG while(false) #endif using na...
true
cf430681bc0e2445a67b2a9204f5eb2daef442f9
C++
Xamla/torch-ros
/src/std/string_vector.cpp
UTF-8
1,534
3.03125
3
[ "BSD-3-Clause" ]
permissive
#include "torch-std.h" STDIMP(StringVector *, StringVector, new)() { return new StringVector(); } STDIMP(StringVector *, StringVector, clone)(StringVector *self) { return new StringVector(*self); } STDIMP(void, StringVector, delete)(StringVector *ptr) { delete ptr; } STDIMP(int, StringVector, size)(StringVect...
true
9b766aacfc90c147b5862ad5f60e8912544d77c5
C++
yu-cao/AlgorithmExercise
/LeetCode/Algorithm/Plus One.cpp
UTF-8
1,028
3.578125
4
[]
no_license
#include<vector> #include<iostream> using namespace std; class Solution { public: static vector<int> plusOne(vector<int>& digits) { int length=digits.size(); digits[length-1]++; if(digits[length-1]==10){ for(int i=digits.size()-1;i>=0;i--){ if(digits[i]==10){ ...
true
9302a1a13b00e2e982a45a0e057465e53310674b
C++
weisensee/PinochleGame
/Desktop Server/cardGame.cpp
UTF-8
20,659
3.078125
3
[]
no_license
/* Live Game Manager -- Pinochle Game Desktop Application Lucas Weisensee November 2014 This program will function as a pinochle game manager. It will: -manage connections to all current players and observers -keep track of the current game -keep track of the current round -enforce turn rules/turn order...
true
951b7e8200030f47293571220308e3bf3720ab0c
C++
prateeksarangi/OctoberCircuits_2k19
/Question1.cpp
UTF-8
337
3.03125
3
[]
no_license
#include<iostream> using namespace std; long long int factorial(long long int N){ long long int f = 1; int i; for(i=1; i<=N; i++) f *= i; return f; } int main(int argc, char const *argv[]){ long long int x; int N, T, f; cin>>T; while(T--){ cin>>N; f = factorial(N); x = ((N-1)*N*f) / 2; cout<<x<<endl...
true
f5daed12ff731d3ddae91785fb2b7d3acd654f12
C++
theroyalcoder/HF-ICT-3-SEM-AAD
/30_eigenerCode/VectorDequeList/main.cpp
UTF-8
3,049
3.46875
3
[ "MIT" ]
permissive
#include <iostream> #include <deque> #include <vector> #include <list> #include <map> #include <queue> using namespace std; int main() { deque<int> deque1; // insert at the end deque1.push_back(rand()); // insert at the start deque1.push_front(rand()); // loop through elements deque<int>...
true
f51b8300aad277fccbd093939bcbbcb6936262bc
C++
FabulaM24/JurassicParkTrespasserAIrip
/jp2_pc/Source/Lib/GeomDBase/Hull.cpp
WINDOWS-1252
26,271
2.515625
3
[]
no_license
/*********************************************************************************************** * * Copyright DreamWorks Interactive. 1998 * * Implementation of Hull.hpp * * Purpose: A fast approximating convex hull algorithm based on the QuickHull algorithm. * ***********************************************...
true
0d18f3845c673f65bab2f29cf977ecd102ac3528
C++
google-code/asf-viewer
/AsfViewer/AsfReader/AsfHeader.h
UTF-8
566
2.53125
3
[]
no_license
#pragma once #include "AsfError.h" #include <string> #include <regex> #include <map> namespace Asf { class AsfHeader // Saves pairs of AsfFile properties and its values { public: AsfHeader(std::istream& inputStream); std::string operator[](const std::string& parametr) const { return values.at(parametr...
true
08603b0bc4c081af80ce771626c060f0bb4c03a2
C++
firebreath/indexeddb
/Root/Support/DatabaseLocation.h
UTF-8
1,776
2.6875
3
[]
no_license
/**********************************************************\ Copyright Brandon Haynes http://code.google.com/p/indexeddb GNU Lesser General Public License \**********************************************************/ #ifndef BRANDONHAYNES_INDEXEDDB_SUPPORT_DATABASELOCATION_H #define BRANDONHAYNES_INDEXEDDB_SUPPO...
true
a5afa48b4140585925e963569bdfcbbcc658ad9c
C++
chicolismo/NewFakeBox2
/dropboxUtil.h
UTF-8
2,463
2.53125
3
[]
no_license
#ifndef __DROPBOX_UTIL_H__ #define __DROPBOX_UTIL_H__ #define MAX_DEVICES 2 #define MAX_NAME_SIZE 256 #define BUFFER_SIZE 1024 #define EMPTY_DEVICE (-1) #include <string> #include <map> #include <mutex> #include <condition_variable> #include <vector> #include <openssl/ossl_typ.h> enum ConnectionType { Normal, Sync, ...
true
39f2e9623a5d4f4cd710ab4714467ea30a89def5
C++
smasimore/MastersThesis
/fsw/include/Device.hpp
UTF-8
4,703
3.1875
3
[]
no_license
/** * Base device class for implementing sensors and actuators. Device objects are * the interface between the Data Vector and the FPGA API. * * PRE-CONDITIONS * #1 The FPGA must be initialized and a session opened before initializing any * devices. This only needs to be done once for the entire program and ...
true
5066cde41595b893f3df0657f0ec9cba5916732a
C++
upupming/algorithm
/upupming/1052.cpp
UTF-8
1,327
3.125
3
[ "MIT" ]
permissive
/** 1. 统计所有用到的数的下标 2. 将用到的数进行排序 3. 对有序下标分配 next 值 */ #include <iostream> #include <vector> #include <algorithm> using namespace std; int address[100005], key[100005], nxt[100005], pos[100005]; int n, head; // pos 记录 node 的下标,used 记录真正在链表中的下标 vector<int> used; int cmp(int a, int b) { return key[a] < key[b]; } int main...
true
a6c98a44224b4bef659051bb76694f9759ef180c
C++
UnknownGi/Codechef-Solution-Closed-
/Easy/Problem #13 - Little Elephant and Permutations/sol.cpp
UTF-8
487
2.515625
3
[]
no_license
#include<stdio.h> #define REPN(i,a,b) for(int i=a; i<b; ++i) using namespace std; int main ( ) { freopen("input.txt", "r", stdin); int t; scanf("%d", &t); while ( t-- ) { int n; scanf("%d", &n); int a[n]; REPN(i,0,n) scanf("%d", &a[i]); int local=0, inv=0; REPN(i,0,n) { if ( i+1...
true
3c74308df129006469646f97c327c0863f1b9b65
C++
Min1307/Leetcode
/117. Populating Next Right Pointers in Each Node II.cpp
UTF-8
759
3.34375
3
[]
no_license
//117. Populating Next Right Pointers in Each Node II class Solution { public: Node* connect(Node* root) { if(!root) return nullptr; Node *ro = root; Node * pre = new Node(0); pre->next = nullptr; Node * re = pre; while(root) { if(root->left) ...
true
13e6ca875fba12cfbadb90cf333225e98c2431f1
C++
harshbawari/CP_and_DSA
/CodeForces/Practice/old/turtle.cpp
UTF-8
1,351
3.3125
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main() { int m, n, mat[100][100]; cin >> m >> n; //Input Matrix for (int i = 0; i < m; i++) for (int j = 0; j < n; j++) cin >> mat[i][j]; //Traverse all elements of matrix //Check for elements present at i-1, j-1, i+1, j+1...
true
f8a1924a2d213e948674dc22fed22adcebbccd67
C++
jariasf/Online-Judges-Solutions
/CodeSignal/InterviewPractice/containsDuplicates.cpp
UTF-8
426
3.078125
3
[]
no_license
/******************************************* ***Problema: Contains Duplicates ***Juez: CodeSignal ***Tipo: Hashing ***Autor: Jhosimar George Arias Figueroa *******************************************/ bool containsDuplicates(std::vector<int> a) { int n = a.size(); unordered_set<int> hash; for( int i =...
true
cb8428db3d40bc99b8e0e24d915c6c6de100f776
C++
OmriGrossW/Cyber-Attack
/include/CyberWorm.h
UTF-8
694
3.015625
3
[]
no_license
#ifndef CYBER_WORM #define CYBER_WORM #include <iostream> #include <string> #include <vector> class CyberWorm { private: const std::string cyber_worm_os_; const std::string cyber_worm_name_; const int cyber_worm_dormancy_time_; CyberWorm(); // Prevent the use of an empty constructor public: Cy...
true
139b652e7cd96839b03205fabde0403932b2fb7c
C++
theradeonxt/FastImageEditor
/ImageProcessing/Config/ModuleSetupPerformer.h
UTF-8
2,155
2.765625
3
[ "MIT" ]
permissive
//! ============================================================================= //! \file //! \brief //! This is a sample description //! //! ============================================================================= #ifndef IMPROC_MODULE_SETUP_PERFORMER_H #define IMPROC_MODULE_SETUP_PERFORMER_H #include "...
true
92855d3a3a303832ff335c9babaf2f129070427f
C++
aayushvats/CPP_AllKindsOfStuff
/XI/ANI_MAN.CPP
UTF-8
3,660
2.53125
3
[]
no_license
#include <stdio.h> #include <conio.h> #include <graphics.h> #include <dos.h> int main() { /* request auto detection */ int gdriver = DETECT, gmode, err; int radius = 10, x, y, midy; /* initialize graphic mode */ initgraph(&gdriver, &gmode, "C:\\TURBOC3\\BGI"); err = graphresu...
true
cb9586a4004cf659cda69c038a48dfbd21156c3c
C++
GyanPrakashRaj/dsacamp
/13 Tries/max_xor_trie.cpp
UTF-8
1,426
3.96875
4
[]
no_license
#include<iostream> using namespace std; class node{ public: node *left; //0 node *right; // 1 }; class trie{ node*root; public: trie(){ root = new node(); } void insert(int n){ //bits of that number in the trie node* temp = root; for(int i=31;i>=0;i--){ int bit = (n>>i)&1; if(bit==0){ if(te...
true
e79441d9ddbc9a2e80dedd5e96b0d1f2cfcc9179
C++
PineTreePizza/roll-back-engine
/src/core/audio/audio_helper.h
UTF-8
1,176
2.78125
3
[ "MIT" ]
permissive
#ifndef AUDIO_HELPER_H #define AUDIO_HELPER_H #include "../global_dependencies.h" class AudioHelper { public: static void PlayMusic(const std::string &musicId) { static AssetManager *assetManager = GD::GetContainer()->assetManager; Mix_PlayMusic(assetManager->GetMusic(musicId), -1); } s...
true
d0ee73a5e097fa21741ce221a627918b0cd605a4
C++
DragonWingsL/Cocos2d-x-Projects
/AircraftWar/Classes/Enemy.h
GB18030
2,457
2.953125
3
[]
no_license
// EnemyǷװ˷ɻ #ifndef __Enemy_H__ #define __Enemy_H__ #include "Common.h" #include "Bullet.h" class Enemy : public Sprite { public: enum TYPE{ SMALL, MIDDLE, BIG }; static Enemy* create(TYPE type) { Enemy* enemy = new Enemy; enemy->init(type); enemy->autorelease(); return enemy; } bool init(TYPE type...
true
eb0c98a0a0a75df7412a99608a9539cfccd1e352
C++
jmccl/acme-lw
/lib/acme-lw.h
UTF-8
2,926
2.921875
3
[ "MIT" ]
permissive
#pragma once #include "acme-exception.h" #include <ctime> #include <list> #include <memory> namespace acme_lw { struct Certificate { std::string fullchain; std::string privkey; // Note that neither of the 'Expiry' calls below require 'privkey' // to be set; they only rely on 'fullchain'. /** ...
true
48fd1811df03966bc1cb12603be9e8d2f214c054
C++
hecongy/Cpp-Primer-Exercises-5th-ed
/ch03/ex3_25.cpp
UTF-8
1,310
3.84375
4
[]
no_license
#include<iostream> #include<vector> using namespace std; //原程序 void index() { //以10分为一个分数段统计成绩的数量:0~9, 10~19, ..., 90~99, 100 vector<unsigned> scores(11,0); //11个分数段,全部初始化为0 unsigned grade; while(cin >> grade){ //读取成绩 if(grade <= 100) //只处理有效的成绩 ++scores[grade/10]; //将对应分数段的计数值加1 }...
true
66a605b2410b62fb3233b1289f521f94d2cd4135
C++
KaiserKatze/win-vc-rtdl
/DllTest/dllmain.cpp
UTF-8
2,728
2.90625
3
[]
no_license
// dllmain.cpp : Defines the entry point for the DLL application. #include "stdafx.h" // @see: https://docs.microsoft.com/en-us/windows/win32/dlls/dllmain BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_...
true
1470e146229480ef508cbad2830540f60a3de23f
C++
connerturmon/opengl
/src/include/Camera.h
UTF-8
1,194
3.015625
3
[ "MIT" ]
permissive
#pragma once #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> enum CameraDirection { FORWARD, BACK, LEFT, RIGHT, DOWN, UP }; class Camera { public: Camera( glm::vec3 initial_position = glm::vec3(0.0f, 0.0f, 0.0f), float sensitivity = 0.1f, float speed...
true
6620968d55bebfae61c58acc05c320b0890d1a33
C++
DHANUSH-6/Datastructures
/Sorting DataStructures/MergeSort.cpp
UTF-8
1,414
3.765625
4
[]
no_license
#include<iostream> void Merge(int array[], int lowerbound,int mid,int upperbound) { int i = lowerbound; int j = mid+1; int k = lowerbound; int temp[50]; while(i<=mid && j<=upperbound) { if(array[i]<=array[j]) { temp[k] = array[i]; i++; } el...
true
02a9ae8773bd76a2d839546ebb6298ca2cf5269f
C++
shaharshalev/FANC
/parser.hpp
UTF-8
28,526
2.53125
3
[]
no_license
#ifndef _PARSER_H #define _PARSER_H #include <string> #include <iostream> #include <vector> #include <typeinfo> #include <sstream> #include <stdbool.h> #include <stdlib.h> /* atoi */ #include "output.hpp" #include "registers.hpp" #include "bp.hpp" #include "assembler_coder.hpp" #include <assert.h> /* assert */...
true
f9071c531caa6358773f70fcb1f4d17cd84d0563
C++
Alleno/exercism
/cpp/sieve/sieve.cpp
UTF-8
845
3.515625
4
[]
no_license
#include "sieve.h" #include <numeric> namespace sieve { std::vector<int> primes(int upto) { std::vector<int> all_values(upto-1); // or should we just default init and then call .reserve? std::iota(all_values.begin(), all_values.end(), 2); for (auto val : all_values) { ...
true
b13ee238460765fd359706a50c6ebb509a362f13
C++
spinos/gorse
/core/grd/LocalGridLookupRule.h
UTF-8
7,105
2.578125
3
[]
no_license
/* * LocalGridLookupRule.h * gorse * * first find cell by bvh * then find closest primitve in cell * * 2019/8/10 */ #ifndef ALO_GRD_LOCAL_GRID_LOOK_UP_RULE_H #define ALO_GRD_LOCAL_GRID_LOOK_UP_RULE_H #include <bvh/BVH.h> #include <bvh/BVHRayTraverseRule.h> #include <math/rayBox.h> namespace alo { names...
true
a88ceedeff73102a6193cf9f35e4dddc510ecce9
C++
DimaPhil/ITMO
/Cpp/year2013/list/List/node.cpp
UTF-8
697
3.46875
3
[]
no_license
#include "node.h" #include <string> using std::string; node::node() { this->value = ""; this->next = this; this->previous = this; } node::node(string const& value) { this->value = value; this->next = this; this->previous = this; } node::node(string const& value, node *previous, node *next) {...
true
1863257f18162f86c433c88a431c48df9539c75a
C++
rushingJustice/C-programming-and-matlab-projects
/Finite Elements - Direct Sitffness Methods/Programs from E-book/Example13_1_1/main.cpp
UTF-8
587
2.6875
3
[]
no_license
/********************************************* Example 13.1.1 Copyright(c) 2005-06, S. D. Rajan Object-Oriented Numerical Analysis *********************************************/ #include "isection.h" int main () { CISection First ("W36X300", 88.3f, 1110.0f, 156.0f, 300.0f); First.Display (); CISection Second ("...
true
13f5b7ccf690b23290d546e0aa6db74795fbb828
C++
Egoushka/University
/II course/Data Calculation System/3/DataCalculatingSystem_3-main/Project11/Source.cpp
WINDOWS-1251
18,070
3.390625
3
[]
no_license
#include <iostream> #include <fstream> #include <windows.h> #include <locale.h> #include <regex> #include <map> int calculateSize(std::ifstream&); void controller(); void firstEx(); void additionFirstEx(); void secondEx(); void additionSecondEx(); void thirdEx(); void additionThirdEx(); void additionThirdEx2(); void a...
true
936507ccac77ac04e0f85fa75db8bb0a94f5882c
C++
henryoier/leetcode
/259_3SumSmaller/259_3SumSmaller.cpp
UTF-8
893
3.046875
3
[]
no_license
/************************************************************************* > File Name: 259_3SumSmaller.cpp > Author: Sheng Qin > Mail: sheng.qin@yale.edu > Created Time: Sat Oct 15 22:07:02 2016 ************************************************************************/ #include<iostream> using namespace std; cl...
true
9470186b886231fde2337c0144c629475a50aabc
C++
edict-game-program/shooting_game_1
/SystemForLearning0409/SystemForLearning/Game/SpecialEnemy.cpp
SHIFT_JIS
9,936
2.546875
3
[]
no_license
#include "SpecialEnemy.h" #include <cmath> #include <Sprite.h> #include <Collision.h> #include "ShootingGame.h" #include "SpriteAnime.h" #include "Player.h" #include "Bullet.h" #if COLLISION_VISIBLE #include <PrimitiveEdgeSprite.h> #endif static const int cRushAttackFrame = 20; static const int cPreliminaryRushFram...
true
10c1e7e2aceb6fcf913f72e8d2a0d8f33b8d3207
C++
quangh33/Coding-Interview-Practice
/Leetcode/graph/997. Find the Town Judge.cpp
UTF-8
565
2.640625
3
[]
no_license
// // Created by Hoang, Quang on 2019-09-02. // // https://leetcode.com/problems/find-the-town-judge/ class Solution { public: int findJudge(int N, vector <vector<int>> &trust) { int in[N + 1]; int out[N + 1]; memset(in, 0, sizeof(in)); memset(out, 0, sizeof(out)); for (au...
true
bf31b6f60287b4681ae3bbc34940a2cddeb6417d
C++
SayaUrobuchi/uvachan
/Kattis/speeding.cpp
UTF-8
335
2.609375
3
[]
no_license
#include<iostream> using namespace std; int main() { int n, i, x, y, t, lx, ly, best; while (scanf("%d", &n) == 1) { for (i=0, best=0; i<n; i++) { scanf("%d%d", &x, &y); if (i) { t = (y-ly)/(x-lx); if (t > best) { best = t; } } lx = x; ly = y; } printf("%d\n", best); ...
true
686b1793a086881df704b24b82fd4eaf39307046
C++
gaoxinge/something
/hpc/mpi/doc/A Comprehensive MPI Tutorial Resource/main6.cpp
UTF-8
4,054
3.25
3
[]
no_license
#include <iostream> #include <vector> #include <cstdlib> #include <time.h> #include <mpi.h> using namespace std; void decompose_domain(int domain_size, int world_rank, int world_size, int *subdomain_start, int *subdomain_size) { *subdomain_start = domain_size / world_size * world_rank; *subdomain_size = domai...
true
03accd1715b346d88384da8acd21937a792daae1
C++
akhil-singh-parmar/algo.cpp
/bubblesort.cpp
UTF-8
648
3.609375
4
[]
no_license
#include<iostream> using namespace std; void bubblesort(int arr[],int n) { for (int i = 0; i < n-1; i++) { for(int j=1;j<n-i;j++) { if(arr[j-1]>arr[j]) { int temp; temp=arr[j-1]; arr[j-1]=arr[j]; arr[j]=temp; } } } } void printarray(int arr[...
true
ababa4114e308fb4d89423e7e3793f4b35869f60
C++
supperking03/AladdinGame
/game/scripts/EnemyController.cpp
UTF-8
5,196
2.59375
3
[]
no_license
#include "EnemyController.h" #include "EnemyDirectionController.h" #include "../Macros.h" #include "WeaponController.h" USING_NAMESPACE_ALA; ALA_CLASS_SOURCE_1(EnemyController, ala::GameObjectComponent) EnemyController::EnemyController(ala::GameObject* gameObject, const int health, const std::function<int(WeaponCo...
true
d09727f13c901da61012c98ad3e2085a4743ac1c
C++
linsen1983/adobe-pdf-library-samples
/CPlusPlus/Sample_Source/ContentModification/PDFUncompress/PDFUncompress.cpp
UTF-8
12,771
2.5625
3
[]
no_license
// // Copyright (c) 2010-2017, Datalogics, Inc. All rights reserved. // // For complete copyright information, see: // http://dev.datalogics.com/adobe-pdf-library/adobe-pdf-library-c-language-interface/license-for-downloaded-pdf-samples/ // // The PDFUncompress sample is a utility that demonstrates how to completely u...
true
8f133bda4ec4194db0f96dfbbbd45dad1774fcea
C++
jacksonn455/Exercicios
/Função com argumento2.cpp
WINDOWS-1250
510
3.515625
4
[]
no_license
#include <cstdio> #include <cstdlib> int mult3 (int a, int b, int c){ return a*b*c; } int main (void){ int valor1, valor2, valor3, resultado; printf ("Digite 3 valores que serao multiplicados\n"); scanf ("%d %d %d", &valor1, &valor2, &valor3); getchar (); resultado=mult3(valor1, valor2, valor3...
true
c7eba7f6c80106ae11a240cf3bceb4c812f7d90f
C++
JeonSheungGyu/ContagionCity
/server/Server(신서버)/ConsoleApplication1/CombatCollision.h
UHC
1,333
2.625
3
[]
no_license
#pragma once #include "stdafx.h" const int COLLISION_FUNC_TYPE = 5; enum { CC_CircleAround = 0, CC_CircleFront, CC_Eraser, CC_PointCircle, ETC_CheckUser }; // Լ ü struct CollisionFuncArray { using FuncType = void(*)(const WORD, std::vector< std::pair<WORD, int>>&, const FLOAT, const FLOAT); FuncType Func; Col...
true
5f162ffd1c1d876d77984d601c64d1688b887aeb
C++
swd543/cppTut
/dictionary-predictive/src/main.cpp
UTF-8
926
3.28125
3
[]
no_license
#include <iostream> #include <fstream> #include <unordered_set> #include "mappifier.hpp" using namespace std; int main() { std::cout << "I will read the dictionary provided and list all anagrams present." << std::endl; fstream file; file.open("./words.txt", ios::in); if (file.is_open()) { cout << "Build...
true
4ce1400bb6754211df85c773ab5ec6e7ae23e525
C++
BobuDragos/Arduino
/Matrices/Matrix_with_LEDMatrixDriver/Matrix_with_LEDMatrixDriver.ino
UTF-8
9,488
2.578125
3
[]
no_license
#include <LEDMatrixDriver.hpp> // This draw a moving sprite on your LED matrix using the hardware SPI driver Library by Bartosz Bielawski. // Example written 16.06.2017 by Marko Oette, www.oette.info // Define the ChipSelect pin for the led matrix (Dont use the SS or MISO pin of your Arduino!) // Other pins are Ardui...
true
183eb32fa4ac10b6ded94a177434c696484d83a6
C++
helfo2/UFMG-CP-training
/rot1201.cpp
UTF-8
1,871
2.75
3
[]
no_license
/* Nome: Henrique Eustaquio Lopes Ferreira * Matricula: 2015068990 * Problema resolvido: UVA NAO CADASTRA * Roteiro 12 - Problema * Estratégias: */ #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #...
true
993b1d4998263e1fdb090eceb895fdf9e3292cf7
C++
wnykuang/studycpp
/chapt5/practise/problem10.cpp
UTF-8
449
3.40625
3
[]
no_license
#include <iostream> int main(){ using namespace std; int rows; cout << "Enter number of rows: "; cin >> rows; int row; for (row = 0; row < rows; ++ row){ int numberofdot = rows - row - 1; int numberofstar = row + 1; for(int i = 0; i < numberofdot; ++i){ cout ...
true
f4ab8e5868e92bed8fbed232e2a463f75031c176
C++
LauraDiosan-CS/lab04-aygean219
/labul4/repo.cpp
UTF-8
799
2.78125
3
[]
no_license
#include "Repo.h" Repo::Repo() { this->n = 0; } Repo::~Repo() { this->n = 0; } void Repo::deleteElem(Produs s) { int i = findElem(s); if (i != -1) { produse[i] = produse[n - 1]; n--; } } int Repo::findElem(Produs s) { for (int i = 0; i < n; i++) if (produse[i] == s) return i; ret...
true
a4ad2b53e019421db42c9059c95e47bc078ca183
C++
JustWhit3/SAFD-algorithm
/test/test_functions.cpp
UTF-8
8,935
2.53125
3
[ "MIT" ]
permissive
//============================================ // Preprocessor directives //============================================ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #define DOCTEST_CONFIG_SUPER_FAST_ASSERTS //============================================ // Headers //============================================ ...
true
f93980e537953e815ebcaed1d133d6a23303009a
C++
qicosmos/fibio
/src/fiber/mutex.cpp
UTF-8
12,534
2.546875
3
[ "BSD-2-Clause" ]
permissive
// // mutex.cpp // fibio // // Created by Chen Xu on 14-3-4. // Copyright (c) 2014 0d0a.com. All rights reserved. // #include <fibio/fibers/mutex.hpp> #include "fiber_object.hpp" namespace fibio { namespace fibers { static const auto NOPERM=lock_error(boost::system::errc::operation_not_permitted); static ...
true
4eba95f7d001d7a7221c30492c048b231f0135ad
C++
KendrickAng/competitive-programming
/kattis/greedilyincreasing/greedilyincreasing.cpp
UTF-8
466
2.71875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; cin >> n; int curr = -1; vector<int> nums; for (int i = 0; i < n; i++) { int tmp; cin >> tmp; if (curr == -1 || tmp > curr) { nums.pus...
true
ac5253122a3188ea97a9cf923b6ec1441eadcf37
C++
cuyi/cpplearn
/time/gnuTimes.cpp
GB18030
504
2.515625
3
[]
no_license
#include <cstdio> #include <unistd.h> // unistd.h C C++ ṩ POSIX ϵͳ API ķʹܵͷļ #include <sys/times.h> #include "timeConsumingFun.hpp" int main(void) { clock_t tBeginTime = times(NULL); timeingFunc(); clock_t tEndTime = times(NULL); double milliseconds = (double)(tEndTime - tBeginTime) * 100...
true
e5f1f3005a211b30ff917de385dcfd8111ccd966
C++
najosky/opendarkeden_server
/src/server/gameserver/ParkingCenter.h
UTF-8
3,302
2.625
3
[]
no_license
////////////////////////////////////////////////////////////////////////////// // Filename : ParkingCenter.h // Written By : Reiot // Description : ////////////////////////////////////////////////////////////////////////////// #ifndef __PARKING_CENTER_H__ #define __PARKING_CENTER_H__ #include "Types.h" #include ...
true
5e003b07e6d45bf1b3622d0bcf7b86ac41b87ad6
C++
candidate2020/AccCppSolnMan
/Chap6/is_palindrome.cpp
UTF-8
138
2.65625
3
[]
no_license
#include<string> #include<algorithm> bool is_palindrome(const std::string& s){ return std::equal(s.begin(), s.end(), s.rbegin()); }
true
029c4ed77c5294a1c5ef96a0113f3e4aa2de06d0
C++
SlickHackz/famous-problems-cpp-solutions
/04 Heap/Source Files/MergeksortedArrays-useHeap.cpp
UTF-8
2,845
3.703125
4
[]
no_license
#include<iostream> using namespace std; struct node { int data; int row; int next; }; class MinHeap { struct node *heaparr; int heapsize; int cursize; public : MinHeap(int n); int getParent(int i); int getLeft(int i); int getRight(int i); void insertKey(struct n...
true
79ac4af75ca815f5cdb07f385c3d7f079fa8496a
C++
myjc/TinySTL
/HashTable.h
UTF-8
4,837
3
3
[]
no_license
#ifndef TINYSTL_HASH_TABLE_H #define TINYSTL_HASH_TABLE_H #include "Iterator.h" #include "Allocator.h" #include "Vector.h" #include "List.h" namespace TinySTL { //hashtable元素节点 template<typename T> struct HashTableNode { T data_; HashTableNode* nextNode_; HashTableNode():nextNode_(nullptr){} }; //HashTable ...
true
29f78dec6727562a69e9fbb3fb31a77009f8cc4e
C++
SRombauts/SimplexNoiseCImg
/color.h
UTF-8
605
3.359375
3
[]
no_license
#include <cstdint> class color3f { public: color3f(); color3f(uint8_t _r, uint8_t _g, uint8_t _b); public: float r; float g; float b; }; inline float lerp(float x, float y, float a) { return (1 - a) * x + a * y; } inline float lerp(float x, float y, float ax, float ay, float a...
true
aa7bb1a4789430b5b33055d6e3abd750f41bf387
C++
Kurorororo/pplanner
/src/multithread_search/lock_free_closed_list.h
UTF-8
4,433
2.875
3
[]
no_license
#ifndef LOCK_FREE_CLOSED_LIST_H_ #define LOCK_FREE_CLOSED_LIST_H_ #include <atomic> #include <fstream> #include <unordered_set> #include <utility> #include <vector> #include "sas_plus.h" #include "search_graph/state_packer.h" #include "search_node.h" namespace pplanner { struct SearchNodeWithNext : public SearchNod...
true
17ce33949aad319bfcef360ffae7288d1babfb6b
C++
riverlight/lport
/libport/testport/testport.cpp
UTF-8
1,407
2.828125
3
[]
no_license
#include <stdio.h> #include <string.h> #include <stdlib.h> #include "port.h" #define THRERA_NUM 10 #define THREAD_RUN_TIME 1000 #define THREAD_SLEEP_TIME 10 static void* thread_process(void *arg); HMutex mutex = NULL; int main(int argc, char *argv[]) { int counter = 0; HThread hThread[THRERA_NUM]; int id[THRERA_...
true
9906e0acd631a639f1c99bd350aef91f3b6ac02c
C++
llwwjjj/Lwj_stl
/sequence containers/Lwj_heap.h
UTF-8
7,855
3.03125
3
[]
no_license
// // Lwj_heap.h // S // // Created by 练文健 on 2018/5/30. // Copyright © 2018年 练文健. All rights reserved. // #ifndef Lwj_heap_h #define Lwj_heap_h namespace Lwj_stl{ //-----------------------------------------------push_heap------------------------------------------------------------- //先对vector进行push_b...
true
b1c309d081f83cae378717f1582347e0bc645d85
C++
kartikf1/cpp-advance
/input/methods.cpp
UTF-8
414
3.234375
3
[ "MIT" ]
permissive
#include <iostream> using namespace std; class MyClass { // The class public: // Access specifier void myMethod() { // Method/function cout << "Hello World!"; cout << "hello universe\n"; } }; int main() { MyClass myObj; // Create an object of MyClass myObj.myMethod(); // C...
true
44eb463194f70d8eea27194be0ace1a0e2fc5b23
C++
linvon/QQ
/server/main.cpp
UTF-8
560
2.625
3
[]
no_license
#include "widget.h" #include <QtGui/QApplication> #include <QtCore/QTextCodec> int main(int argc, char *argv[]) { QApplication a(argc, argv); //确保只运行一次 QSystemSemaphore sema("ServerKey",1,QSystemSemaphore::Open); //在临界区操作共享内存 sema.acquire(); QSharedMemory mem("ServerObject"); // 如果全局对象已存在则退出 if (!mem.create(...
true
022ba9ff65f15bc09c21499c1d76664ee640109f
C++
TsvetinaRasheva/Tasks-_C-
/Tasks_28.10/Zadacha_3.cpp
UTF-8
480
3.484375
3
[]
no_license
#include <iostream> using namespace std; int main() { int number; cout << "Number : "; cin >> number; int fib_first, fib_second; fib_first = 0; fib_second = 1; cout << "Fibonachi numbers : " << 0 << " " << 1 << " " << 1; int next_fib_num = fib_first + fib_second; while (next_fib_num <= number)...
true