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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
140851c9e318c0a942bbea7363bd621105200018 | C++ | OpenEngineDK/extensions-MusicPlayer | /Sound/BruteTransitionMode.cpp | UTF-8 | 1,712 | 2.5625 | 3 | [] | no_license | #include <Sound/BruteTransitionMode.h>
#include <Sound/ISound.h>
#include <Utils/Timer.h>
namespace OpenEngine {
namespace Sound {
BruteTransitionMode::BruteTransitionMode(Time newintime, Time newoutime) {
intime = newintime;
outtime = newoutime;
done = true;
timer.Reset();
}
BruteT... | true |
2047e091313501665a08183babe0085ac9c6c967 | C++ | sorydi3/practica_S1 | /Cim.cpp | IBM852 | 1,042 | 2.59375 | 3 | [] | no_license | #include "Cim.h"
//Nom:Ibrahima Sory Diallo
//Usuari:u1939649
//Practica N:S1
Cim::Cim()
{
_nom = "";
_alcada = 0;
}
Cim::Cim(std::string nom, unsigned alcada,Coordenada coordenada)
{
_nom = nom;
_coordenada = coordenada;
_alcada = alcada;
}
void Cim::mostrar() const
{
//) comarca: 14 15 (Bergued,Cerdanya)
co... | true |
27b7d85cdcc8af8290bdc124047e80c8f77f8be0 | C++ | Abhay4/Algorithm | /LeetCode/searchRange.cpp | UTF-8 | 1,390 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(a);i>=(b);--i)
class Solution {
public:
vector<int> searchRange(int A[], int n, int target) {
vector<int> ret;... | true |
56385eb0291390318f200e31716207473ca1d644 | C++ | paalig/Module_016_06_003 | /main.cpp | UTF-8 | 1,973 | 3.703125 | 4 | [] | no_license | #include <iostream>
#include <vector>
/*
* В базу данных, являющуюся вектором, с клавиатуры приходят целочисленные значения, и помещаются в конец.
* Однако, эта база может хранить только 20 элементов, а дальше необходимо будет удалять элементы,
* которые лежат в базе дольше всех.
* При вводе -1 с клавиатуры необх... | true |
c8eb432519beb18ebe26c5ac75c56301b0bf546f | C++ | shenjianan97/An-Arduino-powered-drawing-robot | /master/Final_master_vs1.ino | UTF-8 | 14,615 | 2.671875 | 3 | [] | no_license | #include <SoftwareSerial.h>
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(19, 18, 17, 16, 7, 2);
char val; //存储接收的变量
SoftwareSerial BT(14, 15); //新建对象,接收脚为8,发送脚为9
String inString = "";
// setup servo
int PEN_DOWN = 10; //... | true |
5c7a8d590c7dfc52e6e3fd4365213c6d326ec00c | C++ | YChuan1115/ShapeFitting | /ShapeFitting/Util.cpp | UTF-8 | 10,832 | 2.9375 | 3 | [] | no_license | #include "Util.h"
/**
* Find the contour polygons from the image.
*/
std::vector<std::vector<cv::Point2f>> findContours(const cv::Mat& image, int threshold, bool simplify, bool allow_diagonal, bool dilate) {
std::vector<std::vector<cv::Point2f>> polygons;
cv::Mat mat = image.clone();
cv::threshold(mat, mat, thre... | true |
bd1c0e138b4a81fd6672b0ca3081e2a10d3f3eb9 | C++ | sw561/TestTemplate | /demo.cpp | UTF-8 | 590 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include "demo.h"
#include "debug.h"
#include "parameter.h"
#ifdef DEBUG
#define DIAGNOSE_ADD(x,y,z) if (debug>0) diagnose_add(x,y,z);
#else
#define DIAGNOSE_ADD(x,y,z)
#endif
int add(const int a, const int b)
{
static const int factor = Parameter::inst()->factor;
int z = (a+b) * factor;
DIAG... | true |
9e29ff04439c041904719839af449067fa657ca9 | C++ | Kajiysor/UJ_CPP | /Dziennik Elektroniczny/person.h | UTF-8 | 640 | 2.953125 | 3 | [] | no_license | #ifndef PERSON_H
#define PERSON_H
#include <string>
class Person
{
public:
Person(const std::string &, const std::string &, const std::string &);
Person(const Person &);
virtual ~Person() {}
void setFirstName(const std::string &);
std::string getFirstName() const;
void setLastName(const std... | true |
3ae8d7e7322cda388a9a7bed7ef63280c98e1cd3 | C++ | Ppito/PuppetFTP | /PuppetFTP-WebServer/src/log/log.cpp | UTF-8 | 681 | 2.59375 | 3 | [] | no_license | /*
* log.cpp
*
* Created on: 3 oct. 2012
* Author: laplace
*/
#include <iostream>
#include <QDateTime>
#include "log.h"
void logMessage(QtMsgType type, const char* msg) {
std::cout << "[" << QDateTime::currentDateTime().toString("MM/dd/yyyy hh:mm:ss").toStdString() << "]";
switch (type) {
case ... | true |
0a12899254f200336ac38fde10f16f7ccb62396e | C++ | rathoresrikant/HacktoberFestContribute | /Algorithms/DynamicProgramming/fibonacci.cpp | UTF-8 | 379 | 3.578125 | 4 | [
"MIT"
] | permissive | //fibonacci using bottom-up approach
#include <bits/stdc++.h>
using namespace std;
int fibonacci(int n){
if (n == 0 || n== 1)
return n;
int * memo= new int[n+1];
memo[0] = 0;
memo[1] = 1;
for (int i = 2; i < n; ++i){
memo[i] = memo[i-1] + memo[i-2];
}
return memo[n -1] + memo[n-2];
}
int main(){
int n;
... | true |
e5d41ce814f0ad4305cbcc2d16659fd2f4c00683 | C++ | hunkarlule/Cpp_Studies | /Cpp_common_data_structures/reverse-string.cpp | UTF-8 | 695 | 4.0625 | 4 | [] | no_license | #include <iostream>
#include <stack>
#include <string>
using namespace std;
string reverseString(const string &input) {
stack<char> charStack;
for (char ch : input) {
charStack.push(ch);
}
string reversedString = "";
while (!charStack.empty()) {
char topElementFromStack = charSt... | true |
1e369ba8ffaa624bc9aeb71ebd9f395f59163c83 | C++ | vespa-engine/vespa | /vespalib/src/vespa/vespalib/stllike/identity.h | UTF-8 | 473 | 2.546875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <utility>
namespace vespalib {
// Functor which returns its argument unchanged.
// Functionally identical to C++20's std::identity
// TODO remove and replace with std::identity once it is av... | true |
85fa3cc01a8be45e4c8997d0f8115eb2ea3749be | C++ | rlank/RVS | /librvs/Disturbance/DisturbanceDriver.cpp | UTF-8 | 2,403 | 2.546875 | 3 | [] | no_license | #include "DisturbanceDriver.h"
RVS::Disturbance::DisturbanceDriver::DisturbanceDriver(RVS::Disturbance::DisturbanceDIO* ddio, bool suppress_messages)
{
this->ddio = ddio;
this->suppress_messages = suppress_messages;
}
RVS::Disturbance::DisturbanceDriver::~DisturbanceDriver()
{
}
int* RVS::Disturbance::Disturbance... | true |
3bf7f0450103ee743df147bee5e17c9e439a9ed1 | C++ | olafurjohannsson/netproc | /net/NetClient.cpp | UTF-8 | 3,329 | 2.640625 | 3 | [] | no_license | #include <ctime>
#include <iostream>
#include <string>
#include <thread>
#include <boost/array.hpp>
#include <boost/asio/deadline_timer.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/read_until.hpp>
#include <boost/asio/streambuf.hpp>
#include <boost/asio/write.hpp>
#inc... | true |
bd29ea7a6be2e6d87a2357c43c5bb634aaefddfa | C++ | pabloluque14/OpenCV | /p5/functions.cpp | UTF-8 | 6,205 | 2.546875 | 3 | [] | no_license |
int main(){
//--------------De aqui se saca los centros de los clusters----------------------------------------------------------------------------------------------------
/*
train_descs-> descriptores
keywords-> el numero de key words -> que será el numero de clusters
dict_runs-> numero de intentos
*/
c... | true |
b6b3b6c5ea68dbc56262c75ea5c902cc61ba9676 | C++ | OasisGallagher/CLRS | /ClrsExercise/Chapter24 (Single-Source Shortest Paths)/24.3-4.cpp | UTF-8 | 432 | 2.796875 | 3 | [] | no_license | void Graph::Signal(GraphContainer& g) const {
// 对每条边的权值, w1, w2, w3 ... wk.
// 使w = w1 * w2 * ... * wk最大.
// 即: log(w) = log(w1) + log(w2) + ... + log(wk).
// 由于0 <= wi <= 1, 所以log(wi) <= 0, 因此,
// 在权值分别为log(w1), log(w2) ... log(wk)的图上计算
// 最短路径, 得到的是abs(log(w))最大的值.
// abs(log(w))最大, 即w的值最大, 因为log(w)是单调递增的.
}... | true |
a965b4f0840e49bdd57404ab122fbdf10eaac9db | C++ | anantprsd5/CurveSim | /CurveSim/Edge.cpp | UTF-8 | 1,163 | 3.03125 | 3 | [] | no_license | #include "Edge.h"
//Author : Suvojit Manna
//Application : CurveSim
Edge::Edge( const std::bitset<STATES> &fromState,
const size_t fromID,
const std::bitset<STATES> &toState,
const size_t toID,
const size_t latency )
{
this->toState = toState;
this->fromStat... | true |
6f04017f476ec744b5dfdda6a31a54aaa342a90d | C++ | david20571015/AOOP_final | /largefactorial.cpp | UTF-8 | 881 | 2.796875 | 3 | [] | no_license | #include "largefactorial.h"
LargeFactorial::LargeFactorial()
{
}
string LargeFactorial::solve(const string &s)
{
ss.clear();
ss << s;
short n;
ss >> n;
unsigned long long fac[2400] = {0};
fac[0] = 1;
for (int i = 2; i <= n; i++)
{
for (int j = 0; j < 2399; j++)
fa... | true |
117069a001e8a916babeb5da4b13db6661029d39 | C++ | m2ci-msp/mri-shape-tools | /ema-tools/output-mesh-for-correspondence/src/include/CorrespondenceReader.h | UTF-8 | 1,441 | 3.0625 | 3 | [
"MIT"
] | permissive | #ifndef __CORRESPONDENCE_READER_H__
#define __CORRESPONDENCE_READER_H__
#include <vector>
#include <string>
#include <json/json.h>
#include "Correspondence.h"
class CorrespondenceReader{
public:
static Correspondence read(const std::string& fileName) {
Correspondence result;
// try to... | true |
fbf914557a2b05f6ed4be993390e0d584245aa35 | C++ | CallMeMajorTom/csci499_haoyuli | /key_value_store/key_value_client.cc | UTF-8 | 2,610 | 2.625 | 3 | [] | no_license | #include "key_value_client.h"
#include <string>
#include <vector>
#include <iostream>
#include <thread>
#include <grpcpp/grpcpp.h>
#include <glog/logging.h>
#include "key_value_store.pb.h"
#include "key_value_store.grpc.pb.h"
using kvstore::PutRequest;
using kvstore::PutReply;
using kvstore::GetRequest;
using kvsto... | true |
d459db1c6c4c8b431347fd80b8a02222dda032f9 | C++ | ibrahimidk/DNA_Analyzer | /SRC/DnaSequence.h | UTF-8 | 2,134 | 2.90625 | 3 | [] | no_license | #ifndef __DNA_SEQUENCE_H__
#define __DNA_SEQUENCE_H__
#include "nucleotides.h"
#include <string.h>
#include <stdlib.h>
#include <sstream>
#include <list>
#include "fstream"
class DnaSequence
{
public:
DnaSequence(const char * data);
DnaSequence(const std::string&);
DnaSequence(const DnaSequence &); // copy CT... | true |
617c019a53b85c0c68c667db19badf7a86ac1b3d | C++ | halsoo/04_507_real-dataset | /src/Block.cpp | UTF-8 | 12,712 | 2.53125 | 3 | [] | no_license | #include "Block.hpp"
Block::Block() {}
void Block::setup(int startX, int startY, int _stepNum, int _stepSize, bool after){
stepNum = _stepNum;
stepSize = _stepSize;
blockWidth = (stepNum * stepSize);
blockCapacity = stepNum * stepNum;
x = startX - blockWidth/2;
y = startY - blockWidt... | true |
c0286c195c64735e8aa504898c4dd67512fde768 | C++ | mankey101/Competitive-Programming | /Assignment1/Hackonacci_rotations.cpp | UTF-8 | 1,439 | 2.671875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,q;
cin>>n>>q;
int query[q];
for(int i=0;i<q;i++) cin>>query[i];
int answer[4];
answer[0]=0;
//for answer 2 i.e 180 *
int count1=0;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
int t=(i*j)%7;
int l=((n+1-i)*(n+1-j))%7;
if(t==1 || t==6... | true |
e90f1bf47b611532943bbccd530c26b0308279eb | C++ | VipulKhandelwal1999/Coding_Blocks | /20.Challenges_Sorting_And_Searching/07.Arrays_Selection_Sort_II.cpp | UTF-8 | 1,858 | 4.375 | 4 | [] | no_license | /*
Take as input N, the size of array. Take N more inputs and store that in an array. Write a function that selection sorts the array. Print the elements of sorted array.
1.It reads a number N.
2.Take Another N numbers as input and store them in an Array.
3.Sort the array using Selection Sort and print that Array.
In... | true |
d4daf665fc0ff1eeea58448bda535e40f59c8df9 | C++ | daniel-lundin/raytrace | /include/raycolor.h | UTF-8 | 649 | 3.015625 | 3 | [] | no_license | #ifndef RAYCOLOR_H
#define RAYCOLOR_H
#include <string>
using std::string;
class RayColor
{
public:
RayColor();
RayColor(double r, double g, double b);
void setR(double r);
void setG(double g);
void setB(double b);
double r() const;
double g() const;
double b() const;
void scale... | true |
19c7f7ce37be533ca1b4661f2b853cbfae42aef7 | C++ | Frc2481/frc-2021 | /frc-2020/src/main/include/commands/Intake/SetFeederSpeedCommand.h | UTF-8 | 1,442 | 2.578125 | 3 | [] | no_license | /*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of... | true |
8535feaa30b38ce7c198f17513c4a438f246ca2a | C++ | r4gg4rs/StreetRaces | /core/MovebleObject.h | UTF-8 | 973 | 2.640625 | 3 | [] | no_license | #ifndef SR_MOVABLEOBJECT_H
#define SR_MOVABLEOBJECT_H
namespace SR
{
typedef Vector3 EulerAngle;
class MovableObject: public Entity
{
typedef std::shared_ptr<MovebleObject> MovableObjectPtr;
typedef std::list<MovableObjectPtr> m_children;
protected:
Vector3 m_position;
EulerAngle ... | true |
047720f8f01458644036d72605a9a4e6038c6775 | C++ | fmi-lab/oop-2019-kn-group1-sem | /Упражнения 1-9/Упражнение 7 (3.04.2019)/Bad code - MeteorologicalStation in Student/Student.h | UTF-8 | 484 | 3 | 3 | [] | no_license | #pragma once
#include"String.h"
#include"MeteorologicalStation.h"
// Bad version
class Student {
String name;
MeteorologicalStation grades;
public:
void add_grade(double _grade) {
grades.add_measurement(_grade);
}
int get_number_of_grades() const {
return grades.get_number_of_meas... | true |
3b97f25667dd253fbe415125b6b017b8d46249c9 | C++ | all1m-algorithm-study/2021-1-Algorithm-Study | /week2/Group4/boj2217_ei6540.cpp | UTF-8 | 586 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void init() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
bool desc(int a, int b) {
return a > b;
}
//많이 들 수 있는게 좋은 밧줄
void solve() {
int N;
cin >> N;
vector<int> rope(N);
for (int i = 0; i < N; i++) {
... | true |
f5e7c166fb8b452ed13f64123378ac0bef966faf | C++ | jstoddard5150/Numerical-Menu | /NumericalMenu.cpp | UTF-8 | 423 | 2.9375 | 3 | [] | no_license | /*
* NumericalMenu.cpp
*
* Created on: Feb 13, 2017
* Author: Jason Stoddard
*/
#include <iostream>
#include "NumericalMenu.h"
using namespace std;
int main() {
NumericalMenu menu;
menu.setPrompt("Select option:");
menu.addOption("Enter new values");
menu.addOption("Help");
menu.addOption("Save");
m... | true |
2012709532684bc544fe5e83750dcfeb0740c86b | C++ | AyalaBouhnik/pandemic-b | /sources/Virologist.hpp | UTF-8 | 394 | 2.640625 | 3 | [] | no_license | #pragma once
#include "Player.hpp"
#include "Board.hpp"
#include "Color.hpp"
#include "City.hpp"
namespace pandemic{
class Virologist: public Player{
public:
Virologist(Board& b, City city):Player(b, city, "Virologist"){}
Player& treat(City city)override; //can do this action in any city of the world- it doesnt ... | true |
534dd7a6d50326d24be77ef7ac59ba2967551b5a | C++ | OjasWadhwani/Leetcode-Solutions | /C++/#134_Gas Station.cpp | UTF-8 | 477 | 2.84375 | 3 | [] | no_license | class Solution {
public:
int canCompleteCircuit(vector<int>& gas, vector<int>& cost) {
int start=0, tank=0, sumGas = 0, sumCost=0;
for(int i=0; i<cost.size(); i++){
sumGas+=gas[i];
sumCost+=cost[i];
tank+=gas[i]-cost[i];
if(tank<0){
sta... | true |
a6436aebeb874194af5f641e28cbae6c12bc0595 | C++ | TheLimpo/Lab-2 | /Task1-SortCheck/src/SortCheck.cpp | UTF-8 | 490 | 3.96875 | 4 | [] | no_license | #include <iostream>
using namespace std;
bool is_sorted(int arr[])
{
for (int i = 0; i < 4; i++)
{
if (arr[i] > arr[i + 1])
return false;
}
return true;
}
int main()
{
int arr[5];
for (int i = 0; i < 5; i++)
{
cout << "Enter a number you want in your 5 length array: ";
cin >> arr[i];
}
cout <<... | true |
1cd579ba12e3104d7b13f04a74fb1cd3ab045ec6 | C++ | Sfourtou/Arcade | /arcade/sources/Fruit.cpp | UTF-8 | 268 | 2.546875 | 3 | [] | no_license | #include "Fruit.hh"
Fruit::Fruit() :
ACharacter("fruit"), state(0)
{
}
Fruit::~Fruit()
{
}
int Fruit::getState() const
{
return state;
}
void Fruit::setState(int st)
{
state = st;
}
std::string Fruit::getSprite() const
{
return std::string("RedFruit");
}
| true |
0cf5cc9e25a4d6507d970f551285d9a734fa98d1 | C++ | narak1/jisikin | /matrix/mat_pow.cxx | UHC | 1,929 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
void printMat(int a[][3], int n);
void addMat(int a[][3], int b[][3], int c[][3], int n);
void multiMat(int a[][3], int b[][3], int c[][3], int n);
void powMat(int a[][3], int c[][3], int n);
int main()
{
int A[3][3]={{1,1,0},
{1,0,1},
{1,1,1}};
int B[3][3]={{1,0,0},
{0,1,1},
{0,0... | true |
ac8e7514a25a5c112ffd34c16d3bb33d4e9be6af | C++ | hoseogame/20111618.SDL | /12.Test/main.cpp | UTF-8 | 627 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include "Game.h"
#define FPS 60
#define UINT32 std::uint32_t
int main( int argc, char* args[] )
{
const int DELAY_TIME = 1000.0f / FPS;
UINT32 frameStart, frameTime;
TheGame::Instance()->init( "SDL_Game_Create",
100, 100, 1024, 768, false );
while (TheGame::Instance()->running() )
{
... | true |
98ddd21e2378478a818499667298ecefc497820a | C++ | mbkim95/Algorithm | /Baekjoon/17136.cpp | UTF-8 | 1,370 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int ans = 100;
int map[10][10];
int paper[] = { 5, 5, 5, 5, 5 };
bool inRange(int x, int y) {
return (0 <= x && x < 10) && (0 <= y && y < 10);
}
bool check(int x, int y, int size) {
for (int i = y; i < y + size; i++) {
for (int j = x; j < x + size; j+... | true |
126213fd5df1cca0033693cda7ec38fcf6ed1479 | C++ | guillaumesoudais/projectUPM115 | /mazeRobot/sonar.h | UTF-8 | 2,092 | 3.25 | 3 | [] | no_license | /*
Code d'exemple pour un capteur à ultrasons HC-SR04.
*/
#ifndef Sonar_h
#define Sonar_h
#include <Arduino.h>
#include <Servo.h>
const int LENGTH = 15;
class Sonar {
/*
Class for the Sonar with its servo and its
ultrasonic sensor
*/
public :
int angle; // angle of the servo
... | true |
407c52ff9ddd30004856f919a43402a58f7c6579 | C++ | belloirines/develop | /ECE_project/Plongeon/main.cpp | UTF-8 | 638 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include <stdlib.h>
#include "graphe.h"
int main()
{
int i=0;
std::string a,b;
std::cout << "taper le nom du fichier 1 ";
std::cin>>a;
std::cout<<a<<std::endl;
std::cout << "taper le nom du fichier 2 ";
std::cin>>b;
std::cout<<b<<std::endl;
graphe g{a,b};
/... | true |
64c391c59d5a55b6cff411c7e12481098fe5b2fc | C++ | DeepLearnPhysics/larcv2 | /larcv/core/DataFormat/ImageMeta.h | UTF-8 | 6,140 | 2.71875 | 3 | [
"MIT"
] | permissive | /**
* \file ImageMeta.h
*
* \ingroup core_DataFormat
*
* \brief Class def header for a class larcv::ImageMeta
*
* @author kazuhiro
*/
/** \addtogroup core_DataFormat
@{*/
#ifndef __LARCV_IMAGEMETA_H__
#define __LARCV_IMAGEMETA_H__
#include <iostream>
#include "larcv/core/Base/larbys.h"
#include "BBox.h"
... | true |
71b1b927d1a51b1acf8fb357b6b2f75ab3e8f038 | C++ | GI071/Iterators | /FibonacciIterator.cpp | UTF-8 | 1,399 | 3.71875 | 4 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
class FibonacciIterator {
public:
static long long int number;
long long int current;
static long long int elements;
static int counter;
static int temp1;
static int temp2;
FibonacciIterator() {}
void next() {
... | true |
66c0253f9e0a2b81b8d22d1f40ee31847adf8d68 | C++ | ArapovXD/QT-Quick-todo- | /src/todo.cpp | UTF-8 | 293 | 2.546875 | 3 | [] | no_license | #include "./include/todo.h"
ToDo::ToDo(QString text, QString id) :
text {std::move(text)},
id {std::move(id)}
{
}
QString ToDo::getText() const
{
return text;
}
QString ToDo::getId() const
{
return id;
}
void ToDo::setText(const QString &newText)
{
text = newText;
}
| true |
9a0cf6f6c616c330ad0775ff3f17c764fdf2e43f | C++ | sirraghavgupta/cpp-data-structures-and-algorithms | /problems/bigFactorialProblem.cpp | UTF-8 | 1,370 | 3.46875 | 3 | [] | no_license | /*##############################################################################
AUTHOR : RAGHAV GUPTA
DATE : 6 october 2019
AIM : find the factorial of big number like upto 500.
STATUS : !!! success !!!
NOTE : see geeks for geeks if u wish
#######################################################################... | true |
94e5e42182d99aef840432c94fe31822a6ecfffe | C++ | atyamsriharsha/My-Spoj-Solutions | /quest5.cpp | UTF-8 | 688 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std ;
typedef struct key
{
int a ;
int b ;
}key ;
bool comp(const key &m,const key &n)
{
return m.b < n.b ;
}
int main()
{
int test,n,i,start,end ;
scanf("%d",&test);
while(test--)
{
... | true |
aeac501de4de53a2a6db06a8f54d2e7f8513b95e | C++ | mmelqonyan/Stepanavan | /Hovhannes Manasyan/Uncompleted tasks/14.02/chatbot.cpp | UTF-8 | 2,062 | 2.9375 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include <string>
#include <ctime>
#include <time.h>
int hour1();
string bot();
int main ()
{
bot();
}
string bot(){
string answer;
string barev="barev";
string vonces="vonces";
string lav="lav";
string anunt_incha="";
cout<<"Start dialog!"<<endl;
cout<<"Hovo: ";
c... | true |
2597e64cc8c1a1d0a9b6f9ebaf09138fe7e62da6 | C++ | lilyyangyn/CSE100-PA4 | /test/test_ActorGraph.cpp | UTF-8 | 9,240 | 2.828125 | 3 | [] | no_license | /**
* This file performs unit tests for ActorGraph.
*
* Author: Yuening YANG, Shenlang Zhou
* Email: y3yang@ucse.edu
*/
#include <gtest/gtest.h>
#include <iostream>
#include "ActorGraph.hpp"
#include "HelpUtil.hpp"
using namespace std;
using namespace testing;
/**
* A simple test fixture of unweighted graph fro... | true |
6b1755be9fdfdb7f8b1d5cef6a06858b079bad87 | C++ | thelokeshgoel00/Competitive_Programming | /GeeksForGeeks/Rank_Permutations.cpp | UTF-8 | 1,072 | 3.28125 | 3 | [] | no_license | // Rank of the string amongst its permutations sorted lexicographically
#include <bits/stdc++.h>
using namespace std;
#define N 1000003
int fact(int n)
{
if(n<=1)
return 1;
return n*fact(n-1);
}
void update(int *count,char c)
{
for(int i=c-'a';i<26;i++)
count[i]--;
}
int rank_lexo(string& str)
{
... | true |
b879c49c2b3f3f281f8fde417867caa43ceb69f7 | C++ | Sillyplus/Solution | /Timus/1496.cpp | UTF-8 | 706 | 2.5625 | 3 | [] | no_license | /*******************************************************************************
> File Name: 1496.cpp
> Author: sillyplus
> Mail: oi_boy@sina.cn
> Created Time: Sun Jan 4 07:26:48 2015
******************************************************************************/
#include <iostream>
#include <string>
#includ... | true |
819fa67954d982e0bbf60246686fc07885281376 | C++ | tecnosam/amstrong-number | /amstrong.cpp | UTF-8 | 1,125 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <boost/lexical_cast.hpp>
using namespace std;
bool checkArmstrong(int n)
{
int dig=log10(n)+1; // Total number of digits of n
int res=0,x=n;
/* find sum of all the digits
raised to the power of the number of digits */
while(n>0)
{
... | true |
9c14a00781c8fbecbb6a474ce79da40778a2e431 | C++ | Delaval-Kevin/Statistique_2019-2020 | /Utile/Echantillon.cpp | UTF-8 | 3,918 | 3.0625 | 3 | [] | no_license | /***********************************************************/
/*Auteur : DELAVAL Kevin */
/*Groupe : 2203 */
/*Application : Calcul de Statistiques */
/*Labo : Premier labo */
/*Date de ... | true |
ac7ec463b01e0611f49f7f54e0c3cf29bf7eb217 | C++ | subha-code/calculator1 | /calculator.cpp | UTF-8 | 2,874 | 3.296875 | 3 | [] | no_license | #include<windows.h>
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int k=0,result=0;
int menu()
{
system("color A5");
int ch;
printf("\n1.Add\t\t2.Sub\t\t3.Mul\t\t4.Div\t\t5.GetRim\t\t6.Clear\t\t7.Exit");
printf("\nEnter your choice:");
scanf("%d",&ch);
return(ch);
}
v... | true |
1c904226f01d5d0ab096003d85e955b0f3418437 | C++ | astrivedi/CSCI2270 | /graphs/driverGraph.cpp | UTF-8 | 412 | 2.734375 | 3 | [] | no_license | #include<iostream>
#include "Graph.hpp"
#include<vector>
int main() {
Graph G;
G.add_vertex("A");
G.add_vertex("B");
G.add_vertex("C");
G.add_vertex("D");
G.add_vertex("E");
G.add_vertex("F");
G.add_vertex("G");
G.add_edge("A","B");
G.add_edge("A","C");
G.add_edge("C","D");
G.add_edge("D","E")... | true |
62a9b684143e05a64e349e755ac5dd494fd862f9 | C++ | BrychDaneel/RussianAI2017 | /AsyncScaleTask.cpp | UTF-8 | 1,381 | 2.703125 | 3 | [] | no_license | #include "AsyncScaleTask.hpp"
#include <vector>
#include "Repos.hpp"
namespace my{
AsyncScaleTask::AsyncScaleTask(double x, double y, double factor, double maxSpeed){
scaleType = ScaleType::Point;
this->x = x;
this->y = y;
this->factor = factor;
this->maxSpeed = maxSpeed... | true |
97adec0ed37956b67427002a34cdb8619386f8c6 | C++ | Thraskia/Elevator_Inheritance | /office.h | UTF-8 | 830 | 3.5 | 4 | [] | no_license | #ifndef OFFICE_H
#define OFFICE_H
#ifndef AREA_H
#include "area.h"
#endif
#include <iostream>
using namespace std;
class Office: public Area{
private:
int office_number; //number of office
public:
//constructor of office
//to construct/create the office needs the capacity(No)
//and office_number
//i... | true |
9466f1575140e2ffc9ce025c4f1ba5eadc1a3825 | C++ | jennyc2004/UVa | /chapter1_UVa11172_simple.cpp | WINDOWS-1252 | 768 | 3.484375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
/*
Input
First line of the input file is an integer t (t < 15) which denotes how many sets of inputs are there.
Each of the next t lines contain two integers a and b (|a|, |b| < 1000000001).
Output
For each line of input produce one line of output. This line contains... | true |
5009f169ed65e1721c9679763b7e365eead7d418 | C++ | Mirax-MRX/Mirax-DHT | /mrxutils/mrx/utils/Observer.h | UTF-8 | 712 | 2.859375 | 3 | [] | no_license |
#pragma once
#include /utils/common.h"
namespace td {
class ObserverBase {
public:
ObserverBase() = default;
ObserverBase(const ObserverBase &) = delete;
ObserverBase &operator=(const ObserverBase &) = delete;
ObserverBase(ObserverBase &&) = delete;
ObserverBase &operator=(ObserverBase &&) = delete;
vi... | true |
1a59fec4ddec2c35aed3bca7543f43d3d2cdacd6 | C++ | bmoon4/CPlusPlusPractice | /ruleofFIve.cpp | UTF-8 | 1,505 | 3.84375 | 4 | [] | no_license | #include <utility>
#include <iostream>
class Student{
private:
int no;
float* grade;
int ng;
public:
Student(){ // defalut constructor
std::cout << "default constructor" << std::endl;
no = 0;
grade = nullptr;
ng = 0;
}
Student(const Student& other){ // copy constructor
std::cout <... | true |
3db65e555b28435d334c74b866419c5e39927c4d | C++ | jimpelton/radar-forensics | /recordsmodel.cpp | UTF-8 | 2,124 | 2.546875 | 3 | [] | no_license |
#include "recordsmodel.h"
#include <QDebug>
///////////////////////////////////////////////////////////////////////////////
RecordsModel::RecordsModel(QObject *parent)
: QAbstractListModel(parent)
{
}
///////////////////////////////////////////////////////////////////////////////
RecordsModel::~RecordsModel() ... | true |
1286fabc10c2b1bde9317f9d4fc6a566a7d7eaf6 | C++ | wangshuaiCode/geeksforgeeks | /bintree/reverselevelorder.cpp | UTF-8 | 315 | 2.9375 | 3 | [] | no_license | void reverselevelorder(struct node *root)
{
stack<struct node *> s;
queue<struct node *>q;
q.push(root);
struct node *temp = NULL;
while(!q.empty())
{
temp = q.front();
q.pop();
s.push(temp);
if(temp -> right != NULL)
q.push(temp -> right);
if(temp -> left != NULL)
q.push(temp -> left);
}
}
| true |
98365eae1c7ca5bcc7c4c5d6f22d641f3b305a82 | C++ | ryudo87/CPP | /githubLeetcode/String/Medium 848 Shifting Letters.cpp | UTF-8 | 418 | 2.875 | 3 | [] | no_license | class Solution {//Brute force Time O(n^2) Space O(1)
public://Prefix-sum Time O(n) Space O(1)
//Shift: S[i] = (S[i] - 'a' + shift) %26 + 'a' = (S[i] - 'a' + shift%26) %26 + 'a'
string shiftingLetters(string s, vector<int>& shifts) {
int c=0;
for (int i=shifts.size()-1;i>=0;--i) {
... | true |
8b9133a40fa11b4d1fa6cf3ff57e1be8aa5f614a | C++ | kynd/apps_of0081_osx | /ShaderEffect/StrokeNoise/src/Snake.cpp | UTF-8 | 3,178 | 2.6875 | 3 | [
"MIT"
] | permissive | #include "Snake.h"
Snake::Snake(float l, float w, int _dl, int _dw) {
length = l;
width = w;
dl = _dl;
dw = _dw;
shader.load("shaders/phong/shader.vert", "shaders/phong/shader.frag");
// center points
for (int i = 0; i < dl; i ++) {
points.push_back(ofVec3f(i * 30, 0,0));
... | true |
b0b78b929ac035f56ee5f3580957a28b47b28333 | C++ | Tudor67/Competitive-Programming | /LeetCode/Problems/Algorithms/#1647_MinimumDeletionsToMakeCharacterFrequenciesUnique_sol2_greedy_O(N+AlogA)_time_O(A)_extra_space_88ms_17.1MB.cpp | UTF-8 | 824 | 3.140625 | 3 | [
"MIT"
] | permissive | class Solution {
public:
int minDeletions(string s) {
const int A = 26;
const int MIN_CHAR = 'a';
vector<int> count(A);
for(char c: s){
count[c - MIN_CHAR] += 1;
}
sort(count.begin(), count.end());
int delete... | true |
bec0ae9830fe81587bdeb99f1733972268f54831 | C++ | nafash/program | /ProjetoSistemaVersao11/ProjetoSistema11/pedidopersistencia.cpp | UTF-8 | 2,694 | 2.671875 | 3 | [] | no_license | #include "pedidopersistencia.h"
namespace wictor{
pedidoPersistencia::pedidoPersistencia()
{
}
void pedidoPersistencia::lerArquivo(wictor::LDEC<wictor::Pedido> *lista)
{
std::string leitura;
wictor::Pedido pedido;
QString arquivoProdutos="ListaDePedidos.csv";
std::ifstream arquivo;
arquivo.open("... | true |
3dda0dc50e15eb96de0ecb37587f180e59d46549 | C++ | eaudex/liblinear-perf | /eval.cpp | UTF-8 | 10,176 | 2.84375 | 3 | [
"BSD-3-Clause"
] | permissive | #include <cstdio>
#include <cassert>
#include <cmath>
#include <algorithm>
#include "linear.h"
#include "eval.h"
#define Malloc(type,n) (type *)malloc((n)*sizeof(type))
//static enum measure {
// ACC=0, AUC, BAC, F_SCORE, PRECISION, RECALL, M_SQ_ERR=11, M_ABS_ERR, R_SQ
//};
static const char * measure_name[] = {
... | true |
3f3c724a5ac13df45a392d2ed75e494fcdbae3e1 | C++ | brunocpbrito/projeto2 | /perfil/PrimeiroPeriodo.cc | UTF-8 | 7,809 | 2.765625 | 3 | [] | no_license | #include <string.h>
#include <omnetpp.h>
#include <math.h>
#include <list>
#include <iostream>
#include "Aluno.h"
#include <vector>
using namespace std;
using namespace omnetpp;
class PrimeiroPeriodo : public cSimpleModule {
private:
int capacidadeFila;
int probReprovacao;
int probCancelamentoDisciplin... | true |
aed428a657fdc06e5d460e03e262968a0058a7e0 | C++ | piriyanka/charge1 | /pair.cpp | UTF-8 | 291 | 2.859375 | 3 | [] | no_license | #include<iostream.h>
using namespace std;
class student
{
public:
calculate()
{
int n,x,p;
int i;
cout<<"enter the n";
cin>>n;
cout<<"pair";
cin>>p;
for(i=0;i<2*n;i++)
{
int j=1;x=2*n-i;
if(p!=x)
{
cout<<"the pair is"<<p<<"for day"<<j++<<"is"<<p;
}
}
};
void main()
{
pair.b;
b.student();
}
| true |
4c4aa286c4f89265d34da04c7501e6eca06c8471 | C++ | zrzw/tour-cxx | /euler12.cxx | UTF-8 | 1,208 | 3.796875 | 4 | [] | no_license | /*
* Project Euler #12
* "Highly divisible triangle numbers"
*/
#include <iostream>
#include <iomanip>
#include <math.h>
#include <vector>
/* factorise using trial division */
std::vector<int> factorise(long int n)
{
std::vector<int> results {};
int limit = n;
for(auto i=1; i<limit; ++i){
if(n %... | true |
0f7736a206816145e44f855924dafb2c944ab811 | C++ | sangwoo0727/Algorithm | /String/Programmers_문자열다루기기본.cpp | UTF-8 | 421 | 3.28125 | 3 | [] | no_license | #include <string>
#include <iostream>
using namespace std;
bool solution(string s) {
bool answer = true;
if (s.length() == 4 || s.length() == 6) {
for (auto c:s) {
if (c - '0' >= 0 && c - '9' <= 0) continue;
else {
answer = false;
break;
}
}
}
else answer = false;
return answe... | true |
14e5f3824ab97748d0ceb5f167e002869899de8b | C++ | exube/StringParser | /StringParser/test.cpp | UTF-8 | 613 | 3.109375 | 3 | [
"MIT"
] | permissive | #include "stringwrapper.h"
#include <iostream>
#include <string>
#include <vector>
int main(int argc, char** argv) {
char abc[256];
std::cin.getline(abc, 255);
abc[255] = 0;
std::string test(abc);
stringwrapper wrap(test);
std::vector<std::string> special_strings;
special_strings.push_ba... | true |
d2284f7fa278547ab23b632ab08623aee30fcc90 | C++ | namtp12/2048-sdl | /2048-cmd/main.cpp | UTF-8 | 1,675 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <ctime>
#include <cstdlib>
#include <iomanip>
#include <cassert>
#include <fstream>
#include "include/GameCmd.h"
#include "include/Game.h"
#include <SDL2/SDL.h>
using namespace std;
//int high_score_flag;
int main(int argc, char* args[])
{
int high_score;
bool wr... | true |
01ce39008ac51383ae30529f5b86566cca7a5027 | C++ | StephanieOrganista/ZybookDSLabs | /Chapter18/LAB1819.cpp | UTF-8 | 587 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include <vector> // Must include vector library to use vectors
using namespace std;
int main() {
vector<int> userVals;
int middle;
int tempVar;
unsigned int i;
while (cin >> tempVar) { //read in array
if (tempVar == -1) break;
userVals.push_back(tempVar);//add to the v... | true |
deb26ab8e1355eb5747bcf45adccb36bb92fde79 | C++ | clutteredmind/Loki | /LokiModules/LokiTests/src/LokiAddonDescriptorTests.cpp | UTF-8 | 8,528 | 2.765625 | 3 | [] | no_license | //
// LokiModuleDescriptorTests.cpp : Defines tests for the LokiModuleBase class
//
#include "gtest\gtest.h"
#include "node_version.h"
#include "LokiModuleDescriptor.hpp"
using namespace Loki;
TEST (LokiModuleDescriptorTests, Instantiation)
{
LokiModuleDescriptor descriptor;
}
class LokiModuleDescriptorTest : ... | true |
101be242726b5a1b2c136d2c47efec5d7f54fa86 | C++ | Melih1635/Data-Structure-Project | /CiftYonluBagilListe.cpp | UTF-8 | 3,092 | 2.578125 | 3 | [] | no_license | #include "Dugum.h"
#include "CiftYonluBagilListe.h"
#include <iostream>
using namespace std;
void::CiftYonluBagilListe::Ekle(int* sayilar,int boyut)
{
listeOrta = new Dugum(sayilar[0]);
for (int i = 1;i < boyut;i++)
{
if (i > boyut / 2)
{
Dugum* son = listeOrta;
while (son->next != NULL)... | true |
b7c0dbb1891050ea293dd1af2bd995ae819150b2 | C++ | signmotion/state-machine | /state-mashine.cpp | WINDOWS-1251 | 9,971 | 2.59375 | 3 | [] | no_license | // @source http://www.boost.org/doc/libs/1_47_0/libs/msm/doc/HTML/ch03s02.html#d0e424
// Copyright 2010 Christophe Henry
// henry UNDERSCORE christophe AT hotmail DOT com
// This is an extended version of the state machine available in the boost::mpl library
// Distributed under the same license as the original.
// Co... | true |
d058bf846f2839c6b43ce783be85b7989af3e889 | C++ | TaeYongHwang/algorithm_study | /백준/15953.cpp | UTF-8 | 579 | 3.03125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int arr1[101] = { 0, };
int prize1[6] = { 500, 300, 200, 50, 30, 10 };
int idx = 1;
for (int i = 0; i < 6; i++) {
for (int j = 0; j <= i; j++) {
arr1[idx++] = prize1[i];
}
}
int arr2[65] = { 0, };
int prize2[5] = { 512,256,128,64,32 };
int count =... | true |
21e2af28aaeba19af6db00a15563b67384b2c1b2 | C++ | antoine-roille/loco | /source/core/log.cpp | UTF-8 | 1,832 | 2.828125 | 3 | [] | no_license |
#include "log.h"
#include "platform.h"
#include "type.h"
#include <ctime>
#include <cstdlib>
#include <cstdio>
#include <cstring>
namespace loco
{
const Log Log::instance;
char LogLevelString[(uint32)Log::Level::Count][8] =
{
"DEBUG",
"INFO",
"WARNING",
"ERROR",
"FATAL"
};
void Log::debug(const c... | true |
1e5cdb32d5bf6205e6acd970a6698f075e6e6974 | C++ | zafird/bcit-courses-notes | /COMP 2617 - C++ for Object Oriented Software Development 1/Share Out/Optional Exercises Solutions/Ex06_37/Ex06_37.cpp | UTF-8 | 5,186 | 3.359375 | 3 | [] | no_license | // Exercise 6.37 Solution: Ex06_37.cpp
// Help user practice multiplication;
// check user's progress every 10 responses.
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
#include <cstdlib>
using std::rand;
using std::srand;
#include <ctime>
using std::time;
void multiplicati... | true |
36a9c84e0c58a7fc6a8b32a3e9f7b3c0499122c5 | C++ | ZaidAlAsali/High-Level-Programming-Languages-ZaidAlAsali | /Chapter9Drill9.3.cpp | UTF-8 | 2,113 | 3.671875 | 4 | [] | no_license | #include "std_lib_facilities.h"
class Date {
int y, m, d;
public:
Date(int yy, int mm, int dd);
void add_day(int n);
int month() const { return m; }
int day() const { return d; }
int year() const { return y; }
};
Date::Date(int yy, int mm, int dd)
... | true |
e3f7a98f777dd331aa90fd39e613cec8aaa65a87 | C++ | LIAO-JIAN-PENG/CPE-One-Star-record | /STAR_34.cpp | UTF-8 | 1,307 | 3.546875 | 4 | [] | no_license | # include<stdio.h>
# include<stdlib.h>
# include<string.h>
# include<ctype.h>
# pragma warning(disable: 4996)
/*
Rule:
we know that n can be deivided by 9,
following the rule that digits sum of n is multiple of 9
ex:
12345678 % 9 == 0
1 + 2 + 3 + 4 ... + 9 = 36
=> 36 % 9 == 0
3 + 6 = 9
=> 9 %... | true |
672fb9ccdf58a3aa70d79431ddced6e5b731b7b3 | C++ | SmiledProgrammer/Gumi-Gota-Game-Engine | /Gumi Gota Game Engine/Gumi Gota/Gumi Gota/src/physics/3D/RigidBody3D.h | UTF-8 | 2,004 | 2.8125 | 3 | [] | no_license | #ifndef GUMIGOTA_RIGID_BODY_3D_H
#define GUMIGOTA_RIGID_BODY_3D_H
/* INCLUDES */
// Normal Includes
#include <vector>
// Header Includes
#include "../../graphics/3D/Renderable3D.h"
#include "AxisAlignedBoundingBox3D.h"
#include "OrientedBoundingBox3D.h"
#include "SphericalBoundingBox3D.h"
namespace gg
{
/* AD... | true |
8a0ba6fd648ebf3a5c837d52b24efc685d2773ff | C++ | tonowak/acmlib | /code/graph/cactus-cycles/test.cpp | UTF-8 | 1,328 | 2.765625 | 3 | [
"MIT"
] | permissive | #include "../../utils/testing/test-wrapper.cpp"
#include "main.cpp"
void test() {
int n = 1;
vector<pair<int, int>> all_edges, cycle_edges;
auto add_edge = [&](int a, int b) {
all_edges.emplace_back(a, b);
all_edges.emplace_back(b, a);
};
auto add_cycle_edge = [&](int a, int b) {
add_edge(a, b);
cycle_ed... | true |
6c1df94959e1645a7daa278eb1489746cffaaad3 | C++ | fmor/fmormath | /src/rectangle.h | UTF-8 | 1,117 | 2.984375 | 3 | [] | no_license | #pragma once
#include "vector2f.h"
namespace fmormath {
struct Rectangle
{
// Top Left point
Real m_X;
Real m_Y;
Real m_Width;
Real m_Height;
inline Rectangle()
{}
inline Rectangle( Real x, Real y, Real width, Real height ) :
m_X(x),
m_Y(y),
m_Width( width... | true |
ea0b81d7192b6baeea00a18084937025c4bac952 | C++ | liqiyang1908/LintCode | /137_Clone_Graph.cpp | UTF-8 | 1,987 | 3.265625 | 3 | [] | no_license | class Solution {
public:
/**
* @param node: A undirected graph node
* @return: A undirected graph node
*/
void connectneighbor(vector<UndirectedGraphNode*> nodes, unordered_map<UndirectedGraphNode*, UndirectedGraphNode*> mapping)
{
for (auto node : nodes)
{
... | true |
602f1feb0ebbc59ff8ef5f0eb4686dc6496bd140 | C++ | WyNotRepax/Studi | /Programmieren_2/Praktikum/vs/Blatt 5/Ringliste.cpp | UTF-8 | 384 | 2.59375 | 3 | [] | no_license | #include "Ringliste.h"
Ringliste::Ringliste(unsigned int capacity) : capacity(capacity),empty(true) {
}
std::string Ringliste::toString() {
return "";
}
Ringliste Ringliste::operator<<(int i)
{
return *this;
}
bool Ringliste::operator==(const Ringliste & other)
{
return false;
}
void Ringliste::operator+=(int i... | true |
d2bf2311830ff533cd2ee870dde1c24d382ae248 | C++ | Capri2014/math | /stan/math/rev/mat/fun/squared_distance.hpp | UTF-8 | 4,348 | 2.59375 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #ifndef STAN_MATH_REV_MAT_FUN_SQUARED_DISTANCE_HPP
#define STAN_MATH_REV_MAT_FUN_SQUARED_DISTANCE_HPP
#include <stan/math/rev/meta.hpp>
#include <stan/math/rev/core.hpp>
#include <stan/math/prim/mat/err/check_vector.hpp>
#include <stan/math/prim/arr/err/check_matching_sizes.hpp>
#include <stan/math/prim/mat/fun/Eigen.... | true |
e931afc0ee743e5e6c9527b28092e357c5a3b5f3 | C++ | dschmenk/Highlander-Hackers | /src/Arduino/MotorControl/MotorControl.ino | UTF-8 | 2,860 | 3.03125 | 3 | [] | no_license | /*
Motor Control sketch:
Steering sensor on analog input A0
Steering direction on D4
Steering PWM on D5
Drive direction on D2
Drive PWM on D3
*/
#define LEFT 0
#define RIGHT 1
#define FORWARD 0
#define BACKWARD 1
const int steeringSensePin = A0; // Analog input pin that the potentiometer is atta... | true |
32c003ced5cdfac2a25d1eeacd220df0954124d2 | C++ | rongyi/lintcode | /src/reverse-3-digit-integer.cc | UTF-8 | 461 | 3.671875 | 4 | [] | no_license | // http://www.lintcode.com/zh-cn/problem/reverse-3-digit-integer
class Solution {
public:
/**
* @param number: A 3-digit number.
* @return: Reversed number.
*/
// 你可以假设输入一定是一个只有三位数的整数,这个整数大于等于100,小于1000。
int reverseInteger(int number) {
auto last = number % 10;
auto mid = number / 10 % 10;
a... | true |
ce8ca8eb39188c675d0c104b901d5ac78b0ee79e | C++ | odiminox/DeadBeef-Engine | /Engine/dxSprite.h | UTF-8 | 2,824 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | #ifndef DXSPRITE_H
#define DXSPRITE_H
#include "Isprite.h"
#include "dxBaseSprite.h"
#include <cstdlib>
#include <time.h>
#include <stdint.h>
class dxSprite: public Isprite
{
private:
dxBaseSprite* pMySprite;
public:
dxSprite();
~dxSprite();
D3DXVECTOR2 spriteScale;//Root scale and position of the sprite
D... | true |
c62c9e2634e7e06bb1fa5bcc88d9203f4820f608 | C++ | jermp/entropy_coding | /include/huffman.hpp | UTF-8 | 2,820 | 3.515625 | 4 | [
"MIT"
] | permissive | #pragma once
#include <iostream>
#include <vector>
#include "util.hpp"
namespace huffman {
template <typename Symbol, typename Weight>
struct node {
weighted_symbol<Symbol, Weight> symbol;
node<Symbol, Weight>* left;
node<Symbol, Weight>* right;
};
template <typename Symbol, typename Weight>
static nod... | true |
078190dece104d7ec3cd6caea08192bd706dbdd7 | C++ | bingmann/distributed-string-sorting | /src/tests_old/mpi.cpp | UTF-8 | 3,970 | 2.53125 | 3 | [
"BSD-2-Clause"
] | permissive | #include <iostream>
#include <vector>
#include <random>
#include <numeric>
#include "mpi/environment.hpp"
#include "mpi/allgather.hpp"
#include "mpi/alltoall.hpp"
#include "util/timer.hpp"
#include "mpi/synchron.hpp"
#include <tlx/cmdline_parser.hpp>
class InitializedUniformIntDistribution {
public:
Initialize... | true |
08c8659f82a6b9111de5d4851e050d241a27570e | C++ | JSpuri/EmuParadise | /src/headers/cpu.hpp | UTF-8 | 2,340 | 2.59375 | 3 | [
"MIT"
] | permissive | #ifndef CPU_HPP
#define CPU_HPP
#include "processor.hpp"
#include "addressbus.hpp"
#include <functional>
#define C 7
#define Z 6
#define I 5
#define D 4
#define Bb 3
#define V 1
#define N 0
class AddressBus;
class CPU : public Processor {
public:
CPU();
uint8_t x;
uint8_t y;
ui... | true |
b4ae7932a2d0a20396a4bb941fc5186925d9a45c | C++ | JohnMai1994/Biquadris | /final_project/a5-biquadris/BasicBoard.cpp | UTF-8 | 30,466 | 2.953125 | 3 | [
"MIT"
] | permissive | #include "BasicBoard.hpp"
#include "player.hpp"
#include <iostream>
#include <string>
extern bool specialOn;
using namespace std;
BasicBoard::BasicBoard () {
player1 = shared_ptr <Player> (new Player);
player2 = shared_ptr <Player> (new Player);
}
BasicBoard::~BasicBoard(){
}
// ********************** in... | true |
38b709f6075344ca7c836d5bf7eba326303f015b | C++ | vnisor/elib1 | /supported/drivers/cpp_linked_in_driver/port_driver.cpp | UTF-8 | 1,933 | 2.640625 | 3 | [
"MIT"
] | permissive | /* port_driver.c */
// gcc -o exampledrv -fpic -shared complex.c port_driver.c
using namespace std;
#include <iostream>
#include "/usr/local/lib/erlang/usr/include/erl_driver.h"
typedef struct {
ErlDrvPort port;
} example_data;
static ErlDrvData example_drv_start(ErlDrvPort port, char *buff)
{
example_data... | true |
346c7a173e0486bf4e5eab7ea94d981ca2d560e8 | C++ | sunaemon/LLGI | /src/Metal/LLGI.VertexBufferMetal.h | UTF-8 | 494 | 2.546875 | 3 | [
"Zlib"
] | permissive | #pragma once
#include "../LLGI.VertexBuffer.h"
namespace LLGI
{
struct Buffer_Impl;
class VertexBufferMetal : public VertexBuffer
{
private:
Buffer_Impl* impl = nullptr;
public:
VertexBufferMetal();
~VertexBufferMetal() override;
bool Initialize(Graphics* graphics, int32_t size);
void* Lock() override;
voi... | true |
b6dfa458b55807ceb5e40be5aff04ac9f023e721 | C++ | oopsno/kaleido | /lang/include/ast/statement.hpp | UTF-8 | 3,549 | 2.640625 | 3 | [] | no_license | #ifndef KALEIDO_AST_STATEMENT_HPP
#define KALEIDO_AST_STATEMENT_HPP
#include "ast/type.hpp"
#include "ast/ast.hpp"
#include "ast/bool.hpp"
namespace kaleido {
namespace ast {
class Statement: public AST {
public:
virtual void dump(size_t indent = 0) = 0;
virtual llvm::Value *codegen(codegen::Context &) = 0;
};
... | true |
98c49f18db9c3b646bc128abc8f1de128c24823f | C++ | jimmyken793/dennao-gadget-sdk | /projects/relay/main.cpp | UTF-8 | 841 | 2.6875 | 3 | [] | no_license | #include "WProgram.h"
uint8_t buf[DENNAO_RX_SIZE];
uint16_t len = 0;
void CreateOutput(uint8_t *buf, uint16_t *len);
void ProcessInput(uint8_t *buf, uint16_t len);
const int pin = 0;
void setup()
{
pinMode(pin, OUTPUT);
}
bool state = false;
void loop()
{
digitalWrite(pin, state ? HIGH : LOW);
if (Denna... | true |
cb33354c559c0cff5b969aa563bb951aabb6d5c6 | C++ | djrieger/mjplusplus | /src/lexer/token.hpp | UTF-8 | 3,476 | 2.546875 | 3 | [] | no_license | #ifndef TOKEN_HPP
#define TOKEN_HPP
#include <string>
#include <unordered_map>
#include "../globals.hpp"
#include "../semantic_analysis/symbol_table/Symbol.hpp"
namespace lexer
{
class Token
{
private:
/**
* string table mapping all strings (identifier, keywords, integers) seen by the lexer to symbols
... | true |
1b4fb397bd90f0dbc98ccf61e4a6fefcea7acd7b | C++ | diwakarindoria/node-addon-cpp | /cppsrc/classes/UtilityWrapper.cpp | UTF-8 | 1,611 | 3.015625 | 3 | [] | no_license | #include "UtilityWrapper.h"
Napi::FunctionReference UtilityWrapper::constructor;
Napi::Object UtilityWrapper::Init(Napi::Env env, Napi::Object exports) {
Napi::HandleScope scope(env);
Napi::Function func = DefineClass(env, "UtilityWrapper", {
InstanceMethod("factorial", &UtilityWrapper::Factorial),
Insta... | true |
4c270028984bff5065d6282cb3403ec307d3eddf | C++ | adni03/DSA-Program-Files | /pointer_struct_3.cpp | UTF-8 | 372 | 3.265625 | 3 | [] | no_license | //Structure pointer problem 3
#include<iostream>
using namespace std;
union u1
{
int b1;
char b2;
};
union u3
{
int i;
float j;
};
struct s2
{
int h;
char g;
};
union u2
{
struct s2 f;
union u3 e;
};
struct s1
{
int a;
union u1 b;
union u2 *c;
union u1 *d;
float e;
};
int main()
{
struct s1 A;
A.c= ne... | true |
2d22263827a7370606ef26ed89438de56205a26f | C++ | MoonWalkerAZ/Picobot | /picobot_remote_control/src/picobot_remote_control.cpp | UTF-8 | 2,383 | 2.5625 | 3 | [
"MIT"
] | permissive | #include <ros/ros.h>
#include <sensor_msgs/Joy.h>
#include <geometry_msgs/Twist.h>
#include "teleop_twist_joy/teleop_twist_joy.h"
#include <iostream>
#include <string.h>
#include <unistd.h>
using namespace std;
class PicoRemoteControl
{
public:
PicoRemoteControl();
private:
void joyCallback(const sensor_msgs::Jo... | true |