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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
96341b44e9f8f9c7989b440b597aedb7f46b181d | C++ | fermi-lat/celestialSources | /GRB/src/LatGRBAlert/LatGRBAlert.h | UTF-8 | 2,734 | 2.96875 | 3 | [
"BSD-3-Clause"
] | permissive | /*!
* \class LatGRBAlert
*
* \brief This class provides interface for trigger likelihood determination process.
* \author Jay Norris jnorris@lheapop.gsfc.nasa.gov
* \author Sandhia Bansal sandhiab@lheapop.gsfc.nasa.gov
*
*/
#ifndef LATGRBALERT_H
#define LATGRBALERT_H
#include <vector>
#include <deque>
#inc... | true |
08f64738252fcbe50ed589227964d582c0d7c719 | C++ | lavandalia/Teme-Poli-Calculatoare | /Anul IV - C4/SPG/Engine/Source/HoughTransform.h | UTF-8 | 6,471 | 2.640625 | 3 | [] | no_license | #pragma once
#include "Globals.h"
#include "Texture.h"
#include <queue>
using namespace std;
namespace HoughTransform {
unsigned char* out_image;
float *lSIN, *lCOS;
float *cSIN, *cCOS;
int **line_acum;
int **circle_acum;
int ntheta = 180;
int ThA_line = 350;
int N, M;
Texture hough_transform;
FILE *Fdebug... | true |
b71e5af689f0d717b4a9f682fe9878408b125fda | C++ | devmanner/devmanner | /school/popup04/lab3/elephants.cpp | ISO-8859-1 | 2,811 | 3.015625 | 3 | [] | no_license | #include <vector>
#include <set>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <cassert>
#include <cstdio>
/*
Finn lngsta kedja med stigande vikt och minskande iq.
*/
using namespace std;
#define MAX 1000
int g_id = 1;
struct Elephant {
Elephant(int _weight, int _iq) : weight(_weight)... | true |
fc2e8d71b5ababa752874aebcbf2619e94e648ef | C++ | foobar-glitch/MyRep | /CAndCpp/TowerOfHanoi/Game.h | UTF-8 | 560 | 3.140625 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <map>
struct Stack
{
unsigned int L_i;
Stack * next;
Stack * prev;
};
class Game {
private:
//size = number of towers
unsigned int size;
//int number of stacks
std::map<int, Stack*> stacks;
void init(unsigned int);
void draw()... | true |
28f161317e53370ace965defcd5931f37d267057 | C++ | Fllorent0D/B2-Statistiques | /Utile/DataSourceSerieContinue.cpp | UTF-8 | 3,302 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <stdlib.h>
using namespace std;
#include "DataSourceSerieContinue.h"
#include "Liste.h"
#include "ListeTriee.h"
DataSourceSerieContinue::DataSourceSerieContinue() : DataSource()
{
L = NULL;
setDebut(0.0);
setIntervalle(0.0);
}
D... | true |
7fb41b6c7d60b7ec4e98b2f74c8a29b8fbd7b999 | C++ | ghayne/PortHumid | /src/PortHumid.ino | UTF-8 | 2,570 | 2.703125 | 3 | [] | no_license |
// Include the libraries we need
#include <Sensirion.h>
#include "SSD1306.h"
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
const uint8_t dataPin = 13;
const uint8_t clockPin = 15;
float temperature;
float humidity;
float dewpoint;
const char* ssid = "EE-sthpqd";
const char* password = "aide-bat-sixty";
c... | true |
dec1ba2e0e3cdfdd6256249fa047f627d472f7b4 | C++ | yoongoing/Algorithm | /SWEA/17143.cpp | UTF-8 | 2,408 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int R,C,M;
int map[102][102];
int dy[4] = {-1,1,0,0};
int dx[4] = {0,0,1,-1};
typedef struct{
int y;
int x;
int speed;
int dir;
int size;
}S;
vector<S> v;
int shark_sum = 0;
int v_dir(int dir){
if(dir == 1)
return 2;
if(dir == 2)... | true |
6df57415afb3bd25b6616d718cb5871970539f84 | C++ | LeeJunJae/MyStudy | /STDMGR_LinkedList/main.cpp | UHC | 1,235 | 3.0625 | 3 | [] | no_license | #include "Student.h"
#include "StdMgr.h"
#include <Windows.h>
#include <time.h>
enum Menu
{
CREATE,
PRINT,
SEARCH,
CREATEDATA,
SAVE,
LOAD,
Delete,
};
int main()
{
srand(time(NULL));
Menu title;
int menu = 0;
StdMgr stdmgr;
while (true)
{
system("cls");
std::cout << "л α" << std::endl;
std... | true |
1723b567d1ac6467475309849d609a359c353a9c | C++ | kaibmarshall/Lab2 | /StreamingService.cpp | UTF-8 | 2,872 | 3.421875 | 3 | [] | no_license |
#include <iostream>
#include <string>
#include "StreamingService.h"
/*#TODO 5: Implement the Streaming Service.*/
//Coded by Kai and Matt
/**
* HINTS:
* Destructor:
* Retrieve movies and actors as vectors.
* For each movie the vector, remove it form the bag, and delete it.
* ... | true |
2d6d4061c0c19ebda51e9ff087d53f761800b342 | C++ | ZiyingShao/graphchi-cpp | /streaming/include/helper.hpp | UTF-8 | 4,147 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | /*
*
* Author: Xueyuan Han <hanx@g.harvard.edu>
*
* Copyright (C) 2018 Harvard University
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2, as
* published by the Free Software Foundation; either version 2 of the License,
*... | true |
28ed213df094448f9d545966dda9d1582617745e | C++ | yordanquintero/taller-3-completo- | /funciones7.cpp | UTF-8 | 963 | 3.375 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
void cambio(int,int&,int&,int&,int&,int&,int&);
int main(){
int numero,cien=0,cincuenta=0,veinte=0,diez=0,cinco=0,uno=0;
printf("ingrese el valor de dolares: ");
scanf("%d",&numero);
//llamo la funcion
cambio(numero,cien,cincuenta,veinte,diez,cin... | true |
6729677cdb27fbdefd70c0d27d3271a2c7bafafa | C++ | jehugaleahsa/spider-cpp | /http_response.hpp | UTF-8 | 1,057 | 2.640625 | 3 | [] | no_license | #ifndef SPIDER_HTTP_RESPONSE_HPP
#define SPIDER_HTTP_RESPONSE_HPP
#include <iosfwd>
#include <memory>
#include <set>
#include <string>
#include <unordered_map>
#include "header.hpp"
namespace spider {
class HttpResponse {
friend class HttpRequest;
mutable std::shared_ptr<std::istream> m_stream;
... | true |
190a1a504ba517d8bb6ee3afa8c50f3180021b11 | C++ | IstominRodion/summary | /QT Автоматизация библиотеки/periodical.cpp | UTF-8 | 2,737 | 2.859375 | 3 | [] | no_license | #include "periodical.h"
Periodical::Periodical()
{
}
Periodical::Periodical(QString title, QString author, QString period) : PrintedEdition(title, author)
{
setPeriod(period);
}
void Periodical::setPeriod(QString str)
{
period = str;
}
QString Periodical::getPeriod()
{
return period;
}
QString Periodic... | true |
b73f7c031df6d6851f04bd855db9bb0aad261430 | C++ | grae22/WavConverter | /source/converters/KSampleRateConverter.cpp | UTF-8 | 3,592 | 2.890625 | 3 | [
"MIT"
] | permissive | #include "KSampleRateConverter.h"
#include "../KWav.h"
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
//-----------------------------------------------------------------------------
using namespace std;
using namespace boost;
//---------------------------------------------------------------... | true |
50001fda9c2d99ded322cddbe369b97ccfa550d5 | C++ | MozziDog/TIL | /Algorithm/20190606-1850.cpp | UTF-8 | 634 | 3.359375 | 3 | [] | no_license | //백준 1850문제
//최대공약수
//모든 자릿수가 1로만 이루어진 두 수의 최대공약수 구하기
//시간 초과
#include <iostream>
int main()
{
long int a, b;
scanf("%ld", &a);
scanf("%ld", &b);
long answer;
if (a == b)
{
answer = a;
}
else
{
for (long int i = (a-b)>0 ? a-b : b-a;; i--)
{
if ... | true |
9a6e7ce8854c7eed277f9228d49bf9939dbe2995 | C++ | Anvesh-Chennupati/Pattern-Recognition-and-Data-Mining | /Isolation_Forest/C++ Implementation/mainv2.cpp | UTF-8 | 3,276 | 3.265625 | 3 | [
"MIT"
] | permissive | #include<iostream>
#include<vector>
#include<string>
#include<sstream>
#include<iterator>
#include<algorithm>
#include<queue>
#include "isolation_forest.h"
using namespace std;
vector<vector<double> > readData(){
vector<vector<double> > input;
while(!cin.eof()){
string line;
vector<double> ins... | true |
76a02d49f87ed899a1086044049d81da06b31b53 | C++ | jaimefeldman/cpp.iomanip | /sources/clases/Persona.cpp | UTF-8 | 1,279 | 3.75 | 4 | [
"MIT"
] | permissive | #include "Persona.hpp"
#include <sstream>
#include <iostream>
#include <string>
using namespace std;
Persona::Persona(string nombre, string apellido, unsigned int edad, SexoEnum sexo)
{
if(edad < 0) {
throw invalid_argument("edad no puede ser un valor negativo");
edad = 1;
}
this->nombre =... | true |
69f319eb01af58d6cb3c1d9c4468c539b0e414c6 | C++ | LeeJiu/The-Levers | /The Lervers/The Lervers/GameContents/StaticObject.h | UHC | 1,101 | 3.015625 | 3 | [] | no_license | #ifndef INCLUDED_GAME_STATIC_OBJECT_H
#define INCLUDED_GAME_STATIC_OBJECT_H
class Image;
class DynamicObject;
class StaticObject{
public:
struct Normal{
enum Flag1{
FLAG_WALL_W = ( 1 << 0 ), //
FLAG_WALL_H = ( 1 << 1 ), //
FLAG_HOLE = ( 1 << 2 ), //
FLAG_FLOOR = ( 1 << 3 ), //ٴ
FLAG_DOOR = ( 1 <<... | true |
c326ae872fec90264a19afc7cdeb484633cdf323 | C++ | knight-byte/Codeforces-Problemset-Solution | /SoldierAndBanana.cpp | UTF-8 | 354 | 2.828125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int price, money, quantity, totalAmount=0;
cin >> price >> money >> quantity;
for (int i=1; i<=quantity; i++) {
totalAmount += i*price;
}
if (totalAmount <= money)
cout << 0 << endl;
else
cout << totalAmoun... | true |
01e7bf5cbce150533df3f4ab22cea94256317754 | C++ | IanDierckx/AP_Project | /SFML/src/BasicEnemy.cpp | UTF-8 | 1,439 | 2.984375 | 3 | [] | no_license | #include "../Include/BasicEnemy.h"
#include "../../GameLogic/Include/GameLogic/Transformation.h"
namespace GameSFML{
BasicEnemy::BasicEnemy(const pair<int, int> &position, double width, double height, const string &fileName,
const GameSFML::window_ptr window)
: GameLogic::BasicEnemy(positi... | true |
e1755f3532aa6037ad166a838bcc60f4df87f9ce | C++ | luckyxxl/hfg-webcam-particles | /source/graphics/Framebuffer.cpp | UTF-8 | 665 | 2.59375 | 3 | [
"MIT"
] | permissive | #include "main.hpp"
#include "Framebuffer.hpp"
namespace graphics {
void Framebuffer::create(uint32_t width, uint32_t height) {
texture.create(width, height);
glGenFramebuffers(1, &framebuffer);
bind();
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture.texture, 0);
}
void Framebuffer::dest... | true |
b186761f1af78675af394d31123747d8820abe89 | C++ | qmzik/Portal2D | /Portal2D/TurretsAI.h | WINDOWS-1251 | 1,516 | 2.734375 | 3 | [] | no_license | #pragma once
#include "Gameplay.h"
#include "Map.h"
// : ,
namespace game
{ // ,
void turretAI(char type, GameInfo* gameInfo, MapCell** map);
// ( ),
int determineMovingDirection(char type, GameInfo* gameInfo, MapCell** map);
// ,
bool checkTurretShootingConditions(char type, GameI... | true |
177779f9e9a7890ab016df8fe3462b345d4118e6 | C++ | RyanLew488/Lab4 | /Lab4/University.hpp | UTF-8 | 732 | 2.875 | 3 | [] | no_license | /*********************************************************************
** Author:Ryan Lew
** Date: 4/28/2018
** Description: Header file for the University class, contains an array
** of Person pointers and an array of building pointers.
*********************************************************************/
#ifndef... | true |
367306b413cfc88c959b8191cb33fa86f79ba766 | C++ | marciacr/Language-C | /josephus problem.cpp | ISO-8859-1 | 1,382 | 3.203125 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<locale.h>
struct Soldado{
int numero;
struct Soldado *proximo;
};
//Criao da lista:
void enfileirar(Soldado **p ){
int x, j;
struct Soldado *w,*z;
w=z=*p;
printf("Digite a quantidade de soldados:");
scanf("%d", &x);
for(j=0;j<x... | true |
3aa9138d998cb9e0b4884fd676d6ed71dc318996 | C++ | xuyangch/DynamicVINO | /include/openvino_service/inferences/age_gender_recognition.h | UTF-8 | 1,535 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | /**
* @brief A header file with declaration for AgeGenderDetection Class
* @file age_gender_recignition.h
*/
#ifndef OPENVINO_PIPELINE_LIB_AGE_GENDER_RECOGNITION_H
#define OPENVINO_PIPELINE_LIB_AGE_GENDER_RECOGNITION_H
#include <memory>
#include "opencv2/opencv.hpp"
#include "inference_engine.hpp"
#include "openvi... | true |
dcb7b06b661e9c84bfda13c755370e0562d81d2d | C++ | mercedes-benz/MOSIM_Core | /Framework/LanguageSupport/cpp/MMICPP/Extensions/MVector3Extensions.h | UTF-8 | 1,589 | 2.671875 | 3 | [
"MIT"
] | permissive | // SPDX-License-Identifier: MIT
// The content of this file has been developed in the context of the MOSIM research project.
// Original author(s): Andreas Kaiser, Niclas Delfs, Stephan Adam
#pragma once
#include <vector>
#include "gen-cpp/scene_types.h"
using namespace std;
using namespace MMIStandard;
namespace MM... | true |
91665f5be4a2769028eb17d8a064f6915babe484 | C++ | EloyRD/Tutorial_Cpp_Udemy | /16 Multiarray/Multiarray.cpp | UTF-8 | 364 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main() {
int timesTable[12][10];
for (int i = 0; i < 12; i++) {
for (int j = 0; j < 10; j++) {
timesTable[i][j] = (i + 1)*(j + 1);
}
}
for (int i = 0; i < 12; i++) {
for (int j = 0; j < 10; j++) {
cout << timesTable[i][j] << ", " << f... | true |
611057ba3bf77a73147b0b1f0d1ab9fd8b69996e | C++ | wenmingxing1/thread | /thread_test/thread_test3.cpp | WINDOWS-1252 | 573 | 3.828125 | 4 | [
"MIT"
] | permissive | /*thread::operator=*/
#include<iostream>
#include<thread>
#include<chrono> //seconds
using namespace std;
void pause_thread(int n) {
std::this_thread::sleep_for(std::chrono::seconds(n));
cout << "Pause for " << n << " seconds ended" << endl;
}
int main() {
std::thread threads[5];
for (int i = 0;... | true |
c25798d2a1c55d58f28b1624a4bd3c7ed7ee688e | C++ | michaelczhou/cpp_practice | /qt_gui/untitled1/mainwindow.cpp | UTF-8 | 1,238 | 2.515625 | 3 | [
"MIT"
] | permissive | #include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QtGui>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
lineEditkeyboard = new Keyboard();
connect( ui->lineEdit_commandline ,SIGNAL(selectionChanged()),this ,SLOT(open_keyboard_li... | true |
1ff0e9c39e16c578beb0d9e33aa4dda116336aa3 | C++ | Broshen/343-6 | /bank.cc | UTF-8 | 991 | 3.34375 | 3 | [] | no_license | #include "bank.h"
Bank::Bank( unsigned int numStudents ) : numStudents(numStudents) {
accounts = new unsigned int[numStudents];
// Each student’s account initially starts with a balance of $0.
for (unsigned int i = 0; i < numStudents; i ++) {
accounts[i] = 0;
}
withdrawCondition = new uCond... | true |
aefde8ca1d572796290ca86920f377557838682c | C++ | XenderMd/BattleTank | /BattleTank/Source/BattleTank/Private/TankTracks.cpp | UTF-8 | 1,651 | 2.609375 | 3 | [] | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "TankTracks.h"
#include "SprungWheel.h"
#include"SpawnPoint.h"
UTankTracks:: UTankTracks()
{
}
TArray <ASprungWheel*> UTankTracks::GetWheels() const
{
TArray<ASprungWheel*> ResultArray;
TArray <USceneComponent *> Children;
G... | true |
bc9704584490f9f3e831d79ff8533405af1e36bf | C++ | InnoFang/algo-set | /LeetCode/2529. Maximum Count of Positive Integer and Negative Integer/solution.cpp | UTF-8 | 313 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | /**
* Runtime: 8 ms
* Memory Usage: 17.3 MB
*/
class Solution {
public:
int maximumCount(vector<int>& nums) {
int neg = lower_bound(nums.begin(), nums.end(), 0) - nums.begin();
int pos = nums.end() - upper_bound(nums.begin(), nums.end(), 0);
return neg > pos ? neg : pos;
}
};
| true |
ecbf10c8cc9f5a49b155dc2516cb746f9961aabf | C++ | TheColonelYoung/ALOHAL | /filesystem/entry.hpp | UTF-8 | 2,024 | 3.421875 | 3 | [] | no_license | /**
* @file entry.hpp
* @author Petr Malaník (TheColonelYoung(at)gmail(dot)com)
* @version 0.1
* @date 05.09.2019
*/
#pragma once
#include <string>
#include <vector>
using namespace std;
class FS_entry {
public:
enum class Type {
Undefined,
Directory,
File,
Executable
};... | true |
a23b63d6521723f9545a52301e30292c41c90900 | C++ | raxracks/chadOS | /userspace/libraries/libwidget/views/TextField.cpp | UTF-8 | 3,725 | 2.5625 | 3 | [
"MIT",
"BSD-2-Clause"
] | permissive | #include <libgraphic/Painter.h>
#include <libwidget/views/TextField.h>
namespace Widget
{
TextField::TextField(RefPtr<TextModel> model)
: _model(model)
{
_model_observer = _model->observe([this](auto &) {
_cursor.clamp_within(*_model);
scroll_to_cursor();
should_repaint();
});
}
... | true |
c521f1415454408f8c534da83ba985409a7e5522 | C++ | stainboy/libhttp | /src/server.cc | UTF-8 | 2,852 | 2.640625 | 3 | [] | no_license | #include "include/libhttp.h"
#include <iostream>
#include <uv.h>
class HttpServerImpl : public HttpServer {
public:
HttpServerImpl(const std::string& address) :
_address(address) {
}
private:
std::string _address;
uv_loop_t *loop;
public:
int run() {
return on_uv_run();
}
void r... | true |
17476e02aa1e47d05a914e30715832a916a6bf19 | C++ | MatanelAbayof/6-Colors | /oop2_ex4/ColorPanel.h | UTF-8 | 1,024 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
//---- include section ------
#include <string>
#include <array>
#include <vector>
#include "HorizontalLayout.h"
#include "ColorButton.h"
//---- using section --------
using std::string;
/*
* ColorPanel class
*/
class ColorPanel :
public GUI::HorizontalLayout<ColorButton>
{
public:
// array of colors... | true |
aa1584b5520d31f3a2e45457e306683a70c00187 | C++ | Tudor67/Competitive-Programming | /LeetCode/Problems/Algorithms/#2250_CountNumberOfRectanglesContainingEachPoint_sol1_sort_and_binary_search_and_suffix_count_O(RlogR+HR+PlogR)_time_O(HR)_extra_space_1126ms_138MB.cpp | UTF-8 | 2,274 | 2.828125 | 3 | [
"MIT"
] | permissive | class Solution {
public:
vector<int> countRectangles(vector<vector<int>>& rectangles, vector<vector<int>>& points) {
const int R = rectangles.size();
const int P = points.size();
// sort rectangles
int maxRectangleWidth = 0;
int maxRectangleHeight = 0;
... | true |
df3801c8f1d211fcd8b65f37cffe6380e31f0206 | C++ | manutouzumaki/TerrainGenerator | /code/particle.cpp | UTF-8 | 8,756 | 2.5625 | 3 | [] | no_license | #include "particle.h"
#include <cstdlib>
DWORD FloatToDword(float f)
{
return *((DWORD*)&f);
}
void InitBoundingBox(BoundingBox* boundingBox)
{
boundingBox->min.x = FLT_MAX;
boundingBox->min.y = FLT_MAX;
boundingBox->min.z = FLT_MAX;
boundingBox->max.x = -FLT_MAX;
boundingBox->max.y = -FLT_M... | true |
f77966b66dd0b705b112027e2f3c7c99a31fd01c | C++ | gfnx410/ProcMonXv2 | /ProcMonX/BinaryEventDataSerializer.h | UTF-8 | 1,096 | 2.6875 | 3 | [
"MIT"
] | permissive | #pragma once
#include "IEventDataSerializer.h"
#include "CompoundFile.h"
class BinaryEventDataSerializer : public IEventDataSerializer {
public:
// Inherited via IEventDataSerializer
virtual bool Save(const std::vector<std::shared_ptr<EventData>>& events, const EventDataSerializerOptions& options, PCWSTR path) over... | true |
d845dfdc6edc4f36ba7e9214fd35da89d5733558 | C++ | DrewScroll/CompilerProgram | /Compilador/SymTab.cpp | UTF-8 | 2,829 | 2.734375 | 3 | [] | no_license | #include "stdafx.h"
#include "SymTab.h"
Compilador::SymTab::SymTab()
{
}
Compilador::SymTab::~SymTab()
{
for (auto it = m_nodes.begin(); it != m_nodes.end(); it++)
{
delete it->second;
}
}
bool Compilador::SymTab::SymbolExists(std::string symbol, ENODE_CLASS nclass, std::string nproc_func)
{
if (nclass == GLOB... | true |
27872ce5e5b6c63b48370706150540d745118ba1 | C++ | shawn233/OnlineJudge | /Leetcode/75-Sort_Colors/solution.cpp | UTF-8 | 3,209 | 3.796875 | 4 | [] | no_license | class Solution {
public:
// 0ms solution 3
// O(N) two pointers
// improved solution 2, having the value of i incremented after
// swapping with left, but unchanged after swapping with right
void sortColors(vector<int>& nums) {
int left = 0, right = nums.size()-1;
for (int i = 0; i <... | true |
17b66aefa555a9ab73d7af069f57f3caf2f6f990 | C++ | LukasMosser/MSc_Thesis | /software/Karambola/print_functions/write_CompWiseMatrixMinkValResultType_to_file.cpp | UTF-8 | 2,148 | 2.515625 | 3 | [] | no_license | #include "write_functions.h"
void write_CompWiseMatrixMinkValResultType_to_file(const CalcOptions& CO, const CompWiseMatrixMinkValResultType &w){
if (w.size() == 0) return;
std::map <unsigned int,MatrixMinkValResultType>::const_iterator it;
it = w.begin ();
std::string filename = CO.outfoldername + ... | true |
270bbe7a582e5e5d265bc66ba7778bc02b973366 | C++ | rongtuech/MyoIntern | /Myo1/DTW.cpp | UTF-8 | 3,357 | 2.84375 | 3 | [] | no_license | #ifndef DTW_H
#define DTW_H
#include <cmath>
#include <vector>
#include "Gesture.cpp"
using namespace std;
#define ROWLENGTH 400
#define COLLENGTH 400
class DTW {
public:
float distanceArray[ROWLENGTH][COLLENGTH];
float dtwArray[ROWLENGTH][COLLENGTH];
float traceArray[ROWLENGTH][COLLENGTH]; // 1: up 2:left 3:cro... | true |
846b6815666e69575eb353f8f150eaa2a989f495 | C++ | dromanov/fun.hpp | /include/fun/classes/functor.hpp | UTF-8 | 3,570 | 2.671875 | 3 | [
"MIT"
] | permissive | /*******************************************************************************
* This file is part of the "https://github.com/blackmatov/fun.hpp"
* For conditions of distribution and use, see copyright notice in LICENSE.md
* Copyright (C) 2019, by Matvey Cherevko (blackmatov@gmail.com)
***************************... | true |
f1cec86fb5e6134305dee590ff2929bfd3d51e3a | C++ | kumarNith/ProblemSolving | /c++/recurrsion/queenAttack-1.cpp | UTF-8 | 942 | 3.359375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int queenAttack(int n, int arr[8][8], int row, int col){
int right = 0;int left = 0;
int up = 0; int down = 0;
int r_up = 0; int l_down = 0;
int l_up =0; int r_down = 0;
int cnt = 0;
int x = row; int y = col;
int cnt1=0;int ... | true |
f858a46c4740a9c945bc5b45e4a29e8d35e87756 | C++ | cosmohacker/About-Animal | /About_Animal/About_Animal/About_Animal.cpp | UTF-8 | 5,560 | 3.28125 | 3 | [] | no_license | // About_Animal.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <windows.h>
#include <vector>
#include <string>
using namespace std;
class Utils {
public:
vector<float> _brainSize, _shouldCalories, _takeCalories, _wingSize, _expecte... | true |
732b1b26de84ec5440b75b276d159e106d3d3ac4 | C++ | Ramnirmal0/Audrino-codes | /GENE ALPHA UGV FULLCODE/MOTHERBOARD/MOTHERBOARD.ino | UTF-8 | 4,467 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | #include <Servo.h>
Servo arm_finger;
Servo arm_palm;
Servo arm_wrist;
Servo docker;
int docking_val = 0;
int undocking_val = 100;
int wrist_left_val = 0;
int wrist_right_val = 100;
int palm_up_val = 0;
int palm_down_val = 100;
int finger_open_val = 0;
int finger_close_val = 100;
int IN1 = 53 , IN2 = ... | true |
87b52306b9fb954c519947ffd91e395e087546ff | C++ | fishfreetaken/orange | /distribute/include/randomkey.h | UTF-8 | 4,739 | 2.828125 | 3 | [] | no_license | #ifndef RANDOM_KEY_GENERATOR_SINGLE_WORKER_
#define RANDOM_KEY_GENERATOR_SINGLE_WORKER_
#include "debug.h"
constexpr const size_t kWritableFileBufferSize = 65536;
class WritableFile
{
public:
WritableFile(const std::string& filename,int fd):
fd_(fd),
pos_(0),
filename_(filename)
{
}
~Wr... | true |
23ae0edec13067a434129f879bee66be695cc262 | C++ | PraydE007/ucode-cpp-marathon | /sprint09/under_pdf/t02/app/src/MultithreadedFileHandler.cpp | UTF-8 | 501 | 2.828125 | 3 | [] | no_license | #include "MultithreadedFileHandler.h"
#include <iostream>
#include <fstream>
void MultithreadedFileHandler::processFile() {
std::unique_lock<std::mutex> mtx(m_mutex);
m_condVar.wait(mtx, [this]{return m_fileLoaded;});
std::cout << m_file << std::endl;
m_fileLoaded = false;
}
void MultithreadedFileHan... | true |
46c5efeb75940840712d72ae5f15aded437520b3 | C++ | scau-drr/bedtools2 | /src/utils/FileRecordTools/Records/BlockMgr.cpp | UTF-8 | 6,995 | 2.5625 | 3 | [
"MIT"
] | permissive | /*
* BlockMgr.cpp
*
* Created on: May 14, 2013
* Author: nek3d
*/
#include "BlockMgr.h"
#include "RecordMgr.h"
#include "Bed12Interval.h"
#include "BamRecord.h"
#include "ParseTools.h"
#include "api/BamAlignment.h"
#include "api/BamAux.h"
BlockMgr::BlockMgr(float overlapFractionA, float overlapFractionB, b... | true |
479e5a09e398c45df993086ed6577879b5b9dca8 | C++ | Stephen-Campbell-UTD/gllabel | /include/types.hpp | UTF-8 | 442 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | #ifndef TYPES_H
#define TYPES_H
#include <stdint.h>
struct Vec2 {
union {
float x;
float w;
};
union {
float y;
float h;
};
Vec2(): x(0), y(0) { }
Vec2(float x, float y): x(x), y(y) { }
};
// Second-order (aka quadratic or conic or single-control-point) bezier
struct Bezier2 {
Vec2 e0;
Vec2 e1;
Vec... | true |
4a759d18b80365ba59169053f2db74930e4fb585 | C++ | bockph/libdl | /library/ComputationalGraph/Operations/include/MSEOp.hpp | UTF-8 | 761 | 2.765625 | 3 | [] | no_license | //
// Created by phili on 17.05.2019.
//
#pragma once
#include "LossFunction.hpp"
/*!
* Implements the Mean Square Error
*/
class MSEOp : public LossFunction {
public:
/*!
* creates an LossFunction object
* stores the labels which are need to calculate the loss
* @param X softmax classified samp... | true |
b4c27be44387df7a2d68f5cbb498af087bac702d | C++ | shengyu7697/TinyTcp | /src/TinyTcp/TinyTcpServer.cpp | UTF-8 | 5,488 | 2.53125 | 3 | [
"MIT"
] | permissive | #include "TinyTcpServer.h"
#include "SocketUtil.h"
#ifdef _WIN32
#include <Ws2tcpip.h>
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
#include <string.h>
using namespace std;
TinyTcpServer::TinyTcpServer() :
mVerbose(0),
mServerSocket(-1),
mRunning(true),
mSession(... | true |
1c46cc921b37506242de4eda373c85a4cf4e74d2 | C++ | alice965/LaonSillv2 | /LaonSill/src/dataset/MockDataSet.h | UTF-8 | 1,206 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | /**
* @file MockDataSet.h
* @date 2016/4/23
* @author jhkim
* @brief
* @details
*/
#ifndef DATASET_MOCKDATASET_H_
#define DATASET_MOCKDATASET_H_
#include "common.h"
#include "DataSet.h"
/**
* @brief 랜덤 데이터셋 생성을 위해 구현된 DataSet 클래스.
* @details 생성자에 지정된 파라미터값에 따라 해당 차원의 랜덤 데이터셋을 생성한다.
* ... | true |
f2fc9f83069622256e417bb7e609d303ebb90f3c | C++ | sirinath/Aeron | /aeron-client/src/test/cpp/concurrent/CountersManagerTest.cpp | UTF-8 | 3,716 | 2.53125 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright 2014 - 2015 Real Logic Ltd.
*
* 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 agr... | true |
d74b7eb712fe9d54eb72ee1c28ae1b5fb8690d20 | C++ | schadov/libwombat | /primitives_test/newton_solver_test.cpp | UTF-8 | 1,020 | 2.546875 | 3 | [] | no_license | #include <gtest/gtest.h>
#include "../primitives/types.h"
#include "../primitives/lu.h"
#include "../primitives/lin_solve.h"
#include "../primitives/RefBlas.h"
#include "../primitives/newton.h"
#include "../primitives/jacobian.h"
void simple_nonlinear_function(double* in, double* out){
out[0] = in[0]*in[0]... | true |
8f485d8a89ad206be1287241f77e95563c4553d6 | C++ | Peilin-Yang/leetcode | /c++/binary_tree_maximum_path_sum.cpp | UTF-8 | 776 | 3.40625 | 3 | [] | no_license | #include<climits>
#include<iostream>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
int h(TreeNode* root, int& res) {
if (!root) return 0;
int l = max(0, h(root->left, res));... | true |
b23c9946166ab70d2b2b70f3b4c28c0c4888a334 | C++ | amanosan/DataStructures-Algo | /Linked Lists/Circular_Linked_List.cpp | UTF-8 | 2,780 | 4.1875 | 4 | [] | no_license | // Implementing Circular Linked List
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node *next;
};
// number of nodes in linked list
int numberNodes(Node *head)
{
int count = 0;
Node *current = head;
if (head == NULL)
{
return 0;
}
do
{
count+... | true |
f4c0e995a12445798719977ace6b01e2fb7cc90b | C++ | KatanaGraph/katana | /libgraph/include/katana/analytics/subgraph_extraction/subgraph_extraction.h | UTF-8 | 2,158 | 2.53125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | #ifndef KATANA_LIBGRAPH_KATANA_ANALYTICS_SUBGRAPHEXTRACTION_SUBGRAPHEXTRACTION_H_
#define KATANA_LIBGRAPH_KATANA_ANALYTICS_SUBGRAPHEXTRACTION_SUBGRAPHEXTRACTION_H_
#include "katana/PropertyGraph.h"
#include "katana/analytics/Plan.h"
// API
namespace katana::analytics {
/// A computational plan to for SubGraph Extra... | true |
c828e03e5cf540dd4cc7d58dba4944a59abdb0ee | C++ | Neverous/ii-kd15 | /include/bitstream.h | UTF-8 | 6,560 | 3 | 3 | [] | no_license | #ifndef __BITSTREAM_H__
#define __BITSTREAM_H__
#include <algorithm>
#include <cassert>
#include <iostream>
typedef unsigned char uchar_t;
template<typename STREAM, typename ACCUMULATOR=uint64_t>
class BitStream
{
STREAM stream;
ACCUMULATOR accumulator;
static const size_t BITSPACE =... | true |
6b8057a5de16683b80811b29d3c992d9bacbe1c8 | C++ | cwaldren/HL-engine | /src/Plugins/hardlight/HardwareDiagnostic.h | UTF-8 | 777 | 2.515625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "HardwareIO.h"
#include <cstdint>
enum class HardwareFailures : uint64_t {
None = 0,
GenericError = 1 << 0,
LeftDriverBoardConnection = 1 << 1,
RightDriverBoardConnection = 1 << 2,
ImuLeftConnection = 1 << 3,
ImuRightConnection = 1 << 4,
ImuChestConnection = 1 << 5
};
inline HardwareFai... | true |
8f4cadd5fe83ff2aee71184f44d4a1b5899ef623 | C++ | midaslmg94/CodingTest | /Simulation/3055_탈출.cpp | UTF-8 | 3,989 | 3.140625 | 3 | [] | no_license | #include <bits/stdc++.h>
#define endl "\n"
#define MAX 10
using namespace std;
/*
비어있는 곳은 '.'로 표시되어 있고,
물이 차있는 지역은 '*',
돌은 'X'로 표시되어 있다.
비버의 굴은 'D'로,
고슴도치의 위치는 'S'로 나타내어져 있다.
고슴도치가 안전하게 비버의 굴로 이동하기 위해 필요한 최소 시간
*/
struct INFO {
char state;
bool isWater;
bool isBeaver;
};
INFO Map[51][51];
int r, c;
int... | true |
35d44fc3a472d534abf8888795bfa7dc525185df | C++ | zypruc/PokemonGame | /health.cpp | UTF-8 | 466 | 2.703125 | 3 | [] | no_license | #include "health.h"
#include <QPixmap>
#include <QFont>
Health::Health(int initHealth, QGraphicsItem *parent)
: QGraphicsTextItem(parent), health(initHealth)
{
setPlainText(QString(":") + QString::number(health)); // Health: 3
setDefaultTextColor(Qt::red);
setFont(QFont("Menlo",22));
}
void Health::dec... | true |
9892eb7e127b402ab42edded7a5f603fab05837f | C++ | eyangch/competitive-programming | /LeetCode/Weekly320/2475.cpp | UTF-8 | 455 | 2.765625 | 3 | [
"MIT"
] | permissive | class Solution {
public:
int unequalTriplets(vector<int>& nums) {
int N = nums.size();
int res = 0;
for(int i = 0; i < N; i++){
for(int j = i+1; j < N; j++){
for(int k = j+1; k < N; k++){
if(nums[i] != nums[j] && nums[i] != nums[k] && nums[j] !... | true |
3e2bb928fcab1dd3fa3760f676561f8453a19768 | C++ | cotyhamilton/programming-techniques | /unique-snowflakes/main.cpp | UTF-8 | 1,378 | 3.140625 | 3 | [] | no_license | // Coty Hamilton : unique snowflakes : 11572 : cotyhamilton
#include <iostream>
#include <unordered_map>
#include <algorithm>
using namespace std;
#define endl '\n'
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int cases, numSnowflakes, largest, count, segment, snowflake;
unorder... | true |
56f4d41deee4c03373f2be7168b8affcf8134e6f | C++ | Rayleigh0328/OJ | /leetcode/1053.cpp | UTF-8 | 762 | 2.8125 | 3 | [] | no_license | class Solution {
struct classcomp {
bool operator() (const int& lhs, const int& rhs) const
{return lhs>rhs;}
};
public:
vector<int> prevPermOpt1(vector<int>& A) {
vector<int> a(A);
set<int, classcomp> tail;
for (int i=a.size()-1; i>=0;--i){
tail.insert(a[i]);
... | true |
64144a3b4f60072f5e477ad66a4f446833b68503 | C++ | yang123vc/UGentProjects | /Homework-Assignment-1/matmat.cpp | UTF-8 | 8,736 | 2.921875 | 3 | [
"MIT"
] | permissive | /***************************************************************************
* Copyright (C) 2012-2013 Jan Fostier (jan.fostier@intec.ugent.be) *
* *
* This program is free software; you can redistribute it and/or modify *
* it unde... | true |
a3d47e86b7c989e1ce413c31512e24662fc3681a | C++ | masashi37/my_programs | /create_application/chara.cpp | UTF-8 | 518 | 2.515625 | 3 | [] | no_license |
#include "chara.h"
cChara::cChara(){
chara = {
0, 0, ONE_SIZE, ONE_SIZE,
};
cMap::loadMaps();
for (int y = 0; y < LENGTH; ++y){
for (int x = 0; x < WIDE; ++x){
if (cMap::map_data[y][x] == START){
chara.x = cMap::map_obj[y][x].x;
chara.y = cMap::map_obj[y][x].y;
}
}
}
}
void cChara::upd... | true |
22e39a5c44be9948b2e753136d1da1d94aae052f | C++ | Tayyibah/OOP | /Oop Programz/Oop operator overloading/operator overloading on []/operator overloading on []/intArray.cpp | UTF-8 | 690 | 3.375 | 3 | [] | no_license | #include"intArray.h"
#include<cstdlib>
intArray::intArray()
{
arr=0;
arrSize=0;
}
intArray::intArray(const intArray & ref)
{
arrSize=ref.arrSize;
int *temp=new int[arrSize];
for(int i=0;i<arrSize;i++)
{
arr[i]=ref.arr[i];
}
}
intArray & intArray::operator=(const int & ref)
{
arrSize=arrSize;
for(int i=0;i<a... | true |
90265e98e07d64dfcc5720fe96f42cfaebfec869 | C++ | zee786/SmartCabinetSystem | /simplecab/Cupboard.cpp | UTF-8 | 813 | 2.859375 | 3 | [] | no_license | #include "StdAfx.h"
#include "Cupboard.h"
#include <vector>
Cupboard::Cupboard(int id, float aspectRatio)
{
this->id = id;
this->width = aspectRatio;
this->points = vector<Point2f>(4);
}
Cupboard::~Cupboard(void)
{
}
void Cupboard::init(vector<Point2f> destPoints)
{
std::vector<cv::Vec2f> srcPoints(4);
srcPoi... | true |
29a9ed29ff40102eeea86b76ece2b73291b061a0 | C++ | jimregan/dotfiles | /practice/max-subarray.cc | UTF-8 | 503 | 3.671875 | 4 | [] | no_license | #include <array>
#include <algorithm>
#include <iostream>
template<std::size_t SIZE>
int max_sub_array(std::array<int, SIZE>& a) {
int newsum = a[0];
int max = a[0];
for(int i = 1; i < a.size(); i++) {
newsum = std::max(newsum + a[i], a[i]);
max = std::max(max, newsum);
}
return max;
}
int main()
{
std::arr... | true |
f5b56975c7a6f1c4281487da7ced33cb631e77ca | C++ | spqr-team/SPQR-Team-2019 | /utility/MultiThreading/doubleled.cpp | UTF-8 | 1,794 | 3 | 3 | [] | no_license | #include <Arduino.h>
#include "TeensyThreads.h"
#define LED 13 //pin dei led (ma va?)
#define LED2 14
volatile int b1 = 0; //numero dei blink, volatile perché la modifichiamo fuori loop
volatile int b2 = 0; //altrimenti la wiki lo definisce come "buggy ... | true |
f4f25cfc5f26f16359b201d4f2907cc1c3caf632 | C++ | KamenPetrovv/UP-2016-2017-Group-1 | /Week06_11-11-16/3zad.cpp | UTF-8 | 1,140 | 3.78125 | 4 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
void getInput(int &cx, int &cy, int &r, int &R, int &x, int &y) {
/**
notice how variables are passed 'by reference' (denoted by an &)
check what happens if it is removed
you'll learn about this in a few weeks
*/
cout << "Ente... | true |
b53c8b5c9ca4bc75672cee5871f20342ead2c6a4 | C++ | umount/ls | /shablon.cpp | UTF-8 | 479 | 3.3125 | 3 | [] | no_license | /*
* Шаблон, который превращает двоичную запись, в десятичную
* Bin <101110>::Value
* @author Denis Sobolev <dns.sobol@gmail.com>
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
template<int bin> class Bin {
public:
enum { Value = 2*Bin<bin/10>::Value + bin%10 };
};
template<>
class Bin<0> {
pu... | true |
457677e35e864b7a7898061851b0b69ca33e2ae2 | C++ | minaminao/competitive-programming | /cpp/aoj/aoj/DSL_2_A_treap.cpp | SHIFT_JIS | 3,119 | 2.84375 | 3 | [] | no_license | #include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif
//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = INT_MAX;
const int MOD = (int)(1e9) + 7;
temp... | true |
ff594cf548b01b280788864e2159a86d5ab2d64e | C++ | yejin0216/daily-c-algorithm | /20190809/11729.cpp | UTF-8 | 580 | 3.625 | 4 | [] | no_license | #include <iostream>
using namespace std;
string result;
int steps;
void move(int from, int to) {
result += to_string(from);
result += " ";
result += to_string(to);
result += "\n";
steps++;
}
void hanoi(int count, int from, int by, int to) {
if ( count == 1 ) {
move(from, to);
} ... | true |
a6665cefd6d7972c48d6ee385b272129dd922768 | C++ | LangLiGeLangLLT/CppPrimer | /Test_06_03/Test_06_03.cpp | UTF-8 | 172 | 3 | 3 | [] | no_license | #include <iostream>
using namespace std;
int f(int x)
{
int y = 1;
for (int i = 1; i <= x; ++i)
y *= i;
return y;
}
int main()
{
cout << f(5) << endl;
return 0;
} | true |
966ac74ad5cd5b6e90db655dacb00d4288bc1c07 | C++ | PriyankJain10/Leetcode | /1161.cpp | UTF-8 | 1,046 | 2.625 | 3 | [] | no_license | // time - O(n)
// space - O(n)
#include<bits/stdc++.h>
using namespace std;
int maxLevelSum(TreeNode* root) {
int curr_level = 1, ans = 1, curr_sum = 0, max_sum = INT_MIN;
queue<TreeNode*>q;
q.push(root);
q.push(NULL);
TreeNode* f = NULL... | true |
90b58c9e346145884889197791f2da6160ca957e | C++ | Hanslen/Mars_base-3D | /g53gra.framework/g53gra.framework/Code/WorkingCar.cpp | UTF-8 | 13,252 | 2.640625 | 3 | [
"MIT"
] | permissive | #include "WorkingCar.h"
#include "VectorMath.h"
#include <iostream>
#define _ACCELERATION 10.0f
using namespace std;
WorkingCar::WorkingCar(float routeRadius, float velocity, int run) : _loopPosition(0.0f),rotateDegree(0.f), armRotateDegree(-30.f),armRotateIncrease(0),stopRotating(0),mouseY(0),mouseX(0)
{
#ifdef __APP... | true |
446d1b173027a5d225cd58a62de8b6e0228d8fef | C++ | xanzacks/DAZStudentRegister | /CIS22C GP/Myhash.h | UTF-8 | 5,784 | 3.28125 | 3 | [] | no_license | // File: Myhash.h
#ifndef HASH_H
#define HASH_H
#include "list.h"
#include <iostream>
template <typename T, unsigned buckets >
class Myhash
{
List<T>* array;
// hash function borrowed from: Thomas Wang https://gist.github.com/badboy/6267743
unsigned hash(string key) const
{
uns... | true |
79056d2ac93f519f4655d5b134ab5fd8a63e76b0 | C++ | ADanilczuk/Cpp-course | /Lista 10/Zad 1/manipulators.hpp | UTF-8 | 1,251 | 3.296875 | 3 | [] | no_license | #include <cstdlib>
#include <iomanip>
#include <string>
#include <iostream>
inline std::istream& clearline( std::istream& os)
{
char a;
a= os.get();
while (a != '\n' && os)
{
a= os.get();
}
return os;
}
class ignore
{
int x;
friend std::istream& operator >> (... | true |
d0a71bbc89fe08ddd14fa7816d042e86ef68a0d5 | C++ | aashishgahlawat/CompetetiveProgramming | /aashishgahlawat/codeforces/A/116-A/116-A-30552295.cpp | UTF-8 | 807 | 2.9375 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
int main() {
// your code goes here
int numberOfStops;
int in,out;
cin>>numberOfStops;
int numberOfIn[numberOfStops];
int numberOfOut[numberOfStops];
for(int i=0;i<numberOfStops;i++){
cin>>out>>in;
numberOfOut[i]=out;
numberOfIn[i]=in;
}
for(int i=1;i<nu... | true |
c90fbdb6284f4eedb4eaf3aa0df52fb06f16bdae | C++ | krishauser/KrisLibrary | /planning/ControlSpace.h | UTF-8 | 8,359 | 2.859375 | 3 | [] | permissive | #ifndef PLANNING_CONTROL_SPACE_H
#define PLANNING_CONTROL_SPACE_H
#include "CSpace.h"
#include "Interpolator.h"
#include "CSpaceHelpers.h"
namespace Math {
class VectorFieldFunction;
} //namespace Math
typedef Vector State;
typedef Vector ControlInput;
class KinodynamicMilestonePath;
//forward declarations
class Co... | true |
34da4a7301620da63158b6d176a04137c538d120 | C++ | alamodepaula/template-prog2-multi-lista01 | /aluno_ex11.hpp | UTF-8 | 305 | 2.734375 | 3 | [
"MIT"
] | permissive | #pragma once // evita múltiplas definições
#include <iostream>
#include <sstream> // istringstream
#include <tuple>
// 11. Faça um programa em C que procure o menor e o maior elementos de um vetor.
void
exercicio11(int v[], int tamanho, int min_max[2])
{
// min_max[0]: min
// min_max[1]: max
}
| true |
4741b7518fc61ff36352963dd8781870e2f9f752 | C++ | joschu/surgical | /legacy/master-slave/slaves/controller_dummy.cc | UTF-8 | 432 | 2.578125 | 3 | [] | no_license | #include "controller_dummy.h"
Controller_dummy::Controller_dummy(int slave, int statesize, int outsize) : Controller(slave, statesize, outsize) { }
Controller_dummy::~Controller_dummy() { }
int Controller_dummy::control(const double* state, double* goal, double* out) {
last_output.clear();
for(int i=0;i<outp... | true |
cf9d1f46019fde8c0f78d74a112cd04a7a073b15 | C++ | kobyyoshida/Syntax-Checker | /syntaxMain.cpp | UTF-8 | 1,229 | 3.09375 | 3 | [] | no_license | //Koby Yoshida
#include <iostream>
#include <fstream>
#include "Syntax.h"
#include "syntaxGenStack.h"
#include "fileio.h"
using namespace std;
int main(int argc, char **argv){
string filePath;
if (argc != 2) { //Checks for valid command line arguments and saves argument to filePath variable
cerr << "Incorrec... | true |
3b8619449abc6405d4b3641be2e5fbd24148e833 | C++ | nurof3n/ProtoypeRayTracer | /Ray Tracer/src/Sampler.cpp | UTF-8 | 398 | 2.65625 | 3 | [] | no_license | #include "Sampler.h"
std::vector<vec2> Sampler::getSamples( vei2 pixelPos )
{
vec2 center = static_cast<vec2>( pixelPos ) + vec2{ 0.5f };
#ifdef AA
return std::vector<vec2>{
center + vec2{ 0.0f, 0.25f },
center + vec2{ 0.0f, -0.25f },
center + vec2{ 0.25f, 0.0f },
center + vec2{... | true |
51a003f7cd2a76c40a0c3e531fb0e83a23776d91 | C++ | sshekh/bplus-tree | /bptree.hpp | UTF-8 | 2,518 | 2.703125 | 3 | [] | no_license | #include "node.hpp"
#include <utility>
#include <cstring>
const double EPS = 1e-10;
struct Bptree {
Bptree() {
ifstream fin("bplustree.config");
fin >> MAXK; fin.close();
fin.open("tree.config", ios::in);
fin >> nptr::cnt;
if(nptr::cnt != 0) fin >> root.fname >> fcnt;
++fcnt;
fin.close()... | true |
2f61c9749b83e6e4c924cc4c5e96f8b474802282 | C++ | DanielPerssonProos/TDDD86-EL2 | /decrypt.cpp | UTF-8 | 5,372 | 3.046875 | 3 | [] | no_license | #include <chrono>
#include <map>
#include <set>
#include "Key.h"
#include <vector>
#include <thread>
#include <bitset>
#include <fstream>
#include <cmath>
using namespace std;
pair<Key,set<int>> AddToSubsetSum(const pair<Key,set<int>>& L, Key& addedValue, int index) {
set<int> returnedSet = L.second;
returne... | true |
e18f3a1bbd55d693c16f6f7445a680a5a8968d14 | C++ | OM234/COMP5421-Advanced-Programming-Assignment-4 | /Rhombus.cpp | UTF-8 | 3,127 | 3.34375 | 3 | [] | no_license | /*
Author: Osman Momoh
Student ID: 26220150
Course: COMP 5421: Advanced Programming
Date: 7/29/2020, Summer 2020
*/
#include "Rhombus.h"
Rhombus::Rhombus(int diagonal, std::string name,
std::string description) :
Shape{name, description} {
Shape::ID = Shape:... | true |
58f2e610b72178790b1017bdd1a0f3eceb381f1a | C++ | StanleyYake/learngit | /static/main.cpp | UTF-8 | 369 | 2.984375 | 3 | [] | no_license | #include <iostream>
using namespace std;
class Point
{
public:
static void initial()
{
x=0;
y=0;
}
void output()
{
initial();
}
private:
static int x,y;
};
int Point::x=0;
int Point::y=0;
int main()
{
// Point p;
// p.output();
// p.initial();
Point::i... | true |
69562c5a2a164622c07366137bc681f5b09f34b2 | C++ | Rakib-Mahmud/Algorithms | /Bitwise_sieve.cpp | UTF-8 | 711 | 2.625 | 3 | [] | no_license | #include<bits/stdc++.h>
#define mx 1e8
using namespace std;
long long k=mx;
int isprime[(int)mx/32];
bool check(int N,int pos)
{
return (bool)(N & (1<<pos));
}
int Set(int N,int pos)
{
return N=N | (1<<pos);
}
void sieve(int n)
{
int p=int(sqrt(n));
for(int i=3;i<=p;i+=2){
... | true |
ab05d9b4a1639bfc3c4ea02095c7c22ddf8f5dce | C++ | carlcook/PtreeMessages | /types.cpp | UTF-8 | 2,649 | 2.90625 | 3 | [] | no_license | #include "types.h"
Instrument::Instrument(const std::string& underlyingName)
: mUnderlyingName(underlyingName)
{
}
const std::string& Instrument::GetUnderlyingName() const
{
return mUnderlyingName;
}
void Gui::GenerateMessage(std::stringstream& message) const
{
pt::ptree tree;
tree.put("resetMessage.underlyi... | true |
29ae4450d5d3efe60f8a2adcf59f259562013c19 | C++ | foopod/gba-boids | /src/boid.cpp | UTF-8 | 1,523 | 2.5625 | 3 | [
"MIT"
] | permissive | #include "boid.h"
#include "bn_math.h"
#include "bn_log.h"
#include "bn_string.h"
#include "bn_sprite_items_boid.h"
Boid::Boid(bn::fixed_point pos)
: _sprite(bn::sprite_items::boid.create_sprite(pos.x(), pos.y())),
_vel(bn::fixed_point(0,0))
{
// _sprite.set_horizontal_scale(0.5);
// _sprite.set_ve... | true |
70b4609c2db77f82822f3d6f69524184fae480e5 | C++ | alchebits/robot-grazyna | /src/Bluetooth.cpp | UTF-8 | 5,042 | 2.578125 | 3 | [] | no_license | #include "Bluetooth.hpp"
#include <math.h>
#include <stdlib.h>
ControlCommand::ControlCommand() :
m_command(EMPTY_COMMAND),
m_value(0.0f)
{
}
ControlCommand::ControlCommand(uint16_t command) :
m_command(command),
m_value(0.0f)
{
}
ControlCommand::ControlCommand(uint16_t command, float value) :
m_command(command),
m... | true |
1604dca9c413e021c9b488f91fa9600ecb6d9a40 | C++ | Meteoric-Dog/OOPExcersize1 | /OOPExcersize1/Sources/Classes/Patient.cpp | UTF-8 | 3,256 | 2.953125 | 3 | [] | no_license | #include "Patient.h"
Patient::Patient()
{
this->InitResistance();
this->DoStart();
}
Patient::~Patient()
{
this->DoDie();
}
void Patient::InitResistance()
{
this->m_resistance = rand() % (int)RESISTANCE_RANGE + MIN_RESISTANCE;
}
void Patient::DoStart()
{
int type_amount = 2, type=0;
int virus_amount = rand() ... | true |
87bcf033eda9967d7b5f387f53bb0f7f42d67d4a | C++ | henrikhasell/rts-engine | /textfield.cpp | UTF-8 | 747 | 2.78125 | 3 | [] | no_license | #include "textfield.hpp"
using namespace Engine;
using namespace GL;
TextField::TextField() : w(0.0f), h(0.0f)
{
//ctor
}
TextField::~TextField()
{
//dtor
}
bool TextField::setText(Font &font, int size, const char text[])
{
bool result = font.renderString(mesh, texture, text, size);
if(result)
... | true |
9295486a7a773e9c5b6a049aa4b72a939c38f004 | C++ | Daviswww/Submissions-by-UVa-etc | /volume034/POJ 3461 - Oulipo.cpp | UTF-8 | 456 | 2.6875 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
using namespace std;
int main(void)
{
int n;
cin >> n;
for(int i = 0; i < n; i++)
{
int k = 0, ip = 0;
string s, g;
cin >> g >> s;
while(ip != s.size()-g.size()+1)
{
int to = 0, no = 0;
for(int j = ip; j < g.size()+ip; j++)
{
if(s[j] == g... | true |
91ed433cb5097caf7f5472baa1ecb8af115be140 | C++ | Remi-Niel/Cpp-course | /part3/week4/ex26/Insertable.h | UTF-8 | 774 | 3.21875 | 3 | [] | no_license | #ifndef INSERTABLE_
#define INSERTABLE_
#define HDR_ template<template <typename> class Policy, typename Data>
using namespace std;
HDR_ struct Insertable: public Policy<Data>
{
Insertable() = default;
Insertable(Data in);
Insertable(Policy<Data>);
std::ostream &insertInto(std::ostream &out);
};
HDR... | true |
24be5b9ecd4a027895ef6f65412bc4ee85082fee | C++ | SiChiTong/Lux | /Lux/Lux/Source/LuxKey.cpp | UTF-8 | 739 | 2.515625 | 3 | [] | no_license | #include "LuxPCH.h"
#include "LuxKey.h"
Lux::Core::Key::StringHash Lux::Core::Key::m_StringHasher;
Lux::Core::Key::Key() : m_Name()
{
m_StringHasher(m_Name);
}
Lux::Core::Key::Key(const String& a_Name) : m_Name(a_Name)
{
m_HashedValue = m_StringHasher(m_Name);
}
Lux::Core::Key::Key(const char* a_Name) : m_Name(a_... | true |