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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ce208e33e066beb14bd8c2f3e2c221bb2fb23b96 | C++ | pillowpilot/problem_solving | /UVa/10003 - Cutting Sticks/code.cpp | UTF-8 | 1,385 | 2.921875 | 3 | [] | no_license | #include <cstdio>
#include <vector>
#include <limits>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
vvi memo;
vi s;
void printMemo(){
for( int i = 0; i < memo.size(); i++ ){
for( int j = 0; j < memo[i].size(); j++ ){
printf("%4d", memo[i][j]);
}
printf("\n");
}
}
int f(... | true |
2c5cbc649c313c6151c43082b351b52d6536d0d0 | C++ | JimNilsson/FSJimNilsson | /FilsystemJimNilsson/src/MetaData.h | UTF-8 | 714 | 3.015625 | 3 | [] | no_license | #ifndef METADATA_H
#define METADATA_H
#include <iostream>
enum chmod_t : int { CH_READ = 2, CH_WRITE = 4, CH_ALL = 6, CH_NONE = 0 };
enum filetype_t : int { TYPE_DIRECTORY = 1, TYPE_FILE = 2, TYPE_ERROR = -1 };
struct MetaData
{
MetaData()
{
//empty
}
MetaData(filetype_t type, std::string name, int location, in... | true |
00927dcc0a735c47be17ced345c76abee3227a2b | C++ | Zapominacz/PEA_TSP_Approx | /Solution.h | UTF-8 | 282 | 2.9375 | 3 | [] | no_license | #pragma once
#include <iostream>
class Solution
{
public:
float cost;
unsigned* order;
unsigned size;
Solution(unsigned size): cost(0), size(size)
{
order = new unsigned[size];
}
~Solution()
{
if (order != nullptr)
{
delete order;
order = nullptr;
}
}
};
| true |
adb7a435626ecd0f13b67c955e981b908eab1724 | C++ | NeuralEnsemble/pype9 | /pype9/simulate/neuron/code_gen/templates/ninemlnrn.cpp | UTF-8 | 1,861 | 2.984375 | 3 | [
"MIT"
] | permissive | /*
A library that wraps GSL random routines for use in mod-files:
gsl_rng* get_gsl_rng()
void release_gsl_rng()
double nineml_gsl_normal(double m, double s);
double nineml_gsl_uniform(double a, double b);
double nineml_gsl_binomial(double p, int n);
double nineml_gsl_exponential(double mu);
double nineml_gsl_poisso... | true |
9ee69864cf83ec7f22a4fa33d305892ce60f4b7c | C++ | arms22/BigFont | /src/BigFont.cpp | UTF-8 | 804 | 2.796875 | 3 | [] | no_license | /*
BigFont.cpp - A library that displays large characters on the LCD.
Copyright 2011,2016(c) arms22. All right reserved.
License: Refer to the phi_big_font.h/cpp file.
*/
#include "BigFont.h"
BigFont::BigFont()
{
_cur_col = _cur_row = 0;
_invert = false;
}
BigFont::~BigFont()
{
}
void ... | true |
adb220997c8839a9b1a4685451d9bd167af80f7b | C++ | joann8/CPP | /C05/ex01/Bureaucrat.cpp | UTF-8 | 1,768 | 3.3125 | 3 | [] | no_license | #include "Bureaucrat.hpp"
const char* Bureaucrat::GradeTooHighException::what() const throw()
{
return "Grade too high.";
}
const char* Bureaucrat::GradeTooLowException::what() const throw()
{
return "Grade too low.";
}
Bureaucrat::Bureaucrat(void) : _name("default"), _grade(LOW_GRADE)
{
return;
}
Bureaucrat::Bu... | true |
fae8fd81f4a9ebf530d3fc7a05437ed7f0094511 | C++ | ykingdsjj/StudentCourseChooseSystem | /Course.cpp | GB18030 | 1,297 | 3.625 | 4 | [] | no_license | /*
**@ ȡ
**@ Courseʵ
**@ 2013/12/20
*/
#include "Course.h"
//>>
ifstream & operator>> (ifstream &in,Course &c){
string num,name,teacher;
double credit;
int times;
in>>num>>name>>teacher>>credit>>times;
c.setNum(num);
c.setName(name);
c.setTeacher(teacher);
c.setCredit(credit);
c.setTimes(times);
return in;
}
... | true |
6c11f77bc1939e87d57ce0519f6a5ec1d2f6090d | C++ | thePetrMarek/ArduinoLedArray | /sendPixel.ino | UTF-8 | 1,332 | 3.203125 | 3 | [
"Apache-2.0"
] | permissive | //Sending pixel from top to bottom and back
bool sendPixelArray[8][8] = {
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
};
void sendPixelRun... | true |
0608817a2f8b9ca81f30d49e34aabb1f137297a5 | C++ | shashank0107/CompetitiveProgramming | /LIVEARCHIVE/5133.cpp | UTF-8 | 3,338 | 2.546875 | 3 | [] | no_license | /*
Author : manu_sy
Idea : Using dynamic hull (to insert lines and query of max) :
- Sort machines with start dates
- Now each machines earning can be represented using line : k * x + m
- mi = -pi + ri + gi * di + max(mj + gj * (di - 1))
- ki = gi
- Keep ins... | true |
36288559cf78e5244a4ebf7d550dd94316db2629 | C++ | pbraga88/study | /Legacy/CPA_cpp/5_ObjectProgrammingEssentials/5.4_StaticComponents/src/main.cpp | UTF-8 | 1,931 | 3.765625 | 4 | [] | no_license | #include <iostream>
using namespace std;
/*Variáveis estáticas*/
// void func(){
// // int var = 0;
// static int var = 0;
// cout<<var++<<endl;
// }
//
// int main(){
// for(int i = 0; i<5;i++)
// func();
//
// return 0;
// }
/********************/
/*Componentes estáticos da classe*/
// class Classe{
... | true |
69be89fde99793e48a0913895de1ba32ddfbf7ce | C++ | Liousvious/LeetCode | /Dynamic_Problems/Game_dynamic_problem/1140. Stone Game II.cpp | UTF-8 | 1,329 | 2.890625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<vector<int>> memo;
vector<int> postSum;
int stoneGameII(vector<int>& piles) {
memo = vector<vector<int>>(piles.size(), vector<int>(piles.size(), -1));
postSum = vector<int> (piles.size());
postSum[piles.... | true |
d975b70b928ddfd9bf79248b9f59346dc402051d | C++ | mosmeh/islands | /islands/include/Health.h | UTF-8 | 694 | 3.015625 | 3 | [
"MIT",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"BSD-3-Clause",
"Zlib",
"Unlicense"
] | permissive | #pragma once
#include "Component.h"
namespace islands {
class Health : public Component {
public:
using HealthType = unsigned int;
Health(HealthType maxHealth, double invincibleDuration = 0.0);
virtual ~Health() = default;
void update() override;
bool isDead() const;
bool takeDamage(HealthType damage);
Health... | true |
8f5217938f6734db400b6342770a59d76a25f897 | C++ | greenwookez/ex_05_cpp | /intarray.hpp | UTF-8 | 629 | 3.09375 | 3 | [] | no_license | #include "intlist.hpp"
class IntArray : public IntList {
int low_index;
int high_index;
protected:
int * AddLeft(int elem);
int * AddRight(int elem);
public:
IntArray();
IntArray(int lb);
IntArray(IntArray &_array);
IntArray(int lb, int cnt, int val);
int Low() { retu... | true |
3552d28c684d89461db45e6c286f0f831667c0ba | C++ | eliwoods/arduino | /proj/revo_mirror/Animation.ino | UTF-8 | 5,171 | 2.875 | 3 | [
"MIT"
] | permissive | // Some utility shit
uint8_t triwave(uint8_t in) {
if ( in < 64) {
return in;
}
else if (in >= 64 && in < 128) {
return (127 - in);
}
else if (in >= 128 && in < 192) {
return (in - 128);
}
else if (in >= 192) {
return (255 - in);
}
}
// Reset everything aka set everything to black
void ... | true |
caba264d9c2a721ddffe988b3724ff1dc5e491b5 | C++ | dibery/UVa | /vol113/11384.cpp | UTF-8 | 246 | 2.859375 | 3 | [] | no_license | #include<cstdio>
#include<algorithm>
int main()
{
int pow2[ 31 ] = { 1 };
for( int i = 1; i < 31; ++i )
pow2[ i ] = pow2[ i-1 ] << 1;
for( int n; scanf( "%d", &n ) == 1; )
printf( "%d\n", std::upper_bound( pow2, pow2+31, n ) - pow2 );
}
| true |
d546fd016386652207c9b3ba75bc90cc72f5cb67 | C++ | hermanzdosilovic/computer-aided-analysis-and-design | /include/caas/optimization/axis.hpp | UTF-8 | 1,465 | 2.53125 | 3 | [] | no_license | #pragma once
#include <caas/optimization/golden.hpp>
#include <caas/optimization/types.hpp>
#include <caas/utils/log.hpp>
#include <cstddef>
#include <iterator>
#include <vector>
namespace caas::optimization
{
template< typename Function, typename T >
T axis( Function f, T const & x0, T const & precision )
{
//... | true |
440f78418d9b766b2c1761815e52ab3cad4b99e2 | C++ | MK2020/Software-Engineering-2 | /SE2L4 - Intvector/notes_main1.cpp | UTF-8 | 1,523 | 3.078125 | 3 | [] | no_license | /*
* notes_main1.cpp
*
* Created on: 13 Nov 2016
* Author: mwanahusssein
*/
//#include <cstdlib>
//#include <vector>
//#include "point4.h"
//using namespace std;
//
///*
// *
// */
//int main(int argc, char** argv) {
// cout<<"main1"<<endl;
// ifstream infile (argv[1]);
// vector<;Point>vp;
// v... | true |
80875f7e8fa5a5ba5d4f7b105c57e3a02b2aa5b2 | C++ | sarahHe/LeetCode-solution | /Find the Duplicate Number.cpp | UTF-8 | 1,354 | 3.59375 | 4 | [] | no_license | //Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive),
//prove that at least one duplicate number must exist. Assume that there is only one duplicate number, find the duplicate one.
//The main idea is the same with problem Linked List Cycle II,
//https://leetcode.com/proble... | true |
bbd023631a2299791ff8b6a94f573b063dbd67f2 | C++ | wuzhipeng2014/CPP-Primer | /CH13.35/Message.h | GB18030 | 793 | 2.984375 | 3 | [] | no_license | #pragma once
#include <string>
#include <set>
#include "Folder.h"
using std::string;
using std::set;
class CMessage
{
public:
friend void swap(CMessage& lhs, CMessage& rhs);
//ƳԱ
CMessage(const string & m); //ĬϹ캯
CMessage(const CMessage & rhs); //캯
CMessage& operator = (const CMessage& rhs); //ֵ
... | true |
751db4c94b1086e0ed6a64e426beeac8fc9dd98f | C++ | steven2795/JamesJohnson-CSCI20-Fall2016 | /lab2/lab2.cpp | UTF-8 | 259 | 2.734375 | 3 | [] | no_license | // computer chooses a number between 1 and 20
//user guesses 5
//computer says wrong its higher
//user guesses 15
//computer says wrong its lower
//user guesses 10
//computer says wrong its higher
//user guesses 13
//computer says correct, you earned 7 points | true |
5b28771a664f35deafcf18aa8a0aed74771ec5dc | C++ | Sbyner/SSHIVA | /src/graph-lib/homology/_Perseus/Cells/Cube.cpp | UTF-8 | 1,155 | 3.421875 | 3 | [
"MIT"
] | permissive | /*
* Cube.hpp
*
* Contains functions for handling the Cube class
*/
# include "Cube.h"
// set vertices to this point
template <typename C, typename PS, typename BT>
void Cube<C,PS,BT>::setAnchor(const Point<PS>* anch)
{
anchor = anch;
}
// set addin vector to this addin
template <typename C, typename PS, typenam... | true |
496c8971abf7d3fd9d1b344ad79cb2256b5191f6 | C++ | robotchaoX/Qt-tutorial-code | /QT_02/07_Control_TableWidget/widget.cpp | UTF-8 | 2,474 | 2.8125 | 3 | [] | no_license | #include "widget.h"
#include "ui_widget.h"
#include <QMessageBox>
Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) {
ui->setupUi(this);
// QTableWidget控件使用
//告诉控件 一共有多少列
QStringList list;
list << "姓名"
<< "性别"
<< "年龄";
// 设置列数
ui->tableWidget->setColumnCount(list.size()... | true |
35932a7ddc8c704a398691e3643bb283c42055c2 | C++ | Marie-Donnie/Projetrpg | /include/Objet.hpp | UTF-8 | 983 | 3.515625 | 4 | [] | no_license | /**
* @name Constructeur complet
* @brief Créé un objet avec son nom et sa description
* @param nom le nom de l'objet
* @param des sa description
* @return Un objet
*/
/**
* @name afficher
* @brief Affiche l'objet
*/
/**
* @name utiliser
* @brief Utilise l'objet sur un person... | true |
fa6912889553dbadc4c7de0c0ccb2a8f38669c65 | C++ | Huangyuren/DSA_Pratices | /LowestCommonAncestorofaBT.cpp | UTF-8 | 918 | 3.515625 | 4 | [] | no_license | // Find the division point, a little bit tricky
// In each iteration, check is this a division point by
// recursively finding its left & right subtree for p or q.
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(... | true |
c6f8f5cd403217ad3a3605bbc93e522c03570055 | C++ | smolinag/CarCounting | /CarCountingAlgorithm/CarCountingAlgorithm/DatasetsSelector.h | UTF-8 | 1,406 | 2.609375 | 3 | [] | no_license | #ifndef DatasetsSelector_H
#define DatasetsSelector_H
#include <iostream>
#include "dirent.h"
#include <vector>
#include <string>
#include <opencv2/opencv.hpp>
#include <fstream>
using namespace std;
class DatasetsSelector
{
public:
//--------------------------------Main functions---------------------------------... | true |
23df7fa388879b23b3d1af20361df052c3261c68 | C++ | kumarsaurav546/cpp-patterns | /diamond.cpp | UTF-8 | 808 | 3.0625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int n,i,j,k,l,m;
cout<<"ENTER THE HIEGHT OF DIAMOND:"<<endl;
cin>>n;
for(i=0;i<n;i++)
{
cout<<"\n";
for(j=n;j>i;j--)
{
cout<<" ";
}
for(k=0;k<=j;k++)
{
cout<<"*";
}
... | true |
36136b438a2b0de8d634b4576cedc6711d2a249e | C++ | FRuiz811/Argentum-Taller | /src/common/TiledMap.h | UTF-8 | 1,089 | 2.765625 | 3 | [] | no_license | #ifndef ARGENTUM_TILEDMAP_H
#define ARGENTUM_TILEDMAP_H
#include <vector>
#include <string>
#include "TileLayer.h"
#include "TileSet.h"
#include "ObjectLayer.h"
class TiledMap {
private:
uint16_t width{};
uint16_t height{};
uint8_t tileWidth{};
uint8_t tileHeight{};
std::vector<TileLayer> tileLay... | true |
32adcedba91b196d5e6fbcb7dc6a89162a63b825 | C++ | Anokhi1994/Cpp-Challenges | /SSNumberMyLogic/northeria.hpp | UTF-8 | 785 | 3.34375 | 3 | [] | no_license | #include "DateGenerator.hpp"
class Northeria{
private:
const std::string sex_type_m;
int MM_, DD_, YYYY_;
public:
Northeria() = default;
Northeria(std::string sex_type, int MM, int DD, int YYYY):
sex_type_m(sex_type),
MM_(MM), DD_(DD), YYYY_(YYYY){
if((sex_type != "F") && (sex_type != ... | true |
3c9ed47a4947c0bb5cfe25e5adc5a2cd660e54dc | C++ | VakarisStankus/1952_Uduotis | /main.cpp | UTF-8 | 406 | 3.28125 | 3 | [] | no_license | // 1952. Užduotis
#include <iostream>
using namespace std;
void Sprendimas(int n);
int main() {
int n;
cout <<"Irasykite Skaiciu nuo 1 iki 10000"<< endl;
cin >> n;
Sprendimas(n);
return 0;
}
void Sprendimas(int n) {
int rez;
for(int i=1; i<=n; i++)
{
if(n % i == 0) {
... | true |
faee460aba68d208f41dd36f737e172da243fef7 | C++ | asif001/Aircraft | /player.hpp | UTF-8 | 1,050 | 2.6875 | 3 | [] | no_license | #ifndef PLAYER_HPP
#define PLAYER_HPP
#include <map>
#include "command.hpp"
#include "SFML/Graphics.hpp"
namespace arnml {
/**
* A player class for handling
* inputs.
* Abstracts the input handling from the game processing
* loop in game
*/
class Player
{
public:
///
Player();
~Player() = default;
publi... | true |
f12f8f62d7c5fb431df99cc7941c7d3be8f0b7f5 | C++ | zhufangda/Telecom-Paristech | /IGR202/Project/Mesh.h | UTF-8 | 6,817 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | // --------------------------------------------------------------------------
// Copyright(C) 2009-2016
// Tamy Boubekeur
//
// Permission granted to use this code only for teaching projects and
// private practice.
//
// Do not distribute this code outside the teaching assignements. ... | true |
b56e0c3510be630bd4a136fbcc0f299581a56fc7 | C++ | wxy3265/NOIP | /1188/main.cpp | UTF-8 | 775 | 3.125 | 3 | [] | no_license | #include <iostream>
int n;
bool boxes[30]; //U:true;L:false
int ans = 0;
int i;
using namespace std;
void dfs(int step);
void dfs(int step)
{
if (step > n) {
cout << boxes << endl;
ans ++;
return ;
}
for (i = 0; i < n - 3; i++) {
boxes[i] = false;
dfs(step + 1);
boxes[i] = true;
}
return ;... | true |
b8b704519344fff8489fe9e5dc555e33e2ded3d7 | C++ | wangfudex/practice | /c_cpp/c++_primer/ch3/ex3-10.cpp | UTF-8 | 249 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <cctype>
int main(void)
{
std::string s; // empty string due to default init.
std::cin >> s;
for (auto &c : s)
if (ispunct(c))
c = ' ';
std::cout << s << std::endl;
return 0;
}
| true |
c05eaaa074ddd54e5c9fce89f0f6a18fba34c9c3 | C++ | RossitsaTasheva/reps | /Struct_C++_task4.cpp | UTF-8 | 1,580 | 3.734375 | 4 | [] | no_license | //============================================================================
// Name : lib_task4.cpp
// Author : t
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include... | true |
5d2b90401582b2bfaf86994e82c86e603cea609d | C++ | thehilmisu/Chess | /Chess/mainwindow.cpp | UTF-8 | 7,323 | 2.953125 | 3 | [] | no_license | #include "mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
grid = new QGridLayout();
central = new QWidget();
setCentralWidget(central);
centralWidget()->setLayout(grid);
decorateTable();
}
void MainWindow::decorateTable()
{
for (int i=0;i<ROW;i++) {
... | true |
856395bf8003d928c3914edaa9a4c6697e82b1fc | C++ | BGCX262/zto-projekt-1-svn-to-git | /trunk/ZTOProjekt1/ZTOProjekt1/Task.h | WINDOWS-1250 | 766 | 3.234375 | 3 | [] | no_license | #pragma once
#include <iostream>
#include "Utils.h"
using namespace std;
class Task {
public:
// liczba osob realizujaca zadanie
int persons;
// czas w ktrym podana liczba osob realizuje zadanie
float hours;
int id;
Task():persons(-1), hours(-1), id(-1) {}
static Task merge(const Ta... | true |
7a1a14621db26e9d64b6cf366007d0f4e76f399c | C++ | hexa4313/lutin | /src/parsing/ast/expression/expsub.cpp | UTF-8 | 1,441 | 3.15625 | 3 | [] | no_license | #include "expsub.h"
#include "numericconst.h"
#include "expmult.h"
void ExpSub::toString(std::ostream &o) const {
o << *m_left << "-" << *m_right;
}
std::shared_ptr<Expression> ExpSub::optimize(std::shared_ptr<Program> program, std::shared_ptr<Instruction> curInst) {
std::shared_ptr<Expression> left = m_left->op... | true |
00c17fd9cbdbd5254a6bfff9094e8eb2e5a22d71 | C++ | worhkd963/oop2016440129 | /HW1-2/HW1_2.cpp | UHC | 222 | 2.578125 | 3 | [] | no_license | #include <stdio.h>
#include <Windows.h>
int main(){
int a;
printf(" Է : ");
scanf("%d", &a);
if(a%2 == 1)
printf("ȦԴϴ.\n");
else
printf("¦Դϴ.\n");
system("pause");
return 0;
} | true |
b260c451bfb48f7a5999eab6b3e5a982eb6504ce | C++ | mustafabar/minimal | /3dp/fmm.cxx | UTF-8 | 7,764 | 2.515625 | 3 | [] | no_license | #include "build_tree.h"
#include "kernel.h"
#include "ewald.h"
#include "timer.h"
#if EXAFMM_EAGER
#include "traverse_eager.h"
#elif EXAFMM_LAZY
#include "traverse_lazy.h"
#endif
using namespace exafmm;
int main(int argc, char ** argv) {
const int numBodies = 1000; // Number of bodi... | true |
3fb6f5094ba09e1ad1f0fb202226124551ad1beb | C++ | XoDeR/AlgoRecap2017 | /Arrays/SubarrayWithGivenSumInGivenArray/SubarrayWithGivenSumInGivenArray03.cpp | UTF-8 | 1,190 | 3.828125 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
// Function to print sub-array having given sum using Hashing
void findSubarray(int arr[], int n, int sum)
{
// create an empty map
unordered_map<int, int> map;
// insert (0, -1) pair into the set to handle the case when
// sub-array with given sum starts from... | true |
bb1c8180d3c2f2fa1f773cd11a4eff807a955c1a | C++ | khpandya/DataStructuresAssignments | /Assignment1.cpp | UTF-8 | 6,917 | 3.6875 | 4 | [] | no_license | #include<iostream>
#include<forward_list>
#include<vector>
#include<fstream>
#include<algorithm>
using namespace std;
bool contains(vector<std::string> list,std::string toFind){
if(std::find(list.begin(),list.end(),toFind)==list.end()){
return false;
}
return true;
}
class countryStats{
public... | true |
7f843a462b4e2940968cac47482aa5c437322b4a | C++ | smilu97/hamtris | /common/server/player.h | UTF-8 | 817 | 2.578125 | 3 | [] | no_license | #ifndef __PLAYER_H__
#define __PLAYER_H__
#include <utility>
#include <boost/asio.hpp>
#include "message.h"
using boost::asio::ip::tcp;
namespace tetris {
typedef std::function<void(std::error_code, std::size_t)> ReadHandler;
class TetrisPlayer: std::enable_shared_from_this<TetrisPlayer> {
PlayerI... | true |
b7f3b17b724b6d0f45f4dd12047f0e476c9b49f1 | C++ | JunJun0411/Algorithm | /algorithm/11721번 열 개씩 끊어 출력하기.cpp | UTF-8 | 201 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
int main() {
char c[100];
cin >> c;
int i = 0;
while(i<strlen(c)) {
cout << c[i];
i++;
if (i % 10 == 0) {
cout << '\n';
}
}
} | true |
0128637f4e7c508e6b47af7c6163de21a5d0f525 | C++ | CS126SP20/naive-bayes-SabarNimmagadda | /include/bayes/model.h | UTF-8 | 4,058 | 3.359375 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2020 [Your Name]. All rights reserved.
#ifndef BAYES_MODEL_H_
#define BAYES_MODEL_H_
#include "image.h"
#include <cstdlib>
namespace bayes {
constexpr size_t kNumClasses = 10;
// Shaded or not shaded.
constexpr size_t kNumShades = 2;
/**
* Represents a Naive Bayes classification model for deter... | true |
8820f7409ab7c6ec20b0d2228f4d706f7b15bc53 | C++ | ahansaha/CPP-DS-and-Algo | /Lecture 20 Graphs - 1/Get-Path-DFS/main.cpp | UTF-8 | 1,472 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <climits>
using namespace std;
//Get the path b/w tow given vertices using DFS and store it in a vector.
vector<int> getPathDFS (int ** edges, int n, int v1, int v2, bool * visited, vector<int> path) {
if (v1 == v2) {
path... | true |
10931e9cc7169bdb53a1bab41360d2d8b9347412 | C++ | jungahshin/algorithm | /c:c++/1699.cpp | UTF-8 | 505 | 2.921875 | 3 | [] | no_license | //제곱수의 합
//310-320사이정도의 제곱수를 요한다.
#include <iostream>
using namespace std;
int n;
int num;
int DP[100001] = {0, };
//DP[n]은 n이라는 수에서 필요한 가장 작은 제곱 항의 수
void go(){
for(int i=1; i<=n; i++){
DP[i] = i;
//n보다 작은 제곱수를 구한다.
for(int j=1; j*j <= i; j++){
DP[i] = min(DP[i], DP[i-j*j]+1)... | true |
a23107c988e1cf625b99c6bdd835777f454ec56b | C++ | TheAIBot/Skynet | /linesensor.cpp | UTF-8 | 5,493 | 2.859375 | 3 | [] | no_license | #include <stdio.h>
#include <cstdlib>
#include "includes/linesensor.h"
#include "includes/odometry.h"
#include "includes/robotconnector.h"
#include "includes/commands.h"
#define THRESHOLD_FOR_DETECTED_COLOR 0.80
bool simulateFloor = false;
static lineSensorCalibratedData lineSensorCalibData[LINE_SENSORS_COUNT];
/*
... | true |
d471da6c2acfeef1f1b7a068a2dcf2c9fbb8efe8 | C++ | AntonPavlovNN/C-lab-3 | /src/task6.cpp | UTF-8 | 326 | 2.921875 | 3 | [] | no_license | //#include "pch.h"
int getSumMaxMin(int arr[], int N)
{
int i, min = 0, max = 0, sum = 0;
for (i = 1; i < N; i++)
{
if (arr[i] < arr[min])
min = i;
else if (arr[i] > arr[max])
max = i;
}
if (min > max)
{
i = min; min = max; max = i;
}
for (i = min + 1; i < max; i++)
sum += arr[i];
return su... | true |
bd431839d749ee01508966a7a047e661df5f057f | C++ | kamalsirsa/vtp | /TerrainSDK/vtdata/Building.cpp | UTF-8 | 37,854 | 2.53125 | 3 | [
"MIT"
] | permissive | //
// Building.cpp
//
// Implements the vtBuilding class which represents a single built structure.
// This is can be a single building, or any single artificial structure
// such as a wall or fence.
//
// Copyright (c) 2001-2013 Virtual Terrain Project
// Free for all uses, see license.txt for details.
//
#include "B... | true |
d9e8cfcbb6a2b23a1f51c2b9947c22cb78cca59c | C++ | shanadas/VxEventInjector | /External/Pelco/VxSdk-1.2/x86/Debug/Include/IVxMonitor.h | UTF-8 | 4,115 | 2.71875 | 3 | [
"MIT"
] | permissive | #ifndef IVxMonitor_h__
#define IVxMonitor_h__
#include "VxPrimitives.h"
#include "VxMacros.h"
#include "VxCollection.h"
#include "VxUtilities.h"
#include "IVxMonitorCell.h"
namespace VxSdk {
struct IVxDevice;
struct IVxMonitorLock;
/// <summary>
/// Represents a display for view data (typically vide... | true |
47c990961b7f6ef402ec91bc85478d6eafa3720b | C++ | GeoffreyHervet/epitek | /2/piscine/piscine_cpp_d06-2015-hervet_g/ex03/koalanurse.cpp | UTF-8 | 1,751 | 2.8125 | 3 | [] | no_license | //
// koalanurse.cpp for ex03 in /home/hervet_g/piscine/piscine_cpp_d06-2015-hervet_g/ex03
//
// Made by geoffrey hervet
// Login <hervet_g@epitech.net>
//
// Started on Mon Jan 09 16:09:50 2012 geoffrey hervet
// Last update Mon Jan 09 16:09:50 2012 geoffrey hervet
//
#include <fstream>
#include <iomanip>
#include... | true |
9449c64681be7018cd08f67cfb985403a99a4581 | C++ | solomonlu/Cocos2dx-Points24 | /Classes/Util.cpp | UTF-8 | 1,200 | 2.546875 | 3 | [] | no_license | #include "Util.h"
#include "cocos2d.h"
USING_NS_CC;
extern std::set<std::string> g_SolutionSet;
std::string getRandom4CardsString()
{
std::string originalCardNums;
std::string cardNums;
int cardNum1,cardNum2,cardNum3,cardNum4;
int sortCardNum1,sortCardNum2,sortCardNum3,sortCardNum4;
srand((unsigned)time(0));
... | true |
71c863dc1aca88cd8eead7c8147a3e0b4ce835fe | C++ | roadev/IPOO_Alcancia | /Alcancia.h | UTF-8 | 1,644 | 2.859375 | 3 | [] | no_license | /* Autor: Hecho por Juan David Roa Valencia
* Fecha de creación: 02/09/14
* Versión: 0.71
*
* Nombre del archivo: Alcancia.h
* Responsabilidad:
* Colaboración:
*/
#include <iostream>
#include <string>
using namespace std;
#ifndef ALCANCIA_H
#define ALCANCIA_H
class Alcancia {// aquí se crea la clase Alcan... | true |
0dea618dffae9e4b5aed0c228bb319cfefaa1ff9 | C++ | AnaA-Rocha/URI-solution-cpp | /Iniciante/URI 1185.cpp | UTF-8 | 431 | 2.671875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main ()
{
float M[12][12];
int l,c;
char s;
float soma=0,media=0.0;
cin>>s;
for(l=0;l<12;l++)
{
for(c=0;c<12;c++)
{
cin>>M[l][c];
}
}
for(l=0;l<12;l++)
{
for(c=0;c<11-l;c++)
{
soma+=M[l][c];
media=soma/66.0;
}
}
if(s=='S')
{
cout.precis... | true |
f57cc787d54926687bdefd266a9c3c7309d0f78e | C++ | a-kashirin-official/spbspu-labs-2018 | /zasyadko.vladislav/A1/rectangle.hpp | UTF-8 | 511 | 2.75 | 3 | [] | no_license | #ifndef RECTANGLE_HEADER
#define RECTANGLE_HEADER
#include "shape.hpp"
class Rectangle :
public Shape
{
public:
Rectangle(const point_t & center, const double & height, const double & width);
double getArea() const override;
rectangle_t getFrameRect() const override;
void move(const point_t & Center)... | true |
2f5b7ef4a4ca03e414d716cdde3d5b526c79d338 | C++ | davidposs/ObjectCodeGenerator | /Syntax.cpp | UTF-8 | 26,367 | 2.84375 | 3 | [] | no_license | /******************************************************************************
* File: Syntax.cpp
* Authors: David Poss, Douglas Galm
*
* Usage: implements methods defined in Syntax.h
*
******************************************************************************/
//TODO:
// when non terminal symbols accep... | true |
75a7c7c3170f31cad0f2ca9b3f1fa48cb47e113f | C++ | akalinow/TPCReco | /MonteCarlo/UtilsMC/include/TPCReco/ObjectRegistrator.h | UTF-8 | 3,101 | 3.234375 | 3 | [] | no_license | #ifndef TPCSOFT_OBJECTREGISTRATOR_H
#define TPCSOFT_OBJECTREGISTRATOR_H
/**
\file
Automatic registration of objects
\author Lukas Nellen
\version $Id$
\date 12 Mar 2004
Modified by Piotr.Podlaski@fuw.edu.pl
01.2023
*/
#include "ObjectFactory.h"
namespace utl {
/**
\class StandardCreator Ob... | true |
9da11ff647f1b22771178ecac8ee6dd8bdc82c2c | C++ | NirajRasal/C- | /OPRATOR.CPP | UTF-8 | 281 | 2.75 | 3 | [] | no_license | #include<iostream.h>
#include<conio.h>
int x=79;
class test
{
int count;
public:
void getdata(int x)
{
count=x;
}
void operator +()
{
count=count+2;
}
void display()
{
cout<<"count:"<<count<<"\n";
cout<<"x="<<x;
}
};
void main()
{
test t;
t.getdata(10);
+t;
t.display();
getch();
} | true |
495f6ff74fff7a71e7f2bf4446fe8379fb2ae056 | C++ | vlhs-beep/SetsumeiDiscord | /setsumei-bot/commands/hellocommand.cpp | UTF-8 | 2,299 | 3.109375 | 3 | [] | no_license | #include "hellocommand.hpp"
HelloCommand::HelloCommand(QDiscord& discord)
:Command(discord)
{
}
void HelloCommand::dispatch(QDiscordMessage message, QStringList args)
{
std::ifstream file("data/txt/firstname.txt"); // Create an input file stream to read from the file named firstname.txt.
if (!file) { // I... | true |
6fdc8eeed6c169d2b759444267651ab9400d9d98 | C++ | GongZhihui/LearnQT | /Learnqt/reflection.h | GB18030 | 1,900 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <qstring>
#include <qmetatype>
#include <qobject>
#include <qdebug>
class ReflectionObject : public QObject
{
Q_OBJECT
Q_PROPERTY(int Id READ Id WRITE setId)
Q_PROPERTY(QString Name READ Name WRITE setName)
Q_PROPERTY(QString Address READ Address WRITE setAddress)
Q_PROPERTY(P... | true |
686d4a3634fbcd08e2b7cf6317bd2f8b656613d3 | C++ | HandongProblemSolvers/Problem-Solving | /problems/DFS and BFS/BOJ 9205/박하윤.cpp | UTF-8 | 1,253 | 2.984375 | 3 | [] | no_license | // 9205
#include<iostream>
#include<vector>
using namespace std;
int t = 0, n = 0;
vector<pair<int, int> > v;
vector<vector<int> > map;
int abs(int n){
return ((n < 0) ? -n : n); //절댓값
}
bool distance(int x1, int y1, int x2, int y2){
return ((abs(x1 - x2) + abs(y1 - y2)) <= 1000 ? true : false); // 1000 ... | true |
e0d34ed1af18417fc26704411ceaaf3a3b9a143d | C++ | programmingo/Guide_to_Scientific_Computing_in_CPP | /ch4/examples/newdel.cpp | UTF-8 | 361 | 3.46875 | 3 | [] | no_license | /*
* Example
* Dynamically allocated memory for arrays
*/
#include<iostream>
using namespace std;
int main(int argc, char* argv[])
{
double *x;
double *y;
x= new double [10];
y= new double [10];
for (int i=1; i<=10; i++)
{
x[i]= (double)(i);
y[i]= 2.0*x[i];
cout << x[i] << " " << y[i] << endl;
}
... | true |
f14449dd9b1c92f1fe74a16c0d39245bf2444b4b | C++ | wpilibsuite/allwpilib | /wpilibc/src/main/native/include/frc/simulation/DCMotorSim.h | UTF-8 | 2,849 | 2.640625 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#pragma once
#include <units/angle.h>
#include <units/angular_velocity.h>
#include <units/moment_of_inertia.h>
#includ... | true |
cd67ce53a9840227df15655d348372852dde9e2c | C++ | rooooooooob/ggj14 | /src/ggj14/ColourChanger.cpp | UTF-8 | 840 | 2.578125 | 3 | [] | no_license | #include "ggj14/ColourChanger.hpp"
#include "jam-engine/Utility/Math.hpp"
#include "ggj14/Level.hpp"
namespace ggj14
{
const float COLOUR_CHANGE_RATE = 2;
ColourChanger::ColourChanger(Level *level, Colour colour)
:level(level)
,colour(colour)
,active(0)
{
}
void ColourChanger::update()
{
if (colour != Colour:... | true |
e7fbaab00cbfd5de409286fd76ac5fc69562a350 | C++ | RoseLeBlood/CsOS-i386 | /include/klibc/cxx/ios.hpp | UTF-8 | 2,856 | 2.75 | 3 | [
"MIT"
] | permissive | #ifndef _STD_IOS_HPP_
#define _STD_IOS_HPP_
#include <cxx/common.hpp>
#include <cxx/utility.hpp>
#include <cxx/string.hpp>
#include <cxx/streambuf.hpp>
extern "C"
{
#include <stdio.h>
}
namespace std
{
template<typename _char_t, typename _traits_t> class basic_ios
{
public:
typedef _char_t char_type;
... | true |
98a81c6246de613b7c0b166a5ec93a03e6785766 | C++ | amits91/coursera_algo_analysis1 | /assignment3/main.cpp | UTF-8 | 6,273 | 2.984375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include <list>
#include <vector>
#include <map>
#include <time.h>
#include <algorithm>
using namespace std;
int sz = 0;
int m = 0;
typedef vector<int> vertexT;
typedef vector<vertexT> graphT;
graphT... | true |
f7e8cd3bd364010c0aba6aad433297f4afefb10f | C++ | anuvazhayil/Algorithms | /LinkedList/linkedListMult.cpp | UTF-8 | 1,996 | 3.609375 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node *next;
};
Node* create(int val){
Node *newNode = (Node*)malloc(sizeof(Node));
newNode->data = val;
newNode->next = NULL;
return newNode;
}
void insertBeg(Node **head, int val){
Node *newNode = (Node*)malloc(sizeof(N... | true |
41adb4ab9d9af158ac5480f016293133d3bda716 | C++ | xDuraid/Codeforces | /376B - B. I.O.U..cpp | UTF-8 | 916 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int main()
{
IOS
int n = 0, m = 0;
cin >> n >> m;
vector<vector<int>> g(n+1,vector<int>(n+1,0));
int a = 0, b = 0, c = 0;
for(int i = 0; i < m; i++){
cin >> a... | true |
d5621b25f9403c4893d5504937ff5a74f8425475 | C++ | kinetickansra/algorithms-in-C-Cplusplus-Java-Python-JavaScript | /Algorithms/Implementation/Pattern-Problems/cpp/pattern33.cpp | UTF-8 | 528 | 3.28125 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
int main(){
cout<<"Enter n : ";
int n;
cin>>n;
for(int row=1; row<=n; row++){
for(int spaces=1; spaces<=row-1; spaces++){
cout<<" ";
}
cout<<row<<" ";
for(int col=1; col<=n-row+1; col++){
cout<<"* ";
}
cout<<endl;
}
for(int ... | true |
c0c1e59610d24dc147a547241f3f6cff724aaa26 | C++ | cccyf/15-466-f20-base1 | /PlayMode.hpp | UTF-8 | 1,010 | 2.515625 | 3 | [
"CC0-1.0"
] | permissive | #include "PPU466.hpp"
#include "Mode.hpp"
#include <glm/glm.hpp>
#include <vector>
#include <deque>
struct PlayMode : Mode {
PlayMode();
virtual ~PlayMode();
//functions called by main loop:
virtual bool handle_event(SDL_Event const &, glm::uvec2 const &window_size) override;
virtual void update(float elapsed)... | true |
4d3c9ba562657d90ff43fd2c30b5825fdccb170d | C++ | theozornelas/throw-catch | /src/source/stadium.cpp | UTF-8 | 8,015 | 3.078125 | 3 | [] | no_license | #include "stadium.h"
#include <iostream>
#include <QDebug>
/**
* C O N S T R U C T O R & D E S T R U C T O R
*/
/**
* @brief Stadium::Stadium Non-default constructor
* @param id
* @param name
* @param team
* @param address
* @param number
* @param capacity
* @param surf
* @param league
*/
Stadium::Stadium... | true |
9125b762d7e71e80ebfd79b2c983ce18dfa4870b | C++ | linuxgnuru/arduino_projects | /old.d/BareMinimum/BareMinimum.ino | UTF-8 | 384 | 2.59375 | 3 | [] | no_license | void setup() {
// put your setup code here, to run once:
pinMode(12, INPUT);
pinMode(11, INPUT);
pinMode(10, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(12) == HIGH)
{
digitalWrite(10, HIGH);
}
if... | true |
9be7a7bf7da514813453d7103cc9214f8a3947e2 | C++ | MechaniUm/radio | /AccelStepper.h | UTF-8 | 6,849 | 2.78125 | 3 | [] | no_license | #ifndef _ACCELSTEPPER_H_
#define _ACCELSTEPPER_H_
#include <wiringPi.h>
#include <cmath>
#include <iostream>
using namespace std;
class AccelStepper {
public:
AccelStepper(int pin_1, int pin_2, int pin_3, bool en) {
wiringPiSetupGpio();
pinMode(pin_1, OUTPUT);
pinMode(pin_2, OUTPUT);
... | true |
661d948bc26d308c8612c48c4968f69d07f8a29b | C++ | zmsunnyday/Cpp-Primer | /exc10_13.cpp | UTF-8 | 506 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using std::cout;
using std::endl;
using std::vector;
using std::string;
using std::partition;
bool longer5(const string& s)
{
return s.size() >=5;
}
int main()
{
vector<string> words = {"nihao", "haha", "what?", "thanks", "hola"};
... | true |
91a0e9b8dfee50cd8e52e1dcdefa8d8ac1b1d6e5 | C++ | szakosevi/polygonRoundness | /Point.h | UTF-8 | 567 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <math.h>
#include <vector>
#ifndef POINT_H
#define POINT_H
class Point
{
private:
double x,y;
public:
Point(double x = 0.0, double y = 0.0);
Point(const Point &p);
double getX() const;
double getY() const;
void setX(double x)... | true |
a2a157d010752c6757df6f393280e5396235c9e4 | C++ | virtyaluk/leetcode | /problems/2083/solution.cpp | UTF-8 | 279 | 2.53125 | 3 | [] | no_license | class Solution {
public:
long long numberOfSubstrings(string s) {
long long ans = 0;
unordered_map<char, int> freq;
for (const char& ch: s) {
freq[ch]++;
ans += freq[ch];
}
return ans;
}
}; | true |
262620773d8f540490a31a896a432b60b0a152af | C++ | xinfushe/lullaby | /src/lullaby/base/serialize.h | UTF-8 | 7,283 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | /*
Copyright 2017 Google Inc. All Rights Reserved.
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 agreed to in ... | true |
ad661c41ba624ca228b403685a6856be328a1a0e | C++ | MoamenHomoumz7/problem-solving-with-c- | /sheets/Sheet #1 (Data type - Conditions)/O. Calculator.cpp | UTF-8 | 766 | 3.21875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
string equ; // "15-150" size = 5
cin>>equ;
int indexOpr;
char charOpr;
string num1,num2;
int num1Int,num2Int;
for(int i=0;i<=equ.size()-1;i++){
if(equ[i] == '+' || equ[i] =='-' || equ[i] =='*' || equ[i] == '/'){
indexOpr = i; // 2
charOpr ... | true |
19b59fe752f835e3316e67e42f49b34c3b8da287 | C++ | JulianPinto/Tatsy | /desktopApp/Controls/mlink.cpp | UTF-8 | 2,255 | 3.234375 | 3 | [] | no_license | // included libraries
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cstdint>
using namespace std;
// define section
#define SPEED_OFFSET 1
#define SPEED_MULTIPLIER 100
// function definitions
void motorMovementMessage(float power);
uint8_t motorSpeedMessageConverter(float speed);
uint16_t calcul... | true |
8d23f05470c8e9940c3b8df160be965221b6b3a1 | C++ | DEVECLOVER/LeetCodeFighting_CPP | /LeetCode400---900/594.最长和谐子序列.cpp | UTF-8 | 2,822 | 3.5 | 4 | [] | no_license | /*
* @lc app=leetcode.cn id=594 lang=cpp
*
* [594] 最长和谐子序列
*/
// @lc code=start
class Solution {
public:
int findLHS(vector<int>& nums) {
//dp 数组即可
int len = nums.size();
int maxlen = 0;
//int 数组初始化问题,一定整明白,这次又是野值
// int dp[len];
// memset(dp,1,si... | true |
741e94169b6bf1a8140665ed5b76580eaea74ef4 | C++ | carriez0705/leetcode | /122-BestTimetoBuyandSellStockII.cpp | UTF-8 | 682 | 2.953125 | 3 | [] | no_license | class Solution {
public:
int maxProfit(vector<int>& prices) {
if(prices.size()<=1) return 0;
int bot= INT_MAX;
int peak = INT_MIN;
if(prices[1]>=prices[0])
bot = prices[0];
int diff = 0;
for(int i = 1; i<prices.size(); i++){
if(i<prices.size()-... | true |
f87ddd4d10ff4421e61ed9aa575e46e430abd7d2 | C++ | paulrahul/algo | /leetcode/852_mountain_peak.cc | UTF-8 | 818 | 3.171875 | 3 | [] | no_license | class Solution {
public:
int binSearch(vector<int>& arr, int start, int end) {
if (start >= end) {
return start;
}
int mid = (start + end) / 2;
if (mid == 0) {
return binSearch(arr, mid + 1, end);
}
if (mid == arr.siz... | true |
09aee1c14f08e20904524d0371ecce20ef13ec06 | C++ | shadowplay7/SPOJ | /Test3.cpp | UTF-8 | 323 | 2.796875 | 3 | [] | no_license | #include <iostream>
int main() {
int input, flag = 0, counter = 0;
while (std::cin >> input)
{
if (input == 42 && flag == 1) counter++;
if (input != 42) {
flag = 1;
std::cout << input << std::endl;
}
else {
flag = 0;
std::cout << input << std::endl;
}
if (counter == 3) break;
}
return 0... | true |
a2381edaa119e732f19484dc6347fe3829812233 | C++ | trxo/cpp_study_notes | /chapter8-Polymorphism and virtual function/8.3在构造函数和析构函数中调用虚函数/C.cpp | UTF-8 | 254 | 2.78125 | 3 | [
"AFL-3.0"
] | permissive | class C : public B {
public:
C(){}
void func(){
cout << "class C"<<endl;
}
~C()
{
fund();
}
void fund()
{
cout << "destruct C " << endl;
}
};
| true |
0e9fbd242e97717e8d0a7fab13cf53df677024be | C++ | trialley/TAlib | /src/Reactor/EventLoopThreadPool.h | UTF-8 | 1,154 | 2.6875 | 3 | [
"MIT"
] | permissive | #ifndef _EVENTLOOPTHREADPOOL_H
#define _EVENTLOOPTHREADPOOL_H
#include <Logger/ptr_vector.h>
#include <functional>
#include <memory>
#include <vector>
namespace TA {
class EventLoop;
class EventLoopThread;
class EventLoopThreadPool {
public:
//typedef std::function<void(EventLoop*)> ThreadInitCallback... | true |
3eab0437ad787e65ca29bed762a52bd3b6d6c798 | C++ | mrFlatiron/Employment | /src/kernel/ssn_handle.cpp | UTF-8 | 1,395 | 2.9375 | 3 | [] | no_license | #include "ssn_handle.h"
#include <cstring>
#include <QRegExp>
ssn_handle::ssn_handle ()
{
m_is_valid = false;
}
ssn_handle::~ssn_handle ()
{
}
ssn_handle::ssn_handle (const QString &ssn)
{
set_from_string (ssn);
}
void ssn_handle::set_from_string (const QString &ssn)
{
QString ssn_parsed = ssn;
ssn_parsed... | true |
9a4ac72353dd1aa2f16854127205e913aedd3be1 | C++ | koisto/commander | /commander.cpp | UTF-8 | 1,524 | 2.84375 | 3 | [] | no_license | #include "commander.h"
#include "ui_commander.h"
Commander::Commander(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::Commander)
, proc(new QProcess(parent))
{
ui->setupUi(this);
connect(proc, SIGNAL(readyReadStandardOutput()), this, SLOT(write_output()));
connect(proc, SIGNAL(readyReadSta... | true |
9573b49d7596c9d97f3577c6f9e9ba4e9cf93894 | C++ | DeshErBojhaa/sports_programming | /lightoj/1054 - Efficient Pseudocode System.cpp | UTF-8 | 2,329 | 2.671875 | 3 | [] | no_license | #include<stdio.h>
#include<iostream>
#include<string.h>
#include<math.h>
using namespace std;
#define range 47000
#define n_prime 4951
typedef long long ll;
bool flag[range];
ll prime[n_prime],T,nn,mm;
int mod=1000000007;
void sieve()
{
int count=1;
prime[0]=2;
for(int i=3; i<rang... | true |
15a7c805752ecaaa4eb4dfefdece50e2b094bae6 | C++ | shiponcs/My-codes-for-UVa-problems | /11152.cpp | UTF-8 | 604 | 3.046875 | 3 | [] | no_license | //for in-circle area = rs
//for out circle area = a*b*c/4R
#include <iostream>
#include <cstdio>
#include <math.h>
using namespace std;
#define PI acos(-1)
double ans[3];
int main()
{
int a, b, c;
while(scanf("%d %d %d", &a, &b, &c) == 3){
double s = (double)(a + b + c) / 2;
double a... | true |
3c9d653ed72a0ea5f78827a5461b6c1541bedec5 | C++ | salj4215/C-College-Work | /Studyguide9.cpp | UTF-8 | 1,131 | 3.8125 | 4 | [] | no_license | #include <stdio.h>
#define NUM 5
//prototype
void displayGrade(int[]);
int calcGrade(int[], int *, float *);
int main()
{
int grades[NUM];
int x, high, low;
float avg;
for(x = 0; x < NUM; x++)
{
printf("Enter a grade: ");
scanf("%d", &grades[x]);
}
displayGrade(grades);
high = ... | true |
8f9bb0d96a662733cf43aac6da3d531a9de3b2a4 | C++ | Alaxe/noi2-ranking | /2018/solutions/C/KKK-Sofia/maze.cpp | UTF-8 | 3,145 | 3.0625 | 3 | [] | no_license | #include<iostream>
#include<queue>
struct path
{
int x,y,len;
bool bombed;
bool operator <(path compared)const
{
return this->len>compared.len;
}
};
int m,n;
int bx,by,ex,ey;
int maze[101][101];
bool visited[101][101][2];
std::priority_queue<path>current;
int main()
{
s... | true |
a8b6fec9e9a05795d3ee7f8d0ab903c1853d9861 | C++ | xiehaibin/study | /C++/读书笔记/C ++/C++ Primer 5/第 14 章 代码的重用/多重继承.cpp | GB18030 | 943 | 3.3125 | 3 | [] | no_license | #include <iostream>
using namespace std;
class A
{
private :
int ca;
public :
A(int a) : ca(a) {}
virtual void Show(void)
{
cout<<"ca: "<<ca<<endl;
}
virtual~A(){}
};
class B : public A
{
private :
int cb;
public :
B(int b, int a) : A(a)
{
cb = b;
}
virtual void Show(void)
{
cout<<"cb: "<< cb <<en... | true |
85d88b387fe3ee82dc710a5d42a94ba8e24da6f8 | C++ | saravsoftnet/Hackerrank_solutions | /Warmup/compare-the-triplets.cpp | UTF-8 | 763 | 2.921875 | 3 | [] | no_license | /*******************************************************
* Copyright (C) 2017 Haotian Wu
*
* This file is the solution to the question:
* https://www.hackerrank.com/challenges/compare-the-triplets
*
* Redistribution and use in source and binary forms are permitted.
*********************************************... | true |
bc61b9811d9adfac8983d3e4c34c3b58a73623ca | C++ | semerdzhiev/oop-2020-21 | /inf-2-practical/06. Object Lifetime, RAII, Rule of 3/Headers/beer.hpp | UTF-8 | 298 | 2.59375 | 3 | [] | no_license | class Beer {
private:
char* brand;
unsigned volume{};
double abv{};
void copyFrom(const Beer& other);
void free();
public:
Beer();
Beer(const char* _brand, unsigned _volume, double _abv);
Beer& operator=(const Beer& other);
~Beer();
void print();
};
| true |
d864f7093b2863e74117d87f1749b31fc8c15317 | C++ | zmaker/arduino_cookbook | /live/live-2022-11-10/webserver_esp32/webserver_esp32.ino | UTF-8 | 1,538 | 2.609375 | 3 | [] | no_license | #include <WiFi.h>
#include "wifi_passwords.h"
WiFiServer server(80);
void setup() {
Serial.begin(115200);
delay(1000);
analogReadResolution(10);
WiFi.disconnect(true);
WiFi.begin(WIFI_SSID, WIFI_PASS);
while(WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.print("... | true |
a06c1c73b863bff9e080a4fdcb5481c0748e2aa9 | C++ | koziuberda/labs | /lab1/c++/main.cpp | UTF-8 | 285 | 3.078125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
float a = 0;
cout << "Enter cube edge length:";
cin >> a;
cout << "Lateral surface area = " << 4 * a * a << endl;
cout << "Volume of the cube = " << a * a * a << endl;
system("pause");
return 0;
} | true |
d4359aa31a1b1e557ccc62793a3100d8101c8a1f | C++ | reposhelf/playground | /cpp-lang/primer/ch13/examples/strvec/strvec.cpp | UTF-8 | 2,332 | 3.21875 | 3 | [] | no_license | #include "strvec.h"
using namespace std;
StrVec::StrVec()
: _elements(nullptr),
_first_free(nullptr),
_cap(nullptr)
{
}
StrVec::StrVec(const StrVec &other)
{
auto newdata = alloc_n_copy(other.begin(), other.end());
_elements = newdata.first;
_first_free = _cap = newdata.second;
}
StrVec:... | true |
ea562a7b997bbfd7db7b94f54788fb6743327268 | C++ | Thomaw/Project-Euler | /600-700/606.cpp | UTF-8 | 1,740 | 2.703125 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using ll = long long;
inline ll sqr(ll x) {return x * x;}
inline ll cub(ll x) {return x * x * x;}
const int SZ = 100000000, mod = 1e9;
int pi[SZ], pl[SZ], p3[SZ], m;
void sieve() {
m = 0; for (int i = 2; i < SZ; ++ i) pi[i] = 1;
for (int i = 2; i < SZ; ++i) {
if (pi[i])... | true |
caf7c11cda3a2cdf515069d7363eff46e84df4ab | C++ | babaliaris/HazelBabaliaris | /Hazel/src/Hazel/Renderer/Shader.h | UTF-8 | 1,079 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <iostream>
#include <glm/glm.hpp>
namespace Hazel
{
class Shader
{
public:
virtual ~Shader() = default;
virtual void Bind() = 0;
virtual void Unbind() = 0;
virtual const std::string& GetName() const = 0;
virtual void SetUniform(cons... | true |
6ec7617676c74504338cf38381c4edfe89644f09 | C++ | tahmidrana/UvaOjProblemsSollutions | /406 accepted.cpp | UTF-8 | 1,275 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#define N 1010
using namespace std;
int status[N];
int prime[N];
void Sieve(){
status[1]=0;
status[2]=0;
for(int i=4 ; i<=N ; i+=2)
status[i]=1;
for(int i=3 ; i*i<=N ; i+=2){
if(status[i]==0){
for(int j=i*i ; j<=N ; j+=i+i)
... | true |