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
f5056c6d6a063f107873a89bbe5c712842ac6a1a
C++
mouchtaris/byrror
/src/stream.h
UTF-8
1,631
2.8125
3
[]
no_license
#pragma once #include "pig.h" #include <optional> #include <type_traits> namespace stream { template <typename T> struct StreamOps; template <typename T> struct StreamOf { using type = StreamOps<std::decay_t<T>>; }; template <typename T> using stream_of_t = typename Str...
true
ce2a8ddec5681197550a9e8d75c07abd577acb2e
C++
andrie/SuppDists
/src/disabled/kruskal_wallace.cpp
UTF-8
7,193
2.859375
3
[]
no_license
// KRUSKAL WALLACE ************************************************************* /* Kruskal-Wallis and normal scores distributions approximated with beta. */ double KruskalWallisMaxU( int c, int n ) { return double(c-1)+1.0/double(n-(c-1)); } // Probability function for R DISTS_API void pKruskalWallisR( ...
true
5c647d5229f457d61c660919bf08feab460ef3af
C++
wizard00/PlayandTest
/powerof3.cpp
UTF-8
479
3.046875
3
[]
no_license
#include <math.h> #include <iostream> using namespace std; bool isPowerOfThree(int n); int main(int argc, char const *argv[]) { cout<<isPowerOfThree(243); return 0; } bool isPowerOfThree(int n) { if(n == 1) return true; double logs; logs = log((double)n)/log(3); c...
true
ebbf11e4e162b6640072e95647b68e61a4493896
C++
rosekc/acm
/contest/2017/NanNingOnline/A.cpp
UTF-8
944
2.703125
3
[]
no_license
//2017-09-24-14.42 //A #include <bits/stdc++.h> using namespace std; double a[5][5]; int s[100000]; char buf[999999]; void cal1() { gets(buf); char *t = strtok(buf, " "); int i = 0; //cout << t << endl; while (t != NULL) { sscanf(t, "%d", &s[i]); //cout << s[i] << endl; i+...
true
b84421c69b468ecfa82c80b59e46546fa6e2d826
C++
triphan2k3/CP_Train
/SPOJ/NKLINEUP.cpp
UTF-8
1,272
2.609375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; const int N=1e5; int a[N]; int ma[N]; int mi[N]; int n; int getmax(int l,int r) { int res=a[r]; while (l<=r) { int k=r-r&(-r); if (r-(r&(-r))<l-1) res=max(res,a[r--]); else { res=max(res,ma[r]); ...
true
e41ac14eec8866b38785d6bb9399a4a844c58145
C++
Smoria/RayTracer
/Code/Projects/RayTracer/sources/Bitmap.cpp
UTF-8
1,560
3.09375
3
[]
no_license
#include <cstdio> #include "Bitmap.h" #include "Macroses.h" const Bitmap& Bitmap::operator=(Bitmap&& uref) { SAFE_ARRAY_DELETE(m_pData); m_width = uref.m_width; m_height = uref.m_height; m_pData = uref.m_pData; uref.m_pData = nullptr; return *this; } const Bitmap& Bitmap::operato...
true
1db3eb027f3c6126a4ad1f2f63cedf171c69bbb0
C++
grok-phantom/CP-books
/2. Graph algorithms/dijkstra.cpp
UTF-8
1,426
3.484375
3
[]
no_license
/* * Dijkstra's algorithm finds shortest paths from the starting node * to all nodes of the graph, like the Bellman-Ford algorithm. The * benefit of Dijkstra's algorithm is that it is more efficient and * can be used for processing large graphs. However, the algorithm * requires that there are no negative weight e...
true
83a62bdc9d1e772e2336bc9adc59b8ed354acd69
C++
cj1ne/Algorithm
/Algorithm/삼성 기출 문제/10875_뱀.cpp
UTF-8
2,758
3.09375
3
[]
no_license
#include <iostream> #include <queue> #include <algorithm> #include <utility> #include <tuple> using namespace std; const int NONE = -1; const int UP = 0; const int RIGHT = 1; const int DOWN = 2; const int LEFT = 3; typedef struct Line { int x1; int x2; int y1; int y2; }line; vector<line> lines; int hx, hy, hd, l;...
true
9c5ad39453809bde7088f8edfcbaeca6e5fa07c0
C++
scsewell/Mantis
/Source/Utils/Geometry/RectInt.h
UTF-8
734
2.8125
3
[]
no_license
#pragma once #include "Mantis.h" namespace Mantis { /// <summary> /// Represents a 2d rectangle. /// </summary> class RectInt { public: int x; int y; int width; int height; /// <summary> /// Gest the position of the rect. /// </summary> ...
true
e196101693e300389dd29fd043930f20170d362e
C++
theoldestsc/TanksGame
/src/VideoManager.cpp
UTF-8
1,845
2.828125
3
[]
no_license
#include "VideoManager.h" std::unique_ptr<VideoManager> VideoManager::VideoManagerInstance = nullptr; VideoManager::VideoManager():mRenderer(nullptr), mWindow(nullptr) { } bool VideoManager::Initialize() { SDL_DisplayMode dm; if (SDL_GetDesktopDisplayMode(0, &dm) != 0) ...
true
495e18b895a4be6f20d916b0691d919577735738
C++
kigster/librgb
/src/librgb/FadeEffect.h
UTF-8
1,219
2.96875
3
[ "MIT" ]
permissive
#ifndef _RGB_PIXEL_EFFECT_H_ #define _RGB_PIXEL_EFFECT_H_ #include "RGBColor.h" #include "Effect.h" /** * Linear fade from one color to another. */ class FadeEffect : public Effect { public: FadeEffect(RGB from, RGB to, long periodMs) { restart(from, to, periodMs); };...
true
815769850f766c6a08bcdd7bd5e1ab698a8146f9
C++
r-mutax/MTextProt
/src/message.cpp
UTF-8
2,658
2.703125
3
[ "MIT" ]
permissive
#include "message.h" #include "key.h" #include "console.h" #include <queue> #include <thread> #include <mutex> std::mutex mtx; class CMessageEngine{ private: std::thread m_thread_key_monitoring; std::thread m_thread_display_monitoring; std::queue<MESSAGE> m_msg_pool; bool m_bRun; void key_monito...
true
18dc0a00fd4f913efc88218ebe5a9f713787e7a7
C++
MarinaNem/C_Lab
/Matrix/Matrix3D.h
UTF-8
311
2.703125
3
[]
no_license
#pragma once #include "MatrixBase.h" class Matrix3D :public MatrixBase { public: Matrix3D() : MatrixBase(m3D_size) {} virtual int element(unsigned int i, unsigned int j) const override; virtual int& element(unsigned int i, unsigned int j) override; private: int matrix[m3D_size * m3D_size]; };
true
f95f6a7e8b92b2f3ff3621d262427821657d90d2
C++
stupend-geek7/CSES
/Geometry/Point in Polygon.cpp
UTF-8
2,198
2.921875
3
[]
no_license
//https://cses.fi/problemset/task/2192/ #include<bits/stdc++.h> using namespace std; #define int long long int struct Point { int x,y; void read(){cin>>x>>y;} Point operator - (const Point& b)const{ return Point{x-b.x,y-b.y}; } void operator -=(const Point& b){ x-=b.x; y-=b.y; } int operator *(const Point...
true
518df2442dfb6c2f0545066e46a0ab0ab6092b30
C++
AndyBrown91/MusicPlayer
/Source/GUI/Controls/Sliders/VolumeControl.h
UTF-8
2,476
2.875
3
[]
no_license
/* * VolumeControl.h * sdaMidiMeter * * Created by Andy on 06/01/2012. * Copyright 2012 __MyCompanyName__. All rights reserved. * */ #ifndef H_VOLUMECONTROL #define H_VOLUMECONTROL #include "../JuceLibraryCode/JuceHeader.h" /** A slider with a volume icon that updates based on the volume bei...
true
a54e725446b4b19c857afbbe6599b34e84171005
C++
gfh16/StudyNotes
/CPP/C++学习资料/C++入门经典/书本例题/Code From the 2271 Book/ch14/prog14_05/list.h
UTF-8
1,230
3.09375
3
[]
no_license
// List.h classes supporting a linked list #ifndef LIST_H #define LIST_H #include "Box.h" class TruckLoad { public: // Constructors TruckLoad(Box* pBox = 0, int count = 1); // Constructor TruckLoad::TruckLoad(const TruckLoad& Load); // Copy constructor ~TruckLoad(); ...
true
e52b23841a020d860f4188a6ad46380f51d9016a
C++
ryanrabello/automatedNightLight
/deskLight/deskLight.ino
UTF-8
3,620
3.5625
4
[]
no_license
/** * Hi! * This program controls an RGB LED with some fade animations. * You can use this by adjusting the LED pins below and adjusting * the value you'd like to use for on and off. **/ //Initialize led pins int led[] = {6, 5, 3}; const int ledOff = 255; //Led full off pwm value. const int ledOn = 175; //...
true
c429a142e62989a54deecce5c3b8f8a60675c1bf
C++
msclam/CodeRepo
/c++/牛客网/剑指offer模块/J40-数组中只出现一次的两个数字.cpp
UTF-8
1,203
3.203125
3
[]
no_license
#include <bits/stdc++.h> using namespace std; class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param array int整型vector * @return int整型vector */ vector<int> FindNumsAppearOnce(vector<int>& A) { // int res = 0; // for (int num : A) { // ...
true
02e175a8d8a630bbb66b2f15109a89a189aa2b46
C++
KarolKalbarczyk/tepLab2
/ConsoleApplication16 - Kopia/ConsoleApplication16/DiffEval.h
UTF-8
1,389
2.640625
3
[]
no_license
#include "MscnProblem.h" const int POPULATION_SIZE = 12; const double CROSS_PROBABILITY = 0.08; const double WEIGHT_DIFF = 0.8; const int FITNESS_COUNT_TO_STOP = 50000; class Individual { public: Individual(double *genes, int size) { this->genes = genes; this->size = size;result = 0; }; bool isDifferent...
true
05df1ad5b6b4066d1be6de6241c581652412aab1
C++
mnakata/2011120803
/main.cc
UTF-8
497
3.203125
3
[]
no_license
#include <iostream> #include <cmath> const int N = 10000; const double p = 0.8; double binomdist(int n, double p, int k) { return exp( lgamma(n + 1) - lgamma(n - k + 1) - lgamma( k + 1) + k * log( p) + (n - k) * log(1....
true
5ce117c85b6a0dfe2c4331a5cb7fb87838391bef
C++
humbertotg/competitivePrograming
/157B.cpp
UTF-8
523
2.875
3
[]
no_license
#include <iostream> #include <algorithm> #include <math.h> #include <iomanip> using namespace std; int main() { int n; cin>>n; double ans = 0; int radius[n]; for(int i = 0; i < n; i++) cin>>radius[i]; sort(radius,radius+n,greater<int>()); for(int i = 0; i < n; i++){ if(i == n - 1 && n % 2 == ...
true
d92f053757b6603a59ec66214318f7e07b7bf920
C++
JoeyAndres/rl
/test/src/agent/Environment_test.cpp
UTF-8
2,258
2.71875
3
[]
no_license
/** * rl - Reinforcement Learning * Copyright (C) 2016 Joey Andres<yeojserdna@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your ...
true
4f655357fbf1682675bfde790875c5a3fea30846
C++
epsilonknot/CodeHub
/DSA/LinkedList/reverseLinkedList.cpp
UTF-8
1,612
4.03125
4
[]
no_license
/* * * Problem 16 : Reverse Linked List * */ #include<iostream> using namespace std; struct Node { int data; struct Node* next; Node(int val):data(val),next(NULL){} }; void display(Node *head) { while(head!=NULL) { cout << head->data << " " ; head=head->next; } cout << endl; } Node* recursive...
true
656e518b7d6af17aa53f8f5f010041c1ceae51ae
C++
vinsonleelws/LeetCode
/225-Implement Stack using Queues.cpp
UTF-8
4,281
4.09375
4
[]
no_license
/*Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. top() -- Get the top element. empty() -- Return whether the stack is empty. Notes: You must use only standard operations of a queue -- which means ...
true
185709aaa2147c385655df1cbb81f3823b878565
C++
definelicht/knn-xeonphi
/code/include/knn/Random.h
UTF-8
2,839
3
3
[]
no_license
#pragma once #include <algorithm> #include <random> #include <type_traits> namespace knn { namespace random { #define CPPUTILS_RANDOM_THREADLOCAL thread_local typedef std::mt19937 DefaultRng; namespace { template <typename T> using DistType = typename std::conditional<std::is_floating_point<T>::value, ...
true
0bec0b231607554b6e995af5b71c18c8a0a82304
C++
Kayoku/BasicPoker
/oldcpp/Poker_Player_FSP.h
UTF-8
2,764
3.109375
3
[]
no_license
#ifndef poker_player_fsp_declared #define poker_player_fsp_declared #include <iostream> #include <random> #include "Poker_Player.h" namespace poker { class Poker_Player_FSP : public Poker_Player { private: std::mt19937 rnd; // 0 = Fold / 1 = Call/Check / 2 = Raise float strats_p1[170][5][3]; // 170 = Nb ...
true
5bcb239d28a252db758b7bb5c0ca0a34d26b214e
C++
georgesuarez/LeetCode
/C++/ToLowerCase.cpp
UTF-8
289
2.984375
3
[]
no_license
#include <string> using namespace std; class Solution { public: string toLowerCase(string str) { string lowerCaseStr = ""; for (int i = 0; i < str.length(); i++) { lowerCaseStr += tolower(str[i]); } return lowerCaseStr; } };
true
38d6001d967dd0a40a49c6ea0d0e9a9a9cd45220
C++
mviseu/Cpp_primer
/Chapter7/7_5.cc
UTF-8
348
3.5
4
[]
no_license
#include "Person.h" #include <iostream> using std::cin; using std::cout; using std::endl; int main() { // using data members to read from input Person P; if (cin >> P.NameID >> P.AddressID) { // using member function to write to output cout << P.Name() << endl; cout << P.Address() << ...
true
6db21e48dd533d6deaed3721001b5b96e9cfc5be
C++
Tanner/Picture-File-System
/source/month_directory_entity.cpp
UTF-8
891
2.71875
3
[]
no_license
#include <iostream> #include <vector> #include "month_directory_entity.h" #include "storage.h" #include "picture_entity.h" #include "util.h" using namespace pfs; using namespace std; MonthDirectoryEntity::MonthDirectoryEntity(int year, int month) : DirectoryEntity(month_to_str(month)), year_(year), month_(month) { ...
true
ab927436dcf3401eea86c8ccbdd1d9362140eb02
C++
sinarahmany/cplusplus
/ASsigment3Cplus/src/SimpleDate.cpp
UTF-8
3,324
3.875
4
[]
no_license
#include "SimpleDate.h" #include <string> #include <iostream> #include "../Functions.h" // Default constructor SimpleDate::SimpleDate():SimpleDate(1, 1, 1970, "Tuesday"){ } // Overloaded constructor SimpleDate::SimpleDate(int month, int day, int year, std::string dayofweek){ if (checkDate(month, day,...
true
a53f5f3c54e38790bb866da25761d382d985517e
C++
vedikagoyal3/Coding-Questions
/Array/Ways to Make a Fair Array.cpp
UTF-8
998
3.03125
3
[]
no_license
class Solution { public: int waysToMakeFair(vector<int>& a) { int e=0,o=0; for(int i=0;i<a.size();i++) { if(i%2==0) e+=a[i]; else o+=a[i]; } int preveven=0,prevodd=0,aftereven=e,afterodd=o; int count=...
true
f9c9dff4f1aab02bab9ca7a7870b24d345adabe4
C++
nikhilbarthwal/Random
/TwsApi/Book/CppLinux/Ch11_Bollinger/Bollinger.cpp
UTF-8
1,799
2.796875
3
[]
no_license
#define BOLLINGER_PERIOD 20 #include "Bollinger.h" Bollinger::Bollinger(const char *host, int port, int clientId) : signal(1000), EClientSocket(this, &signal) { // Connect to TWS bool conn = eConnect(host, port, clientId, false); if (conn) { // Launch the reader thread reader = new EReader(this, &signal); reader->s...
true
ee5b3564fdfa8b25d82f9f79a3e013f2ca5c523e
C++
junblood/arduino
/uploadTemperature/uploadTemperature.ino
UTF-8
5,307
2.703125
3
[]
no_license
/* Web client This sketch connects to a website (http://www.google.com) using an Arduino Wiznet Ethernet shield. Circuit: * Ethernet shield attached to pins 10, 11, 12, 13 created 18 Dec 2009 by David A. Mellis modified 9 Apr 2012 by Tom Igoe, based on work by Adrian McEwen */ #include <SPI.h> #inc...
true
0adf41bce402be5d7f9580712bb6b00214d40555
C++
jezgillen/platypus
/Platypus.ino
UTF-8
5,858
2.6875
3
[]
no_license
#include <string.h> #define RECEIVE 1 #define SEND 0 #define SEND_TIME 60*10 #define RED 3 #define GREEN 4 #define IR_sense 1 #define IR_LED 0 #define IR_HIGH() TCCR0A = 1<<COM0A0 | 2<<WGM00 #define IR_LOW() TCCR0A = 2<<WGM00; #define DELAY_ONE_MILLISECOND(); for(long i = 0; i < 194; i++) {__asm__("nop\n\t");} //funct...
true
d882dc3244be07568a398570bae9cba4f7c8dfc6
C++
aurelienrb/light-monitoring-tool
/src/cpu-stats.cpp
UTF-8
2,121
2.515625
3
[ "MIT" ]
permissive
#include "cpu-stats.h" #include <cassert> #include <sstream> #include <cstdlib> #include <algorithm> #include <iomanip> #include <mutex> #define _UNICODE #include <pdh.h> #pragma comment(lib, "Pdh.lib") namespace { // http://stackoverflow.com/questions/63166/how-to-determine-cpu-and-memory-consumption-from-inside-a...
true
e1c2f97f2b99f7248f47d4317132175830b197a4
C++
opendev0/project_euler
/problem14.cpp
UTF-8
1,153
3.9375
4
[]
no_license
/* The following iterative sequence is defined for the set of positive integers: n → n/2 (n is even) n → 3n + 1 (n is odd) Using the rule above and starting with 13, we generate the following sequence: 13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 It can be seen that this sequence (starting at 13 and finishing at 1) co...
true
9bf2557a3f1c9b6ba4a6d0ec4dfab7ff60d2abb0
C++
Poisondo/SNMP-Sensor-DHT21
/src/read_hw.cpp
UTF-8
545
2.53125
3
[]
no_license
/** ****************************************************************************** * @file : read_hw.c * * @author Dyakonov Oleg <o.u.dyakonov@gmail.com> ****************************************************************************** */ #include <Arduino.h> #include "read_hw.h" #include "config....
true
6d6d6eec4810bbfe403bdddff79906927462b4be
C++
Leoneq/iNapGPU
/gpu tester/src/main.cpp
UTF-8
6,012
2.90625
3
[]
no_license
/* 0 ! 36 A 72 a 1 " 37 B 73 b 2 # 38 C 74 c 3 $ 39 D 75 d 4 % 40 E 76 e 5 & 41 F 77 f 6 ' 42 G 78 g 7 43 H 79 h 8 ( 44 I 80 i 9 ) 45 J 81 j 10 * 46 K 82 k 11 + 47 L 83 l 12 , 48 M 84 m 13 - 49 N 85 n 14 . 50 O 86 o 15 / 51 P 87 p 16 0 52 Q ...
true
ea993b0247ff9c6654f0cf54da7c26723f858e80
C++
ejuarezg/NM4P
/Cpp/randn.cpp
UTF-8
370
2.9375
3
[]
no_license
#include "NumMeth.h" double rand( long& seed ); // Random number generator; Normal (Gaussian) dist. double randn( long& seed ) { // Input // seed Integer seed (DO NOT USE A SEED OF ZERO) // Output // randn Random number, Gaussian distributed double randn = sqrt( -2.0*log(1.0 - rand(seed)) ) * cos...
true
24b888b2a6ca5a251de232586888043e57b15c6a
C++
Priyanshu078/datastructures-in-c-
/sorting.cpp
UTF-8
2,310
3.578125
4
[]
no_license
#include <iostream> using namespace std; // selection sort // int main() // { // int n; // cin>>n; // int array[n]; // for (int i = 0; i < n; i++) // { // cin>>array[i]; // } // for (int i = 0; i < n-1; i++) // { // for (int j = i+1; j < n; j++) // ...
true
88e94962ae6c8571cc9aa392d1078e877ebe2e8c
C++
Song1996/Leetcode
/p130_Surrounded_Regions/p130.cpp
UTF-8
2,290
2.78125
3
[ "MIT" ]
permissive
#include <iostream> #include <memory> #include <vector> #include <stack> #include <map> #include <string> #include <assert.h> #include <algorithm> using namespace std; class Solution { public: void solve(vector<vector<char> >& board) { bool touch_flag = false; for(int i = 0; i < board.size(); i++) ...
true
ca643f815643d85ffcdea17266f128795ef46a3a
C++
joe1166/noi
/p1149.cpp
UTF-8
1,157
2.765625
3
[ "Apache-2.0" ]
permissive
#include <iostream> using namespace std; int numof[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}; int n; int a, b; int c = 0; int fnum = 0; int count(int n, int a) { if (a < 10) { return n - numof[a]; } else if (a < 100) { return n - (numof[a / 10] + numof[a % 10]); } else if (a < ...
true
4807a0a21a9c6d043b743576e4a4f991ce97913d
C++
FangyeReady/GAME
/Scripts/3lua/2016.10.22/C++与lua共用示例/GameInput.h
GB18030
833
3
3
[]
no_license
#ifndef _GAME_INPUT_H_ #define _GAME_INPUT_H_ #include <windows.h> #define _KS_UH 1 //״̬:ſ #define _KS_UC 2 //״̬:ǰſ #define _KS_DH 3 //״̬: #define _KS_DC 4 //״̬:ǰ class CGameInput { private: // HWND m_hWnd; //״̬ΪWindowsֵ֧İ0xfe //256涨װÿ //״̬ˣֱÿļֵΪ± int m_KeyState[256]; public: // CGameInput(HWND hWnd); ...
true
705d37ce1938b389a581baa9a19596a9e05efa90
C++
MichaelBridgette/Overhead-Racing-Game
/Joint Project/Ai.h
UTF-8
1,447
2.625
3
[]
no_license
#pragma once #include <SFML\Graphics.hpp> #include "Car.h" #include <Thor/Vectors.hpp> #include "PhysicsBalls.h" #include "Math.h" /// <summary> /// @mainpage Joint Project - 2D racing game. /// @Author Dylan Murphy, Sean Regan, Micheal Bridgette, David O'Gorman /// @Version 1.0 /// @brief A 2D racing game. /// </sum...
true
bd657d96f6b179e8e5fa638dab5b60f3a2b155d5
C++
ivk-jsc/broker
/libs/libupmq/decaf/nio/Buffer.h
UTF-8
9,783
2.875
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
0935657851dbb0cba37ac25120a4cca994011db6
C++
DmitriyODS/clock
/Store/Clock/reducer/reducer.cpp
UTF-8
1,415
2.734375
3
[]
no_license
#include "reducer.h" ClockState clockReducer(ClockState state, Action action) { switch (action.type) { case ActionTypes::SET_COLOR_ARROW_HOUR: { state.color_clock.hour = *static_cast<Color *>(action.data); return state; } case ActionTypes::SET_COLOR_ARROW_MINUTES: { ...
true
e30c47c15a3e73742fe0d2edddb1d7d351f1233c
C++
openbmc/phosphor-ipmi-flash
/bmc/version-handler/test/version_canhandle_enumerate_unittest.cpp
UTF-8
765
2.640625
3
[ "Apache-2.0" ]
permissive
#include "version_handler.hpp" #include "version_mock.hpp" #include <array> #include <gtest/gtest.h> namespace ipmi_flash { TEST(VersionHandlerCanHandleTest, VerifyGoodInfoMap) { constexpr std::array blobNames{"blob0", "blob1", "blob2", "blob3"}; VersionBlobHandler handler(createMockVersionConfigs(blobNames...
true
8c6760050d1a4309fc29480423924afc4e0cc0bb
C++
moecia/CMPM-265_Flocking
/Vehicle.cpp
UTF-8
1,637
2.765625
3
[]
no_license
#include "Vehicle.h" #include "MyMathLib.h" using namespace sf; Vehicle::Vehicle(sf::RenderWindow* window) { acceleration = Vector2f(0, 0); veclocity = Vector2f(0, 0); location = (Vector2f)sf::Mouse::getPosition(*window); r = 25.0f; maxSpeed = 200; maxForce = 1.0f; shape.setRadius(6); shape.setPointCount(3)...
true
6301a3dc5d369efd005a84f3b9c323527e00c252
C++
slagozd/Cplusplus
/IntroC++/from_line_to_file.cpp
UTF-8
583
2.828125
3
[]
no_license
#include <iostream> #include <cstdlib> #include <fstream> using namespace std; int main(int argc, char *argv[]) { if (argc!=3) { cout<<"Wrong number of parameters"<<endl; return 0; } ifstream input_file; input_file.open (argv[1]); ofstream output_file; output_file.open (argv[2]); c...
true
fbf3ebe4789d248c123b13020bd7a57255a1a2fe
C++
StanPal/MAGE
/Framework/Core/Src/TimeUtil.cpp
UTF-8
1,100
2.921875
3
[]
no_license
#include "Precompiled.h" #include "TimeUtil.h" using namespace MAGE::Core; float MAGE::Core::TimeUtil::GetTime() { //HighResClock is best clock your pc gives you, which is your system clock, //Because it is static the first time we call it, is when you start the stopwatch static const auto startTime = std::chrono:...
true
957f44f3a121ff89b170a08092ed9704014f440f
C++
cde8eae8/ITMO-s5
/translation/labs/lab4-cpp/main.cpp
UTF-8
3,587
2.546875
3
[]
no_license
#include <iostream> #include <any> #include <vector> #include <sstream> #include "parsing_table_generator.h" #include "parser.h" std::unordered_map<std::string, std::vector<std::vector<std::string>>> testGrammar = { std::make_pair("S", std::vector<std::vector<std::string>>{{"C", "C"}}), std::make_pair(...
true
e1af26f11a7cd2dd4542d8b4f43d765201bfb300
C++
chungthaidung/MarioBros
/Project1/Cell.cpp
UTF-8
487
2.953125
3
[]
no_license
#include "Cell.h" Cell::Cell(int x, int y) { this->x = x; this->y = y; } void Cell::Add(CGameObject* obj) { listobj.insert(obj); } unordered_set<CGameObject*> Cell::GetListObj() { return listobj; } void Cell::RemoveObj(CGameObject* obj) { auto find = listobj.find(obj); if (find == listobj.end()) return; l...
true
4ff5340561785afbd6c440cefe4816641b073c94
C++
SayaUrobuchi/uvachan
/Kattis/glitchbot.cpp
UTF-8
1,008
2.65625
3
[]
no_license
#include <iostream> int n; int dx[] = {0, 1, 0, -1}; int dy[] = {1, 0, -1, 0}; int cx[] = {1, 0, 0}; int cy[] = {1, 0, 0}; int cd[] = {0, 3, 1}; int cmd[64]; char buf[64]; const char *cname[3] = {"Forward", "Left", "Right"}; bool check(int ex, int ey) { int x, y, d, i; x = 0; y = 0; d = 0; for (i=0; i<n; i++) {...
true
d65dab573247c4b72734f9e0ab4955f9a5aa55e3
C++
8l/HrwCC
/vm/Memory.h
UTF-8
1,915
3.0625
3
[]
no_license
#ifndef MEMORY_H #define MEMORY_H #include <vector> #include "AllocateNode.h" #include "VMConfig.h" #include "GenericException.h" #include "InstructionsFetcher.h" //#include "ExecParser.h" typedef char byte; /** * this is a full blown memory allocating class * that allows dynamic memory allocation and deallocatio...
true
96827b535ed9a5a78c74999fa9aa9e0d0bfe8c27
C++
farnazkohankhaki/CPP-Codes-Archive
/Programming Class/Number of permutation.cpp
UTF-8
475
2.65625
3
[]
no_license
#include <iostream> using namespace std; const int MAXN = 100 + 10; int n, a[MAXN], t[MAXN], f[MAXN]; int number() { int ans = 1; f[0] = 1; for (int i = 1; i <= n; i++) f[i] = f[i - 1] * i; for (int i = 1; i <= n; i++) { for (int j = 1; j < i; j++) if (a[j] < a[i]) t[a[i]]--; ans += t[a[i]] * f[n ...
true
e0f34e2cd835e0ea3320c2b459d8b809c4642ac4
C++
Bright1992/leetcode
/396.cpp
UTF-8
398
2.921875
3
[]
no_license
// // Created by Bright on 2017/1/3. // #include <vector> #include <iostream> using namespace std; int maxRotateFunction(vector<int>& A){ int n=A.size(); int sum=0,msum=0,tsum=0; for(int i=0;i<n;++i) { msum += i * A[i]; sum += A[i]; } tsum=msum; for(int i=n-2;i>=0;--i){ ...
true
5b195244cfa30c4624a9614bd3d9d05a2d228926
C++
pavelsimo/ProgrammingContest
/spoj/7974_ACPC10A/P7974.cpp
UTF-8
1,302
2.609375
3
[]
no_license
/* @BEGIN_OF_SOURCE_CODE */ /* @SPOJ ACPC10A C++ "Ad Hoc, Math, Arithmetic progression, Geometric progression" */ #include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <stack> #include <set> #include <map> #include <list> #include <bitset> #include <de...
true
01a87938928f57c584b4fc04567962482a4267f8
C++
mzhKU/prcpp_lecture
/testat01/SOLUTION_TESTAT02/UnitTestVector/UnitTestsVector.cpp
UTF-8
5,091
2.609375
3
[]
no_license
#include "pch.h" #include "CppUnitTest.h" #include "..\Testat03\Expression.hpp" #include "..\Testat03\Vector.hpp" using namespace Microsoft::VisualStudio::CppUnitTestFramework; #define AUFGABE1 #define AUFGABE2 #define AUFGABE3 /* #define AUFGABE4 #define AUFGABE4_1 */ namespace UnitTest1 { TEST_CLASS(Expression)...
true
f21910bc5bcea4eb075c9d3c6f5b70303cde2871
C++
jordancharest/School-Work
/Data Structures/HOMEWORK/HW3/the_stack.h
UTF-8
1,277
3.25
3
[]
no_license
#include <cstdio> #include <iostream> #include <cassert> #include <cstdlib> #include <stdint.h> #include <vector> #include <string> // ============================================================================== // // This class supports a limited visualization / printing of the data // stored on the stack in the r...
true
c79b76a3d3a010e0a8ca5916c48542347e61b714
C++
ElhadjBarry/Jeu_Bataille_Navale
/territoireMaritime.cpp
UTF-8
385
2.828125
3
[]
no_license
#include "territoireMaritime.h" TerritoireMaritime::TerritoireMaritime() { init(-1); } void TerritoireMaritime::init(int value) { for(int i=0; i<50; i++) for(int j=0; j<50; j++){ cell[i][j] = value; } } void TerritoireMaritime::setCell(int x, int y, int value) {cell[x][y] = value;} int...
true
103ba0a12d3327cc1d3e5f67d27a50cb7c8eb37d
C++
icbtbo/zhiku
/code for practice/数据结构OJ练习/2-L.cpp
UTF-8
611
3.015625
3
[]
no_license
# include <iostream> # include <string.h> using namespace std; int Index(char S[],char T[]){ int i=1,j=1; while(i<=strlen(S)&&j<=strlen(T)) { cout<<S[i-1]; if(S[i-1]==T[j-1]) { ++i;++j; } else { i=i-j+2; j=1; ...
true
7df43a0b34d18a0069b9e036d96bb72f8a6f33fa
C++
IvanLazarov1/workspace2
/8.FunctionHomeExerciseFunctions-2/src/HomeExerciseFunctions-2.cpp
UTF-8
2,053
3.453125
3
[]
no_license
//============================================================================ // Name : HomeExerciseFunctions-2.cpp // Author : ty // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //======================================================================...
true
acecafda0e7e45796f532a23522293346a9c53fd
C++
CoolName11/UrchinEngine
/physicsEngine/src/collision/narrowphase/algorithm/gjk/GJKAlgorithm.cpp
UTF-8
7,134
2.640625
3
[]
no_license
#include "collision/narrowphase/algorithm/gjk/GJKAlgorithm.h" namespace urchin { template<class T> GJKAlgorithm<T>::GJKAlgorithm() : maxIteration(ConfigService::instance()->getUnsignedIntValue("narrowPhase.gjkMaxIteration")), relativeTerminationTolerance(ConfigService::instance()->getFloatValue("narrowPhase.gjkR...
true
1260e62794a07808a27de4df240f0feee1f845cd
C++
albertomila/continous-formation
/C++11Tests/C++11Tests/Samples/Lambdas.h
UTF-8
6,133
3.234375
3
[]
no_license
#include "stdafx.h" #include <algorithm> #include <vector> #include <functional> using FilterContainer = std::vector<std::function<bool(int)>>; using IntFunction = std::function<int(int)>; bool FiltersFunction(int i) { return false; } void AddOperationReference(FilterContainer& filters) { auto divisor = 4 / 2...
true
dcb2b1a560fa8de728477f66d36cdc7feb40e544
C++
ZuoYuShen/Leetcode-record
/Leetcode-code/41.缺失的第一个正数-hash.cpp
UTF-8
606
3.046875
3
[ "MIT" ]
permissive
/* * @lc app=leetcode.cn id=41 lang=cpp * * [41] 缺失的第一个正数 */ // @lc code=start class Solution { public: int firstMissingPositive(vector<int>& nums) { for(int i=0; i<nums.size(); i++){ if(nums[i]<=0) nums[i] = nums.size() + 1; } for(int i=0; i<nums.size(); i++){ i...
true
c21eb6da343cd41d800f30b59d77ad4f9a4bd0d4
C++
yig/graphics101-meshes
/src/halfedge.h
UTF-8
5,710
3.15625
3
[]
no_license
#ifndef __halfedge_h__ #define __halfedge_h__ #include "mesh.h" // Triangle #include <map> namespace graphics101 { class HalfEdgeTriMesh { public: // We need a signed integer type so we can use -1 for an invalid index. typedef long Index; typedef std::vector< Index > Indices; // A special type t...
true
d7d15123f718c2fd51df8304bef24bdf580077cb
C++
SayaUrobuchi/uvachan
/AtCoder/arc090_a.cpp
UTF-8
325
2.6875
3
[]
no_license
#include <iostream> using namespace std; int ary[2][105]; int main() { int n, i; scanf("%d", &n); for (i=1; i<=n; i++) { scanf("%d", &ary[0][i]); ary[0][i] += ary[0][i-1]; } for (i=1; i<=n; i++) { scanf("%d", &ary[1][i]); ary[1][i] += max(ary[0][i], ary[1][i-1]); } printf("%d\n", ary[1][n]); return ...
true
769cf78a737ec16857f5d2a0bcd626020aefd389
C++
wonter/leetcode-solutions
/1529.bulb-switcher-iv.cpp
UTF-8
386
2.75
3
[]
no_license
/* * @lc app=leetcode id=1529 lang=cpp * * [1529] Bulb Switcher IV */ // @lc code=start class Solution { public: int minFlips(string target) { int ret = 0; int now = 0; for (char ch : target) { if (ch - '0' != now) { now ^= 1; ret += 1; ...
true
3d9ee5237fe08d5fd4ec3b12969f64ca4a5699d9
C++
JamesShirazian/COOL
/FastInterrupt.cpp
UTF-8
3,178
3.390625
3
[]
no_license
#include "FastInterrupt.h" void(*fastInterruptFunction)(void); void fastInterruptHandler (void) __irq; /** * Default constructor: activate EXTINT0 by default and set its priority to 0 which can be alter by "setFunctionToInterrupt"<br> * <B><br>Example:<br><B><br> * * FastInterrupt myInterrupt; <br> * ...
true
8d9b171b7a72066f588c0cb2b42a6d98adec631b
C++
rickwebiii/MallocStarter
/include/Malloc.hpp
UTF-8
6,734
3.1875
3
[]
no_license
#pragma once #include <signal.h> #include <atomic> // You can assume this as your page size. On some OSs (e.g. macOS), // it may in fact be larger and you'll waste memory due to internal // fragmentation as a result, but that's okay for this exercise. constexpr size_t pageSize = 4096; class MMapObject { // The...
true
86c8be546ce5af40b8b73196c39400b48d576a3b
C++
izyakacman/hw12
/check_tensor.cpp
UTF-8
1,079
2.515625
3
[]
no_license
#include "check_tensor.h" #include "tf_classifier.h" #include <sstream> #include <fstream> using namespace std; using namespace mnist; bool ReadFeatures(std::istream& stream, Classifier::features_t& features) { std::string line; std::getline(stream, line); features.clear(); std::istringstream l...
true
11d16fe7e9d384789e6c53c3d21b0c9be8eda8ff
C++
Sairei/PacMan
/ghost.cpp
UTF-8
534
2.515625
3
[]
no_license
#include "ghost.h" Ghost::Ghost(QString skin) : Entity(skin) { QPixmap pixmap("../PacMan/graphics_pacman/Affraid_ghost.png"); setVitesse(1); } void Ghost::setSpawnPoint(QPoint spawn_point){ m_spawn_point = spawn_point; } void Ghost::nextIAMove(Graph *graph_control, Entity *e) { QPoint pos_ghost = cu...
true
c531526f6a0c443758c045992523d725c3301263
C++
Signez/tpinsa-croisedrefs
/Code/Parseur.cpp
UTF-8
3,482
2.75
3
[]
no_license
/************************************************************************* Parseur - Analyse un fichier pour y trouver des identificateurs C++ ------------------- début : 19 nov. 2010 copyright : (C) 2010 par ssignoud et tpatel *************************************************************...
true
0b85f64e20e3ba9cac3fe0b8717dca5991d24f87
C++
ymarkovitch/libpcomn
/pcomn_cmdline/usage.cpp
UTF-8
10,840
3.015625
3
[ "Zlib", "LicenseRef-scancode-unknown-license-reference" ]
permissive
//------------------------------------------------------------------------ // ^FILE: usage.c - functions to print the usage of a CmdLine // // ^DESCRIPTION: // This file contains the functions that are used to print the // command-line usage of a command that is represented by a CmdLine // object. // // ^HISTORY:...
true
2eab2722db31d7bcf5d100a64f36332ba6d5f9ea
C++
fpagliughi/cpp_redis
/includes/cpp_redis/builders/integer_builder.hpp
UTF-8
773
2.515625
3
[ "MIT" ]
permissive
#pragma once #include <cpp_redis/builders/builder_iface.hpp> #include <cpp_redis/reply.hpp> #include <stdint.h> namespace cpp_redis { namespace builders { class integer_builder : public builder_iface { public: //! ctor & dtor integer_builder(void); ~integer_builder(void) = default; //! copy ctor & assignm...
true
d454d4c8b02defd2def715579412c2300ad3d4fa
C++
hehuaiyucn/Algorithm_2020
/HundredFowlsMoneys_problem.cpp
UTF-8
561
3.171875
3
[]
no_license
#include<stdio.h> // 我国古代数学家张丘建在《算经》一书中提出的数学问题: // 鸡翁一值钱五,鸡母一值钱三,鸡雏三值钱一。 // 百钱买百鸡,问鸡翁、鸡母、鸡雏各几何? void hundredFowlsMoneys() { int x, y, z; for (x = 0; x <= 20; x++) { for (y = 0; y <= 33; y++) { z = 100 - x - y; if (z % 3 == 0 && 5 * x + 3 * y + z / 3 == 100) { printf("������%d,��ĸ��%d,������%d\n", x, y,...
true
d2ba48e187936d65e8b4bdccef05f095c942eff0
C++
Lawendt/tilemap-ai
/Broke/Particle.h
UTF-8
592
2.796875
3
[]
no_license
#pragma once #include "Pulse.h" namespace Law { class Particle : public Law::GameObject { public: Particle(int Rotation, double LastingTime, Pulse *pulse, float width, float height, sf::Vector2f aceleration, sf::Vector2f force, sf::VertexArray m_vertices, sf::Texture *m_texture) :GameObject(width, height, ac...
true
5f8971359e319b6c193155ad55e06d27d6c13fcb
C++
aditrio/joki-tugas-cpp
/while/while-8.cpp
UTF-8
558
3
3
[]
no_license
#include <iostream> using namespace std; int main(int argc, char const *argv[]) { // program sewa mobil long harga = 256000; long total_harga = 0; int hari; int i = 1; cout << "harga sewa : Rp.256.000" << endl; cout << "--------------------------" << endl; cout << "masukan jumlah hari : "; cin >> hari;...
true
832480b524b9d7275d41c7c3f1843d4f6c3c1c29
C++
andreparker/spiralengine
/GameEngine/Gfx/VertexFormatImpl.hpp
UTF-8
1,367
2.8125
3
[]
no_license
/*! */ #ifndef VERTEX_FORMAT_IMPL_HPP #define VERTEX_FORMAT_IMPL_HPP #include <boost/cstdint.hpp> #include <boost/tuple/tuple.hpp> #include "../Core/Sp_DataTypes.hpp" namespace Spiral { namespace Impl { struct VertexFormat { VertexFormat():type( VF_INVALID ){} enum { VF_INVALID = -1...
true
81ad8b4e98acd0279f3bce35673a88649c7bca7a
C++
okoks9011/problem_solving
/algospot/ch30/promises.cc
UTF-8
1,801
2.953125
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> using namespace std; const int kInf = 987654321; vector<vector<int>> floyd(const vector<vector<int>>& adj_ori) { vector<vector<int>> adj(adj_ori); int v = adj.size(); for (int i = 0; i < v; ++i) adj[i][i] = 0; for (int k = 0; k < v; ...
true
271623b2ba659396a61e27936fa9dc5a70d52fb4
C++
budelphine/_cpp_modules
/day01/ex06/Weapon.hpp
UTF-8
276
2.828125
3
[]
no_license
#ifndef WEAPON_H # define WEAPON_H # include <iostream> # include <string> # include <iomanip> class Weapon { private: std::string type_; public: Weapon(); Weapon(std::string type); std::string &getType(); void setType(std::string type); }; #endif
true
f15c43015aa74bc58f5f0a2ab32343d7fd6ff723
C++
serk12/SRGGE
/src/Scene.cpp
UTF-8
5,096
2.546875
3
[ "Apache-2.0" ]
permissive
#include "Debug.h" #include <cmath> #define GLM_FORCE_RADIANS #include "PLYReader.h" #include "Scene.h" #include <glm/gtc/matrix_inverse.hpp> #include <glm/gtc/matrix_transform.hpp> #include "TileMapLoader.h" #include <GL/glut.h> Scene::Scene() {} Scene::~Scene() { for (auto &m : meshes) { delet...
true
467bb3ee481f96a6b664158c6b0960ac43078e5f
C++
SpookyDreamer/Intersect2
/UIsrc/MyException.h
UTF-8
912
3.21875
3
[]
no_license
#pragma once #include<exception> #include<iostream> using namespace std; //customized exception class 'myException' class WrongFormatException :public exception { public: WrongFormatException() :exception("ERROR! The file contents are in the wrong format. Please check the file contents.\n") { } }; class Una...
true
e313e206d1328dfeaf1af6c824640f86b1d6029e
C++
ltx6/helloworld
/计科191-14119210-李曈轩-第01次实验/01-1.cpp
GB18030
1,121
3.109375
3
[]
no_license
#include <iostream> using namespace std; int main() { cout << "100ڵ£" << endl; int i,j; int cnt1=0; int cnt2 = 0; for (i=2;i<100;i++) { for (j=1;j<=i;j++) { if (i%j==0) { cnt1++; } } if (cnt1== 2) { cout << i<<" \t"; cnt2++; } cnt1 = 0; if (cnt2 == 10) cout << endl; } int iint; co...
true
09e6804e6fa54a9f42194c3f59345e12b0179b4a
C++
samuelbohl/CP
/project euler/problem4.cpp
UTF-8
409
3.203125
3
[]
no_license
#include <bits/stdc++.h> using namespace std; bool is_palindrome(int x){ string str = to_string(x); int n = str.length(); for(int i = 0; i < n/2; ++i){ if(str[i] != str[n-i-1]) return false; } return true; } int main(){ int maxp = 0; for(int i = 999; i >= 100; --i){ for(int j = 999; j >= 100; --j){ if...
true
cbc11d0a7aaf06599023dc796759d896523895c8
C++
Tuchakage/The-Coin-Hunter
/GTEClib/include/Line.h
UTF-8
2,674
2.859375
3
[]
no_license
#pragma once #include "Model.h" class CLine : public CModel { public: float Length; // length from starting point along the x-axis float Width; CLine() : CModel() { Color.Set( CColor::Green()); Length=0; Width=2.0f; } CLine(float x, float y, float z, float length, const CColor& color=CColor::Gr...
true
fb48ca0aff04580caaccfc0cdc3c81cf53121207
C++
bashu22tiwari/Apna-College
/OOPS Concepts/static.cpp
UTF-8
483
2.890625
3
[]
no_license
#include <bits/stdc++.h> #include <cstdlib> #include <algorithm> #include <cstring> #include <vector> using namespace std; class Student{ public: int rollNumber; int age; static int totalStudents; Student() { totalStudents += 1; } }; int Student :: totalStudents = 0 ; int main() { Student s1; Stude...
true
b467f5ad3ac772d451063d4364a6084b1b8f154e
C++
gauravjaat/Phonebook
/project.cpp
UTF-8
7,657
2.984375
3
[]
no_license
#include<bits/stdc++.h> using namespace std; class conDetails{ public: long long int mob; long long int regCode; int speed=0; }; class avlNode { public: int asc; multimap<string,conDetails> s; avlNode *l; avlNode *r; int h; }; avlNode *newnode(int key,string sname,conDetails D) { avlNo...
true
e37314a2891383f29702052f06b055e19f5bce20
C++
phongvcao/CP_Contests_Solutions
/cpp/Codeforces/101-150/148A_Insomnia_cure.cc
UTF-8
1,106
3.15625
3
[ "MIT" ]
permissive
#include <iostream> #include <string> #include <sstream> #include <vector> int main(int argc, char **argv) { // Read the lines std::string line; long long int lineNumArr[] = { 0, 0, 0, 0, 0 }; int idx = 0; while (std::getline(std::cin, line)) { std::stringstream ss(line); ss >> l...
true
a95c82a0e66fd4f02f46b6b0ea54fce594cd51d6
C++
bmendli/politech-labs-cpp
/common/test-circle.cpp
UTF-8
3,728
3.109375
3
[]
no_license
#include <stdexcept> #include <iostream> #include <cmath> #include <boost/test/auto_unit_test.hpp> #include "circle.hpp" BOOST_AUTO_TEST_SUITE(TestForCircle) const double INACCURACY = 0.001; BOOST_AUTO_TEST_CASE(immutabilityRadiusAfterMovingCenter) { maschenko::Circle test_circle({15, 15}, 5); const double radiu...
true
e8ed7d3b0e4b06a9833d3d3a9f1b168da4ed05f2
C++
pavelsimo/ProgrammingContest
/hackerank/isthisabinarysearchtree2.cpp
UTF-8
562
3.0625
3
[]
no_license
/* ======================================================================== $File: $Date: $Creator: Pavel Simo ======================================================================== */ bool checkBST(Node *root, int min, int max) { if (root == NULL) return true; if (root->data < min ||...
true
f48865111cf8dae64aca479b58528bae55d8289b
C++
mjbriggs/DatalogEvaluator
/parameter.h
UTF-8
476
2.734375
3
[]
no_license
#pragma once #include <vector> #include <string> #include <iostream> #include <cstdlib> #include "tokType.h" using namespace std; class parameter{ private: tokType type; string typeStr; string parameterStr; vector <string> parameters; //might need a vector for parameter contents public: par...
true
8df68bb851c8c230fc9f03508156754a235d2bbc
C++
Plantaquatix/Driver-analysis
/code/traclus/traclus/Trajectory.cpp
UTF-8
872
2.796875
3
[]
no_license
// Trajectory.cpp : implementation file // #include "Trajectory.h" #include <iomanip> // CTrajectory CTrajectory::CTrajectory() { m_trajectoryId = -1; m_nDimensions = 2; m_nPoints = 0; m_nPartitionPoints = 0; } CTrajectory::CTrajectory(int id, int nDimensions) { m_trajectoryId = id; m_nDimensions = nDimensi...
true
4647d73f8fda482154b70183a8951f4e1751407f
C++
Gaurav07Robin/worldLineSim
/src/Entities/human.cpp
UTF-8
2,978
2.65625
3
[ "MIT" ]
permissive
#include <graphMat/iterators.hpp> #include "Entities/human.hpp" #include "world.hpp" #include "db/database.hpp" std::optional<Entity_Point> Human::getPrimaryPos() const { return this->curr_pos; } void Human::simulateExistence() { this->should_wander = true; this->has_been_paused = false; while (this->should_wan...
true
bf7a62fe8d577c7ff003a3c75f5c351b6b6f10c4
C++
wenqicao/algorithm-sec2
/13_13.cpp
UTF-8
1,048
3.296875
3
[]
no_license
#include <iostream> #include <unordered_map> #include <vector> using namespace std; bool find_all_substring_handler(string& str, unordered_map<string,int>& dict, int start, int unitsize, int numofword){ unordered_map<string,int> cur_dict; for(int i=0;i<numofword;i++){ string cur_word = str.substr(start+i*unitsize,...
true
b657743756b4e8c4428cb08c1cf3a5a78290c845
C++
jeacevedo92/SecondPartialHPC
/SobelFIlter/CPU/c++/SobelFilter.cpp
UTF-8
4,426
3.015625
3
[]
no_license
#include<iostream> #include<stdio.h> #include<malloc.h> //#include <cv.h> //#include <highgui.h> #include<opencv2/opencv.hpp> using namespace std; using namespace cv; unsigned char clamp(int value){//porque cuando se hace la convolución pueden salir números fuera del rango de unsigned char if(value < 0) va...
true
e2ee82cf3d1789e495a7c851ac143b19813cd11a
C++
Reitermaniac/AutomaticNightLight
/driver/button/Button.cpp
UTF-8
1,405
2.625
3
[]
no_license
#ifdef SETTING_BUTTON void Button::begin() { pinMode(BUTTON_TOGGLE_COLOR_PIN, INPUT_PULLUP); pinMode(BUTTON_TOGGLE_ON_OFF_PIN, INPUT_PULLUP); pinMode(BUTTON_SENSOR_PIN, INPUT_PULLUP); pinMode(BUTTON_PERM_PIN, INPUT_PULLUP); pinMode(BUTTON_PERM_ON_PIN, INPUT_PULLUP); pinMode(BUTTON_PERM_OFF_PIN, INPUT_PULLUP...
true
7a625b286367d22679e0152ee3af0c434c7c055b
C++
bufenceto/PuG
/core/graphics/src/win32_window.cpp
UTF-8
2,509
2.546875
3
[]
no_license
#include "win32_window.h" namespace pug { namespace graphics { LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); Window* Window::Create(const std::string& a_title, const vmath::Int2& a_size) { Win32Window* window = new Win32Window(); window->Initialize(a_title, a_size); return wi...
true
84230dc64acc334524c09d9ef92757668bc2e408
C++
allisterke/cpp-training-lab
/practise/binary_indexed_tree.cpp
UTF-8
1,083
2.9375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; using LL = long long int; class BinaryIndexedTree { private: vector<int> tree; public: BinaryIndexedTree(int capacity) : tree(capacity + 1) { } void update(int index, int val) { int diff = val - (query(index) - query(index-1)); while(inde...
true
3e90612a59e092a9e4e23b2ba2419518d5d63cea
C++
Ythnam/C-Users-PhilippeJ-WorkspaceCPP-FrameWorkFloue
/FrameWorkFloue/Fuzzy/NotMinus1.h
ISO-8859-1
460
2.671875
3
[]
no_license
/* * NotMinus1.h * * Created on: 2 fvr. 2016 * Author: PhilippeJ */ #ifndef NOTMINUS1_H_ #define NOTMINUS1_H_ #include "Not.h" namespace fuzzy { template<class T> class NotMinus1: public Not<T> { public: virtual ~NotMinus1() {}; T evaluate(core::Expression<T>*) const; }; template<clas...
true