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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
399fafc168e4c039beb29bfd34f24c11a37b1ce9 | C++ | tistatos/complex-terrain | /include/terrain.h | UTF-8 | 1,938 | 2.65625 | 3 | [] | no_license | /**
* @file terrain.h
* @author Erik Sandrén
* @date 07-08-2016
* @brief Complex terrain
*/
#ifndef __TERRAIN_H__
#define __TERRAIN_H__
#include <GL/glew.h>
#include <glm/glm.hpp>
#include <queue>
class Chunk;
class Camera;
class Terrain {
public:
Terrain();
void initialize(Camera* camera);
void render();
... | true |
1a26072f5b7e96695d868f908781380281ec37ae | C++ | lena390/webs | /Server/Serv.cpp | UTF-8 | 6,341 | 2.515625 | 3 | [] | no_license | #include "Serv.hpp"
Serv::Serv( void )
{
this->_port = 0;
this->_decodedBody = "";
}
Serv::Serv( int port, Inside & info )
{
this->_port = port;
this->_servInfo = info;
this->_decodedBody = "";
}
Serv::Serv( const Serv& serv )
{
this->_addr = serv._addr;
this->_port = serv._port;
this->_request = serv._reque... | true |
ca287bd7daf114bd6409bea23bfe0a52614f95e0 | C++ | brenomfviana/mago | /src/maze/cell.cpp | UTF-8 | 800 | 2.640625 | 3 | [
"MIT"
] | permissive | /*
This file is part of MAGO.
Copyright (c) 2019 by Breno Viana
MAGO is a free software; you can redistribute it and/or modify it under the
terms of the MIT License.
*/
#include "maze/cell.hpp"
Cell::Cell() {
this->north = true;
this->east = true;
this->south = true;
this->west = true;
}
bool Cell:... | true |
d707ecc41e0a73c7c9b63ad62eb0e1d8e4794988 | C++ | Mrudul-Bhatt/DS-Algo | /Heap/7)MergeKSortedArrays.cpp | UTF-8 | 1,171 | 3.5625 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct Triplet
{
int val, aPos, vPos;
Triplet(int v, int ap, int vp)
{
val = v;
aPos = ap;
vPos = vp;
}
};
struct MyCmp
{
bool operator()(Triplet &t1, Triplet &t2)
{
return t1.val > t2.val;
}
};
vector<int> merge... | true |
1e80e72e017f154d86e79ddf936efd2d7c36b36f | C++ | BreX900/LearningCpp | /classeTipizzate/threeTree.h | UTF-8 | 896 | 2.875 | 3 | [] | no_license | //
// Created by brexm on 05/11/2018.
//
#pragma once
#include <iostream>
template <class T>
class ThreeTree;
template <class T>
std::ostream& operator<<(std::ostream&, const ThreeTree<T>&);
template <class T>
class ThreeTree {
friend std::ostream& operator<<(std::ostream&, const ThreeTree<T>&);
private:
cla... | true |
b70c0fa22c032f505e8baddd4a80316a204a46ae | C++ | andyreimann/gear | /v2.5/GEAR Core/Entity.cpp | UTF-8 | 1,061 | 2.828125 | 3 | [] | no_license | // GEAR 2.5 - Game Engine Andy Reimann - Author: Andy Reimann <andy@moorlands-grove.de>
// (c) 2014 GEAR 2.5
#include "Entity.h"
using namespace G2;
unsigned int Entity::UNINITIALIZED_ENTITY_ID = 0;
unsigned int Entity::LAST_ENTITY_ID = 1;
Entity::Entity()
: mId(++LAST_ENTITY_ID)
{
// register entity?
// or no:... | true |
2f4bff4de95281998b79d0f5af37279ddce92208 | C++ | sparshgoyal2014/gfgcodes | /Queuereverse/main.cpp | UTF-8 | 628 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <stack>
using namespace std;
// test
void reverseQueue(queue<int> q){ // it is pass by value // If you do this copy of the whole queue is passed and any changes will remained in the copied queue
if(q.empty()){
return;
}
int x = q.front();
q.p... | true |
c8b397419082599453f58999417dae7e189ccdc3 | C++ | HotCapuchino/Basics-of-Programming | /Графы/Графы/main.cpp | UTF-8 | 2,708 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include "Graph.h"
#include <fstream>
#include <float.h>
#include "GraphAlgorithms.h"
using namespace std;
int main(void) {
/*Test graph*/
/*Node node1 = Node("Moscow");
Node node2 = Node("Saints Peterburg");
Node node3 = Node("Ekaterinburg");
Node node4 = Node("Irkutsk");
Graph ... | true |
ddefe0e6bcbf512e679be6dd09cfee7b559f12c1 | C++ | lizhanyin/D3D9V2 | /Console/GPShader.cpp | GB18030 | 2,254 | 2.625 | 3 | [
"MIT"
] | permissive | #include "GPShader.h"
GPShader::GPShader(const TCHAR _file[])
{
std::cout << "[" << this << "]" << "GPShader::GPShader()\t" << std::endl;
m_d3dDevice = GetDevice();
lstrcpy(file, _file);
Load();
}
GPShader::~GPShader()
{
std::cout << "[X]" << "[" << this << "]" << "GPShader::~GPShader()\t" << std::endl;
if (mCo... | true |
c08a17bcf8ccd7a2cd88d6f31c16f4ec29e61985 | C++ | flopp/qubistic | /src/settings.h | UTF-8 | 1,684 | 2.578125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <QtCore/QSettings>
enum class ShapeType
{
Triangles = 1,
Rectangles = 2,
RectanglesRotated = 5,
Circles = 4,
Ellipses = 3,
EllipsesRotated = 7,
Polygons = 8,
Beziers = 6,
Mixed = 0
};
enum class TargetType
{
Steps,
Score
};
class Settings
{
publi... | true |
cc3ddc0b0c229b6815d986874bdcbd30df180e1f | C++ | ifish19/CS172-HW3 | /StringSorter.cpp | UTF-8 | 288 | 2.90625 | 3 | [] | no_license | #include<iostream>
#include<string>
#include "StringSorter.h"
using namespace std;
string sort(string& s)
{
string sSorted;
char c;
for(int i = 0; i < 26; i++)
{
c = i + 97;
if(s.find(c) != string::npos)
sSorted.append(1, c);
}
s = sSorted;
return s;
} | true |
19a827106a42033bb3994a1c2458af097c337cc1 | C++ | oblockiy/read-it-and-weep-simply-geometry | /Parallelepiped/Parallelepiped.h | UTF-8 | 698 | 2.546875 | 3 | [] | no_license | #ifndef PARALLELEPIPED_H
#define PARALLELEPIPED_H
#include <QVector>
class Parallelepiped
{
private:
QVector <int> p_ppEdges={0,0,0};
int p_ppV;
int p_ppS;
public:
Parallelepiped(QVector <int> ppEdges, int ppS, int ppV);
void set_PP(QVector <int> ppEdges, int ppS, int ppV);
QVector<int> ge... | true |
e7f1d874fe6ac283ae4b29213198b2a335365c26 | C++ | gloryXmj/ShapeDemo | /Algorithm/FillControl.cpp | UTF-8 | 11,958 | 2.640625 | 3 | [] | no_license | #include "FillControl.h"
#include "PixControl.hpp"
#include "pixshape.h"
#include <QDebug>
#include <stack>
namespace SCAN_LINE_FILL {
FillControl::FillControl()
{
}
FillControl::FillControl(FillControl::Polygon *polygon)
{
this->polyGon = polygon;
}
void FillControl::setPolygon(Mcoder::Polygon *polygon)
{
... | true |
a3cd6063bf6e5348f6fa10fc247e4ec6f80aaaeb | C++ | MarkiianAtUCU/IPC_Crossplatform | /src/MySharedMemory.cpp | UTF-8 | 4,326 | 2.859375 | 3 | [] | no_license | //
// Created by andriiprysiazhnyk on 12/27/19.
//
#ifdef _WIN32
#include "MySharedMemory.h"
#elif __linux__ || __APPLE__
#include "MySharedMemory.h"
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#endif
bool MySharedMemory::create(size_t size) {
#ifdef _WIN32
this->mapping_size = size;
m... | true |
6513b06a78190707b1fe567c91486e71859e11ae | C++ | 4ndrenobr3/EstruturaDeDados | /ponteiro.cpp | UTF-8 | 757 | 3.78125 | 4 | [] | no_license | #include <iostream>
#include <cstdlib>
using namespace std;
struct nodo
{
int num;
struct nodo *prox;
};
nodo *insereFrente(nodo *ptr, int valor);
int main()
{
int c;
nodo *lista=NULL;
//Primeito no
lista = insereFrente(lista, 23);
//Segundo no
lista = insereFrente(lista, 13);
//Terceiro no
lista = i... | true |
5dff9b435e391c04b97bbb7cf7f7d08ed55d21f0 | C++ | kor-kms/AlgoCode | /기타/14500_테트로미노(백준).cpp | UHC | 3,553 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int ar[500][500];
int ans;
int cou;
int n, m;
void input() {
cin >> n >> m;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> ar[i][j];
}
}
}
void solve() {
//1
for (int i = 0; i < n; i++) {
for (int j = 0; j < m - 3; j++) ... | true |
8286b1e53639da2912ce48e6694af53931da9afc | C++ | asdzxc55888/DesignPattern_hw | /assignment4/src/main.cpp | UTF-8 | 440 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include "io.h"
#include "library.h"
int main(int argc, char **argv) {
Library library;
while (true) {
printInstructions();
std::string instruction;
std::cout << "Input instruction: ";
std::getline(std::cin, instruction, '\n');
std::... | true |
c3760da3a4cf25939453602b322686de67adf947 | C++ | sonuKumar03/data-structure-and-algorithm | /codeforces/CF78B.cpp | UTF-8 | 333 | 2.859375 | 3 | [
"MIT"
] | permissive | #include<iostream>
#include<math.h>
using namespace std;
void solve(){
int n;
cin>>n;
string a ="GBIV";
if(n<7){
cout<<"Wrong!";
}else{
cout<<"ROYGBIV";
}
n = n-7;
for(int i =1;i<=n/4;i++){
cout<<a;
}
n=n%4;
string b ="";
for(int i =0;i<n;i++){
b=b+a[i];
}
cout<<b<<endl;
}
int main(){
solve();... | true |
7b15628192d188034f7c1158b0e117042afb613e | C++ | AmanajasLG/IDJ | /src/Minion.cpp | UTF-8 | 2,743 | 2.640625 | 3 | [] | no_license | #include "../include/Minion.h"
#include "../include/Sprite.h"
#include "../include/Bullet.h"
#include "../include/Game.h"
#include "../include/Collider.h"
#include "../include/Alien.h"
#include <math.h>
Minion::Minion(GameObject &associated, std::weak_ptr<GameObject> alienCenter, float arcOffsetDeg) : Component(associ... | true |
11852d97fb4dfc742c0f44b13e933bcdd9742a90 | C++ | paraagm/StringLibrary | /StringLibrary/string.h | UTF-8 | 1,343 | 3.109375 | 3 | [] | no_license | #pragma once
//#ifdef MSC_VER
//
//#define _CRT_SECURE_NO_WARNINGS
//#pragma warning(disable : 4996)
//
//#endif // MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable : 4996)
#include <cstdlib>
#include <cstring>
#include <locale>
class string
{
char* _str;
size_t _len;
public:
string();
string(cons... | true |
b06059f698aafeb3090427a0ea5ceb5dd12cd925 | C++ | Zerphed/computer-graphics-course | /2012/assignment_2/code/src/basis/Joint.h | UTF-8 | 618 | 2.65625 | 3 | [] | no_license | #ifndef JOINT_H
#define JOINT_H
#include <vector>
#include <base/Math.hpp>
struct Joint
{
FW::Mat4f transform; // transform relative to its parent
std::vector< Joint* > children; // list of children
// This matrix transforms world space into joint space for the initial ("bind") configuration of the joints.
FW::M... | true |
2012a9d3d371f093115ccb1679a780f3e0dac31d | C++ | DongJinNam/boj | /6679.cpp | UTF-8 | 557 | 2.5625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
std::ios::sync_with_stdio(false);
for (int i = 1000; i < 10000; i++) {
int num = i;
int ans_10 = 0, ans_12 = 0, ans_16 = 0;
int temp = i;
while (temp > 0) {
int rm = temp % 10;
temp /= 10;
ans_10 += rm;
}
temp = i;
while (temp > 0) {
... | true |
ffb42fdb25260e6a3143f683b2f05d8a7a3c9fc4 | C++ | codingaquarium/ProgrammingCollection | /MySuccess/11503 - Virtual Friends.cpp | UTF-8 | 1,219 | 2.703125 | 3 | [] | no_license | /*
Shiakh Shiam Rahman
UVa : 11503 - Virtual Friends
*/
#include <iostream>
#include "cstdio"
#include "map"
#include "cstring"
#include "string"
using namespace std;
int par[100010];
int find(int r)
{
if(par[r] < 0)
return r;
return par[r]=find(par[r]);
}
int main()
{
freopen("in.txt","r",stdin... | true |
6520d75b6953a8598e6b7ca5bc80646c417e9a05 | C++ | thecreatorsir/DailyDSA | /recursion/handshake-problem-using-catalan-number.cpp | UTF-8 | 304 | 2.828125 | 3 | [] | no_license | class Solution{
int sum = 0;
public:
int count(int N){
int n = N/2;
return solve(n);
}
int solve(int n){
if(n==0 || n==1)
return 1;
int sum =0;
for(int i=n-1;i>=0;i--){
sum += solve(i)*solve(n-1-i);
}
return sum;
}
};
| true |
4e9deb9dd7e9dc4e290684e57ea2bf5888384f3f | C++ | mpk934/mediasoup | /worker/src/RTC/RTCP/FeedbackPsTst.cpp | UTF-8 | 1,888 | 2.578125 | 3 | [
"ISC"
] | permissive | #define MS_CLASS "RTC::RTCP::FeedbackPsTstPacket"
// #define MS_LOG_DEV
#include "RTC/RTCP/FeedbackPsTst.hpp"
#include "Logger.hpp"
#include <cstring>
namespace RTC { namespace RTCP
{
/* Class methods. */
template <typename T>
TstItem<T>* TstItem<T>::Parse(const uint8_t* data, size_t len)
{
MS_TRACE();
// d... | true |
ea1b43f34080c5e911a5e15690513d02116da5b7 | C++ | veekay7/xphoton | /Raytracer/MemPool.cpp | UTF-8 | 1,266 | 3.015625 | 3 | [] | no_license | #include "stdafx.h"
#include "MemPool.h"
rtOneWayMemPool::rtOneWayMemPool(UINT blockSize, bool aligned)
{
m_blockSize = blockSize;
m_Aligned = aligned;
}
rtOneWayMemPool::~rtOneWayMemPool()
{
release();
}
void* rtOneWayMemPool::alloc(size_t size)
{
//no blocks, create a new one
if (m_Blocks.size() == 0)
{
rt... | true |
b1aadb044673eb07abe049ef91a055d464f3e3bb | C++ | ZenEngine3D/ZenEngine | /Engine/ZenApi/ZenBase/Type/Container/zenBaseTypeListIntrusive.h | UTF-8 | 9,707 | 2.796875 | 3 | [
"MIT"
] | permissive | #pragma once
namespace zen { namespace zenType
{
//! @todo 1 Replace most list with dynamic array with pointer.
//=================================================================================================
//! @brief Macro used to add a ListLink to a class.
//! @note Unless wanting to preserve POD of a class,... | true |
385993bcea11b8319af9a7c714dabce15679b983 | C++ | mfkiwl/BART | /src/quadrature/quadrature_set.h | UTF-8 | 2,963 | 2.640625 | 3 | [
"MIT"
] | permissive | #ifndef BART_SRC_QUADRATURE_QUADRATURE_SET_H_
#define BART_SRC_QUADRATURE_QUADRATURE_SET_H_
#include "quadrature/quadrature_set_i.h"
#include "quadrature/utility/quadrature_utilities.h"
namespace bart {
namespace quadrature {
/*! \brief Default implementation of the QuadratureSet.
*
* @tparam dim spatial dimensio... | true |
8f1d0a0f23a8cb4dde270ce26777c8efdf78f319 | C++ | kaidokert/corona | /include/stm32/stm32h7/device/crc.h | UTF-8 | 5,548 | 2.609375 | 3 | [
"MIT"
] | permissive | #pragma once
////
//
// STM32H7 CRC peripherals
//
///
// CRC: Cryptographic processor
struct stm32h723_crc_t
{
volatile uint32_t DR; // Data register
volatile uint32_t IDR; // Independent Data register
volatile uint32_t CR; // Control register
reserved_t<0x1> _0xc;
volatile uint32_t INIT; /... | true |
f2de5f1cf2c71c57f57cc2b9c401dff862778317 | C++ | shenshengyi/ShenShengYi | /ShenShengYi/UT/UT/School_Test.cpp | UTF-8 | 1,008 | 2.734375 | 3 | [
"MIT"
] | permissive | #include "pch.h"
#include "School_Test.h"
#include <Student.h>
#include <iostream>
using namespace std;
void School_Test::SetUpTestCase(void) {
}
void School_Test::TearDownTestCase(void) {
}
void School_Test::SetUp() {
_shool = STU::School::GetInstance();
}
void School_Test::TearDown() {
STU::School::Release();... | true |
b2ecf20593a8df8025497331667a5ae1523b0e8b | C++ | hakimbalestrieri/INF2 | /recueil_d_exercices_inf2/chapitre_07/exercice_09/main.cpp | UTF-8 | 1,642 | 3.5625 | 4 | [] | no_license |
#include <cstdlib>
#include <iostream>
#include <iomanip>
using namespace std;
class Voiture {
friend void afficherVoiture(const Voiture& voiture);
public:
Voiture(int capacite, float conso) : m_capaciteReservoir(capacite),
m_consoMoyenne(conso) {
m_fuelRestan... | true |
5053ef4c8023a969b27587f2aaafac5e921612ce | C++ | Ccccaramel/C | /Base/CPP/3-强制类型转换.cpp | UTF-8 | 337 | 3.34375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
// C 中的强制类型转换
int m = 5;
double n = (double)m;
cout << "n:" << n << endl;
// C++ 的扩充,使得强制类型转换执行起来像是调用了函数(推荐使用该方法)
int i = 10;
double j = double(i);
cout << "j:" << j << endl;
} | true |
e55b6c2b41ee5c248120dcfccc7e038142d2d8c3 | C++ | ngc2628/swdev | /cpp/app/main.cpp | UTF-8 | 1,067 | 2.53125 | 3 | [] | no_license |
#include <stdio.h>
#include <stdlib.h>
#include <auxx/auxx.h>
#include <osix/xxstyle.h>
int usage() {
printf ("rgb2int color|r,b,g[,a]\n");
return 0;
}
int main(int argc,char **argv) {
if (argc!=2)
return usage();
char *tok=strtok(argv[1],",");
if (!tok)
return usage();
aux::Asciistr str1,st... | true |
6d2ff61d5696a337a6ad79e074e302e673c89085 | C++ | cyb70289/mytests | /memory-order/test2.cc | UTF-8 | 731 | 2.6875 | 3 | [] | no_license | #include <future>
#include <iostream>
#include <thread>
#ifdef __aarch64__
#define mb() __asm__ __volatile__("dmb ish" : : : "memory")
#else
#define mb() __asm__ __volatile__("mfence")
#endif
volatile int x, y;
int f1() {
x = 1;
return y;
}
int f2() {
y = 1;
return x;
}
int main(void) {
long test_... | true |
7677fb8ad77c03b9ebe00fe371538470eb492c99 | C++ | BebeShen/LeetCodePracticeRecords | /Algorithm/1678. Goal Parser Interpretation/Goal Parser Interpretation.cpp | UTF-8 | 542 | 2.796875 | 3 | [] | no_license | class Solution {
public:
string interpret(string command) {
int length = command.length(), p= 0;
string ans = "";
while(p<length){
if(command[p]=='G'){
ans+="G";
p++;
}
else{
if(command[p+1]==')'){
... | true |
eacf0284f35301bd3230867650e0d8d177cad2ca | C++ | Cell-Woworld/cell | /inc/internal/utils/cell_utils.h | UTF-8 | 2,522 | 2.53125 | 3 | [
"MIT"
] | permissive | #ifndef __cell_utils_h__
#define __cell_utils_h__
#include "IBiomolecule.h"
#include "internal/utils/nlohmann/json.hpp"
#include <iomanip>
BIO_BEGIN_NAMESPACE
String EscapeJSONString(const String& in, bool escape_quote)
{
std::ostringstream o;
for (auto c = in.cbegin(); c != in.cend(); c++) {
switch (*c) {
cas... | true |
c97064293ff7dd4b8cec162cfc213711c5b6bae9 | C++ | dqtweb/aixue2 | / aixue2/WeiWeiClient/thirdparty/Theron/Samples/FallbackHandler/Main.cpp | UTF-8 | 3,159 | 3.296875 | 3 | [
"MIT"
] | permissive | // Copyright (C) by Ashton Mason. See LICENSE.txt for licensing information.
//
// This sample shows how to use a fallback handler to catch unhandled messages.
//
#include <stdio.h>
#include <Theron/Actor.h>
#include <Theron/Address.h>
#include <Theron/Framework.h>
#include <Theron/Receiver.h>
//... | true |
8bb939a4a000d029ed0b05bfc7051bca14a8b619 | C++ | lineCode/sprout | /source/base/math/quaternion.inl | UTF-8 | 9,859 | 2.9375 | 3 | [] | no_license | #ifndef SU_BASE_MATH_QUATERNION_INL
#define SU_BASE_MATH_QUATERNION_INL
#include "matrix3x3.inl"
#include "quaternion.hpp"
namespace math {
/****************************************************************************
*
* Generic quaternion
*
**********************************************************************... | true |
344c1e7dab952f18a406dfbb0a64f9f09f86f2e1 | C++ | Mutanne/hiworld | /eng_mecat_bkp/Prog2/lista d 25/E_15.cpp | UTF-8 | 614 | 3.3125 | 3 | [
"Unlicense"
] | permissive | #include<iostream>
#include<stdlib.h>
using namespace std;
//fatorial com recursividade
int fat(int n){
if(n>0){
return(n*fat(n-1));
}
else{ return 1; }
}
int main(){
int n,n2;
char sai;
do{
system("color f0");
system("cls");
cout<<"Digite o numero inteiro: ";
... | true |
3d4d51324b78741d1cf0650fe3c5f6dad52e198f | C++ | suyuan945/LeetCode | /378_KthSmallest/378_KthSmallest.cpp | UTF-8 | 3,269 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <functional>
using namespace std;
class Solution // BST 39ms
{
public:
int kthSmallest(vector<vector<int>>& matrix, int k)
{
int n = matrix.size();
int le = matrix[0][0], ri = matrix[n - 1][n - 1];
int mid = 0;
... | true |
61eab5e3d37a2c4b2f5e19188587c5fe818130ed | C++ | vnesp-donnu/turing | /turing.cpp | UTF-8 | 5,182 | 2.75 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
const int MAX_TIME = 1000;
const int MaxQSize = 100;
const int MaxASize = 100;
const int MaxTapeLen = 10000;
struct DeltaValue {
char newChar;
int newState;
short shift;
bool read(int defaultState, char defaultChar, bool debug) {
newChar = defaultChar;
shi... | true |
a92c9bda50a05e6d9d84ba40eea8717d3662712b | C++ | oyugibillbrian2017/c-codes | /makingtriangle.cpp | UTF-8 | 219 | 2.796875 | 3 | [] | no_license | // a program which prints hello five times on the screen
#include<iostream>
using namespace std;
main()
{
for(int a=1; a<=3; a++)
{
for( int x=1; x<=a; x++)
{
cout<<" * ";
}
cout<<endl;
}
return 0;
}
| true |
fc620baf1789cc080ab02fa2871bcbafa11abc1f | C++ | thomcc/ivcalc | /src/frontend/flagparser.cc | UTF-8 | 9,196 | 2.96875 | 3 | [
"MIT"
] | permissive | #include "flagparser.hh"
#include <cstdint>
#include <sstream>
//#include <cfloat>
#include <cmath>
#include <algorithm>
namespace flag {
using namespace std;
Flag::Flag() : name(""), usage(""), def_value(""), value(nullptr) {}
Flag::Flag(string name, string usage, shared_ptr<Value> v)
: name(name), usage(usage)... | true |
48ec768fd46e7bc3a7917864c4148a990d6f0a2f | C++ | jnannie21/cpp_modules | /module06/ex00/Converter.cpp | UTF-8 | 6,486 | 3.140625 | 3 | [] | no_license | //
// Created by jnannie on 12/27/20.
//
#include "Converter.hpp"
#include <cerrno>
#include <iostream>
static std::string const pseudo[6] = {
"-inff",
"+inff",
"nanf",
"-inf",
"+inf",
"nan"
};
Converter::Converter() {
}
Converter::Converter(Converter const &other) {
*this = other;
}
Converter &Conve... | true |
25141dce46719bf0de05ee888c1a5b0129f3dae5 | C++ | colinsongf/textnet-release | /src/initializer/var_init-inl.hpp | UTF-8 | 1,514 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | #ifndef TEXTNET_VAR_INIT_INL_HPP_
#define TEXTNET_VAR_INIT_INL_HPP_
#include <mshadow/tensor.h>
#include "./initializer.h"
namespace textnet {
namespace initializer {
template<typename xpu, int dim>
class VarInitializer : public Initializer<xpu, dim>{
public:
VarInitializer(std::map<std::string, SettingV> &settin... | true |
2bfe7004bb97295c25d0f2d679056edc00e22ad9 | C++ | wgbartley/rgbpongclock-dev | /ClockFaces/wordclock.cpp | UTF-8 | 4,575 | 2.734375 | 3 | [] | no_license | #ifdef FACE_WORDCLOCK
// #define FACE_WORDCLOCK_NUMBER TOTAL_FACE_COUNT
#define TOTAL_FACE_COUNT_NEW TOTAL_FACE_COUNT + 1
#undef TOTAL_FACE_COUNT
#define TOTAL_FACE_COUNT TOTAL_FACE_COUNT_NEW
#undef TOTAL_FACE_COUNT_NEW
//print a clock using words rather than numbers
void word_clock()
{
DEBUGpln("in word_clock");
... | true |
96e7bae4eaf0895648d443189d582b8984f818fb | C++ | llssyy404/CPP_Standard_Library | /CPP_Standard_Library_4/Deque.cpp | UHC | 1,271 | 3.78125 | 4 | [] | no_license | //-------------------------------------------------------
// C++ ǥ ̺귯
//
// 4. ̳
//
// deque
//-------------------------------------------------------
#include <iostream>
#include <deque>
using namespace std;
struct MyInt {
MyInt(int i) : myInt(i) {}
int myInt;
};
int main()
{
deque<MyInt> myIntDeq;
myIntDeq.... | true |
8a0fa43ec0329b7def98b26263e494772244d473 | C++ | kejhy93/matrix-multiplication | /lib/MatrixMultiplication.h | UTF-8 | 645 | 2.9375 | 3 | [
"MIT"
] | permissive | #ifndef __MATRIX_MULTIPLICATION_H__
#define __MATRIX_MULTIPLICATION_H__
#include <iostream>
#include "Matrix.h"
class MatrixMultiplication {
public:
virtual ~MatrixMultiplication();
virtual Matrix* multiply(const Matrix& left, const Matrix& right) = 0;
/**
* Verify that matrix multiplcation can be applied.
... | true |
fb721c30bfa43830f6a5035453f30ab90e4aa8b1 | C++ | FrankXu7/Timer | /Timer.h | UTF-8 | 2,968 | 3.65625 | 4 | [] | no_license | #pragma once
/**************************************************************************************************
* 基于C++的chrono库实现的简单计时器,是一个单例类,精确到毫秒。
*
* @author FrankX
* @date 2021-04-12
**************************************************************************************************/
#include <unordered_ma... | true |
3b336151fa806f027d743159a8e781294972ef8f | C++ | Handy521/seven-day-become-butterfly | /class_object/Student.cpp | UTF-8 | 456 | 3.140625 | 3 | [] | no_license | #include "Student.h"
void Student::setName(string name)
{
m_strName = name;
}
Student::Student()
{
cout <<"Student"<<endl;
}
Student::Student(const Student &stu)
{
cout<<"Student(const Student& stu)"<<endl;
}
Student::~Student()
{
cout <<"~Student()"<< endl;
}
string Student::getName()
{
return m_strName;
}
void S... | true |
a37938f5e3abc93f61c6d3e5ea39fcab0c3d7672 | C++ | aochernov/MineSweeperSolver | /MineSweeper/PropositionalFormula.cpp | UTF-8 | 4,052 | 3.140625 | 3 | [] | no_license | #include "PropositionalFormula.h"
int PropositionalFormula::NameCounter;
PropositionalFormula::PropositionalFormula(bool sign, std::string name)
{
Type = VARIABLE;
Sign = sign;
if (name == "0")
{
Sign = !Sign;
Name = "";
}
else if (name == "1")
{
Name = "";
}
else
{
Name = name;
}
}
void Propositi... | true |
e612e7c6bfb2053dbdccd2538fc889a13c80ab3e | C++ | hamance/AlgoCode | /DataStructure/Bag_Class_Example/Bag.h | UTF-8 | 3,202 | 3.765625 | 4 | [] | no_license | // FILE: Bag.h
// CLASS PROVIDED: Bag
//
// TYPEDEF and MEMBER CONSTANTS for the Bag class:
// typedef ____ value_type
// Bag::value_type is the data type of the items in the bag. It may be
// any of the C++ built-in types (int, char, etc.), or a class with a
// default constructor, an assignment opreato... | true |
dc3165f8e4796dc5efd3ed55546cc0f0918e2724 | C++ | jackp83/midioverble | /src/ble/BLEReceiver.cpp | UTF-8 | 2,404 | 2.921875 | 3 | [] | no_license | /*
* BLEReceiver.cpp
*
* Created on: 29 apr 2016
* Author: jack
*/
#include "BLEReceiver.h"
BLEReceiver::BLEReceiver() {
}
BLEReceiver::~BLEReceiver() {
}
/*
* Sets up a Bluetooth Low Energy socket with L2CAP using a low security level
* Returns the socket if succesful otherwise it returns -1
*/
int... | true |
7194f4109fc9bba627899520a237f938f3e4186e | C++ | CIA-hideout/pongstar | /src/textureManager.cpp | UTF-8 | 1,842 | 2.828125 | 3 | [
"MIT"
] | permissive | #include "textureManager.h"
//=============================================================================
// Constructor
//=============================================================================
TextureManager::TextureManager() {
texture = nullptr;
width = 0;
height = 0;
file = nullptr;
graphics = nullptr... | true |
275d90c6d0e56e968cf61ec70390b796a3e1024b | C++ | ihsuy/CTCI | /chapter16_Moderate/sumSwap.cpp | UTF-8 | 2,601 | 3.390625 | 3 | [] | no_license | #include <math.h>
#include <algorithm>
#include <bitset>
#include <chrono>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#... | true |
709fe845fef7774503a13049b8f01c5039614665 | C++ | jwcurnalia/first | /CSIS2610/quasiBST.cc | UTF-8 | 813 | 3.421875 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
struct Person {
string name;
int left,right;
};
Person people[10];
int insert(int r,int n) {
if (r == -1)
return n;
if (people[n].name > people[r].name)
people[r].right = insert(people[r].right,n);
else
people[r].left = insert(people... | true |
d16a209851d5d4c8e30cc41ba87ba249d6e5d594 | C++ | yadamit/8th_sem_courses | /PPC_solutions-yadamit/cp3b/cp.cc | UTF-8 | 3,644 | 2.796875 | 3 | [] | no_license | #include "cp.h"
#include<cmath>
#include <new>
#include<cstdlib>
#include <x86intrin.h>
#include<iostream>
typedef float float8_t __attribute__ ((vector_size (8 * sizeof(float))));
static float8_t* float8_alloc(std::size_t n) {
void* tmp = 0;
if (posix_memalign(&tmp, sizeof(float8_t), sizeof(float8_t) * n)) {... | true |
3706ebe06ac10d54c2fcfc9b6c8e7c48a895b0e9 | C++ | sjs108u/OOP | /17.cpp | UTF-8 | 252 | 3.078125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int x, y, tmp;
while(cin >> x >> y){
while(x % y != 0){
tmp = y;
y = x % y;
x = tmp;
}
cout << y << endl;
}
}
| true |
83a92825eadca76907d00f7b9fd0aaef7f706e36 | C++ | yes99/practice2020 | /알고리즘과제/2/functions.cpp | UTF-8 | 8,369 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <cstring>
#include <string>
using namespace std;
// ii >>
// oo <<
struct music
{
int rank;
string name;
string singer;
string album;
int like;
};
void bubblerank(music m[], int n)
{
int flag, i, j;
music t;
for (i = 1; i <= n - 1; i++)
... | true |
bfd1a7574c2d84dd6381c8498263c06735a9ca3c | C++ | hruskraj/advent-of-code-2019 | /01.cpp | UTF-8 | 388 | 3.15625 | 3 | [] | no_license | #include <cstdio>
#include <algorithm>
using namespace std;
int calculateFuel(int mass){
return max(mass / 3 - 2, 0);
}
int main(){
int a, out1 = 0, out2 = 0;
while(scanf("%d", &a) == 1){
out1 += calculateFuel(a);
while((a = calculateFuel(a)) != 0){
out2 += a;
}
}
... | true |
e96b9124f11deebed4b63c293829c31a14ec3dfc | C++ | micahthomas/COSC-1410 | /Thomas2.cpp | UTF-8 | 1,596 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | // 1410 Program 2
// Author: Micah Thomas
// TA: Can Cao
#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;
int main() {
char ans, ch;
int ans_axle;
float toll;
do {
cout << "\n------------------------------------\n";
cout << " TOLL CALCULATION ... | true |
46ed317d6c5458aa3d71662a2e68f35812439bb3 | C++ | ch3ny1/CSCI-1113-HW | /Labs/Lab 8/cheny004_8A.cpp | UTF-8 | 255 | 2.515625 | 3 | [] | no_license | // Chenyi Wang
// Lab 8 Warm-up 1
a)
Print '*' for n times.
b)
n < 1
c)
A condition that can terminate the recursion.
d)
Yes. When the base case is not met, n is reduced by 1.
e)
Whether the corresponding actions contain a self-calling statement.
| true |
81711a6a8b6f75deebba9a185c67289344ce0246 | C++ | delmontz/arduino | /Arduino/RGBLED_PRE/RGBLED_PRE.ino | UTF-8 | 679 | 2.8125 | 3 | [] | no_license | #include <Adafruit_NeoPixel.h>
// RGBLEDに出力するピン番号
#define RGBLED_OUTPIN 3
// Arduinoにぶら下がっているRGBLEDの個数
#define NUMRGBLED 1
// RGBLEDのライブラリを生成する(色指定はRGBの並びで行う、LEDの速度は800KHzとする)
Adafruit_NeoPixel RGBLED = Adafruit_NeoPixel(NUMRGBLED, RGBLED_OUTPIN, NEO_RGB + NEO_KHZ800);
void setup()
{
RGBLED.begin() ; ... | true |
712c363a92fdecaac6ebcbad84d38e1e0041ac4a | C++ | dingyaguang117/AOJ | /410 蛇形数组/1.cpp | UTF-8 | 663 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
using namespace std;
int a[100][100];
int main()
{
int n,i,j,d,s;
while (cin>>n)
{
d=0;
s=0;
for (i=0;i<n;++i)
{
if (d)
{
for (j=0;j<i+1;++j)
{
a[j][i-j]=++s;
}
d=0;
}
else
{
for (j=i;j>=0;--j)
{
a[j][i-j]=++s;
}
... | true |
45f3d847bf530bcc7ec04d730dc942ca92bdead8 | C++ | aoeasif/ProblemSolving | /UVA/374/9031940_AC_0ms_0kB.cpp | UTF-8 | 549 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
using namespace std;
int bigMod(int base, int power, int mod) {
if(power == 0) return 1;
if(power % 2 == 1) {
int part1 = base % mod;
int part2 = bigMod(base, power-1, mod);
return (part1 * part2) % mod; ;
}
int eq_part = bigMo... | true |
469e87846dccc181e880cc4e362b474e003a53d7 | C++ | joppimenta/URI-Online-Judge-Exercises | /01 - Iniciante/1080 - Maior e Posição.cpp | UTF-8 | 381 | 2.71875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int v[100];
int maior = 0, posimaior = 0;
for(int i = 0; i<100; i++){
cin >> v[i];
}
for(int i = 0; i <100; i++){
if(v[i] > maior){
maior = v[i];
posimaior = i+1;
}
}
cout << maio... | true |
1059f79707b0da11d8f112650694b44452fc9c8f | C++ | va-lang/Lab10 | /readpoints.cpp | UTF-8 | 756 | 2.953125 | 3 | [] | no_license | #include "StabbingLine.h"
void readPoints(ifstream& file,Point p1[],int& numPoints){
if(!file.is_open()){
cout<<"File failed to open"<<endl;
}
file>>numPoints;
for (int i=0; i< numPoints; i++){
cout<<p1[i].Pid<<endl;
}
}
int main(){
ifstream file("points.txt");
int Pid,X,Y;
... | true |
33f6af264e6f8df50b30bf6b54caf70be373ac85 | C++ | DonJohnSmith/c9 | /tund_27_11/inheritance.cpp | UTF-8 | 1,728 | 3.625 | 4 | [] | no_license | #include<vector>
#include <string>
#include <iostream>
using namespace std;
class Shape{
private:
enum tyyp{
KOLMNURK,
RUUT,
RISTKYLIK,
RING
};
tyyp kujundityyp;
int A;
public:
Shape(){
A = 0;
}... | true |
e0f6e6275b56829b66cf222e8edd7e34c01a4a82 | C++ | sshedbalkar/DigiPen_Projects | /CS582/Project_1/Project_1/learning/subsets.h | UTF-8 | 1,574 | 3.265625 | 3 | [] | no_license | #ifndef SUBSETS_H
#define SUBSETS_H
#include <vector>
#include <iostream>
////////////////////////////////////////////////////////////
class Subsets {
public:
Subsets(unsigned int _size) : size(_size), subset_id(0),stop(false) {
}
bool next(std::vector<unsigned int> & subset ) {
if (stop) { return false; }
... | true |
a3a9d41547d3aa7f82394cf0da303fbbdefbbdd2 | C++ | ChiapasDeveloper/203-ACM-Problems-Code | /498.cpp | UTF-8 | 1,316 | 3.140625 | 3 | [
"MIT"
] | permissive | /* Problem: Polly the Polynomial UVa 498
Programmer: Md. Mahmud Ahsan
Description: Horner's Rule
Compiled: Visual Studio .Net
Date: 26-12-05
*/
#include <iostream>
#include <cmath>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;
const long MX = 1000000;
double ... | true |
2622b2763d08d47bf129af68854470089b20982c | C++ | TomkneZ/Dll_Injection | /Dll/dllmain.cpp | UTF-8 | 1,836 | 2.609375 | 3 | [] | no_license | // dllmain.cpp : Defines the entry point for the DLL application.
#include "pch.h"
#include <Windows.h>
#include <process.h>
#include <vector>
#define DLL_EXPORT __declspec(dllexport)
using namespace std;
extern "C" void DLL_EXPORT __stdcall ReplaceStr(DWORD pid, const char* search, const char* replace)
{
HANDLE... | true |
17fdb3dae8fe549ec60e9f5b84b9453759f96f2a | C++ | zjzdy/Offline-small-search | /history_obj.h | UTF-8 | 1,124 | 2.796875 | 3 | [
"OpenSSL"
] | permissive | #ifndef HISTORY_OBJ_H
#define HISTORY_OBJ_H
#include <QObject>
class history_obj : public QObject
{
Q_OBJECT
Q_PROPERTY(bool img READ img WRITE setImg NOTIFY imgChanged)
Q_PROPERTY(QString str READ str WRITE setStr NOTIFY strChanged)
Q_PROPERTY(QStringList search_type READ search_type WRIT... | true |
6de8d26af0d720b5d5515fd35417a3a1debf4888 | C++ | fascinatingwind/BerkeleyServer | /BerkeleyServer/BerkeleyNetwork/src/SockBase.cpp | UTF-8 | 349 | 2.640625 | 3 | [] | no_license | #include "SockBase.h"
namespace Network {
int SockBase::GetSock() const {
return m_sock_fd;
}
bool SockBase::operator==(const SockBase &other) const {
return m_sock_fd == other.m_sock_fd;
}
bool SockBase::operator==(std::shared_ptr<SockBase> other) const {
return m_sock_fd... | true |
8f2c9957c5debeb6b2b10711c70c334274bfd7a1 | C++ | atp867/CSCI262-Ass3 | /activity.cpp | UTF-8 | 10,627 | 3.34375 | 3 | [] | no_license | /*************************************
* CSCI262 Assignment 3
* Intrusion Detection
* activity.cpp :Activity file
* 13/10/2018
* <Anthony Pham - atp867 - 5146562>
* <Daniel Nichols - dn688 - 5728356>
* <Olivia Followes - of767 - 5395707>
*************************************/
/*
Do we need even distribut... | true |
cab72edda1176149ba3f5f8d37647288429a50bf | C++ | pescoboza/Genesia | /SpriteSheet.h | UTF-8 | 1,407 | 2.703125 | 3 | [] | no_license | #ifndef SPRITE_SHEET_H
#define SPRITE_SHEET_H
#include <unordered_map>
#include <memory>
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include "Anim_Base.h"
#include "TextureManager.h"
#include "Utilities.h"
using Animations = std::unordered_map < std::string, std::unique_ptr<Anim_Bas... | true |
371b2cfeb82e5a0cdac25d00c8f0cbe84f59d43e | C++ | zybin2756/malgorithm | /Tools/sorttesthelper.h | UTF-8 | 1,884 | 3.484375 | 3 | [] | no_license | #ifndef SORTTESTHELPER_H
#define SORTTESTHELPER_H
#include <ctime>
#include <iostream>
#include <string>
#include <cassert>
#include <stdlib.h>
#include <iomanip>
using namespace std;
namespace SortTestHelper {
template<typename T>
bool isSorted(T arr[], int n){
for(int i = 1; i < n; ++i){... | true |
cdc550b8327cd953e4012b21b94e82f71c323927 | C++ | beached/robot | /roomba/tests/cameratest.cpp | UTF-8 | 1,297 | 2.796875 | 3 | [] | no_license | #include <boost/thread.hpp>
#include <cstdlib>
#include <iostream>
#include "camera.h"
#include "opencvimage.h"
int main( int argc, char** argv ) {
const int interval = 1000;
int width = -1;
int height = -1;
if( argc > 1) {
std::stringstream ss;
ss << argv[1];
ss >> width;
ss.str( std::string( ) );
ss.cl... | true |
ac63b74d0b58b31e22e3a00bb1e7ae97c56c8902 | C++ | Pimed23/UNSA | /CC1_Programs/CC_Teoria/Practica_2/15_MCD.cpp | UTF-8 | 453 | 3.609375 | 4 | [] | no_license | #include <iostream>
using namespace std;
int mcd( int x, int y ) {
if ( y == 0 )
return x;
else
return mcd( y, x % y ); }
int main() {
int a, b;
float r;
cout << "Ingrese el primer numero: " << endl;
cin >> a;
cout << "Ingrese el segundo numero: " << endl;
cin >> b;
... | true |
2d541512f638c6d1298ea96ce39116740880f331 | C++ | akkaze/Excercise | /reduce/reduce.hpp | UTF-8 | 2,289 | 2.625 | 3 | [] | no_license | template <typename T> struct GetType;
template <typename T> struct GetType<T*>
{
typedef T type;
};
template <typename T> struct GetType<volatile T*>
{
typedef T type;
};
template <typename T> struct GetType<T&>
{
typedef T type;
};
template <int I,int N> struct For
{
template <class PointerTuple,cla... | true |
8488e1636477eb10a3ac7c510edd4b3fa449fd6b | C++ | cubetrain/CubeTrain | /contracts/libc++/upstream/test/std/utilities/memory/temporary.buffer/temporary_buffer.pass.cpp | UTF-8 | 781 | 2.609375 | 3 | [
"NCSA",
"MIT"
] | permissive | //===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===---------------------------------... | true |
123a69ac5beecc0789ef141bda7f0121501b3e98 | C++ | uchihaitachi08/daily_code | /c++/test2.cpp | UTF-8 | 1,007 | 3.21875 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
long int increment(long int* count, long int nim,long int i, long int j){
long int c = nim^i^j^(i+j);
if(c == 0){
*count = *count + 1;
}
return c;
}
void printarray(vector<long int>*v){
for(int k=0;k<v->size();k++){
cout<<(*v)[k]<<" ";... | true |
2f483f755d8c24779ceb6880802d03705951fec6 | C++ | m516/8BitSynth | /Instrument.cpp | UTF-8 | 2,011 | 2.875 | 3 | [] | no_license | #include "Arduino.h"
#include "Instrument.h"
Instrument::Instrument(){}
void Instrument::setTimber(float sine, float triangle, float sawtooth, float square, float noise){
for(int i = 0; i < SAMPLE_SIZE; i++){
float fi = float(i)/float(SAMPLE_SIZE);
float sample = 0.0; //-1.0 -> 0, 1.0 -> 256
//Add sin func... | true |
07486968c1e937372aff56fd390c30828d408327 | C++ | TalBarYakar/Selection-problem | /project2Adt/BST.h | UTF-8 | 799 | 2.90625 | 3 | [] | no_license | #ifndef _BST_H
#define _BST_H
#include"person.h"
class BSTree
{
private:
int numberOfleaves;
BSTtreeNode *root;
int numberOfComapres;
public:
friend BSTtreeNode;
BSTree();
~BSTree();
BSTtreeNode* find(int key );
void insert(person* newPerson);
person* Delete(person* delPerson);
const int getNumberOfCompares... | true |
9ded9f69573324653fc4bea0e9552b3f22fc0031 | C++ | GriTRini/study | /ACCELERATED/chap9/score10/main.cpp | UTF-8 | 558 | 3.0625 | 3 | [] | no_license | //
// Created by user on 2021-06-07.
//
#include <vector>
#include <iostream>
#include <algorithm>
#include "student_info.h"
#include "grade.h"
using namespace std;
int main()
{
vector<Student_info> students;
Student_info s;
while(s.read(cin)) {
students.push_back(s);
}
sort(students.beg... | true |
2516b3d7457086868b135ab9d66ea163f0003886 | C++ | SunInTeo/FMI-OOP | /Seminar/Week 09 Files/Jedi.h | UTF-8 | 713 | 2.96875 | 3 | [] | no_license | #ifndef JEDI_H
#define JEDI_H
#include <iostream>
#include <fstream>
#include <cstring>
#include <string>
const std::size_t INITIAL_CAPACITY = 2;
const std::size_t INCREASE_STEP = 2;
class Jedi
{
static int version;
char **skills;
std::size_t size;
std::size_t capacity;
int age;
void copy(co... | true |
e875c5d998c86f6468cf64ad0fff0557a9464754 | C++ | shyamalschandra/Kinect-6DSlam | /kinect-6dslam-data-recorder/src/Slam.cpp | UTF-8 | 3,993 | 2.515625 | 3 | [] | no_license | /*
* Slam.cpp
* ofxKinect
*
* Created by Minjae Lee on 4/17/11.
* Copyright 2011 __MyCompanyName__. All rights reserved.
*
*/
#include "Slam.h"
// This might change since this is found in trial-error technique
#define INDEX(x, y) (((w) - (x)) + (y) * (w))
inline std::string Slam::to_string(const int t, in... | true |
916642017acb6ab1b983d78cddfa4c91ad160417 | C++ | Arby3k/Sketch-Draw | /CPong.cpp | UTF-8 | 3,322 | 2.546875 | 3 | [] | no_license | #include "stdafx.h"
#include "CPong.h"
#define BUT1 33
#define BUT2 32
CPong::CPong(int windowX, int windowY, int _comport)
{
mCControl.init_com(_comport);
mCanvas = cv::Mat::zeros(cv::Size(windowX, windowY), CV_8UC3);
//cv::imshow("Window-of-Doom", mCanvas);
}
CPong::~CPong()
{
}
void CPong::update()
{
... | true |
ed56d9f4639840ee1d6a06253e21f34aea13de00 | C++ | msins/NOS | /lab1a/Auto.cpp | UTF-8 | 1,492 | 3.140625 | 3 | [] | no_license | #include <thread>
#include "logging.h"
#include "random.h"
#include "messages.h"
#include "queues.h"
int main(int argc, char *argv[]) {
int registration = std::stoi(argv[1]);
int direction = std::stoi(argv[2]);
Car car = {registration, direction};
key_t carQueueKey = CAR_QUEUE_KEY;
key_t commandQu... | true |
69f770b079eca76023b5e080fc4357167bcf32ff | C++ | franciscoSoler/nebla | /distribuidos/Duran/ej5/src/IPC/SharedMemory/AbstractSharedMemory.cpp | UTF-8 | 1,974 | 2.8125 | 3 | [] | no_license | #include "AbstractSharedMemory.h"
#include "../IPCException.h"
AbstractSharedMemory::AbstractSharedMemory () {
}
AbstractSharedMemory::~AbstractSharedMemory() {
}
int AbstractSharedMemory::getSharedMemory(char *fileName, int id) {
this->getId(fileName, id, 0666);
return this->attachMemory();
}
int AbstractShare... | true |
1baefdcb1e250337c11fc4fc2e21127b30ea6ea0 | C++ | sytu/cpp_primer | /ch05/5_7_correction.cpp | UTF-8 | 535 | 3.71875 | 4 | [] | no_license | //a.
if (ival1 != ival2)
ival1 = ival2; // add semicolon at here
else ival1 = ival2 = 0;
//b.
if (ival < minval) { // Braces needed to include both satetments in scope.
minval = ival;
occurs = 1;
}
//c.
if (int ival = get_value())
cout << "ival = " << ival << endl;
else if (!ival) // Second if statement sho... | true |
8bddb107c39193d357936b7f165a8543b7a994ae | C++ | wlau006/endre_test | /notes and extra/rletest.cpp | UTF-8 | 1,290 | 2.90625 | 3 | [] | no_license | #include "rle.h"
#include <iostream>
int main(){
//std::string hello = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x42\x42\x42\x42\x42\x42\x42";
std::string hello = "how many shrimp do you have to eat, before you make your skin turn pink, eat too much and you'll get sick, shrimp are pretty rich";
rle thing;
std:... | true |
0e47b8e23de041a57aa17ee126eff09d5fe98746 | C++ | programmerQI/CSCI2270 | /hw2/hw2n.cpp | UTF-8 | 4,706 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <fstream>
#define ARRAYSIZE_IGNOREWORDS 50
#define STARTSIZE_UNIQUEWORDS 100
int arraysize_uniquewords = STARTSIZE_UNIQUEWORDS;
int dtimes = 0;
struct WordItem{
std::string word;
int count;
WordItem() : word(""), count(0) {}
};
WordItem* doubleArray(WordItem o... | true |
aa33f75d7f274ae911b77b3660a66ea1fd7beb9a | C++ | yaelhava/MasterMind | /SmartGuesser.hpp | UTF-8 | 552 | 2.625 | 3 | [] | no_license | #include <string>
#include "Guesser.hpp"
#include "calculate.hpp"
#include <list>
using namespace std;
namespace bullpgia{
//this class represents a smart guesser that crack the code in 100 turns
class SmartGuesser : public bullpgia::Guesser{
private:
list<string> list; //will ... | true |
d7ae08a323e4acb9b9a284cb27dbbf98b7b55306 | C++ | ankelesh/qTagger | /Tagger/Widgets/AuthorTabWidget.h | UTF-8 | 2,214 | 2.5625 | 3 | [] | no_license | #pragma once
#include "CharacterTabWidget.h"
#include "Widgets/TagHolder.h"
/*
This file contains specialized widget for managing author tags
AuthorTabWidget - QWidget child, contains QListWidget and lot of buttons
provides signals:
author_add(Tag) - new author was added to the list
author_erase()... | true |
67fc5ea645c6030f9f9036a894b29834ea4ce89d | C++ | michael-ennis89/DataStructure-Implementations | /LinkedList Integers/LinkedList.hpp | UTF-8 | 469 | 2.96875 | 3 | [] | no_license | /*
File: LinkedList.hpp
Description: Definition for LinkedList Class.
Date: 2/12/2018
Author: Michael Ennis
*/
#ifndef LINKEDLIST_HPP
#define LINKEDLIST_HPP
struct Node
{
int number; // Data element
Node *next; // Next node in LinkedList
};
class LinkedList
{
private:
Node *head;... | true |
21a37aafa50da5cff3fa034216faa55317d4eb9a | C++ | jacobmanning/sandbox | /learn/src/fluent_cpp/expressive_types/inheritance.cc | UTF-8 | 299 | 3 | 3 | [] | no_license | #include <iostream>
#include <named_type.hh>
#include <traits.hh>
using Length = util::named_type<double, struct LengthParameter, traits::Addable, traits::Printable>;
int main()
{
auto x = Length{3.4};
auto y = Length{5.6};
auto total = x + y;
std::cout << "Total = " << total << '\n';
}
| true |
f015e9ffbdb7ad5e1067392be6c1da525bf9eb28 | C++ | minh3td97/Minesweeper- | /src/Cell.cpp | UTF-8 | 1,335 | 3.484375 | 3 | [] | no_license | #include "Cell.h"
#include "Point.h"
#include <iostream>
using namespace std;
Cell::Cell(const int _value, const bool _isWritten, const Point _point, const bool _flag){
value = _value;
isWritten = _isWritten;
coord = _point;
}
Cell::Cell(const int _value, const bool _isWritten){
... | true |
d9aea2d8cf9fbf82db8ad8f7c1fab6c166ff19db | C++ | hjeldin/dojo | /include/dojo/PolyTextArea.h | UTF-8 | 2,458 | 2.6875 | 3 | [
"MIT"
] | permissive | #pragma once
#include "dojo_common_header.h"
#include "Renderable.h"
namespace Dojo
{
class Font;
class Tessellation;
class PolyTextArea : public Renderable
{
public:
enum RenderingType
{
RT_OUTLINE,
RT_SURFACE,
RT_EXTRUDED
};
///creates a new PolyTextArea object at position, using "font", c... | true |
c1ac75f379ad6f9e8e51728b3621275d92eeef33 | C++ | mcolula/CaribbeanOnlineJudge-Solutions | /frankzappa-p1094-Accepted-s800741.cpp | UTF-8 | 1,303 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <utility>
#include <cstdio>
#include <map>
using namespace std;
typedef struct {
int * id;
int * sz;
} UnionFind;
int create(UnionFind * u, int n) {
u->id = new int[n];
u->sz = new int[n];
for(int i = 0; i < n; i++) {
u->sz[i] = 1;
u->id[i] = i;
}
... | true |
b9ccd95a8b3fe50463c1aa86e0be168214df3275 | C++ | GCourtney27/Retina-Engine | /Engine/Graphics/IndexBuffer.h | UTF-8 | 1,207 | 2.546875 | 3 | [
"MIT"
] | permissive | #ifndef IndicesBuffer_h__
#define IndicesBuffer_h__
#include <d3d11.h>
#include <wrl/client.h>
#include <vector>
class IndexBuffer
{
private:
IndexBuffer(const IndexBuffer& rhs);
private:
Microsoft::WRL::ComPtr<ID3D11Buffer> buffer;
UINT indexCount = 0;
public:
IndexBuffer() {}
ID3D11Buffer* Get()const
{
ret... | true |