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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9b0f737828dde5fe76ec899c6cb1313098894f5c | C++ | TerpDAC/MicrophoneControllerCode | /mic.ino | UTF-8 | 2,277 | 2.78125 | 3 | [] | no_license | /*
* Terrapin Development and Consulting (TerpDAC)
* Microphone-Traffic Mapping
* Written by William Heimsoth
* Created: 11/29/2015
* Last modified: 11/30/2015
* Basic Algorithm:
* (1) Initialize
* (2) Sample the mic as fast as possible
* (3) Analyze collected data
* (4) Send analyzed data
* (5) Repeat from ... | true |
fe713d0d9be0b05f668314156f60a76e20409952 | C++ | MikhailGorobets/FaceGenBaseLibrary | /source/LibFgBase/src/Fg3dSurface.hpp | UTF-8 | 9,704 | 2.625 | 3 | [
"MIT"
] | permissive | //
// Coypright (c) 2020 Singular Inversions Inc. (facegen.com)
// Use, modification and distribution is subject to the MIT License,
// see accompanying file LICENSE.txt or facegen.com/base_library_license.txt
//
#ifndef FG3DSURFACE_HPP
#define FG3DSURFACE_HPP
#include "FgStdString.hpp"
#include "FgTypes.hp... | true |
49c25e5738209fccbd478a8192a01b0d6c7e4a43 | C++ | saobangmath/Java-Practice | /src/NTULabs/Animal.h | UTF-8 | 446 | 3.046875 | 3 | [] | no_license | #include <iostream> // header in standard library
#include<string>
using namespace std;
enum COLOR { Green, Blue, Black, Brown, White };
#pragma once
class Animal {
public:
Animal();
Animal(string n, COLOR c);
~Animal();
virtual void speak() const;
virtual void move() const;
private:
string _name;
... | true |
81b31d523fb896503bc134bb5795aed108c1a102 | C++ | jiangwei221/3d_npr | /src/selector.h | UTF-8 | 10,440 | 2.84375 | 3 | [] | no_license | /*
select a set of vector of points, basically, vector<vector<dvec3>>
from a point cloud
jiang wei
uvic
start: 2018.10.9
*/
#pragma once
#include <iostream>
#include <limits>
#include <algorithm>
#include "bezier.h"
#include "glm/vec3.hpp"
#include "glm/glm.hpp"
#include <math.h>
#include <vector>
#include <pcl/io/p... | true |
a2261fae8998439d3277038b2bc5d234f7a65493 | C++ | 96light/SpaceAventural | /Program/TrainingFramework/src/GameObject/Bullet3.cpp | UTF-8 | 1,109 | 2.9375 | 3 | [] | no_license | #include "Bullet3.h"
Bullet3::Bullet3(std::shared_ptr<Models>& model, std::shared_ptr<Shaders>& shader, std::shared_ptr<Texture>& texture)
:Sprite2D(model, shader, texture)
{
m_speed = 500.0;
m_active = true;
m_type = BULLET_TYPE3::None;
m_SizeCollider = 10;
m_Damage = 5;
}
Bullet3::~Bullet3()
{
}
void Bullet... | true |
6f8698a083f0e31b781d1a89506d65dfca603460 | C++ | lasse-steinnes/FYS4150-Project1 | /cpp-code/lu_eigen.cpp | UTF-8 | 2,661 | 3.265625 | 3 | [] | no_license | /*
Code for solving a differential equation using
LU-decomposition with library eigen and writing
to file
*/
#include <iostream>
#include <cmath>
#include <stdlib.h>
#include <fstream>
#include <iomanip>
#include <Eigen/Dense>
#include <chrono>
#include <sstream>
using namespace std;
double f(double x){
/*The ri... | true |
8e00ba13f1909b30f2da670ad0608169a83b3884 | C++ | Stephenhua/Data-Construct | /LeetCode_7/LeetCode_7/源.cpp | GB18030 | 1,177 | 3.515625 | 4 | [] | no_license | # include <iostream>
# include <math.h>
using namespace std;
int reverse(int x)//
{
int ret = 0;
bool isNegative = false;
if (x < 0)
{
isNegative = true;
x *= -1;
}
while (x > 0)
{
int lastDigit = x % 10;
if (lastDigit == 0 && ret == 0)
{
x = x / 10;
continue;
}
if (ret > (INT_MAX - lastDigi... | true |
7bead761995760c94b17a0359aaee9e4378bfcfc | C++ | maenujem/arduino | /testNanoPins.ino | UTF-8 | 5,979 | 2.953125 | 3 | [
"MIT"
] | permissive | /*
Test for pin soldering (PCB socket pins) for Arduino Nano (if you buy it without their "legs" attached and solder these yourself)
Initial testing using external power source (1. to 13.)
The semi-automated test (14.) is based on the built-in pullup-resistors and the built-in LED diode.
Required:
... | true |
6dd61a3976223b4c9599b694a52ed712350ce4e3 | C++ | G4me4u/pic-programmer-arduino | /src/arduino_code/PIC16F88X_pic_programmer.cpp | UTF-8 | 3,215 | 2.828125 | 3 | [
"MIT"
] | permissive | #include "./PIC16F88X_pic_programmer.h"
PIC16F88X_PicProgrammer::PIC16F88X_PicProgrammer(unsigned int flags)
: PIC12F1822_PicProgrammer(flags)
{ }
bool PIC16F88X_PicProgrammer::enterProgrammingMode()
{
// If we're already programming,
// return false.
if (this->programming)
return false;
// Set PGM high, if... | true |
3687e2f95cfda44828c91708a06b0ee62aa31ff7 | C++ | prakash123mayank/C-Plus-Plus-Programming-Language | /String/Check string Palindrome.cpp | UTF-8 | 501 | 3.171875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
char A[]="madam";
char B[6];
cout<<"String 1:"<<A<<endl;
int i,j;
for(i=0;A[i]!='\0';i++)
{}
i=i-1;
for(j=0;i>=0;i--,j++)
{
B[j]=A[i];
}
cout<<"String 2:"<<B<<endl;
for(i=0,j=0;A[i]!='\0'&&B[j]!='\0';i++,j++)
... | true |
6794e77623e4a410fb5d335dcf1671d6b0b88eab | C++ | kcd71461/sw-engineering-hw3 | /src/Reservation.cpp | UTF-8 | 1,327 | 2.90625 | 3 | [] | no_license | //
// Created by 김창덕 on 2018-05-24.
//
#include "Reservation.h"
const std::string &Reservation::getHostID() const {
return hostid;
}
void Reservation::setHostid(const std::string &hostid) {
Reservation::hostid = hostid;
}
const std::string &Reservation::getName() const {
return name;
}
void Reservatio... | true |
dca58e0e004a923682dc7e60f527c29705a78e96 | C++ | AhmedAboutaleb94/2DSnakeGame | /src/game_menu.cpp | UTF-8 | 1,288 | 3.09375 | 3 | [] | no_license | #include "game_menu.h"
void Menu::MainMenu(){
cout << "\033[2J\033[1;1H";
cout << "/------------- Welcome to 2D Snake Game -------------/" << endl;
cout << "/--------------------- Main Menu --------------------/" << endl;
cout << "1. Play Game" << endl;
cout << "2. Show Game History" << endl;
}
vo... | true |
7a74e8ab6d40b8bab8f5b6beaaf63e6da305253c | C++ | safaaougunir/IOT | /conn_mqtt_Potentiometre.ino | UTF-8 | 3,789 | 2.5625 | 3 | [] | no_license | #include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
#define TOLERANCE 10
int state = 0;
/***************************************************************************
* Internet Connectivity Setup - Variables & Functions
**************************************************************************/
// Ent... | true |
7b31184474397fbaa44b9310b43a7a32e9ef7892 | C++ | Kingshida/GUL | /GULTestTool/GULLib/GNSSUtilityLibrary/Ephemeris/IGNSSEphemeris.cpp | UTF-8 | 1,414 | 2.640625 | 3 | [] | no_license | #include "IGNSSEphemeris.h"
#include <cmath>
#include <cstring>
namespace sixents
{
namespace Math
{
IGNSSEphemeris::IGNSSEphemeris()
{
InitVar();
}
IGNSSEphemeris::~IGNSSEphemeris()
{}
DOUBLE IGNSSEphemeris::GetCurTime() const
{
... | true |
e513267d6ec1f9ec6d17349331f27dee43e6d734 | C++ | zanfire/zanbase | /src/base/zEvent.cpp | UTF-8 | 846 | 2.609375 | 3 | [] | no_license | #include "zEvent.h"
zEvent::zEvent(void) {
#if defined(_WIN32)
_event = INVALID_HANDLE_VALUE;
_event = CreateEvent(NULL, true, false, NULL);
#elif HAVE_PTHREAD_H
sem_init(&_event, 0, 0);
#endif
}
zEvent::~zEvent(void) {
#if defined(_WIN32)
if(_event != NULL) {
CloseHandle(_event);
_event = NULL;
}... | true |
9ddc2b0daf6e35a689b307789221268aa04ab146 | C++ | dotnet/dotnet-api-docs | /snippets/cpp/VS_Snippets_CLR/MissingMethodException/cpp/MissingMethodException.cpp | UTF-8 | 2,505 | 3.40625 | 3 | [
"MIT",
"CC-BY-4.0"
] | permissive | //Types:System.MissingMethodException
//Types:System.MissingMemberException
//Types:System.MissingFieldException
//<snippet1>
using namespace System;
using namespace System::Reflection;
ref class App
{
};
int main()
{
//<snippet2>
try
{
// Attempt to call a static DoSomething method defined in the... | true |
04dab509ad381ede2eea0567dccfe9640c0b4d31 | C++ | kpratyush12345/Codeforces | /Codeforces Ladder A/469A_I_Wanna_Be_the_Guy.cpp | UTF-8 | 459 | 2.78125 | 3 | [] | no_license | //469A - I Wanna Be the Guy
//https://codeforces.com/problemset/problem/469/A
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,x,y;
cin>>n;
cin>>x;
int arr[200];
int flag=0;
for(int i=0;i<x;i++){
cin>>arr[i];
}
cin>>y;
for(int i=x;i<x+y;i++){
cin>>arr[i];
}
sort(arr,arr +(x+y));
for(int i=0;i<x+y;i... | true |
5dbba34788612b0f44b8d3e6ae69026c90b8815a | C++ | gymnasy55/COW_BULL | /COW_OR_BULL_GAME.cpp | UTF-8 | 3,469 | 3.390625 | 3 | [] | no_license | // COW_OR_BULL_GAME.cpp: Ковальов Сергій, П-81
#define NUMDIGITS 3
#define MAXGUESS 10
#include <iostream>
#include <ctime>
#include <string>
#include <algorithm>
#include <vector>
#include <Windows.h>
using namespace std;
bool IsValid(string str)
{
return str[0] != str[1] && str[0] != str[2] && str... | true |
12ef791c57b2da00d7f496bf0b561b09f0d141bc | C++ | amiedes/consultorio-medico | /Clinic.h | UTF-8 | 6,943 | 3.140625 | 3 | [
"MIT"
] | permissive | //
// Consultorio.h
// T10-Juez-I
//
// Created by Alberto Miedes on 13/5/16.
// Copyright © 2016 Alberto Miedes. All rights reserved.
//
#ifndef Clinic_h
#define Clinic_h
#include <string>
#include <list>
#include <iosfwd>
#include "TreeMap.h"
#include "Appointment.h"
#include "Appointments.h"
#include "Date.h"
... | true |
0886cd1c73540f84f30d6261fe9283dc54bec2c2 | C++ | TasnimZia/UniThings | /CSC101-CPP/CSE-101-master/MultiplicationTableRevisited.cp | UTF-8 | 460 | 3.640625 | 4 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int m, n;
cout<<"Enter Two Numbers: ";
cin>>m>>n;
//MAX and MIN
int mx = m;
int mn = n;
if (mx < n)
{
mx = n;
mn = m;
}
for (int j = mx;j >= mn;j--)
{
cout<<endl;
//... | true |
0d197f1c2c1f5364851fc6551a2065270f8b9583 | C++ | leeeyupeng/leeeyupeng.github.io | /project/algorithm/usaco/src/milk3.cpp | UTF-8 | 1,728 | 2.734375 | 3 | [] | no_license | /*
ID: leeyupeng
LANG: C++11
PROG: milk3
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
using namespace std;
#define PROG milk3
#define FILESTREAM
#ifdef FILESTREAM
#define IN(prog) TMP(prog.in)
#define OUT(prog) TMP(prog.out)
#define T... | true |
3977b4610f649a1df080c708cb617a0d80cda8cf | C++ | elinoyam/CPP_OOP_Exercise | /dynamicArray.h | UTF-8 | 8,005 | 3.484375 | 3 | [] | no_license | #pragma once
#include <iostream>
using namespace std;
template <class T>
class DynamicArray
{
public:
DynamicArray(int size = 2) :lSize(0), pSize(size), arr(new T[size]){}
DynamicArray(const DynamicArray& other) : arr(nullptr) { *this = other; }
~DynamicArray() { delete[] arr; }
int size()const { return... | true |
db3e5b2690b16a6ba2c5ad2dfb843e8434af4cb5 | C++ | David-Butlr/Circular_LInked_List | /LotteryCircularLinkedList.cpp | UTF-8 | 13,875 | 3.6875 | 4 | [] | no_license | /*---------------------------------|
David Butler |
CSC 210 |
4/4/2019 |
This program uses a circular linked|
list to display a rigged lottery |
and writes the results to a file |
----------------------------------*/
#include <iost... | true |
507f0484b564d03218fc9217ab7cf7f4614828fa | C++ | iaraujopaulo/Arduino | /assistenteArduino.ino | UTF-8 | 2,008 | 3.28125 | 3 | [] | no_license | String inputString = ""; // a String to hold incoming data - String de entrada vazia
bool stringComplete = false; // whether the string is complete - confirma se a string chegou inteira e completa
void setup() {
// initialize serial:
Serial.begin(9600);
// reserve 200 bytes for the inputString:
inputS... | true |
2da2f1681add8ffc66cf467a97ed3783107b951e | C++ | cleybertandre/CppNotes | /test/algorithms/strings/test_find_unique_char_in_str.hpp | UTF-8 | 1,167 | 2.84375 | 3 | [
"MIT"
] | permissive | #ifndef TEST_FIND_UNIQUE_CHAR_IN_STR_HPP
#define TEST_FIND_UNIQUE_CHAR_IN_STR_HPP
#include <boost/test/unit_test.hpp>
#include "algorithms/strings/find_unique_char_in_str.hpp"
BOOST_AUTO_TEST_CASE(test_fucis_empty_str)
{
FindUnique::Solution solution;
std::string str;
int expected = -1;
BOOST_CHECK(e... | true |
b7094db1f71c0d10a44e9a2e9748c3884c5fa6f5 | C++ | stupid-turtle/LearningOpenGL2.0 | /Getting Started/Hello Triangle/Hello Triangle/main.cpp | GB18030 | 8,952 | 2.78125 | 3 | [] | no_license | // GLAD
#include <glad/glad.h>
// GLFW
#include <GLFW/glfw3.h>
#include <iostream>
void framebuffer_size_callback(GLFWwindow* window, int width, int height);
void processInput(GLFWwindow* window);
void check_shader_compile_success(GLuint shader);
void check_program_link_success(GLuint program);
const char* vertexShad... | true |
ab4bbb7258c0548e6c6038d49abeaa3d326d03cd | C++ | LeeMyeungJun/INHAstudy | /HomeStudy/DirectVec/cMatrix.cpp | UHC | 2,752 | 3.0625 | 3 | [] | no_license | #include "stdafx.h"
#include "cMatrix.h"
#include <random>
using namespace std;
cMatrix::cMatrix()
{
}
cMatrix::~cMatrix()
{
}
cMatrix::cMatrix(int nDimension):dimension(nDimension)
{
std::vector<float> insert;
for (int i = 0; i < nDimension; i++)
{
matrix.push_back(insert);
for (int j = 0; j < nDimension;... | true |
97868e4688b255ed5075de9e5efc47833bb66e55 | C++ | G33k1973/CodingGames | /SexyPrimes2.cpp | UTF-8 | 609 | 2.65625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
bool prime[10000001];
int main()
{
int m = 10000001;
for (int i = 0; i < m; i++) {
prime[i] = true;
}
for (int i = 2; i < m; i++) {
if (prime[i] == true) {
for (int j = i + i; j < m; j += i) {
prime[j] = false;
}
}
}
int t;
cin >> t;
... | true |
1ac669c4c4479cb4607def832c5a5d222b2da995 | C++ | ahmoura/TAG | /p2/grafo_extrair_funcoes.cpp | UTF-8 | 5,268 | 3.09375 | 3 | [] | no_license | /*
UnB - Universidade de Brasilia
Projeto 1
TAG - Teoria e Aplicacao de Grafos
Professor: Dibio
Aluno: Antonio Henrique de Moura Rodrigues
Matricula: 15 / 0118236
*/
#include <iostream> // funcoes de entrada e saida de dados
#include <fstream> // funcoes de manipulacao de arquivos
#include <string> // func... | true |
8a473ab1794150bd254fde01cc8956d213ed5aea | C++ | semiessessi/NNL | /Network/FeedForward.cpp | UTF-8 | 3,292 | 2.5625 | 3 | [] | no_license | // Copyright (c) 2015 Cranium Software
#include "FeedForward.h"
#include "Neuron/SigmoidNeuron.h"
#include <cstdio>
namespace NNL
{
void FeedForwardNetwork::AddLayer( Layer& xLayer )
{
if( mapxLayers.size() > 0 )
{
Layer& xPrevious = *( mapxLayers.back() );
// connect all the neurons to eac... | true |
44dcf124ac5bd5faa5551bf364d0773acd54aadb | C++ | iamrakesh28/Competitve-Programming | /Algorithms-Implementation/bfs.cpp | UTF-8 | 1,112 | 2.734375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define pb(x) push_back(x)
class Graph{
public:
int V;
list <int> *adj;
void addEdge(int,int);
Graph(int);
void BFS(int);
};
Graph::Graph(int v)
{
this->V = v;
adj = new list <int> [V];
}
void Graph::addEdge(int u,int v)
{
adj[u].pb(v);
adj[v].pb(u);
}
void Gr... | true |
5d788c654fd1992f00060533fc0ff639755a3ba6 | C++ | mingyuefly/C_Primer_Plus- | /C_Primer_Plus++/diwuzhang/diwuzhang/comstr2.cpp | UTF-8 | 455 | 2.828125 | 3 | [
"MIT"
] | permissive | //
// comstr2.cpp
// diwuzhang
//
// Created by mingyue on 15/12/22.
// Copyright © 2015年 G. All rights reserved.
//
#include <iostream>
#include <string>
int main(int argc, const char * argv[]){
using namespace std;
string word = "?ate";
for (char ch = 'a'; word != "mate"; ch++) {
c... | true |
47ad3c34c24e10e463fc5135f2c16ceb03c0d1ac | C++ | goforit00/ChatServer1 | /ChatServer1/ChatServer1/CLFuncProviderNameServer.cpp | WINDOWS-1252 | 1,088 | 2.625 | 3 | [] | no_license | #include "CLFuncProviderNameServer.h"
#include <string.h>
CLFuncProviderNameServer* CLFuncProviderNameServer::m_Instance = NULL;
CLFuncProviderNameServer* CLFuncProviderNameServer::GetInstance()
{
if( m_Instance == NULL )
m_Instance = new CLFuncProviderNameServer();
return m_Instance;
}
CLFuncProviderNameServer::... | true |
0801bc45e92b4acff75251a8da43428c8b8b440d | C++ | hechenyu/book_code | /libtr1/funobjref/refcref.cpp | UTF-8 | 467 | 3.265625 | 3 | [] | no_license | #include <tr1/functional>
#include <iostream>
using std::tr1::reference_wrapper;
using std::tr1::ref;
using std::tr1::cref;
using std::cout;
void show(int &i)
{
cout << "int &: " << i << '\n';
}
void show(const int &i)
{
cout << "const int &: " << i << '\n';
}
int main()
{
int Miller = 3;
show(ref(Miller));
re... | true |
6d31ddc8936d3cada976980af9d23bf8ab9cf213 | C++ | Crogarox/Mahatta | /tools/gfx_d3d/math/ray.cpp | UTF-8 | 3,505 | 2.703125 | 3 | [] | no_license | #include "common.h"
#include "GFX\gfx_math.h"
//ray stuff
#define EPSILON 1.0e-10 //0.03125f
#define CLOSE_TOLERANCE 1.0e-6
#define DEPTH_TOLERANCE 1.0e-6
//normals for the box
f32 g_boxNorm[6][3] =
{{-1,0,0}, {1,0,0}, {0,-1,0}, {0,1,0}, {0,0,-1}, {0,0,1}};
/////////////////////////////////////
// Nam... | true |
b378b5f7895c78075ba9e9b1f61cb65880bee665 | C++ | BrunoLQS/Projects_and_ITA | /CES-10/lab_01 x/lab_01_Bruno_Lima_Queiroz_Santos.cpp | ISO-8859-1 | 957 | 2.9375 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
int main() {
/*declarao de variveis*/
int aluno,numalunos,p1,p2,p3,p4;float n1,n2,n3,n4;
printf("NOTAS DE DIVERSOS ALUNOS EM 4 PROVAS:\n\n");
printf("Digite o numero de alunos:");
scanf("%d",&numalunos);printf("\n\n");aluno = 1;
printf("Digite o peso da prova 1:");
scanf("%d",&p... | true |
042c44a9651ee5cbb1d28ec4d52fae5b4dc1e39b | C++ | lbondi7/Element-2.0 | /ElementEngine/enginelib/src/VknRenderPass.cpp | UTF-8 | 6,015 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "VknRenderPass.h"
#include "VkFunctions.h"
#include "Device.h"
#include <element/GameSettings.h>
#include "VkInitializers.h"
#include <stdexcept>
Element::RenderPass::RenderPass(VkFormat imageFormat)
{
// createVkRenderPass(imageFormat);
}
Element::RenderPass::RenderPass(SwapChain* swapChain)
{
init(... | true |
c22229a38b3f06682172d765afa4dc995d5701c8 | C++ | vvoZokk/dnn | /dnn_project/spikework/kernels/rbf_dot.cpp | UTF-8 | 1,053 | 2.578125 | 3 | [
"MIT"
] | permissive |
#include "rbf_dot.h"
#include <dnn/util/func_param_parser.h>
#include <dnn/util/fastapprox/fastexp.h>
namespace dnn {
void RbfDotKernel::usage(ostream &str) const {
str << "spec: RbfDot(sigma = " << o.sigma << ")\n";
str << "desc: Gaussian radial basis function, which is a general purpose kernel\n";
}
do... | true |
eaae1e58787f0303af33c0584450bdcc2867e381 | C++ | shugo256/AtCoder | /AGC/002_C_Knot_Puzzzle.cpp | UTF-8 | 560 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int n;
long l;
cin >> n >> l;
long a, prev=-10000000000;
int i = 0;
for ( ; i<n; i++) {
cin >> a;
if (a + prev >= l)
break;
prev = a;
}
if (i == n) {
... | true |
729dec0e292b2a31e1fd5218915115642d16cd69 | C++ | jonathenzc/Algorithm | /LeetCode/iter1/c++/CombinationSumIII.cpp | UTF-8 | 1,073 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
void helper(int index, int sum, int cnt,int target, vector<int>& candidates, vector<int> &curV, vector<vector<int>> &v)
{
if (sum == target)
{
if(curV.size() == cnt)
v.push_back(curV);
}
else
{
for (int i = index + 1; i < cand... | true |
3743f265541385d5833def5853f1a5901d025b71 | C++ | bricewillous/BedControl | /legacy/arduino (old)/src/debugPrint.ino | UTF-8 | 10,522 | 2.8125 | 3 | [] | no_license | #include "arduino.h"
void printPrefix (int debugLevel)
{
Serial.print ("[");
debugPrintDigits (day());
Serial.print ("/");
debugPrintDigits (month());
Serial.print ("/");
Serial.print (year());
Serial.print (" ");
debugPrintDigits (hour());
Serial.print (":");
debugPrintDigits (minute());
Serial.print (":... | true |
87dea907ebbfd2b0f7f88e10ed91ef4ce861ab10 | C++ | huangcaohui/Data-Structure-And-Algorithm | /tree.h | UTF-8 | 1,748 | 3.671875 | 4 | [] | no_license | #include <iostream>
using namespace std;
template<class T>
class TreeNode //树结点的ADT
{
private:
T m_Value; //树结点的值
TreeNode<T> *pChild; //第一个左孩子指针
TreeNode<T> *pSibling; //由兄弟指针
public:
TreeNode(const T &value); //拷贝构造函数
virtual ~TreeNode() {}; //析构函数
bool isLeaf(); //判断当前结点是否... | true |
42fb57de21925214921f70a50f1042597cbe07d7 | C++ | fooad444/OS | /ex2/tests/tester.cpp | UTF-8 | 11,992 | 2.671875 | 3 | [] | no_license | //
///*
// * tester.cpp
// *
// * Created on: Apr 7, 2015
// * Author: moshemandel
//*/
//
//
//
//#include <unistd.h>
//#include "uthreads.h"
//#include "iostream"
//#define INTERVAL 1000000
//using namespace std;
//
//int totalQuantums = 0;
//
//void foo() {
// while(true) {
// if (uthread_get_total_quantums()... | true |
8fffad15e1ece26658d6704697855f794fde3361 | C++ | javierborja95/CSC17C | /Project/WheelOfFortune_V5/Player.h | UTF-8 | 738 | 3.359375 | 3 | [] | no_license | /* File: Player.h
* Author: Javier B
* Created on October 20, 12:00 PM
* Purpose: Struct Specification File for Player
*/
#ifndef PLAYER_H
#define PLAYER_H
//System Libraries
#include <iostream>
#include <string>
using namespace std; //Namespace of the System Libraries
//User Libraries
struct Player{
stri... | true |
7cce15cd3e983fa4cc8594c65334ee5f244b3a9c | C++ | 808sam/Personal-Coding-Projects | /Datalog/Rule.h | UTF-8 | 749 | 3.171875 | 3 | [] | no_license | #ifndef RULE_H
#define RULE_H
#include "Predicate.h"
#include <vector>
#include <string>
//holds which predicates allow for creation of tuples
//headPred(<params>) :- pred1(<params>), pred2(<params>)
//if tuples for all body preds, rule says can create tuple for headPred
class Rule
{
public:
Rule(Predic... | true |
44c51ae3af86ec6d381939d68e5a4a4289e3f07a | C++ | hexlet-basics/exercises-cpp | /modules/40-data-types/70-const-type/main.cpp | UTF-8 | 228 | 2.875 | 3 | [] | no_license | #include <iostream>
int main(int argc, char *argv[]) {
using centimeters = double;
centimeters radius { atof(argv[1]) };
// BEGIN
constexpr double kPi { 3.14 };
std::cout << 2 * kPi * radius << std::endl;
// END
}
| true |
743458393f189d65fa338c2c575d81b28e6f2195 | C++ | pcuji/Meetup_challenges- | /main.cpp | UTF-8 | 416 | 2.796875 | 3 | [] | no_license | //
// main.cpp
// contains_duplicate
//
// Created by Pedro Jose Cuji on 9/20/17.
// Copyright © 2017 Pedro Jose Cuji. All rights reserved.
//
#include <iostream>
#include <list>
int main(int argc, const char * argv[]) {
// insert code here...
// declring list
std::list <int> A;
std::list <int>... | true |
2a5741e491d2f480858eac623cd3958b88ea90c4 | C++ | bobreg/weather_station_on_arduino | /1_loop.ino | UTF-8 | 2,867 | 2.796875 | 3 | [] | no_license | void loop() {
if (flag_button_wake_up == false) { // если кнопка прерывания не была нажата, то...
count_sleepss_period = 0; // обнулим количество периодов долгого сна
measure(); // опросим датчики
update_history(); // обновим историю
//Serial.println(... | true |
ff91d779a79cb0e5b26866489fb6b672d5359645 | C++ | abhijeetmokate/OOP_CPP | /jump_search.cpp | UTF-8 | 599 | 3.828125 | 4 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
int jump_search(int *arr, int size, int value)
{
int block_size = sqrt(size);
int start = 0;
int end = block_size;
while(arr[end]<=value && end<size-1) // |1|2|3|4|5|6|7|8|9|10|11|
{
start = end;
end = end+block_size;
... | true |
a8ca6ef146dda1874ba494a94d8b5f49c886b653 | C++ | ericjohnsonKC/CS325-DataStructures | /wk1_stacks/stackImplementation.cpp | UTF-8 | 7,379 | 3.75 | 4 | [] | no_license | /*************************************************
* Author: Eric Johnson
* Date 11/17/2020
*
* Grantham University
* CS325 Data Structures
* Week 1 Assignment: Stack Implementation
*
* Description:
* This is the main program file, created per the
* assignment instructions.
****************************... | true |
82282a08fda69b1252d90237622335b8cfbcf4b3 | C++ | takase1121/libcompat | /tests/test.cpp | UTF-8 | 531 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include "../compat.h"
using namespace std;
int main() {
cout << "Sleep for 2 seconds." << endl;
compat_sleep(2000);
cout << "Try beeping for 1 second" << endl;
compat_beep(1000, 1000);
compat_cls();
cout << "Did you catch that? I cleared the screen!" << endl;
compat_color("fc");
... | true |
eb8c1fd198bd18c0efa352f344f62538e87bb4cb | C++ | mchlp/competitive-programming | /DMOJ/CCC/ccc18s4.cpp | UTF-8 | 569 | 2.703125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
unordered_map<int, long long> memo;
long long recur(int weight) {
if (memo.count(weight) == 0) {
if (weight == 1) {
memo[weight] = 1;
} else {
long long total = 0;
for (int i=2; i<=weight; i++) {
int... | true |
2579c80469983271b4593c61bdb8171b69791bb7 | C++ | Blubehriluv/Assignment-07-Keywords-II | /Assignment 07/Keywords II/Source1.cpp | UTF-8 | 1,291 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <ctime>
#include <cctype>
using namespace std;
char guess;
const int MAX_WRONG = 8; //How many guesses you can get wrong
vector<string> words; //words to guess
const string THE_WORD = words[0];
//words to guess
int wrong = 0;
//n... | true |
b5af1aa64fad54bc38227de57127ab3cd5aa84eb | C++ | camaren/woo | /Person.hpp | UTF-8 | 663 | 3 | 3 | [] | no_license | // Person.hpp
//
// 'Hello World' class. Function declarations.
//
// (C) Datasim Education BV 2005-2006
//
#ifndef Person_HPP
#define Person_HPP
#include "datasimdate.hpp" // My dates and other useful stuff
#include <string> // Standard string class in C++
using namespace std;
class Person
{
publi... | true |
c8c1ed416605682599a8d21730cb2cb3eda0158f | C++ | eluqm/load-forescasting-ia2 | /network.cpp | UTF-8 | 6,792 | 2.765625 | 3 | [] | no_license | #include "network.h"
#include <math.h>
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <math.h> //For tanh
#include <fstream>
#include <vector>
// returns a float in the range -1.0f -> - 1.0f
#define RANDOM_CLAMP (((float)rand()-(float)rand())/RAND_MAX)
//returns a float between 0 & ... | true |
aba5c75a85a0809f0c7625c1af17a87f34c2f8b8 | C++ | Nebul5/CPS | /headers/shape.h | UTF-8 | 1,787 | 3.03125 | 3 | [] | no_license | #ifndef SHAPE_H
#define SHAPE_H
#include <string>
// std::string
#include <utility>
// std::pair
#include <memory>
// std::shared_ptr
#include <initializer_list>
// std::initializer_list
// This is the Shape Base class that Circle, Rectangle and Regular Polygon
// Inherit from
namespace cps {
class Shape {
public:
... | true |
d592836390d8111da29da5760d59519f83b34426 | C++ | playerxq/algorithm-design | /algorithm design/leetcode-335-地图穿插/leetcode-335-地图穿插/leetcode-335-地图穿插.cpp | GB18030 | 1,110 | 2.703125 | 3 | [] | no_license | // leetcode-335-ͼ.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <unordered_map>
#include <stack>
#include<iomanip>
#include <ctype.h>
#include <algorithm>
using ... | true |
493e061b07d8fe3b04effc8ad5f64650ff23d1b7 | C++ | maskottchentech/Arduino | /Labmate_code/service.ino | UTF-8 | 4,666 | 2.921875 | 3 | [] | no_license | void secondscreen5() {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Enter Password");
while (secondscreenflag5 == true) {
delay(180);
int up = digitalRead(up_buttonPin); // down_buttonPin key
int down = digitalRead(down_buttonPin); // down... | true |
5c3fcf698674ae8fe59cc2c757b65a5f61212891 | C++ | BinaryBrain/Elodie-Dream | /src/Menu/Menu.cpp | UTF-8 | 2,272 | 2.875 | 3 | [] | no_license | #include "Menu.h"
const std::string Menu::SELECTOR_PATH = "assets/img/sprites/poro.png";
Menu::Menu(const std::string& label, GameState state): MenuComponent(label, state)
{
selectortexture.loadFromFile(SELECTOR_PATH, sf::IntRect(102, 16, 120, 30));
selector.setTexture(selectortexture);
background.setOut... | true |
23ece01d03df847d837421205d236fad01ce164d | C++ | Roarw/SteampunkFriends | /SteampunkFriends/CPPGameWorld/Collider.h | UTF-8 | 718 | 2.609375 | 3 | [] | no_license | #ifndef COLLIDER_H
#define COLLIDER_H
#include "Component.h"
#include <stack>
#include <vector>
#include "IDraw.h"
#include "Vector2.h"
#include "RectangleF.h"
class SpriteRenderer;
class Transform;
class Collider :
public Component, public IDraw
{
private:
SpriteRenderer * spriter;
Transform * transform;
voi... | true |
72da6f6930bda8a1303394009ed546e02b95236c | C++ | PranabSarker10/CPlusPlus | /32 to 42.Operator/32 to 42.OPERATOR PROGRAMMING/39.1ASSIGNMENT OPERATOR OVERLOADING.cpp | UTF-8 | 596 | 3.8125 | 4 | [] | no_license | ///Assignment Operator overloading
#include<iostream>
using namespace std;
class Number
{
int x,y;///Private member variable
public:
Number() {x=0; y=0;}///constructor
Number(int a, int b){x=a; y=b;}///constructor
void get(int &a,int &b){a=x; b=y;}
void set(int a, int b){x=a; y=b;}
void print()... | true |
eae177cab3c513e3aadce65c7a1309e2d907fe9c | C++ | msaaddev/Basic-Cpp-Programs | /Continuously takes number from the user until user enters -1, and then gives the maximum number among the inputed number.cpp | UTF-8 | 350 | 2.921875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int maximum, a;
maximum=0;
while (a!=-1)
{
cout << "enter the number=";
cin >> a;
if (a<-1)
{
}
else
{
if (a>maximum)
{
maximum=a;
}
else
{
}
}
}
cout << "Maximum numbe... | true |
6a581f324debf883f45fc2db480d39f6c5bd554a | C++ | wtrsltnk/GraphicsFileLoader | /Graphics/GraphicsView.cpp | UTF-8 | 2,007 | 2.78125 | 3 | [] | no_license | // GraphicsView.cpp: implementation of the GraphicsView class.
//
//////////////////////////////////////////////////////////////////////
#include "GraphicsView.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
////////////////////////////////////////////////////////... | true |
27463a6966a872a99d5aedc1c705dd7d39ccd7c1 | C++ | dbgtmaster/sepbackupmonitor-client | /MainWindow/MainMenu.h | UTF-8 | 1,026 | 2.515625 | 3 | [] | no_license | #ifndef MAINMENU_H
#define MAINMENU_H
#include <QObject>
#include <QWidget>
#include <QLayout>
#include "QPushButton"
#include <MainWindow/MainWindow.h>
class MdiAbstractWindowFactory;
class MdiAbstractWindow;
class MainMenu : public QWidget
{
Q_OBJECT
private:
QHBoxLayout _layout;
// Eine Liste, welch... | true |
3a99cde0d4d013d5f22add3b3c02335c01bd4bb7 | C++ | itsdrell/SoftwareDevelopment | /Engine/Code/Engine/Math/Geometry/Plane.cpp | UTF-8 | 826 | 3.109375 | 3 | [] | no_license | #include "Plane.hpp"
#include "..\..\Core\Tools\ErrorWarningAssert.hpp"
#include "..\MathUtils.hpp"
Plane::Plane(const Vector3 & theNormal, const Vector3 & pos)
{
distance = DotProduct(normal, pos);
normal = theNormal;
}
Plane::Plane(const Vector3 & a, const Vector3 & b, const Vector3 & c)
{
Vector3 e0 = b - a;
V... | true |
50514f46073c01e2bd92f968a6f8c68207bf62d2 | C++ | sakrejda/Lux | /include/slicer-continuous.hpp | UTF-8 | 2,607 | 2.5625 | 3 | [] | no_license | #ifndef SLICER_CONTINUOUS_H
#define SLICER_CONTINUOUS_H
#include <trng/yarn2.hpp>
#include <trng/uniform01_dist.hpp>
#include <trng/exponential_dist.hpp>
#include <cmath>
#include <algorithm>
template <class T_PDF, class T_DOMAIN>
class Slicer_Continuous {
public:
Slicer_Continuous();
Slicer_Continuous(
const T... | true |
4a23a1f676f943285129f504dceee739da63f2c7 | C++ | jackjoynson/MedicalImaging | /ImageReconstruction/ITERATIVECOINC/Cone.h | UTF-8 | 1,084 | 2.96875 | 3 | [] | no_license | #ifndef Cone_h
#define Cone_h
class Cone
{
private:
double _StartX, _StartY, _StartZ;
double _DirectionX, _DirectionY, _DirectionZ;
double _HalfAngle;
public:
Cone(double startX, double startY, double startZ, double directionX, double directionY, double directionZ, double halfAngle);
double GetStartX()
{
r... | true |
5443bc32de6a6d4e67e4f2708b3e8fa2d01f8e98 | C++ | BearPolarny/ComplexNumbers | /ComplexNumbers/ComplexNumber.h | UTF-8 | 778 | 2.890625 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string>
static int count;
class ComplexNumber
{
public:
ComplexNumber();
ComplexNumber(double _real, double _imaginary);
ComplexNumber(double _real);
//ComplexNumber(std::string _str);
ComplexNumber(const ComplexNumber &COther);
~ComplexNumber();
ComplexNumber operat... | true |
ee6971ae8222822ac8fe3b04268ae859639020d2 | C++ | tanzfisch/IH | /src/game/GameLayer.h | UTF-8 | 3,207 | 2.578125 | 3 | [] | no_license | #ifndef __GAMELAYER_H__
#define __GAMELAYER_H__
#include "Plane.h"
class HUDLayer;
class GameLayer : public iLayer
{
public:
/*! init members
*/
GameLayer(iWindow *window, int32 zIndex);
/*! does nothing
*/
virtual ~GameLayer() = default;
/*! sets the hud layer so it's content can be c... | true |
10cfabb0ad77a185d5624ac17efaca346dd5e80c | C++ | grishavanika/bittorrent_client | /src/bencoding/include/bencoding/be_parse_utils.h | UTF-8 | 2,208 | 2.609375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <bencoding/be_element_ref.h>
#include <bencoding/be_errors.h>
#include <small_utils/utils_string.h>
#include <type_traits>
namespace be
{
template<typename T>
outcome::result<const T*> ElementRefAs(const ElementRef& e);
template<typename T>
outcome::result<T*> Eleme... | true |
f2c446f1d6948ebbad4b7091ca6a1632d5f57d78 | C++ | xuguocong/LeetCodeAnswer | /leetCodemianshi/48.cpp | UTF-8 | 1,355 | 3.71875 | 4 | [] | no_license | // 48. 旋转图像
// 给定一个 n × n 的二维矩阵表示一个图像。
// 将图像顺时针旋转 90 度。
// 说明:
// 你必须在原地旋转图像,这意味着你需要直接修改输入的二维矩阵。请不要使用另一个矩阵来旋转图像。
// 示例 1:
// 给定 matrix =
// [
// [1,2,3],
// [4,5,6],
// [7,8,9]
// ],
// 原地旋转输入矩阵,使其变为:
// [
// [7,4,1],
// [8,5,2],
// [9,6,3]
// ]
// 示例 2:
// 给定 matrix =
// [
// [ 5, 1, 9,11],
// ... | true |
895ab60748a164eee575a378048253a4c62d5b27 | C++ | Ritzing/Algorithms-2 | /InsertionSort/C++/insertion_sort.cpp | UTF-8 | 1,113 | 4.28125 | 4 | [
"Apache-2.0"
] | permissive | /*
* @author Abhishek Datta
* @github_id abdatta
* @since 15th October, 2017
*
* The following algroithm takes a list of numbers
* and sorts them using the insertion sort algorithm.
*/
#include <iostream>
using namespace std;
// function to swap two numbers
void swap(int *a, int *b)
{
int t = *a;
*a = *b;
*b = t;
... | true |
454ba1a020e41d9a0daf3db818a6f8aae47ae4b5 | C++ | TanVD/SpbSU-Homeworks | /1_year/1_term/9/9-1/main.cpp | UTF-8 | 1,798 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include "stringATD.h"
#include "rabin-carp.h"
int main()
{
char fileFirstLocation[100];
char fileSecondLocation[100];
std::cout << "This program will create file which contain idenctical lines of two chosen files";
std::cout << "Enter location of first file: ";
... | true |
502cf68161c17ba21aa75830498b9144a0abe81c | C++ | swrni/simple_gui | /Common/Common.cpp | ISO-8859-3 | 2,265 | 2.984375 | 3 | [
"MIT"
] | permissive | #include "Common.hpp"
#include <iostream>
#include <algorithm> // std::remove_if, ...
void TrimString( std::wstring& str,
const std::wstring& cs_to_save )
{
str.erase(
std::remove_if(
std::begin( str ),
std::end( str ),
[&cs_to_save]( const wchar_t& c ){ return cs_to_save.find( c ) == std::wstring::n... | true |
e05260964866f6ca79ab135dfe045add6416402e | C++ | KimBoWoon/HomeWork | /Visual Studio 2013/Projects/Binary_Search_Tree/Binary_Search_Tree/Binary_Search_Tree_Main.cpp | UTF-8 | 1,022 | 3.140625 | 3 | [] | no_license | // HW 2 : Binary Search Tree
// Name :
// Student ID :
//#include "hw2.h"
//#include "lab.hpp"
#include "Binary_Search_Tree.cpp"
int cnt = 0;
int main() {
BinaryST<Item> bst;
// a binary search tree of type Item
while (1) {
cerr << "BST > ";
string command;
cin >> command;
// cout << command << " ";
i... | true |
dff3accf8faf7fc3757e0747994c52b2e82953ee | C++ | dawagner/libstructure | /examples/parameter-framework/exportValue.cpp | UTF-8 | 4,425 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* Copyright (c) 2016, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the ... | true |
86544f70dbc3cd8810bebc40927d7004b702ca08 | C++ | frblazquez/ACA | /Homework3/kernels/kernel4/kernel4_test.cpp | UTF-8 | 776 | 2.921875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "kernel4.h"
int main()
{
int input_array[ARRAY_SIZE], output_array[ARRAY_SIZE], index[ARRAY_SIZE], offset;
offset = rand()%35;
for(int i = 0; i < ARRAY_SIZE; i++ )
{
input_array[i] = rand()%16;
output_array[i] = input_array[i];
ind... | true |
d777c3fb5813e082aacfb1ab0c7987b01f0a72d2 | C++ | kim-ae/cad_tool | /src/main.cpp | UTF-8 | 6,052 | 3.3125 | 3 | [] | no_license | #include <cstdlib>
#include <list>
#include "aagReader.h"
#include "aigBuilder.h"
using namespace std;
typedef enum{
READ_FILE,
CREATE_XOR,
CREATE_AND_OR_GATE,
STATISTICS,
SHOW,
EXIT,
BACK,
INVALID
}options;
options stringToEnum(string option){
if(option == "sta... | true |
51288f459f91570e2214a04163d6955bf06674b2 | C++ | pial08/Practice | /practice1.cpp | UTF-8 | 3,024 | 3.046875 | 3 | [] | no_license | #include <stdio.h>
#include <iostream>
#include <vector>
#include <cstring>
#include <limits.h>
#include <algorithm>
using namespace std;
vector<vector<vector<bool> > > dp;
vector<int> res;
vector<int> original;
int total_size;
bool possible(int index, int sum, int sz) {
if (sz == 0) return (sum == 0);
if (i... | true |
fa239edcb01b26d4985385a03be36e4f2d35d7ac | C++ | peeyuuec/intern | /interleaving_arrays.cpp | UTF-8 | 722 | 3.640625 | 4 | [] | no_license | #include<iostream>
#include<cstring>
using namespace std;
void join(char *arr1,char *arr2,int depth1,int depth2,char *temp,int current){
int length1=strlen(arr1);
int length2=strlen(arr2);
if(length1+length2!=0){
if(current==length1+length2){
cout<<temp<<endl;
}
else{
if(depth1<length1){
temp[curre... | true |
0cdd790aa675f99d134203c5ad0c42cf6ef73166 | C++ | elianalien/nature-of-code-cinder | /chapter03/Example2/src/Mover.cpp | UTF-8 | 1,275 | 2.59375 | 3 | [] | no_license | /*
* Mover.cpp
* Example2
*
* Created by Nathan Koch on 1/5/13
* Copyright 2013 __MyCompanyName__. All rights reserved.
*
*/
#include "cinder/app/AppBasic.h"
#include "cinder/Color.h"
#include "cinder/Rand.h"
#include "Mover.h"
using namespace ci;
using namespace ci::app;
using namespace std;
Mover::Mover... | true |
9cd9b9a996c32b439dc9d0063d9f136db1ca1c95 | C++ | Michal-Stempkowski/isGCS | /cyk_table.h | UTF-8 | 4,322 | 2.640625 | 3 | [] | no_license | #include "cuda_all_helpers.h"
#include "preferences.h"
#if !defined(CYK_TABLE_H)
#define CYK_TABLE_H
class cyk_table
{
public:
enum info : int
{
replicated = 1,
not_enough_space = 2
};
CCM cyk_table(const int block_id_, const char* source_code_localization_, int* prefs_, int* table_, int* table_header_);
C... | true |
78263b0b719cfa22beb22952922d19752ce1856c | C++ | oshiroscope/KHR-Segway-PC | /command_gen.cpp | UTF-8 | 1,715 | 2.703125 | 3 | [] | no_license | #include "command_gen.hpp"
std::vector<unsigned char> CommandGen::SeriesServoMove(std::map<int, int> dest, int frame)
{
int cnt = dest.size();
unsigned char size = (unsigned char)(8 + 2 * cnt + 1);
std::vector<unsigned char> cmd((int)size);
cmd[0] = size;
cmd[1] = 0x10;
cmd[7] = (unsigned char... | true |
f14ccf0203b310ffcc5ebf7a9c12a337a8c4fa0f | C++ | egortrue/NeVK | /src/engine/core/commands/commands.h | UTF-8 | 2,598 | 2.578125 | 3 | [] | no_license | #pragma once
// Внутренние библиотеки
#include "core.h"
#include "resources/resources.h"
class Core;
class Commands {
public:
Core::Manager core;
explicit Commands(Core::Manager);
~Commands();
//=========================================================================
// Области выделения командных буфе... | true |
4deb7f7bffc90d883a666a2f90e9c4425b80c3fc | C++ | YnPagani/Learning-Cpp | /section20/function_templates/src/main.cpp | UTF-8 | 1,097 | 3.859375 | 4 | [] | no_license | #include <iostream>
#include <string>
template <typename T>
T min(T a, T b){
return (a < b) ? a : b;
}
template <typename T1, typename T2>
void func(T1 a, T2 b){
std::cout << a << " " << b << std::endl;
}
struct Person{
std::string name;
int age;
// necessary since the compiler doesn't know how... | true |
f6caf12c638a9f02f8b81f933117081f5a9d05af | C++ | marcelomata/competitive-programming-1 | /UVA/AdHoc/MutantFlatworldExplorers.cpp | UTF-8 | 2,256 | 3.046875 | 3 | [] | no_license | #include<stdio.h>
#include<iostream>
#include<cstring>
#include<string>
bool visited [52] [52];
int x,y,row,col;
char dir;
bool pos;
using namespace std;
void update (char n){
if ( dir == 'S' && n == 'R' )
dir = 'W';
else if ( dir == 'S' && n == 'L' )
dir = 'E';
else if ( dir == 'N' && n =... | true |
b4877e09d3d04e1c17ff0aaa8b5a562dda8b8264 | C++ | tapasjain/SDPOR | /event_buffer.hh | UTF-8 | 1,914 | 2.515625 | 3 | [] | no_license | #ifndef __EVENT_BUFFER_H__
#define __EVENT_BUFFER_H__
#ifdef __GNUC__
#include <ext/hash_map>
using __gnu_cxx::hash_map;
using __gnu_cxx::hash;
#else
#include <hash_map>
#endif
#include <utility>
#include <string>
#include "inspect_util.hh"
#include "inspect_event.hh"
#include "program_state.hh"
using std:... | true |
5432cb0762972d20a6d1865b7afcbe74473e8279 | C++ | s-valentin/Laboratoare-POO | /Exercitii jmekere/Lab3 OOP/Math.cpp | UTF-8 | 1,550 | 3.171875 | 3 | [] | no_license | #include "Math.h"
#include <stdarg.h>
int Math::Add(int nr1, int nr2)
{
return nr1 + nr2;
}
int Math::Add(int nr1, int nr2, int nr3)
{
return nr1 + nr2 + nr3;
}
int Math::Add(double nr1, double nr2)
{
double sum = nr1 + nr2;
return (int)sum;
}
int Math::Add(double nr1, double nr2, double nr3)
{
double sum = n... | true |
138e468eec5474ec2e17c6e0e28b724636d82f7d | C++ | mytlsdnkr/algo | /complete/9461/9461.cpp | UTF-8 | 454 | 2.90625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
long triangle[101];
int testcase;
int length;
int i;
cin>>testcase;
triangle[1]=1;
triangle[2]=1;
triangle[3]=1;
triangle[4]=2;
for(i=5;i<=100;i++){
triangle[i]=triangle[i-3]+triangle[i-2];
}
for(i=0;i<testcase;i++){
... | true |
cad8ba8d9a0439c0a0744e53721b20f9e5b0b95d | C++ | seidyizawa/programacao-avancada | /prova1/main.cpp | UTF-8 | 1,821 | 3.3125 | 3 | [] | no_license | #include "vetorint.h"
#include "data.h"
#include <iostream>
using namespace std;
int main(){
VetorInt v1(4),v2(4),escalar(4),soma(4),sub(4),v3(4);
v1.setValor(0,2);
v1.setValor(1,5);
v1.setValor(2,8);
v1.setValor(3,4);
v3.setValor(0,2);
v3.setValor(1,5);
v3.setValor(2,8);
... | true |
f9d050c254a6f1dd3cec6c8b6e32b420b7f828a5 | C++ | nitsas/pareto-approximator | /DifferentDimensionsException.h | UTF-8 | 1,694 | 3.25 | 3 | [] | no_license | /*! \file DifferentDimensionsException.h
* \brief The declaration and definition of the DifferentDimensionsException
* exception class.
* \author Christos Nitsas
* \date 2012
*/
#ifndef DIFFERENT_DIMENSIONS_EXCEPTION_H
#define DIFFERENT_DIMENSIONS_EXCEPTION_H
#include <exception>
/*!
* \weakgrou... | true |
409a1114c0e1945a1cccc1bcf0ade66b9d9b8ce2 | C++ | vital228/Algorithm | /sportprog1/sportprog1/Handle.cpp | UTF-8 | 509 | 2.71875 | 3 | [] | no_license | #include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<numeric>
#include<iostream>
using namespace std;
int main() {
map<string, string> m;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
string a, b;
cin >> a >> b;
if (m.find(a) != m.end()) {
m[b] = m[a];
... | true |
f08908dc9bd144c9e8c6ee83fd831d12fa7a4288 | C++ | Mashiatmm/Offlines | /2-1/Data Structure & Algorithms Part 1/Offline 7/statistics.cpp | UTF-8 | 4,186 | 3.046875 | 3 | [] | no_license | #include<cstdio>
#include<iostream>
#include<ctime>
#include<chrono>
using namespace std;
void Merge(int a[],int l,int mid,int h){
int n1=mid-l+1;
int n2=h-mid;
int L[n1],H[n2];
for(int i=0;i<n1;i++){
L[i]=a[l+i];
}
for(int i=0;i<n2;i++){
H[i]=a[l+n1+i];
}
int i=0,j=0,k... | true |
22f6724a82d308889b96c4c3907fc2e75f63f30d | C++ | madisoncooney/HPR_Titan | /NoFAT/Arduino Code/HPDF/HPDF.h | UTF-8 | 1,902 | 2.515625 | 3 | [
"MIT"
] | permissive | /*
Test.h - Test library for Wiring - description
Copyright (c) 2006 John Doe. All right reserved.
*/
// ensure this library description is only included once
#ifndef HPDF_h
#define HPDF_h
//Library includes
#include "Arduino.h"
//Define baseclock in millis
#define HPDF_BCLK 50
///
/// Data structure classes
... | true |
40730493cf97d22a92eafedbd50212fa7c54aea4 | C++ | fanofxiaofeng/cpp | /jobdu/1058/main.cpp | UTF-8 | 225 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
using namespace std;
char cs[5];
int main(){
while(scanf("%s", cs) > 0){
swap(cs[0], cs[3]);
swap(cs[1], cs[2]);
printf("%s\n", cs);
}
return 0;
}
| true |
5d5949b0a1e37681713b9b7afc6e3822f38f7aa7 | C++ | webturing/ACM-1 | /按 OJ 分类/51Nod/f-51Nod-1574-排列转换/f-51Nod-1574-排列转换/main.cpp | UTF-8 | 975 | 2.609375 | 3 | [] | no_license | //
// main.cpp
// f-51Nod-1574-排列转换
//
// Created by ZYJ on 2017/5/19.
// Copyright ? 2017年 ZYJ. All rights reserved.
//
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
const int MAXN = 2e5 + 10;
int A[MAXN];
int B[MAXN];
bool vis[MAXN];
int abs(int a)
{
return a < 0 ? -a... | true |
42e8014dc3547d078cfca887654f362e6aae0af9 | C++ | mapsiva/network-master | /t3/Httpd.cpp | UTF-8 | 2,763 | 2.578125 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/signal.h>
#include "Httpd.h"
#include "Util.h"
#include "FileManager.h"
#include "Mime.h"
#include "Thread.h"
#incl... | true |
b8d57010c9e6c47382f194af795ec761242f44f7 | C++ | ThomasMillard123/Mario | /MarioV1/MarioV1/GameScreenManager.cpp | UTF-8 | 1,206 | 2.75 | 3 | [] | no_license | #include "GameScreenManager.h"
#include"GameScreen.h"
#include"GameScreenLevel1.h"
#include"GameScreenLevel2.h"
GameScreenManager::GameScreenManager(SDL_Renderer* renderer, SCREENS startScreen) {
mRenderer = renderer;
mCurrentScreen= NULL;
ChangeScreen(startScreen);
}
void GameScreenManager::Render() {
mCurre... | true |
5b1539794d25e5ddd1504251408c8982b83a0603 | C++ | crasmu75/Dont-Byte-Me-Bro | /Server/spreadsheetSession/spreadsheetSession.h | UTF-8 | 1,752 | 2.84375 | 3 | [] | no_license | #include <string>
#include <vector>
#include <queue>
#include <map>
#include <stack>
#include "workItem.h"
#include "cell.h"
#include<vector>
#include "../DependencyGraph/DependencyGraph.h"
#include <mutex>
//This class creates a spreadsheet session. The session should
//be responsible for spinning all the new threads... | true |
596344f41f60fd52c5aed160c3593e3d168f4929 | C++ | SenKetZu/FinalLaboratorio2 | /Gameplay.cpp | UTF-8 | 4,166 | 2.609375 | 3 | [] | no_license | #include "Gameplay.h"
#include "Joystick.h"
#include "ElementoConTexto.h"
Gameplay::Gameplay() {
}
void Gameplay::pause()
{
sf::RectangleShape pauseBackground;
pauseBackground.setSize(Render::getInstance().getSize());
pauseBackground.setFillColor(sf::Color(50, 50, 50, 2));
_cancion.playMusic(fals... | true |