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
e3eb98e2e678fb98674f1090bbec696feef3240f
C++
zylzjucn/Leetcode
/200~299/221. Maximal Square.cpp
UTF-8
752
2.671875
3
[]
no_license
class Solution { public: int maximalSquare(vector<vector<char>>& v) { if (v.empty()) return 0; int m = v.size(), n = v[0].size(), i, j, l = 0; vector<vector<int>> v1(m, vector<int>(n, 0)); for (i = 0; i < m; i++) { v1[i][0] = v[i][0] - '0'; l = max...
true
36a5a446a18584c69d1251e17f3c0f701ffb4d2e
C++
nideng/Data_Structures
/chapter02/SeqList.h
UTF-8
4,626
3.328125
3
[]
no_license
#ifndef SEQLIST_H #define SEQLIST_H #include<memory> #include<functional> #include<stdexcept> #include<initializer_list> #include<iostream> using std::allocator; using std::function; using std::invalid_argument; using std::initializer_list; template<typename T>class SeqList; template<typename T> int LocateElem(const ...
true
af360506c03ca924783bc5b28dc9c00c4c311596
C++
nik709/Stack
/Tparser.h
UTF-8
3,415
3.15625
3
[]
no_license
#pragma once #include "TStack.h" using namespace std; #define MaxLen 201 class TParser { private: char inf[MaxLen]; char post[MaxLen]; Tstack <double> st_d; Tstack <char> st_c; public: TParser(char *s = NULL) : st_d(100), st_c(100) { if (s == NULL) inf[0] = '\0'; else strcpy_s(inf, s); } int Priority...
true
bf1296a00d983e6332755e7cf129f1e65eb563b7
C++
syed/tc
/bigburger-c++/BigBurgerTest.cpp
UTF-8
2,490
3.34375
3
[]
no_license
#include "BigBurger.h" #include <iostream> #include <vector> using std::cerr; using std::cout; using std::endl; using std::vector; class BigBurgerTest { static void assertEquals(int testCase, const int& expected, const int& actual) { if (expected == actual) { cout << "Test case " << testCase ...
true
dba137186ff48875307a81bd3ee39e33fe2c3642
C++
derbess/algos
/howmanysubstr.cpp
UTF-8
936
2.984375
3
[]
no_license
#include<iostream> using namespace std; int isPalindrome(string str) { int cnt=0; for(int i=0;i<str.size();i++) { if(str[i]==str[str.size()-i-1]) { cnt++; } } if(cnt==str.size()) { return 1; } else return 0; } string getPalindrome(string str) { if(isPalindrome(str)==1) { return "Is_Palindrome"; ...
true
ad80be0c3394c7b20ea8e483e599d713fad358ca
C++
ZoranPandovski/al-go-rithms
/math/Matrix/C++/fast_matrix_exponentiation.cpp
UTF-8
1,037
2.96875
3
[ "CC0-1.0" ]
permissive
#include <bits/stdc++.h> using namespace std; long long mod = (int)1e9 + 7; #define matrix2D vector<vector<long long>> matrix2D matrixMultiply(matrix2D &a, matrix2D &b) { matrix2D c(a.size(), vector<long long>(b[0].size())); for (int i = 0; i < a.size(); i++) { for (int j = 0; j < b[0].size(); j+...
true
1bb0d84951239ecd39184e8fde39ea849c355c92
C++
andry-tino/coding-challenges
/white-rabbit-hole/WhiteRabbitHole/WhiteRabbitHole/Utils.cpp
UTF-8
773
2.984375
3
[ "MIT" ]
permissive
// Utils.cpp #include "Utils.h" std::string challenge::whiterabbithole::disposition_to_string(const std::vector<unsigned int>& disposition) { if (disposition.size() == 0) { return std::string("''"); } std::string s; for (std::vector<unsigned int>::const_iterator it = disposition.begin(); it != disposition.end...
true
3fc28caece564b37b63cd9b13301bcba7c0c1430
C++
Knabin/TBCppStudy
/Chapter2/Chapter2_09/main_chapter29.cpp
UTF-8
1,595
3.671875
4
[]
no_license
#include <iostream> #include "MY_CONSTANTS.h" #define PRICE_PER_ITEM 30 // C++에서는 상수 대체용으로 매크로 사용 안 함!! // 1. debugging 어려움 // 2. 적용 범위가 너무 넓음 using namespace std; void printNumber(const int my_number) { // 입력으로 들어온 값을 바꾸지는 않기 때문에 파라미터에 const를 많이 붙임 // const int& 변수 형태로 많이 사용함 // my_number = 456; error! int n = ...
true
fce4bf78306681e0d80ae6eae2150aad7f23f1da
C++
vasmedvedev/yandex_cpp
/white_belt/week4/rational/interface/main.cpp
UTF-8
903
3.625
4
[]
no_license
#include <iostream> int gcd(int x, int y) { do { int t = x % y; x = y; y = t; } while (y); return x; } class Rational { public: Rational() { _numerator = 0; _denominator = 1; } Rational(int numerator, int denominator) { if (numerator == 0) ...
true
820c048acd35e5f565315b7c41f5356208f21b14
C++
walkccc/LeetCode
/solutions/1900. The Earliest and Latest Rounds Where Players Compete/1900.cpp
UTF-8
1,058
3.03125
3
[ "MIT" ]
permissive
class Solution { public: vector<int> earliestAndLatest(int n, int firstPlayer, int secondPlayer) { dp.resize(n + 1, vector<vector<P>>(n + 1, vector<P>(n + 1))); const auto [a, b] = solve(firstPlayer, n - secondPlayer + 1, n); return {a, b}; } private: typedef pair<int, int> P; // dp[i][j][k] := (...
true
d27916f6ed862d195d5f079018fd769562b3d6cf
C++
rahularya50/ioi_prep
/acm/2010/C.cpp
UTF-8
752
2.765625
3
[]
no_license
#include "bits/stdc++.h" using namespace std; void go(long long n) { auto besta = 4000; auto bestb = 4000; auto bestc = 4000; for (long long a = 1; a < 4000; ++a) { for (long long c = 1; a+c < 4000 && c <= a; ++c) { auto cubesum = a*a*a + c*c*c; if (cubesum % n != 0) continue; auto bcube = cubesum / n;...
true
13822191690e537d40ba902797760c49b31c59cd
C++
Debparna/ctci
/c++/Chapter 1/Arrays&String.cpp
UTF-8
12,270
3.984375
4
[]
no_license
#include <deque> #include <queue> #include <stack> #include <string> #include <limits> #include <vector> #include <fstream> #include <sstream> #include <iostream> #include <algorithm> #include <climits> #include<list> using namespace std; //Q1 //Implement an algorithm to determine if a string has all unique characters...
true
0d6c8f103ce5a20e474d8d85c6f8e03b34a95272
C++
zacbrannelly/SwinEngine
/Mouse.h
UTF-8
621
2.8125
3
[]
no_license
#pragma once #include <SDL.h> #include <map> #include <vector> #include <string> #include "glm\glm.hpp" enum Button { Left = 1, Middle = 2, Right = 3 }; class Mouse { public: static void GetStatesFromEvents(std::vector<SDL_Event>& events); static bool IsButtonDown(Button btn); static bool IsButtonUp(Button btn)...
true
e4c526b7bed7db928bfb8b0b7ca3c34a9b91d4cb
C++
tstaples/Cat3D
/VGP336/Engine/EngineMath.cpp
UTF-8
9,534
2.828125
3
[]
no_license
//==================================================================================================== // Filename: EngineMath.cpp // Created by: Peter Chan //==================================================================================================== //====================================================...
true
110bbf9d372ced6d746d7be3aeef3c59e1e9a671
C++
tonyxiong/stereosynth
/src/math/imageset.h
UTF-8
2,430
3.046875
3
[ "MIT" ]
permissive
/* * File: imageset.h * Author: Alexandre Kaspar <akaspar@mit.edu> * * Created on December 5, 2014, 2:40 PM */ #ifndef IMAGESET_H #define IMAGESET_H #include "bilinear.h" #include "mat.h" #include "pointx.h" #include <type_traits> #include <boost/shared_array.hpp> namespace pm { struct ImageSet { ...
true
30d297cd3b50321dc413c17c3345028c2f0c1e97
C++
knakul853/ProgrammingContests
/OldStuff/SPOJ/new10/loner.cpp
UTF-8
1,659
2.953125
3
[]
no_license
/* Alfonso2 Peterssen (mukel) SPOJ #140 "The Loner" 18 - 5 - 2009 */ #include <cstdio> #include <algorithm> #include <cstring> using namespace std; #define REP( i, n ) for ( int i = 0; i < (n); i++ ) #define REPD( i, n ) for ( int i = (n) - 1; i >= 0; i-- ) const int MAXN = 1 << 15; int T, N; char ...
true
2acc9d4aa89fd31b2dca84a7c1fb221c2013d971
C++
ZeikkuSSJ7/cpp
/file-io_args_classes/args.cpp
UTF-8
387
2.890625
3
[]
no_license
#include <iostream> #include <fstream> #include <stdio.h> using namespace std; int main(int argc, char const *argv[]) { cout << argc << "\n"; cout << argv[1] << "\n"; ifstream i (argv[1]); if (!i.is_open()) { cout << "The file could not be opened!\n"; } else { char x; while...
true
2b96f51268f565087f2a7b96045bea9e73490609
C++
navidkpr/Competitive-Programming
/CodeForces/119/A[ Epic Game ].cpp
UTF-8
462
2.859375
3
[]
no_license
#include <iostream> using namespace std; int a[2]; int gcd(int c, int b) { if (c < b) swap(c, b); if (b == 0) return c; return gcd(c % b, b); } int main() { int n; cin >> a[0] >> a[1] >> n; int turn = 0; bool h = 0; while (n > 0) { //cerr << a[turn] << &#39; &#39; << n << &#39; &#39; << gcd(a[turn], n...
true
c01d04dbd4bc3a97d07581cadb371f8c8b664e7b
C++
yzIAI/xxxt-homeworks
/hw3/solutions/q2.cpp
UTF-8
711
3.015625
3
[]
no_license
/* * [q2.cpp] * 信息学堂2021 课后作业 Day 3 Question 2 * * 信息学堂第三次的作业会带大家熟悉数组以及循环在数组的应用 * 请根据注释里的相应提示,完成 *TODO* 部分的作业内容 * * © Tina J, 2021 * 作者:Tina Ji & Ziang Qiao * 时间:03/07/2021 * 版本:1.0.0 */ #include <iostream> using namespace std; int main(void) { int i = 0, row = 10, col = 10, scalar = 3; int matr...
true
9cc5d752d9d01b8a780e1090be941ab62e880d96
C++
66112/memory_pool
/TestCache.cpp
GB18030
4,421
3.265625
3
[]
no_license
#include "ConcurrentAlloc.h" #include <vector> #include <Windows.h> using std::vector; using std::thread; void BenchmarkMalloc(size_t ntimes, size_t nworks, size_t rounds) { vector<thread> vthread(nworks); size_t malloc_costtime = 0; size_t free_costtime = 0; for (size_t k = 0; k < nworks; k++){ vthread[k] = std...
true
2b64d5dc5a8df421dc1c4664522999a34a9db470
C++
janwilmans/nowindlibraries
/nwhost/BlockWrite.cc
UTF-8
6,909
2.53125
3
[ "MIT" ]
permissive
#include "BlockWrite.hh" #include "DataBlockWrite.hh" #include "NowindHostSupport.hh" #include <cassert> #define DBERR nwhSupport->debugMessage // the BLOCKWRITE_SIZE is not hardcoded in ROM, the host requests the exact amount the msx should send. static const unsigned BLOCKWRITE_SIZE = 240; namesp...
true
87c403f585e472af4f76fa25339abe52b2162543
C++
JackMcCallum/Portfolio
/Demos/Games/Tanks/Source/Game.h
UTF-8
1,614
2.6875
3
[]
no_license
/************************************************************************/ /* @class Game * @author Jack McCallum * * @description * Class from where all the game is controlled, it is entered via TanksMain * also controlls the score and win/lose condision * /*****************************************************...
true
74a61b1f6d902d6bff9a1d4231c9b1f386cd175b
C++
DenisPushkin/randomizer
/gist.cpp
UTF-8
749
2.859375
3
[]
no_license
#include "gist.h" #include <iostream> #include <vector> #include <cmath> using namespace std; void gist (double* arr, int n, double left, double step, int length, int precision1, int precision2) { vector < int > mas(length,0); for (int i=0; i<n; ++i) if (arr[i]>=left){ int j=0; w...
true
04089bc1b96de3da7be03d7edac041f6ac117bd2
C++
JeremyBois/SimpleGL
/src/Components/PointLight.cpp
UTF-8
2,375
2.78125
3
[]
no_license
#include "Components/PointLight.hpp" #include "OpenGL/Shader.hpp" #include "GameManager.hpp" #include "Node.hpp" #include <algorithm> namespace simpleGL { std::vector<PointLight*> PointLight::PointLightContainer; PointLight::PointLight() // http://wiki.ogre3d.org/tiki-index.php?page=-Point+Light+A...
true
4dc6646f0279284da15b809bd09bc8a03378e7d9
C++
yous/acmicpc-net
/problem/9020/main.cpp
UTF-8
678
2.765625
3
[]
no_license
#include <algorithm> #include <iostream> #include <vector> using namespace std; int T, N; vector<bool> sieve(10001, true); int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cin >> T; sieve[1] = false; for (int i = 2; i * i <= 10000; i++) { if (!sieve[i]) { conti...
true
2a39fca94d7f4a5285a751ce45d3475383d84f39
C++
RikkaWZ/DSCode
/2LinearList/SqList/SqList.cpp
UTF-8
4,124
3.78125
4
[]
no_license
#include "SqList.h" /** * 王道P17.1 * 删除具有最小值的元素,空出的位置由最后一个元素填补 */ bool Del_Min(SqList &L, ElemType &value) { if (L.length == 0) return false; value = L.data[0]; // 最小值先当作是第一个元素 int pos = 0; for (int i = 1; i < L.length; i++) if (L.data[i] < value) { value = L.data[i]; ...
true
6b9ba773d3a74d7043c36db6de562ff0cc582bc4
C++
google/perfetto
/include/perfetto/trace_processor/trace_blob_view.h
UTF-8
4,895
2.53125
3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/* * Copyright (C) 2018 The Android Open Source Project * * 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 app...
true
73a2f3cf2be163339a8004b0c3cde85b25e1d4c5
C++
Zeimd/crender-mt
/software-renderer/alg-test/uint8-float.cpp
UTF-8
10,556
2.734375
3
[]
no_license
#include <ceng/datatypes/aligned-buffer.h> #include "alg-test.h" const float scale = 1.0f / 255.0f; void uint8_to_normalized_float(const unsigned char* input, float* output, const int size) { for (int k = 0; k < size; ++k) { output[k] = float(input[k]) * scale; } } void uint8_to_normalized_float_strip4(const ...
true
6b4e7f6ccd64bfe700000daabf4b83be256b3065
C++
Matlock42/Jeopardy
/jgameClass.h
UTF-8
953
2.703125
3
[ "Unlicense", "LicenseRef-scancode-public-domain" ]
permissive
/********************************** * Jeopardy Game v. 3.0 * * Complete rewrite of version 2.0 @author: Joel Cranmer <42.joel.cranmer@gmail.com> @created: 2013/06/23 @modified: @version: 3 * **********************************/ #ifndef jgame_H #define jgame_H class Question; class Game { p...
true
07a757d7eead2fb3d67dced646e3bbd060af9814
C++
evanbradley6/BradleyEvan_CIS5_40739
/Project/Project 1/Craps_Project_1_Complete/main.cpp
UTF-8
13,981
3.609375
4
[]
no_license
/* * File: main.cpp * Author: Evan Bradley * Created on February 6, 2020, 8:47 AM * Purpose: Craps game with Preset Bets and 5 rounds Version 1, * Version 2 will have input bets, and unlimited rounds */ //System Libraries #include <iostream> #include <cstdlib> #include <ctime> using namespace std; //U...
true
fc2c917faa0e3b35e44828bd1f15e2463e50c778
C++
cycasmi/proyectos-VS
/Sexto Semestre Graficas (Infograhie)/Travailles pratiques/DoubleW/DoubleW/main.cpp
ISO-8859-1
8,761
2.625
3
[]
no_license
// Prnoms, noms et matricule des membres de l'quipe: // - Cynthia Castillo (1878153) #include <iostream> #include "inf2705.h" #pragma warning(disable:4996) // variables pour l'utilisation des nuanceurs //Defining ints using GLu-int with the purpouse of being more crossplatform GLuint progBase; // le programme de nua...
true
a7e7b3144ecf62d0aca3e57d49dac56247e44bd4
C++
ibradam/voronoi
/include/voronoi/point.hpp
UTF-8
7,384
2.6875
3
[]
no_license
/********************************************************************** * PACKAGE : geometrix * COPYRIGHT: (C) 2015, Bernard Mourrain, Inria **********************************************************************/ #pragma once #ifndef POINT_HPP #define POINT_HPP #include <cmath> #define TMPL template<class C, i...
true
8e6606f60077b628ab88d34b2347005a8a53dba0
C++
olihewi/NetScape
/src/MouseTracker.cpp
UTF-8
2,355
2.65625
3
[]
no_license
// // Created by hewis on 15/04/2021. // #include "ASGEGameLib/Utilities/MouseTracker.h" MouseTracker::MouseTracker(ASGE::Input* _input) : input(_input), click_callback_id(input->addCallbackFnc(ASGE::E_MOUSE_CLICK, &MouseTracker::mouseInput, this)), move_callback_id(input->addCallbackFnc(ASGE::E_MOUSE_MOVE, &Mou...
true
1d5399e6328f545a9a257e6cbf8515dc1766dcdd
C++
wdeyes/Note_c_jiajia
/PinDuoDuo/no3.cpp
UTF-8
2,894
3.1875
3
[]
no_license
// n长度的数字,满足递增数列,求和为s的数列有多少种。 // n=3 s=10 输出4种,说明:有127,136,145,235。 // n=4,s=18,输出15种 #include<iostream> #include <vector> #include <cmath> using namespace std; // 参考 https://blog.csdn.net/h2453532874/article/details/99250644 // 动态规划 // 递推关系和放苹果问题类似 // dp[n][s]分为两种情况,第一位是1和第一位不是1的, // 是1的:全部拿走1,情况种类和n-1位和为s-n的一样; // 不...
true
e74ab217bd8bd8cbf7110fc5769e234d7cc1526f
C++
sakib-personal/practiced-codes-in-data-structure
/FINAL/list_tree.h
UTF-8
2,095
3.75
4
[]
no_license
#include<iostream> using namespace std; //template<class T> struct node{ int item; node* left; node* right; node(int item){ this->item = item; this->left = NULL; this->right = NULL; } }; class list{ node* root; int count; public: list(){ ...
true
40baf9430c9a1850cf149f61e7ab6869c759a4a6
C++
sfb901c1/TEA
/peer/trusted/structs/aad_tuple.h
UTF-8
2,344
3.03125
3
[]
no_license
/** * Author: Alexander S. */ #ifndef AAD_TUPLE_H #define AAD_TUPLE_H #include <utility> #include "../../../include/config.h" #include "../overlay_structure_scheme.h" #include "../../../include/serialization.h" #include "../../../include/message_structs.h" namespace c1::peer { /** * Structure used to store the a...
true
24c27b0c80bfac792e9c3377c9c45452e6aaf755
C++
PavelMolchan/cpp
/dz25.1/dz25.1/dz25.1.cpp
UTF-8
1,498
3.78125
4
[]
no_license
#include <iostream> using namespace std; class Complex { public: Complex() { real = 0; imag = 0; } Complex(int _real, int _imag) :real(_real), imag(_imag){} Complex(const Complex& num2) { real = num2.real; imag = num2.imag; } void Print() { cout << real; if (imag > 0) cout << "+i" << imag << e...
true
63ded4320c01e8e7f7db898428908b8d79df43e7
C++
guijiangheng/pro-tbb
/src/main.cpp
UTF-8
3,196
2.890625
3
[]
no_license
#include <iostream> #include <tbb/tbb.h> #include <pstl/algorithm> #include <pstl/execution> #include <protbb/fractal.h> using namespace protbb; using ImagePtr = std::shared_ptr<Image>; ImagePtr applyGamma(const ImagePtr& image, double gamma) { auto width = image->width; auto height = image->height; auto outIma...
true
f72060aede67f4d6e0db07d788236e60dd743f8d
C++
shubhampathak09/codejam
/30 days training for beginners/Problem_Bank_adhoc/topoder-trying to underatand bs.cpp
UTF-8
1,034
2.859375
3
[]
no_license
#include<bits/stdc++.h> using namespace std; // // //int solve(int low,int high,int a[],int k) //{ // int n=sizeof(a)/sizeof(a[0]); // // int sum=0; // // int count=0; // // for(int i=0;i<n;i++) // sum+=a[i]; // // 450 // while(low<high) // { // // int mid=(low+high)/2; //225 // // // // if(...
true
411161f6ad54a3db3c5be93f4ce57427b60fa594
C++
the-paulus/old-skool-code
/C++/E19-1.cpp
UTF-8
1,499
3.703125
4
[]
no_license
//Paul Lyon //Exercise 19-1 //E19-1.cpp // compiler directives #include<iostream.h> #include<fstream.h> #define PRINT_IT ofstream prn("PRN") PRINT_IT; // function prototypes void selection_sort(int input_array[], int input_size); void display_array(int input_array[], int input_size); int main() { //int nums[5] = {2...
true
9def6a01abef1fa28faaac78b4dbc6c45c391ce6
C++
marvins/MapServerConnector
/src/apps/msc-viewer/gui/AddServiceWidget.cpp
UTF-8
5,216
2.78125
3
[]
no_license
/** * @file AddServiceWidget.cpp * @author Marvin Smith * @date 3/16/2016 */ #include "AddServiceWidget.hpp" /*********************************/ /* Constructor */ /*********************************/ AddServiceWidget::AddServiceWidget( Options::ptr_t options, ...
true
ee011da2b3d7b9e6b14da39654acbf4578c44ff5
C++
etip00123/ETIPproject
/Share/seeds/rbd.cpp
UTF-8
8,222
3.0625
3
[]
no_license
pragma solidity ^0.4.21; contract IMigrationContract { function migrate(address addr, uint256 nas) returns (bool success); } /* 灵感来自于NAS coin*/ contract SafeMath { function safeAdd(uint256 x, uint256 y) internal returns(uint256) { uint256 z = x + y; assert((z >= x) && (z >= y)); ret...
true
afc0e6f08a2f55179cbc56027a73578f03af5484
C++
martin-varbanov96/fmi--summer16
/Dafi/Kontrolno_teoriq_2/02/main.cpp
WINDOWS-1251
1,298
3.109375
3
[]
no_license
#include <iostream> using namespace std; class PoweredDevice{ public: PoweredDevice(int nPower){ cout << "PoweredDevice" << nPower << endl; } }; class Scanner: virtual public PoweredDevice{ public: Scanner(int nScanner, int nPower) :PoweredDevice(nPower){ cout << "Scanner" <<...
true
c2d7973bebe44f446f2ee84b81d98ba7ae625407
C++
santosli/experiment_datamining
/dataminning/test.cpp
UTF-8
2,265
3.046875
3
[]
no_license
#include <iostream> #include "KahanSum.hpp" #include "Median.hpp" #include "Vector.hpp" #include "DataIO.hpp" #include "Vector_function.hpp" using namespace std; int n; int main() { cout << "Please enter the size of vector N :" <<endl; cin >> n; KahanSum ks; Median md; Vector vc1,vc2,vc3; //for (int i = 1;i<...
true
1c7c098e2cd702f316d8695cb8e609cb4c99631a
C++
omerorhun/game_server
/inc/GameService.h
UTF-8
965
2.53125
3
[]
no_license
#ifndef _GAME_SERVICE_H_ #define _GAME_SERVICE_H_ #include "Game.h" #include "errors.h" #include <list> #include <ev.h> #include <thread> #include <string> #include <mutex> class GameService { public: GameService(); static GameService *get_instance(); Game *create_game(Rival...
true
f495770487b3af09536e254a7319e86d780f960e
C++
Kaffeine/qml2html
/main.cpp
UTF-8
5,049
2.703125
3
[]
no_license
#include <QCoreApplication> #include <QQmlEngine> #include <QQmlComponent> #include <QDebug> #include <QFile> #include <iostream> #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) #define GENERATOR_ENDL endl #else #define GENERATOR_ENDL Qt::endl #endif namespace Html { class HtmlNode : public QObject { Q_OBJECT Q...
true
22a7a59f3d6898f6ee24dbb5545c5b59b934ab74
C++
KingBobb/Mytiny_dnn
/Mytiny_dnn/network.h
UTF-8
2,033
2.578125
3
[]
no_license
#ifndef NETWORK_H #define NETWORK_H #include<iostream> #include<stdexcept> #include<algorithm> #include<iomanip> #include<iterator> #include<map> #include<set> #include<vector> #include<string> #include"nodes.h" #include"util/util.h" #include"lossfunctions\loss_function.h" #include"activations\activation_function.h"...
true
d7c3fc895c00ff63c6ee22e29619b5d716dcc84e
C++
sandeep-07/DSA_ALL
/HasCycle.cpp
UTF-8
1,589
3.4375
3
[]
no_license
#include<bits/stdc++.h> using namespace std; template<typename T> class Graph{ map<T,list<T>> l; public: void addEdge(int x,int y){ l[x].push_back(y); l[y].push_back(x); } void dfs_helper(T src,map<T,bool>& visited){ cout<<src<<" "; visited[src]=true; // g...
true
c5733dee2c295ce9fc22c8129ed21dde200bdac2
C++
AndyGaming/Andrew_Repo
/CSE_CSUSB/cse520/lab_1/draw.cpp
UTF-8
2,131
3.109375
3
[]
no_license
//draw.cpp : demo program for drawing 3 dots, two lines, ploylines, rectangles #include <GL/glut.h> //initialization void init( void ) { glClearColor( 1.0, 1.0, 1.0, 0.0 ); //get white background color glColor3f( 0.0f, 0.0f, 0.0f ); //set drawing color glPointSize( 4.0 ); //a dot is 4x4 glMatrixMode( GL_PROJ...
true
cf323ba8ce4e84e888dd7b3badb84e1dfc923562
C++
cdsc-github/Fluid-Registration
/C++Source/DoubleArray1D.h
UTF-8
12,372
3.15625
3
[]
no_license
#ifndef __DoubleArray1D__ #define __DoubleArray1D__ #include <iostream> #include <iomanip> using namespace std; #ifdef _DEBUG #include <stdio.h> #endif // //#################################################################### // DoubleArray1D.h //###################################...
true
5f47f41e1feef3f6a74bbab5756eb4f815f207fd
C++
alistair-singh/cpp-misc
/malloc.cc
UTF-8
451
3.453125
3
[]
no_license
#include <algorithm> #include <cstdlib> #include <iostream> #include <memory> int main() { const int SIZE = 1024; char *ptr1 = static_cast<char *>(::malloc(sizeof(char) * SIZE)); auto ptr2 = new char[SIZE]; std::fill(ptr1, ptr1 + SIZE, '1'); std::fill(ptr2, ptr2 + SIZE, '2'); std::cout << std::hex << s...
true
bc920cc4e9ad9c528b3a3bc018f5f292794e83f5
C++
dipty13/Competitive-Programming-Codes
/HackerRank/Restaurant.cpp
UTF-8
268
2.546875
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int main() { int t, l, b,gcd, x, y; cin >> t; while(t--) { cin >> l >> b; gcd = __gcd(l, b); x = l / gcd; y = b / gcd; cout << x * y << endl; } return 0; }
true
34288967a56941df36bf407d960c83bded4ef11a
C++
cba96/Data-Structure
/HeapSort/heapSort.cpp
UTF-8
2,521
3.40625
3
[]
no_license
// test heap sort #pragma #include <iostream> #include <algorithm> #include <iterator> #include <ctime> #include "heapSort.h" using namespace std; #define NUMBER_OF_DATASET 10000000 #define MAX_NUMBER_TO_SHOW 50 template <class T> void initializeArray(T nArr[], int n) { srand((unsigned) time(NULL)); for (int ...
true
9ee5e5d3a74f0dfca3ce0337090fe65d1961fa9e
C++
JunzheCS2/FirstRepo12
/Assignment 13-2/13-2.cpp
UTF-8
341
3.203125
3
[]
no_license
#include "Numbers.hpp" #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { Number n(5); n.setElement(); n.printOut(); cout << "Sum " << n.getSum() << endl; cout << "Size " << n.getSize() << endl; Number N(10); for( int i=0;i<10; i++) { N.setElement(i,i*10); ...
true
6762c695fa9083dc70e2d73886ad3ef85df2ef05
C++
abouchie/TicTacToe-using-Classes
/Driver.cpp
UTF-8
389
3.015625
3
[]
no_license
/* * Adrienne Bouchie * Driver.cpp * */ #include "TicTacToe.h" main() { char playerAnswer; TicTacToe TTT; cout << "Would you like to play a game of Tic-Tac-Toe? (y/n)" << endl; cin >> playerAnswer; if ( playerAnswer == 'y' || playerAnswer == 'Y' ) { TTT.setPlayerInfo(); TTT.displayBoard();...
true
a8e2b25cd8787f67e03f2fc1be81841776e5f20e
C++
joe-nano/ljus
/ljus/hash/Hash.h
UTF-8
1,830
2.859375
3
[ "MIT", "LicenseRef-scancode-public-domain", "BSD-2-Clause" ]
permissive
// // Created by cents on 24/08/17. // #ifndef HASH_H #define HASH_H #include <string> extern "C" { #include <argon2.h> }; #include <fcntl.h> #include <unistd.h> #include <sstream> #include <cstring> #include "../exceptions/ZeroEntropyError.h" #define HASH_LENGTH 32 #define SALT_LENGTH 16 #define T_COST 5 #defin...
true
5a533f4fd05fe30e0c878e93a67f0fdf829cc796
C++
cyclone472/SDSpractice
/Day6/Day6/P2458.cpp
UHC
1,271
3.171875
3
[]
no_license
#include <iostream> #include <cstring> #include <vector> using namespace std; vector<int> graph[501]; vector<int> revGraph[501]; bool visited[501]; int n, m; void getInput(); void dfs(int, vector<int>*); int main() { getInput(); //cout << "n : " << n << " m : " << m << '\n'; int ans = 0; for (int i = 1; i <=...
true
ba259350919982debacda01c284938116bf9397a
C++
Lethe0616/practice
/20200115/0115.cpp
UTF-8
208
2.53125
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <math.h> int main() { int n,m,i; double sum=0; scanf("%d %d",&n,&m); for(i=n;i<=m;i++) {sum=sum+1/pow(i,2.0);} printf("%.5lf",sum); return 0; }
true
9d0caf19dfdf86ec1a9fb6ef07bda6cfe8a17755
C++
TarsisJordao/ArquivosVerificar
/teste_serial2.0.ino
UTF-8
850
2.796875
3
[]
no_license
char charRead; void setup() { Serial.begin(115200); } void inicio() { Serial.println("TESTE DE COMANDOS NA SERIAL"); Serial.println(); } void loop() { while(Serial.available() > 0) { charRead=Serial.read(); Serial.println(charRead); switch(charRead) { case '1': { ...
true
6fe0f72982ce8a83e82785e739b89421f9ac4f91
C++
mcdavis17/Hashing
/Src/hashing.cpp
UTF-8
1,118
3.078125
3
[]
no_license
// // hashing.cpp // Hashing // // // //CLASS TO CREATE HASHNODE OBJECTS TO STORE THE NECESSARY VALUES OF EACH NODE class HashNode { public: int key; std::string value; std::string lineNumbers; HashNode* next; HashNode() { key = -1; } HashNode(int k, std::string v, int lineNumber) {...
true
1e01ff585d83309e1892f5846efcead1b420969d
C++
Edwardyeoh1810/evt
/libraries/chain/include/evt/chain/apply_context.hpp
UTF-8
1,864
2.53125
3
[ "BSL-1.0", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause", "MIT" ]
permissive
/** * @file * @copyright defined in evt/LICENSE.txt */ #pragma once #include <algorithm> #include <sstream> #include <boost/noncopyable.hpp> #include <fc/utility.hpp> #include <evt/chain/controller.hpp> namespace chainbase { class database; } namespace evt { namespace chain { struct action_trace; class transact...
true
4ae6a48dea8f833e17715f6a4d4bde19fd0a87a2
C++
GarimaAhuja/IRE
/CodeBase/RomilAdityaSirs/naiveClustering.cpp
UTF-8
1,089
2.90625
3
[]
no_license
#include<iostream> #include<fstream> #include<vector> #include<algorithm> #include<map> using namespace std; int main() { ifstream entityFile("entities.txt"); string line; vector<vector<string> > entities; map< string,vector<int> > clusters; while(getline(entityFile,line)) { vector<string> curr; while(line...
true
cfb72a8a00043c173cf4daee164ce584e07f0d8f
C++
mukoedo1993/CPP_advanced
/effective_modern_CPP/item7/variadic.cc
UTF-8
820
3
3
[]
no_license
#include<iostream> #include<vector> #include<memory> template<typename T, typename... Ts> void doSomeWork(Ts&&... params) { //create local T object from params... T localObject(std::forward<Ts>(params)...); std::cout<<localObject.size()<<"\n";//13 T localObject1{std::forward<Ts>(params)...}; std::...
true
442d0b45785948633b4fa1953ee5925635e7550a
C++
aaronlimwk/tunnelman
/Actor.cpp
UTF-8
19,861
2.5625
3
[]
no_license
#include "Actor.h" #include "GameConstants.h" #include "GraphObject.h" #include "StudentWorld.h" #include <algorithm> #include <vector> using namespace std; // Students: Add code to this file (if you wish), Actor.h, StudentWorld.h, and StudentWorld.cpp /////////////////////////////////// // Boulder Class ...
true
4ca2790cb54c6c65d05bf650ac23622173528d4f
C++
Cpasjuste/pscrap
/include/p_search.h
UTF-8
1,496
2.609375
3
[]
no_license
// // Created by cpasjuste on 29/03/19. // #ifndef PSCRAP_P_SEARCH_H #define PSCRAP_P_SEARCH_H #include <vector> #include <json-c/json.h> #include "p_movie.h" namespace pscrap { class Search { public: // TODO: handle tv shows enum class Type { Movie, TvShow ...
true
9e2e6e422888f72fc47bb1bcdbf5126bb3fc1d2a
C++
sander-skjulsvik/IN1910
/lectures/2019.10.01/throw.cpp
UTF-8
863
3.328125
3
[]
no_license
#include <iostream> #include <cmath> #include <vector> // using forward euler to solve ode using namespace std; struct Sulution { vector<double> t; vector<double> v; vector<double> y; }; Sulution vertical_throw(double v0, double y0, double dt, double T, double m, double D){ Sulution sol; double ...
true
25788e2b17852cc5e1a1b19c0028ff3e6f3d732c
C++
sysidos/fuchsia
/src/developer/shell/console/command.cc
UTF-8
6,022
2.515625
3
[ "BSD-3-Clause" ]
permissive
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/developer/shell/console/command.h" #include <stdlib.h> #include <regex> #include <string_view> #include <vector> namespace shell::console ...
true
029d19ef2ff42bc94cddc1dbb8cacd09cb280bc0
C++
hu2di/c-hust
/Sort/merger.cpp
UTF-8
529
2.953125
3
[]
no_license
void merge(int a[], int a1, int a2, int a3){ int i, j, k, t; int temp[10]; i = a1; j = a2; k = a1; while (i < a2 && j <= a3){ if (a[i] < a[j]){ temp[k] = a[i]; i++; } else{ temp[k] = a[j]; j++; } k++; } if (i >= a2) for (t = j; t <= a3; t++){ temp[k] = a[t]; k++; } else for (t = i; t <= a2; t++){ temp[k] = a[t]; k++; }...
true
f4e71cdc058626e521dca9169ac4af67ce4deabb
C++
tommybutler/mlearnpy2
/home--tommy--mypy/mypy/lib/python2.7/site-packages/pystan/stan/lib/stan_math/test/unit/math/prim/mat/meta/get_test.cpp
UTF-8
523
2.5625
3
[ "Unlicense", "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
#include <stan/math/prim/mat.hpp> #include <gtest/gtest.h> TEST(MetaTraits, get) { using stan::get; Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> m(2,3); m << 1, 3, 5, 2, 4, 6; EXPECT_EQ(1.0, get(m,0)); EXPECT_EQ(3.0, get(m,2)); EXPECT_EQ(6.0, get(m,5)); Eigen::Matrix<double,Eigen::Dynami...
true
b7542857519884d3c37f2a97cb5a50439bfcd641
C++
janniklaskeck/studyCpp
/AdvancedCpp/Uebung4/Freespace.cpp
UTF-8
299
2.609375
3
[]
no_license
#include "Freespace.h" Freespace::Freespace(Vector2D pos) { this->pos = pos; displayChar = '0'; } Freespace::~Freespace() { } bool Freespace::isBlocking() { return false; } bool Freespace::isGoal() { return false; } void Freespace::render(std::ostream& stream) { stream << displayChar; }
true
d8dea138be93a7b709e1fb9378271b61f52ba9fb
C++
daveRQ/Grafica
/GLFW_GLAD_GLUT_GLEW_cmake_project/src/Tutorial_01/clases.h
UTF-8
29,029
3.40625
3
[]
no_license
#include <cmath> #include <vector> #include <iostream> using namespace std; void rotate_x_y(float* arr, float incremento, float x) { // float incremento = 0.01; float center = 1.5; for (int i = 0; i < 2592; i += 8) { arr[i + 0] = center + (arr[i] - center) * cos(incremento) - (arr[i + 1] - center...
true
28e67ab45473b21522cee4f54de041e15891f338
C++
Riverside-City-College-Computer-Science/CSC5_Winter_2014_40375
/cr2439879/Home Rate/main.cpp
UTF-8
694
3.296875
3
[]
no_license
/* * File: main.cpp * Author: Cody Rudd * Created on January 13, 2014, 11:32 AM * Cheaper To Buy Or Rent */ //System Libraries #include <iostream> #include <cmath> //Global Constants //Function Prototypes //Execution Begins Here using namespace std; int main(int argc, char** argv) { //Declare Variables...
true
dd1d3bf1ba7c4eb92b9c5a022948466fb2d31ce6
C++
EngravedMemories/guo_jiacheng
/郭佳承 3-6 第六章作业1/6.28/main.cpp
UTF-8
285
2.765625
3
[]
no_license
#include <iostream> using namespace std; int isperfect() { int a=0,i=1,f=0; for(a=2;a<=1000;a++) { f=0; for(i=1;i<a;i++) { if(a%i==0) f+=i; } if(f==a) cout<<a<<endl; } return a; } int main() { isperfect(); return 0; }
true
4fe2d39a64f8be7eb25d128c3a3a180cc82cc2d4
C++
Magnuskodd/TDT4102
/Øving5/Øving5/Blackjack.cpp
UTF-8
1,356
3.25
3
[]
no_license
#include "std_lib_facilities.h" #include "Card.h" #include<string> #include<locale> vector<int> getSum(vector<Card> summer) { int sum = 0; int sumWithAce = 0; bool canBlackjack = false; for (auto card : summer) { switch(card.getRank()) { case Rank::ace: sum += 1; sumWithAce += 11; bre...
true
bb78d4aa1b04b2aee014f85e15c98de6c68c0732
C++
lineCode/ArchiveGit
/Clients/Powerhouse/Autorun/Autorun (generic)/Autorun.cpp
UTF-8
22,983
2.546875
3
[]
no_license
// INI search values for the APP's path #define INI_FILENAME "pinoc.ini" #define INI_SECTION "Options" #define INI_KEY "Path" // Define the application #define APP_EXE "pinoc.exe" #define APP_ARGS "" #define APP_CD_LABEL "" #define APP_CLASS "pinoc" // If the app is not found... #define SE...
true
5bfd9732566dc206120b035df589f2ffc8e2cf90
C++
Althis974/PiscineCPP
/day05/ex04/srcs/main.cpp
UTF-8
3,572
2.703125
3
[]
no_license
/* ************************************************************************** */ /* LE - / */ /* / */ /* main.cpp .:: .:/ . .:: ...
true
88adf9b655c5bc9d917ee1880555e0938fed3bf2
C++
rongyi/lintcode
/src/binary-representation.cc
UTF-8
2,231
3.296875
3
[]
no_license
// http://www.lintcode.com/zh-cn/problem/binary-representation #include <algorithm> #include <iostream> #include <sstream> #include <string> #include <unordered_set> #include <vector> using std::vector; using std::cout; using std::endl; using std::string; using std::unordered_set; class Solution { public: /** *@...
true
3c1e023d684df25303851ac4c2c873fac13df61b
C++
RyoIwanaga/civ
/Console/Console.h
UTF-8
1,596
2.796875
3
[]
no_license
#ifndef _Console_h_ #define _Console_h_ #include <cassert> #include "../World.h" #include "../Util.h" //#include "Window.h" namespace Console { #include <curses.h> enum class Color : short { Player1 = 10, Player2, Player3, Player4, Player5, Player6, Player7, Player8, }; short makeColorPlayer(ushort player...
true
8ed7c06900d847d39b022dc77b3a2b310ffbd3c0
C++
ROKAF-CV/Homework_JB
/chapter/chapter3/algorithm3.cpp
UHC
1,710
2.8125
3
[]
no_license
#include "Edge.h" void edge() { Mat origin = imread("Lenna.jpg", 0); Edge edge(origin); Mat out(origin.size(), origin.type()); Mat out2(origin.size(), origin.type()); edge.gaussian_blur(origin, out, 0.5); GaussianBlur(origin, out2, Size(7, 7), 1.0); imshow("out", out); imshow("out2", out2); waitKey(); } void...
true
d7e696f169c97d00039a6d2c829bb5485175ebed
C++
bisqwit/crt-filter
/blur.hh
UTF-8
2,957
3.25
3
[]
no_license
#include <cmath> /* blur(): Really fast O(n) gaussian blur algorithm (gaussBlur_4) * By Ivan Kuckir with ideas from Wojciech Jarosz * Adapted from http://blog.ivank.net/fastest-gaussian-blur.html * * input: The two-dimensional array of input signal. Must contain w*h elements. * output: Where the two-dimensional ...
true
221de2cb2e7057578fea34a1bd5ae656b2276910
C++
tonnas/uva_online_judge
/cpp/573.cpp
UTF-8
595
3.28125
3
[]
no_license
#include <iostream> using namespace std; int main() { int count; double height, night, day, percent, h; bool success; while (cin >> height >> day >> night >> percent) { if (height == 0) break; count = 0; h = 0; percent = day * percent / 100; while (1) { count++; h += day; day -= percent; ...
true
c62653200e2efa21e8795d73d1d7acf241f1e9e6
C++
ShaunNaude/COS214_GP
/include/Planets/Planet.h
UTF-8
1,375
2.6875
3
[]
no_license
// // Created by danienel21 on 2019/10/19. // #ifndef COS214_GP_PLANET_H #define COS214_GP_PLANET_H #include <vector> #include <string> class Spaceships; class Route; class Critter; using namespace std; class Planet { private: string planetName; int relationship; int resources; private: int threa...
true
0f38df6a19e2a8e565a5df9e4185644ffadce437
C++
mikeyb1337/RomanCalc
/RomanCalculatorStarter/RomanNumber.hpp
UTF-8
2,144
3.078125
3
[]
no_license
// // Created by HOME on 10/19/2021. // #ifndef ROMANCALCULATORSTARTER_ROMANNUMBER_H #define ROMANCALCULATORSTARTER_ROMANNUMBER_H #include <vector> #include <string> #include "Token.hpp" #include "InfixToPostfix.hpp" #include "Tokenizer.hpp" class RomanNumber { public: void print(){ std...
true
f9e85d12fc87594737730d22a1d861ee511f4913
C++
naresh569/shs-server
/Sessions.hpp
UTF-8
2,955
3.390625
3
[]
no_license
#pragma once #include "Config.hpp" class Session { public: int _id; int userId; char* token; char* timeOfStart; Session(int); ~Session(); void generateToken(); char* getToken(); static int total; static Session* createSession(int);...
true
74b7aa68ecb79640a9a9a7f00ecdd56c138acf53
C++
ZhiyLiu/optim
/Correspondence_Oct7/Pablo2_Oct7/lib/m3d/include/M3DFigurePredictor.h
UTF-8
2,134
2.796875
3
[]
no_license
#ifndef M3D_FIGUREE_PREDICTOR_H #define M3D_FIGUREE_PREDICTOR_H #include "M3DFigure.h" struct SimilarityTransform { Vector3D COR; // center of rotation, defaulted as the COG Matrix cov; // covariance matrix Matrix rotM; // rotation matrix Quat rotQ; // rotation quaternion double scale; // scale V...
true
3357221a5ba9c55bc181853eaa139be2330227c3
C++
15831944/Cpp_SQL
/2020_08_07/멀리뛰기/멀리뛰기/Source1.cpp
UTF-8
371
2.578125
3
[]
no_license
#include <string> #include <vector> using namespace std; int dp[2001]; long long solution(int n) { long long answer = 0; dp[1] = 1; //1,2,3,5, dp[2] = 2; for (int i = 3; i <= n; i++) //dp[i] = (dp[i - 1] + dp[i - 2]) % 1234567; dp[i] = (dp[i - 1] + dp[i - 2]) ; answer = dp[n]; return answer; ...
true
751ddcfab14f366d585eb328cefc3d2f184f15c3
C++
Alon-Regev/Interpreter
/Interpreter/Node.cpp
UTF-8
1,512
3.34375
3
[]
no_license
#include "Node.h" Node::Node() : _value(""), _left(nullptr), _right(nullptr), _parentheses(0), _lineNumber(DEFAULT_LINE_NUMBER) { } Node::Node(const std::string& value) : _value(value), _left(nullptr), _right(nullptr), _parentheses(0), _lineNumber(DEFAULT_LINE_NUMBER) { } Node::Node(const std::string& value, int lin...
true
36961cca6b484d7a46c49ebe680af3403068e355
C++
SeizeTheMoment/Solution-to-Algorithm-Excercise
/leetcode/周赛/20200802/3.排布二进制网格的最少交换次数(中等).cpp
UTF-8
1,034
2.765625
3
[]
no_license
class Solution { public: int minSwaps(vector<vector<int>>& grid) { int N = grid.size(); vector<int> zerocnt; zerocnt.resize(N); for(int i=0;i<N;i++) { int k = 0; for(int j=N-1;j>=0;j--) { if(grid[i][j] == 0) ...
true
ece0a245f030caab58705ec589bddd457de712ca
C++
rainlee/leetcode-jecklee
/SudokuSolver.cpp
GB18030
1,648
3.59375
4
[]
no_license
/*** * ݹ * б'.' ö9 * Ϸݹ鴦 ***/ const int N = 9; class Solution { public: void solveSudoku(vector<vector<char> > &board) { doSudoku(board); } private: static bool doSudoku(vector<vector<char> > &board) { for (int i = 0; i < N; ++i) { for (int j = 0; j < N; ++j) ...
true
5417157368d47e399cba6377854801d6d41d4c2f
C++
takasugi0406/GuessIt
/main.cpp
UTF-8
1,063
3.703125
4
[]
no_license
#include <iostream> #include <cstdlib> #include <ctime> #include <string> using namespace std; int generateRandomNumber(); int getPlayerGuess(); void printAnswer(int guess, int secretNumber); int main() { int secretNumber = generateRandomNumber(); int guess; int score = 100; int times = 0; do ...
true
ec00ad33bd83b115630b7385e7d41f5c13e6943d
C++
Outerskyb/baekjoon
/1934/main.cpp
UTF-8
253
2.921875
3
[]
no_license
#include <iostream> using namespace std; int main() { int t; cin >> t; while (t--) { int a, b; cin >> a >> b; int mul = a * b; while (b != 0) { int r = a % b; a = b; b = r; } cout << mul/a << '\n'; } }
true
ca739266f42a9ced027b597f8b6170c49deaef45
C++
gems-uff/oceano
/core/src/test/resources/CPP/neopz/Material/pzbiharmonic.h
UTF-8
4,335
2.578125
3
[ "MIT" ]
permissive
/** * \file * @brief Contains the TPZBiharmonic class which implements a discontinuous Galerkin formulation for the bi-harmonic equation. */ // -*- c++ -*- //$Id: pzbiharmonic.h,v 1.12 2009-11-16 18:41:59 diogo Exp $ #ifndef TPZBIHARMONICHPP #define TPZBIHARMONICHPP #include <iostream> #include "pzdiscgal.h" #inc...
true
44d6ade473e303fd46edb6d66395f59de8aa2a5d
C++
Tudor67/Competitive-Programming
/LeetCode/Explore/December-LeetCoding-Challenge-2021/#Day#26_KClosestPointsToOrigin_sol10_binary_search_O(N)_time_O(N)_extra_space_128ms_57.9MB.cpp
UTF-8
2,134
2.921875
3
[ "MIT" ]
permissive
class Solution { private: int computeDistanceToOrigin(const vector<int>& P){ return (P[0] * P[0] + P[1] * P[1]); } int computeDistanceToOrigin(const pair<int, int>& P){ return (P.first * P.first + P.second * P.second); } public: vector<vector<int>> kClosest(vecto...
true
7be421e39a27a2f31651bfa98ba4172f529cea66
C++
apiec/labirynth
/Maze.h
UTF-8
1,921
3.40625
3
[]
no_license
#ifndef MAZE_H_INCLUDED #define MAZE_H_INCLUDED #include <iostream> #include <vector> #include "xy.h" /** \brief Contains basic functionality of a maze. * * The maze is made up of square cells. Each cell can either be a wall or a passage. * A maze can either randomly generated or read from a txt file. **/ class Ma...
true
153d70ad074002fb9cd03f46991ead0c424b8b2c
C++
karapish/CPP
/BFS.cpp
UTF-8
1,458
3.515625
4
[]
no_license
#include <iostream> #include <queue> using namespace std; template <typename T=size_t> struct Node { T v; Node* left; Node* right; static Node<T>* create(T v, Node<T>* l, Node<T>* r) { auto n = new Node; n->v = v; n->left = l; n->right = r; return n; } ...
true
497b0140a3de81ab937b415992291a85819bbadf
C++
Qux/CV-Shield
/examples/2CVs/2CVs.ino
UTF-8
371
2.65625
3
[ "MIT" ]
permissive
#include <QuxCV.h> int counter; void setup() { counter = 0; /* By using QuxCV::setup2CVs(), you can use digital 3 and 11 pins as CV signal (fast PWM). */ Qux::CV::setup2CVs(); } void loop() { analogWrite(3, counter); analogWrite(11, 255 - counter); counter++; if (counter == 2...
true
d2a998780f0bfbd0834c6d3346ab4616edb090e4
C++
AmirGD/AP-PROJECT
/HelperClass.cpp
UTF-8
4,035
2.9375
3
[]
no_license
#include "HelperClass.h" using namespace std; void helper::create_by_template(string address) { outfile.open(address); outfile << "#include <iostream>\n#include <vector>\n#include <string>\n\nusing namespace std;\n\ntypedef vector<int> ints\ntypedef vector<string> strings\n\nint main() {\n\treturn 0;\n}" << en...
true
1df27c1baef4fd92dcc4e6cbfa37928b1687c2c6
C++
smeredith/averagecolor
/AverageColorLib/AverageColor_StdThreadRecursive.cpp
UTF-8
2,528
3.203125
3
[]
no_license
#include "stdafx.h" #include <numeric> #include <thread> #include "EveryNIterator.h" #include "AverageColor_StdThreadRecursive.h" // An iterator to iterator over all bytes of one color. typedef EveryNIterator<std::vector<BYTE>::const_iterator, 3> ColorIterator; // Divide and conquer version of SumAverages() ...
true
7867b3f9566faefe499978b73876bfa70fb5487d
C++
maromf/MaromAndNoaProject
/RoboticsProjMfNc/Utils.cpp
UTF-8
3,017
3.53125
4
[]
no_license
/* * Utils.cpp * * Created on: Jul 25, 2015 * Author: colman */ #include "Utils.h" /** * Calculates degrees to grid index */ int Utils::degreesToIndex(int degrees) { return degrees * (TOTAL_SCAN_SPAN / TOTAL_DEGREES); } /** * Calculates grid index to degrees */ int Utils::indexToDegrees(int index) { ...
true
1f07002f882f7f58a7808775b0e65d799c51e410
C++
ganesh1729ganesh/dsa
/graphs/kruskals.cpp
UTF-8
1,482
2.828125
3
[]
no_license
#include <iostream> using namespace std; int findpar(int node, vector<int> &parent){ if(node==parent[node]) return node; return parent[node] = findpar(parent[node],parent); } void unionn(int u,int v,vector<int>&parent,vector<int>&rank){ u = findpar(u,parent); v = findpar(v,pa...
true