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
95c90931a3939c702fd988fb7eae8bf8e3188acd
C++
narnoura/multivec
/multivec/monolingual.cpp
UTF-8
46,851
2.9375
3
[ "Apache-2.0" ]
permissive
#include "monolingual.hpp" #include "serialization.hpp" const HuffmanNode HuffmanNode::UNK; void MonolingualModel::addWordToVocab(const string& word) { auto it = vocabulary.find(word); if (it != vocabulary.end()) { it->second.count++; } else { HuffmanNode node(static_cast<int>(vocabulary....
true
8d769cf35dbf11e01ac5e53c3124ed4b63d1feb6
C++
Ph0en1xGSeek/ACM
/POJ & HDU/Find_a_multiple.cpp
UTF-8
938
2.59375
3
[]
no_license
#include <iostream> #include <stdio.h> #include <algorithm> #include <string.h> using namespace std; int arr[10010]; int sum[10010]; int vis[10010]; int main() { int n, from = 0, to = 1; int flag; arr[0] = sum[0] = 0; memset(vis, -1, sizeof(vis)); vis[0] = 0; while(~scanf("%...
true
3a1176eae644fe7796e67e2ab1b96af6e0039a83
C++
PeterSommerlad/talks_public
/ACCU/2021/ModernCppWorkshop/workspace/BoundedBufferComplete/src/MemoryOperationCounter.h
UTF-8
1,822
3.359375
3
[]
no_license
#ifndef MEMORYOPERATIONCOUNTER_H_ #define MEMORYOPERATIONCOUNTER_H_ struct MemoryOperationCounter { MemoryOperationCounter() = default; MemoryOperationCounter(unsigned moves, unsigned copies, bool known_state) : moves { moves }, copies { copies }, known_state { known_state } { } MemoryOperationCount...
true
fab1d65713543ad45c16f66bd0320a357536f42c
C++
vishaldotkhanna/Coding-Practice
/sorted_insertion_ll.cpp
UTF-8
1,695
3.703125
4
[]
no_license
#include<iostream> #include<vector> #include<cmath> #include<algorithm> #include<bitset> #define MAX_SIZE 500 using namespace std; typedef long long LL; //Sorted insertion in Linked List. struct node { int data; struct node* next; } *start, *ptr, *prev, *cur; int insert_back(int val) { ptr = new struc...
true
6560a8627e53cfe0ab0795cf17778916754e65df
C++
dekrain/I-made-a-LISP
/src/printer.cpp
UTF-8
4,888
2.71875
3
[]
no_license
#include "printer.hpp" #include <sstream> namespace mal { Printer& OstreamPrinter::operator<<(print_begin_t beg) { is_raw = beg.print_raw; return *this; } Printer& OstreamPrinter::operator<<(print_end_t) { stream << std::endl; return *this; } Printer& OstreamPrinter::operator<<(const std::string& str) { s...
true
223f789524c2e4c1cbc29dc24055e148b39fb4cc
C++
LH-2017/cpp_example
/do_whie/d.cpp
UTF-8
489
2.84375
3
[]
no_license
#include <stdio.h> int main() { //int inside = 10; int out = 10; do { //out--; int inside = 10; do { switch (out) { case 1: switch (inside) { case 5: printf("*"); break; default: printf(" "); } inside--; } /*switch (inside) { case 5: cas...
true
6e9f77f9230c3df02fa288a5c3bd8e0bafa53e2d
C++
kromero16/blackjack-1
/blackjack/blackjack/game.h
UTF-8
784
2.625
3
[]
no_license
// // game.h // // Projeto 2 PROG // // Turma 6 Grupo 4 // // Diogo Eiras - ei11087 // IDE - Eclipse, Visual Studio // // Pedro Fernandes - ei11122 // IDE - Xcode // #ifndef game_h #define game_h #include <vector> #include "player.h" #include "round.h" #include "dealer.h" class Game{ vector<Player> playe...
true
d153b01aa6c40a53145a5c15c61a9f4e10c7f25d
C++
calvin456/intro_derivative_pricing
/cpp_dsgn_pattern_n_derivatives_pricing/chapter11/exercise/exercise/main.cpp
UTF-8
2,955
2.71875
3
[ "MIT" ]
permissive
/* //ex 11.1 Implement the factory from chap. 10 using the monostate pattern //instead of the Singleton pattern Compare implementation of book example, curiuosly recurring template pattern , and monostate pattern */ #include <string> #include <iostream> #include <memory> #include<SimpleMC8.h> #include<ParkMille...
true
10610247846db6481d509293af71e342e0230afe
C++
savvynavi/Intro-to-cpp
/Inheritance/inheritance question 1/inheritance question 1/bike.cpp
UTF-8
1,808
3.46875
3
[]
no_license
#include"vehicle.h" #include"bike.h" #include<iostream> using namespace std; //Default Constructor Bike::Bike(){ setPowered(true); setWheelNum(2); setSpeed(0); setMotorised(false); setSeatNum(1); setType("land"); setBasketWeight(5); setSeatNum(1); setWindowNum(0); } //Destructor Bike::~Bike(){ } //gets the...
true
8f58f5a4e88fb3cddd9ed9a16de8c0c6c35354cd
C++
shantanu092/Voice-Controlled-Car
/voice_BT_Car/voice_BT_Car.ino
UTF-8
1,572
3.171875
3
[]
no_license
String voice; void setup() { Serial.begin(9600); //start serial communication pinMode(10,OUTPUT); pinMode(11,OUTPUT); pinMode(12,OUTPUT); pinMode(13,OUTPUT); pinMode(1,OUTPUT); pinMode(0,INPUT); pinMode(8,OUTPUT); } void loop() { while (Serial.available()){ //Check if there is an available byte to read delay(...
true
884354ac9f38e2c91ed758fa11d33bdaed2661c0
C++
Smartuil/Study-CPP
/studyC++/函数指针语法基础.cpp
GB18030
2,007
3.65625
4
[]
no_license
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <string.h> //ָ룺һָ룬ʲôָأָָ롣int (*p)[4]; //ָ飺һ飬ʲôأװָ顣int *p[3]; void main1() { int a[10];//aԪصĵַ &aĵַ a+1 4 &a+1һ40 { //һ typedef int(myTypeArray)[10]; myTypeArray myArray; myArray[0] = 10; printf("%d\n", myArray[0]); } ...
true
8b1668e739b66af7f3426a03bae5546d7155ed93
C++
socc-io/algostudy
/baekjoon/smilu/2577.cpp
UTF-8
247
2.75
3
[]
no_license
#include <cstdio> int cnt[10]; int main(void) { int val = 1, tmp; for(int i = 0; i < 3; ++i) { scanf("%d", &tmp); val *= tmp; } while(val) { cnt[val % 10]++; val /= 10; } for(int i = 0; i < 10; ++i) { printf("%d\n", cnt[i]); } }
true
6675cdbcba289c10cd2efeb9edb0d2ddf8d987fe
C++
brunovergilio/Vulkan-Demos
/Vulkan/Internal/VulkanRenderer/VertexLayout.h
UTF-8
1,069
2.734375
3
[]
no_license
#pragma once #include "BvMath.h" #include "VulkanUtils.h" enum BvVertexLayout : uint32_t { BV_VERTEX_POSITION = 0x1, // 3 floats BV_VERTEX_COLOR = 0x2, // 4 floats BV_VERTEX_TEXCOORD = 0x4, // 2 floats BV_VERTEX_NORMAL = 0x8, // 3 floats BV_VERTEX_TANGENT = 0x10, // 3 floats BV_VERTEX_BITANGENT = 0x20, // 3 f...
true
06779c88e685a1e802469c6af1621eb047b60aa4
C++
fmi-lab/oop-kn-2019-group4
/practicum/Week08_Multiple_Inheritance(21.04)/Solutions/Project/Teacher.cpp
UTF-8
809
3.21875
3
[]
no_license
#include "Teacher.h" #include "Functions.h" #include "User.h" #include <iostream> #include <ostream> #include <string.h> Teacher::Teacher(char const * _firstName, char const * _lastName, char const * pass, int _grade) : User(_firstName, _lastName, pass, "teacher") { this->grade = _grade; } void Teach...
true
f6e0edad0ebe562daa9d38a5c8629de2a0aef5ae
C++
aleanajla/projek1
/project1.cpp
UTF-8
10,349
2.796875
3
[]
no_license
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <time.h> struct Node{ char name[25]; char pass[25]; Node *prev, *next; Node *fsentprev,*fsentnext,*fsenttail; }*head,*tail; Node *now,*pantat; Node *createNode(const char* name,const char* pass){ Node *newNode = (Node*)malloc(siz...
true
69cea8844fe5f82d290ea8edf25b9be8014b4f96
C++
DarthObsidian/LearningPython
/Homework8/Stuff/CCSC/Algorithms/queries3.cpp
UTF-8
1,082
3.65625
4
[]
no_license
#include <algorithm> #include <iostream> #include <iterator> #include <vector> using namespace std; class gt_n { int n; public: gt_n(int the_n) { n = the_n; } bool operator()(int m) { return m > n; } }; typedef vector<int>::iterator iter; void display(iter start, ...
true
f9a0e07fbe4a382c83aa616cf4592a001cfe88ff
C++
c0dysharma/DSA-Practice
/Searching and Sorting/push_zeros.cpp
UTF-8
571
3.8125
4
[]
no_license
#include <iostream> void swap(int& a , int& b){ int temp = b; b = a; a = temp; } void pushZeros(int arr[], int size){ int count = 0; for(int i = 0; i<size; i++){ if(arr[i] != 0) swap(arr[count++], arr[i]); } } int main(void){ int size; std::cin >> size; int* a...
true
5a1598efb76fa06ad676b1a73a24bfc42b50f169
C++
ARW2705/leet-code-solutions
/solutions/994-M-Rotting-Oranges/main.cpp
UTF-8
2,507
3.390625
3
[ "MIT" ]
permissive
#include <iostream> #include <vector> #include <queue> #include "../../utilities/print-matrix.cpp" #include "../../utilities/compare-matrices.cpp" int enqueueNeighbors(std::queue<std::pair<int, int>>& q, std::vector<std::vector<int>>& grid, int row, int col) { std::vector<std::pair<int, int>> neighbors { { -1, 0 }, ...
true
d9010dfa7bfaa006f2a26c6ebfaeffdd67266f27
C++
PhucKhangDang/C-plusplus_E
/Lab02/Lab02_Bai03/Lab02_Bai3/program.cpp
UTF-8
974
3.28125
3
[]
no_license
#include<iostream> #include<conio.h> #include<math.h> using namespace std; double TinhCanhBen(int a, int b, int h); double TinhChuVi(int a, int b, double canhBen); double TinhDienTich(int a, int b, int h); int main() { int a, b, h; double canhBen, chuVi, dienTich; cout << endl << "Nhap a: "; cin >> a; cout << en...
true
c70882f1682d02d543d61138904d167fe1115570
C++
sabyers1/CodeExamples
/helloworld/helloworld.cpp
UTF-8
161
2.671875
3
[]
no_license
#include <iostream> using namespace std; int main(){ cout << "Hello Steve" << endl; printf("Steve is a bullfrog.\nStacy is a toad.\n"); return 0; }
true
d7e88730c66e086b1c39e68a4f089707118cd88d
C++
mssola/programs
/lang/c++/moving.cpp
UTF-8
1,404
3.890625
4
[ "MIT" ]
permissive
/* * Copyright (C) 2014-2016 Miquel Sabaté Solà <mikisabate@gmail.com> * This file is licensed under the MIT license. * See the LICENSE file. */ #include <iostream> #include <string> class Thing { public: // NOTE: it's *important* that this string is not `const`, because the // std::string class does *not* have...
true
9ece758c4caf4c0391cf7bf079c7e2c4f5662fb8
C++
renaudpinon/Arduino_memory
/Sources/02_tas_buffer.ino
UTF-8
375
2.546875
3
[]
no_license
#include <Arduino.h> void setup() { Serial.begin(9600); } void loop() { uint8_t* buffer1 = (uint8_t*)malloc(10); uint8_t* buffer2 = (uint8_t*)malloc(10); Serial.println("Addr1: Ox" + String((uint16_t)buffer1, HEX)); Serial.println("Addr2: Ox" + String((uint16_t)buffer2, HEX)); free(...
true
0e5b266667941dab75015464c2b8d66083c7e41a
C++
fabba/BH2013-with-coach
/Src/Representations/Sensing/ArmContactModel.h
UTF-8
1,822
2.671875
3
[ "BSD-2-Clause" ]
permissive
/** * @file ArmContactModel.h * * Declaration of class ArmContactModel. * @author <a href="mailto:fynn@informatik.uni-bremen.de">Fynn Feldpausch</a> * @author <a href="mailto:simont@informatik.uni-bremen.de">Simon Taddiken</a> * @author <a href="mailto:arneboe@informatik.uni-bremen.de">Arne Böckmann</a> * */ #pragma o...
true
32e2aa0bb30fd48074cd7d1e6bce52080a4aced4
C++
TYuenCN/AggregateTestCPP
/AggregateTestCPP/main.cpp
UTF-8
3,432
2.78125
3
[]
no_license
// // main.cpp // AggregateTestCPP // // Created by 袁峥 on 16/12/21. // Copyright © 2016年 袁峥. All rights reserved. // //#define NDEBUG #include <iostream> #include "TestClass.hpp" #include "TestFuncArgs.hpp" #include "TestMacroDefine.hpp" #include "TestConstructor.hpp" #include "TestClassInherit.hpp" #include "Tes...
true
5f7bc2482dc419784bfd0170df510066f8a4382c
C++
jhwestmoreland/CSCE-1030
/Lab9/Lab9A.cpp
UTF-8
956
3.703125
4
[]
no_license
/* Jared Westmoreland csce 1030.001 11/15/2018 Gets average of file input */ #include <iostream> #include <fstream> #include <cstdlib> using namespace std; int main() { //variables int x=0; int count=0; float sum=0; float avg=0; //allows us to read file ifstream in_s; //opens file ...
true
00afa1eafd6f5330543ada57e28c27f10629a5d7
C++
LaplaceKorea/binary_bakery
/binary_bakery_lib/src/file_tools.cpp
UTF-8
1,860
3.078125
3
[ "MIT" ]
permissive
#include <binary_bakery_lib/file_tools.h> #include <fstream> #include <fmt/format.h> namespace { auto get_absolute_path(const fs::path& path) -> fs::path { if (fs::exists(path) == false) throw std::runtime_error("Path doesn't exist"); if (path.is_absolute()) return path; e...
true
ac18d3fe9dd9f23527109eaae42ac3afb2eb29db
C++
wwuhn/C-CPP
/1cpp单文件/多态/动态多态与编译器行为.cpp
GB18030
956
3.34375
3
[]
no_license
#include<iostream> using namespace std; class Animal { public : virtual void shout() = 0; }; class Dog :public Animal { public: virtual void shout(){ cout << ""<<endl; } }; class Cat :public Animal { public: virtual void shout(){ cout << "~"<<endl; } }; class Bird : public Animal { public:...
true
e9c19241096c190a756e7e40d456c3dc84440485
C++
Hanuvendra/Codechef_Codes
/practice/beginner/palindromic_substrings.cpp
UTF-8
530
3.046875
3
[]
no_license
#include <iostream> using namespace std; int main(){ int i, t, j, c, k; string s1, s2; cin >> t; for(i=0; i<t; i++){ cin >> s1 >> s2; c = 0; for(j=0; j<s1.size(); j++){ for(k=0; k<s2.size(); k++){ if(s1[j] == s2[k]){ c...
true
d8a46f1003ea7bcd84b3388cba67111695e82ab9
C++
klarmann2018/sams_teach_c-_in_one_hour_a_day
/sams_teach_c++_in_one_hour_a_day/09/listing9_11.cpp
UTF-8
1,201
3.25
3
[]
no_license
/* * ===================================================================================== * * Filename: listing9_11.cpp * * Description: A Database class MonsterDB That Allows Object * Creation Only on the Free Store(Using new) * * Version: 1.0 * Created: 2017年02月28日 21时23分44秒 *...
true
20aac55c150148b43407da3f62bc5b2b99ff6d9c
C++
couocu19/codevs
/3061.cpp
UTF-8
555
3.03125
3
[]
no_license
#include <iostream> using namespace std; int main() { long dwA,dwB,dwResult; char dwOp; cin >> dwA>>dwB; cin>>dwOp; switch (dwOp) { case '+': dwResult=dwA+dwB; break; case '-': dwResult=dwA-dwB; break; case '*': ...
true
7ead49a4303916a0d4690d996d177566630a1ca0
C++
typhigh/ACM-2019
/typ-trainning/DataStruct1/KMP/LightOJ1258.cpp
UTF-8
766
2.65625
3
[]
no_license
#include <bits/stdc++.h> using namespace std; void get_z(char *s, int* z) { int l = 1, r = 1, n = strlen(s + 1); for (int i = 2; i <= n; i ++) { if (i > r) { l = r = i; while (r <= n && s[r - l + 1] == s[r]) r ++; z[i] = r - l; r --; } else { int k = i - l + 1; if (z[k] < r - ...
true
f341b495fbcc0caa00e8be16819edeede038bd86
C++
Team973/2019-inseason
/src/main/cpp/lib/util/Util.h
UTF-8
7,492
3
3
[]
no_license
#pragma once #include "frc/WPILib.h" using namespace frc; namespace frc973 { /** * Used internally to represent the state of the robot. */ enum RobotMode { MODE_DISABLED, /**< Disabled mode. */ MODE_AUTO, /**< Autonomous mode. */ MODE_TELEOP, /**< Teleop mode. */ MODE_TEST /**< Test mod...
true
ca56c1c120f802fd9e1fc8e950cbc0103f1ee952
C++
abhijeetranmale7/oop
/studentdatabase.cpp
UTF-8
3,107
3.65625
4
[]
no_license
/* Write a program in C++ to implement sequential file for students' database and perform following operations on it i) Create Database ii) Display Database iii) Add a record iv) Delete a record v) Modify a record . */ #include<iostream> #include<stdio.h> #include<stdlib.h> #include<string.h> using namespace std...
true
845fcded1b027bb95d6dbd1b0e7d1dca7aa0ba83
C++
bkomarow1990/Lesson-11-OOP
/2 PARA/StringWorker.h
UTF-8
496
3.171875
3
[]
no_license
#pragma once #include <iostream> #include <string> using namespace std; class StringWorker { public: static void deleteAllInputWords(string& str,const string& word) { size_t found = str.find(word); while (true) { } if (found != string::npos){ str.erase(found,word.size()); } } static void replaceToNew...
true
fa79cc25e39318d30e2eaae3a754e7280460efd5
C++
eric-tc/cppRef
/lambda/main.cpp
UTF-8
1,389
3.625
4
[ "MIT" ]
permissive
#include<iostream> #include<vector> using namespace std; class Contatto { public: Contatto(string nome,string cognome,string indirizzo):nome{nome},cognome{cognome},indirizzo{indirizzo}{ } string getIndirizzo(){ return indirizzo; } string getName(){ return nome; } private: string nome=""; string cogno...
true
8f9c71595cc35c49cc357e61b5883ee801a599e3
C++
SammyEnigma/QEasyDownloader
/examples/simple_download/main.cpp
UTF-8
1,095
2.609375
3
[ "BSD-3-Clause" ]
permissive
#include <QCoreApplication> #include <QEasyDownloader> int main(int argc, char **argv) { QCoreApplication app(argc, argv); /* * Construct */ QEasyDownloader Downloader; /* * By Default Debug is false , make it true to print the download progress and * other stuff! */ Downlo...
true
9fe1bc26c0c3549b6ce9e5d5291ff0a631e70cfe
C++
FirescuOvidiu/Advent-of-Code-2018
/Day 02/day2-part1/day2-part1.cpp
UTF-8
880
3.234375
3
[]
no_license
#include <iostream> #include <fstream> #include <string> #include <unordered_map> int main() { std::fstream in("input.in", std::fstream::in); std::fstream out("output.out", std::fstream::out); std::vector<int> countLetters(26, 0); std::string boxID; int countTwo = 0, countThree = 0; bool checkCountTwo = false,...
true
47abb7d352e21ef6101a81c4082e141275a25283
C++
ximenpo/simple-cpp
/inc/simple/_third/FindCombByIdx.h
UTF-8
3,826
2.515625
3
[ "MIT" ]
permissive
/* MIT License Combination Library version 1.5 Copyright (c) 2007 Wong Shao Voon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to u...
true
b0ce1d4829a52c3d3464f110707855e0b7fd6ead
C++
justabegging/Client-ServerInCpp
/Lab4Client/Protocol.h
UTF-8
1,692
2.59375
3
[]
no_license
/* * protocol.h * * Created on: 11 okt 2017 * Author: kaiham-3 */ #pragma once #ifndef PROTOCOL_H_ #define PROTOCOL_H_ #define MAXNAMELEN 32 #include <iostream> #include "string.h" enum ObjectDesc{ Human, NonHuman, Vehicle, StaticObject }; enum ObjectForm{ ...
true
e75dab33f51c09d6ed1e5389eff12c7f345ded66
C++
SeppPenner/AceTime
/src/ace_time/hw/HardwareDateTime.h
UTF-8
1,412
2.90625
3
[ "MIT" ]
permissive
/* * MIT License * Copyright (c) 2018 Brian T. Park */ #ifndef ACE_TIME_HW_DATE_TIME_H #define ACE_TIME_HW_DATE_TIME_H #if defined(ARDUINO) #include <stdint.h> #include <Print.h> // Print #include "../common/util.h" namespace ace_time { namespace hw { /** * The date (year, month, day) and time (hour, minute, s...
true
f420177aad9831f1cc96d3a1915e4b13dd51a7b9
C++
amir5200fx/Tonb
/TnbGeo/TnbLib/Geo/Entities/Triangle/Entity_Triangle.hxx
UTF-8
5,160
2.8125
3
[]
no_license
#pragma once #ifndef _Entity_Triangle_Header #define _Entity_Triangle_Header #include <Traits.hxx> #include <Entity_Segment.hxx> namespace tnbLib { template<class Point> class Entity_Triangle { //typedef typename remove_reference<PointRef>::type Point; typedef Entity_Segment<Point> segment; /*Private Data...
true
cf3d4e3b06caa9bed11323d51d33ca2fdd22482a
C++
engichang1467/Wolfenstein3DCppClone
/src/engine/Attenuation.h
UTF-8
476
2.546875
3
[]
no_license
#ifndef ATTENUATION_H #define ATTENUATION_H #include "Attenuation.h" class Attenuation { private: float constant; float linear; float exponent; public: Attenuation(float constant, float linear, float exponent); float getConstant(); void setConstant(float consta...
true
e1f70ceff2fc322063968ac67b663755d2e2fbe4
C++
harinyoo/BAEKJOON
/StepByStep/C++/Step 03/10871.cpp
UTF-8
258
2.734375
3
[]
no_license
#include <iostream> using namespace std; int main() { int n, x; cin >> n >> x; int arr[n]; for(int i=0; i<n; i++) { cin >> arr[i]; } for(int j=0; j<n; j++) { if(arr[j]<x) cout << arr[j] << " "; } return 0; }
true
906ea618906f01cec9c43de5b2d2ad21dfd6255d
C++
NyuuDorian/fuzzy_system
/CW_linear_classfication/algo.cpp
UTF-8
14,955
2.609375
3
[]
no_license
//GET THE SIGN TO GET THE CLASS ! :D #include <iostream> #include <fstream> #include <string> #include <cmath> #include <ctgmath> #include <vector> #include <cstdlib> #include <ctime> using namespace std; /*#define PHI 0 #define ETA 0 #define A 1*/ //#define NBRE_POINTS 2000 //#define NBRE_COORD 8 #define NBRE_IT...
true
f469f302972c6b92dddc44d2d34bf24c493ad896
C++
ObitoLee/slamBase
/src/generatePointCloud.cpp
UTF-8
837
2.578125
3
[]
no_license
#include"slamBase.h" // 相机内参 CAMERA_INTRINSIC_PARAMETERS camera={325.5,253.5,518.0,519.0,1000}; // 主函数 int main( int argc, char** argv ) { Mat rgb, depth; rgb = imread( "./data/rgb.png" );// rgb 图像是8UC3的彩色图像 depth = imread( "./data/depth.png", -1 );// depth 是16UC1的单通道图像,注意flags设置-1,表示读取原始数据不做任何修改 // ...
true
a76cc13e493e07a12eef8813c3b1651d3863155e
C++
resoliwan/cprimary
/l17/check_it.cpp
UTF-8
599
2.609375
3
[]
no_license
#include <iostream> int main(void) { using namespace std; // cout << "Enter numbers: " << endl; // int number; // if (cin >> number) { // std::cout << number << std::endl; // } else { // std::cout << "Input is not a number" << std::endl; // } // // char arr[20]; ...
true
91c542f6794557c6494e86c81f7bcb8d5b3e5501
C++
Klarsch/ProblemC_Pathfinding
/ProblemC_Pathfinding/Node.h
UTF-8
1,794
3.234375
3
[]
no_license
#pragma once #include "V2Dint.h" class Node { public: Node(); const unsigned& getNodeID() const { return ID; } void setNodeID( const unsigned idIn ) { ID = idIn; } const unsigned& getNodeType() const { return Type; } void setNodeType( const unsigned typeIn ) { Type = typeIn; } const V2Dint& getPosition() cons...
true
aefede59cf5797665df0763c509c472d72a7b420
C++
viditrastogi11/DSA
/practice/linkedlist.cpp
UTF-8
1,274
3.328125
3
[]
no_license
#include<iostream> using namespace std; typedef struct node{ int data; struct node* next; } node; node* insertlinked(node *head,int val) { if(head==NULL) { head=new node(); head->data=val; head->next=NULL; return head; } node *head1=head; while(head1->next!=NULL) ...
true
07d158fb0ea1432b033f841c091dc4fa73dc8977
C++
vcato/qt-quick-6502-emulator
/unit_tests/zero_page_mode_ASL.cpp
UTF-8
6,902
2.796875
3
[]
no_license
#include "addressing_mode_helpers.hpp" struct ASL_ZeroPage_Expectations { uint8_t a; NZCFlags flags; uint8_t operand; // Data to be operated upon in Zero Page }; using ASLZeroPage = ASL<ZeroPage, ASL_ZeroPage_Expectations, 5>; using ASLZeroPageMode = ParameterizedInstructionExecutorTestFixture<AS...
true
02725b43dc09ca67011305a3db4e148e83217a95
C++
ivlevAstef/PrototypeCarGame
/src/Models/CarEquipment.h
UTF-8
682
2.53125
3
[]
no_license
// // File: CarEquipment.h // Description: // Author: Ivlev Alexander. Stef // Created: 18:57 28/01/2016 // Copyright (c) SIA 2016. All Right Reserved. // #pragma once #ifndef _MODELS_CAR_EQUIPMENT_H_ #define _MODELS_CAR_EQUIPMENT_H_ namespace Models { class CarEquipment { public: double mass() const { return ...
true
f36ed62d2b98e99378e71caf0f68c0fde9f89f29
C++
ooooo-youwillsee/leetcode
/0501-1000/0518-Coin Change 2/cpp_0518/Solution1.h
UTF-8
676
2.90625
3
[ "MIT" ]
permissive
/** * @author ooooo * @date 2021/2/17 19:21 */ #ifndef CPP_0518__SOLUTION1_H_ #define CPP_0518__SOLUTION1_H_ #include <iostream> #include <vector> using namespace std; class Solution { public: int change(int amount, vector<int> &coins) { int n = coins.size(); vector<vector<int>> dp(amount + 1, vector<int>...
true
5ad3c25551657732a7fa5d7069a6ab29ca9fb76a
C++
PrayagPatel-007/Cpp-basics
/Add_2_num_using_dll.cpp
UTF-8
1,981
3.265625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; struct dlnode { struct dlnode *left; int data; struct dlnode *right; }; typedef struct dlnode *dlptr; void create_dll (dlptr &D){ int n; char c; cin>>c; if(c != '#'){ n = c-'0'; if(D == NULL){ D = new(dlnode); ...
true
a47c9c138296bd16abc36502d7ed728694859105
C++
mohi-othman/ray-tracer-cpp-mohi
/RayTraceEbtihal/View.h
UTF-8
1,012
3.4375
3
[]
no_license
//Class used to store data on the view that results from a scene rendering #ifndef VIEW_H #define VIEW_H #include "Color.h" #include "Vector3D.h" class Point //Class used to store data on a single point in the view { public: struct { Color color; //Color of the point float depth; //Distance f...
true
1d099c4d56e1f43d5ad2bcd6eeddfc3c55a4c9a1
C++
OverDrive1g/custom-timer
/sketch_feb14a.ino
UTF-8
3,072
2.578125
3
[]
no_license
#include "GyverEncoder.h" #include <Wire.h> #include <LiquidCrystal_I2C.h> #include <DS3231.h> //#include <EEPROM.h> LiquidCrystal_I2C lcd(0x27,16,2); RTClib myRTC; DS3231 rtc; Encoder enc(2,3,4); void initLed(){ pinMode(5, OUTPUT); pinMode(6, OUTPUT); } int t1sleep = 1; int t1active = 1; int t1counter = 0; b...
true
3ac7a4bf0862dc30f8b89f7ab928ee392825d764
C++
shivashish123/Competitive-Programming-Codeforces
/753A.cpp
UTF-8
411
2.640625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int pos=0; for(int i=1;i<=100;i++) { int s=(i*(i+1))/2; if((n-s)>i) { pos=i; } else break; } int dif=n-(pos*(pos+1))/2; cout<<pos+1<<...
true
dc967f33817b66401c7d1d05c3d01a2c065ab497
C++
lja9702/JinAh-BOJ
/BaekjoonOnline/2805_cuttingTree2.cpp
UTF-8
483
2.53125
3
[]
no_license
#include <cstdio> #include <algorithm> int n, m, arr[1000010], l, r, res; int main(){ scanf("%d %d", &n, &m); for(int i = 0;i < n;i++){ scanf("%d", &arr[i]); r = std::max(r, arr[i]); } while(l <= r){ int mid = (l + r) / 2; long long temp = 0; for(int i = 0;i < n;i++){ if(arr[i] - mid >...
true
5542a448e9f9bbcc6ad344ce2799faa7353fecac
C++
adarsh1github1/Competetive-codeforces-codechef-
/rotate array by d(anti clockwise).cpp
UTF-8
464
2.875
3
[]
no_license
#include<bits/stdc++.h> using namespace std; void rotateArr(int arr[], int d,int n){ int i,j; int temp[d]; for(int k=0;k<d;k++) temp[k] = arr[k]; for(i=d;i<n;i++){ arr[i-d] = arr[i]; } for(i=n-d;i<n;i++) arr[i] = temp[i-(n-d)]; } int main(){ int n; cin>>n; int d; cin>>d; int i; ...
true
88b7975f7b6119472b634416a8d972d92318e871
C++
ParAlg/gbbs
/utils/to_edge_list.cc
UTF-8
3,816
3.03125
3
[ "MIT" ]
permissive
#include <stdlib.h> #include <cmath> #include <fstream> #include <iostream> #include "gbbs/gbbs.h" namespace gbbs { /* Format: * Emits a lexicographically sorted list of edges. The format takes (u,v) * and writes: * "u v\n" */ template <class Graph> void print_edge_list(Graph& GA, std::string& outfile, bool direct...
true
22a5d546b9bee3352e015274092d2cf8d1ba2929
C++
CRblog/algorithm
/practice/青岛网赛第一题.cpp
UTF-8
307
2.578125
3
[]
no_license
#include<iostream> #include<cmath> using namespace std; int main() { int t,n,m,k; int min,max; while(cin>>t){ for(int i=0;i<t;i++) { cin>>n>>m; if(n==m) { cout<<n<<" "<<m<<endl;} if(n>m){ max=m; min=floor(n/(n-m+1)); cout<<max<<" "<<min<<endl;} } } return 0;}
true
e3fce8bc8143ccac89bbae7d71ddf05f641db3d6
C++
Philip-Teh/MyGame
/Sokoban/source_code/ui/num_draw.h
SHIFT_JIS
792
2.609375
3
[]
no_license
#pragma once //============================================================================ //= = //= `֘A ` = //= = //============================================================================ #ifndef _NUMDRAW_H_ #define _NUMDRAW_H_ class CNumDraw { public: // v...
true
883b14b23799e6a4ae2b0a975a83493860ea9e5d
C++
BigLazyBrother/mini-jeu-Cpp-SFML
/src/Mechant.cpp
UTF-8
1,651
3.0625
3
[]
no_license
#include "Mechant.h" Mechant::Mechant() { //construsteur vide this->cacheOeil = false; this->lachete = 0; this->nom = "sansNom"; } Mechant::~Mechant() { //destructeur vide } void Mechant::setNom(string nom) { this->nom = nom; } string Mechant::getNom() { return this->nom; } void Mechant::setLach...
true
76acf8751a8fb7395a638535b509d1c4bc79fb3e
C++
aametwally/MC_MicroSimilarities
/src/mc/MCModels.hpp
UTF-8
18,907
2.65625
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
// // Created by asem on 04/02/19. // #ifndef MARKOVIAN_FEATURES_MCMODELS_HPP #define MARKOVIAN_FEATURES_MCMODELS_HPP #include "AbstractMC.hpp" namespace MC { template<size_t States> class MC : public AbstractMC<States> { public: using Base = AbstractMC<States>; using Histogram = typename Base::Histogram; ...
true
a1bd9e730bc84fd5cb51db9c1a774a9da5ff31fe
C++
fernicar/EvolvedVirtualCreaturesRepo
/VirtualCreatures/Volumetric_SDL/Source/Sound/SoundSource.h
UTF-8
1,106
2.796875
3
[ "Zlib" ]
permissive
#pragma once #include <Sound/Sound.h> #include <Constructs/Vec3f.h> class SoundSource { private: unsigned int m_sourceID; Sound* m_pSound; float m_pitch; float m_gain; Vec3f m_position; Vec3f m_velocity; float m_referenceDistance; float m_maxDistance; float m_rollOffFactor; bool m_looping; public: Sou...
true
90b453b5670269268739195db7ce864724bb7dea
C++
lucivpav/bomberman
/src/bonus.cpp
UTF-8
127
2.578125
3
[]
no_license
#include "bonus.h" Bonus::Bonus(Block::Type type) :mType(type) { } Block::Type Bonus::type() const { return mType; }
true
ed5b75f2696d9d8520f3d45dc25ed6a597cecc1c
C++
murvi1/dbus-spy
/software/src/list_view.cpp
UTF-8
3,707
2.578125
3
[]
no_license
#include <QTimer> #include "abstract_object_list_model.h" #include "list_view.h" ListView::ListView(WINDOW *w, QObject *parent): QObject(parent), mWindow(w), mRedrawTimer(new QTimer(this)) { mRedrawTimer->setInterval(100); mRedrawTimer->setSingleShot(true); connect(mRedrawTimer, SIGNAL(timeout()), this, SLOT(onR...
true
b4093aec95a10853223f6f8197c1e8d3f98d46ad
C++
shreyakapoor08/CPP_Programs
/29th august/print_substring.cpp
UTF-8
433
3.453125
3
[]
no_license
#include<iostream> #include<cstring> using namespace std; void printSubstrings(char *a) { for(int i=0;a[i]!='\0';i++) { for(int j=i;a[j]!='\0';j++) { //print the string from i to j for(int k=i;k<=j;k++){ cout<<a[k]; } cout<<endl; ...
true
a9900fe223e36a6144cbbe48525fe1f894b51491
C++
pfepark/Cpp11_14
/CppDay3/3_PerfectForwarding3.cpp
UHC
985
3.90625
4
[]
no_license
#include <iostream> void foo(int n) { n = 10; } void goo(int& n) { n = 10; } void hoo(int&& n) { } // Ϻ ذå // 1. int& int&& Լ 2 Ѵ. // Ȯ const int& const int&& ־ Ѵ. // 2. int&& static_cast<int&&> ؼ Ѵ. template<typename F> void logTime(F f, int& arg) { f(arg); } template<typename F> void ...
true
f7d2d0f82edcf517645c76c2debb32f9fb309557
C++
Defens1k/algorithm_TP
/mod_1/old/3_1.cpp
UTF-8
3,495
3.359375
3
[]
no_license
#include <iostream> #define MIN_SIZE 32 class Queue { public: Queue(); ~Queue(); int64_t pop_front(); void push_back(int64_t input_data); int64_t size(); //return lenght of queue bool is_empty(); //is queue empty? bool resize(int64_t new_size); // if (new_size > free_cell) => size = ne...
true
f6baa3e148fd78a43f82d4d0279a0839e67617ae
C++
xingkaihao/Leetcode
/中级算法/数组和字符串/矩阵置零/C++/original.cpp
GB18030
1,436
3.375
3
[]
no_license
class Solution { public: void setZeroes(vector<vector<int>>& matrix) { int row=matrix.size(); int column=matrix[0].size(); vector<int> row1, column1; for(int i=0; i<row; i++){ for(int l=0; l<column; l++){ if(matrix[i][l]==0){ row1.push_...
true
2b65efeedb90f9a0c352eca4dd68e7dcaaac7b84
C++
SethGibson/Circumstellar
/_tests/CoordConvertTest/src/CoordConvertTestApp.cpp
UTF-8
1,880
2.703125
3
[]
no_license
#include "cinder/app/App.h" #include "cinder/app/RendererGl.h" #include "cinder/Camera.h" #include "cinder/gl/gl.h" using namespace ci; using namespace ci::app; using namespace std; static float S_PLANE_Z = 8.0f; struct orbiter { float Angle; float Radius; float Vel; float Depth; orbiter(float pAngle, float pR...
true
94a72ca88770cab81f44940009a4b61acc0ee503
C++
dreamspot4everyone/No-Exam
/Greedy/Kruskal.cpp
UTF-8
2,549
3.171875
3
[]
no_license
#include <iostream> #include<fstream> using namespace std; struct kruskal{ int sv; //source int ev; //destination int weight; //weight }; int graph[100][100]; int n,ans=0; int parent[100]; void merge(kruskal a[],int low,int mid,int high) { int i=low,j=mid+1,k=low; kruskal b[high+1];...
true
99191e56550bd1a57f67a257ac771fa82b58ee41
C++
Aurillon/UMD-Duluth-CS1521
/projects/project5/DiscList.h
UTF-8
646
2.640625
3
[]
no_license
#ifndef DISC_LIST_ #define DISC_LIST_ #include <memory> #include "LinkedList.h" #include "Track.h" //#include "Disc.cpp" class DiscList { public: DiscList(); ~DiscList(); bool isEmpty() const; int getNumberOfDiscs() const; bool insertDisc(std::shared_ptr<Disc> aDiscPtr); bool removeDisc(std::weak_...
true
daaea89d8600e355e3cb6d1a13ff151943a786a8
C++
diazf/indri
/contrib/antlr/src/antlrParser.cpp
UTF-8
6,261
2.578125
3
[ "BSD-2-Clause" ]
permissive
/* ANTLR Translator Generator * Project led by Terence Parr at http://www.jGuru.com * Software rights: http://www.antlr.org/license.html * * $Id: //depot/code/org.antlr/release/antlr-2.7.4/lib/cpp/src/Parser.cpp#1 $ */ #include "antlr/Parser.hpp" #include "antlr/BitSet.hpp" #include "antlr/TokenBuffer.hpp" #incl...
true
e0d27aec863553b2981644fd347f9d30e27266e7
C++
HANJEONGWOO/ACMICPC
/2493.cpp
UTF-8
842
2.828125
3
[]
no_license
#include <stdio.h> int N; int arr[500001]; int idx[500001]; int s_idx; int repeat = 0; int main(void) { int i, j; scanf("%d", &N); for(i=0; i<N; i++) { scanf("%d", &arr[i]); } printf("0 "); for(i=1; i<N; i++) { s_idx = i-1; repeat = 0; while(1) { if(arr[s_idx] >= arr[i]) { //printf("...
true
fa4c4af34790e0a8ef090fd781cb0972f8978358
C++
Ethan-Burchett/Generic-Menu-Class
/MenuClass.h
UTF-8
1,830
3.84375
4
[]
no_license
// Generic menu class // Input: std::string vector of options // Output: valid option integer // Prints formatted options to the terminal with option numbers // User input data validation with helper error messages // can be used with any size of std::string option array // Function Prototype of MenuClass // Ethan Bur...
true
84cac4f37f421d7f97866c38f803cdc3cae060f0
C++
ArdNut/libraries
/dht11/dht11.cpp
UTF-8
2,385
2.65625
3
[]
no_license
#include <stdint.h> #include "Arduino.h" #include "dht11.h" int dht11::readDHT(int pin) { uint8_t cnt = 7; uint8_t idx = 0; uint8_t chksum = 0; uint16_t loopcnt = 0; uint32_t tmbit = 0; // unsigned int loopcnt = 0; // unsigned long tmbit = 0; // clear input buffer for ...
true
ffd0a587ffeb0b30dab3bbcda87c4ae30ae0b61e
C++
ReneeeZhang/Duke-ECE-565
/HW5/rainfall/rainfall_pt.cpp
UTF-8
5,615
2.96875
3
[]
no_license
#include <iostream> #include <cstdlib> #include <string> #include <ctime> #include <functional> #include "landscape.hpp" #include "threadpool.hpp" #define NUM_ARGV 6 static int num_threads; static int raining_time; static double absorption_rate; static int dim; void validate_argc(int argc) { if(argc != NUM_ARGV...
true
a18d884c069d89d3e9230951b2ace466466e3667
C++
alimsadetov/Programming
/Practice/15/c++/15/15.cpp
UTF-8
1,263
3.0625
3
[]
no_license
// 15.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. // #include <iostream> #include <stdlib.h> using namespace std; int main() { setlocale(0, ""); cout << "привет введи число\n"; int x=1, i=0, chislo, n; while (x == 1) { chislo = rand() % 101;...
true
b19021abe274871f4af7f61cc6a99c5ef2a70a63
C++
amanohayato/SecretFilming
/MyGame/MyGame/src/Actor/TitleActor/TitleUfo/TitleUfo.cpp
SHIFT_JIS
877
2.546875
3
[]
no_license
#include "TitleUfo.h" #include <memory> #include "../../../Graphic/Model.h" #include "../../../Game/Time.h" #include "../../../Math/MathHelper.h" TitleUfo::TitleUfo(IWorld* world, const Vector3& start, const Vector3& goal) : Actor(world, "Ufo", start), startPos_(start), goalPos_(goal) { initialize(); } TitleUfo:...
true
4f241206201d3d6ade76b4e30fe6004febbfb5f5
C++
DuncanKane/Some-simple-C-
/SurgeryApp1/SurgeryApp1/SurgeryHeader.h
UTF-8
1,854
2.890625
3
[]
no_license
#pragma once #include <string> #include <vector> using namespace std; #ifndef Login class Login { public: void GetLoginDetails(string sUsernamePass, string sPasswordPass); bool CheckAdminLogin(); protected: string sUsername, sPassword, sUsernameCheck, sPasswordCheck; int iCount; }; #endif // !Lo...
true
c236cd6e2254fabf169d690bfdabe42cbecda7f8
C++
Likilee/webserv
/src/TestMain.cpp
UTF-8
3,896
3.03125
3
[]
no_license
#include <iostream> #include <gtest/gtest.h> //Test functions #include "ConfigParser.hpp" //ConfigParser TEST(ConfigParser, fileToString) { ConfigParser parser; //Test1. fileToString std::string str = parser.fileToString("./test_res/configparser/file1"); std::string str_cmp = "server { #comment1\nlocation / #comme...
true
77fa194b6e01eaf789fcebd74984110a9e21e5ad
C++
PenteractStudios/Tesseract
/Project/Source/Utils/Quadtree.h
UTF-8
8,014
2.890625
3
[ "MIT" ]
permissive
#pragma once #include "Globals.h" #include "Utils/Pool.h" #include "Math/myassert.h" #include "Geometry/AABB2D.h" #include <vector> #include <list> template<typename T> class Quadtree { public: // The elements in a node are linked class Element { public: T* object = nullptr; AABB2D aabb = {{0, 0}, {0, 0}}; ...
true
0ee22d78a360d7c42ba33f706001251f9dd860b7
C++
jerrykcode/luogu
/Problems/P1129/P1129.cpp
UTF-8
2,142
2.96875
3
[]
no_license
#include <cstdio> #include <cstdlib> #include <vector> #include <queue> using namespace std; typedef unsigned char vertex; #define MAX_N 200 #define NOT_A_VERTEX 0xff queue<vertex> vqueue; bool hungarian(vector<vertex> * graph, int num) { vertex * left_matching = new vertex[num]; fill(left_matching, left_matching +...
true
d0f91fcd0b50c9a99d7ec47f1c000d424db5109c
C++
Mario0211/P3_Ejercicio_01
/p_3/include/rectangulo.h
UTF-8
1,138
3.140625
3
[]
no_license
#ifndef RECTANGULO_H #define RECTANGULO_H #include <iostream> #include <math.h> #include "punto.h" using namespace std; class Rectangulo{ private: Punto superiorIzquierdo; Punto superiorDerecho; Punto inferiorIzquierdo; Punto inferiorDerecho; public: Rectangulo(){ cout << "Se ha creado un rectangulo" << endl; } void ...
true
83350daee57f67cb66785c26e7c690a9e8529f88
C++
Shivam06/Cpp-Programming
/DS/Arrays/(IMP)missing_number.cpp
UTF-8
953
2.921875
3
[]
no_license
#include "helper_functions.cpp" void change_neg_to_zero(vi& v) { tr (v, itr) { if (*itr < 0) { *itr = 0; } } } int missingNumber(vi& v) { change_neg_to_zero(v); int i = 0, n = v.size(); while (i < n) { if (v[i] <= 0 || v[i] > n) { //cout << "Skipping" << endl; i++; continue; } int ne...
true
dd6e489d7d5c64d7ae78506a443268474eba38c0
C++
D3z1re/PNRPU_Labs
/Lab_21/graph.cpp
UTF-8
5,648
2.640625
3
[]
no_license
#include "graph.h" #include "ui_graph.h" #include <cmath> #include <queue> #include <QTextStream> using namespace std; QTextStream cout(stdout); QTextStream cin(stdin); int radiusA = 30, radiusB = 230; QString Graph::Dejkstra() { QString tmp = ""; int top = 0; //вершина с номеро...
true
2bbcbaee5cbf79f7ab843b7065a3a69a0ed6a2fa
C++
CreatorSeraph/ModernCppChallengeStudy
/Math/Problem2/main.cpp
UTF-8
547
2.75
3
[ "MIT" ]
permissive
#include <gsl/gsl> #include <iostream> #include <../MyMath.h> #include <numeric> int main(int argc, char* argv[]) { size_t input1, input2; std::cin >> input1 >> input2; std::cout << std::gcd(input1, input2) << std::endl; //auto table = MyMath::PrimeNumberVec(std::max(input1, input2)); // //size_t result =...
true
f5812fe4d75fdc489fe6e7a7fd6fd8d3d1ee1ecc
C++
igorge/gieidl-oldstuff
/idl_compil/idl_countable_string.h
UTF-8
2,406
2.78125
3
[]
no_license
//================================================================================================================================================ // // (c) GIE 04.03.2005 // //===============================================================================================================================================...
true
82d5e006bd9d0d43e51ac202c648e8f726e17363
C++
loveFaying/Leetcode
/11_String/500. Keyboard Row/main2.cpp
UTF-8
1,114
3.1875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; // https://leetcode-cn.com/problems/keyboard-row/ // Time: O(L) // Space: O(C) class Solution { public: vector<string> findWords(vector<string>& words) { vector<string> res; string rowIdx = "12210111011122000010020202"; for (auto& word : words)...
true
5ada8b06e9ebbb3a729ec897bdf1725f549e4d16
C++
royyjzhang/leetcode_cpp
/396_RotateFunction.cpp
UTF-8
781
3.109375
3
[]
no_license
#include<iostream> #include<vector> #include<queue> #include<stdlib.h> #include<string> #include<algorithm> #include<map> #include<math.h> #include<stdint.h> #include<stack> #include<sstream> #include<unordered_map> using namespace std; class Solution { public: int maxRotateFunction(vector<int>& A) { ...
true
c3ee4d68eac7f8e3bef1a9c042049af3c94fd6c6
C++
Fraunhofer-AISEC/cpg
/cpg-language-cxx/src/test/resources/cfg.cpp
UTF-8
195
2.734375
3
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
#include <stdio.h> int main() { cout << "bla"; cout << "blubb"; if(true) { cout << "zonk"; return 1; } else { { cout << "zink"; return 2; } } return 0; }
true
b9299dc047102e6b32ceebb94000ed75cfad206a
C++
thelastsupreme/cs106x
/classes/BankAccount.cpp
UTF-8
1,284
3.8125
4
[]
no_license
#include<iostream> #include<string> #include<vector> #include"BankAccount.h" using namespace std; BankAccount::BankAccount(string accountName,double startBalance) { name=accountName; balance=startBalance; } //other way of writing using this /* BankAccount::BankAccount(string name,double balance) { this->na...
true
82c12b389a88e38cca38a7d917effa985649d38f
C++
donihrmn/5180711106-tugasAlgo2
/5180711106-tugasAlgo2-Modulus Young.cpp
UTF-8
391
3.375
3
[]
no_license
#include<iostream> using namespace::std; int ModulusYoung (int angka, int modulus) { if(angka<modulus) return 0; else return 1+ModulusYoung(angka-modulus,modulus); } main() { int angka,modulus; cout<<"Masukkan Tegangan : ";cin>>angka; cout<<"Masukkan Regangan : ";cin>>mo...
true
e3b6a6ad3ae4be5355281de75e624137375b30a1
C++
mhackampari/OpenCL
/Project_1.1/C++/FiltersC++.cpp
WINDOWS-1252
7,068
2.65625
3
[]
no_license
#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string> #include <iostream> #include "image_processing.hpp" #include <ctime> #include <fstream> #include <iomanip> #define ITERATIONS 25 using namespace std; double factor = 2; class Image{ private: string cat[5]; string mot...
true
6920fe6301cf4ba5e9ad4c357c54fd68cfd726f8
C++
ngrande/Banshee
/Bus/MessageBus.cpp
UTF-8
1,099
2.84375
3
[ "MIT" ]
permissive
// // Copyright (c) 2016 by Niclas Grande. All Rights Reserved. // #include "MessageBus.h" #include <algorithm> MessageBus::MessageBus(void) { this->pStopped = false; this->pMsgThread = std::thread(&MessageBus::processMsgQueue, this); this->pMsgThread.detach(); } void MessageBus::processMsgQueue() { while (!...
true
6bd93dbeb7b072ca083dc1cb2055084069bc1ac3
C++
Iigorsf/AED
/AED/4/4q19.cpp
UTF-8
428
2.9375
3
[ "MIT" ]
permissive
#include <iostream> using namespace std; int main(int argc, char **argv) { string text; cin>>text; string palavra; cin>>palavra; int c=-1, tam, tam2; tam = text.size(); tam2 = palavra.size(); for(int i = 0; i <=(tam-tam2);i++){ if(text[i]==palavra[0] and c==-1){ c = i; for(int j =0; j < tam2; j++) { ...
true
48cf69b0c2a9b4c14e9c6718625cc129eeb929cb
C++
KawaharaSyuichi/algorithms
/Weighted_graph/SingleSourceShortestPathII.cpp
UTF-8
3,249
3.328125
3
[]
no_license
/* 単一始点最短経路 与えられた重み付き有向グラフG=(V,E)について、単一始点最短経路のコストを求めるプログラム ダイクストラのアルゴリズム(優先度付きキュー) グラフG=(V,E)の頂点全体の集合をV、始点をs、最短経路木に含まれている頂点の集合をSとします。 各計算ステップで、最短経路木の辺と頂点を選びSへ追加します。 各頂点iについて、S内の頂点のみを経由したsからiへの最短経路のコストをd[i]、最短経路木におけるiの親をp[i]とする。 1.初期状態で、Sを空にする a. sに対してd[s]=0 b. s意外のVに属する全ての頂点iに対してd[i]=∞ c. d[i]をキーとして、Vの頂点をmin-ヒープHと...
true
a2f5d3636aab8701c68e63df23e72770b862f1b1
C++
remcous/Programming-Principles-and-Practice
/Ch17/exercise9.cpp
UTF-8
1,205
3.46875
3
[]
no_license
/* exercise9.cpp Revision History: */ #include "../std_lib_facilities.h" /**************************************** * MAIN FUNCTION ****************************************/ int main(){ try{ // Test the direction of stack growth int num1 = 0; int num2 = 0; int ...
true
cbad1829f771212052dfa7e1242d34d144ca024e
C++
LindongLi/Leetcode
/191 Number of 1 Bits/191 LL.cpp
UTF-8
658
4.0625
4
[]
no_license
#include <iostream> using namespace std; /* https://leetcode.com/problems/number-of-1-bits/ Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 32-bit integer ’11' has binary representation 00000000000000000000000000001011, so...
true
958ec984dd5877e508aeafc74dee48384e418cc4
C++
ator/chapman
/ChapmanWindows/color.cpp
UTF-8
2,418
3.4375
3
[]
no_license
#include <cmath> #include "color.h" const color color::WHITE(1.0, 1.0, 1.0); const color color::BLACK(0, 0, 0); const color color::GRAY(0.5, 0.5, 0.5); const color color::RED(1.0, 0, 0); const color color::GREEN(0, 1.0, 0); const color color::BLUE(0, 0, 1.0); const color color::YELLOW(1.0, 1.0, 0); const color color:...
true