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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
38bbdce5525d41db1619f671ac083e6b4f4157ed | C++ | arangodb/arangodb | /3rdParty/boost/1.78.0/libs/filesystem/example/mbcopy.cpp | UTF-8 | 2,661 | 2.828125 | 3 | [
"BSL-1.0",
"Apache-2.0",
"BSD-3-Clause",
"ICU",
"Zlib",
"GPL-1.0-or-later",
"OpenSSL",
"ISC",
"LicenseRef-scancode-gutenberg-2020",
"MIT",
"GPL-2.0-only",
"CC0-1.0",
"LicenseRef-scancode-autoconf-simple-exception",
"LicenseRef-scancode-pcre",
"Bison-exception-2.2",
"LicenseRef-scancode... | permissive | // Boost.Filesystem mbcopy.cpp ---------------------------------------------//
// Copyright Beman Dawes 2005
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Copy the f... | true |
1ea966e6508ff76be9d8c2b544b6c52ea53dee56 | C++ | penny12/my_hobby | /programming/c++/c++08/testFile1.cpp | UTF-8 | 486 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
fstream file;
// file.open("test.txt", ios::out);
// file << "aasdf" << endl;
// file.close();
file.open("test.txt", ios::in | ios::out);
string str;
// getline(file, str);
// cout << str <... | true |
8ec45acfd3831a7b3c55a83e9986d51c352d2ebc | C++ | Miao4382/Starting-Out-with-Cplusplus | /Chapter 2/Programming Challenges/13.cpp | UTF-8 | 316 | 3.5 | 4 | [] | no_license | // Programming Challenges 13: Circuit Board Price
#include <iostream>
using namespace std;
int main()
{
double cost = 14.95, profit_rate = 0.35, profit, sale_price;
profit = cost*profit_rate;
sale_price = cost + profit;
cout << "The retail price for the circuit board is: " << sale_price << endl;
return 0;
} | true |
3f820ad4ce2d5ea6568e1a00912b1f1cb1b65393 | C++ | AndreDF98/16-Jogos-em-cpp | /16Jogos/CarRacing.h | UTF-8 | 660 | 2.609375 | 3 | [] | no_license | #pragma once
#include "Game.h"
class CarRacing : public Game
{
public:
void init() override;
void handleEvents() override;
void update() override;
void render() override;
void clean() override;
virtual bool running()
{
return isRunning;
}
static SDL_Renderer* renderer;
static SDL_Event event;
privat... | true |
e6c8b07d0d7f731947462a219beca90e589f3333 | C++ | CaiCui/C-language-probloem | /hdu1720.cpp | UTF-8 | 341 | 2.59375 | 3 | [] | no_license | //hdu1720
//%X大写16进制输出 %x小写16进制输出 %p读入16进制数 %p还用于打印指针地址
#include<cstdio>
#include<cstdlib>
#include<cmath>
using namespace std;
int main()
{
int a,b;
while(scanf("%p%p",&a,&b)!=EOF)//scanf("%x%x",&a,&b)==2
{
printf("%d\n",a+b);
}
return 0;
}
| true |
62bb1403bcd5fb8458185fcbc65cd114fcf561a9 | C++ | LukacsBotond/sincronize-clocks | /src/common/EnValues.cpp | UTF-8 | 3,924 | 3.015625 | 3 | [] | no_license | #include "EnValues.h"
#include <iostream>
#include <algorithm>
using namespace std;
string EnValues::getString(string value){
string ret1=IntToString(value.size()+1)+'s';
return ret1+value;
}
string EnValues::getString(int value){
string ret2 = to_string(value);
string ret1=IntToString(ret2.size()+1... | true |
a3989686b5c2f742504a94569add6517b84b374a | C++ | krstoilo/SoftUni-Fundamentals | /CPP-Fundamentals/Associative-containers/largest3.cpp | UTF-8 | 613 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <set>
#include <sstream>
#include <string>
using namespace std;
int main()
{
string inputLine;
getline(cin, inputLine);
set<double> setOfNum;
double num;
istringstream ssLine(inputLine);
while (ssLine >> num) {
setOfNum.insert(num);
}
if (setOfNum.... | true |
73cac4d497c1185750427e7284407d0de5b39ad3 | C++ | Eduardopinatec/EstructuraDeDatosTec | /ExamenParcial2/AlgoritmosDeBusqueda.cpp | UTF-8 | 1,203 | 3.484375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int busquedaSecuencial(int *a, int buscado, int size){
for(int i=0; i<size; i++){
if(a[i]==buscado){
return i;
}
}
return -1;
}
int busquedaOrdenada1(int *a, int buscado, int size){
if (buscado>a[size-1]){
return -1;
}
for(int i=0; i<size; i++)... | true |
a9d9e8a208d0cd25083a6fecc0b6761231d531b3 | C++ | Anguei/OI-Codes | /LuoguCodes/CF47A.cpp | UTF-8 | 249 | 3.15625 | 3 | [
"MIT"
] | permissive | //【CF47A】Triangular numbers - 洛谷 - Wa
#include <iostream>
int main() {
int n;
std::cin >> n;
for (int i = 1; i <= n; ++i)
if (i * i + i == 2 * n) {
std::cout << "YES" << std::endl;
return 0;
}
std::cout << "NO" << std::endl;
} | true |
0ceceae48dfbe43084e5d52137d29c2274401a73 | C++ | NickinAction/Durak | /toast.cpp | UTF-8 | 1,335 | 2.578125 | 3 | [] | no_license | #include "toast.h"
#include <ctime>
#include <cstdlib>
#include <vector>
#include <QMessageBox>
#include <QLabel>
#include <QDebug>
#include <QString>
#include <QShortcut>
#include <QThread>
#include <thread>
#include <QKeySequence>
#include <QToolTip>
#include <unistd.h>
#include <stdio.h>
#include <QHBoxLayout>
Toas... | true |
ed0b4825f83777a292abd489fb5cef8f9b3212e8 | C++ | CIA66/Competitive-Programming | /UVA/534/19984300_AC_560ms_0kB.cpp | UTF-8 | 1,654 | 2.96875 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
#define MAXN 100000
int Parent[MAXN + 10];
void makeSet(int n){
for(int i=0; i<=n; i++){
Parent[i] = i;
}
}
int findParent(int x){
if(Parent[x] == x) return x;
return Parent[x] = findParent(Parent[x]);
}
void merge(int a, int b){
Parent[findParent(a)] = findParent(b);
}
i... | true |
7539b81d2c68569138716ce20c4b6afdc1d593b1 | C++ | shenhuashan/ImuDAQ-ImuDataProcesser | /ImuDataProcesser_ChangeSeries/imudata.cpp | UTF-8 | 6,919 | 2.734375 | 3 | [] | no_license | #include "imudata.h"
ImuData::ImuData()
{
}
bool ImuData::AppendTimeVector(int time){
this->time.push_back(time);
return true;
}
bool ImuData::AppendLegSignal(LegType legtype,LegPositionType legpositiontype,SignalType signaltype,double signal)
{
switch (legtype) {
case RT:
switch(legpositiontyp... | true |
df58a8a1799caf40c5b4ebb8cad275c17a930a84 | C++ | switchpiggy/Competitive_Programming | /CodeForces/1200 - 1400/dualPalindromes.cpp | UTF-8 | 940 | 2.875 | 3 | [] | no_license | /*
ID: alanxia1
PROG: dualpal
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
using namespace std;
inline char to_char(int c){
if(c >= 10)
return c - 10 + 'A';
return c + '0';
}
string tobase(int num, int base){
string ret;
int div = base;
while(div < num)
div *= ... | true |
2c2acf2c01123bbc709b15c98cbe7296d96006bf | C++ | akash-mankar/RayTracer | /ray/src/KDTreeNode.h | UTF-8 | 906 | 2.609375 | 3 | [] | no_license | #ifndef _KDTREE_NODE_H_
#define _KDTREE_NODE_H_
#include "vecmath/vec.h"
#include "scene/scene.h"
#include "scene/ray.h"
#include "scene/bbox.h"
#include <vector>
#include <iostream>
using namespace std;
class KDTreeNode {
public:
bool isLeaf();
vector <Geometry*> getChildren();
void setMyself(BoundingBox... | true |
93909b8930d19e9696bd87df4a5040afa506971a | C++ | b-chae/AlgorithmStudy | /baekjoon/DP/2624.cpp | UTF-8 | 620 | 2.796875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int A[100][2];
long long D[100][10001];
int main()
{
int T, N;
cin >> T >> N;
for(int i=0;i<N;i++){
cin >> A[i][0] >> A[i][1];
}
for(int k=0; k<=A[0][1]; k++){
if(A[0][0]*k > T) break;
D[0][A[0][0]*k] = 1;
}
for(int i=1;i... | true |
ddaefc32ce2b3ef5461fd3e206bb1865cc4fa833 | C++ | xantnef/gochan | /gochanQ.h | UTF-8 | 2,521 | 3.171875 | 3 | [] | no_license | #include <queue>
#include <condition_variable>
#include <mutex>
////////////////////////////////////////////////////////////////////////////////////////////////////
template <class T>
class gochanQ : public gochan<T> {
std::queue<T> elems;
std::queue<std::condition_variable*> writers;
std::queue<std::cond... | true |
4b7704d7f60eb158500d97eb27f0563e27cefc92 | C++ | reantoansorih/tugas2metnum | /Untitled2.cpp | UTF-8 | 2,179 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <conio.h>
#include <math.h>
#define nMax 100
int main(){
//kamus
int x[nMax+1];
int y[nMax+1];
int x2[nMax+1];
int y2[nMax+1];
int xy[nMax+1];
int n,i,elemen;
int sigma_x=0,sigma_y=0,sigma_x2=0,sigma_y2=0,sigma_xy=0;
float selisih[nMax+1];
float m=... | true |
fc9838bac87a1601fa1db0136c3756253c462ff0 | C++ | FANGYuan827/Leetcode | /leetcode/demo11_maximum-subarray.cpp | UTF-8 | 1,196 | 3.671875 | 4 | [] | no_license | /*
2018年4月24日20:19:44
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array[−2,1,−3,4,−1,2,1,−5,4],
the contiguous subarray[4,−1,2,1]has the largest sum =6.
click to show more practice.
More practice:
If you have figured out the O(n) so... | true |
671408ccf142d6850538214b5ef6ffaff5d9ec59 | C++ | AntonFender/repo | /Scrypts/DAVNEYShIE_SKRIPTY/Vnedrennye/easyegais2/Iskhodnik Eshchenko/src/extractrests.cpp | UTF-8 | 2,528 | 2.5625 | 3 | [] | no_license | #include <string>
#include <fstream>
#include <iostream>
#include <vector>
using namespace std;
struct rest
{
string quantity;
string informbregid;
string alccode;
string productvcode;
};
vector<string> lines;
vector<rest> rests;
vector<string> beercodes;
bool isBeer(string _code)
{
for (int i =... | true |
e0616b289a7cf1bfca14285376a792fc9a050a3f | C++ | mikekenndy/ESE_224 | /Project/game_board.cpp | UTF-8 | 2,080 | 3.6875 | 4 | [] | no_license | // Mike Kennedy
// ESE 224 - Hangman project
// Game Board: Class responsible for providing user with game interface
#include "game_board.h"
#include "basicFunctions.h"
using namespace std;
// Default constructor
game_board::game_board()
{
this->phrase = "";
}
game_board::game_board(string phrase)
{
this->phras... | true |
d8c70f9e074e013a4b1a7ced2a4b515cb018ca37 | C++ | jjchromik/hilti-104-total | /hilti/variable.h | UTF-8 | 2,822 | 2.84375 | 3 | [
"BSD-2-Clause"
] | permissive |
#ifndef HILTI_VARIABLE_H
#define HILTI_VARIABLE_H
#include <ast/variable.h>
#include "common.h"
namespace hilti {
/// Base class for AST variable nodes.
class Variable : public ast::Variable<AstInfo>, public NodeWithAttributes {
AST_RTTI
public:
/// Constructor.
///
/// id: The name of the variable... | true |
c8be7cab4314e01146a7d53096746986b14df2cb | C++ | zrax/string_theory | /include/st_utf_conv_priv.h | UTF-8 | 23,756 | 2.578125 | 3 | [
"MIT"
] | permissive | /* Copyright (c) 2019 Michael Hansen
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, modify, merge, publ... | true |
82752ccb07d7209bbc1d3ba9fcfd14eb4b1848e6 | C++ | ETalienwx/ETGitHub | /SmartPtr/SmartPtr.cpp | GB18030 | 8,696 | 3.59375 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <thread>
#include <mutex>
using namespace std;
////ָԭ
//template<class T>
//class SmartPtr
//{
//public:
// SmartPtr(T* ptr)
// :_ptr(ptr)
// {}
// ~SmartPtr()
// {
// cout <<"delete:"<< _ptr << endl;
// delete _ptr;
// }
//private:
// T* _ptr;
//};
//
////void Func()
/... | true |
4b79b23f75bdebe74361094776789ab26902fa89 | C++ | moevm/oop | /7383/Vlasov_Roman/lab1/array.h | UTF-8 | 1,759 | 3.796875 | 4 | [] | no_license | #include <assert.h>
#include <iostream>
#include <algorithm> // std::copy
#include <cstddef> // size_t
template<typename T>
class Array
{
public:
// (default) constructor
Array(const size_t size = 0)
: m_size(size)
, m_array(m_size ? new T[m_size]() : nullptr)
{
}
Array(const Array &a) //copy constr... | true |
a725bd1deba76314a2b5754c19b45e618e328e84 | C++ | MicrosoftDocs/visualstudio-docs | /docs/snippets/cpp/VS_Snippets_Winforms/InstanceDescriptorSample/CPP/instancedescriptor.cpp | UTF-8 | 4,115 | 3.28125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive |
//<snippet1>
#using <system.dll>
#using <system.drawing.dll>
using namespace System;
using namespace System::ComponentModel;
using namespace System::ComponentModel::Design::Serialization;
using namespace System::Drawing;
using namespace System::Globalization;
using namespace System::Collections;
using namespace Syst... | true |
cf5e6eb7578147ad1acfe775acbc8f5565851b3b | C++ | ishine/docker-volume | /light-nn/src/operators/conv2d.cc | GB18030 | 12,790 | 2.90625 | 3 | [] | no_license | //ͷļ
#include "operators/conv2d.h"
#include "utils/math-functions.h"
namespace lnn {
//float * convert_x(const float *A, float *A_convert, const int outM, const int in_channels, int Map, int Kernel)
//{//ת ݲkernel_sizeСת
// //屻
// const int convAw = Kernel * Kernel * in_channels;
// const int convAh = outM * ou... | true |
65d4ccc9fd14bbf792e19dc6947da3f1ad98b201 | C++ | jollywing/dungeon-generator | /mapstyle.cpp | UTF-8 | 3,980 | 2.765625 | 3 | [] | no_license | #include <stdlib.h>
#include "graphic.h"
static MapStyle map_styles[MAP_STYLE_COUNT];
void InitMapStyles() {
// 武当山
map_styles[0].width = 60;
map_styles[0].height = 45;
map_styles[0].blank_tile1 = 20;
map_styles[0].blank_tile1_dark = 21;
map_styles[0].blank_tile2 = 0;
map_styles[0].blank_t... | true |
656b343ffefc5e716a3a36eeb8a09517abf17386 | C++ | KenSporger/Digital-Image-Processing-Course | /Image-processing-algorithm/Image Extracting/connectedAreaMarkDFS.cpp | UTF-8 | 2,341 | 2.921875 | 3 | [] | no_license | #include<opencv2/opencv.hpp>
#include<iostream>
using namespace std;
using namespace cv;
void seedFilling(Mat &src)
{
// 标签容器,初始化为标记0
vector<vector<int>> labels(src.rows, vector<int>(src.cols, 0));
// 当前的种子标签
int curLabel = 1;
// 四连通位置偏移
pair<int, int> offset[4] = {make_pair(0, 1), make_pair(... | true |
75de5478b6d82d6d40a40f38dc32f044060dab4c | C++ | jenenena/DataStructures | /DataStructures/Controller/FileController.cpp | UTF-8 | 9,157 | 2.765625 | 3 | [] | no_license | //
// FileController.cpp
// DataStructures
//
// Created by Mills, Jenna on 2/5/19.
// Copyright © 2019 CTEC. All rights reserved.
//
#include "FileController.hpp"
//CRIME DATA ---------------------------------------------
//CRIME DATA VECTOR
vector<CrimeData> FileController :: readCrimeDataToVector(string file... | true |
178d76b90acd8d61cb297b71bfb68a2100a20403 | C++ | CyberROFL/YandexSort | /YandexSort/src/main.cpp | UTF-8 | 1,356 | 3.265625 | 3 | [] | no_license | /*
@author Ilnaz Nizametdinov (c)
@project YandexSort
@description
Application entry point.
*/
#include <pch.h>
#include <algo/generator.hpp>
#include <algo/sorter.hpp>
int main(int argc, char* argv[])
{
typedef int value_type;
// Restrictions
const size_t file_size = 1 << 30; // ... | true |
7be2906f02d89a6e873fcc631a3ca88424cd1866 | C++ | shlomilougassi/car | /main.cpp | UTF-8 | 5,941 | 2.828125 | 3 | [] | no_license | //shlomi lougassi 300620077
//tal kot 305468050
#include <iostream>
#include "car.h"
#include "customer.h"
#include "fileparser.h"
#include "garage.h"
#define amount_of_clients_from_file 4
using namespace std;
void matching_cars_to_customers(customer* ptr_customer[], car* ptr_car[], int which_car)
{
for (int i = 0; i... | true |
fa354abe2566097c453d60263c4206999df1a62c | C++ | aarya-bhatia/maze-generator | /src/generator/DisjSet.hpp | UTF-8 | 715 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <list>
#include "K.hpp"
#ifndef DISJ_SET_HPP
#define DISJ_SET_HPP
class DisjSet
{
public:
explicit DisjSet(int n);
~DisjSet()
{
if (K::DEBUG)
{
std::cout << __FILE__ << " destructor" << std::endl;
}
}
int find(int... | true |
c237484c412cef55ee27dc6b753f2d2959905b42 | C++ | mhfu0/DIP2016FALL | /dip_hw4/main.cpp | UTF-8 | 5,944 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <cstdio>
#include <cassert>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
Mat doDFT(Mat img);
Mat doIDFT(Mat imgComplex);
Mat makeSpecImg(Mat imgComplex);
void shift(Mat &specImg);
void createGHPF(Mat &mask, float d0);
void createGLPF(Mat &mask... | true |
5d4b6cbbedda87977b6440ca5d950d9652f593d0 | C++ | 719400737/LeetCode | /35.cpp | UTF-8 | 629 | 2.890625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
int l=0,r=nums.size()-1;
int m=0;
while (l<r)
{
m=(l+r)/2;
if(nums[m]==target)
return m;
else if(nums[m]<target... | true |
2917ec573840ffae034939caaa1fbeabe08589c1 | C++ | tronicslab/ks0108pi | /Ks0108pi.cpp | UTF-8 | 11,213 | 2.765625 | 3 | [] | no_license | /*
Raspberry pi KS0108 LCD interface
Author: Christian Isenberg
With help from the following amazing libraries :D :
- Universal KS0108 driver library by Rados³aw Kwiecieñ, radek@dxp.pl
- BCM 2835 library by Mike McCauley
*/
#include "Ks0108pi.h"
//------------------------------------------------... | true |
55b4dd26d91316f0531c41c51a80ce8f5d6f3933 | C++ | boryssmejda/SPOJ | /NotSoFastMultiplication/include/BigMultiplication.hpp | UTF-8 | 1,360 | 3.4375 | 3 | [] | no_license | #include <chrono>
#include <iostream>
#include <string>
#include <vector>
class BigMultiplier {
protected:
std::string m_number;
static std::string multiplyBySingleDigit(const std::string& number,const char multiplyBy);
static void shiftLeftBy(std::string& number ,int shiftBy);
static std::string add(const std::s... | true |
c394a9746089b3480617fdfc40db2a4bab404d96 | C++ | tylerreisinger/vulkan_wrapper | /src/Extensions.h | UTF-8 | 2,291 | 3.015625 | 3 | [] | no_license | #ifndef EXTENSIONS_H_
#define EXTENSIONS_H_
#include <cstring>
#include <iosfwd>
#include <vector>
#include <vulkan/vulkan.h>
class Extension {
public:
Extension(VkExtensionProperties properties);
Extension(const char* name);
~Extension() = default;
bool operator ==(const Extension& extension) cons... | true |
4c09402a8f84371f41bdb101a4c8600db37efff0 | C++ | AdrienFM/Projet_-cole | /fonction_Tableau.cpp | MacCentralEurope | 3,077 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <windows.h>
#include <vector>
void outputArray(int tableau[], int tailleTableau)
{
for (int i = 0; i < tailleTableau; i++)
std::cout << tableau[i] << std::endl;
}
void fillArrayWithRandom(int tableau[], int tailleTabl... | true |
03d1061da24ef50e197e64b72fddb1a5464739cc | C++ | zhouliyfly/LeetCode | /23/23.h | GB18030 | 1,949 | 3.078125 | 3 | [] | no_license | #ifndef _23_H_
#define _23_H_
#include "../general.h"
#include <vector>
#include <algorithm>
#include <queue>
#include <functional>
_LEETCODE23_BEGIN
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(nullptr) {}
};
class Solution { //320ms
publ... | true |
8dbcbe7be44ff06fc69214ff7ef1700ea1e48ac7 | C++ | utkarsh914/LeetCode | /Arrays and hashing/795. Number of Subarrays with Bounded Maximum.cpp | UTF-8 | 2,476 | 3.703125 | 4 | [] | no_license | // https://leetcode.com/problems/number-of-subarrays-with-bounded-maximum/
/*
We are given an array nums of positive integers,
and two positive integers left and right (left <= right).
Return the number of (contiguous, non-empty) subarrays
such that the value of the maximum array element in that subarray
is a... | true |
26dc3aa501817e1144c0ac4b85d7059fc7f54a62 | C++ | Donione/Hedgehog | /Hedgehog/Include/Animation/Segment.h | UTF-8 | 1,543 | 2.71875 | 3 | [] | no_license | #pragma once
#include <Component/Transform.h>
#include <string>
#include <vector>
#include <glm/gtc/quaternion.hpp>
namespace Hedge
{
struct KeyPosition
{
float timeStamp;
glm::vec3 position;
};
struct KeyRotation
{
float timeStamp;
glm::quat rotation;
};
struct KeyScale
{
float ... | true |
1af8362eec1c1cfba1ba33aab377d427b26415b5 | C++ | antaljanosbenjamin/ch24-huncup | /solutions/sms/main.cpp | UTF-8 | 4,096 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
//properly calcute for any input, but print out the possible output only for one button
using namespace std;
int MODULO = 1000007;
// modify this array to watch the output with one button, eg. for 7:
char chars[] = {'p', 'q', 'r', 's', 'p', ... | true |
cb812eda13265977723e7776ab0e60c9f6b1a07e | C++ | kyelin/ClanLib | /Sources/API/Scene3D/ModelData/model_data_animation_timeline.h | UTF-8 | 2,794 | 2.59375 | 3 | [
"Zlib"
] | permissive | /*
** ClanLib SDK
** Copyright (c) 1997-2013 The ClanLib Team
**
** This software is provided 'as-is', without any express or implied
** warranty. In no event will the authors be held liable for any damages
** arising from the use of this software.
**
** Permission is granted to anyone to use this software for a... | true |
68cf60aaa01b761e2261413e6a06a63befd66036 | C++ | AlvaroVargasM/Scrabble | /Server/Logic/Node.h | UTF-8 | 492 | 2.859375 | 3 | [] | no_license | #ifndef QUEUE_USING_OOP_NODE_H
#define QUEUE_USING_OOP_NODE_H
/**+
* Node class for beaing used in the link list, it stores data similar to a Tile.
*/
class Node {
private:
char l;
Node *next;
int pts;
int i;
int j;
public:
Node(char letter,int row,int columns,int points);
char getL() c... | true |
5565d630bed12c18ac6d0edacbe1f9d6583fedbd | C++ | Ing-Josef-Klotzner/python | /_bob_and_the_minimum_string.cpp | UTF-8 | 862 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <stack>
#include <vector>
using namespace std;
int main () {
ios_base :: sync_with_stdio (false);
cin.tie (NULL); cout.tie (NULL);
int t, i, it;
cin >> t;
while (t--){
int n;
string s, re;
cin >> n >> s;
vector <int> mp (1... | true |
0fce2aa17112e28a6cc10590a55d53cf6652b730 | C++ | isaponsoft/libamtrs | /include/amtrs/chrono/.inc-chrono/chrono-functions.hpp | UTF-8 | 2,007 | 2.609375 | 3 | [
"BSD-2-Clause"
] | permissive | /* Copyright (c) 2019, isaponsoft (Isao Shibuya) All rights reserved. *
* Use of this source code is governed by a BSD-style license that *
* can be found in the LICENSE file. */
#ifndef __libamtrs__functions__hpp
#define __libamtrs__functions__hpp
AMTRS_CHRONO_NAMESPACE_BEGIN
u... | true |
64acd696651f8a58a686c32e99e403c50efc5b58 | C++ | cbrghostrider/Hacking | /leetcode/_001216_validPalindromIII_TopDown_DP_TLE.cpp | UTF-8 | 2,118 | 3.109375 | 3 | [
"MIT"
] | permissive | class Solution {
// memoization cache
unordered_map<string, bool> cache;
// creates a memoization key for the subproblem
string signature(const unordered_set<int>& removed, int next, int k) {
string ret;
ret += "K:" + to_string(k) + ":";
ret += "N:" + to_string(next) + ":";
... | true |
f9a00765d3aaaaaa43a7a4679b3bd2c9e45c63bd | C++ | MatthewDaws/CPP_Learning | /prime_sieve/sieve.tpp | UTF-8 | 11,730 | 3.703125 | 4 | [] | no_license | /** @file: sieve.tpp
* @author: Matthew Daws
*
* Some Prime Sieve (aka Sieve of Eratosthenes) code.
* Lots of templates (quite plausible to use 64-bit integers; but this is a waste
* of memory if `unsigned int` is enough for you).
*/
#ifndef __SIEVE_TPP
#define __SIEVE_TPP
#include <vector>
#include <cmath... | true |
acf218801359a7f1941b7aa08d18eecd32487ca5 | C++ | SadMathLovergo/LeetCodeSolution | /274hIndex/274hIndex.cpp | GB18030 | 840 | 3.390625 | 3 | [] | no_license | #include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
bool myLess(int m, int n) {
return m > n;
}
//274⣺Hָ
//˼·鰴Уҵcitations[num]ʹõi < numʱcitations[i] >= numi > = numʱcitations[i] < numnumΪHָ
class Solution {
public:
int hIndex(vector<int>& citations) {
sort(citatio... | true |
bbdff7bfa6e27b0cc1bbed6704e643503f69dce7 | C++ | PhilipNelson5/AdventOfCode | /2018/1/1/main.cpp | UTF-8 | 294 | 2.890625 | 3 | [] | no_license | #include <fstream>
#include <iostream>
int main()
{
int frequ = 0;
int input;
std::ifstream fin("input.txt");
if (!fin)
{
std::cout << "bad file" << std::endl;
exit(EXIT_FAILURE);
}
while (fin >> input)
{
frequ += input;
}
std::cout << frequ << std::endl;
}
| true |
38232b833f56be70f1d6dc32a26c3ae57071ade1 | C++ | alchemz/CPlusPlusTraining | /review/copyConstuctor.cpp | UTF-8 | 552 | 4.09375 | 4 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
class Animal {
private:
string name;
public:
Animal() { cout << "1 Animal created" << endl; };
Animal(const Animal& other) :name(other.name) { cout << "2 Animal created by copy" << endl; };
void setName(string name) { this->name = name; };
void speak() co... | true |
a6f195ed713b036d42cad2cffc036e818142d959 | C++ | Mohit21/Questions | /AmazonRohitSubarraySUm.cpp | UTF-8 | 889 | 2.703125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int lSum(int A[],int N,int sum){
int tSum=0,maxlen=0;
for(int i=0;i<N;i++){
tSum+=A[i];
}
if(sum==tSum){
maxlen=N;
return maxlen;
}
else{
tSum=0;
for(int i=0;i<N;i++){
tSum=A[i];
... | true |
090f56608215db8de945eae7d86c1e39b0715933 | C++ | Dipet/dldt | /inference-engine/tests/unit/engines/vpu/containers_tests.cpp | UTF-8 | 6,492 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | // Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <algorithm>
#include <chrono>
#include <iostream>
#include <unordered_map>
#include <memory>
#include <gtest/gtest.h>
#include <vpu/utils/containers.hpp>
#include <vpu/utils/range.hpp>
#include <vpu/utils/handle.hpp>
usi... | true |
383259c290afc995bd89ba0b62e7774e2ec5be83 | C++ | jamesnguyen30/uh-cosc | /os/assignment2/server.cpp | UTF-8 | 6,592 | 3 | 3 | [] | no_license | #include <iostream>
#include <unistd.h>
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sstream>
#define NUM_OCTETS 4
#define NUM_ADDRESS 6
using namespace std;
void error(string msg){
perror(msg.c_str());
e... | true |
e05e2dffaa32f1ec3577498e2227a08dcc11d6ab | C++ | yyong119/ACM-OnlineJudge | /leetcode/134.cpp | UTF-8 | 863 | 2.65625 | 3 | [
"MIT"
] | permissive | class Solution {
public:
int canCompleteCircuit(vector<int>& gas, vector<int>& cost) {
int n = gas.size();
int *diff = new int[n];
int sum = 0;
for (int i = 0; i < n; ++i) {
diff[i] = gas[i] - cost[i];
sum += diff[i];
}
if (sum < 0) return -1; ... | true |
fa35bcb8cbe7d59a0d79c142b3180f8eb7c67743 | C++ | lonercoder101/code_template | /array_suffix.cpp | UTF-8 | 783 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using ll=long long int;
int main () {
ll N, M;
// N for no. of elements, M for queries
scanf ("%lld %lld", &N, &M);
std::vector <ll> arr (N, 0);
for (ll i=0; i<M; i++) {
ll a, b;
scanf ("%lld %lld", &a, &b);
... | true |
e3f0b2d35979f019955af8ec773d7a40497c48cf | C++ | yaoelvon/Cpp_learn | /9/practice_9_18.cc | UTF-8 | 368 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <deque> //双向队列的头文件
using namespace std;
int main(int argc, const char *argv[])
{
string str_nb;
deque<string> destr;
while(cin >> str_nb)
{
destr.push_back(str_nb);
}
auto beg = destr.cbegin();
auto end = destr.cend();
while(beg != end)
{
cout << *beg << ... | true |
c9f5d273bcdbf86ed8dfbf4005c95536e7f7900b | C++ | ZhaoBeiChen/Home-Work | /Maze/Maze/maze.cpp | GB18030 | 3,891 | 3.046875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int maze[1000][1000];
int row;
int col;
int sum=0;
struct Coordinate //
{
int x;
int y;
};
class Block //ͨש
{
int ord;
Coordinate seat;
int direction;
public:
Block()
{
direction = 1;
}
void IN(int step, Coordinate site, int Dire)
{
ord... | true |
f26b044ebadde3d775866b56f7ce0012fc3846e1 | C++ | robertcal/cpp_competitive_programming | /AtCoder/ABC/083/A.cpp | UTF-8 | 318 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
#define INF 1e9
using namespace std;
using ll = long long;
int main() {
int a, b, c, d; cin >> a >> b >> c >> d;
int l = a + b;
int r = c + d;
if (l > r) {
puts("Left");
} else if (l == r) {
puts("Balanced");
} else {
puts("Right");
}
} | true |
0491bc60c528d992ab64fe9afaf905b8a869a32b | C++ | afcarl/dqn_caffe | /src/ReplayMemory.cpp | UTF-8 | 1,151 | 2.578125 | 3 | [] | no_license | //
// Created by dc on 6/17/15.
//
#include "ReplayMemory.h"
#include <caffe/util/math_functions.hpp>
#include <algorithm>
void ReplayMemory::Add (CPState s0, int action, float reward, CPState s1, bool terminated)
{
buffer[bufferSize % bufferCapacity] = RMNode{s0, s1, action, reward, terminated};
vis[bufferSize % b... | true |
3e47a1658c00a6e5ae28f6f48d82eed53305bced | C++ | jkl09/intev | /quiz/map_pair.cpp | UTF-8 | 738 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <string>
#include <iterator>
#include <vector>
#include <set>
using namespace std;
int main(int argc, char const *argv[])
{
string word;
map<string, int> word_count;
word_count["james"] = 10;
while(cin >> word)
{
++word_count[word];
}
map<string,int>::iterator ite... | true |
bb349d77589fdc2541f1ad71ec904e0e5bb569a3 | C++ | asicoderOfficial/Interviews | /theory/searching/binary_search_array.cpp | UTF-8 | 1,796 | 4.03125 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int iteration = 1;
//Recursive approach.
bool binarysearch_rec(vector<int> v, int left, int right, int num) {
cout << "Iteration number " << iteration << "\nLeft = " << left << "\nRight = " << right << endl;
if(v.empty() || v[0] ... | true |
82c245291bd5b8089890767f41ae9af67115744e | C++ | gwkdgwkd/leetcode | /c_c++/sort/merge/4.寻找两个正序数组的中位数.cpp | UTF-8 | 4,869 | 3.75 | 4 | [] | no_license | /*
给定两个大小分别为m和n的正序(从小到大)数组nums1和nums2。
请找出并返回这两个正序数组的中位数,算法的时间复杂度应该为O(log(m+n))。
示例1:
输入:nums1 = [1,3], nums2 = [2]
输出:2.00000
解释:合并数组 = [1,2,3],中位数2
示例2:
输入:nums1 = [1,2], nums2 = [3,4]
输出:2.50000
解释:合并数组= [1,2,3,4],中位数(2 + 3) / 2 = 2.5
提示:
nums1.length == m
nums2.length == n
0 <= m <= 1000
0 <= n <= 1000
1 <= m + ... | true |
9aec443a03e2c1cf9425af6e67e0dbd2407919a5 | C++ | spersinger/fchacks-safety-sleeve | /source/visualizer.cpp | UTF-8 | 2,376 | 3.265625 | 3 | [
"MIT"
] | permissive | /*
* Visualizer Program. (This would run on a separate personal device as an application)
* This contains the analyzing of the data from the garment and the displaying of said data.
* This all simulates what would happen in the application on a separate device.
*/
#include <iostream>
#include "lib/termColor.hpp"
i... | true |
17c333c4d4c62b57e0068a6b231cb6c094b8502c | C++ | pakpak123/BasisArduino | /Last_Project_ITC.ino | UTF-8 | 1,789 | 2.734375 | 3 | [] | no_license |
const int pingPin = 7; //trig
int inPin = 8;
int BUTTON = 2;
int Press = 0;
#include <Servo.h>
#include <Wire.h>
const int LCD_COLS = 16;
const int LCD_ROWS = 2;
Servo myservo; //ประกาศตัวแปรแทน Servo
void switch1()
{
if (digitalRead(BUTTON) == LOW)
{
Press++;
if (Press > 1)
{
... | true |
4d4530e755e0e3e81cd132f920218ff7f98f5b16 | C++ | 1BM18CS147/ADS | /Program6/BTreeInsertion.cpp | UTF-8 | 2,688 | 3.46875 | 3 | [] | no_license | #include<iostream>
using namespace std;
class BTreeN
{
int *values;
int t;
BTreeN **C;
int n;
bool leaf;
public:
BTreeN(int _t, bool _leaf);
void insertNonFull(int k);
void splitChild(int i, BTreeN *y);
void traverse();
BTreeN *search(int k);
friend class BTree;
};
class BTree... | true |
819699faaf531d0969be6bd89dcf65f88003a5c8 | C++ | venkateshkulkarni345/venk_test1 | /11_MacroInlineNewDeleteMalloc.cpp | UTF-8 | 1,331 | 3.703125 | 4 | [] | no_license | #include<iostream>
using namespace std;
#define MULERROR(X) ( X * 10)
#define MULCORRECT(X) ( (X) * 10)
//1. Use of inline function : repetative use of the small block of code can be consider as an Inline function
//2. Will increase the performance(runs faster but utilizes the memory for placing the code for every ... | true |
33258c3efc573d562cfe61917e3c7c4cfed790dd | C++ | Max-Sir/Password_Generator | /MyForm.cpp | UTF-8 | 2,211 | 2.703125 | 3 | [] | no_license | #include "MyForm.h"
#include<cmath>
#include<string>
#include<ctime>
#include<cstdlib>
#include <iostream>
using std::string;
using std::endl;
using std::cout;
using std::cin;
//using namespace std;
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
string abc()
{
string c = "";
for (int i =... | true |
d41490cae410eac2d336a970f78997151c3a74a1 | C++ | jaranvil/Data-Structures | /Linked Lists/Project5/Project5/LinkedList.h | UTF-8 | 336 | 2.546875 | 3 | [] | no_license | #include <iostream>
#include "Node.h"
using namespace std;
class LinkedList
{
public:
Node *first;
LinkedList() : first(NULL) {}
virtual ~LinkedList();
void addValue(int, string);
int getNodeNum(int nodenum);
void changeNode(int nodenum, int num);
};
ostream& operator<<(ostream& output, LinkedList& list)... | true |
ffbaabc6bab0b0434ea17bc7311de902080762a9 | C++ | hangkuyr/RPGgame | /tests/enemies/testpumpkin.cpp | UTF-8 | 1,092 | 2.90625 | 3 | [] | no_license | #include "doctest.h"
#include "enemy.hpp"
#include "pumpkin.hpp"
#include "dice.hpp"
Enemy* RPP = new Pumpkin(2);
TEST_CASE("Teste Enemy Damage - 1"){
CHECK(RPP->e_damage() >= 1);
}
TEST_CASE("Teste Enemy Damage - 2"){
CHECK(RPP->e_damage() <= 8);
}
TEST_CASE("Teste Enemy Damage - 3"){
RPP->set_hp(9);
CHECK(RPP... | true |
205919c7342a42d75e3e75c4bee6f9ebe4d7b8e6 | C++ | LeDDGroup/chopter | /src/control/Event.cpp | UTF-8 | 738 | 2.90625 | 3 | [] | no_license | #include <SDL2/SDL_events.h>
#include <SDL2/SDL_timer.h>
#include "Event.hpp"
Event::Event() {
quit = false;
timeout = 1000/30;
resetTime();
}
bool Event::waitForStepTime() {
while(checkEvents()) {
if (isTime()) {
resetTime();
break;
}
}
return !quit;
}
bool Event::checkEvents() {
S... | true |
158da3a530834dac3d91f12cb9258de7c1dfc249 | C++ | aaa055/GreenhouseProject | /Main/LogModule.h | UTF-8 | 2,172 | 2.6875 | 3 | [] | no_license | #ifndef _LOG_MODULE_H
#define _LOG_MODULE_H
#include "AbstractModule.h"
#include "Globals.h"
#include "DS3231Support.h"
#include <SD.h>
typedef struct
{
AbstractModule* RaisedModule; // модуль, который инициировал событие
String Message; // действие, которое было произведено
} LogAction; // структура с описание... | true |
fcf96e550ca135b050e3d906499108c335ccd14f | C++ | goutomroy/uva.onlinejudge | /solved/The snail(573).cpp | UTF-8 | 499 | 2.5625 | 3 | [
"MIT"
] | permissive | #include<stdio.h>
#include<math.h>
#define ERR 1e-10
void main( )
{
float feet,wall,one,fatig,night,per;
int day;
while(scanf("%f%f%f%f",&wall,&one,&night,&fatig)==4 )
{
if(fabs(wall - 0.00000) <ERR)
break;
day=1;feet=0;
per=(fatig*one)/100;
while(1)
{
if(one>=0)
feet=feet+one;
if(feet>wall)
{... | true |
84999413828609604fe31ae6d10b0fcf4c0067e9 | C++ | muaddib1971/pucpp | /tutorials/groupb/week1/extern.cpp | UTF-8 | 272 | 2.703125 | 3 | [] | no_license | #include <cstdlib>
#include "extern1.h"
#include "extern2.h"
struct foo;
void doit(foo* f);
int i;
int main() {
i = 5;
/* incomplete type */
foo* f;
return EXIT_SUCCESS;
}
struct foo {
int a, b;
};
void func(foo* f) {
f->a = 5;
f->b = 42;
}
| true |
367e59db874a8d9b18b1425ca195419677ffc099 | C++ | DhikaAufa/P4-Dhika-Aufa-Hardinata | /Jobsheet 1 C.cpp | UTF-8 | 530 | 2.671875 | 3 | [] | no_license | #include<stdio.h>
main(){
int myarray[10] = {1,3,5,7,9,2,4,6,8,};
printf("\nNAMA : Dhika Aufa Hardinata");
printf("\nNIM : F1B019039");
printf("\nKELOMPOK : 8");
printf("\ndata ke-1 = %d" ,myarray[0]);
printf("\ndata ke-2 = %d" ,myarray[1]);
printf("\ndata ke-3 = %d" ,myarray[2]);
printf("\ndata ke-4 = %d... | true |
71c452a5088a82352adc2ed36d89e28e5d4e40bd | C++ | ji12345ba/CS225-UIUC | /lab_dict/cartalk_puzzle.cpp | UTF-8 | 1,354 | 3.328125 | 3 | [] | no_license | /**
* @file cartalk_puzzle.cpp
* Holds the function which solves a CarTalk puzzler.
*
* @author Matt Joras
* @date Winter 2013
*/
#include <fstream>
#include "cartalk_puzzle.h"
using namespace std;
/**
* Solves the CarTalk puzzler described here:
* http://www.cartalk.com/content/wordplay-anyone.
* @return ... | true |
0194374ddd30e328056605d7a1c67448309e7188 | C++ | H-Shen/Collection_of_my_coding_practice | /Leetcode/1381/1381.cpp | UTF-8 | 790 | 3.609375 | 4 | [] | no_license | class CustomStack {
private:
vector<int> vec;
size_t maxSize;
public:
CustomStack(int maxSize) : maxSize(maxSize) {
}
void push(int x) {
if (vec.size() < maxSize) {
vec.emplace_back(x);
}
}
int pop() {
if (vec.empty()) {
retu... | true |
0b6f3a3479e4e25dffc25d41ed66b9bfd72c6c81 | C++ | Abdelrahman009/Algorithms | /Collection/StronglyConnectedComponents/StronglyConnectedComponentsFinder.cpp | UTF-8 | 1,612 | 3.15625 | 3 | [] | no_license |
#include "StronglyConnectedComponentsFinder.h"
#include "../DFS/DFSOperator.h"
void DFS(DirectedGraph &graph,vector<Vertex> &component,Vertex &v){
v.color = 1;
component.push_back(v);
for (int i = 0; i < v.edges.size(); ++i) {
for(Edge e : v.edges){
if(graph.vertices[e.destination].co... | true |
fef009e3982290f5a984ddbba7bc51d164ca27de | C++ | JayeRen/profile | /580-3DGraphicsAndRendering/JIAYI_REN_HW3/HW3/rend.cpp | UTF-8 | 23,041 | 2.9375 | 3 | [] | no_license | /* CS580 Homework 3 */
#include "stdafx.h"
#include "stdio.h"
#include "math.h"
#include "Gz.h"
#include "rend.h"
#include <vector>
using std::vector;
#define MAXINTENSITY 4095
#define PI (float) 3.14159265358979323846
//extra func
void Matrix_d4(GzMatrix x, GzMatrix y, GzMatrix z) {
float te... | true |
0b4bc5bbb5359b4d8d786077e1c128e1edd19cba | C++ | danieljluna/Project-Perfect-Citizen | /Project-Perfect-Citizen/Code/Game/PipelineJobsAndIncomes.h | UTF-8 | 5,643 | 2.765625 | 3 | [] | no_license | #pragma once
#include <vector>
#include <map>
namespace ppc {
//IF ADDING A JOB IT MUST BE PRESENT IN ALL LISTS OR THERE WILL BE
//PROBLEMS
const std::vector<std::string> JOBS_ALL = {
"Retail Sales Associate",
"Retail General Manager",
"Office Clerk",
"Chef",
"Line Cook",
"Nurse",
"Waitstaff",
"Cu... | true |
84163d44dc6e23ab1202496b2f7413d181b0ac8b | C++ | limbo018/Limbo | /limbo/thirdparty/dlx/test/nqueens/NQueens_test.cpp | UTF-8 | 1,047 | 2.796875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | #include "../../example/nqueens/NQueens.hpp"
#include <gtest/gtest.h>
#include <algorithm>
namespace {
TEST(NQueens_test, zero) {
EXPECT_DEATH(NQueens(0), "Assertion");
}
TEST(NQueens_test, count_solutions) {
EXPECT_EQ(1, NQueens(1).count_solutions());
EXPECT_EQ(0, NQueens(2).count_solutions());
EXPECT_EQ(0... | true |
b6efd787f8fd49af81f2174a41ec59d8faea978c | C++ | himani-singh-8899/Data_Structures_algorithms | /Stack/delete_middle.cpp | UTF-8 | 1,403 | 3.921875 | 4 | [] | no_license | /*
Input:
Stack = {1, 2, 3, 4, 5}
Output:
ModifiedStack = {1, 2, 4, 5}
Explanation:
As the number of elements is 5 ,
hence the middle element will be the 3rd
element which is deleted
*/
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
... | true |
28872d1b237ac100d1b24849fa27e7a4dd2f69f5 | C++ | wjzhou/cuda-raytrace | /cuda_render/util/random/cudarandom.cpp | UTF-8 | 987 | 2.59375 | 3 | [] | no_license |
#include <stdio.h>
#include "cudarandom.h"
#include <curand.h>
#include "../cuda/helper_cuda.h"
class CudaRandom::impl
{
private:
impl(impl const &);
impl & operator=(impl const &);
curandGenerator_t prngGPU;
// private data
public:
impl(unsigned int seed)
{
checkCudaErrors(curandCreat... | true |
5b4e349fff5ad68d0e475d14266a9313f127347d | C++ | lamer0k/RtosWrapper | /Application/ledsdriver.hpp | UTF-8 | 2,056 | 3 | 3 | [
"MIT"
] | permissive | /*******************************************************************************
* FILENAME: LedDriver.h
*
* DESCRIPTION:
*
* Copyright (c) 2018 by South Ural State Universaty
******************************************************************************/
#ifndef LEDDRIVER_H
#define LEDDRIVER_H
#include "leds.hpp... | true |
51c73c543d42320f5a48ec8d7e72ba72d7a1fc1c | C++ | KOMMYHAP/education | /pattern_examples/proxy/shared_pointer/shared_pointer.h | UTF-8 | 5,990 | 3.71875 | 4 | [] | no_license | // interface for shared, unique, weak, etc pointers.
template <class T>
class pointer_base
{
public:
typedef T data_t;
private:
data_t *_data_ptr;
protected:
/** @param pointer: pointer on existing data
@brief: copy pointer
*/
pointer_base(data_t *pointer) noexcept
: _data_ptr(pointer) {}
// default c-tor in... | true |
de54def23f517c2d2831a3bcce9e1e536c9f352c | C++ | zhqiu/My-OJ-Programs | /hw5/A.cpp | UTF-8 | 2,474 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <assert.h>
#include <queue>
#include <string.h>
#define N 10000
using namespace std;
struct node{
int id;
struct node* next;
};
struct vertex{
int id;
int color;
int part;
struct node* next;
};
void dfs(struct vertex* point, int start, int part){
point[start].part = part;
poin... | true |
7a937171f6286d1bd439f8d79f3be1df555fdbc1 | C++ | akash-mankar/Coding | /Palindrome.cpp | UTF-8 | 855 | 2.953125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
char* str = argv[1];
int len = strlen(str), N = 2*len+1;
char* hashStr = new char[N];
int* hashInt = new int[N];
bool hash = true;
int i = 0, index = 0;
while (i <= len)
{
hashInt[index] = 0;
if (hash)
{
h... | true |
e9c0b34a7170c34a654e11cb69af64f03c936347 | C++ | vincentlie06/RPSains13-2020 | /C++/HamPath+Animasi.cpp | UTF-8 | 4,239 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <SFML/Graphics.hpp>
#include <math.h>
#include <vector>
using namespace std;
bool in(vector<int> vec, int args){
for(int x: vec){
if (args==x) return true;
}
return false;
}
void print_ham(vector<int> vec){
int s=vec.size();
cout<<vec[0];
for(int x=1; x<s; x... | true |
ad0008cf3e4901da4f153886bd1d3f92b4c7e7dd | C++ | d-eremina/assembly | /microproject02/readers-writers.cpp | UTF-8 | 8,323 | 3.015625 | 3 | [] | no_license | /**
* Еремина Дарья Валерьевна
* Микропроект №2
* Вариант 8
*
* Задача о читателях и писателях-2 («грязное чтение»).
*
* Базу данных разделяют два типа потоков – читатели и писатели.
* Читатели выполняют транзакции, которые просматривают записи базы данных,
* транзакции писателей и просматривают и изменяют за... | true |
75861e3df3ecad0811682b2d6599490d3998e5a1 | C++ | MikhailGoriachev/C-C | /16. 09.02.2021 - Указатели. Двумерные динамические массивы. Файлы заголовков/1. Class work/1. Teacher/CPP_Pointers/CPP_Pointers/main.cpp | UTF-8 | 5,491 | 3.703125 | 4 | [] | no_license | #include <iostream>
#include "myio.h"
using namespace std;
// принимает массив и символ, подсчитывает, сколько раз символ встечается в массиве
size_t check2DCharArray(char a[3][4], char ch)
{
int n = 0;
for (size_t i = 0; i < 3; i++)
{
for (size_t k = 0; k < 4; k++)
{
if (a[i][k] == ch)
n++;
if (n >... | true |
dd1752718e1a7d33004e9b8d4c494edc878d6106 | C++ | Igor-amateur/mvp-for-license-service-project | /Linux_C++_server/src/file_parser.cpp | UTF-8 | 4,626 | 2.84375 | 3 | [] | no_license | #include"file_parser.h"
#include<fstream>
#include<sstream>
#include<map>
#include<vector>
#include<exception>
#include<memory>
#include <cstdlib>
#include<string.h>
using namespace std;
TargetPoint::TargetPoint(int port, string ip_addres, double time_dur)
{
port_ = port;
ip_addres_ = ip_addres;
time_dur_ = time_... | true |
ba7b9eb0b995c03dde2e7490ab0decd6a3640f47 | C++ | OleksandrVoronin/UbisoftNext2021 | /GameTest/Gameplay/WaveChoreographer.h | UTF-8 | 1,955 | 2.859375 | 3 | [] | no_license | #pragma once
#include <algorithm>
#include <stdlib.h>
#include "EnemySpawner.h"
#include "TowerDefenseArena.h"
#include "Enemies/EnemyBoss.h"
#include "Enemies/EnemyCorner.h"
#include "Enemies/EnemyHeavy.h"
#include "Enemies/EnemyScout.h"
#include "Enemies/EnemySoldier.h"
class TowerDefenseArena;
class WaveChoreogr... | true |
9e2064e549140c68ea5d5c0042710533cd1490c6 | C++ | oyiadin/Schoolworks | /Data Structure (2018-2019)/Homework - Month1/P17.2.11.cpp | UTF-8 | 1,350 | 3.71875 | 4 | [] | no_license | template <typename T>
int binary_search(const T &elem, const T *va, int length);
template <typename T>
void insert_into_nonstrictly_increasing_ordered_list(const T &elem, T *va, int &length) {
int pos = binary_search(elem, va, length);
for (int i = length; i > pos; --i)
// move move move!
va[i... | true |
72bde314c36b1b29411be7f7cf795c82b3670765 | C++ | letusget/Cplusplus_work | /无用:随机读写文件程序/随机读写文件程序/源.cpp | GB18030 | 7,738 | 3.171875 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<fstream>
#include<cstring>
#include<cstdlib>
#include<cctype>
using namespace std;
const int header_size = 256;
const char Taken = 'T';
const char Free = 'F';
const char Deleted = 'D';
class frandom :public fstream {
public:
frandom();
fra... | true |
81d9ac2e606929428b232427443485651af0c074 | C++ | UBIC-repo/core | /NtpEsk/NtpEskSignatureRequestObject.h | UTF-8 | 2,048 | 2.515625 | 3 | [
"MIT"
] | permissive | #include <openssl/evp.h>
#include <openssl/ec.h>
#include <openssl/ecdsa.h>
#include <openssl/bn.h>
#include <vector>
#ifndef NTPESK_NTPESKSIGNATUREREQUESTOBJECT_H
#define NTPESK_NTPESKSIGNATUREREQUESTOBJECT_H
class NtpEskSignatureRequestObject {
private:
const EC_POINT *pubKey;
const EC_GROUP *curveParams;
... | true |
8b9958ff8e9a6af0317afa4a6fb3d135385d0cd2 | C++ | niuxu18/logTracker-old | /second/download/git/gumtree/git_repos_function_6813_git-2.11.4.cpp | UTF-8 | 345 | 2.53125 | 3 | [] | no_license | static struct entry *lookup_entry(unsigned char *sha1)
{
int low = 0, high = nr_convert;
while (low < high) {
int next = (low + high) / 2;
struct entry *n = convert[next];
int cmp = hashcmp(sha1, n->old_sha1);
if (!cmp)
return n;
if (cmp < 0) {
high = next;
continue;
}
low = next+1;
}
return... | true |
7ec01f4b5f74cfc0f24d73a6b66d511fa2042406 | C++ | JackeryShh/CPPlayGround | /XcodeCPPTest/DataAndStruction/BinaryTree.cpp | UTF-8 | 1,155 | 2.8125 | 3 | [] | no_license | //
// BinaryTree.cpp
// XcodeCPPTest
//
// Created by jackery on 2018/3/25.
// Copyright © 2018年 jackery. All rights reserved.
//
#include <stdio.h>
#include "iostream"
#include "BinaryTree.h"
#include <deque>
using namespace std;
CBinaryTree::CBinaryTree():pRoot(nullptr)
{
cout << "wow,great!" <<endl;
deq... | true |
200f027cc52be77d7d47f15a513ecf1b8c58cae4 | C++ | YoucefSklab/utymap | /core/src/index/GeoStore.hpp | UTF-8 | 2,979 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | #ifndef INDEX_GEOSTORE_HPP_DEFINED
#define INDEX_GEOSTORE_HPP_DEFINED
#include "BoundingBox.hpp"
#include "CancellationToken.hpp"
#include "GeoCoordinate.hpp"
#include "LodRange.hpp"
#include "QuadKey.hpp"
#include "entities/Element.hpp"
#include "entities/ElementVisitor.hpp"
#include "index/ElementStore.hpp"
#include... | true |
b72031708099f03621870f3d275ec49e06806d33 | C++ | joaovitor73/ExeCplusplus | /vetorMatriz/exe 07.cpp | UTF-8 | 462 | 3.09375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int A[4] , B[4], R[4], l;
for (l = 0; l < 4; l++){
cout << "\nDigite o " << 1+l << "o. valor para o vetor A: ";
cin >> A[l];
cout << "\nDigite o " << 1+l << "o. valor para o vetor B: ";
cin >> B[l];
R[l] = A[l] * B[l];
}
co... | true |
3238ab14f5972d0fe41e0b97be7c3883b9b5ea3b | C++ | Xalanot/AcceleratorPractice | /Ex4/4.1/common_pinned_memory.h | UTF-8 | 2,419 | 2.734375 | 3 | [] | no_license | #pragma once
#include <thrust/random.h>
#include <thrust/device_vector.h>
#include <cuda.h>
#include <thrust/sort.h>
#include <thrust/memory.h>
#include <thrust/system/cuda/memory.h>
#define DEBUG 1
// Error handeling of cuda functions
#define checkCudaError(ans) { gpuAssert((ans), __FILE__, __LINE__); }
inline void... | true |