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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c2937617fda8bef6c00a5ba59c353b34c66f91e8 | C++ | VeggieOrz/Algorithm-Practice | /leetcode/lwh/Daily_1006 笨阶乘.cpp | UTF-8 | 1,443 | 3.921875 | 4 | [] | no_license | /*
* 题目:1006. 笨阶乘
* 链接:https://leetcode-cn.com/problems/clumsy-factorial/
* 知识点:栈、数学
*/
class Solution {
public:
int clumsy(int N) {
vector<int> nums(1, N);
int i = 0;
while (--N) {
switch(i%4) {
// 符号*
case 0:
nums.back() *... | true |
ead9b68c271efa5b6bed049dbd4667971a7f807a | C++ | jaronwakley/Prime-Numbers | /prime_compressor.cpp | UTF-8 | 2,878 | 3.046875 | 3 | [] | no_license | //This program takes the files generated by prime_generator and compresses the contents down to files of 1,000,000 primes keeping only every 1,000th .
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <stdio.h>
using namespace std;
int main()
{
stri... | true |
af04c7045db453d22b52169eb8f22c81dadc4172 | C++ | CarlHernaez15/Experiment3 | /Experiment3/Exp3.2.cpp | UTF-8 | 826 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int provinceA[7];
int provinceB[7];
int provinceC[7];
int j = 1;
for(int i =0; i<7; i++)
{
cout <<"Province A, Day " << i+1 <<": ";
cin >> provinceA[i];
}
for(int i =0; i<7; i++)
{
cout <<"Province B, Day " <... | true |
6265a27dd7663cc32bce8960726e5c370708601f | C++ | azlove2021/c- | /14. 可删除的点.cpp | GB18030 | 672 | 2.796875 | 3 | [] | no_license | #include<iostream>
using namespace std;
#include<string>
#include<vector>
int main()
{
int n;
cin >> n;
// int H = n;
// int* x = new int[n];
int L = 0, R = 0;
long x, temp;
while ( n--)
{
cin >> x >> temp;
if (x < 0)
L++;
else
... | true |
2fe2e11e74e072e8e38c57e8bf26b75fe380b466 | C++ | huafei1137/Autobraid | /include/data-structures/Lattice.hpp | UTF-8 | 816 | 3.078125 | 3 | [] | no_license | #ifndef LATTICE_HPP
#define LATTICE_HPP
#include "Gate.hpp"
#include "Point.hpp"
#include <vector>
// represents grid of cells and how logical qubits are arranged in that grid
class Lattice {
public:
// assigns a default mapping (identity map)
Lattice(int length);
// sets a logical to physical qubit mapp... | true |
393c79354007d2d18111e4b8ee5cc96ea88dc505 | C++ | cursedtoxi/hurby-1 | /Eye.cpp | UTF-8 | 9,083 | 2.984375 | 3 | [] | no_license | /*************************************************************************************
This file is the implementation file of the Eye class
*************************************************************************************/
#include "Eye.h"
// callback for unassigned handlers (two void* args)
static void NULL... | true |
ace42cb3efe34d8c6999442bb28cf386a1745f93 | C++ | DiegoGarzaro/POO | /Lista7/Classe.h | UTF-8 | 1,084 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <string>
class Motor
{
private:
int NumCilindro;
int Potencia;
public:
Motor();
Motor(int NumCilindro, int Potencia);
~Motor();
void getdata();
void putdata();
};
class Veiculo
{
private:
int Peso;
int VelocMax;
float Preco;
publi... | true |
6aab744aebba54eb208259b0cbd51b915b68b9c2 | C++ | umer-amjad/Baby-Wolf | /Constant.hpp | UTF-8 | 823 | 2.78125 | 3 | [
"MIT"
] | permissive | //
// Constant.hpp
// BabyWolf
//
//
#ifndef Constant_hpp
#define Constant_hpp
#include "AbstractFunction.hpp"
class Constant : public AbstractFunction {
double val;
const Function wrap() const override;
const Function flatten() const override;
const Function collapse() const override;
Abstrac... | true |
4adf8ebf8b96b77e93405a70d226b43579c1668a | C++ | AshleshaBhamare/CPSC5910-DataStructures | /P4- Hashing the Hobbit/WordCounter.h | UTF-8 | 6,705 | 3.859375 | 4 | [] | no_license | // Ashlesha Bhamare
// WordCounter.h
// 11/21/2020
// Specification and Implementation file for the WordCounter class
// having different public functions like addWord, removeWord, getCapacity,
// getWordCount, getUniqueWordCount, getTotalWordCount, empty and private
// function like getHashKey.
#ifndef P4_WORDCOUNTER... | true |
44f4bbce64e70cefe6d402dc3c191129bdd2c8f9 | C++ | Elvins/Algorithm-problem | /others/2017网易游戏实习编程/网易实习1.cpp | UTF-8 | 2,328 | 3.203125 | 3 | [] | no_license | /**
时间限制:1秒
空间限制:65536K
题目描述
小Q是名小学生,他最喜欢数学中的加法竖式填空了。例如下面的填空题,每个空格表示1…9中的一个数字。
有时候这种竖式题不一定只有唯一解,小Q很想知道,给定一个这样的竖式,总共可能的解有多少个。
被加数和加数的位数不会超过3位。和的位数不会超过4位。空格只可能存在于被加数和加数中。
输入描述:
每个输入数据包含多个测试点。
第一行为测试点的个数T(T<=30)。
每个测试点包含一行,包含了三个长度大于0的字符串,分别表示被加数,加数和结果。每个字符串之间有一个空格。每个字符串只会包含“X”和“1”…“9”,其中“X”表示竖式中的空格。保证竖式至少有一个解。
输出描述:
... | true |
8d725bc275187505aab58f9ab311eeb7d3fa83df | C++ | John-Janzen/Major-Project | /Major Project Engine/Header Files/EventHandler.h | UTF-8 | 2,137 | 3.09375 | 3 | [] | no_license | #pragma once
#ifndef _EVENTHANDLER_H
#define _EVENTHANDLET_H
#include <map>
#include <list>
static std::uint16_t id_counter = 0;
enum EventType
{
NULL_TYPE,
GAME_CLOSED,
NEW_FRAME,
OPEN_DEBUGGER,
DEBUG_FINISHED_LOAD,
RENDER_NEW_OBJECT,
RENDER_FINISHED,
STATE_CHANGE,
LEFT_MOUSE_BUTTON,
T_BUTTON_PRESSED,... | true |
db2fd5181e0fe9b5ce5e696ff9ab212c56c08b9d | C++ | tres-xxx/Codeforces-Exercises | /A/100-199/141A-AmusingJoke.cpp | UTF-8 | 1,091 | 2.625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
char guest[100];
char hoster[100];
char check[100];
cin >> guest >> hoster >> check;
int found = 1;
for(int i = 0; check[i]!='\0' && found < 2;i++){
found = 0;
if(check[i] != ' '){
for(int j = 0; hoster[j] != '\0' && check[i] != ' '; j++){
if(check... | true |
e76812e1d1ab20babc56e779e176a3bed0dac61a | C++ | LGuitron/CyPS | /UnitTest/ValueParametrized/valueParametrized.h | UTF-8 | 211 | 3.375 | 3 | [] | no_license | #include <iostream>
template <class T>
void printValue(T value)
{
std::cout<<value<<std::endl;
}
template <class T>
void printValues(T value1, T value2)
{
std::cout<<value1<<" , "<<value2<<std::endl;
}
| true |
0163a9847d55db43b54eb41d1f74222e1263d85e | C++ | AnnaGorina/Artificial-intelligence | /Lab1/State.h | UTF-8 | 353 | 2.703125 | 3 | [] | no_license | #pragma once
#include<vector>
class State {
std::vector<int> SequenceWidth;
std::vector<bool> isVisited;
public:
explicit State(int N);
bool isEnd(int** A, int N);
bool isSequence(int i) const;
void set_number(int i);
int get_last_number() const;
int get_first_number() const;
std::vector<int> get_vecto... | true |
e4afb16f7c562ca1723146d9e730547b0a77bff1 | C++ | gulrak/filesystem | /examples/dir.cpp | UTF-8 | 1,891 | 2.734375 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | #include <chrono>
#include <iomanip>
#include <iostream>
#include <string>
#if defined(__cplusplus) && __cplusplus >= 201703L && defined(__has_include)
#if __has_include(<filesystem>)
#define GHC_USE_STD_FS
#include <filesystem>
namespace fs = std::filesystem;
#endif
#endif
#ifndef GHC_USE_STD_FS
#include <ghc/filesys... | true |
71726554aa6c535615e8896eb8377b5e8ea5d94e | C++ | gurus158/codingPractice | /solutions/mergeTwoSortedList_easy.cpp | UTF-8 | 830 | 3.21875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
struct ListNode{
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution{
public:
ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
if(!l1)
return l2;
if(!l2)
return l1;
if(l1->val < l2->val){
l1->next = merg... | true |
702452eca3b258d99782f7cf4e68da2b0be6ce00 | C++ | georgistoilov8/Object-Oriented-Programming | /Social media/Version 1/FMI Book/FMI Book/text_post.cpp | UTF-8 | 801 | 2.96875 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include "text_post.h"
char* TextPost::wrapToHtml() const {
int content_length = strlen(getContent());
int html_length = 48;
char* result = new char[html_length + content_length + 1];
strcpy(result, "<!DOCTYPE html><html><body><p>");
strcat(result, getContent(... | true |
fed1ad6b1ab0465b8b6bf7f4a2ad9622c2a76e58 | C++ | prasad-joshi/CPPCodes | /pcap/FindDevice.cpp | UTF-8 | 1,028 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <pcap.h>
std::ostream& operator << (std::ostream& os, pcap_addr_t& addr) {
return os;
}
std::ostream& operator << (std::ostream& os, pcap_if_t& dev) {
os << dev.name << ": "
<< (dev.description ? dev.description ... | true |
090f7b9d76d199d2b9fb7ba4a6b43e7a9fa2c8e0 | C++ | saifullah3396/team-nust-robocup-v2 | /src/TNRSModules/UserCommModule/include/Deprecated/BoostTcpServer.h | UTF-8 | 2,569 | 2.6875 | 3 | [
"BSD-3-Clause"
] | permissive | //
// server.cpp
// ~~~~~~~~~~
//
// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under 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)
//
#include <boost/asio.hpp>
#include <boost/bind.... | true |
d4dd4022f132a53e4840271a16f2356f2c1e429f | C++ | gmevelec/npuzzle | /srcs/implementation.cpp | UTF-8 | 4,841 | 3.25 | 3 | [] | no_license | #include "implementation.h"
#include <queue>
#include <map>
#include <iostream>
template<typename T, typename priority_t>
struct PriorityQueue
{
typedef std::pair<priority_t, T> PQElement;
std::priority_queue<PQElement, std::vector<PQElement>, std::greater<PQElement> > elements;
inline bool empty() const
{
retu... | true |
86324ad499525f5df8a3a009d1ff857867550cbd | C++ | Antonio180233/C-programming | /Actividad_4.cpp | UTF-8 | 3,567 | 3.71875 | 4 | [] | no_license | #include <iostream>
using namespace std;
/*Estructura nodo*/
struct nodo {//Se crea una estructura con el nombre nodo con dos componentes
int numero;//Almacena un dato numerico en el nodo que tenemos
struct nodo* sig;//Almacena la direccion de memoria del nodo continuo
};
typedef nodo* P;//Define un tipo... | true |
981f6500295dc4d62bcd452fc578ede5e12c70dc | C++ | Alfeim/njuee_LeetCode_Solutions | /Cpp/Submit Records/274. H-Index.cpp | UTF-8 | 568 | 3.109375 | 3 | [] | no_license | /********************************************
作者:Alfeim
题目:H指数
时间消耗:8ms
解题思路:排序
********************************************/
class Solution {
public:
int hIndex(vector<int>& citations) {
if(citations.empty())
return 0;
int res;
sort(citations.begin(),citations.end(),greater<int>... | true |
dc6cf42236ec103d1c0024e845befd93fc97f952 | C++ | rafaellg8/MP | /Practicas/P6/imagen/imagen/src/testarteASCII.cpp | UTF-8 | 2,911 | 3.265625 | 3 | [] | no_license | //lee imagenes/gio.pgm y la convierte en ascii con los caracteres "@%#*+=-:. "
#include <iostream>
#include <imagen.h>
using namespace std;
/**
* @brief Funcion auxiliar para imprimir la matriz arteASCII
*/
void imprimir(char ** arteASCII, int f, int c){
if (arteASCII!=0)
for (int... | true |
3ce39c189b45a12a427f613a70c75cb0e48a2676 | C++ | Soumya-padala/NcrWork | /C/Assignment1/Program10/Program10/Sumofdigits.cpp | UTF-8 | 247 | 3.203125 | 3 | [] | no_license | # include<stdio.h>
int getSum(int n)
{
int sum = 0;
while (n != 0)
{
sum = sum + n % 10;
n = n / 10;
}
return sum;
}
int main()
{
int n;
printf("enter number");
scanf_s("%d", &n);
printf(" %d ", getSum(n));
getchar();
return 0;
}
| true |
b3e4a0a1f6bfe99ebf4b5e4381c451a2c489049f | C++ | aspcodenet/Iot20AlgorithmDemos | /Iot20AlgorithmDemos/Iot20AlgorithmDemos.cpp | ISO-8859-1 | 6,270 | 3.59375 | 4 | [] | no_license | // Iot20AlgorithmDemos.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <numeric> //POWER OF ABSTRACTION. ok tyckte du det var svrt att anvnda DVD-spelaren?
//svrt att anvn... | true |
2c37fcdf8966cafeb6ef4973c8073a1844e7ed11 | C++ | Kushal148/C-DAC-Feb2020 | /DerivedDataTypes.cpp | UTF-8 | 1,893 | 3.890625 | 4 | [] | no_license | //DerivedDataTypes.cpp
/*
Data types that are derived from the primitive or builtin types are called as Derived Types
Functions, Arrays, pointers and references are the examples of derived types.
A Function is a set of statements that performs a computation based in inputs given to it in
the form of arguments and... | true |
e328151d6d4e471c56e7914966b0c3ae0e19f8d4 | C++ | anibalvale666/ParallelWordCount | /WordCount.cpp | UTF-8 | 5,256 | 3.390625 | 3 | [] | no_license | // WordCount.cpp : Este archivo contiene la función "main". La ejecución del programa comienza y termina ahí.
#include <iostream>
#include <thread>
#include <vector>
#include <fstream>
#include <sstream>
#include <map>
#include <iomanip>
#include <cctype>
#include <chrono>
#include <string>
using names... | true |
69bf7c753843380cda73d74722bad654af31237a | C++ | cmorris9/ProjectTwo | /CMorris_COMP340_Project1/Items.cpp | UTF-8 | 767 | 2.921875 | 3 | [] | no_license | #include "Items.h"
#include <string>
#include <vector>
Item::Item()
{
}
Item::Item(std::string ItemName)
{
this->WeapModifier = 0;
this->ItemName = ItemName;
this->IsHidden = false;
}
Item::~Item()
{
}
Item* Item::GenerateItems(int x)
{
switch (x)
{
case 1:
this->ItemName = "Swo... | true |
201c93307c9c250232917ad9fa0e9c24c3c727e5 | C++ | CyrilKoe/tronAI | /game/map.h | UTF-8 | 1,343 | 2.921875 | 3 | [] | no_license | #ifndef MAP_H
#define MAP_H
#include <SDL2/SDL.h>
#include "utils.h"
class Game;
class Map
{
private:
Game *game;
unsigned int screen_width, screen_height;
unsigned int width, height, size;
unsigned int boxes_width, boxes_height;
uint8_t *content = nullptr;
public:
Map(unsigned int _screen_w... | true |
415eff18349c68b74fe2919036d43f615002fe46 | C++ | shribadiger/interviewpreparation | /AlgorithmDesignModel/SelectionSort.cpp | UTF-8 | 474 | 3.546875 | 4 | [] | no_license | #include<iostream>
using namespace std;
//utility function to print the list
void PrintArray(int Array[],int n) {
for(int i=0;i<n;i++){
cout<<"\t"<<Array[i];
}
cout<<endl;
}
int main() {
int Array[] = {9,8,7,6,5,4,3,2,1};
PrintArray(Array,9);
for(int i=0;i<9;i++) {
int min = i;
for(int j=i+1;j<9;j++) {
... | true |
6d119c9c5310312f1d3987a3b2bd98c8571aa10d | C++ | Seneca-244200/BTP-Workshops | /WS03/part 2 (DIY)/calorieListTester.cpp | UTF-8 | 4,145 | 3.203125 | 3 | [] | no_license | // Workshop 3:
// Version: 1
// Date: 2023/05
// Author: Fardad Soleimanloo
// Update: Cornel
// Description:
// This file tests the DIY section of your workshop
// Do not modify this code when submitting
/////////////////////////////////////////////
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include "Food.h... | true |
e470d1cbcee1cc89e32680b35a6eec08f093c0e7 | C++ | grokitgames/giga | /Source/Engine/Resource/ResourceSystem.cpp | UTF-8 | 3,857 | 2.859375 | 3 | [] | no_license |
#include <giga-engine.h>
ResourceSystem::~ResourceSystem() {
}
void ResourceSystem::AddResource(ResourceObject *resource) {
m_resources.AddObject(resource);
}
void ResourceSystem::RemoveResource(ResourceObject* resource) {
m_resources.RemoveObject(resource);
}
void ResourceSystem::Initialize() {
}
R... | true |
fd53805236cfed2886b006af8c1b6077594ab1d2 | C++ | Sourabh-1309/Data-Structure-Course | /Trees/Search_BST.cpp | UTF-8 | 1,297 | 3.71875 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
struct node{
int data;
struct node *left;
struct node *right;
}*root = NULL;
struct node *createnode(int val){
struct node *temp = new node;
temp->data = val;
temp->left = temp->right = NULL;
return temp;
}
struct node *insertnode(struct node... | true |
0dbe2ca41d3dbd4dfe9590af85acc9605f282c10 | C++ | wcybxzj/cplusplus_www | /1.tan_c++/6.pointer/2.quote.cpp | UTF-8 | 814 | 3.65625 | 4 | [] | no_license | #include <iostream>
using namespace std;
//声明一个引用后不能再使之成为另外一个变量的引用
void test1()
{
int a1, a2;
int &b = a1;
//int &b = a2;//error
}
//数组不能被引用
void test2()
{
int a[5];
//int &b[5]= &a;//error
}
//可以建立引用的引用
void test3()
{
int a=3;
int &b = a;
int &c = b;
//a=100;
cout << c << endl;
}
//不能建立指向引用的指针
void test4... | true |
804575470e3600b38450ac03a6e6bff7add56b76 | C++ | piotrekvs/AGH | /archive/Sem1/Games/game8vs8.hpp | UTF-8 | 11,135 | 2.890625 | 3 | [] | no_license | #include "userInterface.hpp"
#include "jumpingPawnsFunctions.hpp"
void StartField8vs8(char GameField[8][8], pawnsCordinates Pawns[16]) {
for(int r = 0; r < 8; r++) {
for(int c = 0; c < 8; c++) {
GameField[r][c] = 'N';
}
}
pawnsCordinates initial;
for(int i = 0; i < 8; i++){
... | true |
95e83b167c30b4e1f4bd1806ab73fde06534446e | C++ | caizhixiang/zikao | /C++/程序第2-5章/3.4 函数重载 -3.cpp | UTF-8 | 187 | 2.859375 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
int add(int m1=0,int m2=0,int m3=0,int m4=0)
{return m1 + m2 + m3 + m4;}
void main( )
{cout<<add(1,3)<<","<<add(1,3,5)<<","<<add(1,3,5,7)<<endl;} | true |
bfb01e70187e448e6b6e00d4fe39f381ac72a585 | C++ | taijihua/Udacity_Projects | /Project5_Extended_Kalman_Filter/src/kalman_filter.cpp | UTF-8 | 1,691 | 2.734375 | 3 | [
"MIT"
] | permissive | #include "kalman_filter.h"
using Eigen::MatrixXd;
using Eigen::VectorXd;
// Please note that the Eigen library does not initialize
// VectorXd or MatrixXd objects with zeros upon creation.
KalmanFilter::KalmanFilter() {}
KalmanFilter::~KalmanFilter() {}
void KalmanFilter::Init(VectorXd &x_in, MatrixXd &P_in, Matr... | true |
03db8c742e9b848441aed07d912bb822f48b1962 | C++ | bgporter/JuceRpc | /Source/RpcException.h | UTF-8 | 890 | 2.65625 | 3 | [] | no_license | /*
Copyright 2016 Art & Logic Software Development.
*/
#ifndef h_RpcException
#define h_RpcException
#include "../JuceLibraryCode/JuceHeader.h"
class RpcException
{
public:
RpcException(uint32 code) : fCode(code) {};
// use default ctor, op=, copy ctor.
//
uint32 GetCode() const {return fCode;}... | true |
c2d35b1f62d83d001988742a8291f607bf20fe66 | C++ | alexandraback/datacollection | /solutions_5669245564223488_0/C++/Arorua/train.cc | UTF-8 | 727 | 2.875 | 3 | [] | no_license | #include <string>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool validate(string s)
{
bool t[256] = {0};
char last = 0;
for (int i = 0; i < s.size(); ++i)
if (s[i] != last) {
if (t[s[i]]) return false;
last = s[i];
t[last] = 1;
}
return true;
}
int proc(int k)
{... | true |
82160b04d8cb63d7de9ed87e3fd0dbe94d2f037b | C++ | capagot/swpathtracer | /acceleration/sbvh_node.h | UTF-8 | 1,733 | 2.875 | 3 | [
"MIT"
] | permissive | #ifndef ACCELERATION_SBVH_NODE_H
#define ACCELERATION_SBVH_NODE_H
#include <algorithm>
#include <memory>
#include <vector>
#include "primitive_ref.h"
class SBVHNode {
public:
struct Comparator {
static bool sortInX(const PrimitiveRef& a, const PrimitiveRef& b) {
return a.poly_centroid_.x <... | true |
0da7965b5d71cc3c34f841b196608f11d53e971c | C++ | sunyinkai/ACM_ICPC | /FutherTraining/Futher_Training10_网络流/b.cpp | UTF-8 | 3,364 | 2.65625 | 3 | [] | no_license | //枚举割边在残留图上增广
//important:割边集合:跑完最大流后vis[e.from]=1&&vis[e.to]=0&&e.cap>0
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
const int INF=2e9+11;
const int MAXN=107;
struct edge{ int from,to,cap,flow; };
vector<int>G[MAXN];
vector<edge>es;
void addEdge(int a,in... | true |
e47a79629555ae8710cc658276ec2199ead1fbe6 | C++ | SANDRAKUMI/PrivacyGuard | /DataConsumer/App/operations.cpp | UTF-8 | 2,743 | 3.03125 | 3 | [
"MIT"
] | permissive | #include "operations.h"
#include <stdio.h>
#include <stdlib.h>
/* Send a transaction invoking the request function of DO or DB's contract */
// payment unit: ether
// For DO's contract: [range_start, range_end] refers to the range of data files
// For DB's contract: [range_start, range_end] refers to the range of DOs... | true |
028a908a07f1ad66ff287d639f4cd0dfb33be7bf | C++ | Ciubix8513/Vulkan-engine | /Math/Vector2.h | UTF-8 | 1,083 | 2.609375 | 3 | [] | no_license | #pragma once
#ifndef _VECTOR2_H_
#define _VECTOR2_H_
#include <math.h>
#include <exception>
#include <DirectXMath.h>
//using namespace std;
namespace EngineMath
{
#define Deg2Rad 0.0174532925f
#define PI (double)3.1415926535897932384626433832795f
using namespace EngineMath;
struct Vector2
{
public:
#pragma regi... | true |
a1907167df60721ad1666d20ca77bac4825e180a | C++ | travisdowns/zero-fill-bench | /metric-column.hpp | UTF-8 | 838 | 3.171875 | 3 | [] | no_license | #ifndef METRIC_COLUMN_H_
#define METRIC_COLUMN_H_
#include "stamp.hpp"
#include <string>
/**
* A Column object represents a thing which knows how to print a column of data.
* It injects what it wants into the StampConfig object and then gets it back out after.
*
* Templated on the result type R.
*/
template <ty... | true |
69f3863c250bdb8b00f98df767e10c611a3cc15a | C++ | peace-shillong/Computer-Applications-Theory-and-Practical-Part-1 | /MCA/2nd Sem/Programs/OOPD/Worksheet 2/POWER.CPP | UTF-8 | 536 | 3.453125 | 3 | [
"MIT",
"LicenseRef-scancode-proprietary-license"
] | permissive | #include<iostream.h>
#include<conio.h>
double power(double m,int n=2);
void main()
{
int n;
double m;
clrscr();
cout<<endl<<"Program to find a number raised to another number"<<endl;
cout<<"Enter the value of m ";
cin>>m;
cout<<"Enter the value of n "<<endl<<"Enter a negative number to SKIP ";
cin>>n;
if(n>=... | true |
e72cbbff562941a28fc008ee617550a81659c40d | C++ | fwsGonzo/LiveUpdate | /verify.cpp | UTF-8 | 1,540 | 2.890625 | 3 | [] | no_license | /**
* Master thesis
* by Alf-Andre Walla 2016-2017
*
**/
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <unistd.h>
#include <cstring>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <util/crc32.hpp>
int main(void)
{
uint32_t x = CRC32_BEGIN();
for (int i = 0; i ... | true |
73f9a0046e7b34ecc65aa0884cda27dc2297dbe2 | C++ | llenroc/CP | /LeetCode/tags/array/longest-continuous-increasing-subsequence.cpp | UTF-8 | 578 | 2.515625 | 3 | [] | no_license |
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define INF LLONG_MAX/4
#define MOD 1e9+7
#define DEBUG(x) cerr << #x << " is " << (x) << endl;
class Solution {
public:
int findLengthOfLCIS(vector<int>& nums) {
int n=nums.size();
if(n==0) return 0;
int curr=1, ans=1;
... | true |
db2da51618e510e2d56b3ee42d7febd21c95e795 | C++ | sawlani/densest-subgraph | /alternate_code/iterative_peeling_naive.cpp | UTF-8 | 3,557 | 3.09375 | 3 | [] | no_license | // Saurabh Sawlani
// Find maximum subgraph density
// Uses BBST to store intermediate degrees
// 6-10 x slower than recursive_peeling_yu, but simpler to understand
#include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include<cassert>
#include <vector>
#include <queue>
... | true |
cbc2b3b9408f29065c2498023c44f94c6737f851 | C++ | msrLi/portingSources | /ACE/ACE_wrappers/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Message_Block_Data_Iterator.cpp | UTF-8 | 2,239 | 2.6875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-sun-iiop"
] | permissive | #include "orbsvcs/PortableGroup/UIPMC_Message_Block_Data_Iterator.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
UIPMC_Message_Block_Data_Iterator::UIPMC_Message_Block_Data_Iterator (iovec *iov, int iovcnt) :
iov_ (iov),
iovcnt_ (iovcnt),
iov_index_ (0),
iov_ptr_ (0),
iov_len_left_ (0),
state_ (INTER_BLOCK)
{
}
b... | true |
40e579ba5dc7a02db377beebcbe2db34b3243fa5 | C++ | IlVin/stepic-149-final | /include/buffer.h | UTF-8 | 778 | 2.609375 | 3 | [] | no_license | #pragma once
#include <string>
#include <assert.h>
#include <ev.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <cstring>
#define INIT_RAW_SIZE 2048
class TBuffer {
private:
char * raw;
char * hd;
char * tl;
size_t size;
public:
TBuffe... | true |
0d55b0ef705a785a6b5ca6730540ca1b456df08a | C++ | gm2-pisa/gm2daq | /analyzer/modules/master/master.cpp | UTF-8 | 5,898 | 2.609375 | 3 | [] | no_license | /**
* @file analyzer/modules/master/master.cpp
* @author Vladimir Tishchenko <tishenko@pa.uky.edu>
* @date Tue Jun 5 15:48:21 2012 (-0500)
* @date Last-Updated: Tue Mar 17 13:38:06 2015 (-0500)
* By : Data Acquisition
* Update #: 34
* @version $Id$
*
* @copyright (c) new (g-2) col... | true |
ce4bae236c2ca2754a69b28ab977b9cef3b522cf | C++ | narendraumate/piLibs | /src/libSystem/windows/piFileOS.cpp | UTF-8 | 2,449 | 2.734375 | 3 | [
"MIT"
] | permissive | #include <windows.h>
#include <stdio.h>
#include <io.h>
#include <errno.h>
#include "../piTypes.h"
#include "../piFile.h"
namespace piLibs {
bool piFile::Open(const wchar_t *name, const wchar_t *mode)
{
FILE *fp = nullptr;
if( _wfopen_s(&fp, name, mode) != 0 )
return false;
mInternal = (void*)fp... | true |
a9b68e4532353ca5c1a4fec64e01ceb9edbaa547 | C++ | 5trike/robot | /Servo.ino | UTF-8 | 10,557 | 2.578125 | 3 | [] | no_license | /*********
Руи Сантос
Более подробно о проекте на: http://randomnerdtutorials.com
*********/
#include <WiFi.h>
#include <ESP32Servo.h>
#include "soc/soc.h" //disable brownout problems
#include "soc/rtc_cntl_reg.h" //disable brownout problems
Servo myservo1; // создаем экземпляр класса «Servo»,
... | true |
ce946c1b1af19adf73384a2c554c6f7c645dc9ed | C++ | H-W-Huang/c-codes | /数据结构/排序/OJ/8644堆排序/8644堆排序.cpp | UTF-8 | 2,654 | 3.375 | 3 | [] | no_license | // 8644 堆排序
// 时间限制:1000MS 内存限制:1000K
// 提交次数:1909 通过次数:1257
// 题型: 编程题 语言: G++;GCC
// Description
// 用函数实现堆排序,并输出每趟排序的结果
// 输入格式
// 第一行:键盘输入待排序关键的个数n
// 第二行:输入n个待排序关键字,用空格分隔数据
// 输出格式
// 第一行:初始建堆后的结果
// 其后各行输出交换堆顶元素并调整堆的结果,数据之间用一个空格分隔
// 输入样例
// 10
// 5 4 8 0 9 3 2 6 7 1
// 输出样例
// 9 7 8 6 4 3 2 5 0... | true |
de6fa45d4d5c412d2720dfaf52d9482b94757f43 | C++ | PierreINP/Projet_Info | /ProjetC/Software/Install/Source/FSM_assignation.cpp | UTF-8 | 2,066 | 3.03125 | 3 | [] | no_license | #include"./../Header/Lexeme.h"
#include <stdlib.h>
#include <stdio.h>
#include <list>
#include <iostream>
#include <string.h>
using namespace std;
extern string keywordList[];
extern char specialList[];
extern string operatorList[];
bool isEntier(string a) {
int i;
for (i; i< a.size(); i++) {
if (not(a[i]... | true |
b6d51ef37b0d07b206d7e82d11853e15bc5050d2 | C++ | yl1019/Lid-Driven-Cavity-Problem | /LidDrivenCavitySolver.cpp | UTF-8 | 2,581 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <exception>
#include <iomanip>
#include <mpi.h>
using namespace std;
#include "LidDrivenCavity.h"
#include "ProgramOptions.h"
#include "MpiConfig.h"
int main(int argc, char **argv)
{
/** Initialize MPI and retrieve rank & size */
MPI_Init(&argc, &argv);
int rank, size;
MPI_Comm_rank(MP... | true |
d0435eb0d04d0c54a5e8269faf3333a23d778c0e | C++ | cntkillme/Advent-of-Code-2020 | /src/problem-7/main.cpp | UTF-8 | 4,133 | 3.15625 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "dataset.hpp"
struct constraint {
std::size_t bag;
std::string name;
std::unordered_set<std::size_t> parents;
std::unordered_map<std::size_t, long> children;
};
using input = std... | true |
8a9a5fa7ca825ab200ab8585bdaab535fde3ba48 | C++ | hasancuet13/uva | /divisorsV2.cpp | UTF-8 | 935 | 2.71875 | 3 | [] | no_license | #include<bits/stdc++.h>
#define SIZE_N 1000000
using namespace std;
bool status[1000000];
int prime[SIZE_N];
void sieve()
{
int N=1000000,t=0;
for(int i=4;i<=N;i+=2){
status[i]=1;
}
for(int i=3;i*i<=N;i+=2){
if(!status[i]){
for(int j=i*i;j<=N;j+=i){
... | true |
96f2aacc2460a9cc06d8e0d30f2d272073f1e591 | C++ | Elotod/Sensor-de-corrente-Elotod | /Valor_eficaz_AC_usando_sensor_de_corrente_Elotod_versao14set202.ino | UTF-8 | 5,588 | 2.625 | 3 | [] | no_license | // Editado por prof. Spalding em 09Set2020:
// Para usar com Arduino UNO, ESP32 e outros: Programa adaptado por Carlos Re Signor em Setembro de 2018 para capturar as formas
// de onda do sensor de corrente Elotod.
// O programa calcula o valor eficaz da corrente e mostra o valor na saida serial e a forma de onda na ... | true |
80b554e93193fa5a0c4eb993271943fd80957e1b | C++ | Radiation-Physics-Group-of-Alexandria/GeantV | /Nudy/src/TNudyDB.cxx | UTF-8 | 3,229 | 2.609375 | 3 | [] | no_license | #include "TNudyDB.h"
#include "TNudyEndfTape.h"
#include "TFile.h"
#include "TNudyLibrary.h"
#ifdef USE_ROOT
ClassImp(TNudyDB)
#endif
//______________________________________________________________________________
// TNudyDB::TNudyDB(const char *name,const char *title,const char *file){
TNudyDB::TNudyD... | true |
b4580a304a84b10ac620421ed91193b235d9c9f9 | C++ | Lumos-az/MiniSQL | /src/BufferManager.h | UTF-8 | 4,157 | 2.828125 | 3 | [] | no_license | #ifndef MINISQL_BUFFERMANAGER_H
#define MINISQL_BUFFERMANAGER_H
#include <map>
#include <set>
#include <string>
#include <vector>
#include <ctime>
using namespace std;
#define BUFFER_SIZE 4096
#define BLOCK_SIZE 4096
#define HEAD_SIZE 4
#define TABLE_INFO_PATH "../data/TableInfo.txt"
class Buffer;... | true |
37cb7943fff601a3e92bbff287e4bec899fe11b3 | C++ | abhirishi7/Algorithmic-Puzzles | /Matrix Multiplication/MatrixMultiplication.cpp | UTF-8 | 1,096 | 3.59375 | 4 | [] | no_license | /*
* MatrixMultiplication.cpp
*
* Created on: 03-Sep-2017
* Author: Abhishek Tripathi
*/
#include "MatrixMultiplication.h"
#include<iostream>
using namespace std;
int** matrixMul(int r1, int c1, int r2, int c2, int** mat1, int** mat2) {
int** result = new int*[r1];
for (int i = 0; i < r1; i++) {
res... | true |
e182ea8f32ca3a6fc6772edacfeaaff886d18257 | C++ | mfueller/eventglue | /mcr_robinson_ros/ros/include/mcr_robinson_ros/RosEventGlue.h | UTF-8 | 1,472 | 2.59375 | 3 | [] | no_license | #ifndef ROSEVENTGLUE_H_
#define ROSEVENTGLUE_H_
#include "RosEvent.h"
#include "RosPort.h"
class RosEventGlue
{
public:
static EventPortOutput &ros_event_source(std::string topic_name, std::string event_name)
{
EventPortOutputROS *event_source = new EventPortOutputROS(topic_name, e... | true |
48368f1de872137eecd8ae5e70895c381e645de9 | C++ | DawsonMeyer/UVAProblems | /497.cc | UTF-8 | 1,440 | 2.9375 | 3 | [] | no_license | /*
Dawson Meyer
Problem #497: Strategic Defence Initiative
Need to dynamically allocate the space in the data structure. So use a
Vector.
*/
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
vector<int> M;
//changing Howard's code to work with vectors that get passed in
int sas... | true |
816ccfa16302016b65c2f9179c95ed938bd86183 | C++ | JuntaoLiu01/LeetCode | /Array/FDN.cpp | UTF-8 | 956 | 3.109375 | 3 | [] | no_license | #include <vector>
using namespace std;
class Solution {
public:
int findDuplicate(vector<int>& nums) {
int left = 1,right = nums.size()-1;
while(left < right){
int mid = (left+right)/2;
int cnt = 0;
for(auto a:nums){
if(a <= mid)
... | true |
ccae11320406fe9ef8ca308a4755e12941e5acf3 | C++ | Rigel09/CRW_2021_Teensy_Data_Record | /src/main.cpp | UTF-8 | 2,230 | 2.671875 | 3 | [
"MIT"
] | permissive | /*
Retrieves sensor data and writes to a csv file on the sd card
Sensors:
Magnetometer x1
Accelerometer x3
Gyroscope x3
Author: Charger Rocket Works 2021/2022 Team
Date: Fall 2021
*/
#include "Arduino.h"
#include "SPI.h"
#include "SdFat.h"
#include "include/ADXL356_Accelerometer.hpp"
//------------------------... | true |
40ec48aab7492b895b16fc9c2cacc27edd992a2d | C++ | pongsh/aizuoj | /volume_1/0100.cpp | UTF-8 | 807 | 2.640625 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <vector>
using namespace std;
int main() {
int N;
while (cin >> N && N != 0) {
cin.get();
map<int, long long> sales;
vector<int> sequence;
int i;
long long p, q;
for (int n = 0; n != N; ++n) {
... | true |
b7988a74157ef9131ce7db5ed76981094192ba51 | C++ | boomitsnoom/ray | /cpp/src/ray/test/cluster/cluster_mode_test.cc | UTF-8 | 2,879 | 2.5625 | 3 | [
"Apache-2.0",
"MIT"
] | permissive |
#include <gtest/gtest.h>
#include <ray/api.h>
#include <ray/api/ray_config.h>
#include <ray/experimental/default_worker.h>
using namespace ::ray::api;
/// general function of user code
int Return1() { return 1; }
int Plus1(int x) { return x + 1; }
/// a class of user code
class Counter {
public:
int count;
Co... | true |
163f1a37757ba6561ea3ebbb4f0f7396f1a26ffa | C++ | MohammadAlhourani/Physics-lab-03 | /square physics/square physics/Game.cpp | UTF-8 | 3,505 | 2.9375 | 3 | [] | no_license | #include "Game.h"
#include <iostream>
#include <SFML/Graphics.hpp>
// Updates per milliseconds
static double const MS_PER_UPDATE = 10.0;
////////////////////////////////////////////////////////////
Game::Game()
: m_window(sf::VideoMode(800, 800, 32), "physics!", sf::Style::Default)
{
Square.setSize(sf::Vector2f(10,... | true |
a5e577621f1358f6171eec25225afac6786c268f | C++ | ksmeeks0001/black_jack | /Deck.cpp | UTF-8 | 1,647 | 3.453125 | 3 | [] | no_license | #include <cstdlib>
#include <iostream>
#include <time.h>
#include "Deck.h"
#include "Card.h"
Deck::Deck()
{
srand(time(NULL)); // random seed to time
suits[0] = "Hearts";
suits[1] = "Diamonds";
suits[2] = "Spades";
suits[3] = "Clubs";
denoms[0] = "A";
denoms[1]= "2";
denoms[2]= "3"... | true |
c7a1ca5ec1df187576bfea743df4eea622d0c688 | C++ | maggie-han/3rd-Polynomial-Fit | /FINAL least squares.cpp | UTF-8 | 2,867 | 3.765625 | 4 | [] | no_license | //Maggie Han
//AP physics assignment 0
//C programming Least Squares
//Accept a set of data then effect 3rd degree polynomial fit
//using least squares and Vandemonde matrix
#include <iostream>
#include <math.h>
#include <iomanip>
#include <cstdlib>
using namespace std;
int main()
{
... | true |
754f4dbbda4bff38364878581001b7d023a415cc | C++ | Nightmare4214/connect_four | /Project1/AlphaBetaPruning.cpp | GB18030 | 16,762 | 2.796875 | 3 | [] | no_license | #include "AlphaBetaPruning.hpp"
#include"TranspositionTable.hpp"
#include<conio.h>
int AlphaBetaPruning::getScore(const uint64_t & currentMove)const
{
uint64_t pos = getWinPositions(bitBoard | currentMove, mask);
int cnt = 0;
while (0 != pos) {
++cnt;
pos &= pos - 1;
}
return cnt;
}
uint64_t AlphaBetaPruning... | true |
81019e106cdb98b3bf06bb109d502e4941d029a7 | C++ | qianzhanwang/libnet | /src/epollctrl.cpp | UTF-8 | 1,204 | 2.5625 | 3 | [] | no_license | #include "epollctrl.h"
#include <unistd.h>
EpollCtrl::EpollCtrl ()
:EpollUserData(EpollUserData::et_ctrlor)
{
m_nfds[0] = 0;
m_nfds[1] = 0;
}
EpollCtrl::~EpollCtrl ()
{
}
bool EpollCtrl::Init(std::functioal<void()> cb)
{
m_cbHandleCmd = cb;
if (pipe(m_nfds) < 0)
{
return false;
}... | true |
5bec85a3cb21727f92c039431ceb981d9e048870 | C++ | juankzero/EjerciciosProgramacion3_P3A20 | /EjemploPolimorfismo/Figura2D.h | UTF-8 | 339 | 2.84375 | 3 | [] | no_license | #pragma once
#ifndef FIGURA2D_H
#define FIGURA2D_H
enum TipoFigura
{
tRectangulo, //0
tTrianguloRectangulo, //1
tCirculo //2
};
//definicion de clase abstracta
class Figura2D
{
public:
virtual float getArea() = 0;
virtual float getPerimetro() = 0;
virtual void imprimirFigura() = 0;
virtual TipoFigura getTip... | true |
c31f45ba9370158b3541ab0ebdd12f1bfc5f30ba | C++ | Candlemancer/Freshman-Year | /CS 1410 - Intermediate Computer Science/Recursion/Recursion.cpp | UTF-8 | 5,104 | 3.46875 | 3 | [] | no_license | // Jonathan Petersen
// A01236750
// Recursion Examples
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int cannonball(int);
void printBinary(int);
int sumOfDigits(int);
void maze(string);
void solver(bool&, char**&, int&, int&, int, int);
int main()... | true |
97c244a39f549b5af407e9473c39e71ad8d1237e | C++ | tbobo555/CrazyRat | /Classes/Controller/GameController.cpp | UTF-8 | 25,407 | 2.796875 | 3 | [] | no_license | #include "GameController.h"
namespace Controller
{
GameController* GameController::instance = new GameController::GameController();
GameController::GameController(){}
GameController* GameController::getInstance()
{
return instance;
}
void GameController::loadMenuSceneReso... | true |
d3e3b988e25b9a3fff123e0324bfc1f88f2fee1b | C++ | rsahara/whip | /src/lib/Formats/KotlinFormat/StateMachineGenerator.cpp | UTF-8 | 10,830 | 2.6875 | 3 | [] | no_license | //
// StateMachineGenerator.cpp
// Whip
//
// Copyright © 2019 Runo Sahara. All rights reserved.
//
#include "StateMachineGenerator.hpp"
#include <sstream>
#include "Document/Document.hpp"
#include "PseudoCode/PseudoCode.hpp"
#include "Util/Text.hpp"
namespace Whip::KotlinFormat {
StateMachineGenerator::Stat... | true |
d4ce81fa70bcdae1987e4efd2877fc8d4dfdb916 | C++ | chandan0904/coding | /coding/subset_sum.cpp | UTF-8 | 685 | 3.171875 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
void subset_sum(vector<int> &set,vector<bool> &ex,int sum,int m,int i,int j)
{
if(sum<m || i>j)
{
return ;
}
if(sum == m)
{
for(int k=0;k<j;k++)
{
if(ex[k])
cout<<set[k]<<" ";
}
cout<<endl;
return ;
}
subset_sum(s... | true |
b2e50dc1680ab259aa82b2f6afcd845f4c0233b3 | C++ | HRNaudZ/CppSolutions | /ThreeNumbers.cpp | UTF-8 | 990 | 3.40625 | 3 | [] | no_license | /**** Code by WOANA Yao Renaud *****/
/*---------woanayr@gmail.com------*/
#include <iostream>
#include <vector>
bool isEndThree(int a){
return a%10==3;
}
bool isPrime(int a){
if(a<=1) return false;
if(a<=3) return true;
if(a%2==0 || a%3==0) return false;
for(int i(5); i*i<=a; i+=6){
if(a%i==0 ... | true |
0f15b7dd003b4e11998161c9e07d9a78f8548228 | C++ | kumasento/VELVET-PROGRAMMING | /OJ/POJ/POJ_DS_61.cpp | UTF-8 | 1,876 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <string>
using namespace std;
struct node {
node *ch, *sb;
int v, k;
};
void Insert(node *&o, string st, int i){
int n = st[i]-'0';
if(o->ch == NULL){
// build a new child
o->ch = new node();
(o->ch)->... | true |
7b7b31015b4127b651c2e7e25b9487fe98f5e84d | C++ | nolanjian/Parametric-Furniture-Designer | /Component/Axis.cpp | UTF-8 | 846 | 2.53125 | 3 | [] | no_license | #include <Component/Axis.h>
#include <osg/Geode>
#include <osg/Shape>
#include <osg/ShapeDrawable>
namespace PFD
{
namespace Component
{
Axis::Axis(Dim dim, unsigned int uLen)
: m_dim(dim), m_uLen(uLen)
{
Init();
}
void Axis::Init()
{
removeChildren(0, getNumChildren());
osg::ref_ptr<osg::Ge... | true |
e9f5df151ccfaade0df440d830ad68a4c0f5312a | C++ | GuillaumeSmaha/sleepyogre3d | /include/Core/ClassRootSingleton.h | UTF-8 | 1,985 | 3.328125 | 3 | [
"BSD-2-Clause"
] | permissive | /*!
* \file ClassRootSingleton.h
* \brief Ce fichier contient la déclaration de la classe ClassRootSingleton.
*/
#ifndef __CLASS_ROOT_SINGLETON_H__
#define __CLASS_ROOT_SINGLETON_H__
#ifndef DOXYGEN_SKIP
#include <stddef.h>
#endif
#include "Core/ClassRoot.h"
/*!
* \class ClassRootSingleton
* \brief Permet de c... | true |
a9e7b0dcc4b67008dcd703b2261f8e9de09559e5 | C++ | MargaretBarseghayn/OA_Hashing | /OA_HashTable.h | UTF-8 | 915 | 3.296875 | 3 | [] | no_license | #pragma once
//*** THE REPETITIONS ARE NOT ALLOWED ***//
class OA_HashTable
{
enum Status { FREE, OCCUPIED, DELETED };
struct Node {
int key_;
Status status_;
Node(int key = 0, Status status = FREE) :key_(key), status_(status) {}
};
//the values of these functions should be taken modulo size_
... | true |
549d349e8b213c831cdf6fbbba72be816d4f61d6 | C++ | zfu/codejam | /FairandSquare/Solution.cpp | UTF-8 | 3,338 | 2.953125 | 3 | [] | no_license | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmat... | true |
f10249daa6df6342932d6000a78e4d3f9749dfe1 | C++ | apple/foundationdb | /fdbclient/TupleVersionstamp.cpp | UTF-8 | 1,592 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | #include "fdbclient/TupleVersionstamp.h"
TupleVersionstamp::TupleVersionstamp(StringRef str) {
if (str.size() != VERSIONSTAMP_TUPLE_SIZE) {
throw invalid_versionstamp_size();
}
data = str;
}
TupleVersionstamp::TupleVersionstamp(int64_t version, uint16_t batchNumber, uint16_t userVersion) {
data = makeString(VER... | true |
95f24b1f505a7cc05f76c35785c964502b26fd45 | C++ | joss31/ada | /1/cutRod.cpp | UTF-8 | 2,745 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <time.h>
#include <random>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
// esta funcion es muy ineficiente ya que tarda mucho tiempo en ejecutarse,
//tambien por su llamada recursiva se llama varias veces los mismos parametros
//por eso es su tiempo de ejecucion es 2ˆ(n-1).... | true |
89a2870d785a1f1a34a44a5a70b3e6922fb74a9e | C++ | winielson/CS435 | /Proj1/RecBST/RecBST/RecBST.cpp | UTF-8 | 6,102 | 3.78125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
using namespace std;
#define MAX_SIZE_OF_ARR 256
struct node {
int key;
struct node *l, *r;
};
// Create new node
struct node *newNode(int item) {
struct node *temp = (struct n... | true |
4259989d82c0d9a23713ddbcfb99cb06d3a90032 | C++ | kurochan/OASIS | /v1.1/source/system/graphic/sheet.cpp | UTF-8 | 10,202 | 2.765625 | 3 | [] | no_license | //=========================================
// OASIS Kernel source code
// Copyright (C) 2010 soS.A
//=========================================
/*シート関係*/
#include "kernel.h"
SHTCTL shtctl ;
bool SHTCTL::alreadyExist = 0;
/*
シートシステム初期化関数
シートを一枚作って、シートシステムを確立します。
シート関係の関数を使う場合は... | true |
d7b960822e6d7d80afde7e17e6c2a8f17fd70b39 | C++ | Anirgb00/gfg-Covid-codes | /unqueprime.cpp | UTF-8 | 1,203 | 3 | 3 | [] | no_license | #include <bits/stdc++.h>
#include <vector>
#include <string.h>
#include <math.h>
using namespace std;
void sieve(long long int n){
bool isprime[n+1];
int flag = 0;
for(int i=0;i<=n;i++)
isprime[i] = true;
isprime[0] = false;
isprime[1] = false;
for(int i=2;i*i<=n;i++){
if(isp... | true |
0692143634ddf43520132eac327ff30aab05d5b7 | C++ | alexandraback/datacollection | /solutions_2645486_0/C++/swda289346/B.cpp | UTF-8 | 1,375 | 2.65625 | 3 | [] | no_license | #include <stdio.h>
#define N 10000
inline long long max(long long a, long long b)
{
return a>b?a:b;
}
inline long long min(long long a, long long b)
{
return a<b?a:b;
}
long long _calc(long long *v, int e, int r, int n, int se, int ee)
{
if (n<=0)
return 0;
int maxpos = 0;
long long ans = ... | true |
644c7ea7b6636da5f9baf043aa5dcc2e0c7b25e5 | C++ | jishnusen/cs32-hw | /homework2/mazestack.cpp | UTF-8 | 1,196 | 3.578125 | 4 | [] | no_license | #include <iostream>
#include <stack>
#include <string>
using namespace std;
class Coord {
public:
Coord(int rr, int cc) : m_row(rr), m_col(cc) {}
int r() const { return m_row; }
int c() const { return m_col; }
private:
int m_row;
int m_col;
};
bool pathExists(string maze[], int nRows, int nCols, int sr,... | true |
bed6e4d7253afcb2c7e8b70cd5da89687d57e98b | C++ | Eradan94/Tangram | /include/View/Menu.h | UTF-8 | 2,177 | 3.296875 | 3 | [] | no_license | /*!
* \file Menu.h
* \brief Defines a representation of menu.
* \author Biguenet Denis & Gosset Severin
* \date 22/02/2020
*/
#pragma once
#include "../../include/View/Drawable.h"
#include "../../include/View/Button.h"
#include "../../include/Model/Shape.h"
#include "../../include/Model/Piece.h"
#include <list>
... | true |
0d93944f6fd52aeb7593befab6b59d15e970bbe8 | C++ | SebiCoroian/pbinfo-sources | /primeintreele.cpp | UTF-8 | 336 | 3.328125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int euclid(int a, int b)
{
int c;
while (b)
{
c = a % b;
a = b;
b = c;
}
return a;
}
int main()
{
int a,b;
cin>>a>>b;
if(euclid(a,b)==1)
{
cout<<"PIE";
}
else
{
cout<<"N... | true |
68fe604a4903a5949caf8132a39e7e85e17f740c | C++ | 1001root/SEM4_lab_codes | /c++/DSA/lab5/oppQueue_linklist.cpp | UTF-8 | 1,363 | 3.84375 | 4 | [] | no_license | #include<iostream>
using namespace std;
class list{
public:
int data;
list * next;
list * previous;
};
class queue{
public:
list * head;
list * tail;
public:
queue(){
head = NULL;
tail = NULL;
}
bool is_empty(){
return(head == NULL || tail == NULL);
}
void enqueue(int a){
list * temp;
temp = new... | true |
2c9712900f91666eaf071047b953234e94440403 | C++ | qawbecrdtey/BOJ-sol | /problems/acmicpc_22952.cpp | UTF-8 | 199 | 2.59375 | 3 | [
"MIT"
] | permissive | #include <cstdio>
int main() {
int n; scanf("%d", &n);
if(n & 1) printf("%d ", n);
for(int i = 1; i <= n / 2; i++) {
if(i * 2 == n) printf("%d %d", i, n);
else printf("%d %d ", i, n - i);
}
} | true |
a9bbb6c09aaf75a2fedad536c756b461e5612a0d | C++ | parthc-rob/tictactoe-game | /include/gameboard.h | UTF-8 | 3,086 | 2.875 | 3 | [] | no_license | //Console-based Tic-Tac-Toe Game. Can be played vs a random bot
// Copyright (C) 2019, Parth Chopra [parthchopra93@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, ei... | true |
c005fe0a5a3bdcf9f25125326468692d1e1d87ba | C++ | JulienFiant/arcade | /games/PACMAN/include/clyde.hpp | UTF-8 | 1,245 | 2.53125 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2019
** OOP_arcade_2018
** File description:
** clyde
*/
#ifndef CLYDE_HPP_
#define CLYDE_HPP_
#include "../../../core/IEntity.hpp"
class clyde : public IEntity
{
public:
clyde();
~clyde();
void setBonus(int = 0);
int getBonus();
void setSpriteSFML(sf::Sprite sprite);
sf::Sprite ... | true |
74871d89152babb98d4681f52c5ded1b261b1a91 | C++ | epsilon-phase/logo | /tests/lexer2.cpp | UTF-8 | 5,670 | 3.265625 | 3 | [] | no_license | #include "catch2.hpp"
#include <iostream>
#include <logo/errors/syntaxexception.hpp>
#include <logo/language/lexer/lexer.hpp>
#include <string>
#ifdef TEST_PRINTING
#define PRINT_ERROR(X) std::cerr << X
#define PRINT_OUT(X) std::cout << X
#else
#define PRINT_ERROR(X)
#define PRINT_OUT(X)
#endif
using namespace logo::la... | true |
5fc0b8592fe5e3855aedbc662ce63b0c123e5239 | C++ | olendvcook/TinyMaze | /Enemy.h | UTF-8 | 738 | 2.8125 | 3 | [] | no_license | #pragma once
#include "animatedsprite.h"
//Example of extended Animated Sprite class to create simple enemies
//update depending on what state enemy is in
//TODO: is states for enemies as dumb as states for player?
enum ENEMYSTATE { eLEFT, eRIGHT, eNONE };
//extends AnimatedSprite so it has all of AnimatedSprites va... | true |
76610bd434861a44d9a056d597e527f3a5b521b4 | C++ | tongchiyang/PSS | /purenessscopeserver/purenessscopeserver/PurenessScopeServer/PacketParse/PacketParse.h | GB18030 | 3,000 | 2.578125 | 3 | [] | no_license | #ifndef _PACKETPARSE_H
#define _PACKETPARSE_H
//ȫʹõ
//↑ֻҪȥʵ5ӿڣͿһݰ
//һӣֻģʽĻҪٹ캯ָm_u1PacketModeΪPACKET_WITHSTREAM
//ȻʵGetPacketStream()һдСӡ
//ʵģʽֻްͷЭ飬аͷЭ飬㲻SetPacketHeadSetPacketBody
//ҲԼȥGetPacketStreamʵ
//ԼϲãһƼǰߣΪЧʱȽϸߡ
//add by freeeyes
#include "PacketParseBase.h"
#ifdef WIN32
#if defined PACKETPARSE_BUILD_DLL
#defin... | true |