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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
cfee6d3411ab15f5ef012cbcefe4474764005678 | C++ | Gguardiola/PRO1-VACUNES | /main.cpp | UTF-8 | 4,264 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include "Cambra.hpp"
#include "Control.hpp"
#include <queue>
#include <list>
using namespace std;
/*
NOTA: ACTUALIZACIONES DE LA PRIMERA ENTREGA
- Arreglado canviar_nevera
- Mejorada la modularizaciรณn de las clases:
ยท Ahora los siguientes metodos tienen return en vez de vo... | true |
9112ada6397e336972722971a37107655658ca31 | C++ | microtsiu/Anaquin | /src/VarQuin/VarQuin.hpp | UTF-8 | 1,186 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef VARQUIN_HPP
#define VARQUIN_HPP
#include "data/data.hpp"
#include "data/variant.hpp"
namespace Anaquin
{
inline std::string gt2str(Genotype x)
{
switch (x)
{
case Genotype::Somatic: { return "Somatic"; }
case Genotype::Homozygous: { return "Homozygous"... | true |
aeaa36c3cc4568f6868f7b2dbd8af8a060f53ab8 | C++ | fourthcafe/BasicCpp | /Ch02/02-5/Question02-3.cpp | UTF-8 | 1,525 | 3.859375 | 4 | [] | no_license | //
// Created by fourthcafe on 2017. 8. 23..
//
// ํ๋๋ ๋ชจ๋ฅด๊ฒ ๋ค!!!
#include <iostream>
using namespace std;
// 2์ฐจ์ ํ๋ฉด์์์์ ์ขํ๋ฅผ ํํํ ์ ์๋ ๊ตฌ์กฐ์ฒด ์ ์
typedef struct __Point {
int xpos;
int ypos;
} Point;
// ๊ตฌ์กฐ์ฒด๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ๋ ์ ์ ํฉ์ ๊ณ์ฐํ๋ ํจ์๋ฅผ ๋ค์์ ํํ๋ก ์ ์ํ๊ณ (๋ง์
๊ฒฐ๊ณผ๋ ํจ์์ ๋ฐํ์ ํตํด์ ์ป๊ฒ ๋๋ค.)
Point &PntAdder(const Point &p1, const Point &p2) {
... | true |
6902b194a943c6eedaddd0cccd0fd6a30a2ee7f3 | C++ | BobEh/AI-Path-Finding | /ProjectEndGame/Graph.h | UTF-8 | 864 | 3.0625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <list>
#include <vector>
#include "Vertex.h"
#include <string>
using namespace std;
struct Node
{
unsigned int id;
bool visited;
bool hasResource;
bool hasBase;
float gCostSoFar;
float hDistance;
string nodeType;
Vertex position; //position in the game world. used for calculating he... | true |
0c8a5c376a786ab62fe4afdc6294ca6e261193f3 | C++ | Alexander-Wilms/Advanced-Programming-Techniques | /Navigation System (Advanced features)/myCode/CJsonPersistence.h | UTF-8 | 4,217 | 3.0625 | 3 | [] | no_license | /*
* CJsonPersistence.h
*
* Created on: 26.12.2017
* Author: Fabian Alexander Wilms
*/
#ifndef MYCODE_CJSONPERSISTENCE_H_
#define MYCODE_CJSONPERSISTENCE_H_
#include "CPersistentStorage.h"
#include "CWpDatabase.h"
#include "CPoiDatabase.h"
#include <fstream>
#include <string>
#include <type_traits>
class ... | true |
f6c59cd52b2480a920089b7511c6fadae8a9c641 | C++ | zixuanwang/iroom | /AnnotateMain.cpp | UTF-8 | 1,818 | 2.71875 | 3 | [] | no_license | /*
* AnnotateMain.cpp
*
* Created on: Apr 2, 2013
* Author: zxwang
*/
#include <boost/lexical_cast.hpp>
#include <boost/filesystem.hpp>
#include <fstream>
#include <iostream>
#include <list>
#include <opencv2/opencv.hpp>
#include <vector>
bool is_draw = false;
int start_x, start_y;
cv::Mat image;
std::list... | true |
55dfb0c668fde5435770f06b0fff4cdf34cf3226 | C++ | AnthonyG1371/College-Assignments | /Data Structures/Project2/main.cpp | UTF-8 | 417 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <stack>
#include <string>
#include "maze.h"
using namespace std;
//Main simply calls functions
int main()
{
cout << "Starting Maze Program" << endl;
cout << "S is Start, F is Finish, and P is Player Location" << endl;
getrows();
getcols();
Maze mazega... | true |
f97e299ac3c7f72bd29d6c1df038bff187b33743 | C++ | BahiaSechi/AntsCPP | /src/Board/Tile.cpp | UTF-8 | 1,294 | 2.765625 | 3 | [] | no_license | /**
* Address :
* ENSICAEN
* 6 Boulevard Mareฬchal Juin
* F-14050 Caen Cedex
* Note :
* This file is owned by an ENSICAEN student. No portion of this
* document may be reproduced, copied or revised without written
* permission of the authors.
*
* @author Mateo RABOTIN <mateo.rabotin@ecole.ensicaen.fr>
* @a... | true |
303c4f37fe42f27dfac5df4ba3953c34f6a30e3d | C++ | paulnewman1979/edocteel | /000/005/main.cpp | UTF-8 | 1,097 | 3.375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
string longestPalindrome(string s) {
int i;
int j;
int max = 1;
int maxs = 0;
for (i=1; i<s.length(); ++i) {
for (j=1; ((j<=i)&&(j+i<s.length())); ++j) {
if (s[i-... | true |
0d9da78c0c3b3e0647b768277c6fdaade1cca98d | C++ | Shivamj075/DSA | /BITMASKING/Get_Ith_Bit.cpp | UTF-8 | 202 | 2.953125 | 3 | [] | no_license | //Get the Ith bit
#include<bits/stdc++.h>
using namespace std;
int getIthBit(int n,int i){
return (n&(1<<i))!=0?1:0;
}
int main()
{
int n,i;
cin>>n>>i;
cout<<getIthBit(n,i)<<endl;
return 0;
}
| true |
4fb17bb2f75a71012cab502b9ad1361ab24513b8 | C++ | yangjiang123/possumwood | /src/libs/dependency_graph/nodes_iterator.h | UTF-8 | 939 | 2.796875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <stack>
#include <boost/iterator/iterator_facade.hpp>
namespace dependency_graph {
class Network;
template<typename ITERATOR>
class NodesIterator : public boost::iterator_facade <
NodesIterator<ITERATOR>,
typename ITERATOR::value_type::element_type, // element type stored in an std smart po... | true |
6bde2021775ba3e2613ec19966fc7b9a4342c37d | C++ | sAusk3/Cpp_White_Belt | /Week-4/008_ClassRationaleExeptions/rational.cpp | UTF-8 | 2,615 | 3.671875 | 4 | [] | no_license | #include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <exception>
#include <stdexcept>
using namespace std;
int recursive_div_helper (int a, int b)
{
if (b == 0)
return (a);
else
return (recursive_div_helper(b, a % b));
}
class Rational {
public:
Rational () {
... | true |
35ace8a53d7ae0c28630be9fdd5760c95794178c | C++ | shyde8/Jekyll | /Jekyll/src/Jekyll/Broadcaster.cpp | UTF-8 | 658 | 2.78125 | 3 | [] | no_license | #include "Broadcaster.h"
namespace Jekyll
{
void Broadcaster::AddObserver(Observer* observer)
{
for (Observer* obs : this->_observers)
{
if (obs == observer)
{
return;
}
}
this->_observers.push_back(observer);
}
void Broadcaster::RemoveObserver(Observer* observer)
{
std::vector<Observer*>... | true |
2f57e48ea580d01c08771f00036adb2e4978fecd | C++ | mpfeifer1/150Labs | /Lab11/lab11.cpp | UTF-8 | 3,422 | 3.546875 | 4 | [] | no_license | /*--------------------------------------------------------------------
Program: lab11.cpp
This program reads data into a 2-D array named cadmium with daily
readings of airborne cadmium in a room of a house every six
hours (6am, noon, 6pm, and midnight) for seven consecutive
days. Then, it comp... | true |
aab1ae2bf0bdc0a61a282a606d428a34ad14f6f1 | C++ | morganwilde/playful | /Models/Circle.cpp | UTF-8 | 2,052 | 3.671875 | 4 | [] | no_license | #include "Circle.h"
void Circle::init(Point center, double radius, int segments)
{
this->segments = segments;
this->setCenter(center);
this->setRadius(radius);
// The environment
double circleRadius = 2 * M_PI;
double segmentRadius = circleRadius / this->segments;
double angleStart = 0;
... | true |
8875ffb46f4245699463bc8b0ee6c1de14bc9c10 | C++ | Aswinv2k17/Lab_Programs | /S5/OOT/fileopr.cpp | UTF-8 | 848 | 3.3125 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<cstdlib>
using namespace std;
class Payroll
{
char name[20];
float salary;
public:
void readdata(void);
void writedata(void);
};
void Payroll::readdata(void)
{
cout<<name<<" "<<salary<<"\n";
}
void Payroll::writedata(void)
{
cout<<"\nEnter the name:... | true |
a7198514e4fc3c256e5028edbdec46d84917fb07 | C++ | billy607/FTP | /LabelingBase/context/UserAuthorize.h | UTF-8 | 810 | 2.703125 | 3 | [] | no_license | #ifndef USERAUTHORIZE_H
#define USERAUTHORIZE_H
#include<QString>
namespace labelingbase {
class UserAuthorize
{
public:
UserAuthorize(){}
QString getUserName() {
return userName;
}
void setUserName(QString userName) {
this->userName = userName;
}
QString getUserId() {
... | true |
7110fb9ed115ededf8906dfd2d9c399acab5fcc1 | C++ | LorenzoTomaz/_Bacteria_ | /src/Environment.cpp | UTF-8 | 9,217 | 3.421875 | 3 | [] | no_license | #include "Environment.hpp"
void Environment::setup(vector<vector<Cell>> level){
//set the current level's matrix passed by the Game istance
lifeMatrix = level;
gridSize = lifeMatrix.size();
/*
Creation of the player at position (gridGame/2, 1, 1) of the grid
The player is alive afte... | true |
c91f9f4ea55036d43bbd6fc9bbbc4a8bb102eb4e | C++ | chriskatnic/CPSC301 | /simpleFile.cpp | UTF-8 | 1,719 | 3.546875 | 4 | [] | no_license | #include <iostream >
#include < fstream >
//practice writing to and getting from a file.
int main()
{
char c[3] = { '1', '2', '3' };
char d[3];
char e[3];
char * s;
int length;
std::ofstream output("other.bin"); //open da file
output.write( c, 3); //writing to a binary file, write( c... | true |
455904372e7cd8d27a13cb4203f4791aff35857d | C++ | google/gvisor | /test/syscalls/linux/mkdir.cc | UTF-8 | 4,441 | 2.515625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | // Copyright 2018 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... | true |
a72eb3d45f39e1dec7348c08e48e107edf6f224f | C++ | FnEsc/Course-Code | /CPlus_Source/Shiyan3/person.cpp | GB18030 | 909 | 3.453125 | 3 | [] | no_license | #include"pch.h"
#include "person.h"
Person::Person() : m_nAge(0), m_nSex(0)//์บฏ เตฑฺณสผึตm_nAge=0 m_nSex=0
{
strcpy_s(m_strName, "XXX");
}
Person::Person(const char *name, int age, char sex) : m_nAge(age), m_nSex(sex == 'm' ? 0 : 1)//์บฏ 0ลฎ1 วณิฑสผูผ
{
strcpy_s(m_strName, name);
}
Person::Person(const Person &p) : m_nAge(p.m_... | true |
50c414ceb31ea0df8024bc3058c4d16623497d83 | C++ | Rimilmandrita/lab-2-Rimilmandrita-Ghosh-1711106 | /lab2.Question7.cpp | UTF-8 | 373 | 3.3125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int a1,a2,a3;
cout << "Enter an angle of a triangle.\n ";
cin >>a1;
cout<<"angle 1 is= "<<a1<<" degree.\n";
cout << "Enter another angle of the triangle.\n ";
cin >>a2;
cout<<"angle 2 is= "<<a2<<" degree.\n";
a3= 180-(a1+a2);
cout <<"The 3rd a... | true |
bb9b5436880e57dd97a668bc812c2319773cf5ff | C++ | schwa-lab/libschwa | /src/lib/schwa/utils/shlex.h | UTF-8 | 360 | 2.515625 | 3 | [
"MIT"
] | permissive | /* -*- Mode: C++; indent-tabs-mode: nil -*- */
#ifndef SCHWA_UTILS_SHLEX_H_
#define SCHWA_UTILS_SHLEX_H_
#include <string>
namespace schwa {
namespace utils {
/**
* Return a shell-escaped version of the string \p s with quotes added if required.
**/
std::string shlex_quote(const std::string &s);
... | true |
e20e98a78168fab2130ede054f3a7a8a90ad00d5 | C++ | TouwaErioH/Algorithm | /ๅ็ฑป/ๆฐๅญฆๆฆๅฟตไธๆนๆณ/ๅ
ถไปๆฐๅญฆไธ้ข/uva10288.cpp | UTF-8 | 1,291 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#define LL long long
using namespace std;
LL gcd(LL a,LL b){
return a==0?b:gcd(b%a,a);
}
LL lcm(LL a,LL b){
return a/gcd(a,b)*b;
}
int main()
{
LL n;
while(cin >> n) {
LL lm = 1;
for(LL i = 1;i... | true |
c967c37e181ad8eb639a0a5842774ee1c3e927fc | C++ | antoinusitos/CPP_OpenGL | /FirstProject/FirstProject/UIButton.cpp | UTF-8 | 2,922 | 2.53125 | 3 | [] | no_license | #include "UIButton.h"
#include <iostream>
#include <string>
#include "UIManager.h"
#include "LogManager.h"
#include "ResourceManager.h"
#include "CameraManager.h"
#include "Camera.h"
#include "Shader.h"
#include "Model.h"
#include "TimeManager.h"
#include "TextManager.h"
namespace Engine
{
UIButton::UIButton(std::str... | true |
4a483173d7e888d06aef5665d9a2ad4502824c42 | C++ | 7on9/algorithm | /C++/Contacts.cpp | UTF-8 | 1,319 | 3.59375 | 4 | [] | no_license | //Bร i cฦก bแบฃn vแป trie
#include <iostream>
#include <string>
using namespace std;
class Node
{
public:
Node()
{
numOfNode = 0;
for(int i = 0;i < 28;i++)
Arr[i] = NULL;
}
void addString(string s)
{
Node *temp = this;
for(int i = 0;i < s.size();i++)
{
... | true |
e7e3b535f5f9aa48f4e5f7ec0437e0b6c1f32edc | C++ | shashankch/DataStructures-Algorithms | /stringcompression.cpp | UTF-8 | 410 | 3.234375 | 3 | [] | no_license |
#include <iostream>
#include <string>
using namespace std;
void str_comp(string comp)
{
for (int i = 0; i < comp.length(); i++)
{
int cnt = 1;
while (i < comp.length() - 1 && comp[i] == comp[i + 1])
{
cnt++;
i++;
}
cout << comp[i] << cnt;
... | true |
beb097f26016163eb20a10be967aa1f443b71730 | C++ | jodaomaikham/InternGame | /Lesson4/Lesson4/Closed.cpp | UTF-8 | 500 | 3.140625 | 3 | [] | no_license | #include"Locked.h"
#include"Closed.h"
#include"Openned.h"
#include<iostream>
using namespace std;
void Closed::open(Door* door)
{
cout << "*****NOW THE DOOR IS OPEN*****" << endl;
door->setState(new Openned);
}
void Closed::close(Door* door)
{
cout << "THE DOOR IS ALREADY CLOSED " << endl;
}
void Closed::unlock(Do... | true |
6a5adc7be8001ff4ab3ab46d990844f3e54271a0 | C++ | Compiladores7009/Practicas-Laboratorio | /Practicas/p4/src/ParserLL.cpp | UTF-8 | 1,232 | 2.640625 | 3 | [] | no_license | #include "headers/ParserLL.hpp"
ParserLL::ParserLL(Lexer *lexer)
{
this->lexer = lexer;
}
ParserLL::~ParserLL()
{
}
void ParserLL::loadSyms()
{
/*********************************************
* 4. Agregar todos los sรญmbolos (N'โชT) de G'*
*********************************************/
}
void ParserL... | true |
3a2ef33e5d665f363f1d503a52fa180697149ea6 | C++ | Sumant-Dusane/Hotel-Management-System-using-CPP- | /hotel1.cpp | UTF-8 | 6,649 | 3.0625 | 3 | [] | no_license | #include<iostream>
#include<string.h>
using namespace std;
class hotel
{
public:
int rooms[5][4]=
{
{00,01,02,03},
{10,11,12,13},
{20,21,22,23},
{30,31,32,33},
{40,41,42,43}
};
char type;
char rent[6];
char status;
int rent1;
... | true |
c7bfd800202e5a9da55faf301c855097598372d5 | C++ | NOVACProject/SpectralEvaluation | /include/SpectralEvaluation/Calibration/InstrumentLineShapeEstimation.h | UTF-8 | 9,756 | 2.828125 | 3 | [] | no_license | #pragma once
#include <memory>
#include <vector>
#include <string>
#include <SpectralEvaluation/Calibration/InstrumentLineShape.h>
#include <SpectralEvaluation/Evaluation/CrossSectionData.h>
namespace novac
{
class CSpectrum;
class IFraunhoferSpectrumGenerator;
class ICrossSectionSpectrumGenerator;
cl... | true |
10dad5ea1175dace14c58129462d82f7d2f3381f | C++ | AndrijaS37N/doomrecey | /practice_part_two/malamute.hpp | UTF-8 | 595 | 3.078125 | 3 | [] | no_license | #ifndef malamute_hpp
#define malamute_hpp
#include <vector>
// example : taking a declared global constant from husky.hpp and defining it here
const int GLOBAL_AVARAGE_BARKS = 7;
class Malamute
{
private:
std::vector<Yawn> yawns;
public:
void add_yawn(Yawn yawn);
void print_yawns();
void set_yawns(s... | true |
a067ab4927a3e42b3c1bb852a5b0ceafd75c21b9 | C++ | Marko-Jur/Wireless-CAN | /CAN_Transceiver.cpp | UTF-8 | 1,811 | 2.671875 | 3 | [] | no_license | /* File Name:CAN Transceiver
* Author: Marko Jurisic
* Date Edited: 14th June 2021
*
* Description: Contains functions to allow transmission and receiving of CAN messages to and from a DUT.
*/
// Including all header files
#import <Arduino.h>
#include "Pin_Assignments.h"
#include "Libraries.h"
floa... | true |
a190c34e035b819cb740e71e12bc046a536a17c7 | C++ | TheWeberino/LoisonTan | /src/engine/ActionList.cpp | UTF-8 | 432 | 2.65625 | 3 | [] | no_license | #include "ActionList.h"
namespace engine{
ActionList::ActionList(std::vector<Action*> actions){
this->actions=actions;
}
ActionList::~ActionList(){
}
int ActionList::size () const{
return actions.size();
}
Action* ActionList::get (int i) const{
return ... | true |
8705ebb60eec8933745a8766573e2925ad14d95f | C++ | Sitispeaks/turicreate | /src/ml/sketches/hyperloglog.hpp | UTF-8 | 4,343 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive | /* Copyright ยฉ 2017 Apple Inc. All rights reserved.
*
* Use of this source code is governed by a BSD-3-clause license that can
* be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
*/
#ifndef TURI_SKETCH_HYPERLOGLOG_HPP
#define TURI_SKETCH_HYPERLOGLOG_HPP
#include <cmath>
#include <c... | true |
0f2b8086d5f4add3d4b136ec4b99e88712145fdc | C++ | wf225/ios_ci | /DemoLib/Counter.h | UTF-8 | 128 | 2.515625 | 3 | [] | no_license |
class Counter {
public:
Counter();
int GetCount() { return count_; }
int Increment();
private:
int count_;
}; | true |
7fec690b86f89509a3656b1e6cc421fd4afbb7d3 | C++ | WescamSW/libwscDrone | /src/Pilot.cpp | UTF-8 | 7,054 | 2.703125 | 3 | [] | no_license | /*
* piloting.c
*
* Created on: Feb 3, 2019
* Author: slascos
*/
#include <iostream>
#include <chrono>
#include <stdexcept>
#include "Utils.h"
#include "Pilot.h"
using namespace std;
using namespace chrono_literals;
namespace wscDrone {
constexpr int PILOT_TIMEOUT_MS = 10000;
constexpr float MOVEMENT_STEP... | true |
c7a83977841291fe3cf456b7467afbed4457cccc | C++ | freezexpert/C | /sudoku.cpp | UTF-8 | 1,019 | 2.78125 | 3 | [] | no_license | #include <stdio.h>
char array1[13][13]={0};
int array2[10]={0};
int main()
{
for(int i=0;i<13;i++)
{
for(int j=0;j<13;j++)
{
scanf("%c",&array1[i][j]);
}
}
int flag1=1;
for(int i=0;i<13;i++){
for(int j=0;j<13;j++){
if(array1[i][j]=='x'){
... | true |
aaf632eb334d323c8b61ae33bda7c0bb4b4a6095 | C++ | pimukthee/competitive-prog | /csacademy/numbers_tournament.cpp | UTF-8 | 1,734 | 2.640625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int arr[105][105], n;
pair <int, int> ans[105];
bool cmp(pair <int, int> a, pair <int, int> b) {
if (a.first != b.first) return a.first > b.first;
else return a.second < b.second;
}
pair <int, int> find_bound(int i, int j) {
int high = -1, low = -1;
for ... | true |
e037ad38ec651b134be7de4f6b3e59c6f86657e6 | C++ | LeThaoHuyen/CS202-Group06-Road-Crossing | /Road Crossing Game/Road Crossing Game/Game2.cpp | UTF-8 | 3,458 | 2.921875 | 3 | [] | no_license | #include "Game2.h"
Game2::Game2() {
screen.init(consoleWidth, consoleHeight, frameWidth, frameHeight);
laneManager.init(1);
player.init(96, 34);
currentLevel = 1;
m_isRunning = true;
}
Game2::Game2(int level) {
screen.init(consoleWidth, consoleHeight, frameWidth, frameHeight);
laneManager.init(level);
player... | true |
9c39db079edd0b43828992686f67a5d20bfd670f | C++ | Shaik-Avaies/Algo- | /Searching & Sorting(Divide and Conquer/_KTH ROOT.cpp | UTF-8 | 567 | 2.71875 | 3 | [] | no_license | #include<iostream>
#include<math.h>
#define ll long long
using namespace std;
bool isValid(ll n,ll k,ll mid){
if(pow(mid,k) <= n) return true;
else return false;
}
int main() {
ll t;
cin>>t;
while(t--){
ll n,k;
cin>>n>>k;
ll s = 1, e = n;
ll final_ans = 0;
w... | true |
3b0f6f987cebe8eb20ae8ceba14eeccec66d15eb | C++ | mrfade/depth-camera-transformer | /src/FilterPipe.cpp | UTF-8 | 341 | 2.671875 | 3 | [
"MIT"
] | permissive | #include"FilterPipe.h"
#include<vector>
void FilterPipe::addFilter(PointCloudFilter* filter)
{
filters.push_back(filter);//!adds filter to the filters vector
}
void FilterPipe::filterOut(PointCloud& points)
{
for (int i = 0; i < filters.size(); i++)
{
filters[i]->filter(points);//!filters pointcloud with using f... | true |
26416c0b44a4bc942786557790e97c889efabf49 | C++ | xGreat/CppNotes | /src/algorithms/data_structures/string/num_to_english_string.hpp | UTF-8 | 2,859 | 3.34375 | 3 | [
"MIT"
] | permissive | #ifndef CPPNOTESMAIN_NUM_TO_ENGLISH_STRING_HPP
#define CPPNOTESMAIN_NUM_TO_ENGLISH_STRING_HPP
/*
*/
#include <string>
#include <vector>
#include <algorithm>
namespace Algo::DS::String {
class ConvertNumToEnglishStr {
enum Section {
first = 0,
thousand,
million,
... | true |
2fd919776f537bffbce2395ae31b05ed34b7b230 | C++ | benoitk/COT | /tests/auto/keyboard/keyboardnormalbutton/keyboardnormalbuttontest.cpp | UTF-8 | 2,321 | 2.703125 | 3 | [] | no_license | #include <qtest.h>
#include <qtestmouse.h>
#include <QSignalSpy>
#include "CKeyboardNormalButton.h"
#include <QObject>
class KeyboadNormalButtonTest : public QObject
{
Q_OBJECT
private slots:
void shouldHaveDefaultValue();
void shouldAssignCharacter();
void shouldEmitPressSignal();
void shouldEmitCl... | true |
239aa56c511c48e9f86941532efb5a4ba39fc442 | C++ | matinjun/leetcode--- | /1.ไธคๆฐไนๅ.cpp | UTF-8 | 932 | 3.1875 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=1 lang=cpp
*
* [1] ไธคๆฐไนๅ
*/
// @lc code=start
#include <vector>
#include <unordered_map>
using namespace std;
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
// vector<int> result(2);
// for(int i = 0; i < nums.size(); ++i) {
/... | true |
c5725031e5ecbc5fe9c85edbf2dd037b610c7a96 | C++ | aks14y/OOT | /program14.cpp | UTF-8 | 753 | 3.5625 | 4 | [] | no_license | #include<iostream>
using namespace std;
class student
{
public:
int rollno;
void read()
{
cout<<"Enter the rollno : ";
cin>>rollno;
}
};
class test:public student
{
public:
int m1,m2;
void read1()
{
cout<<"Enter the marks :";
cin>>m1>>m2;
}
};
class sports
{
public:
int weightage;
v... | true |
12830813e3949c333d793f3c17fa8849889e6b1a | C++ | lifujie/Misc | /Contest/BDstar/2012่ตๆ ผ/2.cpp | UTF-8 | 487 | 2.734375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int foo(int set[21],int k)
{
int an=0;
for(int i=0;i!=k;i++)
an+=set[i];
an=an-k+1;
return an;
}
int main()
{
int answer[21];
int times=0;
cin>>times;
for(int run=0;run!=times;run++)
{
int k=0;
cin >> k;
int set[21]={0};
int n,cnt=0;
while(cnt!=k &&ci... | true |
94e7561513ed9dfce30b343d63d4e0b3dfe91823 | C++ | masaers/cmdlp | /options.hpp | UTF-8 | 4,450 | 2.59375 | 3 | [
"MIT"
] | permissive | #ifndef COM_MASAERS_CMDLP_OPTIONS_HPP
#define COM_MASAERS_CMDLP_OPTIONS_HPP
#include "cmdlp.hpp"
#include "iooption.hpp"
#include "paragraph.hpp"
// c++
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
// c
#include <cstdlib>
namespace com { namespace masaers { namespace cmdlp {
namespace o... | true |
b8883dc05c696fd416abf4f04ff420aafb4fc43b | C++ | eric-plus-plus/arduino-demo-simon | /simon-says-2/simon-says-2.ino | UTF-8 | 5,144 | 3 | 3 | [
"MIT"
] | permissive | /*
* Simon Says 2
*
* This version of the simon says code uses more
* features of the C language than the previous
* version. It functions the same as
* "simon-says.ino", but has good programming
* practices (in my opinion), making it much more
* readable.
*
* It is still simple code that doesn't implement
... | true |
20687cc6930d54744d01b00c8ee2977a488e685d | C++ | Yami-Karen/Week2 | /A1.cpp | UTF-8 | 742 | 2.703125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
//con dem voi so lan lap nhat dinh
for (int i = 1;i <= 100;i++)
if (i%2 == 0) cout << i << " ";
cout << endl;
//khong xac dinh so lan lap
int i = 0;
while (true)
{
i++;
if (i%2 == 0) cout << i << " ";
if (i == 100) break;
}
cout << e... | true |
b5979a2464298fa57e1c68ede4afb4d7acb404c0 | C++ | fhmunna/rEPaRDUINO | /PIR_Email/PIR_Email.ino | UTF-8 | 4,057 | 2.5625 | 3 | [] | no_license | #include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xAF, 0xCE, 0xDD }; // whatever mac you want
byte ip[] = { 192, 168, 0, 109};
byte server[] = { 203, 188, 201, 253 }; // Mail server address smtp.mail.yahoo.com.tw)
Client client(server, 25); // yahoo's mobile smtp server ip/port 587
//////////... | true |
59fc814eb932d38d4aa86cb21952284f7ebe1269 | C++ | MG-RAST/clustgun | /hat.hpp | UTF-8 | 12,858 | 2.953125 | 3 | [
"BSD-2-Clause"
] | permissive |
#ifndef clustgun_hat_h
#define clustgun_hat_h
#include <omp.h>
#include "basic_tools_omp.hpp"
class ReaderWriterLock;
template <class T>
class HashedArrayTree { // powers of two 2^20=1048576
protected:
vector<T * > *hash; // the inner arrays will be fixed size, the outer vector flexibel
size_t arrayChunkSiz... | true |
30299bc14d145060a1446588e30005953cf0b8d7 | C++ | Shubham1320/Data-Structure-Assignments | /Data Structures/Expression Tree/expression.h | UTF-8 | 1,087 | 3 | 3 | [] | no_license | /*
* Author: Shubham Yewalekar
* Div : SE 9 H9
* Roll No : 23182
* File Name : Expression Header File
*/
#ifndef IMPLEMENT_H_
#define IMPLEMENT_H_
class expression
{
private:
char *exp;
int exp_size;
int postFix_size;
char *postFix;
char *preFix;
public:
expression();//constructor
void setEx... | true |
2a30813548739551228b97fb46a38ef4ef8d3d85 | C++ | coneco/PAT-Advanced-Practice | /1029 Median/median.cpp | UTF-8 | 733 | 2.84375 | 3 | [] | no_license | #include <cstdio>
#define MAX 1000000
int main()
{
int n1, n2;
int* s1 = new int[MAX];
int* s2 = new int[MAX];
std::scanf("%d", &n1);
for (int i = 0; i < n1; ++i)
{
std::scanf("%d", s1 + i);
}
std::scanf("%d", &n2);
for (int i = 0; i < n2; ++i)
{
std::scanf("%d", s2 + i);
}
int n = n... | true |
36c24239772eeaa333a2e85bc1b65007ee37afbf | C++ | trialblazer/Algorithm | /Algorithm/shuzifanyi.cpp | UTF-8 | 2,286 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <string.h>
using namespace std;
char num[20];
char a[20][10]={"","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","ninteen"};
char b[9][10] = {"","twenty","thirty","fourty","fifty","sixty... | true |
510860fadc43b314ba9778fb4148a0ebb94d1923 | C++ | dreampatryk/Arkanoid | /Arkanoid/Entity.h | UTF-8 | 762 | 2.8125 | 3 | [] | no_license | #pragma once
#include <SFML/Graphics.hpp>
class Entity : public sf::Drawable, public sf::Transformable
{
protected:
sf::Vector2f m_velocity;
sf::RectangleShape m_shape;
sf::Vector2f getVelocity() {
return this->m_velocity;
}
sf::Vector2f getPosition() {
return this->m_shape.getPosition();
}
sf::Vector2f ge... | true |
580df07804dda23514e338dea18e9097cc2cf4d5 | C++ | yash19970/CPP-Questions | /vec.cpp | UTF-8 | 245 | 2.703125 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
int main() {
vector<int> v;
int n;
cout<<v.size()<<endl;
for(int i=0;i<5;i++)
{
v.push_back(i);
}
for(int i=0;i<5;i++){
cout<<"Enter: "<<endl;
cin>>n;
cout<<v[n]<<endl;
}
return 0;
}
| true |
1caee45ddd8262164026aff48568cda61062d6ad | C++ | KISTI-hackathon-2017/IT-s | /Source/Client/Stop1.ino | UTF-8 | 5,646 | 2.609375 | 3 | [] | no_license | #include "LedControl.h"
#include <LiquidCrystal.h>
LedControl lc1=LedControl(8,10,9,4);
LiquidCrystal lcd1(7, 6, 5, 4, 3, 2);
#include "Phpoc.h"
#include "SPI.h"
char server_name[] = "192.168.0.6";
int port = 8080;
char bus_num1[5]="719 ";
int bus_num_len=0;
char bus_data1[20]="full";
char stop_data1[20]={0};
char t... | true |
5cd58cbdfa02107cfc13f474a40cffb31cd9adef | C++ | FASTSHIFT/ucGIS | /ucGISEngine/pcๅฐๅพ่ฝฌๆข็จๅบ/v1.2/MapDll/Line.h | GB18030 | 1,581 | 2.59375 | 3 | [] | no_license | // Line.h: interface for the CLine class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_LINE_H__8B3F7165_E05A_48D6_BD17_321D5BBE5597__INCLUDED_)
#define AFX_LINE_H__8B3F7165_E05A_48D6_BD17_321D5BBE5597__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER... | true |
e5ca45797650b5301ceacd817758a66ac62e3bb7 | C++ | DelusionsOfGrandeur/labs | /ะฒะฒะฟ9(1).cpp | UTF-8 | 398 | 2.546875 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
#include<locale.h>
int main()
{
setlocale(LC_ALL, "Russian");
int n;
printf("ะฒะฒะตะดะธัะต ัะตะปะพะต ัะธัะปะพ ัะตะบัะฝะด, ะฟัะพัะตะดัะธั
ั ะฝะฐัะฐะปะฐ ัััะพะบ\n");
scanf("%d", &n);
n = (n%60);
printf("ัะธัะปะพ ัะตะบัะฝะด, ะฟัะพัะตะดัะธั
ั ะฝะฐัะฐะปะฐ ะฟะพัะปะตะดะฝะตะน ะผะธะฝััั, ัะฐะฒะฝะพ %d", n);
return 0;
}
| true |
fa524f4130a935f743fad72afdacdd83f56d9fa1 | C++ | agudeloandres/C_Struct_Files | /other_c_files/FCCDPAL.CPP | UTF-8 | 1,410 | 2.578125 | 3 | [] | no_license | #include <stdio.h>
#include <dos.h>
void main()
{
int *base,*dir;
int A[20][20],limtif,limtsf,W,limtic,limtsc,colm,n,d[10],sma,r,i,j;
printf(" POR FAVOR DIGITE EL NUMERO DE FILAS Y COLUMNAS DE LA MATRIZ A :");
do
{
scanf("%d",&n);
}
while (n<=0);
printf (" POR FAVOR DAR EL LIMITE INFERIOR DE FILAS Y DE COLUM... | true |
e06e02b85ef2cb8ec3677caeaac8ef5fe482f723 | C++ | pharick/cpp | /2-year/22-brackets-overload/b.cpp | UTF-8 | 520 | 3.734375 | 4 | [] | no_license | #include <iostream>
class Fraction {
int x, y;
public:
Fraction(int x = 0, int y = 1);
int& operator [] (int i);
};
Fraction::Fraction(int x, int y) {
this->x = x;
this->y = y;
}
int& Fraction::operator [] (int i) {
if (i == 0) return this->x;
if (i == 1) return this->y;
throw 1;
}
i... | true |
726599dbfc63bbc816f302be29555cc8861b6277 | C++ | cnug98/CS530 | /prog2/convert.cpp | UTF-8 | 3,301 | 3.5 | 4 | [] | no_license | /*
* Members: Colin Nugent, Carter Andrews, Patrick Perrine
* Red ID's: 820151963, 820214623, and 820486635
* Class Users: cssc0440, cssc0425, cssc0426
* Class Information: CS530, Spring 2019
* Assignment #2, SIC/XE Disassembler
* Filename: convert.cpp
* Purpose: Contains helper methods for data type conversions... | true |
a233809a305f5e72cd109703cadacf6d9e7e4da0 | C++ | DevinLeamy/Competitive-Programming | /Toolkit/Algorithms/LongestIncreasingSubsequence.cpp | UTF-8 | 710 | 3.234375 | 3 | [] | no_license | #include <vector>
#include <algorithm>
#define INF 2147483647
using namespace std;
int long_inc_sub(vector<int> &vals) {
int n = (int) vals.size();
vector<int> last(n, INF);
int len = 1;
last[0] = vals[0];
for (int i = 1; i < n; i++) {
int val = vals[i];
if (val < last[0]) {
// new smallest value
last... | true |
c36728dcfad293902f2719167bc649f19172cd47 | C++ | AVNISHPATEL102/POWERGRID-GAME | /Player.cpp | UTF-8 | 2,642 | 3.421875 | 3 | [] | no_license | /*
* Player.cpp
*
* Created on: Feb 25, 2019
* Authors: Trevor Lall, Stephen Smith, Avnish Patel, Wenbo Zhong
* Purpose: Source file for Player Object. Used to represent players for the game.
*/
#include "Player.h"
#include "City.h"
#include "House.h"
using namespace std;
//Default Constructor
Pl... | true |
07f6abb236c99534abeae3d4234432cf4ea4bd88 | C++ | cskarthikcs/cpp-template | /main.cpp | UTF-8 | 2,449 | 2.765625 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<string>
#include<math.h>
#include<list>
#include<vector>
#include <sstream>
#define SSTR( x ) dynamic_cast< std::ostringstream & >( \
( std::ostringstream() << std::dec << x ) ).str()
using namespace std;
void print (vector<vector <int> >& B ){
for(long long int ... | true |
4d02678adbab1b3902bd8a2f940ea2ae69b72fd3 | C++ | aceiro/atm_2019 | /CI-APP/Src/FormCreate.cpp | UTF-8 | 5,728 | 3.34375 | 3 | [] | no_license | // Declaraรงรฃo das Bibliotecas internas do C++
#include <iostream>
#include <string>
#include <ctime> // Biblioteca interna do C++ para usar padrรตes de data hora do sistema
#include <cctype> // Biblioteca interna do C++ para usar "isdigit"
// Declaraรงรฃo das Bibliotecas internas do Projeto (declaรงรฃo das Classes)
#inclu... | true |
c6d4bf212fe80d86028aeb00548aa2a996809cef | C++ | kurocha/logger | /source/Logger/Log.hpp | UTF-8 | 1,766 | 2.890625 | 3 | [
"MIT"
] | permissive | //
// Log.hpp
// File file is part of the "Logging" project and released under the MIT License.
//
// Created by Samuel Williams on 28/6/2017.
// Copyright, 2017, by Samuel Williams. All rights reserved.
//
#pragma once
#include "Level.hpp"
#include <sstream>
#include <Time/Timer.hpp>
#include <unordered_map>
#... | true |
475ef93f9fda95fc03befd5f91e03d438ef81738 | C++ | teptind/AlgoLabs | /Labs/dp/4A.cpp | UTF-8 | 2,215 | 2.734375 | 3 | [] | no_license | #include <bits/stdc++.h>
#include <time.h>
using namespace std;
#define ll long long
#define ld long double
#define uint unsigned int
#define ull unsigned long long
struct P{
ll acts, resH, resW;
int divInd;
P() {}
P(ll a, ll rH, ll rW, int dI) {
acts = a; resH = rH, resW = rW; divInd = dI;
... | true |
22ad9105da1fdb573eddd02d184ade4681597999 | C++ | RKBOSAMIA/Cpp-Applications | /STL vector and List/SortedList.cpp | UTF-8 | 1,894 | 3.578125 | 4 | [] | no_license | #include <iostream>
#include <iterator>
#include "SortedList.h"
using namespace std;
SortedList::SortedList()
{
Node::reset();
}
SortedList::~SortedList()
{
Node::reset();
}
/***** Complete this file. *****/
void SortedList::prepend(const long value)
{
this->push_front(value);
}
void SortedList::appen... | true |
74cace1b73b212bf9ed183deadb290ae1af2d8f3 | C++ | SamDHodgkinson/c.pp-algorithms | /logical operators.cpp | UTF-8 | 879 | 4.09375 | 4 | [] | no_license | /*This program asks for 3 numbers to be inputted.
The first and second number entered represent the minimum and maximum of the interval respectively.
The program then checks if the third number is within this interval and output a boolean type variable (1 = true, 0 = false)
*/
#include <iostream>
using names... | true |
1d4e943bd52af7c02925b4d145a93132b89f87ec | C++ | TheBuzzSaw/Nullocity | /source/SimpleBufferObject.hpp | UTF-8 | 701 | 2.78125 | 3 | [
"Unlicense"
] | permissive | #ifndef SIMPLEBUFFEROBJECT_HPP
#define SIMPLEBUFFEROBJECT_HPP
#include "SimpleBuilder.hpp"
class SimpleBufferObject
{
public:
SimpleBufferObject();
SimpleBufferObject(const SimpleBuilder& builder);
SimpleBufferObject(SimpleBufferObject&& other);
~SimpleBufferObject();
Simp... | true |
459015cae3a809ad52e591f86b956c37f79ab654 | C++ | bjornt16/T113VLN1-2 | /domain.h | UTF-8 | 2,958 | 2.75 | 3 | [] | no_license | #ifndef DOMAIN_H
#define DOMAIN_H
#include <vector>
#include <algorithm>
#include <string>
#include <fstream>
#include <iostream>
#include "data.h"
using namespace std;
//domain layer
class Domain
{
private:
//declare data variable, to have access to lower layer.
Data data;
Utils utils;
public:
Doma... | true |
9c87a9d4b1971fd8c185d6c330de6687158843b3 | C++ | MinhazAbtahi/UVA | /10812 - Beat the spread.cpp | UTF-8 | 541 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cmath>
/*
a+b=sum...(1)
=>a=s-b;
a-b=diff...(2)
getting value of a from (1) and putting it in (2)
s-b-b=diff
s-diff=2b
b=(s-diff)/2
*/
using namespace std;
int main()
{
int t;
scanf("%d", &t);
while(t--){
int s,d,a,b;
... | true |
603078d32c5235215070103cafff91b5157b898e | C++ | zacklukem/weird-os | /tests/string.cpp | UTF-8 | 1,613 | 3.078125 | 3 | [] | no_license | #include "test/tests.h"
#include <string.h>
#include <util/string.h>
using util::string;
TEST_CASE(string_strlen) {
const char *str = "12345678";
ASSERT_EQ(strlen(str), 8);
}
TEST_CASE(string_strcmp) {
const char *a = "asdf";
const char *b = "fdsa";
const char *c = "asdfg";
const char *d = "asdf";
ASSER... | true |
0d7a13d6cab9cb37de3b0f890c14df2d63e5c8fe | C++ | icalamesa/Practica-PRO2 | /src/platform/user.cc | UTF-8 | 2,961 | 3.078125 | 3 | [] | no_license | #include "user.hh"
#include <iostream>
using namespace std;
User::User(){}
void User::insertion(const string& problem_id, bool solved)
{
this->problem_register.emplace(make_pair(problem_id, make_pair(solved, 1)));
}
int User::u_tell_course() const
{
return this->coursing;
}
bool User::u_is_coursing() const... | true |
9e99227e0e1420eb9a34178fc4a34403d291fc4b | C++ | gaelh7/Graphics | /include/Graphics/shader.hpp | UTF-8 | 6,934 | 2.703125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <glad/glad.h>
#include <string>
#include <fstream>
#include <sstream>
namespace gmh {
struct ShaderSource {
std::string VertexShader, FragmentShader;
};
class Shader {
private:
static ShaderSource ParseShader(const char* filepath);
static unsi... | true |
c9913cbeffbcb7d9b052c8fc141af3b0e5df9d41 | C++ | iyappan/CPP---Maze-using-various-Graph-algorithms | /guievent.h | UTF-8 | 2,476 | 2.75 | 3 | [] | no_license | #ifndef GUIEVEN_H_INCLUDED
#define GUIEVEN_H_INCLUDED
#include<string>
#include"cmazeconst.h"
#include"cevents.h"
using namespace std;
class CRoom;
//These are the events used by core logic to submit on GUI for various painting.
class GUIMazeEvent : public CMazeEvent
{
public:
virtual ~GUIMazeEvent(){}
//Fact... | true |
e6e03a0c8bd1c69c6a4e58570c7454f443a899bf | C++ | gun2841/guno | /PS/BOJ/C++/1912.cc | UTF-8 | 253 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace::std;
int main()
{
int n, t, sum=0, m= 1<<31;
scanf("%d", &n);
while (n--){
scanf("%d", &t);
if (sum < 0) sum = t;
else sum += t;
m = max(m, sum);
}
cout << m;
}
| true |
ebda228457a3bec72c4f6d393c2f5d25d33455c5 | C++ | sangwa69/Data-Structures-and-Algorithims-Intro-II | /Project 3/StudentWorld.cpp | UTF-8 | 7,321 | 2.96875 | 3 | [] | no_license | #include "StudentWorld.h"
#include "GameConstants.h"
#include <string>
#include "Actor.h"
#include<cmath>
using namespace std;
GameWorld* createStudentWorld(string assetDir)
{
return new StudentWorld(assetDir);
}
// Students: Add code to this file, StudentWorld.h, Actor.h and Actor.cpp
StudentWorld::StudentWorld(... | true |
c50e5a0354d71c982c7c4a9178ca161315857279 | C++ | sebastiandev/muxer | /musicindexer/ui/compactplaylist.h | UTF-8 | 906 | 2.609375 | 3 | [] | no_license | #ifndef COMPACTPLAYLIST_H
#define COMPACTPLAYLIST_H
#include <QWidget>
#include <QModelIndex>
#include <QPair>
#include "entities/song.h"
namespace Ui {
class CompactPlaylist;
}
class CompactPlaylist : public QWidget
{
Q_OBJECT
public:
explicit CompactPlaylist(QWidget *parent = 0);
~CompactPlaylist... | true |
d26aadeed79bce5130a28f76a7176488e1fc324a | C++ | gorevojd/Ivan | /Source/asset_builder.cpp | UTF-8 | 66,062 | 2.53125 | 3 | [] | no_license | #include "asset_builder.h"
/*
NOTE(Dima):
1) Images are stored in gamma-corrected
premultiplied-alpha format
2) Animations will be baked into models.
Later maybe if I need I should make that
I can do it both ways.
3) IMPORTANT!!!
If you bake multiple animations in a
single file, you should m... | true |
d7048c60cba2f880a17c0856464fc8b3e9dcf8e0 | C++ | Coolog/Nanodet-Robot-PathPlanning | /path_planning.cpp | UTF-8 | 27,704 | 2.609375 | 3 | [] | no_license | #include <path_planning.h>
/*********************** DEBUGๅฝๆฐๅฎๅฎไน***********************/
//#define DUBUG_LINE //่พๅบ็ป็็บฟ็ไฝ็ฝฎไฟกๆฏ
//#define DEBUG_PRE_MESSAGE //่พๅบๅไธๅธง็ไฟกๆฏ
//#define DEBUG_NOW_MESSAGE //่พๅบๅฝๅๅธง็ไฟกๆฏ
//#define DEBUG_EACH_LINE //็ปๆฏไธๆก็บฟ
float Path::judge_distance(){
if(line_max_y[la... | true |
907c68137e41cf28f9807d5911fb85dfd0341854 | C++ | johnoneil/dynrec-experiment | /main.cpp | UTF-8 | 7,259 | 2.828125 | 3 | [] | no_license | /*
main.c
dynrec experiment for performance improvment measure
*/
#include <iostream>
#include <stack>
#include <chrono>
#if __EMSCRIPTEN__
#include <emscripten.h>
#define __DYNREC__ 1
#endif
#define LOOPS 100
class VirtualMachine {
public:
#if __EMSCRIPTEN__
void dynrec_startMethod(const char* name)
{... | true |
4d4c297d3d80bd19078a5221f70ee9f92db92a73 | C++ | amirbaghi/pac-boy-game-opengl | /Headers/Obstacle.h | UTF-8 | 841 | 2.9375 | 3 | [] | no_license | #ifndef OBSTACLE_H
#define OBSTACLE_H
#include "Component.h"
// Obstacle Component, inheriting from Component class
class Obstacle : public Component
{
public:
Obstacle(Component *parent);
~Obstacle();
void load(int time);
void update(int time);
void render(int time);
// x1 Getter
int ge... | true |
797c7cd9757396af762c00b123f45972ecd688f1 | C++ | akshayaggarwal/LeetCode | /Q_104.cpp | UTF-8 | 614 | 3.1875 | 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:
int ht;
void max_depth(TreeNode *root,int level){
if(root == NULL)
retu... | true |
cce688c96db3cf4c85622868cf1b6a189344787f | C++ | yueyiqiu178/DataStructure | /booleanvariable.cpp | UTF-8 | 907 | 2.75 | 3 | [] | no_license | #include <iostream>
#include<iomanip>
using namespace std;
void printout(bool []);
int main(void) {
bool a[5];
int n=5;
for(int i=0;i<n;i++)
a[i]=false;
while(!a[0]){
printout(a);
int j=n-1;
a[n-1]... | true |
127a0d786ee05adb284ca4f2fab67a7fdbdb2eed | C++ | kermado/Suborbital | /include/suborbital/scene/SpecificSceneFactory.hpp | UTF-8 | 744 | 2.9375 | 3 | [
"MIT"
] | permissive | #ifndef SUBORBITAL_SPECIFIC_SCENE_FACTORY_HPP
#define SUBORBITAL_SPECIFIC_SCENE_FACTORY_HPP
namespace suborbital
{
template<typename SceneType>
class SpecificSceneFactory : public SceneFactory
{
public:
/**
* Constructor.
*/
SpecificSceneFactory() = default;
/... | true |
060306c4c47b218fd736e40f9111b2ea7183bb10 | C++ | alexandraback/datacollection | /solutions_5652388522229760_1/C++/calfcamel7/A.cpp | UTF-8 | 816 | 2.78125 | 3 | [] | no_license | #include <stdio.h>
int a[10];
int chk()
{
for(int i = 0; i < 10; i++)
if(!a[i])
return 0;
return 1;
}
void add(long long x)
{
//printf("add %lld\n", x);
while(x)
{
a[x % 10] = 1;
x /= 10;
}
}
long long found(long long x)
{
//printf("found %lld\n",x);
for(int i = 0; i < 10; i++)
a[i] = 0;
long long a... | true |
e67f74ab958d5a62aba60f9dbdfca5d9b9c65b00 | C++ | knightrider17/PoolsTestConsApp | /PoolsTestConsApp/tests.cpp | UTF-8 | 11,351 | 2.9375 | 3 | [] | no_license | #include "tests.h"
#include "solutionBicycle.h"
#include "solutionStl.h"
void fillPoolFromArray(vector<uint8_t> &_arr_from, Pool& _pool_to)
{
for (size_t i = 0, ilen = _arr_from.size(); i < ilen; i += 2)
{
_pool_to.push_back(Range(_arr_from[i], _arr_from[i + 1]));
}
}
////////////////////////////... | true |
356a6007a7b197558a1010992f65849fc4558ce1 | C++ | yang947960976/Car | /lcdclock.cpp | UTF-8 | 959 | 2.796875 | 3 | [] | no_license | #include "lcdclock.h"
#include <QTime>
LcdClock::LcdClock(QWidget *parent)
:QLCDNumber(parent),
hour(0),
minute(0),
second(0)
{
// ๅๅพๅฝๅ็่ฐ่ฒๆฟไฟกๆฏ
QPalette pal = this->palette();
this->setDigitCount(8);
// ๅฐ่ๆฏ่ฒ่ฎพ็ฝฎไธบๆทก็ฐ่ฒ
pal.setColor(QPalette::Background, Qt::lightGray);
... | true |
370d1ab1adfa72ed8ae4719b6893509b1cacf65e | C++ | seritake/TwoDimetionalInvertedPendlum | /src/trackModule/cameraException.hpp | UTF-8 | 373 | 2.875 | 3 | [] | no_license | #pragma once
#include <stdexcept>
#include <string>
using std::string;
//Exception class about camera
class CameraException: public std::runtime_error{
public:
CameraException(const char* message):runtime_error(message){}
CameraException(const string& message):runtime_error(message){}
CameraException(... | true |
440488ac8db91731a39d46d6fc4817a727742c50 | C++ | giftycad/my-c-lessons | /factorial.cpp | UTF-8 | 845 | 4.0625 | 4 | [] | no_license | //calculating factorial using for, while loop and do-while loop
#include <iostream>
#include <string>
//for loop
/*
int main()
{
int factorial = 5;
int fact = factorial;
for (int i = factorial - 1; i > 1; i--)
{
factorial = factorial * i;
}
std::cout << "The factorial of " << fact << " ... | true |
a5d63b7503dcca6e24ce9ff37f1ce59ff9c82af6 | C++ | jaye1944/lcpp | /thread/mutual.cpp | UTF-8 | 1,815 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <string>
#include <chrono>
#include <thread>
#include <mutex>
#include <memory>
#define NO_THREAD 10
#define ELEMENTS 10000
// std::this_thread::sleep_for(std::chrono::milliseconds(10));
/*
5 thread write to map and other 5 threads read from map
*/
std::map<std::string, std:... | true |
1c99761850139428c4821d2adb9a6092bece13b7 | C++ | astrellon/Rouge | /log/logger.h | UTF-8 | 2,296 | 2.59375 | 3 | [
"MIT"
] | permissive | #pragma once
#include "log_entry.h"
#include <string>
#include <sstream>
#include <vector>
#ifdef _VERBOSE_LOG
# define am_log(type, msg) am::log::_log_verbose(type, msg, __FILE__, __LINE__)
# define am_log_e(entry) am::log::_log_verbose(entry, __FILE__, __LINE__)
#else
# define am_log(type, msg) am::log::_log(type... | true |
a93eeb4308b9ab47931f14b78cb1907f5e42c9d8 | C++ | hbdhj/spoj-cpp | /1161_TOE1.cpp | UTF-8 | 2,183 | 3.109375 | 3 | [] | no_license | /*
TASK: Tic-Tac-Toe ( I )
Input:
6
X.O
OO.
XXX
O.X
XX.
OOO
XXO
OOX
OXX
XXX
OO.
..O
XXX
OOO
...
0X0
XXX
0X0
Output:
yes
no
no
no
no
no
*/
#include <iostream>
#include <vector>
using namespace std;
int num(string m, char c)
{
int ret=0;
for(int i=0;i<m.length();i++)
if(m[i]==c)
... | true |
57ec62089ea5a57df888d9129e4cd0f313d4f546 | C++ | evoldoers/machineboss | /ext/valijson/internal/uri.hpp | UTF-8 | 897 | 2.78125 | 3 | [
"BSD-3-Clause"
] | permissive | #pragma once
#ifndef __VALIJSON_INTERNAL_URI_HPP
#define __VALIJSON_INTERNAL_URI_HPP
#include <string>
namespace valijson {
namespace internal {
namespace uri {
/**
* @brief Placeholder function to check whether a URI is absolute
*
* This function just checks for '://'
*/
inline bool isU... | true |
712aa72611ff33cf7c1bb949f28ceb2677c56d0f | C++ | mu1023/select_demo | /select_client.cpp | UTF-8 | 1,216 | 2.546875 | 3 | [] | no_license | #include <sys/select.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include<thread>
#include <string.h>
#include <stdio.h>
#include <signal.h>
#include<iostream>
using namespace std;
int main()
{
int sockfd=socket(AF_INET,SOCK_ST... | true |
9ee7ee694d119c2c42ee951a487e7cecbb96990b | C++ | Chen-Qixian/BUAA-PostGraduate-Entrance-Exam | /7-DynamicPlan/eg7-3preventMissile.cpp | UTF-8 | 714 | 2.6875 | 3 | [] | no_license | /*
ๆฆๆชๅฏผๅผน
LIS
*/
#include <bits/stdc++.h>
#define N 50
using namespace std;
int main(void) {
int ans, k;
int a[N];
while(scanf("%d", &k) != EOF) {
for(int i = 1 ; i <= k ; i ++) {
scanf("%d", &a[i]);
}
int dp[N];
for(int i = 0 ; i <= k ; i ++) {
dp[i] = 0;
}
dp[1] = 1;
for(int i = 2 ; i <= k ; i... | true |
0019742aafcc3e6756dbef82627a6e00c8270c52 | C++ | amoghj98/MLX90614 | /src/mlx90614.cpp | UTF-8 | 5,488 | 2.6875 | 3 | [
"MIT"
] | permissive | /***************************************************************************************************************************************
ยฉ2020, Amogh S. Joshi. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in... | true |