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
5de960ea566eeed5e99a8e44bd8c4f4ea2f8a54f
C++
Riyakumari57/DSA
/Bit Manipulation/GeeksforGeeks/Swap 2 numbers using Bit Manipulation.cpp
UTF-8
233
3.09375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main() { int a, b; ; cin >> a >> b; // swapping two variables a = a ^ b; b = a ^ b; a = a ^ b; //variables swapped cout<<" a is "<<a<<" b is "<<b; }
true
0951b9b497117e8f440776dc18aae352e2144ec4
C++
dle07/CSCI33500
/Homework/3_Homework/test_tree.cc
UTF-8
3,612
3.28125
3
[]
no_license
// Daniel Le /* */ // Main file for Part 2.2 of Homework 3. #include "avl_tree.h" // You will have to add #include "sequence_map.h" #include "sequence_map.h" #include <cmath> //log2() function #include <fstream> #include <iostream> #include <string> #include <utility> using namespace std; namespace { vector<str...
true
b15fcaabf5f7e6614263f14b57b309610c9df481
C++
amorellgarcia/arduino-util-lib
/util_string.cpp
UTF-8
2,713
2.890625
3
[ "BSL-1.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
//////////////////////////////////////////////////////////////////////////////// /// @section LICENSE /// /// (C) Copyright 2013 Alejandro Morell Garcia /// /// Distributed under the Boost Software License, Version 1.0. ...
true
a6739baf6cc1e6a206c00c875bf4c56193ffc704
C++
beersbr/ShadowSpaceMain
/ShadowSpaceMain/IGameObject.cpp
UTF-8
534
2.640625
3
[]
no_license
#include "IGameObject.h" long IGameObject::instance_id_inc = 0; std::list<IGameObject*> *IGameObject::_game_objects = new std::list<IGameObject*>(); std::list<IGameObject*>* IGameObject::game_objects(void) { return _game_objects; } IGameObject::IGameObject(void) { instance_id_inc = IGameObject::instance_id_inc++; ...
true
4cbc5514feb42660a19609d1a2002d198393ddb3
C++
NKTS-9/Opozduni
/T34C/main.cpp
WINDOWS-1251
4,617
2.953125
3
[]
no_license
#include <iostream> #include <string> #include <fstream> #include <windows.h> #include "include/Device.h" #include "include/Keyboard.h" #include "include/Scanner.h" #include <stdlib.h> using namespace std; void output(Device* ps[]); // void edit(Device* ps[], Keyboard k1, Keyboard k2, Scanner s1, Scanner ...
true
60e733cfcc81a638878cd711bd8e96ab863a447d
C++
zdgeorgiev/FMI
/C++/03. Data Structures/04. BST/DummyVector.h
UTF-8
2,475
3.609375
4
[ "MIT" ]
permissive
/** * * Solution to homework task * Data Structures Course * Faculty of Mathematics and Informatics of Sofia University * Winter semester 2016/2017 * * @author Zdravko Ivailov Georgiev * @idnumber 45115 * @task 1 * @compiler VC * */ #pragma once #ifndef __DUMMY_VECTORE_HEADER_INCLUDED__ #define __DUMMY_VECTORE_HEADER_...
true
84f115b5fb357b09787ac41ef3a132518e642a51
C++
nick-valentine/roguelike
/src/levelPass/enemies.cpp
UTF-8
1,611
2.90625
3
[ "MIT" ]
permissive
#include "enemies.h" #include <random> namespace levelPass { Enemies::Enemies(int count) : mCount(count) { } void Enemies::execute(objects::Level &l) { for (int i = 0; i < mCount; ++i) { spawnEnemy(l); } } void Enemies::spawnEnemy(objects::Level &l) { while (true) { auto size = l.size(); st...
true
1e1818517a58cbd6dae890ca605f7e54fb89126d
C++
iamslash/learntocode
/fundamentals/greedy/knapsackfractional/a.cpp
UTF-8
1,146
3.234375
3
[]
no_license
// Copyright (C) 2018 by iamslash // https://www.geeksforgeeks.org/fractional-knapsack-problem/ // https://practice.geeksforgeeks.org/problems/fractional-knapsack/0 #include <cstdio> #include <vector> #include <algorithm> int N = 3; int C = 50; class Item { public: int value; int weight; Item(i...
true
69ff7cf216d014a95cea447fd3e71b854446fd43
C++
crookjj102/RoboticsEngineering
/Lab3/Lab3B/Lab3B.ino
UTF-8
969
2.890625
3
[]
no_license
#include <Arduino.h> #define RIGHT_BUTTON 2 #define LEFT_BUTTON 3 #define PIN_LED_1 64 #define PIN_LED_2 65 #define PIN_LED_3 66 #define PIN_LED_4 67 #define PIN_LED_5 68 #define PIN_LED_6 69 void setup() { pinMode(LEFT_BUTTON, INPUT_PULLUP); pinMode(RIGHT_BUTTON, INPUT_PULLUP); pinMode(PIN_LED_1, OUTPUT); pi...
true
7149eef604b66d79bdca0d7207450bf86f04b67d
C++
kalyankondapally/chromiumos-platform2
/libbrillo/brillo/file_utils.h
UTF-8
9,134
2.703125
3
[ "BSD-3-Clause" ]
permissive
// Copyright 2014 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef LIBBRILLO_BRILLO_FILE_UTILS_H_ #define LIBBRILLO_BRILLO_FILE_UTILS_H_ #include <sys/types.h> #include <string> #include <base/files/file_pat...
true
25fa9580ff359e25c6d588f5b2657078219c079a
C++
andromeda0412/logcpp
/examples/daemon.cpp
UTF-8
585
2.515625
3
[ "MIT" ]
permissive
#include <logcpp/logger.hpp> #include <logcpp/logger/consolelogger.hpp> #include <logcpp/logger/filelogger.hpp> using namespace logcpp; #include <iostream> using namespace std; int main(int argc, char* argv[]) { const bool daemon = true; Logger::Ptr logger; if (daemon) { /* daemonize */ ...
true
1cf423d6524a3605f5f2562ced940eb17fcc3b26
C++
swarnabhpaul/OOPS
/Assignments/Set 3/stack.cpp
UTF-8
2,021
3.78125
4
[]
no_license
#include<iostream> #include<stdbool.h> using namespace std; class stack { private: int top, size; int *a; bool isempty(); bool isfull(); void initialize(int); void deconstruct(); public: stack(int); stack(int,int); stack(); ~stack(); void push(int); int ...
true
335cd40146cf5399334771f5c2977fbf2445bc52
C++
austinwklein/cs201
/Lab/Lab05/Lab05b/main.cpp
UTF-8
1,169
4.0625
4
[]
no_license
// Boilerplate /* * Austin Klein * CS 201 * 1/29/2021 * Lab 05b * Switch statements */ // Description: /* Write a C++ program that repeatedly does the following: * input a number, and do one of—at least!—three different things, * depending on the value of the number. * Note. Exiting the loop does ...
true
1ffdd50dceac7a1089f047062f9c798f5669ebf6
C++
81887821/nmfs
/fuse.hpp
UTF-8
1,402
2.8125
3
[]
no_license
#ifndef NMFS__FUSE_HPP #define NMFS__FUSE_HPP #define FUSE_USE_VERSION 35 #include <fuse.h> #include "structures/metadata.hpp" namespace nmfs { /** * A wrapper class of fuse_fill_dir_t */ class fuse_directory_filler { public: /** * The kernel wants to prefill the inode cache during readdir. * This fl...
true
463f08cb7c3ecbc5b940ecea03769d60ffae4cb7
C++
ptiwald/graphs
/graphs.hpp
UTF-8
1,700
2.9375
3
[]
no_license
//==================== // include guards #ifndef __graphs_H_INCLUDED__ #define __graphs_H_INCLUDED__ //==================== //forward declared dependencies //... you can not forward declare path/path_list -> objects of them are used //==================== //included dependencies #include "paths.hpp" #include<fstream>...
true
1d1c7805c1d63ce73b4fe617203a43f5f7cb7503
C++
JackYifan/Learning-Code
/1063.cpp
WINDOWS-1252
707
2.734375
3
[]
no_license
#include<cstdio> #include<set> using namespace std; int main() { int n; scanf("%d",&n); set<int> st[51]; for (int i = 1; i <= n; i++) { int num; scanf("%d", &num); for (int j = 1; j <= num; j++) { int x; scanf("%d", &x); st[i].insert(x); } } int tot,x,y; set<int>::iterator it; scanf("%d", &t...
true
3aeadf3c0b17706ebacd87e45a3bda1696e737cd
C++
DToxS/UMI-Extraction
/src/hts/include/hts/PairedFASTQSequencePipe.hpp
UTF-8
3,327
3.125
3
[]
no_license
// // PairedFASTQSequencePipe.hpp // High-Throughput-Sequencing // // Created by Yuguang Xiong on 8/25/17. // Copyright © 2017 Yuguang Xiong. All rights reserved. // #ifndef PairedFASTQSequencePipe_hpp #define PairedFASTQSequencePipe_hpp #include <iostream> #include <stdexcept> namespace hts { /// \brief Pipe a...
true
163f111e84b0a58437bea36cb7b8f4b34f239c79
C++
suhyunNam000/acmicpc_practice
/2108.cpp
UTF-8
1,277
2.96875
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> using namespace std; //통계학 //https://www.acmicpc.net/problem/2108 int map[51][51] = { 0 }; int go_row[4] = { 1,-1,0,0 }; int go_col[4] = { 0,0,-1,1 }; int N; int main() { cin >> N; int input; int sum = 0; int max = -4000; int min = 4000; vector<int> number...
true
b2582097f3b896ce92f89d0d9bfa863b95c03c9f
C++
cui-shuhai/projs
/shrest_server/shrest_db/user_table.cpp
UTF-8
4,593
2.59375
3
[]
no_license
/* Standard C++ includes */ #include <stdlib.h> #include <memory> #include <map> #include <iostream> #include <sstream> #include <sqlite/transaction.hpp> #include <sqlite/connection.hpp> #include <sqlite/command.hpp> #include <sqlite/execute.hpp> #include "shrest_db/user_table.h" #include "shrest_db/employee_table.h...
true
c2ff529703a4400b0df1c076b1ccc8dc956e9377
C++
powervr-graphics/Native_SDK
/framework/PVRUtils/OpenGLES/PBRUtilsGles.h
UTF-8
2,613
2.546875
3
[ "MIT" ]
permissive
/*! \brief Contains OpenGL ES-specific utilities to facilitate Physically Based Rendering tasks, such as generating irradiance maps and BRDF lookup tables. \file PVRUtils/OpenGLES/PBRUtilsGles.h \author PowerVR by Imagination, Developer Technology Team \copyright Copyright (c) Imagination Technologies Limited. */ #pra...
true
0012afd59a1e1bba828dda12fed48c3da0661578
C++
jfcbooth/triangle
/pyramid_challenge.cpp
UTF-8
2,518
3.484375
3
[]
no_license
/* Make a pyramid of numbers given some integer 1 1 2 1 2 1 3 1 2 3 2 1 4 1 2 3 4 3 2 1 5 1 2 3 4 5 4 3 2 1 6 1 2 3 4 5 6 5 4 3 2 1 7 1 2 3 4 5 6 7 6 5 4 3 2 1 ...
true
a08aa06e551b4c482707e4577eeda9d167dbe0ac
C++
jdmack/tlb
/src/gfx/2DCamera.cpp
UTF-8
1,894
2.90625
3
[]
no_license
#include "gfx/2DCamera.h" #include "GameObject.h" #include "Level.h" #include "Game.h" #include "util/Logger.h" #include "Point.h" #include "math/Math.h" Camera2D::Camera2D() { xPosition_ = kCamera2DInitialX; yPosition_ = kCamera2DInitialY; width_ = kCamera2DWidth; height_ = kCamera2DHeight; } void C...
true
8d58e5f540de228ac4c8d6480b667571ad4fb82d
C++
wayne1116/Uva-Online-programming
/C++/10622-Perfect P-th Powers.cpp
UTF-8
579
2.609375
3
[]
no_license
#include<iostream> #include<cmath> using namespace std; int main() { long long num, flag, limit, temp, i, count=0; while(cin>>num&&num){ flag=0; if(num<0){ flag=1; num=-num; } limit=sqrt(num); for(i=2; i<=limit; i++){ temp=num; count=0; while(temp%i==0){ temp/=i; ++count; } if(t...
true
265cc1d5658809b5bef683615c65afd53e538b2e
C++
yurychu/cpp_coding
/six/switch.cpp
UTF-8
828
3.40625
3
[]
no_license
// оператор switch #include <iostream> using namespace std; void showmenu(); void report(); void comfort(); int main(){ showmenu(); int choice; cin >> choice; while (choice != 5){ switch (choice){ case 1 : cout << "a - n\n"; break; case 2 : report(); break; case 3 : cout << "Босс каждый день!\n"; bre...
true
62abd74a5a2305c1f1ee876a84c007a577690567
C++
littlepig2013/littlepig2013.github.io
/files/top-k-meta-path/top-k-meta-path/DataReader.h
UTF-8
814
2.65625
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
// // DataReader.h // #ifndef __DataReader__ #define __DataReader__ #include <stdio.h> #include <iostream> #include <vector> #include <map> #define MAX 100000 using namespace std; class Edge { public: int dst_; int type_; double pro_; double rpro_; Edge(int x, int y, double d1, double d2): d...
true
c2be58cf7f96764f3a143023c126da5d7bab0be3
C++
robert333/graph
/source/unit_tests/test_maximum_matching.cpp
UTF-8
1,289
2.765625
3
[]
no_license
// test_maximum_matching.cpp #include "catch/catch.hpp" #include "../graph/matching/MatchingAlgorithms.hpp" TEST_CASE("Computing Maximum Matchings (Test 1)", "[maximum matching]" ) { graph::UndirectedGraph undirected_graph(12); undirected_graph.add_edge(0, 4); undirected_graph.add_edge(0, 5); undirected_graph.ad...
true
a3b60e25c215361c33b530051f584f5caf3907eb
C++
wuzeyu2015/Algorithm-4th-edition-C
/DataStruct/Graph/PathDfs.h
GB18030
1,389
3.53125
4
[]
no_license
#ifndef _PATHDFS_H #define _PATHDFS_H #include <iostream> #include <cassert> #include <stack> using namespace std; template <typename Graph> class PathDfs{ private: Graph &G; bool *visited;//¼ڵǷѾ int *from; //from[i]iһڵ int s; //·ʼ void dfs( int v ){ visited[v] = true; Graph::adjIterator itor(G, v); ...
true
63a33f422d20fcb26d59ce5d66db44e47b2cbbb0
C++
dimitarkole/CPlusPlusTasks
/C++/za.cpp
UTF-8
261
2.609375
3
[]
no_license
#include<iostream> using namespace std; int main() { int maxi=0; float a,b; for(float i=0;i<51;i+=0.01) { a=i; for(float j=0;j<=i;j+=0.01) { b=j; if(a*a==b*(a+b))cout<<a/b<<endl; } } }
true
123edbd4cbf1471a66d0ef82d2c9e2faf21306cb
C++
DavidFaria38/AEDs2_Repositorio
/TP/TP02/tp02/TP02Q14 - Radixsort em C/TP02Q14.c
UTF-8
12,398
3.234375
3
[]
no_license
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #include <time.h> /* ================= (Inicio) Definições Struct StatusAlgoritmo ================= */ typedef struct StatusOrdenacao { int comp; int mov; clock_t start; clock_t end; } StatusOrd; StatusOrd *newStatusOrd() { StatusOrd...
true
54352255f64541bcf0929fd2ad13777fa37dfe6a
C++
ArchiveTyre/Spirit
/old/src/Parser.hpp
UTF-8
1,430
2.90625
3
[]
no_license
/** * @class Parser * * A mini-parser for the Cheri language. * * @author Tyrerexus * @date 26 March 2017 */ #pragma once #ifndef PARSER_HPP #define PARSER_HPP #include "Lexer.hpp" #include "AST/ASTClass.hpp" class Parser { public: /*** METHODS ***/ /** Automatically test this Lexer to assure that it ...
true
e9dd17b291f79a1bd7a520dbbbb655dbd93b264d
C++
andreacasalino/Flexible-GJK-and-EPA
/src/header/Flexible-GJK-and-EPA/Error.h
UTF-8
366
2.640625
3
[]
no_license
/** * Author: Andrea Casalino * Created: 06.01.2020 * * report any bug to andrecasa91@gmail.com. **/ #pragma once #include <stdexcept> namespace flx { /** @brief A runtime error that can be raised when using any object in flx:: */ class Error : public std::runtime_error { public: explicit Error(const st...
true
bd17906f3b61d782aabcd2ceceff7b32f2ecb7e6
C++
guygoudeau/Homework
/First Semester/ZombieClass/Source.cpp
UTF-8
4,084
3.359375
3
[]
no_license
//Guy Goudeau //Sep 29, 2015 #include <iostream> #include <string> #include <cstdlib> #include "Header.h" using namespace std; int randNum = (rand() % 6) + 1; //random number generator Zombie zomb1(20, 2, "Janitor"); // define first zombies stats Zombie zomb2(10, 3, "Astronaut"); //define second zombies stats Zombie ...
true
e2dd58665357625ea00bfab511892561ac64ade4
C++
sudhanshu-t/DSA
/InterviewPrep/Array _ Strings/sortTransformedArray.cpp
UTF-8
1,217
3.515625
4
[]
no_license
#include<iostream> #include<vector> #include<algorithm> using namespace std; // ----------------------------------------------------- // This is a functional problem. Only this function has to be written. // This function takes as input an array and 3 integers // It should return an integeral array vector<int> sortTra...
true
94c6165cdad167726ac442f680a25d8e797fdde3
C++
BellaLiu112/leetcode
/PascalsTriangle_118.cpp
UTF-8
703
3.015625
3
[]
no_license
class Solution { public: vector<vector<int>> generate(int numRows) { vector<vector<int>> retVal; if (!numRows) return retVal; int i, j; for (i = 0; i < numRows; ++i) retVal.push_back(vector<int>(i+1)); retVal[0][0] = 1; if (numRows == 1) ...
true
b8315d2e85bf4bc436455b6f1bc932b353b9f089
C++
RastusZhang/symreader
/filemapping_unix.cpp
UTF-8
894
2.625
3
[ "MIT" ]
permissive
#include "filemapping.h" #include <fcntl.h> #include <new> #include <stdexcept> #include <sys/mman.h> #include <sys/stat.h> #include <unistd.h> using namespace std; namespace symreader { shared_ptr<const mapped_region> map_file(const char *path) { struct mapping : mapped_region { mapping(const char *path) ...
true
a968509f37cae1cc6f4516f67626ca5b90832c7e
C++
ln93/ImgTrim
/ImgTrim/trimpic.cpp
UTF-8
3,844
2.640625
3
[ "MIT" ]
permissive
#include "trimpic.h" #include <QPainter> #include <QDir> #include <thread> TrimPic::TrimPic(QObject *parent) : QObject(parent) { } TrimPic::~TrimPic() { unlockButton(true); } QImage TrimPic::resizeAndFullfill(QImage input,int w,int h,bool forceResize) { QImage result=QImage(w,h,QImage::Format_RGB...
true
28af4d15d5d6c338aa08b470b27602be7af84427
C++
azfa2019/lcCpp
/ex/exArray.cpp
UTF-8
830
2.671875
3
[]
no_license
#include<iostream> #include<vector> #include<queue> #include<set> #include<map> #include<unordered_set> #include<unordered_map> #include<stack> #include<queue> #include<algorithm> #include <numeric> #include <climits> #include <sstream> #include <memory> using namespace std; template<typename T> void showVector(vecto...
true
8e2dade132f9c22d578f25ef0ca44c206e9bccb5
C++
ilyachalov/lafore-book-examples
/Lafore-examples/chapter_05/169_table.cpp
UTF-8
1,402
3.046875
3
[]
no_license
// исходный текст программы сохранен в кодировке UTF-8 с сигнатурой // table.cpp // пример использования простой функции, которая печатает // строку из 45 символов '*' (звездочка) #include <io.h> // для функции _setmode #include <fcntl.h> // для константы _O_U16TEXT #include <iostream> using namespace std; ...
true
6a267151d043a9fc5b1b160aff00dce806fc99bb
C++
NaHenn/libskylark
/sketch/RFUT_Elemental.hpp
UTF-8
11,616
2.71875
3
[ "Apache-2.0" ]
permissive
#ifndef SKYLARK_RFUT_ELEMENTAL_HPP #define SKYLARK_RFUT_ELEMENTAL_HPP #include <boost/mpi.hpp> namespace skylark { namespace sketch { /** * Specialization for local */ template < typename ValueType, typename FUT, typename ValueDistributionType> struct RFUT_t< El::Matrix<ValueType>, FU...
true
f082387b68f45aafaeb01a48f6f546a5a82a656a
C++
tokar-t-m/lippman
/Part_2/Chapter_12/learn_12_6/learn_12_6.cpp
UTF-8
675
3.71875
4
[]
no_license
#include <iostream> #include <vector> #include <new> std::vector<int>* vec_create(); std::vector<int>* in_ivec(std::vector<int>* ivec); void print(std::vector<int>* ivec); int main(int argc, char *argv[]){ std::vector<int>* ivec = vec_create(); in_ivec(ivec); print(ivec); return 0; } std::vector<int>* vec_create...
true
aa100dc88e4f94c254a9ee52725d84e0b5c7ff52
C++
derisan/cg_2020
/13camera/13camera/player.cpp
UTF-8
1,845
2.546875
3
[]
no_license
#include "player.h" #include <glm/gtc/matrix_transform.hpp> #include <glm/gtx/rotate_vector.hpp> #include "mesh_component.h" Player::Player(Gfw* gfw, Gfw::Layer layer) : Actor{ gfw, layer }, mForwardSpeed{ 0.0f }, mRotationSpeed{ 0.0f }, mStrafeSpeed{ 0.0f }, mViewOption{ ViewOption::kFollow }, mView{ 1.0f } {...
true
42644a888e5af27212c6f89a6347dc8fb6684a45
C++
MarcWng/CPP_POOL
/B-CPP-300-PAR-3-3-CPPD07A-marc.wang/ex01/Parts.cpp
UTF-8
1,666
2.75
3
[]
no_license
/* ** EPITECH PROJECT, 2020 ** B-CPP-300-PAR-3-3-CPPD07A-marc.wang ** File description: ** Parts.cpp */ #include "Parts.hpp" Arms::Arms(std::string serial, bool functional) { this->_name = "Arms"; this->_serial = serial; this->_functionnal = functional; } Arms::~Arms() { } Legs::Legs(std::string serial, ...
true
23b09408364221d676d521b2b9f3832350846bde
C++
swolf-personal/CPSC-1020
/Mimir/MatrixEncription/encrypt.h
UTF-8
357
2.78125
3
[]
no_license
#include <iostream> #include <fstream> using namespace std; /*Read the data from a file. As you read each character check if *the character is a space. If it is not store the character in *a vector of characters. Then return the vector. */ vector<char> readData(ifstream& ); void findFloorCeiling(int&, int&, int)...
true
2c831280897d8608cfe43bd263b9942bc0f71e9c
C++
SunmoonHans/boj
/1700~1799/1780.cpp
UTF-8
1,116
3.40625
3
[]
no_license
#include <iostream> #define MAX 2188 using namespace std; int minus_one = 0; int zero = 0; int one = 0; bool check(int paper[][MAX], int row, int column, int size) { for (int i = row; i < row + size; ++i) for (int j = column; j < column + size; ++j) // 하나라도 같지 않은 색 있으면 break if (paper[i][j] != paper[row][co...
true
6109baed15ca6770ae2b1e6520975cdf8b0330b6
C++
black3r/subtitle-tool
/semiautomovedialog.cpp
UTF-8
2,588
2.640625
3
[]
no_license
#include "semiautomovedialog.h" #include "ui_semiautomovedialog.h" #include <QMessageBox> #include <QListWidgetItem> #include <QTime> SemiAutoMoveDialog::SemiAutoMoveDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SemiAutoMoveDialog) { this->subs = NULL; ui->setupUi(this); connect(this, SIGNA...
true
961b8ed1b68342c8c348f596d50a44c387ec2c9e
C++
mau5atron/CppTime
/012_section_pointers_and_references/022_section_12_challenge_pointers.cpp
UTF-8
2,348
4.25
4
[]
no_license
#include <iostream> using namespace std; void print(int arr[], const size_t size); int * apply_all(const int arr1[], const size_t size1, const int arr2[], const size_t size2); void print(int arr[], const size_t size){ for (size_t i { 0 }; i < size; ++i){ cout << arr[i] << " "; } cout << endl; } int * appl...
true
1f5fb1627e4ebc48624cb9b9d73a8cff0345d778
C++
simonpintarelli/2dBoltzmann
/src/aux/filtered_data_out.hpp
UTF-8
1,030
2.875
3
[]
no_license
#pragma once #include <deal.II/dofs/dof_handler.h> #include <deal.II/grid/filtered_iterator.h> #include <deal.II/numerics/data_out.h> namespace dealii { template <int dim> class FilteredDataOut : public DataOut<dim> { public: FilteredDataOut(const unsigned int subdomain_id) : subdomain_id(subdomain_id) { ...
true
e447db907bdef766622e65095e8ced3dc2f55619
C++
yanghai127/PTA
/PTA/1022.cpp
UTF-8
401
3.03125
3
[]
no_license
#include <iostream> #include <vector> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; a = a + b; if (!a) { cout << 0; return 0; } vector<int> v; while (a) { v.push_back(a % c); a /= c; } while (v.size()) ...
true
d67aac41b41b802410677cd42dfda0ce0491a7b8
C++
johnrsibert/tagest
/25/src/position.cpp
UTF-8
2,261
3.109375
3
[ "BSD-2-Clause" ]
permissive
//$Id: position.cpp 3125 2013-11-19 02:44:01Z jsibert $ #include <stdlib.h> #include <ctype.h> #include "modlarea.h" // convert geographic latitude to "equator/dateline" convention void lat_trans(int& lat, const char code) { char c = (char)toupper(code); if (c == 'S') { //Don't set the sign bit of 0 latitud...
true
d86e75e364843dea6ab95321935c46cd0a41f286
C++
iceylala/design-pattern
/adapter/adapter.cpp
UTF-8
464
3.296875
3
[ "MIT" ]
permissive
#include <iostream> using namespace std; class Base { public: virtual void show(){ cout<<"Base show"<<endl; } }; class Other { public: void show(){ cout<<"Other show"<<endl; } }; class Here:public Base { private: Other* tmp; public: Here(){ tmp = new Other(); } void show(){ Base::sh...
true
ca3e4d064427ac7bf4af0517d2424b7780a7424e
C++
Sushanth47/hello
/Snake/include/Snake.h
UTF-8
553
2.8125
3
[]
no_license
#ifndef SNAKE_H #define SNAKE_H #include <vector> #include<windows.h> #define width 50 #define height 25 class Snake { private: COORD pos; int len; float vel; char direction; std::vector<COORD> body; public: Snake(COORD pos, float vel); ...
true
cbd14b30a9bbda6bdc80c5ec2cd30083089e514f
C++
poehlerj/hack_taintdroid_app
/app/src/main/cpp/ScopedJniThreadState.h
UTF-8
1,234
2.6875
3
[ "Apache-2.0" ]
permissive
#ifndef __ScopedJniThreadState__ #define __ScopedJniThreadState__ #include "JNIEnvExt.h" #ifdef WITH_TAINT_TRACKING # define CHECK_STACK_SUM(_self) ((void)0) # define COMPUTE_STACK_SUM(_self) ((void)0) #endif /* * Entry/exit processing for all JNI calls. * * We skip the (curiously expensive) thread-local st...
true
bda04b3a667ee911620d815a744664cd2680320a
C++
sahib-pratap-singh/CB-LIVE-Solution
/Recurssion/string to int/main.cpp
UTF-8
347
3.046875
3
[]
no_license
#include <iostream> using namespace std; int stringtoint(string s, int n){ if(n==0){ return 0; } int digit = s[n-1]-'0'; int small_ans=stringtoint(s,n-1); return small_ans*10+digit; } int main() { string s; cin>>s; int n=s.length(); c...
true
9e2ac197466ac6423b6dd7c0685d059085768ec6
C++
rimever/SuraSuraCPlus
/list6_13/AccountEx.cpp
UTF-8
197
2.671875
3
[ "MIT" ]
permissive
#include "AccountEx.h" string AccountEx::getName() { return this->name; } AccountEx::AccountEx(string number, string name, int balance) : Account(number, balance) { this->name = name; }
true
3440118f5d6cc5554b8a3cabff461dd9515e736f
C++
duyhung2201/AppliedAlgo_20201
/Lesson3/HolleyNQueens/HolleyNQueens/main.cpp
UTF-8
1,196
2.859375
3
[]
no_license
// // main.cpp // HolleyNQueens // // Created by Duy Hung Le on 11/12/20. // Copyright © 2020 Macintosh. All rights reserved. // #include <iostream> using namespace std; int N, M, mark[13][13], sum=0; void placeQueen(int r, int c, int x){ for (int i =1; i<=N; i++){ mark[r][i] += x; if (1<= r+...
true
6f45dfa731f8f3b7cdb7b9c572e5de9f41704875
C++
brucelevis/zenith
/src/renderer/shaders/color_matrix_frag.hpp
UTF-8
1,713
2.75
3
[ "MIT" ]
permissive
/** * @file * @author __AUTHOR_NAME__ <mail@host.com> * @copyright 2021 __COMPANY_LTD__ * @license <a href="https://opensource->org/licenses/MIT">MIT License</a> */ #ifndef ZEN_RENDERER_SHADERS_COLOR_MATRIX_FRAG_HPP #define ZEN_RENDERER_SHADERS_COLOR_MATRIX_FRAG_HPP #include <string> namespace Zen { namespace...
true
66554ae9d1cf02835d149ee2f94524b94990ffe8
C++
PiotrKaszuba/2D-GAME
/Game/Header Files/Trap.h
UTF-8
695
2.59375
3
[]
no_license
#pragma once #include "Physical.h" //this class represents a trap that might be step on to activate //not used - base class for other traps //it might be used for other purposes than traps - anything that activates on step class Trap : public Physical { public: Trap(); Trap(int ID, Sprite_Sheet_Data base, sf::Vect...
true
7a8cd88df21093f75a42d680114d19f496cd8099
C++
ericxyun/pcc_cs
/cs_2/final_project/battleship.cpp
UTF-8
28,040
3.265625
3
[]
no_license
/************************************************************************** * AUTHOR : Eric Yun * FINAL PROJECT : Battleship * CLASS : CS 002 * SECTION : MTRF: 7:00a - 12p * Due Date : June 20, 2019 **************************************************************************/ #i...
true
c0facc24437216326165a41e968cbfad774b0255
C++
rrrr98/uva
/10800.cpp
UTF-8
1,338
2.75
3
[]
no_license
#include <cstdio> #include <iostream> #include <string> #include <limits> #include <climits> #include <cstdlib> #include <cstring> using namespace std; int main() { int nc; string input; int cases; int h, l, hMax, hMin; char arr[150][150]; cin >> nc; cases = 1; h = 0; while (nc--) { cin >> input; int x =...
true
fa9d379b0a9c851ea4610a4c3bb444b17fc8ee23
C++
MohammedZien/project-pacman
/project/sfml_1/Settings.cpp
UTF-8
1,197
2.859375
3
[]
no_license
#include "Settings.h" Settings::Settings() { this->resolution = sf::VideoMode::getDesktopMode(); this->fullScreen = false; this->frameRateLimite = 240; this->resolutions = sf::VideoMode::getFullscreenModes(); this->soundLevel = 100.f; }; void Settings::readFromFile(const std::string fileAdress) { std::ifstream ...
true
a008f88b5e9b67db7748a32047a7ded1a2b5036a
C++
gleiss/rapid
/src/analysis/SemanticsHelper.cpp
UTF-8
12,977
2.609375
3
[]
no_license
#include "SemanticsHelper.hpp" #include <cassert> #include "Variable.hpp" #include "Term.hpp" #include "Theory.hpp" #include "SymbolDeclarations.hpp" namespace analysis { # pragma mark - Methods for generating most used variables std::shared_ptr<const logic::LVariable> posVar() { return logic::Term...
true
75b58355fc966c71470a0663f27e26c238503d7e
C++
memeghaj10/Data-Structures-and-Algorithms
/Algorithms/Handling CSV/CSV.hpp
UTF-8
4,170
3.78125
4
[]
no_license
/** * * @author Het Daftary * This file has the read, write and generate random CSVs funcitons for CSV file. * We will be using vector of string* here to store data. */ #include <vector> #include <fstream> #include <cstdlib> #include <string> #include "Split_And_Join.hpp" class Field { public: string ...
true
84bedcabc2f22ac726a25889b1e4db0fd3779140
C++
msinvent/rbcpp
/include/rbc/subscriber/rbc_subscriber_impl.h
UTF-8
1,350
2.546875
3
[]
no_license
// // Created by Julian on 15.10.18. // #include <rbc/subscriber/rbc_subscriber.h> using namespace rbc::subscriber; using namespace rbc::msgs; template<typename T> RBCSubscriber<T>::RBCSubscriber(std::shared_ptr<ROSBridgeClient> rbc, std::string topic, std::string msg_type, size_t buf...
true
1d1d0f34a186fece1cb0b267d97bbaeb79009395
C++
caioguedesam/linkedlists_tp1
/node.cpp
UTF-8
806
3.25
3
[]
no_license
#include "node.h" Node::Node() { _nome_aluno = "head"; _nota = -1; _curso1 = -1; _curso2 = -1; _prox = nullptr; } Node::Node(std::string nome_aluno, float nota, int curso1, int curso2) { _nome_aluno = nome_aluno; _nota = nota; _curso1 = curso1; _curso2 = curso2; _prox = nullptr; } /*Node::~Node() { if(_pro...
true
931fc1cbf82aa0c9f0632896c190b304aebd6278
C++
ddusi/Algorithm_StudyGroup
/나영/July/등굣길(DP).cpp
UTF-8
671
2.78125
3
[]
no_license
#include <string> #include <vector> #include<iostream> #include<cstdio> #define MAX 101 #define long long ll using namespace std; int solution(int m, int n, vector<vector<int>> puddles) { bool water[MAX][MAX]={false,}; for(int i=0;i<puddles.size();i++){ water[puddles[i][0]][puddles[i][1]]=true; } int n...
true
8dffae97088182681bccbb93574b5d02e5f70a35
C++
madhurima31/Dynamic-Programming
/zero_one_knapsack.cpp
UTF-8
679
2.6875
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int knap_sack(int W, int val[],int wt[],int n); int main(){ int W =50; int val[]= {60,100,120}; int wt[]={10,20,30}; int n = sizeof(val)/sizeof(val[0]); cout<<knap_sack(W,val,wt,n); return 0; } int knap_sack(int W, int val[], int wt[], int n ){ int ...
true
f9a756816cd2e4d0fe044206497f7acedd998721
C++
darrinwillis/FluenceRenderer
/src/bsdf.cpp
UTF-8
2,821
2.84375
3
[]
no_license
#include "bsdf.h" #include <iostream> #include <algorithm> #include <utility> using std::min; using std::max; using std::swap; namespace CMU462 { void make_coord_space(Matrix2x2& o2w, const Vector2D& n) { Vector2D y = Vector2D(n.x, n.y); Vector2D h = y; if (fabs(h.x) <= fabs(h.y)) { h.x = 1.0; ...
true
977e8ad245f9546cca1c96f403b429459e16cc99
C++
LindongLi/Leetcode
/202 Happy Number/202 LL.cpp
UTF-8
1,195
4.09375
4
[]
no_license
#include <iostream> #include <unordered_set> using namespace std; /* https://leetcode.com/problems/happy-number/ Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its...
true
91eb2408d483e9f985a2f99aef84c52429817537
C++
aconstlink/natus
/math/spline/cubic_hermit_spline.hpp
UTF-8
13,163
2.71875
3
[ "MIT" ]
permissive
#pragma once #include "../typedefs.h" #include "continuity.h" #include "../interpolation/interpolate.hpp" #include <natus/ntd/vector.hpp> namespace natus { namespace math { template< typename T > class cubic_hermit_spline { public: natus_this_typedefs( cubic_hermi...
true
ec0ae9f5622442991fa390f29774774ef480db1b
C++
disini/Photon
/Photon/RT1W/textures/solid_color.h
UTF-8
363
2.65625
3
[]
no_license
#pragma once #include "RT1W\textures\texture.h" class solid_color : public base_texture { public: solid_color() {} solid_color(color c) : color_value(c) {} solid_color(double red, double green, double blue) : solid_color(color(red, green, blue)) {} virtual color value(double u, double v, const vec3& p) const o...
true
c054c524544d7e319ee192a44b00573897d6f581
C++
MotoX244/GraphicsLibrary
/Graphics2D/CanvasImplementor_WinAPI.cpp
UTF-8
6,704
2.5625
3
[]
no_license
#include <exception> #include <sstream> #include "CanvasImplementor_WinAPI.h" #include "Camera.h" #include "Object/Line.h" #include "Object/Circle.h" #include "Object/Rectangle.h" #include "Object/Bitmap.h" using namespace std; using namespace Graphics2D; class CanvasException final : public exception { public: Can...
true
ecceaa5502d5efe6ed273e6894f316b354ff8742
C++
boyvita/oop
/lab6/oop_lab6/oop_lab6/Vector.h
UTF-8
624
2.96875
3
[]
no_license
#pragma once #include <stdint.h> #include <exception> #include <stdexcept> template <typename T> class Vector { public: Vector(); ~Vector(); void reserve(uint32_t const& _sz); void resize(uint32_t const& sz); T & at(uint32_t const& num); T & operator [] (uint32_t const& num); Vector(Vector<T> const& v); ...
true
e8c00413518f8ba42f8d4526970c5de502c10575
C++
ytldsimage/kinect_ouster_autoware_driver
/include/ouster/os1.h
UTF-8
6,160
2.734375
3
[]
no_license
/** * @file * @brief OS-1 sample client */ #pragma once #include <cstdint> #include <memory> #include <string> #include <vector> #include "version.h" #include "os1_packet.h" namespace ouster { namespace OS1 { struct client; enum client_state { TIMEOUT = 0, CLIENT_ERROR = 1, LIDAR_DATA = 2, IMU_...
true
0ddf62129c78c018c9790c52ab1cecf80def883f
C++
mit-carbon/Graphite-Cycle-Level
/tests/unit/spawn/spawn.cc
UTF-8
986
2.9375
3
[ "MIT" ]
permissive
// This unit test will test the spawning mechanisms of the simulator #include <stdio.h> #include <unistd.h> #include <assert.h> #include "carbon_user.h" void* thread_func(void *threadid); void* thread_func_simple(void *threadid); void do_a_sim() { const unsigned int numThreads = 5; int threads[numThreads]; ...
true
3cf5a2904290357c97c945ba72877bd8abd3d85d
C++
ScottHutchinson/Mastering-Cpp-Programming.
/Chapter-2/4_constructor_call.cpp
UTF-8
295
2.75
3
[]
no_license
#include <iostream> struct BeforeMain { BeforeMain() { std::cout << "Constructing BeforeMain" << std::endl; test(); } void test() {std::cout << "test" << std::endl;} }; BeforeMain b; int main() { std::cout << "Calling main()" << std::endl; return 0; }
true
24f9f30eb9af3c0d108d0dc501ef9a9d01875385
C++
dmyang42/Leetcode_Problem
/leetcode_260.cpp
UTF-8
485
3.078125
3
[]
no_license
class Solution { public: vector<int> singleNumber(vector<int>& nums) { int aXorb = 0; for (auto item : nums) aXorb ^= item; int lastBit = (aXorb & (aXorb - 1)) ^ aXorb; int intA = 0, intB = 0; for (auto item : nums) { if (item & las...
true
adf2b471b8e09ec46c9eede51d953924eb551455
C++
mikhail-frolov/C-and-CPP-programming
/C++/WS7/VehicleTester.cpp
UTF-8
3,183
3.3125
3
[]
no_license
// OOP244 Workshop 7: Inheritance // File: VehicleTester.cpp // Version: 1.0 // Date: 02/28/2020 // Author: Nargis Khan // Description: // This file tests lab section of your workshop ///////////////////////////////////////////// // ----------------------------------------------------------- // Name Mikhail F...
true
f21fb2bb3b8b2d7f55c64eda5cbdccf92f758518
C++
cha0s/avocado-old
/app/native/SPI/Script/v8/v8Counter.cpp
UTF-8
1,947
2.5625
3
[]
no_license
#include "avocado-global.h" #include "v8Counter.h" using namespace v8; namespace avo { v8Counter::v8Counter(Handle<Object> wrapper) { counter = Counter::factoryManager.instance()->create(); Wrap(wrapper); } v8Counter::~v8Counter() { delete counter; } void v8Counter::initialize(Handle<ObjectTemplate> target) {...
true
ab5a356f1ed3f2b3cf8dc94d243ecbe475277aa0
C++
paulzfm/mydb
/record/types.h
UTF-8
3,402
3.140625
3
[]
no_license
// Data types for mydb. // type DType = Short | Int | Long | Float | Double | Bool | Char | String <bytes> #ifndef RECORD_TYPES_H_ #define RECORD_TYPES_H_ #include <string> #include <cstring> class DType { public: DType(int ident) : ident(ident) { this->ident = ident; switch (ident) { ...
true
367ae16224a5e344dd6355ae3543ff1c72d54b9f
C++
chen-fang/FaSTL
/ThreeStage/Op.hpp
UTF-8
692
3.125
3
[]
no_license
#pragma once struct OpAdd { template< typename T > inline static T value ( T a, T b ) { return ( a + b ); } template< typename T1, typename T2 > inline static typename T1::size_type Get_Derivative ( const T1& t1, const T2& t2 ) { return ( t1.derivative() + t2.derivative() ); } }; ...
true
886216388098399124cdee27604b2b1c62f1dedb
C++
shym98/PentaGo
/PentaGo/Main_menu.h
UTF-8
1,592
2.859375
3
[]
no_license
#pragma once #include <SFML/Graphics.hpp> #include <bits/stdc++.h> using namespace sf; using namespace std; void menu(RenderWindow &window) { /*Background*/ Texture Reich; Reich.loadFromFile("zighail.png"); Sprite Fuhrer; Fuhrer.setTexture(Reich); Fuhrer.setTextureRect(IntRect(0, 0, 830, 800)); Fuhrer.setPos...
true
3379a28fd831015fcc11f771ac3ea134b9afd783
C++
cameron4143/epsi-br-2022
/src/battleroyale/Fighter.cpp
UTF-8
5,061
3.140625
3
[]
no_license
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include "Fighter.h" #include "log.h" using namespace std; Fighter::Fighter(string name, int attack, int defense, int speed) { this->name = name; // Calcul d'ID discutable basé sur l'adresse de l'instance... // Les 3 lignes en...
true
b43f24babbba6c7f17a3c6468eb1697c3fb7bbcc
C++
sanggs/CS839-PhysicsBasedModeling
/3-DElasticity/tests/assignment2/main.cpp
UTF-8
15,461
2.703125
3
[]
no_license
/* ************** Assignment 2 ****************** * Title: Linear Elasticity * Files: main.cpp * Semester: (CS839) Fall 2019 * Author: Sangeetha Grama Srinivasan * Email: sgsrinivasa2@wisc.edu * CS Login: sgsrinivasa2 * Lecturer's Name: Prof. Eftychi...
true
bd5bb9362e52fc4066a5a1eee4ce76ba204fe59c
C++
vineethkumart/snippet
/union_find/eq_class.cpp
UTF-8
1,814
3.546875
4
[]
no_license
#include <iostream> #include <vector> #include <set> using namespace std; class uf_t { public: uf_t(int size) { for (int i =0; i < size; i++) { set_t s; s.parent = i; s.rank = 0; sets.push_back(s); } } int find_root(int i) { if (...
true
1cd277ac56160e8a799707995668faada3bec027
C++
aneesh001/InterviewBit
/Arrays/rotate_2d.cpp
UTF-8
408
2.9375
3
[ "MIT" ]
permissive
#include <bits/stdc++.h> using namespace std; void rotate(vector<vector<int> > &A) { int n = A.size(); for(int x = 0; x < n / 2; ++x) { for(int y = x; y < n - x - 1; ++y) { int tmp = A[x][y]; A[x][y] = A[n - y - 1][x]; A[n - y - 1][x] = A[n - x - 1][n - y - 1]; A[n - x - 1][n - y ...
true
ad2587093b96e532567ce2f8ac1184670af6beeb
C++
Justocodes/C-Projects
/PROJECTS/JUSFLE (19).cpp
UTF-8
554
3.96875
4
[]
no_license
#include <iostream> // this program uses if and else statements using namespace std; int main() { double num; cout << "Enter a positive or negative number, or enter 0 : "; cin >> num; cout << endl; cout << "The number you just entered is " << num << ", and for your info this is a "; if (nu...
true
f3df1b293a330f869265d9ce50f82dfe0250ba49
C++
wzj1988tv/code-imitator
/data/dataset_2017/dataset_2017_8_formatted_macrosremoved/4yn/5304486_5760761888505856_4yn.cpp
UTF-8
1,301
2.78125
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int tc; int main() { cin >> tc; for (int t = 1; t <= tc; t++) { int r, c; cin >> r >> c; char cake[30][30]; for (int i = 0; i < r; i++) { for (int j = 0; j < c; j++) { cin >> cake[i][j]; } } for (int i = 0; i < r; i++) { ...
true
2a743f9a27dc474c1a8e44b5cecd08a0304c692b
C++
jjocram/sydevs
/src/sydevs/core/scale.h
UTF-8
7,724
3.46875
3
[ "BSL-1.0", "Apache-2.0" ]
permissive
#pragma once #ifndef SYDEVS_SCALE_H_ #define SYDEVS_SCALE_H_ #include <sydevs/core/number_types.h> #include <iosfwd> namespace sydevs { /** * @brief A data type which represents the general concept of scale as a * dimensionless power of 1000. * * @details * A `scale` value can be used to characterize t...
true
aa748fcff0ef30570418f5c5f95c034897825d41
C++
Vishal260700/Placement_Codes
/PLACEMENT/Inter-IIT-NIT-IIIT-solutions-2019-20-master/Sharechat/compressed string.cpp
UTF-8
810
3.40625
3
[]
no_license
/* Given a string of lowercase letters, output the compressed form of the string. Compressed form of a string 'aaabccdde' is : a3bc2d2e. */ #include <iostream> #include <bits/stdc++.h> using namespace std; string compressedString(string str){ int len = str.length(); string res = ""; res += str[0]; int ...
true
3b3b64f873bb64b4c8c77b6c89346ee4d8ba78bd
C++
Pravesh-Jamgade/path-finding
/Path_Planning.cpp
UTF-8
1,455
2.765625
3
[]
no_license
#include <bits/stdc++.h> #include "Path_Planning.hpp" using namespace PathPlanner; int main(){ Planner<int> g; g.set_directed(true); //// graph 1 // g.insert_edge(0, 1, 4); // g.insert_edge(0, 7, 8); // g.insert_edge(1, 2, 8); // g.insert_edge(1, 7, 11); // g.insert_edge(2, 3, 7); // g.insert_edge(2, 8, 2)...
true
b776f53a42333dd4326f764642ba765d057d4858
C++
tbrax/cs487
/GameJam_1/gamelib/gamelib_action.hpp
UTF-8
1,023
2.734375
3
[]
no_license
#ifndef GAMELIB_ACTION_HPP #define GAMELIB_ACTION_HPP #include <gamelib_base.hpp> #include <gamelib_actor.hpp> namespace GameLib { class Action { public: virtual ~Action() {} void setActor(Actor* actor) { actor_ = actor; } Actor* getActor() { if (!actor_) r...
true
bd6abc32c56135a46b60972e620316b9bf0c1a43
C++
edhayes1/cudapi
/singlethreadpi.cpp
UTF-8
767
3.359375
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <cstdlib> #include <iostream> #include <vector> #include <math.h> using namespace std; vector<double> randomints(vector<double> &a, double n) { int i; for (i = 0; i < n; ++i) { a[i] = (double)rand() / (double)RAND_MAX; } cout << "created rando...
true
4e20fccdf47c0ddff614538a903292f9ab48afd0
C++
bigfei123/learngit
/20190108/singleton.cc
UTF-8
1,627
3.46875
3
[]
no_license
/// /// @file singleton.cc /// @author bigfei775655478@qq.com) /// @date 2019-01-10 09:02:49 /// #include <iostream> using std::cout; using std::endl; //单例模式:要求通过该类只能创建出一个对象 //1.该对象不能是栈对象,只能是堆对象 //2.将构造函数私有化 //3.在类中定义一个静态的指针对象(私有),并在类外初始化为空 //4.定义一个返回值为类指针的静态成员函数 // // //1.只要出现的全局变量都可以用单例模式替代 //2.对于全局唯一的...
true
1906f16314c37b1f8042d61fbedb93f8fd58297f
C++
arabhiar/InterviewBit
/Dynamic Programming/regular-expression-ii.cpp
UTF-8
878
3.0625
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int helper(string A, string B) { // '.' Matches any single character. // '*' Matches zero or more of the preceding element. int l1 = A.length(), l2 = B.length(); vector<vector<bool>> dp(l1 + 1, vector<bool>(l2 + 1, false)); dp[0][0] = 1; for (int i ...
true
387f81ed880178f386d3f25bbeab27a268fa82ba
C++
rlalance/PhaserNative
/src/JSC/JSCValue.cpp
UTF-8
4,757
2.984375
3
[ "MIT" ]
permissive
#include "JSCValue.h" #include "JSCObject.h" #include "JSCException.h" #include "JSCHelpers.h" #include <JavaScriptCore/JavaScript.h> #include <SDL2/SDL_log.h> #include <limits> #include <sstream> namespace JSC { Value Value::MakeUndefined() { return JSValueMakeUndefined(JSC_GLOBAL_CTX); } Value Value::MakeNu...
true
49b7491972ca3100e3d3d63d983fe76f6b20157f
C++
Sherjia/Cplus-demo
/c++day6/c++day6/dm_01继承的基本语法.cpp
UTF-8
439
3.359375
3
[]
no_license
#include <iostream> using namespace std; class Parent { public: void print() { a = b = 0; cout << "a=" << a << endl; cout << "b=" << b << endl; } int a; int b; protected: private: }; //class Child : private Parent //class Child : protected Parent class Child : public Parent { public: protected: private:...
true
472484ca4b0f0ecd9c324c7002b8e471349c6260
C++
chenxu-liu/vscode
/Leetcode429.cpp
UTF-8
1,045
3.125
3
[]
no_license
/* // Definition for a Node. class Node { public: int val; vector<Node*> children; Node() {} Node(int _val) { val = _val; } Node(int _val, vector<Node*> _children) { val = _val; children = _children; } }; */ class Solution { public: vector<vector<int>> levelOr...
true
1aed740228382321530caf0e2ff338e477001728
C++
Fireflaker/Arduino-ds18b20-Thermometer-Data-Logger
/ArduinoDataLogger/Mega_display/Mega.ino
UTF-8
3,076
2.84375
3
[ "MIT" ]
permissive
#include <OneWire.h> #include <DallasTemperature.h> // Data wire is plugged into pin 2 on the Arduino #define ONE_WIRE_BUS 2 // Setup a oneWire instance to communicate with any OneWire devices // (not just Maxim/Dallas temperature ICs) OneWire oneWire(ONE_WIRE_BUS); // Pass our oneWire reference to Dallas Temperatur...
true
c51c903ee354255c8657c2d5cfdfb6be9b57c486
C++
bluecataudio/plugnscript
/Built-in/Scripts/Midi FX/midi log.cxx
UTF-8
2,756
2.765625
3
[]
no_license
/** \file * MIDI log. * Write the content of MIDI events to the log file. */ #include "../library/Midi.hxx" // internal data--------------------------- array<string> MidiEventsTypes(kUnknown+1,"-Event-"); MidiEvent tempEvent; string consoleMessage; string temp; // internal functions-----------------...
true
6ce26ba89c1f82ff812b6266d4d368e2baa4932c
C++
wakewakame/VideoTest
/GLGraphics.cpp
UTF-8
1,948
3
3
[]
no_license
/* ============================================================================== OpenGL.cpp Created: 11 Oct 2018 3:25:50pm Author: 0214t ============================================================================== */ #include "GLGraphics.h" GLGraphics::GLGraphics() {} GLGraphics::...
true