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
d29257a351e21480542a11b20ef42d7422f0620c
C++
EntropyHaos/codebender_cleanup
/sketches/a_haos_infrared_linetracer/haos_smartcar_linetracer.cpp
UTF-8
3,716
2.734375
3
[]
no_license
#include "Arduino.h" #include "haos_smartcar_movement.h" #include "haos_smartcar_infrared.h" int main_loop_delay = 5; // = ms between chechs in the IR. boolean move_wheels_for_reals = false; boolean line_tracing; boolean smartcar_is_still_learning_and_has_lost_his_way; void move_car_for_line_tracing(int left_speed,...
true
9876cc9b08895447796513039075a02fd494296e
C++
yyqian/cpp-arsenal
/src/apue/file.cpp
UTF-8
749
2.953125
3
[ "MIT" ]
permissive
#include <iostream> #include <string> #include <unistd.h> #include <sys/stat.h> using namespace std; void print_file(const char *filename) { struct stat f_stat; stat(filename, &f_stat); cout << "birth: " << endl; if (S_ISCHR(f_stat.st_mode)) { cout << "/dev/null is char special file" << endl; ...
true
b9750a4c573784a7eb81f1fee3fb440ad83cf0a0
C++
EhsanEsc/Netflip
/src/cp_password.cpp
UTF-8
528
2.734375
3
[]
no_license
#include "cp_password.h" #include "md5.h" using namespace std; Password::Password(string ct,TYPE_NAME tp) : Component(ct,tp) { if(validation() == false) return; set(ct); raw_content = ct; } bool Password::validation() const { return true; } string Password::get_value() const { return conte...
true
0bc738a03045966d076e9c8c8c67825058804794
C++
ryuukk/arc_cpp
/arc/src/gfx/rendering/DefaultShaderProvider.h
UTF-8
3,318
2.59375
3
[]
no_license
#pragma once #include <utils/Format.h> #include "BaseShaderProvider.h" #include "DefaultShader.h" namespace arc { class DefaultShaderProvider : public BaseShaderProvider { public: DefaultShaderProvider(const std::string& vs, const std::string& fs) { config.vertexShader = vs; ...
true
ae7f9d017c8776cda7a911112798dbd59b88bc59
C++
janniklaskeck/SolusEngine
/SolusEngine/AssetSystem/Asset.cpp
UTF-8
1,718
2.625
3
[]
no_license
#include "Asset.h" #include "AssetMeta.h" #include "Engine/Engine.h" #include "Utility/FileUtils.h" #include "AssetSystem/SAsset.h" namespace Solus { Asset::Asset() { } Asset::Asset(const Asset& other) { asset = other.asset; if (asset) asset->Increment(); } Asset::Asset(Asset&& other) noexcept { ass...
true
6425d92b1800b5bd8584f31c7cb4e6892328153e
C++
Matt-Hoang/CECS-282-PA1-Solitaire-Prime
/PA1 - Solitaire Prime/Card.cpp
WINDOWS-1250
1,023
4.0625
4
[]
no_license
#include <iostream> #include "Card.h" using namespace std; // create a blank card Card::Card() { rank = 'z'; suit = 'z'; } // constructor to create a card, setting the rank and suit Card::Card(char r, char s) { rank = r; suit = s; } // set an existing blank card to a particular value void Card::setCard(char r, c...
true
b5b5038a77ae5a4b94503c9c1d3a7fd7edb3aa16
C++
aigerard/cplusplus-coursera
/examples/8 - inheritance/main.cpp
UTF-8
391
2.84375
3
[]
no_license
// simple classless executable with function. #include <iostream> #include "BaseClass.h" using namespace ExampleNamespace; int main() { try { ExampleNamespace::BaseClass bc; bc.baseClassMethod(); bc.superClassMethod(); bc.superEquivalentMethod(); } catch (const std::exception ...
true
2912c1d99e35ce6ca366fc52f83f03ca20a3f748
C++
ondesly/blocking_queue
/tests/test_multithreading.cpp
UTF-8
1,735
2.96875
3
[ "BSD-2-Clause" ]
permissive
// // test_multithreading.cpp // blocking_queue // // Created by Dmitrii Torkhov <dmitriitorkhov@gmail.com> on 29.08.2021. // Copyright © 2021 Dmitrii Torkhov. All rights reserved. // #include <chrono> #include <numeric> #include <random> #include <thread> #include <blocking_queue/blocking_queue.h> namespace { ...
true
e77c941c258d3b381a06b4e1663a222894a46b89
C++
TekatoD/controller_crutches
/src/config/arguments_parser_t.cpp
UTF-8
2,162
2.90625
3
[]
no_license
/*! * \autor arssivka * \date 10/27/17 */ #include <log/trivial_logger_t.h> #include "config/arguments_parser_t.h" using namespace drwn; arguments_parser_t::arguments_parser_t(std::string caption) : m_caption(std::move(caption)) {} void arguments_parser_t::add_strategy(arguments_parsing_strategy_t& str...
true
a90211b0f295fb1874c63ceb83078790610d1dbf
C++
nika500/HLSLibrary
/elemstream.hpp
UTF-8
3,354
2.703125
3
[ "ISC" ]
permissive
/** * @file elemstream.hpp * @brief A container for an elementary stream from a file container * * @copyright Copyright 2015 Samir Sinha. All rights reserved. * @license This project is released under the ISC license. See LICENSE * for the full text. */ #ifndef CINEK_AVLIB_ELEM...
true
360458a7dc39d9c7816a89af60f7aa2ebdbaacbb
C++
jinbeomdev/daily-algorithm-problems
/[BOJ]12906.cc
UTF-8
1,352
2.765625
3
[]
no_license
#include <stdio.h> #include <array> #include <map> #include <string> #include <queue> #include <iostream> using namespace std; int main() { array<string, 3> a; for(int i = 0; i < 3; i++) { int cnt; scanf("%d", &cnt); if(cnt > 0) { cin >> a[i]; } else { ...
true
fc45750ce7bae4a1bf110c3b81a1772aa7eef934
C++
minoof/CN_Switch
/Ethernet.cpp
UTF-8
1,176
3.25
3
[]
no_license
#include <iostream> #include "Ethernet.h" using namespace std; Ethernet::Ethernet(string inputName){ name = inputName; vlan = 1; allocated = false; fd = -1; ip = "None"; subnet = 0; mac = "None"; } Ethernet::~Ethernet(){ name = ""; ip = "None"; subnet = 0; mac = "None"; vlan = 0; allocated = false;...
true
0baa4a536003ac04af0dd4aee9a252918ab6c73b
C++
rubis-lab/DroneTransferSimulator
/Drone.h
UTF-8
409
2.734375
3
[]
no_license
#ifndef _H_DRONE_ #define _H_DRONE_ #include <utility> #include "Time.h" class Drone { private: double battery, chargingRate; /* unit: percent */ double availDist, maxAvailDist; /* available distance of Drone */ std::pair<double, double> destination; public: Drone(double _maxAvilDist); void fly(double distance);...
true
42387732e56cca77b7f9bdadc238480a8253243e
C++
rthomas015/robertthomas-CSCI21-Spring2018
/Project_2_Part_C/tournament/stack.h
UTF-8
463
2.921875
3
[]
no_license
/* */ #ifndef stack_h #define stack_h #include "node.h" #include <string> #include <iostream> #include <sstream> using namespace std; template <class T> class Stack { private: Node<T>* head; Node<T>* tail; public: Stack(); ~Stack(); int si...
true
2b863c3b667401128302c45cc641cb9e616dda5b
C++
shailesh1001/uva-solutions-1
/uva12210/uva12210.cpp
UTF-8
1,870
2.671875
3
[]
no_license
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <map> #include <sstream> #include <set> #include <iomanip> #include <list> #include <stack> #include <queue> #include <bitset> #include <numeric> #include <cstdio> #include <cmath> #include <climits> #include <cstrin...
true
e43205f3f8cbd849c95d579e3818a27d0cd2e5dc
C++
cqiyi/kaoshi
/01_数据结构/exam001/test02/test02.cpp
GB18030
2,121
3.75
4
[]
no_license
/* 1ͼڽӾΪn i1 j1 i2 j2 i3.....-1 -1þ󣬲ʾͼnǶ30 > n > 0,ĶСnҴڵ0 */ #include <iostream.h> #include <stdlib.h> void exit(int); #define MAX_NODE 30 int arc[MAX_NODE][MAX_NODE]= {0}; int list[MAX_NODE]= {0}; int n,index = 0; void showMGraph() { for(int i=0; i<n; i++) { for(int j=0; j<n; j++) { c...
true
ebb942b620f2223aeb48f8bfe4f2b836d78a08c9
C++
frontalnh/data-structure
/sort/insertionSort/insertionSort.cpp
UTF-8
1,045
3.9375
4
[]
no_license
#include "SortHelper.h" #include <iostream> using namespace std; void SortHelper::insert(Element elements[], Element element, int index) { for (int i = index; i > 0; i--) { if (elements[i - 1].value > element.value) { elements[i] = elements[i - 1]; } else { ...
true
0ac5333f37eac40bd823bed33fdaee4354e692be
C++
ly774508966/fvision2010
/modules/geom/include/fvision/geom/pointpair.h
UTF-8
1,656
2.609375
3
[]
no_license
#ifndef FVISION_POINT_PAIR_H_ #define FVISION_POINT_PAIR_H_ #include <cv.h> #include <utility> #include <vector> #include <iosfwd> namespace fvision { typedef std::pair<CvPoint2D32f, CvPoint2D32f> PointPair; typedef std::vector<PointPair> PointPairs; typedef std::pair<CvPoint, CvPoint> PointIntPair; ...
true
8879bef533559d6346caa72a17892393b8b42628
C++
slmcbane/Galerkin
/src/Rationals.hpp
UTF-8
10,300
3.125
3
[ "MIT" ]
permissive
/* * Copyright (c) 2019, Sean McBane * This file is part of the Galerkin library; Galerkin is copyright under the * terms of the MIT license. Please see the top-level COPYRIGHT file for details. */ #ifndef RATIONALS_HPP #define RATIONALS_HPP /*! * @file Rationals.hpp * @brief Compile-time computations with rati...
true
fb3ee161f27eab8e320f5da465405ccfb37092d5
C++
ayoubEL-MOUTAOUAKKIL/fuzzy
/fuzzy/domain/categorie/CategoryFactory.cpp
UTF-8
729
2.9375
3
[]
no_license
#include "CategoryFactory.h" #include "City.h" #include "Sports.h" #include "Suv.h" #include "Utilitary.h" #include "Electric.h" namespace domain { const std::string CITY = "citadine"; const std::string SPORT = "sportive"; const std::string SUV = "suv"; const std::string ELECTRIC = "electrique"; const std::strin...
true
37df60d0e1cd2c2749f56e97cdd9d08da0c05f79
C++
paulkim1997/MY_Programmers
/오답노트/(오답노트)삼각 달팽이.cpp
UTF-8
1,660
3.140625
3
[]
no_license
//문제 보자마자 든 생각: 사각 달팽이 수열도 못하는데... 이걸 어떻게 하누 //딱봐도 알고리즘/자료구조 없이 구현력 원하는 문제 같음 //삼각 달팽이 말고 그냥 2차원 배열 써서 계단 모양 만들것임 //n=4 라고 치면 //1 //2 9 //3 10 8 //4 5 6 7 이렇게! #include <bits/stdc++.h> using namespace std; int board[1001][1001]; vector<int> solution(int n) { vector<int> answer; //d 면 down 아래로, r ...
true
2cd301390d27cee3ebf66375606ed2df15b4ad18
C++
hundeboll/bronco
/src/nc/nc.cpp
UTF-8
3,291
2.578125
3
[]
no_license
/* vim: set sw=4 sts=4 et foldmethod=syntax : */ #include <signal.h> #include <string> #include <inttypes.h> #include <cstdlib> #include <cstdarg> #include <cstdio> #include <iostream> #include <sstream> #include <ncurses.h> #include "peermanager.hpp" #define HEADER_HEIGHT 2 #define FILE_HEIGHT 3 bronco::peermanager...
true
fc47e826f4560f4be8659f24c138d873bf4ccfa2
C++
jeremylorino/arduino-chess-clock
/libraries/ChessPlayerTimer.cpp
UTF-8
1,980
3.0625
3
[]
no_license
#include "Arduino.h" #include "ChessPlayerTimer.h" int getMinutes(unsigned long elapsed) { float h, m, s, ms; unsigned long over; h = int(elapsed / 3600000); over = elapsed % 3600000; m = int(over / 60000); return m; } int getSeconds(unsigned long elapsed) { float h, m, s, ms; unsigned long over; h ...
true
1ea0d97b24f9fd89510b2bc84975cef0fbd39870
C++
TommasoCapanni/ProgettoListaSpesa
/User.h
UTF-8
752
2.859375
3
[]
no_license
// // Created by Tommaso Capanni on 12/07/2021. // #ifndef PROGETTOLISTASPESA_USER_H #define PROGETTOLISTASPESA_USER_H #include "ShoppingList.h" class User { public: User(std::string name) : name(name) {}; void addList(std::shared_ptr<ShoppingList> sl); std::vector<std::shared_ptr<ShoppingList>> getLis...
true
3a3d8e5cda5f580393403a1acd565104688f11ca
C++
ParsaAlizadeh/AIC21
/client/src/AI/MyCell.cpp
UTF-8
993
2.84375
3
[]
no_license
#include "MyCell.h" #include <bits/stdc++.h> using namespace std; MyCell::MyCell() : x(-1), y(-1), lastseen(0), state(C_UNKNOWN), self(false) {} MyCell::MyCell(int x, int y, int lastseen, CellState state, bool self) : x(x), y(y), lastseen(lastseen), state(state), self(self) {}...
true
49c18c3a2120097d5655c48a7b357672b0d02c7d
C++
tudennis/LintCode
/C++/majority-number.cpp
UTF-8
520
3.234375
3
[ "MIT" ]
permissive
// Time: O(n) // Space: O(1) class Solution { public: /** * @param nums: A list of integers * @return: The majority number */ int majorityNumber(vector<int> nums) { int ans = nums[0], cnt = 1; for (const auto& i : nums) { if (i == ans) { ++cnt; ...
true
85c20d699bc9be5ee8f08fa13b14fdec79d6edbe
C++
anstjaos/KIT-Homeworks
/2학년/자료구조1/4차과제/단순연결리스트(헤더)/Chain.h
UHC
414
2.625
3
[]
no_license
#include "ChainNode.h" class Chain { private: ChainNode *head; ChainNode *first; public: Chain(); ~Chain(); bool checkNode(Book b); // ߺ˻ void insertNode(Book b); // void deleteNode(string bookNumber); // Է¹ ȣ ´ void printAll(); // ü bool loadFile(string fileName); void saveFile(string...
true
2bc060146a2cd72aa37e0915d0ac2619c60298a0
C++
qfu/LeetCode_1
/M_220_Contains_Duplicate_III.cpp
UTF-8
600
3.109375
3
[]
no_license
#include <iostream> #include <vector> using namespace std; class Solution { public: bool containsNearbyAlmostDuplicate(vector<int>& nums, int k, int t) { int size = nums.size(); if(!size) return false; int l = min(k,size-1); for(int i = l; i < size; ++i){ for(int j = (i-l); j < i;++j){ ...
true
fb9c3fad3d415291fd1e06b2b52afa1ea2e7f411
C++
JunyoungChoi/my
/20181127_Smart_vase/20181127_smart_vase.ino
UTF-8
3,948
2.796875
3
[]
no_license
#include <arduino.h> #include <SPI.h> #include <SoftwareSerial.h> const int trigPin = 4; const int echoPin = 2; long duration; int distance; unsigned long last_light_check_millis = 0; bool get_light_value(unsigned int &value1, unsigned int &value2, unsigned int &value3, unsigned int &value4){ unsigned long sta...
true
542b3daa1189f7873fe8d67bafd2c6822910aa1a
C++
OlivierArgentieri/Jeu_de_la_mort_cpp
/jeu_de_la_mort/Sprite.cpp
UTF-8
422
3.03125
3
[]
no_license
#include "pch.h" #include "Sprite.h" #include <iostream> Sprite::Sprite(char _cChar, color _cColor) { m_char_ = _cChar; SetColor(_cColor); } Sprite::Sprite(const Sprite& _refSprite) { m_char_ = _refSprite.m_char_; m_color_ = _refSprite.m_color_; } void Sprite::SetColor(color _cColor) { m_color_ = _cColor; } vo...
true
5dd05e2abec5a919f0a914a145cbf9a47354ae76
C++
Zerp2808/program-language
/Language programm/practTwo/codeTwo.h
UTF-8
502
2.84375
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> #include <random> using namespace std; int RandomGenerator() { static mt19937 rnd((uint64_t)&rnd); uniform_int_distribution<int>d(1000000000,1000000000); return d(rnd); } int main(int argc, char **argv) { int rd; vector <int> first; vector <int> second(1000...
true
fe9c63d4f7ecc3cf84577803ead9ca4147f5b77d
C++
tabvn/ued
/codefores/a_prank.cpp
UTF-8
955
2.875
3
[]
no_license
#include <iostream> #include <vector> #include <unordered_map> using namespace std; vector<int> A; vector<int> result; void findSubSeq() { int n = A.size(); unordered_map<int, int> m; int lis_size = 1; int lis_index = 0; m[A[0]] = 1; for (int i = 1; i < n; i++) { m[A[i]] = ...
true
02b7aa7b0ee3e588064f093788c33f2e127ca8d8
C++
wangchenwc/leetcode_cpp
/700_799/774_minmax_gas_dist.h
UTF-8
729
2.703125
3
[]
no_license
// // 774_minmax_gas_dist.h // cpp_code // // Created by zhongyingli on 2018/8/24. // Copyright © 2018 zhongyingli. All rights reserved. // #ifndef _74_minmax_gas_dist_h #define _74_minmax_gas_dist_h class Solution { public: double minmaxGasDist(vector<int>& stations, int K) { double left = 0, right =...
true
5d9e728d707d8dce90ad8e9208886a790d20aa4c
C++
DenSto/APC_524_Project
/src/poisson/poissonBC.cpp
UTF-8
2,198
2.515625
3
[]
no_license
#include <iostream> #include <cstdlib> #include <cmath> #include <assert.h> #include "../globals.hpp" #include "poissonBC.hpp" using namespace std; PoissonBC::PoissonBC(int side, Input_Info_t *input_info, Grid *grids){ assert(abs(side)<=3 && abs(side)>=1); dim_ = abs(side)-1; //x:0, y:1, z:2 grids_ = grids...
true
8bacba16cc44f9e0aff1d798a84fffe57a02f62f
C++
Xelopie/Violet-v1.0
/Violet v1.0/Memory.cpp
UTF-8
1,145
2.609375
3
[]
no_license
#include "stdafx.h" HANDLE MEMORY::hProcess; DWORD MEMORY::PID; bool MEMORY::Attach(const char* processName, DWORD rights) { HANDLE hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); PROCESSENTRY32 pe32; pe32.dwSize = sizeof(PROCESSENTRY32); if (!Process32First(hProcessSnap, &pe32)) { return fa...
true
568764cd312b2e996a9512dd3e79469ed9556fd1
C++
jef42/pcapwrapper
/include/helpers/helper.h
UTF-8
2,335
2.59375
3
[ "MIT" ]
permissive
#ifndef PCAPHELPER_H #define PCAPHELPER_H #include <array> #include <stdexcept> #include <vector> #include "../network/addresses/ipaddress.h" #include "../network/addresses/macaddress.h" #include "../network/sniff/snifficmp.h" #include "../network/sniff/sniffip.h" #include "../network/sniff/snifftcp.h" #include "../ne...
true
d7c111f592cf74ab7d47eb0a59683f7cb56488cd
C++
Valnig/TacticsEngine
/main.cpp
UTF-8
5,342
2.96875
3
[ "MIT" ]
permissive
#include <iostream> #include <vector> #include <utility> #include <sstream> #define MAX(a,b) ((a) > (b) ? (a) : (b)) class SimpleSpace{ private: int height_ = 0; public: virtual bool walkable() const = 0; }; class GroundSpace : public SimpleSpace{ public : bool walkable() const { return true; } ...
true
5fa8df6d4a04c21a80a2b8bcf883bed8232aa562
C++
panshim/ros_cricket
/src/ekf/src/ekf_models.cpp
UTF-8
7,434
2.625
3
[]
no_license
#include "ekf_models.hpp" #include <tf/tf.h> State sys_evaluate_g( const State& state_in, double dt ){ State state_out; // dt : time step state_out.x[0] = std::min(100.0,state_in.x[0]+dt*state_in.x[3]+0.5*dt*dt*state_in.x[6]); state_out.x[1] = std::min(100.0,state_in.x[1]+dt*state_in.x[4]+0.5*dt*dt*state_...
true
b49dfa9378a1314aa084531f2306c3ce3bb01733
C++
raymondxie/duelling
/test/wandLight/wandLight.ino
UTF-8
1,224
3
3
[]
no_license
#include <Adafruit_NeoPixel.h> // NodeMCU D3 pin #define PIN D3 // How many NeoPixels are attached to the Arduino? #define NUMPIXELS 15 Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); int delayval = 1000; void setup() { pixels.begin(); pixels.setBrightness(32...
true
ad98fdf96e594183052a3e422d9325b386185dc3
C++
thirtiseven/CF
/edu 52/F.cc
UTF-8
587
2.640625
3
[]
no_license
#include <iostream> #include <vector> const int maxn = 1e6; std::vector<int> t[maxn]; int dep[maxn]; int dfs(int cur, int fa) { int ans = maxn*2; if (t[cur].size()==1) { return dep[cur] = 1; } for (auto it: t[cur]) { if (it != fa) { ans = std::max(it, cur); } } return ans; } int main(int argc, char *...
true
943f62730eb83c76422a68fa0c8561321618a4f5
C++
Tahani-0514/CS-Courses
/COSC214_Data_Structure/projects/Ch5_Ex1_linkedList/code/dateTypeImp.cpp
UTF-8
1,536
3.453125
3
[]
no_license
//Implementation file date #include <iostream> #include "dateType.h" using namespace std; void dateType::setDate(int month, int day, int year) { if (year >= 1) dYear = year; else dYear = 1900; if (1 <= month && month <= 12) dMonth = month; else dMonth = 1; switch...
true
65113b6fd4da71958380881359b12c6ad9f2ceee
C++
jontierno/7574A16C2PROY
/loadbalancer/main.cpp
UTF-8
3,572
2.859375
3
[]
no_license
#include <iostream> #include <stdlib.h> #include "string" #include "vector" #include <stdio.h> #include <cstring> #include <fstream> #include <algorithm> using namespace std; #define STATICS_FILE "/home/load.db" #define WORKERS_FILE "/home/workers.db" string handleCrearCuenta(int nro) { return ""; } string hand...
true
edce5412a85f003422825688d9cf8ea04804e333
C++
scm-ns/real_neurons_stdp_minst
/network_old.h
UTF-8
1,693
2.609375
3
[]
no_license
#ifndef NETWORK_H #define NETWORK_H #include "neuron.h" #include "error.cpp"// NOT NEEDED present FROM NEURON.h #include <vector> #include <iostream> #include <tuple> #include <functional> #include <chrono> /* This will handle the structure of the neuron connections.. How ? Keep a vector of neurons wit...
true
3fbe5bfcd85c78479cf30e719e140509abda9f81
C++
Rancho06/board_puzzle
/hlayout.cpp
UTF-8
770
2.75
3
[]
no_license
#include "hlayout.h" #include "main_window.h" /** Constructor creates two QRadioButtons @param m_w A pointer to the main window object */ HLayout::HLayout(MainWindow* m_w){ mw=m_w; horizon=new QHBoxLayout(); manhattan=new QRadioButton("Manhattan"); outofplace=new QRadioButton("OutOfPlace"); this->setLayout(horizo...
true
b373ad0f813d132f8501f0159907294bf91406e5
C++
bonaert/torrent
/main.cpp
UTF-8
2,397
2.953125
3
[]
no_license
#include <iostream> #include <assert.h> #include "Torrent.hpp" #include "Client.hpp" #include "Utils/Tools.hpp" /* * The following examples methods demonstrate how the API should be used. * This is here to help design the API of the library, and make sure the * interfaces are as simple and clear as possible. */ ...
true
eb0bb20d0838a0aed2676455a914ce5f29cd33bd
C++
mtreviso/university
/Problems & Contents/URI/4-DataStructures&Libraries/1112-Schweisen.cpp
UTF-8
1,476
2.75
3
[]
no_license
#include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <set> #include <vector> using namespace std; const int MAX = 1001; int MAX_X, MAX_Y, P; int tree[MAX][MAX]; void atualiza(int x, int y, int val){ while (x <= MAX_X){ int y1 = y; while(y1 <= MAX_Y){ tree[x][y1] += val...
true
4dad9fc4f200ed9d04aa334b051f0149b3ee6537
C++
lizhieffe/ztl
/src/network/socket_sender.cc
UTF-8
1,836
2.765625
3
[]
no_license
#include "socket_sender.hh" #include <cstring> #include <errno.h> #include <iostream> #include <netdb.h> #include <sys/select.h> #include <sys/socket.h> namespace ztl { namespace { class SocketSenderImpl : public SocketSender { public: SocketSenderImpl(int socket_fd) : socket_fd_(socket_fd) {} bool Send(const ...
true
a6de0c5a28d2b397d9025ce9a1a9d66f45e75b2f
C++
OTTFFYZY/StandardCodeLibrary
/BasicDataStructure/FenwickTree_2drarq.cpp
UTF-8
1,259
3.03125
3
[]
no_license
#include <stdio.h> #include <string.h> #include <algorithm> using namespace std; const int M=1e3+5; int bit0[M][M],bit1[M][M],bit2[M][M],bit3[M][M]; //Binary Index Tree inline int lowbit(int x) { return x&(-x); } void add(int x,int y,int v) //add v at (x,y) { for(int i=x;i<M;i+=lowbit(i)) for(int j=y;j<M;j+=lowbi...
true
09e984b2f6d1bb45dace30cef1f8af2adf5b3ee7
C++
webdev1001/dotnetinstaller
/dotNetInstallerLib/InstallSequence.cpp
UTF-8
788
2.75
3
[ "MIT" ]
permissive
#include "StdAfx.h" #include "InstallSequence.h" #include "InstallerSession.h" InstallSequenceState::InstallSequenceState() : m_sequence(InstallerSession::Instance->sequence) { } InstallSequenceState::InstallSequenceState(InstallSequence sequence) : m_sequence(InstallerSession::Instance->sequence) { ...
true
a7bbc6bd8f18670c17757122062fd031b5e8ab83
C++
tengfeizhilang/homework
/台阶问题.cpp
UTF-8
984
3.484375
3
[]
no_license
最好时间复杂度为O(1),最坏时间复杂度为O(n),空间复杂度为O(1) 最好的情况是只执行一次就成功退出,所以时间复杂度为O(1),最坏情况则是要反复检索n次才能成功,所以最坏时间复杂度为O(n),每次检索所需要的内存空间为1,所以空间复杂度为O(1) #include<iostream> using namespace std; //int f(int n) //{ // if(n==1){return 1; // } // if(n==2){ // return 2; // } // if(n>2){ // return f(n-1)+f(n-2); // } //} //int ma...
true
aa4050a42680d47b9166d7270e633e76e7fd63f7
C++
Alitebbal/SolutionTPAliTebbal
/Formes2054583/Formes2054583.cpp
ISO-8859-1
8,662
3.3125
3
[]
no_license
#include "Formes2054583.h" #include <string> #include "Labo06Fonctions.h" #include <iostream> #include <time.h> #include "Menus2054583.h" using namespace std; // La fonction pour tracer le rectangle int traiterRectangle(int choixRemplissage) { // Dclaration des variables int largeur; int hauteur; // On demande les...
true
0db860afad1e986db7a92429c013cbda32b7a288
C++
lzhu1992/util
/src/geom/test/TestCube.cc
UTF-8
644
2.6875
3
[]
no_license
#include "../Vec3d.hh" using namespace std; using namespace geom; #define print(v) cout << #v << ' ' << v << '\n' /* Test all operations for Cube */ int main() { const Cube c1(0, 0, 0, 9); print(c1); const Cube c2(0, 0, 0, 9, 9, 9); print(c2); const Cube c3(0, 0, 0, 7, 7, 7); print(c...
true
bbe3a3c6bedf593a38ceff2cf46b20659bc44ccf
C++
huangr/HS-Competitive-Coding
/Codeforces_Problems/cf-448A.cpp
UTF-8
446
2.640625
3
[]
no_license
#include <iostream> using namespace std; int main() { int cups = 0, medal = 0, a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f; int shelves = 0; cin >> shelves; cups = a+b+c; medal = d+e+f; int numneed = 0; if(cups % 5 != 0) numneed += cups/5 + 1; else numneed += cups/5; if(medal % 10 != 0) numneed += m...
true
5d5adfb88753ce54c89be9269d94874afb7af6b3
C++
ycwang812/SLAMCar
/PHOENIXEngine/PHOENIX/PX2Engine/Core/PX2ErrorHandler.cpp
UTF-8
2,260
2.640625
3
[]
no_license
// PX2ErrorHandler.cpp #include "PX2ErrorHandler.hpp" #include "PX2Log.hpp" #include "PX2ScopedCS.hpp" using namespace PX2; //---------------------------------------------------------------------------- ErrorHandler* ErrorHandler::Get() { return mHandler; } //---------------------------------------------------------...
true
3ccb6b5b0091fe6bf54f0f9d9fad8c343460a40c
C++
Lekheshwar/LeetCode
/Min_Height_Tree.cpp
UTF-8
1,182
2.6875
3
[]
no_license
// QUESTION LINK : https://leetcode.com/explore/featured/card/november-leetcoding-challenge/564/week-1-november-1st-november-7th/3519/ class Solution { public: vector<int> findMinHeightTrees(int n, vector<vector<int>>& edges) { if (n == 1)return {0}; vector<int> leaves; vector<int> degre...
true
e3b677b2cb9b22f5062a8bd7a7e61eb11c4a1d5e
C++
timothydmorton/transit
/src/ld_test.cpp
UTF-8
897
2.6875
3
[ "MIT" ]
permissive
#include <iostream> #include "limb_darkening.h" #include "numerical_limb_darkening.h" using transit::QuadraticLaw; using transit::NumericalLimbDarkening; using transit::QuadraticLimbDarkening; int main () { double q1 = 0.9999, q2 = 0.9999, u1 = 2*q1*q2, u2 = q1*(1-2*q2); QuadraticLaw* law = new Q...
true
217c5d96a2a543f137a6e1f51e87785ef27aac5b
C++
meteora211/SelfLearning
/cpp_concurrency_in_action/parallel_design/parallel_std.cc
UTF-8
3,088
3.328125
3
[]
no_license
#include <atomic> #include <thread> #include <latch> #include <iostream> #include <vector> #include <chrono> #include <ranges> #include <algorithm> #include <numeric> #include <future> using namespace std; using namespace chrono; using namespace std::chrono_literals; template<typename Iterator, typename Func> void pa...
true
d6192ff9a20679d6cf2f42ffd561dd2aa66d385e
C++
Flotchie/main
/RasPi/RaspPLC/src/Data.cpp
ISO-8859-1
4,586
2.671875
3
[]
no_license
/* * Data.cpp * * Created on: 29 janv. 2019 * Author: Bertrand */ #include "Data.h" #include "StringTools.h" #include "json/json.h" #include <chrono> using namespace std; bool Data::InitFromIni(CSimpleIniA& ini, std::map<std::string, Data*>& datas) { CSimpleIniA::TNamesDepend variable...
true
03117cf7f594f8fc9f843c40d01c9315934323eb
C++
Lawlets/FrogEngine
/Math/Tools.h
UTF-8
1,032
2.9375
3
[]
no_license
#ifdef MATH_EXPORTS #define TOOLS_API __declspec(dllexport) #else #define TOOLS_API __declspec(dllimport) #endif #define PI 3.14159265359f #include <string> #include "Vector3d.h" namespace Math { struct Tools { // Functions template<class T> static T Clamp(T f, T min, T max); TOOLS_API static void Swap(...
true
faa76c6d86717bee0c0c6a505a925d7388599512
C++
zl6977/BasicKnowledge
/HuaWei/40输入一行字符,分别统计出包含英文字母空格数字和其它字符的个数.cpp
UTF-8
553
2.875
3
[ "MIT" ]
permissive
#include "stdafx.h" #include "HuaWei.h" #include <stdio.h> #include <ctype.h> #include <string> #include <iostream> using namespace std; int test_40() { string str; while (getline(cin, str)) { int English = 0, Blank = 0, Number = 0, Other = 0; for (int i = 0;i<str.size();i++) { char tmp = str[i]; if (is...
true
6b6e2a900348b2630a357c9f7251c6e7a97e8eb1
C++
hakaorson/CodePractise
/Dynamic/paint-fence-two.cpp
UTF-8
516
2.90625
3
[]
no_license
#include <iostream> #include <vector> #include <tuple> #include <algorithm> #include <unordered_map> #include <array> #include <numeric> using namespace std; const int maxsize{ 100 }; int main() { int size{}; cin >> size; int matrix[maxsize + 1]{}; for (int i = 1; i <= size; i++) { if (i == 1) { matrix[i] = ...
true
105012dae7409e0db6139c43cd190c0485e1c691
C++
ikold/Coil
/Coil/Source/Platform/Windows/WindowsInput.cpp
UTF-8
1,321
2.53125
3
[ "BSD-3-Clause", "Zlib", "Apache-2.0", "LicenseRef-scancode-public-domain" ]
permissive
#include "pch.h" #include "WindowsInput.h" #include "Coil/Core/Application.h" #include <GLFW/glfw3.h> namespace Coil { // static assign binding WindowsInput implementation methods with static methods in base Input class Scope<Input> Input::Instance = CreateScope<WindowsInput>(); bool WindowsInput::IsKeyPressedIm...
true
64d737f34a3df4fb6e0202291566fbbaef01dced
C++
bhupeshprajapati/UdemyCPP
/sectionChallengeStreamsIO/main.cpp
UTF-8
2,644
3.046875
3
[]
no_license
#include<iostream> #include<iomanip> #include<vector> #include<string> struct City{ std::string name; long population; double cost; }; //Assume each country has has atleast one city struct Country{ std::string name; std::vector<City> cities; }; struct Tours{ std::string title; std::vector<Country> countries ;...
true
5da93aacb083d9f3c1bb642d4cf47cf437406c72
C++
Hz-Lin/codam2019
/cpp/cpp06/ex00/Conversion.hpp
UTF-8
1,623
2.6875
3
[ "Apache-2.0" ]
permissive
/* ************************************************************************** */ /* */ /* :::::::: */ /* Conversion.hpp :+: :+: ...
true
90a6e8a73a0442771f9bab65a6d0f4eed74f90d4
C++
P140N/origin
/Alg/main.cpp
UTF-8
1,365
2.75
3
[]
no_license
#include <QtGui/QApplication> #include <QtOpenGL/QGLWidget> #include <QDesktopWidget> #include "GLWidget.h" #include "Polygon.h" #include "Point.h" #include "MonotonePartition.h" #include <list> #include <iostream> #include <fstream> #include <stdio.h> using namespace std; int main(int argc, char *argv[]){ if (arg...
true
ce4c82e9b98047efefb37c9a317dcc4ed9e95bee
C++
aidaka/KayoVM
/vm/rtda/heap/Object.cpp
UTF-8
2,882
2.859375
3
[ "MIT" ]
permissive
/* * Author: kayo */ #include <sstream> #include "../ma/Class.h" #include "Object.h" #include "../ma/Field.h" #include "../../symbol.h" #include "StringObject.h" using namespace std; Object *Object::newInst(Class *c) { if (c == java_lang_String) { return StringObject::newInst(""); // todo } siz...
true
063f810d9ee3ccb8b3027360562de80ba383182e
C++
alexcortes18/Programacion2
/1 Parcial/programa9-Tarea2/programa9-Tarea2.cpp
UTF-8
250
2.734375
3
[]
no_license
#include <iostream> #include <stdlib.h> using namespace std; int main() { int n,numero; cout<<"Ingrese el numero:..."; cin>>numero; while (numero>0) { n=numero%10; numero=numero/10; cout<<n; } cout<<endl; system("PAUSE"); }
true
6f3e6b949ee89b878336ae1c602643825edb04a9
C++
Jucesr/videogames
/PuyoPuyo/Source Files/Player.cpp
UTF-8
10,832
3.140625
3
[]
no_license
//*************** Player Class *************** #include "../Header Files/Player.h" Player::Player(int nheadStartX, int nheadStartY, int npuyoWidth, int npuyoHeight, Texture* npuyoSprite , int nxrenderOffset, int nyrenderOffset){ puyoHeight = npuyoHeight; puyoWidth = npuyoWidth; startPositionX = nheadStartX; start...
true
c70f51df16efdf51fd1fdd3e4604a61ec66c49c0
C++
Hopobcn/EnTT-Pacman
/include/Simpleton/Memory/alloc.hpp
UTF-8
1,388
3.1875
3
[ "MIT" ]
permissive
// // alloc.hpp // Simpleton Engine // // Created by Indi Kernick on 16/8/18. // Copyright © 2018 Indi Kernick. All rights reserved. // #ifndef engine_memory_alloc_hpp #define engine_memory_alloc_hpp #include <new> #include <cstring> #include <cstddef> namespace Memory { /// Allocate memory inline void *allo...
true
f8fde0646eb7a847ef563f77187ac0ea9984e035
C++
khersham/cplusplus
/complexlog.cpp
UTF-8
845
3.140625
3
[]
no_license
#include <iostream> #include <cmath> #include <complex> #include <ctime> //for seeding the random number with time #include <cstdlib> //for random number using namespace std; complex<double> MonteCarlo(complex<double>(*func)(complex<double>), double Start, double End, double Number) { srand(time(NULL)); double u;...
true
585816aca0dbf69467d9679c75e032324cfed52d
C++
illyashenko/Arkanoid2D
/src/Block.h
UTF-8
850
2.8125
3
[]
no_license
#pragma once #include "IEntity.h" using namespace sf; enum class BlockType { SINGLE, DOUBLE, TRIPLE, BROKEN }; class Block : public IEntity { public: Block(); Block(BlockType blockType, Vector2f position); void draw(RenderWindow& window); void update(const float& time); float getLeft(); float getRight(); ...
true
99d34753ff869205dad1edb8db7782f7c74abcac
C++
quant108/Algorithms-Itmo
/week1/week1-H.cpp
UTF-8
450
2.53125
3
[]
no_license
#ifdef JUDGE #include <fstream> std::ifstream cin("input.txt"); std::ofstream cout("output.txt"); #else #include <iostream> using std::cin; using std::cout; #endif #include <algorithm> using namespace std; int main() { int n, A[15], time = 18000, con = 0; cin >> n; for(int i = 0; i < n; i++) cin >> A[i]; sort(...
true
706e8b541d62b20d71a5493a7e3770e4e5a42e07
C++
chargen/leetcode
/subsets.cc
UTF-8
402
2.75
3
[]
no_license
class Solution { public: vector<vector<int> > subsets(vector<int> &S) { vector<vector<int> > ans; int len = S.size(); sort(S.begin(), S.end()); for(int s = 0; s < (1<<len); ++s){ vector<int> tmp; for(int i = 0; i < len; ++i){ if((1<<i)&s) tmp.push_back(S[i...
true
26ce5cd077dc26cda72f4041d7b1979ae2b588ec
C++
shinkw83/lib
/include/logger.h
UTF-8
1,782
2.53125
3
[]
no_license
#ifndef __LOGGER_H__ #define __LOGGER_H__ #include <log4cplus/logger.h> #include <log4cplus/layout.h> #include <log4cplus/fileappender.h> #include <log4cplus/loggingmacros.h> using namespace log4cplus; #define MAX_FILE_SIZE (1024*1024*1024 / 10) class LogMgrC{ SharedAppenderPtr myAppender; Log...
true
e2b817521213e708c23e8fb3015ffc7396a922ff
C++
lhj1230/lee-hyun-ju
/Project(stl)/maze_vector.cpp
UHC
9,234
2.640625
3
[]
no_license
#include<stdio.h> #include<conio.h> #include<windows.h> #include<time.h> #include<iostream> #include<vector> using namespace std; ////////////////////////////////////////////////////// #define col GetStdHandle(STD_OUTPUT_HANDLE) #define BLACK SetConsoleTextAttribute( col,0x0000 ); #define DARK_BLUE SetConsoleTextAttr...
true
6f46a8ab6b6fb5dc6152df7c36b1bb785fc84cf4
C++
DShcherbak/Algorithms
/semester_4/Lab_2/Node.cpp
UTF-8
1,710
3.75
4
[]
no_license
/*#include "Node.h" void add_node_to_tree(Node* head, Node* new_node){ if(!head){ head = new_node; return; } Node* parent = head; while(parent){ if(parent->value > new_node->value){ if(parent->left) parent = parent->left; else{ ...
true
382344e508c42056dff0b8156fb35203430a03a1
C++
tashleyy/recruit
/src/ds/HashTable.cpp
UTF-8
1,269
3.15625
3
[]
no_license
#include <functional> #include "../../lib/ds/HashTable.h" #include "../../lib/Exceptions.h" using namespace std; const int NUM_BUCKETS = 20; template <class K, class V> HashTable<K, V>::HashTable() { data = new LinkedList<pair<K, V>>*[NUM_BUCKETS]; for (unsigned int i = 0; i < NUM_BUCKETS; i++) { data[i] = new Li...
true
bbdea9110281d0c7a179df121a939d5924af1fbe
C++
Coding-Badly/tc_Random
/tc_random_XorShift16.cpp
UTF-8
498
2.609375
3
[]
no_license
#include <Arduino.h> #include <inttypes.h> // http://www.arklyffe.com/main/2010/08/29/xorshift-pseudorandom-number-generator/ static uint16_t Seed = 1; unsigned long tc_RandomGenerate_XorShift16( void ) { uint16_t Next; Next = Seed; Next = Next ^ (Next << 1); Next = Next ^ (Next >> 1); N...
true
6b32d72dfc1a455f8ba9c628fc66740ba272d8a3
C++
raulgoce/porfolio
/Advanced/19.POO_Clases_derivadas/207.Herencia_protected/Turismo.h
UTF-8
528
2.953125
3
[]
no_license
#include <iostream> #include <string.h> #include "Vehiculo.h" using namespace std; class Turismo: public Vehiculo{ //si no se pone el tipo de herencia, se pone privado por defecto private: int numeroPuertas; public: Turismo(string marca, string color, string modelo,int numeroPuertas):Vehiculo(marca, color, mode...
true
ca5aacf30e31004044c628731ba9e42b030e4d4d
C++
jtiu-cse-school-assignments/csce-121-homeworks
/CSCE_121_Homework/Homework8/Homework8/Household.h
UTF-8
405
2.609375
3
[]
no_license
// // Header.h // Homework8 // // Created by Julian Tiu on 4/11/16. // Copyright © 2016 Julian Tiu. All rights reserved. // #pragma once #include "Product.h" #include <string> class Household : public Product { private: public: Household(); Household(int productNum, std::string productName)...
true
ae861d9f54140504c6d070826f91e18e5fd3a72b
C++
eaasna/low-memory-prefilter
/hashmap/lib/seqan3/doc/tutorial/search/search_span.cpp
UTF-8
335
2.703125
3
[ "BSD-3-Clause", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-public-domain", "CC0-1.0", "CC-BY-4.0", "MIT" ]
permissive
#include <seqan3/core/debug_stream.hpp> #include <seqan3/std/span> int main() { std::string text{"Garfield the fat cat without a hat."}; size_t start{2}; size_t span{3}; std::span text_view{std::data(text) + start, span}; // represent interval [2, 4] seqan3::debug_stream << text_view << '\n'; // ...
true
c70ca4c4d9fe8de52d49b81c9ac790a859359194
C++
MarkRepo/CppSTL
/Allocator/allocator_test.cc
UTF-8
4,099
3.671875
4
[]
no_license
#include <gtest/gtest.h> #include <cstddef> #include <iostream> using namespace std; class MyType { public: MyType() { cout << "ctor for MyType" << endl; } MyType(const MyType& val) { cout << "copy ctor for MyType" << endl; } ~MyType() { cout << "dtor for MyType" << endl; } }; //自定义allocator必须提供以下内容 template...
true
02617f5dde9d3063b3ecb7cbebe5fb6df250ccc1
C++
bablookr/ds_algo
/Part 1 - Data Structures/array1.cpp
UTF-8
648
3.78125
4
[]
no_license
#include <iostream> #include <algorithm> using namespace std; /*Array: Basic functions insert,delete,reverse,sort,search*/ void ins(int a[],int n){ } void del(int a[],int n){ } void reverse_array(int a[],int n){ reverse(a,a+n); } void sort_array(int a[],int n){ sort(a,a+n); //sort(a,a+n,greater<int>(...
true
c37f8024c9b30b4efbad1d58aa0029ebb75293ca
C++
lizkwan/UVa-Online-Judge
/10409.cpp
UTF-8
752
3
3
[]
no_license
#include <stdio.h> int main () { int T,B,N,E,S,W,count,i,temp; char str[6]; while ((scanf("%d",&count)==1) && (count!=0)) { T=1; B=6; N=2; S=5; W=3; E=4; gets(str); for (i=0; i<count; i++) { gets(str); switch (str[0]) { case 'n': case 'N': temp = T; ...
true
9b1a2e58ba4ddbbd4f937e196963068e33566f78
C++
asherikov/smpc_solver
/solver/as_matrix_ecL.h
UTF-8
1,643
2.578125
3
[ "BSD-2-Clause" ]
permissive
/** * @file * @author Alexander Sherikov * @date 28.08.2011 13:43:12 MSD */ #ifndef AS_MATRIX_ECL_H #define AS_MATRIX_ECL_H /**************************************** * INCLUDES ****************************************/ #include "smpc_common.h" #include "as_problem_param.h" /// @addtogroup gas /// @{ /***...
true
1313b5a19b382e4825703ad95ce8f0a217c14b7d
C++
NeilWangziyu/C-Primer
/C-Primer/inheritance/main.cpp
UTF-8
1,962
3.515625
4
[]
no_license
// // main.cpp // inheritance // // Created by 王子昱 on 2019/7/5. // Copyright © 2019 王子昱. All rights reserved. // #include <iostream> #include <string> using namespace std; class Quota{ public: Quota() = default; Quota(const string &book, double sales_price): bookNo(book), price(sales_price){ } ...
true
7d8fa628f16fe520b415b398a9deb1e2311fcf28
C++
yhmtmt/awsv1
/src/blh2ecef.cpp
UTF-8
532
2.875
3
[]
no_license
#include <iostream> #include <iomanip> using namespace std; #include "aws_coord.hpp" int main(int argc, char ** argv) { if(argc != 3 && argc != 4){ cout << "Usage: blh2ecef <lat> <lon> [<alt>]" << endl; return 1; } double lat = atof(argv[1]) * PI / 180.0; double lon = atof(argv[2]) * PI / 180.0; dou...
true
54cf0e94fb7b79d259bfa48192efd5b3a9625015
C++
ksaravindakashyap/dsa_placement_prep
/Arrays/commonEle.cpp
UTF-8
1,308
3.4375
3
[]
no_license
// Common elements // // Given three arrays sorted in increasing order. Find the elements that are common in all three arrays. // Note: can you take care of the duplicates without using any additional Data Structure? // // Example 1: // // Input: // n1 = 6; A = {1, 5, 10, 20, 40, 80} // n2 = 5; B = {6, 7, 20, ...
true
35990ad11f771e0fed4611cc48c0c430c845dd44
C++
mrSerega/DiscreteMathematics
/test.cpp
UTF-8
1,188
2.921875
3
[]
no_license
#include "test.h" #include "dijkstra.h" #include "crapalgo.h" #include <fstream> #include <iostream> Test::Test() { //in stream ifstream input; input.open("input.txt"); //in vars int testLen = 0; int n = 0; input>>n>>testLen; vector< vector< pair<int,int> > > testVector(testLen); ...
true
eccfc7cac6cc43a91d2f2148462b24ab73159798
C++
shuyuFranky/coding
/Greedy/minimum spanning trees/POJ1751-prim.cpp
UTF-8
1,505
2.984375
3
[]
no_license
/** * Prim * Highways */ #include <iostream> #include <cstring> #include <cmath> using namespace std; #define maxn 760 #define inf 1e9 struct Node { int x; int y; } node[maxn]; int N, M; double dis[maxn]; int p[maxn]; int book[maxn]; double e[maxn][maxn]; double getDis(int a, int b) { int x = node[a]...
true
6fc77a6f0efa64271ec9b2f5d923ddf7a79538a1
C++
Aaron-P/CS-325
/OurCode/Object.cpp
UTF-8
1,581
3.328125
3
[]
no_license
#include <iostream> #include "Object.h" using namespace std; //Default Constructor Object::Object() { speed = 0; maxSpeed = 0; xcoord = 0; ycoord = 0; direction = 0; height = 0; width = 0; alive = 0; isKillable = 0; } //Initializing Constructor Object::Object(int dSpeed, double dDirection, do...
true
60708148d6aab28ed4b4c518e8324abd65aa737d
C++
pmiddend/fcppt
/test/cyclic_iterator.cpp
UTF-8
1,326
2.734375
3
[ "BSL-1.0" ]
permissive
// Copyright Carl Philipp Reh 2009 - 2018. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include <fcppt/cyclic_iterator.hpp> #include <fcppt/config/external_begin.hpp> #include <catch2/c...
true
afc488e312f480f705f78c1479b60c3b37c4d4ff
C++
AemieJ/competitive
/gfg/37/main.cpp
UTF-8
428
3.28125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; struct Node { int data; struct Node *next; Node(int x) { data = x; next = NULL; } }*head; // explanation: we need m to be removed and the one before m need to be connected to the node after m. Thus, we change the pointer of m itself to the next node. // Th...
true
d1d880266627bce3228b2f837a3dc49aac155d3e
C++
Kobayashi58843/MissileBozu
/ProjectShooter/SourceCode/Game/Model/Character/Event/EventModel.cpp
SHIFT_JIS
3,551
2.796875
3
[]
no_license
#include "EventModel.h" //ʒu. const D3DXVECTOR3 POSITION = { 0.0f, 0.0f, 0.0f }; EventModel::EventModel(clsD3DXSKINMESH* const pModel, const float fScale, const double dAnimSpeed) : m_ModelState() { AttachModel(pModel); //ʒu. m_vPos = POSITION; m_vRot = { 0.0f, 0.0f, 0.0f }; //TCY. m_fScale = fScale; //Aj...
true
13b9b3a95713844b320892dd7641a20045afacc8
C++
DannyMoses/ArduinoSquareWaveGenerator
/SquareWaveGenerator.ino
UTF-8
1,694
3.109375
3
[ "Apache-2.0" ]
permissive
/* * A simple square wave generator using a tlc5940 IC, an LCD and some buttons * Author: Daniel Moses */ /* * PINOUTS: * LCD on pins 8, 7, 6, 5, 4 and 2 * TLC5940 on the default pins for the library * buttons: left: A1 * right: A2 * set: A3 */ #include "Tlc5940.h" #include <LiquidCrystal.h> /* declarations for the...
true
a4ee1053c6c37260ed4e277a794d26fde658ac31
C++
hmk1337/Prokom
/faktorial.cpp
UTF-8
456
3.453125
3
[]
no_license
#include<iostream> using namespace std; int faktorial(int bil,int hasil){ if(bil == 0){ cout<<'='; return hasil; } else{ hasil*=bil; cout<<bil; if(bil != 1) cout<<'*'; faktorial(bil-1,hasil); } } int main(){ int bil,hasil=1; cout...
true
d3ee778345d0d0e8a584603d5d035df291cb5c75
C++
kunhuicho/crawl-tools
/codecrawler/_code/hdu5088/16215543.cpp
UTF-8
1,430
2.765625
3
[]
no_license
#include<iostream> #include<cstdio> #include<cstring> using namespace std; const int maxn = 1000; const int bit = 42; typedef long long LL; LL a[maxn][maxn],g[maxn]; int n; void build_matrix() //构造系数矩阵 { for(int i = 0; i < n; i++) { for(int j = 0; j < bit; j++) a[i][bit-...
true
f3970f664f4dc0db25dddcc4f4fc5863992e19ea
C++
rahul-prasad-cse/Algorithms
/heapsort.cpp
UTF-8
1,201
3.203125
3
[]
no_license
#include <iostream> using namespace std; int main(){ int count; cout<<"Enter the number of elements you want to enter:\n"; cin>>count; int input[count]; for(int i=0;i<count;i++){ int temp; cin>>temp; if(i==0){ input[0]=temp; continue; } input[i]=temp; int j=i; while(input[(j-1)/2]<input[j] &&...
true
f46b175ae7f6360e337af3d61f27acea7e9e73cd
C++
mLenehan1/EE219-Object-Oriented-Programming
/Assignment 5/A5Q2/main.cpp
UTF-8
282
3.296875
3
[]
no_license
#include <iostream> using namespace std; bool isPowerOf(int num, const int base) { if(num%base == 0){ if(num/base == 1) return true; else return isPowerOf(num/base, base);} else return false; } int main() { cout << isPowerOf(32, 2); }
true
76d2b9b4a697de4bcefce059257ce2e8981d272f
C++
aaraki/CtCI
/Chapter_2/2.6_Palindrome/reverse.cpp
UTF-8
1,239
3.484375
3
[]
no_license
#include <iostream> #include <vector> #include <list> #include <stack> #include <queue> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <string> #include <algorithm> using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(nullp...
true