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
fd757bb8b2ab2f8b7f4d49540b7fa025bb5d7ca7
C++
pawcio16m/Randlab_app
/include/Rectangle.h
UTF-8
354
2.5625
3
[]
no_license
#pragma once #include <opencv2/core/mat.hpp> #include <opencv2/core/core.hpp> #include "IShape.h" class Rectangle : public IShape { public: Rectangle(cv::Point p1, cv::Point p2) : m_p1(p1), m_p2(p2) {} virtual ~Rectangle() = default; void drawMeInPict(cv::Mat&) override; private: cv::P...
true
24efa5cb0adf0678b6a6ff7a940cf661e43261f3
C++
kipa00/AplusB-mc
/compiler/main.cpp
UTF-8
4,519
2.640625
3
[]
no_license
#include <cstdio> #include "world.hpp" #include "analyze.hpp" #include "check.hpp" #include "color.hpp" const int BUFSIZE = 1048576; byte data[BUFSIZE]; void traverse_world(const world &w, std::function<void(int, int, int)> f) { int cx, cy, cz; for (cz=0; cz<32; ++cz) { for (cx=0; cx<32; ++cx) { for (cy=0; cy<...
true
9b0cd6b1cb6b736441cea37af9556435db5af329
C++
hannabizon/hannabizon
/zadania do wgrania c++/3I (1).cpp
UTF-8
807
3.359375
3
[]
no_license
#include <iostream> #include <string> using namespace std; int main () { int index_number; int term; string first_name; string last_name; string field_of_study; cout << "What is your first name?" << endl; cin >> first_name; cout << "What is your last name?"<< endl; cin >> last_name; cout << "What is ...
true
44ff0e57ae6c0d0be0a364c5cd77a89199a87948
C++
519984307/SimpleQTWebApp
/AppFramework/wellknown/appinfo.h
UTF-8
1,755
3.09375
3
[]
no_license
#ifndef APPINFO_H #define APPINFO_H #include <QtCore> class AppInfo { public: static AppInfo& getInstance() { static AppInfo instance; // Guaranteed to be destroyed. // Instantiated on first use. return instance; } QString g...
true
fa7efdf249eda80e7e7859c366f0ca3eef391bd3
C++
starplaton/Jaeho
/BOJ2170.cpp
UTF-8
647
2.65625
3
[]
no_license
#include <iostream>https://github.com/starplaton/Jaeho #include <algorithm> #include <utility> #include <cstdio> using namespace std; const int INF = 1e9 + 1; int main() { pair<int, int> map[1000000]; int N; scanf("%d", &N); for (int i = 0; i < N; i++) { int a, b; scanf("%d %d", &a, &b); map[i] = pair<int, i...
true
ec17d1241f1e67b7378ea31982d8406d4781610c
C++
f-schroeder/orvis
/lib/orvis/Material.cpp
UTF-8
4,629
2.890625
3
[ "MIT" ]
permissive
#include "Material.hpp" #include "Util.hpp" #include <imgui.h> Material::Material(glm::vec4 color, float roughness, float metallic, float ior) { setColor(color); setRoughness(roughness); setMetallic(metallic); setIOR(ior); } glm::vec4 Material::getColor() const { if (util::getBit(m_isTextureBitset...
true
b1a09856cb664d22f632ad9d224ac86d9d879e2d
C++
laity-slf/PTA
/PAT (Advanced Level) Practice/1102 Invert a Binary Tree.cpp
GB18030
1,647
3.28125
3
[]
no_license
#include<iostream> #include<cstdio> #include<queue> using namespace std; const int MAX = 110; struct Node{ int lchild, rchild; } node[MAX]; int n, num = 0; // ڵn, ڵnum bool notRoot[MAX] = { false }; void print(int id) { printf("%d", id); num++; if(num<n) printf(" "); else printf("\n"); re...
true
3e8e3e4aad5f313fb74e4a8a86ece22038346da1
C++
zhouyujt/daxia
/system/windows/find_window.h
GB18030
1,631
2.65625
3
[]
no_license
/*! * Licensed under the MIT License.See License for details. * Copyright (c) 2021 콭ĴϺ. * All rights reserved. * * \file find_window.h * \author 콭ĴϺ * \date ʮһ 2021 * * ڱ * */ #ifdef _WIN32 #ifndef __DAXIA_SYSTEM_WINDOWS_FIND_WINDOW_H #define __DAXIA_SYSTEM_WINDOWS_FIND_WINDOW_H #include <memory> #include "window.h" n...
true
ed8f2e5d7bf6749271b6b6ad32fb62bdbe3c13fd
C++
brupelo/opentoonz
/toonz/sources/toonz/versioncontrolwidget.cpp
UTF-8
7,821
2.65625
3
[ "BSD-3-Clause" ]
permissive
#include "versioncontrolwidget.h" #include <QLabel> #include <QVBoxLayout> #include <QSpinBox> #include <QTimeEdit> #include <QTextEdit> #include <QDateTimeEdit> #include <QRadioButton> //============================================================================= // DateChooserWidget //---------------------------...
true
56f2e107cade00001584c1cb49418f4b6a391e4a
C++
IIIcecream/icecream
/algorithm/include/recursion/WordSearch.h
WINDOWS-1252
435
2.78125
3
[]
no_license
#pragma once #include "IACM.h" #include <vector> #include <string> using namespace std; // class WordSearch : public IACM { public: WordSearch(vector<vector<char>>& board, string word) : m_board(board), m_sWord(word) {} virtual bool solve() override; private: bool exist(vector<vector<char>>& board, strin...
true
fe328a3ef0cca641c8bcdca334e4371483feb8a6
C++
sk7755/Algorithm
/src/Dynamic Programming/Optimal Binary Search Trees/Optimal_BST.cpp
UTF-8
1,759
3.078125
3
[]
no_license
#include <iostream> using namespace std; inline double MIN(double a, double b) { return a < b ? a : b; } void optimal_BST(int n,double* p, double* q, double** dp, int** path) { double *w = new double[n + 1]; w[0] = 0; for (int i = 1; i <= n; i++) w[i] = w[i - 1] + p[i] + q[i]; for (int i = 1; i <= n+1; i++)...
true
b30f39dcf21e9d0edde24ae0e81c029164ca9b70
C++
daxingyou/ysz
/YSZSever-master/Server/library/GDK/Timer/TimerMgr.h
UTF-8
2,344
2.625
3
[]
no_license
/***************************************************************************** Copyright (C), 2012-2100, ^^^^^^^^. Co., Ltd. 文 件 名: TimerMgr.h 作 者: Herry 版 本: 1.0 完成日期: 2012-9-24 说明信息: 计时管理器, 单线程版本, 限制在Word线程内使用 *****************************************************************************/ #pragma once #i...
true
836f1fc25d48bb91d1d5131d66c84cd15ad28b3b
C++
vikashkumarjha/missionpeace
/lc/lc/2021_target/core/binary_search/lc_352_data_stream_as_disjoint_sets.cpp
UTF-8
1,636
3.515625
4
[]
no_license
/* Given a data stream input of non-negative integers a1, a2, ..., an, ..., summarize the numbers seen so far as a list of disjoint intervals. For example, suppose the integers from the data stream are 1, 3, 7, 2, 6, ..., then the summary will be: [1, 1] [1, 1], [3, 3] [1, 1], [3, 3], [7, 7] [1, 3], [7, 7] [1, 3], [6...
true
2a007195ec5d4634deb7645384024abe5de493c4
C++
hzqtc/zoj-solutions
/src/zoj1823.cpp
UTF-8
501
2.640625
3
[]
no_license
#include <cstdio> #include <cmath> using namespace std; int main() { typedef long long lint; lint num,i,upbond; while(scanf("%lld",&num) , num > 0) { i = 2; upbond = (lint)sqrt((double)num); while(num >= i && i <= upbond) { if(num % i) { if(i == 2) i++; else i...
true
89c0d0d566b5d3b43da2319509e5e8b0766babe8
C++
tgxworld/CS1020E
/tutorials/6/List.cpp
UTF-8
3,552
3.40625
3
[]
no_license
#include <iostream> #include <sstream> #include "List.h" using namespace std; List::List(int skipInt) { this->_size = 0; this->_head = NULL; this->_skipInt = skipInt; } KListNode* List::traverseTo(int index) { if(index < 0 || index > this->_size) { return NULL; } else { KListNode* ptr; ptr = th...
true
53abb734a696668cca85c2e9478f1723e0d3188c
C++
BrinkOfMan/Software-Design
/hw10/steps.cpp
UTF-8
1,175
3.203125
3
[]
no_license
#include"../react.h" int func(int arg) { arg = arg + 2; return arg; } int funcp(int *argp) { *argp = (*argp) + 2; return *argp; } int main () { int i = 17; double f = -4.2; int *ip = &i; double *fp = &f; print("Initial values: i is {i}, *ip is {ip}, f is {f}, *fp is {fp}\n", {{"i",i},{...
true
667bcaabfcacb8b1c2ca2c0dc665b95074db6e1c
C++
griels/gojsonsm
/src/cpp/rc4.cpp
UTF-8
2,125
2.515625
3
[]
no_license
std::string KeySizeError::_ErrorByValue() { return "crypto/rc4: invalid key size " + strconv::Itoa(int(this)); } std::tuple<Cipher *, moku::error> NewCipher(moku::slice<uint8_t> key) { Cipher c{}; uint8_t j{0}; int k{0}; k = len(key); if (k < 1 || k > 256) { return {nil, KeySizeError(k)...
true
b9f80489b8b299eb37835d7ef19088b98726f66b
C++
welldias/stonedb
/src/data/code_list_adapter.h
UTF-8
3,674
2.90625
3
[]
no_license
#ifndef __PROJECT_STONE_DATA_CODELISTADAPTER_H__ #define __PROJECT_STONE_DATA_CODELISTADAPTER_H__ #include <string> #include <vector> #include <cstdint> #include "list_data_provider.h" #include "list_data_provider_helper.h" #include "../oci20/oci20.h" namespace Data { struct CodeEntry { std::string own...
true
cc8418749dc23fe72d27a58f3c5e3eb8b5837682
C++
wiliamhw/Data-Structure-Course
/Cpp/PFinal/ToT.cpp
UTF-8
644
3.0625
3
[]
no_license
// https://www.hackerrank.com/contests/final-sd-2020/challenges/train-of-thought #include <iostream> #include <cstring> using namespace std; const int maxSize = 100000000; int main(void) { bool *arr = new bool[maxSize]; memset(arr, false, sizeof(bool) * maxSize); int N; cin >> N; while (N-- > 0...
true
abac6103de936f38c4b4f246b6f695936220b64c
C++
bromlu/CPong
/menu.hpp
UTF-8
2,894
2.90625
3
[]
no_license
class Menu { public: Menu(int width, int height, sf::Font *font) { loadAssets(); this->width = width; this->height = height; this->selected = 0; this->lastMoved = now(); this->lastSelected = now(); title = Text("Spike Pong", width/2, height/5, 150, font,...
true
bb86a4c826059dbdf4b36bcedcd08b869af7509e
C++
ryanchengguo/C-Plus-Plus-Application-Development-1
/Exercise 6.26/Exercise 6.26/main.cpp
UTF-8
1,143
3.578125
4
[]
no_license
// // main.cpp // Exercise 6.26 // // Created by Ryan Guo on 5/25/19. // Copyright © 2019 Ryan Guo. All rights reserved. // #include <iostream> #include <iomanip> using namespace std; double celsius(double f); double fahrenheit(double c); int main() { cout << fixed << setprecision(1); cout << setw(5...
true
2a618c06a915fa9ee4c34064cc30de122f4f009b
C++
lazybones1/Algorithms
/백준알고리즘/단계별로 풀어보기/18. 스택/P_Number_10773.cpp
UTF-8
465
2.84375
3
[]
no_license
#include <iostream> #include <stack> using namespace std; int main() { ios::sync_with_stdio(false); cout.tie(NULL); cin.tie(NULL); int k; cin>>k; int ans = 0; stack<int> s; for(int i = 0; i<k; i++){ int command; cin>>command; if(command == 0){ s.pop(); } else{ s.push(comm...
true
7abf3dc1d9c7fbf3b2f06577110a98eba77f5d1e
C++
Jackbenfu/Jackbengine
/src/component/generic/stringComponent.hpp
UTF-8
611
2.546875
3
[]
no_license
// // stringComponent.hpp // jackbengine // // Created by Damien Bendejacq on 31/07/2017. // Copyright © 2017 Damien Bendejacq. All rights reserved. // #ifndef __STRING_COMPONENT_H__ #define __STRING_COMPONENT_H__ #include <string> #include "component/component.hpp" namespace Jackbengine { class StringComponent : p...
true
2c56cea1c9026df9ec17496bf66eca619cfefcb3
C++
prolog/shadow-of-the-wyrm
/engine/calculators/source/unit_tests/PhysicalDamageCalculator_test.cpp
UTF-8
5,354
2.984375
3
[ "MIT", "Zlib" ]
permissive
#include "gtest/gtest.h" CreaturePtr create_creature_with_weapon_and_15_str(); CreaturePtr create_creature_with_weapon_and_15_str() { CreaturePtr creature = std::make_shared<Creature>(); creature->set_strength(15); ItemPtr weapon_item = ItemPtr(new MeleeWeapon()); Damage damage(3,4,2,DamageType::DAMAGE_TYPE...
true
ffad0b571bea70e636ae32eac404a0aceb51c382
C++
vidit-virmani/CP
/vidit_123/codeforces/479-C/479-C-36733580.cpp
UTF-8
778
2.6875
3
[]
no_license
#include<bits/stdc++.h> using namespace std; struct node{ int ff; int ss; }q[5005]; bool cmp(node A,node B){ if(A.ff==B.ff){ return A.ss<B.ss; } return A.ff<B.ff; } int main(){ //1st attempt to understand the question :p int n; cin>>n; for(int i=0;i<n;i++){ cin>>...
true
cafb818c29cb2828eb57867a432677271c20a23d
C++
itstechgaurav/cpp-term-work
/q14.cpp
UTF-8
2,166
3.28125
3
[]
no_license
#include<iostream> #include<stdlib.h> using namespace std; char sname[10][10]; class student { int id,age,i; char name[10], g; float marks[5], avg, total; void calc() { total = 0; for(i = 0; i < 5; i++) { total+=marks[i]; } avg = total/5; // grades...
true
b8eea41fec1ec69b9de527e06fbcbddb61f2ecfb
C++
HeElLyan/homeworkMPI
/Task11.cpp
UTF-8
1,944
2.65625
3
[]
no_license
//// //// Created by He Elvina on 29.09.2020. //// // //#include <mpi.h> //#include <iostream> // //using namespace std; // //// Циклическая передача данных (6 баллов) //// В коммуникаторе передаем сообщение от одного //// процесса другому с нулевого до size-1. //// Последний процесс отправляет сообщение нулевому. ///...
true
bcad5be66c00c0628f5b19ebb993f318c74cc987
C++
UTennessee-JICS/MPCC
/src/MPCC.cpp
UTF-8
32,415
2.890625
3
[]
no_license
//Pearsons correlation coeficient for two vectors x and y // r = sum_i( x[i]-x_mean[i])*(y[i]-y_mean[i]) ) / // [ sqrt( sum_i(x[i]-x_mean[i])^2 ) sqrt(sum_i(y[i]-y_mean[i])^2 ) ] // Matrix reformulation and algebraic simplification for improved algorithmic efficiency // where A is matrix of X vectors and B is tran...
true
370b908e661be38f38698780c006187adb5abdcf
C++
Douraid-BEN-HASSEN/BTS
/CTraitementImage/CTraitementImage.cpp
UTF-8
642
2.921875
3
[]
no_license
// CTraitementImage.cpp : Définit le point d'entrée pour l'application console. // #include "CTraitements.h" int main() { Mat image; image = imread("Image9Balles.png", IMREAD_COLOR); if (image.empty()) { cout << "Impossible de trouver l'image" << endl; } Mat image_base = image.clone(); CTrait...
true
1b19f3d63ee05fd4c4f6c1e746316d506b8b79a2
C++
dhillonsh/cis431-project
/conv_layer.cpp
UTF-8
2,859
3.296875
3
[]
no_license
#include <iostream> #include <vector> double calculate_block(std::vector<std::vector<std::vector<int>>> input, std::vector<std::vector<double>> filter, int row, int col, int stride) { int i, j; int input_row_start = row + stride - 1; int input_row_end = input_row_start + filter.size(); int input_col_sta...
true
3113e9bd5cd749b0f8dd70575c29dfc649218222
C++
kyle45/easy_threadpool
/task.h
UTF-8
225
2.546875
3
[]
no_license
#ifndef TASK_H_ #define TASK_H_ class Task { public: Task(void* _arg):arg(_arg){}; virtual ~Task(){} virtual void* func(void *) = 0; //interface void run(){func(arg);}; protected: void* arg; // parameter }; #endif
true
e50e16f216f82b45328cbaaa2a33a917057c7e6e
C++
mkuric/SeismicDemo
/geolib/csFlexHeader.cc
UTF-8
12,113
2.984375
3
[]
no_license
#include <cstring> #include <cstdio> #include <cstdlib> #include "csFlexHeader.h" #include "csException.h" using namespace cseis_geolib; const int csFlexHeader::MIN_BYTE_SIZE = 8; csFlexHeader::csFlexHeader() { init(); myByteSize = MIN_BYTE_SIZE; myValue = new char[myByteSize]; myType = TYP...
true
687ea8d51b6f040cb5c96a8c2ec125c48585e246
C++
DmitrySyr/diff_tasks
/otus_task_12/thread_wrapper.h
UTF-8
676
3.34375
3
[]
no_license
#ifndef TH_WRAPPER_H_INCLUDED #define TH_WRAPPER_H_INCLUDED #include <thread> class thread_wrapper{ std::thread this_thread{}; public: thread_wrapper() = delete; thread_wrapper( const thread_wrapper& ) = delete; thread_wrapper( thread_wrapper&& old_thread ) { if( this != &old_thread ) ...
true
e3e9873e414c6dd2f5fb5dc7bb0695c99704e671
C++
Sopel97/conference_db_gen
/conference_database_gen/src/ConferenceDatabase/Tables/Country.cpp
UTF-8
438
2.5625
3
[]
no_license
#include "ConferenceDatabase/Tables/Country.h" #include "Csv/CsvRecord.h" Country::PrimaryKeyType Country::primaryKey() const { return m_countryId; } Record::IdType Country::countryId() const { return m_countryId; } const std::string& Country::countryName() const { return m_countryName; } CsvRecord Cou...
true
d415dc05e5419bcf30d2d7274c8959d8448d9b08
C++
wangjunjie1107/CodeTesting
/C++/96_黑马_类模板做函数参数.cpp
GB18030
1,104
3.5625
4
[]
no_license
#define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<string> using namespace std; //ģ ҲʹĬϲ template<class T1, class T2> class Person { public: Person(T1 name, T2 age) { this->m_Age = age; this->m_Name = name; } void showPerson() { cout << ": " << this->m_Name << " 䣺 " << this->m_Age << endl; } ...
true
75336652d3c5fee75986dbc375c6052cde1ade99
C++
TKscoot/Dodo-Engine
/Dodo-Engine/code/entity/Entity.h
UTF-8
2,193
2.65625
3
[ "MIT" ]
permissive
#pragma once #include "dodopch.h" #include "components/ECS.h" #include "components/Transform.h" namespace Dodo { namespace Entity { class CEntity { public: CEntity(); CEntity(std::string _name); ~CEntity() {} void Update() {} void Destroy() { m_bActive = false; } //template<typename T> ...
true
d2bdcbf1f4b3e08663d3c0488f5b568b505de339
C++
vittorioromeo/Experiments
/Random/Old/testRange.cpp
UTF-8
1,167
3.5625
4
[ "AFL-3.0", "AFL-2.1", "LicenseRef-scancode-unknown-license-reference" ]
permissive
#include <iostream> #include <vector> #include <iterator> #include <utility> #include <tuple> template <typename TItr> class Range { private: TItr itrBegin, itrEnd; public: inline constexpr Range(const TItr& mItrBegin, const TItr& mItrEnd) noexcept : itrBegin{mItrBegin}, itrEnd{mItrEnd} ...
true
50c11c42ed7982be805a5c29440933b45eba4f7f
C++
dpnom/opencv
/samples/cpp/travelsalesman.cpp
UTF-8
2,662
3.234375
3
[ "BSD-3-Clause" ]
permissive
#include <opencv2/opencv.hpp> using namespace std; using namespace cv; void DrawTravelMap(Mat &img, vector<Point> &p, vector<int> &n); class TravelSalesman : public ml::SimulatedAnnealingSolver { private : vector<Point> &posCity; vector<int> &next; RNG rng; int d0,d1,d2,d3; public: TravelSalesm...
true
9f15cd48a4938aaa0326bd1477d0ccb12914e8be
C++
manalarora/coding-blocks-online-questions
/recurssion/recurssionSubsequence.cpp
UTF-8
694
3.265625
3
[]
no_license
#include<iostream> #include<set> #include<cstring> #include<cmath> using namespace std; void subsequences(char *in,char *out,int i,int j,set<string> &s){ //Base Case if(in[i]=='\0'){ out[j] = '\0'; cout<<out<<" "; //string temp(out); //Create a string object //s.insert(temp); //insert into set s return;...
true
04eb2e58866f5a400da647bed190548fef8992c3
C++
vehiclecloud/CS218-CarTorrent
/src/CodingPacket.h
UTF-8
2,256
2.671875
3
[]
no_license
/* * CodingPacket.h * * Created on: Dec 3, 2017 * Author: Reggie */ #ifndef SRC_CODINGPACKET_H_ #define SRC_CODINGPACKET_H_ #include "NetworkCodingMessage_m.h" class CodingPacket { public: CodingPacket(std::string pid, NetworkCodingMessage* ncm, simtime_t ts) { m_pac...
true
5df6f905c61146cf4fb027f1bd53ed2a747c2d09
C++
mad0/NewSurvi
/Survival/GUISlot.cpp
UTF-8
397
2.53125
3
[]
no_license
#include "GUISlot.h" GUISlot::GUISlot() { //std::cout << "Tworze slot...\n"; //slotItem = nullptr; //empty = true; //slot.setFillColor(sf::Color::Green); //slot.setSize(sf::Vector2f(62, 64)); } GUISlot::~GUISlot() { //delete slotItem; } void GUISlot::setPosition(int _x, int _y) { slot.setPosition(_x, _y); } ...
true
fb38dee43dc4e3f4e877902ef1f3d598aa863df2
C++
missdeer/WinCopy
/Exception.h
UTF-8
575
2.828125
3
[ "MIT" ]
permissive
#pragma once namespace ex { class WinException : public std::runtime_error { public: explicit WinException(const char* const what, const DWORD error = ::GetLastError()) : runtime_error(std::string(what) + ", error = " + std::to_string(error)) { } }; tem...
true
5a3af3ea4f5ea34cb975258d09381ce382e76295
C++
jwvg0425/boj
/solutions/3058/3058.cpp11.cpp
UTF-8
482
2.796875
3
[]
no_license
#include <stdio.h> #include <algorithm> #include <vector> #include <string> #include <iostream> #include <stack> #include <math.h> #include <memory.h> #include <queue> void solve() { int min = 987654321; int sum = 0; for (int i = 0; i < 7; i++) { int k; scanf("%d", &k); if (k % 2 != 0) continue; min ...
true
620ddf98e745bdd92d66291ee7adb2a15ed20f57
C++
otomarukanta/3docr
/include/blob_extracter.h
UTF-8
499
2.65625
3
[]
no_license
#include <vector> #include <opencv2/opencv.hpp> #include "blob.h" #include "labeling.h" class BlobExtracter { public: BlobExtracter(unsigned int w, unsigned int h) : width(w), height(h) { label_img = new unsigned int[w * h]; labeling = new Labeling(w, h); }; ~BlobExtracter() { delete [] label_img; delete la...
true
3541debd700ff8b9a08d82070d58b3cef59a5cfa
C++
Codeon-GmbH/mulle-clang
/test/CXX/temp/temp.constr/temp.constr.constr/function-templates.cpp
UTF-8
1,933
3.03125
3
[ "Apache-2.0", "LLVM-exception", "NCSA" ]
permissive
// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s template<typename T> constexpr bool is_ptr_v = false; template<typename T> constexpr bool is_ptr_v<T*> = true; template<typename T, typename U> constexpr bool is_same_v = false; template<typename T> constexpr bool is_same_v<T, T> = true; template<typename T> requires...
true
f1693702f4a116918fd60d2a650f0e30406f4164
C++
julian533/PeTRA
/petra_central_control/include/petra_central_control/CCUState.h
UTF-8
826
3
3
[]
no_license
#pragma once #include <petra_central_control/default.h> class CCUState { public: enum Value { uninitialized = 0, initialized = 1, active = 2, finished = 3 }; CCUState(Value value) : value_(value) {} CCUState() : CCUState(uninitialized) {} operator Value() cons...
true
e21302857b3b55c85c22c69b9d06af5bdd6a43d2
C++
joaoabcoelho/euclid
/src/test.cxx
UTF-8
637
3.140625
3
[]
no_license
#include <iostream> #include <ctime> #include <math.h> using namespace std; int main(){ float d; float x = 1; float y = 20; int trials = 1e8; clock_t startTime = clock(); for(int i=0; i<trials; i++){ d = sqrt(x*x + y*y); } clock_t endTime = clock(); clock_t clock...
true
45710de85574e3cda43d1e4b6163ad219b1048d6
C++
CatBatRat/cis161cpp
/week5/peer_review/Kalafus/hackenbush.h
UTF-8
2,894
2.890625
3
[]
no_license
/* * Author: Jame J Kalafus * Date: 02018-10-08 * Description: CS161+ Week 3 homework demonstrating sequence and selection. */ #include <iostream> #include <limits> #include <cmath> #ifndef HACKENBUSH_H #define HACKENBUSH_H #ifndef CONST #define CONST const short int QUIT = 0; const short int INVALID = -1; c...
true
5cc74fcf790a3b0a3787501bd64941d8832fad07
C++
Gchenzhiyang/LP5562-RK
/src/LP5562-RK.h
UTF-8
39,217
3.234375
3
[ "MIT" ]
permissive
#ifndef __LP5562_RK_H #define __LP5562_RK_H // Repository: https://github.com/rickkas7/LP5562-RK // License: MIT #include "Particle.h" /** * @brief Class for programming the LP5562 directly * * You'll need to read the datasheet to understand this, probably. There are a bunch of hardware * limitations and a very ...
true
04702df8d6d4179f8761b76df2971c49c3bf3582
C++
JpSilver/Headguard-of-Binding-Worlds
/Headguard-of-Binding-Worlds/ModelHandler.h
UTF-8
319
2.625
3
[]
no_license
#ifndef MODELHANDLER_H #define MODELHANDLER_H #include <vector> #include "Model.h" using std::vector; class ModelHandler{ public: ModelHandler(){}; Model *addModel(Model model); Model *getModel(string name); Model *getModel(int index); int getSize(); private: vector<Model> models; }; #endif //MODELHANDLER_H
true
9822ed6a52ed2db62a9ba6b5eb46747cb97d760a
C++
aliceyang16/Software_Labs
/Lab01 - 597609, 453828/Exercise 5 - Stop_Watch/StopWatch.cpp
UTF-8
874
3.515625
4
[]
no_license
#include <iostream> #include <time.h> #include <StopWatch.h> using namespace std; StopWatch::StopWatch() // Constructor { } // Starts the StopWatch when a request for it to start has been made bool StopWatch::startStopWatch(char& button) { bool start = false; if((button == 's') || (button == 'S')) { st...
true
e47b34385a99891b2ab28c932c366f9ca087806d
C++
tuan9999/Containers
/tests/map_tests.cpp
UTF-8
8,374
3.53125
4
[]
no_license
// // Created by Tuan Perera on 27.02.21. // #include <map> #include "gtest/gtest.h" #include "../library.h" TEST(MapTest, ConstructorTests) { std::string str = "Mapped"; ft::map<int, std::string> mf1; std::map<int, std::string> ms1; mf1.insert(ft::pair<int, std::string>(16, str)); ms1.insert(std::pair<int, std:...
true
7e4c18857c24a7e8d0b39ffc796be294644e187a
C++
stroupo/hash-maps
/tests/ranges.cc
UTF-8
1,183
3.34375
3
[]
no_license
#include <doctest/doctest.h> #include <iostream> #include <iterator> #include <type_traits> using namespace std; template <typename T, bool Constant> struct range_iterator { range_iterator(T n) : n_{n} {} range_iterator& operator++() { return (++n_, *this); } T operator*() const { return n_; } bool operato...
true
7359e619cd9656c1a287c08fc0809e9e9369e493
C++
wafemand/list-testing
/postnikova_anastasia.h
UTF-8
6,743
3.53125
4
[]
no_license
#ifndef LIST_MY_LIST_H #define LIST_MY_LIST_H #include <memory> #include <list> template <typename T> struct my_list { private: struct node_without_data { node_without_data *left; node_without_data *right; node_without_data() : left(nullptr), right(nullptr) {} node_without_data(...
true
664c1eebbcf6664bc935adc5fd244499c95a816e
C++
ANARCYPHER/coding-interview-solutions
/src/cpp/binary-tree-next-pointers/bst.cpp
UTF-8
3,541
4.25
4
[]
no_license
/** * Given a binary tree: * * struct TreeLinkNode { * TreeLinkNode *left; * TreeLinkNode *right; * TreeLinkNode *next; * } * * Populate each next pointer to point to its next right node. If there is no * next right node, the next pointer should be set to NULL. * * Note: each "pointer" is already init...
true
7112fb40bc70c61dd8b01c3d35a8cc16b0806a32
C++
Andrey562895/ADS-4
/test/tests.cpp
UTF-8
771
2.828125
3
[]
no_license
#include "gtest/gtest.h" #include <string> #include "tpqueue.h" TEST(lab4,test1_1) { TPQueue<SYM> pqueue; pqueue.push(SYM{'a',4}); pqueue.push(SYM{'b',7}); SYM c1=pqueue.pop(); SYM c2=pqueue.pop(); ASSERT_EQ(c1.ch,'b'); ASSERT_EQ(c2.ch,'a'); } TEST(lab4,test1_2) { TPQueue<SYM> pqueue;...
true
85c59fd741372916d3c4c60e790a76894a253f4e
C++
AnantaYudica/simple
/include/iter/RandomAccess.h
UTF-8
12,687
2.53125
3
[ "MIT" ]
permissive
#ifndef ITERATOR_RANDOM_ACCESS_H_ #define ITERATOR_RANDOM_ACCESS_H_ #include <iterator> #include "../id_const/Validation.h" #include "../Handle.h" #include "../Iterator.h" #include "Bidirectional.h" namespace simple { namespace iter { struct RandomAccessIDConst : simple::iter::BidirectionalIDCons...
true
ea953fd8d2957d78a6f1839df529438603a11072
C++
dw-liedji/Cours-alogrithme-et-poo
/exams/code/l1.cpp
UTF-8
342
3.796875
4
[ "MIT" ]
permissive
#include <iostream> using namespace std; class calculer { int x, y; public: void val(int, int); int somme() { return (x + y); } }; void calculer::val(int a, int b) { x = a; y = b; } int main() { calculer calculer; calculer.val(5, 10); cout << "La somme = " << calculer.so...
true
a87d6ba01b48c6d540518f9dcee5e61dafd6b096
C++
pmusau17/carma-utils
/carma_utils/include/carma_utils/timers/Timer.h
UTF-8
2,404
3.03125
3
[ "Apache-2.0" ]
permissive
#pragma once /* * Copyright (C) 2020-2021 LEIDOS. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
true
95e1a4129be89bcc9f0322be95feca8c4b7ef334
C++
llGuy/msdev
/cpp/gl_math/vector_output.h
UTF-8
628
2.8125
3
[]
no_license
#ifndef VECTOR_OUTPUT_HEADER #define VECTOR_OUTPUT_HEADER #include <algorithm> #include <iostream> #include <iterator> #include "vector.h" #include "matrix.h" template<typename _Ty, uint32_t _Dm> std::ostream& operator<<(std::ostream& os, vec<_Ty, _Dm>& v) { std::copy(v.Begin(), v.End(), std::ostream_it...
true
4281a1d06f240235ef0dbd1f8fb8280c6a922e0e
C++
changtingwai/leetcode
/House Robber/House Robber/源.cpp
UTF-8
486
2.953125
3
[]
no_license
#include <iostream> #include <stdlib.h> #include <vector> using namespace std; class Solution { public: int rob(vector<int>& nums) { if(nums.size()==0) return 0; int i; int dp[100]; dp[0]=nums[0]; dp[1]=max(nums[0],nums[1]); for(i=2;i<nums.size();i++) dp[i]=max(nums[i]+dp[i-2],dp[i-1...
true
ef129c9915097a80a34a2ff5377d15a4e4d5da76
C++
jitingcn/c_study
/codes/c++ primer plus/3.7.1 身高单位转换.cpp
UTF-8
570
4
4
[]
no_license
// 3.7.1 // 用户使用一个整数指出自己的身高(单位为英寸),然后将身高转换为英尺和英寸. // 使用下划线字符指示输入位置.并使用一个const符号常量来表示转换因子 // 1 foot = 12 inch #include <iostream> using namespace std; int main(){ const int inch = 12; int inchs; int in; int ft; cout << "Please enter your height:______(in)\b\b\b\b\b\b\b\b\b\b"; cin >> inchs; ...
true
34a233c438676e3d0c4bc6f27c28d4f16072240d
C++
ggyool/study-alone
/ps/boj_cpp/11576.cpp
UTF-8
493
2.6875
3
[]
no_license
#include <iostream> #include <vector> using namespace std; int main(void){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int a, b, n; cin >> a >> b >> n; int sum=0, num; for(int i=0; i<n; ++i){ cin >> num; sum = sum*a + num; } vector<int> v; whi...
true
0858cdb7f7424f444cff0accfb539aabb58f9695
C++
krupa852/Decision_Tree
/decision_tree.cpp
UTF-8
17,004
2.703125
3
[]
no_license
#include <unordered_map> #include <set> #include <list> #include <algorithm> #include<iostream> #include <cmath> #include <vector> #include <fstream> #include <sstream> #include<map> #include <string> class node; using namespace std; vector<string> Attributes; vector<int> attribute_num; int attribute_no =0; //find bi...
true
26f48f4b6b4100c4f7cca6a07f70d91a8b425280
C++
lygztq/mdfs
/include/mdfs/common/writable.hpp
UTF-8
711
2.75
3
[]
no_license
#ifndef MDFS_COMMON_WRITABLE_HPP_ #define MDFS_COMMON_WRITABLE_HPP_ #include <iostream> #include <string> #include <fstream> namespace mdfs { namespace common { // can (store to/load from) disk using fstream struct WritableInterface { virtual void store(std::ofstream & ofs) const = 0; virtual void load(std:...
true
3a77082e0d9d2ff1b8ba75ce68393265dbf860b0
C++
InamulRehman/CplusplusPrograms
/Input_Output/Dividing/divide.cpp
UTF-8
419
3.359375
3
[ "MIT" ]
permissive
#include <iostream> using namespace std; int main () { int dividend, divisor, quotient, remainder; cout << "Enter Dividend: " << flush; cin >> dividend; cout << "Enter Divisor " << flush; cin >> divisor; quotient = dividend/ divisor; remainder = dividend % divisor; cout << "Quotient i...
true
7f42da5a6a42823f8669f433e489886b9db840e2
C++
dcastro123/PiscineCPP
/d01/ex00/Pony.hpp
UTF-8
385
2.90625
3
[]
no_license
#ifndef PONY_HPP # define PONY_HPP # include <string> # include <iostream> class Pony { public: Pony(); ~Pony(); void setBreed(std::string); void setName(std::string); void setColor(std::string); std::string getBreed(void); std::string getName(void); std::string getColor(void); private: std::str...
true
0a3bc331524b18d2dd04bb4b1f4fa65aa4a45b6e
C++
ClaudiaVisentin/eeros-framework
/test/control/saturation/SaturationTestContainer.cpp
UTF-8
4,146
2.78125
3
[ "Apache-2.0" ]
permissive
#include <eeros/control/Saturation.hpp> #include <iostream> #include <random> #include <climits> #include <ctime> #include <functional> #include <type_traits> #include <array> #include "../../Utils.hpp" template <typename C, typename T, unsigned int N> class SaturationBlockTest { public: SaturationBlockTest() : r...
true
1966d6b975770d3fdeace8c46c244b385ff532bb
C++
thecheebo/Cpp-Code-Samples
/SampleProblems/InDJarrMakeuptreenode.cpp
UTF-8
996
2.921875
3
[]
no_license
You have the DSNode class shown on page 8 of the exam, as well as the Array class shown on page 9 of the exam. You want to write a function makeTrees, which has one parameter, an Array<int> named sets. This array will be indexed from 1 through sets.size(), representing a collection of disjoint sets implemented with uni...
true
abfea1c3fd86f146980ae32fecbfb8fd95d3b8ba
C++
PratAm/Program
/c++/diamond1.cpp
UTF-8
781
3.484375
3
[]
no_license
#include<iostream> using namespace std; class Base { public: void doSomething(){} }; class Derived1:public virtual Base { public: void doSomething(){} }; class Derived2:public virtual Base { public: void doSomething(){} }; class Base1 { public: virtual void doSomething(){...
true
166c29926bfe6ce633444f807ad0812e9fbe7ff8
C++
jaishreedhage/Competitive-coding
/G4G/flattening_a_linked_list.cpp
UTF-8
1,027
3.5625
4
[]
no_license
/* Node structure used in the program struct Node{ int data; struct Node * next; struct Node * bottom ; }; */ /* Function which returns the root of the flattened linked list. */ Node *flatten(Node *root) { // Your code here Node *t1 = root->next, *t2, *t3, *prev, *t5; while(t1!=NULL){ ...
true
7bfc078ff89d051f4ae8e9055de9e624616e77f8
C++
nyChers/ACM-Learning
/exercises/枚举法/2.吹气球.cpp
UTF-8
1,065
3.140625
3
[]
no_license
#include<iostream> #include<cmath> #include <vector> #define PI 3.14 using namespace std; struct ball { int x; int y; int z; double r; // ball(){ // x=0;y=0;z=0; // } ball(int a,int b, int c){ x = a; y = b; z = c; r = 0.0; } }; int main() { int n; cin>>n; int x1,x2,y1,y2,z1,z2; cin>>x1>>y1>>z1; cin...
true
1ea018258b6b80870155bd6046c3b3ac368cc7e0
C++
VAMK-embedded-project-2019A/Development-Board-Application
/src/buttonpoll.cpp
UTF-8
1,953
3
3
[]
no_license
#include "buttonpoll.h" #include <iostream> #include <chrono> #include <thread> #include <unistd.h> // lseek() #include <poll.h> // poll() ButtonPoll::~ButtonPoll() { for(auto &button : _buttons) close(button._fd); } void ButtonPoll::addButton(uint8_t pin, TriggerEdge edge) { _buttons.push_back(Button(pin, stat...
true
928cb1a7c97449656f10caf966c61781463a88a3
C++
niti1987/Quadcopter
/Libraries/Rim Sound/include/rim/sound/util/rimSoundMIDIInputStream.h
UTF-8
6,672
2.578125
3
[]
no_license
/* * rimSoundMIDIInputStream.h * Rim Sound * * Created by Carl Schissler on 5/30/13. * Copyright 2013 __MyCompanyName__. All rights reserved. * */ #ifndef INCLUDE_RIM_SOUND_MIDI_INPUT_STREAM_H #define INCLUDE_RIM_SOUND_MIDI_INPUT_STREAM_H #include "rimSoundUtilitiesConfig.h" #include "rimSoundMIDIMessag...
true
f1a5a4694fbd583d4362265a7a531f103c04cb75
C++
Leesuhuck/C-
/Bank.h
UHC
3,803
3.578125
4
[]
no_license
#pragma once #include <string> #include <iostream> class Bank { private: int ParsonOneMoney; std::string ParsonOneID; public: void deposit(std::string id); //Ա void withdraw(void); // void balance(void); // ܾ //? Bank(int Money, std::string ID) { ParsonOneMoney = Money; ParsonOneID ...
true
27bc7c21eaa1110fdf629f65bf663ae86fb6f510
C++
parmj/MysticalEscapadeMUD
/lib/combat/src/CombatManager.cpp
UTF-8
4,868
3
3
[ "MIT" ]
permissive
#include "CombatManager.h" CombatManager::CombatManager(){} Combat& CombatManager::createCombat(const std::string& player1Name, const std::string& player2Name) { Combat newCombat{player1Name, player2Name}; this->combatList.emplace_back(newCombat); return combatList.back(); } void CombatManager::deleteCo...
true
b2d99d109394dbd8438366c8999ca5367d184e35
C++
masterchef2209/coding-solutions
/codes/spoj/BITMAP.cpp
UTF-8
718
2.546875
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n,m; cin>>n>>m; int arr[n][m]; vector< pair<int,int> >pp; for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { char a; cin>>a; arr[i][j]=a-'0'; if(arr[i][j]==1) pp.push_back(make_pa...
true
3d92dda6bfd867866e1e23b35904b507cd2bd410
C++
Hannibal96/Network-Load-Balanace-Project
/main.cpp
UTF-8
20,658
2.671875
3
[]
no_license
// // Created by Neria on 06/08/2019. // #include "defs.h" #include "Server.h" #include "Dispacher.h" #include "Job.h" #include "JBuffer.h" #include <iomanip> #define VEC_SIZE 1000000 using namespace std; /*************************************************** **************** declerations ******************** *****...
true
7587776e3355474fd05ea8f7b9910b14ddae4adf
C++
LeeWooSang/Server_Programming
/숙제 1번/SimpleGame/SimpleGame/Player.cpp
UTF-8
1,611
2.8125
3
[]
no_license
#include "stdafx.h" #include "Player.h" #include "Renderer.h" Player::Player() : GameObject(), m_HpBar_width(0), m_HpBar_height(0), m_Speed(0), m_TextureID(0) { } Player::~Player() { } void Player::ProcessInput() { if (GetAsyncKeyState(VK_RIGHT) & 0x0001) m_X += 100; //if (GetAsyncKeyState(VK_RIGHT) & 0x8000) ...
true
83dd27dc51b7aadcd79837e7f68dac90aad9384d
C++
pyettra/tecprog_3
/Pessoa.cpp
UTF-8
1,699
3.59375
4
[]
no_license
#include <stdio.h> #include <string.h> #include "Pessoa.h" #include <iostream> using std::cout; using std::endl; // Não colocamos o valor default na implementação do método, apenas na assinatura que consta no header da classe Pessoa::Pessoa(int diaN, int mesN, int anoN, char* nome) { diaP = diaN; mesP = mesN...
true
0e4ac5653c8c5b2b0fe1a16b55e0a9a016283c3a
C++
LockieJames/ap-assignment2
/starter_code/Menu.cpp
UTF-8
9,085
3.390625
3
[]
no_license
#include "Menu.h" Menu::Menu(){ } Menu::~Menu() { } /* * Beginning message welcoming players to Qwirkle. */ void Menu::startMessage() { std::cout << "\n" << "Welcome to Qwirkle!" << std::endl; std::cout << "-------------------" << std::endl; } /* * Shows list of options available to user. */ void Men...
true
ee5f4570dc7491b6e4d5b5ecc1813621ed9b0d6c
C++
insertinterestingnamehere/libdynd
/tests/types/test_tuple_type.cpp
UTF-8
2,699
2.625
3
[ "BSL-1.0", "BSD-2-Clause" ]
permissive
// // Copyright (C) 2011-16 DyND Developers // BSD 2-Clause License, see LICENSE.txt // #include <iostream> #include <sstream> #include <stdexcept> #include <dynd/array.hpp> #include <dynd/gtest.hpp> #include <dynd/json_parser.hpp> #include <dynd/types/fixed_string_type.hpp> #include <dynd/types/tuple_type.hpp> usin...
true
091f6bfa8a6a8cc74fb59e341aac65cb8eebb412
C++
Yann-P/Quidditch-OpenGL
/src/GoldenSnitch.cpp
UTF-8
4,480
3
3
[ "MIT" ]
permissive
/** * \file GoldenSnitch.cpp * \author Julien Lepasquier * \date 20/03/2017 * */ #include "GoldenSnitch.h" #include <cmath> using namespace std; #define MAIN_SPEED 0.3 #define PARASITE_SPEED 3 #define MAXDISTANCE 100 GoldenSnitch::GoldenSnitch(glm::vec3 position) : Drawable( new Shader("../shaders/snitch....
true
643607323e8434994e24294ecb791a21627280a1
C++
ZGWJ/PAT
/c/A1012.cpp
UTF-8
1,322
2.703125
3
[]
no_license
#include <iostream> #include <cstdio> #include <cmath> #include <algorithm> using namespace std; struct Student{ int ID; int grade[4]; }stu[2010]; char course[4]={'A','C','M','E'}; int Rank[1000000][4]={0}; int now; bool cmp(Student a,Student b){ return a.grade[now]>b.grade[now]; } int main(){ int ...
true
9cf4e461b0cb3cf9ee0354dda88bd2e0c92b762c
C++
pturon/game-programming
/metroidvania/metroidvania/src/MenuManager.cpp
UTF-8
1,318
2.875
3
[]
no_license
#include "../include/MenuManager.h" void MenuManager::showDeathMenu() { currentMenu = death; } void MenuManager::showWinMenu() { currentMenu = win; } void MenuManager::init() { currentMenu = noMenu; font = TTF_OpenFont("assets/Bebas-Regular.ttf", 64); color = { 255,255,255 }; background = TextureManager::lo...
true
c5c7631bd8e309c40a85463509b5cd08e6ff1e64
C++
tobme/TrafficSimulator
/Map.h
UTF-8
1,134
2.75
3
[]
no_license
#pragma once #include "DrawableShape.h" #include "IObject.h" #include "CarStates.h" #include<vector> #include <SFML/Graphics.hpp> namespace map { class Map { public: Map(); Map(unsigned int width, unsigned int height); ~Map(); template<typename T> void add(unsigned int x, unsigned int y, T item); ...
true
24c21396e9936e2ec556b48287123f3db98f9dc1
C++
YanB25/MyToyCode
/designPattern/order.cpp
UTF-8
1,407
3.671875
4
[]
no_license
#include <iostream> using namespace std; class Account { public: Account() : money(0) {} Account(double m) : money(m) {} void MoneyIn(double m) { money += m; cout << "money is " << money << endl; } void MoneyOut(double m) { money -= m; cout << "money is " << money << endl;} private: double money; }...
true
93b55ab40f65fe4b768664ebd23835d51bbb858b
C++
Williams3DWorld/OpenGL-Game-Engine
/GBufferPass.h
UTF-8
3,170
2.734375
3
[]
no_license
#ifndef __G_BUFFER_H__ #define __G_BUFFER_H__ #include "Pass.h" // Get access to abstract header #include "GBufferData.h" // Get GBuffer data #define ATTACHMENT_POSITION 0 // Define position attachment index #define ATTACHMENT_NORMAL 1 // Define normal attachment index #define ATTACHMENT_ALBEDO 2 // De...
true
9abf79fb75ed4f0140ca3ff9a348d04a4737f1ee
C++
taro-masuda/leetcode
/0017_LetterCombinationsOfAPhoneNumber.cpp
UTF-8
1,378
3.109375
3
[ "MIT" ]
permissive
class Solution { private: vector<vector<char>> num2abc = {{'\0','\0','\0','\0'},{'\0','\0','\0','\0'}, {'a', 'b', 'c','\0'}, {'d', 'e', 'f','\0'}, {'g', 'h', 'i','\0'}, {'j', 'k', 'l','\0'}, {'m', 'n', 'o','\0'}, {'p', 'q', 'r', 's'}, ...
true
bae7a10f30564c75c64f2826b240419b3f5c3848
C++
stevenireeves/GP_upsamp
/interp/cpp_pipeline/test.cpp
UTF-8
523
3.1875
3
[]
no_license
#include <stdio.h> #include <iostream> extern "C" { void interpolate(float *img_in, float *img_out, const int *upsample_ratio, const int *in_size); } int main(){ float imgin[16] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; float imgout[256] = {}; int size[3] = {4, 4, 1}; int upsample[2] = {4, 4}; std...
true
66650e92a3257638d6287f06342a328b08c595a4
C++
oliverpecha/Stanford-SEE
/CS106B/Chapter09 (Backtracking Algorithms) Book Exercises/121314. Nim/Nim.cpp
UTF-8
16,673
3.625
4
[]
no_license
/* * File: Nim.cpp * ------------------------------------------ * This program simulates a simple variant of the game of Nim. In this * version, the game starts with a pile of 13 coins on a table. * Players then take turns removing 1, 2, or 3 coins from the pile. * The player who takes the last coin loses. * * 12. Rewr...
true
bf1d81678c778d02e78ee8a5bee73d6aa66e25cb
C++
jfbaltazar/PROG-proj2
/Board.h
UTF-8
418
3.171875
3
[]
no_license
#pragma once #include <string> #include <vector> class Board { public: explicit Board(unsigned size); char getLetter(const int &x, const int &y) const; void setLetter(const int &x, const int &y, char letter); unsigned getSize() const; bool validPos(const int &x, const int &y) const; void show(...
true
8a85a145befb6fd3d90954d596ee7fd3b00665af
C++
Ubpa/RenderLab
/src/Engine/Light/SpotLight.cpp
UTF-8
1,110
2.703125
3
[ "MIT" ]
permissive
#include <Engine/Light/SpotLight.h> using namespace Ubpa; using namespace std; float SpotLight::Fwin(float d, float radius) { float ratio = d / radius; float ratio2 = ratio * ratio; float ratio4 = ratio2 * ratio2; float falloff = std::max(0.f, 1.f - ratio4); return falloff * falloff; } const rgbf SpotLight::Sa...
true
c0f4a731f0edb7814d17d6f5ccc75e99920d8158
C++
bsuir-labs/getmanskaya
/Lab2/main.cpp
UTF-8
3,939
3.640625
4
[]
no_license
#define _CRT_SECURE_NO_WARNINGS 1 #include <cstdio> #include <cstdlib> #include <ctime> #include <algorithm> #include <cstring> #include <ctype.h> using namespace std; int rangeReadInt(int minimal, int maximal, const char* prompt); void flush_stdin(); int recursiveFind(const int* array, int left, int right, int elem...
true
cf8076ea28730fcc0d65f8edd262eac5d21739ec
C++
oborges/CPP
/strings/extractExtension.cpp
UTF-8
632
3.34375
3
[]
no_license
//string_view usage demo #include <string> #include <iostream> using namespace std; string_view extractExtension(string_view fileName) { return fileName.substr(fileName.rfind('.')); } int main() { string fileName = R"(./my file.ext)"; cout << "C++ string: " << extractExtension(fileName) << endl; c...
true
ed49640dc7977bab351e53c1d0644ec877e3e2f6
C++
phrimm136/Study
/Bookshelf/C++ Primer Plus/Chapter 8/Exercise 2.cpp
UTF-8
914
3.921875
4
[]
no_license
#include <iostream> #include <string> struct CandyBar { std::string brandname; double weight; int calories; }; void set(CandyBar &, std::string brandname = "Millennium Munch", double weight = 2.85, int calories = 350); void print(const CandyBar &); int main(int argc, char *argv[]) { CandyBar bar1, ba...
true
7f4475ddfed39a82ab5f356308a79c60cf04d46c
C++
cevinclein/IP-Projects
/Uebung 8/Aufgabe2.cc
UTF-8
6,242
3.765625
4
[]
no_license
#include <iostream> //Enhält Aufgabe 2a und 2b, habe private Methoden definiert, auch Listen-Elemente //sind privat, sowie Variablen eben. Alles andere wie gefordert in die Klasse //geschrieben //Signatur Interface, nur Definitionen class IntList { public: // Konstruktor, erzeugt eine leere Liste ...
true
d47e6d39120681b30f3ec3e572c975fb6c31b643
C++
tuw-robotics/tuw_marker_detection
/tuw_aruco/aruco-2.0.10/src/markerlabelers/dictionary_based.cpp
UTF-8
4,456
2.609375
3
[ "BSD-2-Clause" ]
permissive
#include "dictionary_based.h" #include <bitset> #include <opencv2/imgproc/imgproc.hpp> namespace aruco{ void DictionaryBased::setParams(const Dictionary &dic,float max_correction_rate){ _dic=dic; max_correction_rate=max(0.f,min(1.0f,max_correction_rate)); _maxCorrectionAllowed=float(_dic.tau())*max_corre...
true
a365028e1453af5df39d7610203552adc055e167
C++
lucasvictorsp/ArduinoDataLogLibary
/string.cpp
UTF-8
152
2.828125
3
[ "MIT" ]
permissive
String floatToString(float f){ String stringOne = String(5.698, 3); // using a float and the decimal places return stringOne; }
true
09eadfc244b6190a87eb5b3e600b6499b3ebecc0
C++
CodeBlueDev/DungeonKeeperGoldTrainer
/DKH/DKH.cpp
UTF-8
1,186
2.78125
3
[]
no_license
#pragma once #include <Windows.h> DWORD* GoldBaseAddress = (DWORD*)0x0074B6B0; DWORD GoldDisplayOffset = 0x499082; DWORD GoldValueOffset = 0x499086; WORD GoldAdded = 25000; bool isAttached = true; bool isRunning = true;; DWORD __stdcall GoldIncrease() { DWORD* goldDisplayAddress = (DWORD*)(*GoldBaseAddress+GoldDispl...
true