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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c756f92d3fc61ff87d1b36d7abb17667bb5b4d49 | C++ | mishadolgih/study | /hse/2020/11/lvl1/B/simple.cpp | UTF-8 | 1,493 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <set>
#include <map>
#define ll long long
#define X first
#define Y second
using namespace std;
int n, k, *a, *b;
struct trio {int i, j, h;};
inline int idx(trio t) {return t.i * k * 4 + t.j * 4 + t.h; }
bool operator<(const trio &l, const trio &r) {return idx(l) < idx(r);}
map<trio, ll> ... | true |
b1a4eaddea66c1f82cff83b405c04b7ed90fea20 | C++ | isaacdvid1596/DataStructures_1 | /Class_Examples/DLLMangoTree/mangoFruit.cpp | UTF-8 | 405 | 2.90625 | 3 | [] | no_license | #include "mangoFruit.h"
mangoFruit::mangoFruit()
{
setWeight(0);
this->next = NULL;
this->prev = NULL;
}
mangoFruit::mangoFruit(double w)
{
setWeight(w);
this->next = nullptr;
this->prev = nullptr;
}
mangoFruit::~mangoFruit()
{
}
void mangoFruit::setWeight(double w)
{
this->we... | true |
8bc4dcc855ca35d377d9ecb9c2861f09a22e22ee | C++ | Sherrydqy/physical-computing | /Arduino Exercises/190207/190207.ino | UTF-8 | 1,002 | 2.59375 | 3 | [] | no_license | int pot1 = A0;
int ledPin1 = 10;
int ledPin2 = 11;
int potRead = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); // we are telling arduino to send back infomation, like read a sensor, read a switch and send
// back to your pc. 9600 is the speed limit of the communication between c... | true |
bfc09a0321b79f8b7e45f6ff23a02903b5d3ae1c | C++ | camilo1765684/proyecto | /IPOO-master/Usuario.h | UTF-8 | 897 | 2.75 | 3 | [] | no_license | #ifndef USUARIO_H
#define USUARIO_H
#include <string>
using namespace std;
class Usuario
{
private:
int codigo;
string nombre;
int telefono;
string direccion;
int valorM;
string tipo;
public:
Usuario();
~Usuario();
Usuario(int codigo, string nombre, int telefono, string direcc... | true |
049cb45f247ff06fc1d85e6521faf237287235a7 | C++ | singhashish-26/Leetcode | /Algorithms/Binary Search/find-smallest-letter-greater-than-target.cpp | UTF-8 | 347 | 3.375 | 3 | [] | no_license | #https://leetcode.com/problems/find-smallest-letter-greater-than-target/
class Solution {
public:
char nextGreatestLetter(vector<char>& letters, char target) {
int x= upper_bound(letters.begin(), letters.end(), target)- letters.begin();
if(x>=letters.size())
return letters[0];
r... | true |
cbfdfeb169b28b8959cbad4f9c7bf523c1e4ebc5 | C++ | logsniper/ACM-code | /ZOJ Accepted/2286-Sum of Divisors.cpp | UTF-8 | 349 | 2.609375 | 3 | [] | no_license | #include<cstdio>
#include<cstdlib>
int f[1000001];
void init()
{
int k,p;
f[0]=0;
for(k=1;k<=1000000;++k)
f[k]=1;
for(k=2;k<=1000000;++k)
for(p=k+k;p<=1000000;p+=k)
f[p]+=k;
}
int main()
{
init();
int m;
while(scanf("%d",&m)!=EOF){
int res=0;
for(int i=1;i<=1000000;++i)
if(f[i]<=m) ++res;
printf(... | true |
b9bab4847e0beb3ca6fb6cef5647ac832d2e2305 | C++ | krovma/glare | /glare/math/utilities.h | UTF-8 | 1,116 | 2.671875 | 3 | [
"MIT"
] | permissive | #pragma once
#include "glare/core/common.h"
namespace glare
{
#if defined(__cpp_lib_math_constants)
#include <numbers>
constexpr float32 PI = std::numbers:pi_v<float32>;
constexpr float32 SQRT_2 = std::numbers::sqrt2_v<float32>
#else
constexpr float32 PI = static_cast<float32>(3.14159265358979323846);
constexpr float... | true |
47970631e7d947cefdb9e229065327a3e4630899 | C++ | l-paz91/principles-practice | /Chapter 18/Exercise 11/main.cpp | UTF-8 | 1,266 | 2.921875 | 3 | [] | no_license | // -----------------------------------------------------------------------------
// https://lptcp.blogspot.com/
// Chapter 18 - Exercise 11
/*
Look up (e.g., on the web) skip list and implement that kind of list.
This is not an easy exercise.
*/
// https://github.com/l-paz91/principles-practice/
// ----------------... | true |
d20d40d964efa928d653de44a4ecd1990d0b584a | C++ | etb10/PAndT | /pingB.ino | UTF-8 | 4,799 | 2.75 | 3 | [] | no_license | #include <neopixel.h>
#include "application.h"
#include "Particle.h"
void colorAll(uint32_t c, uint8_t wait);
void colorWipe(uint32_t c, uint8_t wait);
void rainbow(uint8_t wait);
void rainbowCycle(uint8_t wait);
uint32_t Wheel(byte WheelPos);
SYSTEM_MODE(AUTOMATIC);
#define PIXEL_COUNT 24
#define CIRCLE_ONE_PIN D5
... | true |
a970a551e7fe40b57c9eda3371f21bb902ea149c | C++ | Mjolnir-MD/Mjolnir | /test/core/test_neighbor_list.cpp | UTF-8 | 2,822 | 2.546875 | 3 | [
"MIT"
] | permissive | #define BOOST_TEST_MODULE "test_neighbor_list"
#ifdef BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#else
#include <boost/test/included/unit_test.hpp>
#endif
#include <mjolnir/util/empty.hpp>
#include <mjolnir/util/logger.hpp>
#include <mjolnir/core/SimulatorTraits.hpp>
#include <mjolnir/core/BoundaryCondit... | true |
6c946460e173d8c011a555961a3467ac199a87f2 | C++ | waleywen/BubuJump | /BubuJumpClient/Classes/GamePlay/Obstruction/Effect/BaseEffect.cpp | UTF-8 | 2,008 | 2.53125 | 3 | [] | no_license | #include "BaseEffect.h"
#include "FlyBootEffect.h"
#include "RocketEffect.h"
#include "MagnetEffect.h"
#include "AngelWingEffect.h"
#include "EvilCloudEffect.h"
#include "VortexEffect.h"
#include "TransitionEffect.h"
USING_NS_CC;
BaseEffect::~BaseEffect()
{
}
float BaseEffect::changeSpeed(float speed)
{
return... | true |
79f4649a85cf2a8395d35dba3d151f35c9b7a0e6 | C++ | jasfin/CPP-Programming | /linkedlist/intersection_llist.cpp | UTF-8 | 2,506 | 3.65625 | 4 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
typedef struct node node;
struct node
{
int data;
node *next;
}*root;
void disp(node *ptr)
{
while(ptr!=NULL)
{
cout<<ptr->data<<"\t";
ptr=ptr->next;
}
cout<<"\n";
}
void FindIntersection(node *ptr1,node *ptr2)
{
int count1=0;
int count2=0;
node *temp1... | true |
1cacebd28022a9f2e5e880c1b7252674a867d01e | C++ | mdiepart/Lanternfish | /firmware/lanternfish/daySchedule.cpp | UTF-8 | 8,128 | 3.4375 | 3 | [
"MIT"
] | permissive | #include <stddef.h>
#include "daySchedule.h"
#include <EEPROM.h>
DaySchedule::DaySchedule(unsigned char dayOfWeek){
nbPts = 0;
dow = MONDAY;
changeDay(dow);
}
/*
* Returns the number of points in the selected schedule
*
*/
unsigned char DaySchedule::getSize() const{
return nbPts;
}
point... | true |
0098d74baae2546046c43c0c45e74a84c7f49c18 | C++ | wokickic/Algorithm | /Algorithms/DFS/[BOJ]2468_안전영역.cpp | UHC | 3,145 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
#define max(a, b) ((a) > (b) ? (a) : (b))
using namespace std;
const int dy[] = { 0, 1, 0, -1 };
const int dx[] = { 1, 0, -1, 0 };
const int NSIZE = 101;
int n;
vector<vector<int>> map, visit;
void dfs(int y, int x, int h) {
visit[y][x] = 1;
for (int i = 0; i... | true |
f02f51efdf4cc5562a483cbdc5fe21185930c736 | C++ | jnonline/gdk | /Source/Gdk/System/Memory.h | UTF-8 | 5,531 | 2.875 | 3 | [] | no_license | /*
* Copyright (c) 2011, Raincity Games LLC
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
//
// Memory:
// This file contains implemenation for the GDK memory system. Useable in GDK components & games
//
// Configuration:
//
// Usage:
// Single object
// Foo *foo = G... | true |
1b1218a2870e961436e5acc62d90253426531976 | C++ | Alexsanchoo/2labOOP4sem | /2 laba OOP (4 sem)/ElectricalDevices.cpp | UTF-8 | 411 | 2.90625 | 3 | [] | no_license | #include "ElectricalDevices.h"
void ElectricalDevices::setName(string name)
{
this->name = name;
}
void ElectricalDevices::setCost(double cost)
{
this->cost = cost;
}
void ElectricalDevices::setType(TypeGood type)
{
this->type = type;
}
string ElectricalDevices::getName()
{
return name;
}
double ElectricalDevi... | true |
9918ad7392df1d195f66b190fbe1bf8f5be2e6b6 | C++ | bitcoin/bitcoin | /src/core_read.cpp | UTF-8 | 9,067 | 2.59375 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2009-2022 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <core_io.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <script/script.h>
#include <... | true |
b41d9914f8c52b8b9f78613aafde200f0ef423e9 | C++ | luckeciano/competitive-programming | /10919.cpp | UTF-8 | 705 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int main() {
int k;
cin >> k;
while (k > 0) {
int m;
cin >> m;
bool grads = true;
vector <int> freddieCourses;
for (int i = 0; i < k; i++) {
int course;
cin >> course;
freddieCourses.push_back(course);
}
for (int j = 0; j < m; j++)... | true |
93783af2376cb445b5f047e9e3ad442c3402c07f | C++ | Adam-J-Harris/ImageEditor | /MVCImage - Commented/MVCImage/ImageFactory.h | UTF-8 | 751 | 2.71875 | 3 | [] | no_license | // Class: ImageFactory
// Inherits from: IFactory<shared_ptr<IImage>
// Definition: Factory to create objects of type IImage
//
// Duncan Baldwin & Adam Harris
// 01/05/2017
#pragma once
#include "stdafx.h"
#include <string>
#include <iostream>
#include <memory>
#include <FreeImagePlus.h>
#include "IFactory.h"
#in... | true |
d0249230ad3ff231b0b2e74628dcb365648937a8 | C++ | Pasalc/OOP | /Lab03/Rectangle.h | UTF-8 | 541 | 2.921875 | 3 | [] | no_license | #ifndef RECTANGLE_H
#define RECTANGLE_H
#include <cstdlib>
#include <iostream>
#include "Figure.h"
class Rectangle : public Figure{
public:
Rectangle();
Rectangle(std::istream &is);
Rectangle(size_t i,size_t j);
Rectangle(const Rectangle& orig);
double Square() override;
void Print() overrid... | true |
50ef9e736eecdb881973bd26622817e73119b4b6 | C++ | Brkys/minimalcode | /model.cpp | UTF-8 | 661 | 2.796875 | 3 | [] | no_license | #include "model.h"
MyModel::~MyModel(){
qDeleteAll(itemList_);
itemList_.clear();
}
int MyModel::rowCount(const QModelIndex &parent) const{
return parent.isValid() ? 0 : itemList_.size();
}
QVariant MyModel::data(const QModelIndex &index, int role) const{
if(role == Qt::UserRole){
... | true |
53d141307f7f87269f7ae483613aff0f7bf565f1 | C++ | mpardalos/MIPS-Simulator | /src/memory.cpp | UTF-8 | 6,725 | 3.234375 | 3 | [
"MIT"
] | permissive | #include <vector>
#include <array>
#include <stdexcept>
#include <algorithm>
#include <sstream>
#include "opcodes.hpp"
#include "typedefs.hpp"
#include "memory.hpp"
#include "exceptions.hpp"
#include "show.hpp"
using namespace std;
// We pass in the vector by unique_ptr so that the memory object "owns" the vector.
/... | true |
78e0642ce731e59c310f3075cee0c98c489f082c | C++ | somnath-saha/silver-parakeet | /hello_world/hello.cpp | UTF-8 | 437 | 3.1875 | 3 | [] | no_license | #include <iostream>
using namespace std;
string caesarCypherEncryptor(string str, int key) {
// Write your code here.
// 97 + 25 = 122
int s = 0;
for(int i=0; i<str.size(); i++) {
s = (static_cast<int>(str[i]) + key);
str[i] = (s > 122) ?
static_cast<char>(96 + (s % 122)) : static_cast<char>(s);
}
retur... | true |
62352f8f06153394eb9d9c840f8b9f3710822d9c | C++ | kjohnnyk91/Cell-viewer | /Line.cpp | UTF-8 | 2,262 | 2.734375 | 3 | [] | no_license | // -*- explicit-buffer-name: "Line.cpp<M1-MOBJ/7>" -*-
#include <iostream>
#include "xmlutil.hpp"
#include "line.hpp"
#include "cell.hpp"
#include "net.hpp"
#include "stringToInt.hpp"
namespace Netlist
{
Line::Line ( Node* source, Node* target ):
source_(source),
target_(target)
{
source_-> attach( this );
... | true |
a805cb3a9713cb0ddb52a681fecbc12c6b6dfe65 | C++ | paolocaraos/EECS-111 | /p2_54702118/types_p2.cpp | UTF-8 | 5,961 | 2.984375 | 3 | [] | no_license | #include "types_p2.h"
#include "utils.h"
Person::Person(){
gettimeofday(&t_create, NULL);
started = false;
}
Person::Person(int g, long t_stay, unsigned long n) : gender(g), order(n){
gettimeofday(&t_create, NULL);
time_to_stay_ms = t_stay;
started = false;
}
Person::Person(struct timeval t, long stay, int gen... | true |
e4f259c595a858e6348d2add6a9e346899500df1 | C++ | teresalazar13/CG | /rain.cpp | UTF-8 | 1,232 | 2.65625 | 3 | [] | no_license | #include "rain.h"
float slowdown = 1;
float velocity = 0.6;
int w;
void Rain::setup_particle(int i) {
par_sys[i].alive = true;
par_sys[i].life = 1.0;
par_sys[i].fade = (rand() % 100) / 1000.0f + 0.003f;
par_sys[i].ypos = 20.0;
par_sys[i].vel = velocity;
par_sys[i].gravity = -0.8;
}
void Rain::init_parti... | true |
fedacf1b35918222d043df460cc7777577e1681e | C++ | nfj5/salsa-server | /salsa.cpp | UTF-8 | 4,889 | 3.0625 | 3 | [] | no_license | /**
* Nicholas Jones
* CPSC5510 - SQ20
* Professor Lillethun
* Project1 - HTTP Server
*/
#include <iostream>
#include <fstream>
#include <string>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <netdb.h>
#include <time.h>
#include <unistd.h>
#include <cstdio>
#include <array>
#includ... | true |
1339e27f9f02891b58fedec8d49757a0ce87dac4 | C++ | minhaz1217/My-C-Journey | /0. Vision 2019/2. February/Accepted/uva_406 - Prime Cuts_AC.cpp | UTF-8 | 1,951 | 2.71875 | 3 | [] | no_license | /*
Minhazul Hayat Khan
minhaz1217.github.io
EWU, Bangladesh
Problem Name:
Problem Link: https://vjudge.net/problem/UVA-406
Date : 19 / February / 2019
Comment: very very easy problem, mistook the sieve range
*/
#include<bits/stdc++.h>
//#include<iostream>
using namespace std;
#define check(a) cout << a << endl;
#define... | true |
e3049f1f3cf20700fbe81b368632d79975d7426c | C++ | lymven-io/OOP | /oop-rubook/cp8/8-6.cpp | UTF-8 | 1,285 | 3.9375 | 4 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
class Retangle {
double width, height;
double area;
public:
Retangle() {
width = height = area = 0.0;
}
Retangle(double w, double h) {
width = w;
height = h;
area = width * height;
}
... | true |
b6211fcf1037c40c1b5ed17ac20ee18c5a96fed7 | C++ | rwang067/rocksGraph | /test/testPMEM/hello_world_pmem.cpp | UTF-8 | 7,736 | 2.984375 | 3 | [] | no_license | /* 这是一个PMEM的hello world程序,主要展示如何libpmemobj-cpp工具库进行持久内存C++编程。
* 除了基本的新建/打开PMEM pool、PMEM对象分配、释放、读写等API的介绍外,
* 还介绍了pmem::obj::vector<>这个与标准vector用法非常相似的PMEM版vector的用法。
* 关于libpmemobj-cpp的其它API详细介绍,可参考官方文档https://pmem.io/libpmemobj-cpp/v1.12/doxygen/index.html。
*
* 此程序同时提供了Makefile,可使用符合要求的编译环境直接运行make编译。
*/
#incl... | true |
e284b0b902301d449bbfc1c25f271a6e8a741e62 | C++ | lojpark/CodeForces | /Round #568 Div. 2/B - Email from Polycarp.cpp | UTF-8 | 905 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
string s, t;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> s;
cin >> t;
int sn = (int)s.size();
int tn = (int)t.size();
if (sn > tn) {
cout << "NO" << endl;
continue;
... | true |
e9e500dc8e513cf5cdd6e657c39ab8e4401f1f79 | C++ | RobertKraaijeveld/GrandeOmegaVisualization | /lib/DataProcesser/src/Utilities/JSONEncoder.cpp | UTF-8 | 2,721 | 2.8125 | 3 | [] | no_license | #include "Utilities.h"
#include "../StatisticalAnalyzer/GenericVector/GenericVector.h"
#include "../StatisticalAnalyzer/Point/IClusteringPoint.h"
#include "JSONEncoder.h"
#include <vector>
#include <string>
/*
This .cpp file is separate from the .inl file exists because
clustersToJSON does not use any template parame... | true |
6c08e74481a3bc3f64bea047f4ba4a6e2bc0e8a4 | C++ | 46ccac1474d000676430445ffc4b160a/Algo | /term_paper/Term_paper/App/Trie/trie.cpp | UTF-8 | 3,883 | 2.953125 | 3 | [] | no_license | #include "trie.hpp"
int Node_p::p_indexHelper(const QChar &c)
{
QChar ch = c.toLower();
int index = ( ch.row() << 8 ) | ch.cell();
if ('a' <= index && index <= 'z') return index - 'a';
else if (1072 <= index && index <= 1103) return (index - 1072) + 26; //ru а-я
else if (index == 1105) return 58; ... | true |
8ea470e324213bed6d0d45752191e8032fd15ea7 | C++ | lpkruger/sfe-tools | /sfe/C-sfe/src/crypto/cipher/EVPCipher.h | UTF-8 | 1,953 | 2.609375 | 3 | [] | no_license | /*
* EVPCipher.h
*
* Created on: Sep 3, 2009
* Author: louis
*/
#ifndef EVPCIPHER_H_
#define EVPCIPHER_H_
#include <openssl/evp.h>
#include <openssl/rand.h>
#include "cipher.h"
#include "sillytype.h"
namespace crypto {
void throwCipherError(const char* localerr = NULL);
namespace cipher {
struct EVPPara... | true |
c1b8cf3427b946b818ab8efed481ea422ebe1343 | C++ | VitaliyOschepkov/Labs_PSTU2 | /14. Базы данных/Lab_14/List.h | WINDOWS-1251 | 3,533 | 3.296875 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <iomanip>
#include <list>
#include "Temperature.h"
using namespace std;
typedef list<Temperature> List;
typedef List::iterator Lit;
List listMake(int n)
{
List l;
for (int i = 0; i < n; i++)
{
int d = rand() % 30;
int t = rand() %... | true |
679d91fe1df48f9936017945249e6f1ebd8f5e90 | C++ | sarachour/topaz | /src/common/scheduler/scheduler.cpp | UTF-8 | 679 | 2.78125 | 3 | [] | no_license |
#include "machine.h"
#include "task.h"
#include "scheduler.h"
Scheduler::Scheduler(MachineNetwork * network){
this->size = network->getSize();
this->nodes = new ScheduleNode[this->size];
int main_id = network->getMain().getId();
this->nodes[main_id].setBaselineCost(1.0);
}
//dummy scheduler
int Scheduler::sched... | true |
7411524092eb62c87008d0fd00f94e367fa03cc2 | C++ | MariusGrumer/Info2Labor | /CStackQueue/CStackQueue/CStack.h | ISO-8859-1 | 382 | 2.796875 | 3 | [] | no_license | #pragma once
#include"CMessage.h"
class CStack // LIFO wchst nach oben, zeigt auf Leerelement
{
public:
CStack(int pSize); // ctor mit param, Groee bei Aufruf
~CStack();
bool add(CMessage& pMsg);
bool get(CMessage& pMsg);
private:
int mSize; // store Size
unsigned int mIndex; // Stackpointer
C... | true |
d8ff1a222d15633dda052f9bf6a2e0daae4b5167 | C++ | kamontesanti/Advanced-Digital-Design-using-SystemVerilog | /temperature_app.cpp | UTF-8 | 6,540 | 3 | 3 | [] | no_license | /*
* ECE 4305L - EXP #11 "Temperature Reading"
*
* APPLICATION FILE FOR READING THE TEMPERATURE FROM THE ADT7420 ONBOARD TEMPERATURE SENSOR:
*
* AUTHOR: KYLE A. MONTESANTI
*/
// required libraries for application file:
#include "chu_init.h"
#include "gpio_cores.h"
#include "sseg_core.h"
#include "i2c... | true |
8a79d5d101e1cd4088e5f25619ef7e14f6723c38 | C++ | oyugibillbrian2017/c-codes | /a.cpp | UTF-8 | 232 | 3.515625 | 4 | [] | no_license | // a program which computes and displays the average of 3 numbers entered by the user.
#include <iostream>
using namespace std;
int main()
{
int a;
int b;
int c;
float average;
average=(a+b+c)/3;
cout<<"average";
return 0;
}
| true |
a76ec03453293d53ca75e8bf29f60cff2b1403d8 | C++ | braedenb/SSE662 | /Battle_Ship/Battleship/Battleship/battleship_matt.cpp | UTF-8 | 5,021 | 3.421875 | 3 | [] | no_license | // roytest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
void InitializeBoards();
void PrintBoard(int n);
void SetupBoards();
void ... | true |
7cd769af06f3d2ec039d6969ebf5ea68457b1b21 | C++ | orbs-network/orbs-network-typescript | /client/crypto-sdk/lib/utils.cpp | UTF-8 | 987 | 3.28125 | 3 | [
"MIT",
"LGPL-2.0-only"
] | permissive | #include "utils.h"
#include <iomanip>
#include <iostream>
#include <stdexcept>
using namespace std;
using namespace Orbs;
const string Utils::Vec2Hex(const vector<uint8_t> &data) {
stringstream ss;
ss << hex << setfill('0');
for (uint8_t i : data) {
ss << setw(2) << static_cast<unsigned>(i);
... | true |
009ecddb2776fc8c3d644cd60bb5f36e7a291028 | C++ | redknotmiaoyuqiao/VideoHomework | /common/RedVideoFormat/RedByte.cpp | UTF-8 | 605 | 2.875 | 3 | [] | no_license | #include "RedByte.hpp"
RedByte::RedByte()
{
}
RedByte::~RedByte()
{
if(data != NULL){
free(data);
data = NULL;
}
}
int RedByte::PushData(unsigned char * _data, int _length)
{
unsigned char * tempData = (unsigned char *)malloc(dataLength + _length);
int pos = 0;
if(data != NULL){... | true |
b79786dca085c8beb05c6443f94915c39c72c095 | C++ | adamikandras/error_or | /examples/foo.hpp | UTF-8 | 5,011 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | // Copyright 2013 Andrew C. Morrow
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | true |
a542fc3fd021bd350b5159a72746df6d65d706d4 | C++ | israelElad/AP1-FlightSimulator-Interpreter | /BindCommand.cpp | UTF-8 | 931 | 2.8125 | 3 | [] | no_license | #include <regex>
#include "BindCommand.h"
BindCommand::BindCommand(DataCommands *dataCommands, DataBinds *dataBinds) {
this->dataCommands = dataCommands;
this->dataBinds = dataBinds;
}
void BindCommand::doCommand() {
// get the index from dataCommands
unsigned long index = this->dataCommands->getIndex... | true |
71ae7a9d554003f47e86c3aa019fa6dda909e04d | C++ | KadrusBAG/vector-0.0.2-2nd-sem- | /include/vector.hpp | UTF-8 | 3,956 | 3.671875 | 4 | [] | no_license | #include <iostream>
template <typename T>
class vector_t
{
private:
T* elements_;
std::size_t size_;
std::size_t capacity_;
public:
vector_t();
vector_t(vector_t const& other);
vector_t& operator=(vector_t const& other);
~vector_t();
std::size_t size() const;
std::size_t capacity(... | true |
c25a3b59828368ee94b8cd84bada1497c4a4125a | C++ | thien926/Thien | /UPCoder/DAYNP.cpp | UTF-8 | 446 | 2.5625 | 3 | [] | no_license | #include<iostream>
using namespace std;
typedef unsigned long long int ll;
typedef unsigned short int usi;
void xuat(usi *a,ll n){
for(ll i=0;i<n;i++) cout<<a[i];
cout<<endl;
}
void quaylui(usi *a,ll n,ll j){
for(ll i=0;i<2;i++){
a[j]=i;
if(j==n-1) xuat(a,n);
else quaylui(a,n,j+1);... | true |
6a77711a4e679418546397a2470034e790056b0b | C++ | mugisaku/pglang | /parser/pglang_parser__stream_character.cpp | UTF-8 | 1,333 | 2.96875 | 3 | [] | no_license | #include"pglang_parser__stream.hpp"
#include<cctype>
#include<cstring>
namespace pglang{
namespace parser{
uint64_t
Stream::
get_character()
{
pointer = std::strchr(pointer,'\'')+1;
uint64_t c = *pointer++;
if(c == '\\')
{
auto uc = get_escchar();
c = uc;
}
if(*pointer != ... | true |
ced84dce4fec4d76b3652f800b5a5a938526ea48 | C++ | Stjowa/CS1 | /Lab11_1/src/Lab11_1.cpp | UTF-8 | 2,397 | 4.34375 | 4 | [] | no_license | //============================================================================
// Name : Lab11_1.cpp
// Author : Stephen Walentik
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//========================================================================... | true |
f11ab3e45d17c24b7c99b6c15631bee39d48dcc4 | C++ | lepexys/projects | /SDL_Programm/SDL_Programm/main.cpp | UTF-8 | 34,576 | 2.640625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <clocale>
#include <stdlib.h>
#include <SDL.h>
#include <SDL_ttf.h>
#include <SDL_image.h>
using namespace std;
struct Window
{
SDL_Window *win;
SDL_Renderer *rend;
};
struct Sym
{
int row, pos;
char symbol;
bool ihl;
Sym(char s,int r, int p , bool b)
{
row = r... | true |
ebaea40b05edcdad21b707ef0ceb0c170e2b0d43 | C++ | Soveu/algothings | /themis/6/klm2_2.cpp | UTF-8 | 1,682 | 3.28125 | 3 | [] | no_license | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
#include <stdint.h>
struct Position { int x, int y };
struct Edge {
int from, int to;
int64_t weight;
};
struct DisjoinSet {
struct Item {
int repr;
int count;
};
std::vector<Item> vi;
void init(size_t n) {
this->v... | true |
94f01dd02235c6bd1e4bee2f628fc43443bb25f4 | C++ | danhellem/send-github-issues-to-azure-boards | /sketches/GetWorkItemCount.ino | UTF-8 | 3,076 | 2.765625 | 3 | [
"MIT"
] | permissive | /*
ESP8266 Blink by Simon Peter
Blink the blue LED on the ESP-01 module
This example code is in the public domain
The blue LED on the ESP-01 module is connected to GPIO1
(which is also the TXD pin; so we cannot use Serial.print() at the same time)
Note that this sketch uses LED_BUILTIN to find the pin wit... | true |
cee353e8aa9a0746981d32ff3121aa5b8b29f62f | C++ | uiucCme/Practicum | /Assignment1/buildOrderBook.cpp | UTF-8 | 15,325 | 2.9375 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<fstream>
#include<sstream>
#include<stdlib.h>
#include<queue>
#include<unordered_set>
#include<vector>
#include<unordered_map>
using namespace std;
class generalInfo{
string code;
int stockLocate;
int trackingNumber;
long timestamp;
public:
string getcode() ... | true |
a3239bf24a5d0e78d58742f50db767195d3ae3ee | C++ | wangchaomail/methods | /algorithms/sorting/quicksortclassic.cpp | UTF-8 | 1,544 | 3.703125 | 4 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
template <class A, class I> void print(A *a, I lo, I hi) {
cout << "Array (size: " << hi - lo + 1 << "):";
for(I i = lo; i <= hi; ++i) {
cout << ' ' << a[i];
}
cout << endl;
}
template <class A, class I> I partition(A *a, I lo, I hi) {
A p = a[hi];
... | true |
73c94e7901c6475186206732f550020b8f566a6e | C++ | advancevillage/trace | /core/object.h | UTF-8 | 1,022 | 2.859375 | 3 | [] | no_license | #ifndef __OBJECT__
#define __OBJECT__
#ifndef __USED_OPENCV__
#define __USED_OPENCV__
#include <opencv2/opencv.hpp>
using namespace cv;
#endif
class Object{
protected:
int _x;
int _y;
int _width;
int _height;
cv::Scalar _color;
bool _ishow;
public:
Object();
Object(int x, int y, int w... | true |
1f7d8a12cd0c6ff8845532629a49a53113709c2d | C++ | REDFOX1899/Interview-Bit | /Bit Manipulation/NumberOf1Bits.cpp | UTF-8 | 502 | 3.53125 | 4 | [] | no_license | /*
Write a function that takes an unsigned integer and returns the number of 1 bits it has.
Example:
The 32-bit integer 11 has binary representation
00000000000000000000000000001011
so the function should return 3.
*/
int Solution::numSetBits(unsigned int A) {
int count =0;
vector<int> bits (32, 0);
in... | true |
8e23ce4e6140d76f37dac7251f5b7a7abf209619 | C++ | xiayifan-1984/optionHedge | /memoryManage/journal/Page.h | UTF-8 | 1,903 | 2.640625 | 3 | [] | no_license | #ifndef MM_PAGE_H
#define MM_PAGE_H
#include "../utils/memoryManage_declare.h"
#include "../utils/constants.h"
#include "FrameHeader.h"
#include "Frame.hpp"
MM_NAMESPACE_START
FORWARD_DECLARE_PTR(Page)
class Page
{
private:
//current frame
Frame frame;
//address of mmap-file associated with this ... | true |
e3d810224c57d2823ee246ae7819cbb94d58a21e | C++ | jiadaizhao/LeetCode | /0401-0500/0489-Robot Room Cleaner/0489-Robot Room Cleaner.cpp | UTF-8 | 2,122 | 3.609375 | 4 | [
"MIT"
] | permissive | /**
* // This is the robot's control interface.
* // You should not implement it, or speculate about its implementation
* class Robot {
* public:
* // Returns true if the cell in front is open and robot moves into the cell.
* // Returns false if the cell in front is blocked and robot stays in the curren... | true |
c22c2b9f7e7f92464feca3834f6f9174fc2eef77 | C++ | alissastanderwick/OpenKODE-Framework | /01_Develop/libXMCocos2D-v3/Source/3d/C3DBatchMesh.cpp | UTF-8 | 5,818 | 2.6875 | 3 | [
"MIT"
] | permissive | #include "3d/C3DBatchMesh.h"
#include "3d/C3DVertexFormat.h"
#include "3d/Vertex.h"
namespace cocos3d
{
C3DBatchMesh::C3DBatchMesh(const C3DVertexFormat* vertexFormat, PrimitiveType primitiveType, bool bIndex, unsigned int initialCapacity, unsigned int growSize)
: _vertexFormat(NULL), _primitiveType(primitiveType... | true |
42f4a6c1b4663302691523bb611e3cb41294b9d9 | C++ | jamellknows/rationalPointsEllipse | /main.cpp | UTF-8 | 5,262 | 3.390625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <string>
#include <math.h>
using namespace std;
int primes();
int conversion();
void curve();
void rational();
int conversion(long double number) //This function converts decimals to integers
{
string stringDouble = to_string(num... | true |
3dcbb359efa7b9e68a5c3ba364d06ad482194660 | C++ | xiezilailai-xkh/MS_DAKA | /Week32/longest-univalue-path.cpp | UTF-8 | 942 | 3.140625 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int ans;
int dfs(TreeNode* root){
if(!root)return 0;
int tmp = 1;
i... | true |
d9cccad6d498f6f51d77eafe754216f56dea8e2b | C++ | ljjhome/CPrimerPractice | /chp3/ex_3_1.cpp | UTF-8 | 564 | 3.65625 | 4 | [] | no_license | #include <iostream>
using std::cout;
using std::endl;
using std::cin;
int main(){
/* exercise 1.9*/
int i = 50;
int sum = 0;
while(i<101){
sum = sum + i;
i++;
}
cout<<"the sum from 50 to 100 is: "<<sum<<endl;
/* exercise 1.10*/
for (int i = 10; i>-1; i--){
cout... | true |
88d912b10677ef1f2ff4c5b9ce60e5aaad8d8988 | C++ | schmcory/CS161 | /week1/gardenCost.cpp | UTF-8 | 2,015 | 3.875 | 4 | [] | no_license | #include <iostream>
#include <stdint.h>
#include <iomanip>
//function prototype
int inputValidation(double &input);
// a simple example program
int main()
{
double soilCost; //variable holds cost of soil input by user
double flowerSeedsCost; //variable holds cost of flowers input by user
double fenceC... | true |
abfd579fa05c9a85b379074a8312e081f9499c82 | C++ | ssong86/leetcode-problem-solving | /Top-Interview-Questions/DynamicProgramming-Easy-Collection/53-maximum-subarray.cpp | UTF-8 | 552 | 2.90625 | 3 | [] | no_license | // Kadane's algorithm
// TC: O(n)
// SC: O(1)
// Runtime: 12 ms, faster than 64.48%
// Memory Usage: 13.4 MB, less than 22.87%
class Solution {
public:
int maxSubArray(vector<int>& nums) {
if(!nums.size())
return 0;
int max = INT_MIN, sum = 0;
for(int i... | true |
9b9ef1a5826ea1294aff5fdcf75385f27a90c65a | C++ | zetrax1/POS | /src/controller/Hra.cpp | UTF-8 | 5,641 | 2.734375 | 3 | [] | no_license | #include "Hra.hpp"
#include <iostream>
#include <future>
#include <thread>
#include <chrono>
namespace controler
{
Hra::Hra()
{
}
Hra::~Hra()
{
}
void Hra::moveItems()
{
while (m_isRun)
{
for (int i = 0; i < (int)m_postava.size(); i++)
{
auto x = getPostava(i).getPozicia(... | true |
7bae6927714c047cdde6cc24ba164e771e349748 | C++ | RostyslavMV/OOP_Module1 | /Task2/Task2/Function.h | UTF-8 | 4,409 | 3.546875 | 4 | [
"MIT"
] | permissive | #pragma once
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <set>
using std::string;
using std::to_string;
using std::vector;
using std::istringstream;
using std::pair;
using std::set;
class Function
{
private:
int IntPow(int arg, int pow)
{
int ret = 1;
for (int i = 1; i <= po... | true |
cc7161289d65bbabe80502c4402167ab540643bd | C++ | HeliumProject/Engine | /Source/Engine/Engine/AssetPath.cpp | UTF-8 | 30,486 | 2.8125 | 3 | [
"BSD-3-Clause"
] | permissive | #include "Precompile.h"
#include "Engine/AssetPath.h"
#include "Foundation/FilePath.h"
#include "Foundation/ReferenceCounting.h"
#include "Engine/Asset.h"
struct Helium::AssetPath::PendingLink
{
PendingLink *rpNext;
//struct Entry *pObjectPath;
AssetWPtr wpOwner;
// TODO: Maybe this ought to be a relative pointe... | true |
841b74f876a4cd135674864db471f2098fa3630e | C++ | MacroStones/MacroStonePTA | /Hello-Word/2006.cpp | UTF-8 | 690 | 3.25 | 3 | [] | no_license | //2006
//Problem Description
//给你n个整数,求他们中所有奇数的乘积。
//Input
//输入数据包含多个测试实例,每个测试实例占一行,每行的第一个数为n,表示本组数据一共有n个,接着是n个整数,你可以假设每组数据必定至少存在一个奇数。
//Output
//输出每组数中的所有奇数的乘积,对于测试实例,输出一行。
#include<stdio.h>
int main()
{
int product;
int n,tmp;
while(scanf("%d",&n)==1)
{
product=1;
while(n-->0)
{
sc... | true |
b5de35a049c6ea8c5396e8c412f71d32835209fc | C++ | Luminarys/acsl | /acsl/array.hh | UTF-8 | 1,219 | 3.375 | 3 | [] | no_license | //
// Templated safe array class.
//
#ifndef ACSL_ARRAY_HH
#define ACSL_ARRAY_HH
#include "maybe.hh"
#include "types.hh"
#include "utility.hh"
#include <initializer_list>
namespace acsl {
template<typename T, usize N>
class Array {
static_assert(N > 0, "Array must be of size 1 or more");
T buffer_[N];
public:
... | true |
17d214e950a1f7bf74f6a8f4c8a4ec676119e9d6 | C++ | LexxaPressF/Programing_C | /Lab12C++/SchoolCpp/SchoolCpp/SchoolCpp.cpp | UTF-8 | 1,051 | 2.875 | 3 | [] | no_license | #include <iostream>
#include "human.h"
#include "Student.h"
#include <string>
#include <vector>
#include <Windows.h>
#include "teacher.h"
using namespace std;
int main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
human id1("Leonidovich", "Pavel", "Efimov");
cout << "ФИО человека: " << id1.get_full_name() <<... | true |
a010261aa3fafc1b34fa9dd0d9d680400d1be262 | C++ | LearningAchievements-masdevas/RungeKutta4 | /RungeKuttaGraphic/Tokenizer.cpp | UTF-8 | 1,895 | 3.078125 | 3 | [] | no_license | #include "Tokenizer.h"
void SkipSpaces(std::stringstream& stream) {
while (stream.peek() != EOF && std::isspace(stream.peek())) {
stream.get();
}
}
Tokens ParseToTokens(const std::string& data, const std::unordered_map<std::string, double>& variables) {
Tokens tokens;
std::stringstream buffer(data);
... | true |
a6ddfe2f91e83ce9b2b9e8e77d50264e6d585d33 | C++ | AhJo53589/leetcode-cn | /problems_test/17.13-lcci/SOLUTION.cpp | UTF-8 | 1,223 | 2.8125 | 3 | [] | no_license |
//////////////////////////////////////////////////////////////////////////
class Solution {
public:
int respace(vector<string>& dictionary, string sentence) {
vector<int> dp(sentence.size() + 1, 0);
for (int i = 0; i < sentence.size(); i++) {
dp[i + 1] = (i == 0) ? i + 1 : min(i + 1, d... | true |
1ab1a868edfee021812b018e88ea5fddd7f07292 | C++ | valleyceo/code_journal | /1. Problems/f. Trees/2_Top_K_Frequent_Elements.cpp | UTF-8 | 1,096 | 3.359375 | 3 | [] | no_license | // Top K Frequent Elements
/*
Given a non-empty array of integers, return the k most frequent elements.
For example,
Given [1,1,1,2,2,3] and k = 2, return [1,2].
Note:
You may assume k is always valid, 1 ≤ k ≤ number of unique elements.
Your algorithm's time complexity must be better than O(n log n), where n is the... | true |
696923513c395558c20b46f208b4d0c31ca27cf5 | C++ | fapablazacl-old/xe.old | /src/xe/xe/io/IosStream.cpp | UTF-8 | 2,900 | 2.9375 | 3 | [] | no_license |
#include "IosStream.hpp"
#include <cassert>
#include <fstream>
#include <iostream>
namespace xe {
struct IosStream::Private {
mutable std::istream *stdStream = nullptr;
};
IosStream::IosStream(std::istream *stdStream) : m_impl(new IosStream::Private()) {
assert(m_impl);
assert(s... | true |
1ac1eb3632f26ca2f7af71bfb9876321b4ab1fff | C++ | Genixi/Cpp_yellow | /decomposition_2/responses.cpp | UTF-8 | 1,148 | 3.015625 | 3 | [] | no_license | #include <string>
#include <iostream>
#include <vector>
#include <map>
using namespace std;
#include "responses.h"
ostream& operator << (ostream& os, const BusesForStopResponse& r) {
if (r.buses_count == 0) {
os << "No stop" << endl;
} else {
for (const string& bus : r.buses) {
os << bus << " ";
}
os <<... | true |
844bfb9d3e5444df78a0b2da18bd26c54a102550 | C++ | Joe-Feng/PAT | /A1025 PAT Rianking/main.cpp | GB18030 | 1,892 | 3.6875 | 4 | [] | no_license | /*
1 ˼ṹӦü¼ʲôֵ
2 sortʹ
3 ִ
4 СӦΪ
*/
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
struct student
{
char id[15];
int score;
int location_num;
int location_rank;
}stu[30010]; //Ŀгn<=100, ÿ<=300, С>=30000,UI δ
bool cmp(student a, student b)
{
if(a... | true |
8ddf557abc95b94a6464a29eedb368f9715efbd8 | C++ | fsps60312/old-C-code | /C++ code/Polish Olympiad in Informatics/XX OI/Maze(3).cpp | UTF-8 | 4,757 | 2.859375 | 3 | [] | no_license | #include<cstdio>
#include<cassert>
#include<vector>
#include<algorithm>
#include<deque>
#include<set>
using namespace std;
const int INF=2147483647;
void getmin(int &a,const int b){if(b<a)a=b;}
void getmax(int &a,const int b){if(b>a)a=b;}
struct Point
{
int x,y;
Point(){}
Point(const int _x,const int _y):x(_x),y(_y)... | true |
6382ba2c2033dfb26bb80a967a15bc984f925604 | C++ | kottofy/CPlusPlus-Projects | /Assignment 2-Rot13/a2-g++/main.cpp | UTF-8 | 581 | 3.0625 | 3 | [] | no_license |
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
void rot13(char *str);
int main(int argc, char ** argv )
{
char buf[4096];
int i;
if (argc < 2 ) {
printf("Usage: %s e (for encode) or %s d (for decode) \n", argv[0], argv[0]);
exit(-1);
}
i=0;
while (cin.get(buf[i... | true |
8b169745d4c75abeb8448db9ae4c13a560840b6d | C++ | Zwlin98/Learn_ACM | /1143.cpp | UTF-8 | 317 | 3.140625 | 3 | [] | no_license | #include <stdio.h>
void move(char f ,char t)
{
printf("%c->%c\n",f,t);
}
void hanota(int n,char from,char depend,char to)
{
if(n==1) move(from,to);
else
{
hanota(n-1,from,to,depend);
move(from,to);
hanota(n-1,depend,from,to);
}
}
int main()
{
int n;
scanf("%d",&n);
hanota(n,'a','b','c');
return 0;
} | true |
24942c7fc0973b2df4a817de3b6546b0d2c247ca | C++ | 8BitSec/DS_practicals | /ds_10.cpp | UTF-8 | 7,072 | 4.21875 | 4 | [] | no_license | /*
Q. Implementation of Linked list using templates. Include functions for insertion,
deletion and search of a number, reverse the list and concatenate two linked
lists(include a function and also overload operator +).
*/
#include<iostream>
using namespace std;
//NODE CLASS
template <class t>
class ... | true |
34be5646a5b99e4c3c5a36c0b1cd0820bf7f5240 | C++ | yyt12345/Leetcode | /链表/021.cpp | UTF-8 | 1,979 | 3.90625 | 4 | [] | no_license | /*
21. 合并两个有序链表
将两个升序链表合并为一个新的升序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。
*/
#include <string>
#include <vector>
#include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
//20 ms 13.02% 7.2 MB 100.00% 时间复杂度 O(m+n)
ListNode* mergeTwoLists(L... | true |
448b3926b97c64fca76503a49276fc3bf9bfb21a | C++ | anita-sharma/cpp | /binary_tree_problem/bfs.cpp | UTF-8 | 994 | 3.703125 | 4 | [] | no_license | #include<iostream>
#include<queue>
using namespace std;
struct node{
int data;
struct node* left;
struct node* right;
};
struct node* newnode(int data)
{
struct node* temp=(struct node*)malloc(sizeof(struct node));
temp->data=data;
temp->left=NULL;
temp->right=NULL;
return(temp);
}
//func to print tree data ... | true |
319e10f28515a3dbba96c531a9653e3e65a21f4c | C++ | KCCTdensan/Procon30th-KCCT | /Solver/engine_loader.cpp | SHIFT_JIS | 1,037 | 2.828125 | 3 | [] | no_license | #include "engine_loader.hpp"
namespace solver
{
EngineLoader::EngineLoader(const std::wstring &engineName)
{
const std::wstring dllPath = engineName + L".dll";
moduleHandle = LoadLibrary(engineName.c_str());
if(moduleHandle == NULL)
{
throw L"EngineManager : DLL̓ǂݍ݂Ɏs܂";
}
creator = reinterpret_cast<... | true |
e9a3e3d3745c05eb61024d660386755ac0876ab8 | C++ | walterar/pioneer-sp | /src/ui/Widget.h | UTF-8 | 17,499 | 2.640625 | 3 | [] | no_license | // Copyright © 2008-2016 Pioneer Developers. See AUTHORS.txt for details
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
#ifndef UI_WIDGET_H
#define UI_WIDGET_H
#include "libs.h"
#include "Point.h"
#include "Event.h"
#include "RefCounted.h"
#include "WidgetSet.h"
#include "PropertiedObject.h"
#inclu... | true |
0d6fcffdfe5c7399578b9d7726b7b1afb8bbf427 | C++ | mahkons/Software-design-course-HSE2020 | /CLI/inc/commands/pwd_command.h | UTF-8 | 927 | 2.78125 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string>
#include <vector>
#include <memory>
#include "result.h"
#include "commands/command.h"
#include "commands/execution_result.h"
namespace NCLI::NCommand {
/**
* Command that writes current directory absolute path to output stream
*/
class PwdCommand... | true |
a78d4b0a6759b9bb89fe308cf6ec073823c98d59 | C++ | markkun/galaxy | /galaxy/src/galaxy/fs/FileSystem.hpp | UTF-8 | 2,002 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | ///
/// FileSystem.hpp
/// galaxy
///
/// Refer to LICENSE.txt for more details.
///
#ifndef GALAXY_FS_FILESYSTEM_HPP_
#define GALAXY_FS_FILESYSTEM_HPP_
#include <string>
namespace galaxy
{
namespace fs
{
///
/// Open an open file dialog using pfd.
///
/// \param filter See: https://github.com/samhocevar/p... | true |
7586e94bf3db37f5d66a51be3337a2508852900b | C++ | Zhenghao-Liu/LeetCode_problem-and-solution | /0990.等式方程的可满足性/solution_union_find.cpp | UTF-8 | 1,421 | 3.171875 | 3 | [] | no_license | class Solution {
unordered_map<char,char> parent;
public:
bool equationsPossible(vector<string>& equations) {
parent.clear();
int equations_size=equations.size();
vector<int> unequal;
vector<int> equeal;
for (int i=0;i<equations_size;++i)
{
if (equatio... | true |
086937c1864824ba76f9f6c7eb25984512448bc8 | C++ | hyedoii/ite1015_2017029716 | /HW5/draw_shape/draw_shape_main.cc | UTF-8 | 2,097 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include "draw_shape.h"
using namespace std;
int main()
{
int row, col;
cin>>col>>row;
Canvas canvas(row, col);
canvas.Draw(cout);
Shape shape;
while(true)
{
string word;
cin>>word;
if(word=="add")
... | true |
768b797b2e6f718248f4e5867ab1e0f7572fd48d | C++ | StK1729/SK-Game-Engine | /SK-Game-Engine/src/SK-Game-Engine/Renderer/VertexArray.h | UTF-8 | 561 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <memory>
#include "SK-Game-Engine/Core/Core.h"
#include "Buffer.h"
namespace SK_Game_Engine
{
class SKGE_API VertexArray
{
public:
virtual ~VertexArray() {};
virtual void Bind() = 0;
virtual void Unbind() = 0;
virtual void AddVertexBuffer(const Ref<VertexBuffer>& vertexBuffer) = 0;
... | true |
3ec71fdbcc7b16db20d8ac6aa062f2fee6563a8c | C++ | imnick002/hackerrank | /divisible sum pairs.cpp | UTF-8 | 503 | 2.609375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,s;
cin>>n>>s;
int arr[n];
int sum=0;
int count=0;
for(int i=0;i<n;i++){
cin>>arr[i];
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
sum=arr[i]+arr[j];
if(i!=j)... | true |
24e5a0411fd4a526a9dc0dfdc643ee33e9a35f20 | C++ | Le0nRoy/BerkleyAPI_App | /src/client/client.cpp | UTF-8 | 2,624 | 2.96875 | 3 | [] | no_license | //
// Created by lap on 9/5/20.
//
#include <iostream>
#include "client.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <cstring>
#include <unistd.h>
/// Good
void Client::run()
{
if (createConnection() == EXIT_FAILURE)
{
return;
}
std::string str;
int ... | true |
8ec4da28b043e3c98ce800bd787024ac597872fe | C++ | heronsousa/PPC | /prova2/d.cpp | UTF-8 | 581 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ll t;
double m;
cin >> m >> t;
vector<double> taxa;
for(int i=0;i<t;i++){
double aux;
cin >> aux;
taxa.push_back(aux/100.0);
}
double lo=0,hi=m,mid;
while(lo <= hi){
mid = lo+(hi-lo)/2;
double... | true |
b05c14004f69f141cc082dc16d9034285840fe17 | C++ | tek1031/AOJ | /2014/2014.cpp | UTF-8 | 1,067 | 2.734375 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<vector>
#include<string.h>
using namespace std;
int h,w;
bool is_next[2][50][50];
vector<string> M;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
void dfs(int x,int y,int is_black){
if(x<0 || y<0 || x>=w || y>=h) return;
if(M[y][x]!='.') return;
if(is_next[is_black][y][x]... | true |
ef60438dee5cca548a1a797193c23c0ed86845ed | C++ | Meet57/programming | /c++ practicals/5.18.cpp | UTF-8 | 512 | 3.578125 | 4 | [] | no_license | #include<iostream>
using namespace std;
class TEST
{
private:
int maths;
public:
TEST()
{
cout << "contructor" << endl;
maths = 0;
}
void Setdetails(int a)
{
maths = a;
}
~TEST()
{
cout << "Destructor" << endl;
}
friend int find_square(TEST temp);
};
int find_square(TEST temp)
{
... | true |
81a8f6bada5eb31151eff51e862dd006a2fb302b | C++ | CompPhysics/ThesisProjects | /doc/MSc/msc_students/former/ChristianF/ThesisCodes/diagonalization/WaveFunctions/wavefunction.cpp | UTF-8 | 1,602 | 3.09375 | 3 | [
"CC0-1.0"
] | permissive | #include "wavefunction.h"
WaveFunction::WaveFunction(System* system, double omega) {
m_system = system;
m_omega = omega;
}
vec WaveFunction::computeHermitePolynomial(int nValue, vec position) {
// Computes Hermite polynomials.
double omegaSqrt = sqrt(m_omega);
vec factor = 2*omegaSqrt*position;
... | true |
ab37d71d8de069116090468ca5cf88d683b6209c | C++ | ore13/rocketThermal | /src/AeroHeating.cpp | UTF-8 | 3,572 | 2.609375 | 3 | [] | no_license | #include "AeroHeating.hpp"
#include "AirProperties.hpp"
#include "CsvWriter.hpp"
#include "vectorMath.hpp"
#include <cmath>
#include <vector>
using namespace std;
class flightData
{
vector<double> *time_ptr;
vector<double> *temperature_ptr;
vector<double> *pressure_ptr;
vector<double> *velocity_ptr;
... | true |
6ba88a43563145b2bc88199cd3a3104db6778acf | C++ | MohammadJRanjbar/Dataset-and-NeuralNet-Class | /cpp/dataset.cpp | UTF-8 | 6,275 | 2.890625 | 3 | [
"MIT"
] | permissive | #include "dataset.h"
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <cmath>
void Dataset::show()
{
std::cout << "Dataset:" << std::endl;
std::cout << " " << "No of sampels: " << no_of_samples << std::endl;
std::cout << " " << "Train sampels " << train_inpu... | true |
bcdb75f9981dc479c67ef96c18984f283a49fbd5 | C++ | Muret/Zephyr | /Zephyr/CatmullClark.h | UTF-8 | 1,661 | 2.71875 | 3 | [] | no_license |
#ifndef __INCLUDE_CATMULLCLARK_H
#define __INCLUDE_CATMULLCLARK_H
#include "includes.h"
class Mesh;
class CatmullClark
{
struct CC_Edge
{
int edge_points[2];
//int touching_faces[2];
int newly_added_midpoint;
int face;
};
struct CC_Face
{
vector<int> edges_of_face;
vector<int> vertices_of_face;
... | true |
f70adc01b03032ee415c8124949e7d7d5adfbf60 | C++ | serman/muncyt_tests | /nuclear_Fuerte/src/Emisor.h | UTF-8 | 1,957 | 2.671875 | 3 | [] | no_license | /*
* Emisor.h
* nuclear_Fuerte
*
* Created by guillermo casado on 03/09/14.
* Copyright 2014 __MyCompanyName__. All rights reserved.
*
*/
#ifndef _EMISOR
#define _EMISOR
class Emisor {
public:
// posicion
float rho;
float ang;
ofVec2f posXY;
// hacia donde van las particulas
ofVec2f pointTo;
of... | true |
23828cb055a58e86ee3cfb5fb9da2f060f9a1b5c | C++ | borispeeters/cpp | /module00/ex01/contact.cpp | UTF-8 | 5,520 | 3.046875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* :::::::: */
/* contact.cpp :+: :+: ... | true |
18034963bae21fa30207442ac3251e2e0dd3fcd7 | C++ | wangqifei/leetcode | /152_MaximumProductSubarray.cpp | UTF-8 | 1,340 | 3.6875 | 4 | [] | no_license | // 152 Maximum Product Subarray
// Find the contiguous subarray within an array (containing at least one number) which has the largest product.
// For example, given the array [2,3,-2,4],
// the contiguous subarray [2,3] has the largest product = 6.
// Hide Tags Array Dynamic Programming
#include <iostream>
#include... | true |