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
7bda7602b8f899e0a0848bc690e8d987e896fee6
C++
ccebinger/SWPSoSe14
/rail-interpreter/src/Board.h
UTF-8
570
2.78125
3
[]
no_license
// Board.h #ifndef BOARD_H_RAIL_1 #define BOARD_H_RAIL_1 #include "Vec.h" class Board { public: Board(); ~Board(); Board(std::string const & newName, std::list<std::string> const & newData); void reset(std::string const &newName, std::list<std::string> const & newData); char at(Vec pos) const...
true
a4fc8d2c62b607501281026b9dc2dc4f2c99ff30
C++
ivk-jsc/broker
/libs/libupmq/decaf/util/StringTokenizer.h
UTF-8
5,001
3.09375
3
[ "Apache-2.0" ]
permissive
/* * Copyright 2014-present IVK JSC. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appl...
true
715e5b7038136947b882263edf3d32d850d02540
C++
gwanhyeon/algorithm_study
/beakjoon_algorithm/beakjoon_algorithm/브루트포스/NM시리즈(4) 중복조합.cpp
UTF-8
1,047
2.578125
3
[]
no_license
// // NM시리즈(4).cpp // beakjoon_algorithm // // Created by kgh on 01/10/2019. // Copyright © 2019 kgh. All rights reserved. // #include <stdio.h> #include <iostream> #include <vector> using namespace std; int n,m; vector<int> v; int check[10]; void go(int cnt){ if(cnt == m){ bool tf = false; ...
true
50ed2ca553b59cb31cf4484557672b8192d4ac40
C++
SylwiaNowak/homeBudgetPlaner
/HomeFinanceCalculator.cpp
UTF-8
3,583
3.4375
3
[]
no_license
#include "HomeFinanceCalculator.h" bool HomeFinanceCalculator::isTheUserLoggedIn() { userManager.isTheUserLoggedIn(); } char HomeFinanceCalculator::chooseOptionFromTheMainMenu() { userManager.chooseOptionFromTheMainMenu(); } char HomeFinanceCalculator::chooseOptionFromTheUserMenu() { userManager.chooseOp...
true
57be0b0b48e150e903da0648d8ae7e2077f31ad6
C++
BSU2015gr09/Motolov
/semester_1/2-3naibcifra.cpp
UTF-8
369
2.6875
3
[]
no_license
#include<iostream> #include<clocale> using std::cout; using std::cin; int max3(int n, int m, int p){ int result = n; if (result < m){ result = m } if (result < p) { result = p; retyrn result; } } int main(){ setlocale(LC_ALL, "Russian"); int a = 0, b = 0, c = 0, max; cin >> a >> b >> c; rez = max3(a, b...
true
ae20c2515ee517f378ecb056284d991cbe0116ef
C++
ronistone/Maratonas
/URI online/2589.cpp
UTF-8
482
2.625
3
[]
no_license
#include <bits/stdc++.h> using namespace std; typedef long long int ll; vector<ll> primos; bool prime[1000000002]; void sieve(){ //memset(prime,true, sizeof(prime)); primos.clear(); prime[1] = true; ll i,j; for(i=2;i<=1000000001;i++){ if(!prime[i]){ primos.push_back(i); for(j=i*i;j<=1000000001;j+=i) ...
true
7957121c410ed819120c20c747295b764f12aa57
C++
ishika-patel/Data-Structures
/HW3/arrayDouble.cpp
UTF-8
855
3.71875
4
[]
no_license
#include <iostream> using namespace std; bool append(string* &str_arr, string s, int &numEntries, int &arraySize){ bool check = false; string *tempArray = NULL; int numberDoubled = 0; if(numEntries == arraySize) { //Increase the capacity by two times arraySize = arraySize *2; /...
true
beb8709a5cb0c09c177d2861c6621cf7342c957a
C++
seesealonely/leetcode
/greedy/2592.MaximizeGreatnessofanArray.cc
UTF-8
1,153
3.671875
4
[]
no_license
/* You are given a 0-indexed integer array nums. You are allowed to permute nums into a new array perm of your choosing. We define the greatness of nums be the number of indices 0 <= i < nums.length for which perm[i] > nums[i]. Return the maximum possible greatness you can achieve after permuting nums. ...
true
d48d97b2350990c3ec20c7549277ba160c806fba
C++
chen82508/Zeorjudge
/原創or不分類題庫/CPP/a160.cpp
WINDOWS-1252
2,766
3.078125
3
[]
no_license
/****************************************************************************** * * The purpose of using row index - column index + the number of Queens 2 - 1 * to set value of slash is to prevent the repeat of the index of diagonal from * top left to bottom right which might result in judgment error. * * The ju...
true
d6baf5cbb7400f83dd2dfbb9da5e1145142de407
C++
firearasi/raytracingbasicscuda
/lib/sphere.h
UTF-8
627
2.578125
3
[]
no_license
#ifndef SPHEREH #define SPHEREH #include "hitable.h" #include <stdlib.h> #include <math.h> #include "material.h" void get_sphere_uv(const vec3&p, float&u, float& v); class sphere: public hitable { public: sphere() {} sphere(vec3 cen, float r, material *m): center(cen), radius(r), mat(m) {}; virtual void free(){} ...
true
d878d5e2216d116ae6a01fc93f9f6bd0d6c668cf
C++
andyyu/web-steganographer
/Compressor.cpp
UTF-8
3,526
3
3
[]
no_license
#include "provided.h" #include "HashTable.h" #include <string> #include <vector> #include <iostream> using namespace std; unsigned int computeHash(string key) { if (key.length()!= 0) return key[0] + 11; return 0; } unsigned int computeHash(unsigned short key) { return (key+3)/(key+1); } void Co...
true
de34ee4691829d9f2da5372aa8d0ebbc084a1a97
C++
SiLeader/cluster-manager
/include/cluster/detail/cluster.hpp
UTF-8
1,061
3.21875
3
[ "Apache-2.0" ]
permissive
// // Created by cerussite on 2019/11/16. // #pragma once #include <cstdint> #include <string> #include <string_view> namespace cluster { class Cluster final { private: std::string _host; std::uint16_t _port; public: Cluster(std::string_view host, std::uint16_t port) ...
true
48d1de928a111aa7d17f28dd0dae7aac678006d8
C++
amanr11314/PLACEMENT-PREPARATION
/Placement Preparation-II/Arrays/jump_game_II.cpp
UTF-8
1,958
3.53125
4
[]
no_license
/** * Given an array of non-negative integers nums, you are initially positioned at the first index of the array. * Each element in the array represents your maximum jump length at that position. * Your goal is to reach the last index in the minimum number of jumps. * You can assume that you can always reach the l...
true
b62c92c0d06dcb7a7cfe1d9e71bbdd7c9273b620
C++
rgmelko/VB_qmc
/melko/LOOPS/2dmaybe/ratioloop/loop_main.cpp
UTF-8
2,802
2.703125
3
[]
no_license
//Jan 18, 2010 --- starting loop code #include "header.h" #include "loop_header.h" int main(){ cout.precision(10); // read in parameters: system dimensions, number of bond operators, // filenames, iterations per loop, number of loops, a random seed int dim1, dim2; int ratioflip; long long its_per_lo...
true
4bf56f992e51b999d375ffd533e0f0a79b9708a4
C++
killbug2004/TASDK
/TribesAscendSDK/DynamicClasses.h
UTF-8
6,967
2.578125
3
[]
no_license
class NameProperty { DWORD offset_; uintptr_t thisptr_; public: NameProperty( void *thisptr, DWORD offset, DWORD bit_mask ) { thisptr_ = ( uintptr_t )( thisptr ); offset_ = offset; } operator ScriptName*() { return ( *( ScriptName** )( thisptr_ + offset_ ) ); } }; class StrProperty { DWORD offset_; ui...
true
c3755933896c665dda0564e8da9d5a014b46976c
C++
JackOKITC/Brake-Point-Racing
/Joint_Project/include/Sfe/StreamSelection.hpp
UTF-8
2,043
2.5625
3
[]
no_license
/* * StreamSelection.hpp * sfeMovie project * * Copyright (C) 2010-2015 Lucas Soltic * lucas.soltic@orange.fr * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * ...
true
813e5d14d108b7aac718c419a71f7b0c59ad3b34
C++
bdonkey/DataStructures-Algorithms
/DSA Crack Sheet/solutions/57. Permutations of a Given String.cpp
UTF-8
743
3.390625
3
[ "MIT" ]
permissive
// using STL #include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { string s; cin >> s; sort(s.begin(), s.end()); do { cout << s << " "; } while (next_permutation(s.begin(), s.end())); cout << endl; } return 0; } /* ====================...
true
92480d682a77a62f3a1a3d2627f18f15a00164e3
C++
Casket/marsh-game-files
/Marsh/Marsh/Attack.cpp
UTF-8
8,326
2.78125
3
[]
no_license
#include "Main.h" Attack::Attack(int x, int y, int vel, int vel_d, Sprite* img, int base_damage, int penetration, int range, int tree_depth, int exp_date, int charge_time) :iDrawable(x, y, vel, vel_d, img) { this->base_damage = base_damage; this->penetration = penetration; this->range = range; this-...
true
addd5c7b4a4d05c27ef7cea728e6a7fc3a5280d0
C++
jeffbahns/scheme-to-cpp
/CodeGenerator.h
UTF-8
1,215
2.734375
3
[]
no_license
#ifndef CODEGENERATOR_H #define CODEGENERATOR_H #include <iostream> #include <fstream> #include <vector> using namespace std; class CodeGenerator { public: CodeGenerator(char * filename); ~CodeGenerator(); void write(string code_to_write); void define(string function_name); void end_de...
true
f207a7532c4e111c9c0904fa252cd289695b8c81
C++
WenYang-Lai/NCTU_Homework
/AdvencedUnixPrograming/hw3/include/jobs.h
UTF-8
894
2.671875
3
[]
no_license
#ifndef __JOBS__ #define __JOBS__ #include <stdio.h> #include <stdlib.h> #include <map> using namespace std; struct Process{ struct Process *next; char **argv; int pid; bool completed; bool stopped; Process(int i_pid, char** i_argv){ next = NULL; pid = i_pid; argv = i_argv; completed = ...
true
b3cc9f9649fa1aac4ee3601e939f1caa28a9e03e
C++
rahulroshan96/placement
/Amazon/isLands.cpp
UTF-8
910
3.203125
3
[]
no_license
#include <iostream> #include <string.h> using namespace std; #define ROW 4 #define COL 4 bool isSafe(int a[][COL], bool M[][COL], int i, int j) { return ( (i>=0 && i<ROW) && (j>=0 && j<COL) && a[i][j] && !M[i][j]); } void DFS(int a[][COL], bool M[][COL],int i, int j) { int rowNbr[] = {-1, -1, -1, 0, 0, 1, 1, 1};...
true
390919b8f04b2f9585a94cd7ccbd2602138f7fa4
C++
JonasRock/ARXML_LanguageServer
/src/messageParser.cpp
UTF-8
2,687
2.640625
3
[ "Apache-2.0" ]
permissive
#include "messageParser.hpp" #include "lspExceptions.hpp" void lsp::MessageParser::register_response_callback(const uint32_t id, response_callback callback) { if(callback) response_callbacks_[id] = callback; } void lsp::MessageParser::register_notification_callback(const std::string &notification, jsonrpc...
true
cb8393ab05269820d0e5d420e32c78f229f09362
C++
opensourceyouthprogramming/h5vcc
/external/angle/samples/angle/Resource_Tracking/resource_tracking.cc
UTF-8
3,339
2.546875
3
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// Note that this sample is incomplete in that it gives a snippet of code // that demonstrates a use case of eglSetResourceTrackerANGLE(), but does not // have any driving main() method. #include <assert.h> #include <iostream> #include <sstream> #include <string> #include <d3d11.h> #include <EGL/eglext.h> #include <...
true
0352c2cf9f09f70834abfd595f067c3ed8ebe8eb
C++
lexoux/rayTracer
/projet3D/BBox.h
UTF-8
684
2.5625
3
[]
no_license
// // BBox.h // projet3D // // Created by Julien Philip on 14/04/2015. // Copyright (c) 2015 Julien Philip. All rights reserved. // #ifndef projet3D_BBox_h #define projet3D_BBox_h #include "Vec3.h" class BBox{ public : inline BBox(){ xL=0; yL=0; zL=0; coin=Vec3f(0,0,0); ...
true
aac1cdeabd89ca35375cf1d3226d3ebc92ecbfad
C++
Yippie-Calle/CS165
/Projects/Skeet/birds.cpp
UTF-8
1,050
2.90625
3
[]
no_license
#include "birds.h" #include "uiDraw.h" NormalBird::NormalBird(const Point& point) : Bird(point) { float dx = random(3, 6); float dy = random(0, 4); if (point.getY() > 0) { dy *= -1; } Velocity newVelocity; newVelocity.setDx(dx); newVelocity.setDy(dy); setVelocity(newVelocity); } ToughBird::ToughBird(con...
true
607a38ef0163aa5f15921cc813b8cda70fde2e60
C++
ontario-tech-pw-II/a7-shayne-lewis
/Part-1/SavingsAccount.cpp
UTF-8
755
3.40625
3
[]
no_license
#include "SavingsAccount.h" using namespace std; // constructor initializes balance and interest rate SavingsAccount::SavingsAccount( double initialBalance, double rate ) : Account( initialBalance ) { // your code if( rate >= 0.0 ) interestRate = rate*100; else interestRate = 0.0; } double SavingsAccount::c...
true
585e6209127596a9ee97e904e417ab344cd6e2e1
C++
KarlaRivera/Programacion_Sistemas
/Segundo Parcial/Parcial2/Arreglos/main.cpp
UTF-8
377
3.03125
3
[]
no_license
#include <iostream> #include <string> using namespace std; int int_array[5]; void arreglo (int int_array[]) { for (int i=0; i<5; i++) { cout<<"Ingresar numero :"; cin>>int_array[i]; } for (int i=0; i<5; i++) { cout<<"Numero :"<<int_array[i]<<"\n"; } } int...
true
9cdad12c6970ad2f9a43d46e64aeb64893fdc25d
C++
ptrv/SimpleSceneGraph
/src/Rotate.cpp
UTF-8
891
2.6875
3
[]
no_license
/* * Rotate.cpp * Szenegraph * * Created by peter on 03.06.08. * Copyright 2008 __MyCompanyName__. All rights reserved. * */ #include "Rotate.h" #define foreach( i, c )\ typedef __typeof__( c ) c##_CONTAINERTYPE;\ for( c##_CONTAINERTYPE::iterator i = c.begin(); i != c.end(); ++i ) Rotate::Rotate(const std...
true
d8cd31d4743e845003f42e54b4dfc431c90efca5
C++
mayfes-ar/game
/ar2016/src/game/single_game_player.cpp
UTF-8
31,635
2.609375
3
[]
no_license
#include "game/single_player_game.h" #include <typeinfo.h> std::shared_ptr<SinglePlayerGame::Teresa> SinglePlayerGame::makeTeresa(int x = 0, int y = 0, double size = 1.0) { if (x == 0 && y == 0) { x = rand() % (WIDTH - 100) + 50; y = rand() % (HEIGHT - 100) + 50; } auto enemy = std::make_shared<Teresa>(x, y, *...
true
13ac30cbc33acd24fe37519eddbd033b7525ba58
C++
Wevan/untitled3
/main.cpp
UTF-8
6,916
3.09375
3
[]
no_license
#include <iostream> #include <stdio.h> #include <pthread.h> #include <cstdlib> #include <unistd.h> #include <semaphore.h> #define BUFFER_SIZE 10//缓冲区大小为10 #define N_WRITER 20 //写者数目 #define N_READER 5 //读者数目 #define W_SLEEP 1 //控制写频率 #define R_SLEEP 1 //控制读频率 #define P(S) sem_wait(S) #define V(S) sem_post(S) pthrea...
true
670996905aaee889336ee15688496bcc23f4891f
C++
cristiandonosoc/rothko
/rothko/math/math.cc
UTF-8
15,773
2.859375
3
[ "BSD-2-Clause" ]
permissive
// Copyright 2019, Cristián Donoso. // This code has a BSD license. See LICENSE. #include "rothko/math/math.h" #include <cassert> #include <cmath> #include "rothko/logging/logging.h" #include "rothko/utils/strings.h" namespace rothko { // Math Functions =============================================================...
true
583e8fc4555249a59ae400dc71cc96c47f599f71
C++
edwinpadron/Cpp-Primer
/chapter07/7.57.cpp
UTF-8
1,173
3.796875
4
[]
no_license
/* * Exercise 7.57: Write your own version of the Account class. * * by Faisal Saadatmand */ #include <iostream> #include <string> class Account { public: Account() = default; Account(std::string name) : owner(name) {} Account(std::string name, double amt) : owner(name), amount(amt) {} void calculate()...
true
0541ce6a07a77759dbb07d53368a2cab8eb15ac1
C++
ExpLife/Norton_AntiVirus_SourceCode
/Consumer/r12.0.6/src/Engine/SND/GRENLEAF/OBJNAME.H
UTF-8
6,992
2.5625
3
[]
no_license
//************************************************************************ // // $Header: S:/GRENLEAF/VCS/OBJNAME.H_v 1.0 12 Mar 1998 12:13:16 DCHI $ // // Description: // Greenleaf ArchiveLib 2.0 // //************************************************************************ // $Log: S:/GRENLEAF/VCS/...
true
fc53c97cc45036e190e4fcd0125715b9c03801c7
C++
mkalenska/task29
/main.cpp
UTF-8
406
3.046875
3
[]
no_license
#include <iostream> #include <thread> #include <random> #include <chrono> #include <string> #include "thread_pool.hpp" using namespace std; void sum(string text) { cout << text << endl; } int main() { ThreadPool pool(2); pool.runAsync([](int a){ cout << "It's Lambda with parameter a = " << a << ...
true
ca0762c17eba3165285f48623b97a7300083af85
C++
officerobody/legend-of-zelda
/LOZ/CameraControl.cpp
UTF-8
3,911
3.1875
3
[]
no_license
#include "CameraControl.h" #include <stdlib.h> #include <stdio.h> #include <math.h> #include <glut.h> #include <gl/gl.h> float angle=-(3.14/2); float angley=0.0; void CameraControl::kbd(unsigned char key, int x, int y,float direction[3],float eye[3]) { // if the "w" key is pressed rotate the camera to look upwards...
true
12a537b28c90c7e8d721d9355f8a9a81945e22b1
C++
Anehta/AGE-lua
/src/render/age_animationset.cpp
UTF-8
1,638
2.640625
3
[]
no_license
#include <../include/age_animationset.h> #include <qfile.h> namespace AGE2D { AAnimationSet::AAnimationSet(QString fileName) { QFile file(fileName); QDomDocument doc("superdick"); file.open( QIODevice::ReadOnly ); doc.setContent (&file); file.close(); QDomElement root = doc.documentElement();//获得根节点 //遍...
true
a99a34475ea5d8853044b5d41315127ae6f165d6
C++
rutsky/semester07
/Computer_graphics/wine_task1.2/Src/application/xvertex.h
UTF-8
840
2.609375
3
[]
no_license
// xvertex.h // Common DirectX vertices structures definitions. // Vladimir Rutsky <altsysrq@gmail.com> // 09.09.2009 #ifndef XVERTEX_H #define XVERTEX_H #include "xvertex_fwd.h" #include "point_fwd.h" #include "color_fwd.h" #include <d3dx9.h> namespace xcg { // Common vertex with a lot of parameters. struct ve...
true
14990393e60fe0169f9833f36886a8c9936d04df
C++
HelloWoori/AlgorithmStudyWithBaekjoon
/ExhaustiveSearch/Alphabet.cpp
UTF-8
1,868
3.25
3
[]
no_license
/* 알파벳 https://www.acmicpc.net/problem/1987 */ #include <iostream> #include <vector> #define SIZE 4 using namespace std; // 전역으로 사용할 변수 선언 int leftRight[SIZE] = {-1, 1, 0, 0}; int upDown[SIZE] = {0, 0, -1, 1}; int calc(vector<vector<char>>& board, vector<bool>& check, int currX, int currY); int main() { int ro...
true
5305ebb3c9c9916fee9580b05b4487b899bfdf5c
C++
cgokmen/nin10kit
/shared/cmd-line-parser-helper.cpp
UTF-8
2,642
2.765625
3
[ "Apache-2.0" ]
permissive
#include "cmd-line-parser-helper.hpp" #include "scanner.hpp" #include "logger.hpp" #include <algorithm> bool CmdLineParserHelper::GetSwitch(const std::string& param) { return parser.Found(param); } bool CmdLineParserHelper::GetBoolean(const std::string& param, bool def_value) { long ret; if (!parser.Found...
true
b8ef75808f90937636e491d7879aea157561f8f8
C++
YYYHHHSSS/Learn-C
/Task/6/Homework6-7.cpp
GB18030
942
3.046875
3
[]
no_license
#include<stdio.h> #define STOP '|' int main() { char c; // ǰַ char prev; //ǰһַ long n_chars = 0; // ַ int n_lines = 0; // int n_words = 0; // int p_lines = 0; // int inword = 0; // ǰַcһУinword1 //printf("Enter text to be analyzed( | to terminate):\n"); prev = '\n'; // ʶ while ((c = getchar...
true
ddf30a27b8dcfae84dcde508817b50a60e1c4582
C++
DatabaseGroup/tree-similarity
/src/label/json_label_impl.h
UTF-8
2,249
2.796875
3
[ "MIT" ]
permissive
// The MIT License (MIT) // Copyright (c) 2020 Thomas Huetter. // // 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 use, co...
true
aea4a066e26384d32a9391985c786d722881b5ca
C++
WilliamQf-AI/mork
/test/testUtil.cpp
UTF-8
2,087
2.84375
3
[]
no_license
#include "../mork/util/Util.h" #include "../mork/util/Time.h" #include "../mork/util/File.h" #include "../mork/core/Log.h" #include <gtest/gtest.h> using mork::debug_logger; class UtilTest : public ::testing::Test { protected: UtilTest(); virtual ~UtilTest(); // Code here will be called immediately af...
true
925d5d5cd9389e0ef00fa3d84d2b97f70551e641
C++
ayrtoncg20/practica6AEDA
/src/main.cpp
UTF-8
7,634
2.75
3
[]
no_license
#include <iostream> #include <cstdlib> //rand() #include <ctime> #include "../include/DNI.hpp" #include "../include/nodo.hpp" #include "../include/arbol.hpp" #include <ctime> #include <iomanip> using namespace std; int main (void){ ABB_t<dni_t> arbol; int opcion; int opcion1; int opcion2; ...
true
ccfbd57b9760fad97e0bcab721fd46fa9982fff7
C++
Absenths/Arduino
/laserShot.ino
UTF-8
1,928
2.828125
3
[]
no_license
#include "FastLED.h" //LEDS #define NUM_STRIPS 3 #define NUM_LEDS_PER_STRIP 15 CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP]; int sensorPin = A4; int relay = 4; int sens = 0; int sensorLimit = 500; int lsrLvl = 0; int shotTime = 2000; int fillUpSpeed = 400; int lsr[15]; void setup() { // declare the led...
true
0fbdc68092389af5fc1e401b52638d51aca7093a
C++
gbelmonte/GBEmu
/logger.cpp
UTF-8
752
2.828125
3
[]
no_license
#include "logger.hpp" using namespace std; Logger::Logger() { } Logger::~Logger() { } bool Logger::logEnabled = false; void Logger::InitLogger(bool enable = false) { logEnabled = enable; if (enable == true) { freopen("log.txt", "w", stdout); } } void Logger::LogOpcode(BYTE opcode) { if (logEnabled == true...
true
c0eca03a70dee2e307e9f1c0168fa76d665ea2a1
C++
naman3112/pep-coding-imp-quest
/Arrays/Container-with-most-water.cpp
UTF-8
423
3.015625
3
[]
no_license
class Solution { public: int maxArea(vector<int>& height) { int maxAns=-1; int start=0, end=height.size()-1; while(start<end){ int area= ((end-start) * min(height[start],height[end])); maxAns=max(maxAns,area); if(height[start]<height[end]){ star...
true
b64767958c97e584708b986ab7876634b137638f
C++
georgidimov/sdp
/homework1/homework1/main.cpp
UTF-8
679
2.671875
3
[]
no_license
#include <QCoreApplication> #include <iostream> #include <fstream> #include <string> #include <math.h> #include <stack.h> #include <operators.h> #include <parser.h> //int main(int argc, char ** argv){ int main(){ char filePath[] = "../homework1/files/simpleTest"; Operators operationSet(filePath); // Parse...
true
4531fd1947fcf0a6d2c4709ab1d544e2e3529971
C++
dietotter/cpp-learning
/tests/classes/quiz/MonsterGenerator.h
UTF-8
1,023
3.46875
3
[]
no_license
#pragma once #include "Monster.h" #include <array> class MonsterGenerator { private: // Generate a random number between min and max (inclusive) // Assumes std::srand() has already been called // Assumes max - min <= RAND_MAX // IMPORTANT: for now moved this method's definition to header file // ...
true
5e666ea6799924129ca5079349417f624b4ead9a
C++
AlexitoReyes54/GrafoDinamicos
/menu.cpp
UTF-8
10,661
2.796875
3
[]
no_license
#include <iostream> //#include <windows.h> #include "grafo_Estructura.cpp" using namespace std; int main() { Grafo G; G.Inicializa(); int opc; /* G.InsertaVertice("TIJ"); G.InsertaVertice("MTY"); G.InsertaVertice("MZT"); G.InsertaVertice("BJX"); G.InsertaVertice("GDL"...
true
6f5ae5378e4c568cf41cb99b32b7a217f5079f9a
C++
Asia292/OOP2905
/Shapes/src/main.cpp
UTF-8
2,287
3.421875
3
[]
no_license
/*! \mainpage Lab Book 1 - Shapes * * This program creates and draws a set of shapes from scratch * * The shapes are split into a number of classes to make creating them easier * * Transformations are also applied to the shapes */ /*! \file main.cpp * \brief Main file for the application * * Contains the entry point o...
true
b51903795badfc338468a668e84133904f1d5042
C++
AleKiller21/Tiny-C
/ast/expressions/cast/cast_expression.h
UTF-8
542
2.6875
3
[]
no_license
#ifndef CAST_EXPRESSION #define CAST_EXPRESSION #include "../expression.h" #include "../../declarations/abstract_declarator.h" class cast_expression : public expression { private: expression* expr; abstract_declarator* type; public: cast_expression(abstract_declarator* type, expression* expr, int positio...
true
e9af6812cb06199a8e8f2bafbdd31966c1b50de7
C++
lgsvl/chromium-src
/url/origin.h
UTF-8
7,584
2.65625
3
[ "BSD-3-Clause" ]
permissive
// Copyright 2015 The Chromium 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 URL_ORIGIN_H_ #define URL_ORIGIN_H_ #include <stdint.h> #include <string> #include "base/strings/string16.h" #include "base/strings/string_piec...
true
ae2197ee9807969ab1f184e04f2515628c9c10fb
C++
sidorovis/cpp_craft_1013
/solutions/ivan_sidarau/trade_processor_project/tests/multicast_communication_tests/market_datafeed_writer_tests.cpp
UTF-8
1,859
2.5625
3
[]
no_license
#include "test_registrator.h" #include <market_datafeed_writer.h> namespace multicast_communication { namespace tests_ { namespace detail { class market_datafeed_writer_test_helper : virtual protected boost::noncopyable { market_datafeed_writer writer_; public: explicit market_datafeed_writer_t...
true
b09dddd49570cfaa6b39d737f0138995c535f34f
C++
waynejo/android-ndk-m4a-writer
/memUtils.cpp
UTF-8
286
2.90625
3
[ "MIT" ]
permissive
#include "memUtils.h" void memcpy_r(void* dst, void* src, uint32_t size) { uint8_t* srcEnd = (uint8_t*)src; uint8_t* srcPtr = (uint8_t*)src + size; uint8_t* dstPtr = (uint8_t*)dst + size; for (; srcEnd != srcPtr; --srcPtr, --dstPtr) { *dstPtr = *srcPtr; } *dstPtr = *srcPtr; }
true
ae341ee0d2d0e2be49dc02189d4ef0a9cad0e1af
C++
pgmatev/C-
/GTA/water_vehicle.cc
UTF-8
222
2.859375
3
[]
no_license
#include "water_vehicle.hh" #include <iostream> void WaterVehicle::accelerate(){ float change = displacement/weight; speed+=acceleration*change; std::cout << "The vehicle accelerated on water!" << std::endl; }
true
3290a857a4e31e72df2c577130df8c2d0206f0fd
C++
SubAquaticsROV/squeaky-rov
/src/rov/camera.ino
UTF-8
477
3.078125
3
[]
no_license
int camera_pins[4]; void set_camera_pins(int pin1, int pin2, int pin3, int pin4) { camera_pins[0] = pin1; camera_pins[1] = pin2; camera_pins[2] = pin3; camera_pins[3] = pin4; for (int i = 0; i < 4; ++i) { pinMode(camera_pins[i], OUTPUT); } } void switch_camera(int camera) { digitalWrite(camera_pins[0], ca...
true
f3dbd2f8e6e6c4d02d6bce65e2e6ebc88f920e27
C++
Noverish/codingtest-cpp
/src/baekjoon/1149 - RGB거리.cpp
UTF-8
880
2.859375
3
[]
no_license
#include <algorithm> #include <iostream> #include <string> #include <vector> #include <cmath> using namespace std; template <typename T> ostream& operator<<(ostream& out, const vector<T>& v) { out << "{"; size_t last = v.size() - 1; for (size_t i = 0; i < v.size(); ++i) { out << v[i]; if (...
true
a75c238b5357f71147597a6004c5f4cb51d6c667
C++
windhooked/mpi-afis
/Parallel/ParallelHandler.h
UTF-8
14,648
2.859375
3
[ "Apache-2.0" ]
permissive
/** * \file ParallelHandler.h * \author Daniel Peralta <dperalta@decsai.ugr.es> * \version 1.0 * * \section DESCRIPTION * * Header file for the ParallelHandler class. */ #ifndef PARALLEL_HANDLER_H #define PARALLEL_HANDLER_H #include "Fingerprint.h" #include <string> #include <vector> #include "omp.h" #inc...
true
f6d5b444c240563d483004bceed30ba60ea6df83
C++
zhang-peixiang/c_class_code
/stack、queue/stack、queue/test.cpp
UTF-8
669
3.109375
3
[]
no_license
#define _CRT_SECURE_NO_WARNINGS 1 #include <iostream> using namespace std; #include <queue> #include <stack> // stack void Test1() { stack<int> s; s.push(1); s.push(2); s.push(3); s.push(4); s.push(5); cout << s.size() << endl; cout << s.top() << endl; s.pop(); cout << s.size() << endl; cout << s.top() <<...
true
cc0da17da0142850441e29e417be483ec69f93e8
C++
akira2009999/NetAnalyzer-analise-de-trafego
/NetAnalyzer/src/compression/QuickLZDecompress.cpp
UTF-8
1,734
2.671875
3
[]
no_license
#ifdef WITH_QUICKLZ #include "QuickLZDecompress.h" #include "Data.h" #include "../Debug.h" #include <cstdlib> #include <cstring> #define DBG_QUICKLZ "QLZ_DEC" QuickLZDecompress::QuickLZDecompress() { reset(); } QuickLZDecompress::~QuickLZDecompress() { delete decompressState; decompressState = nullptr; } Deco...
true
ad63daf5d1b510ad5f73bafce5552a067f2a8b8a
C++
Ckkk112138/Demo-6.2-Simple-Chat
/Demo6.1 Very Simple Telnet Server.cpp
UTF-8
1,362
2.703125
3
[]
no_license
// Demo6.1 Very Simple Telnet Server.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <iostream> #include "SocketLib.h" using namespace std; using namespace SocketLib; int main() { ListeningSocket lsock; DataSocket dsock; char buffer[128]; int size = 0; int received; lsock.Listen(5098); ...
true
13ab562eb0f0750eaa1ce2a86deadf5772d09c2c
C++
Tempoblink/cxxp
/ch16_Templates_and_GenericProgramming/exercise_16_61.cpp
UTF-8
449
3.578125
4
[]
no_license
/* * 定义你自己版本的make_shared。 */ #include <iostream> #include <memory> #include <string> #include <utility> template<typename T, typename... Args> std::shared_ptr<T> make_shared(Args &&...args) { return std::shared_ptr<T>(new T(std::forward<Args>(args)...)); } int main(int argc, char const *argv[]) { std::shar...
true
a7b50a3097c3046ba39dce1e82dd201d0c40b1d4
C++
jennkryst/HSpace-5
/hsfuel.h
UTF-8
884
2.59375
3
[]
no_license
#ifndef __HSFUEL_INCLUDED__ #define __HSFUEL_INCLUDED__ #include "hstypes.h" #include "hseng.h" // Types of fuel. enum HS_FUELTYPE { FL_BURNABLE = 0, FL_REACTABLE, }; // This is derived an engineering system, // even though it is quite different. // // The CHSFuelSystem handles fuel storage, transfer, // etc. clas...
true
a1a0a99e1e906fd52a1cbff212512f0ab56c1ec2
C++
OldKrab/AffineTransforms
/src/Figure/TriangleMeshFigure.h
UTF-8
957
2.90625
3
[]
no_license
#pragma once #include "BaseFigure.h" #include "Math/Triangle.h" class TriangleMeshFigure :public BaseFigure { public: struct TriangleInxs { size_t firstInx, secondInx, thirdInx; }; TriangleMeshFigure(Matrix<float> dots); TriangleMeshFigure(Matrix<float> dots, std::vector<TriangleInxs> trianglesInxs, sf::Color...
true
b33a2feb379464989388bbf231c8e17527558df8
C++
hardcodder/computer_graphics_console
/Vectorscantheory_project.cpp
UTF-8
2,482
2.765625
3
[]
no_license
void fun_call_theory_handler(); void vectroescan() { char chosevs ; char cvs; system("clear") ; cout<<"\033[32m * Vector scan display directly traces out only the desired lines on CRT.\033[0m\n"<<endl; cout<<"\033[32m * If we want line between point p1 & p2 then we directly drive the beam deflection\n circuitry...
true
0b1ee6dd94b89d275781d15e4002e6ad5044e721
C++
gianzav/terminal-emulator
/pty2.cpp
UTF-8
2,185
3.234375
3
[]
no_license
#include <iostream> #include <pty.h> #include <string> #include <sys/wait.h> #include <unistd.h> using namespace std; void openpty_demo(const char *output_size) { int master; int slave; openpty(&master, &slave, NULL, NULL, NULL); // Temporarily redirect stdout to the slave, so that the command execut...
true
4dc0a0ccdd5f4994d51a2a8e4a3a38e0c51fad27
C++
victor-hernandez/Basketduino
/PushButtonRedRing.h
UTF-8
500
2.765625
3
[]
no_license
/* PushButtonRedRing.h - Biblioteca para controlar un boton del tipo push button con un anillo iluminado de color rojo @author: Victor Hernandez Bermejo, Gabriel Rodriguez Polaina, Diego Sepulveda Blanco @version: 1.0 */ #ifndef PushButtonRedRing_h #define PushButtonRedRing_h #include "Arduino.h" class Pus...
true
6c50b7f3954326912101fb89bb47f757f4fe14a1
C++
Prabhu001-dot/SIT210
/8.1.ino
UTF-8
1,302
3.53125
4
[]
no_license
// Include the Wire library for I2C #include <Wire.h> // LED on pin 13 const int yellow = 13; const int green = 12; const int red = 5; void setup() { // Join I2C bus as slave with address 9 Wire.begin(0x9); // Call onRecieving when data received Wire.onReceive(onRecieving); ...
true
11499aa6a8ce7c3b6f23189183d3071af902959d
C++
fravera/ArduinoChessTimer
/ChessTimer.ino
UTF-8
4,334
2.65625
3
[]
no_license
#include "Button.h" #include "Definitions.h" #include "LiquidCrystalDisplay.h" #include "Timer.h" #include "Switch.h" #include <stdio.h> #include <stdlib.h> LiquidCrystalDisplay theLCD(PIN_LCD_RS, PIN_LCD_EN, PIN_LCD_D4, PIN_LCD_D5, PIN_LCD_D6, PIN_LCD_D7); Timer timerWhite(10); Timer timerBlack(10); Button buttonUp ...
true
cae76e53276b9c00c9ed43370f43b0de4c64f3d5
C++
opendarkeden/server
/src/Core/EffectInfo.cpp
UHC
3,151
3.078125
3
[]
no_license
////////////////////////////////////////////////////////////////////// // // Filename : EffectInfo.cpp // Written By : elca@ewestsoft.com // Description : Ʈ Ʈ . // ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// // i...
true
1d6132530fbb9697b02ce1b6c4cde043614cf538
C++
graphffiti/PopHead
/tests/Physics/CollisionHandlers/testStaticCollisionHandler.cpp
UTF-8
4,590
3.015625
3
[ "MIT" ]
permissive
#include <catch.hpp> #include "Physics/CollisionHandlers/staticCollisionHandler.hpp" #include "Physics/CollisionBody/collisionBody.hpp" namespace ph { TEST_CASE("Static collision is properly handled", "[Physics][StaticCollisionHandler]") { StaticCollisionHandler staticCollisionHandler; CollisionBody kinematicBo...
true
1adec6b3f3e07564fc01b03cfb0494c0c1789576
C++
daiseyj15/4346AI
/AStarWithHeuristicFunctions/h5.cpp
UTF-8
959
2.6875
3
[]
no_license
float heuristicFunction_H5(Node* s, AStar* t) { //h5(n) = {Go around the edge of the board, i.e., //omit the center square, count the number of pairs //of tiles that are "inverted" compared to the goal position, and return this number} float pairsInverted = 0; int** currentpuzzle = s->getP...
true
c0597e32d0d7ff97731df466e6be9bb94110f21a
C++
manish1596/DS_and_Algo_Library
/Sorting Algorithms/Merge_sort.cpp
UTF-8
1,182
2.96875
3
[ "MIT" ]
permissive
#include <iostream> using namespace std; void merg_e(int a[], int p, int q, int r) { int i,j,k; j=0; k=0; int l[q-p+1]; int m[r-q]; for(i=0; i<q-p+1; i++) l[i]=a[p+i]; for(i=0; i<r-q; i++) m[i]=a[q+1+i]; if(r>p) { for(i=0;i<r-p+1;i++) {...
true
e8fe5f98f16aa2b05e134e82c1bf51a5b39b5410
C++
AsAsgard/BigBlackHole
/CppUniversityTasks/Task4/print_tuple/print_tuple_ver.1/print_tuple.h
UTF-8
1,273
3.515625
4
[]
no_license
#ifndef PRINT_TUPLE_H #define PRINT_TUPLE_H #include <iostream> #include <sstream> #include <tuple> class TPrinterPrivate{ std::stringstream ss; template<std::size_t N, typename... Types> friend class TPrinter; template<typename... Types> friend std::ostream& operator<<(std::ostream& out, const std::tuple...
true
f6e14414dbf5cc5c60f4abfae7a3aae85b3bea09
C++
ramtw/CompetitiveProgramming
/StringsAndArrays/stringCompression.cpp
UTF-8
983
3.8125
4
[]
no_license
/* Implement basic compression using counts of repeated characters if result string is shorter than original */ #include <iostream> #include <string> using namespace std; int newLength(string s){ int count = 0; for(int i = 0; i < s.length(); i++){ if(s[i+1] == s[i]) continue; else...
true
5505b5e53637436a7627ea409f4b1ad931e78916
C++
Garcia-Christophe/NavalBattle
/src/CBateau.cpp
UTF-8
7,083
3.515625
4
[]
no_license
#include "CBateau.h" /** * Constructeur de CBateau par défaut. Il initialise le nom du bateau à "néant", sa taille et ses * positions à 0, et son tableau de dégâts à NULL. */ CBateau::CBateau() { m_nom = "neant"; m_taille = 0; m_position.first = 0; m_position.second = 0; m_pDegats ...
true
e3cfdf73c6b8ac068ca7df5f2c70528c3a6e4336
C++
xSeditx/Native-API
/nativeAPI/main.cpp
UTF-8
2,050
2.796875
3
[]
no_license
#include"Threading/native_thread.h" #include<vector> //https://c9x.me/x86/html/file_module_x86_id_26.html native::mutex Mtx; std::vector<uint32_t> ThreadVector; void Thread_TestFunction() { //Print("Active Thread: " << native::thread::ActiveThread()); //Print("Get Thread: " << native::thread::GetThread()); st...
true
c21c81cb1d46ac1584ee366ff7ad54786e269b7d
C++
simonlindholm/otterduck
/src/client/anim.h
UTF-8
632
2.890625
3
[]
no_license
#pragma once #include "resources.h" // An animation. class Anim { public: Anim(Resources::Img start, unsigned int len, unsigned int delay); // Initialize Anim with an empty state. Calls to getImage will get // undefined results until operator= or resetFromDifferent is called. Anim(); // Assign to this ani...
true
ccec9d6bba5d08daed9bbe03d9378ec0e2449ff4
C++
kyawawa/procon
/atcoder/ABC/abc127/src/f.cpp
UTF-8
1,417
2.828125
3
[]
no_license
#include <iostream> #include <cstdio> #include <cmath> #include <vector> #include <string> #include <algorithm> #include <set> using namespace std; // あるxを大きくするか小さくするかで距離が縮まるaが多い方向に進めていく // queryが // 奇数 => 真ん中 // 偶数 => 真ん中2つの内の小さい方 // どちらも(num_query - 1) / 2 // 偶数->奇数の時、abs(新しい中央 - 追加された数)だけ増える // 奇数->偶数の時、abs(元の中央 - ...
true
ec0eca1998c134e6dfcc26f12d09f127836fd52c
C++
Krstar233/krits-code-workplace
/Old-Code/题解代码/acm/求共同元素(数组).cpp
UTF-8
990
2.5625
3
[]
no_license
#include <stdio.h> #include <algorithm> using namespace std; int main() { int t; int num[3][100],com[100]; int n[3]; scanf("%d",&t); while (t--) { int i,j,k,q; int x; int flag1,flag2; int c_com=0; for (i=0;i<3;i++) { scanf ("%d",&n[i]); for (j=0;j<n[i];j++) { scanf ("%d",&num[i][j]); ...
true
a0a74c223249f42bcf60cd3d04e72e74946d8170
C++
caetanosauer/foster-btree
/src/encoding.h
UTF-8
18,532
2.71875
3
[ "MIT" ]
permissive
/* * MIT License * * Copyright (c) 2016 Caetano Sauer * * 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 use, copy, modif...
true
30eecc69ea7a408e1619fb8d83c684791ee38d44
C++
qjatn0120/algorithm_open_seminar
/2. Search/source_code/10819.cpp
UTF-8
523
2.609375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int N, A[10], ans; vector <int> v; int main(){ cin.tie(nullptr), ios::sync_with_stdio(false); cin >> N; for(int i = 0; i < N; i++) cin >> A[i]; sort(A, A + N); // 처음 순열로 만듦 do{ int sum = 0; for(int i = 1; i < N; i++) sum += abs(A[i - 1...
true
0f42a1e0f646df63c1b2603d9f4d0d56460c2e9d
C++
alexandraback/datacollection
/solutions_2692487_1/C++/absmurf/1B1.cpp
UTF-8
936
2.5625
3
[]
no_license
#include<iostream> #include<stdio.h> #include<algorithm> #include<vector> #include<limits.h> using namespace std; int main() { int T,i,j; scanf("%d",&T); for(int c=1;c<=T;c++) { int A,N; scanf("%d", &A); scanf("%d", &N); int mote[N]; for(i=0;i<N;i++) scanf("%d", &mote[i]); sort(...
true
c58edcf0ef522a1a8d0aaa37c2ee2f7662f62032
C++
ydiz/contraction
/defs.h
UTF-8
3,425
2.78125
3
[]
no_license
#pragma once #include <iostream> #include <string> #include <vector> #include <algorithm> #include <assert.h> int factorial(int n); // sym.cc enum class Sym {u, uBar, d, dBar, s, sBar, a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, alpha, beta, s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, w, x, y, z, v, g5, gmu, g...
true
97fe9c8eb28d0da957ab3b8ff83ed2eb4b4c5ad0
C++
cristiano-xw/c-homework
/homework/提取字符串的数字.cpp
GB18030
1,452
3.921875
4
[]
no_license
/* ʱ: 2020/08/20 Ŀģȡַе ܣӶַ˽⣬жַ νһΪһ洢 */ #include<stdio.h> void search(char*); int main() { char str[10000]; printf("ַ"); gets(str); search(str); return 0; } void search(char *str){ int i,j=0,flag=0,t=0,a[20]; for(i=0;str[i]!='\0';i++){ if(str[i]>='0'&&str[i]<='9'&&flag==0){//жDz...
true
1b053eb4dc5ed2b3973e074f02ff28bfb4b1c1d5
C++
ReCodEx/worker
/src/helpers/config.h
UTF-8
1,798
2.90625
3
[ "MIT" ]
permissive
#ifndef RECODEX_WORKER_HELPERS_CONFIG_H #define RECODEX_WORKER_HELPERS_CONFIG_H #include <memory> #include <yaml-cpp/yaml.h> #include "config/job_metadata.h" #include "config/task_metadata.h" namespace helpers { /** * From given configuration in yaml it build job_metadata structure and its tasks. * @param conf ...
true
484cd3bdcb36c25e1c7e53362ca90120db66c7a1
C++
Alex-Falk/CSC8503
/Build/Examples_Cuda/BallPoolScene.h
UTF-8
2,730
2.59375
3
[]
no_license
#pragma once #include <ncltech\Scene.h> #include <ncltech\CommonUtils.h> #include <ncltech\SoftBody.h> #define NUM_BALLS 300 #define RAND (rand() % 101) / 100.0f //Fully striped back scene to use as a template for new scenes. class BallPoolScene : public Scene { public: BallPoolScene(const std::string& friendly_nam...
true
df73960a4401b102dab38d733b4706d08d0aab1d
C++
sniperswang/dev
/leetcode/L247/test.cpp
UTF-8
1,667
3.4375
3
[]
no_license
#include <iostream> #include <vector> #include <map> using namespace std; class Solution { public: void helper(vector <string> &res, vector<char> &e, string str, int pos, int n) { if ( (pos > n/2 && n % 2 != 0) || (pos >= n/2 && n % 2 ==0) ) { res.push_back(str); return; } if ( (n == 1 && pos == 0...
true
d6eb4cf4c984a1051be716299c703aca982b5a92
C++
jwvg0425/boj
/solutions/5704/5704.cpp14.cpp
UTF-8
541
2.9375
3
[]
no_license
#include<stdio.h> #include<vector> #include<iostream> #include<string> #include<algorithm> #include <set> #include <queue> #include <memory.h> int main() { while (true) { int counts[26] = { 0, }; std::string str; std::getline(std::cin, str); if (str == "*") break; for (auto& c : str) { if (c ==...
true
8dcd4c88206cec6a95abd529f294ce18991d6115
C++
istoney/POJCode
/1002.cpp
UTF-8
1,553
3.3125
3
[]
no_license
//Memory:624K Time:1250MS //2013-08-08 00:05:00 #include<iostream> #include<string> using namespace std; unsigned tele_check(string); void tele_print(unsigned); int tele_compare(const void *a, const void *b) { return *(unsigned *)a - *(unsigned *)b; } int main() { unsigned num =0,un_tmp; string str_tmp; cin>>nu...
true
13eefdaf24cce00844296d0fb75b968fc8f0533d
C++
yutaka-watanobe/problem-solving
/AOJ/0147/saito.cpp
UTF-8
2,922
3.0625
3
[]
no_license
#include <iostream> #include <queue> #include <cassert> using namespace std; enum EventType{ LEAVE, ARRIVE }; class Event{ public: int time; EventType type; int gid; Event(int time, EventType type, int gid) : time(time), type(type), gid(gid){ } bool operator<(const Event &e) const{...
true
3bb37a87fb8ebe2c0fd69955e34ec77361b38d7f
C++
true-bear/cpp_server_study_projects_Pub
/codes_book_onlinegameserver/NetLib/Thread.cpp
UTF-8
1,538
2.65625
3
[ "MIT" ]
permissive
#include "Precompile.h" #include "Thread.h" #include "Log.h" Thread::Thread(void) { m_hThread = NULL; m_bIsRun = false; m_dwWaitTick = 0; m_dwTickCount = 0; m_hQuitEvent = CreateEvent( NULL , TRUE , FALSE , NULL ); } Thread::~Thread(void) { CloseHandle( m_hQuitEvent ); if( m_hThread ) Close...
true
c6c4ea1d688f0099a437c9c01a67d10201f9f751
C++
mmaxim2710/OOP
/oop_exercise_04/vertex.h
UTF-8
1,339
3.453125
3
[]
no_license
#ifndef VERTEX_H #define VERTEX_H #include <iostream> #include <type_traits> #include <cmath> template<class T> struct vertex { T x; T y; vertex<T>& operator=(vertex<T> A); }; template<class T> std::istream& operator>>(std::istream& is, vertex<T>& p) { is >> p.x >> p.y; return ...
true
454ad5750ce9f98fc6b5c04b2ba958af6499bbed
C++
j0ntan/Project-Euler-plus-plus
/solutions/001-050/Problem049.cpp
UTF-8
1,602
3.453125
3
[]
no_license
/* Prime permutations * The arithmetic sequence, 1487, 4817, 8147, in which each * of the terms increases by 3330, is unusual in two ways: * (i) each of the three terms are prime, and, (ii) each of * the 4-digit numbers are permutations of one another. * * There are no arithmetic sequences made up of three 1-, 2-...
true
de80d715105f18e00fbaa9b54eef0ff23554d10e
C++
per-gron/rapidcheck
/include/rapidcheck/gen/Distinct.hpp
UTF-8
994
2.890625
3
[ "BSD-2-Clause" ]
permissive
#pragma once namespace rc { namespace gen { namespace detail { template <typename Value> class DistinctPredicate { public: template <typename ValueArg, typename = typename std::enable_if< !std::is_same<Decay<ValueArg>, DistinctPredicate>::value>::type> DistinctPredicate(ValueArg &&valu...
true
c7b7963912be7c99d44f8cd7f23f70f4e888ede1
C++
MichaelxhJiang/LeetCode
/LowestCommonAncestor.cpp
UTF-8
1,318
3.34375
3
[]
no_license
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) { TreeNode* lc...
true
42dc900322d30d5cef11eca9eb433218d6577c8f
C++
zhangbaochong/LearnOpenGL
/LearnOpenGL/src/utils/MainCamera.cpp
UTF-8
285
2.515625
3
[]
no_license
#include "MainCamera.h" MainCamera* MainCamera::s_instance = nullptr; MainCamera::MainCamera(glm::vec3 position) : Camera(position) { } MainCamera* MainCamera::getInstance() { if (s_instance == nullptr) { s_instance = new MainCamera(); } return s_instance; }
true
500387707f291bad8133c1aa7e7537e0d82fa15e
C++
pandian4github/competitive-programming
/spojnew/fibosum.cpp
UTF-8
1,002
2.625
3
[ "Apache-2.0" ]
permissive
#include<stdio.h> #include<math.h> long int mod=1000000007; void multiply(long long int F[][2],long long int M[][2]) { long long int x = F[0][0]*M[0][0] + F[0][1]*M[1][0]; long long int y = F[0][0]*M[0][1] + F[0][1]*M[1][1]; long long int z = F[1][0]*M[0][0] + F[1][1]*M[1][0]; long long int w = F[1][0]*M[0...
true
9017c52e46a196adab52a6d7512cf97883f44a95
C++
arbor-sim/arbor-sonata
/sonata/include/sonata/hdf5_lib.hpp
UTF-8
7,985
3
3
[]
no_license
#pragma once #include <iostream> #include <fstream> #include <string> #include <hdf5.h> namespace sonata { /// Class for reading from hdf5 datasets /// Datasets are opened and closed every time they are read class h5_dataset { public: // Constructor from parent (hdf5 group) id and dataset name - finds size of th...
true
d1bb8caf4c43352edadea8bf96fb573e2a72be78
C++
Jaddori/BScPCG
/BScPCG/BScPCG/Assets.cpp
UTF-8
2,005
2.890625
3
[]
no_license
#include "Assets.h" using namespace Utilities; using namespace std; namespace Assets { AssetManager::AssetManager() { } AssetManager::~AssetManager() { } int AssetManager::loadModel(const std::string& path) { int result = find(modelPaths, path); if(result < 0) { Model model; ...
true