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
44bc928fc543f4c356bed59633d948a18bb21ff9
C++
xxxalxxx/amvk
/src/buffer_info.cpp
UTF-8
501
2.65625
3
[]
no_license
#include "buffer_info.h" BufferInfo::BufferInfo(const VkDevice& device): buffer(VK_NULL_HANDLE), memory(VK_NULL_HANDLE), size(0), mVkDevice(device) { } BufferInfo::BufferInfo(const VkDevice& device, VkDeviceSize size): buffer(VK_NULL_HANDLE), memory(VK_NULL_HANDLE), size(size), mVkDevice(device) { } Buff...
true
b4dfab8f52a36bb80c0904e68f665eb40f8f27d5
C++
stacieem/GameEngine
/GameEngine/Source/InputManager.h
UTF-8
1,881
2.640625
3
[]
no_license
// // InputBindings // // Created by Trystan Jasperson. // // #pragma once #include "../JuceLibraryCode/JuceHeader.h" #include <vector> #include <map> #include "GameCommand.h" /* Abstract button assignments to keep magical indeces out of this */ class InputManager : public KeyListener, public Mou...
true
b2bb3f4888084e98c84ac40ba572afcd9a7dd9ca
C++
saseb80/EstructuraDeDatos
/EstructurasDeDatos14005/Lista.h
ISO-8859-1
4,466
3.8125
4
[]
no_license
#pragma once #include "NodoT.h" #include <iostream> template<class T> class Lista { public: Lista(); NodoT<T>* first; NodoT<T>* last; NodoT<T>* tmp; NodoT<T>* tmp2; int size; void push_back(T val); void push_front(T val); void push_at(T val, int index); void updateIndex(); void printG(); //NodoG<T>* get_a...
true
4c5f5af11e7c485095d1f88de74994cfd798f59a
C++
benhuckell/Team7Robot
/RobotMain/include/Hardware/DriveMotor.h
UTF-8
400
2.734375
3
[]
no_license
#pragma once #include "Arduino.h" class DriveMotor { public: DriveMotor(PinName motor_port_forwards, PinName motor_port_backwards); void update(); int getSpeed(); void setSpeed(int speed); private: int speed; PinName motor_port_forwards; PinName motor_port_backwa...
true
956e1f03b9ddc3a33df05107d947e104ead5100a
C++
darkling66/lab1
/lab01/lab01.cpp
UTF-8
998
3.09375
3
[]
no_license
// lab01.cpp : Defines the entry point for the console application. // #include "stdafx.h" #define E 2.7182 using namespace std; float f1(float a, float b, float x) { return pow(E, (a * abs(1 - 2 * cos(b * x)))); } float f2(float a, float b, float x) { return ((x*cos(a - x)) / (b*x + 1)); } float f3(float a, fl...
true
c7b6a43cef31a03a4cb0dae403c0f19d113f80af
C++
tado/MusubuExhibition
/MusubuCanvas/src/ThumbButton.cpp
UTF-8
1,030
2.8125
3
[]
no_license
#include "ThumbButton.h" #include "ofApp.h" ThumbButton::ThumbButton(int num, string imgname, string nameImgName, ofVec2f position, int width, int height) { img.load(imgname); nameImg.load(nameImgName); this->num = num; this->position = position; this->width = width; this->height = height; selected = false; ru...
true
b48780a69bd7c8736932d576171f399c9ec76c3b
C++
SumanthReddy9/DSAlgo
/Krushkals_Algorithm/main.cpp
UTF-8
1,689
3
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int root(int x, int idx[]){ int ans = 0; while(idx[x] != x){ idx[x] = idx[idx[x]]; x = idx[x]; } } void union1(int x, int y, int idx[]){ idx[root(x, idx)] = idx[root(y, idx)]; } void KrushkalMST(vector<pair<int, pair<int, int> > >adj, int v...
true
b2a942d14150aa166f3a53f0ffbd11c39464b449
C++
ankitkarna99/DataStructures
/queueFromArray.hpp
UTF-8
1,187
4.03125
4
[]
no_license
#include <iostream> using namespace std; template <class T> class Queue { T * arr; int count; int size; public: Queue(int _size){ size = _size; arr = new T[size]; count = 0; } void enqueue(T data){ if (count == size){ ...
true
29b98c7eb8d4591a11a856108d3fdff68b5000f7
C++
fareed5464/cs340.data_structures
/prog5/prog5.cc
UTF-8
4,801
2.90625
3
[]
no_license
////////////////////////////////////////////////////////////////// // NAME: Corey Burmeister // ASSIGNMENT: 5 // DUE: 2/28/2012 ////////////////////////////////////////////////////////////////// #include "/home/onyuksel/courses/340/progs/12s/p5/prog5.h" int simClock = 0; bool f1 = true; bool f2 = true; i...
true
ad75a45ad6c363dcda1fda6d2649deb3f063a9e6
C++
Meta-phy/MetroRoutePlanningSystem
/LoadData.cpp
GB18030
901
2.625
3
[]
no_license
// // Created by 17737 on 2020/12/13. // #include "LoadData.h" #include<fstream> LoadData::LoadData(Map *map, const string &stationFile, const string &routeFile) { ifstream ifs; ifs.open(stationFile.c_str(),ios::in); string s; string station; int id[3]; while(ifs>>s) { int lineNum=0; if(s =...
true
18939c0357e43c55e8e1a6fa3b4adb19383ec010
C++
Phengaris/programacao-avancada
/src/padroes-projeto/bridge/Radio.h
UTF-8
460
2.609375
3
[ "MIT" ]
permissive
/* * UTP - BCC * Programacao Avancada - 2o Bimestre * Aluna: Sabrina Eloise Nawcki */ #ifndef _RADIO_H_ #define _RADIO_H_ #include "Device.h" #include <string.h> using namespace std; class Radio : public Device { public: Radio(string _name) { name = _name; } void run() { cout...
true
807435e94250de669f0d536b1db58cdccc6c3b69
C++
ruiyuanxu/Cafe
/Cafe.Core/src/Cafe/Misc/Optional.h
UTF-8
4,517
3
3
[ "MIT" ]
permissive
#pragma once #include "TypeTraits.h" #include "Utility.h" #include <cassert> #include <cstddef> namespace Cafe::Core::Misc { template <typename T> struct NormalChecker { constexpr NormalChecker() noexcept : m_HasValue{ false } { } constexpr void Emplace(T*) noexcept { m_HasValue = true; } conste...
true
721fc19f07bbb9d79636a08f5a87b46b535188a6
C++
DeveshDutt2710/Competitive_Programming
/GFG/arrays/3_array_rotation_block_swap.cpp
UTF-8
869
3.484375
3
[]
no_license
//time complexity : O(n) #include <bits/stdc++.h> using namespace std; void swap(int arr[], int fi, int si, int d) { int temp,i; for (i=0;i<d;i++) { temp=arr[fi+i]; arr[fi+i]=arr[si+i];; arr[si+i]=temp; } } void leftRotate(int arr[], int d, int n) { if(d==0|| d==n) { ...
true
78b1661f18ed1b8823b533ff0de78e46183d817a
C++
zhangrongzhao/CPlusPlusTemplates
/src/CPlusPlusTemplates/Chapter.22/ComposeFunctor/Compose4.h
GB18030
263
2.546875
3
[]
no_license
#include "../stdafx.h" #ifndef COMPOSE_4_H #define COMPOSE_4_H //Ϊ̳ظ࣬һ̳в template<typename C,int N> class BaseMem :public C{ public: BaseMem(C& c):C(c){ } BaseMem(C const& c):C(c){ } }; #endif//COMPOSE_4_H
true
b40fb647e281b1961a20d34d8b7cff4bdbb9f8a8
C++
MarkOates/hexagon
/src/Hexagon/ChatGPTIntegration/Chat/ConversationView.cpp
UTF-8
8,672
2.78125
3
[]
no_license
#include <Hexagon/ChatGPTIntegration/Chat/ConversationView.hpp> #include <Hexagon/ChatCPTIntegration/Messages/Text.hpp> #include <allegro5/allegro_primitives.h> #include <iostream> #include <sstream> #include <stdexcept> namespace Hexagon { namespace ChatGPTIntegration { namespace Chat { int ConversationView::mu...
true
1d0974da57da6748997f56cd9c44d8a5c60eec92
C++
Youssab-William/Competitive-Programming
/IOI/IOI 10-quality.cpp
UTF-8
1,540
2.875
3
[]
no_license
/* binary search on the smallest median X check every X by using 2d prefix sum array to know the number of elements <= X in any submatrix let that number = num if(num<=H*W-num) in any of the submatrices of size H*W then we can try smaller X if not try larger X */ #include <bits/stdc++.h> #inclu...
true
64774406c59924a06be81ab28a9183afb1e35784
C++
md-w/httpserver
/resource/src/EntryPoint.cpp
UTF-8
2,185
2.71875
3
[ "MIT" ]
permissive
#include <Poco/Util/HelpFormatter.h> #include <Poco/Util/ServerApplication.h> #include "DummyDataGenerator.hpp" #include "monitoring_thread.hpp" #include <iostream> static std::string get_session_folder() { return "./session/"; } class EntryPoint : public Poco::Util::ServerApplication { public: EntryPoint() : _shu...
true
54b4c5c51b0764a7831dec1faebba0c05d439d2e
C++
tinyfrog/Data-Structure-Algorithm
/Easy/Q5363 (요다).cpp
UHC
647
2.71875
3
[]
no_license
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> using namespace std; int main(void) { int i, N, len, com; scanf("%d", &N); while (N--) { com = 0; char st[101]; for (i = 0; i < 101; i++) st[i] = 0; // ʱȭ scanf(" %[^\n]", st); // ֱ for (i = 0; st[i]; i++) { if (st[i] == ' ') com++...
true
6980683599aaa0bb631c3c632ebeaa6169e7221a
C++
kcconch/Nature-of-Code
/week_4_particles/src/particle.cpp
UTF-8
778
2.859375
3
[]
no_license
#include "particle.h" particle::particle(ofPoint l, ofImage img_) { acceleration.set(0,0); /* float vx = randomGaussian()*0.3; float vy = randomGaussian()*0.3 - 1.0; velocity.set(vx,vy); */ velocity.set(ofRandom(-1,1), ofRandom(-2,0)); location = l; lifespan = 100.0; mas...
true
384db7fff50a1705296be1d84540edf60d8115f7
C++
christopherdiamond10/Forest-of-Serenity
/Game/Assignment 6/source/CoreGame/GnEngine.cpp
UTF-8
6,244
2.625
3
[]
no_license
//\==================================================================================== //\ Authors: Jamie.Stewart, Christopher Diamond //\ About : GnEngine.cpp - //\ //\ The main class for the whole game, in this cpp file we create and delete our //\ singleton classes, process scenes, seed random and Update the Gam...
true
8103f2e6dcdd41b374f21795bbe88ec7c23f053b
C++
Greykoil/Euler_solutions
/Euler/Euler/pjeProblem51.cpp
UTF-8
3,142
3.296875
3
[]
no_license
#include "stdafx.h" #include "pjeProblem51.h" #include "pjeFactorizerUtils.h" #include "pjeNumUtils.h" #include <vector> #include <algorithm> #include <set> #include <iostream> #include <assert.h> // Some thoughts: // we can find the family from any point in the cycle. // We only want to carwe about primes that have a...
true
f8b21b685b7cbf89a904a399f447ccdca5159da0
C++
SLIIT-FacultyOfComputing/tutorial-02b-it21032806
/tute03.cpp
UTF-8
791
4.21875
4
[ "MIT" ]
permissive
/*Exercise 3 - Repeatition Convert the C program given below which calculates the Factorial of a number that you input from the keyboard to a C++ program. Please Note that the input command in C++ is std::cin. This is a representation of the Keyboard.*/ /*#include <stdio.h> int main() { int no; long fac; ...
true
692dac6771b7cccf53b954e5935a228306bcadc4
C++
Tudor67/Competitive-Programming
/LeetCode/Explore/January-LeetCoding-Challenge-2023/#Day#5_MinimumNumberOfArrowsToBurstBalloons_sol5_greedy_and_sort_O(NlogN)_time_O(N)_extra_space_353ms_93MB.cpp
UTF-8
1,115
3.0625
3
[ "MIT" ]
permissive
class Solution { private: using Segment = pair<int, int>; Segment computeIntersection(const Segment& LHS, const Segment& RHS){ return {max(LHS.first, RHS.first), min(LHS.second, RHS.second)}; } public: int findMinArrowShots(vector<vector<int>>& points) { const int N = points....
true
dac465d07e73e079ab58c3c739bc8f81f07666b0
C++
NormanDunbar/TraceAdjust
/src/TraceAdjust.cpp
UTF-8
10,101
2.59375
3
[ "MIT" ]
permissive
/* * MIT License * * Copyright (c) 2017 Norman Dunbar * * 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, mo...
true
fee4af13b1db0774f609d9a262c293640b48616f
C++
svickpet/BI-PA2_semestralni_prace
/src/game.h
UTF-8
4,516
3.28125
3
[]
no_license
#ifndef SEMESTRALKA_GAME_H #define SEMESTRALKA_GAME_H #include <vector> #include <string> #include "Location.h" #include "Dialogue.h" #include "ConsoleGUI.h" /** * Class representing one game */ class Game{ private: vector<Location*> vLocations; /**< vector of all locations in a game*/ vector<Item*> vIt...
true
d8c0c05ae72a0a7ba777e49dbe34b4a39801ee64
C++
LosYear/minic-translator
/tests/Atoms.cpp
UTF-8
2,758
2.796875
3
[]
no_license
#include "stdafx.h" #include "CppUnitTest.h" #include "Atom\Atom.h" #include "SymbolTable\SymbolTable.h" #include <string> #include <memory> using namespace Microsoft::VisualStudio::CppUnitTestFramework; namespace tests { TEST_CLASS(AtomsTest) { public: TEST_METHOD(BinaryOpAtom__Init) { SymbolTable table; ...
true
0813e0bc3bcabea6bfe7e9f061fffe618d943ef3
C++
uhmseohun/algorithm-study
/jungol/2994.cpp
UTF-8
1,587
2.515625
3
[]
no_license
#include <cstdio> #include <climits> #include <algorithm> #include <set> #include <cstdlib> #include <vector> using namespace std; // <position, distance> typedef pair<int, int> ipair; const int _size = 100005; struct Data { int x, s, e; bool operator < (const Data &r) const { return x < r.x; } } ...
true
6a1b55e61d5b88cf9ba9f4fc093ffee4259e1570
C++
MJ-Park/Arduino
/20190703/DHTSensor_LCD/DHTSensor_LCD.ino
UTF-8
792
2.75
3
[]
no_license
#include "DHT.h" #include <LiquidCrystal_I2C.h> #include<Wire.h> #define DHTPIN 2 // Digital pin connected to the DHT sensor #define DHTTYPE DHT11 // DHT 11 LiquidCrystal_I2C lcd(0x27,16,2); //LCD 클래스 초기화 DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(9600); dht.begin(); lcd.init(); lcd.backlig...
true
4b58153aaffa1301d9a7b19bcf32f7ed0bcc084f
C++
SluBard/CLA300
/Extras/Lesson1/SpeedCalculator.h
UTF-8
381
2.59375
3
[]
no_license
/* * SpeedCalculator.h * * Created on: Jun 1, 2020 * Author: student */ #ifndef SRC_SPEEDCALCULATOR_H_ #define SRC_SPEEDCALCULATOR_H_ class SpeedCalculator { private: int numEntries; double *positions; double *timesInSeconds; double *speeds; public: void initializeData(int numEntries); void calculate...
true
78b183abbeec4d322e294f290eb413c48d7e87d3
C++
eitrunix/Battleship-Final
/BattleShipV2.1/GameEntity.h
UTF-8
896
2.734375
3
[]
no_license
#ifndef __GAMEENTITY_H #define __GAMEENTITY_H #include "MathHelper.h" #include "LinkList.h" namespace SDLFramework { class GameEntity { public: enum Space { Local = 0, World = 1 }; private: Vector2 mPosition; float mRotation; Vector2 mScale; bool mActive; GameEntity * mParent; public: GameEntity...
true
782f7bbcca8838f01dfedc79bafc40594b348a4d
C++
ThermalSimulationProgram/McFTP
/src/dispatchers/Aperiodic.h
UTF-8
994
2.640625
3
[]
no_license
#ifndef _APERIODIC_H #define _APERIODIC_H #include "core/Dispatcher.h" /*************************************** * CLASS DECLARATION * ***************************************/ class Aperiodic : public Dispatcher { private: /*********** VARIABLES ***********/ ///This parameter specifies the r...
true
3013478a5d5b509dca1cc43f9cfabaa7d81c3ba5
C++
a0124453/collections
/cppcms/src/myapp.cpp
UTF-8
1,270
2.78125
3
[]
no_license
#include <cppcms/application.h> #include <cppcms/applications_pool.h> #include <cppcms/service.h> #include <cppcms/http_response.h> #include <cppcms/url_dispatcher.h> #include <cppcms/url_mapper.h> #include <iostream> #include "numbers.h" #include "letters.h" class myapp: public cppcms::application { public: myapp(cp...
true
b76f47a080389d5cd7af8317e7ace10902dd2a3d
C++
pdrews/dynamics
/cpp/PredictorExpression.cpp
UTF-8
7,115
2.828125
3
[]
no_license
#include <gtsam/geometry/Pose2.h> #include <functional> #include <vector> #include <cmath> #include <gtsam/nonlinear/Expression.h> #include "PredictorExpression.h" /* x \in X == R^n * xdot \in Xdot == R^n * u \in U = R^p * theta \in Theta == R^m */ //n = 3 //p = 2 //m = 5 /* Parameters * Calpha * Fz * mu * ...
true
330c9b168cccfe6df191540fcd753434f14e1bdb
C++
hazem92/sensorpro
/Project/ArduinoSensor/Alert/Alert.h
UTF-8
1,644
2.90625
3
[]
no_license
#ifndef ALERT_H #define ALERT_H #include <iostream> using namespace std; #include <string> #include <list> using std::string ; using std::list ; enum comparator : string {INF="<",SUP=">",EGL="=",IEGL="<=",SEGL=">="} ; /** * class Alert * */ class Alert { public: Alert (); Alert (short id, comparator co...
true
61605c3b6dcb3be26cc1ac40af7b250d7d144615
C++
inf-eth/i02-0491-courses
/1301 - Programming for Engineers II - Spring 2013/Course Progression/Code/SimpleDynamicMatrix.cpp
UTF-8
1,617
4.1875
4
[]
no_license
#include <iostream> using std::cin; using std::cout; using std::endl; class matrix { private: float *Element; // 1D matrix of size 1xSize. int Size; public: matrix(); matrix(int); ~matrix(); void SetSize(int); void Input(); void Display(); void Add(matrix&); }; // Default constructor. ma...
true
c9e93d818f042dd594e856f673c2a9cc1b3ffb49
C++
FreeFalcon/freefalcon-central
/src/graphics/bsplib/polylibrestore.cpp
UTF-8
3,683
2.671875
3
[ "BSD-2-Clause" ]
permissive
/***************************************************************************\ PolyLibRestore.cpp Scott Randolph March 24, 1998 Provides pointer restoration services for 3D polygons of various types after they've been read back from disk. \***************************************************************...
true
4b621b242c4baf015550bac2be7beb1460a79077
C++
5l1v3r1/hdphmm_lib
/class/io/Sof/sof_07.cc
UTF-8
16,488
2.578125
3
[]
no_license
// file: $isip/class/io/Sof/sof_07.cc // version: $Id: sof_07.cc 4958 2000-09-22 21:35:19Z zhao $ // // isip include files // #include "Sof.h" // method: put // // arguments: // const SysString& name: (input) object name // int32 size: (input) object size // // return: a bool8 value indicating status // // put this...
true
42e26a9eaf367e701501b2f9f2e59cabc06c613f
C++
whywhyzhang/ACM-ICPC-Code
/BC/SaiMa/1010.cpp
UTF-8
1,227
2.5625
3
[]
no_license
#include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <vector> #include <queue> #include <set> #include <map> #include <string> #include <math.h> #include <stdlib.h> #include <time.h> using namespace std; int L[1010],R[1010],D[1010]; int ans[1010]; int N,Q; int gcd(int a,int b) { ...
true
758c6934df32c09a86c763c54a279953895bd8aa
C++
vojtajina/ctu-bruch-jina-par-pmt
/src/sequential_task.cpp
UTF-8
840
2.84375
3
[]
no_license
#include "sequential_task.h" /** * @file sequential_task.cpp * @author Vojta Jina * @brief Implementation of the SequentialTask class */ Configuration* SequentialTask::solve(Configuration* init) { this->initConfiguration(init); clock_t startClock = clock(); this->processConfiguration(); clock_t endClo...
true
e65a28c779b5b61c119a487481e6440867c3e800
C++
michegan/kt6400
/src/config/calfactorxml.cpp
GB18030
1,856
2.609375
3
[]
no_license
#include <QtDebug> #include "path.h" #include "xmlnode.h" #include "calfactorxml.h" CalFactorXml::CalFactorXml() : Xml(Path::configFilePath() + "calfactor.xml") { } CalFactorXml::CalFactorXml(const QString& fileName) : Xml(fileName) { } CalFactorXml::~CalFactorXml() { } // У׼ϵ QList<CalFactor> CalF...
true
3d718c4342613bbfcde229cb3a517f9008549ecd
C++
shilangyu/EOOP20L-neural-network
/include/NN/serialize.hpp
UTF-8
846
3.171875
3
[]
no_license
#include <iostream> #include <string> #pragma once template <typename T> class Serializer { protected: /// protected on purpose, Serializer is an abstract class Serializer() = default; public: /// deserializes a file into the parent object. /// throws if file does not exist static auto from_file(const st...
true
a97e17c87cd1b1c849505f334e19f509dd15935e
C++
Nernums/ufo
/src/game/Game.cpp
UTF-8
5,221
2.703125
3
[]
no_license
#include "Game.h" #include "AppSettings.h" #include "EngineSettings.h" #include "TextureManager.h" #include "SoundSourceManager.h" #include "SoundBufferManager.h" #include "LevelTile.h" #include "Level.h" #include "GameObjectRenderer.h" #include "CityScapeCamera.h" Game* g_GameInstance = NULL; float Game::s_LogicStep...
true
80797718b10b2972e9ac67dd5114bcdd52883ad3
C++
MasyoLab/ImageViewer
/DirectX11Project/Source/Common/System/Container.h
SHIFT_JIS
2,184
3.265625
3
[ "MIT" ]
permissive
//========================================================================== // Rei [Container.h] // author : MasyoLab //========================================================================== #pragma once #include "dx11afx.h" _MDX_COMMON_BEGIN //====================================================================...
true
ad603b239771daf9480347c5f3663845f1d1cd39
C++
IGME-RIT/Intermediate-Cpp-Smart-Pointers
/header/pair.h
UTF-8
2,029
3.421875
3
[]
no_license
/* Class Templates (c) 2016 Author: David Erbelding Written under the supervision of David I. Schwartz, Ph.D., and supported by a professional development seed grant from the B. Thomas Golisano College of Computing & Information Sciences (https://www.rit.edu/gccis) at the Rochester Institute of Technology. This program...
true
8fe0666df37e4eafd186682d17aaaca9caf15af9
C++
LLNL/Sina
/cpp/test/src/DataHolder_test.cpp
UTF-8
10,009
2.859375
3
[ "MIT" ]
permissive
#include <stdexcept> #include <typeinfo> #include "gtest/gtest.h" #include "gmock/gmock.h" #include "sina/DataHolder.hpp" #include "sina/testing/ConduitTestUtils.hpp" namespace sina { namespace testing { namespace { using ::testing::Contains; using ::testing::ElementsAre; using ::testing::Key; using ::testing::Has...
true
4a92b0b4a08f66d716ed76fabec21575dd913c52
C++
RanWangTilburg/NSPCA
/src/cudasrc/hostSrc/errorHandling.cpp
UTF-8
4,781
2.953125
3
[]
no_license
// // Created by user on 24-11-16. // #include <iostream> #include "errorHandling.h" #include <cstdlib> cudaRuntimeError::cudaRuntimeError(cudaError_t _error, string _fileName, int _lineNumber) : linedError( "CUDA Runtime Error", _fileName, _lineNumber), error(_error) {} cudaRuntimeError::~cudaRuntimeError()...
true
fdcfc848ad6712f531c0ec1d312c885534d5ba86
C++
ioannco/Rasteriser
/main.cpp
UTF-8
2,546
2.546875
3
[]
no_license
#include <cmath> #include <iostream> #include "mouse.hpp" #include "perspectiveShader.hpp" #include "phongShader.hpp" #include "pipeline.hpp" #include "oscontext.hpp" #include "texShader.hpp" int main(int argv, char **argc) { WindowContext * c = new WindowContext; c->clear(); TriangleRasterizer skyRast...
true
4e9ca0256f8762053dbcfcd2f9a3427e36e0f0b5
C++
DaiyangLiu/CSP
/jobdu/上交2010-计算表达式-1101-简单方法示例.cpp
UTF-8
413
2.546875
3
[]
no_license
#include <cstdio> using namespace std; int main(){ char ch; int i,j,temp,a[200]; while(scanf("%d",&temp)!=EOF){ i=1; a[0]=0; a[1]=temp; while(scanf("%c",&ch)!=EOF&&ch!='\n'){ scanf("%d",&temp); if(ch=='-')a[++i]=-temp; else if(ch=='+')a[++i]=temp; else if(ch=='*')a[i]*=temp; else if(ch=='/')a[...
true
f9b41b91d794f0d0bf930b1729bedf018634ffe1
C++
JohnDJOGrady/ClockworkHeart
/src/Game.cpp
UTF-8
3,007
2.859375
3
[]
no_license
#include "Game.h" // Updates per milliseconds static sf::Int32 MS_PER_UPDATE = 10.0;; Game::Game() : m_window(sf::VideoMode(1920, 1080, 32), "A Clockwork Heart") { sf::Vector2u window_size = m_window.getSize(); int currentLevel = 1; if (!LevelLoader::load(currentLevel, m_level)) { std::cout << "Level not lo...
true
3eea431caa21c60fc28d77eb4e51a6ee16585cbc
C++
LesyaLesyaLesya/BlackJack
/BlackJack/Hand.cpp
UTF-8
458
3.1875
3
[]
no_license
#include "Hand.h" #include <iostream> void Hand::Add(Card* addCard) { m_hand.push_back(addCard); } void Hand::Clear() { m_hand.clear(); } int Hand::GetTotal() const { int sum{ 0 }; int aces{ 0 }; for (int i = 0; i < m_hand.size(); i++) { if (m_hand[i]->GetValue() == ACE) { aces++; } ...
true
446851a37aa6d6cf8788a7059719dbb62dbe508d
C++
Scif99/Engine
/game/src/blob.h
UTF-8
1,052
2.578125
3
[ "MIT" ]
permissive
#pragma once #include <engine.h> //class arrow; class blob { public: blob(); ~blob(); //bool is_goal_scored(football& football); void initialise(float x_pos, float z_pos, float health=50); //bool goal_scored(const football& ball); void on_update(float dt); void on_render(const engine::ref<engine::shader>& sha...
true
83c6c2641127e3a1b5ebcfaf86646f8a1626eeec
C++
padawin/RogueCard
/src/rogue-card/cardState/FightTurn.cpp
UTF-8
3,706
2.71875
3
[ "MIT" ]
permissive
#include "SDL2/SDL.h" #include <sstream> #include <math.h> #include "FightTurn.hpp" #include "../Card.hpp" const int MAX_DURATION_PLAYER_ATTACK = 250; const int MAX_DURATION_PAUSE = 200; const int MAX_DURATION_ENEMY_ATTACK_PHASE1 = 125; const int MAX_DURATION_ENEMY_ATTACK_PHASE2 = 125; const int SPEED_ATTACK_ENEMY_P...
true
8169109d09a194108a51b15bd34ad87fa4cc6c12
C++
dankamongmen/snare
/src/handler/sf_catstrings.cc
UTF-8
421
2.578125
3
[]
no_license
#include "sf_catstrings.h" #include <map> class CatStrings { public: CatStrings(); std::map<unsigned int, const char*> cat_strings; }; static CatStrings cat_strings; CatStrings::CatStrings() { #include "sf_catstrings.inc" } const char* get_category_name(unsigned int catid) { if(cat_strings.cat_strings.count(...
true
9034fceac609dbcd7c135ab740a5f977b755656b
C++
Breush/evilly-evil-villains
/inc/scene/wrappers/customline.hpp
UTF-8
1,436
2.6875
3
[]
no_license
#pragma once #include "scene/entity.hpp" #include "sfe/beziercurve.hpp" namespace scene { //! A customizable line over a scene::Entity. class CustomLine final : public Entity { using baseClass = Entity; public: //! Constructor. CustomLine(); //! Default destructor. ...
true
6d2b62499d60839fe997287553f8159ec45448ab
C++
mrts/log-cpp
/include/logcpp/log.h
UTF-8
2,429
3.109375
3
[ "MIT" ]
permissive
#ifndef LOGCPP_LOG_H__ #define LOGCPP_LOG_H__ #include <ctime> #include <memory> #include <string> #include <vector> #include <mutex> namespace logcpp { enum class LogLevel { DEBUG = 1, INFO, WARN, ERROR, }; inline std::string toString(const LogLevel level) { switch (level) { case LogLev...
true
42f0a3ad245349155e60c7efe85ccc6180c25ee0
C++
MentalBlood/infinite-tower-defense
/game/Bot/Bot.cpp
UTF-8
3,602
2.71875
3
[]
no_license
#include "getDistanceCoveredByTower.cpp" #include "VirtualTower.cpp" #include "VirtualMap.cpp" VirtualMapCell* getNextActionCell() { VirtualMapCell *maxActionProfitCell = (*towersCellsList->begin()); double maxActionProfit = (*towersCellsList->begin())->getMaxActionProfitValue(); for (std::list<VirtualMapCell*>::it...
true
1d697ad548e78dba4608e0f6f39c6952932d54ea
C++
joshsherc/Bank-Line-Simulation
/PriorityQueue.h
UTF-8
9,047
4.125
4
[]
no_license
/* * PriorityQueue.h * * Class Description: A position-oriented data collection ADT. * Class Invariant: The elements stored in this Priority Queue are always sorted. * * Last modified on: June 2017 * Author: Hakeem Wewala and Josh Shercliffe */ #include "Node.h" #include "EmptyDataCollectionException.h" templa...
true
d72691aaa86fa5f5a029b1b5192ae1cc2a52caed
C++
Zizky51017022/Hadiah-Pertemuan-6
/Hadiah6Fix.CPP
UTF-8
628
2.984375
3
[]
no_license
#include <iostream.h> #include <conio.h> int Pilihan; char kode; int main () { cout<< " Daftar Lokasi Pembuatan Produk Komputer :\n"; cout<<" A. Amerika \n J. Jepang \n K. Korea \n C. China \n G.German \n T. Taiwan\n"; cout<<" Masukkan Pilihan Anda ( A,J,K,C,G,T) : "; cin >> Pilihan; switch(Pilihan) { ca...
true
c666beb0905f1b704c7e1d5ebbbbba34d3d2296b
C++
Gi-hyeon/Coding
/Chapter 11/자가진단11-5.cpp
UTF-8
242
2.75
3
[]
no_license
#include <stdio.h> int inv(int a, int b) { int i, c = a; for (i = 1; i < b; i++) { a *= c; } if (b == 0) { a = 1; return a; } return a; } int main() { int m, n; scanf("%d %d", &m, &n); printf("%d", inv(m, n)); return 0; }
true
cf19ed9dec512ddfc1815b6dedd88f3b09a1ca26
C++
panda421/leetcode
/leetcode/editor/cn/645-set-mismatch.cpp
UTF-8
1,456
3.109375
3
[]
no_license
//集合 s 包含从 1 到 n 的整数。不幸的是,因为数据错误,导致集合里面某一个数字复制了成了集合里面的另外一个数字的值,导致集合 丢失了一个数字 并且 有 //一个数字重复 。 // // 给定一个数组 nums 代表了集合 S 发生错误后的结果。 // // 请你找出重复出现的整数,再找到丢失的整数,将它们以数组的形式返回。 // // // // 示例 1: // // //输入:nums = [1,2,2,4] //输出:[2,3] // // // 示例 2: // // //输入:nums = [1,1] //输出:[1,2] // // // // // 提示: // // // 2 <=...
true
3c3c6656f6fd4172c664ff876e50c87ae5b2b041
C++
armap99/Poo-ListaDinamica
/cancion.cpp
UTF-8
1,944
3.0625
3
[]
no_license
#include "cancion.h" Cancion::Cancion() { } Cancion::Cancion(const Cancion &c):duracion(c.duracion), nombre(c.nombre), autor(c.autor), interprete(c.interprete) { } void Cancion::setDuracion(const unsigned int &d) { duracion = d; } void Cancion::setNombre(const string &c) { nombre = c; } ...
true
b45f6e67162c83fb11a6070cbd0f09ba7681f150
C++
MikeSquall/arduino
/servo_test/servo_test.ino
UTF-8
577
2.953125
3
[]
no_license
/* Inclut la lib Servo pour manipuler le servomoteur */ #include <Servo.h> /* Créer un objet Servo pour contrôler le servomoteur */ Servo monServomoteur; void setup() { // Attache le servomoteur à la broche D8 monServomoteur.attach(8); } void loop() { // Fait bouger le bras de 0° à 180° for (int posit...
true
4eaf6885053b4675b6d60f375f7d673b1ec3cf9e
C++
xiaowu001/cppstudy
/epollstudy/Utility.cpp
UTF-8
957
2.75
3
[]
no_license
#include "Utility.h" using namespace std; Utility::Utility() = default; Utility::~Utility() = default; int Utility::initserversocket(uint16_t &port) { int listenfd = socket(AF_INET, SOCK_STREAM, 0); sockaddr_in serveraddr; memset(&serveraddr, 0, sizeof(serveraddr)); serveraddr.sin_family = AF_INET; ser...
true
bf27c264717bc3c46983c3a3b3e09f33fc38c266
C++
paratreet/cluster-finding
/examples/simple_graph/graph-io.h
UTF-8
4,303
2.8125
3
[]
no_license
#include <string> #include <sstream> #define USE_PROTEIN //#define USE_SAMPLE // vertex structure for given graph #ifdef USE_PROTEIN struct proteinVertex { long int id; char complexType; float x,y,z; }; #endif #ifdef USE_SAMPLE struct proteinVertex { long int id; std::string type; }; #endif // u...
true
933ec0b5cd67a6521331c061125b0f66b1ec2ca1
C++
SpirentOrion/osv
/java/jvm/java_api.cc
UTF-8
8,201
2.765625
3
[ "BSD-3-Clause" ]
permissive
/* * Copyright (C) 2014 Cloudius Systems, Ltd. * * This work is open source software, licensed under the terms of the * BSD license as described in the LICENSE file in the top-level directory. */ #include "java_api.hh" #include <jni.h> using namespace std; java_api* java_api::_instance = nullptr; std::mutex java...
true
cb430288b36471728db658d02737dede0abe45ad
C++
douglascraigschmidt/CPlusPlus
/STL/S-11/11.2/11.2a/simple_string.cpp
UTF-8
7,486
3.65625
4
[]
no_license
#pragma clang diagnostic push #pragma ide diagnostic ignored "cert-dcl21-cpp" #include <iostream> #include <cstring> #include "simple_string.h" using namespace std; std::ostream & operator<<(std::ostream &os, const simple_string &string) { return os << (const char *) string; } /** * This simple stri...
true
cb7605dc6dcd16d5a60db3f5422970a018c088dd
C++
fsps60312/old-C-code
/C++ code/PEG Judge/ioi1513(3).cpp
UTF-8
4,067
2.703125
3
[]
no_license
#include<cstdio> #include<cassert> #include<vector> #include<algorithm> #include<map> using namespace std; const int INF=2147483647; struct Node { Node *ch[2]; int sum; Node(const int _sum):ch{NULL,NULL},sum(_sum){} }; Node *Build(const int l,const int r) { Node *ans=new Node(0); if(l<r) { const int mid=(l+r)/2...
true
e6157edc9b8e0f1ef6ce33144a49a7885b0ce30f
C++
Lozoute/Rtype
/API/API_Thread/Implementation/API_Thread_STD/API_Thread_STD.hpp
UTF-8
950
3.046875
3
[]
no_license
#ifndef API_THREAD_STD_HPP # define API_THREAD_STD_HPP # include <iostream> # include <string> # include <thread> # include "API_Thread.hpp" template <typename Func, typename... Arg> class Thread : public API_Thread::IThread<Func, Arg...> { private: std::thread *_thread; Thread(const Thread &) {} Thread &op...
true
020f14e721d66d07eabe954ee02ad7d99364d12c
C++
arek1029384756/evo1
/window.h
UTF-8
3,219
2.515625
3
[]
no_license
#ifndef WINDOW_H #define WINDOW_H #include <QWidget> #include <vector> #include <list> #include <set> #include <memory> #include <cmath> #include "creature.hpp" #include "partitions.hpp" namespace gui { class Window : public QWidget { Q_OBJECT struct Color { inline static const Q...
true
36ebb9f566810a8b622b2b626a0f5a2e2ad521b7
C++
xiabofei/leetcode
/former/092.MaximumSubarray.cpp
UTF-8
429
2.875
3
[]
no_license
#include <iostream> #include <vector> #include <queue> #include <map> #include <set> #include <math.h> using namespace std; class Solution { public: int maxSubArray(vector<int>& nums) { int global = INT_MIN; int local = INT_MIN; for ( int i=0; i<nums.size(); ++i ) { local = local>0 ...
true
9e1235a8fb2fde8d8237a39464f757d37ad37d8f
C++
StylistMercurial1130/Chip8Emulator
/src/Chip8/display.h
UTF-8
437
2.53125
3
[]
no_license
#include "SDL2/SDL.h" #include <iostream> #include <inttypes.h> class Display{ private : SDL_Window * m_Display; SDL_Surface * m_Displaysurface; SDL_Surface * m_Chip8surface; SDL_Rect m_Chip8Display; public : Display(const char * title,int windowHeight,int windowWidth); void InitChip8S...
true
a8f5514f8a92afe1a25c69fbc90c38be7175af9e
C++
shipp02/graphics
/include/gl/shader.h
UTF-8
729
2.65625
3
[]
no_license
// // Created by Aashay shah on 26/12/2020. // #ifndef OPENGL_WITH_CONAN_SHADER_H #define OPENGL_WITH_CONAN_SHADER_H #include "raw/wrappers.h" #include <gl/raw/opengl.h> #include <string> namespace gl { class shader { using error_handler = void (*)(int err, std::string describe); public: shader(gl::raw::s...
true
040db53a890b4e26819acee5eeeaf3f500f8c82f
C++
yuntaewoong/gomokuAI_SDL2
/gomokAI/AIGameScene.cpp
UHC
1,707
2.890625
3
[]
no_license
#include "AIGameScene.h" #include <iostream> AIGameScene::AIGameScene(CustomRenderer* customRenderer,Turn playerTurn) : Scene(customRenderer) { gomokuBoard = new GomokuBoard(customRenderer, WINDOW_WIDTH, WINDOW_HEIGHT, WHITE_SPACE); this->playerTurn = playerTurn; this->AddUpdateObject(gomokuBoard); } void A...
true
eb2ca7d21d0accaa71fe35409c35ec199a8125cb
C++
TimpanogosTechGroup/GameEngine
/GameEngine/ErrorCode.h
UTF-8
1,279
3.703125
4
[]
no_license
/** File: Purpose: @author Jon Meilstrup @version 1.0 Copyright (c) 2018 All Rights Reserved */ #ifndef ERROR_CODE_H #define ERROR_CODE_H #include <string> #include <sstream> /* * Author: Jon Meilstrup * * Includes class declaration for ErrorCode class. * * This is used to keep identify any erro...
true
d17e9805a9e68678b772342193b06a69e56ea27c
C++
SpookyDreamer/Intersect2
/src/Line.h
UTF-8
1,247
3.015625
3
[]
no_license
#pragma once #include "Point.h" class Line { protected: char type; double A = 0; double B = 0; double C = 0; public: Line(Point* point1, Point* point2); virtual bool isParallel(Line* line); virtual Point* intersect(Line* line); virtual bool isOnline(Point* point); virtual bool equals(...
true
3e3aae420bd112eb688311a17c22eef93cb8e6af
C++
darlinaw/Splicer
/main.cpp
UTF-8
1,037
2.9375
3
[]
no_license
#include <iostream> #include "List.h" int main(){ using std::cout; using std::endl; List myList; cout << myList.toString() << endl; // (0) myList.insert(""); cout << myList.toString() << endl; // (0) ...
true
d763a3c9e80450a5b22aa8bdb34cf39982cecb68
C++
dtalther/ArticRasterizingPollinizer
/ArticRasterizingPollinizer-core/window.cpp
UTF-8
1,229
2.703125
3
[]
no_license
#include "window.h" #include <stdio.h> namespace ARP { namespace HellsKitchen { void windowResize(GLFWwindow* window, int width, int height); Window::Window(const char* name, int width, int height) { this->name = name; this->width = width; this->height = height; if (!init()) glfwTerminate(); } ...
true
a17d9e1110cc9d5dab7c26d9a63fdce0c25dbf16
C++
rdoster13/CS101
/Labs/CS101_Lab15/Stats.cpp
UTF-8
2,426
3.890625
4
[]
no_license
#include<stdio.h> #include<math.h> // TODO: Insert you code here // - call prototype functions for operations double mean(int num1, int num2, int num3, int num4); double stddev(int num1, int num2, int num3, int num4); int max(int num1, int num2, int num3, int num4); int min(int num1, int num2, int num3, int num4); in...
true
05e06da7d9a473d6d973f6369732008d49da4b55
C++
Shadek07/uva
/Solved Category/Graph/DFS/352.cpp
UTF-8
2,297
2.625
3
[]
no_license
#include<iostream> #include<vector> #include<cstring> using namespace std; #define SIZE 100 vector <int> adj[SIZE][SIZE]; vector <int> adj1[SIZE][SIZE]; bool visited[SIZE][SIZE]; int v; char in[25][26]; void visit(int u,int v) { int i; visited[u][v]=true; for(i=0;i<adj[u][v].size();i++) if(!visited[adj[u][v][...
true
69f6f7643865f1de6d2c7f7ffea34dc50aaa13ef
C++
vster/OOP_CPP
/Ch09/Ch09-Exercises/ex08-1/ex08-func.h
WINDOWS-1251
1,016
3.34375
3
[]
no_license
/////////////////////////////////////////////////////////// class String { protected: enum { SZ = 40 }; // char str [ SZ ]; // public: // String ( ) { str [ 0 ] = '\x0'; } // String ( char s [ ] ) { strcpy_s ( str, s ); } // // void display ( ) const { cout << s...
true
9a52169a46026a7adafe57b45e5164131498e351
C++
noekleby/TDT4102
/Øving 8/rectangle.cpp
UTF-8
584
3.046875
3
[]
no_license
// // rectangle.cpp // Øving 8 // // Created by Magnus Pedersen on 21.03.14. // Copyright (c) 2014 Magnus Pedersen. All rights reserved. // #include "rectangle.h" Rectangle::Rectangle(Line diagonal) : Shape(diagonal.getColor()), diagonal(diagonal) {} void Rectangle::Draw(Image& img){ Line d = diagonal; //Just c...
true
d35f7774f523972fa75f328e55980da48b83a8c3
C++
Lime5005/epitech-1
/tek2/C++/Pool/cpp_d06/ex01/main.cpp
UTF-8
772
2.796875
3
[]
no_license
/* ** main.cpp for cpp_d06 in /home/gogo/rendu/tek2/cpp_d06/ex00/main.cpp ** ** Made by Gauthier CLER ** Login <gauthier.cler@epitech.eu> ** ** Started on Mon Jan 09 09:55:27 2017 Gauthier CLER ** Last update Mon Jan 09 09:55:27 2017 Gauthier CLER */ #include <iostream> #include <iomanip> int main() { double ...
true
e0049e341653a304ea02ef6adfa0c54e4aee7bc6
C++
ArduinoGranCanaria/bluetooth
/ControlBT_leds/ControlBT_leds.ino
UTF-8
2,308
3.46875
3
[]
no_license
/* www.diymakers.es by A.García Arduino + Bluetooth Tutorial en: http://diymakers.es/arduino-bluetooth/ */ #include <SoftwareSerial.h> //Librería que permite establecer comunicación serie en otros pins //Aquí conectamos los pins RXD,TDX del módulo Bluetooth. SoftwareSerial BT(10, 11); //10 RX, 11 TX. int gre...
true
572ebe3ce19e903bd24bc6ae066ceb57156b3116
C++
Mrhuangyi/leetcode-Solutions
/Cpp/Hard/145. 二叉树的后序遍历.cpp
UTF-8
1,630
4.125
4
[]
no_license
给定一个二叉树,返回它的 后序 遍历。 示例: 输入: [1,null,2,3] 1 \ 2 / 3 输出: [3,2,1] 进阶: 递归算法很简单,你可以通过迭代算法完成吗? 递归法: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ cla...
true
be67e85e5f216032218d7ad419efd06ec673d2db
C++
yangyilincn83/CodePractise
/CodeInterview/RightValueReference.h
UTF-8
6,510
3.59375
4
[]
no_license
#pragma once #include "stdafx.h" #include <iostream> #include <vector> using namespace std; // http://thbecker.net/articles/rvalue_references/section_01.html namespace CPlusPlus { class ResourceClass { private: vector<int>* m_pResource; // representing expensive resource that is allocated for ea...
true
a88437b8647be63feddd497d5e6892544dcaa6d9
C++
alexandraback/datacollection
/solutions_2751486_0/C++/JohnySebb/consonants.cpp
UTF-8
1,816
2.75
3
[]
no_license
/* * ===================================================================================== * * Filename: consonants.cpp * * Description: Consonants * * Version: 1.0 * Created: 05/12/2013 12:01:00 PM * Revision: none * Compiler: gcc * * Author: Jan Sebechlebs...
true
3a2e3bf299744e987206954f32d7be99d729c880
C++
pyre/pyre
/tests/journal.lib/channel_xtalk.cc
UTF-8
4,648
3.15625
3
[ "BSD-3-Clause" ]
permissive
// -*- c++ -*- // // michael a.g. aïvázis <michael.aivazis@para-sim.com> // (c) 1998-2023 all rights reserved // get the journal #include <pyre/journal.h> // support #include <cassert> // type aliases template <typename severityT> using channel_t = pyre::journal::channel_t<severityT>; // severity stubs // info cl...
true
beb270575a636892689855099e1786f2548f861d
C++
ProgramacionCompetitivaUFPS/notebook
/c++/6 - Math/Divisors.cpp
UTF-8
1,007
3.546875
4
[ "MIT" ]
permissive
* Calcula la suma de los divisores de n. Agregar Prime Factorization y Modular Exponentiation (sin el modulo). ll sumDiv(ll n) { map<ll, int> f; fact(n, f); ll ans = 1; for (auto p : f) { ans *= (exp(p.first, p.second+1)-1)/(p.first-1); } return ans; } * Calcula la cantidad de divisore...
true
8377feae7b83e7a0ea7b9c4dd58173b6bb36992f
C++
FMYang/FSLAVLearningDemo
/FSLAVComponent/Framework/FSLAVComponent/C+/Mutex.cpp
UTF-8
922
2.875
3
[]
no_license
// // Created by Clear Hu on 2018/6/25. // #include "Mutex.h" #include "fslAVComponent_Utils.h" namespace fslAVComponent { Mutex::Mutex(void) { this->mutex = PTHREAD_MUTEX_INITIALIZER; } Mutex::~Mutex(void) { //保证对象被析构时候能够删除临界区 pthread_mutex_destroy(&mutex); } void Mutex...
true
696f311a05fa0e375a8affe2bef683c83d21dbc7
C++
Crogarox/Mahatta
/tools/Voxel/ColumnIter.cpp
UTF-8
1,882
3.078125
3
[]
no_license
#include "Voxel.h" #include "VoxelImp.h" namespace Voxel { /// @brief Derefernces the column iterator /// @return Column cell int ColumnIter::operator * (void) { return mSI->M1(); } /// @brief Gets the column's begin forward iterator /// @return Forward iterator RowIterF ColumnIter::begin (voi...
true
e2c59f63b47cac3887dab74e3da19b1e7be4b35e
C++
Cvetomird91/cpp-playground
/HashMap-remix/src/HashMap.cpp
UTF-8
2,514
3.046875
3
[]
no_license
#include "HashMap.h" #include <string> #include <array> #include <cstdint> #include <iostream> #include "HashMapNode.h" int default_compare(std::string a, std::string b) { return a == b; } uint32_t default_hash(std::string key) { size_t len = key.size(); uint32_t hash = 0; uint32_t i = 0; for (...
true
35d812b241a95a03834e0b7d0d2ae0ea6e226532
C++
SoftwareCornwall/m2m-teams-october-2018-liskeard
/Last Place/Straight_Line_Stop/Straight_Line_Stop.ino
UTF-8
3,599
3.234375
3
[ "MIT" ]
permissive
const int motorLFeedback = 2; //Left Motor Feedback const int motorRFeedback = 3; //Right Motor Feedback volatile int leftCount = 0; volatile int rightCount = 0; int startingSpeed = 150; //The starting speed is quite low and it slowly increments so as to prevent any jolting when the rover first ...
true
9087ec1373a82bfedfec8f893f3570d3b4028733
C++
NPPprojects/olivera_engine
/src/TestScreen/FPSCamera.cpp
UTF-8
3,840
2.734375
3
[]
no_license
#include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> #include "FPSCamera.h" FPSCamera::FPSCamera() { } FPSCamera::~FPSCamera() { } glm::mat4 FPSCamera::GetViewMatrix() { return glm::lookAt(transform.lock()->getPosition(), transform.lock()->getPosition() + transform.lock()->get...
true
34b57272c6dcec575c26a05357f233ed4d8feb69
C++
namu1714/Algorithm-Problem-Solving
/다이나믹프로그래밍/boj_12865(0-1 knapsack).cpp
UTF-8
622
2.515625
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<pair<int, int>> v; int dp[100][100001] = { 0, }; int N, K, W, V; cin >> N >> K; for (int i = 0; i < N; i++) { cin >> W >> V; v.push_back({ W, V }); } for (int i = v[0].first; i <= K; i++) dp[0][i] = v[0]...
true
ef3b2115821326af8d927ab617eaa903c53562a6
C++
zxdan523/PoissonEditing
/src/Image.cpp
UTF-8
5,000
2.578125
3
[]
no_license
/*************************************************************************************************************/ /* The Frame is based on Pieter Peers's framework */ /*Date:06/13/2016 ...
true
16c3397f50caea1a508e7545e07342e6da2fb359
C++
Andydiaz12/COJ-Solutions
/2374.cpp
UTF-8
754
2.890625
3
[]
no_license
#include <cstdio> #include <cstring> #include <cstdlib> using namespace std; long valores_max(char (*a)[1000000], int b){ long x; for(int i=0; i<b; i++){ if((*a)[i] == '5') (*a)[i] = '6'; } x=atol(*a); return x; } long valores_min(char (*a)[1000000], int b){ long x; for(int i=0; i<b; i++){...
true
b0c9faa2aea6f6b81f6e30447c80ca84372784cf
C++
ssrtw/SBCA
/SBCA/Key.h
UTF-8
480
2.546875
3
[]
no_license
#pragma once class Key { private: uint64_t usingTime = 0; vector<uint64_t> keys; void keyPadding(vector<uint8_t>& key); void keyHashing(vector<uint32_t>& in, vector<uint64_t>& out); void genKeys(vector<uint8_t>& key, vector<uint64_t>& keys); void genKeys(string& key, vector<uint64_t>& keys);...
true
975e37a251e041cfb52aa710e4d49579c6c071bd
C++
jackhax/APS-LIB
/functions/corstent.cpp
UTF-8
870
2.984375
3
[]
no_license
#include<iostream> #include<vector> using namespace std; bool solve(vector<string> s,int n){ for(int i=0;i<n;i++){ int u=0; int l=0; for(int j=0;j<s[i].length();j++){ int ascii = s[i][j]; if(ascii>=110 && ascii<=122) return false; if(ascii...
true
756b1921a1c7b20530aa14416c238bcc70350777
C++
TraurigeNarr/IRS
/IRSBatch/MathTests/TestVector.cpp
UTF-8
1,537
2.96875
3
[]
no_license
#include "stdafx.h" #include <MathBase\math\Vector3D.h> #include <UnitTest++.h> SUITE(Vector3DTests) { TEST(CheckConstructorForZeroing) { Vector3D vec; CHECK_EQUAL(0, vec[0]); CHECK_EQUAL(0, vec[1]); CHECK_EQUAL(0, vec[2]); } TEST(CopyConstructorTest) { Vector3D vec(1,2,3); ...
true
2e1c7795b39e73dff6f87c86c36e85f3738d5cea
C++
Michael-Z/spaceShooter
/button.cpp
UTF-8
2,339
2.8125
3
[]
no_license
//button.cpp #include "SDL/SDL.h" #include "globals.h" #include "classes.h" #include "functions.h" Button::Button(int x, int y, int w, int h, SDL_Surface *theButtonSheet, SDL_Rect* buttonClip, SDL_Rect* mouseOverClip, SDL_Rect* buttonClicked) { box.x = x; box.y = y; box.w = w; box.h = h; b...
true