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
4028c8013a15cc0af6cbadfc1243580337cfa339
C++
sailesh2/CompetitiveCode
/2020/cf539C.cpp
UTF-8
1,045
2.703125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int arr[n]; for(int i=0;i<n;i++){ cin>>arr[i]; } map<int,long long int> even; map<int,long long int>::iterator evenIt; map<int,long long int> odd; map<int,long long int>::iterator oddIt; ...
true
3058308605695cd9ef3e31dda355935db691a7d5
C++
vadera11jeet/DataStructure-And-Algorihtm
/trees/binary search tree/check bst has dead end or not.cpp
UTF-8
1,500
3.59375
4
[]
no_license
#include<bits/stdc++.h> using namespace std; class Node { public: int data; Node *right; Node *left; Node(int data = INT_MIN, Node *right = NULL, Node *left = NULL) { this->data = data; this->right = right; this->left = left; } }; class BinarySearchTree { public: ...
true
3d575045fedf0992ac98edd27535c342ce9f0634
C++
Tosi/wadutil
/src/ArgParser.cpp
UTF-8
4,182
3.046875
3
[ "MIT" ]
permissive
#include "ArgParser.h" #include <iostream> #include <cstdlib> using std::vector; using std::string; using std::map; using std::pair; using std::cout; using std::endl; ArgParser::ArgParser(const int argc, const char** argv) { conf = new ArgParserConf(); callback = nullptr; this->argc = argc; args = new...
true
8faf327bfe884e5bdfa2431781535bac4b666d47
C++
CSDNSampleGroup/CSDNQA4VS
/Q185912/Source.cpp
UTF-8
562
3.109375
3
[ "MIT" ]
permissive
#include <iostream> using namespace std; int main() { double sum_2diagonal(double arry_2d[][100], unsigned int m, unsigned int n); int i, j; double summ; unsigned int x, y; double arry[100][100]; cin >> x >> y; for (i = 0; i < x; i++) for (j = 0; j < y; j++) { cin >> arry[i][j]; } summ = sum_2diagonal(...
true
abe1c3dc8c4550b6d11e919c4280384566a6aa6c
C++
kunalsharmaks/DS-Algorithmic-Questions
/Data Structure/Stack/Stack using Array.cpp
UTF-8
1,494
3.84375
4
[]
no_license
#include<stdio.h> #include<stdlib.h> #include <limits.h> #define SIZE 100 int stack[SIZE]; int top = -1; void push(int element); int pop(); int main() { int choice, data; while(1){ printf("------------------------------------\n"); printf(" STACK IMPLEMENTATION PROGRAM \n"); ...
true
198e9cf6d72fd37523b05d6b1fbe522ca182bafc
C++
Abrham-CISCO/Problem-Solving-With-Programming-II
/Day1/Lab5_Functions.cpp
UTF-8
505
3.71875
4
[]
no_license
#include <iostream> //passing arguements to function can be done in two ways by value and by reference. //by default we are passing by value. by reference means using memory address and usually done using a pointer variable //for example int sum(int *x, int *y) here by reference method is used. using namespace std; int...
true
95d0d8c9bdc7f54d3fa7ca9a41ccb5cf7b53447c
C++
davidcorne/cpp-sandbox
/VirtualFunctions.cpp
UTF-8
1,113
3.5625
4
[]
no_license
//============================================================================= // How virtual functions work in constructors and destructors #include <iostream> //============================================================================= class Base { public: Base() { print("Base::Base()"); func...
true
983ffe536e921a988c65da6674b08b34c1160d76
C++
meakambut/Snake
/Snake/Snake/Point.cpp
WINDOWS-1251
852
3.234375
3
[]
no_license
#include "stdafx.h" #include "Point.h" #include "Direction.h" #include "stdio.h" #include "conio.h" using namespace std; void Point::Draw() { COORD position = { x, y }; HANDLE hconsole = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleCursorPosition(hconsole, position); cout << sym; } Point::Point(int _x, int _y, cha...
true
8ebe37209cc9571b4787514e42fb2925f8765e73
C++
arkrde/foundations_of_qt_development
/ch1/ch1-14/main.cpp
UTF-8
1,372
2.90625
3
[]
no_license
/* * Foundations of Qt Development * Ch 1-14 * STL-style iterator and Java-style iterator side by side * Copyright (C) 2021 Arnab De <arkrde@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 Soft...
true
53c25225c0e201b420e307d4c5269c07a74845ab
C++
simple-user/cpp
/tempik26 Car/tempik26 Car/lib.cpp
UTF-8
2,426
3.015625
3
[]
no_license
#include <iostream> #include "Menu.h" #include "lib.h" bool odInit(Odometr *&od) { if (od) { gotoxy(0, 9, 7); cout << "Parameters are cleared!" << endl; delete od; } int kmpl = 0; int cap = 0; int vol = 0; gotoxy(0, 10, 7); cout << "Input km per liter: "; cin >> kmpl; cout << "Input capacity of fuel...
true
25e2804b18c532472fd48e53414ee63042f842a0
C++
green-fox-academy/dodoo86
/Week5/Day-3/GFOpractice/Sponsor.h
UTF-8
384
2.625
3
[]
no_license
#ifndef GFOPRACTICE_SPONSOR_H #define GFOPRACTICE_SPONSOR_H #include "Person.h" class Sponsor : public Person { public: Sponsor(); Sponsor(const string &name, int age, const string &gender, const string &company); void introduce(); void hire(); void getGoal(); protected: string _company...
true
b4639ab4b22ee70cab471b4e6cbf59c3a9a279be
C++
JoTaeYang/Study
/Profile.cpp
UHC
5,525
2.5625
3
[]
no_license
#include <Windows.h> #include <stdio.h> #include <wchar.h> #include "Profile.h" //PROFILE_SAMPLE profile[MAX_PROFILE]; THREAD_SAMPLE g_profile[MAX_PROFILE]; int IsCheckName(int index, const WCHAR* szName) { for (int iCnt = 0; iCnt < MAX_SAMPLE; iCnt++) { if (g_profile[index].samples[iCnt...
true
fa72073d7a4821798f912be68a61037f89c58a31
C++
KaraJ/conpenguum
/Core/comm/udpConnection.cpp
UTF-8
3,689
2.90625
3
[]
no_license
/*---------------------------------------------------------------------------------------------------------- -- SOURCE FILE: udpConnection.cpp -- -- PROGRAM: TuxSpace -- -- METHODS: -- UDPConnection(int port) -- ~UDPConnection() -- void sendMessage(struct sockaddr* to, const void* data, size_t dataLen) -- ssize_...
true
6624db4c160b0265e8dda439c0e976e9ad318ab4
C++
zungybungy/Codility
/L3_PermMissingElem.cpp
UTF-8
599
3.109375
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> using namespace std; int solution(vector<int> &A) { // write your code in C++11 (g++ 4.8.2) int res = 0; for (int i = 0; i < int(A.size()); i++) { res += (i + 1 - A[i]); } res += int(A.size() + 1); return res; } int main(int arg...
true
c8a5afbcb5cc81147e70cd711f28f0b1c810f57c
C++
tianzhuwei/Algorithm
/Introduction to Algorithms/StringMatching/StringMatching-Read/StringMatching-Read/main.cpp
WINDOWS-1252
1,439
2.765625
3
[]
no_license
#include"general.h" void PuSu_match(char* buffer,char* p); void KMP(char* buffer, char* p); void BM(char* buffer, char* p); void Sunday(char* buffer, char * p); #include<string> int main() { clock_t time = clock(); ifstream DNA("E:\\ݼ\\DNA.txt"); //ifstream DNA("E:\\test.txt"); if (!DNA) { cout << "Can not open ...
true
0df0ff22ce10fdc6d3e834512952a79f70080689
C++
EPAC-Saxon/environment-map-JuliePreperier
/ShaderGLLib/Texture.cpp
UTF-8
4,392
2.71875
3
[ "MIT" ]
permissive
#include "Texture.h" #include <GL/glew.h> #include "Image.h" namespace sgl { Texture::Texture( const std::string& file, const PixelElementSize pixel_element_size /*= PixelElementSize::BYTE*/, const PixelStructure pixel_structure /*= PixelStructure::RGB_ALPHA*/) : pixel_element_size_(pixel_element_size), ...
true
522368d4c03b005eb5c3a30cb4aac8e4f909d789
C++
PeterZhouSZ/Boundary_Sampled_Halfspaces
/src/Cone_sImplicit.h
UTF-8
4,881
2.71875
3
[]
no_license
// // Created by Charles Du on 10/9/20. // #ifndef PSI_CONE_SIMPLICIT_H #define PSI_CONE_SIMPLICIT_H #include "Sampled_Implicit.h" #include <Eigen/Dense> #include <iostream> class Cone_sImplicit : public Sampled_Implicit { public: // standard cone Cone_sImplicit() : Sampled_Implicit() , ape...
true
002be08fcadac9b405cb3070d093ece0494f74a1
C++
souzag/training
/456.cpp
UTF-8
1,021
3.203125
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int main() { int qtdP, rooms; string city; cin >> qtdP >> city >> rooms; transform(city.begin(), city.end(), city.begin(), ::tolower); //transforma a palavra toda em minusculo double value = 0; if(city == "pipa") { int ...
true
b107a358cd9a5e57433a6986015b49da23c68c07
C++
DeclanRussell/WhatTheFlock
/src/openglwidget.cpp
UTF-8
2,726
2.765625
3
[]
no_license
#include <QGuiApplication> #include <ngl/NGLInit.h> #include <ngl/Vec3.h> #include "openglwidget.h" #include <iostream> OpenGLWidget::OpenGLWidget(const QGLFormat _format, QWidget *_parent) : QGLWidget(_format,_parent) { // set this widget to have the initial keyboard focus setFocus(); // re-size the widg...
true
77b9c6759d712c51e3bc57dddb6b2bcfe5c9c5b2
C++
kakabori/nfit12.16
/inc/fileTools.h
UTF-8
2,547
3.125
3
[]
no_license
#ifndef GUARD_FILETOOLS_H #define GUARD_FILETOOLS_H #include <vector> #include <fstream> #include <iostream> #include <sstream> #include <string> #include <assert.h> #include <stdexcept> using std::vector; using std::string; using std::ifstream; using std::getline; using std::istringstream; using std::ofstream; usin...
true
d699e2d75f90949152ccce8cba3764b4a6b00152
C++
magnusl/SwfEngine
/src/glrenderer/vertex_buffer.cpp
UTF-8
922
2.8125
3
[]
no_license
#include "stdafx.h" #include "vertex_buffer.h" #include <GL\glew.h> namespace ogl { /** * \brief Constructor for oglVertexBuffer * \param [in] a_VertexData The vertex data. * \param [in] a_DataSize The size fo the data. */ VertexBuffer::VertexBuffer(const void * a_VertexData, size_t a_DataSize, GLenum...
true
f21ffa314f5d58bf1e203e233d30e61aa233cc74
C++
Wonki4/coding-practice
/codingStudy/2001_swea.cpp
UTF-8
1,106
3.0625
3
[]
no_license
#include <iostream> #include <fstream> #include <cstring> using namespace std; int arr[15][15] ={0}; int M, N; //정사각형내부에 있는 파리의 총 개수를 세어주는 함수 int getArea(int y, int x) { int area = 0; for(int i = 0; i<M;i++) { for(int j = 0; j<M; j++) { area+=arr[y+i][x+j]; } } return area; }...
true
12b230784c008d2b97c2dfd056e6fce630a14510
C++
sudoDavi/cpp-study
/chapter8/Point2d.cpp
UTF-8
720
4.03125
4
[]
no_license
#include <iostream> #include <cmath> class Point2d { private: double m_x{}; double m_y{}; public: Point2d(double x = 0.0, double y = 0.0) : m_x{x}, m_y{y} {} void print() const { std::cout << "Point2d(" << m_x << ", " << m_y << ")\n"; } friend double distanceFrom(const Point2d& point1, const Point2d& point2)...
true
18a5706892b960ff722eeade9779ec6408facf22
C++
abicorios/MyCppExercises
/c7e19date/c7e19date/c7e19date.cpp
WINDOWS-1251
3,131
2.671875
3
[ "Unlicense" ]
permissive
// c7e19date.cpp: . // #include "stdafx.h" #include <iostream> #include <sstream> #include <regex> using namespace std; struct Date { short day; short month; short year; short wday; }; int what_day(Date*); void dprint(Date); void wdpp(short& wd) { short x = (wd++) % 7; wd = (x == 0) ? 7 : x; } void dincr(D...
true
77d70fc8638e8fd8051adbd9ae5f003184379d78
C++
XuChongBo/cxxdemo
/opencv_cxx_to_py_demo/examples.cpp
UTF-8
1,916
3.109375
3
[ "MIT" ]
permissive
#include <iostream> #include <opencv2/imgproc/imgproc.hpp> #include <boost/python.hpp> #include "conversion.h" namespace py = boost::python; typedef unsigned char uchar_t; //http://www.boost.org/doc/libs/1_55_0/libs/python/doc/tutorial/doc/html/python/exposing.html /** * Displays an image, passed in from python as...
true
0e289091c6dbd081024e467fdbe0fa1e6c9d3752
C++
icepic/bass
/src/functions.cpp
UTF-8
3,788
2.953125
3
[]
no_license
#include "assembler.h" #include <cmath> #include <coreutils/file.h> static uint8_t translate(uint8_t c) { if (c >= 'a' && c <= 'z') return c - 'a' + 1; if (c >= 'A' && c <= 'Z') return c - 'A' + 0x41; return c; } void initFunctions(Assembler& a) { auto& syms = a.getSymbols(); syms.set("Math.Pi", ...
true
0f5869d11597925d43eeb24ce09a7e5e167a19e7
C++
Kirby-Vong/FinalProject
/main.cpp
UTF-8
3,354
3.296875
3
[]
no_license
#include <iostream> #include <vector> #include <string> #include "UserClass.hpp" #include "Warrior.hpp" #include "Ranger.hpp" #include "State.hpp" #include "UnlockedState.hpp" #include "LockedState.hpp" #include "Armors.hpp" #include "LightArmor.hpp" #include "HeavyArmor.hpp" #include "Weapons.hpp" #include "Melee.hpp"...
true
0758690c9334f0bc44d854e883daa300898496db
C++
jt-taylor/42-cpp-piscine
/d03/ex00/main.cpp
UTF-8
495
2.8125
3
[]
no_license
#include "FragTrap.hpp" int main(void) { FragTrap not_claptrap("'a good name'"); not_claptrap.beRepaired(10); not_claptrap.takeDamage(10); not_claptrap.takeDamage(100); not_claptrap.beRepaired(30); not_claptrap.beRepaired(3); for (int i = 0;i < 5;i++) not_claptrap.vaulthunder_dot_exe("also not claptrap"); ...
true
e3102e8aa4229b12733d33bad770c7ec511cec7e
C++
nikhilyadv/UVA
/Mathematics/10407 - Simple Division.cpp
UTF-8
553
2.640625
3
[]
no_license
#include<bits/stdc++.h> using namespace std; int gcd(int a , int b){ return b == 0 ? a : gcd(b , a%b);} int main(){ int a[1001]; while(1){ cin>>a[0]; if(a[0] == 0) break; int size =1; while(1){ cin>>a[size]; if(a[size] == 0) ...
true
a0c5eeb56e44313e04b2c36a975667fd21d0d1b6
C++
alexey-roienko/Cpp-courses
/task2_1/Bicycle.cpp
UTF-8
6,056
3.0625
3
[]
no_license
// Task 2.1 - Realization of Bicycle-class which describes Bicycle entity // Created by Alexey Roienko, 2017 #include <iostream> #include <iomanip> #include "Bicycle.h" std::array<std::string, static_cast<unsigned int>(BicycleTypes::COUNT)> Bicycle::bTypesDescr{ "Road bicycles are designed for traveling at speed o...
true
5507ec4927d887bb38a8b61c962b2013103a2ea8
C++
AsamiSato9/Asami
/PR1/P_20/P_8.cpp
UTF-8
347
2.8125
3
[]
no_license
#include <iostream> using namespace std; int main() { int a,half1,half2; cin >> a; if (a>9999||a<1000) {cout << "fail" << endl;} else { half1 = a%100; half2 = (a-half1)/100; half2 = (half2%10)*10 + (half2-half2%10)/10; if (half1==half2) cout << "Yes" << endl; else cout << "No" << e...
true
db9e2e1c492e7e026efb8fa280c54c767acceda2
C++
MalcevStepan/Snake
/Snake/Delegate.h
UTF-8
196
2.96875
3
[]
no_license
#pragma once #include <functional> template <class T> class Delegate { public: Delegate(std::function<T(T)>& fn) : fn(fn) {} void invoke(T t) { fn(t); } private: std::function<T(T)> fn; };
true
b8617027b46128430112388130368c8bca800464
C++
KDSBest/service-fabric
/src/prod/src/ServiceModel/ConfigPackageSettingDescription.cpp
UTF-8
3,639
2.671875
3
[ "MIT" ]
permissive
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ #include "stdafx.h" using nam...
true
0542c52d84ebeea00e25ca612677456ece90b6da
C++
zeta0134/1gam-runner
/arm9/source/state_machine.h
UTF-8
2,968
3.265625
3
[]
no_license
#ifndef STATE_MACHINE_H_ #define STATE_MACHINE_H_ #include <functional> #include "drawable_entity.h" class Game; template<typename T> using GuardFunction = std::function<bool(T const&)>; template<typename T> using ActionFunction = std::function<void(T &)>; struct ObjectState { DrawableEntity* entity = nullptr; ...
true
64a4b919db10ee70e76b768924e4862cd00d4a4a
C++
ankitwagadre/My-Competitive-Programming-Code
/hackerrank/Art.cpp
UTF-8
693
2.609375
3
[]
no_license
#include <iostream> #include <vector> #include <algorithm> #include <cstring> using namespace std; typedef long long ll; int main() { ll t; cin >> t; while (t--) { ll n; cin >> n; ll a[n]; for(ll i = 0; i < n; i++) { cin>>a[i]; } b...
true
f0b6cde56c6b6b9a30c7eedf7f8a6d1eb717b42e
C++
SashaMazurProger/AcademyTasks
/C++ Homeworks/Solutions/17.03.26/4.cpp
UTF-8
2,492
2.96875
3
[]
no_license
#include<iostream> #include<stdio.h> #include<iomanip> #include<string.h> using namespace std; struct Auto { char Model[20]; char Kolir[20]; char Nomer[9]; }; void Print(Auto a) { cout << "\n\tModel:" << a.Model; cout << "\n\tKolir:" << a.Kolir; cout << "\n\tNomer:" << a.Nomer; } void Print(Auto a[],int size) { ...
true
c8749928412bb8ed6143445b67ecca5191ae30f2
C++
longnguyen1997/adv_comp_photography
/problem_sets/ps1/Image.h
UTF-8
5,531
3.34375
3
[]
no_license
/* ----------------------------------------------------------------- * File: Image.h * Created: 2015-08-29 * Updated: 2019-08-10 * ----------------------------------------------------------------- * * The 6.815/6.865 Image class * * ---------------------------------------------------------------*/ #ifndef _...
true
b49d8a5d4040234a1bbe7778e26e18c4a9210bb7
C++
jakobfrederikson/Homework
/QuadraticEquation_JakobFrederikson/QuadraticEquation_JakobFrederikson.cpp
UTF-8
1,156
4.125
4
[]
no_license
#include <iostream> #include <cmath> // including <cmath> for the future use of sqrt() using namespace std; // this program gathers user input to calculate a quadratic equation in C++ int main() { float a, b, c, x1, x2; // declaring variables used for quadratic equation cout << "Enter a, b , c "; ...
true
418dab63fbaa4c36f365f36fb8aa65ac53b9785a
C++
Louis5499/leetcode-practice
/636/solution.cpp
UTF-8
936
2.71875
3
[]
no_license
class Solution { public: vector<int> exclusiveTime(int n, vector<string>& logs) { stack<pair<int, int>> stk; vector<int> output(n, 0); int beingOccupied = 0; for (string &log: logs) { stringstream ss(log); string temp, temp2, temp3; getline(ss, tem...
true
65609744dbbf144236a0f18cb8b8a9d025047ae9
C++
anil-adepu/OS_lab
/2_fork/perfectno.cpp
UTF-8
662
3.0625
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <unistd.h> #include <sys/wait.h> int isPerfectNumber(int n) { int sum = 0; for(int i=1;i<=n-1;i++) { if(n%i==0) sum += i; } if(sum==n) return 1; return 0; } int main() { pid_t pid; pid = vfork(); int lowerLimit,upperLimit; if(pid>...
true
716d8db6c6731441e1ecf97c3cabb01fa0167f79
C++
Joshua-Joseph/s3cllgLAB
/c++/LAB.C.1/date.cpp
UTF-8
4,217
3.78125
4
[]
no_license
/* JOSHUA JOSEPH CSA 43*/ #include <iostream> using namespace std; class Date { private: int day, month, year, nxt_day, nxt_month, nxt_year; bool is_leap_year = false; public: void intake() { cout << "Enter the day, month and year : "; cin >> day >> mont...
true
8ba3540c2192882dcc78b8d27a99e2cf03a5e009
C++
willis7/Programming-Tutorials
/C++/Classes/Point_Class.h
UTF-8
1,718
3.796875
4
[]
no_license
#ifndef POINT_CLASS_H #define POINT_CLASS_H /* Welcome to the wonder world of classes and encapsulation. What makes C++ different (and better) is the ability to encapsulate data. When programming in C the general flow of a program is this: -- Make structures/variables, write functions to do stuff with them But in C...
true
9aa5ce18c5c87dbe56431273cb81d27a022eb569
C++
sneakfax/AlgoProgAbgabe
/src/ImageConverter.cpp
UTF-8
4,405
3.1875
3
[]
no_license
/*INFO: This class is resposible for two image-transformation operations: * rgb to grayscale and changing of the brightness. * * */ #include <cstdio> #include <iostream> #include <omp.h> #include "opencv2/opencv.hpp" class ImageConverter { private: cv::Mat image; double lastOperationTime; bool assembl...
true
e12aae9c259dcc1123804f827c61ca6d86cb14e1
C++
kaabimg/opengl-demos
/lighting/ex_fog/fogscene.cpp
UTF-8
2,254
2.6875
3
[]
no_license
#include "fogscene.h" #include "torus.h" #include <math.h> FogScene::FogScene() : CameraScene(), m_modelMatrix(), m_torus( 0 ) { m_modelMatrix.setToIdentity(); // Initialize the camera position and orientation m_camera->setPosition( QVector3D( 5.0f, 0.0f, 5.0f ) ); m_camera->setViewC...
true
4a67fc9aa36856fdcbbf8b7da7be6dae23a6cef8
C++
xianjimli/Elastos
/Elastos/Framework/Droid/eco/src/core/widget/RadioButton.cpp
UTF-8
794
2.640625
3
[]
no_license
#include "widget/RadioButton.h" RadioButton::RadioButton() {} RadioButton::RadioButton( /* [in] */ IContext* context, /* [in] */ IAttributeSet* attrs, /* [in] */ Int32 defStyle) : CompoundButton(context, attrs, defStyle) {} /** * {@inheritDoc} * <p> * If the radio button is already checked, this ...
true
01de56f64d381f8ed8254cca3662341fb4e47c76
C++
DylanDeWaele/DAudioVisualizer
/DDWChannel.h
UTF-8
315
2.515625
3
[]
no_license
#pragma once class DDWSound; class DDWChannel { public: DDWChannel(); void WriteSoundData(signed short* pData, int count); void Play(DDWSound* pSound); void Stop(); void SetVolume(float volume); bool IsFree() const; private: DDWSound* m_pCurrentSound; unsigned int m_Position; float m_Volume; };
true
76eceb40c3f5c434d2f5142d92d85210560c1edf
C++
zhaozf13/MyCppTemplete
/AddMinusMutiDivideByBit/AddMinusMutiDivideByBit.cpp
UTF-8
2,308
3.75
4
[]
no_license
// AddMinusMutiDivideByBit.cpp : // 用位运算实现加减乘除,但用户要保证给的数字不能超出范围 #include <iostream> #include <algorithm> #include <stdio.h> #include <string.h> using namespace std; //加法 int addByBit(int a, int b) { int sum = a; while (b != 0) { sum = a ^ b; //无进位相加 b = (a & b) << 1; //进位结果 a =...
true
c644fdca80e78b94306d7f315d8cc8a7a85af752
C++
jakorten/softrobotics
/Small/PumpValveTestLEDs/PumpValveTestLEDs.ino
UTF-8
1,175
2.515625
3
[]
no_license
/* RobotPatient Simulators BV Test for Breath Circuit */ #define PumpA 6 // PA20 #define PumpB 7 // PA21 #define ValveA 2 // PA14 #define ValveB 5 // PA15 // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(PumpA...
true
3649be44e36e00cd05ba32b857b9dca342ac3163
C++
kmoerman/pqvm
/tests/control-z.cpp
UTF-8
3,931
2.5625
3
[]
no_license
#include <string> #include <iostream> #include <cstdlib> #include <ctime> #include "../performance.h" #include "../quantum/quantum.h" #include "../options.h" using namespace quantum; /* * The the performance of the Z operator * options: * q number of qubits * r number of iterations (set high to overcome in...
true
1de471c6a8a7dbbbab8773bdc4b2cdf4cb604158
C++
ttune/dayz_0-45-124252
/extern/SimulWeather/Simul/Math/SimVector.h
UTF-8
14,231
2.625
3
[]
no_license
#ifndef SimVectorH #define SimVectorH #include <stdlib.h> #ifdef _CRTDBG_MAP_ALLOC #include <stdlib.h> #include "DebugNew.h" // Enable Visual Studio's memory debugging #endif #include <float.h> #if !defined(DOXYGEN) && !defined(__GNUC__) #define ALIGN16 _declspec(align(16)) #else #define ALIGN16 #endif #include ...
true
bc8a452c339e18f568aa8fd56689494f3530234f
C++
vivekpisal/450-problem-solving
/stack/ReverseStack.cpp
UTF-8
527
3.3125
3
[]
no_license
#include<bits/stdc++.h> using namespace std; void insertAtBottom(stack<int> &st,int val) { if(st.empty()) { st.push(val); return; } int top = st.top(); st.pop(); insertAtBottom(st,val); st.push(top); } void reverse(stack<int> &st) { if(st.empty()) return; int top = st.top(); st.pop(); reverse(st); i...
true
76fb6ca1d081c1f3cd653c0234c8ab02c09559fc
C++
walnutkakki/cpptut
/chap4.object/array.cpp
UTF-8
469
2.921875
3
[]
no_license
#include <iostream> using namespace std; class Sample { int a; public: Sample() { a = 100 ; cout << a << ' ' ;} Sample(int x) {a =x; cout << a << ' ';} Sample(int x, int y) { a = x*y ; cout << a << ' ';} int get(){return a;} }; int main() { // Sample arr[3]; Sample arr2D[2][2] = {{Sample(2,...
true
6e7cf3580333aa9254f5246deb945788c9949ba9
C++
gprunecode/AlgoritCabrera
/Tarea 3/src/3.cpp
UTF-8
452
3.96875
4
[]
no_license
#include <iostream> using namespace std; int main (int argc,char** argv){ int numero; cout<<"Ingrese un numero"<<endl; cin>>numero; if (numero % 2 == 0){ cout<<"El numero es multiplo de 2"<<endl; } if (numero > 12){ cout<<"El numero es mayor que 12"<<endl; } if (numero % 3 =...
true
54742a06e1dc743c873433aa332013a6750b6819
C++
NoSpooksAllowed/cpp-coursera
/cpp-white-belt/week_2/set/unique_str/main.cpp
UTF-8
323
2.875
3
[]
no_license
#include <iostream> #include <set> #include <string> using namespace std; int main() { set<string> uniqueStr; int queries; string s; cin >> queries; for (int i = 0; i < queries; i++) { cin >> s; uniqueStr.insert(s); } cout << uniqueStr.size() << endl; return 0;...
true
8e8df52930fd4bc7b8a67dcaa6f307c4531e256f
C++
lavanych22/lab4
/lab4.cpp
UTF-8
1,563
3.625
4
[]
no_license
#include<iostream> #include<math.h> #define n 5 using namespace std; class Matrix { private: int a[n][n]; int sum[n]; int i, j, k, c; long double g_m, sumg; public: void matrix_input(); void matrix_output(); void matrix_sorting(); void raw_geometric_mean_and_summation(); }; void Matri...
true
d883a10d9a250ff3ae40afbf220fd610813c60a2
C++
Mariars11/RealizadoEmClasse
/dddswitch.cpp
ISO-8859-1
623
3.140625
3
[]
no_license
//ddd com switch case #include <stdio.h> #include <locale.h> int main() { setlocale(LC_ALL, "Portuguese"); int ddd; printf("Informe o ddd: "); scanf("%d", &ddd); switch(ddd) { case 61: printf("Braslia"); break; case 71: printf("Salvador"); break; case 11: printf("So Paulo"); break; ...
true
7578cc1c30cd513feab1a2370a54a8a7defa9f57
C++
nkteaching/assignment-2-sualehalam
/Ch5.q17c recursion remove all occur [C].cpp
UTF-8
591
3.296875
3
[]
no_license
#include <string.h> #include<iostream> using namespace std; void deletechar(char *s,char c) { static int i=0,k=0; if(s[i] == NULL) // if ( !s[i] ) { return; // exit from function } else { s[i]=s[i+k]; if(s[i]==c) { k++;...
true
f1b9ace8acee1cb35c458e62426b761897a4b2fe
C++
qqonline/EasyNetFramework
/src/common/impl/ArrayObjectPool.cpp
UTF-8
1,125
2.71875
3
[]
no_license
/* * ArrayObjectPool.cpp * * Created on: Apr 18, 2013 * Author: LiuYongJin */ #include <assert.h> #include <stddef.h> #include <stdlib.h> #include "ArrayObjectPool.h" namespace easynet { ArrayObjectPool::ArrayObjectPool(uint32_t elem_size, uint32_t elem_num) { m_ElemNum = elem_num; if(elem_size < sizeof...
true
4960a734d3df5ecfe674f7e65afad43fc830e8b8
C++
saurishphatak/Data-Structures
/CPP/Linked Lists/GenericSentinelLinkedList.cpp
UTF-8
4,845
4.25
4
[ "MIT" ]
permissive
/* * -------------------------------------------------------------------------------- * File : GenericSentinelLinkedList.cpp * Project : CPP * Author : Saurish Phatak * * * Description : Generic Sentinel Linked List * ------------------------------------------------------------------------...
true
b7f1f67cc984f0d7fbeb3e7cbbe442b4b550bfbe
C++
SamuelXing/Algorithm
/cpp_solutions/sequence/36_Valid_SudoKu.cpp
UTF-8
1,399
3.515625
4
[]
no_license
/* Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled with the character '.'. */ class Solution { public: bool isValidSudoku(vector<vector<char>>& board) { bool used[9]; for(int i=0; i<9; i++ ) ...
true
31cd4e26bc4f2dd6e197c84cdfa7bd67f95010eb
C++
jjjpolo/Pi-Pico-Demo-Blinking-Led-Using-Modern-Cpp
/Led.h
UTF-8
280
2.8125
3
[]
no_license
#pragma once class Led { private: const uint ledPin = 0; int state = 0; public: //Constructor Led(const uint, int); //Change LED state (no parameter needed) void toggle(); //A demo animation for the LED void demoQuickBlinking(); //Destructor ~Led(); };
true
8acaabe6f914befa1a3f779283d02d907b3f40ad
C++
mjww3/algorithms
/nsteps.cpp
UTF-8
488
2.8125
3
[]
no_license
///n steps problem #include <stdio.h> #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int N; cin>>N; long int x,y; while(N--) { cin>>x>>y; if(x==y) { if(x%2==0 && y%2==0) { cout<<2*x<<endl; } else { cout<<2*x-1<<endl; } } else if(x-y...
true
9712bab54f6a4063083f556bbbe7db3baced1460
C++
kuonanhong/UVa-2
/10452 - Marcus.cpp
UTF-8
930
2.53125
3
[]
no_license
/** UVa 10452 - Marcus by Rico Tiongson Submitted: July 13, 2013 Accepted 0.019s C++ O(?) time */ #include<iostream> #include<cstdio> using namespace std; const char* dir[] = {"forth", "right", "left"}; char I[] = "AVOHEI@"; char grid[10][10]; int t, m, n, i, dx[] = {1,0,0}, dy[] = {0,-1,1}; bool inR...
true
b71259a9fb685f6f647468a66abc70a84358cf7c
C++
McBrez/ESIF_Task2
/Subtask1/ESIFTask2_1.sdk/ESIF2_1_App/src/main.cc
UTF-8
1,686
3.140625
3
[]
no_license
#include<xparameters.h> #include<xgpio.h> #include<xil_printf.h> #define GPIO_CHANNEL 1 #define GPIO_DD_BITMASK 0b111 #define GPIO_BITMASK 0b111 void bin2grey(unsigned int val, char* retVal, unsigned int bitWidth) { unsigned int greyVal; switch(val) { case 0: greyVal = 0; break; case 1: greyVal = 1; ...
true
07e65aeab5dc1c704a309fd02f459a8991807559
C++
WuyangPeng/Engine
/Engine/Code/Mathematics/Objects2D/Box2.h
GB18030
2,500
2.671875
3
[ "BSD-3-Clause" ]
permissive
/// Copyright (c) 2010-2023 /// Threading Core Render Engine /// /// ߣʶ /// ϵߣ94458936@qq.com /// /// ׼std:c++20 /// 汾0.9.0.11 (2023/06/08 15:11) #ifndef MATHEMATICS_OBJECTS_2D_BOX2_H #define MATHEMATICS_OBJECTS_2D_BOX2_H #include "Mathematics/MathematicsDll.h" #include "CoreTools/Helper/Export/PerformanceUnsharedEx...
true
58cf52b9e566f815f4b4c35147da34f16bad6521
C++
vldmalov/ShootingGallery
/src/Scene/Scene.cpp
UTF-8
6,534
2.6875
3
[]
no_license
#include "Scene.h" #include "Utils/Random.hpp" #include "Objects/CircleTarget.h" #include "Objects/Projectile.h" #include "Objects/CannonObject.h" #include "Preferences.h" namespace Scene { Scene::Scene() : _cannon(nullptr) , _isGameActive(false) , _isPause(false) , _timeToEnd(0.f) , _onLevelCompleteCallback(nullptr...
true
1faa6f84619d557662619ce876a08fcc9b160197
C++
enatalie122/cpsc350-fall2020-assignment3
/file.h
UTF-8
1,902
3.40625
3
[]
no_license
/* Natalie Ewing 2313895 ewing@chapman.edu CPSC 350-01 Assignment 3 file.h is the header file for the File class. */ #ifndef FILE_H #define FILE_H #include <fstream> #include <string> #include <iostream> #include "gen_stack.h" using namespace std; //The File class reads and collects data from...
true
8a65e0f9d3a9e6ddd17d66cb3956cc956cdcfbe0
C++
yrrSelena/Computer-BasicKnowledge
/剑指offer/15反转链表.cpp
UTF-8
1,082
3.859375
4
[]
no_license
/* 考点:链表 题目: 输入一个链表,反转链表后,输出新链表的表头。 思路: 定义前、中、后三个指针p1,p2,p3,p3用于指向原链表的下一个节点,每次都修改p2的next指针,使其指向前面一个节点p1,直至p3指向空(遍历完链表中的所有节点) 此时p2作为新链表的表头指针,最后将原链表的头节点的next指向NULL 注意考虑链表为空以及链表中只有一个节点的情况。 */ /* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: ...
true
dc63a5287917fd12b899892817f419dcddf594a0
C++
chrisoldwood/FarmMonitor
/Logon.hpp
UTF-8
1,650
3.140625
3
[ "MIT" ]
permissive
//////////////////////////////////////////////////////////////////////////////// //! \file Logon.hpp //! \brief The Logon class declaration. //! \author Chris Oldwood // Check for previous inclusion #ifndef APP_LOGON_HPP #define APP_LOGON_HPP #if _MSC_VER > 1000 #pragma once #endif #include <Core/SharedPtr.hpp> ...
true
17d4c4b96abea42150551db7c8f23cd19aac11b2
C++
Alexander1000/image
/filters/zonefilter.cpp
UTF-8
24,278
2.78125
3
[]
no_license
using namespace std; class ZoneFilter : public Filter { public: ZoneFilter() : Filter() { // do something ... } ZoneFilter(int* bitMap, int width, int height) : Filter(bitMap, width, height) { // do something ... } int* filterSmooth() { ...
true
740d109c525798a5f76d589e69eff2f2b1b79327
C++
GaoLF/LeetCode_THD
/13.Roman to Integer.cpp
UTF-8
1,075
3.453125
3
[]
no_license
#include<iostream> #include<algorithm> #include<string> #include<unordered_set> #include<unordered_map> using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution { public: int romanToInt(string s) { vector<int> vec; int res ...
true
0888df5be6014f20cf1ff65477d4042339610047
C++
Aaronlanni/DataStruct
/冒泡排序/bubblesort1.hpp
UTF-8
424
3.90625
4
[]
no_license
void BubbleSort(int *array, int size) { assert(array || size < 0); int i = 0; int j = 0; for (; i < size - 1; ++i) { bool flag = false; for (j = 0; j < size - i - 1; ++j) { if (array[j] > array[j + 1]) { flag = true; swa...
true
fc75eef96ac2ba7d19487bff2b3b787fb43a9c77
C++
viskey98/uva-solution
/CH03/11057.cpp
UTF-8
1,157
2.890625
3
[]
no_license
#include<iostream> #include<vector> #include<algorithm> #include<cmath> #define FOR(i,n) for(i=0;i<n;i++) int N; using namespace std; vector <long int> books; int binarysearch(int start, int end, long int J) { if(start>end)return 0; int mid=(start+end)/2; if(books[mid]==J) return 1; else if(J>books[...
true
a9cf6a7f8ab14e6b74dfb970b8f010b8e4cbef51
C++
uvsq-versailles/Licence3_Informatique
/Semestre_5/IN505/PROJET/fractales/app/src/enregistreurFractale.cc
UTF-8
2,612
3.3125
3
[ "MIT" ]
permissive
/** * \file enregistreurFractale.cc * \author {Clement Caumes Doudouh Yassin} * \date 9 janvier 2018 * \brief contient la definition des methodes de EnregistreurFractale */ #include "../head/enregistreurFractale.hh" #include "../head/types.hh" using namespace Cairo; /** * \fn EnregistreurFractale::Enregistreur...
true
8e244b06800023465fb7fb6a9ec2ad6e449f62ab
C++
Ostrichisme/LeetCode
/202. Happy Number.cpp
BIG5
360
3.15625
3
[]
no_license
class Solution { public: bool isHappy(int n) { int temp; //ɤOѡAu17~|Otrue while(n>=10){ int temp=n; n=0; for(auto c:to_string(temp)) n+=(c-48)*(c-48); } if(n==1||n==7) return true; else return...
true
3f39ef8b46265ebd039650ca7013c597a8767b53
C++
wintel2014/LinuxProgram
/CPU/cache/strip-mined_2.cpp
UTF-8
1,590
2.859375
3
[]
no_license
#include <vector> #include <stdio.h> #include "../../Utils/readTsc.hpp" #include "../../Utils/affinity.hpp" // // cat /sys/devices/system/cpu/cpu0/cache/index*/size // 32K // 32K // 256K // 9216K // long __attribute__((noinline)) Add(const int*pData, const size_t count) { long ret = 0; for(unsigned i=0; i...
true
b0c86cafc92bf2974f68bc928d4f7b7c20826053
C++
avaxman/scisim
/scisim/ConstrainedMaps/IpoptUtilities.cpp
UTF-8
3,989
2.625
3
[ "Apache-2.0" ]
permissive
// IpoptUtilities.cpp // // Breannan Smith // Last updated: 09/03/2015 #include "IpoptUtilities.h" #include <string> bool IpoptUtilities::linearSolverSupported( const std::string& linear_solver_name ) { if( linear_solver_name != "ma27" && linear_solver_name != "ma57" && linear_solver_name != "mumps" && linear_solv...
true
ff5bbbc37339de54aa1d72b0b0f9b5d0207da3c4
C++
Luisill0/Activity-Selection
/src/ActivitySelector.hpp
UTF-8
543
2.875
3
[]
no_license
#include <iostream> using namespace std; void recursiveActivitySelector(int* s,int* f, int k, int n,int *res,int iRes){ int m; m = k + 1; while(m <= n && s[m] < f[k]){ m++; } if(m <= n){ iRes++; res[iRes] = m; recursiveActivitySelector(s,f,k,n,res,iRes); }else{ return; } } int* greedyActivitySel...
true
3504ffcf374d60452f5d9218eca693aaf1a921a0
C++
xuechensh/demo
/pipe.cpp
UTF-8
639
2.734375
3
[]
no_license
#include <stdio.h> #include <unistd.h> #include <errno.h> #include <string.h> using namespace std; #define MAX_MSG_SIZE 1024 int main(int argc, char** argv){ pid_t pid = -1; int pipefd[2] = {0}; if(0 != pipe(pipefd)){ printf("create pipe error\n"); return 0; } pid = fork(); if( pid < 0){ printf("cal...
true
761667ea8b84d05ff4b7b52bf863d48719c91cf6
C++
totticarter/myleetcode
/RemoveDuplicatesFromSortedList2.cc
UTF-8
831
3.453125
3
[]
no_license
#include"leetcode.h" ListNode* deleteDuplicates(ListNode* head){ ListNode* oneNode = head; ListNode dummy(-1); ListNode *newList = &dummy; int lastValue = head->val; while(oneNode != NULL){ if(oneNode->val == lastValue && oneNode != head){ oneNode = oneNode->next; }else{ ListNode *newNode = new List...
true
8ec379322a3320b3b88dffa7fae06fb3716aa68f
C++
Jungzhang/cPlusPlus
/10_42.cpp
UTF-8
683
2.8125
3
[]
no_license
/************************************************************************* > File Name: 10_42.cpp > Author: Jung > Mail: jungzhang@xiyoulinux.org or zhanggen.jung@gmail.com > Created Time: 2016年02月21日 星期日 17时40分21秒 > Description: ************************************************************************/ #include...
true
5fefa7d56458cc3ceb63809c5b9010c0420e832a
C++
usi-systems/railwaydb
/code/libcommon/include/intergdb/common/QueryWorkload.h
UTF-8
2,097
2.53125
3
[]
no_license
#pragma once #include <intergdb/common/Attribute.h> #include <intergdb/common/QuerySummary.h> #include <intergdb/common/Query.h> #include <vector> #include <unordered_map> namespace intergdb { namespace common { class QueryWorkload { public: QueryWorkload() {} QueryWorkload(std::...
true
1412bb3add70d4c32ea0963bfb8c4596b34292e4
C++
bullfrognz/Pool
/Project/Source/LogManager.cpp
UTF-8
2,211
2.6875
3
[]
no_license
// // Diploma of Interactive Gaming // Game Development Faculty // Media Design School // Auckland // New Zealand // // (c) 2011 Media Design School // // File Name : "-----" // Description : Template for implementation (source) files // Author : Bryce Booth // Mail : bryce.booth@mediade...
true
bddc9e0fa49fed31bd7201c2fd36f1a7503fd6e6
C++
josezm/cpp-exercises
/multiplo mas pequeno.cpp
UTF-8
333
2.796875
3
[]
no_license
#include <iostream> using namespace std; int main() { int x=2520,i=1,contador=0,res=0; bool z=true, y=true; while (z){ if (contador==20){ z=false; res=x;} if (contador<20) contador = 0; x++; for(i=1;i<21;i++){ if (x%i==0) contador++; } } cout << "el menor es: " <<res; ...
true
985660a6338c37c4518724549a4af86a0b182518
C++
wiwitrifai/competitive-programming
/codeforces/453/b.cpp
UTF-8
1,946
2.65625
3
[]
no_license
#include <bits/stdc++.h> using namespace std; typedef vector<double> polinom; polinom mult(polinom a, polinom b) { polinom res(a.size() + b.size() - 1); for (int i = 0; i < a.size(); ++i) for (int j = 0; j < b.size(); ++j) { res[i+j] += a[i] * b[j]; } return res; } polinom add(polinom a, polinom ...
true
4d8cb01306604d756a96b1fed40a000c6349b520
C++
sellersgrant/AdventOfCode2018
/src/Day07/sellersgrant.cpp
UTF-8
9,767
3
3
[]
no_license
#include <iostream> #include <fstream> #include <vector> #include <algorithm> #include <string> #define BOUNDS 26 #define OFFSET 61 #define WORKERS 5 int convertChar(char a) { return (int)(a) - 65; } char convertInt(int a) { return (char)(a + 65); } void extend(std::vector<int>* buffer, std::vector<int> to_...
true
0828e94e61f2f2ce533ebbd69f6634bc7edd5562
C++
hbchen121/SimpleCNN_Release
/SimpleCNN/SdlfFunction.cpp
GB18030
7,113
2.765625
3
[]
no_license
/*********************************************** * File: SdlfFunction.cpp * * Author: CHB * Date: 2020-04-18 * * Purpose:峣ú * * **********************************************/ #include <math.h> #include <algorithm> #include "SdlfFunction.h" #include "KernelCPU.h" #include "Common.h" float SdlfFunction::MaxInP...
true
881ad153583e11db26daafc83373064197a517e6
C++
viswaf1/MultiModelFitting
/MultiRansac.cpp
UTF-8
3,563
2.609375
3
[]
no_license
/* * MultiRansac.cpp * * Created on: Apr 1, 2016 * Author: teja */ #include "MultiRansac.h" namespace std { bool CSElmCompare(CSElement el1, CSElement el2) { return(el1.inliers.size() < el2.inliers.size()); } MultiRansac::MultiRansac(vector<vec2f> inpts, int initerNum, float inthDist, float ininlrRatio)...
true
48f74410b044fd7729ea6b8dfb464388aaf1a57b
C++
baixigxn/2021_first
/基础巩固/C_43/main.cpp
GB18030
1,255
4.25
4
[]
no_license
#include<stdio.h> #include<stdlib.h> /* Ŀһ Ǵʱʹͷ巨˳ģǿڸĻϽ */ typedef struct Node{ int data; struct Node* next; }Node,*LinkList; //ͷβ巨 LinkList creste(int n){ LinkList head=(Node*)malloc(sizeof(Node)); Node *p=head; Node *q; int i; printf("Ԫֵ\n"); for (i = 0; i < n; i++) { q=(Node*)malloc(sizeof(Node)); scan...
true
fe997b52cba0cdf7f6b57c6d63d8622c56830948
C++
bwhitely/DungeonBuilder
/Core/Dungeon/Common/blockeddoorway.cpp
UTF-8
1,379
3.046875
3
[]
no_license
#include "blockeddoorway.h" #include <iostream> namespace core::dungeon::common { BlockedDoorWay::BlockedDoorWay(Direction direction): Doorway{direction} { _direction = direction; } /** * @brief BlockedDoorWay::~BlockedDoorWay * Sets _opposite doorway to nullptr */ BlockedDoorWay::~BlockedDoorWay() { // ...
true
bf47937364e61bd68fdf4844501abe16283559d5
C++
michalsvagerka/competitive
/arch/a2oj/mix/CColoradoPotatoBeetle.cpp
UTF-8
2,847
2.515625
3
[]
no_license
#include "../l/lib.h" // #include "../l/mod.h" class CColoradoPotatoBeetle { public: vector<int> RG, CG; vector<vector<int>> S; void dfs(int x, int y) { if (x >= 0 && x < RG.size() && y >= 0 && y < CG.size() && !S[x][y]) { S[x][y] = 2; dfs(x+1, y); dfs(x-1, y); ...
true
024f9a46896523204a734326e403fbb7ccf4bb2d
C++
midnitekoder/Latte
/src/activation_function.cpp
UTF-8
801
2.921875
3
[ "Apache-2.0" ]
permissive
#include<stdio.h> #include<math.h> #include "util.h" float maxfloat(float num1, float num2) { if (num1 > num2) return num1; else return num2; } float activation(activation_type type_of_activation, float val, float negative_slope) { double positive_exp, negative_exp; switch (type_of_activati...
true
712cb2e2a00b37d7135800237655331e642342a6
C++
astrellon/GPP
/GPP/lab02/lab02/main.cpp
UTF-8
334
2.859375
3
[]
no_license
/*#include "Vector3.hpp" #include <Windows.h> #include <iostream> using namespace std; void disp(Vector3 &vec) { cout << vec.m_fX << ", " << vec.m_fY << ", " << vec.m_fZ << endl; } int main() { Vector3 vec1(1, 2, 3); Vector3 vec2(2, 4, 6); Vector3 vec3(1, 1, 1); vec3 = -vec1; disp(vec3); system("PAUSE"); ...
true
ca88e6749eac476e376f0a8edb9129a0a86d541a
C++
tomotomek/Cpp
/09_cvicenie.h
UTF-8
6,646
2.71875
3
[]
no_license
#include <iostream> #include <sstream> #include <iomanip> using namespace std; //#include "riesenie9.h" //Toto je vlozeny hlavickovy subor riesenie9.h #if !defined( _RIESENIE_H_ ) #define _RIESENIE_H_ class Vynimka {}; class ZlyVstup : public Vynimka { string text; public: ZlyVstup(const char *v) { text = v; }; s...
true
8d0e2f033f03355d9f59d5f740f87cf860fec834
C++
jstraveler/C-C.plus.plus
/DT Bayes-Laplace criterion/main.cpp
UTF-8
3,412
3.5625
4
[]
no_license
#include <iostream> #include <iomanip> using namespace std; /** Задача планирования на год * Определить оптимальный объем заказа автомобилей в условиях неравномерного спроса. */ void init_matrix_first_year(int *matrix, int size); void init_probability_matrix(double *probability_matrix, int const *init_matrix, doub...
true
936f04d388ff51911ee385226c2399721b928e98
C++
LaylaHirsh/Victor
/tools/GetArg.h
UTF-8
4,493
3.21875
3
[]
no_license
/** * @Author: Ulrike Hoefer, updated by Silvio Tosatto * @Name of the method: getArg(s) * @Description: * - interprets the inputs of the command line, assigne a * variable a command line input, possibly set default value, * - check, if an option is chosen, if stop=true, the program will * end, if the option is ch...
true
bd3d5cb7d2dfa3ad05757058f2ca6a6ecefa124a
C++
YogeshSingla/compiler_design
/10042018/p7.cpp
UTF-8
1,502
3.671875
4
[]
no_license
// C++ program to find out execution time of // of functions #include <algorithm> #include <chrono> #include <iostream> using namespace std; using namespace std::chrono; //measure time of this function void myfunction(){ int x = 0; int y = 10; int z = 20; long n = 50000; //50 thousand elements in array in...
true
54f6bd4145030ee42597e7e877aa9cc9f7ba7ad4
C++
gsotirchos/ball-chaser-bot
/ball_chaser/src/drive_bot.cpp
UTF-8
2,200
3.109375
3
[ "MIT" ]
permissive
#include "ros/ros.h" #include "geometry_msgs/Twist.h" #include "ball_chaser/DriveToTarget.h" // Single class containing ROS entities and relevant state variables, inspired by Martin Peris' answer: // https://answers.ros.org/question/59725/publishing-to-a-topic-via-subscriber-callback-function/?answer=59738#post-id-59...
true
ae25a584ef5d29a99ff9f0f1a3f563e158339803
C++
jeffreymutethia/Data-Structures-C-
/Sorted Sequence/sorted_seq.h
UTF-8
1,165
3.453125
3
[]
no_license
/****************** * Header file for a Sorted Sequence class sorted_seq. * * * */ #ifndef SORTED_SEQ_H #define SORTED_SEQ_H #include <iostream> #include <cstdlib> #include "node.h" #include "const_node_iterator.h" template <class Item> class sorted_seq { public: // Default constructor sort...
true
34a65f948489e9aefd6f35277b5d419428bbb92c
C++
DreadArceus/LeetCode
/Explore Cards/JulyLC2020/J28-Task_Scheduler.cpp
UTF-8
2,396
3.09375
3
[]
no_license
//Not sorting all the time causes WA because the answer isnt min //Sorting all the time causes TLE //Came up with a less time consuming case specific sort, accepted. #include <iostream> #include <fstream> #include <vector> #include <unordered_set> #include <algorithm> using namespace std; bool key(vector<int> a, vector...
true