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
71fe69fffb77ec56b99e30707c35fe756c213372
C++
swxie/algorithm
/disjoint.cpp
UTF-8
1,700
3.25
3
[]
no_license
#include <iostream> #include <iterator> #include <vector> #include <unordered_map> using namespace std; class disjoint { private: vector<int> parent; vector<int> rank;//秩 public: disjoint(int size); ~disjoint(); int find(int x){ if (x == parent[x]) return x; else{ ...
true
13a6839772217ebdeae4c674c6416ad0e4a697cd
C++
paksas/Tamy
/Code/Include/core/Algorithms.inl
UTF-8
2,270
3.21875
3
[]
no_license
#ifndef _ALGORITHMS_H #error "This file can only be included from Algorithms.h" #else /////////////////////////////////////////////////////////////////////////////// template< typename T > void Collection::clear( T& collection ) { for ( T::iterator it = collection.begin(); it != collection.end(); ++it ) { ...
true
0baf6651fdcb71245b49a87fb2d79e80791443d3
C++
szr712/PAT-Advanced-Level-Practice
/1052.cpp
UTF-8
1,296
2.796875
3
[]
no_license
/* 这道题坑点很多 然后有可能给出的结点不是全部都在链表中 最后一个最坑 就是可能给出的起始地址不在给出的结点的中 */ #include<iostream> #include<algorithm> #include<string.h> #include<string> #include<vector> #include<map> #include<set> #include<cmath> #include<stack> using namespace std; int n; map<int, pair<int, int>> link; map<int, int> ans; int start; int main() { s...
true
37a5e54282f02d241e7c80288e973b7ecd27a798
C++
gzumpan/fuzzy-cmeans
/VAT/cmeans/Unicode/UnicodeUtil.cpp
UTF-8
3,467
2.8125
3
[]
no_license
// UnicodeUtil.cpp: implementation of the UnicodeUtil class. // ////////////////////////////////////////////////////////////////////// #include "StdAfx.h" #include "UnicodeUtil.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif //////////////////////////////...
true
6e25321bd68972d8955ad5fbffaed61196ec2295
C++
ajosh0504/Cosine-and-Dot-Product-Similarity
/doc_query.cpp
UTF-8
7,881
2.8125
3
[]
no_license
#include <dirent.h> #include <stdio.h> #include <iostream> #include <vector> #include <math.h> #include <Eigen/SVD> #define MAX_STRING 50 #define FOUND -1 #define QUERY_PATH "Documents/Machine Learning/MachineLearning/MachineLearning/queries" #define DOCS_PATH "Documents/Machine Learning/MachineLearning/MachineLearnin...
true
b7969f4c1dbb408401cb5ca020a77a9bc61a1c69
C++
Spark-NF/face-detector
/addpersondialog.cpp
UTF-8
948
2.71875
3
[ "Apache-2.0" ]
permissive
#include "addpersondialog.h" #include "ui_addpersondialog.h" AddPersonDialog::AddPersonDialog(QList<Person*> *persons, QList<Group *> *groups, QWidget *parent) : QDialog(parent), ui(new Ui::AddPersonDialog), _groups(groups) { setModal(true); ui->setupUi(this); for (Group *group : *groups) ui->...
true
8d67b6f2fb2cd21510b487545eeca50b5773eb94
C++
trinhvo/OceanRendering
/Terrain.h
UTF-8
830
2.625
3
[]
no_license
#ifndef _TERRAIN_H #define _TERRAIN_H #include "VertexArrayObject.h" #include <glm/glm.hpp> #include <vector> using namespace glm; class Terrain : public VertexArrayObject { public: Terrain(int resolution, int tileNumber, bool generateHeightValues); Terrain(int resolution, int tileNumber, bool generateHeightVa...
true
8106a78ba46f587ac99ec091d07f40002913ca0a
C++
ThereWillBeOneDaypyf/Summer_SolveSet
/codeforces/cf_980_a.cpp
UTF-8
418
2.78125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int main() { string s; while(cin >> s) { int cnt = 0; for(int i = 0;i < s.size();i ++) { char temp = s[i]; if(temp == '-') cnt ++; } int ret = (int)s.size() - cnt; if(ret == 0) { cout << "YES" << endl; contin...
true
d68a20b9562730ac903c2ea864c179020c4a2a4f
C++
hect1995/Processing-Radar-Data
/data.hpp
UTF-8
1,824
2.609375
3
[]
no_license
// // data.hpp // ubimet // // Created by Héctor Esteban Cabezos on 04/06/2020. // Copyright © 2020 Héctor Esteban Cabezos. All rights reserved. // #ifndef data_hpp #define data_hpp #include <stdio.h> #include <vector> #include <string> #include <map> struct Spherical{ float latitude; float longitude; }...
true
1b4aed40ed62056101a93ec400b679eab698b703
C++
SanchitaMishra170676/STL100
/VECTOR/vector-5.cpp
UTF-8
535
2.5625
3
[]
no_license
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 #define pb push_back #define int long long using namespace std; // To print vector void printvector(vector<ll> &v){ ll n = v.size(); for(int i=0;i<n;i++){ cout<<v[i]<<"\n"; } } // sort in reverse bool rev(const &a, const &b) { return (a ...
true
d953570a3b0e327e4f526c31aa713e0df2cf2b63
C++
d2macster/leetcode-cpp
/src/E/3/E342_PowerFour.cpp
UTF-8
241
2.65625
3
[]
no_license
// // Created by Andrii Cherniak on 1/9/18. // class Solution { public: bool isPowerOfFour(int num) { unsigned int mask = 0b10101010101010101010101010101010; return num > 0 && (num & (num - 1)) == 0 && (num & mask) == 0; } };
true
e88a8b447796227d1bc8f78bc019aaa218cdee20
C++
TheOnlyJoey/vlc-vr
/include/label.h
UTF-8
3,275
2.8125
3
[]
no_license
#ifndef LABEL_H #define LABEL_H #include <SDL/SDL.h> #include <SDL/SDL_ttf.h> #include <GL/gl.h> #include <usercontrol.h> template <class Controller> class Label : public UserControl<Controller> { public: Label(float x, float y, int fontSize, std::string text, GLuint shaderProgram) : UserContr...
true
60c5f6f391853566a5a5bfd38937db08dfb5f835
C++
oysterkwok/Practice
/UVa OJ/Binary Trees/112.cpp
UTF-8
820
3.296875
3
[]
no_license
#include <iostream> #include <vector> #include <cstdlib> using namespace std; bool found; int n; bool play_tree(int); bool play_tree(int sum) { char ch; cin >> ch; string num_buf; bool both_empty = true; while (ch != ')') { if (ch == '(') { if (!play_tree(sum + atoi(num_buf.c_str()))) { both_empty = f...
true
07d7aed152f9f935cef47072c758ec31a2d8b00a
C++
Job-Colab/Coding-Preparation
/Day-62/Lavanya.cpp
UTF-8
371
2.96875
3
[]
no_license
class Solution { public: int maximumWealth(vector<vector<int>>& accounts) { int max=0; for(int i=0;i<accounts.size();i++){ int amt=0; for(int j=0;j<accounts[i].size();j++){ amt+=accounts[i][j]; } if(amt>max){ max=amt; ...
true
951ce51d6c0c70a57367c06348de71879bff87f3
C++
imhdx/My-all-code-of-Vjudge-Judge
/POJ/2386/18602413_AC_32ms_1064kB.cpp
UTF-8
696
2.71875
3
[]
no_license
#include<cstdio> #include<cstdlib> using namespace std; int dx[]={0,0,1,-1,1,-1,1,-1}; int dy[]={1,-1,0,0,1,-1,-1,1}; char str[102][102]; int n,m; void dfs(int x,int y) { for (int i=0;i<8;i++){ int tx=x+dx[i]; int ty=y+dy[i]; if (tx<0||tx>=n||ty<0||ty>=m) continue; if (str[tx][ty]=='...
true
229cc1cb981c0e4b314000022ef32055a4269211
C++
PeachOS/zserio
/compiler/extensions/cpp/runtime/src/zserio/VarUInt64Util.cpp
UTF-8
689
2.75
3
[ "BSD-3-Clause" ]
permissive
#include <limits> #include "CppRuntimeException.h" #include "StringConvertUtil.h" #include "VarUInt64Util.h" namespace zserio { namespace { template <typename T> T convertVarUInt64(uint64_t value) { if (value > static_cast<uint64_t>(std::numeric_limits<T>::max())) throw CppRuntimeExce...
true
bf93ee9fb7277f67e09f3a7d745e45e9acb548a4
C++
XintongHu/leetcode
/CPP/IntergerToRoman.cpp
UTF-8
765
2.953125
3
[]
no_license
class Solution { public: string intToRoman(int num) { string ans = "", tmp; int r, n = 0, i; vector<string> roman = {"I", "V", "X", "L", "C", "D", "M"}; while (num != 0) { tmp = ""; r = num%10; num/=10; if (r == 9) tmp += (roman[n] + ro...
true
51c1494abc9f79fdff8332f8b16f581691219544
C++
mariokonrad/marnav
/test/marnav/seatalk/Test_seatalk_message_36.cpp
UTF-8
1,192
2.734375
3
[ "BSD-3-Clause", "BSD-4-Clause" ]
permissive
#include <marnav/seatalk/message_36.hpp> #include <gtest/gtest.h> namespace { using namespace marnav::seatalk; class test_seatalk_message_36 : public ::testing::Test { }; TEST_F(test_seatalk_message_36, construction) { message_36 m; } TEST_F(test_seatalk_message_36, parse_invalid_data_size) { EXPECT_ANY_THROW(me...
true
91a1630c07e09b92bf3fb2bb8acfb9f28e431cd6
C++
8489545/SpaceEngine
/Space/ObjectMgr.cpp
UTF-8
1,361
2.765625
3
[]
no_license
#include "stdafx.h" #include "ObjectMgr.h" ObjectMgr::ObjectMgr() { } ObjectMgr::~ObjectMgr() { } void ObjectMgr::Release() { for (auto iter = m_Objects.begin(); iter != m_Objects.end(); iter++) { (*iter)->SetDestroy(true); } } void ObjectMgr::DeleteCheak() { for (auto iter = m_Objects.begin(); iter != m_Ob...
true
811aee31e421fa2e59766b8d9c0fc10366a22263
C++
nitcse2018/daa-jerinjoseph121
/DAA Assignment/Divide and Conquer Method/DivideandConquer.cpp
UTF-8
3,305
3.15625
3
[]
no_license
//product multiplication using divide and conquer //in this method instead of divind the whole polynomials together, we divide into parts //there is only three polynomial multiplications of small degree taking place //A=a1x + a0 //B=b1x + b0 //AB=a1b1x^2 + ((a1+a0)(b1+b0) - a1b1 - a0b0)x + a0b0 #include<iostream>...
true
cc5a6fceeac8175d4c3eb815e4bea86595d8f7ba
C++
pliamoconnor/Personnal-Projects
/Unlimited/Unlimited/Graphics/Mesh/Mesh.cpp
UTF-8
239
2.546875
3
[]
no_license
#include "Mesh.h" Mesh::Mesh(Vector3 position, Vector2 uv, Vector3 normal) { m_VertexData = new VertexFormat(position, uv, normal); } Mesh::~Mesh() { if (m_VertexData != nullptr) { delete m_VertexData; m_VertexData = nullptr; } }
true
7cc382274a8819ff18eb8a35269febea8cc50cab
C++
shivangigoel1302/leetcode_solutions
/number_of_good_leaf_node_pairs.cpp
UTF-8
1,054
3.203125
3
[]
no_license
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
true
bb028facc99ee56b1fc66c50b3ede03ea63d2f63
C++
madil90/miro
/src/material.h
UTF-8
1,582
2.90625
3
[]
no_license
#ifndef __MATERIAL_H__ #define __MATERIAL_H__ #include <list> #include <string> #include "miro.h" #include "Vector.h" class Material { public: Material(); virtual ~Material(); virtual void PreCalc() {} virtual Vector3 Shade (const Ray& ray, const HitInfo& hit, Scene& s...
true
b1be784044374acc2e391476fff59601da06acdb
C++
nicolasbrailo/playingwithgtk
/gtk_helper/image.h
UTF-8
1,258
2.703125
3
[]
no_license
#ifndef INCL_GTK_HELPER_IMAGE_H #define INCL_GTK_HELPER_IMAGE_H #include "general.h" #include <gtk/gtk.h> #include <string> namespace Gtk_Helper { class Image : Gtk_Object { GtkWidget *img; public: GtkWidget* get_raw_ui_ptr() { return this->img; } operator GtkWidget* () { return this->img; ...
true
6f21d5166be2b976741055e5b768656f4a6109d1
C++
nqtwilford/Misc
/CppShortCode/TextQuery/Test2.cpp
UTF-8
542
2.59375
3
[]
no_license
#include "Query.h" #include "TextQuery.h" #include <iostream> #include <algorithm> #include <string> using namespace std; TextQuery tq; void print(TextQuery::line_no lno) { cout<<lno<<":"<<tq.text_line(lno)<<endl; } int main(int argc, char **argv) { ifstream in("infile.txt"); tq.read_file(in); ...
true
59bef909d7819a9e1ba044cc386f7bfd5f78e787
C++
Markisino/Pandemic
/view/show_deck.cpp
UTF-8
1,684
3.21875
3
[]
no_license
#include <iomanip> #include "show_deck.h" auto show_deck::name() const -> std::string { return "show-deck"; } auto show_deck::description() const -> std::string { return "Show deck information"; } auto show_deck::run(context &ctx, args_type const &args, ostream_type &out) const -> void { if (args.empty()) { sta...
true
83ab1fdc13c2ac52a41a0fe5febd96e5684a3a2d
C++
binsearch/code
/topcoder/584/Egalitarianism.cpp
UTF-8
4,987
2.8125
3
[]
no_license
#line 2 "Egalitarianism.cpp" #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #...
true
c7bd866f2358d93cece3634f9fe37b3a22d2fdf6
C++
YuhuiYin/CPP-Primer-Notes
/ch12/t12-7.cc
UTF-8
481
3.625
4
[]
no_license
#include <iostream> #include <vector> #include <memory> using namespace std; shared_ptr<vector<int>> my_alloc(void) { return make_shared<vector<int>>(); } void fill(shared_ptr<vector<int>> p) { int elem; while (cin >> elem) p->push_back(elem); } void print(shared_ptr<vector<int>> p) { for (a...
true
b377ef7bcd1045e63327c613959b82085a0837f1
C++
usnistgov/OOF1
/XPPM2OOF/elector.C
UTF-8
3,524
2.515625
3
[]
no_license
// -*- C++ -*- // $RCSfile: elector.C,v $ // $Revision: 1.5 $ // $Author: langer $ // $Date: 2004-10-23 00:48:47 $ // Machinery to take care of homogeneity calculations. // Elector classes are used to vote to find the most popular kind of // pixel in a mesh triangle. There is only one of each type of // Elector, so ...
true
8ea7c44ca7933329b76fd891a6f3293bc424bdfa
C++
IzhakLatovski/programming-snippets
/C++/cppMatrix.cpp
UTF-8
3,201
3.34375
3
[]
no_license
#include <iostream> #include <string.h> using namespace std; class Matrix { private: int m_rows; int m_columns; int m_totalSize; int* m_ptValues; public: Matrix(int rows, int columns); ~Matrix(); Matrix(const Matrix& temp); Matrix& operator=(const Matrix& ...
true
49905d823bc589a25bb68232137a369f64c0cea7
C++
pennkao/algorithm
/随机算法/001randN.cpp
UTF-8
1,002
3.921875
4
[]
no_license
/* 题目:已知随机数rand(), 以概率p产生0,以概率1-p产生1,现在要求设计一个新的随机函数RandN(), * 以等概率产生1-n之间的数。 * 思路:首先这个rand()概率函数是假定存在的, * TIME:2015-4-28 */ /* 等概率产生0-1 * 0、1实际上是二进制数,那么使用rand()产生两个0的概率是 */ int Rand() { int i = 2; //00:p^2 //01:p(1-p) //10:(1-p)p //11:(1-p)^2 int n = 2*rand()+rand(); //转换成进制数 if(n == 1...
true
87ef13e24ae81da5f3984f1a6d4d3c246a8e83b1
C++
tdyx87/moon-core
/moon/net/ServerSocket.h
UTF-8
1,428
2.71875
3
[]
no_license
/** Copyright 2018, Mugui Zhou. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the License file. Author: Mugui Zhou */ #ifndef MOON_NET_SERVERSOCKET_H_ #define MOON_NET_SERVERSOCKET_H_ #include <moon/noncopyable.h> #include <moon/net/InetAddress.h> name...
true
9e8808a4984dec043a6365847a2f6cdb7f693a7a
C++
shubhampathak09/codejam
/30 days training for beginners/Problem_Bank_adhoc/ith_bit.cpp
UTF-8
228
2.609375
3
[]
no_license
// check ith bit set or not #include<bits/stdc++.h> using namespace std; int main() { int n=5; // 101 //check if 0th bit is set or nit int i=1; int ans=n & (1<<i); if(ans) cout<<ans; else cout<<"ith bit is not set"; }
true
3be09d9b3d00cd2613c33b55832fe52a2925490a
C++
xMijumaru/RamosKevin_CSC5_SPRING2018__
/Assignments/Assignment_5/Savitch_9thEdition_Chap5_PracProj6_Shootergame/main.cpp
UTF-8
2,188
3.484375
3
[]
no_license
/* * File: main.cpp * Author: Kevin Ramos * Created on April 26th, 2018, 12:10 PM * Purpose: Shooter Program */ //System Libraries #include <iostream> //I/O Library -> cout,endl #include <iomanip> //Format Library #include <cstdlib> //Srand function #include <ctime> //Time function #include <cmath> //...
true
275c7d2123519e87f49ae31f00e3b727ed5aa955
C++
UgolnikovAR/FortTE
/main.cpp
WINDOWS-1251
4,070
2.8125
3
[]
no_license
//#include <iostream> #include <conio.h> #include <string> #include <vector> #include "Data.cpp" int main() { DataClass data; /* data.object[0].field[0] = "CMake\0"; data.object[0].field[0].print('\r'); data.object[0].field[1] = 126; data.object[0].field[1].print('\r'); data.object[0].fie...
true
cdb1b68871301e24dc7673dfbf5dea79b153645b
C++
JediJeremy/unorthodox-arduino
/Unorthodox/examples/tokenfs-ramdrive.cpp
UTF-8
4,522
2.515625
3
[]
no_license
#include <unorthodox.h> unsigned long debug_count = -1; unsigned long stop_count = -1; // create a 1024 byte buffer byte storage[1024]; // wrap it in a virtual page MemoryPage store(storage); // create tokenfs storage TokenFS fs(&store,1024,192); // remember token state byte token_state[256]; const int check_token...
true
b84ac4115239026c338c4b2fc86d7500d2c4ff53
C++
Yaman8/Sorting-Visualizer
/Project1/Project1/insertion sort.cpp
UTF-8
1,548
2.671875
3
[]
no_license
//#include<iostream> //#include<SFML/Graphics.hpp> //#include<limits.h> //#include<Windows.h> //#define size 800 //using namespace std; // //int random = 0, pass = 1, itr = 0, temp = 0, lim = 799; // //struct element { // int hei; // int pos; //}num[800]; // // // //int main() { // sf::RenderWindow window(sf::VideoMode...
true
47228a1e9b88cf3c790a98a3d3be61ec1d65158f
C++
johnjacobpeters/cryoET
/Tom_Toolbox/tom_dev/IOfun/FileTool.cpp
UTF-8
42,436
2.515625
3
[]
no_license
// FileTool.cpp: implementation of the FileTool class. // ////////////////////////////////////////////////////////////////////// #include "FileTool.h" //#include "File.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ///////////////////////////////////////...
true
39f5fa58cf0d02ef3e76140926361e4312634466
C++
lstefani006/teensy
/LibStm/LeoStm/ring.cpp
UTF-8
939
3.25
3
[]
no_license
#include <ring.hpp> Ring::Ring() : _data(nullptr), _size(0), _begin(0), _end(0) { } Ring::Ring(uint8_t *buf, int32_t size) : _data(buf), _size(size), _begin(0), _end(0) { } void Ring::begin(uint8_t *buf, int32_t size) { _data = buf; _size = size; _begin = 0; _end = 0; } int32_t Ring::WriteCh(uint8_t ch) { ...
true
d139bd046d5844832b3dd07a56872bd5424076a3
C++
Mariam-Marie/Day-2
/day2.cpp
UTF-8
269
3.171875
3
[]
no_license
#include <stdio.h> int main() { int i, h, m, s; printf("Please enter a number : "); scanf("%d", &i); h = (i/3600); m = (i - (3600*h))/60; s = (i - (3600*h)-(60*m)); printf("hours: %d \n", h); printf("minutes: %d \n", m); printf("seconds: %d", s); return 0; }
true
076d89f5fafc7b20e7f78b0ee99a40b4cc91dcd0
C++
hansionz/Cpp_Code
/StackObj/StackObj.cpp
UTF-8
723
3.59375
4
[]
no_license
#include <iostream> using namespace std; class StackType { public: StackType() {} void Print() { cout << "StackType:" << this << endl; } private: //不能再堆上创建,我们可以考虑直接把operator new和new的定位表达式声明为私有的 //将operator new声明为私有的,就把new的定位表达式也声明为私有的了 void* operator new(size_t size); void operator de...
true
a88784eac938c16e515f374a1435b559b1cf7196
C++
SmileOrDie/A_VM
/srcs/error/MissingArgument.hpp
UTF-8
461
2.9375
3
[]
no_license
#ifndef MISSINGARGUMENT_HPP #define MISSINGARGUMENT_HPP #include <exception> #include <string> class MissingArgument: public std::exception { public: MissingArgument(const std::string &funct); MissingArgument(); ~MissingArgument(); MissingArgument(MissingArgument const & src); MissingArgument& ...
true
add16d1602e64a8a4e8bc99a7811eb9a2fc0090b
C++
bulacu-magda/Alemia
/data/preprocessed/train/student_62/sources/SunFlower.cpp
UTF-8
1,329
2.765625
3
[]
no_license
#include "SunFlower.h" bool SunFlower::Draw(Panel& panel) { COORD Center = this->getCenterOfDrawing(); if (panel.getChar(Center.X, Center.Y) == SPACE) { panel.setChar(Center.X - 1, Center.Y - 1, SUNFLOWER); panel.setChar(Center.X - 1, Center.Y, SUNFLOWER); //panel.setChar(Center.X - 1, Center.Y + 1, SUNFLOWER)...
true
7afdead7774a06dd97f2bd0f6b853a80ca75ce65
C++
haved/DafCompiler
/Old/OldCpp/Compiler/src/parsing/NameScopeParser.cpp
UTF-8
3,729
2.875
3
[]
no_license
#include "parsing/NameScopeParser.hpp" #include "parsing/lexing/Lexer.hpp" #include "parsing/DefinitionParser.hpp" #include "parsing/ErrorRecovery.hpp" #include "DafLogger.hpp" unique_ptr<NameScopeExpression> null_nse() { return unique_ptr<NameScopeExpression>(); } void parseGlobalDefinitionList(Lexer& lexer, std::v...
true
5f5528629317612005f06d6a0555f4330942b801
C++
yechang1897/algorithm
/math/leetcode_172.cpp
UTF-8
596
3.65625
4
[]
no_license
#include<iostream> #include<algorithm> #include<vector> using namespace std; int trailingZeroes(int n) { int zero = 0; while (n > 0) { n /= 5; zero += n; } return zero; } int trailingZeroes_2(int n) { int zeroCount = 0; // We need to use long because currentMultiple can potent...
true
e417a58ef544bed7a759d96e9ee4dfcb03eeb12d
C++
Liu-cp/Json-file
/VQA_questions/Program/Program/Program.cpp
UTF-8
2,335
2.71875
3
[]
no_license
// Program.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include "pch.h" #include <iostream> #include <fstream> #include <vector> #include <string> #include "json/json.h" using namespace std; typedef struct Questions { int image_id; string question; int question_id; }Questions; int Find(vector<int...
true
b6c9f0120ec2c79c4b2ca118faa3da1bcc424cc5
C++
anuj108/Codeforces
/dragons-sol.cpp
UTF-8
573
2.796875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<pair<int, int>> v; for (int i = 0; i < m; i++) { int x, y; cin >> x >> y; v.push_back({x, y}); } sort(v.begin(), v.end()); bool isvalid = true; for (int i = 0; i < m; i...
true
52ce69e1812176c1249c8c2c43b6d190feb9935b
C++
sudhir5595/LeetCode
/July LeetCoding Challange/05 - Hamming Distance.cpp
UTF-8
692
3.515625
4
[]
no_license
class Solution { public: int hammingDistance(int x, int y) { int answer=0; while(x||y){ //checking for atleast one of them is positive if(x&&y){ //if both x and y are positive if(x%2!=y%2) answer++; x/=2; y/=2; } ...
true
c32ee7237e0b857fdaa36b650e92454de62417ba
C++
Ming-J/LeetCode
/C++ Primer/Ch7_Class/E7_5.cpp
UTF-8
586
3.296875
3
[]
no_license
#include <iostream> struct Person{ std::string name; std::string address; std::string getName() const{ return name; } std::string getAddress() const{ return address; } } /* The function should be const, since we will not modify the this object. We are simply just getting the member function. ...
true
7339e617ddf268fbf12a348ad5032c7543278f1c
C++
DOGGY-SAINT/designPatternClassDesign
/code/group3/ll/Composite Entity Pattern/main.cpp
UTF-8
259
2.546875
3
[]
no_license
#include "Client.h" #include<iostream> using namespace std; int main() { Client* client = new Client(); client->setInfo("Sam", "Tom"); client->printInfo(); client->setInfo("Stephon", "Joe"); client->printInfo(); return 0; }
true
17aef14b046e1672e54665c07cb41afd85a42009
C++
LukasJoswiak/rec
/src/process/paxos/leader.cpp
UTF-8
12,723
2.640625
3
[]
no_license
#include "process/paxos/leader.hpp" #include <functional> #include <thread> #include <unordered_map> #include "process/paxos/compare.hpp" #include "spdlog/spdlog.h" #include "server/code.hpp" #include "server/servers.hpp" namespace process { namespace paxos { Leader::Leader( common::SharedQueue<Message>& messag...
true
a9000742df74db01e842d421898b6259a57ac205
C++
haoweiliang1996/spiderAndTrain
/structs.h
UTF-8
693
3.453125
3
[]
no_license
#include <string> using namespace std; struct douNode { string left, right; douNode(string left, string right) { this->left = left; this->right = right; } bool operator< (const douNode& rhs) const { if (left != rhs.left) return left < rhs.left; return right < rhs.right; } }; struct t...
true
857fa278fcb8f8b05be04bd8550eaeaec722d164
C++
Limeman/competitive_programming
/Leetcode/Remove Duplicates from Sorted Array/solution.cpp
UTF-8
571
3.390625
3
[]
no_license
#include<vector> /* Solution to the Remove Duplicates from Sorted Array problem https://leetcode.com/problems/remove-duplicates-from-sorted-array/ */ class Solution { public: int removeDuplicates(std::vector<int>& nums) { if (nums.size() == 0) { return 0; } else { ...
true
bee3967c4656aefbbb226f16b856bc5054bea745
C++
gusl0801/ShootingGame
/CBackBuffer.cpp
UTF-8
733
2.609375
3
[]
no_license
#include "stdafx.h" #include "CBackBuffer.h" #define ERASE_COLOR RGB(255,255,255) CBackBuffer::CBackBuffer(HWND hWnd, const RECT &rtClientSize) :m_hWnd(hWnd), m_rtClientSize(rtClientSize) { m_hBrush = CreateSolidBrush(ERASE_COLOR); HDC hdc = ::GetDC(hWnd); m_hDC = CreateCompatibleDC(hdc); m_hBmp = CreateCompat...
true
45b2824871718a216f2e5bf4d48f18fbcb935b49
C++
LeeKangW/CPP_Study
/STL_Univ/STL_Univ/소스.cpp
WINDOWS-1252
428
2.890625
3
[ "MIT" ]
permissive
#include"default.h" using namespace std; class X { private: int num; public: X(int k) :num(k){} friend ostream& operator<<(ostream& os, const X& k); }; ostream& operator<<(ostream& os, const X& k) { os << k.num; return os; } void change(X& a, X& b); int main() { X a{ 1 }; X b{ 2 }; change(a, b); cou...
true
dbdc25e289161adf9a07eb0dcbcb17da3436591f
C++
charlesg3/faux
/tests/copy.cpp
UTF-8
2,951
2.609375
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <unistd.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> #include <fcntl.h> #include <sched.h> #include <utilities/time_arith.h> static int g_cores; static int g_iterations = 4096; static int g_write_size = 4...
true
8c89427bd36bf205849cdf445f2e31c2c1856776
C++
Gundoctor/MyTest
/FinalProject/Game/Source/GameObject/Controllers/CameraController.cpp
UTF-8
1,928
2.65625
3
[]
no_license
#include "GamePCH.h" CameraController::CameraController() : m_currentFlags(0) { } CameraController::~CameraController() { } void CameraController::OnEvent(InputEvent *pEvent) { if (pEvent->GetDeviceType() == DeviceType::Keyboard) { if (pEvent->GetKeyState() == KeyState::Pressed) { ...
true
f608894fc9b35f8513e3c8da137d9d0871f9d0f7
C++
RavivTrichter/ATOOP
/Exercise2/Destination.h
UTF-8
1,099
2.953125
3
[]
no_license
// // Created by Admin on 19/05/2018. // #ifndef HW2_DESTINATION_H #define HW2_DESTINATION_H #include "Station.h" #include "Vehicle.h" #include <memory> class Destination { public: Destination(weak_ptr<Station> station, shared_ptr<Vehicle> vehicle, int weight,const string& name); // C'tor public: //bool...
true
a791efb9c0d1dd6e4ca8502edb3d98565807f7e5
C++
mmf19144/programming2020
/Ilya_prokofev/MatrixClass.cpp
UTF-8
5,971
3.796875
4
[ "MIT" ]
permissive
#include <algorithm> #include <fstream> using namespace std; class column { int* matrix; const size_t dim; const size_t column_idx; public: column(const size_t dim, int* m, const size_t col_id) : matrix(m), dim(dim), column_idx(col_id) {} int& operator[](const size_t row)//column element reference { if (row ...
true
2c136b71f6d831064828552a71805bdc8f1f83ab
C++
ggzor/competitive-programming
/Kattis/orderlyclass.cpp
UTF-8
1,151
2.75
3
[]
no_license
#include <algorithm> #include <iostream> #include <iterator> #include <string> #include <vector> using namespace std; int main() { string A, B; getline(cin, A); getline(cin, B); int N = A.size(); auto left = distance(A.begin(), mismatch(A.begin(), A.end(), B.begin()).first); auto right = dis...
true
0db9532071f6fc563d45049957b6311c20e801d8
C++
yanhongjuan/Algorithm
/sort/sort6_shell.cpp
UTF-8
1,330
3.515625
4
[]
no_license
/*@brief:希尔排序*/ /*目的:利用插入排序简单,同时克服插入排序每次只交换两个元素的缺点*/ /*定义增量序列,递减的序列间隔,最后间隔为1进行插入排序*/ /*更小间隔的排序任然保持上一间隔有序*/ /*适用于数据量大的排序*/ /*希尔排序的时间复杂度和增量序列有关,{1,2,4,8..}这种为o(n^2),它是不稳定排序*/ /*参考博客:https://blog.csdn.net/zpznba/article/details/88407089 但是程序是错的,增量错误*/ #include <iostream> #include <vector> using namespace std; void shell_s...
true
91a2651062ccefc451c5b9c2a770dbccfc2db692
C++
yuting-zhang/UVa
/10945 - Mother bear/bear.cpp
UTF-8
761
3.375
3
[]
no_license
#include <iostream> #include <string> #include <cstdio> using namespace std; bool is_char(char ch){ return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); } char to_uppercase(char ch){ if (ch >= 'A' && ch <= 'Z') return ch; return ch - ('a' - 'A'); } int main(){ string line; while (getline(cin, line) &...
true
441226cddc2c0bb381f31adb583af576a7ba806d
C++
fazeelkhalid/University-of-Okara-Oop-final-2020
/Q2/student.h
UTF-8
675
2.90625
3
[]
no_license
#pragma once #ifndef student_H #include"user.h" #include<iostream> using namespace std; class student:public user { private: char *name; int sclass; // student class public: student() { name = NULL; sclass = 0; } void setStudentinfo() { name = new char[36]; cout << "\nEnter student name without space : ";...
true
bc05df82a4d94994a3b493e226e93d9780b0c736
C++
uym2/HGT_triplets
/tripPairs/RootedTree.cpp
UTF-8
24,275
2.828125
3
[]
no_license
#include <cstdlib> // for exit #include "rooted_tree.h" #include "hdt.h" #include <fstream> #include <sstream> #include <algorithm> #include <string> /**************/ /* uym2 added */ void RootedTree::countLeaves(){ if (this->isLeaf()) { this->n = 1; return; } int nSum = ...
true
0fdc7d4a97ae4bb79827c46842a857b40bd12872
C++
JingxueLiao/Data_Structures_and_Algorithms
/problems/find_the_duplicate_number.cpp
UTF-8
872
3.484375
3
[ "MIT" ]
permissive
// Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. // Assume that there is only one duplicate number, find the duplicate one. // Note: // You must not modify the array (assume the array is read only). // You must use ...
true
8147c119479938d37fc9a0b98679ead4db766571
C++
baris-topal/Polynomial_Calculation
/Polinom_Hesaplaması.cpp
UTF-8
4,022
2.953125
3
[]
no_license
 #include <iostream> #include <string> using namespace std; void yaz(int kat[], int kuv[], int boyut) { string poli; for (int i = 0; i < boyut; i++) { if (kat[i] == 0) {} else if (kuv[i] == 0 && kat[i] != 0) { poli = poli + " " + to_string(kat[i]) + " +"; } else { poli = poli + " " + to_string(kat[i]...
true
cd6067dd3edc5e10035c388f25016134f150846c
C++
trojancode95/Day-toDay-Codes
/Sorting-Algorithms/ShellSort.cpp
UTF-8
654
3.3125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int shellsort(int arr[],int n) { for(int gap=n/2;gap>0;gap/=2) { for(int i=gap;i<n;i+=1) { int temp=arr[i]; int j; for(j=i;j>=gap && arr[j-gap]>temp;j-=gap) arr[j]=arr[j-gap];...
true
862c86adb063c4c08a36d5d2ceb47c641fa89adb
C++
abrdo/Widget_library---in_CPP
/MyWidgetApplications/selectorlist.cpp
UTF-8
4,034
2.515625
3
[]
no_license
#include "selectorlist.hpp" #include <iostream> #include <vector> #include <cmath> using namespace std; using namespace genv; using namespace dowi; SelectorList::SelectorList(int x, int y, int sx, int sy) : Widget(x,y,sx,sy){ _items = {}; _selected_index = -1; _leading = _fonthight+2; _scroll_shift = ...
true
a12cfbfe82341d6e2f33e574c296834cfe633f7f
C++
DavidLaMartina/RideTheWorm
/utility.cpp
UTF-8
19,646
3.390625
3
[]
no_license
/************************************************************************************************** * Project: Reusable Utility Functions * Author: David LaMartina * Date: January 17, 2018 * Description: These utility functions are applicable to a variety of programs. They are primarily * used for validating numer...
true
24b7ae17ecf9fcadaff1149ffb501065a6be50da
C++
kuki-xie/-
/336多关键字排序/336.cpp
UTF-8
872
3.34375
3
[]
no_license
// // main.cpp // 336多关键字排序 // // Created by 谢容海 on 2020/12/18. // #include <iostream> #include <algorithm> using namespace std; struct stu{ char name[20]; int age,score; }stu[100];// 整数小于等于100 bool compare(struct stu stu1,struct stu stu2){ if (stu1.score != stu2.score) { return stu1.score > stu...
true
d2efa4cf11d7ccadccc2600dc6b42c2c0cce67fb
C++
sadads1337/fit-gl
/src/Kononov/Common/Scene/DirectionInputController.cpp
UTF-8
2,507
2.703125
3
[ "MIT" ]
permissive
#include "DirectionInputController.hpp" namespace Kononov { void DirectionInputController::update(float /*delta*/) {} void DirectionInputController::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { m_lastPosition = event->pos(); m_mousePressed = true; } } void DirectionInpu...
true
bbbc063fa4371524c61fbeb5ca27c41c444cdc08
C++
DrGr4f1x/raytracing-ref
/core/texture.h
UTF-8
1,206
3
3
[ "MIT" ]
permissive
#pragma once #include "noise.h" class Texture { public: virtual Vec3 value(float u, float v, const Vec3& p) const = 0; }; class ConstantTexture : public Texture { public: ConstantTexture(const Vec3& c) : m_color(c) {} Vec3 value(float u, float v, const Vec3& p) const override { return m_color; } privat...
true
c8c35a0188f5274f1091255f9e8a0fe288bb556f
C++
EvaristArdon/portafolio_00361518
/Ejercicios labo/Labo 2/Ejercicio5c.cpp
UTF-8
643
3.65625
4
[]
no_license
#include <iostream> using namespace std; void TorrHanoi(int discos,int Orig,int Aux, int Dest){ if(discos==1) cout<<"Sujeta el disco de la torre "<<Orig<<" y colocalo en la torre "<<Dest<<endl; else{ TorrHanoi(discos-1,Orig,Dest,Aux); cout<<"Sujeta el disco de la torre "<<Orig<<" y colocalo ...
true
7da349d70f4186303106ac7697fdaba3b157b035
C++
sweetmentor/Learning-cpp
/hello-cpp-world.cc
UTF-8
1,161
3.5
4
[]
no_license
#include <iostream> #include <cmath> using namespace std; int main() { // std::cout << " / |" << std::endl; // std::cout << " /____|" << std::endl; // std::cout << " /|" << std::endl; // std::cout << " / |" << std::endl; // std::cout << " / |" << std::endl; // std::cout ...
true
bebb2d56f0a5e4de7286382222b08bfb2f911793
C++
Apelcina/Super-Matching
/Super-Matching/src/utility_funcs.cpp
UTF-8
879
3.875
4
[]
no_license
#include <iostream> void swap(int* arr, int a, int b) { int temp = arr[a]; arr[a] = arr[b]; arr[b] = temp; } int partition(int* arr, int low, int high) { int j = low; int pivot = arr[high]; for(int i = low; i < high; i++) if(arr[i] <= pivot) { swap(arr, i, j); j++; } swap(arr, j, high); re...
true
27a7ac2d023e26818b7cd4dd3369f030f1c3b643
C++
Crazyremi/ITSA-C-
/c_mm37.cpp
UTF-8
514
2.78125
3
[]
no_license
#include<iostream> using namespace std; int main() { int a,b; cin >> a >> b; if(a==0&&b==0) cout << "origin\n"; else if(a==0) cout << "y-axis\n"; else if (b==0) { cout << "x-axis\n"; } else if (a>0&&b>0) { cout << "1st Quadrant\n"; } else if (a...
true
ea93dec74fcba1ec7743028c6aa16eb59c6212e1
C++
piecedigital/GGPOPLUSR
/src/util/procutil.cpp
UTF-8
989
2.609375
3
[ "MIT" ]
permissive
#include <"procutil.h"> #include <stdexcept> #include <Windows.h> #include <Psapi.h> namespace util { bool get_module_bounds(const char* name, uintptr_t* start, uintptr_t* end) { const auto module = GetModuleHandle(name); if (module == nullptr) { return false; } MODULEINFO info; GetModuleInformation(Ge...
true
c20936f9febc0722384b6bd88678e27920dca246
C++
Hd0702/Search_Engine
/queryprocessor.cpp
UTF-8
5,974
2.9375
3
[]
no_license
#include "queryprocessor.h" /** * @brief queryProcessor::queryProcessor : this takes user input and sets into our processor * @param qur : this is the user query we're going to analyze */ queryProcessor::queryProcessor(string qur) { query = qur; } /** * @brief queryProcessor::splitQuery : this stems every query and...
true
a2d01402016f713d0cc5c7c37a8e3420a9b44deb
C++
Alaxe/noi2-ranking
/2020/solutions/E/PDP-Varna/PDP/balans.cpp
UTF-8
386
2.890625
3
[]
no_license
#include <iostream> using namespace std; int main () { int n; char a; int brAB; int brCD; int brB; cin >> n; cin >> a; if(a == 'a' || a == 'b') { brAB++; } if(a == 'c' || a == 'd') { brCD++; } if(brAB == brCD) { ...
true
2467a3860089ea360b9939a7894f0156237a6eb3
C++
buresm11/mirunInterpreter
/src/Visitor.h
UTF-8
42,495
2.71875
3
[ "BSD-3-Clause" ]
permissive
#pragma once #include <iostream> #include <fstream> #include <string> #include "tlVisitor.h" #include "tlParser.h" #include "Runtime.h" #include "IntObj.h" #include "StringObj.h" #include "BoolObj.h" #include "ArrayObj.h" #include "ContextValue.h" #include "FuncArgDeclContext.h" #include "Function.h" #include "FuncAr...
true
f7c2db7d563187d1a0356ab8ac831a828b5621df
C++
mdarafat1819/Timus-OJ
/1209 - 1, 10, 100, 1000...(using b_search).cpp
UTF-8
615
2.84375
3
[]
no_license
#include <bits/stdc++.h> #define SIZE 65537 #define u_int unsigned int using namespace std; int b_search(u_int ara[], int l, int r, u_int k) { if(l > r) return 0; int mid = l + (r - l) / 2; if(ara[mid] == k) return 1; if(ara[mid] < k) return b_search(ara, mid + 1, r, k); if(ara[mid] > k) return ...
true
6acfbc2c92937e8a3f2d9e0e90f321fd92dbdc75
C++
idgetto/PancakeArduino
/PancakePrinter/Extruder.cpp
UTF-8
750
2.921875
3
[]
no_license
#include "Extruder.h" #include <Arduino.h> Extruder::Extruder(Adafruit_DCMotor *pumpMotor, Adafruit_DCMotor *solenoidMotor) : _pumpMotor{pumpMotor}, _solenoidMotor{solenoidMotor} { } void Extruder::extrudeOn(float speed) { openValve(); runPump(speed); ...
true
402072750f75f75b9bc9d0a59bd75378af59298a
C++
vu1p3n0x/GameGame
/GameGame/GameGame/textobject.h
UTF-8
988
2.5625
3
[]
no_license
// FILE: textobject.h // DATE: 2/25/13 // DESC: declaration of the class to manage an object of text #ifndef TEXTOBJECT_H #define TEXTOBJECT_H // #define _CRT_SECURE_NO_WARNINGS #include <string> #include "graphicsobject.h" #ifndef FONTOBJECT_H class FontObject; #endif class TextObject { private: struct VertexTyp...
true
c7eee53ec3cc4882b6839836cc8eddba648848f2
C++
kolusask/Snake
/field.hpp
UTF-8
735
2.515625
3
[]
no_license
#ifndef FIELD_H #define FIELD_H #include <SDL2/SDL.h> #include <SDL2/SDL_image.h> #include <stdlib.h> #include "snake.hpp" #define TILE_WIDTH 50 #define TILE_HEIGHT 50 enum Tiles { EMPTY, HEAD, TAIL, TREAT }; class Field { public: Field(const int w, const int h, const unsigned snake_len); ~Field(); int...
true
d1ae870bc0d8f031e5c65ad3a535eb842f9cccff
C++
cms-analysis/HeavyFlavorAnalysis-Bs2MuMu
/ana-naegeli/ncFormula.cpp
UTF-8
5,845
2.890625
3
[]
no_license
/* * ncFormula.cpp * * Created by Christoph Nägeli <christoph.naegeli@psi.ch> on 02.07.12. * */ // my headers #include "ncFormula.h" // Standard headers #include <algorithm> #include <utility> #include <queue> using std::string; ncFormula::ncFormula() : fName(""), fOp(false) {} ncFormula::ncFormula(std::str...
true
50508fbb7d5ea20d78ccf4c7fba4812cfefe1c24
C++
nhoudelot/antedominium-by-traction
/texture.cpp
ISO-8859-1
1,783
2.625
3
[]
no_license
#include "stuff.hpp" #include "texture.hpp" Texture::Texture(int pwidth, int pheight, unsigned long *pdata) { int i; width = pwidth; height = pheight; data = new unsigned long[width*height]; for (i=0;i<width*height;i++) { data[i] = pdata[i]; } } Texture::Texture(int pwidth, int pheight) { ...
true
7e951114cde2224cf7f9072f0d6207ea56fc3533
C++
Francisco0947/COJ
/1493 - Geometrical Task II.cpp
UTF-8
510
3.296875
3
[]
no_license
# include <iostream> # include <cstdio> using namespace std; int main() { string x; cin>>x; if(x == "circle") { double radio; cin>>radio; radio = 3.14*(radio* radio); cout<<radio; }else if(x == "triangle") { double base,altura; cin>>base>>altura...
true
b0c9032e726f2e9993b726d147440745c558ea08
C++
guithin/BOJ
/15668/Main.cpp
UTF-8
670
2.59375
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int n; int pick[11]; int chk[11]; void back(int cur) { if (cur == 11) { for (int i = 0; i <= 10; i++) { for (int j = 0; j <= min(i, 10 - i); j++) { int a = 0, b = 0; for (int k = 0; k <= i; k++) { a *= 10; a += pick[k]; } for (int k = 0; k <= j; ...
true
2714d718152ac3871a44b0a3cc83b848e24e954b
C++
jamesbertel/CS-211-x
/lab24/queue.cpp
UTF-8
3,179
4.0625
4
[]
no_license
#include <iostream> using namespace std; typedef char el_t; class Queue { private: struct QueueNode { el_t letter; // letter in the node QueueNode *next; // Pointer to the next node }; // declare the following: // Pointer to the front of the Queue QueueNode * front; // Pointer to the rear of th...
true
c4c1c320e7d6d38727e6645b079f198ec7c66f20
C++
chupakabr/coursera-cpp-solutions
/CourseraCpp/week03/task1.cpp
UTF-8
1,534
2.953125
3
[]
no_license
// // Created by Valeriy Chevtaev on 11/4/13. // Copyright (c) 2013 7bit. All rights reserved. // #include <iostream> #include <vector> #include "task1.h" #include "random_graph.h" using namespace std; void week03::task1::run(int argc, const char** argv) { if (argc < 1) { cerr << "Path to a file having ...
true
10807366a4f8210b7c69646174c8523a4b5431de
C++
thejosess/Informatica-UGR
/2ºAÑO/1ºCuatrimestre/ED/Practicas/practica2/src/Termino.cpp
UTF-8
864
3.5625
4
[]
no_license
#include "Termino.h" bool Termino::operator==(const Termino& termino) { return this->getPalabra() == termino.getPalabra(); } istream& operator>>(istream& is, Termino& term) { string def, palabrita; getline(is, palabrita, ';'); getline(is, def, '\n'); term.setDefinicion(def); term.se...
true
d19ad447fce271ecf8cd5956e5179a94c12ee3b7
C++
APGRoboCop/jk_botti
/neuralnet.h
UTF-8
2,012
2.59375
3
[ "BSD-3-Clause" ]
permissive
#include "new_baseclass.h" /******************************************************************* CNeuron */ class CNeuron : public class_new_baseclass { public: int m_num_inputs; double *m_weights; CNeuron(): m_num_inputs(0), m_weights(nullptr) {} CNeuron(int num_inputs, double in_weights[]); int get_num_inputs(...
true
6d39722f76bc84d66d7566ddca4774aed3ac120f
C++
aditk3/JUCE-Projects
/MIDI Connect/Source/MidiPianoRoll.h
UTF-8
4,220
3.15625
3
[]
no_license
//============================================================================== /// @file MidiPianoRoll.h /// A component that displays a piano roll animation of incoming midi messages. #pragma once #include "../JuceLibraryCode/JuceHeader.h" /// A Component that displays a midi note in piano roll notation. struct P...
true
6d3a2331816f656d525e44f241c746e5380cf42d
C++
openbmc/phosphor-net-ipmid
/crypt_algo.hpp
UTF-8
6,682
3.171875
3
[ "Apache-2.0" ]
permissive
#pragma once #include <array> #include <cstddef> #include <cstdint> #include <vector> namespace cipher { namespace crypt { /** * @enum Confidentiality Algorithms * * The Confidentiality Algorithm Number specifies the encryption/decryption * algorithm field that is used for encrypted payload data under the sessi...
true
91648713b046e1aa37ab6ba49fb8d88ee24fde9f
C++
TTeun/TDJ
/week2/uppertri/19.cc
UTF-8
275
2.703125
3
[]
no_license
#include <iostream> using namespace std; size_t index(size_t nFighters, size_t one, size_t two) { return one > two ? index(nFighters, two, one) : one * nFighters - (one * one + one) / 2 + two - one - 1; } int main(int argc, char * argv[]) { return 0; }
true
25e2cc5c4013b61d0463f60232af6bf9db2ed624
C++
N0I0C0K/VJ_training
/temp.cpp
UTF-8
150
2.515625
3
[]
no_license
#include<iostream> using namespace std; int main(int argc, char const *argv[]) { int a=5,b=6,c=7, f; f= c>b>a; cout<<f; return 0; }
true
1269abc3eec6c387d5586114470191f1a702722c
C++
Lihit/LeetCode
/Medium/419. Battleships in a Board.cpp
UTF-8
1,549
3.609375
4
[]
no_license
// Given an 2D board, count how many battleships are in it. The battleships are represented with 'X's, // empty slots are represented with '.'s. You may assume the following rules: // You receive a valid board, made of only battleships or empty slots. // Battleships can only be placed horizontally or vertically. In o...
true
da3f1a57369800e870618b652735c68bb969999b
C++
gaolichen/contest
/topcoder/124_2/250/250.cpp
UTF-8
4,953
2.8125
3
[]
no_license
//program framework generated with WishingBone's parser :)- //common header #include <iostream> #include <vector> #include <string> #include <deque> #include <map> #include <set> #include <list> #include <algorithm> #include <utility> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> using names...
true
49d69bfdd47031e9af62a5183ca28479f95d9654
C++
anhendric/Physium
/Sources/DrawWindow.h
UTF-8
756
2.578125
3
[]
no_license
#ifndef DRAWWINDOW_INCLDUED #define DRAWWINDOW_INCLDUED #include "ScribbleDocument.h" /////////////////////////////////////////////////////////////////// // // DrawWindow - Child Window that manages drawing // /////////////////////////////////////////////////////////////////// class DrawWindow: public CPWindow { pro...
true
bd8bcfb4c6c4f6c52c35d1ab0453911975ad5781
C++
RolandoAndrade/NubeUCABManager
/server/usermanager.cpp
UTF-8
847
2.859375
3
[]
no_license
#include "usermanager.h" bool UserManager::addUser(QString user, QString password, QString home) { return addUserToFile(user.toStdString(), password.toStdString(), home.toStdString()+"/"+user.toStdString()); } bool UserManager::removeUser(QString user) { return removeUsersFromFile(user.toStdString()); } QVar...
true