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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
535acc5d768b7b64e91f4de7830c6e8dd87ba0c6 | C++ | bg1bgst333/Sample | /winapi/SetupDiGetClassDevs/SetupDiGetClassDevs/src/SetupDiGetClassDevs/SetupDiGetClassDevs/SetupDiGetClassDevs.cpp | SHIFT_JIS | 993 | 2.671875 | 3 | [
"MIT"
] | permissive | // wb_t@C̃CN[h
#include <tchar.h> // TCHAR^
#include <stdio.h> // Wo
#include <windows.h> // WWindowsAPI
#include <setupapi.h> // SetUpAPI
// _tmain̒`
int _tmain(int argc, TCHAR *argv[]){ // mainTCHAR.
// ϐ̐錾
HDEVINFO hDevInfo; // foCXnhhDevInfo
// {[foCX̃foCXC^[tF[XNX̃foCX擾.
hDevInfo = SetupDiGetClassDevs(&... | true |
413e4bea03dee30f128403fd377bcda2e7df0a7a | C++ | CSEKU160212/C_Programming_And_Data_Structure | /C Programming (Home Practice)/programming/programming/string/cmparison.cpp | UTF-8 | 1,208 | 4.53125 | 5 | [] | no_license | /*
* C Program to accepts two strings and compare them. Display
* the result whether both are equal, or first string is greater
* than the second or the first string is less than the second string
*/
#include <stdio.h>
int main()
{
int count1 = 0, count2 = 0, flag = 0, i;
char string1[10], string2[10];
... | true |
4c3db8ea006c5564dfa1c2986997d83ed364f525 | C++ | coffee-sound/competitive_programming | /library/algorithm/run_length_encoding.cpp | UTF-8 | 488 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
// ランレングス圧縮
vector<pair<char, int>> RLE(const string &str) {
vector<pair<char, int>> res;
char tmp = ' ';
int cnt = 0;
for (auto c : str) {
if (c == tmp) {
cnt++;
} else {
if (tmp != ' ') {
... | true |
a822c074ddcab979603317dc5bca7c318a1b7443 | C++ | blockspacer/engine-4 | /server_dll/entity_system.h | UTF-8 | 727 | 2.53125 | 3 | [] | no_license | #pragma once
#include <vector>
#include <array>
#include "base_entity.h"
#include <net/networking.h>
using entity_id = size_t;
using entity_handle = size_t;
class entity_system {
public:
entity_handle add_entity(base_entity* ent);
base_entity* get_entity(entity_handle h);
base_entity* get_entity_by_... | true |
31a84344904e61c08ac188c2542db7b58650434c | C++ | xingyun86/RtmpServer | /src/RtmpHeader.h | UTF-8 | 5,659 | 2.65625 | 3 | [] | no_license | #ifndef RTMP_HEADER_H
#define RTMP_HEADER_H
/*
+--------------+----------------+--------------------+--------------+
| Basic Header | Message Header | Extended Timestamp | Chunk Data |
+--------------+----------------+--------------------+--------------+
| |
|<-----... | true |
8fe37971d3c8052d0c47f3270460c54479da8eb6 | C++ | acekiller/poro | /source/utils/easing/penner_cubic.cpp | UTF-8 | 554 | 2.59375 | 3 | [
"Zlib"
] | permissive | #include "penner_cubic.h"
namespace ceng {
namespace easing {
Cubic::EaseIn Cubic::easeIn;
Cubic::EaseOut Cubic::easeOut;
Cubic::EaseInOut Cubic::easeInOut;
float Cubic::impl_easeIn (float t,float b , float c, float d) {
return c*(t/=d)*t*t + b;
}
float Cubic::impl_easeOut(float t,float b , float c, float d) {
ret... | true |
36db0365c59b446577f781800a4d6415e9e772e9 | C++ | liufei65536/algorithm | /PAT乙级/Project1/Project1/1008数组右移.cpp | UTF-8 | 621 | 3.390625 | 3 | [] | no_license | #include<iostream>
using std::cin;
using std::cout;
void move(int arr[], int n_arr);
int main()
{
int n_array;
cin >> n_array;
int move_times;
cin >> move_times;
int * original_array = new int[n_array];
for (int i = 0; i < n_array; i++) {
cin >> original_array[i];
}
for (int j = 0; j < move_times; j++) {
mo... | true |
494ca267c69b051fba132a69105ff2ded7cffb41 | C++ | boy2000-007man/oop-final-project | /Paper5/sort.cpp | UTF-8 | 606 | 2.765625 | 3 | [] | no_license | #include "defs.h"
#include "decl.h"
void merge_sort(point *p[], point *p_temp[], index l, index r) {
index i, j, k, m;
if (r - l > 0)
{
m = (r + l) / 2;
merge_sort(p, p_temp, l, m);
merge_sort(p, p_temp, m+1, r);
for (i = m+1; i > l; i--)
p_temp[i-1] = p[i-1];
for (j = m; j < r; j++)
p_temp[r+m-j]... | true |
488e5a54317792ab716d4c5f3de656554bb2a0fa | C++ | eka43/ascii-rpg | /hero.h | UTF-8 | 1,385 | 2.734375 | 3 | [] | no_license | #ifndef HERO_H
#define HERO_H
#include "unit.h"
//class Item;
class Inventory;
class Paperdoll;
class SLL;
class Hero : public Unit {
protected:
// Item *pocket;
Inventory *slots;
SLL *backpack;
Paperdoll *paperdoll;
public:
Hero();
Hero(char shape, int row, int col, int hp, int maxHp, in... | true |
22b1b36e52c8c8feaeb6d3748292da65067def2d | C++ | nico88chessa/ipg-marking-wrapper | /ipg-marking-library-wrapper/VectorWrapper.cpp | UTF-8 | 3,069 | 2.578125 | 3 | [] | no_license | #using "ipg/IpgMarkingGraphicsLibrary.dll"
#include "stdafx.h"
#include <msclr/gcroot.h>
#include "VectorWrapper.h"
#include "Vector.h"
using namespace System;
using namespace System::Runtime::InteropServices;
namespace ipgml = IpgMarkingGraphicsLibrary;
using namespace ipg_marking_library_wrapper;
class ipg_mark... | true |
3ceeb9cbe9f6c356f02e14ab11f91408a8f8461d | C++ | lohith171/Coding-Practice-Problems | /Strings/Reverse the String.cpp | UTF-8 | 605 | 3.21875 | 3 | [] | no_license | //https://www.interviewbit.com/problems/reverse-the-string/
string Solution::solve(string A) {
int n=A.length();
if(n==0)return "";
string temp;
stack<string>st;
for(int i=0;i<n;i++){
if(A[i]==' '){
if(!temp.empty()){
st.push(temp);
temp.clear();
... | true |
35ff3bf3c4b10c84c8b4d4e5ff109721c7ab7400 | C++ | tudormihaieugen/Cpp2009 | /Neintensiv/S2_5/V095.cpp | UTF-8 | 375 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <string.h>
#pragma warning(disable : 4996) //Eroare strcpy visual studio
using namespace std;
int main()
{
char s1[21], s2[21];
int n = strlen(s1);
cout << "Sir: "; cin.get(s1, 20);
char* p = strtok(s1, " ");
strcpy(s2 + 3, p);
p = strtok(NULL, " ");
s2[0] = p... | true |
4a882dc25b50e7ff59c5931ef87a63b8ce50d0d2 | C++ | ashishsurya/Data_Structures_Algorithms | /Arrays/three_sum_closest.cpp | UTF-8 | 986 | 3.734375 | 4 | [] | no_license | /*
Given an array Arr of N numbers and another number target, find three integers in the array such that the sum is closest to target.
Return the sum of the three integers.
NOTE: If their exists more than one answer then return the maximum sum.
*/
int threeSumClosest(vector<int> arr, int target) {
// Your code... | true |
78d418268988f6e110b5c73553a9dedeeb19f872 | C++ | AlexandreCordaJunior/URI | /Estruturas/uri2482.cpp | UTF-8 | 440 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int num;
scanf("%d", &num);
getchar();
map<string, string> mapa;
while(num--){
string idioma, natal;
getline(cin, idioma);
getline(cin, natal);
mapa[idioma] = natal;
}
scanf("%d", &num);
getchar();
while(num--){
string nome, idioma;
g... | true |
142b2f530c6269e8d7417c10f2ff66bdb02bbaac | C++ | SplendidSky/Visual-Studio-2015 | /HR1/HR1/源.cpp | UTF-8 | 359 | 2.9375 | 3 | [] | no_license | #include <set>
using namespace std;
template<class T>
T& stat(double t, const vector<double> &rec, T& out) {
set<double> absolute_error;
double sum = 0;
for (int i = 0; i < rec.size(); i++) {
absolute_error.insert(rec[i] - t);
sum += rec[i] - t;
}
return out << absolute_error[0] << absolute_error[absolute_er... | true |
44c8bb03cf2f043dba7012dcc2c26ac15f7c2f7a | C++ | hushhw/LQOJ | /BASIC/BASIC-03 字母图形.cpp | GB18030 | 785 | 3.4375 | 3 | [] | no_license | /*
BASIC-3 ϰ ĸͼ
ĸһЩͼΣһӣ
ABCDEFG
BABCDEF
CBABCDE
DCBABCD
EDCBABC
һ57еͼΣҳͼεĹɣһnmеͼΡ
ʽ
һУnmֱʾҪͼε
ʽ
nУÿmַΪͼΡ
5 7
ABCDEFG
BABCDEF
CBABCDE
DCBABCD
EDCBABC
ݹģԼ
1 <= n, m <= 26
*/
#include <iostream>
#include <cmath>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
for(int i=0; i<n; i++){
for(int j=0; j<m; j++)... | true |
a0aa6bce25e231234884eb782d0f218390c86341 | C++ | vaehx/SpeedPointEngine | /Source/SpeedPointEngine/Common/FileUtils.h | UTF-8 | 3,535 | 3.40625 | 3 | [] | no_license | #pragma once
#include "SAPI.h"
#include <string>
#define RESOURCE_PATH_SEPARATOR '/'
#define SYSTEM_PATH_SEPARATOR '\\'
namespace SpeedPoint
{
S_API bool IsAbsoluteResourcePath(const std::string& path);
S_API bool IsAbsoluteSystemPath(const std::string& path);
// Normalizes slashes inside the path and removes tr... | true |
52f74599363d8690f66ad3430cb70706d5b1eb37 | C++ | fmcnish-co/roarse | /sketch01.ino | UTF-8 | 2,508 | 2.8125 | 3 | [] | no_license |
#define DIGIN_L 12
#define DIGIN_R 4
#define ANAOUT_L 11
#define ANAOUT_R 5
#define MAX_VEL 250
#define MIN_VEL 180
#define inLA 10
#define inLB 9
#define inRA 6
#define inRB 7
const int analogPin = A0;
int value; //variable que almacena la lectura analógica
int velocity = 0;
void setup() {
... | true |
897e6ccf39c575f2c352a4bf92c7202fd6786cc5 | C++ | ComesToMind/Theory-of-Information | /TI_lab4/TI_lab4/TI_lab4/Kazakevich.cpp | UTF-8 | 3,783 | 3.078125 | 3 | [] | no_license | #include "Kazakevich.h"
#include <vector>
#include <iostream>
#include <fstream>
struct Code
{
size_t offset;
size_t length;
//string symbols;
char symbols;
};
void Kaz::Run(vector<char> first_data, string filename)
{
first_data.push_back('\0');
vector<Code> Codes;
Code code;
ofstream fout(filename);
string ... | true |
8d2774ba19526bdb7f3979c16b5270734ee42807 | C++ | wjgaas/algorithm | /HufmannCoding-150918/HaffmanCoding-wjg.cpp | UTF-8 | 4,996 | 3.875 | 4 | [] | no_license | /*
----------------------------------------------------------------------------------
problem : Haffman Coding
Author : W.J.G
time : 2015.09.20
comment : use min heap to get the minist two nodes
and push the sum of them into heap again
until the heap size is 1.
------------------------------------... | true |
52ed2bfb116cebf82a0170c0483cf2166d0666a4 | C++ | quangvm2k3/codeC | /4.10.cpp | UTF-8 | 220 | 2.625 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
int main()
{
int n;
printf("nhap n:");
scanf("%d", &n);
int tong = 0;
for(int i = 0; i <= n;i = i + 1)
{
if (i %2 == 1)
{
tong = tong + i;
}
}
printf("%d", tong);
return 0;
}
| true |
19ef8f167b03ac59527fd0963540e6f77be715bc | C++ | Roout/tic-tac-toe-solver | /Board.hpp | UTF-8 | 3,134 | 3.4375 | 3 | [
"MIT"
] | permissive | #ifndef BOARD_HPP
#define BOARD_HPP
#include <cassert>
#include <cstdint>
#include <cstddef>
#include <utility>
#include <iostream>
// Contain game logic implementation
namespace game {
class Board {
public:
enum Details: size_t { ROWS = 3, COLS = 3, SIZE = 9 };
enum class Cell: uint8_t { X =... | true |
c017d1407869341e87e8ce3649fd5aebf8c93981 | C++ | rsalgad/ConsoleFEM | /VS_2019/ConsoleFEMTest/SparseMatrix.cpp | UTF-8 | 2,386 | 3.09375 | 3 | [] | no_license | #include "pch.h"
#include "SparseMatrix.h"
#include <map>
SparseMatrix::SparseMatrix()
{
}
SparseMatrix::SparseMatrix(const int dimX, const int dimY)
{
_dimX = dimX;
_dimY = dimY;
}
SparseMatrix::~SparseMatrix()
{
}
std::map<int, std::map<int, double>>* SparseMatrix::GetMap()
{
return &_matrix;
}
void SparseMat... | true |
8ba5f3b769bf38be4b242b8ba319c56c0ba836d6 | C++ | mbielsk/Dune-II---The-Maker | /utils/cSoundPlayer.h | UTF-8 | 703 | 2.796875 | 3 | [] | no_license | /*
* cSoundPlayer.h
*
* Created on: 6-aug-2010
* Author: Stefan
*
* A class responsible for playing sounds. But also managing the sounds being played (ie, not
* playing too many sounds in the same frame, etc).
*
*/
#ifndef CSOUNDPLAYER_H_
#define CSOUNDPLAYER_H_
class cSoundPlayer {
public:
cSoun... | true |
b73cb451ffa3cdf055afc8976917a2854424c8e6 | C++ | sarum9in/cpp_course | /examples/utility.hpp | UTF-8 | 301 | 2.640625 | 3 | [] | no_license | #include <iostream>
#include <cassert>
#include <cstdint>
#define assert_equal_ptr(A, B) \
assert(reinterpret_cast<std::intptr_t>(A) == reinterpret_cast<std::intptr_t>(B))
#define assert_not_equal_ptr(A, B) \
assert(reinterpret_cast<std::intptr_t>(A) != reinterpret_cast<std::intptr_t>(B))
| true |
87f030e63c4f1e01a92c5c5d9685142c1c8efc37 | C++ | sunnysetia93/competitive-coding-problems | /LeetCode/All/cpp/191.number-of-1-bits.cpp | UTF-8 | 149 | 2.53125 | 3 | [
"MIT"
] | permissive | class Solution {
public:
int hammingWeight(uint32_t n) {
int ones = 0;
for (; n; ++ones, n &= n-1);
return ones;
}
}; | true |
450ef040a90ef3e67044bde5617dacfebd07df36 | C++ | ektagarg786/Coding-Ninjas-CP | /Graph_1/Largest_piece.cpp | UTF-8 | 1,880 | 3.59375 | 4 | [] | no_license | /*Its Gary's birthday today and he has ordered his favourite square cake consisting of '0's and '1's . But Gary wants the biggest piece of '1's and no '0's . A piece of cake is defined as a part which consist of only '1's, and all '1's share an edge with eachother on the cake. Given the size of cake N and the cake , ca... | true |
279d9053e9aee3718bab5e7ccdddc0eb8f5f4c49 | C++ | mime3/bit | /day8/day8/main_tree.cpp | UHC | 2,230 | 3.609375 | 4 | [] | no_license | #include <stdio.h>
#include "Queue.h"
struct Node
{
int value;
Node * left;
Node * right;
};
Node * head, *tail;
void preOrder(Node * root)
{
if (root != nullptr)
{
printf("%d ", root->value);
preOrder(root->left);
preOrder(root->right);
}
}
// bst ŽƮ ˻ϸ ĵ
void inOrder(Node * root)
{
if (root != nullpt... | true |
df904961123ef4478bee8db9d7c1274145b7a945 | C++ | pbcarvalhaes/HapticPaddle | /Contador_Encoder/Contador_Encoder.ino | UTF-8 | 1,294 | 2.890625 | 3 | [] | no_license | #define ENCODER_A 2
#define ENCODER_B 3
volatile int pos;
volatile bool state_A;
volatile bool state_B;
//Do not use volatile variables directly!
void conta_A() {
if(state_A){
if(state_B){
pos+=1;
}
else{
pos-=1;
}
}
else{
if(state_B){
... | true |
b32483b0ed7bb01a1eb648409e988106026b0c94 | C++ | ShailendraLohia/os-spring-2019 | /data_structures/map/maybe.h | UTF-8 | 651 | 3.15625 | 3 | [] | no_license | #ifndef DOCUMENTS_MAP_H
#define DOCUMENTS_MAP_H
namespace data_structures {
namespace map {
template<typename ValueType>
class Maybe {
private:
const bool is_present_;
const ValueType value_;
public:
// we have an actual value
explicit Maybe(const ValueType& value)
: is_present_(true),
... | true |
cca677dde34fce0769c0c4782f311be583fd561b | C++ | rgreenblatt/apma_2822b | /hw/hw_3/src/test.cpp | UTF-8 | 1,127 | 2.875 | 3 | [] | no_license | #include <vector>
#include <mpi.h>
#include <omp.h>
#include "matrix.h"
struct TestParams
{
int size_i;
int size_j;
int size_k;
bool use_mkl;
};
int main(int argc, char **argv) {
MPI_Init(&argc, &argv);
int omp_num_threads = omp_get_max_threads();
int world_size, world_rank;
MPI_Comm_size(MPI_COMM_WOR... | true |
8041bd4a02e076df0a4d53d8cd810fe9d7a1a94d | C++ | devikakrishnadas/OJ-problems | /codeforces/Laptops.cpp | UTF-8 | 546 | 2.609375 | 3 | [] | no_license | #include<bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define vc vector<char>
#define vll vector<ll>
#define pb push_back
#define sf scanf
#define pf printf
#define mp make_pair
#define all(V) V.begin,V.end
using namespace std;
int main()
{
int n;
cin>>n;
vector<pair<int,int> >A;
int x,y;
for(int i... | true |
d7f3c47b7e32aa7f43be787ef9a008f086f7574e | C++ | jcelerier/pfa_guitar_tutor | /GridEditor/TimeEdit.h | UTF-8 | 783 | 2.6875 | 3 | [] | no_license | #ifndef TIMEEDIT_H
#define TIMEEDIT_H
#include <QtWidgets/QTimeEdit>
/**
* @brief Enfant de la QTimeEdit pour afficher en rouge si données invalide
*/
class TimeEdit : public QTimeEdit
{
Q_OBJECT
public:
explicit TimeEdit(QWidget *parent = 0);
void setBad();
void setGood();
virtual void mousePressEvent ... | true |
dc0c01dd2f1608e05e6a45ac8b8a1618fe6bd61d | C++ | ArthurSonzogni/just-fast | /src/libs/FileSystemOperations/FileSystemOperations.cpp | UTF-8 | 1,911 | 3.1875 | 3 | [
"MIT"
] | permissive | #include "FileSystemOperations.h"
#include <algorithm>
void FileSystemOperations::setSelectedFiles(std::vector<std::filesystem::path> sFiles)
{
selectedFiles = sFiles;
}
void FileSystemOperations::appendSelectedFiles(std::filesystem::path fileToAppand)
{
//I hate that.
auto it = std::find(selectedFiles.be... | true |
2136935bf7194fc078f385bc2e904f980a942545 | C++ | levankhaduri/StudentManagmentApplication | /StudentsDatabase/StudentsDatabase/courseswindow.cpp | UTF-8 | 5,659 | 2.625 | 3 | [] | no_license | #include "courseswindow.h"
#include "ui_courseswindow.h"
#include "Classes.h"
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QString>
#include <QMessageBox>
#include <SqlDatabase.h>
CoursesWindow::CoursesWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::CoursesWindow)
{
ui->setupUi(this);
... | true |
0a66c283f2d20e66207f17ab850f6f3c0df455f2 | C++ | electrified/cpuqt | /ui/cpm_io.cpp | UTF-8 | 628 | 2.546875 | 3 | [] | no_license | #include "cpm_io.h"
cpm_io::cpm_io() = default;
/* Emulate CP/M bdos call 5 functions 2 (output character on screen) and
* 9 (output $-terminated string to screen).
*/
void cpm_io::in(Rgstr rgstr, const MemoryAddress &i, Registers *registers, Memory *memory) {
if (registers->getC() == 2) {
// rewrite as code,... | true |
41e5d5bea90a84ed83620da97c4437d8e8cb628d | C++ | arpit23697/For-Uva-solutions | /Graph/Graph_traversal/Articulation_Bridges.cpp | UTF-8 | 1,813 | 2.984375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
vector <vector <int>> graph;
int n;
vector <int dfs_num;
vector <int> dfs_low;
int UNVISITED = 0;
vector <int> parent;
vector <bool> articulation;
int dfs_counter;
int dfs_root;
int root_children;
void Articulation_and_bridges (int u)
{
dfs_num[u] = dfs_low[u] = dfs_... | true |
39266263ff42a000ad46283d5b9b8907b9fe4abd | C++ | formichi3/CMPS109 | /tadum/Rule_H.h | UTF-8 | 560 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <utility>
#include <vector>
using namespace std;
#ifndef Rule_H
#define Rule_H
class rule{
public:
//constructors & destructors
rule();
rule(string p_name, vector < string > p_args, int p_Operator, vector < vector < string > > p_preds);
~rule();
strin... | true |
52c7d301960aea87b6a89d266cc84a1ee6209b99 | C++ | bellkyle/GPA-Degree-Audit | /gpa7.cpp | UTF-8 | 23,003 | 3.625 | 4 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
//class for Courses
class Course
{
public:
Course(); // default constructor
void get(string& name, string& time, string& number,
char& g, int& h) const;
//to only get the course number and hours
void getRequirements(s... | true |
fe95589835a0d5301789d170b55fe8e04fe9fef8 | C++ | rickbrian/Personal-learning | /通讯录管理系统/通讯录管理系统/01 通讯录管理系统.cpp | GB18030 | 7,333 | 3.953125 | 4 | [] | no_license | #include<iostream>
using namespace std;
#include <string>;
#define max 1000
//*ϵ˽ṹ
struct person
{
string m_name; //
int m_sex; //Ա 1 2Ů
int m_age; //
string m_phone; //绰
string m_addr; //ַ
};
//* ͨѶ¼ṹ
struct addrressboos
{
//ͨѶ¼бϵ
struct person person_arr [max];
//ͨѶ¼еǰ¼ϵ˵ĸ
int m_size;
};
//ϵ
void a... | true |
ed98437a0e478de7272e7ffde5edba71f19a2450 | C++ | yao-yl/stan | /src/stan/lang/generator/generate_bare_type.hpp | UTF-8 | 1,869 | 3.140625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"GPL-3.0-only"
] | permissive | #ifndef STAN_LANG_GENERATOR_GENERATE_BARE_TYPE_HPP
#define STAN_LANG_GENERATOR_GENERATE_BARE_TYPE_HPP
#include <stan/lang/ast.hpp>
#include <ostream>
#include <string>
namespace stan {
namespace lang {
/**
* Generate the basic type for the specified expression type
* without dimensions, using the sp... | true |
97382948dd7be418b145966b736daf711aa079db | C++ | luckhoi56/girsLabBackEndEngine | /src/core/ParamArray.cpp | UTF-8 | 16,730 | 2.546875 | 3 | [] | no_license | // $Id: ParamArray.cpp 2240 2014-02-23 02:14:31Z Dongfeng Zhu $
#include "ParamArray.h"
#include "NormalDensityOperator.h"
#include "BRASSError.h"
#include "SliceSamplerAids.h"
#include "NetCorrelation.h"
#include <math.h>
/**
* Constructor.
* @param len number of variables.
*/
ParamArray::ParamArray(... | true |
eea03731cfe1c29133905a88db1279eecac5a040 | C++ | GWBryant/CSC310-FileStructures | /quiz1/char.cpp | UTF-8 | 223 | 2.9375 | 3 | [] | no_license | #include <iostream>
using namespace std;
struct student
{
char gender;
int age;
char name[20];
};
int main()
{
student s;
int i = 0;
char c = 'a';
char cs[20];
cout << sizeof(s) << endl;
} | true |
ebb4acd4fc2318f21c9b855ec7b42cc4a1b36107 | C++ | kevinsunguchoi/monstrous-mosaics | /mp_mosaics/kdtree.hpp | UTF-8 | 6,675 | 3.59375 | 4 | [] | no_license | /**
* @file kdtree.cpp
* Implementation of KDTree class.
*/
#include <utility>
#include <algorithm>
using namespace std;
template <int Dim>
bool KDTree<Dim>::smallerDimVal(const Point<Dim>& first,
const Point<Dim>& second, int curDim) const
{
/**
* @todo Implement this fun... | true |
29c0ef0345657b3f345043958c70aab96aa6c3b4 | C++ | Darkknight1299/C-plus-plus | /Misc/AdjacentListGraph.cpp | UTF-8 | 913 | 3.140625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
class Graph{
int V;
//Array of lists(containg key and nodes)
list<int> *l;
public:
Graph(int V){
this->V=V;
l = new list<int>[V];
}
void AddEdge(int x,int y){
l[x].push_back(y);
l[y].push_back(x);
}... | true |
d53b2750ae630bc3a4a515b4cc7c9317fec9f84f | C++ | IluckyI/01---bank | /projectEND/user.cpp | GB18030 | 4,062 | 2.515625 | 3 | [] | no_license | #include<cstdio>
#include"user.h"
#define _CRT_SECURE_NO_WARNINGS
void outputRecord(UserPtr user) //ûʾԼ˻Ϣ⣩
{
printf("\t\t\t\t%-6s %-16s%10s %-3s\n", "acctnum", "name", "balance","password");
printf("\t\t\t\t%-6d %-16s%10.2lf %-3d\n", user->acctNum, user->name, user->balance,user->password);
}
//void userUpdate... | true |
4c2b3465eae7a82197bbc9d0d4882bedc26b512e | C++ | turi-code/GraphLab-Create-SDK | /graphlab/util/lru.hpp | UTF-8 | 3,781 | 2.921875 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* Copyright (C) 2016 Turi
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD license. See the LICENSE file for details.
*/
#include <utility>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/tag.hpp>
#include <boost/multi_index/member.hp... | true |
79b5d677b359fdfac6b157daf2cd6d295d317b9a | C++ | sdaingade/cpplabs | /TemplateMethodSol/shape.h | UTF-8 | 809 | 2.78125 | 3 | [] | no_license | #ifndef SHAPE_H
#define SHAPE_H
/**************************************************************
*
* File: shape.h
*
* Description: Class Shape is defined in this class.
*
* Author: SciSpike
*
* Modification History:
*
***************************************************************/
/* Include Files */
/... | true |
0b0847cdcbcdaed01dcc5fe5ab46fe877d2ad5b5 | C++ | git-patrick/math | /include/box.h | UTF-8 | 5,934 | 2.953125 | 3 | [] | no_license | //
// box.h
// math
//
// Created by Patrick Sauter on 3/21/14.
// Copyright (c) 2014 Patrick Sauter. All rights reserved.
//
#ifndef math_box_h
#define math_box_h
#include <limits>
#include <utility>
#include <numeric>
#include <functional>
#include "vector.h"
namespace math {
template <typename Vector>
clas... | true |
d000178bf0284fa16dcf4f85d3cebea786f92c50 | C++ | bhavishrohilla/c-plus-plus | /hacker.cpp | UTF-8 | 281 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include<climits>
using namespace std;
int main() {
int no;
int max_so_far = INT_MIN;
for(int i=0; i<=4;i++){
cin>>no;
if(no>max_so_far){
max_so_far=no;
}
}
cout<<max_so_far<<endl;
return 0;
} | true |
cfd5b292e2b3022266cc1c0576d270748920a9db | C++ | arielofer/C-projects-and-homework | /Project1/menu_funcs.cpp | UTF-8 | 19,882 | 2.859375 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
// also adds all structs
#include "menu_funcs.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#define MAX_STRING_LENGTH 50
//global head instant
extern headder head;
//file names
const char* PFILENAME = "players.dat";
const char* TFILENAME = "teams.dat";
//-------------... | true |
950da5805f41bbd7893b2419b527aee8d17705d0 | C++ | OperatorFoundation/Crypto | /src/GHASH.cpp | UTF-8 | 4,488 | 2.53125 | 3 | [
"MIT"
] | permissive | /*
* Copyright (C) 2015 Southern Storm Software, Pty Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, ... | true |
b865bc78046ac425b833f9492193785f92dbec2c | C++ | lamyj/odil | /examples/cpp/dump.cpp | UTF-8 | 2,186 | 3.109375 | 3 | [
"LicenseRef-scancode-cecill-b-en"
] | permissive | #include <fstream>
#include <iostream>
#include <ostream>
#include <string>
#include <utility>
#include <odil/DataSet.h>
#include <odil/Reader.h>
#include <odil/Value.h>
struct Printer
{
typedef void result_type;
std::ostream & stream;
std::string indent;
Printer(std::ostream & stream, std::string c... | true |
589ee341fcd705a5de14af2eb536944c70d40c2e | C++ | ytsurkan/uni-tasks | /public/uni/tasks/details/Task.hpp | UTF-8 | 1,941 | 2.875 | 3 | [] | no_license | #pragma once
#include "uni/tasks/ITask.hpp"
#include "uni/tasks/details/TaskImpl.hpp"
namespace uni
{
template < typename F, typename... Args >
class Task : public ITask
{
public:
/**
* @brief
* std::decay_t models the type conversions applied to function arguments when passed by value.
* std::is_s... | true |
13984b9f869eb012e64400d40b3508544b68cbd1 | C++ | ch200c/leetcode-cpp | /UnitTests/src/p169/p169_test.cpp | UTF-8 | 629 | 2.671875 | 3 | [
"MIT"
] | permissive | #include "pch.h"
#include "CppUnitTest.h"
#include "leetcode-cpp/p169/p169_solution.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace tests
{
TEST_CLASS(p169_test)
{
public:
TEST_METHOD(test1) {
auto solution{ leetcode::p169::Solution() };
auto input{ std::vector<int>{3, 2, 3} };... | true |
be60b579237a0843c0f5b31399410fffdff7931b | C++ | alexander-jones/NCV | /gui/utilities/combowidget.h | UTF-8 | 3,760 | 2.890625 | 3 | [] | no_license | #ifndef SIDEBAR_H
#define SIDEBAR_H
#include <QWidget>
#include <QLabel>
#include <QCheckBox>
#include <QSignalMapper>
#include <QSpinBox>
#include <QComboBox>
#include <QHBoxLayout>
/*!
\class ComboWidget
\author Alex Jones
\brief A widget class for cycling through a number of widgets thr... | true |
39a1c0ab1b5802d9cdab37d98f22c28e40d68447 | C++ | Wzhoooh/Turtle_graphic | /parser.cpp | UTF-8 | 671 | 2.9375 | 3 | [] | no_license | #include "parser.hpp"
#include "list.hpp"
#include "string.hpp"
#include "command_handler.hpp"
Parser::Parser(DS::string&& input, Command_Handler&& handler): s(input),
_handler(handler){}
void Parser::handle()
{
DS::list<DS::string> commandsList;
for (size_t i = 0; i < s.size();)
{
for (; ... | true |
d7fff419a8a6112bd33c7373763ab25f68a2bcac | C++ | waewing/CS246 | /Mains/NodeSum.cpp | UTF-8 | 381 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include "node.h"
using namespace std;
int Sum(Node<int>* root)
{
int sum;
for(Node<int>* tmp = head; tmp!=NULL; tmp = tmp->GetLink())
{
if(tmp = root)
{
sum = tmp->GetData();
}
else
{
sum = sum + tmp->GetD... | true |
9871d328cf57f6ad636846517e1396d680532dd3 | C++ | elemaryo/Ubisoft-NEXT-2021-Tower-Defense | /WDAU_API2020/GameTest/Level.cpp | UTF-8 | 3,525 | 2.59375 | 3 | [] | no_license | //-------------------------------------------------------------------
// Level.h
// The class manages all aspects of the level entity
// Derived from GameEntity
//-------------------------------------------------------------------
#include "stdafx.h"
#include "Level.h"
#include "MathHelper.h"
#include "CanonTow... | true |
32d5c070de5adf7fb234cc32f3c7a831e2a18779 | C++ | DiegoCV/programacion_competitiva | /el_sueno_del_emperador.cpp | UTF-8 | 738 | 2.921875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int const MAX_N = 30 + 1;
vector<int> adj[MAX_N];
bool visited[MAX_N];
void dfs(int s){
if(visited[s]) return;
visited[s] = true;
for(auto u: adj[s]) dfs(u);
}
int main() {
int t, n, m, a, b, cant_islas;
cin >> t;
while(t){
cant_islas = ... | true |
fcefcb3efb80edd1ac86030a5efe8d12b80c92a1 | C++ | staticfloat/liblsl | /src/udp_server.cpp | UTF-8 | 7,418 | 2.53125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include "udp_server.h"
#include "socket_utils.h"
#include "stream_info_impl.h"
#include <boost/asio/ip/address.hpp>
#include <boost/asio/ip/multicast.hpp>
#include <boost/asio/ip/udp.hpp>
#include <boost/asio/placeholders.hpp>
#include <boost/bind.hpp>
#include <boost/thread/thread_only.hpp>
// === implementation of... | true |
14874e046b01872451fe14e964d4f1d411006e4f | C++ | SoPlump/POO2 | /src/Trajet.cpp | UTF-8 | 3,482 | 2.84375 | 3 | [] | no_license | /*************************************************************************
Trajet - description
-------------------
debut : 14 decembre 2018
copyright : (C) 2018 par CERBA, RAUDRANT
e-mail : guilhem.cerba@insa-lyon.fr, sophie.raudrant@insa-lyon.fr
******************************... | true |
922f2bd36dcfc87183f1289ebb5c8a58c22e1d50 | C++ | GabeOchieng/ggnn.tensorflow | /program_data/PKU_raw/88/873.c | UTF-8 | 215 | 2.921875 | 3 | [] | no_license | void main()
{
char str[32];
gets(str);
char *p=str;
int i;
for(i=0;*(p+i)!='\0';i++)
{
if(*(p+i)>='0'&&*(p+i)<='9')putchar(*(p+i));
else if(*(p+i-1)>='0'&&*(p+i-1)<='9')putchar('\n');
}
} | true |
7baab54295ac7d56ace10fbe52f76acac20b0aba | C++ | Saman-Ahmari/CIS | /Hmwk/Assignment_3/Gaddis_9thEd_Chap4_Prob12_BankCharges/main.cpp | UTF-8 | 1,960 | 3.078125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: main.cpp
* Author: samanahmari
*
* Created on March 14, 2019, 8:22 PM
*/
#include <iostream>
#include <iomanip>
us... | true |
7a26252db03db982efd511abb6571a865ad2c492 | C++ | VladislavKuzevanov/cpp_spring_2019 | /05/ping_pong_block.cpp | UTF-8 | 697 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <thread>
#include <condition_variable>
const int n = 500000;
int amount_in_process = 1;
std::mutex mtx;
std::condition_variable c_v;
void print1() {
for (int i = 0; i < n; i++) {
std::unique_lock<std::mutex> lock(mtx);
c_v.wait(lock, []() {return amount_in_process > 0; });
printf("... | true |
3beb76fdbe72f59b3326437b655a0673ed9db6cc | C++ | ThomasCLee/funnyvale | /hackabot_nano/Tutorial4_receving_message_over_bluetooth/Tutorial4_receving_message_over_bluetooth.ino | UTF-8 | 3,280 | 2.921875 | 3 | [] | no_license | /***************************************************************************************************
* This sample code is designed for Hackabot Nano (Arduino Compatible Robotic Kit)
*
* Tutorial 4:
* In this example, the robot receives commands through bluetooth. It moves forward, backward,
* left, right or sto... | true |
74b44179d5a72b413c20ee47ea5b919e7e594e0e | C++ | fancyGenTatsu/HOMEWORK | /今天星期几.cpp | UTF-8 | 1,026 | 2.59375 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int year,month,day;
int tempmonth,yearday;
int week,weekday;
int sum=0;
int tag=0;
scanf("%d-%d-%d",&year,&month,&day);
tag =( year - 1900 )/4;
sum=(year-1900)*365 + tag;
tempmonth = month - 1;
yearday = 0;
switch(tempmonth)
{
case 12:yearday+=... | true |
e6bd1231baf1978c3e16064759dcc7d7c46e4138 | C++ | iisword/copyright-infringement-elementals | /Game Project/Elementals/Elementals/source/Renderer/D3DObjects.cpp | UTF-8 | 1,358 | 2.515625 | 3 | [] | no_license | #include "D3DObjects.h"
#include "Renderer.h"
D3DObject::D3DObject(void)
{
tempObj = nullptr;
XMStoreFloat4x4(m_XMmatrix.GetMatrix(), XMMatrixIdentity());
copy = false;
shader = nullptr;
}
D3DObject::~D3DObject(void)
{
if(tempObj && !copy && tempObj->Size())
{
delete tempObj;
}
tempObj = nullptr;
}
void D... | true |
0be650d8062b547706a82268a42dd390bae0fb6b | C++ | TacianasdOliveira/ExerciciosCPlusPlus | /Pacote-Download/Lista2/lista6_ex6_taciana_oliveira.cpp | UTF-8 | 786 | 3.203125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <cmath>
#include <Windows.h>// usei para imprimir os acentos
using namespace std;
namespace maria {
int idade= 18;
float cre= 8.3;
void incrementar_idade() {idade++;}
}
namespace jose {
int idade=21;
float cre= 4.3;
}
namespace taciana {
int idade= 28;
float cre=... | true |
3048125f959afa2ee38491cf051d7f8b923e6268 | C++ | BrianArch96/QT_Game | /QtZelda-master/mainwindow.cpp | UTF-8 | 1,733 | 2.609375 | 3 | [] | no_license | #include "mainwindow.h"
#include "ui_mainwindow.h"
#include "gameframe.h"
#include "input.h"
#include "gametextbox.h"
#include <QGridLayout>
#include <iostream>
#include <map>
#include <QMediaPlayer>
#include "globals.h"
#include "inventoryframe.h"
#include <QSound>
MainWindow::MainWindow(QWidget *parent) :
QMain... | true |
a39272bd1137e388b3eb4b7c62abeb737f9df33c | C++ | PineappleCompote/EE312_Cheaters | /LinkedList.cpp | UTF-8 | 1,186 | 3.671875 | 4 | [] | no_license | /* LinkedList.cpp
* Methods for the Linked List class used for separate chaining
* Created by Dilya Anvarbekova and Teddy Hsieh
* Last Modified: 05/06/2020
*/
#include <iostream>
#include <string>
#include "LinkedList.h"
using namespace std;
Node *LinkedList::getHead() {
return head;
}
Node* LinkedList::get... | true |
5d9c02f18c4d2eb49ec45e617c0589694c1482b6 | C++ | IvanIsCoding/OlympiadSolutions | /beecrowd/2089.cpp | UTF-8 | 1,070 | 2.546875 | 3 | [] | no_license | // Ivan Carvalho
// Solution to https://www.beecrowd.com.br/judge/problems/view/2089
#include <cstdio>
#include <unordered_map>
#define MAXN 100001
#define MAXM 1001
#define gc getchar_unlocked
void getint(int &x) {
register int c = gc();
x = 0;
for (; (c < 48 || c > 57); c = gc())
;
for (; c > ... | true |
728b602cce17cdd3243b242c1368a81f0d20312c | C++ | marco-c/gecko-dev-comments-removed | /third_party/libwebrtc/rtc_base/numerics/moving_percentile_filter_unittest.cc | UTF-8 | 2,621 | 2.84375 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive |
#include "rtc_base/numerics/moving_percentile_filter.h"
#include <stdint.h>
#include <algorithm>
#include "test/gtest.h"
namespace webrtc {
TEST(MovingPercentileFilter, Percentile25ReturnsMovingPercentile25WithWindow4) {
MovingPercentileFilter<int> perc25(0.25f, 4);
const int64_t kSamples[10] = {1, ... | true |
74e5c7a69bf357575a9e23be0511b47a512b82a9 | C++ | bird11329/TwoTools | /common_tools.cc | UTF-8 | 30,885 | 2.6875 | 3 | [] | no_license | // ************************************************************************* //
// File: common_tools.cc
// Contents: common functions that both tools will use
// Classes:
// MySQLInterface
// BaseParser::ColumnAcquirer
// BaseParser
// RecordsHolder
// **********************************************************... | true |
ef034e5750b6ef02f493f2ec4938a09511c5ddb9 | C++ | creep06/competitive-programming | /PCCB/p066_DivisionNumber.cpp | UTF-8 | 1,006 | 2.875 | 3 | [] | no_license | /*
dp[i][j]: jをi個以下の自然数に分割するパターンの総和 順序は無視
と定義すると↓こういう漸化式になる
dp[i][j] = dp[i][j-i] + dp[i-1][j]
右辺の2つの項について
1) jをi個に分割するパターンの総数
まずj個の品物からi個の箱へ1個ずつ入れてから、残ったj-i個をi個の箱へ振り分けていく
と考えられるのでdp[i][j-i]と書ける
2) jをi-1個以下に分割するパターンの総数
これはそのまんま dp[i-1][j]
本の解説はクソわかりづらい
http://techtipshoge.blogspot.jp/2011/01/blog-post_28.html
ここが参考にな... | true |
52c861eaf798e84d4efc61ca3aa4f1ba70302f80 | C++ | romit0226/DS_Algo | /LeetCode/1217. Minimum Cost to Move Chips to The Same Position.cpp | UTF-8 | 262 | 2.53125 | 3 | [] | no_license | class Solution {
public:
int minCostToMoveChips(vector<int>& position) {
int i, ec=0, oc=0;
for(i=0; i<position.size(); i++) {
if(position[i]&1) oc++;
else ec++;
}
return min(oc, ec);
}
};
| true |
c54daa712676050b1efbf77dcf2f9bbaea9a97e2 | C++ | a-mandy/ProjectoFinalEstructurasDatos | /ProjectoFinalEstructurasDatos/NodoListaMejoresPuntajes.cpp | UTF-8 | 906 | 2.890625 | 3 | [] | no_license | #include "NodoListaMejoresPuntajes.h"
NodoListaMejoresPuntajes::NodoListaMejoresPuntajes(){
puntaje = 0;
nombre = " ";
siguiente = NULL;
}
NodoListaMejoresPuntajes::NodoListaMejoresPuntajes(int pPuntaje) {
puntaje = pPuntaje;
}
NodoListaMejoresPuntajes::NodoListaMejoresPuntajes(string pNombre, int pPuntaje) {
n... | true |
2a875759dc3bf7a586e10df88455c0d1596ff714 | C++ | JanMfa/MatchingWordApp | /MatchingWordsApp.cpp | UTF-8 | 7,017 | 3.546875 | 4 | [] | no_license | // MatchingWordsApp is an application to create an output of substring matching words.
// Condition: commonwords.txt and allwords.txt has to be in the same folder/path.
// allwords.txt consist of single word on each line in alphabetical order
// commonwords.txt consist of substrings on each line
// Output: matchingwor... | true |
131e4f1d2a2b9d28f5d9e5e1bc5e8cf2453aa1c4 | C++ | Sumethh/BlueGengineProject | /BlueEngine/BlueEngine/BlueCore/Source/Public/BlueCore/Components/ComponentRegistery.h | UTF-8 | 2,791 | 2.609375 | 3 | [] | no_license | #pragma once
#include "BlueCore/BlueCore.h"
#include "BlueCore/Core/Log.h"
#include "BlueCore/Hashing/CompileTimeHashing.h"
#include "BlueCore/Managers/MemoryManager.h"
#include <map>
#include <vector>
namespace Blue
{
class ActorComponent;
class Actor;
template<typename T>
ActorComponent* __Constr... | true |
5c82e6b987085d7e6930047b04c59a9d9b3ec59e | C++ | ganshuoos/C-Primer- | /stocks.cpp | UTF-8 | 1,977 | 3.828125 | 4 | [] | no_license | //stocks.cpp -- the whole program
#include<iostream>
#include<cstring>
class stocks
{
private:
char company[30];
int shares;
double share_val;
double total_val;
void set_tot(){
total_val = shares * share_val;
}
public:
void acquire(const char* co, int n, double pr);
void buy(int num, double price);
void sel... | true |
f822a14265708423d42cd52593a2fa7795e7d874 | C++ | venkat-oss/SPOJ | /KAOS.cpp | UTF-8 | 1,476 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <cassert>
#include <iomanip>
#include <ctime>
using namespace std;
con... | true |
25bf09904019f6410925b1245f6a4b897ecb1db0 | C++ | aalin/gta2-level-viewer | /src/geometry.cpp | UTF-8 | 1,355 | 2.90625 | 3 | [] | no_license | #include "common.hpp"
Geometry::Geometry()
{ }
void
Geometry::pushVertex(const Vertex& vertex)
{
_positions.push_back(vertex.position);
_normals.push_back(vertex.normal);
_texcoords.push_back(vertex.texcoord);
}
void
Geometry::draw()
{
if(_positions.size() % 3 != 0)
throw std::runtime_error("The number of vert... | true |
d4da50859edf028299e9bc116c0fa872283a586e | C++ | ganzena/BOJ | /[2839] 설탕 배달/[2839] 설탕 배달/main.cpp | UTF-8 | 585 | 2.5625 | 3 | [] | no_license | //
// main.cpp
// [2839] 설탕 배달
//
// Created by YOO TAEWOOK on 2018. 1. 17..
// Copyright © 2018년 YooTae-Ook. All rights reserved.
//
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
int sugar;
int total = 0;
cin>>sugar;
while(1){
if(sugar % 5 ... | true |
54b79ea13f3ac56fb3ad8cc74542514d235b6392 | C++ | CrossCompiled/lvm | /includes/LittleVirtualMachine/LittleCompiler/CompilerExceptions.h | UTF-8 | 1,063 | 2.671875 | 3 | [] | no_license | #ifndef LITTLEVIRTUALMACHINE_COMPILEREXCEPTIONS_H
#define LITTLEVIRTUALMACHINE_COMPILEREXCEPTIONS_H
#include <stdexcept>
#include <string>
namespace lvm{
namespace compiler {
struct CompilerException : std::runtime_error {
explicit CompilerException(const std::string& message) : runtime_error(message) {}
... | true |
14f030d90c71476558240b4679031f436bf62adc | C++ | Chantico-org/smart_board | /Main/Client.cpp | UTF-8 | 578 | 2.5625 | 3 | [
"MIT"
] | permissive | #include "Client.h"
void smart::Client::connect() {
Serial.printf("Conneting to %s:[%d]\n", host, port);
int state = LOW;
digitalWrite(HOST_CONNECTION_PIN, state);
bool connected = wifi_client->connect(host, port);
state = !state;
digitalWrite(HOST_CONNECTION_PIN, state);
unsigned long begin_millis = mil... | true |
4ac1881b5485cf30fd5d4547369c70154abe539e | C++ | Eunno-An/ACMICPC_boj | /ACMICPC/같은 수로 만들기_2374_골.cpp | UTF-8 | 693 | 2.625 | 3 | [] | no_license | #include <stdio.h>
#include <stack>
#include <vector>
using namespace std;
long long int A[1000001];
vector<long long int> v;
int main() {
int n;
long long int output = 0;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%lld", &A[i]);
if (v.empty()) v.push_back(A[i]);
else {
while (v.back() < A[i]) {... | true |
f3030f668febdd9431e77aa6f1a210b56e8bf620 | C++ | jiangtao89/kraken | /plugins/devtools/bridge/inspector/protocol/exception_details.h | UTF-8 | 5,669 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2020-present The Kraken authors. All rights reserved.
*/
#ifndef KRAKEN_DEBUGGER_EXCEPTION_DETAILS_H
#define KRAKEN_DEBUGGER_EXCEPTION_DETAILS_H
#include "inspector/protocol/error_support.h"
#include "inspector/protocol/remote_object.h"
#include "inspector/protocol/stacktrace.h"
#include <memory>... | true |
bab1a4d82d2bdc4ef3ebd68b61f797bf39a2f18e | C++ | CharlsPalm/ejercicios_C | /19_seccion/arboles.cpp | UTF-8 | 1,304 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include "nodo3.h"
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
nodo3 *R, *T;
void agregar(nodo3 *);
void presentar(nodo3 *);
void ordenar(nodo3 *);
int op,x;
int main(int argc, char** argv) {
do{
cout<<"Menu"<<endl;... | true |
6e611cb44094a5867299dc911b5b911218e51895 | C++ | BoykoMihail/ML_HomeWork_NeuralNetwork | /SoftPlus.h | UTF-8 | 788 | 2.765625 | 3 | [] | no_license | /*
* File: SoftPlus.h
* Author: boyko_mihail
*
* Created on 30 октября 2019 г., 19:47
*/
#ifndef SOFTPLUS_H
#define SOFTPLUS_H
#include <eigen3/Eigen/Core>
#include "Configuration.h"
class SoftPlus : public Activation {
private:
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> Matrix;
publi... | true |
88af3ea633248c63df3710a43c31fbb806c48fae | C++ | oLESHIYka/PdfConsoleParser_QT | /PdfConsoleParser_QT/source/Document/Issue/Page/Page.h | WINDOWS-1251 | 1,010 | 3.078125 | 3 | [] | no_license | #pragma once
/*====================================================*\
Page.h - Page
,
\*====================================================*/
#include "../../../Text/Block/TextBlock.h"
#include <algorithm>
class Page : public std::vector<TextBlock>
{
public:
Page() {};
void findRunningTitles();
... | true |
f026cf5598f9b925e970746b33a8732aa55aba87 | C++ | longshadian/estl | /redis/test/rediscpp/test/TestSet.cpp | UTF-8 | 1,150 | 2.625 | 3 | [] | no_license | #include "RedisCpp.h"
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <chrono>
#include "TestTool.h"
std::string ip = "127.0.0.1";
int port = 6379;
using namespace rediscpp;
ContextGuard g_context;
bool test_Set()
{
try {
Buffer key{"test_set"};
... | true |
5aba282414a840791b764e640404a741f51479c4 | C++ | sanish-khadgi/cpp_projects2 | /LEC_C++/Lab_works/types-of_user_defined_functions/from_assignment-using_area_of_triangle/no_arument_but_return_type.cpp | UTF-8 | 1,047 | 3.578125 | 4 | [] | no_license | //area of triangle using funtion with no argument and return type
/*no argument mean "the called function" does not received any data
from "the calling function"*/
#include<iostream>
#include<math.h>
#include<conio.h>
using namespace std;
float area_Triangle();
int main()
{
float area;
area=area_Triangle()... | true |
e58212baa6c3db40c4af5a1de88ff8919a2f3eb4 | C++ | gonzanicorodriguez/juego_topo | /BaseProject/main.cpp | UTF-8 | 9,744 | 2.9375 | 3 | [] | no_license | #include "mbed.h"
#include <stdlib.h>
/**
* @brief Estos son los estados de la MEF (Máquina de Estados Finitos), para comprobar el estado del boton.
* El botón está configurado como PullUp, establece un valor lógico 1 cuando no se presiona
* y cambia a valor lógico 0 cuando es presionado.
*/
typedef enum{
BUT... | true |
531a1853c5da2a4a0283501153356975c15507a1 | C++ | rodoufu/challenges | /leetCode/interview/strings/LongestCommonPrefix.hpp | UTF-8 | 742 | 3.203125 | 3 | [] | no_license | //https://leetcode.com/problems/longest-common-prefix/
class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
string resp;
int len = strs.size();
if (len == 0) {
return resp;
}
int smallLen = strs[0].length();
for (int i = 1; i < len;... | true |
26b107234d3545e67f332b2f01dad4138ce251d2 | C++ | tridibsamanta/LeetCode_Solutions | /ValidateBinarySearchTree_98.cpp | UTF-8 | 864 | 3.375 | 3 | [] | no_license | /*
~ Author : leetcode.com/tridib_2003/
~ Problem : 98. Validate Binary Search Tree
~ Link : https://leetcode.com/problems/validate-binary-search-tree/
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(... | true |
f296956838b6fd62065ead5c1ce416b61097c886 | C++ | ccharp/School | /ku/560/lab4/BinarySearchTree.h | UTF-8 | 1,008 | 3.140625 | 3 | [] | no_license | #ifndef BINARYSEARCHTREE_H_
#define BINARYSEARCHTREE_H_
#include "TNode.h"
class BinarySearchTree {
private:
TNode *root;
void insert(int v, TNode* &t);
void inOrderTraversal(TNode* &t);
void preOrderTraversal(TNode* &t);
void postOrderTraversal(TNode* &t);
int leafCount(TNode* &t);
int tree... | true |
922370622fcf918fee182370a52cba3d35820bf1 | C++ | rgianluca00/ROS_exercises_tutorial | /exercise_2/src/saturation_controller.cpp | UTF-8 | 3,734 | 3.09375 | 3 | [] | no_license | /*
* saturation_controller.cpp
*
* Created on: March, 2020
* Author: Gianluca Rinaldi
*/
#include "ros/ros.h"
#include <iostream>
#include <exercise_2/CustomVelMsg.h>
#include <geometry_msgs/Twist.h>
/* Global variables */
float vel; // linear_velocity
float ang; // angular_velocity
bool command_ready = fa... | true |
0c3c862178feda1cdc6e0a8b6e146bf6e0d15613 | C++ | Madness-D/CodeUp | /2 c c++快速入门/2.5 数组/J 字符串求最大值.cpp | UTF-8 | 357 | 3.3125 | 3 | [] | no_license | //三个字符串 输出最大的那个
#include <stdio.h>
#include <string.h>
int main()
{
char a[20],b[20],c[20];
char *max;
//两种c语言字符数输入方式
gets(a);
scanf("%s",&b);
//getchar();
gets(c);
//找出a b最大者
if(strcmp(a,b)>0)
max = a;
else
max =b;
if(strcmp(max,c)>0)
puts(max);
else
puts(c);
return 0;
} | true |
914253386233906bba2992ce56a5755f44a408ef | C++ | michaelbprice/default-arguments | /examples/slide36.cpp | UTF-8 | 606 | 3.21875 | 3 | [
"MIT"
] | permissive | // GCC> g++ -std=c++14
#include <cassert>
#include <string>
using std::string;
struct Base
{
auto fn (string s = "foo")
{
return s;
}
};
struct D_one : Base
{
void fn (char);
using Base::fn; // Bring Base names back into overload set!
};
struct D_two : Base
{
using Base::fn;
aut... | true |
4fe3daabca310ffd065ef121875a1a0af3d78489 | C++ | HamzaHajeir/IoT_Learning_Kit | /Distance/Applications/Car_Sensor/Car_Sensor.ino | UTF-8 | 1,566 | 2.515625 | 3 | [] | no_license | /* This example shows how to use continuous mode to take
range measurements with the VL53L0X. It is based on
vl53l0x_ContinuousRanging_Example.c from the VL53L0X API.
The range readings are in units of mm. */
#include <Wire.h>
#include <VL53L0X.h>
#include <H4Plugins.h>
H4_USE_PLUGINS(115200, 20, false);
H4P... | true |