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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
55adf32824451ed46b49d47af0f7e647975960d0 | C++ | SteveDCronin/NodeEmitterPublic | /node-steve.cc | UTF-8 | 2,025 | 2.53125 | 3 | [] | no_license | #include "node-steve.h" //interface file
#include <v8.h>
#include <node.h>
using namespace v8;
using namespace node;
static int showDebugMessages = 1;
static Persistent<String> sym_emit;
SteveNode::SteveNode() : ObjectWrap() {
if (showDebugMessages==1) printf("\nSteveNode - Constructor");
this->steve = n... | true |
dab3f57799f61f575e7f779c0b37a91fdcf49f68 | C++ | xanatower/Ard | /joy_stick.ino | UTF-8 | 1,618 | 2.75 | 3 | [] | no_license | // Module KY023
// For more info see http://tkkrlab.nl/wiki/Arduino_KY-023_XY-axis_joystick_module
int JoyStick_X = A0; // x
int JoyStick_Y = A1; // y
int JoyStick_Z = 3; // key
int mapped_x = 0;
int mapped_y = 0;
//servo stuffs
#include <Servo.h>
Servo myservo;
Servo myservo1;// create servo object to control a ser... | true |
5c59edfa64cc0647dd379b6cd9b501b072ed2cc5 | C++ | paul-hc/DevTools | /CommonUtl/utl/Registry.h | UTF-8 | 10,701 | 2.546875 | 3 | [] | no_license | #ifndef Registry_h
#define Registry_h
#pragma once
#include <atlbase.h>
#include "Registry_fwd.h"
#include "ErrorHandler.h"
namespace reg
{
bool WriteStringValue( HKEY hParentKey, const TKeyPath& keySubPath, const TCHAR* pValueName, const std::tstring& text );
bool DeleteKey( HKEY hParentKey, const TKeyPath& keyS... | true |
e8c4e78e359ca72abe0c5badbd9e0fad44061590 | C++ | jcstange/Arduino | /display7_pcf8574_banheira/display7_pcf8574_banheira.ino | UTF-8 | 3,456 | 2.546875 | 3 | [] | no_license | #include <Wire.h>
long cont = 0;
int tempsensor = 0;
int tempwanted = 25;
void setup() {
for (int i=2; i<=13; i++) {
pinMode(i, OUTPUT);
digitalWrite(i,0);
}
pinMode (A0,INPUT);
Serial.begin(9600);
Wire.begin(); // Join I2C bus
}
void loop() {
temp_sensor();
if (digitalRead(6)==HIGH || digitalR... | true |
5341e5abcc2c0787df5e02ab0d6e7ce0b783aa5c | C++ | harrynull/MemoryPool | /MemoryPool/src/Allocators.h | UTF-8 | 2,749 | 3.4375 | 3 | [
"MIT"
] | permissive | #ifndef ALLOCATORS_H__
#define ALLOCATORS_H__
class MemoryPool;
template <class T, size_t Size>
class FixedMemoryPool;
// Allocators for memory pools
template <class T>
class Allocator
{
public:
using value_type = T;
using pointer = T*;
using size_type = size_t;
using difference_type = ptrdiff_t;
u... | true |
54edf435f7c16a82d93f2482fb9fc048d738f23d | C++ | mepranav/OOPS_ONE_SHOT_REVISION | /CODE/constructor.cpp | UTF-8 | 595 | 3.78125 | 4 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
class student
{
public:
string name;
int age;
int roll_no;
student(string s , int a , int r)
{
name = s;
age = a;
roll_no = r;
}
//parameterized constructors
void print_info()
{
... | true |
22775f123e9ea5a3f725ae91cdb752d4fb516c9c | C++ | heldercostaa/lab-programacao-course | /classes/class-11/main.cpp | UTF-8 | 1,676 | 3.328125 | 3 | [] | no_license | //
// main.cpp
// class-11
//
// Created by Helder Costa (github: heldercostaa) on 30/04/19.
// Copyright © 2019. All rights reserved.
//
#include <iostream>
#include <cstring>
#include <random>
void printar_array(const char* i, int tam) {
for (const char* q = i; q != i + tam; q++) {
*q < 10 ? std::cout << "... | true |
34cd06fa65d7cd035897e1ab08892af5a809a34f | C++ | Anatoliuz/Dijkstra | /Dijkstra.cpp | UTF-8 | 976 | 2.578125 | 3 | [] | no_license | //
// Dijkstra.cpp
// Dijkstra(version 2)
//
// Created by fix on 13/12/15.
// Copyright (c) 2015 Anatoly Filinov. All rights reserved.
//
#include "Dijkstra.h"
void Dijkstra( char* argv[])
{
int vertextNum = 0;
int s = 0;
T_vec vec;
std::ofstream fout(argv[2]);
vec = ReadData(argv, &vertextNum... | true |
944abef64f9d9afe1a2c8977a1055337a2653056 | C++ | mansi35/Programmers-Community | /Data Structure/Array Or Vector/Find the Missing Number/SolutionByAditya.cpp | UTF-8 | 517 | 3.25 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using namespace std;
int findMissingNumber(vector<int> inputArray, int numberOfElements) {
int missingNumber = numberOfElements + 1;
for(int i = 0; i < numberOfElements; i++)
missingNumber ^= inputArray[i] ^ (i + 1);
return missingNumber;
}
int main() {
int numberOfElements = 0;
cin... | true |
00e2ec96c33c3b626e361051a91b34293c5d0eba | C++ | miselaytes-anton/electro-pumpkin | /src/dsp/Smooth.cpp | UTF-8 | 542 | 3.171875 | 3 | [] | no_license | // Exponential smoothing filter
// init with coeff, for me 0.05 is normal
// set initial value via setValue(some reading from sensor)
// in update loop call updateValue and folowing getValue for filtered
class Smooth {
private:
float _value;
float _coeff;
public:
// coeff [0..1] if near to zero filter more iner... | true |
7c81e4b2aa1978de2d7719e59299189a8b756f63 | C++ | shivral/cf | /0800/90/894a.cpp | UTF-8 | 598 | 3.09375 | 3 | [
"Unlicense"
] | permissive | #include <iostream>
#include <string>
#include <vector>
void answer(size_t v)
{
std::cout << v << '\n';
}
void solve(const std::string& s)
{
const size_t n = s.length();
std::vector<size_t> pf(n);
for (size_t i = 0; i < n; ++i) {
if (i > 0)
pf[i] = pf[i-1];
if (s[i] == 'Q... | true |
408465ad55ca928831eb7259e99116440ea95a16 | C++ | RohitKumar-200/CompetitiveProgramming | /LoveBabbarList/13_Kadane_algorithm.cpp | UTF-8 | 847 | 3.984375 | 4 | [] | no_license | // Given an array arr of N integers. Find the contiguous sub-array with maximum sum.
// https://practice.geeksforgeeks.org/problems/kadanes-algorithm-1587115620/1
#include <bits/stdc++.h>
using namespace std;
// Function to find subarray with maximum sum
// arr: input array
// n: size of array
int maxSubarraySum(int ... | true |
b58758054a3e9c0862400c3243a5760ff497969d | C++ | NNikonov/MAI_OOP | /Lab2/TBinTree.cpp | UTF-8 | 3,090 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
//#define DEBUG 1
#include "TBinTree.h"
TBinTree::TBinTree()
{
root = nullptr;
}
void TBinTree::Insert(const TItem& val)
{
if (root == nullptr)
root = new TNode(val);
else
{
TNode *currNode = root;
TNode *leafNode = nullptr;
while (currNode != nullptr)
{
leafNod... | true |
2a2361f6d2ee557cc8041f97e143c800c4d899a5 | C++ | bestyuan/Chest-CAD | /cadx/src/util/Boundary.cpp | UTF-8 | 3,758 | 2.71875 | 3 | [] | no_license |
#include "Boundary.h"
using namespace CADX_SEG;
void Boundary::initialize() {
boundaryList.clear();
imgCols = 0;
imgRows = 0;
minCol = LONG_MAX;
maxCol = LONG_MIN;
minRow = LONG_MAX;
maxRow = LONG_MIN;
}
void Boundary::mapToBoundary(IemTImage<unsigned char>& img) {
boundaryList.... | true |
e8ffe807ff7d352a06de680ead129b90d1430d1b | C++ | WIZARD-CXY/pp | /1035.cpp | UTF-8 | 1,755 | 3.015625 | 3 | [] | no_license | /*************************************************************************
> File Name: 1035.cpp
> Author:
> Mail:
> Created Time: Tue 28 Oct 2014 09:35:34 PM CST
************************************************************************/
#include<iostream>
#include<cstdio>
using namespace std;
#include<vector>
... | true |
95b2b34fd532336015494e836c6f6a473943e435 | C++ | FakeEngine/FakeMath | /FakeMath/FakeMath/tests/Vec2/Vector2LengthTest.cpp | UTF-8 | 1,153 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | #include "Vector2LengthTest.h"
#include "../../src/Core/Test.h"
namespace FakeVector2Tests
{
int test_length()
{
FakeVec2f v(32.0f, 23.0f);
float expectedLength = 39.4081f; // sqrt(32 * 32 + 23 * 23) -> sqrt(1553) -> 39.40812099047606
FakeTimer timer("FakeVector2Tests::test_length");
float result = v.Leng... | true |
ebcda43b1731545c57da79fc189d3cac39445ff1 | C++ | EldelPelo/Ciencias1 | /ArbolArreglo.cpp | UTF-8 | 2,072 | 3.625 | 4 | [] | no_license | //Arbol binario como arreglo
#include <iostream>
using namespace std;
struct Nodo{
int dato;
int izq,der;
};
class ArbolBinOrd{
int tamanio;
Nodo *nodo;
//Metodos
public:
ArbolBinOrd(int);
int getRaiz();
void setRaiz(int);
int nuevo();//Crea un nodo
void libre(int);//Libera una posicion
int agregar(... | true |
0c14a02588d79b72460f77228b4effd43439d705 | C++ | brinkqiang2cpp/douzero_cpp | /cpp/train.cpp | UTF-8 | 16,894 | 2.59375 | 3 | [] | no_license | #include <csignal>
#include <iostream>
#include <fstream>
#include <filesystem>
#include <ctime>
#include <cmath>
#include "data_loop.h"
using std::printf;
namespace fs = std::filesystem;
struct Config {
string xpid = "douzero";
int save_interval = 30;
string objective = "adp";
vector<string> actor_dev... | true |
4e4306c316a43120d4fb1595d7848530fcfd801a | C++ | harskish/Doodle | /src/Optimizer.h | UTF-8 | 684 | 2.765625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <fstream>
#include "SDL.h"
#include "Utils.h"
/*
Base class for an optimization algorithm
*/
class Optimizer
{
public:
Optimizer(SDL_Surface const *reference);
~Optimizer();
// Run optimizer for one iteration
virtual bool step() = 0;
// Poll (and eventually show) cu... | true |
a6e36689e20e3060fd2d58c210ca9db3bf85a104 | C++ | darkhader/LTU15 | /20201/data-structure-and-algorithm/fibo.cpp | UTF-8 | 247 | 3.0625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int fibo(int n)
{
if (n == 1 || n == 2)
return 1;
else
return fibo(n - 1) + fibo(n - 2);
}
int main()
{
for (int i = 1; i < 10; i++)
{
int fi = fibo(i);
printf("%d ", fi);
}
} | true |
8493401d31f72b603f67f89902bdc109aef44405 | C++ | markus456/peliohjelmointi | /defenceSolution/defence/Bullet.h | UTF-8 | 514 | 2.75 | 3 | [] | no_license | #ifndef BULLET_H
#define BULLET_H
#include "SDL.h"
#include "Sprite.h"
class Bullet : public Sprite {
private:
double dir, speed;
unsigned int damage;
public:
Bullet(void);
~Bullet(void);
virtual void draw(SDL_Renderer* rndr);
virtual void update();
void setDirection(double direction, double s... | true |
033a197cdfb24cadc3d60dea2a69b988e3b47271 | C++ | PawelAdamczuk/pooker | /utils.h | UTF-8 | 821 | 3.09375 | 3 | [] | no_license | //
// Created by Janusz Grzesik on 01.02.2017.
//
#ifndef POOKER_CONSTANTS_H
#define POOKER_CONSTANTS_H
#include <vector>
using namespace std;
enum RoundPhase {
preflop = 0, flop, turn, river
};
template<class T>
class CyclicIterator{
private:
vector<T> *vec;
typename vector<T>::iterator it;
public:
... | true |
6d5eebfb54081cd7f78ea9ddc163bc34d0f24a64 | C++ | pavluntiy/Third-Attempt | /data.cpp | UTF-8 | 3,653 | 2.953125 | 3 | [] | no_license | #include "data.hpp"
Data::Data(istream &in):
in(in)
{
//wasEof = false;
ready = false;
currentPosition = -1;
previousPosition.push(0);
currentChar = '\n';
badCharacters = "";
errorOccured = false;
}
bool Data::wasError(){
return this->errorOccured;
}
string Data::getErrorReport(){
this->errorO... | true |
95a66710c490258930afe74ad1c324ec07238510 | C++ | Merci24Dec/unitech_cpp_with_oops-course | /programs_AtoZ/Bubble Sort/Array_after_Each_Sort.cpp | UTF-8 | 601 | 3.515625 | 4 | [
"Unlicense"
] | permissive | // Print Array after Each Sort
#include<iostream>
using namespace std;
int main()
{
int i, arr[10], j, temp;
cout<<"Enter 10 Elements: ";
for(i=0; i<10; i++)
cin>>arr[i];
cout<<endl;
for(i=0; i<9; i++)
{
for(j=0; j<(10-i-1); j++)
{
if(arr[j]>arr[j+1])
... | true |
13e34e3f95fe65fd61ca1768f3623b2e3b5bc430 | C++ | octopus0110/Products | /calculator.cpp | UTF-8 | 11,057 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP2(i, m, n) for (int i = (m); i < (int)(n); ++i)
#define REPR(i, n) for (int i = (n)-1; i >= 0; --i)
#define REPR2(i, m, n) for (int i = (n)-1; i >= (m); --i)
#define REPx... | true |
c2306d650f1b31753fa157a84fcc169b024033d6 | C++ | lx999/Plurinote | /relations/bidirectionalrelationship.h | UTF-8 | 2,403 | 3.09375 | 3 | [] | no_license | #ifndef BIDIRECTIONALRELATION_H
#define BIDIRECTIONALRELATION_H
#include <QString>
#include "relationship.h"
#include "relationsmanager.h"
#include "association.h"
template<typename T> class Relationship;
template<typename T> class Association;
template<typename T>
class BidirectionalRelationship : public Relationsh... | true |
dcdab1a13cd6304f2eb43303d7ba25c9cd210dea | C++ | bonventre/BTrk | /BTrk/Dch/DchGeomBase/include/DchCellAddr.hh | UTF-8 | 1,646 | 2.5625 | 3 | [] | no_license | #ifndef DCHCELLADDR_HH
#define DCHCELLADDR_HH
//--------------------------------------------------------------------------
//
// Environment:
// This software was developed for the BaBar collaboration. If you
// use all or part of it, please give an appropriate acknowledgement.
//
// Copyright Information:
... | true |
9063ee2701e66e574bbb1a656f0bdb15a8c1bfd0 | C++ | team-compilers/compilers | /homework1/inc/Expression.h | UTF-8 | 2,066 | 2.96875 | 3 | [
"MIT"
] | permissive | // Author: Alexey Zhuravlev
// Description: Expression Interface and it's implementations
#pragma once
#include <Visitor.h>
#include <VisitorTarget.h>
#include <string>
class IExpression : public IVisitorTarget {
};
//-----------------------------------------------------------------------------------------------//
... | true |
ac3e9d34ee01a050537e05917699d6aaf43f1a86 | C++ | httpc/hw | /ControlStructures/Power/main.cpp | WINDOWS-1251 | 585 | 2.84375 | 3 | [] | no_license | #include<iostream>
using namespace std;
//#define POWER
void main()
{
setlocale(LC_ALL, "");
#ifdef POWER
double a; //
int n; //
double N = 1;//
/*unsigned int b = -3;
cout << b << endl;
cout << UINT_MAX << endl;*/
cout << " c : "; cin >> a;
cout << " : "; cin >> n;
if (n < 0)
{
a = 1 / a;
n = ... | true |
c7eee9e81285f9824631347d797d1a8ec2aefdc7 | C++ | ThorStark/ROSPong | /src/pong_ball/src/pong_ball.cpp | UTF-8 | 4,513 | 2.578125 | 3 | [
"MIT"
] | permissive | /*****************************************************************************
* @file pong_main.cpp
*
* @author Thor Stark Stenvang
* thor.stark.stenvang@gmail.com
* @version 0.00
* @date 2017-09-07 YYYY-MM-DD
******************************************************************************/
#include<cmath>... | true |
f5a878e55c1a697d2b69d30af99e0e3f4c3d9181 | C++ | mylvoh0714/BOJ | /13415.cpp | UTF-8 | 1,222 | 2.765625 | 3 | [] | no_license | #include <cstdio>
#include <algorithm>
#include <queue>
#include <utility>
using namespace std;
int arr[100004];
int ans[100004];
int main()
{
int n; scanf("%d", &n);
for ( int i = 0; i < n; i++ ) scanf("%d", arr + i);
int k; scanf("%d", &k);
int max_v = 0;
deque<pair<int, int>> dq;
for ( int i = 0; i < k; ... | true |
5b29315456e37e195f904846b90943f1fdc2c580 | C++ | akshatdevp/Competitive | /HditDistance.cpp | UTF-8 | 654 | 3.171875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int minDistance(string word1, string word2) {
if(word1.empty()||word2.empty())return max(word1.size(),word2.size());
int x=word1.size();
int y=word2.size();
int dp[x+1][y+1];
for(int i=0;i<x+1;i++)
for(int j=0;j<y+1;j++)
{
... | true |
41099f3b2bb8ef568a81cc65cda31ad685ef5bc0 | C++ | steplee/matching-benchmarks | /src/quad/quad.h | UTF-8 | 1,190 | 2.890625 | 3 | [] | no_license | #pragma once
#include <Eigen/StdVector>
#include <Eigen/Core>
template <int Cap, class V>
struct Leaf {
int occupancy;
Eigen::Vector2f keys[Cap];
V vals[Cap];
void init();
};
template<int Cap, class V>
class Quad {
private:
// Top left and bot right
Eigen::Vector2f tl;
... | true |
d8c3003ec1a34f4e9ee09f6e74231d7eece59003 | C++ | daBisNewBee/NativeProject | /cpp/basic.cpp | UTF-8 | 8,558 | 3.375 | 3 | [] | no_license | //
// Created by Salmon on 2018/11/18.
//
extern "C"{
#include "xinda.h"
}
#include <iostream>
using namespace std;
namespace com_xmly_native {
class Person {
public:
Person() {
name = new char[16];
cout << "Person构造" << endl;
}
virtual ~Person() {
... | true |
a9287f1dee8d45a75fa27e26939a05570e1519ee | C++ | gsz/codejam | /cj2010/3-A/DeRNGed.cpp | UTF-8 | 2,378 | 2.75 | 3 | [] | no_license | #include <everything.h>
using namespace std;
struct Eratosthenes {
vector<i64> ps;
Eratosthenes(int upto);
};
Eratosthenes::Eratosthenes(int upto) {
vector<bool> sieve(upto+1, true);
int max_relevant = static_cast<int>(floor(sqrt(upto)));
for (int p = 2; p <= max_relevant; ++p) {
if (!si... | true |
ebef2a5c15a8d2c52702fee3cb11b3d24b52c273 | C++ | wgfi110/cpp-playground | /cpp-htp/standard/ch21solutions/Ex21_10/Ex21_10.cpp | UTF-8 | 2,329 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | // Exercise 21.10 Solution: ex21_10.cpp
#include <iostream>
#include <iomanip>
using namespace std;
void displayBits( unsigned ); // prototype
unsigned power2( unsigned, unsigned ); // prototype
int main()
{
unsigned number;
unsigned pow;
unsigned result;
cout << "Enter two integers: ";
... | true |
96430b5af5b778abfc96b1b4ce04e9548ecc53eb | C++ | Susuo/rtilabs | /files/asobiba/Banana/RNeoIFStreamUtil.h | SHIFT_JIS | 2,933 | 2.53125 | 3 | [] | no_license | // RNeoIFStreamUtil.h: RNeoIFStreamUtil NX̃C^[tFCX
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_RNEOIFSTREAMUTIL_H__99BC3921_D3F0_4FA2_BEDD_93AA770FD785__INCLUDED_)
#define AFX_RNEOIFSTREAMUTIL_H__99BC3921_D3F0_4FA2_BEDD_93AA770FD785__INCLUDED_
#if _MSC_VER > 1000
#pragma... | true |
72ca7dbf85278f0817ede9002dad483eb1651b2f | C++ | anthony-leclerc/arcade | /include/loader/DLLoader.hpp | UTF-8 | 3,782 | 2.546875 | 3 | [] | no_license | /*
** DLLoader.hpp for in /home/anthony/documents/repository/cpp/cpp_arcade
**
** Made by Anthony LECLERC
** Login <anthony.leclerc@epitech.net>
**
** Started on Mon Mar 6 15:26:39 2017 Anthony LECLERC
** Last update Sun Apr 9 17:22:22 2017 Sylvain Chaugny
*/
#ifndef ARCADE_BOOTSTRAP_DLLOADER_HPP
# define ARCADE... | true |
babebafaa2fb2dfbf96a3a2f6f6fb982f1581026 | C++ | gaopj/leetcode | /leetcode101_150/107_Binary Tree Level Order Traversal II/源.cpp | UTF-8 | 1,022 | 2.796875 | 3 | [] | no_license | #include<stdio.h>
#include<vector>
#include<queue>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
vector<vector<int>> res;
vector<int> res0;
queue<TreeNode*> q;
queue<int> l;
v... | true |
6f6ba5982fbcbeb2352e1af324087c66a95e36f2 | C++ | ysun94/myQuantLib | /Matrix.h | UTF-8 | 378 | 2.953125 | 3 | [] | no_license | #pragma once
#include <iostream>
class Matrix
{
private:
int nrows;
int ncols;
double* data;
double* endPointer;
public:
Matrix();
Matrix(int nrows, int ncols);
Matrix(const Matrix& other);
~Matrix();
inline int nRows() const;
inline int nCols() const;
inline double get(int i, in... | true |
a024ab12fcd8dc2567111fe75a2673708ee6ff64 | C++ | ellismi/C-labs | /C++ labs (base)/lab4_gr/Animal.h | UTF-8 | 161 | 2.546875 | 3 | [] | no_license | #pragma once
class Animal
{
public:
int age;
char name[20];
int weight;
Animal();
Animal(int age, char* name, int weight);
void voice();
void info();
};
| true |
170dda2e2fc6c683566e996e9e0dde804119d98f | C++ | Sayardiss/arduino-projects | /Le grand livre d'Arduino - Eyrolles/Fichiers de travail/Montage10/DetecteursLumiere/DetecteursLumiere.ino | UTF-8 | 961 | 3.03125 | 3 | [] | no_license | /*
Auteur : Erik Bartmann
Nom : Des détecteurs de lumière
Version : 1.0
Références : http://arduino.cc/en/Reference/PinMode
http://arduino.cc/en/Reference/Constants
http://arduino.cc/en/Reference/For
http://arduino.cc/en/Reference/DigitalWrite
... | true |
30159d4fb8ce06aaf73f11e3c897b199b8ba4d2d | C++ | Dchment/Data-Structure | /树.cpp | GB18030 | 962 | 3.609375 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
typedef struct node{
int data;
struct node *lchild;
struct node *rchild;
}*tree;
int count=0;
void createtree(tree &t){//һҪ&ΪҪtĵֵַָֹиı䣡
int i;
scanf("%d",&i);
if(i==0){
t=NULL;
}
else{
t=(tree)malloc(sizeof(node));
t->data=i;
count++;
createtree(t->... | true |
6b9951ba48baca030e93d88b916a7a4dc72e0d84 | C++ | griby/ray-tracing-series | /ray-tracing-series/src/camera.cpp | UTF-8 | 1,693 | 3.03125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /**
* MIT License
* Copyright (c) 2019 Guillaume Riby <guillaumeriby@gmail.com>
*
* GitHub repository - https://github.com/griby/ray-tracing-series
*
* A ray tracer implementation based on the Ray Tracing in One Weekend Book Series by Peter Shirley - https://raytracing.github.io/
*/
#include "camera.h"
#includ... | true |
8078c8b61a2659e3d1474746f5ff327b6f6a5956 | C++ | mvodya/big-sort-collection | /cocktail-sort/cocktail.cpp | UTF-8 | 1,535 | 3.484375 | 3 | [
"MIT"
] | permissive | #include <ctime>
#include <iostream>
#include <random>
#include "bigsortlib/visualm.h"
using namespace sortlib;
// Elements count
#define N 200
// Array
int arr[N];
// Swaping two elements
void swap(int a, int b, int* m) {
int tmp = m[a];
m[a] = m[b];
m[b] = tmp;
}
// Cocktail sorting
void cocktail(int* m) {... | true |
398ced47ffc14fc9a16f83200eac5f6138e884cf | C++ | ElMurte/MCBURGER | /Model/database.h | UTF-8 | 2,503 | 2.6875 | 3 | [] | no_license | #ifndef DATABASE_H
#define DATABASE_H
#include "Model/product.h"
#include "Model/burger.h"
#include "Model/sweet.h"
#include "Model/patatine.h"
#include "Model/drink.h"
#include "Model/manager.h"
#include "Model/menu.h"
#include<vector>
#include "Model/Dlist.h"
#include<QJsonObject>
#include<QJsonArray>
#include<QJsonD... | true |
e4f8f3e2b46a8c3d90fc1a77e2b6291e581a996c | C++ | Thecarisma/serenity | /Libraries/LibCore/CSocket.cpp | UTF-8 | 3,774 | 2.640625 | 3 | [
"BSD-2-Clause"
] | permissive | #include <LibCore/CNotifier.h>
#include <LibCore/CSocket.h>
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <unistd.h>
CSocket::CSocket(Type type, CObject* parent)
: CIODevice(parent)
... | true |
39953c6b085fc4d9a8f5d937ba12e298fd7c63bc | C++ | MartinMedek/reversible-sketch | /src/Sketch.h | UTF-8 | 2,830 | 2.90625 | 3 | [] | no_license | //
// Created by medek on 7.3.17.
//
#ifndef SKETCH_SKETCH_TABLE_H
#define SKETCH_SKETCH_TABLE_H
#include <array>
#include <algorithm>
#include <list>
#include <cstdint>
#include "SketchTable.h"
#include "BIV.h"
#include "misc_functions.h"
class Sketch
{
public:
std::array<SketchTable *, TABLE_COUNT> tables;
... | true |
77e3a4823163967aa6bde9f5beb4103d87fb4655 | C++ | ravikishore1993/Spoj | /EQBOX.cpp | UTF-8 | 504 | 2.53125 | 3 | [] | no_license | #include<stdio.h>
main()
{long long int a,b,c,d,e,f,g;
scanf("%lld",&g);
while(g>0)
{
scanf("%lld %lld %lld %lld",&a,&b,&c,&d);
if((c*d)>=(a*b))
printf("Box cannot be dropped.\n");
else
if((c>=b && c>=a) || (d>=b && d>=a))
{if((a*a+b*b)<=(c*c+d*d))
... | true |
fbe08e685bdd12de465e4508cec5137ddbc3b64b | C++ | PavloNaichuk/Projects | /AirHockey/EnemyStrikerRenderer.cpp | UTF-8 | 1,123 | 2.515625 | 3 | [] | no_license | #include "pch.h"
#include "EnemyStrikerRenderer.h"
#include "GameObject.h"
#include "PositionComponent.h"
#include "RadiusComponent.h"
EnemyStrikerRenderer::EnemyStrikerRenderer(SharedRenderer renderer, SharedResourceManager resourceManager)
: mRenderer(renderer)
, mTexture(resourceManager->GetTexture(ResourceManage... | true |
c8f5192bdd7211b6f3b67c62b93f013cbc41c0d6 | C++ | lordjaxom/schlazicontrol | /trackable.cpp | UTF-8 | 2,291 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include "trackable.hpp"
using namespace std;
namespace sc {
namespace detail {
/**
* class TrackableTracker
*/
void TrackableTracker::announce()
{
++count_;
}
void TrackableTracker::forget()
{
--cou... | true |
8214649936224bfdcdff8af32d050293779bac7d | C++ | flpdsc/basic_algorithm | /cpp/30.cpp | UTF-8 | 433 | 2.734375 | 3 | [] | no_license | //3의 개수는? (large)
#include <iostream>
using namespace std;
int main()
{
int n, lt, cur, rt, k=1, res=0;
cin >> n;
while(lt != 0){
lt = n/(k*10);
cur = n/k%10;
rt = n%k;
if(cur > 3){
res += (lt+1)*k;
}
else if(cur < 3){
res += lt*k;
... | true |
7c0335017188d76f879d4ea1695f34f4de4728c7 | C++ | pureexe/SCSU-compro1 | /exercise/mid56_1/p3_3_best_avail_box.cpp | UTF-8 | 1,009 | 2.640625 | 3 | [
"MIT"
] | permissive | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int in[3],n,i,sum[] = {0,0,0,0},cnt[] = {0,0,0,0},remain[4],cType;
cin >> n;
cin >> remain[1] >> remain[2] >> remain[3];
for(i=0;i<n;i++){
cin >> in[0] >> in[1] >> in[2];
sort(in,in+3);
if(in[0]<=8 && in[1]<... | true |
2ece93608908e63e881a7b734207d9fea5fba351 | C++ | sssrdezh/Cpp-Primer | /Chapter 003/Exercise 011/main.cpp | GB18030 | 371 | 3.640625 | 4 | [] | no_license | /*
ϰ3.11ķΧforϷϷcʲô
*/
#include <iostream>
#include <string>
using std::string;
using std::cout;
using std::endl;
int main()
{
const string s = "Keep out!";
for (auto &c : s)
{
cout << c;
}
cout << endl;
return 0;
}
/*
cõֵϷcģΪconst char &.
*/ | true |
e8dd11aa36436d25e411af18434a3f535da2277d | C++ | kittu9999/CPU-schedules-and-N-process | /kittu os project.cpp | UTF-8 | 11,662 | 2.84375 | 3 | [] | no_license | //MULTILEVEL FEEDBACK QUEUE
#include <stdio.h>
#include <stdlib.h>
#include <queue>
using namespace std;
struct process
{
int processid;
int arrival_time;
int burst_time;
int priority;
int time_left;
int starting_time;
int end_time;
};
//r... | true |
a378beced171c9d6dfee43576aea8d18d499b1c9 | C++ | ruogudu/pagelevelcache | /scripts/tochart.cpp | UTF-8 | 1,206 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <map>
#include <fstream>
#include <algorithm>
using namespace std;
int main(int argc, char **argv) {
string curType = string(argv[2]);
string curAlgo = string(argv[3]);
ifstream fin;
fin.open(argv[1]);
string type;
string algo;
long siz... | true |
5f68eed37aa4fd93a278f4f013dd076dffc6cc3c | C++ | vespa-engine/vespa | /vdslib/src/vespa/vdslib/state/state.h | UTF-8 | 2,992 | 3.234375 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
* @class vdslib::State
*
* Defines legal states for various uses. Split this into its own class such
* that we can easily see what states are legal to use in what situations.
* They double as node states no... | true |
043e6c6a8d443f93e182fcc7e6f6b183ae47d546 | C++ | sologyan/CPP | /area_of_circle.cpp | UTF-8 | 209 | 3.171875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
float a, radius;
cout<<"enter the radius";
cin>>radius;
a = 3.14 * radius * radius;
cout<<"Area of circle ="<<a;
return 0;
} | true |
98a2178e91069d8ab08d3cfc256a502ba499feaf | C++ | wowangki/Study | /Game/Puzzle/D2DFramework_v0.0006/Module/Timer/TimerModule.h | UTF-8 | 655 | 2.5625 | 3 | [] | no_license | #pragma once
class TimerModule
{
private:
bool isHardware;
float timeScale;
float timeElapsed;
__int64 _periodTime;
__int64 _lastTime;
__int64 _curTime;
unsigned long frameRate;
unsigned long FPSFrameCount;
float FPSTimeElapsed;
float worldTime;
public:
TimerModule();
~TimerModule();
void UpdateTime(f... | true |
c8865dab91cfc98b3c65f44552a343f2931b7a4d | C++ | yalaudah/CtCI-6th-Edition-cpp | /Ch 1.Arrays And Strings/isUnique.cpp | UTF-8 | 587 | 3.59375 | 4 | [] | no_license | #include <string>
#include <vector>
#include <iostream>
bool isUnique(const std::string &word)
{
if (word.size() > 127)
return 0;
std::vector<bool> char_set(128); //
for(const char c: word)
{
if (char_set[static_cast<int>(c)])
return false;
else
char_set[c] = true;
}
... | true |
624a90d2335f4d83655ed4becf6adca778691145 | C++ | kiselyovanat/Haffman | /haffman.cpp | UTF-8 | 3,439 | 3.21875 | 3 | [] | no_license | #include <stdio.h>
#include <iostream>
#include <fstream>
#include <list>
#include <iterator>
#include <vector>
using namespace std;
struct Node
{
int pos;//вероятность символа
char c;//cам символ
Node *left;//указатель на левого сына(для дерева)
Node *right;//указатель на правого сына(для дерева)
};
struct C... | true |
aded8558abc8f9e6153862594b53b251d0bcd742 | C++ | juseqidai/Make-Wearable-Electronics | /MWE_Ch06_AnalogInput/MWE_Ch06_AnalogInput.ino | UTF-8 | 522 | 3.140625 | 3 | [] | no_license | /*
Make: Wearable Electronics
Analog Input example
*/
// initialize variable for light sensor reading
int lightSensorValue = 0;
// initialize variable for light sensor pin
int lightSensorPin = A2;
void setup() {
// initialize serial communication at 9600 bps
Serial.begin(9600);
}
void loop() {
// read pin a... | true |
85f0a2ace55deb0d8a1630ac030bcb3f9e85f158 | C++ | RobbeVG/SeaCore | /SeaCore/Source/Resources/Loaders/FontManager.cpp | UTF-8 | 707 | 2.5625 | 3 | [] | no_license | #include "SeaCore_pch.h"
#include "FontManager.h"
#include <SDL_ttf.h>
FontManager::FontManager()
: m_FontSize(12)
{
// load support for fonts, this takes a while!
if (TTF_Init() != 0)
throw std::runtime_error(std::string("Failed to load support for fonts: ") + SDL_GetError());
}
FontManager::~FontManager()
{
... | true |
e0bc119e4eb9868b5f17729f2c5ea510660afd09 | C++ | neattools/neattools | /util/JDate.h | UTF-8 | 2,381 | 2.546875 | 3 | [] | no_license | #if !defined( _JDate_h )
#define _JDate_h
#include "JObject.h"
#include "JDate.hpp"
class
#include "JBase.hpp"
JDate : public JObject {
protected:
virtual void writeContent(class JOutputStream& os);
virtual void readContent(class JDictionary& dict);
public:
static double constant;
static char* wee... | true |
7e1684a9eec876753bfb59109792cb0b8621f0bd | C++ | leejinho/c-language | /private/test.cpp | UTF-8 | 236 | 2.90625 | 3 | [] | no_license | #include <stdio.h>
void main()
{
int time, fare;
printf("주차시간(분)을 입력하고 Enter>");
scanf("%d", &time);
if(time%10==0)
{
fare=(time/10)*1000;
}
else
{
fare=(time/10+1)*1000;
}
printf("주차요금= %d원",fare);
}
| true |
9eb0fa5d2fa2fd70a107b5b22c0c2f47f5b13a0a | C++ | polezhaev-ds/made_2019_cpp | /04/Matrix.h | UTF-8 | 2,880 | 3.09375 | 3 | [] | no_license | //
// Created by admin2 on 08.11.2019.
//
#ifndef HW4_MATRIX_H
#define HW4_MATRIX_H
#include <cstdlib>
#include <stdexcept>
#include <cstring>
#include <vector>
#include <iostream>
class Matrix {
public:
class MatrixRowProxy {
public:
const int& operator [] (std::size_t colum... | true |
af8c856f5b7534787af63b366c91a95e32b8b6af | C++ | casaletto/alby.bigmath | /albybigmath/include/albybigmath/pi.h | UTF-8 | 1,732 | 2.859375 | 3 | [
"MIT"
] | permissive | #pragma once
namespace alby::bigmath
{
class pi
{
protected:
class nonic_term_t
{
public:
R a ;
R r ;
R s ;
R t ;
R u ;
R v ;
R w ;
virtual ~nonic_term_t()
{}
nonic_term_t()
{}
nonic_term_t( const nonic_term_t& rhs )... | true |
8d89a9f4e96b0a2beac95370fa09a4d43bca7da4 | C++ | kamyu104/LeetCode-Solutions | /C++/contains-duplicate-iii.cpp | UTF-8 | 928 | 2.984375 | 3 | [
"MIT"
] | permissive | // Time: O(nlogk)
// Space: O(k)
class Solution {
public:
bool containsNearbyAlmostDuplicate(vector<int>& nums, int k, int t) {
if (k < 0 || t < 0) {
return false;
}
queue<int64_t> window;
multiset<int64_t> bst;
for (int i = 0; i < nums.size(); ++i) {
... | true |
fb46dc419bc86db3796c866d8361a5366e376d7b | C++ | joabda/Robot | /Project/code/codeEmeteur/communication.h | UTF-8 | 2,033 | 3 | 3 | [
"MIT"
] | permissive | /*
* Classe permettant de faire communiquer nos 2 robots, soit en mode émission soit en mode réception.
*
* En mode emission : appeler getPressionsBouton(), puis emettreSignal().
* 1) Détection du nombre de pressions du bouton
* 2) Emission selon SIRC :
* - signal d'initialisation : une émission de 2.4ms, puis... | true |
f0160797657d8548027ad693f3632f61e4916cd9 | C++ | Parfenoff/HW_cpp | /#SimpleCode_lessons/switch.cpp | UTF-8 | 308 | 2.8125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
setlocale(LC_ALL,"RU");
int a;
cin >> a;
switch(a) {
case 1:
cout << "Вы ввели 1" << endl;
break;
case 2:
cout << "Вы ввели 2" << endl;
break;
default:
cout << "Я не знаю этого числа!" << endl;
break;
}
}
| true |
a2436c8dc5a7c1f6e9d963801cf83e7e4815c78a | C++ | gregshin/workout-tracker | /Cardio.h | UTF-8 | 598 | 3.03125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "BaseExercise.h"
// abstract class definition for Cardio. Inherits from BaseExercise
class Cardio : public BaseExercise
{
public:
// Cardio class constructor
Cardio(double time, double dist, double lbs);
// procedure to set distance
void setDistance(double dist);
// procedure to set speed... | true |
f50a6292174419318f353edc73946b2ed58c6640 | C++ | mukhoplus/Mukho | /source/repos/DataStructure_UnsortedArrayList/UnsortedArrayList.cpp | UTF-8 | 2,175 | 2.96875 | 3 | [] | no_license | #include "UnsortedArrayList.h"
UnsortedArrayList::UnsortedArrayList()
{
ArrayList = new UserType[MAXSIZE];
Length = 0;
ResetIterator();
}
UnsortedArrayList::~UnsortedArrayList()
{
if (ArrayList)
delete[] ArrayList;
}
void UnsortedArrayList::MakeEmpty()
{
Length = 0;
}
int UnsortedArrayList::GetLength()
{
retu... | true |
9d94b6cd05c7ff88d1b62287b78e195b1a5a240b | C++ | The-atama/Library | /String/wavelet_matrix.cpp | UTF-8 | 11,024 | 2.921875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct FullyIndexableDictionary {
static const int smallBlockSize = 16;
static const int bigBlockSize = 1024;
static constexpr int smallInBig = bigBlockSize / smallBlockSize;
vector<uint16_t> bit; // raw data
vector<uint32_t> bigBlockAcc; // not succi... | true |
b8113616298933336f71a3892e23fcd11f1bbfe0 | C++ | sunmangul/TIL | /C++/basic/code/06auto.cpp | UTF-8 | 322 | 3.375 | 3 | [] | no_license | #include <iostream>
using namespace std;
auto add(int x, int y)
{
return x+y;
}
int main()
{
auto num1 = 5.1234;
cout << "num1(" << num1 << ")의 타입은 " << typeid(num1).name() << endl;
auto sum = add(5, 6);
cout << "sum("<< sum << ")의 타입은 " << typeid(sum).name() << endl;
return 0;
} | true |
80908b6bbff38249dfd1638168b44f386c75c15d | C++ | amjadtbssm/TGE | /InverseWayLiberation/src/Entities/EntityManager.h | UTF-8 | 1,744 | 2.78125 | 3 | [] | no_license | #pragma once
#include <boost/bimap.hpp>
#include <SFML/Graphics.hpp>
#include "../Tools/Singleton.h"
class Entity;
class EntityManager : public Singleton<EntityManager>, public sf::Drawable
{
protected:
friend class Singleton<EntityManager>;
// Ctor & dtor
EntityManager();
virtual ~EntityManager();... | true |
23168d4e15daffe353c504af25840086a5113cce | C++ | ElliottWaterman/Individual-Project | /ArduinoCode/Examples/DS3231RTC/SetupDateTime.ino | UTF-8 | 3,275 | 3.078125 | 3 | [] | no_license | /**
Author: Elliott Waterman
Date: 09/01/2019
Description: Program to setup the date and time
of an RTC module.
Hardware:
Arduino Uno, DS3231 RTC.
Connect RTC SDA to Arduino pin A4.
Connect RTC SCL to Arduino pin A5.
*/
/* INCLUDES */
#include <DS3232RTC.h> //RTC library used to control the ... | true |
a2df18ec798afd9ef68f95f548ac7af169e72fa4 | C++ | WhiteNeo135/SIAOD_Baloons | /main.cpp | UTF-8 | 992 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include "Ballon.h"
using namespace std;
int main()
{
srand(time(nullptr));
int amount;
int arrow;
int count=0;
int temp=0;
vector<ballon> ballons;
cout << "Введите кол-во шаров"<< endl;
cin >> amount;
... | true |
c482ab51a1bda5ee5f418c1012e7985cb32299c3 | C++ | asifikbalpro/Binary-Search-Trees | /main.cpp | UTF-8 | 1,077 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include "src/BST.h" /// including a .cpp file ????
using namespace std;
int main() {
int TreeKeys[] = {50, 76, 21, 4, 32, 64, 15, 52, 14, 100, 83, 2, 3, 70, 87, 80, 1};
BST myTree;
int input = 0;
cout << "Printing the tree in order" << endl;
cout << "Before Adding Number " ... | true |
9ad96711d050839a31bfdb84ded46598c0cfbf52 | C++ | ajayhegde96/Competitive-Coding | /DA Lab/part_test.cpp | UTF-8 | 931 | 3.21875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int sum(int arr[],int n)
{
int sum =0;
for(int i=0;i<n;i++)
sum+=arr[i];
return sum;
}
void display(int arr[] ,int c)
{
int j;
for(j=0;j<c;j++)
if(arr[j])
printf("%d ",arr[j]);
printf("\n");
}
int main(int argc, char const *argv[])
{
//int set... | true |
9a1b9d5c71e73c1c617eb3144666663f49135c9c | C++ | FiftyBillion/C-plus-plus | /HW3-5/HW3-5/HW3-5.cpp | UTF-8 | 1,401 | 3.71875 | 4 | [] | no_license | // HW3-5 Mobile Service Provider
// this program calculate the amount that the user should pay for different data
// created by Po-I Wu on 01/29/2018
#include <iostream>
using namespace std;
int main()
{
char choice;
double min;
cout << "Please choice the package you purchased.\n" << endl;
cout << "Package A: Fo... | true |
0e1fa728519fe64a5a26c443e0277f9d149e7f5f | C++ | prestocore/browser | /modules/webgl/src/wgl_string.cpp | UTF-8 | 2,687 | 2.515625 | 3 | [] | no_license | /* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) Opera Software ASA 2010 - 2011
*
* WebGL compiler -- string representations (JString derived.)
*
*/
#include "core/pch.h"
#ifdef CANVAS3D_SUPPORT
#include "modules/webgl/src/wgl_string.h"
#include "modules/webgl/src/wg... | true |
bc28438fbd013bd1c1ccd31291b56776043bfc44 | C++ | gateway-services/chipdna-winlin-client-cpp | /CppLib/include/paymentdeviceconfigurationstate.h | UTF-8 | 1,349 | 2.640625 | 3 | [
"MIT"
] | permissive | #ifndef PAYMENTDEVICECONFIGURATIONSTATE_H
#define PAYMENTDEVICECONFIGURATIONSTATE_H
#include <map>
namespace ChipDnaClientLib {
namespace ParameterTokens {
/**
* \brief
* Payment device configuration state.
**/
enum PaymentDeviceConfigurationState {
/**
* \brief
* Payment device is not config... | true |
490f7d078fd95d20f270c02e2ff1ad93f2c2c5ff | C++ | nkvelkov/OOP2018 | /exercise3/SmartHouse.h | UTF-8 | 1,027 | 2.96875 | 3 | [] | no_license | #ifndef SMARTHOUSE_H
#define SMARTHOUSE_H
#include "Robot.h"
const int MAX_NUM_ROBOTS = 20;
const int ADDRESS_MAX_LEN = 11;
class SmartHouse
{
public:
SmartHouse();
SmartHouse(const char* address,
int numRooms,
int numPeople,
int robotsCoun... | true |
747f750f4333871996225b5800341fdde923ec6b | C++ | seguijoaquin/tp-datos-kika | /src/Capa Fisica/AdministradorEntidades.h | UTF-8 | 1,603 | 2.5625 | 3 | [] | no_license | #ifndef ADMIN_ENTIDADES
#define ADMIN_ENTIDADES
#include <iostream>
#include <list>
#include <sstream>
#include "../Capa Fisica/Entidad.h"
#include "../Capa Fisica/Archivos/Archivo.h"
#include <cstring>
#include <cstdlib>
using namespace std;
struct Eliminados{
int idEntidad;
vector<int>* idInstancias;
};
class ... | true |
2c29912fd17f1072a72d6862c0f06dd5727156a1 | C++ | martinnj/GOD | /data/StudentProject/src/solution/edge_rasterizer.h | UTF-8 | 14,343 | 3.1875 | 3 | [] | no_license | #ifndef EDGE_RASTERIZER_H
#define EDGE_RASTERIZER_H
//
// Graphics Framework.
// Copyright (C) 2010 Department of Computer Science, University of Copenhagen
//
#include <iostream>
#include <iomanip>
#include <cmath>
#include "graphics/graphics.h"
#include "solution/linear_interpolator.h"
namespace graphics {
//... | true |
0f3075af4416acfb7a6f9efd720308e023a48b90 | C++ | SlavaX/SimpleClientServer | /Src/ClientServer/Internal/ClientWinAPI.cpp | UTF-8 | 1,782 | 2.875 | 3 | [] | no_license | //------------------------------
#include "..\Public\ClientWinAPI.h"
//------------------------------
#include <iostream>
#include <ws2tcpip.h>
//------------------------------
ClientWinAPI::ClientWinAPI() :
ConnectSocket(INVALID_SOCKET)
{
}
void ClientWinAPI::GetConnectSocket(PCSTR Port)
{
addrinfo *addrInfoList =... | true |
d46b213a74aca50ea7d484c238d66dba4e6f410e | C++ | 2015cnugithub/2151002050MengQianQian | /Third Mycar/mycar.cpp | GB18030 | 7,576 | 3.03125 | 3 | [] | no_license | #include <graphics.h>
#include <conio.h>
#include <dos.h>
#include <time.h>
#include <windows.h>
#include <iostream>
using namespace std;
class Figure{
friend class FigureLink;//FigureLinkӲͬͼλ
friend class Vehicle;
protected:
int cx,cy; // ͼελ
Figure *ptr;// ָҪͼλƶ
Figure *next;// ָһͼλƶ
public:
Figure(int x,int ... | true |
e9659802dd339719f3bb3efe67b49f37123856c0 | C++ | MykolaNemo/AdventOfCode | /2019/Day-9/main.cpp | UTF-8 | 643 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include "../Computer.h"
using namespace std;
#define PART1
int main()
{
std::ifstream infile("input.txt");
std::vector<long long> program;
std::string code;
while(std::getline(infile, code, ','))
{
program.push_... | true |
ce10e0347e92c47f95d51129996ef2a8816a4299 | C++ | JanessaMunt/BlackJack | /dealer.cpp | UTF-8 | 3,047 | 3.375 | 3 | [] | no_license | #include <iostream>
#include <time.h>
#include <unistd.h>
using namespace std;
#include "./card.h"
#include "deck.h"
#include "./hand.h"
#include "./player.h"
#include "./dealer.h"
dealer::dealer(){
}
dealer::~dealer(){
}
/*********************************************************************
** Function: d_get_... | true |
5c945c158332c010e65cfa1c77c92a1d7ab09219 | C++ | suyuan945/LeetCode | /292_NimGame/292_NimGame.cpp | UTF-8 | 244 | 2.9375 | 3 | [] | no_license | #include <iostream>
using namespace std;
class Solution {
public:
bool canWinNim(int n) {
return (n & 3);
}
};
int main(int argc, char *argv[]){
Solution s;
cout << s.canWinNim(3) << endl;
system("pause");
return 0;
} | true |
76e481e3373a49f49ccd5a9cb14ab90639075234 | C++ | honglion/NewRepo | /Project1/include.h | UHC | 1,326 | 2.59375 | 3 | [] | no_license | #pragma once
#include <iostream> /// input output , std::cout , std::cin
#include <cstdio> /// printf
#include <algorithm> /// std::max(a,b) , std::sort(a, b) 迭 a° Һ b° ұ , for_each
#include <limits> //// std::numeric_limits<int>::max(),lowest()
#include <cmath> /// std::pow(2,3) 2 3 , std::abs(-123) 밪
#include <t... | true |
5f8020e892c907030a9cf3939945ad42d3adedf2 | C++ | danielmonr/Estructura-de-datos | /Tarea4Ejercicio4/Tarea4Ejercicio4/Pantalla.cpp | UTF-8 | 4,475 | 2.921875 | 3 | [] | no_license | //
// Pantalla.cpp
// Tarea4Ejercicio4
//
// Created by Daniel on 18/10/14.
// Copyright (c) 2014 Gotomo. All rights reserved.
//
#include "Pantalla.h"
bool Pantalla::curses_ON = false;
void Pantalla::print(ListaDoblementeEnlazada<ListaDoblementeEnlazada<char> *> *texto){
std::cout<<"------------- Editor de... | true |
fd4479e823ee0c3d54ff9b4d0e9c092c1afbb82d | C++ | jnf611/cpp_initobjprog | /cpp/s05-e18-puissance4.cpp | UTF-8 | 2,042 | 3.484375 | 3 | [] | no_license | /* s05e18 Puissance 4*/
#include <iostream>
#include <vector>
using namespace std;
enum Couleur
{
VIDE,
JAUNE,
ROUGE
};
class Jeu
{
public:
Jeu(size_t largeur = 8) : largeur(max(largeur, largeur_min)), plateau(8) {}
size_t getLargeur() { return largeur; }
bool jouer(Couleur couleur, size_t colonne)
{
bool o... | true |
82fbef35cac4a42c1c31d6da7d170f0e710f8a10 | C++ | Dicksonlab/MateBook | /grapher/source/ContinuousGraph.cpp | UTF-8 | 1,978 | 2.53125 | 3 | [] | no_license | /*
* continuousgraphdata.cpp
* grapher
*
* Created by Herbert Grasberger on 15.11.10.
* Copyright 2010 by grasberger.org. All rights reserved.
*
*/
#include "ContinuousGraph.hpp"
#include <QGLWidget>
#include <math.h>
#include <limits>
#define SIGN(_a) ((_a) > 0 ? 1 : (_a) < 0 ? -1 : 0)
size_t Continuou... | true |
cd5f2afc428ec7dfa7079a7282fadc7f7d227489 | C++ | jjmmg/Project-Euler | /problem_21.cpp | UTF-8 | 2,834 | 3.40625 | 3 | [] | no_license | // Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).
// If d(a) = b and d(b) = a, where a ? b, then a and b are an amicable pair and each of a and b are called amicable numbers.
// For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 1... | true |
1631e73c5fa35873bbc4f72fbfa7746003bf4a17 | C++ | keangnage/Nibbler | /sfmllib/sfmllib.cpp | UTF-8 | 4,671 | 2.65625 | 3 | [] | no_license | #include "sfmllib.hpp"
Sfmllib::Sfmllib(void) : window(sf::VideoMode(640, 480), "snake")
{
}
Sfmllib::~Sfmllib(void)
{
}
int Sfmllib::userResponse()
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
else if(sf::Keyboard::isKeyPressed(sf::Keyboard::U... | true |
70c0214b01b399adfea0fb8c67f9a16339fba5a2 | C++ | karolmorawski-AGH/AGH_Metody-Numeryczne2019 | /mnumeryczne/diffeq.cpp | UTF-8 | 2,293 | 3.296875 | 3 | [] | no_license | #include "diffeq.h"
#include "Point.h"
#include <vector>
#include "MnMath.h"
#include "newton-cotes.h"
//Euler
double euler(double x, double y0, double h, double(*fun)(double, double)) {
double n = x / h;
double result = 0;
if (h == 0) {
return 0;
}
double prevx = 0;
double prevy = y0;
double x1, y1;
... | true |
fa5e8b5f985ae1ccdece55304aa1266528c65431 | C++ | demidko/filemap | /src/Main.cpp | UTF-8 | 1,038 | 2.84375 | 3 | [
"MIT"
] | permissive | #include "Telegram.h"
#include <spdlog/spdlog.h>
#include <mutex>
#include <unordered_map>
using Database = std::unordered_map<int64_t, std::unordered_map<std::string, std::string>>;
Telegram::FileHandler saveFileTo(Database &db, std::mutex &m) {
return [&](const auto &bot, const auto &file) {
spdlog::info("cha... | true |
4fdeaf25124ad9410aacc36dcf926592e83f26d8 | C++ | soarhigh03/baekjoon-solutions | /solutions/prob1520/solution_c++.cc | UTF-8 | 1,157 | 2.921875 | 3 | [] | no_license | /*
* Baekjoon Online Judge #1520
* https://www.acmicpc.net/problem/1520
*/
#include <cstdio>
#include <cstring>
using namespace std;
int in_m, in_n, in_grid[501][501], cache[501][501];
bool range_check(int y, int x) {
bool result = y >= 0 && y < in_m && x >= 0 && x < in_n;
return result;
}
int pathfind(... | true |
4da44e1446aefb639475837be5fab147c9111b22 | C++ | rodrigosetti/centurion | /test/interactive/audio/music/interactive_music.cpp | UTF-8 | 5,005 | 3.078125 | 3 | [
"MIT"
] | permissive | #include <utility> // move
#include "centurion.hpp"
#include "event.hpp"
#include "music.hpp"
#include "renderer.hpp"
#include "texture.hpp"
#include "window.hpp"
namespace {
inline constexpr cen::iarea windowSize{800, 600};
inline constexpr auto msgZero = "\"0\" to play the click one time.";
inline constexpr auto... | true |