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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1aa11f0c03788a37e50a7a3acb386827589516ff | C++ | rkagrawal/Cplusplus | /core/inheritance/private/main.cpp | UTF-8 | 633 | 2.984375 | 3 | [] | no_license | #include<iostream>
using namespace std;
class A {
public:
virtual void onUpdate() { cout << "A::onUpdate" << endl; }
};
//class B: private A { // this will not compile
//class B: protected A { // this will not compile
class B: public A { // this will compile
public:
void onUpdate(... | true |
4d66b07ba668a8395b184536dc78f92de6578600 | C++ | lukasblass/AdventOfCode2019 | /2/task1.cpp | UTF-8 | 1,095 | 3.125 | 3 | [] | no_license | #include <stdlib.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
void runIntcode(std::vector<int>& intcode) {
int state = 0;
int command = intcode[state];
while (command != 99) {
int o1 = intcode[intcode[state + 1]];
int o2 = intcode[intcode[state + 2]];
if (command == 1... | true |
f039c6f30508e8332fc49acab632d88a774f71c5 | C++ | volzkzg/Tempus-Fugit-Code-Machine | /Tempus Fugit/Graph Theory/K-shortest Path (Repeat is allowed).cpp | UTF-8 | 4,185 | 2.890625 | 3 | [] | no_license | #define for_each(it, v) for (vector<Edge*>::iterator it = (v).begin(); it != (v).end(); ++it)
const int MAX_N = 10000, MAX_M = 50000, MAX_K = 10000, INF = 1000000000;
struct Edge { int from, to, weight; };
struct HeapNode { Edge* edge; int depth; HeapNode* child[4]; }; // child[0..1] for heap G, child[2..3] for heap ou... | true |
64766747e6500cee0dae016b9d5e41b522ba130e | C++ | minji0320/Algorithm_for_CodingTest | /Dongmin/SWEA/보호필름/P2112.cpp | UTF-8 | 2,048 | 2.90625 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int D, W, K;
vector<vector<int> > film;
vector<bool> dosed;
void getInput() {
cin >> D >> W >> K;
film.assign(D, vector<int>(W, 0));
dosed.assign(D, false);
for(int i=0; i<D; i++) {
for(int j=0; j<W; j++) {
... | true |
437362a78b1f0419e1351ebf9943b3ec32b727ed | C++ | emli/competitive | /tasks/BChetniiMassiv.cpp | UTF-8 | 1,440 | 2.84375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
class BChetniiMassiv {
public:
void run(std::istream& cin, std::ostream& cout){
int n;
cin >> n;
vector<int> a(n);
int even = 0;
int odd = 0;
vector<int> pos;
for (int i = 0; i < n; ++i) {
... | true |
b061e54b10b6822ae2964ef6e65708a87c131f2c | C++ | EgeCiklabakkal/Raytracer | /src/dynArray.h | UTF-8 | 1,448 | 3.859375 | 4 | [
"MIT"
] | permissive | #ifndef _DYNARRAY_H_
#define _DYNARRAY_H_
// a DynArray stores data in an ordered random access structure with
// no delete operations. Items are added with append.
template <class T> class DynArray
{
public:
T *data;
int nData;
int arraySize;
DynArray();
DynArray(int size);
~DynArray();
bool append(T item... | true |
da84ac6d045ef6166ae1e24025eecb0449c6283a | C++ | jinguodong/JSSWW-BUPT-For-Amazon-Hackathon | /OpenCVTest/ScharrOperator.cpp | UTF-8 | 850 | 2.671875 | 3 | [] | no_license | #include "ScharrOperator.h"
ScharrOperator::ScharrOperator(){
}
ScharrOperator::~ScharrOperator(){
}
int ScharrOperator::process(Mat & m, bool isGaussianBlurUsed){
if(!isGaussianBlurUsed){
GaussianBlur( m, m, Size(3,3), 0, 0, BORDER_DEFAULT );
}
Mat m_gray;
cvtColor(m,m_gray,CV_RGB2GRAY);
Mat grad, grad_x... | true |
d6faccee6a24fe2d1b90da1ed82b1de19ca8aecd | C++ | komilguliev99/grader | /user_task1.cpp | UTF-8 | 229 | 2.671875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int m[1000], n, i = 0;
cin >> n;
while (i < n)
cin >> m[i++];
i = 0;
while (i < n)
{
cout << m[i];
if (i + 2 < n)
cout << " ";
i += 2;
}
return (0);
}
| true |
6f37fb0cc0aeda6ecaf218064269bbd7b8f6139f | C++ | colinw7/CUtil | /include/CUtf8.h | UTF-8 | 6,625 | 2.84375 | 3 | [
"MIT"
] | permissive | #ifndef CUtf8_H
#define CUtf8_H
#include <cassert>
typedef unsigned char uchar;
typedef unsigned long ulong;
namespace CUtf8 {
inline bool IS_IN_RANGE(uchar c, uchar f, uchar l) { return (((c) >= (f)) && ((c) <= (l))); }
inline ulong readNextChar(const std::string &str, int &pos, uint len) {
assert(pos >= 0... | true |
bb9f2036528a4d505a873ac0bfe0f5d953347acd | C++ | lzxysf/CC | /ds&algorithm/05_二叉树/01_二叉树_递归法.cpp | UTF-8 | 3,789 | 3.75 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
using namespace std;
typedef int DataType;
typedef struct Tree{
DataType data;//数据
struct Tree* left;//左子节点
struct Tree* right;//右子节点
}Tree;
//先序遍历
void pre_travel(Tree* tree)
{
//递归结束条件
if(tree == NULL)
{
return;
}
... | true |
4f9a03ac95dd928bc38de1465da7b5dce76f11ab | C++ | lattice133/hackerrank | /C/Small trangles large triangles.cpp | UTF-8 | 847 | 3.625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
struct triangle
{
int a;
int b;
int c;
};
double Calc_Area(triangle tr){
double p = (tr.a + tr.b + tr.c) / 2.0;
return p * (p-tr.a) * (p-tr.b) * (p-tr.c);
}
typedef struct triangle triangle;
void sort_by_area(triangle* tr, int n) {
/**
* Sort an array a... | true |
7bc047089758075191f245bae1e2474855c23339 | C++ | adityanjr/code-DS-ALGO | /GeeksForGeeks/DS/3. Array/17.maximum-and-minimum-in-an-array.cpp | UTF-8 | 749 | 3.890625 | 4 | [
"MIT"
] | permissive | // http://www.geeksforgeeks.org/maximum-and-minimum-in-an-array/
#include <iostream>
#include "array.h"
struct _pair {
int min;
int max;
};
struct _pair getMinMax(int *a, int start, int end){
int n=end-start+1;
if(n==1){
return {a[start], a[start]};
}
else if( n==2){
return {min(a[start], a[end]), max(a[s... | true |
3e43cf9038d43a8482ba68523efcbf20db19fd53 | C++ | gopalcdas/JLTi-Code-Jam | /ChoosingOranges.cpp | UTF-8 | 2,906 | 3.171875 | 3 | [] | no_license | //JLTi Code Jam Oct 2017
//https://gopalcdas.wordpress.com/2017/10/14/choosing-oranges/
#include <stdio.h>
#include <queue>
using namespace std;
struct Node
{
int score;
int index;
bool operator<(const Node& rhs) const
{
return score < rhs.score;
}
};
Node *BuildNodes(int *scores, int n);
int *BestSc... | true |
b0265de9bd95293578e7b764c587ad5bab709d3e | C++ | Loycine/Design-Pattern | /StatePattern/StatePatternOld.cpp | GB18030 | 1,908 | 2.96875 | 3 | [] | no_license | #include <iostream>
using namespace std;
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
class Context;
class State { // ״̬࣬һӿԷװContextһض״̬صΪ
public:
virtual void Handle(Context* c) = 0;
virtual ~State() {}
};
class Context { // άһConcreteStateʵʵΪǰ״̬
private:
State * state;
public:
Context(Stat... | true |
9ec92d833473bdc352cd568cd9e505a1119eec0d | C++ | VincentLLam/Class-with-File-Manipulation | /pay.cpp | UTF-8 | 1,163 | 3.546875 | 4 | [] | no_license | // Vincent Lam
// Section Number 3
#include "person.cpp"
#include <fstream>
#include <vector>
#include <iomanip>
void readData(vector<Person> &employees);
void writeData(vector<Person> &employees);
int main()
{
vector <Person> employees;
readData(employees);
writeData(employees);
return 0;
}
void readData(... | true |
73756a0e2933146340575ddbc6fb919ec1edd205 | C++ | abhishekanimatron/act_cpp | /trees/binary/maximumSumOfPaths.cpp | UTF-8 | 1,406 | 3.8125 | 4 | [] | no_license | #include <iostream>
#include <climits>
using namespace std;
struct Node
{
int data;
Node *left;
Node *right;
Node(int value)
{
data = value;
left = NULL;
right = NULL;
}
};
int maximumPathSumHelper(Node *root, int &answer)
{
if (root == NULL)
return 0;
/... | true |
5192d95eeac47c063ecbc61b15efd4b7cc61eaf3 | C++ | dbuksbaum/FreeOrion | /FreeOrion/universe/Tech.h | UTF-8 | 12,853 | 2.515625 | 3 | [] | no_license | // -*- C++ -*-
#ifndef _Tech_h_
#define _Tech_h_
#include <boost/serialization/shared_ptr.hpp>
#include "Enums.h"
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/key_extractors.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <set>
#include <string>
#include <vector>
#include <GG... | true |
add6c8ab720e2fcc96243498e02fc4c7adb50ebb | C++ | jtlai0921/AEL021700-Samplefiles | /C++程式設計解題入門-程式碼/ch8/8-3-2-可以插隊在任意位置.cpp | UTF-8 | 582 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <list>
using namespace std;
int main(){
int n,m,p,pos;
char cmd;
list<int> mlist;
list<int>::iterator it;
while(cin>>n>>m){
mlist.clear();
for(int i=1;i<=n;i++) mlist.push_back(i);
for(int i=1;i<=m;i++){
cin >> cmd;
if (cmd=='s') {
cout << mlist.fr... | true |
0da08fc529282c3ffd81256cddec149dab97413a | C++ | Natches/Drakkar-Engine | /Source/Serialization/Serializer.cpp | UTF-8 | 1,311 | 2.578125 | 3 | [] | no_license | #include <PrecompiledHeader/pch.hpp>
namespace drak {
namespace serialization {
void Serializer::FileDescriptor::writeToFile(std::fstream& file) {
file.seekp(0, std::ios::beg);
int size = (int)m_descriptor.size();
m_endPos = sizeof(int) * 2;
for (auto& x : m_descriptor)
m_endPos += (int)(x.first.first... | true |
c62dd83b9a9286d4e4a7c505a24050b8116db862 | C++ | dinushan/CHIP-8 | /CHIP-8/src/Chip8.cpp | UTF-8 | 10,019 | 2.6875 | 3 | [] | no_license | #include "Chip8.h"
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <ctime>
unsigned const char Chip8::FontSet[16*5] =
{
0xF0, 0x90, 0x90, 0x90, 0xF0, // 0
0x20, 0x60, 0x20, 0x20, 0x70, // 1
0xF0, 0x10, 0xF0, 0x80, 0xF0, // 2
0xF0, 0x10, 0xF0, 0x10, 0xF0, // 3
0x90, 0x90, 0xF0, 0x10, ... | true |
3b887a4a7e63157380b789b13af278240a908c16 | C++ | jaehooonjung/Reference | /c_c++/c++제출모음/RPG만들기 2/RPG만들기 2/RPG만들기 2/Character.cpp | UHC | 857 | 2.875 | 3 | [] | no_license | #include "Character.h"
Character::Character()
{
}
void Character::InfoSetUp(string Name, int Demage, int Hp, int MaxHp, int Gold, int Exp)
{
m_strName = Name;
m_iDemage = Demage;
m_iHp = Hp;
m_iMaxHp = MaxHp;
m_iGold = Gold;
m_iExp = Exp;
}
void Character::InfoShow(int Width, int Height)
{
m_MapDrawManager.... | true |
e42ac508fc444c22674d5b6435dc7c899ba31ae5 | C++ | frankzhangrui/MPI_FFT | /fft2d.cc | UTF-8 | 5,905 | 2.890625 | 3 | [] | no_license | // Distributed two-dimensional Discrete FFT transform
// YOUR NAME HERE
// ECE8893 Project 1
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <signal.h>
#include <math.h>
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include "Complex.h"
#include "Input... | true |
c7d8ce8f0bd06b5a9598d220b0cfdd7b6fa23b52 | C++ | shaolanqing/C-code | /mydev3.cpp | UTF-8 | 267 | 3.34375 | 3 | [] | no_license | #include<iostream>
using namespace std;
void swap(int &x,int &y)
{
int temp=x;
x=y;
y=temp;
}
int main()
{
int a,b;
cout <<"please intput two nums:"<<endl;
cin >>a>>b;
swap(a,b);
cout <<"swap:"<< a <<" "<< b <<endl;
system("pause");
return 0;
}
| true |
deb1d0cd3290ce49990457d59e074e2d27a8a17c | C++ | fiatveritas/Intro_to_C- | /In_Class/Week_4/LAB/ProblemSix.cpp | UTF-8 | 2,299 | 3.40625 | 3 | [] | no_license | //Written by: Jesse Gallegos
//Assignment: LAB WORK page 105 #6
//Date: 19 September 2018
/*Description: This program computes your gross income,
social security tax, federal tax, state tax,
union dues, healthcare tax, and net ... | true |
96eca70bb5699748f772164874bcd13b88c7933f | C++ | Brotin003/Programming | /C++ Tutorials/Tutorial18.cpp | UTF-8 | 475 | 3.75 | 4 | [] | no_license | // Selection control structure : IF else - if - else ladder
#include <iostream>
using namespace std;
int main()
{
int age;
cout << "Tell me your age" << endl;
cin >> age;
if (age < 18)
{
cout << "You can't come to my party" << endl;
}
else if (age == 18)
{
cout << "You a... | true |
cba5fc6f106132377aaf3393d5cdb8f0b1ae1d12 | C++ | gregjauvion/bio_simulation | /conception/simulation-algorithms/cpp-code-specific-model_repressilator_1/src/Cell.cpp | UTF-8 | 892 | 2.71875 | 3 | [] | no_license |
#include "Cell.hpp"
RanGen Cell::ran_gen = RanGen(0) ;
bool Cell::should_divide ()
{
if (V > target_V_div)
{
V_div = V ;
return true ;
}
return false ;
}
void Cell::choose_new_size ()
{
V_birth = V_div * ran_gen.norm (0.5,Parameters::sigma_size_split) ;
V = V_birth ;
}
void Cell::do_partitioning ()
{
d... | true |
0f18064b37bf71f885ade10b7ea687b4b20d2a02 | C++ | evenam/Synthadeus | /Synthadeus/Synthadeus/ux_comp/base/ButtonBase.h | UTF-8 | 1,697 | 3.046875 | 3 | [] | no_license | ////////////////////////////////////////////////////////////////////////////////
// //
// Button Base //
// Everett Moser ... | true |
7fe8f7dc9b07e82df1a458d5bd860876107f5c6f | C++ | jguoaj/intelligent-scissor | /Scissor/FibonacciHeap/fibtest.cpp | UTF-8 | 2,571 | 2.78125 | 3 | [] | no_license | //***************************************************************************
// FIBTEST.CPP
//
// Test program for the F-heap implementation.
// Copyright (c) 1996 by John Boyer.
// See header file for free usage information.
//***************************************************************************
#include <stdl... | true |
79ec84b874ede582174f3f9923ce2bc15896c8ef | C++ | ankitaaaaaaaaaa/project1 | /test.cpp | UTF-8 | 424 | 2.984375 | 3 | [] | no_license | #include<stdio.h>
/*int inc(int i){
static int c=0;
c=c+i;
return(c);
}
int main(){
int i,j;
for(i=0;i<=4;i++){
j=inc(i);
}
printf("%d",j);
return 0;
}
int main(){
int k=35, *z, *y;
y=z=&k;
printf("k = %d z = %p y = %p",k,z,y);
*z++= *y--;
k++;
printf("k = %d z = %p y = %p",k,z,y);
... | true |
b2a5eccc5076ad77acef5a8386241aeb7c130739 | C++ | ArunJayan/OpenCV-Cpp | /first_readDisplay.cpp | UTF-8 | 1,041 | 2.859375 | 3 | [] | no_license |
#include <iostream>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int main(int argc,const char** argv)
{
Mat img;//Mat datastructure stores image
img = imread("cat.jpg",CV_LOAD_IMAGE_GRAYSCALE);
//using imread() we can read image
//first argument is name of the image to be loaded... | true |
99df7285335e611641c04a2223eef3aa27d7ca8a | C++ | yimengfan/BDFramework.Core | /HybridCLRData/LocalIl2CppData-OSXEditor/il2cpp/libil2cpp/utils/PathUtils.h | UTF-8 | 2,985 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include "il2cpp-config.h"
#include <string>
#include "StringViewUtils.h"
namespace il2cpp
{
namespace utils
{
namespace PathUtils
{
std::string BasenameNoExtension(const std::string& path);
std::string PathNoExtension(const std::string& path);
template<typename CharType>
std::basic_stri... | true |
ff436a684c2026585ab329ced5e33c5140580b1e | C++ | HJiahu/learn_caffe_src | /read_caffe_vs2015/read_caffe_vs2015/caffe_src/caffe/layers/shuffle_channel_layer.cpp | GB18030 | 4,754 | 2.75 | 3 | [] | no_license | #include <algorithm>
#include <vector>
#include "caffe/layers/shuffle_channel_layer.hpp"
namespace caffe
{
template <typename Dtype>
void ShuffleChannelLayer<Dtype>::LayerSetUp (const vector<Blob<Dtype> *> &bottom, const vector<Blob<Dtype> *> &top)
{
group_ = this->layer_param_.shuffle_channel_pa... | true |
bb9bd788a5ca3af2076bdbb36b6e90929a79862b | C++ | lsthiros/cellular-automata | /CellularAutomataAlgorithm.cpp | UTF-8 | 443 | 2.703125 | 3 | [] | no_license | #include "CellularAutomataAlgorithm.hpp"
CellularAutomataAlgorithm::CellularAutomataAlgorithm(std::vector<int> born, std::vector<int> survive, int iterations) :
born(born), survive(survive), iterations(iterations) {
}
void CellularAutomataAlgorithm::runAlgorithm(CellularAutomataGrid &grid) {
for(int i = 0; i < ... | true |
5b84e59d6a30d161320dcdfb7c5f49c95a4d0053 | C++ | daniel-torquato/VRP | /src/Convexo/src/convexo.cpp | UTF-8 | 2,367 | 3.078125 | 3 | [] | no_license | #include <fstream>
#include <complex>
#include <vector>
typedef std::complex<double> point;
typedef std::vector<point> route;
typedef unsigned uint;
double sign( point A, point B) {
return (A.real()*B.imag()-A.imag()*B.real());
}
bool In( route V, point X) {
uint n=V.size();
for ( uint k=0; k<n-1; k++)
if ( si... | true |
d4c6a61dc041526969d39d6ba64f978f359ce06f | C++ | ayushchhabra/cpplearn | /generic_adjlist.cpp | UTF-8 | 2,116 | 3.296875 | 3 | [] | no_license |
#include<iostream>
#include<unordered_map>
#include<list>
#include<queue>
#include<map>
using namespace std;
template <typename T>
class Graph{
unordered_map<T,list<T> >adjlist;
public:
void addedge(T u,T v,bool bidir=true){
adjlist[u].push_back(v);
if(bidir){
adjlist[v].push_back(u);... | true |
2029ff7879b4c5e7421c82715d35796e8d65840f | C++ | WSU-Cpts322/snake-revisited-jramirez1989 | /Snake!Revisited Final Version/Snake.cpp | UTF-8 | 2,932 | 3.359375 | 3 | [
"MIT"
] | permissive | #include "Snake.h"
Snake::Snake()
{
Coordinates a = Coordinates(42, 20);
Coordinates b = Coordinates(41, 20);
Coordinates c = Coordinates(40, 20);
Coordinates d = Coordinates(39, 20);
Coordinates head = Coordinates(38, 20);
body.push_back(a);
body.push_back(b);
body.push_back(c);
body.push_back(... | true |
219f00b02d56259ffc7724a42d5342d729cb3651 | C++ | zonasse/Algorithm | /coding interview guide/链表/将单链表的每K个节点之间逆序.cpp | UTF-8 | 1,071 | 3.34375 | 3 | [] | no_license | //
// Created by 钟奇龙 on 2019-04-16.
//
#include <iostream>
#include <stack>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(int x):data(x),next(NULL){
}
};
//将栈内节点顺序连接并返回链表尾节点
Node* resignStack(stack<Node*> &node_stack,Node* left, Node* right){
Node *cur = node_stack.top();
... | true |
308b66bd710e8de026be3a2b4883748367a2253e | C++ | lsiddiqsunny/Leetcode-solve | /September Challange/Maximum XOR of Two Numbers in an Array.cpp | UTF-8 | 665 | 2.828125 | 3 | [] | no_license | class Solution
{
public:
int findMaximumXOR(vector<int> &arr)
{
int maxx = 0, mask = 0;
int n = arr.size();
set<int> se;
for (int i = 31; i >= 0; i--)
{
mask |= (1 << i);
for (int i = 0; i < n; ++i)
{
se.insert(arr[i... | true |
eb2ab000c3720f8919e59fa4d1663f7c4e36b29c | C++ | LucasM127/Stuff-I-Don-t-Want-To-Lose | /Moonlander/Observer.hpp | UTF-8 | 417 | 2.765625 | 3 | [] | no_license | #ifndef OBSERVER_HPP
#define OBSERVER_HPP
//public domain...
class Observer
{
public:
virtual ~Observer(){}
virtual void onNotify() = 0;
};
class Subject
{
public:
Subject():m_observer(nullptr){}
virtual ~Subject(){}
inline void setObserver(Observer *observer){m_observer = observer;}
inline vo... | true |
6a4f928daf58db4bd4e26e111198d69dcef15122 | C++ | ndhuanhuan/MLinAction | /295. *Find Median from Data Stream.cpp | UTF-8 | 813 | 3.46875 | 3 | [] | no_license | //http://www.cnblogs.com/jcliBlogger/p/4893468.html
//https://www.hrwhisper.me/leetcode-find-median-from-data-stream/
最大堆取最大,最小堆取最小
class MedianFinder {
priority_queue<int> small, large;
public:
// Adds a number into the data structure.
void addNum(int num) {
if (!large.empty() && -large.top() < num)
large.pu... | true |
8bbbce5f7cdd1c6f065244f084cf05996dd09da6 | C++ | adamfowleruk/cppexamples | /release/src/TestClasses.hpp | UTF-8 | 1,007 | 3.125 | 3 | [
"Apache-2.0"
] | permissive | #include <string>
namespace mltests {
using namespace std;
/*
* ANTI PATTERN
*/
class StringReference {
public:
StringReference();
void setString(std::string& strRef);
std::string& getString();
private:
std::string str;
};
/*
* ANTI PATTERN
*/
class StringHolder {
public:
StringHolder(std::string s);
std:... | true |
af2ce70bdcc487c3ae13a68f6826a53dec485023 | C++ | ricaun/esp32-lora-serial | /esp32-lora-serial/pbutton.ino | UTF-8 | 1,312 | 2.84375 | 3 | [
"MIT"
] | permissive | //----------------------------------------//
// pbutton.ino
//
// created 03/06/2019
// by Luiz Henrique Cassettari
//----------------------------------------//
// update 28/06/2019
// add button time to turn off wifi
//----------------------------------------//
#define BUTTON 0
#define BUTTON_MODE_MAX 2
#define... | true |
75f48a0d759eec61283a7e12f5bfd75a48d00052 | C++ | Junkmen/HackFMI | /main.cpp | UTF-8 | 911 | 2.859375 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include "GameObject.hpp"
int main(){
SDL_Window* window = (SDL_Window*)nullptr;
SDL_Renderer* renderer = (SDL_Renderer*)nullptr;
SDL_CreateWindowAndRenderer(0, 0, SDL_WINDOW_FULLSCREEN_DESKTOP, &window, &renderer);
bool running = false;
if(window != (SDL_Wi... | true |
3efc6eed0a5f706290e2d25c30e400d7d9057b56 | C++ | NuriYuri/LiteRGSS | /ext/LiteRGSS/CTone_Element.h | UTF-8 | 886 | 2.640625 | 3 | [] | no_license | #ifndef CTONE_ELEMENT_H
#define CTONE_ELEMENT_H
#include <SFML/Graphics.hpp>
#include "CViewport_Element.h"
class CTone_Element {
private:
sf::Glsl::Vec4 tonevalues;
CViewport_Element* target_ = nullptr;
public:
CTone_Element() = default;
~CTone_Element() {
if(target_ != nullptr) {
target_->bindTone(... | true |
89ee4bd127e631b64bccbc2d3db29f4551d99aad | C++ | dwentzel/bounce | /headers/importer/imported_model.h | UTF-8 | 1,646 | 2.609375 | 3 | [] | no_license | #ifndef BOUNCE_IMPORTER_IMPORTED_MODEL_H_
#define BOUNCE_IMPORTER_IMPORTED_MODEL_H_
#include <memory>
#include <vector>
#include "imported_material.h"
namespace bounce {
class ImportedModelImpl;
class ImportedModel {
private:
ImportedModelImpl* impl_;
ImportedModel(const Imp... | true |
28ada8a47925e90f4efba4ad24077bbfa840b216 | C++ | m-karcz/pythonpp | /helpers/contains-helper.h | UTF-8 | 1,186 | 3.109375 | 3 | [] | no_license | #pragma once
#include <algorithm>
#include <type_traits>
namespace helper
{
template<typename... Ts> struct make_void { typedef void type;};
template<typename... Ts> using void_t = typename make_void<Ts...>::type;
template<typename Container, typename = void_t<>>
struct hasFindMemberFn : std::false_type
{};
templa... | true |
4074ccadb5ed587a7cb58d3dd89314abef4cf811 | C++ | 1143910315/mimabaoguan | /list.cpp | UTF-8 | 462 | 2.796875 | 3 | [
"Artistic-2.0"
] | permissive | #include "list.h"
/*
list::list()
{
}
list::list(T data)
{
indata=data;
}
*/
template <class T>
list<T>::list()
{
}
template <class T>
list<T>::list(T data)
{
indata=data;
}
template <class T>
bool list<T>::ru(T data)
{
if(next==nullptr){
next=new list(data);
}else{
list temp=next;
while (temp.ne... | true |
d7ed5d8d6c9665a629451d96597c428148d5044d | C++ | ancapantilie/data-structures-and-algorithms-hw2 | /DsaHW2/doubly-linked-linear-list.h | UTF-8 | 5,740 | 3.609375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
template<typename T> struct list_elem
{
T info;
struct list_elem<T> *next, *prev;
};
template <typename T> class LinkedList
{
public:
struct list_elem<T> *pfirst, *plast;
void addFirst(T x)
{
struct list_elem<T... | true |
325a016e6fdd9a8dfa0ab340c83dab9df0088117 | C++ | reimeytal/pong | /src/paddle/paddle.cpp | UTF-8 | 2,502 | 2.5625 | 3 | [] | no_license | #include <gml/gml.hpp>
#include <gl/glew.h>
#include <cstdint>
#include "../shader/shader.hpp"
#include "../vertex.h"
#include "../entity/entity.hpp"
#include "../bounding-box/bounding-box.hpp"
#include "paddle.hpp"
#define PONG_PADDLE_SPEED 6.f
unsigned int pong::Paddle::vbo = 0;
unsigned int pong::Paddle::ibo = 0;... | true |
75903dd1103d78ccccb504a6b3df9a17ebb56a4e | C++ | ggharibian/Graphing-Calculator-C | /SFML Graphing Calculator/!includes/Queue/Queue_Test_Functions.cpp | UTF-8 | 6,806 | 3.78125 | 4 | [] | no_license | #include "Queue_Test_Functions.h"
Queue<int> getAscendingQueue()
{ //Returns an ascending Queue.
Queue<int> q;
for (int i = 1; i <= 10; i++)
q.Push(i * 10);
return q;
}
Queue<int> getDecendingQueue()
{ //Returns an decending Queue.
Queue<int> q;
for (int i = 10; i >= 1; i--)
q.Push(i * 10);
return q;
}
... | true |
23b95e2e1c82189a4a9d36aedc030fff472d85c9 | C++ | GaoLF/Leetcode | /Spiral Matrix .cpp | UTF-8 | 1,643 | 2.828125 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<vector>
#include <cctype>
#include<algorithm>
#include<math.h>
using namespace std ;
typedef struct ListNode{
int val;
ListNode * next;
} ListNode;
class Solution {
public:
vector<int> spiralOrder(vector<vector<int> > &matrix) {
vector<int> res;
int col,row=m... | true |
f8d70f7dcfd0ae6f33d1efc3b548e488141e13cd | C++ | carlushuang/kernel-launcher-amdgpu | /src/main.cpp | UTF-8 | 4,313 | 2.625 | 3 | [] | no_license | #include "hsa_backend.h"
#include <random>
#include <math.h>
#include <iostream>
#include <string>
#include <stdio.h>
int asm_kernel(){
int rtn;
backend * engine = new hsa_backend();
rtn = engine->init_backend();
if(rtn) return -1;
std::cout<<"engine init ok"<<std::endl;
hsa_dispatch_param d_... | true |
333bf68169a1922e2d18ac02516607efa938d82a | C++ | foxox/afdtd | /FDTD3D/foxmath3.h | UTF-8 | 2,046 | 2.703125 | 3 | [] | no_license | #ifndef FOXMATH3H
#define FOXMATH3H
#include <math.h>
static const float PI = (float)3.1415926535897932384626433832795;
static const float DEG2RAD = (float)0.01745329251994329576923690768489;
static const float RAD2DEG = (float)57.295779513082320876798154814105;
typedef unsigned int uint;
#ifdef __cplusplus
namespa... | true |
aae6011ab3c4952fb1dae49e4d39f5daddb8b7b8 | C++ | Masters-Akt/CS_codes | /leetcode_sol/1441-Build_An_Array_With_Stack_Operations.cpp | UTF-8 | 429 | 2.734375 | 3 | [] | no_license | class Solution {
public:
vector<string> buildArray(vector<int>& target, int n) {
vector<string> ans;
int j = 1;
for(int i=0;i<target.size();i++){
if(target[i]==j){
ans.push_back("Push");
}else{
ans.push_back("Push");
ans... | true |
1044ed522a9d3a1775f2856293ccba54fe560c11 | C++ | GuilhermeCaetano/DarkLight-Engine-3 | /Branch_Master/Dark Light Engine 3/DarkLightEngine3/include/Shader/cShader.cpp | UTF-8 | 914 | 2.640625 | 3 | [] | no_license | // cShader.cpp
#include <Shader\cShaderManager.h>
// the shader class itself is kinda big, so we'll separate it from the manager class
cShaderManager::cShader::cShader()
{
this->shaderType = cShader::eShaderTypes::UNKNOWN;
this->shaderID = -1;
return;
}
cShaderManager::cShader::~cShader()
{
return;
}
std::str... | true |
52f1471d1bededd85aa6041e8ac1d5bc292a1dbc | C++ | th3or14/semaphore | /tests.cpp | UTF-8 | 3,518 | 3.09375 | 3 | [] | no_license | #include "tests.hpp"
namespace {
template <typename T>
class SemaphoreInterface
{
public:
SemaphoreInterface(size_t passing_limit);
void adjust_passing_limit(size_t limit);
void wait();
void signal();
private:
T impl;
};
class Semaphore2
{
public:
explicit Semaphore2(size_t passing_limit = 1... | true |
954bde0e737c2f6c4c183c525952f615124a2205 | C++ | DSFlare/Anthill | /Anthill/Graphic/Mesh.cpp | WINDOWS-1251 | 1,495 | 2.90625 | 3 | [] | no_license | #include "Mesh.h"
Mesh::Mesh(vector<Vertex> vertices, vector<unsigned int> indices, sf::Texture *texture)
{
this->vertices = vertices;
this->indices = indices;
this->texture = texture;
setupMesh();
}
void Mesh::Draw(Shader shader)
{
glEnable(GL_TEXTURE_2D);
sf::Texture::bind(texture);
//
glBindVertexArr... | true |
be46fbabba38ea577c6730a13576c2edc740c2d1 | C++ | Olysold/Space-Invaders---SFML | /include/Invaders.h | UTF-8 | 1,793 | 2.9375 | 3 | [] | no_license | #ifndef INVADERS_H_INCLUDED
#define INVADERS_H_INCLUDED
#include <SFML\Graphics.hpp>
#include <SFML\Audio.hpp>
#include "AnimatedSprite.h"
#include "Bullets.h"
#include <vector>
#include <list>
#include <memory>
class Invaders
{
public:
typedef std::vector<std::vector<AnimatedSprite>> InvaderMatrixVec;
type... | true |
7d8f6919a1954890fc48985ec19441754db210ab | C++ | Mvalverde00/Graphing-Calculator-3D | /src/chunk.cpp | UTF-8 | 4,022 | 3.09375 | 3 | [] | no_license | #include "chunk.h"
#include <iostream>
#include <vector>
#include <Engine/src/math/vectors.h>
float graphing_func(float x, float y) {
//return 5*sin(x/2.0 + y/2.0);
//return -1.0;
return sin(x * 3.1415926) + sin(y * 3.1415926);
//return x * x + y * y;
}
Chunk::Chunk(float startX, float startY, float endX, fl... | true |
0882c59943c353d69802c655db15747df57dcb59 | C++ | Vlad-Stelea/RBE2002FinalProject | /src/SubSystems/DriveTrain.h | UTF-8 | 3,699 | 2.71875 | 3 | [] | no_license | /*
* DriveTrain.h
*
* Created on: Dec 8, 2018
* Author: vlads
*/
#ifndef SRC_SUBSYSTEMS_DRIVETRAIN_H_
#define SRC_SUBSYSTEMS_DRIVETRAIN_H_
#include "../Components/HBridgeEncoderPIDMotor.h"
#include "../Components/FireTracker.h"
#include "../Components/Gyro.h"
#include <list>
class DriveTrain {
public:
str... | true |
795ceb558fd3ecc1ece43f7412ad19c43acac101 | C++ | JoaoPedro1221/JogoVelha_CPP | /JogoVelha.cpp | UTF-8 | 4,709 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
using namespace std;
char Tabuleiro[3][3];
int xpts=0, opts=0;
bool Marcar ( char Simbolo, int linha, int coluna)
{
if (Tabuleiro[linha][coluna] == ' ')
{
Tabuleiro[linha][coluna] = Simbolo;
return true;
}
return false;
}
void Mostra ()
{
cou... | true |
dfacddc6b6d5c2e5654fc8fe6c538255a5cc61b3 | C++ | EricVaughanOVR/SparseStereo | /demo/main.cpp | UTF-8 | 2,112 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include "SparseStereo.hpp"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/features2d/features2d.hpp>
using namespace cv;
static void help( char** argv )
{
std::cout<<"\nUsage: "<<argv[0]<<"[path/to/image1] [path/to/image2] [Max Hammi... | true |
ab441303e6b576107f7b34c33846e2bace8e87af | C++ | wzor/GrinPlusPlus | /src/Core/Models/FullBlock.cpp | UTF-8 | 648 | 2.671875 | 3 | [
"MIT"
] | permissive | #include <Core/Models/FullBlock.h>
FullBlock::FullBlock(BlockHeader&& blockHeader, TransactionBody&& transactionBody)
: m_blockHeader(std::move(blockHeader)), m_transactionBody(std::move(transactionBody)), m_validated(false)
{
}
void FullBlock::Serialize(Serializer& serializer) const
{
m_blockHeader.Serialize(seri... | true |
bd0126f155bd3baf056b730d152f62b3c8caf3ec | C++ | TerensTare/tnt | /include/utils/BitFlags.hpp | UTF-8 | 2,739 | 3.234375 | 3 | [
"MIT"
] | permissive | #ifndef TNT_UTILS_ENUM_CLASS_BIT_FLAGS_HPP
#define TNT_UTILS_ENUM_CLASS_BIT_FLAGS_HPP
#include <type_traits>
namespace tnt
{
// thx Anthony Williams for all of the content of this header.
// https://blog.bitwigglers.org/using-enum-classes-as-type-safe-bitmasks/
template <typename T>
concept enum_type... | true |
e15595d8de10990b0b78773cf29c1e6f3f18afd6 | C++ | PuppyQ08/data_structure | /potd-q27/TreeNode.cpp | UTF-8 | 569 | 3.0625 | 3 | [] | no_license | #include "TreeNode.h"
#include <cstddef>
#include <iostream>
using namespace std;
TreeNode::TreeNode() : left_(NULL), right_(NULL) { }
int TreeNode::getHeight() {
int leftHeight = -1, rightHeight = -1;
if(this->left_ != NULL)
leftHeight = this->left_->getHeight();
if(this->right_ != NULL)
rightHeig... | true |
4e4d15897a01feb3da901fb63193c34fb4cddb3e | C++ | AKL-FIRE/Algorithm | /Chapter6 Divide and Conquer/main.cpp | UTF-8 | 213 | 2.578125 | 3 | [] | no_license | /*
* main.cpp
*
* Created on: Oct 3, 2017
* Author: apple
*/
#include "Algorithm.hpp"
int main()
{
int a[5] = {3,5,2,1,6};
int min,max;
minmax(0,4,a,min,max);
std::cout << min << " " << max;
}
| true |
5efdaef7de5faa752fa3784d41b9757d124324e3 | C++ | johannesugb/origin_of_cg_base | /framework/include_stst/vulkan_attribute_description_binding.h | UTF-8 | 720 | 2.609375 | 3 | [
"MIT"
] | permissive | #pragma once
#include "vulkan_context.h"
class vulkan_attribute_description_binding
{
public:
vulkan_attribute_description_binding(uint32_t binding, uint32_t stride, vk::VertexInputRate inputRate);
~vulkan_attribute_description_binding();
void add_attribute_description(uint32_t location = 0, vk::Format format = v... | true |
e48a4b047b1069157d38189b5d83fa44cbb496ae | C++ | lipskydan/Project_Qt_2019 | /MusicQuiz/musicquiz.cpp | UTF-8 | 3,715 | 2.9375 | 3 | [] | no_license | #include "musicquiz.h"
MusicQuiz::MusicQuiz()
{
qsrand(time(NULL));
melody = nullptr;
QuantityOFSongs = 5;
CountLevel = 1;
CountGood = 0;
CountBad = 0;
UsedNumber = false;
FirstTime = true;
NumberOfPossibleAnswer = "0";
NumberOfTrueAnswer = "0";
}
void MusicQuiz::CleanInfo(){... | true |
433c570885bae888cfb41605d20917456c53e621 | C++ | valikl/remote-translator | /Utils/BB_Window.h | UTF-8 | 514 | 2.5625 | 3 | [] | no_license | #pragma once
#include <windows.h>
#include <string>
#include "IRunnable.h"
class BB_Window : public IRunnable
{
public:
BB_Window(std::wstring windowClassName, std::wstring title, HWND hEffectiveWnd);
~BB_Window(void);
// the thread procedure
virtual void run();
HWND BBGetHandle() { return m_hWn... | true |
74f644779755eb88be1b578c3daf404e8abe8b80 | C++ | rafalgrzeda/Multiliga | /src/administator.cpp | UTF-8 | 2,228 | 2.875 | 3 | [] | no_license | #include "administator.h"
#include "okno_paneladministratora.h"
#include "listakontuzytkownikow.h"
#include <QDebug>
Permanentny *Administator::getPerm()
{
return perm;
}
void Administator::setPerm(Permanentny *value)
{
perm = value;
}
Administator::Administator(Uzytkownik *uzyt)
:Uzytkowni... | true |
11eab3525af9976b11f1fec5d44e949d58fa2391 | C++ | 1292765944/ACM | /表达式求值.cpp | UTF-8 | 2,108 | 2.84375 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <stack>
#include <vector>
#define N 1000100
typedef long long ll;
using namespace std;
char s[N];
int len;
vector<char>out;
stack<char>sta;
const int mod=1000000007;
void gotOper(char opThis,int prec1){
while(!sta.empty()){
char opTop=sta.top();
... | true |
b8ab26c5366020e10fb54b9efa8439819b365bf0 | C++ | foobarna/OOP | /lab6-8/src/domain/MovieRepository.h | UTF-8 | 800 | 2.796875 | 3 | [] | no_license | /*
* MovieRepository.h
*
* Created on: May 1, 2012
* Author: Aneta
*/
#ifndef MOVIEREPOSITORY_H_
#define MOVIEREPOSITORY_H_
#include "Movie.h"
#include "Exceptions.h"
#include <vector>
namespace domain
{
class MovieRepository
{
public:
virtual Movie* findByTitle(string title) = 0;
... | true |
cb9915e623b3badd8240e19188d5544c34ca6957 | C++ | tuan2195/subset-sum | /tool.cpp | UTF-8 | 1,083 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <random>
int main(int argc, char** argv)
{
if (argc != 4)
{
std::cout << "Usage: ./tool <sampleSize> <limit> <outputFile>" << std::endl;
exit(1);
}
auto sampleSize = std::stoi(argv[1]);
auto limit = std::stoi(argv[2]);
if (sample... | true |
c6566bf62b8e3d46ceb144f5f2e37dfd938df2b3 | C++ | sanjeev1102/cpp_program | /c++Training_harman/Day1/009Location.cpp | UTF-8 | 1,294 | 3.265625 | 3 | [] | no_license | #include<iostream>
using std::cout;
using std::endl;
namespace nm9
{
class CA
{
bool IsOnHeap;
static int count;
public:
CA() :IsOnHeap(true)
{
count--;
if (count < 0)
IsOnHeap = false;
}
static void* operator new(std::size_t size)
{
CA* temp = (CA*)malloc(size);
coun... | true |
3b8d7c2ed9d6cf0e27652f9f5559191f2f0fe69a | C++ | wwqqqqq/LeetCode-Solution | /First Missing Positive.cpp | UTF-8 | 2,097 | 3.109375 | 3 | [] | no_license | class Solution {
public:
void insert(vector<pair<int,int>>& intervals, int e) {
// intervals is sorted in ascending order
for(int i = 0; i < intervals.size(); i++) {
if(intervals[i].second >= e && intervals[i].first <= e) {
return; // e has already appeared in nums
... | true |
a15cb910d0c0ed01383bbd6ee73cc3137f07a154 | C++ | mchalupa/dg | /include/dg/ADT/SetQueue.h | UTF-8 | 844 | 3.0625 | 3 | [
"MIT"
] | permissive | #ifndef DG_ADT_SET_QUEUE_H_
#define DG_ADT_SET_QUEUE_H_
#include "Queue.h"
#include <set>
namespace dg {
namespace ADT {
// A queue where each element can be queued only once
template <typename QueueT>
class SetQueue {
std::set<typename QueueT::ValueType> _queued;
QueueT _queue;
public:
using ValueTyp... | true |
42c8ff18f4cbb751555243ae2559ce4dcebcd077 | C++ | ArSoto/guia9 | /main.cpp | UTF-8 | 2,366 | 3.453125 | 3 | [] | no_license | #include <iostream>
#include <time.h>
#include "Busqueda.h"
using namespace std;
int main(int argc , char *argv[]) {
/**
* validacion de parametros de entrada
* */
char eleccion;
if(argc == 1){ //Valida la cantidad de parametros de entrada
eleccion = *argv[1];
}else{ /... | true |
f4fbcaa4c0d64325283c843c154fdf6374b9cc1c | C++ | mcerv/tbConverter | /src/converters/waveform.h | UTF-8 | 753 | 2.515625 | 3 | [] | no_license | #ifndef __WAVEFORM_H_DEFINED__
#define __WAVEFORM_H_DEFINED__
#include <iostream>
#include <iomanip>
#include <stdint.h>
#include <string>
#include <vector>
#include "TGraph.h"
using namespace std;
class Waveform
{
public:
Waveform(
vector<float>, //time vector
vector<float> //amplitude vector
);
~W... | true |
f0f1250bfc32209994e4b5a719a096f326057518 | C++ | inbarizrael/Assignment1Project | /include/Customer.h | UTF-8 | 1,621 | 3.21875 | 3 | [] | no_license | #ifndef CUSTOMER_H_
#define CUSTOMER_H_
#include <vector>
#include <string>
#include "Dish.h"
class Customer{
public:
Customer(std::string c_name, int c_id);
virtual std::vector<int> order(const std::vector<Dish> &menu)=0;
virtual std::string toString() const = 0;
std::string getName() const;
int ... | true |
0c9e3cb778349ed2483d5112e83d8cf80c62da9a | C++ | Ciaran-byte/Cpp | /03 Cpp Primer/17 标准库特殊设施/17-9 随机数基本用法.cpp | UTF-8 | 323 | 2.734375 | 3 | [] | no_license | #include<iostream>
#include<random>
using namespace std;
int main()
{
default_random_engine e;
for (size_t i = 0; i < 10; ++i)
{
cout << e() << endl;
}
uniform_int_distribution<unsigned> u(0, 9);
cout << endl;
for (size_t i = 0; i < 10; i++)
{
cout << u(e) << endl;
}
return 0;
}
... | true |
b4c9da17cc5eedf8b52926df16f1da87d677b6da | C++ | naxo100/PExKa | /src/util/Exceptions.cpp | UTF-8 | 1,819 | 2.75 | 3 | [] | no_license | /*
* Exceptions.cpp
*
* Created on: Aug 16, 2016
* Author: naxo
*/
#include <sstream>
#include <cstring>
#include "Exceptions.h"
using namespace std;
SemanticError::SemanticError(const string &str,const yy::location &l)
: msg(), loc(l) {
strcpy(msg,str.c_str());
}
const char* SemanticError::what() co... | true |
d367657ad1a299350c8e2c3d0a60184064363a39 | C++ | zeroengineteam/ZeroCore | /ZeroLibraries/Platform/Windows/Process.cpp | UTF-8 | 11,571 | 2.71875 | 3 | [
"MIT"
] | permissive | ///////////////////////////////////////////////////////////////////////////////
///
/// \file Process.hpp
/// Declaration of the Process class and support functions.
///
/// Authors: Trevor Sundberg / Joshua T. Fisher / Chris Peters
/// Copyright 2015, DigiPen Institute of Technology
///
//////////////////////... | true |
aa13ab5862046dab816d2d70912ceb9c099beb4e | C++ | mrbratchenko/CPP_bootcamp | /d04/ex00/Peon.cpp | UTF-8 | 1,417 | 2.65625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Peon.cpp :+: :+: :+: ... | true |
8def17d25ce8460ed50d3c7ba26b6baf15ef5a3a | C++ | dsbeach/GliderScoreRemote | /Source/Raspbian/udpTelemetrySender/UdpSender.cpp | UTF-8 | 2,378 | 2.84375 | 3 | [
"MIT"
] | permissive | /*
* UdpSender.cpp
*
* Created on: Jan 28, 2018
* Author: dbeach
*/
#include "UdpSender.h"
UdpSender::UdpSender(int port) {
// for testing at home I want to send the datagrams to all available interfaces!
this->udpPort = port;
udpHandle = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
int enable=1;
sets... | true |
17518e8231839cdd3ac027d30e58a82b7dc0d7db | C++ | abdulabbas/CSC-5 | /Assignments/A6/Savitch_Chapter6/Savitch_Ch6_9thEd_Prac_Program2/main.cpp | UTF-8 | 980 | 3.203125 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Abdul-Hakim
* Purpose: Assignment 6
* Created on July 24, 2015, 11:43 AM
*/
//System Libraries
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;
//User Libraries
//Global Constants
//Function Prototypes
void rmBlk(ifstream& , ofstre... | true |
48022c18be10efca6679a0e96bd7d7e67d8bb823 | C++ | cyxsourcetree/chen-yixin | /第九周/7.16.cpp | UTF-8 | 394 | 2.765625 | 3 | [] | no_license | #include "stdafx.h"
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int sum[36000] = {0};
int a, b;
int count = 0;
for (size_t i = 0; i < 36000; i++)
{
a = rand() % 6 + 1;
b = rand() % 6 + 1;
sum[i] = a+b;
if (sum[i]==7)
{
count++;
}
printf("%d %d %d %d\n", i,a,b, s... | true |
de4d7b543a7861540413ee3eaaa68d1634f3bb37 | C++ | dotnet/dotnet-api-docs | /snippets/cpp/VS_Snippets_CLR/cryptography.Xml.EncryptedData2/CPP/encrypteddata.cpp | UTF-8 | 1,768 | 3.03125 | 3 | [
"MIT",
"CC-BY-4.0"
] | permissive |
//<SNIPPET4>
#using <System.Xml.dll>
#using <System.Security.dll>
#using <System.dll>
using namespace System;
using namespace System::Security::Cryptography::Xml;
using namespace System::Xml;
using namespace System::IO;
/// This sample used the EncryptedData class to create a EncryptedData element
/// and write it ... | true |
128f63183d7f26cd02e08540e9f408bc51ead3c0 | C++ | schuay/mcsp | /src/sequential/sequential.cpp | UTF-8 | 1,839 | 3 | 3 | [] | no_license | #include "sequential.h"
#include <memory>
using namespace graph;
using namespace sp;
Sequential::
Sequential(const Graph *graph,
const Node *start)
: graph(graph), start(start)
{
}
ShortestPaths *
Sequential::
shortest_paths()
{
ShortestPaths *sp = new ShortestPaths();
PathPtr init(new Path(... | true |
d5edc8f63c66a98309167523396457a1711397d3 | C++ | tienthanght96/Directx_Game_2016 | /Castlevania_Game/m2dxanimatedsprite.cpp | UTF-8 | 2,584 | 2.71875 | 3 | [] | no_license | #include "m2dxanimatedsprite.h"
M2DXAnimatedSprite::M2DXAnimatedSprite() { }
M2DXAnimatedSprite::~M2DXAnimatedSprite() { }
bool M2DXAnimatedSprite::initWithTexture(LPCSTR textureName)
{
setTexture(M2DXResourceManager::getInstance()->getTextureByName(textureName));
if (!getTexture())
{
return false;
}
auto in... | true |
833f7e160f28d046306c7e06d5da2ea84c5ff678 | C++ | AditiShrivastava/COURSEWORK-IIITH | /EXAM/GAURAV-GRAPHS/DFS_connected_components.cpp | UTF-8 | 2,357 | 3.8125 | 4 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
vector <int> adj[10]; //vector of 10 integers which has the name adj. the number of elements is optional in a vector
bool visited[10]; // vector of boolean data type to keep track of the nodes we have visited
void dfs(int s)
{
visited[s]=true; // making th... | true |
20d0ebdf296aed5454397721d990d4533ad3ab78 | C++ | deerlu/leetcode | /AddTwoNumbers/main.cpp | UTF-8 | 1,650 | 3.4375 | 3 | [] | no_license | #include <iostream>
using namespace std;
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode *addTwoNumbers(ListNode *l1, ListNode *l2) {
ListNode *head = NULL, *r;
ListNode *p = l1, *q = l2;
... | true |
c9d582438b2de63202d7db2435fbb06e237fecac | C++ | Giusepp3/class-pacco | /class_pacco.1484758449.cpp | ISO-8859-1 | 3,903 | 2.703125 | 3 | [] | no_license | #include "class_pacco.h"
namespace posta{
pacco::pacco(){
codice = 0;
peso = 0.0;
indirizzo = new char[1];
strcpy(indirizzo,"");
}
pacco::pacco(const int cod, const float pes, const char* ind){
codice = cod;
peso = pes;
indirizzo = new char [strlen(ind)+1];
strcpy(indirizzo,i... | true |
5d09a3ca8c07e14aee17c842fa205156783c9d03 | C++ | awesomemachinelearning/ELL | /libraries/nodes/include/ConstantNode.h | UTF-8 | 12,024 | 2.546875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Project: Embedded Learning Library (ELL)
// File: ConstantNode.h (nodes)
// Authors: Chuck Jacobs
//
////////////////////////////////////////////////////////////////////////////////////////////////////
#... | true |
c7e15b658df86cf56e06d7e0e86ae206cc8bfd39 | C++ | JaatSoft/LightsOff | /src/Grid.h | UTF-8 | 678 | 2.71875 | 3 | [
"MIT"
] | permissive | #ifndef GRID_H
#define GRID_H
#include <vector>
#include <SupportDefs.h>
typedef std::vector<int8> grid;
// The Grid class performs data handling and translation for the lights
// themselves and also makes it easy to write a level to disk. :)
class Grid
{
public:
Grid(int8 dimension);
void SetDimension(int8 dime... | true |
1c9ffada2a0f1364fafd9e6c7d70fa5d7da350a8 | C++ | lcarlso2/GroupHWordScramble | /utils/Utils.cpp | UTF-8 | 1,124 | 3.359375 | 3 | [] | no_license | #include "Utils.h"
const string toTime(const int value)
{
string minutes;
string seconds;
string time;
minutes = to_string(value / MINUTE_MULTIPLIER);
seconds = to_string(value % MINUTE_MULTIPLIER);
if (seconds == "0")
{
seconds = "00";
}
else if (seconds.length() == ONE_DI... | true |
15e858f542b22eb2784ea7ac06622ccc7b383784 | C++ | Katyapuchkova1/Competitions | /Campus.cpp | UTF-8 | 694 | 3.1875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int blockflats, blockfloor, floor, floorsbefore, x, y, k, n;
cout << "Write the number of flats in the kratnye floors" << endl;
cin >> x;
cout << "Write the number of flats in the non-kratnye floors" << endl;
cin >> y;
cout << "Write the number of floors" <<... | true |
4bdb2e5291a23235c6847a213c3636999cedbc6f | C++ | yunyu-Mr/myLeetcode | /cpp/one/a073.cpp | UTF-8 | 872 | 3.046875 | 3 | [] | no_license | class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
int m = matrix.size();
if (m == 0) return;
int n = matrix[0].size();
unordered_set<int> row, col; // hash table.
// Find those rows and columns that should be zero.
for (int i ... | true |
d113ecfa329ffe00cb8cafb5a91d94600d3d392e | C++ | waterjf/panna | /pnEditor/pnUndoRedo.cpp | GB18030 | 13,905 | 2.515625 | 3 | [] | no_license | #include "precomp.h"
#include "pnUndoRedo.h"
#include "pxShapeBase.h"
pnUndoRedo::pnUndoRedo()
{
}
pnUndoRedo::~pnUndoRedo(void)
{
Clear();
}
void pnUndoRedo::RecordAction( ActionType at, const shape_list& releated_shapes, int ActionBlockNr)
{
if(releated_shapes.GetCount() > 0)
{
//clear redo actions
ClearRed... | true |
e93ac4bc2fdf448ecf907b95766074eeb590965d | C++ | Joey-Liu/online-judge-old-version | /数据结构编程实验/8_1_2again/8_1_2again/源.cpp | WINDOWS-1252 | 1,316 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <string>
#include <list>
#include <stdio.h>
using namespace std;
struct Tman
{
string name;
Tman *f;//ָ
list<Tman* > son;//ָ
Tman()
{
f = NULL;
}
};
map<string,Tman*> hash_;
Tman* root;
void print(int dep,Tman* now)
{
if(NULL== now) return;
for(int i = 1;i <= de... | true |
28c55fa4eeb7da57411f83fb90f4fb9c21e4183b | C++ | skyrimax/CppXtractLib | /CppXtractLib/CppXtractLib/FST.cpp | ISO-8859-1 | 6,015 | 3.234375 | 3 | [] | no_license | #include "FST.h"
#include "State.h"
#include "Reader.h"
#include "FileReader.h"
#include "StringReader.h"
#include "Writer.h"
#include "FileWriter.h"
#include "StringWriter.h"
#include "ScreenWriter.h"
#include "Transition.h"
// 1) Implanter le destructeur
FST::~FST()
{
for (auto const & s : mStates)
{
delete s;... | true |