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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
750f8a17118084d587cdea4f600c57218ed4e055 | C++ | hennin67/TreeProject | /CanadianExperience\CanadianExperience\TreeAdapter.h | UTF-8 | 1,383 | 2.78125 | 3 | [] | no_license | /**
* \file TreeAdapter.h
*
* \author Becky Henning
*
* Tree adapter for Tree Lib
*/
#pragma once
#include "Drawable.h"
#include "Tree.h"
#include "Timeline.h"
#include <memory>
class CBasketAdapter;
/**
* Class for tree in drawings
*/
class CTreeAdapter : public CDrawable
{
pub... | true |
7984ec959ffe4b518f5b538dfe2cc3676ac16c24 | C++ | rustamojukas/jaluzi | /NTP.ino | UTF-8 | 3,522 | 3.078125 | 3 | [
"MIT"
] | permissive | #include <time.h> //Содержится в пакете
void initNTP() {
HTTP.on("/Time", handle_Time); // Синхронизировать время устройства по запросу вида /Time
HTTP.on("/timeZone", handle_time_zone); // Установка времянной зоны
timeSynch(jsonReadtoInt(configJson, "timeZone"));
modulesReg("ntp");
}
void... | true |
07bc6790411e36a146a0f27191d890d9f006111f | C++ | lixu1/Cpp_Object_Oriented | /StudentChooseCourse/Control.cpp | GB18030 | 2,793 | 3.28125 | 3 | [] | no_license | #include "Control.h"
#include <iostream>
#include <iomanip>
using namespace std;
Control::Control()
{
allObNumber=0;
allElNumber=0;
}
Control::~Control()
{
if(student!=NULL)
delete student;
for(int i=0;i<allObNumber;i++)
{ delete ocourse[i];}
for(int j=0;j<allElNumber;j++)
{ delete... | true |
111ea8e34b9580c4da5dd7428f65f6eb0b776580 | C++ | wenpincui/leetcode | /sort-colors.cpp | UTF-8 | 490 | 3.171875 | 3 | [] | no_license | class Solution {
public:
void sortColors(int A[], int n) {
int r = 0, w = 0, b = 0;
for (int i = 0; i < n; i++) {
switch(A[i]) {
case 0: r++; break;
case 1: w++; break;
case 2: b++; break;
default: break;
}
}
in... | true |
fd545d91cf7156e4ecdbf6b533608cbbf9cc0e1b | C++ | MrPaoBrother/C-primer-demo | /chapter13/tabletennis/tabtenn.cpp | UTF-8 | 945 | 3.0625 | 3 | [] | no_license | #include "tabtenn.h"
using std::cout;
using std::endl;
using std::string;
TableTennisPlayer::TableTennisPlayer(const string &fn, const string &ln, bool ht)
{
firstname = fn;
lastname = ln;
hasTable = ht;
}
TableTennisPlayer::TableTennisPlayer(const TableTennisPlayer &tp)
{
this->firstname = tp.firstn... | true |
bc4f31b62f835d326253952f2be492ee4894e88f | C++ | hoseogame/20151683 | /20151683/MiniGame/cHStage.h | UHC | 1,582 | 2.734375 | 3 | [] | no_license | #pragma once
#define CHSTAGE_H
#include <time.h>
class cHStage
{
private:
int m_iBasketX; // Note: Ʈ ٱ x ǥ
int m_iBasketY; // Note: Ʈ ٱ y ǥ
int m_iHeartCount; // Note: Stage Ʈ
int m_iGoalHeartCount; // Note: ǥ Ʈ
int m_iBarLength; // Note:
clock_t m_BasketMoveTime; // Not... | true |
f3bd62a5c56cdb1793df5aa87a58a0c60725baca | C++ | fabtosz/pjp2-projekt | /pjp2-projekt/resources/collisions.h | WINDOWS-1250 | 1,903 | 3.171875 | 3 | [] | no_license | #include <iostream>
bool isCollide(float pos1_x, float pos1_y, float size1_x, float size1_y, float pos2_x, float pos2_y, float size2_x, float size2_y)
{
if ((pos1_x > pos2_x + size2_x - 1) || // is b1 on the right side of b2?
(pos1_y > pos2_y + size2_y - 1) || // is b1 under b2?
(pos2_x > pos1_x + size1_x - 1) ||... | true |
f4d8e43b238f22fab7cc24777af1972fcca9d9a5 | C++ | batataOussama/RespiteServicesEvaluation | /V4/RespiteServicesEvaluation/InputData.h | ISO-8859-1 | 4,654 | 2.921875 | 3 | [] | no_license | /*
* InputData.h
*
* Created on: 12 mai 2018
* Author: Oussama BATATA
*/
#ifndef INPUTDATA_H_
#define INPUTDATA_H_
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
using namespace std;
namespace mySpace {
class InputData {
private:
//-... | true |
fcb8558cb8fdf04cb90e07e083d62ee9d37e38be | C++ | cecamschool2020/simplemd | /cpp/Vector.cpp | UTF-8 | 561 | 2.6875 | 3 | [] | no_license | #include "Vector.h"
#include <cmath>
namespace PLMD{
/// Small auxiliary class.
/// I use it to test a few things that I am scary of and could introduce bugs.
/// It checks at startup that Vector satifies some requirement so as to allow
/// accessing a vector of tensors as a 3 times longer array of doubles.
static cl... | true |
e4249c3f5c2340faab5c6dc47e89099cefa6d423 | C++ | a-doering/kattis | /C++/fizzbuzz.cpp | UTF-8 | 401 | 2.859375 | 3 | [] | no_license | //fizzbuzz
#include <bits/stdc++.h>
using namespace std;
int main(){
//speed up of cin/cout
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int x, y, n;
cin>>x>>y>>n;
for(int i=1; i<=n; i++){
if(i%x==0)cout<<"Fizz";
if(i%y==0)cout<<"Buzz";
... | true |
fd2eb41338ed2385d29269a0dc2d96ab0e937b8e | C++ | gbrlas/AVSP | /CodeJamCrawler/dataset/11_1301_6.cpp | UTF-8 | 468 | 2.78125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
for (int tt = 1; tt <= t; ++tt) {
int d, pd, pg;
cin>>d>>pd>>pg;
bool ans = false;
if (!(((pd > 0) && (pg == 0)) || ((pd < 100) && (pg == 100)))) {
for (int i = 1; i <= d; ++i) {
if (((i * pd) % 100) ... | true |
004ec50151243e0322abc30126d5bc4dddc34f56 | C++ | emiatej9/Kiwi-App | /include/kiwi/FrozenTrie.h | UTF-8 | 1,851 | 2.703125 | 3 | [] | no_license | #pragma once
#include <array>
#include <vector>
#include <deque>
#include <memory>
#include <algorithm>
#include <numeric>
#include <kiwi/Trie.hpp>
namespace kiwi
{
namespace utils
{
namespace detail
{
template<class Value, class = void>
struct HasSubmatch {};
template<class Value>
struct HasSubmat... | true |
70a6827aab6a4909a083878fb678f991789b81cb | C++ | Dyex719/OCRF | /sklearn/ensemble/ocrf_open/ocrf_v0.6/src/dforest.cpp | UTF-8 | 17,004 | 2.796875 | 3 | [
"BSD-3-Clause"
] | permissive | #include "../include/dforest.h"
/* *************************************************************
* Constructor
* param :
* set : pointer to the training set
*/
DForest::DForest(DataHandler * set) {
trainSet = set;
minmax = trainSet->computeMinMax();
rsm_predict = false;
}
//DForest::DForest(Da... | true |
ff1078b3a14dcefc52168183bb29e64b190b5728 | C++ | wangqiim/mycode | /CF/1324D.cpp | GB18030 | 596 | 2.578125 | 3 | [] | no_license | #include<cstdio>
#include<algorithm>
using namespace std;
const int maxn = 200005;
int nums[maxn]; //nums[i] = ai-bi
int main(){
int n; //nʦѧ
long long res = 0;
scanf("%d",&n);
int b;
for(int i=0;i<n;i++)
scanf("%d",&nums[i]);
for(int i=0;i<n;i++){
scanf("%d",&b);
nums[i]-=b;
}
sort(nums,nums+n);
for(... | true |
122da014120b8e2c5f5214b44cb002de4dce62ae | C++ | nowiwr01w/itmo | /algo/3 term/lab1/H.cpp | UTF-8 | 1,873 | 2.765625 | 3 | [] | no_license | #include <vector>
#include <iostream>
using namespace std;
const int MAX_N = 1001;
int n;
int ans, reversed_ans;
vector<bool> used;
vector<bool> reversed_used;
vector<vector<uint32_t>> graph;
vector<vector<uint32_t>> reversed_graph;
void dfs1(int vertex, int cur_min) {
used[vertex] = true;
ans++;
... | true |
c4235993a73f19d6a2619fee0bee3fe1ea1e65cf | C++ | StanleyDing/OnlineJudge | /UVA/UVA_10507_Waking_up_brain.cpp | UTF-8 | 1,315 | 2.59375 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
int main()
{
int N, M, x, y, now, counter[26], wake[26], count;
bool con[26][26];
char in[5];
queue<int> q;
while(scanf("%d%d", &N, &M) != EOF){
memset(con, 0, sizeof(con));
memset(wake, -1, si... | true |
505509fcaefcf198031fc18718a47c67b6bfd326 | C++ | jawwadmateen/OOP-concepts | /override keyword.cpp | UTF-8 | 323 | 2.984375 | 3 | [] | no_license | #include <iostream>
using namespace std;
class base
{
public:
virtual void show()
{
cout<<"Base Class"<<endl;
}
};
class derived:public base
{
public:
virtual void show()override
{
cout<<"Derived Class"<<endl;
}
};
int main()
{
derived d1;
base* b1;
b1=&d1;
b1->show();
... | true |
29cb369b78239d36ece4b24f1b4e1bc735b1a499 | C++ | tklee1975/SimpleTDD-cocos2dx | /Classes/SimpleTDD/TDDData.cpp | UTF-8 | 3,496 | 2.59375 | 3 | [] | no_license | //
// TDDData.cpp
// Cocos2dxTDDLib
//
// Created by Ken Lee on 14/8/14.
//
//
#ifdef ENABLE_TDD
#include "TDDData.h"
#include "TDDHelper.h"
#define kKeyTestHistory "simpleTDD.ccx.history"
#define kKeySearchType "simpleTDD.ccx.searchType"
#define kKeyKeywordAll "simpleTDD.ccx.keyword.all"
#define kKeyKeywordRec... | true |
d91011bbaf0b83f6cccd84a32b8da78632c0f500 | C++ | pauldepalma/CPSC121 | /ex9.cpp | UTF-8 | 523 | 3.265625 | 3 | [] | no_license | /*
CPSC 121-0X
Paul De Palma
depalma
Example 9
*/
//exponentiation with ints
//try using exponents greater than 30
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
int base, exp, i, total;
base = exp = i = total = 0;
cout << "Enter a base and the highest power ... | true |
2e48875c5ca432a00d2f2aaa690908693f5cb713 | C++ | Juan14-mart/Tarea-I | /Ejercicio_005.cpp | UTF-8 | 332 | 2.96875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main () {
int edad,b,c;
printf("Ingrese la edad");
scanf("%d",&edad);
if(edad>60){
c=75*.45;
printf ("El costo del boleto es: %d",c);
}else if(edad<18){
b=75*.4;
printf ("El costo del boleto es: %d",b);
}else if (edad>=18){
printf("El costo del boleto es:75"... | true |
5fd4e3c93b9be78dd091009934ad87786a5d8078 | C++ | arunxls/GraphReLabel | /GraphReLabel/GraphHeaderReader.cpp | UTF-8 | 2,176 | 3.03125 | 3 | [] | no_license | #include "stdafx.h"
#include "GraphHeaderReader.h"
template <typename T>
GraphHeaderReader<T>::GraphHeaderReader()
{
}
template<typename T>
GraphHeaderReader<T>::GraphHeaderReader(char * filename)
{
this->FR = new FileReader(filename);
this->length = 0;
//Save some extra buffer space for partial reads
... | true |
2c96e58b2ac7e0363badbf791dd2719dab8148de | C++ | akstraw/PokerAI | /ai/randomPlayer.cpp | UTF-8 | 1,497 | 3.09375 | 3 | [] | no_license | #include "randomPlayer.h"
#include <chrono>
#include <random>
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <fstream>
using std::ofstream;
using std::ifstream;
RandomPlayer::RandomPlayer() : Player{}
{}
int RandomPlayer::raise(int highestBet)
{
int rv = highestBe... | true |
dc37bf81dc8ce0952c0bf68152d726f790041443 | C++ | ritabugking/Programming | /array.cpp | UTF-8 | 14,777 | 3.953125 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <cassert>
using namespace std;
// Return the number of strings in the array that are equal to target.
int tally(const string a[], int n, string target) {
int num = 0;
if (n < 0 ) // If the size of input array is less than zero, return -1.
return -1;
for (int i ... | true |
23e7389e982943282e6000d960a91ab55a15f499 | C++ | newsb/qtdemo | /deevBean/QTGraphicsViewDemo/mainwindow - 副本.cpp | UTF-8 | 1,666 | 2.71875 | 3 | [] | no_license | #include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QTimer>
#define TILE_SIZE 22
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
// , ui(new Ui::MainWindow)
,scene(new QGraphicsScene(this))
,view(new QGraphicsView(scene,this))
// ,game(new GameController(*scene, this))
... | true |
413eb1bad8458820708a97b7f3546af9ab721f3a | C++ | MaxenceRobin/CompilerForRobotic | /compilers/micropython/micropythoncompiler.cpp | UTF-8 | 19,065 | 2.734375 | 3 | [] | no_license | #include "ANTLR/antlr4-runtime/PivotLexer.h"
#include "micropythoncompiler.h"
using namespace antlr4;
#include <QDebug>
/**
* @brief Constructor of the MicroPython compiler class
*/
MicroPythonCompiler::MicroPythonCompiler()
: PivotBaseVisitor()
{
}
/**
* @brief Initializes the intern attributes used during ... | true |
8d0bbb80b8357b7bc479e2cc284c8f6b002b70c9 | C++ | rithram/bregman_mst | /mlpack_code/enhanced_bregman_ball_impl.hpp | UTF-8 | 3,044 | 2.5625 | 3 | [] | no_license | /**
* @file enhanced_bregman_ball_impl.hpp
*
* Implementation for EnhancedBregmanBall class
*/
#ifndef BMST_ENHANCED_BREGMAN_BALL_IMPL_HPP_
#define BMST_ENHANCED_BREGMAN_BALL_IMPL_HPP_
#include "enhanced_bregman_ball.hpp"
#include "L2Divergence.hpp"
namespace bmst {
template <typename T, class TBDiv>
EnhancedBr... | true |
64775a78a385809d1f239c9b908e492240b2fa15 | C++ | ferserc1/bg2-unreal-tools | /Source/Bg2UnrealTools/Private/Bg2MeshParser.h | UTF-8 | 1,866 | 2.609375 | 3 | [] | no_license | #pragma once
#include <string>
#include <vector>
#include <fstream>
class Bg2MeshParser
{
public:
enum OpenMode
{
kModeClosed,
kModeRead,
kModeWrite
};
enum BlockType {
kHeader = 'hedr',
kPolyList = 'plst',
kVertexArray = 'varr',
... | true |
b805b1c8accd71bf4eb74a056625941cd548b432 | C++ | siberiy4/comp_prog | /2018.10.18/slime2.cpp | UTF-8 | 498 | 2.578125 | 3 | [] | no_license | #include<iostream>
#include<deque>
using namespace std;
int main(){
int N;
int ans=0;
deque<int> slimes(N);
cin>>N;
int now,pre;
cin>>pre;
int continuous=1;
for(int i = 1; i < N; i++)
{
cin>>now;
if(pre==now){
continuous++;... | true |
56fb588b4e2811bde2aa3356c1a9847243bc532d | C++ | nguyenviettien13/CodeLearning | /DesignPattern/Singleton class using inheritance/Singleton class using inheritance/MyBase.cpp | UTF-8 | 482 | 2.640625 | 3 | [] | no_license | #include "MyBase.h"
#include <iostream>
using namespace std;
MyBase* MyBase::m_pMyBaseInstance = nullptr;
MyBase::MyBase()
{
}
MyBase::MyBase(int X):
m_data(X)
{
}
MyBase::~MyBase()
{
}
void MyBase::setDataX(int value)
{
m_data = value;
}
int MyBase::getDataX() const
{
return ... | true |
b27df1ccca9e21b2deff8dcb7412391e18581cc0 | C++ | MrrrrFox/OOP | /CPP/3rd semester - Fundamental Concepts of Object-Oriented Programming/lab05/Sources/MapDist.cpp | UTF-8 | 508 | 2.671875 | 3 | [] | no_license | #include "MapDist.h"
#include <cmath>
using namespace std;
const MapDist distance(MapPoint miasto1, MapPoint miasto2)
{
const MapDist dystans = new MapDist;
// dystans->longitude =
return 0;
}
double angularDistance(const MapDist delty)
{
return 0;
}
const MapPoint& closestFrom(MapPoint * miastoRef, MapPoint * ... | true |
8628903021a37f82f30d2ab61b08be839acbfa31 | C++ | NeilWangziyu/NewJourneyOfCPlusPlus | /NewJourneyOfCPlusPlus.git/15-4/main.cpp | UTF-8 | 1,769 | 3.421875 | 3 | [] | no_license | //
// main.cpp
// 15-4
//
// Created by 王子昱 on 2019/12/9.
// Copyright © 2019 王子昱. All rights reserved.
//
#include <iostream>
#include <vector>
#include <string>
#include <memory>
using namespace std;
class Quote{
public:
Quote() =default;
Quote(const string &book, double sales_price) :
bookNo(... | true |
ee8d5f453abe8d8a53e7615f1f1cffe20838b3ba | C++ | jhuni45/TCG-Laboratorio | /Practicas/Practica 3/Hayde/Codigo/ejercicio5.cpp | UTF-8 | 700 | 2.609375 | 3 | [] | no_license | #include <opencv2/opencv.hpp>
#include <bits/stdc++.h>
using namespace cv;
using namespace std;
int main(){
Mat img=imread("imagen1.jpg");
if ( !img.data){
return -1;
}
Mat pt1(1, 3, CV_32FC2); // Puntos en el origen
pt1.at<Vec2f>(0,0)= Vec2f(0, 0); // Rellenar los tres puntos
pt1.at<Vec2f>(0,1)= V... | true |
fa5e4ed1ca81fcf4a9dc8356fb3362a29a9534f1 | C++ | electro-smith/DaisySP | /Source/Synthesis/oscillatorbank.h | UTF-8 | 1,907 | 2.796875 | 3 | [
"MIT"
] | permissive | #pragma once
#ifndef DSY_OSCILLATORBANK_H
#define DSY_OSCILLATORBANK_H
#include <stdint.h>
#ifdef __cplusplus
/** @file oscillatorbank.h */
namespace daisysp
{
/**
@brief Oscillator Bank module.
@author Ben Sergentanis
@date Dec 2020
A mixture of 7 sawtooth and square waveforms in the ... | true |
fe2b3c7289f281f0a1ef42c7aac40cd2d9b80964 | C++ | ShariqueMohd/B-tree-and-Linear-Hashing | /LinearHashing.hpp | UTF-8 | 3,031 | 3.140625 | 3 | [] | no_license | #ifndef __LHASHING__
#define __LHASHING__
#include <bits/stdc++.h>
using namespace std;
template<typename T>
class Block {
int capacity;
vector<T> data;
Block *next;
public:
Block(int capacity): capacity(capacity), data(), next(nullptr) {}
bool isOverflow() const {
if(next != nullptr) {
return true;
}
... | true |
8fd602ad02d6244b72afaca7278d713114739baa | C++ | tjgykhulj/Pencil-Drawing-Builder | /Code/第一次迭代/method.h | GB18030 | 1,259 | 2.609375 | 3 | [] | no_license | #ifndef METHOD_H
#define METHOD_H
#include <opencv2\opencv.hpp>
#include <opencv2/legacy/compat.hpp>
using namespace cv;
//תͼƬdegreeȣ˫Բֵ
Mat rotateImage(Mat img, double degree)
{
Point2f center = Point2f((img.cols-1) / 2.0, (img.rows-1) / 2.0);
Mat M = getRotationMatrix2D(center, degree, 1);
Mat result;
warpAffi... | true |
cec5f4b7c01e3b0282a0a75a3f72a40cc7b42537 | C++ | brunobonfim01/Projeto-Telecom | /Projeto.cpp | ISO-8859-1 | 4,422 | 2.84375 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
#include<ctype.h>
#include<windows.h>
#include<stdlib.h>
struct cliente
{
char cpf[15];
char nome[50];
float plano;
}s;
void criarplano();
void listarplanos();
void mudarplanos();
void deletar();
void procurar();
char get;
int main()
{ int senha;
int cpf;
char e... | true |
8607ecec8548f01d3418246bfe40f0ebe22c09f8 | C++ | Xarvie/chain-socket | /code/ChainSocket/Ip.cpp | UTF-8 | 1,471 | 2.671875 | 3 | [
"MIT"
] | permissive | //
// Created by ftp on 7/3/2021.
//
#include "Ip.h"
#include <ws2tcpip.h>
void IP::fromString(std::string ip, std::string port, IP::Version ipv) {
//addrinfo结构体是为了消除IPv6协议与IPv4协议之间的差异,编制统一的程序而追加的结构。并且允许多个IPv4地址或IPv6地址链成链表
struct addrinfo hints, //服务器端地址信息
*result = NULL; //若有多个地址,res是地址信息链表指针
memset(&hints, 0, s... | true |
2c0ecec9071e108fa3b0c817d38738f618250105 | C++ | LiLiaoMing/chipset | /X1/charUtile.cpp | UTF-8 | 1,612 | 2.703125 | 3 | [] | no_license | #include "stdafx.h"
#include "charUtile.h"
#include <assert.h>
int AnsiToUTF8(char* szSrc, char* strDest, int destSize)
{
WCHAR szUnicode[2048];
char szUTF8code[2048];
int nUnicodeSize = MultiByteToWideChar(CP_ACP, 0, szSrc, (int)strlen(szSrc), szUnicode, sizeof(szUnicode));
int nUTF8codeSize = WideCharToMu... | true |
ff50966454064f03b8a4677842303eed41d8991b | C++ | ameetgohil/ulcdDemo | /main.cpp | UTF-8 | 1,654 | 2.671875 | 3 | [
"MIT"
] | permissive | #include "mbed.h"
#include "uLCD_4DGL.h"
uLCD_4DGL uLCD(p9,p10,p11);
int main() {
int x;
int y;
int radius;
int vx;
//Set out UART baudrate to somehting reasonable
uLCD.baudrate(921600);
//Change background color (must be caclled before cls)
uLCD.backgrou... | true |
c038f48f2f95cc19818c1fca7d4037d5ac5982eb | C++ | dev-akashparmar/dev-cpp | /binary_search_array.cpp | UTF-8 | 991 | 3.78125 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "enter the size of array:";
cin >> n;
int a[n] = {};
cout << "enter the elements of array:" << endl;
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
cout << "the elements of array are:";
for (... | true |
cbbbefdf314e61fb9d2b529d1da2d96ae9bcc59f | C++ | monkbroc/Thermomatic | /firmware/src/thermomatic.ino | UTF-8 | 1,804 | 2.546875 | 3 | [] | no_license | /*
* Internet connected fleet of thermometers
*
* Connect the MCP9808 temperature sensor
* Vdd to 3V3
* Gnd to GND
* SCL to D1
* SDA to D0
*/
#include "MCP9808.h"
PRODUCT_ID(3341);
PRODUCT_VERSION(1);
SYSTEM_THREAD(ENABLED);
MCP9808 sensor = MCP9808();
int publishDelay = 60; // seconds
String deviceName;
... | true |
2b5625f54a14448c5fba82bcc73af8ce86dca708 | C++ | Doc-Zegno/handmada | /include/misc/ComparisonFlag.h | UTF-8 | 1,066 | 2.78125 | 3 | [] | no_license | //
// Created by syzegno on 07.05.17.
//
#ifndef EQUEUE_V2_COMPAREFLAG_H
#define EQUEUE_V2_COMPAREFLAG_H
namespace Handmada {
class ComparisonFlag
{
public:
ComparisonFlag() = delete;
enum Type {
LESS,
EQUAL,
GREATER,
NOT_EQUAL,
... | true |
14829ec23742be5a815ba3757e72b173a5e74516 | C++ | AmborFei/cpphomework | /15.cpp | GB18030 | 384 | 2.84375 | 3 | [] | no_license | #include<iostream>
#include<stdlib.h>
using namespace std;
void main()
{
int n=10;
float *p;
if((p=new float[n])==0)
{
cout<<"ڴʧ\n";
exit(1);
}
float sum=0;
for(int i=1;i<=n;i++)
{
p[i-1]=i*(1.0/10);
sum+=p[i-1];
cout<<"sum="<<sum<<endl;
}
cout<<"飺"<<endl;
for(int i=0;i<n;i++)
{
cout<<p[i]<<" ";... | true |
71f07ddf0c571c8237aee69336357cd008e2a451 | C++ | RichardBruce/RAPTor | /RAPTor/convex_decomposition/unit_tests/voxel_set_tests.cc | UTF-8 | 39,195 | 2.609375 | 3 | [] | no_license | #ifdef STAND_ALONE
#define BOOST_TEST_MODULE voxel_set test
#endif /* #ifdef STAND_ALONE */
/* Standard headers */
/* Boost headers */
#include "boost/noncopyable.hpp"
#include "boost/test/unit_test.hpp"
/* Convex Decomposition headers */
#include "voxel_set.h"
namespace raptor_convex_decomposition
{
namespace te... | true |
8114e1acc7d0e523ee549b8051c23e584aab7b5c | C++ | juanmard/juegocpp | /Clases/Nombres.h | UTF-8 | 3,253 | 3.71875 | 4 | [] | no_license | ///
/// @file Nombres.cpp
/// @brief Fichero de implementación de la clase "Nombres".
/// @author Juan Manuel Rico
/// @date Noviembre 2015
/// @version
/// - 1.0.0 Noviembre 2015
///
#ifndef _NOMBRES_H_
#define _NOMBRES_H_
#include <string>
#include <iostream>
/// Clase que reúne todos los nombres de o... | true |
97fc8b49cc21639fb787f17fe0e846ccf8b2f2dd | C++ | AlicKaufmann/hovercraft_cpp | /src/mylibrary/src/create_integrator.cpp | UTF-8 | 2,265 | 2.625 | 3 | [] | no_license | // creates an integrator for non-autonomous ODE, also returning the cost
#include <casadi/casadi.hpp>
#include <create_integrator.hpp>
#include <iostream>
//#include <casadi_limits.hpp>
using namespace std;
using namespace casadi;
Function create_integrator_cost(Function f /*transition map*/ , int M /*number of integ... | true |
18d9a42fe6c9c3501972c7e352eb2da2a423e65a | C++ | oktomus/cpp-closest-point-on-mesh | /src/core/scene.h | UTF-8 | 500 | 2.90625 | 3 | [] | no_license | #pragma once
#include "mesh.h"
#include "rasterized_mesh.h"
#include <vector>
namespace core
{
/**
* @brief Store multiple meshes and everything required to render them.
*/
class Scene
{
public:
Scene(const std::vector<Mesh>& meshes);
std::size_t get_mesh_count() const;
const Mesh& get_mesh(const ... | true |
94a3efba61e556fd825a54ba4e2074a28fa4ef08 | C++ | Ajay7545/AllDataStructure | /arrarysort012.cpp | UTF-8 | 1,374 | 3.375 | 3 | [] | no_license | #include<iostream>
#include<bits/stdc++.h>
#include<assert.h>
using namespace std;
void printarr(int *a,int n);
int main()
{
/*
Invariant: At each index, at 0th index count 0s ,at 1th index 1s count 2s count at index 2.
Pre-condition:vaues shoud not be other than 0,1,2
Post-condition: a the ... | true |
5eed547b245db972797a91c5bc5f7ac774bf47b6 | C++ | marinov98/CSCI-335 | /tests/project1Tests/main.cpp | UTF-8 | 1,319 | 3.25 | 3 | [] | no_license | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | true |
7704f93c14324bc3321187311e5126ec2a9c7ac8 | C++ | dkarlo2/PlayerDetectionTracking | /src/min_edge_cover.cpp | UTF-8 | 10,536 | 2.765625 | 3 | [] | no_license | #include "min_edge_cover.h"
#include "time_measurement.h"
#include <queue>
#undef min
#undef max
// mostly copied from
// https://www.topcoder.com/community/data-science/data-science-tutorials/assignment-problem-and-hungarian-algorithm/
// ##################################################################... | true |
61674029382c398626d076c1f1566c00174c6d1d | C++ | FancyKings/SDUSTOJ_ACCode | /Code_by_runid/2430668.cc | UTF-8 | 2,352 | 3.484375 | 3 | [
"Apache-2.0"
] | permissive | #include <bits/stdc++.h>
using namespace std;
const double PI = 3.14;
class Shape
{
public:
static int NumOfShapes;
double r;
Shape(double x):r(x){
NumOfShapes++;
cout << "A shape is created!" << endl;
};
virtual ~Shape(){
cout << "A shape is erased!" << endl;
};
... | true |
9f5666bda0ff306003b3e9d14ad898319e023ac3 | C++ | BhanujaAggarwal/LeetCode | /#1408.cpp | UTF-8 | 534 | 2.71875 | 3 | [] | no_license | class Solution {
public:
vector<string> stringMatching(vector<string>& words) {
set<string> ans;
vector<string> a;
for(int i=0;i<words.size()-1;i++){
for(int j=i+1;j<words.size();j++){
if(words[i].find(words[j])!=-1){
ans.insert(words[j]);
... | true |
9d21e90a10f0d7ca96f9b844725a191c9ac26464 | C++ | serialphotog/emu64 | /libemu64/rom.cpp | UTF-8 | 761 | 2.734375 | 3 | [] | no_license | #include "emu64/rom.h"
#include <algorithm>
#include <fstream>
#include <vector>
#include <stdio.h>
#include <iostream>
namespace Emu64
{
Rom::Rom()
{
}
Rom::~Rom()
{
if (m_data != nullptr) delete m_data;
}
void Rom::Read(std::string path)
{
... | true |
91b85deb5a23474888d73ce57a739b2fb2dc02c1 | C++ | vikas0o7/important_cpp_questions | /trie.cpp | UTF-8 | 1,208 | 3.53125 | 4 | [] | no_license | #include<bits/stdc++.h>
#define io ios_base::sync_with_stdio(false)
#define mp make_pair
#define pb push_back
using namespace std;
class Trie{
public:
bool isendofword;
unordered_map<char,Trie*> map;
};
Trie* newTrie(){
Trie* temp= new Trie;
temp->isendofword=false;
return temp;
}
void insert(Trie* &root, string ... | true |
5d3dad482af4cea609ed5546869e8ef900b6acdf | C++ | FunctionDou/Code | /Cc++/epoll_fifo_1_复用.cpp | UTF-8 | 3,907 | 2.703125 | 3 | [] | no_license | /*************************************************************************
> File Name: epoll.cpp
> Author: Function_Dou
> Mail: NOT
> Created Time: 2018年04月19日 星期四 20时25分45秒
epoll 函数:
// 创建一个 epoll 对象(epoll instance),同时返回该对象的描述符。
int epoll_create(int size);
int epoll_ctl(int epfd, int op, int fd, s... | true |
5a529dc751027fa0c712c26b46396384cefcb7e6 | C++ | ConnorShore/Candle3D | /Candle3D/Camera.h | UTF-8 | 1,061 | 2.75 | 3 | [] | no_license | #pragma once
#include "glm\glm.hpp"
#include "InputManager.h"
#include "Window.h"
enum Translate
{
FORWARD, BACK, LEFT, RIGHT
};
struct CameraTransform
{
glm::vec3 position, direction, right, up;
float pitch, yaw, roll, sensitivity;
};
struct Viewing
{
glm::mat4 viewMatrix, projectionMatrix;
float fov, zNear, ... | true |
aa46a0bdf9abc00d2d8ae79b8e197b1bbcb08226 | C++ | robini/LeetCode | /LinkedList/92. Reverse Linked List II.cpp | UTF-8 | 659 | 3.296875 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* reverseBetween(ListNode* head, int m, int n) {
if (m == n)
return head;
ListNode p(0);
p.next = head;
n -= m - 1;
ListN... | true |
840ea3aea29e2eeecd6216592f0fd0029174690c | C++ | iloveooz/podbelsky | /04/p4-04.cpp | UTF-8 | 787 | 3.4375 | 3 | [] | no_license | //p4-04.cpp - оператор break в переключателе
#include <iostream>
using namespace std;
int main()
{
int ic;
cout << "\nВведите восьмеричную цифру: ";
cin >> ic;
cout << '\n' << ic;
switch (ic)
{
case 0: cout << " - Ноль ";break;
case 1: cout << " - Один"; break;
case 2: cout << " - Д... | true |
6dff0d9d59523d6e49208d89e28d8de7c2ff93c0 | C++ | IonUreche/VulkanApp | /src/GUI/window.cpp | UTF-8 | 4,483 | 2.5625 | 3 | [] | no_license | #include "window.h"
#include <QTimer>
#include "Utils/Camera.h"
Window::Window(int width, int height) : m_width(width), m_height(height),
m_time(0.0f)
{
SetFocus(reinterpret_cast<HWND>(this->winId()));
m_camera = new utils::Camera(width, height);
m_vulkanWindow = new VulkanWindow(m_width, m_height, static_cast<u... | true |
566c46a4bf4bd13c69f91e4f45360eac9e5d4b4d | C++ | pvaibhavv12/Coding | /coding_interview/merge.cpp | UTF-8 | 1,842 | 3.515625 | 4 | [] | no_license | #include<iostream>
#include<stdlib.h>
using namespace std;
typedef struct node{
int element;
struct node* next;
} node;
typedef struct list{
node* head;
} list;
void add_ele(list* list,int ele){
node* temp = (node*)malloc(sizeof(node*));
temp->element = ele;
temp->next = NULL;
... | true |
7356fe6740de6602b8b192b6d2764e280e00532f | C++ | FUKUDA87/OneWaySurvivor | /OneWaySurvivor/SourceFolder/Source/GameSource/Count/Count.cpp | UTF-8 | 586 | 2.578125 | 3 | [] | no_license | #include "Count.h"
#include"../Judgment.h"
C_Count::C_Count(const int * Start)
{
//‰Šú‰»
CountStart = *Start;
StartFlg = true;
}
bool C_Count::Update(void)
{
SetNow();
CountDownNow--;
if (CountDownNow <= 0)StartFlg = true;
return StartFlg;
}
bool C_Count::Update_Count(void)
{
SetNow();
CountDownNow-... | true |
62872538c54bd8250e2c4341cd5cb478cceb59fc | C++ | hitochan777/programming | /cf/Rockethon2015/513B1.cpp | UTF-8 | 730 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int n,m,cnt = 0;
int f(vector<int>& v){
int val = 0;
for(int i = 0;i< n;++i){
for(int j = i;j<n;++j){
int minval = 100;
for(int k = i;k<=j;++k){
if(minval>v[k]){
minval = v[k];
}
}
val += minval;
}
}
ret... | true |
9e3f34720e31429a5b36ac95fd16ccd9ecd26d8f | C++ | Sage-of-Mirrors/Booldozer | /include/DOM/DoorDOMNode.hpp | UTF-8 | 1,762 | 2.640625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "BGRenderDOMNode.hpp"
struct LStaticDoorData;
class LRoomDOMNode;
enum class EDoorOrientation : uint8_t
{
Front_Facing = 1,
Side_Facing,
No_Fade = 4
};
enum class EDoorType : uint8_t
{
Door,
Viewport,
Window
};
enum class EDoorModel : uint8_t
{
None,
Square_Mansion_Door,
Round_Topped... | true |
8e68d0f13d2779cc18bbe3aa6772b588a48f618e | C++ | shivam-72/Data-Structure | /OPERATIONS ON ARRAY/delete.cpp | UTF-8 | 1,000 | 3.65625 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int n, length, index, i, x;
int A[n];
cout << "enter the size of array" << endl;
cin >> n;
cout << "no. of element you want to insert:" << endl;
cin >> length;
if (length <= n)
{
cout << "elements of array" << endl... | true |
069f9659cbd96a32c522cdd65ec36abb0a589c12 | C++ | fosheus/ManvsMen | /ManvsMen/MapGenerator.h | UTF-8 | 1,243 | 2.59375 | 3 | [] | no_license | #pragma once
#include <cstdlib>
#include <SFML\Graphics.hpp>
#include "Point.h"
#include "AVL.h"
#include "Utils.h"
#include "ImageManager.h"
class MapGenerator
{
public :
enum Cell_Type {
WALL = 0,
PATH = 1,
CONCRETE = 2
};
private :
int **matrix;
size_t height;
size_t width;
size_t blocWidth;
size_t blo... | true |
9bd21163d0d14292aff70f9bb62931260942a8dd | C++ | mdpabel/CPP | /14. vector/04.cpp | UTF-8 | 1,171 | 2.765625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
// Fast I/O
ios_base::sync_with_stdio(false);
cin.tie(NULL);
vector<int> v = {10, 12, 3, 14, 51, 6, 7, 7, 12, 12, 10, 10, 4, 3, 3, 3, 3};
// vector<int>::iterator it;
// for (it = v.begin(); it != v.end(); it++)... | true |
a38863352829d0d4386e8a99f74eaf468dbbcb49 | C++ | workshopbot/ProjectEuler | /20-FactorialDigitSum.cpp | UTF-8 | 835 | 2.9375 | 3 | [] | no_license | #include<iostream>
// #include<fstream>
#include"gmp.h"
using namespace std;
int main()
{
int SIZE = 0, Sum = 0;
unsigned long int num = 100;
mpz_t factorial;
mpz_init(factorial);
mpz_fac_ui(factorial, num);
gmp_printf(" 100! is , \n%Zd\n", factorial);
SIZE = __gmpz_sizeinbase(factoria... | true |
c14a72b637a1a5b419db8467c38143994c9ffabc | C++ | Psingh12354/C-STL | /Inserter.cpp | UTF-8 | 354 | 3.46875 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<list>
using namespace std;
int main()
{
vector<int> ar={1,2,3,4,5,6};
vector<int>::iterator p1=ar.begin();
advance(p1,3);
copy(ar.begin(),ar.end(),inserter(ar,p1));
cout << "The new vector after inserting elements is : ";
for (int &x : ar)
cou... | true |
230c7789549d6963eff7884803cd2e29f9b75453 | C++ | NeoGameEngineProject/SDK | /Neo2D/include/KeyboardShortcuts.h | UTF-8 | 882 | 2.765625 | 3 | [] | no_license | #ifndef NEO_KEYBOARDSHORTCUTS_H
#define NEO_KEYBOARDSHORTCUTS_H
#include <Widget.h>
#include <vector>
#include <map>
namespace Neo2D
{
namespace Gui
{
class NEO2D_EXPORT Shortcut
{
private:
std::map<unsigned int, bool> status;
std::vector<Neo::INPUT_KEYS> keys;
std::function<void(void*)> callback;
void* data;
p... | true |
7d8f5f674723391ad3c8239e3a8c0b0a5e7a8487 | C++ | nmlgc/ReC98 | /th01/math/str_val.cpp | UTF-8 | 869 | 3.15625 | 3 | [] | no_license | #include "th01/math/str_val.hpp"
void pascal str_right_aligned_from_uint16(
char *str, uint16_t val, uint16_t width
)
{
uint16_t divisor = 10000;
unsigned int i = width;
bool past_leading_zeroes = false;
while(i < 5) {
divisor /= 10;
i++;
}
for(i = 0; i < width; i++) {
if(val / divisor) {
past_leading... | true |
ac040517dc7e66ccb28fa7be0ad55242028f8692 | C++ | onnoo/Online-Judge | /Baekjoon/17363.cpp | UTF-8 | 666 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
char mapping[125];
int a[] = {46, 79, 45, 124, 47, 92, 94, 60, 118, 62};
char b[] = {'.', 'O', '|', '-', '\\', '/', '<', 'v', '>', '^'};
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
int N, M;
cin >> N >> M;
cin.ignore();
fo... | true |
71dfb7bd9efd31baad0698ae46087b28a5200618 | C++ | sereslorant/logan_engine | /LoganEngine/src/lExample/lPacMan/lPM_Model/lPM_Agents/lPM_PacMan.h | UTF-8 | 1,362 | 2.671875 | 3 | [
"MIT"
] | permissive | #ifndef LPM_PAC_MAN_H
#define LPM_PAC_MAN_H
#include "lPM_Agent.h"
#include "../../lPM_Controller/liPM_AgentController.h"
class lPM_PacMan : public lPM_Agent, public liPM_PacMan
{
protected:
unsigned int Reward = 0;
liPM_AgentController *AgentControl;
std::list<liPM_PacManObserver *> PacManObservers;
public:
... | true |
35f616f706a3ad623d7d7402d4a388354d35d3c6 | C++ | GrinPlusPlus/GrinPlusPlus | /src/P2P/Messages/TransactionKernelMessage.h | UTF-8 | 1,428 | 2.875 | 3 | [
"MIT"
] | permissive | #pragma once
#include "Message.h"
#include <Crypto/Models/Hash.h>
class TransactionKernelMessage : public IMessage
{
public:
//
// Constructors
//
TransactionKernelMessage(Hash&& kernelHash)
: m_kernelHash(std::move(kernelHash))
{
}
TransactionKernelMessage(const Hash& kernelHash)
: m_kernelHash(kernelHa... | true |
ac5f5f0353636166ea6f7be73b5f8c04154a69ba | C++ | sillsdev/WorldPad | /Bin/src/AutoCheckin/Checkin.cpp | UTF-8 | 19,826 | 2.65625 | 3 | [] | no_license | /*
Auto-Checkin - a utility to perform the entire Perforce check-in process
unattended. The steps taken are:
Waiting for the CheckIn_History.txt file to become available;
Acquiring the CheckIn_History.txt file (no longer locking token file);
Re-syncing all files to the local machine;
Rebuilding FW with tests;... | true |
793feedcca763412eb3abfdfa51e4c58d13567a0 | C++ | jeanyvesb9/GS | /visitview.cpp | UTF-8 | 7,594 | 2.546875 | 3 | [] | no_license | #include "visitview.h"
#include "ui_visitview.h"
VisitView::VisitView(QWidget *parent, int visit) :
QDialog(parent),
ui(new Ui::VisitView),
visit{visit}
{
ui->setupUi(this);
this->setWindowIcon(QIcon(iconsPath->absolutePath().append("/Open_Icon.png")));
QStringList list {"Bueno", "... | true |
252edb53f5542d4e64c06c14fae33ddfc5cf8602 | C++ | cwlseu/Source | /lib/Seu/Cose/Test/NewArrayTest.cpp | UTF-8 | 436 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include "../Util/newArray.h"
using namespace Seu::Cose;
using namespace std;
void test()
{
int ndim=2;
int* arr = new int[2]{1,2};
int init =3;
int*** p = new3DimArray(4,4,4,init);
print3DimArray(p,4,4,4);
delete3DimArray(p,4,4,4);
std::cout<<sizeof(p)<<"";
reAlloc(arr,2,100);
for (int i ... | true |
70c02ca7d085f4a1ed257cc17705a0b98e039007 | C++ | nssk1999/Edabit-Solutions | /1. Very Easy/sumOfTwoNumbers.cpp | UTF-8 | 505 | 3.65625 | 4 | [
"MIT"
] | permissive | /* this program will add two numbers
* Problem : https://edabit.com/challenge/SFzHtm63XT6EYNHWY
*/
#include <iostream>
using namespace std;
int addition(int a, int b) {
if (b > 0) {
while (b > 0) {
a++;
b--;
}
}
if (b < 0) { // when 'b' is negative
... | true |
fa9462ff0ae04912e4933e4e5a6d10858d15a234 | C++ | sipe9/PerforceAssist | /P4Library/Utils/StringUtil.cpp | UTF-8 | 3,306 | 3.203125 | 3 | [
"MIT"
] | permissive |
#include "StringUtil.hpp"
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
namespace VersionControl
{
bool StringUtil::endsWith(const std::string &from, const std::string &what)
{
if (from.length() < what.length())
return false;
std::string::const_reverse_iterator i1 = from.rbeg... | true |
3839a4feafe318aae6502b5d5f0b3c05591cb6be | C++ | rsrs2013/Optimizing-Single-Source-Shortest-Path-Algorithm-to-parallelize-on-a-GPU | /codeSample/entry_point.cpp | UTF-8 | 8,415 | 2.53125 | 3 | [] | no_license | #include <cstring>
#include <stdexcept>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
#include "utils.h"
#include "cuda_error_check.cuh"
#include "initial_graph.hpp"
#include "parse_graph.hpp"
#include "opt.cu"
#include "impl2.cu"
#include "impl1.cu"
#define SSSP_IN... | true |
f73669a6ea841f6649c274665365e0e29425ac4a | C++ | veedee2000/Competitive-Programming | /Leetcode/MATH/Smallest_Range_1.cpp | UTF-8 | 306 | 2.671875 | 3 | [] | no_license | class Solution {
public:
int smallestRangeI(vector<int>& a, int k) {
int mmin = a[0], mmax = a[0];
for(auto x:a){
mmin = min(mmin, x);
mmax = max(mmax, x);
}
if(mmax - mmin - 2 * k > 0) return mmax - mmin - 2 * k;
else return 0;
}
};
| true |
88f5dbf9f408bfff6e3d735be97180f653c05d31 | C++ | C-Elegans/d16-cc2 | /src/MachineInstruction.hpp | UTF-8 | 957 | 2.59375 | 3 | [] | no_license | //
// MachineInstruction.hpp
// d16-cc2
//
// Created by Michael Nolan on 7/3/16.
// Copyright © 2016 Michael Nolan. All rights reserved.
//
#ifndef MachineInstruction_hpp
#define MachineInstruction_hpp
#include <cstdint>
#include <stdio.h>
#include <memory>
#include <vector>
typedef enum _Op_Type{
NOP=0,
ADD,
... | true |
47b648bdc8c15547bdb8d18eb654b4416a065396 | C++ | sindreij/TDT4102 | /Oving1/del3b.cpp | UTF-8 | 319 | 3.5 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main() {
double tall1;
double tall2;
cout << "Skriv inn et tall: ";
cin >> tall1;
cout << "Skriv inn enda et tall: ";
cin >> tall2;
if (tall1 > tall2) {
cout << tall1 << " er størst" << endl;
} else {
cout << tall2 << " er størst" << endl;
}
}
| true |
78f6b307ae80bb58ab96e771416ee03fa78cadc7 | C++ | RdlP/space-invader | /include/Juego.h | UTF-8 | 2,924 | 3.1875 | 3 | [] | no_license | #ifndef Juego_h
#define Juego_h
/**
* Clase que representa al jeugo.
*
* Esta clase representa al juego, almacenando diversos atributos,
* como por ejemplo la puntuación, el nivel en el que se encuentra
* el juego, el nombre del jugador, si el juego ha terminado o no, etc...
*
* @author Ángel Luis Perales Gómez
* @v... | true |
2bfe2414fba45ad50e06518eac608f4191503a0c | C++ | rems4e/Projet2MIC | /Projet2MIC/src/Personnage.h | UTF-8 | 2,998 | 2.734375 | 3 | [] | no_license | //
// Personnage.h
// Projet2MIC
//
// Créé par Marc Promé et Rémi Saurel.
// Ce fichier et son contenu sont librement distribuables, modifiables et utilisables pour toute œuvre non commerciale, à condition d'en citer les auteurs.
//
#ifndef Projet2MIC_Personnage_h
#define Projet2MIC_Personnage_h
#include "Entite... | true |
1f81bf4962a140a39878d98f445262c3ab9204b6 | C++ | 15831944/TRiAS | /TRiAS/TRiAS/TRiAS/Obsolete (Win16 etc.)/IRISOPEN.HXX | ISO-8859-1 | 1,135 | 2.625 | 3 | [] | no_license | // Dialogfensterklasse fr DB erffnen
// File: IRISOPEN.HXX
#if !defined(_IRISOPEN_HXX)
#define _IRISOPEN_HXX
// OpenDialogfenster
class OpenDBDialog : public DialogWindow {
// Buttons
PushButton OKButton, CancelButton;
CheckBox ROCheckBox;
// FileListBoxes
FileListBox FileList;
// EditFenster
Sing... | true |
db06ff792afbd43114e25f2c690e01b31821c21e | C++ | shgalus/shg | /include/shg/rng.h | UTF-8 | 9,186 | 3.140625 | 3 | [
"MIT"
] | permissive | /**
* \file include/shg/rng.h
* Random number generator.
* \date Created on 11 December 2011.
*/
#ifndef SHG_RNG_H
#define SHG_RNG_H
#include <iostream>
#include <shg/vector.h>
namespace SHG {
/**
* \defgroup random_number_generator Random number generator
*
* Random number generator.
*
* \{
*/
/**
* A ... | true |
e78cbc09314cf9eac18833acd457cffec10be91a | C++ | FRCTeam1073-TheForceTeam/preseason2012 | /CS Lectures on OOP/RookieOOP/RookieOOP/AnimalDemo.cpp | UTF-8 | 1,598 | 3.25 | 3 | [] | no_license | //
// main.cpp
// RookieOOP
//
// Created by Irfan Ugur on 11/4/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#include <iostream>
#include <string>
#include "Animal.h"
#include "Fish.h"
#include "Quadrupedal.h"
#include "Dog.h"
#include "Beagle.h"
#include "Cat.h"
void printAnimalInfo(Anima... | true |
aaee83118374861e55b0000fadae21facdb850fa | C++ | TTilenB/Programiranje1 | /naloga04e.cpp | UTF-8 | 438 | 3 | 3 | [] | no_license | #include <iostream>
#include <math.h>
using namespace std;
int main ()
{
int n, m = 1, a;
cout << "Vnesite število za dimenzijo: " << endl;
cin >> n;
cout << "\n" << endl;
a = n + 7;
for(int i = n; i >= 1; --i)
{
cout << a;
a = a - 2;
for(int j = 1; j <= i; ++j)
{
cout << "+ ";... | true |
294d83fe18e43bb6c570ce21ecb78bd7021454dc | C++ | sagregas/Leetcode | /CPP_Solutions/PalindromeNumber.cpp | UTF-8 | 447 | 3.203125 | 3 | [] | no_license | class Solution {
public:
bool isPalindrome(int x) {
if(x < 0) return false;
if(x / 10 == 0) return true;
std::stack<int> stk;
int num = x;
while(num != 0){
stk.push(num%10);
num = num/10;
}
while(x != 0){
if(stk.top() != x%10){
return ... | true |
9f4e6d7d2dce078f31dde50033df9ef2cf30af39 | C++ | AdeelZafar907/math.h-library-complete-calculator- | /math.h/Matrix.h | UTF-8 | 473 | 2.8125 | 3 | [] | no_license | #pragma once
class matrix
{
int row;
int column;
public:
void set_row(int);
void set_col(int);
int get_row();
int get_col();
void get_additionOfMatrix(int**,int**,int,int);
void get_subtractionOfMatrix(int**, int**,int,int);
void get_multiplicationOfMatrix(int**, int**,int,int,int);
void get_dete... | true |
c1689905a8bf38a822b5c46f3a51e62bacf5d9e2 | C++ | hvvka/ncurses-threading | /src/learning/2cpp/main.cpp | UTF-8 | 355 | 2.609375 | 3 | [] | no_license | #include <ncurses.h>
using namespace std;
int main(int argc, char** argv)
{
initscr();
int x, y;
x = y = 10;
// moves the cursor to the specified location
move(y, x);
printw("Hello move!");
refresh();
int c = getch();
// clears the screen
clear();
mvprintw(0, 0,"%d", c);
refresh();
g... | true |
17f2bd25a76087b34a783e54e50a4e420e7bedd8 | C++ | SimonGido/Dot_Engine | /Dot_Engine/src/Dot/PhysicsEngine/PhysicsSystem.cpp | UTF-8 | 1,238 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | #include "stdafx.h"
#include "PhysicsSystem.h"
namespace Dot {
void PhysicsSystem::Update(float dt)
{
for (int i = 0; i < m_Entities.size(); ++i)
{
auto transform = &ECSManager::Get()->GetComponent<Transform>(m_Entities[i]);
auto& rigidBody = ECSManager::Get()->GetComponent<RigidBody>(m_Entities[i]);
t... | true |
916cc16f17d33472fb6114863d5da31897381484 | C++ | wwuhn/wwuhn.github.io | /witisoPC/32cpp/贺利坚/overall/自定义顺序栈解决迷宫问题.cpp | GB18030 | 3,397 | 3.140625 | 3 | [] | no_license | #include <iostream> // Զ˳ջԹ
#include <iomanip>
#include <cstdlib>
using namespace std;
#define MaxSize 100
int maze[10][10] = //һԹ0ʾͨ1ʾǽ
{
{1,1,1,1,1,1,1,1,1,1},
{1,0,0,1,1,0,0,1,0,1},
{1,0,0,1,0,0,0,1,0,1},
{1,0,0,0,0,1,1,0,0,1},
{1,0,1,1,1,0,0,0,0,1},
{1,0,0,0,1,0,0,0,0,1},
... | true |
874bf479fe91818d401eee8222fe15549a200127 | C++ | visvasuthar/CMPE152-Project1 | /Word.cpp | UTF-8 | 492 | 2.890625 | 3 | [] | no_license | //
// Created by Luis on 2/7/2020.
//
#include <iostream>
#include "Word.h"
#include "Tag.h"
#include "Token.h"
using namespace std;
Word::Word(){
*AND = Word("&&", tag.AND);
*OR = Word("||", tag.OR);
*eq = Word("==", tag.EQ);
*ne = Word("!=", tag.NE);
*le = Word("<=", tag.LE);
*ge = Word... | true |
93013dbe7582b5e2451df911eb9c1652070d4657 | C++ | Dev-LucasReis/Estruturada-de-Dados-C- | /Atividades/ParPos.cpp | UTF-8 | 657 | 3.53125 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <stdlib.h>
using namespace std;
class PosPar{
public:
int n;
void entrada(){
cout <<"Digite um numero:" <<"\n";
cin >> n ;
}
bool VerificaPosPar(){
if(n >= 0 && n % 2 == 0){
return true;
}else{
return false;
}
}
int cont(){
int aux = 1;
while(VerificaPo... | true |
83d7fd7346aebfe08ac5cc4944462009e23795a0 | C++ | xRiveria/Amethyst | /Amethyst/Source/RHI/RHI_DescriptorSetLayoutCache.cpp | UTF-8 | 6,380 | 2.703125 | 3 | [] | no_license | #include "Amethyst.h"
#include "RHI_DescriptorSetLayoutCache.h"
#include "RHI_Shader.h"
#include "RHI_Pipeline.h"
#include "RHI_DescriptorSetLayout.h"
namespace Amethyst
{
RHI_DescriptorSetLayoutCache::RHI_DescriptorSetLayoutCache(const RHI_Device* rhi_Device)
{
m_RHI_Device = rhi_Device;
//Set the descriptor s... | true |
99f37ae3edf349104cbbe6370dbbc1ffd9313312 | C++ | mdross95/Tic-Tac-Toe | /test.cpp | UTF-8 | 7,436 | 2.859375 | 3 | [] | no_license | #include <vector>
#include "AIPlayer.hpp"
#include "Board.hpp"
#include "CreatePlayers.hpp"
#include "Game.hpp"
#include "InputOutput.hpp"
#include "HumanPlayer.hpp"
#include "Player.hpp"
#include "SetupGame.hpp"
#include "Spot.hpp"
using namespace std;
void testBoard()
{
Board board;
Player* p1ptr = new Hum... | true |
167fe48134820edaf323b27db733d7484f69b869 | C++ | necros0/battletanks | /BattleTanks/Menu.cpp | UTF-8 | 1,100 | 2.984375 | 3 | [] | no_license | #include "Menu.h"
#include "Game.h"
#include "Vec2.h"
#include <iostream>
Menu::Menu(std::string title) :
mTitle(title, *Game::Font().get("resources/font/Ubuntu-M.ttf"), 50)
{
mTitle.setOrigin(Vec2(mTitle.getLocalBounds().width * 0.5f, mTitle.getLocalBounds().height * 0.5f));
Vec2 labelOrigin = Vec2(WINDOW_WIDTH *... | true |
cee5fe9f7aa1a3d05ece9b96b70f0b90dd877e72 | C++ | MasterHoracio/Uva | /10013/10013.cpp | UTF-8 | 776 | 2.5625 | 3 | [] | no_license | #include <cstdio>
using namespace std;
int n1[1000000];
int n2[1000000];
int re[1500000];
int main()
{
int cases, len, carry, sum;
scanf("%d",&cases);
while(cases--){
scanf("%d",&len);
for(int i = 0; i < len; i++)
scanf("%d %d",&n1[i],&n2[i]);
carry... | true |
9a9628268f2e393852ff61f671ae5f2b83993134 | C++ | Elendeer/homework | /operating_system/process_scheduling_algorithm/round_robin_scheduling.cpp | UTF-8 | 4,676 | 3.421875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <string>
#include <list>
using namespace std;
// ===== =====
class Process {
private:
string _name;
int _arrival_time, _served_time, _priority;
// _time_tarting = -1 by default, means haven't start yet.
int _time_remaining, _time_starting;
public:
Process(string name,
int arriva... | true |