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
4384f8bdccb8aece3adbdf1b9ba06081cb6a3539
C++
naveensharma27/CodeForces
/16A.cpp
UTF-8
700
3.25
3
[]
no_license
#include<iostream> using namespace std; int n,m,i; bool checkR(string flag[]) { for(int i=0;i<n;i++) { char c = flag[i][0]; for(int j=1;j<m;j++) { if(flag[i][j] !=c) { return false; } } } return true; } bool checkC(string flag[]) { for(int i=1;i<n-1;i++) { if((fl...
true
b98625626d8b67445a3c481c9330ec4d384577c7
C++
llNeeleshll/CPP
/functions/pass_ref.cpp
UTF-8
733
3.859375
4
[]
no_license
#include <iostream> #include<vector> #include<string> using namespace std; void change(int &a); void pass_by_ref(vector<string> &v); void print_vector(const vector<string> &v); int main(){ int a{50}; cout<<"Value before passing : "<<a<<endl; change(a); cout<<"Value after passing : "<<a<<endl; ve...
true
fa2f2376ca824f82fca74b11161591a050a57741
C++
Jacob-Zackaria/Graphics-Engine
/src/LODModel.h
UTF-8
1,466
2.59375
3
[]
no_license
#ifndef LOD_MODEL_H #define LOD_MODEL_H #include "Model.h" #include "GraphicObjectBase.h" class LODModel { public: enum class Name { TROLL, SMALL_TROLL, SEAGULL, WIZARD, BOAT, FLOWER, FISH, UFO, ORIGAMI_TREE, UNDEFINED }; LODModel(const LODModel&) = delete; // Copy ...
true
6271a25fa2959e8ef9b2f92bfbebbb29bfa9a25b
C++
cxrasdfg/json_yacc_lex
/json.cpp
UTF-8
11,255
2.984375
3
[ "MIT" ]
permissive
/** * Created by theppsh on 17-5-7. */ #include "json.hpp" json_ast::pNode json_ast::AllocNode(const ASTType type) { return std::make_shared<json::JsonObject>(type); } json_ast::pNode json_ast::CreateString(const char *str, const int leng) { auto result = AllocNode(ASTType::AT_STRING); result->string_v...
true
ab80b1dc53fc1cbf3bb8794642c61de1931c13e3
C++
implementedrobotics/Nomad
/Hardware/Actuator/NomadBLDC/FirmwareG4/NomadBLDC/RingBuffer.cpp
UTF-8
2,581
2.625
3
[ "MIT" ]
permissive
/* * RingBuffer.cpp * * Created on: April 6, 2020 * Author: Quincy Jones * * Copyright (c) <2020> <Quincy Jones - quincy@implementedrobotics.com/> * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to de...
true
b746e2173fd0eef79db7aaf2afcc509c7bb2de2a
C++
fvazquezf/7542_TpFinal
/client/commands/CreateGame.h
UTF-8
412
2.515625
3
[ "MIT" ]
permissive
#ifndef CREATEGAME_H #define CREATEGAME_H #include "Command.h" class CreateGame : public Command{ private: std::string gameName; std::string mapName; public: explicit CreateGame(std::string gameName, std::string mapName); void serialize(std::function<void (std::vector<unsigned char>)> &callback, ...
true
d5ca4e66980c7c177fceeb34d7c4576554fb5ef8
C++
TimTam725/Atcoder
/その他/nazo/a.cpp
UTF-8
207
2.71875
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int main(){ float A,B,T; cin>>A>>B>>T; T+=0.5; int i,sum; sum=0; for(i=1;A*i<=T;i++){ sum+=B; } cout<<sum<<endl; }
true
e328b6a6c11cf447474f94ad9e4231e94fb0940c
C++
AkVaya/CP_Solutions
/Codeforces/832B.cpp
UTF-8
1,505
2.578125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int main(){ string s,t; bool check = true; unordered_set<char> allowed; cin>>s>>t; int q,ind = -1; for(auto i : s){ allowed.insert(i); } for (int i = 0; i < t.length(); ++i) { if(t[i]=='*'){ ind = i; break; } } cin>>q; while(q--){ cin>>s; if((ind=...
true
b819eb03394b83462afea00614ccc90827cb3f56
C++
cowtony/ACM
/XJOJ/Documents/Too hard - Haven't solved/164/164 WA.cpp
UTF-8
484
3.21875
3
[]
no_license
#include<iostream> using namespace std; int GCD(int a,int b) { if(b==0)return a; else return GCD(b,a%b); } int LCM(int a,int b) { return a/GCD(a,b)*b; } int Factor(int n,int k) { int count=0; for(int i=2;i<=n/2;i++) { int lcm=LCM(i,i^k); if(lcm==0)lcm=99999999; ...
true
fa3bbecacf5357378509e2e10a490d54148257ee
C++
idemb/idemb
/ID/IndexValuePair.hpp
UTF-8
483
3.28125
3
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
#pragma once #include <iostream> struct IndexValuePair { size_t m_index; double m_value; IndexValuePair(size_t i= 0, double v=0.0) : m_index(i), m_value(v) { } friend std::ostream& operator<<(std::ostream& os, const IndexValuePair& pair) { return os << "index = " << pair.m_index << " value = " << p...
true
090a3866172065354559bd9858498007af09c9ad
C++
macbury/mqtt_led_strip
/led_strip.ino
UTF-8
4,413
2.59375
3
[]
no_license
#include <EEPROM.h> #include <Adafruit_NeoPixel.h> #include <ArduinoJson.h> #include <ESP8266WiFi.h> #include <PubSubClient.h> #include <ESP8266mDNS.h> #include <WiFiUdp.h> #include <ArduinoOTA.h> #include "credentials.c" #include "SingleColor.h" #include "SinColor.h" #include "RainbowColor.h" #include "DualColor.h" ...
true
d76a72381d870824ffad6e5387cf8e4ba4ea068b
C++
pR1smm/MPEG
/MPEG/Image.h
UTF-8
1,184
3.046875
3
[]
no_license
// // Image.h // MotionVectorizer // // Created by Klaus Ulhaas on 21.05.14. // Copyright (c) 2014 Klaus Ulhaas. All rights reserved. // #ifndef __MotionVectorizer__Image__ #define __MotionVectorizer__Image__ #include <string> class Image { protected: int width, height; // Dimensions of the imag...
true
e55ea4d43d91450d02400f5d1284d476130454c2
C++
zhuhaijun753/FDTtools
/Delivery_Master_2016-09-16/ToolsuiteSource/FDTUI/SchedulerAnalysis/SchedulerTaskModel.cpp
UTF-8
3,202
2.5625
3
[]
no_license
#include "SchedulerTaskModel.h" #include "Project.h" #include "Task.h" #include <QAbstractTableModel> #include <QList> SchedulerTaskModel::SchedulerTaskModel(const Project& project) { project.GetAllTasks(m_unchangedTasks); Reset(); } void SchedulerTaskModel::Reset() { beginResetModel(); m_tasks.cle...
true
52aaee00759719224cb326bf9553af817d682175
C++
rapman1986/Programming_Principles_and_Practice_using_Cpp
/Chapter_05/Exercises/13.cpp
UTF-8
5,008
3.984375
4
[]
no_license
// Bulls and Cows game #include "std_lib_facilities.h" void WelcomeMessage(); void PlayGame(); vector<int> GetUserInput(int); vector<int> BuildDigitsVector(int, int); vector<int> BuildValueToGuess(int); int GetLength(); bool CheckGuess(vector<int>, vector<int>); bool CheckForRepeatedDigits(vector<int>); int main() {...
true
b19d0074659f644077a7619f12b3f19dba4644e8
C++
rajatgirotra/study
/cpp/BOOST/mpl/20.cpp
UTF-8
2,972
3.28125
3
[]
no_license
/* * Some very important stuff to follow. * * 1) A placeholder * * A placeholder is just a typedef for the template argument number. * * typedef arg<1> _1; //meaning argument number 1. * typedef arg<2> _2; //meaning argument number 2. * typedef arg<3> _3; // ditto * ..... * typedef arg<n> _n; where n is BOO...
true
7dc609464451618020f2963ffd42f16cefed0e89
C++
apassi99/Joystick
/Wifly/main.cpp
UTF-8
580
2.59375
3
[]
no_license
// // main.cpp // TestXbee // // Created by Arjun Passi on 5/4/15. // Copyright (c) 2015 Arjun Passi. All rights reserved. // #include <stdio.h> #include <stdlib.h> #include <string.h> #include <iostream> #include <thread> #include "USBDevice.h" #define USB_PORT "/dev/tty.usbserial-A5025UHW" void readStringFrom...
true
5551ad37acb356038b2eb1db2f2ca2d90a744988
C++
TheRedLady/Data-Structures-Pract
/Binary Ordered Tree/main.cpp
UTF-8
242
2.65625
3
[]
no_license
#include "BinaryOrderedTree.h" int main() { BOT<int> tree; tree.insert(5); tree.insert(8); tree.insert(3); tree.insert(2); tree.insert(7); tree.insert(-1); tree.insert(9); tree.print(); tree.remove(5); tree.print(); return 0; }
true
0d8683791263f13a7414baa9c33d285dcbe4a3a8
C++
anagorko/zpk2015
/grupa3/lukaszdm/p1/czy.cpp
MacCentralEurope
377
2.734375
3
[]
no_license
#include <iostream> using namespace std; int main(){ /* 10 5 18 9 30 15 48 24... 9 30 15 48 24.... 8 4 2 1 7 24 12 6 3 12 6 3 100 50 25 78 39 120 60 30 15 tylko potgi dwojki*/ long long c; cin >>c; while(c%2==0 && c!=1) c/=2; if(c==1) cout << "TAK" <...
true
2868db0f3c8e54c93b48413c872287084efcc921
C++
Knabin/AlgorithmQ
/Chapter2/main_50.cpp
UTF-8
738
2.90625
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(void) { int h, w, i, j, t; int height, width, max = -2147000000; int p1, p2; cin >> h >> w; vector<vector<int>> vInt; vector<int> temp; for (i = 0; i < h; ++i) { temp.clear(); temp.resize(w); for (j = 0; j < w; ++...
true
64b92e23551a65204099497d733061189e39bc9e
C++
DevilBot000/cpploader
/cppencoder/cppencoder.cpp
UTF-8
829
2.78125
3
[]
no_license
#include <windows.h> #include <iostream> void encode(LPCSTR inFilename, LPCSTR outFilename) { char buf[4096]; HANDLE inFile = CreateFile(inFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); int size = GetFileSize(inFile, NULL); DWORD bytesRead = 0; ReadFile(inFile, buf, size, ...
true
1df2988b6429e3050d6d447086ada1df9a0eeb39
C++
Space0726/Algorithm
/baekjoon/2231.cc
UTF-8
423
2.765625
3
[]
no_license
#include <cstdio> using namespace std; int main() { int n, div_sum; scanf("%d", &n); int min_div = n; for (int x = n-1; x >= n/2; x--) { div_sum = x; for (int i = 10; i <= x*10; i *= 10) div_sum += (x % i)/(i / 10); if (div_sum == n) min_div = x; } ...
true
e6b4dc66187a9f96fbbd55216630d8f35223f9e9
C++
seongwon-kang/Elsword-Source-2014
/KncTools/FileBackup/KLogManager.h
UHC
10,063
2.5625
3
[ "MIT" ]
permissive
/** @file @author cruise@kogsoft.com */ #ifndef _KOG_KLOGMANAGER_H_ #define _KOG_KLOGMANAGER_H_ "$Id: KLogManager.h,v 1.8 2003/02/11 03:13:24 cvs Exp $" #pragma once // for _MSC_VER > 1000 #include <string> #include <cstdio> #include <cstdarg> #include <windows.h> #include <vector> #include "KSingleton.h" /** Log Me...
true
a6c4add4065647c1242ebfe7a90ca9a481ee32c1
C++
faical-yannick-congo/BPad
/software/computer/push.ino
WINDOWS-1252
20,589
2.921875
3
[]
no_license
/* State change detection (edge detection) Often, you don't need to know the state of a digital input all the time, but you just need to know when the input changes from one state to another. For example, you want to know when a button goes from OFF to ON. This is called state change detection, or edge dete...
true
64b2e7d3ecf1f25e9311f42e8d26f62d7e70a32e
C++
chosh95/STUDY
/BaekJoon/2020/후위 표기식2 (1935번).cpp
UTF-8
943
3.078125
3
[]
no_license
#include <iostream> #include <algorithm> #include <string> #include <stack> using namespace std; int N; double number[26]; string origin; stack<double> operand; int main() { cin >> N; cin >> origin; for (int numberIndex = 0; numberIndex < N; numberIndex++) cin >> number[numberIndex]; for (int originIndex = 0;...
true
5e51fa9f9429451ee08bbeb9c9681f255dbe3148
C++
HimanshuSourav/Practice-Programs
/ValidParenthesis.cpp
UTF-8
1,526
3.9375
4
[]
no_license
/* Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Every close bracket has a corresponding open bracket of...
true
d1ccf0f4e5fc6a1fe49e0560a81d92f7413a64fd
C++
Emanil/Lab3
/Task6/Task6.cpp
UTF-8
2,164
3.859375
4
[]
no_license
#include <iostream> #include <vector> #include <string> using namespace std; int vector_Alternatives(int userInp, string wordInp, string userYN, vector<string>& vector) { int len = 0, i = 0; switch (userInp) { case 1: cout << "Are you sure? [Y/N] "; cin >> userYN; if (userYN == "y" || userYN == "Y") { ve...
true
2a0e7c93edd9e9b52657b1ebf8c2f3b989a0fd82
C++
Resethel/Purple-Rain
/src/GUI/Slider.cpp
UTF-8
7,997
2.828125
3
[ "Unlicense" ]
permissive
// // Slider.cpp // Purple-Rain // #include "Slider.hpp" namespace GUI { ////////// Constructor & Destructor Slider::Slider() : mBody(sf::Vector2f(0,0)) , mSlider(sf::Vector2f(0,0)) , mTitle() , mMinValue(0) , mMaxValue(100) , mDisplayTitle(true) , mMinorStep(15) , mDragOffset(0)...
true
8cfa5960d24db7936db9d4e922ea92acb2d4b56d
C++
UzL-ITS/cipherfix
/taint-tracking/src/bdd_tag.cpp
UTF-8
5,156
2.734375
3
[ "MIT" ]
permissive
// TODO: support multiple thread #include "bdd_tag.h" #include "debug.h" #include <cassert> #include <cstring> #include <iostream> #include <sstream> #include <stack> #define VEC_CAP (1 << 16) #define LB_WIDTH BDD_LB_WIDTH #define MAX_LB ((1 << LB_WIDTH) - 1) #define LB_MASK MAX_LB #define LEN_LB BDD_LEN_LB #define R...
true
ec954912e357e217edff2eeb8476b9ab2d8c1ca9
C++
zeta1999/minicore
/include/minicore/util/exception.h
UTF-8
3,819
2.78125
3
[ "MIT" ]
permissive
#ifndef FGC_EXCEPTION_H__ #define FGC_EXCEPTION_H__ #include <stdexcept> #include <string> #include <iostream> // for std::cerr; namespace minicore { inline namespace exception { struct verbose_runtime_error: public std::runtime_error { // Sometimes exception messages aren't emitted by the stdlib, so we're ensur...
true
c9ed3c57b6b307103f241d48038b5db3d9de3047
C++
justdone32/EvHttpServer
/evhttpserver/EvHttpThread.cpp
UTF-8
1,569
2.546875
3
[]
no_license
#include "EvHttpServer.h" #include "EvHttpThread.h" namespace ustd { // public EvHttpThread::EvHttpThread (const evutil_socket_t& evsock, EvHttpServer* server) : http_server_ (nullptr) , evbase_ (nullptr) , evsock_ (evsock) , server_ (server) , has_start_ (false) { } EvHttpThread::~EvHttpThread (void) { stop ()...
true
4e3b0b6fe5a7958d2e472f4b65827d3ce5a0caef
C++
mohandarsi/CPlusPlus
/EmScripten/Tetris/src/Game.h
UTF-8
524
2.65625
3
[]
no_license
#pragma once #include "raylib-cpp.hpp" #include<memory> #include "Board.h" #include "Block.h" #include "Timer.h" class Game { public: Game(int width, int height); void run(); void gameLoop(); private: void input(); void update(); void draw(); void drawBlock(); bool moveCurrentBlock(const raylib::Vector2& no...
true
2a14d21da3b78a92a6d1d860d4e8aef61fe84aa5
C++
Andrew22674/examen2clase
/Cuadrado.h
UTF-8
293
2.609375
3
[]
no_license
#pragma once #include "Figura.h" class Cuadrado : public Figura{ private: double base; double altura; public: Cuadrado(); //recibe solo un double porque la base y la altura van a ser igual Cuadrado(string, double); string toString(); double Area(); virtual ~Cuadrado(); };
true
a76b5b1ffbaea4ff7d082911d0b8441a34b9c87d
C++
Job-Colab/Coding-Preparation
/Day-124/Lawrance.cpp
UTF-8
273
2.59375
3
[]
no_license
int solve(vector<int>& prices, int k) { int ans = 0; sort(prices.begin(), prices.end()); for(int i : prices) { k -= i; if(k < 0) break; else ++ans; } return ans; } // This can be further optimized by using quickselect algorithm
true
ddde1dddcb89ebc213ed9ce220e64aa77dbfb292
C++
anvesh649/programming-revamp
/InterviewBit/Arrays/Find Permutation.cpp
UTF-8
1,226
3.40625
3
[]
no_license
void swap_array(vector<int> &A, int start, int end) { int n = (end - start) + 1; for(int i = 0; i < n/2; i++) { swap(A[start], A[end]); start++; end--; } } vector<int> Solution::findPerm(const string A, int B) { vector<int> result; int start = 0, end = 0; for(int i ...
true
ec51e93553a2e431fc8a5f653e9ad731360e29de
C++
TheMecz/ATS_programming
/1_Introduccion_entrada_y_salida/Ejercicio_1.cpp
UTF-8
540
4
4
[]
no_license
/*Ejericio 1. Escriba un programa que lea de la entrada estándar dos números y muestre en la salida estándar su suma, * resta, multiplicación y división. * */ #include <iostream> using namespace std; int main() { float num1, num2; cout<<"Digite un numero: "; cin>>num1; cout<<"Digite otro numero: "; c...
true
a577441f365adf0655c11a2052482c06cda8db36
C++
taejin0323/Algorithm_Study
/programmer/07.collatz.cpp
UTF-8
361
3.34375
3
[]
no_license
#include<iostream> using namespace std; int collatz(long num) { int answer = 0; while (num > 1) { if (num % 2 == 0) { num = num / 2; } else { num = (num * 3) + 1; } answer++; if (answer == 500) { answer = -1; break; } } return answer; } int main() { int testCase = 6; int testAnswer = c...
true
a579cd86e303ad822c567378ca7958e95560b162
C++
LuckyResistor/CatProtect
/CatProtect/SDCard.h
UTF-8
4,266
2.9375
3
[ "MIT" ]
permissive
#pragma once // // A SD-Card Access library for asynchronous timed access in timer interrupts // -------------------------------------------------------------------------- // (c)2014 by Lucky Resistor. http://luckyresistor.me // Licensed under the MIT license. See file LICENSE for details. // // // I developed this lib...
true
ffb0f27bf4f199a1f3bbfafb853a76be3e7c2bc8
C++
kenschenke/Mak_Writing_Compilers_and_Interpreters
/Mak_Writing_Compiler_2nd_Ed/Chapter07/Ver_1/XREF2.CPP
UTF-8
2,317
2.578125
3
[]
no_license
//fig 7-15 // ************************************************************* // * * // * Program 7-1: Cross-Referencer II * // * * // * Generate a cross-reference listi...
true
def02453401b85530b7c1d91904e71518a758987
C++
Haecriver/ProjetISIMA-dotr
/src/line.hpp
UTF-8
1,810
2.984375
3
[]
no_license
#ifndef LINE_HPP #define LINE_HPP #include <vector> #include <iostream> #include <vector> #include <algorithm> #include "linePoint.hpp" #include "axe.hpp" class Line{ private: std::vector<LinePoint*> pts; // Liste des points passant par cette droite long double a; // Coefficient a de l'equation y = ...
true
bded18aaf73a915cc94c5c49ac27e369b1e7f488
C++
bar4411/DIJKSTERA
/main.cpp
UTF-8
316
2.671875
3
[]
no_license
#include <iostream> #include "Graph.cpp" #include "Graph.h" using namespace std; int main() { int size; cout << "Enter the size of graph: "; cin >>size; Graph g(size); //g.dijisktra(1); cout << "The average shortest path in a graph is: " << g.getAvergeShortestPaths()<<endl; return 0; }
true
1f5ca965617e88bce557f93bfe67e1f9b57e77da
C++
chromium/chromium
/chrome/browser/offline_items_collection/offline_content_aggregator_factory.h
UTF-8
1,922
2.53125
3
[ "BSD-3-Clause" ]
permissive
// Copyright 2017 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_OFFLINE_ITEMS_COLLECTION_OFFLINE_CONTENT_AGGREGATOR_FACTORY_H_ #define CHROME_BROWSER_OFFLINE_ITEMS_COLLECTION_OFFLINE_CONTENT_AGGREGATOR_FACTORY_H_ #in...
true
d4c7c4e14f7ebe99924e8ea01637b114dd46aab0
C++
MKCA06/SDE_Sheet_Striver
/Day-17_Binary_Tree/right_view.cpp
UTF-8
707
3.625
4
[]
no_license
/* Problem Link: https://leetcode.com/problems/binary-tree-right-side-view/ */ void findRightView(TreeNode* root, int level, int &max_level, vector<int> &results) { // base case if(!root) return; // new node (rightmost) of each new level if(level > max_level) { results.push_back(ro...
true
75eee43b548437a7d59e742d1c82c3656848d399
C++
KuboCh/RUN-LISP
/LISP-Interpreter/False.cpp
UTF-8
290
2.6875
3
[]
no_license
#include "False.h" #include "DataType.h" #include "Environment.h" False::False() { } False::False(const False& orig) { } False::~False() { } /* * False is (surprisingly) false. */ DataType* False::eval(Environment* e) { return this; } void False::print(){ cout << "false"; }
true
3e1c0286ae3d12b63ad32823528b22302c246987
C++
exapde/Exasim
/Applications/NavierStokes/OAT15A/sources/exasim4.0/kernel/solution/solution.h
UTF-8
1,038
2.609375
3
[ "MIT" ]
permissive
#ifndef __SOLUTION_H__ #define __SOLUTION_H__ class CSolution { private: public: CDiscretization disc; // spatial discretization class CPreconditioner prec; // precondtioner class CSolver solv; // linear and nonlinear solvers // constructor CSolution(string filein, string fileout, Int...
true
ed0292cc19f30e1fee8d503dc658a29d98b4de24
C++
Chlebnik/KIV-OS
/src/kivos.cpp
UTF-8
2,967
2.671875
3
[]
no_license
// HelloWorld2.cpp : Defines the entry point for the console application. // #include "stdafx.h" using namespace std; int main() { Kernel kernelInstance; Kernel *kernel = &kernelInstance; File* initialDrive = kernel->LoadFileSystem(); /*cout << response << endl; cout << initialDrive->GetAbsolutePath() << endl...
true
924561db7bf32c8839c39e1d7c756be2c95704fe
C++
Hanseunghoon/TAVE_4_2_Algorithm_study
/HSH/1주차/설탕배달.cpp
UTF-8
248
2.546875
3
[]
no_license
#include<stdio.h> int main() { int s, B = 0; scanf("%d", &s); while (1) { if (s % 5 == 0) { printf("%d", s / 5 + B); break; } else if (s <= 0) { printf("-1"); break; } s -= 3; B++; } return 0; }
true
c7dba0b26c46b72447ca048188075f74f49e2bbd
C++
DamienHenderson/GEC-Engine
/HAPI_Start/Quad.hpp
UTF-8
424
2.734375
3
[ "MIT" ]
permissive
#pragma once #include "FrameBuffer.hpp" #include "Types.hpp" #include "Utils.hpp" #ifndef QUAD_HPP #define QUAD_HPP class Quad { public: Quad(const Vertex& v1, const Vertex& v2, const Vertex& v3, const Vertex& v4, vec4 < u8 > colour) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), colour_(colour) { } void Render(Fram...
true
745b686183b236ae71dc9b502e4ee9c7aa5865ff
C++
librahu/Algorithm
/leetcode/leetcode_10.cpp
UTF-8
1,299
3.21875
3
[]
no_license
/** * Solution : dp * 1. s[i] == p[j] : dp[i][j] = dp[i-1][j-1]; * 2. p[j] == '.' : dp[i][j] = dp[i-1][j-1]; * 3. p[j] == '*': * 1) p[j-1] != s[i] : dp[i][j] = dp[i][j-2] //in this case, a* only counts as empty * 2) p[j-1] == s[i] or p[j-1] == '.' * dp[i][j] = dp[i-1][j] //...
true
1af645518daa733614f1c19d71d7ac406fdb0e2a
C++
catboost/catboost
/library/cpp/cppparser/parser.cpp
UTF-8
17,944
2.609375
3
[ "Apache-2.0" ]
permissive
#include <util/generic/hash.h> #include <util/string/cast.h> #include <util/generic/hash_set.h> #include <util/generic/yexception.h> #include "parser.h" //#define DEBUG_ME 1 TCppSaxParser::TText::TText() : Offset(0) { } TCppSaxParser::TText::TText(ui64 offset) : Offset(offset) { } TCppSaxParser::TText::TTe...
true
617f261204273b8e37219d26435c6b5b2591f431
C++
pio2725/Discrete-Structure
/Parser.cpp
UTF-8
6,700
2.828125
3
[]
no_license
#include "Parser.h" Parser::Parser() { position = -1; } Parser::~Parser() { } Datalog Parser::Parse(std::vector<Token> tokens) { //copying the vector this->tokens = tokens; try { //datalog parser DatalogParser(); if (tokens.at(position + 1).getTokentype() != EOFILE) { //std::...
true
c149ddabd8b370019ab150c377547b644056e54b
C++
piyush2011257/GFG
/AMAZON/165_sde2/r2_q1_using_trie.cpp
UTF-8
2,477
3.3125
3
[]
no_license
#include<cstdio> #include<cstring> #include<string> #include<iostream> #include<algorithm> using namespace std; struct trie { char data; string word; struct trie* child[26]; trie( char d=0 ) { data=d; word.clear(); for ( int i=0; i<26; i++ ) child[i]=NULL; } }; struct trie* insert ( struct trie* root, c...
true
23b48e91a6a4afd77ead33bc9bc5229d9fa939e1
C++
Tomato1107/particle_filter_cuda
/src/classify.cpp
UTF-8
2,986
2.546875
3
[ "MIT" ]
permissive
#include "particle_filter_fast.h" #include <pcl/point_types.h> #include <pcl/point_cloud.h> #include <pcl/io/pcd_io.h> #include <pcl/console/parse.h> int main(int argc, char **argv) { int cudaDevice = 0; float normal_vectors_search_radius = 0.2f; float curvature_threshold = 0; float ground_Z_coordinate_threshold...
true
8359f722822bfe7544519bb80a93d51632084a26
C++
aliaksei-ivanou-by/Coursera_Yandex_c-plus-plus-modern-development
/01 White/Week 02/Lessons/01 White_Week 02_Lesson 06.cpp
UTF-8
837
3.59375
4
[]
no_license
// Основы разработки на C++: белый пояс. Вторая неделя // Контейнер vector. Векторы, часть 1 #include "iostream" #include "vector" #include "string" using namespace std; void PrintVector(const vector<string>& v) { for (string s : v) { cout << s << '\n'; } } int main() { int n1; cin >> n1; vector<string> v1(n1...
true
dc9ef4e62fa14daec7bf657f1d2d20115d3f57c6
C++
martincap94/LatticeBoltzmann
/LatticeBoltzmann/Utils.h
UTF-8
1,452
3.53125
4
[]
no_license
/////////////////////////////////////////////////////////////////////////////////////////////////// /** * \file Utils.h * \author Martin Cap * \date 2018/12/23 * \brief Defines utility functions that may be used anywhere in the application. * * Defines utility functions that may be used anywhere i...
true
6202b98cde383127ff267eb16afec54ac2c92b1b
C++
aryangulati/Hacktoberfest2021
/Contributions/cpp/Kadane's_Algo.cpp
UTF-8
434
2.828125
3
[]
no_license
#include <iostream> using namespace std; int main(int argc, const char * argv[]) { int n; cin>>n; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } int currSum = 0; int maxSum = INT_MIN; for(int i=0;i<n;i++){ currSum += a[i]; if(currSum < 0){ ...
true
64f01555d5abee6713b1f94904c90598a758387d
C++
ktp-forked-repos/AlgorithmLibrary
/Includes/NumberTheory.h
UTF-8
3,321
2.765625
3
[ "MIT" ]
permissive
#pragma once #include "Core.h" template<typename T> T fastpow(const T& a, int p) { if (p==0) return T(1); T tmp=fastpow(a, p/2); if (p%2) return tmp*tmp*a; return tmp*tmp; } /* Adjust Formaula xgcd(a,b) solves ax+by=gcd(a,b)=g ax+by=c satisfied iff c=g*k so, do x*=k and y*=k. if (x,y) is one of root, (x+t*b/...
true
9679d04ef7337520490de657b7daa63cb3e2c94a
C++
USTC-CS-Course-Resource/Algorithm-HWs-and-Labs
/labs/exp3/exp3.2-merge.cpp
UTF-8
1,121
3.09375
3
[ "MIT" ]
permissive
#include <iostream> #include <climits> using namespace std; constexpr int MAX_N = 200; int time_costs[MAX_N][MAX_N] = {0}; int sum_costs[MAX_N][MAX_N] = {0}; int lengths[MAX_N] = {0}; void min_merge_time(int* lengths, int i, int j) { if (i == j) return; int min_time = INT_MAX; for (int k = i; k < j; k++...
true
9fab5ee1091bcb37457acc41649d6b67ac15b802
C++
jamiepg1/ta
/C++/lab/lab05/tsk03.cpp
UTF-8
310
3.15625
3
[]
no_license
#include <iostream> using namespace std; #include "ccc_time.cpp" void addTime(Time& t, int h){ t.add_seconds(h*3600); } int main(){ int h; cout<<"number of hours"<<endl; cin>>h; Time now; addTime(now,h); cout<<now.get_hours()<<":"<<now.get_minutes()<<":"<<now.get_seconds()<<endl; }
true
7ba7bc93ec1f8cd25e25edc394d4a9be071d0b40
C++
CuteyThyme/CSU_CS_Experiment
/实验课设代码/计算机图形学/实验三/Trace/src/fileio/buffer.cpp
UTF-8
3,027
3.359375
3
[ "MIT" ]
permissive
/* The Buffer class is essentially a wrapper for an istream. It is here mainly to keep track of the current file location (line number, column number) to print intelligent error messages. If you find yourself changing stuff in this file, you're probably doing something wrong. */ #include <string> #include ...
true
1a1a1f4a69c5f5f66924e175cc8a48d69294355e
C++
olderor/advanced3
/main.h
UTF-8
6,134
4.0625
4
[]
no_license
#pragma once #include <iostream> #include <istream> #include <vector> #include <string> #include <utility> struct treap { public: // Initialization - create new treap with elements from 1 up to size. // Parameter const int size - number of elements in the array. explicit treap(const int size);...
true
7152f3e8b5fa24ad7e48f8c737d883fb421d7823
C++
gganetlepage/CVRP
/VRPwConstraintsonCheckerboard/client.cpp
UTF-8
632
2.828125
3
[]
no_license
#include "client.h" #include <iostream> #include <fstream> using namespace std; Client::Client(int positionX, int posiitionY, int demande): m_positionX(positionX), m_positionY(posiitionY), m_demande(demande) { } void Client::showClient() const { cout << m_positionX <<" "<<m_positionY<<" "<<m_demande<<endl; } ...
true
93aebf06b063117ae8208e02efa20f6b12ad0b5c
C++
khare1872/CP
/Another_Dividing_Number_Problem.cpp
UTF-8
1,003
2.59375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; long long int solve(int n) { long long int ans=0; while (n % 2 == 0) { ans++; n = n/2; } for (int i = 3; i <= sqrt(n); i = i + 2) { while (n % i == 0) { ans++; n = n/i; } } if ...
true
4d1cc241910fb55ad3fafef7d00a491ef9ae152f
C++
ryanxunhuan/Sequential_Experimental_Design
/src/tools.cpp
UTF-8
10,435
2.984375
3
[]
no_license
#include "tools.h" /* Functions with templates are defined in header file. */ // void randMultivariateNormal(vector< vector<double> > const &sqrtCov, // gsl_rng const * generator, vector<double> &sample) // { // /* Initialization. */ // unsigned int length(sqrtCov.size()); // vector<double> indep1DGa...
true
4d1e14246c4116ab0a796761ff6507208f76b9da
C++
AllexSmartHouse/ASNPRouter
/software/STM32RouterArduinoSketch/PortHandler.h
UTF-8
2,201
2.65625
3
[]
no_license
#ifndef PORT_HANDLER_H #define PORT_HANDLER_H #include <Arduino.h> #include "ProtocolListener.h" const uint8_t START_CHAR_POS = 0; const uint8_t ADDRESS_POS = 1; const uint8_t LENGTH_POS = 2; const uint8_t DATA_START_POS = 3; const uint8_t SYS_MSG = 0; const uint8_t BROADCAST_ADDRESS = 0x00; const uint8_t START_CHA...
true
428dc8af82d065424449ad617c18c5737e2a2d31
C++
archylex/Nebula-Psi
/NebulaPsi/Classes/Weapon.cpp
UTF-8
2,235
2.734375
3
[]
no_license
#include "Weapon.h" // Create missile sprite Weapon *Weapon::create(string _name, bool _isEnemy, int _type) { Weapon *_weapon = new Weapon(); if(_weapon && _weapon->initialize(_name, _isEnemy, _type)) { _weapon->autorelease(); return _weapon; } CC_SAFE_DELETE(_weapon); return nu...
true
fed31a0fcd70a9740752813350165cb6f6239b30
C++
davidcorne/cpp-sandbox
/MutableReferences.cpp
UTF-8
1,479
2.78125
3
[]
no_license
//============================================================================= // // #include <UnitCpp.h> class NonConstClass; //============================================================================= class MutableReference { public: MutableReference(NonConstClass& r); int calculate() const; // Note:...
true
1f641412f1155af37fe2dd917babd3caf64360c9
C++
yangzebin001/OJ
/POJ/POJ1426B.cpp
UTF-8
491
2.53125
3
[]
no_license
#include<iostream> #include<queue> #include<cstdio> using namespace std; typedef unsigned long long ULL; int n; void bfs(int n){ int ans = 1; queue<ULL> q; while(!q.empty()) q.pop(); q.push(ans); while(q.size()){ ULL i = q.front();q.pop(); if(i % n == 0){ printf("%llu\n",...
true
1c27cf60ef2f70dd76517bdf30d4e5d9c09b4a64
C++
lostsoul3/DS-Algo
/triplestep.cpp
UTF-8
516
3.390625
3
[]
no_license
/* A child can run 1,2,3 steps at a time. count no. of ways a child can run. */ #include <bits/stdc++.h> using namespace std; int countways(int n,vector<int> m) { if(n<0) return 0; else if(n==0) return 1; else if(m[n]>-1) return m[n]; else { m[n] = countways(n-1,m)+...
true
1e8a498f78c71871cbf59dc3db5828b1a6bb7248
C++
DandelionLU/code-camp
/backup/2/leetcode/c++/all-elements-in-two-binary-search-trees.cpp
UTF-8
1,868
3.265625
3
[ "Apache-2.0" ]
permissive
// Hi, I'm Yanzhan. For more algothmic problems, visit my Youtube Channel (Yanzhan Yang's Youtube Channel) : https://www.youtube.com/channel/UCDkz-__gl3frqLexukpG0DA?view_as=subscriber or my Twitter Account (Yanzhan Yang's Twitter) : https://twitter.com/YangYanzhan or my GitHub HomePage (Yanzhan Yang's GitHub HomePage)...
true
7ae252754b682bbf9dd466de780c4663e509a15d
C++
Gapex/CppPrimer
/Chapter7/7.21.cpp
UTF-8
2,259
3.546875
4
[]
no_license
#include <iostream> #include <fstream> #include <string> class Sales_data; std::istream &read(std::istream &in, Sales_data &ref); std::ostream &print(std::ostream &out, const Sales_data &ref2C); Sales_data add(const Sales_data &lh, const Sales_data &rh); class Sales_data { std::string bookNo; unsigned units_...
true
3e510db8b53f1b1a7445367b173bdbe45e2f26e6
C++
HENRYHKll/gb_cxx_oop
/lesson3/main.cxx
UTF-8
10,945
3.625
4
[]
no_license
#include <cstdint> #include <iostream> /* Создать абстрактный класс Figure (фигура). Его наследниками являются классы Parallelogram (параллелограмм) и Circle (круг). Класс Parallelogram — базовый для классов Rectangle (прямоугольник), Square (квадрат), Rhombus (ромб). Для всех классов создать конструкторы. Для класса ...
true
793d7fc65acb8cc5d4e8ded262f029bbeda5a913
C++
HongJungWan/KSA
/Module01. 컴퓨터과학 심화/Ch10. 배열과 포인터/예제10_2.cpp
UTF-8
243
3.15625
3
[]
no_license
// 예제 10-2. 배열명 역할을 하는 포인터 #include <stdio.h> int main(void) { int ary[3]; int *pa = ary; int i; *pa = 10; *(pa+1) = 20; pa[2] =pa[0]+pa[1]; for (i=0; i<3; i++); { printf("%5d", pa[i]); } return 0; }
true
cbb4640e667e4ae1bfb8a0882a606b607952bec4
C++
AdhaarSharma/DSA
/PrefixUniqueRowBooleanMatrix/main.cpp
UTF-8
762
2.875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; #define ROW 4 #define COL 5 void findUniqueRows(int M[ROW][COL]){ for(int i=0; i<ROW; i++){ int flag=0; for(int j=0; j<i; j++){ flag=1; for(int k=0; k<COL; k++) if(M[i][k]!=M[j][k]) flag=0; ...
true
8fd2086b558848537754a7d65e711b5e4ce99c2f
C++
Basez/Agnostik-Engine
/include/common/i_logger.hpp
UTF-8
826
2.6875
3
[ "MIT" ]
permissive
#pragma once namespace AGN { enum class ELoggerOutputType { Window = 1, Internal = 2, // TODO: create internal console (shown inside the main render window) OutputDebug = 4, // windows only, shows logs in visual studio console }; enum class ELogTimeType { RunningTime, SystemTime }; class ILogger {...
true
dbd18493dcb9b3c58a638339f0518cd06f5244e5
C++
MagiaGroz/Algorithms
/Sort/MID-EXAMPLES/SHOPPING.cpp
UTF-8
483
2.515625
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ vector<int> vec; int n,x; cin>>n; for(int i=0;i<n;i++){ cin>>x; vec.push_back(x); } sort(vec.begin(),vec.end()); double res; int i=0; while(vec.size()!=1){ if(i==vec.size()-1){ sort(vec.begin(),vec.end()); i=...
true
c17bc9a736fffbc7e215de6b141d96e18b168cc8
C++
johnsietsma/AIE_OpenGLTutorials
/AIEOpenGL/src/UtilitySystems/World.cpp
UTF-8
2,992
2.75
3
[]
no_license
#include "World.h" #include "Gizmos.h" #include "gl_core_4_4.h" #include <GLFW\glfw3.h> #include <iostream> World::World() { m_houseLocation = glm::vec3(10, 0, -10); m_treeLocation = glm::vec3(-10, 0, -10); m_foodLocation = glm::vec3(10, 0, 10); m_waterLocation = glm::vec3(0, 0, 10); m_restedLocation = glm::ve...
true
b899418acd63c350812ee591bdc51270afbeb49b
C++
seanbaxter/circle
/fmt/test3.cxx
UTF-8
951
3.59375
4
[]
no_license
#include "format.hxx" enum class shape_t { circle, square, octagon, triangle, }; int main() { shape_t shapes[] { shape_t::square, shape_t::octagon, shape_t::triangle, (shape_t)27 }; // Print the enums in the array with default settings. The enumerator names // are printed when avail...
true
8625c5070b19bcd9b5cf86513b48b2a0d19b7b57
C++
paulngouchet/CrackingTheCodingInterviewHackerRank
/crackingTheCodingInterview/leftRotation.cpp
UTF-8
1,315
3.265625
3
[]
no_license
#include <map> #include <set> #include <list> #include <cmath> #include <ctime> #include <deque> #include <queue> #include <stack> #include <string> #include <bitset> #include <cstdio> #include <limits> #include <vector> #include <climits> #include <cstring> #include <cstdlib> #include <fstream> #include <numeric> #inc...
true
64b7f29c84413be92d64750033cab327397a3cbb
C++
markoczy/2DGameSDK
/Project_2DGameSDK/include/2DGameSDK/core/asset/SoundBufferCache.h
UTF-8
1,078
2.703125
3
[ "MIT" ]
permissive
/** * @file SoundBufferCache.h * @author Aleistar Markoczy (a.markoczy@gmail.com) * @brief SoundBufferCache class * @version 1.0 * @date 2020-01-15 * * @copyright Copyright (c) 2020 * */ #ifndef __SOUND_BUFFER_CACHE_H__ #define __SOUND_BUFFER_CACHE_H__ #include <SFML/Audio.hpp> #include <2DG...
true
d04632cb357d8b809c5209d7f6a20450021ca5a3
C++
jbenipal/dstl
/edge.h
UTF-8
385
2.921875
3
[]
no_license
#pragma once namespace dstl { typedef unsigned int vertex; typedef int weight; class Edge { public: Edge(vertex n, weight w, Edge *next = nullptr) : node(n) , weight(w) , next(next) {} vertex node; weight weight; Edge* next; ...
true
1f83c733041db0022557ec2f063e801d8cb11db3
C++
jdleesmiller/twenty48
/ext/twenty48/policy_reader.cxx
UTF-8
701
2.6875
3
[ "MIT" ]
permissive
#include "policy_reader.hpp" namespace twenty48 { policy_reader_t::policy_reader_t(const char *pathname) : is(pathname, std::ios::in | std::ios::binary), data(0), offset(0) { } void policy_reader_t::skip(size_t num_states) { size_t byte_offset = num_states / 4; is.seekg(byte_offset); for (size_t i = 0; i < n...
true
9969fcd58845d6119226f7d34392529805a73218
C++
cubeman99/SEAL
/src/graphics/VertexData.h
UTF-8
10,447
3.015625
3
[ "MIT" ]
permissive
#ifndef _VERTEX_DATA_H_ #define _VERTEX_DATA_H_ #include <graphics/Color.h> #include "OpenGLIncludes.h" #include <math/Vector2f.h> #include <math/Vector3f.h> #include <math/Matrix4f.h> #include <assert.h> //----------------------------------------------------------------------------- // Standard vertex formats for m...
true
10fbd883dbaabd77409bfd6a12ac4f47f0328405
C++
AVRGroup/Telepresence
/Projeto Telepresenca/ButtonControl/ButtonControl.ino
UTF-8
1,393
2.96875
3
[]
no_license
#include <Servo.h> //Biblioteca Servo #include <time.h> Servo motor1; Servo motor2;//variavel servo int angulo1,angulo2; //angulo inicial do motor int anguloBase;//Posicionamento Inicial double unidadeBaseGiro;//Segundos por Grau double tempoDeGiro; int lixo,i=0,val[6]; String dado; char command; void setup(){ Ser...
true
697eeeb55d6e5f9c4d0b9e5ce7906b5e53653750
C++
topcodingwizard/code
/zerojudge/d550_2.cpp
UTF-8
692
2.65625
3
[]
no_license
#include <math.h> #include <stdio.h> #include <algorithm> using namespace std; int main() { int M[3], P[3]; while (scanf("%d%d%d%d%d%d", &P[0], &P[1], &P[2], &M[0], &M[1], &M[2])) { if (M[0] == 0 && M[1] == 0 && M[2] == 0 && P[0] == 0 && P[1] == 0 && P[2] == 0) break; i...
true
0bba9d0b54edae59c4bb1bb99131e55e5ed12a17
C++
KriSWhitch/Fundamentals-of-Algorithmization-and-Programming-Second-Semester
/lab16/px/dop4/HashTable.cpp
WINDOWS-1251
1,996
3.53125
4
[]
no_license
#include <iostream> #include <vector> #include <string> #include "HashTable.h" using namespace std; HashTable::HashTable(const int &size) : arr(size), size(size) {} HashTable::~HashTable() { arr.clear(); } void HashTable::insert(const Element &elem) { // int hash = -1; hash = computeHash(elem.year, 0); if (fi...
true
4c1d9380aa37ec4d240c1f3f907e871a5b17c836
C++
Qkvad/AffiliationRecommendation
/social_network/main.cpp
UTF-8
3,425
2.984375
3
[]
no_license
#include <iostream> #include <stdlib.h> #include <time.h> #include <unistd.h> #include <fstream> #include "config.h" #include "User.h" #include "Group.h" #include "Crawler.h" void createUsers(std::list<User>* Users) { for(int i=0; i<NUMBER_OF_USERS; i++) Users->push_back(User(i+1, "User")); std::cou...
true
7d8d6cbef137cc7a72391f99c4981c870ed048b2
C++
csu-anzai/CAU_CodingStudy
/HDY/2751_HDY_baekjoon.cpp
UTF-8
470
2.8125
3
[]
no_license
#include <iostream> #include <queue> #include <vector> #include <functional> using namespace std; void printArr(int arr[], int arr_size) { for (int i = 0; i < arr_size; i++) cout << arr[i] << "\n"; } int arr[1000001] = { 0, }; int main() { priority_queue <int,vector<int>,greater<int>> q; int N; cin...
true
e867ee224d988826fd3f3f13a8d0b12f62fcb6a3
C++
6Kwecky6/Ovinger1819
/src/cppOvinger/oving3/oving_3/main.cpp
UTF-8
4,126
3.8125
4
[]
no_license
#include <iostream> //Oppg. 1 class Circle { public: Circle(double radius_); //Stor C, skal ha samme navn som klasse double get_area() const; //double i stedet for int double get_circumference() const; private: //Private skal stå over variabelen, med kolonne const double pi = 3.141592; /...
true
8affce6a5c088964437d638dca8d2e4e13f26e25
C++
asutton/banjo
/banjo/scope.hpp
UTF-8
2,832
3.015625
3
[ "MIT" ]
permissive
// Copyright (c) 2015-2016 Andrew Sutton // All rights reserved #ifndef BANJO_SCOPE_HPP #define BANJO_SCOPE_HPP #include "hashing.hpp" #include "overload.hpp" namespace banjo { // -------------------------------------------------------------------------- // // Scope definitions // Maps names to overload sets. us...
true
f12d1aada546c33ec7648ab453f4944a4ec36b43
C++
HiroakiIMAI/SimpleObjectDrawingLibrary
/SODL_sample_03_MultiViewPort/SODL_sample_03_MultiViewPort_main.cpp
SHIFT_JIS
15,841
2.5625
3
[ "BSD-2-Clause" ]
permissive
#define _USE_MATH_DEFINES #include <math.h> #include <iostream> #include "SimpleObjectDrawingLibrary.h" #pragma comment( lib, "SimpleObjectDrawingLibrary.lib" ) // CũGCAXݒ肷 namespace sodl = SmplObjDrwLib; // AvP[ṼO[oV{appl[Xy[XɎ߂ namespace app { const int WINDOW_SIZE_X = 1280; const int WINDOW_SIZE_Y = 960; ...
true
20256f8085b1d051bb536b0ee10f08e254719d13
C++
cppnuts-yt/pthread
/threadCpp/excercise/Thread.cpp
UTF-8
253
2.78125
3
[]
no_license
#include "Thread.h" using namespace std; void * Thread::dispatch(void * arg){ static_cast<Thread*> (arg)->run(); } void Thread::start(){ pthread_create(&thread_handle,NULL,dispatch,this); } void Thread::join(){ pthread_join(thread_handle,NULL); }
true
b02fb7004e69b8ede5cf90e22442cd6fdabba484
C++
turbide/BlurParser
/Parser/ParserTable.h
UTF-8
1,227
3.09375
3
[ "MIT" ]
permissive
/** * @author Blurred-9L * @file ParserTable.h */ #ifndef PARSER_TABLE_H #define PARSER_TABLE_H class ParserTableKey; class ParserTableAction; /** * @class ParserTable * * @brief Base class used to abstract the required operations * for the implementation of an LR Table. */ class ParserTable...
true
8a9584c3dc0d27d9ac186d75786058179975015f
C++
jamornsriwasansak/wurstrenderer
/src/common/math/spectrum.h
UTF-8
1,430
2.734375
3
[]
no_license
#pragma once #include "vecmath.h" #if __AVX2__ using RgbSpectrum = Math::VecSimd4<3, 1001>; #else using RgbSpectrum = Math::VecPrim<double, 3, 1001>; #endif struct SpectrumConvertUtil { static inline double FromSrgb(const double v) { if (v <= 0.04045) return v * (1.0 / 12.92); return std::pow((v + 0.055) * (1...
true
b29e4463e8b62f102e8400115f9f7b18021d6af9
C++
Choi-Young-Hoon/cpp-design-pattern
/Composite.cpp
UHC
1,519
3.734375
4
[]
no_license
#include <iostream> #include <string> #include <list> /* * ü ü ׷ о ϳ ̽ ٷ ְ Ѵ. * ü(Leaf) (Comosite) Ʈ Ͽ ϳ ̽ ϵ ̴. */ // Component ̽ class Component { public: virtual void Operation() = 0; virtual void Add(Component* pComponent) {} virtual void Remove(Component* pComponent) {} virtual Component*...
true
4a125067b8e8437a4abb0a5a095c7a08af8a1dc0
C++
fourglod/iOSDevelopment
/iOS_Developer/DevelopGuide_iOS/DevelopGuide_iOS/dwvlt_v3.0_0522/M3Core_iOS4/source/MPFDrawer/System/Linux/XdwFileIOLinux.h
UTF-8
4,681
2.5625
3
[]
no_license
/** * @file XdwFileIOLinux.h * @brief XdwFileIOLinuxクラスの定義 * * @author DPC DS&S STD T31G Tomohiro Yamada <Tomohiro.Yamada@fujiexreox.co.jp> * @date 2002-3-29 * @version 1.0 * $Id: XdwFileIOLinux.h,v 1.5 2009/12/22 08:11:29 chikyu Exp $ * * Copyright (C) 2002 Fuji Xerox Co., Ltd. */ #ifndef _XDW_FILE_IO_LIN...
true
6d2cf5857f29b1f99ddbe6731ed2bd73a3b3ba7a
C++
physbuzz/quantumbounce
/quantum.cpp
UTF-8
4,066
2.8125
3
[]
no_license
#include <iostream> #include <vector> #include <cmath> #include "ImageUtil.h" #include <fstream> #include <string> #include <sstream> #include <iomanip> using namespace std; //The space 0<x<L, 0<y<L is discretized into D*D cells. const int D=512; const double L=200; const double dx=L/D; const double dt=dx*dx*0.4; /...
true
d0c25cf5bd227e2171cd98499039c730384e441e
C++
Hyukli/leetcode
/762.cpp
UTF-8
780
3.25
3
[]
no_license
#include<iostream> #include<vector> using namespace std; class Solution { public: int countPrimeSetBits(int L, int R) { vector<int> p={2,3,5,7,11,13,17,19,23,29,31}; int ans=0; for(int i=L;i<=R;i++) { if(isp(p,i)) { ans++; } ...
true
bd98747364870564f2d78cd2a8705abf34070250
C++
AustinStephens/CPPSemester2
/Lab 11-C/Phone.cpp
UTF-8
952
3.125
3
[]
no_license
#include <iostream> #include <iomanip> #include "Phone.h" using std::cout; using std::endl; using std::setw; using std::setfill; using std::ostream; Phone::Phone() { setPhone(0,0,0,false); } Phone::Phone(int a, int e, int n, bool u) { setPhone(a,e,n,u); } void Phone::setPhone(int area, int ex, int num, bool unlist)...
true
a3a2a8bca5d557c2a6de1144749109c892abb8e3
C++
mp5557/multithread_utility
/main/test_ring_buffer.cpp
UTF-8
773
3.125
3
[]
no_license
#include <iostream> #include <fmt/format.h> #include <fmt/ostream.h> #include <ring_buffer.h> int main() { RingBuffer<int> ring_buffer(3); ring_buffer.Push(1); fmt::print("after push 1: {}\n", fmt::join(ring_buffer, ",")); ring_buffer.Push(2); fmt::print("after push 2: {}\n", fmt::join(ring_buffer, ...
true
daa288baee1d7f7b9771eb204f63a1578e405d62
C++
xunzhang/lcode
/leetcode/remove-nth-node-from-end-of-list.cc
UTF-8
595
3.265625
3
[]
no_license
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* removeNthFromEnd(ListNode* head, int n) { ListNode *it1 = head, *it2 = head; int i = 0; for(; i < n && it2->ne...
true