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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
75141d4985fae267bfc97ad81d033da86be9eb31 | C++ | yiyayiya557/epc | /Utility/H/CircularBuffer.h | UTF-8 | 1,761 | 3.09375 | 3 | [] | no_license | #ifndef __CircularBuffer_h__
#define __CircularBuffer_h__
#include "ReEntrantMutex.h"
#include "Semaphore.h"
#define DEF_STREAM_BUFFER_SIZE 4096 // 4K
PROJECT_NS_BEGIN
/****************************************************************************************
* Thread safe circular buffer,
* on write it will over... | true |
359a6f8ed5a7ee002b3798dc41e61773f74c28cc | C++ | tikhova/discrete-math-2018 | /Labs/S2 MATROID LAB/D.cpp | UTF-8 | 1,455 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <math.h>
using namespace std;
int main() {
freopen("cycles.in", "r", stdin);
freopen("cycles.out", "w", stdout);
// Input & check 1 axiom
int n, m;
cin >> n >> m;
vector<vector<int>> s(m);
vector<int> masks(... | true |
1b3d15ffdeeba77514cfe62952032438ef8e626f | C++ | anonymouslei/LeetCode | /tree/543_DiameterOfBinaryTree.cpp | UTF-8 | 1,075 | 3.28125 | 3 | [] | no_license | //
// Created by lei.ge on 6/11/2020.
//
//Runtime: 12 ms, faster than 74.24% of C++ online submissions for Diameter of Binary Tree.
//Memory Usage: 20.7 MB, less than 34.36% of C++ online submissions for Diameter of Binary Tree.
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
*... | true |
d6944f2bda137d3e8adb16c26a0d7e9363d53d13 | C++ | Longarithm/silver_marriage | /geometry/_standard_library.cpp | UTF-8 | 2,204 | 3.140625 | 3 | [] | no_license | bool eq(ld a, ld b) {
return (fabs(a - b) < eps);
}
struct pt {
ld x, y;
pt(): x(0), y(0) {}
pt(ld _x, ld _y) {
x = _x, y = _y;
}
void read() {
cin >> x >> y;
}
void print() {
cout << x << ' ' << y << endl;
}
friend bool eq(pt a, pt b) {
return eq(a.x, b.x) && eq(a.y, b.y);
}
friend bool o... | true |
896ff55e83b7b10c0ba06676b11cbe056ea2eab6 | C++ | wen96/pl-man2 | /masternetwork/src/CNetwork.cpp | UTF-8 | 2,989 | 2.921875 | 3 | [
"MIT"
] | permissive | #include "CNetwork.h"
#include "CNetworkServer.h"
///////////////////////////////////////////////////////////////////////////////
/// \brief Network constructor
///////////////////////////////////////////////////////////////////////////////
CNetwork::CNetwork()
: m_networkInitialized(false)
{}
///////////////////////... | true |
fc12a7d8c35a7e2f75481225938fc30de6811b1a | C++ | Bryanskaya/AnalysisOfAlgorithms | /lab_06/program/ant_search.cpp | UTF-8 | 4,070 | 2.6875 | 3 | [] | no_license | #include "ant_search.h"
matrix_double_t create_pheromone(int n)
{
matrix_double_t res;
vector<double> temp;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
temp.push_back(INIT_PHR);
res.push_back(temp);
}
return res;
}
double find_avg_path(matrix_t& c)
{
int n = c.size();
... | true |
56699fa792f8fd79a2ec15146b4eae61dc498437 | C++ | hizengbiao/SLR-compiler | /code/编译实验一【词法分析】/analyze.h | GB18030 | 4,223 | 2.53125 | 3 | [] | no_license | #pragma once
#include "defineAndStruct.h"
#include <stdio.h>
#include <sstream>
class analyze
{
string line; //ǰɨ
int i; //ǰɨַλ
char ch; //ǰɨַ
int ccount; //ǰɨ赽Ĵ
int po_ch; //ǰǼ˶ٸʶ
//int po_nu = 0; //ǰǼ˶ٸ
int nowline;//ǰɨǴеĵڼ
int count_err; //ǰɨĴ
char errs[60]; //Ϣ
int errsLine[60];//ÿԴек
string t... | true |
f45b6443c2c6f2af6a7f66e03dcbfc68af5bbbf7 | C++ | fineday009/Problemset_accepted | /树/lc102层次遍历.cpp | UTF-8 | 906 | 3.03125 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<vector<int>> levelOrder(TreeNode* root) {
vector<vector<int>> res;
if(!r... | true |
4b695b026d44d5a01d53a3d0cc920f8c47745bb8 | C++ | luguoss/test_leetcode | /20.有效的括号.cpp | UTF-8 | 995 | 3.296875 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=20 lang=cpp
*
* [20] 有效的括号
*/
// @lc code=start
#include <stack>
#include <unordered_map>
class Solution {
public:
bool isValid(string s) {
if(s.size() == 0)
{
return true;
}else if(s.size() % 2 == 1)
{
return false;
}... | true |
97e89193d011c91e5d630157dc06911f9c459610 | C++ | lyh458/InteractionModels_DemoCode | /src/iModOSG/MyInteractionTetrahedronMeshView.cpp | UTF-8 | 7,610 | 2.765625 | 3 | [] | no_license | //
// MyInteractionTetrahedronMeshView.cpp
// BoneAnimation
//
// Created by Christian on 30.11.13.
//
//
#include "MyInteractionTetrahedronMeshView.h"
using namespace MyInteractionMesh;
MyInteractionTetrahedronMeshView::MyInteractionTetrahedronMeshView(MyInteractionMeshModel* model) {
_model = model;
}
MyI... | true |
8ad085dd07648522f719424aaeed5c02604fff08 | C++ | david-browning/Queue-Game-Library | /QGL_Input/include/Helpers/qgl_pointer_helpers.h | UTF-8 | 2,681 | 2.625 | 3 | [] | no_license | #pragma once
#include "include/qgl_input_include.h"
#include "include/qgl_input_key.h"
namespace qgl::input
{
using input_mouse_button =
typename winrt::Windows::UI::Input::PointerUpdateKind;
constexpr std::array<winrt::Windows::UI::Input::PointerUpdateKind, 11>
pointer_keys =
{
input_mouse... | true |
9e27419d1f0a68e70595559266e932f014249de5 | C++ | HONGYU-LEE/NetWorkProgram | /IOMultiplexing/select/select_srv.cc | UTF-8 | 2,117 | 2.890625 | 3 | [
"MIT"
] | permissive | #include<iostream>
#include<string>
#include<unistd.h>
#include<sys/socket.h>
#include<arpa/inet.h>
#include<netinet/in.h>
#include"TcpSocket.hpp"
#include"select.hpp"
using namespace std;
int main(int argc, char* argv[])
{
if(argc != 3)
{
cerr << "正确输入方式: ./select_srv.cc ip port\n" << endl;
... | true |
aba2336ca4e17e83eb2d5d83bd5eef172b15c1e3 | C++ | MichaelSt98/NNS | /3D/MPI/MPI_NBody/include/Octant.h | UTF-8 | 2,814 | 3.109375 | 3 | [] | no_license | //
// Created by Michael Staneker on 25.01.21.
//
#ifndef NBODY_OCTANT_H
#define NBODY_OCTANT_H
#include "Vector3D.h"
#include <iostream>
#include <utility>
class Tree;
class Octant {
private:
double length;
Vector3D center;
public:
/**!
* Constructor for Octant class.
*
* @param _x x... | true |
fc81a355fd7666dc5b8c48b632aea93104b55798 | C++ | el-bart/ACARM-ng | /src/filternewevent/Filter/NewEvent/Exception.hpp | UTF-8 | 668 | 2.625 | 3 | [] | no_license | /*
* Exception.hpp
*
*/
#ifndef INCLUDE_FILTER_NEWEVENT_EXCEPTION_HPP_FILE
#define INCLUDE_FILTER_NEWEVENT_EXCEPTION_HPP_FILE
#include "Filter/Exception.hpp"
namespace Filter
{
namespace NewEvent
{
/** \brief base for all new-event-filter-related exceptions.
*/
class Exception: public Filter::Exception
{
public:
... | true |
95d0ea3592e1e5d6c36f08fd01d0d899ec708904 | C++ | wyuange/node_cpp_addon | /lib/bigNumber.cpp | UTF-8 | 6,386 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <stack>
#include <string>
#include <algorithm>
#include <node.h>
#include <node_object_wrap.h>
#include "bigNumber.h"
Local<String> ToLocalString(const char* str) {
Isolate* isolate = Isolate::GetCurrent();
EscapableHandleScope scope(isolate);
Local<String> s = String::NewFromUtf8(is... | true |
358811ca4e66c5ae11e0ee22846a91aa1fc258b7 | C++ | IsuraManchanayake/computer-graphics-assignments | /CGUtils/camera.cpp | UTF-8 | 3,153 | 2.828125 | 3 | [] | no_license | #include "camera.h"
#include <cmath>
#include <iostream>
CGUTILS_NAMESPACE_BEGIN
Camera::Camera() {
}
Camera::Camera(const Vector<3>& pos, double angle, const Vector<3>& coa, const Vector<3>& up, double n, double f)
: pos(pos),
angle(angle),
coa(coa),
n(n),
f(f) {
view = (coa - pos).... | true |
3a358aaf39761698f5567578c72ae753ca602077 | C++ | pp1565156/PetIBM | /src/utilities/SimulationParameters.h | UTF-8 | 1,582 | 2.578125 | 3 | [
"MIT"
] | permissive | /***************************************************************************//**
* \file SimulationParameters.h
* \author Anush Krishnan (anush@bu.edu)
* \brief Definition of the class `SimulationParameters`.
*/
#if !defined(SIMULATION_PARAMETERS_H)
#define SIMULATION_PARAMETERS_H
#include "types.h"
#include <i... | true |
a7c8e2f1e294bdadf420703d9c86572ebfc5e165 | C++ | midskavid/RenderingAlgorithms | /Assignment1/Source/Film.cpp | UTF-8 | 796 | 2.90625 | 3 | [] | no_license | #include "Film.h"
#include "../FreeImage/FreeImage.h"
void Film::AddColor(Point2i pt, RGBColor color) {
mFilm[pt[0]][pt[1]] = mFilm[pt[0]][pt[1]] + color;
}
void Film::WriteToImage(std::string fname) {
FreeImage_Initialise();
FIBITMAP* img = FreeImage_Allocate(mWidth,mHeight,24);
RGBQUAD c;
for(in... | true |
3c96df1eccf981e603a33570bd9831a516913c48 | C++ | obada-a/s3tp | /test/s3tp_start.cpp | UTF-8 | 1,397 | 2.5625 | 3 | [] | no_license | //
// Created by lorenzodonini on 06.09.16.
//
#include "../core/TransportDaemon.h"
int main(int argc, char ** argv) {
if (argc != 4) {
std::cout << "Invalid arguments. Expected unix_path, transceiver_type, start_prt" << std::endl;
return -1;
}
s3tp_daemon daemon;
TRANSCEIVER_CONFIG c... | true |
09ab0f458b7b78e9242d9754262770df2ce73473 | C++ | kyeonglinSong/algorithm_study | /C++/baekjoon_10448.cpp | UHC | 689 | 3.171875 | 3 | [] | no_license | // 19.09.16 ī ̷
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
vector<int> arr;
void calculate()
{
int n = 1;
while (n * (n + 1) / 2 < 1000)
{
arr.push_back(n * (n + 1) / 2);
n++;
}
}
bool triangularNum(int n)
{
for (int i = 0; i < arr.size() ; i++)
... | true |
2c145e4e463e1f0894966273f3825a846ed63156 | C++ | mmardanova/C-lab-5 | /src/task2.cpp | UTF-8 | 1,074 | 3 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include "task2.h"
void clearMatrix(char(*arr)[M])
{
for (int i = 0; i < M; i++)
{
for (int j = 0; j < M; j++)
{
arr[i][j] = ' ';
}
}
}
void fillMatrix(char(*arr)[M])
{
for (int i = 0; i < (M/2); i++)
{
for (int j... | true |
6eb3c7df748cd4831d8e61dd2edab271872263ff | C++ | mohamedmaged/heelo-world | /date.h | UTF-8 | 458 | 2.640625 | 3 | [] | no_license | #ifndef DATE_H
#define DATE_H
class date
{
private:
int day ;
int month;
int year;
public:
date (int d=0,int m=0,int y=0)
{
day =d;
month=m;
year=y;
}
void setday (int d){
day=d;
}
void setmonth (int m)
{
month=m;
}
void setyear (int y)
{
year=y;
}
int getday... | true |
26571d5e3c384a41810353d8ab71d44b582cea9f | C++ | calofmijuck/SNUCSE | /2017 Fall/Computer Programming/Studying Codes/Rational.cpp | UTF-8 | 2,168 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <cassert>
#include "Rational.h"
using namespace std;
Rational::Rational() {
SetNumerator(0);
SetDenominator(1);
}
Rational::Rational(int numer, int denom) {
SetNumerator(numer);
SetDenominator(denom);
}
Rational::Rational(const Rational &r) {
SetDenomi... | true |
579c44c06f801aba8c82c4c5f3b4c7f8c162c21b | C++ | Setyobudi/dasar-pemrograman | /Muhammad Hakim Setyobudi/tugas_2_Muhammad_Hakim_Setyobudi.cpp | UTF-8 | 1,082 | 2.625 | 3 | [] | no_license | #include<iostream>// #include<iostreem>
using namespace std;
int main()// Int main()
{
int nilai_a;// int nilai a; //deklarasi variabel dengan nama(nilai_a) sebagai integer
cout<<"Masukkan nilai a :"; ... | true |
3bbe3cc1b63106f5792c1aba474fab24a05af475 | C++ | imyjalil/NCRwork | /Data structures/Assignment 1/program2/program2.cpp | UTF-8 | 1,458 | 3.796875 | 4 | [] | no_license | #include "pch.h"
#include<string.h>
#include <iostream>
using namespace std;
class Stack
{
int top;
char *s;
int size;
public:
Stack()
{
top = -1;
}
void setsize(int a)
{
size = a;
s = new char[size];
}
void push(char a)
{
if (isfull())
{
cout << "Stack already full" << endl; return;
}
s[++t... | true |
b7c7743e7a1db3ac21af201c90fbe486ec46b8c3 | C++ | zteo-phd-software/ironstack | /common/timer.cpp | UTF-8 | 1,769 | 3.296875 | 3 | [
"BSD-3-Clause"
] | permissive | #include "timer.h"
// constructor
timer::timer() {
start();
deadline_ms_ = 0;
}
// sets the current time point and clears the sleep deadline
void timer::clear() {
start();
deadline_ms_ = 0;
}
// same as clear, but easier to understand in some code implementations
void timer::reset() {
clear();
}
// resets the ... | true |
e2dce0f21a1bc569169e47904adfda3bc17a1f7b | C++ | Sugrue/UOIT-Projects | /Introduction to Programming/Assignment 1/Exercise2.cpp | UTF-8 | 1,104 | 3.8125 | 4 | [] | no_license | #include <iostream>;
using namespace std;
int main(){
//Variable declaration
double dblAmountOfNumbers = 0, dblAverage = 0, dblNumber = 0;
int intNumOfPositiveNum = 0;
//requests user input for the amount of number he/she wishes to enter
cout<<"Please enter the amount of numbers you wish to enter : "<<endl;
cin... | true |
d95baf24421abca78982cd9e1e1f17adb96ddd06 | C++ | aah867/kmeans | /parallel/support.cpp | UTF-8 | 7,287 | 2.796875 | 3 | [] | no_license | #include <kmeans.h>
using namespace std;
unsigned int cluster_index[CLUSTER_SIZE];
#ifdef __linux__
double timespecDiff(struct timespec *timeA_p, struct timespec *timeB_p)
{
return ((timeA_p->tv_sec * 1000000) + timeA_p->tv_nsec/(double)1000) -
((timeB_p->tv_sec * 1000000) + timeB_p->... | true |
758dd8b7537f974cd85fd51ee022209faef49ca1 | C++ | aFleetingTime/Cpp | /14.OverloadedOperatorAndTypeConversion/42/FunctionObject.cpp | UTF-8 | 1,339 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
#include <functional>
#include <random>
using namespace std::placeholders;
int main()
{
std::vector<std::string> b;
std::copy(std::istream_iterator<std::string>(std::cin), std::istream_iterator<std::string>(), std::back... | true |
31bccddf4b4144f2c4b66168f1b2574237aa02e6 | C++ | Humblefool14/UVa-solutions | /Numbers/382 Perfection.cpp | UTF-8 | 462 | 3.03125 | 3 | [] | no_license | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
int t;
cout << "Perfection Output" << endl;
while(cin >> t,t>0)
{
int sum=0;
for(int i=2;i<=(t/2);i++)
{
if(t%i==0)
{
sum+=i;
}
}
if(sum > t) cout << t << " Abundant" << endl;
if(s... | true |
3670ae6107e4ba7773f621ae99b03510bc8af607 | C++ | 9chu/et | /src/Base.cpp | UTF-8 | 5,844 | 2.59375 | 3 | [
"MIT"
] | permissive | /**
* @file
* @author chu
* @date 2018/1/7
*/
#include <et/Base.hpp>
#include <set>
#include <fstream>
using namespace std;
using namespace et;
//////////////////////////////////////////////////////////////////////////////// LuaHelper
namespace
{
class KeywordList
{
public:
KeywordList()
... | true |
177abffdd102592b39da03d83fc1f0df9b8c2acb | C++ | ziyuhuang/BankingSystem | /Account.h | UTF-8 | 1,810 | 3.21875 | 3 | [] | no_license | //
// Account.h
// BankingSystem
//
// Created by ZIYU HUANG on 10/30/16.
// Copyright © 2016 ZIYU HUANG. All rights reserved.
//
#ifndef Account_h
#define Account_h
#include "Customer.h"
#include <string>
#include "DepositTransaction.hpp"
#include "WithdrawTransaction.hpp"
#include <list>
#include "Exception.h"
... | true |
02e74f8d84365d5e677a0c9d859de3a15801e353 | C++ | xb985547608/VIDICON | /InterfacialDesign/Switch/switchwidget.cpp | UTF-8 | 3,138 | 2.53125 | 3 | [] | no_license | #include "switchwidget.h"
#include "ui_switchform.h"
#include <QDebug>
SwitchWidget::SwitchWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::SwitchForm)
{
ui->setupUi(this);
connect(ui->btnWelcome, SIGNAL(clicked()), this, SLOT(onWelcomeBtn()));
connect(ui->btnPreview, SIGNAL... | true |
42619c5194e2e7be3a349eaad3edcd892f3c9fc9 | C++ | isant028/cs100_lab8_VisitorPattern | /Mult.hpp | UTF-8 | 988 | 3.140625 | 3 | [] | no_license | #ifndef __MULT_HPP__
#define __MULT_HPP__
#include "base.hpp"
class Mult : public Base {
public:
double value1;
double value2;
double testfinal;
Base* leftnode;
Base* rightnode;
Mult(Base* test1,Base* test2) : Base() {
leftnode = test1;
rightnode = test2;
v... | true |
666c5e3468ea79a568bd11ef0794d09e5ff676b1 | C++ | j-thomps21/CS | /IC210/homework/hw31/vector.h | UTF-8 | 279 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
struct Vector
{
int vals[4];
};
Vector operator-(Vector a, Vector b);
Vector operator+(Vector a, Vector b);
istream& operator>>(istream &in, Vector &a);
ostream& operator<<(ostream &out, Vector a);
| true |
304f4a9554c3f804ea828617f3b853adea1ecc3b | C++ | Reesing/learn | /cpp/cpp.primer/exercises/4.6/iter.cc | UTF-8 | 565 | 3.375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<string> svec = {"a","b","c","d","e"};
auto iter = svec.begin();
cout << "*iter++:" << *iter++ << endl;
//error:cout << "(*iter)++:" << (*iter)++ << endl;
//error:cout << "*iter.empty():" << *iter.empty() << endl;
c... | true |
27ce06beee903cfd8098bf62145de26077a676d4 | C++ | IamGary24/CollegeCourseWork | /GaryFowler_Program3Starcraft/GaryFowler_Program3Starcraft/SuperSoldier.cpp | UTF-8 | 3,555 | 3.078125 | 3 | [] | no_license | //SuperSoldier.cpp
//Class functions for Supersoldier derived class
//Created by: Gary Fowler
//for Dr. McWhorter CSCI 428 Program 3
#include "stdafx.h"
#include <iostream>
//included class definition files
#include "SuperSoldier.h"
//initialize flamethrower damage and ammo
int SuperSoldier::grenadeDamage = 40; //gr... | true |
da1c2baa4f11369b3ff04778be5af4c4b9403ec5 | C++ | ailyanlu1/Programming-Challenges | /poj/poj1625.cpp | UTF-8 | 5,212 | 2.65625 | 3 | [] | no_license |
# include <iostream>
# include <cstdio>
# include <cstring>
const int SMAX = 223;
const int CMAX = 50;
const int PMAX = 50;
const int NMAX = 10;
int ID_MAP[SMAX];
const int BASE = 10000;
const int DLEN = 100;
class BigInt {
public:
int n;
short d[DLEN];
BigInt(): n(1)
{
memset(d, 0, sizeof(s... | true |
a50e2487dbd76b7919c1a070c82c825dbc96c664 | C++ | Delt4Squad/Hand-Bot | /Recepteur.ino | UTF-8 | 2,126 | 2.65625 | 3 | [] | no_license | #include <VirtualWire.h>
const char* MSGA = "A"; //Avant
const char* MSGB = "B"; //Arriere
const char* MSGC = "C"; //Gauche
const char* MSGD = "D"; //Droite
const char* MSGE = "E"; //Avant + Droite
const char* MSGF = "F"; //Avant + Gauche
const char* MSGG = "G"; //Arriere + Droite
const char* MSGH = "H"; //Arriere + ... | true |
0d0290a937d062ed9e139c0d673be702ac6d63d8 | C++ | bnavarma/SharedMemory | /SharedMemory/b_tree.h | UTF-8 | 4,775 | 2.8125 | 3 | [] | no_license | #pragma once
#include "shared_memory.h"
#include "pool_allocator.h"
template <class A, class B>
class b_tree {
public:
IndexNode<A> *root;
void* page_start;
pool_allocator<IndexNode<A>, MaxSize>* idx_allocator;
pool_allocator<LeafNode<A, B>, MaxSize>* leaf_allocator;
pool_allocator<B, MaxSize>* data_allocator;
... | true |
cb2822b05f23a5487e671cbb01e7e01847328a7a | C++ | vgasparyan1995/OnLineHiring | /RandomPermutator.cpp | UTF-8 | 987 | 3.078125 | 3 | [] | no_license | #include "RandomPermutator.h"
#include <algorithm>
#define pow_3(n) ((n)*(n)*(n))
std::random_device RandomPermutator::s_rd;
std::mt19937 RandomPermutator::s_generator(s_rd());
int RandomPermutator::uniform_random(const int from, const int to)
{
std::uniform_int_distribution<> distributor(from, to);
return ... | true |
68909793b5236a7f01ae2250b1bd60e774de4426 | C++ | aorura/fontLength | /FontDumy/LengthCalculationDummy8.h | UTF-8 | 4,498 | 2.765625 | 3 | [] | no_license | #ifndef LENGTHCALCULATIONDUMMY8_H
#define LENGTHCALCULATIONDUMMY8_H
#include "LengthCalculationInterface.h"
#include <QObject>
class LengthCalculationDummy8 : public QObject, public LengthCalculationInterface
{
Q_OBJECT
Q_INTERFACES(LengthCalculationInterface)
public:
/// Konstruktor.
LengthCalcula... | true |
fc7adf3c1ba90aa44f8934d970fcc5c255eaf176 | C++ | yukarinoki/programing_contests | /joi2008-spring/closest_pair.cpp | UTF-8 | 1,436 | 2.90625 | 3 | [] | no_license | /******************************
verified by http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_5_A
******************************/
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
#define INF 1000000000.0;
typedef pair<double, double> P;
bool compare_y(P... | true |
63cf889b89c99863f0ea0d491ae3d8f22d52f02f | C++ | Chineseguuys/huawei2020Codecraft | /chusai/test_change_line.cpp | UTF-8 | 745 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <unistd.h>
// 使用 mmap 需要的头文件
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char** argv)
{
const char file... | true |
dd69062b233f2a11b8894a423c057f4aed1739f2 | C++ | Niraka/ThirdYearProject | /Include/ClientNetworking/NetworkTCPHandler.h | UTF-8 | 3,360 | 3.203125 | 3 | [] | no_license | /**
The NetworkTCPHandler is a component of the NetworkManager that handles TCP communication.
@author Nathan */
#ifndef NETWORK_TCP_HANDLER_H
#define NETWORK_TCP_HANDLER_H
#include <set>
#include <mutex>
#include <thread>
#include <memory>
#include <queue>
#include <SFML/Network.hpp>
#include "NetworkMessage.h"
#in... | true |
bd0c1edd520c34226ff988317b6ffb49d75c2785 | C++ | ChiaYi-LIN/Computer-Programming | /PSA06/b04704016_p1.cpp | UTF-8 | 972 | 4.03125 | 4 | [] | no_license | #include <iostream>
#include <cstdio>
using namespace std;
int main()
{
// aPtr will reference the first element of array a
int *aPtr, N;
int last;
// N is the size of array a
cout << "Please enter array size : ";
cin >> N;
// initial an array with size N
int a[N] = {0};
// put value in array a
... | true |
b9b4787789c7fee51af393746339f819d1641adb | C++ | CasperBHansen/CPP | /8/find.h | UTF-8 | 1,020 | 3.625 | 4 | [] | no_license | /*
* find.h
*
* Defines the generic function find(b, e, t)
*
* Description:
* Returns an iterator denoting the first occurrence of the value t,
* or for which the predicate p is true (if p is supplied), in the
* sequence denoted by the input iterators b and e. Returns e if no
* such element exists.
*/
#ifnde... | true |
88830cc223fcd081c189f57e0d1c0c135a1d6dbe | C++ | aphelps/Network-Boxes | /Networked_Boxes.ino | UTF-8 | 491 | 2.625 | 3 | [] | no_license | /*
* Box networking
*/
#include "messaging.h"
/* "Unique" ID for the node */
node_id_t local_ID = 0x4321;
void setup() {
}
void loop() {
unsigned char buffer[MSG_MAX_LENGTH];
msg_header_t *hdr = (msg_header_t *)buffer;
unsigned short read;
/* Receive a message directed to this node */
read = messagi... | true |
3e14a07849d1836363aabaa9002a4688e83e3c65 | C++ | raulmorenoamoretti/Sudoku | /sudo_f/main.cpp | UTF-8 | 623 | 3.1875 | 3 | [] | no_license |
#include <iostream>
#include "sudoku_3.h"
#include "sudoku_2.h"
using namespace std;
int num;
int main() {
sudoku_2 sudo2;
sudoku_3 sudo3;
cout<<"Elige un numero:\n 1. Dibuja Soduko 3x3,"
"\n 2.Dibuja Soduko 2X2"
"\n 3. Jugar sudoku 3X3"
"\n 4. Jugar sudoku 2x2" << endl;
... | true |
0d4e008f63f2772c509107ea78c6a12dcdcacb48 | C++ | NickPollard/Stellariad | /src/system/hash.cpp | UTF-8 | 2,216 | 3.078125 | 3 | [] | no_license | // hash.c
#include "common.h"
#include "hash.h"
//-----------------------
#include "mem/allocator.h"
unsigned int mhash( const char* src ) {
unsigned int seed = 0x0;
int len = strlen( src );
return MurmurHash2( src, len, seed );
}
/*
void* hashtable_findOrAdd( hashtable, key ) {
}
void* hashtable_find( hashtable,... | true |
c459c91beac311b309d4750a10721537d930211a | C++ | Guillem96/Allegro-PokemonGame | /Game/Game/objectslist.cpp | UTF-8 | 1,515 | 3.21875 | 3 | [] | no_license | #include "objectslist.h"
Olist Olist_create(){
Olist ol;
ol.f = (NodeO*)malloc(sizeof(NodeO));
if (ol.f == NULL){
printf("\nList is not created");
}
else{
(*(ol.f)).seg = NULL;
ol.prv = ol.f;
}
return ol;
}
Olist Olist_insert(Olist ol, Object o){
NodeO *aux;
aux = (NodeO*)malloc(sizeof(NodeO));
if (... | true |
7b718788212098b00d53e9f201791d6a1a8041c0 | C++ | SummerZJU/Data-Structure-Visualization | /project/Common/Parameter/IntParameter.cpp | UTF-8 | 279 | 2.71875 | 3 | [
"MIT"
] | permissive | #include "IntParameter.h"
IntParameter::IntParameter(int para):
para(para)
{
}
IntParameter::~IntParameter()
{
}
int IntParameter::get() const
{
return para;
}
void IntParameter::set(int para)
{
this->para = para;
}
IntParameter::operator int() const
{
return get();
} | true |
bac12d08907163185225061a8e22a5b255a745e8 | C++ | DanNixon/CSC3224_CSC3222_Gaming | /Engine_UIMenu/MenuItem.cpp | UTF-8 | 1,594 | 2.734375 | 3 | [] | no_license | /**
* @file
* @author Dan Nixon (120263697)
*
* For CSC3224 Project 1.
*/
#include "MenuItem.h"
#include <Engine_Graphics/Alignment.h>
#include <Engine_Graphics/RectangleMesh.h>
#include "IMenu.h"
using namespace Engine::Graphics;
namespace Engine
{
namespace UIMenu
{
/**
* @brief Creates a new menu item... | true |
939cfc3c6dd7701985af83498144fb7f046962c2 | C++ | stharakan/par_nystrom | /gaussKernel.hpp | UTF-8 | 1,575 | 3.203125 | 3 | [] | no_license | #include "El.hpp"
#include "math.h"
//#include "omp.h"
//#include "kernel_inputs.hpp"
#include <iostream>
#include <functional>
using namespace El;
class GaussKernel {
public:
// Kernel Params
double sigma;
double gamma;
// Grid
const Grid* grid;
GaussKernel(){};
/*
* Constructor:
* kernel_in... | true |
3fd1e84f7dfd7cf36bf66bb86a1b584509e02b5a | C++ | kmunson/CommentReflowerVSIX | /CommentReflowerTest/Compare/RegressionBullets.compare.cpp | UTF-8 | 1,781 | 3.3125 | 3 | [] | no_license | // 1) test - just a single line bullet
// 2) test - This line is far too long and so should wrap to the right hand side
// of the word test
// 3) test - this bullet is wrapped too short and so should be merged
// Text at a normal indentation after a bullet. This should wrap normally.
// 1) A different type of bulle... | true |
059c650f76027106e80049e634dba52c451675ce | C++ | eklavaya2208/practice-ml-cp | /Algorithmic Toolbox/week3_greedy_algorithms/car_fueling.cpp | UTF-8 | 582 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
inline int MinRefills(vector<int> x, int n, int L){
int lr=0,cr=0,ans=0;
while(cr<=n){
lr = cr;
while(cr<=n && x[cr+1]-x[lr]<=L){
cr++;
}
if(cr==lr){
return -1;
}
if(cr<=n){
... | true |
8811b6d5b74c1850664ed9e8151f98466eff1de3 | C++ | ayamahmod/competitive-programming | /CodeForces/231A-Team.cpp | UTF-8 | 265 | 2.734375 | 3 | [] | no_license | //http://codeforces.com/problemset/problem/231/A
#include<iostream>
using namespace std;
int main()
{
int n,x,y,z,num=0;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>x>>y>>z;
if((x+y==2)||(y+z==2)||(x+z==2))
num++;
}
cout<<num<<endl;
return 0;
}
| true |
fc86dbb86a31217aebda831e3f0dd0553d717a89 | C++ | gundamace17/LeetCode | /C++/0001. Two Sum.cpp | UTF-8 | 938 | 3.453125 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <unordered_map>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
unordered_map<int, int> prevMap;
for (int i = 0; i < nums.size(); i++) {
int diff = target - n... | true |
6e4538fd768c4927bfbcecb8f541e1bfe4aec208 | C++ | ShingenTakeda/Ikemen-PP | /src/Common.hpp | UTF-8 | 825 | 2.796875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <string>
#include <iostream>
#include <cstdint>
#include <math.h>
class Common
{
public:
//Message whoever made this and ask them what this does
/*
IMax = int32(^uint32(0) >> 1)
IErr = ^IMax
*/
int32_t Random();
int Srand(int32_t s);
... | true |
9a6046bc0a6129e5bee2ae4e65a5743db4929aca | C++ | anixpower/Arduino | /anix_robot/anix_robot.ino | UTF-8 | 1,117 | 2.6875 | 3 | [] | no_license | String message; // variabila bluetooth
// 1 si r stanga si dreapta x spate si o fata
void setup(){
pinMode(13,OUTPUT);
pinMode(12,OUTPUT);
pinMode(11,OUTPUT);
pinMode(10,OUTPUT);
Serial.begin(9600);
}
void loop(){
while(Serial.available())
{
message+=char(Serial.read());//salveaza in vari... | true |
ca1e306c0a3c9028270b8ab08df22cf95f4a33e5 | C++ | windystrife/UnrealEngine_NVIDIAGameWorks | /Engine/Source/ThirdParty/llvm/3.6.2/include/clang/Analysis/Analyses/ThreadSafetyLogical.h | UTF-8 | 2,717 | 2.625 | 3 | [
"MIT",
"LicenseRef-scancode-proprietary-license"
] | permissive | //===- ThreadSafetyLogical.h -----------------------------------*- C++ --*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | true |
1dc0d7d49f4bd365c502451784b694f74cb0a1aa | C++ | MH15/swerve-arduino-core | /swerve.ino | UTF-8 | 8,946 | 2.59375 | 3 | [] | no_license | #include "BigMotor.h"
#include "Step.h"
// defines pins numbers
const int stepPin = 4;
const int dirPin = 3;
const int victor_pin = 5;
// declare the motors
Step stepper(8);
BigMotor motor(9);
// Bluetooth
#define HC06 Serial3
// void setup()
// {
// pinMode(LED_BUILTIN, OUTPUT);
// Serial.begin(9600);
// ... | true |
6c487a533b26ec66d2e55aa03a415f39921f429e | C++ | sunayski/notSofiaLib | /src/Misc/IdHolder.h | UTF-8 | 232 | 2.65625 | 3 | [] | no_license | #ifndef ID_HOLDER_H
#define ID_HOLDER_H
#include "Holder.h"
class IdHolder : public Holder<int> {
public:
using Holder<int>::Holder;
int id() const {
return Holder<int>::value();
}
};
#endif // ID_HOLDER_H
| true |
eb3e3b270e947028979f09b8d10953a745531ec6 | C++ | DHaylock/CuisineColour | /src/ImageController.h | UTF-8 | 3,146 | 2.546875 | 3 | [] | no_license | //
// ImageController.h
// CusineColor
//
// Created by David Haylock on 10/02/2015.
//
//
enum AnimationType
{
ANIMATION_TYPE_BACK,
ANIMATION_TYPE_BOUNCE,
ANIMATION_TYPE_CIRC,
ANIMATION_TYPE_CUBIC,
ANIMATION_TYPE_ELASTIC,
ANIMATION_TYPE_EXPO,
ANIMATION_TYPE_LINEAR,
ANIMATION_TYPE_QUA... | true |
6daef8e57cf389d28304fa96d33f7d601c3a38a3 | C++ | MiladShafiee/Surena4HumanoidSimulation-Choreonoid | /src/Util/YAMLWriter.h | UTF-8 | 3,368 | 2.8125 | 3 | [
"MIT",
"IJG",
"Zlib"
] | permissive | /**
@author Shin'ichiro Nakaoka
*/
#ifndef CNOID_UTIL_YAML_WRITER_H
#define CNOID_UTIL_YAML_WRITER_H
#include "ValueTree.h"
#include <boost/lexical_cast.hpp>
#include <stack>
#include <string>
#include <fstream>
#include "exportdecl.h"
namespace cnoid {
class CNOID_EXPORT YAMLWriter
{
public:
YAMLWriter(cons... | true |
75175e470c9ba9b562365387cb4df2cb6b08daa7 | C++ | OS2World/APP-GRAPHICS-Dovetail | /control.cc | UTF-8 | 685 | 2.71875 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | #include "control.h"
// basic functions shared by all controls
Control::Control(HWND hParent, ULONG ulId)
{
fCreated=FALSE;
if(ulId > 0)
hWnd = WinWindowFromID(hParent,ulId);
}
BOOL Control::Hide()
{
return (BOOL) WinShowWindow(hWnd, FALSE);
}
BOOL Control::Show()
{
return (BOOL) WinShowWindo... | true |
f0c17c2fd5bcf456785f2daac2d55c5747f2021b | C++ | mirmik/ralgo | /ralgo/third/terathon/TSMatrix2D.h | UTF-8 | 14,020 | 2.875 | 3 | [
"MIT"
] | permissive | //
// This file is part of the Terathon Math Library, by Eric Lengyel.
// Copyright 1999-2022, Terathon Software LLC
//
// This software is distributed under the MIT License.
// Separate proprietary licenses are available from Terathon Software.
//
#ifndef TSMatrix2D_h
#define TSMatrix2D_h
//# \component Math Library... | true |
7e701f10d05acac69e64779e3a0fe1239ad00d56 | C++ | naohisas/KVS | /Source/Core/Network/SocketAddress.cpp | UTF-8 | 9,084 | 2.828125 | 3 | [
"BSD-3-Clause",
"MIT",
"Zlib",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] | permissive | /****************************************************************************/
/**
* @file SocketAddress.cpp
* @author Naohisa Sakamoto
*/
/****************************************************************************/
#include "SocketAddress.h"
#include <cstdlib>
namespace kvs
{
/*============================... | true |
a5f26cf84233dc05570344a0faf8975adfb35d6a | C++ | lukemcraig/PanningTheory | /Source/MatrixRenderer.cpp | UTF-8 | 3,424 | 2.515625 | 3 | [] | no_license | /*
==============================================================================
MatrixRendererImplementation.h
Created: 22 Apr 2018 8:56:43pm
Author: Luke
==============================================================================
*/
#include "../JuceLibraryCode/JuceHeader.h"
#include "Matrix... | true |
710d0c633de9b3a6551601dc4947de9ab981753a | C++ | michaljanus90/FactoryMock | /tests/CopyTest.cpp | UTF-8 | 1,479 | 2.765625 | 3 | [] | no_license | #include "Filesystemhelpers.hpp"
#include "Usage.hpp"
#include "ItemMock.hpp"
#include "FactoryMock.hpp"
#include <memory>
#include "gtest/gtest.h"
using namespace src;
class FileSystemTC : public testing::Test
{
public:
FileSystemTC()
{
std::cout<< "Running Ctor\n";
createDirectory(path);
... | true |
557ab7d6d6f0322dd5e37cc4cd4321b0280ef405 | C++ | faultyagatha/res15-opengl | /frustumCullingExample_complete/src/ofApp.cpp | UTF-8 | 6,275 | 3.09375 | 3 | [
"MIT"
] | permissive | #include "ofApp.h"
// HERE'S THE GENERAL IDEA:
//
// 0. Place some spheres at random positions into the scene.
// 1. Calculate which spheres can be culled from camera 0's view
// 2. Flag the culled spheres, so they will be rendered in red instead of white.
// 3. Draw the scene.
// 4. Then: BONUS: draw the culling came... | true |
11d9fa80fcd202c6a3f31e86372d7558fbc42521 | C++ | polansks/CS-162-FinalProject | /Player.hpp | UTF-8 | 1,071 | 2.8125 | 3 | [] | no_license | /****************************************************************
** File Name: Player.hpp
** Author: Scott Polansky
** Date: Dec 5, 2017
** Description: A class for the player in the game
****************************************************************/
#ifndef Player_hpp
#define Player... | true |
2134b8a90b43f3c0e296c39aa94cc640788eb0bf | C++ | ewuharun/Algorithm | /BFS/the_flight_plane.cpp | UTF-8 | 1,414 | 2.578125 | 3 | [] | no_license | #include<iostream>
#include<stdio.h>
#include<vector>
#include<queue>
using namespace std;
int graph[1005][1005];
int visited[1005];
int dis[1005];
int parents[1005];
int count=0;
queue<int>arr;
void printpath(int x,int y,int node)
{
if(parents[y]==-1){
return ;
}
printpath(x,pa... | true |
7015fe306232c49b798deff37fb51b7c9130c748 | C++ | marcinlos/zephyr | /Zephyr/src/zephyr/glfw/input_adapter.cpp | UTF-8 | 5,451 | 2.609375 | 3 | [] | no_license | /**
* @file input_adapter.cpp
*/
#include <zephyr/glfw/input_adapter.hpp>
namespace zephyr {
namespace glfw {
Key keyFromGLFW(int key) {
switch (key) {
case GLFW_KEY_A: return Key::A;
case GLFW_KEY_B: return Key::B;
case GLFW_KEY_C: return Key::C;
case GLFW_K... | true |
3d6bacaa626c8aa56b6a723e8c0a66f402c028a0 | C++ | WildGenie/VirtualGameSandbox | /CppVhdAPI/Registry/RegTest.cpp | UTF-8 | 1,205 | 2.71875 | 3 | [
"Zlib"
] | permissive | #pragma warning(disable: 4201) // nameless struct/union
#include <windows.h>
#include <tchar.h>
#pragma warning(default: 4201)
#include "RegistryKey.hpp"
#include <iostream>
using namespace JetByteTools;
int main()
{
try
{
//CRegistryKey key = CRegistryKey(HKEY_LOCAL_MACHINE, _T("SOFTWARE"));
... | true |
fcd96cedceb232b20ff62a5c90b50cc04b7fee37 | C++ | MaksPetrov/lab21 | /#6.cpp | UTF-8 | 406 | 2.96875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
string str, s = "";
getline(cin, str);
unsigned i = str.length()-1;
int count = 0;
while(count!=2)
{
if(int(str[i])==92)
{
count += 1;
}
i -= 1;
}
i += 2;
while(int(... | true |
e2979eb1ec0abe88799cde8b69f5f3b9fc74fc64 | C++ | joonas-yoon/PS | /Kakao/Blind Recruitment/2018/2.cpp | UTF-8 | 1,051 | 2.828125 | 3 | [] | no_license | #include <string>
#include <vector>
using namespace std;
using lld = long long;
struct Round {
int score;
char bonus, opt;
};
int powWithBonus(int k, char bns) {
int x = 1, res = k;
if (bns == 'D') x = 2;
else if (bns == 'T') x = 3;
while (--x > 0) res *= k;
return res;
}
int solution(string dartResult) {
v... | true |
de5947a8e3dd0a86612a49748704ab2cb03d9316 | C++ | darrell24015/Uno | /Grove_LED_Button/Grove_LED_Button.ino | UTF-8 | 774 | 2.90625 | 3 | [
"CC0-1.0"
] | permissive | /* Grove_LED_Button
* Demo of Grove - Starter Kit
* Loovee 2013-3-10
* This demo will show you how to use Grove Touch Sensor Button to control a LED
* Also works the same way with the mechanical button
* Grove - Button connect to D3
* Grove - LED connect to D7
*/
// Define your pins
const int pinButton = 3;
const int... | true |
04988dc8e4ec8088426dbba55aaadf58c9e9bb67 | C++ | henke37/psf-shellext | /Mininscf-shellext/psfParser.cpp | UTF-8 | 3,729 | 2.578125 | 3 | [] | no_license | #include "common.h"
#include "psfParser.h"
#include <cstring>
PsfParser::PsfParser(IStream *_stream) : stream(_stream) {
stream->AddRef();
}
PsfParser::~PsfParser() {
stream->Release();
}
HRESULT PsfParser::readLong(uint32_t &out) {
HRESULT hresult;
ULONG bytesRead;
CHAR readBuf[4];
hresult=stream->Read(&vers... | true |
b6cf5c594c80ef2c945059ef39edb6be3a223005 | C++ | lwxwx/multi-master-tool | /easy_logger/test_main.cc | UTF-8 | 1,800 | 2.578125 | 3 | [
"MIT"
] | permissive | /*
* @Author: wei
* @Date: 2020-06-16 10:25:27
* @LastEditors: Do not edit
* @LastEditTime: 2020-06-16 15:14:57
* @Description: file content
* @FilePath: /multi-master-tool/easy_logger/test_main.cc
*/
#include "include/easylogger.h"
#include <iostream>
// void fun1()
// {
// EasyLogger("fun","./async_log.t... | true |
3bbc7666238b7825e5c5e6fc5e9ef9bb0a66928c | C++ | lucianap/7559-tp1 | /src/Status/Status.cpp | UTF-8 | 3,646 | 2.734375 | 3 | [] | no_license | //
// Created by nestor on 23/09/19.
//
#include <Signal/SignalHandler.h>
#include <Informe/Informe.h>
#include "Status.h"
#include "SolicitudStatus.h"
Status::Status(Logger &logger) : ProcesoHijo(logger) {}
Status::~Status() {
}
void Status::cargar(std::string statusSerializado) {
//TODO
//implementar le... | true |
ba516046407c585b642f1f7c4ea4fda1684dcd50 | C++ | epidersis/olymps | /327A/327A.cpp | UTF-8 | 581 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
short n, temp, max = 0;
cin >> n;
bool *arr = new bool[n];
for (short i = 0; i < n; i++) cin >> arr[i];
for (short k = 0; k < n; k++)
{
for (short i = 0; i < n - k; i++)
{
for (short j = i; j < n - k... | true |
d32d70f955385688da627d238f39586e4dab1152 | C++ | ji12345ba/CS225-UIUC | /lab_memory/tests/catchlib.cpp | UTF-8 | 2,168 | 3.0625 | 3 | [] | no_license | #include "catchlib.hpp"
namespace cs225
{
bool fileExists(std::string fileName)
{
std::ifstream f(fileName.c_str());
bool exists = f.good();
f.close();
return exists;
}
void print_valgrind()
{
std::cout << "===============================================================================" << ... | true |
dd3a5f7b1be186867d75356945e2d52657474acd | C++ | eatoncns/sdl-asteroids | /asteroids/src/gameTest/cpp/GameLoopTest.cpp | UTF-8 | 2,805 | 2.984375 | 3 | [] | no_license | #include <gmock/gmock.h>
#include <GameLoop.hpp>
#include <Game.hpp>
#include <TestTimer.hpp>
#include <boost/assign/list_of.hpp>
#include <list>
#include <string>
using namespace pjm;
using namespace boost::assign;
using ::testing::Eq;
using ::testing::ElementsAre;
struct TestGame : public Game
{
TestGame()
... | true |
3bf44434e345d6eadd4f3fccb92a4b282ae173eb | C++ | AndreSci/Cpp | /lesson_007/queue.cpp | UTF-8 | 959 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
int Q(5), people(0);
int worry_peop_step(0);
cin >> Q;
int* worry_people = new int [Q];
for (int e(0); e < Q; e++)
worry_people[e] = 0;
vector<string> i;
string come_quiet;
for (int p(0); p < Q; p++)
{
cin >>... | true |
1666e21fe9d5a68e6e2678def45a1f758c9ea797 | C++ | arash-ha/Cpp | /Find All Numbers Disappeared in an Array.cpp | UTF-8 | 1,405 | 3.703125 | 4 | [] | no_license | /*
Find All Numbers Disappeared in an Array
Given an array of integers where 1 = a[i] = n (n = size of array), some elements appear twice and others appear once.
Find all the elements of [1, n] inclusive that do not appear in this array.
Could you do it without extra space and in O(n) runtime? You may assume the retur... | true |
d7fda6f428f94f687c89b4f6717a92ad13e49fee | C++ | nikhildhruwe/cpp_practice | /primeFactor.cpp | UTF-8 | 406 | 3.546875 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int number ;
cout<<"Enter a number"<<endl;
cin>>number;
while(number%2==0)
{
cout<<"2 ";
number/=2;
}
for (int i = 3; i*i<=number; i+=2){
while (number%i==0){
cout<< i << " ";
number/=i;
... | true |
6c744328cb566cd8614d964382034a918dc4317a | C++ | BenWeber42/algo-labs | /week2/03_aliens/solution.cpp | UTF-8 | 1,897 | 2.921875 | 3 | [] | no_license | #include <cassert>
#include <iostream>
#include <utility>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
int tests;
cin >> tests;
for (int test = 0; test < tests; ++test) {
int n, m;
cin >> n >> m;
vector<pair<int, int>> in... | true |
3f2b486c5d734ebb0fa21032cc46bc4f84d4b28e | C++ | Sabuj-Kumar/Problem_Solve | /sabuj/Rahul vai/Projects and presentation/60-65-66/Final(joma deoyar jonno)/code.cpp | UTF-8 | 4,136 | 2.9375 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cstring>
using namespace std;
struct data
{
char Airlines_name[1000];
int Planes;
bool available;
char t_list[100][20];
}all[1000];
void data_print(data A)
{
printf("%s has ",A.Airlines_name);
printf("%d Planes \nstatus: ",A.Pla... | true |
030015bb80e387189d9788f4804e1ca67ff04d8e | C++ | shishir-roy/competitive-programming-master | /LightOJ/1276 - Very Lucky Numbers.cpp | UTF-8 | 1,377 | 2.625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
vector<long long int>lucky,vlucky;
void lucky_gen(long long int num)
{
if(num>1000000100000LL)
{
return;
}
if(num!=0)
{
lucky.push_back(num);
}
lucky_gen(num*10+4);
lucky_gen(num*10+7);
}
set<long long int>st;
... | true |
6770f2cf7f4525ac81813e91427846ab2dfb1c6d | C++ | DecimatorMind/Code-Chef-CPP-Answers | /Code Chef C++ Answers/FLOW004.cpp | UTF-8 | 460 | 2.796875 | 3 | [] | no_license | //
// FLOW004.cpp
// Code Chef C++ Answers
//
// Created by Pranjal Bhardwaj on 24/07/20.
// Copyright © 2020 Pranjal Bhardwaj. All rights reserved.
//
#include <iostream>
using namespace std;
int flow004(){
int iter;
cin >> iter;
for(int i = 0;i < iter;i++){
int n,temp = 0,flag;
cin >... | true |
7f05a0370a807fd9f2177f5b9f68cddfbbb488b7 | C++ | m1h4/Touch | /Sound.h | UTF-8 | 565 | 2.71875 | 3 | [
"MIT"
] | permissive | #pragma once
class Sound
{
public:
Sound(void) : mBuffers(NULL), mBufferCount(0) {}
~Sound(void) { Unload(); }
bool LoadFromFile(LPCTSTR path,unsigned long buffers = 8);
bool LoadFromMemory(LPWAVEFORMATEX format,unsigned char* data,unsigned long size,unsigned long buffers);
void Unload(void);
bool Play(bool lo... | true |
f5506bc12321140325098179d2aec02a6292c4cc | C++ | hiddeninplainsight/EmbeddedHelperLibrary | /tests/exponential_smoothing.tests.cpp | UTF-8 | 1,480 | 3.046875 | 3 | [
"MIT"
] | permissive | #include <ehl/exponential_smoothing.h>
#include <unity_cpp.h>
#include <ehl/algorithm.h>
TEST_GROUP(exponential_smoothing);
TEST_SETUP(exponential_smoothing)
{
}
TEST_TEAR_DOWN(exponential_smoothing)
{
}
TEST(exponential_smoothing, A_smoothing_factor_of_1_applies_no_smoothing)
{
ehl::exponential_smoothing<float> sm... | true |
686589e7c43cfb50397bc7b5a64d3a0e1a9d89a9 | C++ | Hendra89ms/Cpp_Program | /Faktorial2.cpp | UTF-8 | 332 | 3.421875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int faktorial (int n);
int main(){
int angka,hasil;
cout<<"Menghitung faktorial : ";
cin>>angka;
hasil=faktorial(angka);
cout<<"\nNilainya adalah : "<<hasil<<endl;
}
int faktorial(int n){
if (n<= 1){
cout<<n;
return n;
}else{
cout<< n << "*";
return n*faktorial(n... | true |
259fa25a41b26dea9b748c3b4842223c5186146a | C++ | MadisonStevens98/Hotel-Booking-Demo | /Main.cpp | UTF-8 | 4,387 | 3.421875 | 3 | [] | no_license |
#include <iostream>
#include <string>
#include <fstream>
#include "Hotel.h"
#include "Room.h"
using namespace std;
char charinput;
int intinput;
string date;
Room arrayofcourtyardrooms[70];
Room arrayofscenicrooms[35];
Room arrayofsuiterooms[15];
Room arrayofpenthouserooms[2];
void myfilewriter(Hotel... | true |
79645a27c3f53135a1ccc1585c9e43a3062fb975 | C++ | ashehata277/Projects-C- | /Arrays/String class.cpp | UTF-8 | 394 | 3.1875 | 3 | [] | no_license | #include<iostream>
#include<string> //for string class
using namespace std;
int main()
{
string s1="Man ";
string s2="Beast";
string s3;
s3=s1; //assign and without the library cant write that
cout<< s3<<endl;
s3= "neither "+s1+" nor "; //concatenate
s3+=s2; //concatenate
cout<< s3<< end... | true |
91ef1a285c1670795fb60e7fcd2154355eb88380 | C++ | jjuiddong/Common | /Motion/script/mathscript.h | UHC | 1,295 | 2.5625 | 3 | [
"MIT"
] | permissive | // ͽ ũƮ ü
#pragma once
namespace mathscript
{
//-----------------------------------------------------------------------------------------
// Mixing Command Parser
struct sFactor;
struct sDTerm;
namespace OP_MULTI {
enum TYPE {
MULTI, DIVIDE
};
}
namespace OP_PLUS {
enum TYPE {
PLUS, MINUS
}... | true |
010f017f978a81b52880f1236ba247495bf86f2e | C++ | FabienPean/vectr | /example.cpp | UTF-8 | 1,920 | 3.3125 | 3 | [
"MIT"
] | permissive | #include "vectr.h"
#include <vector>
#include <iostream>
struct X {
static inline int n = 0;
int x;
X(int i) : x(i) { std::cout << "constructed-default" << std::endl; ++n; }
X() { std::cout << "constructed-default" << std::endl; ++n; }
X(X&& y) { std::cout << "constructed-move" << std::endl; x = y.x... | true |
d56d38c3b2881d01128ce6844a501126ea643c34 | C++ | Tonmoy55/Basic-Problem-Solving | /armostrong_number.cpp | UTF-8 | 740 | 3.1875 | 3 | [] | no_license | #include <bits/stdc++.h>
#include <conio.h>
using namespace std;
int power(int rem , int a)
{
int pow=1,i=1;
while(i<=a)
{
pow=pow*rem;
i++;
}
return pow;
}
int main()
{
int i,digit=0,rem,sum=0;
int a,b;
cout<< "Enter a number to check armstrong... | true |
d41db507ef025decb269e5a5754dc9d78d91ca81 | C++ | aruna09/Competitive-Programming | /Codechef/DEM5.cpp | UTF-8 | 556 | 2.859375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
long int a=0, b=0, sum=0;
cin>>a>>b;
if((b-a+1)%2==0){
int temp = (b-a+1)/2;
while(temp--){
sum = sum+a*a+b*b;
a++;
b--;
}
cout<<s... | true |