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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1f743427eac4f889aaa6659b62249e5b88a413fe | C++ | Kim-dongeon/Algorithm | /Study/백준/2667_동언.cpp | UTF-8 | 1,187 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
int N;
int arr[27][27];
bool isVisited[27][27];
vector<int> apart;
int dx[] = { 0,0,-1,1 };
int dy[] = { 1,-1,0,0 };
int main()
{
scanf("%d", &N);
for (int i = 0; i < N; i++)
{
for (int j = 0; j < N; j++)
{
scan... | true |
6361c6a8ab52c18650d0d1012175d14a1f0cc9c9 | C++ | Haut-Stone/ACM | /INBOX/独木舟问题(贪心).cpp | UTF-8 | 3,096 | 3.5625 | 4 | [] | no_license | /*
n个人,已知每个人体重,独木舟承重固定,每只独木舟最多坐两个人,可以坐一个人或者两个人。显然要求总重量不超过独木舟承重,假设每个人体重也不超过独木舟承重,问最少需要几只独木舟?
分析:
一个显然的策略是按照人的体重排序。
极端化贪心策略,最重的人要上船——如果最重的人和最轻的人体重总和不超过船的承重,则他们两个占用一条船。否则(因为假设最重的人的体重也不超过船的承重了),最重的人单独占一条船。转变为(n – 1)或者(n – 2)的问题了。
关键在于这种贪心策略是正确的。我们可以证明,最优解也可以变为这种策略。
(1) 假设最重的人和最轻的人的体重和超过了船的承重,那么最优解中,显然也是最重的人单独占一条船... | true |
19d644dc2cfd77d8dd45bd25d40e62a3df676c94 | C++ | HuuPhuc25/abstract_demo_cpp | /date_field.cpp | UTF-8 | 1,780 | 2.84375 | 3 | [] | no_license | #include "date_field.h"
DateField::DateField()
{
}
DateField::~DateField()
{
}
DateField::DateField(int _index)
{
this->index = _index;
this->setDefaultData();
}
DateField::DateField(int _index,tm _data)
{
index = _index;
mData = _data;
}
int DateField::getIndex()
{
return this->index;
}
void ... | true |
ec9573988644fc33c63eec1c169edc52e2bf44a1 | C++ | ibnumaulana215/program-perulangan-While-dan-Do-While | /main.cpp | UTF-8 | 312 | 3.03125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int a=1;
while(a<10)
{
cout<<a<<endl;
a++;
}
cout<<endl<<"---------------------------------------"<<endl;
int b=0;
do
{
cout<<b<<endl;
b++;
}
while(b<10);
}
| true |
839e66393680f1090189826e61fb5b86bd8b4c3f | C++ | chemesh/Elections_v2 | /DistrictsList.cpp | UTF-8 | 2,548 | 2.875 | 3 | [] | no_license | #include "DistrictsList.h"
namespace elc
{
bool DistrictsList::setSize(const int& _size)
{
District** temp = new District*[_size];
for (int i = 0; i < size; i++)
temp[i] = list[i];
this->size = _size;
//delete[] list;
list = temp;
return true;
}
bool DistrictsList::setLength(const int& len)
{
t... | true |
fdcb14392bf363b53bb96a59684f998b4fc53bf4 | C++ | Tsaanstu/new_project_2 | /Game/tests/src/test_object.cpp | UTF-8 | 4,092 | 2.859375 | 3 | [] | no_license | #include "catch.hpp"
#include "mistborn.hpp"
#include "misting.hpp"
#include "soldier.hpp"
#include "metal.hpp"
TEST_CASE("mistborn, constructor with initialisation", "[mistborn]") {
SECTION("without argument") {
Mistborn mistborn(100, 10, 9, 8, 7, 600, String("test_mistborn_1"), String("test_mistborn_1"));
REQ... | true |
e65b9e233a2feecbac1e023865770ab666baa6d7 | C++ | gcaushik/Cplusplus-School-Projects | /College Course Map/graph.cpp | UTF-8 | 8,578 | 3.828125 | 4 | [] | no_license | //Gokul Caushik
#include "graph.h"
#include <iostream>
using namespace std;
#include <cstring>
/*The constructor allocates the memory for the vertices and initializes
all their head pointers to NULL.*/
graph::graph()
{
numofvertices = 0; //Keeps track of the number of vertices in the graph
degree = new vertex... | true |
75dc73ed29712a515c8c72faf6c5ba61d99823da | C++ | sheeyen/FE2assignment- | /Q3straddle.cpp | UTF-8 | 2,223 | 2.890625 | 3 | [] | no_license | //FE2 ASSIGNMENT STRADDLE
#include <iostream>
#include <math.h>
#include <conio.h>
#include <iomanip>
#include <fstream>
#define PI 3.14159265358979323846
using namespace std;
double N (double);
double M (double);
void main ()
{
float time, K, d1, d2, nd1, nd2, n1d1, delta, vega, theta;
float S... | true |
425a114009ebdfdef3d96d5d1f322189685c1099 | C++ | gabrielpastori/Competitive-Programming | /OBI/2013/soma_de_fracoes.cpp | UTF-8 | 527 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
long long int mdc(long long int a,long long int b){
return (b==0 ? a:mdc(b,a%b));
}
int main(){
long long int a,b,c,d;
cin>>a>>b>>c>>d;
long long int mmc=b*d/mdc(max(b,d),min(b,d));
long long int n=(mmc... | true |
85853f750742153cc6f0417a5160a2052bfb010b | C++ | Arryboom/LeagueAPI | /include/lol/def/LolChampSelectLegacyChampSelectChatRoomDetails.hpp | UTF-8 | 719 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | #pragma once
#include "../base_def.hpp"
namespace lol {
struct LolChampSelectLegacyChampSelectChatRoomDetails {
std::string chatRoomName;
std::optional<std::string> chatRoomPassword;
};
inline void to_json(json& j, const LolChampSelectLegacyChampSelectChatRoomDetails& v) {
j["chatRoomName"] = v.cha... | true |
ea7f7ecc0618634c94060cc0adb7d645639403c3 | C++ | JustinLiu1998/ECNU-Online-Judge | /34/main.cpp | UTF-8 | 811 | 2.71875 | 3 | [] | no_license | //
// main.cpp
// 34
//
// Created by 刘靖迪 on 2018/1/7.
// Copyright © 2018年 刘靖迪. All rights reserved.
//
#include <iostream> //有错
#include <cstring>
char *Filter(char *s, char *x) {
int len = (int)strlen(x);
for (int i=0; i<strlen(s) - len; i++) {
int flag = 1;
... | true |
d4e605f7d3a2baab48fbd60b3dd3ee9abcec59dc | C++ | ccdxc/logSurvey | /data/crawl/git/hunk_285.cpp | UTF-8 | 1,040 | 3.234375 | 3 | [] | no_license | }
/*
- * Convert a partial SHA1 hex string to the corresponding partial SHA1 value.
- * - hex - Partial SHA1 segment in ASCII hex format
- * - hex_len - Length of above segment. Must be multiple of 2 between 0 and 40
- * - oid - Partial SHA1 value is written here
- * Return 0 on success or -1 on error (i... | true |
24db26dc73d71ce1f54f552b6755d2dabaad2967 | C++ | chiibu21/cppGameProject | /game.cpp | UTF-8 | 16,199 | 3.34375 | 3 | [] | no_license | //============================================================================
// Name : game.cpp
// Author : Chiibu Abdul-Kudus
//============================================================================
// PLEASE COMPILE AND RUN THIS FROM A WINDOWS COMMAND PROMPT OR CODEBLOCKS. I USED FUNCTIONS RESER... | true |
cfab1f4c36da24e748f5191002106243873c6211 | C++ | binkesi/leetcode_easy | /cpp/n530_BSTMinus.cpp | UTF-8 | 960 | 3.40625 | 3 | [] | no_license | // https://leetcode-cn.com/problems/minimum-absolute-difference-in-bst/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
}... | true |
41feef098169a6cd5407208e898847e974a5d2e1 | C++ | ddorobek/3307-Final-Project-Video-Game | /Final Project/Final/GameOver.cpp | UTF-8 | 3,983 | 3.625 | 4 | [] | no_license | /** @class GameOver
* @brief The GameOver class creates a screen for when the player fails to complete the game.
* @author
*
* The GameOver class creates a window of the screen when the player fails to complete the game (player dies). The screen informs the player that they have lost and gives them the option to ex... | true |
45dcbe108d47a8b37284f518b2206e29bbea8254 | C++ | BurningS0ul/QT-Projects | /Praktikum2A4/main.cpp | UTF-8 | 593 | 3.109375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
float Zinsen, Schuld = 10000, Ann, Til, Rate = 0.07;
cout << "Tilgungsplan" << endl;
cout << "Bitte geben Sie die gewuenschte Annuitaet ein: ";
cin >> Ann;
for (int i = 0; i < Schuld; i++) {
Zinsen = Schuld * Rate;
Til = Ann ... | true |
c7fe2417f1c96f969b02dcc6ce2435ade179c7d3 | C++ | pratiksaha/practice | /geometric/minCostPolynomialTriangulation.cpp | UTF-8 | 1,381 | 3.78125 | 4 | [] | no_license | //A DP based sol to find min cost of convex polygon triangulation
#include<iostream>
#include<cmath>
#include<cfloat>
#include<algorithm>
using namespace std;
struct point{
int x, y;
};
typedef struct point Point;
double dist(Point p1, Point p2) {
return sqrt( (p1.x-p2.x)*(p1.x-p2.x) + (p1.y-p2.y)*(p1.y-p2.y... | true |
ab46d488f85731f5cc93c63054ce2d4ae3c70736 | C++ | mastereuclid/cs494project | /src/responses.cpp | UTF-8 | 1,936 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | #include "responses.hpp"
#include <sstream>
// using namespace irc::response;
const string err_NOSUCHNICK(const string arg) {
return string("401 ") + arg + string(" :No such nick/channel");
}
const string err_NOSUCHCHANNEL(const string arg) {
return string("403 ") + arg + string(" :No such nick/channel");
}
const ... | true |
0dc862920a209b9e167eea2c2a92e9578b52d43e | C++ | YellowFish085/NightmareBeforeChristmas | /GLImac-Template/projet/src/Vertex.cpp | UTF-8 | 994 | 3.0625 | 3 | [] | no_license | #include "projet/Vertex.hpp"
namespace Projet
{
Vertex::Vertex() :
_position(glm::vec3(0)),
_texCoords(glm::vec2(0)),
_normal(glm::vec3(0)){
}
Vertex::Vertex(glm::vec3 position, glm::vec2 textcoord, glm::vec3 normal) :
_position(position),
_texCoords(textcoord),
_normal(normal){
}
... | true |
1cda4b0dc08196fd16df2557edd48ffe31115ea8 | C++ | jigar23/Entropycoding | /EntropyCoding/src/Ahuffman/TreeManipulations.cpp | UTF-8 | 4,518 | 3.703125 | 4 | [] | no_license | #include "TreeManipulations.h"
//Global values define
std::vector<Tree*> treeElements;
std::vector<Tree*> leafNodes;
/**
* This function gives birth to two new nodes
* when a new symbol occurs.
* the left child --> NYT node and
* the right right --> new Symbol
* @param:
* 1. int value - value of the symbol
*/
... | true |
c475a83dcbc4a0f2c78795519446727c84385e7a | C++ | shikharbhatia/Algorithm-and-DataStructures | /AllTopologicalSorts.cpp | UTF-8 | 1,300 | 2.921875 | 3 | [] | no_license | #include <bits/stdc++.h>
#define V 6
using namespace std;
vector<list<int> >adj(V);
vector<int>indegree(V, 0);
void addEdge(int u, int v){
adj[u].push_back(v);
indegree[v]++;
}
void alltopologicalutil(vector<bool>visited, vector<int>&res){
bool flag = 0;
for(int i = 0; i < V; i++){
... | true |
9a5a652f28b680bab7243846b51ac00105eb4c20 | C++ | netikras/studies | /Strukt.Progr/_1/N.D./nd_uzd/7.uzd.cpp | UTF-8 | 382 | 2.703125 | 3 | [] | no_license | #include <cstdlib>
#include <stdio.h>
#include <time.h>
/*
7. Funkcijos, kuri generuoja atsitiktinius skaičius, pagalba aprašyti žaidimo kauliuką, kuris po metimo išveda skaičių iš intervalo 1...6.
*/
using namespace std;
int randGen();
int main(){
printf("Iškrito:\t%i",randGen());
return 0;
}
int randGen... | true |
fed8cc8a75fc7018fa4be170969cc88626136ba1 | C++ | ccluo33/LeetCode | /src/array/56.合并区间.cpp | UTF-8 | 782 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
/*
* @lc app=leetcode.cn id=56 lang=cpp
*
* [56] 合并区间
*/
// @lc code=start
class Solution {
private:
static bool cmp(vector<int>& a, vector<int>& b) {
return a[0] < b[0];
}
public:
vector<vector<int>> merge(vector<vector<int>>& interval... | true |
e567c2a01dd077bf411743cc0151420d03e620d9 | C++ | cpbonnell/winlockr | /src/CryptUnprotectData.cpp | UTF-8 | 2,286 | 2.84375 | 3 | [] | no_license | #include <Rcpp.h>
#include <stdio.h>
// Some fixes to make the code play nicely with Windows.h ...
#undef Realloc
#undef Free
// Windows specific includes...
//#pragma comment(lib, "crypt32.lib")
#include <windows.h>
#include <wincrypt.h>
using namespace Rcpp;
//' A wrapper for the Windows DPAPI function CryptU... | true |
5fab5ff740d4de4715db4d000d1d8e56381a2042 | C++ | yuyilei/LeetCode | /conTest/180-week/1379_Design-a-Stack-With-Increment-Operation.cpp | UTF-8 | 3,440 | 4.3125 | 4 | [] | no_license | /*
Design a stack which supports the following operations.
Implement the CustomStack class:
CustomStack(int maxSize) Initializes the object with maxSize which is the maximum number of elements in the stack or do nothing if the stack reached the maxSize.
void push(int x) Adds x to the top of the stack if the stack has... | true |
19e1b08f9f98aabc9dac08ffd55a84f10799cf4b | C++ | kylemarino22/droneProject | /Testing/encoderTesting/MotorController/MotorController.cpp | UTF-8 | 997 | 3.109375 | 3 | [] | no_license |
#include "MotorController.h"
MotorController::MotorController() {}
void MotorController::setup(int id, int motorPin){
this->id = id;
motor.attach(motorPin);
char rx_byte;
Serial.println("Initialize Motors?");
while(1) {
//waiting for serial response
if (Serial.available() > 0)... | true |
6cdb2f18da1117395da0dbd6b34b70fcd62449fa | C++ | eugenyvolosenkov/compgraph | /КГ Турлапов/global illumination/PPM/src/ray.hxx | WINDOWS-1251 | 1,009 | 2.90625 | 3 | [
"MIT"
] | permissive | #ifndef __RAY_HXX__
#define __RAY_HXX__
#include <vector>
#include <cmath>
#include "math.hxx"
//////////////////////////////////////////////////////////////////////////
// Ray casting
struct Ray
{
Ray()
{}
Ray(const Vec3f& aOrg,
const Vec3f& aDir,
float aTMin
) :
org(aOrg),
... | true |
5e579e99ec6450830e7ce0f49bc3cf1e80b3c95a | C++ | bloomberg/bde | /groups/bal/balber/balber_berutil.h | UTF-8 | 299,915 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | // balber_berutil.h -*-C++-*-
#ifndef INCLUDED_BALBER_BERUTIL
#define INCLUDED_BALBER_BERUTIL
#include <bsls_ident.h>
BSLS_IDENT("$Id: $")
//@PURPOSE: Provide functions to encode and decode simple types in BER format.
//
//@CLASSES:
// balber::BerUtil: namespace of ... | true |
322f4f05c4fabf965dd743f72940ea8d99f06003 | C++ | athena255/CacheCash | /src/DuplexPipe.h | UTF-8 | 2,889 | 2.71875 | 3 | [] | no_license | //
// Created by sage on 1/22/21.
//
#ifndef CACHECASH_DUPLEXPIPE_H
#define CACHECASH_DUPLEXPIPE_H
#include <poll.h>
#include <cstdarg>
class DuplexPipe
{
public:
static constexpr int READ = 0;
static constexpr int WRITE = 1;
static constexpr size_t BUF_SIZE = MAX_RX_BUF;
DuplexPipe(char const *cmd, ... | true |
30f4af09752baed7c78c8eccd966e85252b300f2 | C++ | sri-soham/mapnik-utf8grid-tester | /json_object.hpp | UTF-8 | 1,281 | 2.890625 | 3 | [] | no_license | #ifndef JSON_OBJECT_HPP
#define JSON_OBJECT_HPP
#include <typeinfo>
#include <boost/variant.hpp>
#include <mapnik/value.hpp>
#include <mapnik/unicode.hpp>
class JsonObject;
class JsonArray;
typedef boost::variant<mapnik::value, std::string, JsonObject, JsonArray> json_type;
class JsonObject {
private:
s... | true |
865c5e43f524fe79cf55cc4c46f079c27ad1809e | C++ | Anmol2307/Hackerrank | /101Aug14/Pangrams.cpp | UTF-8 | 812 | 2.671875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
inline void inp(int &n ) {//fast input function
n=0;
int ch=getchar(),sign=1;
while( ch < '0' || ch > '9' ){if(ch=='-')sign=-1; ch=getchar();}
while( ch >= '0' && ch <= '9' )
n=(n<<3)+(n<<1)+ ch-'0', ch=getchar();
n=n*sign;
}
int main () {
... | true |
6403316750ebee032f3c1a572c84ae446b97edc0 | C++ | sayandodo1234/compe_codes | /tries/maximum_xor_subarray.cpp | UTF-8 | 2,022 | 3.421875 | 3 | [] | no_license | // Maximum XOR Subarray
// Send Feedback
// Given an array of n integers, find subarray whose xor is maximum.
// Input Format
// First line contains single integer n (1<=n<=1000000).
// Next line contains n space separated integers.
// Output Format
// Print xor of the subarray whose xor of all elements in subarray is ... | true |
565d09286ded5b8d10cd08ad641c410a0ad0ccef | C++ | arni30/marathon-cpp | /sprint04/t03/app/main.cpp | UTF-8 | 912 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "src/dwemerCalculator.h"
int main(){
dwemerCalculator calc;
std::string input_str;
std::smatch match;
std::regex regex("^[[:blank:]]*([\\+\\-]{0,1}[a-zA-Z0-9]+)[[:blank:]]*([\\+\\-\\*\\/]{1})[[:blank:]]*([\\+\\-]{0,1}[a-zA-Z0-9]+)[[:blank:]]*$");
std::regex regex_var("^[[:blank:]]*([\\+\... | true |
93ca9956139f2d55770004593254b7ed7a8bef47 | C++ | AbraaoLincoln/LP1 | /lista_aquecimento/problem5.cpp | UTF-8 | 474 | 4.25 | 4 | [] | no_license | #include <iostream>
int fat1 (int n);//iterative version.
int fat2 (int n);//recursive version.
int main(void)
{
int n{0};
std::cout << "Type a interage number: " << std::endl;
std::cin >> n;
std::cout << fat2(n) << std::endl;
return 0;
}
int fat1 (int n)
{
int fat{n};
for(int i{n - 1}; i > 0; i--)
{
... | true |
1ea89ff61134769ff82d4a8dc64deb7c1cbbc6c0 | C++ | CLDP/USACO-Contest | /2011-2012 Season/2012 February/Gold/coupons.cpp | UTF-8 | 1,233 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
using namespace std;
struct coupons {
long long p, c;
};
bool compare(const coupons &a, const coupons &b) {
if (a.c != b.c) return a.c < b.c;
return a.p < b.p;
}
int main() {
freopen("coupons.in", "r", stdin);
freopen("co... | true |
51b3198d3907c58d524b30887574007882b000e7 | C++ | rafidmahin20/CG-summer | /Lake view city/main.cpp | UTF-8 | 103,450 | 2.546875 | 3 | [] | no_license | #include<windows.h>
#include<mmsystem.h>
#include <GL/glut.h>
#include <stdlib.h>
#include <math.h>
#include <fstream>
#include<iostream>
#define PI 3.1416
//#include<MMSystem.h>
using namespace std;
void introscreen();
static float tx= 0.0, cloudleftx=0,cloudmiddlex=0,cloudrightx=0,cloudrightupx=0;
stati... | true |
24efe9bfdccf1c3cbce42ca6cc89f0b46c1e7903 | C++ | Delaunay/hydrafs | /src/bencode.h | UTF-8 | 1,678 | 2.90625 | 3 | [] | no_license | #ifndef HYDRAFS_BENCODE_HEADER
#define HYDRAFS_BENCODE_HEADER
// simple bencode parsing
// https://en.wikipedia.org/wiki/Bencode
#include <ostream>
#include <string>
#include <vector>
namespace hydrafs{
namespace bencode{
struct Value{
Value() = default;
Value(std::string bytes):
_string(std::move... | true |
f60e8250b0407afb4feb6f0a0ea9f6afad36867a | C++ | SeisSol/Device | /interfaces/sycl/DeviceCircularQueueBuffer.cpp | UTF-8 | 2,017 | 2.984375 | 3 | [
"BSD-3-Clause"
] | permissive | #include "DeviceCircularQueueBuffer.h"
#include "utils/logger.h"
namespace device {
DeviceCircularQueueBuffer::DeviceCircularQueueBuffer(
cl::sycl::device dev,
std::function<void(cl::sycl::exception_list)> handler,
size_t capacity)
: queues{std::vector<cl::sycl::queue>(capacity)} {
if (capacity <= 0... | true |
d1d9110894ca568603a473564208d8aee9b42c0f | C++ | saturneric/LR1Generator | /src/SyntaxParser.cpp | GB18030 | 6,339 | 2.859375 | 3 | [] | no_license | //
// Created by Administrator on 2021/4/30.
//
#include "SyntaxParser.h"
void SyntaxParser::parse() {
status_stack.push(0);
now_line = 1;
size_t _line_index = 0, max_line_index = lines_index[now_line - 1];
while (!tokens_queue.empty()) {
auto *p_step = atg->findActionStep(status_stack.top()... | true |
96cf6be3e34b0bbd10fc88d1d23350f5068d7223 | C++ | chikashimiyama/Interface-Entwicklung_ZHDK_2014 | /Klasse5/sketches/no_interrupt_improved/no_interrupt_improved.ino | UTF-8 | 499 | 2.578125 | 3 | [] | no_license | int switchPin = 2;
int speakerPin = 13;
int switchState = 0;
int interval = 1000;
void setup()
{
pinMode(speakerPin, OUTPUT);
digitalWrite(switchPin , HIGH); // pull up
}
void loop()
{
if(digitalRead(switchPin) == 0){
if(switchState == 0 ){
interval = 1000000 / random(220, 440) / 2;
switchState ... | true |
2323205f05a348f84c0e84217ea7c0e9a80d03fc | C++ | 42yeah/rc | /server/Client.h | UTF-8 | 1,226 | 2.65625 | 3 | [] | no_license | #pragma once
#include <WinSock2.h>
#include <iostream>
#include <vector>
#include <optional>
#define CLIENT_TOKEN_LEN 8
#define ACCESS_CODE "access_code"
class Clients;
class Client {
public:
Client(Clients& clients, sockaddr_in sin);
~Client();
unsigned int get_id() const;
bool authenticate(std::string in_... | true |
492ec31df2ccf00c116579a1b832bc3ed15d01e3 | C++ | ldt9/ECE0302_ICEs_and_Projects | /Projects/Project5/Project5/Starter Code/state.hpp | UTF-8 | 499 | 2.84375 | 3 | [] | no_license | #ifndef STATE_HPP
#define STATE_HPP
// generic state holding a value of type T
template <typename T>
class State {
public:
State(const T &p, std::size_t cost, std::size_t heur);
T getValue() const;
// copy assignment
State& operator=(const State& rhs);
void updatePathCost(std::size_t cost);
std::si... | true |
c2bbb63aaa67c820fa52743950352c9a322dc409 | C++ | atrin-hojjat/CompetetiveProgramingCodes | /sorts.cpp | UTF-8 | 5,415 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <random>
#include <time.h>
#include <algorithm>
#include <chrono>
using namespace std;
using namespace chrono;
// #define ARR_SIZE 1e10
const int ARR_SIZE = 2e5;
// const int ARR_SIZE = 10;
void min_max(int i,int j,double*arr,double*min,double*max);
void min_max_pos(int i,int j,double*ar... | true |
da38440f142bc233cb1a7c30ff8539921eab7210 | C++ | dittoo8/algorithm_cpp | /BOJ/14442.cpp | UTF-8 | 1,126 | 2.640625 | 3 | [] | no_license | #include <cstdio>
#include <queue>
using namespace std;
struct map {
int x, y, w;
};
int n,m,k, dist[1001][1001][11]; // dist (x좌표, y좌표, 벽 부순 횟수);
char a[1001][1001];
const int dx[] = {-1,0,1,0}, dy[]={0,1,0,-1};
int bfs(){
queue<map> q;
q.push({0,0,0});
dist[0][0][0]= 1;
while(!q.empty()){
... | true |
7c4f98eefef0ee3b98f4165775c0409d9d64b1e7 | C++ | bashell/leetcode | /70_ClimbingStairs.cpp | UTF-8 | 461 | 3.40625 | 3 | [] | no_license | class Solution {
public:
// 设爬n层梯子有f(n)种方法,则f(n) = f(n-1) + f(n-2).
// Note: f(n-1)再爬1 step即可,f(n-2)再爬2 steps即可.
// Fibonacci: f(1) = f(2) = 1
int climbStairs(int n) {
if(n <= 2) // i = 0, 1
return n;
int a = 1, b = 1, c;
for(int i = 2; i <= n; ++i) { // i = 2, 3, ... | true |
1a65c0d6b80a687793b981a760438d7b1f38a8b6 | C++ | root-jeong/BOJ | /~9999/2718_타일 채우기.cpp | UTF-8 | 2,083 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
int dp[501][16];
int N;
int fun(int n, int nowState) {
if (n == 0) {
return 1;
}
if (dp[n][nowState] != -1) return dp[n][nowState];
int ret = 0;
if (nowState == 0) {
ret += fun(n-1, 0);
ret += fun(n-1, 5... | true |
69177e44afd2a59a856f0e588be165b669f02382 | C++ | walkccc/LeetCode | /solutions/0410. Split Array Largest Sum/0410-3.cpp | UTF-8 | 675 | 3.234375 | 3 | [
"MIT"
] | permissive | class Solution {
public:
int splitArray(vector<int>& nums, int m) {
int l = *max_element(nums.begin(), nums.end());
int r = accumulate(nums.begin(), nums.end(), 0) + 1;
while (l < r) {
const int mid = (l + r) / 2;
if (numGroups(nums, mid) > m)
l = mid + 1;
else
r = mid;... | true |
1f10f8bd39cd86ff7d34c631836dee610526d686 | C++ | pppoe/robot-photographer | /src/rp_locomotion/include/locomotion.hpp | UTF-8 | 4,255 | 2.765625 | 3 | [] | no_license | /**
* @class RPLocomotionNode
*
* @brief Robot photographer's locomotion node, which converts driving direction messages
* and bumper press events into linear/angular velocity messages.
*
* @copyright Manfredas Zabarauskas, 2013. All rights reserved. This project is released under
* ... | true |
cc0362cd4cffef64c227755a89730ebd8ebae0fa | C++ | meiring13/Project2_CS2413 | /project2.cpp | UTF-8 | 9,586 | 3.484375 | 3 | [] | no_license | /*
* project2.cpp
*
* Created on: Feb 18, 2020
* Author: Ike Meiring
*/
#include <iostream>
using namespace std;
//exceptions go here
double round(double var)
{
double value = (int)(var * 100.0);
return (double)value / 100.0;
}
template <class DT>
class Point; //class prototype
template <clas... | true |
8da6651c12a4dc75fee7a0a8a980f901f88cf70e | C++ | 1337hunter/cpp_modules | /module07/ex02/main.cpp | UTF-8 | 2,108 | 3.0625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | true |
e9b6d431ae590da89480fdd5e7a823fa4c61b19f | C++ | Andreskammerath/Competitive_Programming | /Spoj/l_digit.cpp | UTF-8 | 706 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int last_dig(int num)
{
return (num % 10);
}
int pot1(int a, int b)
{
if(b == 0) return 1;
if(a == 0) return 0;
int res = 1;
int b1 = b;
while(b1 > 0)
{
if(b1 % 2 == 1){
res *= a;
b1 -= 1;
}
a *= a;
a =
res = last_dig(res);
... | true |
ab4b5911807a27547c81a2a1d941b83d20c12f07 | C++ | scgyong/cpp2018 | /cp_bricks/cp_bricks/GameScene.cpp | UTF-8 | 1,158 | 2.84375 | 3 | [
"MIT"
] | permissive | //#include <SFML/Graphics.hpp>
#include "GameScene.h"
#include "main.h"
#define PADDLE_Y_OFFSET 50.0
using namespace sf;
GameScene::GameScene(RenderWindow &window) :
Scene(window),
ball(WINDOW_WIDTH / 2, WINDOW_HEIGHT / 2),
paddle(WINDOW_WIDTH / 2, WINDOW_HEIGHT - PADDLE_Y_OFFSET)
{
for (int y = 0; ... | true |
b6e7125492eafd72c2595e0e5c2e6b9b2e350c53 | C++ | Omlala97/ChamberCrawler3000 | /character.h | UTF-8 | 875 | 3.125 | 3 | [] | no_license | #ifndef CHARACTER_H
#define CHARACTER_H
#include <iostream>
#include <vector>
using namespace std;
class Character {
protected:
vector<int> charPos;
int cur_HP;
int max_HP;
int cur_atk;
int max_atk;
int cur_def;
int max_def;
string Name;
char ... | true |
079372b496e4e88c5d0584996dbb7c4ea2022292 | C++ | ChillMagic/PrivateLibrary | /include/memory.h | UTF-8 | 3,617 | 2.953125 | 3 | [
"MIT"
] | permissive | // memory.h
// * PrivateLibrary
#pragma once
#ifndef _PRILIB_MEMORY_H_
#define _PRILIB_MEMORY_H_
#include "macro.h"
#include <utility>
#include <cstdint>
#include <cstdlib>
#include <cstring>
PRILIB_BEGIN
#if _ITERATOR_DEBUG_LEVEL != 0
PRILIB_END
#include <iterator>
PRILIB_BEGIN
template <typename T>
class pointer_it... | true |
610bfeefd70def514e3dfcd169d4701973c71ff1 | C++ | f4goh/WSPR | /src/ds18s20_read/ds18s20_read.ino | UTF-8 | 2,113 | 2.75 | 3 | [] | no_license | /* read ds18s20 sensor
Anthony LE CREN F4GOH@orange.fr
Created 26/7/2020
send dds outpout to zero to prevent conduction in the bs170
*/
#include <SPI.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define SENSOR 7 //ds18s20 sensor
#define LED 8
#define W_CLK 13
#define FQ_UD 10
#define RESET 9 // or 1... | true |
aacbe5309e3e7ab8f8a52a77e924e39ecf21a403 | C++ | zhichao281/study_test | /QWhiteBoard/HCanvas/DrawWidget.cpp | GB18030 | 7,184 | 2.5625 | 3 | [] | no_license | #include "DrawWidget.h"
#include <QPainter>
CDrawWidget::CDrawWidget(QWidget *parent)
: QWidget(parent)
{
setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
this->setAttribute(Qt::WA_TranslucentBackground, true);
setWindowOpacity(1);
this->setMouseTracking(true);
_Init();
}
CDrawWidget::~C... | true |
4b879632a887bf8070e31e00a8ec0c8ba25aefee | C++ | electrosy/sdl2-blocks | /Sprite.cpp | UTF-8 | 1,366 | 2.5625 | 3 | [] | no_license | /*
sdl2-blocks
Copyright (C) 2020 Steven Philley
Purpose: see header.
Date: Feb/14/2020
*/
#include "Sprite.h"
ley::Sprite::Sprite()
:
Renderable() {
}
ley::Sprite::Sprite(SDL_Texture * t, unsigned int s, std::vector<SDL_Rect> v)
:
Renderable(),
animSpeed(s),
texture(t) {
if (!texture) {
return;//... | true |
dd08712bf6c6b800d00243fa547aa1859f958309 | C++ | bingxinfeng/Fascinating-Face | /FascinatingFace/FascinatingFace.ino | UTF-8 | 1,065 | 2.953125 | 3 | [] | no_license | /*
Physical Computing Project : Fascinating Face ;-)
Author: Bingxin Feng
To do:
1. Use light dependent resistor to sense the facial expression changing.
2. Put the serial data into Processing.
3. Use a rotatory pot to switch the output of two different light dependent resistors data.
*/
//ldr1 for wink mode, ldr2 ... | true |
53fccdb1fba888a281428b48ca04439f71a72c74 | C++ | kobake/KppLibs | /MathLib/src/range.h | SHIFT_JIS | 3,918 | 3.265625 | 3 | [] | no_license | #pragma once
#ifdef min
#undef min
#undef max
#endif
template <class T> T adjust(T t, T min_value, T max_value)
{
if(t<min_value)return min_value;
if(t>max_value)return max_value;
return t;
}
template <class T> class range{ //###ASSERT_POLICY=DEFAULT_ASSERT,EXIT_ASSERT,EXCEPTION_ASSERT,NO_ASSERT
public:
class ... | true |
07ef1675b63a4572b085c2eb968a7c6f28f8a25f | C++ | zxc123qwe456asd789/library | /modint/barrett-reduction.hpp | UTF-8 | 906 | 2.84375 | 3 | [
"CC0-1.0"
] | permissive | #pragma once
#include <utility>
using namespace std;
struct Barrett {
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
u32 m;
u64 im;
Barrett() : m(), im() {}
Barrett(int n) : m(n), im(u64(-1) / m + 1) {}
constexpr inline i64 quo(u64 n) {
u64 x = u64((__uint128_t(n)... | true |
df79cb606654eb502ec07628f509ccd015d8532c | C++ | AndreJesusBrito/OpenGL-Tetris | /src/matrix.h | UTF-8 | 1,354 | 3.171875 | 3 | [
"MIT"
] | permissive | #ifndef MATRIX_H
#define MATRIX_H
// #include <array>
#include <stdexcept>
#include <iostream>
namespace mycontainers {
// Aggregate class for a matrix of T objects
template<class T, std::size_t width, std::size_t height>
class Matrix {
public:
// Support height = 0 and width = 0
T m_... | true |
883aa4e041c4ca9f261c969699968244e9004048 | C++ | rubenvereecken/challenges | /Elements of Programming Interviews/8-StacksQueues/MaxStackNode.h | UTF-8 | 519 | 2.75 | 3 | [] | no_license | /*!
* \file
* \brief MaxStackNode.h
*
* \date Aug 14, 2013
* \author Ruben Vereecken
*/
#ifndef MAXSTACKNODE_H_
#define MAXSTACKNODE_H_
#include <memory>
template <typename T>
class MaxStackNode;
//typedef MaxStackNode MSNode;
template <typename T>
using MSNodePtr = std::shared_ptr<MaxStackNode<T> >;
te... | true |
d2a25fc3a6c2fb033480d0f1e3cd38f491f03db2 | C++ | bugsb/CPP | /shuffle-Leet.cpp | UTF-8 | 813 | 3.328125 | 3 | [] | no_license | /* Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn].
Return the array in the form [x1,y1,x2,y2,...,xn,yn]. */
class Solution {
public:
vector<int> shuffle(vector<int>& nums, int n) {
// vector<int> soln(2*n,0);
// for(int i{0},j{0}; i<n*2 && ... | true |
6ca36f84914f018c10d3a2d7279b7a6015355444 | C++ | F2i/dsa | /assignment2/Cache.h | UTF-8 | 1,660 | 3.140625 | 3 | [] | no_license | #ifndef CACHE_H
#define CACHE_H
#include "main.h"
class Node {
public:
int key;
Node *left;
Node *right;
int height;
Elem* cont;
~Node(){delete cont;}
};
class AVL
{
public:
Node * root;
AVL(){
this->root = NULL;
}
~AVL(){
this->emptyTree(this->root);
... | true |
30769fd20f43851dc8283b6dbfb6eb3926d5e1d3 | C++ | green-fox-academy/Arubechama | /W03D05/Power.cpp | UTF-8 | 434 | 3.828125 | 4 | [] | no_license | #include <iostream>
int powerN(int base, int n);
int main()
{
int base, n;
std::cout << "Enter the base value:" << std::endl;
std::cin >> base;
std::cout << "Enter the power value:" << std::endl;
std::cin >> n;
std::cout << "Your number is " << powerN(base, n) << "." << std::endl;
}
int powerN(i... | true |
ed731f3d04646c0d168071d5a0f54372e540ab8b | C++ | nanfang-wuyu/proj19-process-memory-tracker | /src/memoryFile/allocation_info.cpp | UTF-8 | 898 | 2.9375 | 3 | [
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-mulanpsl-2.0-en",
"MIT"
] | permissive | // reference https://www.codeproject.com/articles/393957/cplusplus-memory-leak-finder
#include "allocation_info.hpp"
allocation_info::allocation_info(void* address, size_t size, char** stacktrace, size_t depth, pthread_t thread_id)
{
this->address = reinterpret_cast<allocation_info::address_type>(address);
th... | true |
e83bb2236a8aa7d0ad16729ac25f35a2e7bdc433 | C++ | mebbaid/scs-eigen | /src/ScsEigen/include/ScsEigen/Math.h | UTF-8 | 805 | 2.84375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /**
* @file Math.h
* @author Giulio Romualdi
* @copyright Released under the terms of the MIT License.
* @date 2021
*/
#ifndef SCS_EIGEN_LINEAR_MATH_H
#define SCS_EIGEN_LINEAR_MATH_H
#include <utility>
#include <Eigen/Dense>
/**
* ScsEigen namespace.
*/
namespace ScsEigen
{
/**
* @brief Compute the Cholesk... | true |
fbd3b475d1743ffa85ccee18676a2c00e6838edf | C++ | NitefullWind/gamesByQt | /snake/controller.cpp | UTF-8 | 6,275 | 3 | 3 | [] | no_license | #include "controller.h"
#include "constants.h"
Controller::Controller(QGraphicsScene &scene, QObject *parent):
QObject(parent),
scene(scene),
food(new Food(0,0)),
gameIsOver(false),
gameIsPause(false)
{
drawWall();
drawSnake();
drawFood();
info = new InfoWidget();
scene.addItem... | true |
fba419eaaa70bf392a7e81d65ee5809c33d0c270 | C++ | EtiTheSpirit/LovePotion | /source/objects/thread/wrap_thread.cpp | UTF-8 | 2,023 | 2.625 | 3 | [
"MIT"
] | permissive | #include "common/runtime.h"
#include "modules/mod_thread.h"
#include "objects/thread/thread.h"
#define CLASS_TYPE LUAOBJ_TYPE_THREAD
#define CLASS_NAME "Thread"
int threadNew(lua_State * L)
{
const char * arg = luaL_checkstring(L, 1);
void * raw_self = luaobj_newudata(L, sizeof(LuaThread));
luaobj_setc... | true |
0b36cf440e702c395fa7d0c9633f478081084979 | C++ | vtienhieu/GCH0715-Cloud-VuTienHieu | /ASM/include/program.h | UTF-8 | 454 | 2.546875 | 3 | [] | no_license | #ifndef __PROGRAM__H__
#define __PROGRAM__H__
#include "Document.h"
#include <iostream>
#include <vector>
#include <string>
using namespace std;
// define option constant
#define ADD_DOCUMENT 1
#define DISPLAY 2
#define EXIT 0
class Program
{
private:
vector<Document *> Doc;
public:
void print_menu();
in... | true |
77f8fccf383d49ce1171bab83ee73565fcf77aa9 | C++ | 8emi95/elte-ik-cpp | /cpp_schaum/msvec_170619/msvecmain.cpp | UTF-8 | 4,111 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <iterator>
#include <numeric>
#include <algorithm>
#include "msetvec.h"
#include <vector>
#include <string>
#include "msetvec.h"
struct string_size_less
{
bool operator()( const std::string& a,
const std::string& b ) const
{
return a.size() < b.size();
}
};
... | true |
1f66c729c2f55bdeeb09b77cfd62a913a7b393e9 | C++ | ZhouXing-19/nailit_cpp | /3/refer.cpp | WINDOWS-1252 | 362 | 3 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int x = 100;
int y = x; //ֵ
cout<<"x=" <<x<<" y="<<y<<endl;
y+=100;
cout<<"x=" <<x<<" y="<<y<<endl; //x,yͬ
int &refx = x ;
cout<<"x=" <<x<<" refx="<<refx<<endl;
x*=10;
cout<<"x=" <<x<<" efx="<<refx<<endl;
refx+=50;
cout<<"x=" <<x<<" refx="<<refx<<e... | true |
ffbcd299936c73c4f1ad4033afb6311b8eba9a88 | C++ | mephi82/ssufarm | /DFRobot_PH_EC2/DFRobot_PH_EC2.ino | UTF-8 | 4,607 | 2.65625 | 3 | [] | no_license |
#include "DFRobot_PH.h"
#include "DFRobot_EC.h"
#include <EEPROM.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <ArduinoJson.h>
#define PH_PIN A2
#define EC_PIN1 A1
#define EC_PIN2 A3
#define ONE_WIRE_BUS 4
#define KVALUEADDR 0x0A
// Setup a oneWire instance to communicate with any OneWire devices (n... | true |
885361918e84a04930b25d7df4faa9dad20aa3bf | C++ | aart11330056/Project_Smart-Apartment_full | /ArduinoUnoKeypadPassword.ino | UTF-8 | 3,799 | 2.8125 | 3 | [] | no_license | #include <Keypad.h>
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include<EEPROM.h>
#define I2C_ADDR 0x27 //defining the LCD pins
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
Liquid... | true |
015e44516ad4cd3d739161930a98b8a983a19f2c | C++ | akashrajkn/spoj-solutions | /spoj_absp1.cpp | UTF-8 | 1,327 | 2.53125 | 3 | [] | no_license | /*
problem code: ABSP1
problem number: 18155
problem link: http://www.spoj.com/problems/ABSP1/
*/
#include<cstdio>
#include<cstdlib>
#include<cctype>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<iterator>
#include<set>
#include<map>
#include<iostream>
#include<sstream>
#include<dequ... | true |
1b99c33cdfebab6cac638764ca1dbabc5c7e4788 | C++ | Mansterteddy/Cracking-the-Coding-Interview | /language/c++/data structure/Class/ComputeAreaAndPermiter/Circle.h | UTF-8 | 434 | 3.09375 | 3 | [] | no_license | #ifndef CIRCLE_H_
#define CIRCLE_H_
#include "Shape.h"
class Circle : public virtual Shape
{
public:
Circle(): radius(0) {}
Circle(int the_radius) : radius(the_radius){}
int get_radius() const {return radius;}
double compute_area() const;
double compute_perimeter() const;
... | true |
8afdbaa2de60cc167f33a228b49aed557231bb73 | C++ | menguan/toj_code | /tojcode/3100.cpp | UTF-8 | 1,104 | 2.546875 | 3 | [] | no_license | #include<iostream>
#include<cstring>
using namespace std;
char map[60][60];
bool trap[60][60];
bool vis[60][60];
int r,c;
int ans;
int dir[4][2]={0,1,1,0,-1,0,0,-1};
void dfs(int x,int y)
{
if(x==0||y==0||x>r||y>c) return;
vis[x][y]=1;
int tx,ty;
if(map[x][y]=='G') ans++;
if(trap[x][y]) retur... | true |
71c117966d37842e97dd0bcfab082775c2de0678 | C++ | tatiotir/QJabberd | /NodeSubscriber.cpp | UTF-8 | 1,256 | 2.640625 | 3 | [] | no_license | #include "NodeSubscriber.h"
NodeSubscriber::NodeSubscriber(QString jid, QString affiliation, QString subscription)
{
m_jid = jid;
m_affiliation = affiliation;
m_subscription = subscription;
}
NodeSubscriber::NodeSubscriber()
{
m_jid = "";
m_affiliation = "";
m_subscription = "";
}
QString Nod... | true |
37cadea32afff0e118ac5a9032c2b2e8f9ea3731 | C++ | heiseish/CPLib | /Graph/KirchoffTheorem.hpp | UTF-8 | 1,335 | 3.140625 | 3 | [] | no_license | #include <vector>
class KirchoffTheorem {
private:
std::vector<std::vector<double> > AdjMat, DegreeMat;
int N;
long long determinant(std::vector<std::vector<double> >& a) {
const double EPS = 1E-9;
int n = a.size();
double det = 1;
for (int i=0; i<n; ++i) {
int k = i;
for (int j=i+1; j<n; ++j)
if (... | true |
25e390c520cfe28308a1aed4982adbb8f7c9ef0f | C++ | beshaya/bwas | /examples/bwasSerial/bwasSerial.ino | UTF-8 | 3,206 | 2.671875 | 3 | [] | no_license | #include <bwas.h>
#include <thermistor.h>
#include <pwm.h>
#include <Wire.h>
#include "Adafruit_TMP007.h"
//choose thermistor types for the 8 channels
thermistor_t thermistor_config[8];
//array for reading temperatures
int16_t temperatures[8];
Adafruit_TMP007 tmp007;
uint8_t sensor_found = 0;
void setup() {
ther... | true |
d693b1971c59abec8353f66422c1e134572a621e | C++ | zhaozhao/leetcode | /power_of_three.cpp | UTF-8 | 438 | 3.265625 | 3 | [] | no_license | #include "catch.hpp"
bool isPowerOfThree(int n) {
if (n <= 0) return false;
if (n == 1) return true;
if (n % 3) return false;
return isPowerOfThree(n / 3);
}
TEST_CASE("is power of three") {
REQUIRE(!isPowerOfThree(0));
REQUIRE(isPowerOfThree(1));
REQUIRE(!isPowerOfThree(2));
REQUIRE(i... | true |
bb933e4d29654f5dcdb8947add1ef467d6ce791f | C++ | Unity-Technologies/com.unity.webrtc | /Plugin~/WebRTCPlugin/VideoFrameScheduler.h | UTF-8 | 1,487 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <rtc_base/task_utils/repeating_task.h>
#include "VideoFrame.h"
namespace unity
{
namespace webrtc
{
class VideoFrameScheduler
{
public:
VideoFrameScheduler(TaskQueueBase* queue, Clock* clock = Clock::GetRealTimeClock());
VideoFrameScheduler(const VideoFrameScheduler&... | true |
53956fa906c129d007777a1951872609a0aff8f6 | C++ | v1nnyc/W18-PA3 | /RodCut.cpp | UTF-8 | 1,991 | 2.921875 | 3 | [] | no_license | // CSE 101 Winter 2018, PA 3
//
// Name: Vincent Cannalla
// PID: A13006747
// Sources of Help: TODO
// Due: February 23rd, 2018 at 11:59 PM
/* to run:
make TestRodCut
build/TestRodCut testcases/rod-22.txt
*/
#ifndef __RODCUT_CPP__
#define __RODCUT_CPP__
#include "RodCut.hpp"
#include "TwoD_Array.hpp"
#include <iost... | true |
20769b64b742e95cfc01d59dff3dde72b9532af0 | C++ | Garrett-Webb/Application-using-lists | /Drum_Channel_Application/Drum_Channel_Application/Node.cpp | UTF-8 | 690 | 2.953125 | 3 | [] | no_license | #include "stdafx.h"
#include "Node.h"
Node::Node()
{
name = "Default";
units = 0;
year = 0;
studentID = "xxxx-xxxx-xxxx";
gpa = 0.0;
}
Node::Node(string N, int U, int Y, string S, double G)
{
name = N;
units = U;
year = Y;
studentID = S;
gpa = G;
}
Node::~Node()
{
}
string Node::getName()
{return name;}
... | true |
4b4190f9202d9771ad7082e2b43d462cceea8ba6 | C++ | Juditmartin/ARDUINO | /Dau/CFGS_MP10_LL009_002_DAUS_JUDIT_MARTIN_VILA/CFGS_MP10_LL009_002_DAUS_JUDIT_MARTIN_VILA.ino | UTF-8 | 2,511 | 3.109375 | 3 | [] | no_license | /**********************************************************************************
** **
** Daus LED **
** ... | true |
4262a51165be26d04b8f5d121322c2b02a899602 | C++ | Moyaro/Cpp-Primer-Note | /Practice/chapter_03/exercise_3_42.cpp | UTF-8 | 276 | 3.296875 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int> ivec = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
int arr[ivec.size()];
for (int i=0; i < ivec.size(); ++i)
arr[i] = ivec[i];
for (auto i : arr)
cout << i << " ";
cout << endl;
return 0;
}
| true |
c2a4b3bd70c38aa3b044703a94a3d9813b08341e | C++ | laziestcoder/Problem-Solvings | /codeforces/321b.cpp | UTF-8 | 1,565 | 2.71875 | 3 | [] | no_license | /************************************************************************/
/* Name: Towfiqul Islam */
/* uva id: 448714 */
/* email id: towfiq.106@gmail.com */
/* institute: IIUC */
/* address: Chittagong, Bangladesh */
/* */
/*******************... | true |
c850b70806d49170d32d07ae2395d1099a040259 | C++ | lihao1992/Visual-Odometry | /VO/main.cpp | WINDOWS-1252 | 1,669 | 2.546875 | 3 | [] | no_license | #include <fstream>
#include <iostream>
#include <iomanip>
#include "visual_odometry.h"
int main(int argc, char* argv[]){
Camera* cam = new Camera(320.0, 240.0,
608.662263, 806.280756, 330.413538, 174.888673);
VisualOdometry vo(cam);
std::ofstream out("position.txt");
char text[100];
int font_face = cv::FONT... | true |
a486608beeb864590740412de08a27b319399f83 | C++ | niuxu18/logTracker-old | /second/download/CMake/CMake/CMake-joern/Kitware_CMake_repos_function_1381.cpp | UTF-8 | 2,377 | 2.546875 | 3 | [] | no_license | static int
archive_write_client_write(struct archive_write_filter *f,
const void *_buff, size_t length)
{
struct archive_write *a = (struct archive_write *)f->archive;
struct archive_none *state = (struct archive_none *)f->data;
const char *buff = (const char *)_buff;
ssize_t remaining, to_copy;
ssize_t... | true |
2e1d1f6b03c7389b003fe96a94ed62bc3345155f | C++ | arunvaishy2000/cb | /DeleteNodeBST.cpp | UTF-8 | 2,039 | 3.703125 | 4 | [] | no_license | #include<iostream>
using namespace std;
class node
{
public:
int data;
node* left;
node* right;
node(int data)
{
data = data;
left = NULL;
right = NULL;
}
};
node* insertInBST(node*root,int data){
if(root==NULL){
return new node(data);
}
if(data<=root->data){
... | true |
f905466d3a05e5fb83a97969063717620fbbace0 | C++ | alcohololismm/alcoholism | /2-bfs/[2573]broccolism.cpp | UTF-8 | 3,082 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
int R, C;
int SEA[300][300];
int TMP_SEA[300][300];
bool BEEN[300][300];
/**
* returns true if the iceberg is broken, false if not
* using queue.
*/
bool is_broken()
{
queue<pair<int, int>> Q;
int num_of_iceberg = 0;
bool return_me = false;
... | true |
6975f6d01396b8fd3773de5ad5970e4955e80324 | C++ | jskz/flowcpp | /main.cpp | UTF-8 | 3,591 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <flowcpp/flow.h>
enum class counter_action_type {
thunk,
increment,
decrement,
};
struct increment_action {
flow::any payload() const { return _payload; }
flow::any type() const { return _type; }
flow::any meta() const { return _meta; }
bool error() const ... | true |
48c02fba7779b71fb7ae416350c11e80a5ec7cff | C++ | rahulsbisen/interview | /leetcode/palindrome_interger_without_extra_space.cpp | UTF-8 | 524 | 2.765625 | 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 d = x;
int t = 1;
while (d = d / 10) ++t;
if (t == 1) return true;
d = x;
int n = 0;
... | true |
f3ce1cfbbe3766e3ed754327d80ece155410e12f | C++ | alcasa04/Pac-Man-de-los-huevos | /Pacaman2/ProyectosSDL(1.07)/HolaSDL/Texture.cpp | UTF-8 | 2,041 | 3.15625 | 3 | [] | no_license | #include "Texture.h"
//inlcusiones circulares, romper el ciclo e include el.h de uno en el cpp del otro
using namespace std;
Texture::Texture()
{
//constructora dificil
}
bool Texture::loadText(const string filename,int numRows, int numCols, SDL_Renderer* render)
{
this->numRows = numRows;
this->numCols = numCols... | true |
8fd6002a428cb58a6dcd5a805113ba33f9c6ec69 | C++ | JayeshS-02/DSA-college-practical-code | /D1.cpp | UTF-8 | 1,418 | 3.734375 | 4 | [] | no_license | #include<iostream>
#define MAX 20
using namespace std;
class queue
{
public:
int q[MAX];
int front;
int rear;
queue()
{
front=-1;
rear=-1;
}
void insert();
void remove();
int q_overflow();
int q_undeflow();
void display();
};
int queue::q_overflow()
{
if(rear==MAX-1)
return 1;
else
return 0;
}
in... | true |
8131d5a3c5882daa303a181676545fbbac573ac9 | C++ | silicondosa/AnimatLabPublicSource | /Libraries/RoboticsAnimatSim/RbStructure.h | UTF-8 | 825 | 2.515625 | 3 | [] | no_license | /**
\file RbStructure.h
\brief Declares the vortex structure class.
**/
#pragma once
namespace RoboticsAnimatSim
{
/**
\namespace RoboticsAnimatSim::Environment
\brief Classes for the virtual world simulation that use the vortex physics engine.
**/
namespace Environment
{
/**
\brief Vortex physical stru... | true |
8d416a2a255990b40db580a4a5ce27fb4337e652 | C++ | xiazhiyiyun/C-Primer | /Test/testEnumAddr.cpp | UTF-8 | 184 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
enum color{red,green,blue};
int main()
{
int i;
cout << &i << endl;
color c;
c=green;
cout<<&c<<endl;
}
| true |
c383e2998fcbb31716e696cdbaff448e6fbc7429 | C++ | GustaFreitas/Cpp | /Prova Oficial 02/Gustavo Luiz de Freitas (Questão 02).cpp | UTF-8 | 2,532 | 2.890625 | 3 | [] | no_license | #include <stdlib.H>
#include <stdio.H>
struct vendedor
{
int Cod, Ven;
};
int main ()
{
char Opc;
int Tot_Ven, Qtd = 0, Tie_1 = 0, Tie_2 = 0, Tie_3 = 0, Cod_Mai = 0;
float Sal = 0, Com = 0, Tot_Fol = 0, Med_1 = 0, Med_2 = 0, Med_3 = 0, Med_Ger = 0, Mai = 0;
struct vendedor v;
do
{
system ("cls");
... | true |
f1503be9980a20c8453320d7bdcc2c7b702c1d39 | C++ | trojancode95/Data-Structure-and-Algorithm | /Trie/Longest_Common_Prefix.cpp | UTF-8 | 1,619 | 3.171875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
char data;
unordered_map<char,Node*>children;
bool terminal;
int cnt;
Node(char d){
data=d;
terminal=false;
cnt=0;
}
};
class Trie{
public:
Node*root;
Trie(){
root=new N... | true |
cd6c4f0d1ce0651dda83b77f8d8e486082994fdd | C++ | i-am-mike-m/LeetCode | /832.cpp | UTF-8 | 786 | 3.453125 | 3 | [] | no_license | /***********************
This is fairly straightforward on reversing the rows.
To invert using abs(A[row][i] - 1) will take all 1's to 0's and all 0's to -1's, which become 1's.
O(n^2) time - assuming that n x n size is a requirment
O(n) space
***********************/
class Solution {
public:
vector<vector<int>... | true |