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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
295c6abe0580d5f1f297c6ad833c206fdd5a17e4 | C++ | lucianaaaaaa/Progetti | /Esame/L3/LetterGrades/LetterGrades.cpp | UTF-8 | 2,099 | 3.828125 | 4 | [] | no_license | //LetterGrades.cpp
//using a switch statement to count letter grades
#include <iostream>
#include <iomanip>
using std::cout;
using std::cin;
using std::fixed;
using std::setprecision;
using std::endl;
int main () {
int total{0}; //sum of grades
unsigned int gradeCounter{0}; //total number of grades
unsigne... | true |
048515fc246bdb6d498a5a6defe3b71f97b08c6a | C++ | heojoung2/Baekjoon | /이친수.cpp | UTF-8 | 357 | 2.671875 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int number;
cin >> number;
long long dp[90][2] = { 0, };
dp[0][0] = 0;
dp[0][1] = 1;
for (int i = 1; i < number; i++)
{
dp[i][0] = dp[i - 1][1]+dp[i-1][0];
dp[i][1] = dp[i - 1][0];
}
cout << dp[number-1][0]+dp[numbe... | true |
df937a5558a3a34c156354d82c46bd648a898e9e | C++ | fgwu/hbuf | /media_cache.cc | UTF-8 | 1,979 | 2.53125 | 3 | [] | no_license | #include <queue>
#include <unordered_map>
#include <queue>
#include <cassert>
#include "media_cache.h"
#include "disk.h"
#include "stats.h"
//#define LIMITED_MEDIA_CACHE_MAPPING
Media_Cache::Media_Cache() { serial_no = 0; }
Media_Cache::~Media_Cache() {}
loff_t Media_Cache::write(ioreq req) {
loff_t start = mq.... | true |
0eafd0da006f5204e86f48ba90590cbc8fdffae1 | C++ | redagito/SymbolicDeriver | /source/Main.cpp | UTF-8 | 1,023 | 3.125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <memory>
#include "AddNode.h"
#include "MulNode.h"
#include "ConstNode.h"
#include "VarNode.h"
#include "Deriver.h"
#include "Printer.h"
int main(int argc, char** argv)
{
// f(x) = 5 * x^2 + 7 * x
// f'(x) = 5 * 2 * x + 7
auto val_2 = std::make_shared<ConstNode>("2");
auto val_5 = st... | true |
dd1b77c56d01b658d27ef3e882bb19ff90134846 | C++ | tectronics/heledd | /software/HELEDDv0_1/HELEDDv0_1.ino | UTF-8 | 19,650 | 2.53125 | 3 | [] | no_license | //*****Some constants used by the device*****
const long day = 86400;
const byte daysInMonth[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const byte pulsePin = 0;
//*****Values used by the pulse sensor*****
volatile int BPM; // used to hold the pulse rate
volatile int Signal; ... | true |
2563f6f58053fe7e7fdb7a61fb1818275c3a2ef0 | C++ | kaiwenHong/cs225git | /potd/potd-q39/main.cpp | UTF-8 | 854 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include "Hash.h"
using namespace std;
int main() {
vector<string> inputs {
"Fourth Doctor",
"Harry Sullivan",
"Leela",
"K9",
"Romana I",
"Romana II",
"Adric",
"Tegan Jovanka",
"Nyssa of... | true |
54d97af8acb6339b69996478a5c90cc4d76eb6da | C++ | 1136863240/cpp-library-github | /HoString.cpp | UTF-8 | 19,522 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include "HoString.h"
bool operator==(char s1, HoString s2) {
HoString _s1(s1);
return (_s1 == s2);
}
bool operator==(char* s1, HoString s2) {
HoString _s1(s1);
return (_s1 == s2);
}
bool operator==(const char* s1, HoString s2) {
HoString _s1(s1);
return (_s1 == s2);
}
bool operator==(std:... | true |
2a0f99e6f6cc8d613ca1016b63c1c598e025f3ac | C++ | ubiratansoares/bira-bachelor-files | /courses/POO/Curso Mello (2009)/Archives/COMP07 Files/exemplos/ex27/ex27.h | ISO-8859-1 | 519 | 3 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
using namespace std;
class Veiculo {
private:
char *placa;
char *marca;
protected:
char *modelo;
public:
int ano;
Veiculo(char *pl, char *ma, char *mo, int an);
void print();
};
class Caminhao: public Veiculo {
private:
float capacidade;
public:
Caminhao(char *pl, char *ma,... | true |
53510a38f8144c5267b0556585c89235ba6775a7 | C++ | LavenSun/IlumEngine | /Source/Ilum/Device/PhysicalDevice.hpp | UTF-8 | 876 | 2.65625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "Graphics/Vulkan/Vulkan.hpp"
namespace Ilum
{
class PhysicalDevice
{
public:
PhysicalDevice();
operator const VkPhysicalDevice &() const;
const VkPhysicalDevice & getPhysicalDevice() const;
const VkPhysicalDeviceProperties & getProperties() const;
const VkPhysicalD... | true |
fb017e82154914ec286a27170729dedf0a1f4ff8 | C++ | PigeonZombie/PewPew | /PewPew/Bouclier.h | ISO-8859-1 | 949 | 3.125 | 3 | [] | no_license | // Classe qui gre les boucliers du joueur
#pragma once
#include "Bonus.h"
namespace PewPew
{
class Bouclier :public Bonus
{
public:
// Constructeur et destructeur
Bouclier(Vector2f position);
~Bouclier();
// Place la texture dans le sprite
void InitGraphiques();
// Dclenche l'action du bouclier
void ... | true |
a058192a795ff8b4d4187846c4a4957284fb3e8a | C++ | gabs505/jazz_harmonizer_app | /PresetsData.h | UTF-8 | 1,263 | 3.203125 | 3 | [] | no_license |
#pragma once
#include<vector>
#include<string>
#include <stdlib.h>
#include <ctime>
std::vector<int>weightsFor251;
std::vector<int>weightsForFifthDown;
std::vector<int>weightsForFourthDown;
int scoreForMajorScheme;
float percentForTSReplacement;
bool replaceWithSD;
std::vector<int> draw(int num) {
srand((unsigned)... | true |
35806494892a25f78eaf9e33a0fd08f9af8290e5 | C++ | YiPan80/ESP8266_PLAY | /ESP8266_PLAY.ino | UTF-8 | 194 | 2.515625 | 3 | [] | no_license |
void setup()
{
pinMode(15, OUTPUT);
}
// the loop function runs over and over again forever
void loop()
{
digitalWrite(15, LOW);
delay(1000);
digitalWrite(15, HIGH);
delay(2000);
}
| true |
ad190b6bd203aa8fcde24e3bf762fbac3a57f72b | C++ | AndyCYao/409Problemsets | /a2/11512Gattaca/11512.cpp | UTF-8 | 2,927 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
vector<int> sufArr;
struct SuffixArray{
const int L;
string s;
vector<vector<int> > P;
vector<pair<pair<int, int>, int > > M;
SuffixArray(const string &s) : L(s.length()), s(s), P(1, vector<int>(L,0... | true |
7cfb0ddec578fd2e1f40a027bad61037b80f8626 | C++ | ryudo87/CPP | /githubLeetcode/Yi Zhang sourcecode/Heap/堆的操作.cpp | UTF-8 | 1,125 | 2.703125 | 3 | [] | no_license | #include "stdafx.h"
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <fstream>
#include <vector>
#include <string>
#include <stddef.h>
#include <algorithm>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <list>
#include <memory... | true |
134f16a2a9af12f52628399afb880a4f882ba232 | C++ | skoppisetty/ads | /dijikstra.h | UTF-8 | 714 | 3.046875 | 3 | [] | no_license | /**
* This is header file to be used by dijikstras implementation.
*
**/
#ifndef DIJIKSTRA_H
#define DIJIKSTRA_H
#include <unordered_map>
#include <vector>
#include <climits>
#include <algorithm>
#include "Fibonacci.h"
#include "leftist.h"
using namespace std;
/**
* Implements dijikstras algorithm
*
* @param ... | true |
f35643322054f03e4839b41d567314b159ef619f | C++ | Jason-1978/MQTT_PubSubClient | /My_MQTT_PubSub.ino/My_MQTT_PubSub.ino.ino | UTF-8 | 6,044 | 2.65625 | 3 | [] | no_license | /*
* My ESP8266 Mosquitto MQTT Publish-Subscribe
* Based on Thomas Varnish (https://github.com/tvarnish)
* PubSubClient API: https://pubsubclient.knolleary.net/api.html
*
*/
#include <Bounce2.h> // Used for "debouncing" the pushbutton
#include <ESP8266WiFi.h> // Enables the ESP8266 to connect to the local netwo... | true |
aa1ffdd6602f89e8226cdfcbc46eec95c49f6c6e | C++ | riley-harper/RayTracer | /code/geom/NormalTriangle.cpp | UTF-8 | 2,036 | 2.890625 | 3 | [] | no_license | #include "geom/NormalTriangle.h"
#include <vector>
#include "core/Vector3.h"
#include "geom/Triangle.h"
#include "geom/Ray.h"
#include "geom/HitInfo.h"
#include "geom/Plane.h"
#include "light/Material.h"
std::vector<Vector3> NormalTriangle::normals_ = std::vector<Vector3>();
NormalTriangle::NormalTriangle(int v1_in... | true |
7fd51a865c9001999345e79eb5e5de9af6d48c1a | C++ | joseph7576/Tic-Tac-Toe | /gs.cpp | UTF-8 | 475 | 2.546875 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
using namespace std;
int main(){
std::cout<<"\n\n\n\t 1 2 3 "<<endl<<"\t-----------------\n";
std::cout<<" A | "<<0<<" | "<<1<<" | "<<2<<" "<<endl<<" | ----|-----|-----"<<endl;
std::cout<<" B | "<<3<<" | "<<4<<" | "<<5<<" ... | true |
1485856f58eb423966794074e6d8c1a358d35e85 | C++ | github188/TPS | /t3-venus/owslib/source/commandqueue.cpp | GB18030 | 5,709 | 2.734375 | 3 | [] | no_license | #include "owslib.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCommandQueue::CCommandQueue()
{
... | true |
f6d323ad33267844ef5c0f4af52d3c3a0008750f | C++ | Ali1215/EdmontonPlotterDijkstra | /server/dijkstra.cpp | UTF-8 | 2,491 | 3.6875 | 4 | [] | no_license |
#include <queue>
#include "dijkstra.h"
//comparision so heap considers the cost for ordering purposes
class mycomparison
{
public:
bool operator()(const PIPIL &lhs, const PIPIL &rhs) const
{
return (lhs.second.second > rhs.second.second);
}
};
void dijkstra(const WDigraph &graph, int startVerte... | true |
5721ae161b24d48d19b2cce3ced2a8d49cecd365 | C++ | cnsuhao/Dx3D-Study | /3DModel/ai_object.cpp | UHC | 7,318 | 2.515625 | 3 | [
"MIT"
] | permissive |
#include "global.h"
#include "control.h"
#include "character.h"
#include "ai_object.h"
float g_flag2 = 12.f;
//-----------------------------------------------------------------------------//
// ij ΰ ũƮ ȣϴ ݹԼ.
// nFuncID : Լ Ÿ Ÿ.
// LoadVariable: class pointer, id (import Ŭ )
// id (import )
// Stor... | true |
b87dc7d3dd8e20202c167b42ecb3d907d4e117da | C++ | xphoenix/afina | /src/network/mt_nonblocking/Worker.h | UTF-8 | 2,108 | 2.84375 | 3 | [] | no_license | #ifndef AFINA_NETWORK_MT_NONBLOCKING_WORKER_H
#define AFINA_NETWORK_MT_NONBLOCKING_WORKER_H
#include <atomic>
#include <memory>
#include <thread>
namespace spdlog {
class logger;
}
namespace Afina {
// Forward declaration, see afina/Storage.h
class Storage;
namespace Logging {
class Service;
}
namespace Network {
... | true |
7d1019f76f421ccd82ae7996c3f27723954f5187 | C++ | Junior007/sketchbook | /NRF2401Emisor/NRF2401Emisor.ino | UTF-8 | 4,242 | 2.546875 | 3 | [] | no_license |
/*
* Getting Started example sketch for nRF24L01+ radios
* This is a very basic example of how to send data from one node to another
* Updated: Dec 2014 by TMRh20
*
1*/
#include <SPI.h>
#include "RF24.h"
#include "Botones.h"
Boton boton_1;
Boton boton_2;
Boton boton_3;
Boton boton_4;
Boton boton_5;
Boton boton_6;
... | true |
170390d30b493784bcc6aad36819ac26ec3f46ae | C++ | AnupamKSingh/CPP_Practice | /Threading/Managing_Threads/class.cpp | UTF-8 | 1,074 | 3.6875 | 4 | [] | no_license | #include<iostream>
#include<thread>
using namespace std;
class anu {
private:
int a;
string& s;
public:
anu(int i, string str):a(i),s(str) {
cout<<"Constructor is called with a = "<<a<<endl;
cout<<"Constructor is called with s = "<<s<<endl;
}
~anu() {
cout<<"Destructor is called with a = "<<a<<end... | true |
1e7f04190e2bcec20ee864b4ff75e2d1390df4b3 | C++ | Abirami2017/OOT | /10.employee_array.cpp | UTF-8 | 1,075 | 3.546875 | 4 | [] | no_license | #include<iostream>
using namespace std;
class employee
{
private:
int a,s;
char name[20],des[20];
public:
void read() //Date input
{
cout<<"\n\nEnter the Details\n";
cout<<"Enter the name : ";
cin>>name;
cout<<"Enter the designation : ";
cin>>des;
cout<<"Enter the age : ";
... | true |
57a2f16a02442a19fcdc8de10db0764cfea48d16 | C++ | yoniescobar/CursoProgramacionC-4PC | /Primera Unidad/Descuento.cpp | UTF-8 | 732 | 3.546875 | 4 | [] | no_license | #include <conio.h>
#include <iostream>
using namespace std;
int main(){
//1. Declarar variables
int cantidad,categoria;
float precioU,subtotal,precioTotal,descuento;
//2. Ingreso de datos
cout<<"\n Ingrese cantidad de Producto: ";
cin>>cantidad;
cout<<"\n Ingrese Costo unitario de Producto: ";
cin>>precio... | true |
df4466a5d34e11593a425e365d1672fc03ff64e5 | C++ | varun7882/Programs_C-CPP | /vscode/codes/monkandchampion.cpp | UTF-8 | 479 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include<set>
using namespace std;
typedef int dtype;
int main()
{
dtype c=0,m,n,x,i,tmp;
multiset<dtype> s;
multiset<dtype>::iterator it;
cin>>m>>n;
for(i=0;i<m;i++)
{
cin>>x;
s.insert(x);
}
while(n>0)
{
it=s.end();
it--;
tmp=*it... | true |
3a923c2c066a094de47e2c511cf781767b581f1b | C++ | BruceleeThanh/Backup_CppBasicTLU | /Problem 11/Source.cpp | UTF-8 | 970 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <math.h>
#include <fstream>
using namespace std;
ifstream doc("Problem 11.txt");
ofstream ghi("Record.txt");
int main()
{
int a[20][20];
for (int i = 0; i < 20; i++)
{
for (int j = 0; j < 20; j++)
{
doc >> a[i][j];
}
}
long long tich[100000], max;
int z = 0;
for (int i = ... | true |
373995e11aee1c7d06b39e6c7649a01859f48c14 | C++ | iSergioMejia/Trees | /3D Tree/main.cxx | UTF-8 | 1,083 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include "kDTree.h"
#include "kDPoint.h"
#include <vector>
#include <fstream>
#include <sstream>
int main(int argc, char** argv)
{
std::vector<PUJ::kDPoint> points;
std::ifstream in("in2.txt");
double x, y, z;
if(in)
{
while(!in.eof())
{
std::string leido;
getline(in, leido);
st... | true |
c173e41b8a5bca710ddb7c39d3a72eb067d1b265 | C++ | Alexandrecajamos/geometria_comp | /triangulo.cpp | UTF-8 | 2,471 | 2.546875 | 3 | [] | no_license | #include "triangulo.h"
triangulo::triangulo()
{
}
triangulo::triangulo(Coord_3D _P1, Coord_3D _P2, Coord_3D _P3){
this->P1=&_P1;
this->P2=&_P2;
this->P3=&_P3;
this->attNormal();
}
triangulo::triangulo(Coord_3D *_P1, Coord_3D *_P2, Coord_3D *_P3)
{
this->P1=_P1;
this->P2=_P2;
this->P3=_P3;
... | true |
16819f41ce33e7e522a04c1b95a27febfc94d16e | C++ | mehrdadzakershahrak/Online-Explanation-Generation | /rovers/fastdownward/src/search/options/registries.h | UTF-8 | 3,867 | 3.328125 | 3 | [
"GPL-1.0-or-later",
"GPL-3.0-or-later",
"MIT"
] | permissive | #ifndef OPTIONS_REGISTRIES_H
#define OPTIONS_REGISTRIES_H
#include "../utils/system.h"
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <string>
#include <typeindex>
#include <unordered_map>
#include <vector>
namespace options {
class OptionParser;
// A Registry<T> maps a strin... | true |
3961152187aeeb0441b3f5f079af67117e18f79f | C++ | Blinningjr/opengl-lab-env | /projects/assigment4/code/engine/node/graphicsNodes/Cube.h | UTF-8 | 1,435 | 2.609375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <glm/glm.hpp>
#include <glm/vec3.hpp> // glm::vec3
#include <glm/mat4x4.hpp> // glm::mat4
#include <memory>
#include "../../material/Material.h"
#include "../../Mesh.h"
#include "../GraphicsNode.h"
namespace Graphics3D {
class Cube : public GraphicsNode {
public:
Cube(glm::vec3... | true |
46edb3c0cd6b97d85d536cc8f90ddd80b988ba2c | C++ | drlongle/leetcode | /algorithms/problem_0792/other1.cpp | UTF-8 | 632 | 2.78125 | 3 | [] | no_license | class Solution {
public:
int numMatchingSubseq(string s, vector<string>& words) {
int n = s.size();
int m = words.size();
int count =0;
unordered_map< string, int>mp;
for (int i = 0; i < words.size(); i++)
mp[words[i]]++;
for(auto x: mp){
int... | true |
9f153d4cdbd2477978fd0bffad1c2ee81f1f9e88 | C++ | VinayKarnam/APS2k19 | /interleave.cpp | UTF-8 | 887 | 2.546875 | 3 | [] | no_license | #include<stdio.h>
#include<iostream>
#include<string.h>
#include<unordered_map>
#include<vector>
using namespace std;
int main()
{
int n;
cin>>n;
int k=1;
unordered_map<int,vector<pair<int,int>>> umap;
while(n--)
{
char s[110];
cin>>s;
int small=0;
fo... | true |
d7d682632aba7ea1062d16122b6c180cc499c301 | C++ | wizard1990/PAT-Solutions | /P1023.cpp | UTF-8 | 828 | 2.90625 | 3 | [] | no_license | #include<string>
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
int f[10];
memset(f,0,sizeof(f));
string s,ds;
cin>>s;
string::iterator it;
for(it = s.begin(); it != s.end(); it++){
int digit = *it - '0';
char ch = '0' + digit*2;
ds += ch;
f[digit]... | true |
fbd73b386626c9e41f0880c8ee1bb401480b9d0b | C++ | vikkypatil/Git | /Math/GCD/GCD/gcd.cpp | UTF-8 | 197 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
using namespace std;
int gcd(int a, int b)
{
if (b == 0)
return a;
else
{
gcd(b, a%b);
}
}
int main()
{
cout << gcd(56, 98);
_getch();
return 0;
}
| true |
6bb1b822db8367db47d410367570e0f7dbf210bb | C++ | Abhinavgup2001/IPMP | /week8/Trees/Trees52.cpp | UTF-8 | 508 | 3 | 3 | [] | no_license | TreeNode* helper(vector<int>& nums,int start, int end)
{
if(start>end)
return NULL;
int mid= start+(end-start)/2;
TreeNode* node= new TreeNode(nums[mid]);
if(start==end)
return node;
node->left=helper(nums,start,mid-1);
node->right=helper(nums,mid+1,end);... | true |
ae787d89a1689fa0facf19a59131c7ff4e6fa245 | C++ | fcuzzocrea/KR_Exercises | /ex5.cc | UTF-8 | 440 | 3.046875 | 3 | [] | no_license | #include <stdio.h>
main()
{
int c, nl, nb, nt;
nl = 0;
nb = 0;
nt = 0;
while((c=getchar()) != EOF)
if
( c == '\t')
++nt;
else if( c == '\n')
++nl;
else if
( c== ' ')
++nb;
printf("\n");
printf("Numb... | true |
eb0ca43ef15148b2a934910181fa0073b39a1af1 | C++ | airtooz/EDAproject | /utility.h | UTF-8 | 2,145 | 2.953125 | 3 | [] | no_license | #ifndef _DEFINE_UTILITY_
#define _DEFINE_UTILITY_
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Module
{
public:
Module();
void setlchild(Module*);
void setrchild(Module*);
void setparent(Module*);
void setblock_x(int);
void setbloc... | true |
783e67c7ba11c27d244264ec0fcb97129950b135 | C++ | amey16/Just-cp-- | /Time_space_complexity/part1/partition_an_array.cpp | UTF-8 | 795 | 3.546875 | 4 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
void print(vector<int> &arr){
for (int i = 0; i < arr.size(); i++)
cout << arr[i] << " ";
cout << endl;
}
void swap(vector<int>& arr, int i, int j) {
cout<<"Swapping "<<arr[i]<<" and "<<arr[j]<<endl;
int temp = arr[i];
arr[i] = arr[... | true |
b5c7842f11d6b7c6ae409965a5709b5fca30d29e | C++ | ZiluZhang/LeetCode-2 | /0340.cpp | UTF-8 | 596 | 3.0625 | 3 | [] | no_license | class Solution {
public:
int lengthOfLongestSubstringKDistinct(string s, int k) {
int len = s.length();
if (len == 0) return 0;
unordered_map<char, int> m; // rightmost index of char in the window;
int max_len = -1;
int left = 0, right = 0;
while (right < len) {
... | true |
3e5a7e0872ae50a69ce1a7b580f4cd834d611415 | C++ | MR782/RunGame | /RunAction/Animation.cpp | UTF-8 | 1,369 | 2.625 | 3 | [
"BSD-3-Clause",
"libtiff",
"IJG",
"MIT"
] | permissive | #include "Animation.h"
#include"Resource.h"
#include"./dxlib/DxLib.h"
#include"CoreScene.h"
void Animation::switch_anime()
{
//アニメーションの切り替え
current_anime++;
if (current_anime >= object->sheets) {//問題
//ループしないなら最後の画像で止める
if (object->loop == true) { current_anime = 0; }//ループ有り
else {
current_a... | true |
14d1695f6308669b10db67db0494d5167981a003 | C++ | carnotryu/2018_Voucher_IITP | /5_finger_basic_with_latency_check_bluetooth/_MEGA_bluetooth/_MEGA_bluetooth.ino | UTF-8 | 273 | 2.515625 | 3 | [] | no_license | void setup()
{
Serial.begin(9600);
Serial1.begin(38400); // 19: MEGA_RX1 <-> BT TX, 18: MEGA_TX1 <-> BT RX
}
void loop()
{
if (Serial1.available()) {
Serial.write(Serial1.read());
}
if (Serial.available()) {
Serial1.write(Serial.read());
}
}
| true |
4c52580acfee785e521fab8ee0eb2f3a992c39b1 | C++ | nicowxd/Competitive-Programming | /URI/AD-HOC/1105 - Sub-prime.cpp | UTF-8 | 760 | 2.515625 | 3 | [] | no_license | // Autor: CarlosJunior<carloserratojr@gmail.com>
// Nome: Sub-prime
// Nível: 2
// Categoria: AD-HOC
// URL: https://www.urionlinejudge.com.br/judge/pt/problems/view/1105
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int b,n,fundo[30];
while(scan... | true |
0f64f99f95e3d9db78ab52d799fd73118ca0b6ba | C++ | deepend0/dynamicpointlabeling | /src/main/graph/GraphUtils.cpp | UTF-8 | 1,006 | 2.796875 | 3 | [] | no_license | /*
* GraphUtils.cpp
*
* Created on: Feb 17, 2018
* Author: oakile
*/
#include "GraphUtils.h"
#include <iostream>
#include <vector>
using namespace std;
namespace graph {
GraphUtils::GraphUtils() {
// TODO Auto-generated constructor stub
}
GraphUtils::~GraphUtils() {
// TODO Auto-generated destructor s... | true |
02c4cb9146bfc16a70c022801c9f2fe386caaf86 | C++ | sebak94/micromachines | /server/src/acceptor_th.cpp | UTF-8 | 2,521 | 2.578125 | 3 | [] | no_license | #include <unistd.h>
#include "../include/acceptor_th.h"
#include "../include/model/micromachines_th.h"
#include "../../common/include/socket_error.h"
#include "../../common/include/lock.h"
#include "iostream"
#include "vector"
AcceptorTh::AcceptorTh(const char *service, GamesTh &games):
keep_accepting(true), g... | true |
0b606583b615be32b557a37544134fed09c83214 | C++ | aminnj/babymaker | /main.cc | UTF-8 | 2,122 | 2.875 | 3 | [] | no_license | #include "babymaker.h"
// #include "./CORE/CMS3.h"
// #include "./CORE/Tools/goodrun.h"
// #include "TTree.h"
// #include "TFile.h"
// #include "TString.h"
// #include <string>
int main(int argc, char *argv[]){
TString input_filename, output_filename;
unsigned int max_nevents = 0;
if (argc > 2) {
... | true |
0c6f2ee8e91affc25e6e3ea8e44cee156527663a | C++ | DominicMe/hyperion | /libsrc/effectengine/Effect.cpp | UTF-8 | 7,315 | 2.6875 | 3 | [
"MIT"
] | permissive | // Python include
#include <Python.h>
// stl includes
#include <iostream>
#include <sstream>
// Qt includes
#include <QDateTime>
// effect engin eincludes
#include "Effect.h"
// Python method table
PyMethodDef Effect::effectMethods[] = {
{"setColor", Effect::wrapSetColor, METH_VARARGS, "Set a new color for t... | true |
a85264df12e8e01f2b93610a6466e8f3ab4105fc | C++ | shamimferdous/NSU-CSE225 | /final-assignment/knightMovesCalculator.h | UTF-8 | 681 | 2.859375 | 3 | [] | no_license | #ifndef KNIGHTMOVESCALCULATOR_H_INCLUDED
#define KNIGHTMOVESCALCULATOR_H_INCLUDED
#include <bits/stdc++.h>
#include "unsortedtype.h"
#include "chessPiece.h"
const int TOTAL_SQUARES = 56;
// structure for storing a cell's data
struct cell
{
int x, y;
int distance;
cell() {}
cell(int x, int y, int distan... | true |
11e7132c63dd31a6963114993d8ca3b4b5297415 | C++ | harrituononen/winged-tanks | /airb/src/ui/kill_notification.hpp | UTF-8 | 1,021 | 2.625 | 3 | [] | no_license | #ifndef UI_KILL_NOTIFICATION_HPP
#define UI_KILL_NOTIFICATION_HPP
#include <chrono>
#include <string>
#include <utility>
#include <vector>
#include "../math/matrix.hpp"
namespace ui {
class Font;
class FontRenderer;
class KillNotification final
{
private:
Font const& m_font;
math::Vector2f m_positio... | true |
a79fcb80b04ea4dc4924f28d019259884d62c3e2 | C++ | ShannonKuo/EDA-fraig | /fraig-project/src/checker.cpp | UTF-8 | 1,795 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
using namespace std;
string trans( int tt ){
string ss = "";
if( tt < 10 ){
ss = "0";
while( tt -- ) ss[ 0 ] ++;
return ss;
}else{
ss = "00";
for( int i = 0 ; i < tt % 10 ; i ++ ) ss[ 1 ] ++;
for( int i = 0 ; i <... | true |
e8dbdae0cc6fb9de2a215a1d7be882e2409a9802 | C++ | Unril/kaguya | /include/kaguya/lua_ref_table.hpp | UTF-8 | 12,668 | 2.53125 | 3 | [
"BSL-1.0"
] | permissive | #pragma once
#include <vector>
#include <map>
#include <cassert>
#include "kaguya/config.hpp"
#include "kaguya/lua_ref.hpp"
namespace kaguya
{
class State;
//! Reference to Lua userdata
class LuaUserData :public LuaRef
{
void typecheck()
{
if (type() != TYPE_USERDATA)
{
except::typeMismatchError(... | true |
e0508696437533096d49841b8520971a70ff88e2 | C++ | Phixyn/PhinyxEngine | /PhinyxEngine/src/Entity.cpp | UTF-8 | 552 | 2.59375 | 3 | [
"CC0-1.0",
"Zlib",
"CC-BY-3.0"
] | permissive | #include "../include/Entity.hpp"
/// <summary>
/// Initilizes the entity's <see cref="Collision">Collision</see> object.
/// </summary>
PhinyxEngine::Entity::Entity() :
m_collision(m_rect)
{
}
/// <summary>
/// Calls the setTexture method of this Entity's SFML RectangleShape instance
/// to give it a t... | true |
6c60df377e9ca5b5d9ff2d8db451e2a52461f9ec | C++ | AvilovaEM/tasks | /white/2week/syn_new.cpp | UTF-8 | 998 | 3.078125 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<map>
#include<string>
#include<algorithm>
int main()
{
int cmnd_cnt;
std::map<std::string, std::string> alf_word;
std::map<std::string, int> cnt_word;
std::string word1;
std::string word2;
std::string command;
std::cin >> cmnd_cnt;
for(int ... | true |
c9ecb9d94e8c2b9cf5cbd4fc36fdf001e7a17c00 | C++ | strengthen/LeetCode | /C++/172.cpp | UTF-8 | 998 | 3.03125 | 3 | [
"MIT"
] | permissive | __________________________________________________________________________________________________
sample 4 ms submission
class Solution {
public:
int trailingZeroes(int n) {
int count=0;
long long i=5;
while(n/i)
{
count+=n/i;
i=i*5;
}
... | true |
03881d2c63c8b4c4b002554956a66c95f2902aec | C++ | maaziPractice/FastReliableFileTransfer | /set1.cc | UTF-8 | 1,648 | 2.96875 | 3 | [] | no_license | #include <stdio.h>
#include <iostream>
#include <set>
using namespace std;
unsigned int currentSeqNumber;
typedef struct
{
unsigned int chunkSeqNumber;
char actualFileChunkBytes[1450+sizeof currentSeqNumber];
unsigned int actualChunkBytesReadFromWire;
}SingleFileChunk;
int main()
{
SingleFileChunk single... | true |
8123237ecb1a28c1f78489c4e39d627a7db5354b | C++ | davidgreisler/four-in-a-line | /src/GUI/Actions/Move.hpp | UTF-8 | 1,277 | 2.6875 | 3 | [
"MIT",
"CC-BY-3.0",
"CC0-1.0"
] | permissive | #ifndef GUI_ACTIONS_MOVE_HPP
#define GUI_ACTIONS_MOVE_HPP
#include <QObject>
#include <QScopedPointer>
class QWidget;
class QMenu;
class QAction;
namespace GUI
{
class GameView;
namespace Actions
{
/**
* Contains actions regarding game moves, like undo/show hint, etc.
*
* Provides an action for undoing the las... | true |
c732daa75bd3dc43d591aa8cf2183714bdb482d6 | C++ | RamboQiu/RAMCPPDemo | /RAMCPPDemo/float.cpp | UTF-8 | 602 | 3.109375 | 3 | [
"MIT"
] | permissive | //
// float.cpp
// RAMCPPDemo
//
// Created by rambo on 2020/11/26.
//
#include "float.hpp"
void floattest() {
int num=9; /* num是整型变量,设为9 */
float* pFloat=# /* pFloat表示num的内存地址,但是设为浮点数 */
printf("num的值为:%d\n",num); /* 显示num的整型值 */
printf("*pFloat的值为:%f\n",*pFloat); /* 显示num的浮点值 */
*pFlo... | true |
7df6c13bc77a949ef2f04822af7a15394011e390 | C++ | OvechkinDanil/IVector | /include/ICompact.h | UTF-8 | 2,703 | 2.71875 | 3 | [] | no_license | #pragma once
#include "ILogger.h"
#include "IVector.h"
#include "RC.h"
#include "IMultiIndex.h"
class ICompact {
public:
static ICompact* createCompact(IVector const * vec1, IVector const * vec2, IMultiIndex const *nodeQuantities);
virtual ICompact *clone() const = 0;
static RC setLogger(ILogger* const l... | true |
3f1b37435f6372169b5d7aae7adba6325c6decd9 | C++ | GeekBand/GeekBand-CPP-1501-Homework | /G2015010300/rectangle.h | UTF-8 | 1,754 | 3.203125 | 3 | [] | no_license | //
// Created by diaosj on 15/8/8.
//
#ifndef GEEKBANDTEST_RECTANGLE_H
#define GEEKBANDTEST_RECTANGLE_H
class Rectangle : public Shape {
int width;
int height;
Point *leftUp;
public:
Rectangle(const int width, const int height, const int x, const int y);
Rectangle(const Rectangl... | true |
d354e8072d2ff0f0999ac5c59feef604af0790b5 | C++ | Jamesweng/leetcode | /0006-zigzag-conversion.cpp | UTF-8 | 826 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | class Solution {
public:
string convert(string s, int numRows) {
string ans = "";
if (s.empty()) return "";
else if (s.size() == 1) return s;
else if (numRows == 1) return s;
for (int i = 0; i < numRows; ++i) {
int odd = 1;
for (int j... | true |
856c635ad30eff7cfef27db726db3a7f678f5379 | C++ | spencerparkin/Blob | /Code/Controller.h | UTF-8 | 2,698 | 2.53125 | 3 | [
"MIT"
] | permissive | // Controller.h
#pragma once
#include <Vector.h>
#if defined _WINDOWS
# include <Windows.h>
# include <Xinput.h>
#endif
class Controller
{
public:
Controller( void );
virtual ~Controller( void );
enum
{
BUTTON_A,
BUTTON_B,
BUTTON_X,
BUTTON_Y,
BUTTON_DPAD_UP,
BUTTON_DPAD_DN,
BUTTON_DPAD_LF,
BUTT... | true |
ad2b8a8090b5fb2de03ae24932ae2b8013a47cbf | C++ | adam-zhang/stdextension | /std_extension.hpp | UTF-8 | 1,594 | 3.671875 | 4 | [] | no_license | #include <string>
#include <cctype>
#include <algorithm>
template<typename CharT>
bool begin_with(const std::basic_string<CharT>& source, const std::basic_string<CharT>& pattern)
{
if (source.size() < pattern.size())
return false;
for(auto i = 0; i != pattern.size(); ++i)
if (pattern[i] != sour... | true |
e8f5a3b4d658f440f744be9c444afb17e82366a7 | C++ | robhendriks/avans-kmint | /OkunoshimaCore/src/progress_bar.cpp | UTF-8 | 726 | 2.75 | 3 | [
"WTFPL"
] | permissive | #include "progress_bar.h"
namespace okunoshima
{
void progress_bar::calculate_percentage()
{
m_percentage = (m_value - m_min) / (m_max - m_min) * 100;
calculate_bounds();
}
void progress_bar::calculate_bounds()
{
m_outer_bounds.min = {0, 0};
m_outer_bounds.max =... | true |
af4aa558f7341315497472bfd155ecb86e1aa9d0 | C++ | Jordy753/Lp-2-Jord | /Qt/figures/mainwindow.cpp | UTF-8 | 2,245 | 2.546875 | 3 | [] | no_license | #include "mainwindow.h"
#include "ui_mainwindow.h"
#include "figures.h"
#include "circle.h"
#include "triangle.h"
#include "rect.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
pixmap = new QPixmap(600, 200);
pixmap->fill(Qt :: black);
pen ... | true |
80a0830c655ea594729afb15c625540524ea55f1 | C++ | SeanGo/GPS_CoordinateTransform | /GPS_Coordinate.h | GB18030 | 2,419 | 3.3125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <algorithm>
/**
* \brief GPSγ࣬ԱֻоγȣԱƸʽݡ
* ṩ˼Ӽ㣬ṩϵ֮תķ̬Ͷ̬
* ϵͣҪûм¼Ҳ˸תϷԼ顣
* ο
* https://github.com/DingSoung/CoordinateTransformation
* https://github.com/wandergis/coordtransform
*/
class GPS_Coordinate
{
public:
GPS_Coordinate():longitude(0.0), latitude(0.0)
{
}
explicit GPS... | true |
ce9a877d738aabaa240d19915a6bee4e729cca3c | C++ | Hendrik410/SpectrumJacket | /SpectrumJacket/WS2812.h | UTF-8 | 1,254 | 2.59375 | 3 | [] | no_license | #pragma once
#include "colors.h"
#include "Config.h"
class WS2812
{
protected:
Config* config;
uint16_t bufferSize;
uint16_t WS2812_IO_High;
uint16_t WS2812_IO_Low;
bool selfAllocated;
uint8_t* backBuffer;
uint8_t* frontBuffer;
void initGPIO();
void initTimer();
void initDMA();
public:
WS2812(Config*... | true |
43af2e9a7c4bc5ca445990b198369d340e2e5123 | C++ | Alex-Movchan/Piscine-CPP- | /d00/ex02/Account.class.cpp | UTF-8 | 2,913 | 3.34375 | 3 | [] | no_license |
#include "Account.class.hpp"
#include <iostream>
Account::Account( int initial_deposit ) : _amount(initial_deposit), _nbDeposits( 0 ), _nbWithdrawals( 0 ) {
this->_accountIndex = Account::_nbAccounts;
Account::_nbAccounts++;
Account::_totalAmount += this->_amount;
Account::_displayTimestamp();
std::cout << "inde... | true |
1dd8c12455ad8d6f2e5b3dcd529a40a6336d6b96 | C++ | booneng/competitive_programming | /projecteuler/6.cpp | UTF-8 | 213 | 2.578125 | 3 | [] | no_license | #include <iostream>
#define ll long long int
using namespace std;
int main() {
ll n1 = 0;
ll n2 = 0;
for (ll i = 1; i <= 100; i++) {
n1 += i * i;
n2 += i;
}
n2 = n2 * n2;
cout << n2 - n1;
}
| true |
96a30fbb945afd2837ccdf05df491f0e6bca47e7 | C++ | vikuliukas/OOP_1_uzd | /pasisveikinimas.cpp | UTF-8 | 1,420 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <string>
void PirmaIrPaskutine(int ilgis);
void Tuscios(int ilgis);
void Vidurine(int dydis, std::string vardas);
int main(){
int ilgis, dydis;
std::string vardas;
std::cout << "Iveskite varda: ";
std::cin>>vardas;
std::cout << "Iveskite remelio dydi: ";
... | true |
dce82ef0ba2c1a10b388f05c2a6e7a54d5349c71 | C++ | LYCHSJ/OJ | /code/ACM/ACM LeetCoder/ACM LeetCoder/198 with DP.cpp | UTF-8 | 427 | 2.96875 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
int rob(vector<int> &num) {
int n = num.size();
if (n == 0)
return 0;
else if (n == 1)
return num[0];
else
{
vector<int> maxV(n, 0);
maxV[0] = num[0];
maxV[1] = max(num[0], num[1]);
for (in... | true |
1914b365065cf2ebf3123f65feb331c9d6adaecb | C++ | HarryDC/weather | /indoor_led/indoor_led.ino | UTF-8 | 4,113 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | #include "LedControl.h"
#include <Adafruit_GFX.h>
#include <gfxfont.h>
/*
Now we need a LedControl to work with.
***** These pin numbers will probably not work with your hardware *****
pin 10 is connected to the DataIn
pin 9 is connected to the CLK
pin 8 is connected to LOAD
***** Please set the number of de... | true |
6ab936fceeb98a5230a01c2fd2bd59c59fc2458d | C++ | leannejdong/autocircuit | /graph.h | UTF-8 | 8,934 | 3 | 3 | [] | no_license |
#ifndef AUTOCIRCUIT_GRAPH_H
#define AUTOCIRCUIT_GRAPH_H
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <iterator>
#include <cassert>
#include <fstream>
using namespace std;
class graph {
int r;
std::vector<std::vector<bool>> adjMatrix;
std::vector<... | true |
aee18935d06188d11a7a97ccab4208741d88527c | C++ | sdourlens/WK-Agent-Board | /test/pwm.h | UTF-8 | 4,249 | 2.578125 | 3 | [] | no_license | // Control PWM
// WK Agent Board uses PWML4,PWMH4,PWML6 and PWMH6 of the SAM3X, and DAC0, DAC1 too
#include "pwm_lib.h"
/* PWM generator */
#define PWM_PERIOD 1000 // 100 kHz
#define PWM_DUTY 500 // 50% of PWM_PERIOD
// variants ok, périphérique B
#define PIN_PWM4 45 // PC18 - pin 100 - channel 6 ... | true |
d7a73d8cd75c02cd3b7dd8094f793e43be293de3 | C++ | allen880117/NCTU-compiler-f19-hw3 | /src/include/AST/unary_operator.hpp | UTF-8 | 543 | 2.78125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "AST/ast.hpp"
#include "visitor/visitor.hpp"
class UnaryOperatorNode : public ASTNodeBase
{
public:
int line_number; // operator
int col_number; // operator
enumOperator op;
Node operand; // an expression node
public:
UnaryOperatorNode(
... | true |
8d4c9ac2db358aa6f4b57a4a86f1d7b51308712d | C++ | Marharyta-Tkachenko/4.4 | /Lab4.4/Complex.cpp | UTF-8 | 1,783 | 3.328125 | 3 | [] | no_license | #include "Complex.h"
Complex::Complex()
: Pair()
{}
Complex::Complex(double x, double y)
: Pair(x, y)
{}
Complex::Complex(const Complex& v)
: Pair(v)
{}
Complex* Complex::operator = (Pair* r)
{
this->SetA(r->GetA());
this->SetB(r->GetB());
return this;
}
Complex* Complex::operator + (Pair* Z)
{
Complex* T =... | true |
111a399280e419d994c1e0274b649c9ddb163f6a | C++ | MariaMsu/computer_graphics | /ray_tracing/shapes.h | UTF-8 | 7,362 | 3.078125 | 3 | [] | no_license | #ifndef RAY_TRACING_SHAPES_H
#define RAY_TRACING_SHAPES_H
#include "material.h"
#include <stdint.h>
#define STB_IMAGE_IMPLEMENTATION
#include "Lib/stb_image.h"
struct Shape {
public:
/* orig - camera position
* dir - direction of gaze from the camera
* t0 - distance to nearest intersection */
virtu... | true |
3d90ee962e69fe19f675cd16debc9782fa3e644b | C++ | facebookresearch/loop_tool | /include/loop_tool/smallvec.h | UTF-8 | 6,961 | 3.34375 | 3 | [
"MIT"
] | permissive | /*
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <type_traits>
template <class Tp, std::size_t Nm>
class smallvec {
private:
static_assert(Nm > 0, "Smallvec only supp... | true |
de612c146810039315f1a5623c7ff8d66f5b64c5 | C++ | priyabnsal/DSA-Cheat-Sheet | /Dynamic Programming/39 Egg dropping problem memoization optimization.cpp | UTF-8 | 997 | 2.734375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
const int D = 101;
int dp[D][D];
int Solve(int eggs, int floors) {
if (dp[eggs][floors] != -1) // if value is already there in the table then return the value
return dp[eggs][floors];
if (eggs == 1 || floors == 0 || floors == 1) { // base condition
dp[eggs][floors... | true |
b05803eb7185433214cdccaf45665907fb9dc8b7 | C++ | wangliuliu/loam_cali | /loam_trajectory/include/imu_pose/imustate.h | UTF-8 | 1,567 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | #include <Eigen/Dense>
#include <Eigen/Geometry>
#include <vector>
class ImuState
{
public:
ImuState();
Eigen::Matrix<double,3,1> mImu_w; // IMU的角速度,测量值
Eigen::Matrix<double,3,1> mImu_a; // MU的线加速度,测量值
Eigen::Quaternion<double> mImu_ori; // MU的角度,测量值
Eigen::Matrix<double,... | true |
b719bf7014ab84b1143e4ba6fb24539a2a30798f | C++ | annikura/key-value-storage | /tests/test_btree.h | UTF-8 | 9,505 | 3.140625 | 3 | [] | no_license | #ifndef TERM_PROJECT_TEST_BTREE_H
#define TERM_PROJECT_TEST_BTREE_H
#include "gtest/gtest.h"
#include "../src/tree/BTree.h"
void genIntPairs(size_t n, size_t seed, std::vector<std::pair<int, int>> & arr) {
srand(seed);
std::set<int> used;
for (size_t i = 0; i < n; i++) {
int key = rand();
... | true |
85f8fedff3dc35f13d3310d214108576e1476cea | C++ | sgpritam/cbcpp | /Challenges - Bitmasking/Count Set Bits.cpp | UTF-8 | 259 | 2.9375 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
int countbits(int a)
{
int ans=0;
while(a>0)
{
ans=ans+(a&1);
a=(a>>1);
}
return ans;
}
int main()
{
int n,a;
cin>>n;
while(n>0)
{
cin>>a;
int z=countbits(a);
cout<<z<<endl;
n--;
}
return 0;
}
| true |
1cb5a8ad65e851f5b380ae86d728ccaca12fc80b | C++ | alonameir/Reviiyot | /include/Card.h | UTF-8 | 1,293 | 3.421875 | 3 | [] | no_license | #ifndef CARD_H_
#define CARD_H_
#include <iostream>
using namespace std;
enum Shape {
Club,
Diamond,
Heart,
Spade
};
enum Figure {
Jack,
Queen,
King,
Ace
};
class Card {
private:
Shape shape;
public:
Card();
Card(Shape shape);
virtual string toString() = 0; //Returns the string representation of ... | true |
1d49ffbba485e3ac2fd100849c34749ae8512c22 | C++ | DennisStanistan/stevens | /x_kary.h | UTF-8 | 2,822 | 3.25 | 3 | [] | no_license | #ifndef __XENTAX_KARY_H
#define __XENTAX_KARY_H
class kary_node;
class kary_tree;
class kary_iterator;
class kary_tree {
private :
struct kary_node {
typedef kary_node& reference;
typedef kary_node* pointer;
friend class kary_tree;
pointer parent;
std::deque<pointer> children;
kary... | true |
c50aab637e83c17631bdfc293ec25fe45e7e29e3 | C++ | niuxu18/logTracker-old | /second/download/git/gumtree/git_repos_function_5357_last_repos.cpp | UTF-8 | 433 | 2.53125 | 3 | [] | no_license | static const char *get_tag(const struct cache_entry *ce, const char *tag)
{
static char alttag[4];
if (tag && *tag && show_valid_bit && (ce->ce_flags & CE_VALID)) {
memcpy(alttag, tag, 3);
if (isalpha(tag[0])) {
alttag[0] = tolower(tag[0]);
} else if (tag[0] == '?') {
alttag[0] = '!';
} else {
altt... | true |
301720525994b05d74384cca931fe9215cb97b98 | C++ | a-rodionov/Otus.Cpp.Homework12 | /Statistics.h | UTF-8 | 399 | 2.921875 | 3 | [] | no_license | #pragma once
struct Statistics {
size_t commands{0};
size_t blocks{0};
};
std::ostream& operator<<(std::ostream& out, const Statistics& statistics) {
out << statistics.blocks << " блок, "
<< statistics.commands << " команд";
return out;
}
class BaseStatistics {
public:
auto GetStatisctics() const {... | true |
604c5c4efd5386df61e9273820676639278eec8a | C++ | lygstate/swiftshader | /src/System/Thread.hpp | UTF-8 | 1,612 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | // Copyright 2016 The SwiftShader Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required b... | true |
fa531763225e43d9e325081f1839da11186c2dba | C++ | danilaml/DZ | /144/HW14_1/List/listtest.h | UTF-8 | 1,381 | 2.875 | 3 | [] | no_license | #ifndef LISTTEST_H
#define LISTTEST_H
#include <QObject>
#include <QtTest/QtTest>
#include "mylinkedlist.h"
#include "mydoublelinkedlist.h"
class ListTest : public QObject
{
Q_OBJECT
public:
explicit ListTest(QObject *parent = 0);
private slots:
void initTestCase()
{
mll = new MyLinkedList();... | true |
fa8ce1172a7350e0076a00abcc09e5e40970b2fe | C++ | sachinsp14/C-Programming-Practice | /Stacks and Queues/stack.cpp | UTF-8 | 3,950 | 3.8125 | 4 | [] | no_license | #include <iostream>
using namespace std;
class llist
{
public:
int data;
llist *pNext;
llist *pPrev;
llist(int n)
{
data = n;
pNext = NULL;
pPrev = NULL;
}
};
class Stack
{
private:
int top;
llist *list;
llist *midNodeOfList;
llist *lastNodeOfList;
... | true |
1a80ff82ba063e0508b84b2ed5a7f59dac7426a9 | C++ | Johnny-YuZJ/cpp-Marvelous-Trading-Card-Game | /card/spell/banish.h | UTF-8 | 270 | 2.5625 | 3 | [] | no_license | #ifndef BANISH_H_INCLUDED
#define BANISH_H_INCLUDED
#include <memory>
#include "spell.h"
class Player;
class Banish: public Spell{
public:
Banish(std::shared_ptr<Player> owner);
void cast(std::shared_ptr<Card> target) override;
};
#endif // BANISH_H_INCLUDED
| true |
74ddaec2643690e5ff482bc3fc9425055b1282bb | C++ | kc991229/practice | /2020.9.16/test.cpp | UTF-8 | 254 | 2.703125 | 3 | [] | no_license | //爬楼梯
#include <iostream>
class Solution {
public:
int climbStairs(int n) {
int p=0,q=0,j=1;
for (int i=0;i<n;i++)
{
p=q,q=j,j=p+q;
}
return j;
}
};
| true |
9d5446d1e4646c3252fcb049bf5429e51fee349d | C++ | nanshan-high-school/cs50-problem-set-1-mario-02-Vincent-2019 | /馬力歐2.0.cpp | UTF-8 | 391 | 3.46875 | 3 | [] | no_license | #include <iostream>
using namespace std;
void display(int num,string stars);
int main() {
int num;
cout << "請輸入行數";
cin >> num;
for(int i = 1 ; i <= num;i++){
display(num-i," ");
display(i ,"#");
display(2 ," ");
display(i ,"#");
cout << endl;
}
}
void display(int num,string stars){
... | true |
57d4981b899a54fe1967cee67a51b8795a55d61c | C++ | LongerZrLong/gloo | /gloo/gl_wrapper/BindableBuffer.cpp | UTF-8 | 1,371 | 3 | 3 | [
"MIT"
] | permissive | #include "BindableBuffer.h"
#include <type_traits>
#include "gloo/utils.h"
namespace GLOO {
BindableBuffer::BindableBuffer(GLenum target) : target_(target)
{
GL_CHECK(glGenBuffers(1, &handle_));
}
BindableBuffer::~BindableBuffer()
{
Reset();
}
BindableBuffer::BindableBu... | true |
43340a774d487abd951f0a2a0f84812d32d23dd9 | C++ | cad420/NeuronAnnotation | /src/Algorithm/AutoPathFind.hpp | UTF-8 | 5,447 | 2.828125 | 3 | [] | no_license | //
// Created by wyz on 2021/5/13.
//
#ifndef NEURONANNOTATION_AUTOPATHFIND_HPP
#define NEURONANNOTATION_AUTOPATHFIND_HPP
#include <vector>
#include <array>
#include <Image.hpp>
#include <seria/object.hpp>
#include <stack>
#include <Common/utils.hpp>
#include <algorithm>
#include <unordered_set>
/**
* using dijkstra ... | true |
c13ed7636c9a2f0dc5dcc0e08feb78a7d723a8c9 | C++ | nitz14/pto2014_przetwarzanie | /src/core/transformations/edge_zero.cpp | UTF-8 | 3,339 | 2.5625 | 3 | [] | no_license | #include "edge_zero.h"
#include "edge_laplacian_of_gauss.h"
EdgeZeroCrossing::EdgeZeroCrossing(PNM* img) :
Convolution(img)
{
}
EdgeZeroCrossing::EdgeZeroCrossing(PNM* img, ImageViewer* iv) :
Convolution(img, iv)
{
}
PNM* EdgeZeroCrossing::transform()
{
int width = image->width(),
... | true |
b5c216f592d0cf1fa80e144239986c69b3b4fcec | C++ | loicseguin/spinify | /src/Graph.h | UTF-8 | 6,848 | 3.21875 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | /*
* Graph.h
* spinify
*
* Created by Loïc Séguin-Charbonneau on 09-12-22.
* Copyright 2009-2011 Loïc Séguin-Charbonneau. All rights reserved.
*
*/
/*
* Graph is a basic data structure for graphs implemented as two
* vectors: a vector of Edges and a vector of Nodes. Each Edge
* has pointers to its two endpoi... | true |
1024be65bbe62136d0f2fc2f78c60fbc1bea4d76 | C++ | rcthomas/C3 | /include/inline/C3_Row.hh | UTF-8 | 683 | 3.03125 | 3 | [] | no_license |
// Constructor.
template< class T >
inline C3::Row< T >::Row( const C3::size_type ncolumns ) noexcept :
C3::Block< T >( ncolumns )
{}
// Initializing constructor.
template< class T >
inline C3::Row< T >::Row( const C3::size_type ncolumns, const T pixel ) noexcept :
C3::Block< T >( ncolumns, pixel )
{}
... | true |
7cd55a1b68183731daa5c79b734ec1e29a24e458 | C++ | Ajay2521/Tutorial-on-CPlusPlus- | /Math Operation.cpp | UTF-8 | 1,141 | 3.921875 | 4 | [] | no_license | /*In this lets see more about NUMBERS in c++ program.*/
/*In c++ program we usually use int, float, short, long are major Data Types used for defining and using numbers.*/
/*C and C++ has many built in functions , one amoung it was math , which contains amny functions related to math operations*/
/*including preproc... | true |
c2f3e073293bffb9e0bdbddb23df2139832dd5b4 | C++ | rbonifacio/OBERON-Lang | /include/Expression.hpp | UTF-8 | 2,527 | 3.25 | 3 | [] | no_license | #ifndef EXPRESSION_H
#define EXPRESSION_H
#include <cstdint>
#include <iostream>
#include "Types.hpp"
#define TYPE_INTEGER uint64_t
#define TYPE_BOOLEAN bool
#define TYPE_REAL double
using namespace std;
namespace OberonLang {
class Value;
class OBRVisitor;
/* the base class of our Expression hierarch... | true |
77c1cc984d0a92f06e50d2429c2bb0840dd3eb6f | C++ | charu-wadhs16/BASICS_OF_STL | /BASICS_OF_STL/Queue.cpp | UTF-8 | 372 | 3.109375 | 3 | [] | no_license | //FIFO CONCEPT
#include <iostream>
#include<queue>
using namespace std;
int main()
{
queue<string> q;
q.push("Charu");
q.push("Wadhwa");
q.push("B.Tech CSE");
cout<<"Size before pop ->" <<q.size()<<endl;
cout<<"First Element "<<q.front()<<endl;
q.pop();
cout<<"First Element "<<q.front()<<endl;... | true |