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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
119dbcffb079d4eb7d444945af79c46ba2b330e7 | C++ | herambchaudhari4121/Hacktoberfest-KIIT-2021 | /ROHIT KUMAR SINGH (Hacktober Contribution)/HackerRank/Intro_to_Tutorial_Challenges.cpp | UTF-8 | 373 | 2.75 | 3 | [
"MIT"
] | permissive | #include<bits/stdc++.h>
using namespace std;
int introTutorial(int V, vector<int> arr) {
int ind = (find(arr.begin(), arr.end(), V) - arr.begin());
return ind;
}
int main()
{
int V,n;
cin>>V;
cin>>n;
vector<int> arr(n);
for(int &it:arr) cin>>it;
int result = introTutoria... | true |
64aa4e218e88013715cf44c755eb3198b3a190ae | C++ | unwag001/CS14-SPRING2015 | /lab02/lab2.h | UTF-8 | 956 | 3.78125 | 4 | [] | no_license | template <class T> class List
{
private:
struct Node
{
T data;
Node* next;
}
Node* head;
public:
List(): data(0), next(NULL) {}
void push_front(T value);
void pop_front();
void display();
void elementSwap(int pos);
};
template <class T>
void List::push... | true |
2be2d5b944897ce5b509bd7b5832bb89714f8404 | C++ | w135110392/students_question | /students_question/飞机大战.cpp | GB18030 | 1,309 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <conio.h>
void mainfeiji()
{
int i, j;
int x = 5;
int y = 10;
char input;
int isFire = 0;
int ny = 5; // һӣڵһУny
int isKilled = 0;
while (1)
{
system("cls"); //
//
if (!isKilled) //
{
for (j = 0; j < ny; j++)
printf(" ");
printf("+\n")... | true |
9fea1720b21ad82fc7862c88f5f96d435497c8b2 | C++ | jiwoo-kimm/epoll-chat-server | /server.cpp | UTF-8 | 6,601 | 2.640625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/epoll.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define DEFAULT_PORT 10007 // default server port
#define MAX_EVENTS 1000 // events limit
#define MA... | true |
ee788ff0ea460272cb53bcdfd39ec29f1e842ce6 | C++ | BlackFox101/OOP | /lw2/Dictionary/Dictionary/Dictionary.cpp | WINDOWS-1251 | 3,531 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <map>
#include <vector>
#include <string>
#include <algorithm>
#include "Dictionary.h"
using namespace std;
bool OpenFile(fstream& file, string fileName)
{
file.open(fileName);
if (!file.is_open())
{
return false;
}
return true;
}
void Init... | true |
17959050a5934f04db017cc25453f42dac19cdc8 | C++ | sasaki-seiji/ProgrammingLanguageCPP4th | /part4/ch36/36-3-4-input-string/src/input_string.cpp | UTF-8 | 692 | 3.34375 | 3 | [] | no_license | /*
* input_string.cpp
*
* Created on: 2016/12/18
* Author: sasaki
*/
#include <string>
#include <vector>
#include <iostream>
using namespace std;
void successive_input()
{
cout << "-- successive_input() --\n";
cout << "enter first_name and second_name: " << flush;
string first_name;
string second_name... | true |
aa73e5d90c3044d7d84dd123bb615014c89db625 | C++ | toddnguyen-gf/embedded-training | /ece-18-642/lec-01-to-04/project02/p02_noid_student_turtle.cpp | UTF-8 | 6,821 | 2.75 | 3 | [] | no_license | /*
* Originally by Philip Koopman (koopman@cmu.edu)
* and Milda Zizyte (milda@cmu.edu)
*
* STUDENT NAME: Todd Nguyen
* ANDREW ID: noid
* LAST UPDATE: Sunday 2021-03-14 10:49
*
* This file is an algorithm to solve the ece642rtle maze
* using the left-hand rule. The code is intentionaly left obfuscated.
*
*/
... | true |
7dad3c5243c3a8543e01a94039e1b9121f666035 | C++ | askshaik/design_pattern | /CodeCOR.cpp | UTF-8 | 1,558 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
namespace cor {
class Handler {
protected:
Handler *next;
public:
Handler(Handler *n) : next(n){}
virtual void handle_request(string message) = 0;
virtual ~Handler() { delete next;}
};
class Spam_handler : public Handler {
public:
Spam_handler(H... | true |
76afb0f13f5646343d8604983a180c724041a69c | C++ | zhangyilin/leetcode | /leetcode/palindromeNumber.cpp | UTF-8 | 556 | 3.015625 | 3 | [] | no_license | class Solution {
public:
bool isPalindrome(int x) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
if (x<0){
return false;
}
int x_copy=x;
int y=0;
while (x){
in... | true |
af0adcbc7e2640580ec669af48b52687a6c0a707 | C++ | HanaYukii/Algorithm | /hw1/217-2.cpp | UTF-8 | 1,525 | 2.609375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define INF 1e14
int n,k;
struct P
{
long long x, y;
int pos;
} p[500005], t[500005];
bool cmpx(P i, P j) {return i.x < j.x;}
bool cmpy(P i, P j) {return i.y < j.y;}
priority_queue<long long> max_heap;
void DnC(int L, int R)
{
if (L >= R)
{
max_heap.p... | true |
2b94f9b2b36e7f9230d7cc3079c89561828580a6 | C++ | ParkSunW00/CppNote | /0612/0612/Circle.cpp | UHC | 425 | 3.53125 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Circle
{
public:
int radius;
Circle(); Circle(int r); ~Circle();
};
Circle::Circle()
{
radius = 10;
cout << "" << radius << " " << endl;
}
Circle::Circle(int r) {
radius = r;
cout << "" << radius << " " << endl;
}
Circle::~Circle() { cout << " " << radius << " Ҹ" <... | true |
785aae38889be0a6969a070fea3b973437e4f23b | C++ | mdamt/erpiko | /include/erpiko/oid.h | UTF-8 | 879 | 3.078125 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef _OBJECT_ID_H_
#define _OBJECT_ID_H_
#include <string>
#include <memory>
namespace Erpiko {
/**
* ASN1 Object ID
*/
class ObjectId {
public:
/**
* Creates a new ObjectId from a string
*/
ObjectId(const std::string fromString);
virtual ~ObjectId();
/**
* Gets string represe... | true |
0d81a53c9ad872c68abc052d062a5268c9578c33 | C++ | gui-works/luigui-OpenGL3.3-Plus | /examples/main.cpp | UTF-8 | 1,427 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <luigui.hpp>
#include <GLFW/glfw3.h>
constexpr int WIDTH = 640, HEIGHT = 480;
GLFWwindow *createWindow() {
GLFWwindow *window = NULL;
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPE... | true |
b435118a4c2233bbe3180b40ba639cbfd38503c4 | C++ | Ferror/particle-shaders | /ShaderBasics/Particle.h | UTF-8 | 720 | 2.671875 | 3 | [] | no_license | #pragma once
class Particle
{
private:
//***** TODO *****//
float age;
float deathTime;
float sPosX;
float sPosY;
float sPosZ;
float phaseX;
float phaseY;
public:
//***** TODO *****//
Particle() = delete;
Particle(float _deathTime, float _sPosX, float _sPosY, float _sPosZ, float _phaseX, flo... | true |
745339a4ed8c56ee14d0173092ee092225e9781f | C++ | SaisriramVaddadi/LeetCode | /25-Reverse Nodes in k-Group.cpp | UTF-8 | 1,472 | 3.171875 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* rev_helper(ListNode* hed,int k )
{
ListNode *pres,*next,*prev;
pres = hed->next;
next... | true |
6e0573e13f0f62f2ecf9e8b6a90f55d9e2a85ae0 | C++ | erossi/cpp_tips | /bind_functions.cpp | UTF-8 | 4,774 | 3.234375 | 3 | [] | no_license | /* Bind functions in C++, a working example.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is... | true |
1e617391ad8de9d2204c5cf907c0480009789f42 | C++ | nacl1415/Arduino | /watchDogTest.ino | UTF-8 | 1,664 | 2.578125 | 3 | [] | no_license |
#include <JeeLib.h>
#include "DHT.h"
#include <SoftwareSerial.h>
#define DHTPIN 2//D2 pin is DHT11's singal
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
SoftwareSerial mLoraPort(6, 7); // RX, TX
int mM0 = 4;
int mM1 = 5;
ISR(WDT_vect)
{
Sleepy::watchdogEvent();
}
int mCount = 0;
int mLedPin = 9;
String mSen... | true |
5355839c7896890800717df352125a16a1cdf0be | C++ | Tanzimul-Hasib/All-C-Programs-Algorithms | /power.cpp | UTF-8 | 318 | 3.15625 | 3 | [] | no_license | #include<stdio.h>
int main ()
{
int power=1, i , base, expo;
printf("Enter the number base: ");
scanf("%d", &base);
printf("Enter the power number : ");
scanf("%d", &expo);
for(i=1; i<=expo; i++)
{
power=power*base;
}
printf("%d\n", power);
return 0;
}
| true |
792170ba28e401b0f1429cdb7792735cb180bbd3 | C++ | velocic/opengl-tutorial-solutions | /17-ambient-lighting/src/renderwindow.cpp | UTF-8 | 1,280 | 2.65625 | 3 | [
"MIT"
] | permissive | #include <renderwindow.h>
RenderWindow::RenderWindow(unsigned int screenWidth, unsigned int screenHeight)
{
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribut... | true |
8ba72443f2e08ad10370273f01bffccfae081fe3 | C++ | jfellus/pg_learning | /src/Normalize.h | UTF-8 | 618 | 2.59375 | 3 | [] | no_license | /*
* Normalize.h
*
* Created on: 15 avr. 2015
* Author: jfellus
*/
#ifndef NORMALIZE_H_
#define NORMALIZE_H_
#include <pg.h>
#include <matrix.h>
class Normalize {
public:
Matrix* out;
OUTPUT(Matrix, *out);
public:
Normalize() {out = 0;}
void init() {}
void process(Matrix& m) {
for(uint i=m.h;i--... | true |
ea72675bedd4b647ceafbcfb09e3aedf1065f61f | C++ | sorcery-p5/Asteraiser | /ls/Collide/CollideTypes.h | SHIFT_JIS | 4,441 | 2.859375 | 3 | [
"BSD-3-Clause"
] | permissive | #pragma once
///////////////////////////////////////////////////////////////////////////////
//
// ֘A^`
//
///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
// 背C[
//-----------------------------------------... | true |
4e34217933b48bbc97293c6718cf813b96329680 | C++ | Mashiatmm/Offlines | /2-2/Data Structure and Algorithms Part 2/Offline 9/offline9.cpp | UTF-8 | 5,004 | 2.96875 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<sstream>
#include<queue>
#include<chrono>
#include<ctime>
#define INF 99999
using namespace std;
int startvertex;
int n;
int exact(int** tsp,int path[],int s,int f){
if(s==f){
int dis = tsp[startvertex][path[0]];
for(int i=0;i<n-1;i++){
//c... | true |
ef7895ebe954b85520cc78929502d883aa3f9e54 | C++ | pierug/programs | /cppCourse/pointers/main.cpp | UTF-8 | 240 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <memory>
using namespace std;
int main(int argc, char *argv[])
{
unique_ptr<int> uPtr1(new int(13));
shared_ptr<int> uPtr2(new int(14));
//uPtr1=uPtr2;
cout << *uPtr1 << endl;
return 0;
}
| true |
3e63b88eefb5e6df8c061d6fd8a03a291fbc6a5c | C++ | ruifshi/LeetCode | /LeetCode/KokoEatingBananas.cpp | UTF-8 | 859 | 3.59375 | 4 | [] | no_license | #include "stdafx.h"
#include "KokoEatingBananas.h"
#include <algorithm>
bool canEatAll(vector<int> &piles, int K, int H) {
int countHour = 0; // Hours take to eat all bananas at speed K.
for (int pile : piles) {
countHour += pile / K;
if (pile % K != 0)
countHour++;
}
return countHour <= H;
}
... | true |
67af122b3dc8c13ef8561fc81cdc5c06f9bab2df | C++ | BIT-zhaoyang/uva | /uva10048-AudioPhobia/src/uva10048-AudioPhobia.cpp | UTF-8 | 2,253 | 3.109375 | 3 | [] | no_license | //============================================================================
// Name : uva10048-AudioPhobia.cpp
//============================================================================
#include <iostream>
#include <vector>
#include <stack>
#include <cassert>
using namespace std;
struct Edge {
Edge(int... | true |
e26ee89a1b188002bf72f6f71873c259413b9b19 | C++ | PLUkraine/Battle-City-Qt | /entities/bullet.h | UTF-8 | 402 | 2.640625 | 3 | [
"MIT"
] | permissive | #ifndef BULLET_H
#define BULLET_H
#include"entities/entity.h"
#include"entities/tank.h"
class Bullet : public Entity
{
Q_OBJECT
public:
Bullet(Body*body, Renderer*renderer, Physics* physics, Entity* sender, int damage);
virtual ~Bullet();
void update();
Entity *sender() const;
int damage() ... | true |
155bce1a5acb0b845458b53652d489bde379a42b | C++ | seahorn/seahorn | /test/devirt/devirt_cha_04.false.cpp | UTF-8 | 1,076 | 2.703125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | /* Diamond inheritance */
// RUN: %sea pf -O0 --devirt-functions-with-cha --horn-use-mbqi "%s" 2>&1 | OutputCheck %s
// RUN: %sea pf -O3 --devirt-functions-with-cha --horn-use-mbqi "%s" 2>&1 | OutputCheck %s
// CHECK: ^sat$
#include "seahorn/seahorn.h"
extern void foo(int);
extern int nd_int();
class A {
public:... | true |
d248aa04c86c34235a0de1fef76f692ca830c616 | C++ | MuhammadAlaminMir/CPP | /9_Strings/4.Compare.cpp | UTF-8 | 510 | 4 | 4 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main()
{
// Compare two strings
string a, b;
a = "abc";
b = "def";
// if our output greater or less than zero its means a and b are not equal
// if we get 0 then its means a and b are equal.
cout << b.compare(a) << endl;
b =... | true |
9b51a4301b1f8970e209587d767f7c85355a555d | C++ | include-minimaltools/windows-c | /INCLUDE/Registro.H | UTF-8 | 64,580 | 2.5625 | 3 | [] | no_license | /*---- Registro Academico ---- created by Gabriel Ortiz ---- version A3.3g ---- tested by Luis Pineda and Engel Reyes*/
/*--------1----------------------- Library --------------------------------*/
#include "covpagbv.h"
/*--------M----------------------- Constant -------------------------------*/
#define cursor 1... | true |
05226aeab13c45b0dc45cc28c48e8e947f71a371 | C++ | Aniganesh/100daysofcode | /Mystery-1.cpp | UTF-8 | 601 | 2.671875 | 3 | [] | no_license | // https://www.hackerearth.com/practice/basic-programming/bit-manipulation/basics-of-bit-manipulation/practice-problems/algorithm/mystery-30/
// 13-06-2020 Very-easy/easy
#include<bits/stdc++.h>
#define MOD % 1000000007
typedef long long ll;
using namespace std;
ll countSetBits(ll& n){
ll count = 0;
while(n){... | true |
fc6bbf03d87cf785cc854df34fb6ffbd05ca280d | C++ | Xangis/magma | /editors/de310/source/misc/keywords.cpp | UTF-8 | 5,350 | 3.046875 | 3 | [] | no_license | //
// File: keywords.cpp originally part of dikuEdit
//
// Usage: functions used to handle keyword lists
//
// Copyright 1995-98 (C) Michael Glosenger
//
#include <string.h>
#include "../fh.h"
//
// createKeywordList : Taking keywordStrn as input, breaks the individual
// wor... | true |
39313532bd192a5dcc4f6dc64c781e022b8f8c2d | C++ | Forrest-Z/gcy_tmap | /src/Tmapping/include/tmapping/StructedMap.h | UTF-8 | 2,039 | 2.515625 | 3 | [
"MIT"
] | permissive | //
// Created by stumbo on 2019/11/17.
//
#ifndef TMAPPING_STRUCTEDMAP_H
#define TMAPPING_STRUCTEDMAP_H
#include <utility>
#include <vector>
#include "tools/TopoParams.h"
#include "tools/TopoVec2.h"
#include "expDataTypes/ExpDataTypes.h"
namespace tmap
{
struct MapNode : std::enable_shared_from_this<MapNode>
{
pu... | true |
86f8f02b1e850f71f7ad1ed77611fbc18588d717 | C++ | qwb2333/got7 | /src/lib/common/config.cpp | UTF-8 | 1,066 | 2.828125 | 3 | [] | no_license | #include "config.h"
using namespace qwb;
ConfigReaderPtr ConfigReaderFactory::createFromFile(const char *path) {
FILE *file = fopen(path, "r");
char buffer[4096];
ConfigReaderPtr ptr(new ConfigReader);
std::map<std::string, std::string> &kv = ptr->getKv();
while(fgets(buffer, sizeof(buffer), file... | true |
1882eac269200920c932f8b8cc8984b08f91b713 | C++ | MoonOrchid18/P31- | /testing.cpp | UTF-8 | 1,242 | 3.1875 | 3 | [] | no_license | // ??????????? ?????.cpp : Defines the entry point for the console application.
//
//#include "stdafx.h"
#include <iostream>
#include<iomanip>
#include<cstdlib>
using namespace std;
class SimpleClass
{
int *ptr; //pointer for someone memory area
public:
SimpleClass() // Construct
{
cout << "\nNormal constr\n... | true |
3745ecb85939d20b0e659f64963754725b8d97b7 | C++ | xwy27/CrackingTheCodingInterview | /Chapter 4 Trees and Graphs/cpp/4_3.cpp | UTF-8 | 1,006 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
using namespace std;
typedef struct treeNode {
int val;
treeNode* left;
treeNode* right;
}treeNode;
treeNode* addToTree(int* arr, int start, int end) {
if (end < start) return NULL;
int mid = (start + end ) / 2;
treeNode* temp = new treeNode;
temp-... | true |
a3dad962d46fb5d3ec2768862f59b4bc76860f1e | C++ | wada811/MeikaiClangNyumon | /Capter06/0605.cpp | SHIFT_JIS | 360 | 3.515625 | 4 | [] | no_license | /*
K6-5:xnovoid alert(int no)쐬B
*/
#include <stdio.h>
/*--- xno ---*/
void alert(int no){
while(no-- > 0){
putchar('\a');
}
}
int main(void){
int no;
printf("͂ĂF");
scanf("%d", &no);
alert(no);
return 0;
} | true |
f104729ef7d53d141d21f33bb3223c0cc60b06b5 | C++ | TimGoll/projektpraktikum | /controller/src/ownlibs/pca9555.cpp | UTF-8 | 2,261 | 3.015625 | 3 | [] | no_license | #include "pca9555.h"
Pca9555::Pca9555(uint8_t address) {
this->_address = address;
this->_valueRegister = 0b0000000000000000; //alle Pins auf LOW
this->_configurationRegister = 0b0000000000000000; //alle PINS als OUTPUT
Wire.begin();
}
Pca9555::~Pca9555() {
}
void Pca9555::beg... | true |
b69e08e5d3653c24e2c0f7b44b0023e6ab7bf9b2 | C++ | therealendrju/WorkshopContent | /examplecontent/ExampleAlgorithms/MergeClustersAlgorithm.cc | UTF-8 | 3,460 | 2.546875 | 3 | [] | no_license | /**
* @file WorkshopContent/examplecontent/ExampleAlgorithms/MergeClustersAlgorithm.cc
*
* @brief Implementation of the merge clusters algorithm class.
*
* $Log: $
*/
#include "Pandora/AlgorithmHeaders.h"
#include "examplecontent/ExampleAlgorithms/MergeClustersAlgorithm.h"
#include "examplecontent/Exam... | true |
74c334e2189a1c6dc1960fce41fe4f66f48746c8 | C++ | lyc2345/delicateiOS | /delicateiOS/include/com/tastenkunst/cpp/brf/nxt/utils/AllocUtils.hpp | UTF-8 | 1,115 | 2.921875 | 3 | [] | no_license | #ifndef __brf_AllocUtils__
#define __brf_AllocUtils__
#include <cstdlib>
#include "com/tastenkunst/cpp/brf/nxt/utils/StringUtils.hpp"
namespace brf {
/**
* Utility functions to alloc, free and align pointers.
* Borrowed from OpenCV memory alignment:
*
* Aligns pointer by the certain number of bytes.
*
... | true |
c3a2ce7815c540dffe2e2068cc45d817a468572b | C++ | GTSKA/LinearAlgebra | /LinearAlgebra/MatrixClass.hpp | UTF-8 | 16,159 | 3.328125 | 3 | [] | no_license | #ifndef _MATRIX_CLASS_H
#define _MATRIX_CLASS_H
#include <assert.h>
#include "VectorClass.hpp"
#include <iostream>
#include <vector>
template<typename T, size_t m, size_t n>
class Matrix
{
public:
T** mat;
Matrix()
{
mat = new T*[m];
for (size_t i = 0; i < m; ++i)
{
mat[i] = new T[n];
for (size_t j = 0; ... | true |
af60f48a20b220d7876911e533d890faaf390b4d | C++ | namnani/cplusplus | /pointer/InitialPointerVariable.cpp | UTF-8 | 186 | 2.890625 | 3 | [] | no_license | #include <iostream>
class Nani {
public:
std::string* namnani;
Nani() : namnani(NULL) { }
};
int main(void)
{
Nani nani;
std::cout << nani.namnani << std::endl;
return 0;
}
| true |
807ee86d958f4d3b3107ab23a864bb8b201c802e | C++ | Jason-Dominguez/Arena-Management-System- | /bankacc.cpp | UTF-8 | 5,586 | 3.34375 | 3 | [] | no_license | #include "bankacc.h"
double bank::getSales(){
return sales;
}
void bank::setSales(double inSales){
sales=inSales;
}
double bank::getCash(){
return cash;
}
void bank::setCash(double inCash){
cash = inCash;
}
double bank::getDebt(){
return debt;
}
void bank::setDebt(double inDebt... | true |
6c79c0126bb8e1807f3f16aeeb213d4fb0c9ccea | C++ | SebastianRobayo/Curso_de_Cpp | /Bloque1_Entrada,Salida_y_Expresiones/Ejercicio12.cpp | UTF-8 | 875 | 3.921875 | 4 | [] | no_license | //Ejercicio 12
/*Escriba un programa que lea de la entrada estandar los dos catetos de
un triangulo rectangunlo y escriba en la salida su hipotenusa*/
#include<iostream>
#include<math.h>//Esta libreria nos sirve para usar funciones matematicas, si se piensan usar hay que importarla.
using namespace std;
int main()
{
... | true |
e0168b0f09fce4d4894cb734d9dcd9195c9d7902 | C++ | wangqiangcc/samples | /udp_bench/src/server.cpp | UTF-8 | 5,169 | 2.90625 | 3 | [] | no_license | #include <cstdlib>
#include <iostream>
#include <string>
#include <functional>
#include <asio.hpp>
using asio::ip::udp;
enum PacketType
{
E_INFO = 1,
E_HEARTBEAT,
E_PACKET,
E_BAD_PACKET,
E_QUIT
};
class server
{
public:
server(asio::io_service& io_service, short port)
: io_service_(io... | true |
96705dc1798b81b07e2414ae75809d3ff3e47f5b | C++ | cs142ta/style-unit-test | /NonConstGlobalChecker.h | UTF-8 | 5,493 | 2.65625 | 3 | [
"MIT"
] | permissive | #ifndef NON_CONST_GLOBAL_CHECKER_H_
#define NON_CONST_GLOBAL_CHECKER_H_
#include <string>
#include <stack>
#include <algorithm>
#include "Token.h"
#ifdef DEBUG
#include <iostream>
#endif
struct GlobalsMachineData {
int firstBadLine;
int currLineNum;
std::string currWS;
int namespaceDepth;
int braceDepth;
... | true |
deda38f196db9eb4f5351bc9fc3efb57467bbaa3 | C++ | ashishc534/Codeforces | /Chat room.cpp | UTF-8 | 450 | 2.984375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
bool isHello(string s)
{
string word="hello";
int a=0;
int i, count = 0;
for(i=0; i<s.size(); i++){
if(s[i]==word[a]){
a++;
count++;
}
}
if(count==5)
return true;
else... | true |
47bfb3570176f38babed1d45890fedbd007c8d14 | C++ | briskware/randomstring | /main.cpp | UTF-8 | 3,327 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include <string>
#include "RandomString.h"
#define ASIZEOF(arr) sizeof(arr)/sizeof(*arr)
using namespace std;
int main()
{
// initialise a random vector of adjectives
const string arr[] = {
"awesome",
"cool",
"brilliant",
"incredibely smart",
"abso... | true |
e8bd34786089053480ab997ed0b250d3b3c28f43 | C++ | TheShip1948/ObserverPattern | /main.cpp | UTF-8 | 712 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include "observer.h"
int main() {
// Create Subject
WeatherData *wd = new WeatherData;
// Create Current Conditions Display
CurrentConditions *cd = new CurrentConditions;
// Create Statisitcs Display
StatisticsDisplay *sd = new StatisticsDisplay;
// Register observers
wd... | true |
1b2b18e179c51b1d541761991ab9e02881a12198 | C++ | BrayanMBeltre/CPP | /For Fun/logintry1.cpp | UTF-8 | 1,484 | 3.734375 | 4 | [] | no_license | #include <stdio.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace std;
void
registro ()
{
//Crear
fstream archivo ("registro.txt");
string nick, email, password;
int op, op2;
//menu
do
{
cout << "1.- Nuevo registro\n2.- Salir\nIntroduzca la opcion deseada: ";
... | true |
1dea434eb45d05bf066831e71a3150942705af6e | C++ | frustra/glomerate | /include/ecs/HandleImpl.hh | UTF-8 | 931 | 2.84375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #pragma once
#include "ecs/Handle.hh"
namespace ecs
{
template <typename CompType>
Handle<CompType>::Handle()
: eId(), compPool(nullptr)
{
}
template <typename CompType>
Handle<CompType>::Handle(Entity::Id entityId, ComponentPool<CompType> *componentPool)
: eId(entityId), compPool(componentPool)
{
}
t... | true |
82cef635b769a12c204c2ab4f5a7b576e84bf1c2 | C++ | ITCGamesProg2/jp21-iz-sh | /JointProject/include/Cell.h | UTF-8 | 1,995 | 3.03125 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <SFML/Graphics.hpp>
#include <queue>
class Cell
{
public:
Cell(int t_cellWidth, int t_cellHeight, int t_cellId = -1) : m_id(t_cellId)
{
m_isPassable = true;
findCentreXandCentreY(t_cellWidth, t_cellHeight);
m_cellShape.setSize(sf::Vector2f(t_cellWidth, t_cellHeight));
... | true |
01f92f6239b4a6cd9149ae5bcdb510464b4ba253 | C++ | Mehuu26/MES---Metoda-Elementow-Skonczonych | /MES_4.0/MES_4.0/Trzypunktowy_s_c.cpp | UTF-8 | 973 | 3.03125 | 3 | [] | no_license | #pragma once
#include "pch.h"
#include <fstream>
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
float funkcja(float x, float y) {
return -5 * (x*x)*y + 2 * x*y*y + 10;
}
float oblicz() { //trzypunktowy schemat calkowania
float pc[3] = { -0.77, 0, 0.77 };
//cout << "... | true |
5f67226bf9db3b1a1b7efd52e83aedbb32610f98 | C++ | kimduuukbae/Magic-Cat-Academy | /source/Physics.cpp | UTF-8 | 442 | 2.765625 | 3 | [] | no_license | #include "stdafx.h"
#include "Physics.h"
#include "Object.h"
bool Physics::isCollide(Object * lhs, Object * rhs){
auto [lx,ly,lz] = lhs->getPosition();
auto[lvx, lvy, lvz] = lhs->getVolume();
auto[rx, ry, rz] = rhs->getPosition();
auto[rvx, rvy, rvz] = rhs->getVolume();
if (lx - lvx / 2 < rx + rvx / 2 &&
lx +... | true |
fb6286d45721de745d1c2977b2f92cde36702c81 | C++ | ioneliabuzatu/fullyConnectedCpp | /include/fc.hpp | UTF-8 | 1,514 | 2.6875 | 3 | [] | no_license | #ifndef __FC__HPP_
#define __FC__HPP_
#include <iostream>
#include <vector>
#include "matrix.hpp"
#include "layer.hpp"
#include "utils/matrix_multiplication.hpp"
using namespace std;
class FC {
public:
FC(vector<int> architecture);
void set_input(vector<double> input);
void set_target(vector<double> tar... | true |
ee9c6abb9102ee398810b92e7aed7b08446f7606 | C++ | PhullFury/Random-CPP-Practice-Code | /FINISHED/class.cpp | UTF-8 | 1,001 | 3.765625 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
class User
{
std::string status = "Gold";
public:
std::string first_name;
std::string last_name;
std::string get_stauts()
{
return status;
}
};
int add_user_if_not_exists(std::vector<User> &users, User... | true |
29cdc947d65f25b90efa8cb52051700edb126781 | C++ | Logan-Ashford/CougSat1-Software | /CougSat1-IHU/src/subsystems/ADCS.cpp | UTF-8 | 363 | 2.515625 | 3 | [] | no_license | #include "ADCS.h"
/**
* @brief Construct a new ADCS::ADCS object
*
* @param i2c connected to the ADCS
*/
ADCS::ADCS(I2C & i2c) : i2c(i2c) {}
/**
* @brief Destroy the ADCS::ADCS object
*
*/
ADCS::~ADCS() {}
/**
* @brief Initialize the ADCS
*
* @return mbed_error_status_t
*/
mbed_error_status_t ADCS::initia... | true |
d73d1990b45bb8492b1e770f0a66a831274766f6 | C++ | semenovf/pfs | /tests/byte_string/test_operations.hpp | UTF-8 | 26,796 | 3.28125 | 3 | [] | no_license | #pragma once
void test_insert ()
{
std::cout << "///////////////////////////////////////////////////////////////////////////\n";
std::cout << "// Operations (insert) //\n";
std::cout << "//////////////////////////////////////////////////////////////////////... | true |
babb8170e1ada24c17ac4f8e3c0e21269e137c62 | C++ | osphea/zircon-rpi | /src/storage/fs_test/dot_dot.cc | UTF-8 | 4,977 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <dirent.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <un... | true |
9e92a8b0fc6e8263adfa7f442eee1e33ba2ecb62 | C++ | andrewhle/2sem | /test.cpp | UTF-8 | 2,269 | 3.3125 | 3 | [] | no_license | #include <iostream>
using namespace std;
struct stud
{
string name; // имя
int group; //номер группы
int grades[5]; //оценки
int stipend; //стипендия
stud *next;
};
struct group
{
stud *begin = NULL; //указатель на начало списка студентов группы
group* nextgr = NULL; //следующая группа
... | true |
f37a22b23d62fa86dc7b015c4605f5371fdddf79 | C++ | vvbetter/P1 | /CommonLib/ConfigManager.cpp | GB18030 | 2,024 | 2.59375 | 3 | [] | no_license | #include "stdafx.h"
#include "ConfigManager.h"
#include<iostream>
#include<boost/property_tree/ptree.hpp>
#include<boost/property_tree/json_parser.hpp>
#include<boost/filesystem.hpp>
using namespace boost::filesystem;
using namespace boost::property_tree;
ConfigManager* ConfigManager::GetInstance()
{
static ConfigMa... | true |
8ad97706bd78c790171a60989d22f608d3eea4a4 | C++ | khanhdk0000/car-rental | /CarRentalManagement.cpp | UTF-8 | 10,438 | 3.03125 | 3 | [] | no_license | #include "CarRentalManagement.h"
using namespace std;
CarRentalManagement::CarRentalManagement(Vehicle* &veh)
{
arrVeh.push_back(veh);
}
int CarRentalManagement::getnumCar()
{
return arrVeh.size();
}
void CarRentalManagement::addVehicle(string ID, string brand, int cost,int trunkCap)
{
Vehicle* pVeh = n... | true |
bf0727c668faf0b2ad27f12fbdd2791de6cb8b4d | C++ | linlinyeyu/C-C-Arithmetic | /循环链表.cpp | UTF-8 | 1,939 | 3.15625 | 3 | [
"MIT"
] | permissive | #include "stdio.h"
#include "stdlib.h"
typedef struct lnode
{
int data;
struct lnode *next;
}linklist;
typedef struct dlnode
{
int data;
struct dlnode *prior;
struct dlnode *next;
}dlinklist;
void createlist(linklist *&L,int a[],int n)
{
int i;
linklist *s;
L=(linklist ... | true |
035ad2ce1fe4a2c319aee39f9617b4f49295c4b2 | C++ | Hondy000/Reso | /Source/HarmonyFrameWork/Collision/CollisionObject/Public/CollisionPlanesObject.h | SHIFT_JIS | 2,603 | 2.59375 | 3 | [] | no_license | #pragma once
#include "BaseCollisionObject.h"
class CollisionPlanesObject
:
public BaseCollisionObject
{
public:
CollisionPlanesObject()
{
m_type = PLANE;
};
virtual ~CollisionPlanesObject()
{
m_planeInfoArray.clear();
};
// n`f[^̖ʂ̕
class PLANE_INFO
{
public:
PLANE_INFO()
{
}
virtual ~PLANE_IN... | true |
db93f9e41ffebcf37b406d1e6ce6c5e9628cc488 | C++ | hedvik/IMT3612-GPU | /shader/Tutorial Project/Vertex Input/Structs.h | UTF-8 | 4,243 | 2.703125 | 3 | [] | no_license | #pragma once
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <glm\glm.hpp>
#include <array>
#include <glm/gtx/hash.hpp>
#include "consts.h"
struct RenderableUBO {
glm::mat4 mvp;
glm::mat4 projectionMatrix;
glm::mat4 viewMatrix;
glm::mat4 modelMatrix;
};
struct RenderableMaterialUBO {
float specular... | true |
495b0cc7beed3e6850ebed82230453cbc0e0fe63 | C++ | GhostofGoes/evo-comp | /3/population.cpp | UTF-8 | 7,089 | 3.484375 | 3 | [
"MIT"
] | permissive | // Project: Assignment 3 - Evolution Strategies
// Author: Christopher Goes
// Description: Function definitions for the Population class as defined in population.h
#include <iomanip>
#include "population.h"
#include "points.h"
// Constructor ** ASSUMES initRand() HAS BEEN CALLED! **
Population::Population( int ... | true |
78ed0fad8c3eb7cf95f5df4241a12a39dca546b5 | C++ | Graphics-Physics-Libraries/OpenGL-flight-simulator-1 | /GraphicsProject/GObject.cpp | UTF-8 | 2,109 | 2.5625 | 3 | [
"MIT"
] | permissive | #include "GObject.h"
#include "ResourceManager.h"
GObject::GObject()
{
Parent = nullptr;
UpdateObject = true;
ResourceManager::AddGameObject(this);
}
GObject::GObject(GObject* Parent)
{
this->Parent = Parent;
UpdateObject = true;
ResourceManager::AddGameObject(this);
}
void GObject::SetParent(GObject* Parent... | true |
f393eab13972ca9d1ea55aaeb627a04b261a9cd8 | C++ | kgifaldi/ThreadedWebCrawler | /temp.cpp | UTF-8 | 5,268 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <curl/curl.h>
#include <sstream>
#include <queue>
#include <pthread.h>
using namespace std;
// when the size of this queue is greater than 0
// the number of parse threads specified will be going
deque<string> toParse;
deque<string> fi... | true |
fa5a845d3384bea47c4d9e49ea66f33b183b877b | C++ | CaterTsai/C_Square | /src/draw/DAudioMesh.cpp | UTF-8 | 2,247 | 2.65625 | 3 | [] | no_license | #include "DAudioMesh.h"
//-------------------------------------
void DAudioMesh::update(float delta)
{
CHECK_START();
}
//-------------------------------------
void DAudioMesh::draw(int x, int y, int w, int h)
{
CHECK_START();
float size = w * 0.005;
ofVec3f temp;
ofPushStyle();
ofSetLineWidth(2);
ofSetColor... | true |
2f941ec8c5d39909c1e51b9f5c83015549e028b3 | C++ | Plaristote/crails | /modules/mongodb/crails/mongodb/exception.hpp | UTF-8 | 437 | 2.5625 | 3 | [] | no_license | #ifndef CRAILS_MONGODB_EXCEPTION_HPP
# define CRAILS_MONGODB_EXCEPTION_HPP
# include <crails/utils/backtrace.hpp>
# include <string>
namespace MongoDB
{
class Exception : public boost_ext::exception
{
public:
Exception(const std::string& message) : message(message)
{
}
const char* what(voi... | true |
5a6f425b3f9b5d59b08e6a3fbc1ac132cc81a53d | C++ | infyloop/uva-solns | /Arranged/587. There's treasure everywhere/treasure1.cpp | UTF-8 | 1,093 | 2.875 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
char s[300],d[3]="";
int i,l,n=0,t=0,c=0;
float x,y,temp;
while(1)
{
scanf("%s",s);
if(strcmp(s,"END")==0) break;
x=y=0;c++;
l=strlen(s)-1;
for(i=0;i<=l;i++)
{
if(s[i]>='0' && s[i]<... | true |
2e5edb485cc9298ace96cabfc44d8ba2e24c3e29 | C++ | Manav-Aggarwal/competitive-programming | /CodeJam/Google CodeJam 2015/Standing Ovation.cpp | UTF-8 | 817 | 2.515625 | 3 | [] | no_license | /* Written By Manav Aggarwal */
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
int main()
{
ios_base::sync_with_stdio(false); cin.tie(0);
freopen("A-small-attempt0.in", "r", stdin);
freopen("Standing-Ovation-Output.out", "w", stdout);
ll t, cases;
cin >> t;
cases... | true |
14bcd6ffece8e8827434506e4f5d1db832eb50eb | C++ | lagoproject/easy | /src/interp.cc | UTF-8 | 2,467 | 3.015625 | 3 | [
"BSD-3-Clause"
] | permissive | /* 3D interpolation code */
/* la idea es trabajar con álgebra vectorial, extendiendo lo que se hace en 2D a un vector de dimension n */
#include <vector>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
// co... | true |
a7b34578648fed77d72af770afe89b92fec4d76a | C++ | chromium/chromium | /components/feed/core/v2/public/stream_type_unittest.cc | UTF-8 | 2,891 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/feed/core/v2/public/stream_type.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace feed {
class StreamTypeTest : public testing::Test {
public... | true |
e52500cc2d3b5e52737261ca6089c92d898a583f | C++ | Aodai/c1 | /main.cpp | UTF-8 | 205 | 2.578125 | 3 | [] | no_license | #include <stdio.h>
int main(int argc, char** argv) {
if(argc < 2 || argc > 2) {
printf("Usage: greetings [name]\n");
return 0;
}
printf("Hello %s\n", argv[1]);
return 0;
}
| true |
e6fb3800e8007719b687f4c2c8a5f6c40308a606 | C++ | UnnamedOrange/Contests | /Source Code/李沿橙 2017-7-19/source/李沿橙/match Indirect + BIT.cpp | GB18030 | 2,073 | 2.8125 | 3 | [] | no_license | //Indirect sort + BIT
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
using std::cin;
using std::cout;
using std::endl;... | true |
0456a7a281969d81e51223c04005a76dd72adf4c | C++ | leafyoung88/Virtual-Engine | /virtual_engine_origin/Common/vector.h | UTF-8 | 8,234 | 3.109375 | 3 | [] | no_license | #pragma once
#include <stdint.h>
#include <stdlib.h>
#include <memory>
#include <initializer_list>
#include <type_traits>
#include "ArrayList.h"
#include "Memory.h"
namespace vengine
{
template <typename T>
class vector
{
public:
struct ValueType
{
T value;
};
private:
T* arr;
uint64_t mSize;
uint6... | true |
7615c65dadcd4e97e94fa5885ce1eda250a3aea0 | C++ | seader025/CplusPlus-Examples | /Class Examples/Dog.cpp | UTF-8 | 1,110 | 3.328125 | 3 | [] | no_license | // ClassPractice4.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<iostream>
#include<string>
#include<conio.h>
using namespace std;
class Dog
{
private:
string name;
string breed;
int age;
const static double fee;
public:
void setDogName(string);
vo... | true |
826a2dd3ea4863d70b31f0679b84910439be81a5 | C++ | Archibald-300/The-second-semester | /2_week/Problem_4.cpp | UTF-8 | 533 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
int prime ( int num)
{
int count = 1, act_num = 2;
bool is_simple = false;
while (count < num) {
act_num += 1;
is_simple = true;
for (int i = 2; i * i < act_num + 1; i++) {
if (act_num % i == 0) {
... | true |
d21baab953f421ad87999d1098e9996fa5375aa0 | C++ | aceduce/leetcode-practice | /leetcode/p543.cpp | UTF-8 | 502 | 2.734375 | 3 | [] | no_license | #include"Solutions.h"
// a true thinking process very much similar to p124
int p543::helper(TreeNode * r, int &ans) {
if (!r) return 0;
int diam_l = helper(r->left, ans);
int diam_r = helper(r->right, ans);
if (r->left) diam_l++;
if (r->right) diam_r++;
ans = max(ans, diam_l + diam_r); // diam_r/l >= 0;
int re... | true |
fd44dd3c027cd1c26286ad5c5f63c7319bd741d0 | C++ | kaist-jisungpark/ImageRegistration | /app/imagefusion.hpp | UTF-8 | 1,947 | 2.921875 | 3 | [
"MIT"
] | permissive | #ifndef IMAGEFUSION_HPP
#define IMAGEFUSION_HPP
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "../core/domain/fusion_services.hpp"
#include "../interfaces/image_repository.hpp"
#include "../infastructure/file_repository.hpp"
class imagefusion
... | true |
e044695b7bbf0a8e780cac6db988bd23f27002fa | C++ | zsims/af | /bslib/src/bslib/blob/Address.cpp | UTF-8 | 2,148 | 3.078125 | 3 | [] | no_license | #include "bslib/blob/Address.hpp"
#include <boost/uuid/sha1.hpp>
#include <sstream>
#include <iomanip>
#include <algorithm>
namespace af {
namespace bslib {
namespace blob {
Address::Address(const void* rawBuffer, int bufferLength)
{
if (bufferLength != static_cast<int>(_address.max_size()))
{
throw InvalidAddr... | true |
e4522ea6c37c73ccd0acfd78bc65f5e61043e1e4 | C++ | paalkristian/sb_mpc | /obstacle.cpp | UTF-8 | 1,517 | 2.65625 | 3 | [] | no_license | /*
* obstacle.cpp
*
* Created on: Dec 22, 2016
* Author: ingerbha
*/
#include "obstacle.h"
obstacle::obstacle(const Eigen::Matrix<double,9,1>& state, double T, double dt)
: n_samp_(T/dt)
{
T_ = T;
dt_ = dt;
x_.resize(n_samp_);
y_.resize(n_samp_);
u_.resize(n_samp_);
v_.resize(n_samp_);
A_ = state... | true |
5bbbf483390604f072b24f47ce0e2a73e91d378c | C++ | Suleiman99Hesham/OOP-Course | /Assignment_1/code/VendingMachine.cpp | UTF-8 | 4,469 | 3.078125 | 3 | [] | no_license | #include "VendingMachine.h"
#include "MoneyDrawer.h"
#include "FoodItem.h"
#include <iostream>
using namespace std;
class FoodItem;
class MoneyDrawer;
MoneyDrawer adding;
FoodItem listing;
VendingMachine::VendingMachine()
{
temp_twenty=0;
temp_ten=0;
temp_five=0;
temp_one=0;
temp_half=0;
temp_qu... | true |
8661454386629537f5995e33e521102e7aa805a0 | C++ | ziixu/Pro1 | /p5/x50141/x40141.cc | UTF-8 | 291 | 3.09375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int engreixa (int n) {
if (n < 10) return n;
else {
int e = engreixa(n/10);
int m = max(e%10, n%10);
return e*10 + m;
}
}
int main () {
int n;
cin >> n;
cout << engreixa(n) << endl;
} | true |
dc187903af89bf3a9103f151a0440aa6d360822a | C++ | landrew2/friendly-octo-waffle | /trace/Object.hpp | UTF-8 | 830 | 3.015625 | 3 | [] | no_license | // virtual class for any object
#ifndef OBJECT_HPP
#define OBJECT_HPP
// other classes we use DIRECTLY in our interface
#include "Appearance.hpp"
#include "Intersection.hpp"
#include "Vec3.hpp"
// classes we only use by pointer or reference
class World;
class Ray;
class Object {
protected: // data visible to childre... | true |
e2fa1f8d4f22209f8d1cf0e40f4e751cfdb02086 | C++ | echiou/caps-loc | /ex-2-rotary/ex-2-rotary.ino | UTF-8 | 4,722 | 2.796875 | 3 | [] | no_license | #include <Wire.h>
#include <Adafruit_NeoPixel.h>
#include <math.h>
#include "Adafruit_MPR121.h"
// Put n = number of capacitors here, n > 1.
#define NUMCAPS 3
// This code assumes that you are using a dielectric the same size of the capacitors,
// Put m = number of neopixels here.
#define NUMNEOPIXELS 16
#define NEOP... | true |
e83b34370bd482634e64a46275ff5253be1235b9 | C++ | f516106199/flowchar | /include/token.hpp | UTF-8 | 2,499 | 2.90625 | 3 | [] | no_license | #pragma once
#ifndef _TOKEN_HPP_
#define _TOKEN_Hpp_
#include<string>
#include<utility>
#include<set>
namespace fc{
namespace ft{
class token{
public:
enum class Kind:int{
BEGIN,
STM,
LBRACE,
RBRACE,
IF,... | true |
b9721ee9fa4c7d42269c363a167242355dba635d | C++ | guigaoliveira/qtsupervisory | /QtTcpClientConsumer/plotter.cpp | UTF-8 | 2,722 | 3.1875 | 3 | [] | no_license | #include <QPainter>
#include <QBrush>
#include <QPen>
#include <QColor>
#include <cmath>
#include "plotter.h"
#define MAX_ITEMS 30.0
/**
* @brief Plotter::Plotter
* @param parent
*/
Plotter::Plotter(QWidget *parent) : QWidget(parent)
{
times = new vector<float>();
values = new vector<float>();
}
/**
* @b... | true |
b5a254de3c1ba11334707c6bcc51339b4f45a066 | C++ | meduag/Projetos-Arduino-Proteus-Simulation | /inos/PWM.ino | UTF-8 | 292 | 2.65625 | 3 | [] | no_license | const int PWM_Pin = 3;
void setup() {
// put your setup code here, to run once:
pinMode(PWM_Pin, OUTPUT);
analogWriteFrequency(PWM_Pin, 750000); // Teensy 3.0 pin 3 also changes to 375 kHz
}
void loop() {
// put your main code here, to run repeatedly:
analogWrite(PWM_Pin, 4);
}
| true |
94e57ef28d8e17c0c61915afaadf82b9afbf11dc | C++ | simdjson/simdjson | /include/simdjson/generic/ondemand/json_iterator.h | UTF-8 | 12,030 | 2.546875 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"MIT",
"BSL-1.0"
] | permissive | #ifndef SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H
#ifndef SIMDJSON_CONDITIONAL_INCLUDE
#define SIMDJSON_GENERIC_ONDEMAND_JSON_ITERATOR_H
#include "simdjson/generic/ondemand/base.h"
#include "simdjson/generic/implementation_simdjson_result_base.h"
#include "simdjson/generic/ondemand/token_iterator.h"
#endif // SIMDJSON... | true |
a815dca79eadaebf2adcafdb5c67fefc555d143b | C++ | drlongle/leetcode | /algorithms/problem_1230/solution.cpp | UTF-8 | 1,830 | 3.40625 | 3 | [] | no_license | /*
1230. Toss Strange Coins
Medium
You have some coins. The i-th coin has a probability prob[i] of facing heads when tossed.
Return the probability that the number of coins facing heads equals target if you toss every coin exactly once.
Example 1:
Input: prob = [0.4], target = 1
Output: 0.40000
Example 2:
Input: p... | true |
189daa53b1936185c114c3650b32a40d0717687a | C++ | Remi-Coulom/joedb | /test/Readonly_File_Connection_Test.cpp | UTF-8 | 2,841 | 2.703125 | 3 | [
"MIT"
] | permissive | #include "joedb/concurrency/Readonly_File_Connection.h"
#include "joedb/concurrency/Interpreted_Client.h"
#include "joedb/journal/Test_File.h"
#include "gtest/gtest.h"
namespace joedb
{
////////////////////////////////////////////////////////////////////////////
TEST(Readonly_Connection, pull)
////////////////////... | true |
009a2771af1b5e5d890c2ba847ece58d2d9f382d | C++ | zxx43/Tiny3D | /Win32Project1/node/staticNode.cpp | UTF-8 | 2,222 | 2.515625 | 3 | [] | no_license | #include "staticNode.h"
#include "../render/staticDrawcall.h"
#include "../render/terrainDrawcall.h"
#include "../render/waterDrawcall.h"
#include "../util/util.h"
#include "../scene/scene.h"
StaticNode::StaticNode(const vec3& position):Node(position, vec3(0, 0, 0)) {
batch = NULL;
dynamicBatch = true;
fullStatic =... | true |
9cc50e1845f92e777f3d0173c796e8e56ca77e8b | C++ | Lujie1996/Leetcode | /42. Trapping Rain Water/42. Trapping Rain Water/main.cpp | UTF-8 | 1,228 | 3.234375 | 3 | [] | no_license | //
// main.cpp
// 42. Trapping Rain Water
//
// Created by Jie Lu on 2018/4/3.
// Copyright © 2018 Jie Lu. All rights reserved.
//
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int trap(vector<int>& height) {
if (height.size() <= 2) {
return 0;
}
int i, maxHei... | true |
2e71bbe7739e75b0886f66c4dd2157684217e147 | C++ | hyunbingil/OpenCV_lecture | /week4/we04_ex01.cpp | UHC | 840 | 3.09375 | 3 | [] | no_license | #include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
// Scalar Ŭ? ϳ ȼ Ÿ Ŭ̴.
// Scalar 4 .(rgb )
int functionn() {
Scalar_<uchar> red(0, 0, 255);
Scalar_<int> blue(255, 0, 0);
Scalar_<double> color1(500);
Scalar_<float> color2(100.f, 200.f, 125.9f);
Vec3d green(0, 0, 300.5);
Scalar green... | true |
663a58095186b7640f9ce964f4e2e6f84bcf8dea | C++ | morikoh/io_library | /inputDevice/lib_photoReflector/lib_photoReflector.ino | UTF-8 | 346 | 2.515625 | 3 | [] | no_license | /*
インプットライブラリ_フォトリフレクタ
フォトリフレクタからのアナログ入力値をシリアルモニタに表示する
*/
void setup() {
Serial.begin(9600); // シリアル通信速度
}
void loop() {
float photoReflectorValue = analogRead(A0);
Serial.println(photoReflectorValue);
}
| true |
dd09f0d00d05f1e1ed0ee15adf30774483a65689 | C++ | Bolodya1997/Proxy | /cache/cache.cpp | UTF-8 | 1,755 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include "cache.h"
#include "../logging.h"
using namespace std;
using namespace chrono;
cache_entry *cache::get_entry(string &absolute_url) {
auto it = entry_map.find(absolute_url);
if (it == entry_map.end())
return NULL;
if (!it->second->is_valid()) {
remove_entry(it)... | true |
2dfa9e6f3aa4e4b3b5145d7d9b44afb86fcbf114 | C++ | mtreviso/university | /Programming Languages/C e C++/Avancado/Aula5/codigos/ex1.cpp | UTF-8 | 6,128 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <typeinfo>
using namespace std;
/////////////////////////////////////
// EMPREGADO
/////////////////////////////////////
class Empregado{
private:
static unsigned int id;
string nome, email, celular;
float salario;
int departamento;
public:
Empregado(){
this->id++;
};
... | true |
8e66d7c70b3502932242a1d0e716ac7c9fab236c | C++ | rdffg/bcaa_importer | /model/propertyclassvaluetype.cpp | UTF-8 | 1,721 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | #include "propertyclassvaluetype.h"
#include "saveerror.h"
#include <QMetaEnum>
#include "QDjangoQuerySet.h"
using namespace model;
PropertyClassValueType::PropertyClassValueType(QObject *parent) : QDjangoModel(parent)
{
}
PropertyClassValueType::ValueType PropertyClassValueType::type() const
{
return m_type;
}
... | true |
0ec01ecc8f995730cd386ef30ebc03956f9b3be0 | C++ | DanielSlavov/FMI-OOP-HW-TaskManager | /BusinessTask.cpp | UTF-8 | 2,855 | 3.59375 | 4 | [] | no_license | #include"BusinessTask.h"
Time BusinessTask::Duration()
{
return Time(this->End().Hour() - this->Start().Hour(), this->End().Min() - this->Start().Min(), this->End().Sec() - this->Start().Sec());
}
void BusinessTask::AddPerson(char * firstName, char * lastName)
{
people.push_back( Person(firstName, lastName));
}
B... | true |