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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
033508cad01acc5e52c1e9ca92e214ff56242dc0 | C++ | murmal/Softwareprojekt | /aufgabe4/test.cpp | UTF-8 | 1,054 | 3.59375 | 4 | [] | no_license | #include "String.h"
ostream& operator<< (ostream &out, String &s) {
for (int i = 0; i<s.size; i++) {
out << s.str[i];
}
return out;
}
int main() {
String s;
String si('a');
String sii('s');
String s3("wie gehts?");
String s33("mir gehts gut danke");
String s4(s3);
String s5("hallo ... | true |
83d75a851cb08738e5d7b8dbede9be13599fb7f6 | C++ | kedvall/coursework | /ECE470/src/lab4pkg/src/lab4func.cpp | UTF-8 | 2,526 | 2.796875 | 3 | [] | no_license | #include "lab4pkg/lab4.h"
float get_theta6(float theta1, float yaw_WgripRad);
float get_theta1(float xcen, float ycen);
/**
* function that calculates an elbow up Inverse Kinematic solution for the UR3
*/
std::vector<double> lab_invk(float xWgrip, float yWgrip, float zWgrip, float yaw_WgripDegree)
{
... | true |
436acff35449c2aedd9abaaf19f32b242f160b20 | C++ | cswangle/QbS | /pathPPL.cpp | UTF-8 | 8,613 | 2.671875 | 3 | [] | no_license | // Method: pruned path labelling, (2-hop path cover, a baseline).
// SIGMOD21' Query-by-Sketch: Scaling Shortest Path Graph Queries on Very Large Graphs
// originFile is the file generated by preprocess.
// first, run main function to execute test.labelConstruction() which will generate a labelling file (outputFile).
... | true |
e6cb1425ed7b4aac2b1eb4e4e38e8f8bbf6aac4f | C++ | drlongle/leetcode | /algorithms/problem_0908/other1.cpp | UTF-8 | 1,350 | 3.46875 | 3 | [] | no_license | class Solution {
public:
int smallestRangeI(vector<int>& A, int K) {
// get max and min value in array
int maxv = *max_element(A.begin(),A.end());
int minv = *min_element(A.begin(),A.end());
// possible smallest max value => maxv - K
// possible largest min value => minv + ... | true |
e82fd5b254d50f34b25d63a9f319f4ab1b3913f5 | C++ | nwnlp/fasttree | /src/rf.h | UTF-8 | 3,452 | 2.640625 | 3 | [] | no_license | //
// Created by johnny on 2019/7/1.
//
#ifndef DECISIONTREE_RF_H
#define DECISIONTREE_RF_H
#include <vector>
#include "tree.h"
#include "attribute_list.h"
#include <ctime>
#include <omp.h>
#include <unistd.h>
#include "tree_histogram.h"
class RandomForest{
public:
RandomForest(int num_trees, int max_depth, floa... | true |
9fecf1fc723040f000797d075a15e51244e2132e | C++ | rraallvv/Algorithmic-Composer | /MarkovArray/setNote.cpp | UTF-8 | 988 | 2.828125 | 3 | [] | no_license | //
// setNote.cpp
// MarkovArray
//
// Created by Jonas Schüle on 11.12.14.
// Copyright (c) 2014 hw. All rights reserved.
//
#include "Note.h"
void note::setNumber(int number)
{
if(number >= 0 && number < 128)
{
note::noteData[0] = number;
}
else
{
printf("ERROR: Notenumber ou... | true |
a2fe20e7240842afdb667aec70ce222882a1c9a0 | C++ | skzr001/Leetcode | /150. Evaluate Reverse Polish Notation/lc150.cpp | UTF-8 | 405 | 2.78125 | 3 | [] | no_license | class Solution {
public:
int evalRPN(vector<string>& tokens) {
string s=tokens.back();
tokens.pop_back();
if(s!="+"&&s!="-"&&s!="*"&&s!="/") return stoi(s);
int b=evalRPN(tokens),a=evalRPN(tokens);
// Does every operation valid?
if(s=="+") return a+b;
if(s=="-... | true |
ed488345c055cf2efa6483926cb7073767b4e346 | C++ | jpvanoosten/LearningCUDA | /Tutorial2/main.cpp | UTF-8 | 3,347 | 3.40625 | 3 | [
"MIT"
] | permissive | #include "cuda_runtime.h"
#include <algorithm>
#include <chrono>
#include <iostream>
cudaError_t addWithCuda_1(int n, float* x, float* y);
cudaError_t addWithCuda_256(int n, float* x, float* y);
cudaError_t addWithCuda_256xN(int n, float* x, float* y);
using namespace std::chrono;
void add(int n, float* x, float* y... | true |
54b30f4dfb937ed42cbc527bf68fcc1f417ab573 | C++ | mururaj/Algorithms | /BitOps/testEndianess.cpp | UTF-8 | 359 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
int main()
{
union s
{
unsigned int i;
unsigned char ch[4];
};
union s obj;
obj.i=1u;
printf("%d %d %d %d %d\n",obj.i,obj.ch[0],obj.ch[1],obj.ch[2],obj.ch[3]);
unsigned int num = 0x01020304;
unsigned char *myChar = (unsigned char *)#
printf("num = %x mychar = %x... | true |
872df62ecf54f0a6b6d48913a47a2041f4a06037 | C++ | RuslonPy/C-Example | /dfs_matritsa.cpp | UTF-8 | 941 | 2.84375 | 3 | [] | no_license | #include<iostream>
using namespace std;
char a[1000][1000];
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int n , m;
bool used[1000][1000];
void dfs(int x, int y){
used[x][y] = true;
for(int i = 0; i < 4; i ++){
int tx = x + dx[i], ty = y + dy[i];
if(tx >= 0 and ... | true |
c73414ee8f44b960e64738689531597cdf9a9bd7 | C++ | przempore/Deadstorm | /lib/gem/Bounce.cpp | UTF-8 | 2,030 | 2.828125 | 3 | [] | no_license | #include "gem/Bounce.hpp"
namespace Gem
{
void Bounce::Reset()
{
FiniteAction::Reset();
m_action->Reset();
m_reverseAction->Reset();
m_bounceCounter = 0;
m_reverseActionActive = false;
}
void Bounce::Update(float aTimeDelta)
{
if (m_bounceCount > 0)... | true |
0732afdf5ea23ed736d91abaa98213228a736ef4 | C++ | finch185277/leetcode | /051-075/056.cpp | UTF-8 | 932 | 3.4375 | 3 | [] | no_license | /**
* Definition for an interval.
* struct Interval {
* int start;
* int end;
* Interval() : start(0), end(0) {}
* Interval(int s, int e) : start(s), end(e) {}
* };
*/
class Solution {
private:
inline static bool sort_intervals(const Interval &lhs, const Interval &rhs) {
return lhs.start <... | true |
04703672cdf8d2c77bc29cc10d7c1a6082dced59 | C++ | jordsti/stigame | /StiGame/primitives/Primitive.h | UTF-8 | 1,789 | 2.828125 | 3 | [
"MIT"
] | permissive | #ifndef PRIMITIVE_H
#define PRIMITIVE_H
#include "SDL.h"
#include "Color.h"
namespace StiGame
{
/* Note(s)
* Need to examine some alternative
* Maybe do a wrapper of SDL_gfx...
*
*/
class Surface;
/// \class SPrimitive
/// \brief Interface to draw or fill a polygon
class Primitive
{
public:
/// \brief Empty constru... | true |
a4807911e19714cc2b019cb659d045d22d96bff5 | C++ | Samantha-Jo/Final-Project-2.0 | /user.cpp | UTF-8 | 677 | 2.84375 | 3 | [] | no_license | //
// user.cpp
// CS2Final
//
// Created by Samantha-Jo Cunningham on 5/7/18.
// Copyright © 2018 Samantha-Jo Cunningham. All rights reserved.
//
#include <stdio.h>
#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
#include "user.h"
User::User(){}
string User::userName(string nameofU... | true |
3f6bf57bdf2dda260c0d358a7af68ff8298e5832 | C++ | metrosxxmin/OOP_201502090 | /week03/assignment1.cpp | UTF-8 | 433 | 2.78125 | 3 | [] | no_license | #include <iostream>
void code() {}
static const int rodata = 0;
int data = 1;
int bss;
int main() {
int* heap = new int[1];
int stack = 1;
std::cout << "Code\t : " << (void *) code << '\n';
std::cout << "Rodata\t : " << &rodata << '\n';
std::cout << "Data\t : " << &data << '\n';
std::cout << "Bss\t : " << &bss... | true |
2ea0e5d1feb4bf0dac47b50b987988cb562fd3ba | C++ | Javed69/Cpp_Masterclass | /Competitive_Programming/array/max_till_i.cpp | UTF-8 | 456 | 3.40625 | 3 | [] | no_license | /*
Approach
1.Keep a variable max which stores the maximum tiil the ith element
2.Iterate over the array and update max = max(max, a[i])
*/
#include<iostream>
using namespace std;
int main()
{
int mx = -19999999;
int n;
cin>>n;
int array[n];
for (int i = 0; i < n; i++)
{
cin>>array... | true |
c4217a897ea6a0e39704cab73c2d40b1380bdd1f | C++ | Nimish-Jain/DSA-Practice | /Binary Trees/207. LCA.cpp | UTF-8 | 699 | 2.875 | 3 | [] | no_license | //Code :: Nimish Jain
#include<bits/stdc++.h>
#define endl "\n"
using namespace std;
class node {
public:
int data;
node* left;
node* right;
node(int val) {
data = val;
left = NULL;
right = NULL;
}
};
Node* lca(Node* root, int a, int b) {
if (!root) return NULL;
if (root->data == a or root->data == b)... | true |
f6e48a1303ca23e5180ebe7408478b5c5a4f71f5 | C++ | Kerorohu/PAT_Code | /1041.cpp | UTF-8 | 634 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <string>
using namespace std;
struct Data {
string number;
int ksn;
}data;
int main() {
int num;
cin >> num;
int sjn;
map<int, Data> m;
for (int i = 0; i < num; i++) {
cin >> data.number >> sjn >> data.ksn;
m.insert(pair<int, Dat... | true |
6e196e676a746ded301d52e505312406caae16e8 | C++ | glennismade/NeuralNetwork | /mlplayer.cpp | UTF-8 | 12,752 | 3.15625 | 3 | [] | no_license | // Library Module Implementing Layers of Perceptrons for CY2D7 .. SE2NN11
// Dr Richard Mitchell 15/12/06 ... 18/09/13
// Adapted by
#include "mlplayer.h"
#include <math.h>
#include <iomanip>
#include <valarray>
// functions students write which return vectors need to be safe
// before student writes the c... | true |
28832687f40eddad2893ff42ecaa16242c8ba876 | C++ | nagyistoce/millipede | /dev/s_golodetz/New Partition Forest Testbed 2/RegionProperties.h | UTF-8 | 1,373 | 2.640625 | 3 | [] | no_license | /***
* millipede: RegionProperties.h
* Copyright Stuart Golodetz, 2009. All rights reserved.
***/
#ifndef H_MILLIPEDE_REGIONPROPERTIES
#define H_MILLIPEDE_REGIONPROPERTIES
#include <vector>
#include "VoxelProperties.h"
namespace mp {
struct RegionProperties
{
int area;
double meanGreyValue;
... | true |
1307acadecf4f55f98ac0f82ed2bffaef7e8acfb | C++ | hmc-cs-jamelang/hmc-tessellate | /src/utilities.hpp | UTF-8 | 648 | 2.78125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <iostream>
#include <sstream>
#include <random>
namespace hmc { namespace utilities {
std::default_random_engine random_generator;
void set_random_state_true_random()
{
random_generator.seed(std::random_device{}());
}
std::string get_random_state()
{
std... | true |
d9d683c142891233db0e867952a330c2e465bbf5 | C++ | yami/DBricks | /src/util/string.hxx | UTF-8 | 351 | 2.703125 | 3 | [] | no_license | #ifndef STRING_HXX
#define STRING_HXX
#include <cstring>
namespace util {
inline bool string_equal(const char* s1, const char* s2)
{
using namespace std;
return !strcmp(s1, s2);
}
inline bool string_iequal(const char* s1, const char* s2)
{
using namespace std;
return !strcasecmp(s1, s2);
}
} // na... | true |
d3d43bac054bba82dac5b9d177d5e3de69f2bfc9 | C++ | JerryTheUser/Leetcode | /Letter_Combinations_of_a_Phone_Number.cpp | UTF-8 | 1,180 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
class Solution {
public:
vector<string> letterCombinations(string digits) {
if(digits.size() == 0)
return vector<string>();
unordered_map<char, std::string> table {{'2',"abc"}, {'3',"def"}, {'4', "ghi"},... | true |
65eac87dccbe9205704353fbfb504c38ccc86614 | C++ | kgrojas/MI_Proyecto | /main.cpp | UTF-8 | 4,932 | 3.1875 | 3 | [] | no_license | /* Un ciclista desea obtener una aplicacion que le permita obtener datos estadísticos sobre sus*/
// entrenamientos con el fin de mejorar en su actividad.
// El ciclista nos cuenta que registra una cantidad aleatoria de vueltas, que elige también de forma
// aleatoria, de las 20 vueltas que realiza en cada entrenamient... | true |
26eb913dc21e432e7cccde39e335f8ea662b9673 | C++ | Pothulapati/competitive-practice | /SMARTINTERVIEWS/missing.cpp | UTF-8 | 360 | 2.59375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin >> T;
while(T--)
{
int i,n,sum;
cin >> n;
sum = ((n+1)*(n+2))/2;
int a;
int ssum = 0;
for(i=0;i<n;i++)
{
cin >> a;
ssum += a;
}
cout << su... | true |
23cd6c2a4460aca4e3663c620300aaed194972e9 | C++ | caiopngoncalves/uri | /1911.cpp | UTF-8 | 578 | 2.65625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
map<string ,string > m;
int diff(string &a, string &b)
{
int dif = 0;
for (int i = 0 ; i < min(a.size(), b.size()); ++i)
{
if (a[i] != b[i]) ++dif;
}
return dif + abs(a.size() - b.size());
}
int main()
{
int n, m1;
string s1, s2;
int roubou;
while (cin >> n... | true |
d05668492a90f84dcda05e61b80a99fcb1f15723 | C++ | JpHu2017/gof_pattern | /apps/abstract_factory/include/laptop.h | UTF-8 | 486 | 2.5625 | 3 | [] | no_license | #ifndef GOF_PATTERN_LAPTOP_H
#define GOF_PATTERN_LAPTOP_H
#include <memory>
#include <string>
#include "cz_def.h"
namespace gof {
class CZ_EXPORTS Laptop {
public:
typedef std::shared_ptr<Laptop> Ptr;
Laptop();
//use keyword 'virtual' to make that subclass of Computer could be destructed
vir... | true |
0f7a5ea27785f9b414852ae2b7c8c5926c72d859 | C++ | ManuelSch/LastMechStanding | /LastMechStanding/LastMechStanding/Util/Shader.cpp | UTF-8 | 1,851 | 3.0625 | 3 | [] | no_license | #include "Shader.h"
Shader::Shader(const string & vertexShaderFilePath, const string & fragmentShaderFilePath) {
// create shader program:
shaderProgram = glCreateProgram();
// load shader source code:
loadShader(vertexShaderFilePath, GL_VERTEX_SHADER, vertexShader);
loadShader(fragmentShaderFilePath, GL_FRAGME... | true |
5d72786bfd3aaa8c760a0b9fa3f5ef19c092bd90 | C++ | DVDemon/mai_oop | /Example75_SimpleAllocator/TAllocationBlock.h | UTF-8 | 567 | 2.546875 | 3 | [] | no_license | /*
* File: TAllocationBlock.h
* Author: dvdemon
*
* Created on July 28, 2015, 9:17 AM
*/
#ifndef TALLOCATIONBLOCK_H
#define TALLOCATIONBLOCK_H
#include <cstdlib>
class TAllocationBlock {
public:
TAllocationBlock(uint64_t size,uint64_t count);
void *allocate();
void deallocate(void *pointer);
... | true |
142ad8f42f49862413971fdd022aaaa1e286abb4 | C++ | Vild/testbench | /gl_testbench/Vulkan/VertexBufferVK.cpp | UTF-8 | 3,020 | 2.796875 | 3 | [] | no_license | #include "VertexBufferVK.h"
#include "VulkanRenderer.h"
#include "../IA.h"
#include "MeshVK.h"
VertexBufferVK::VertexBufferVK(VulkanRenderer* renderer, size_t size) : _renderer(renderer), _device(renderer->_device), _size(size) {}
VertexBufferVK::~VertexBufferVK() {
_device.destroyBuffer(_buffer);
_device.freeMemor... | true |
d34cd2219fe328a80ad17939a446434e4dffbeca | C++ | ayang55/Lab-3 | /prog5.cc | UTF-8 | 668 | 3.703125 | 4 | [] | no_license | /*
* @file: prof5.cc
* @author: Andrew Yang
* @date: 9/8/2020
* @brief This is our 3rd lab, and for this program you compare the size of two intergers.
*/
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
double ctof; // equivalent Celsius temperature
double ftoc; // equivalent Fahrenh... | true |
681dd7c5cbf2e17039fbc702496554fd3ccdab90 | C++ | ElementAyush/Code | /OnlineJudges/codeshef/New folder/SPELLBOB.cpp | UTF-8 | 1,249 | 2.84375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std ;
int main()
{
int test_case ;
cin >> test_case ;
for(int i = 0 ; i < test_case ; i++)
{
string s1 , s2 ;
cin >> s1 >> s2 ;
if(s1 == "bob" || s2 == "bob")
{
cout << "yes" << "\n" ;
continue ;
}
int countb = 0 , counto = 0 , counta = 0;
for(int j... | true |
7f9798aab9ddcc21f5add89d991ee136abd820df | C++ | andrei828/CPP_Projects | /OOP_Project_Company/Director.hpp | UTF-8 | 704 | 2.96875 | 3 | [] | no_license | #ifndef _INCL_DIRECTOR
#define _INCL_DIRECTOR
#include "Dependencies.hpp"
#include "Personnel.hpp"
class Director: virtual public Personnel {
protected:
double Bonus;
public:
virtual double get_salary(Movie *);
/* constructors */
Director(uint Id, std::string Name, double Salary,
std::vector< std::pair< std::... | true |
aefe4061de2eefe3580c8d14e2f83d795959848e | C++ | whztt07/acm | /uva/489/Sov_03_22_2012.cpp | UTF-8 | 777 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
void clean(string &s)
{
for (int i = 0; i < s.size(); i ++)
{
if (s.find(s[i]) != i)
{
s.erase(s.begin()+i);
i --;
}
}
}
int main()
{
int n;
while (cin>>n && n!=-1)
{
string hang,cho;
cin >> hang >> cho;
clean(hang);
clean(cho);
in... | true |
36ca7c9856fd880c03077787f2c19182dc250daa | C++ | TuringJuniors/Fortran | /SmartHome/smartLamp/µC(Arduino)/Smart_lamp_arduino/Smart_lamp_arduino.ino | UTF-8 | 1,464 | 2.84375 | 3 | [] | no_license | #include <Wire.h>
using namespace std;
#define ON 0
#define OFF 1
#define BLINK 2
#define LED 7
class controlHub{
};
class smartLamp
{
public:
smartLamp(controlHub* newController);
int state=1;
void blink();
void on();
void off();
privat... | true |
1da5443e3f74f4aaa59e933f208021dde8c3d084 | C++ | nur-alam/CrackingTheCodingInterview | /Array Problems/Maximum Subarray/StartEndIndexesOfMaxSubArr.cpp | UTF-8 | 773 | 3.25 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int* maxSubArray(vector<int>& nums) {
int size = nums.size();
int curmax = 0;
int maxsum = INT_MIN, i = -1;
int startIndex = 0, endIndex = 0, tempIndex = 0;
while(++i < size) {
curmax = max(nums[i], curmax + nums[i]);
if(nums[i] >= curm... | true |
a4734d832f543d27d7d5b342e8cee9c6f122fae2 | C++ | RazrFalcon/ttf-explorer | /src/tables/kern.cpp | UTF-8 | 16,959 | 2.515625 | 3 | [
"MIT"
] | permissive | #include <bitset>
#include "src/algo.h"
#include "tables.h"
struct OpenTypeCoverage
{
static const int Size = 1;
static const QString Type;
static OpenTypeCoverage parse(const quint8 *data)
{ return { data[0] }; }
static QString toString(const OpenTypeCoverage &value)
{
std::bitset<8... | true |
10f1efb2a42667e002ca36b360a568b092261f96 | C++ | nzombiegaming/Learning-C-Luca-to-Pro | /L5switch.cpp | UTF-8 | 1,608 | 4.3125 | 4 | [] | no_license | /*
Today we are going to be talking about switch statements. Switch statements are important to clean programming.
Switch statements allow you to use the versitility of if statements but without all of the nested if's.
Switch statements look better and are easy to modify if you need to change something later on (yo... | true |
428ba57ca5aebc8531bd050e01b5729e0f5aaa65 | C++ | qgpmztmf/LeetCode | /112.cpp | UTF-8 | 1,306 | 3.453125 | 3 | [] | no_license | // 112. Path Sum
/**
* 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:
bool hasPathSum(TreeNode* root, int sum) {
if(!root){
... | true |
6dff15ae47793604a490b1679f28085fe3dd7279 | C++ | andreifreddmironov/TcpServer | /tcpthread.cpp | UTF-8 | 2,468 | 2.625 | 3 | [] | no_license | #include "tcpthread.h"
TcpThread::TcpThread(QObject *parent, int socketDescriptor) : QObject(parent),
m_socketDescriptor(socketDescriptor)
{
}
TcpThread::~TcpThread()
{
qDebug() << "TcpThread exit";
if(m_tcpSocket->isOpen())
{
m_tcpSocket->close();
}
delete m_tcpSocket;
m_tcpSocke... | true |
2774ab552d5c0b8df47ff340c70e9c3592c7c001 | C++ | cerkiewny/exercises | /codechef/august2015/transform.cpp | UTF-8 | 732 | 3.265625 | 3 | [] | no_license | #include<vector>
#include<iostream>
using namespace std;
int main(){
int ncases;
cin >> ncases;
for (int i =0 ; i < ncases; i++){
string curs;
cin >> curs;
vector<char> ops;
for(int i = 0; i < curs.size(); i++){
char cur = curs[i];
if(cur == '('){
ops.push_back(cur);
}... | true |
2d54d3e3e87dd7b7fc21057c452df0e1dfc35e82 | C++ | Valtis/Lang | /AsmVM/src/MemoryManager.cpp | UTF-8 | 2,692 | 3.3125 | 3 | [] | no_license | #include "MemoryManager.h"
#include <cstdlib>
#include "VM.h"
#define GC_MIN_THRESHOLD 20
MemoryManager::MemoryManager() : m_gcThreshold(20), m_allocatedMemorySizeInBytes(0)
{
}
MemoryManager::~MemoryManager()
{
for (auto &ptr : m_allocatedPointers)
{
free(ptr.ptr);
}
}
VMObject MemoryManager::Allocate(VM *v... | true |
3ab2530f658e197b8ecf2f2435d504aaf90ac5bf | C++ | goodcheney/Arduino-Profile-Examples | /libraries/Dragino/examples/IoTServer/Emoncms/emoncms_download/emoncms_download.ino | UTF-8 | 3,148 | 2.765625 | 3 | [] | no_license | /*
Downlink Example for Emoncms Server
Arduino Requirements:
* Dragino LG01
* Arduino 1.5.4 IDE or newer
Network Requirements:
* Router with Wi-Fi
* DHCP enabled on Router
Created: December 20, 2016 by Dragino (http://wiki.dragino.com)
by Dragino Technology(hhtp://www.dragino.com)
*/... | true |
2d0f7155a388c3ec1d6c20417930c166e69d161f | C++ | Salmanius/CS253 | /Assignments/PA9/Image.h | UTF-8 | 746 | 2.796875 | 3 | [] | no_license | #ifndef IMAGE_INCLUDED
#define IMAGE_INCLUDED
#include <iostream>
using std::cout;
using std::cerr;
using std::endl;
#include <string>
using std::string;
using std::stoi;
#include <fstream>
using std::ifstream;
#include <vector>
using std::vector;
#include <math.h>
using std::floor;
class Image
{
public:
Image(... | true |
11e91a7fe288da38803542e4b541936188ca5ff3 | C++ | seansio1995/MISC | /prioority_queue.cpp | UTF-8 | 262 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
int main(){
priority_queue<int> myque;
mypq.push(30);
mypq.push(100);
mypq.push(25);
mypq.push(40);
while(!myque.top()){
cout<<myque.top()<<endl;
myque.pop();
}
return 0;
}
| true |
e2bd9bc63899026f0cc518aee224ca6760bfc806 | C++ | B0TJerry/Projects | /c++/tests/test.cpp | UTF-8 | 947 | 2.71875 | 3 | [] | no_license | #include "test.hpp"
int main() {
long double a,b;
char mode;
char op;
long double ans;
cin >> mode;
while(cin >> a >> op >> b) {
switch(op) {
case '+':
ans = add(a,b);
cout << a << " + " << b << " = " << ans << '\n';
hist(a,op,b,ans);
break;
case '-':
ans = sub(a,b);
cout <<... | true |
38bf3e7f5a4b0618a769cff31355462043b627bd | C++ | matinjun/mtjrandom | /main.cpp | UTF-8 | 268 | 2.75 | 3 | [] | no_license | #include "random_method.hpp"
#include <iostream>
using namespace std;
int main() {
int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
mtjrandom::randmize_array(a, 10);
for (int i = 0; i < 10; i++) {
std::cout << a[i] << " ";
}
std::cout << std::endl;
return 0;
}
| true |
054f04dd94c83751ccf7d8275ba29ed6dd012f30 | C++ | Didgy74/DEngine | /any/include/DEngine/Gui/Grid.hpp | UTF-8 | 1,946 | 2.671875 | 3 | [] | no_license | #pragma once
#include <DEngine/Gui/Widget.hpp>
#include <DEngine/Std/Containers/Box.hpp>
#include <vector>
namespace DEngine::Gui
{
class Grid : public Widget
{
public:
u32 spacing = 10;
void SetDimensions(int width, int height);
void SetWidth(int newWidth);
[[nodiscard]] int GetWidth() const noexcept;
... | true |
d7ca9f9e922170e9b2da093b4344845edc0c2b73 | C++ | Aayushshah196/DataStructure-Algorithms | /spanningtree/Edge.h | UTF-8 | 428 | 2.765625 | 3 | [] | no_license | #pragma once
#include "Node.h"
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
class Edge
{
private:
Node* node1;
Node* node2;
sf::RectangleShape rect;
float weight;
public:
Edge();
Edge(Node* node1, Node* node2);
void draw(sf::RenderWindow& window);
void setNodes(Node* node1, Node* node2);
float getW... | true |
80ee69d4c6f3b65c23f98bbe097f96fd9fb172f0 | C++ | HarshitGuptaa/DS-Algo | /lecture_001/loops/odd_even.cpp | UTF-8 | 313 | 2.984375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(int args, char **argv){
cout<<"Even :";
for(int i=1;i<=10;i++){
if(i%2==0){
cout<<" "<<i;
}
}
cout<<"\nOdd :";
for(int i=1;i<=10;i++){
if(i%2!=0) {
cout<<" "<<i;
}
}
} | true |
42a07711d37162ac5a46c5f1ca8863b5d495f6f1 | C++ | ercecan/BLG335E | /project4/submit.cpp | UTF-8 | 11,812 | 3.375 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
using namespace std;
struct Keys
{
int x;
int y;
char z;
Keys(){};
Keys(int x_, int y_, char z_)
{
x = x_;
y = y_;
z = z_;
}
void pr... | true |
c791da5a69b3096cec56af3c088968bb8b647667 | C++ | DreamBlack/pat | /first/Median.cpp | GB18030 | 1,092 | 3.234375 | 3 | [] | no_license | #include<stdio.h>
long num1[1000000];
long num2[1000000];
int main(){
/*
Ŀ⣺Укϲм
˼·
1ÿʼö̬滮ķ˵ʵDz̫ᡣʱҪԾͨ˫ָķ
2˫ָʱһ鴦µһԵ
3һҪעǣ1000000Ϊȫֱᱨ
*/
int n,m;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%ld",&(num1[i]));
}
scanf("%d",&m);
for(int i=0;i<m;i++){
scanf("%ld",&(num2[i]));
}
int i=0,j=0,cnt=0;
int tar... | true |
52343ce958170244c926fb027b67fe63d46076ec | C++ | thubk/idps | /Masters.cpp | UTF-8 | 922 | 2.765625 | 3 | [] | no_license | #include "Masters.h"
void Masters::updatePriorCounter(double num) {
this->prior_counter = num;
}
void Masters::setV(double v) {
this->v = v;
}
void Masters::setVDelta(double v_delta){
this->v_delta = v_delta;
}
void Masters::setVBackup(double v_backup) {
this->v_backup = v_backup;
}
void Masters::setExV(double ex... | true |
7139a180e330d3859a0db39351ac183e84b61f32 | C++ | devonrball/Assignment4 | /DLinkedList.h | UTF-8 | 4,132 | 3.859375 | 4 | [] | no_license | #include <string>
#include "Node.h"
using namespace std;
template <typename T>
class DLinkedList
{
private:
Node<T> *front;
Node<T> *back;
unsigned int size;
public:
DLinkedList();
//DlinkedList(Node<T> *someNode);
DLinkedList(T data);
~DLinkedList();
void inse... | true |
44a12a105987fd0cd28afd4b4a639b5a66093be2 | C++ | wbrbr/raytracer | /src/triangle.cpp | UTF-8 | 1,681 | 3.015625 | 3 | [] | no_license | #include "shape.hpp"
#include "mesh.hpp"
std::optional<float> Triangle::intersects(Ray ray) const
{
glm::vec3 v0 = vertex(0).position;
glm::vec3 v1 = vertex(1).position;
glm::vec3 v2 = vertex(2).position;
float a,f,u,v;
glm::vec3 edge1 = v1 - v0;
glm::vec3 edge2 = v2 - v0;
glm::vec3 h = glm... | true |
c6e8442293dcad4d8227a3d4fced8f508b1dc84f | C++ | mojoe12/UVa | /synchingsignals.cpp | UTF-8 | 882 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, char *argv[]) {
string s;
getline(cin, s);
for (int c = 1; s != ""; c++) {
int size = (s.length() + 1) / 3;
vector<int> cycles (size);
for (int i = 0; i < size; i++) {
cycles[i] = 10 * (s[3*i] - '0') + s[3*i+... | true |
97c7baf1346c7d3598914e6d82e65d6a7690e662 | C++ | CESARIUX2596/Computer-Vision-Extended | /Tests/OpenCVTest/Source.cpp | UTF-8 | 1,844 | 3.125 | 3 | [] | no_license | #include<opencv2/opencv.hpp>
#include<iostream>
using namespace std;
using namespace cv;
int main(int argc, char** argv)
{
//Show Image
Mat img = imread("lena.jpg");
if (img.empty())
{
cout << "Could not open or find the image" << endl;
cin.get(); //wait for any key press
return -1;
}
namedWindow("image",... | true |
0014cade09e955527877e758b88feb67a2cb5dbf | C++ | obryanlouis/cs_143_group_project | /Routing/RoutingTable.h | UTF-8 | 1,299 | 2.984375 | 3 | [] | no_license | // RoutingTable.h
#ifndef ROUTING_TABLE_H
#define ROUTING_TABLE_H
#include "Link.h"
#include <map>
#include <cstddef>
#include <utility>
class Link;
class Node;
class RoutingTable
{
private:
std::map<Node*, std::pair<double, Link*> > mapping;
// The map containing the routing table information. Maps from... | true |
f852e973200d0a936936f44ff97c8e7caa7dad11 | C++ | neharathig/All_Cpp | /82FibbonicciRecursive.cpp | UTF-8 | 227 | 3.140625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int Fibb(int n)
{
if (n==0 || n==1)
{
return n;
}
return Fibb(n-1)+Fibb(n-2);
}
int main()
{
int n;
cin>>n;
cout<<Fibb(n)<<endl;
return 0;
} | true |
0d0b46ca90c272d0cffa6692ec79e4a74efb7e7b | C++ | sandral/numeeriset_menetelmat | /ratkaisut1/h1t4.cpp | UTF-8 | 692 | 3.21875 | 3 | [] | no_license | //Tehtävä4
#include <iostream>
#include <math.h>
using namespace std;
double coeff(double x[], double y[], int n)
{
double a;
double b;
double t1;
double t2;
double t3;
double t5;
for (int i=0; i<n; i++)
{
t1 += x[i]*y[i];
t2 += x[i];
t3 += y[i];
}
dou... | true |
80f4f4e40f7dd5dae8fa4f62c5e9275f5b34c880 | C++ | simonusher/genetic-programming-challenge | /Win32Project1/Node.h | UTF-8 | 1,378 | 2.859375 | 3 | [] | no_license | #pragma once
#include <string>
#include <cstdlib>
#include <vector>
#include <cmath>
#include "constants.h"
const enum NodeType {
OperationSum,
OperationSub,
OperationMult,
OperationDiv,
OperationSin,
OperationCos,
Constant,
Variable
};
const int NUMBER_OF_OPERATIONS = 6;
const int NUMBER_OF_TYPES = 8;
const... | true |
c1c63b96531ecfef6fb3f2c62f3b71d21ae3ed53 | C++ | LeeGyeongHwan/Algorithm_Student | /acm_9286.cpp | UTF-8 | 593 | 2.6875 | 3 | [] | no_license | /*
ACMICPC
문제 번호 : 9286
문제 제목 : Gradabase
풀이 날짜 : 2020-07-27
Solved By Reamer
*/
#include <iostream>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int testCase, student, tmp;
cin >> testCase;
for (int i = 0; i < testCase; i++)
{
... | true |
b9cc0ab203596f391b45bdfa646c833da0a9b559 | C++ | Singhm35/INFO450GUESS | /Guess Project/guess.cpp | UTF-8 | 2,681 | 3.40625 | 3 | [] | no_license |
#include <iostream>
#include <time.h>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
{
cout << " ***************************************\n";
cout << " ** Find MORE Gold! **\n";
cout << " ** **\n";
cout << " ** You have 5 gues... | true |
fb8e996e3dfb447a6997a742798cbbda26cac2e7 | C++ | Abrantedr/Practicas-Informatica-Industrial-4-GIEIA | /Practica 2/clienteTCP_noError.cpp | UTF-8 | 1,285 | 3.3125 | 3 | [
"MIT"
] | permissive | //Ejemplo cliente eco UDP. Sin control de errores.
//Autor: Alberto Hamilton Castro
// 2019-10-23
#include <iostream> // std::cout, std::endl
#include <arpa/inet.h> // htons(), htonl(), etc.
#include <sys/socket.h> // socket(), bind(), etc.
#include <unistd.h> // close()
#define SERVER "127.0.0.1"
#define B... | true |
3fbd4c19386b5f4f5bb4cd7961ef74effc9f5a8d | C++ | sangwe11/ray-tracing-in-one-weekend-cpp | /src/main.cpp | UTF-8 | 4,643 | 2.703125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <fstream>
#include "common.h"
#include "camera.h"
#include "color.h"
#include "hittable_list.h"
#include "sphere.h"
#include "material.h"
double hit_sphere(const point3& center, double radius, const ray& r)
{
vec3 oc = r.origin() - center;
auto a = r.direction().length_squared();... | true |
e190c8a40b3e1cce7aae2ba44a5b8feb1182f088 | C++ | soyaoki/CarND-Kidnapped-Vehicle-Project | /src/particle_filter.cpp | UTF-8 | 11,163 | 2.703125 | 3 | [
"MIT"
] | permissive | /**
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: Tiffany Huang
*
* Improved on Mar 17, 2019
* Author: Soya AOKI
*/
#include "particle_filter.h"
#include <math.h>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <random>
#include <string>
#include <vecto... | true |
b6fd96f91ea11d3ddc7d8e064ba08050a9fab013 | C++ | jeonyeohun/PS-With-CPP | /BOJ/P2110_InstallRouter.cpp | UTF-8 | 1,026 | 3.171875 | 3 | [] | no_license | #include <cstdio>
#include <set>
using namespace std;
set<int> houses;
int N, C;
int installRouter(int interval)
{
int count = 1;
int point = *(houses.begin()) + interval;
while (true)
{
auto iter = houses.lower_bound(point);
if (iter != houses.end())
{
count++;
... | true |
85894fa89d180a885b1f15bee8af7d3bc8cfed81 | C++ | danthinnee/matrix-multi-practice | /Sequential/Programs/matrix_timer.cpp | UTF-8 | 2,082 | 3.15625 | 3 | [] | no_license | #include<fstream>
#include<iostream>
#include<ctime>
#include<cstdlib>
#include<sstream>
using namespace std;
const int default_dim = 10000;
int numthreads = 1;
int rows1 = 10000;
int cols1 = 10000;
int rows2 = 10000;
int cols2 = 1;
int matrix1[default_dim][default_dim];
int matrix2[default_dim][1];
int product[default... | true |
4ca946609a92702a1164f2ef29b131e789da5efa | C++ | thaoc/guessinggame | /guessgame.cpp | UTF-8 | 597 | 3.28125 | 3 | [] | no_license | #include<iostream>
#include<stdlib.h>
#include<time.h>
using namespace std;
// nelsoncs02's comment!
int main(){
srand(time(NULL));
int number = rand()%100+1;
int guess;
bool correct = false;
int tries = 0;
cout << "Thinking of a number (1-100). Guess?";
while(!correct){
cin >> guess;
t... | true |
13299b39b7633fc3e54cce109f67867c40d785fb | C++ | kkevn/ACER_Benchmark | /benchmarks/saxpy/saxpy_c.cpp | UTF-8 | 2,844 | 3.859375 | 4 | [] | no_license | /* Single-Precision AX+Y in C/C++
*******************************************************************
* Description:
* Populate two vectors each of size N. In the first vector,
* multiply each element by some constant scalar and then sum
* this product with with the elment at same index in other
* vector. ... | true |
678efb2014d990f47ae83289d957651ea8a3f682 | C++ | namhong2001/Algo | /aoj/fortress.cpp | UTF-8 | 2,505 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <functional>
using namespace std;
struct Circle {
int x;
int y;
int r;
int height = 0;
Circle* parent;
vector<Circle*> children;
int getHeight() {
if (height > 0) return height;
if (chil... | true |
89a69001e02cf960c3922dffe17e2b0586a0e512 | C++ | THavart/Computer-Engineering-Technology | /C++/Graphics_Vectors + Shapes/VectorGraphic.h | UTF-8 | 358 | 2.609375 | 3 | [] | no_license | // VectorGraphic.h
#ifndef VECTORGRAPHIC_H
#define VECTORGRAPHIC_H
#include <vector>
using namespace std;
#include "GraphicElement.h"
class VectorGraphic : public vector<GraphicElement>
{
public:
VectorGraphic();
~VectorGraphic();
void AddGraphicElement();
void DeleteGraphicElement();
friend ostream& operator<<... | true |
1e4a3f6c06b24c9d0a61ad761a8acfc0156eefc1 | C++ | mcmiloy/cpp_primer | /c3/vector2.cpp | UTF-8 | 418 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using std::string;
using std::vector;
int main(){
vector<unsigned> scores(11, 0);
unsigned grade;
while(std::cin >> grade){
if (grade <= 100)
++scores[grade/10];
// same as
// auto ind = grade/10;
// scores[ind] = score... | true |
5ad8c30434c087ff0b14fe6d612f65ed3315d7b2 | C++ | byn52602/RAII-Net | /src/Ability.h | UTF-8 | 488 | 2.71875 | 3 | [
"MIT"
] | permissive | #ifndef ABILITY_H
#define ABILITY_H
#include <string>
enum Abilities {LinkBoost = 'L', Firewall = 'F', Download = 'D', Polarize = 'P', Scan = 'S', Sand = 'N', Portal = 'O', Strengthen = 'R'} ;
class Ability{
private:
int ID;
Abilities name;
bool isUsed;
public:
Ability(char code, i... | true |
b9cc70d4a3c1a6d7cb85b602dd5d17764b9bb176 | C++ | windystrife/UnrealEngine_NVIDIAGameWorks | /Engine/Source/ThirdParty/PhysX/APEX_1.4/shared/general/meshimport/include/utils/MiInparser.h | UTF-8 | 6,473 | 2.703125 | 3 | [
"MIT",
"LicenseRef-scancode-proprietary-license"
] | permissive | /*
* Copyright (c) 2008-2017, NVIDIA CORPORATION. All rights reserved.
*
* NVIDIA CORPORATION and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto. Any use, reproduction, disclosure or
* distribution of this so... | true |
f98a66f826ca48acc6de7673465af3a1deeaa6b5 | C++ | chingpaq/CorbaTask | /P5_CorbaTestTask/Common/src/MathFactory.cpp | UTF-8 | 164 | 2.703125 | 3 | [] | no_license | float Plus (int a, int b){return a+b;}
float Minus (int a, int b){return a-b;}
float Multiply (int a, int b){return a*b;}
float Divide (int a, int b){return a/b;}
| true |
2438c1f68e0083a6aabbe43001f2bf54f022961a | C++ | dotnet/runtime | /src/coreclr/pal/tests/palsuite/c_runtime/errno/test2/test2.cpp | UTF-8 | 1,871 | 2.796875 | 3 | [
"MIT"
] | permissive | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/*============================================================================
**
** Source: test2.c
**
** Purpose: Test that errno is 'per-thread' as noted in the documentation.
*... | true |
1ad837f95ff06fb0c4a5d0bd9dcf8a3a47dee862 | C++ | sienaiwun/MAGE | /MAGE/MAGE/src/system/system_time.hpp | UTF-8 | 2,657 | 2.859375 | 3 | [] | no_license | #pragma once
//-----------------------------------------------------------------------------
// Engine Includes
//-----------------------------------------------------------------------------
#pragma region
#include "platform\windows.hpp"
#pragma endregion
//---------------------------------------------------------... | true |
ec7ce23cc7e152f83ae6ebf93df6107a1dcebaeb | C++ | brunolaporais/blprecsys | /recsys_methods/colaborative_filtring/ItemBased.cpp | UTF-8 | 2,206 | 2.578125 | 3 | [] | no_license | /*
* ItemBased.cpp
*
* Created on: Sep 24, 2015
* Author: brunolaporais
*/
#include "ItemBased.h"
ItemBased::ItemBased(Dataset &d):data(d) {
// TODO Auto-generated constructor stub
}
ItemBased::~ItemBased() {
// TODO Auto-generated destructor stub
}
void ItemBased::predictTarget(int nbNumbers, int mi... | true |
78d321306d7df503b5944ee685929f67a1f87972 | C++ | xusiwei/leetcode | /Algorithms/BinaryTreeZigzagLevelOrderTraversal/binaryTreeZigzagLevelOrderTraversal.cc | UTF-8 | 2,722 | 4.03125 | 4 | [] | no_license | /*
copyright xu(xusiwei1236@163.com), all right reserved.
Binary Tree Zigzag Level Order Traversal
=========================================
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
For ex... | true |
3b8728e0c2123b41fb3f03bf4678fce0afe4ea0a | C++ | lukedan/DoodleEngine | /Engine/BinarySearchTree.h | UTF-8 | 19,044 | 2.703125 | 3 | [] | no_license | #pragma once
#include <tchar.h>
#include <functional>
#include "Common.h"
#include "Math.h"
#include "ObjectAllocator.h"
#include "List.h"
namespace DE {
namespace Core {
namespace Collections {
template <typename KeyType, typename ValueType> struct KeyValuePair;
template <typename KeyType, typename ValueTy... | true |
0f4b0a6248281769746d5e9dc8d88a0bdc870903 | C++ | dmlicht/Swell-Synth | /rand_table.cpp | UTF-8 | 382 | 2.671875 | 3 | [] | no_license | #include "rand_table.h"
#include "wavetable.h"
#include <cmath>
#include <iostream>
rand_table::rand_table(): wavetable::wavetable(){
fill_table();
}
rand_table::rand_table(int size): wavetable::wavetable(size){
fill_table();
}
void rand_table::fill_table(){
srand(time(NULL));
for (int i = 0; i < length; ++i... | true |
2e7f10b4d3c996f614c9e4fda5c02baaa6473da7 | C++ | Phaeon/QtWarriors | /QtWarriors/Models/Pawns/super_attack_decorator.h | UTF-8 | 476 | 2.53125 | 3 | [] | no_license | #ifndef SUPER_ATTACK_DECORATOR_H
#define SUPER_ATTACK_DECORATOR_H
#include "powerdecorator.h"
/**
* @brief The Super_Attack_Decorator class
*/
class Super_Attack_Decorator : public Power_Decorator
{
public:
Super_Attack_Decorator();
Super_Attack_Decorator(std::shared_ptr<Pawn>);
Super_Attack_Decorator(c... | true |
16e5cd5106a687c1a35f4cdd2e5099dd17453b91 | C++ | nexus6-haiku/dontworry | /Extra/Exemples/Modifications.cpp | UTF-8 | 5,034 | 2.703125 | 3 | [
"MIT"
] | permissive | /*
* Test primitif des classes CS
*
*
*/
#include <DataIO.h>
#include <Entry.h>
#include <Directory.h>
#include <Roster.h>
#include <Path.h>
#include <String.h>
#include <stdio.h>
#include "Modifications.h"
#include "CSLibrary.h"
#include "CSClass.h"
#include "CSMethod.h"
#include "CSVariable.h"
int main()
{
(... | true |
8196210596553af4249a4cf52b38dd13308b08b2 | C++ | pavellebedev7/stc | /1/main.cpp | UTF-8 | 3,156 | 3.8125 | 4 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
using namespace std;
const int CurrentYear = 2021;
const int n = 5;
struct Citizen{
string LastName;
string Residence;
int DateOfBirth;
};
void PrintFile(Citizen *citizens){
for(int i = 0; i < n; i++){
cout << citizens... | true |
2092752f4ea6f8985dfcef695d46dc13300ae8d7 | C++ | Tudor67/Competitive-Programming | /LeetCode/Problems/Algorithms/#1719_NumberOfWaysToReconstructATree_sol1_dfs_and_greedy_and_sort_O(N^2+ElogE)_time_O(N+E)_extra_space_1056ms_123MB.cpp | UTF-8 | 2,745 | 3.046875 | 3 | [
"MIT"
] | permissive | class Solution {
private:
using Graph = vector<vector<int>>;
bool contains(const vector<int>& A, const vector<int>& B){
// return true if vector A (with unique elements)
// contains all elements of vector B (with unique elements)
if(A.size() < B.size()){
... | true |
1df84c4f91330b1a912b38473191cfca19333724 | C++ | Fredrik-G/oru-freguh131 | /DoA/Forward_List/main.cpp | ISO-8859-1 | 1,548 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <clocale>
#include <string>
#include "forward_list.h"
using namespace std;
int main()
{
//***********************************************
//COPY CONSTRUCTOR
forward_list<int> fl1,fl2,fl3;
for (int i = 1; i < 15; i++)
fl1.push_front(i);
forward_list<int> fl4(fl1);
co... | true |
a1d23a8a68ef1cba2243e11e68bb38fa716878f2 | C++ | hophacker/algorithm_coding | /POJ/1503/6974649_AC_0MS_200K.cpp | UTF-8 | 589 | 2.59375 | 3 | [] | no_license | #include<iostream>
#include<string.h>
#include<fstream>
#include<memory.h>
using namespace std;
int main()
{
//freopen("in.txt", "r", stdin);
int a[110];
memset(a, 0, sizeof(a));
char s[110];
while (scanf("%s", s) && strcmp(s, "0"))
{
int len = strlen(s);
for (int i = 1; i <= len; i++)
a[i] += (s[len-i] -... | true |
8ed1e7aeff84ebf0b6ae8290c7b3eb4cdf85dfe9 | C++ | Fairbrook/Panteon | /Proyecto_Panteon/include/Propiedades.h | UTF-8 | 1,169 | 2.59375 | 3 | [] | no_license | #ifndef PROPIEDADES_H
#define PROPIEDADES_H
#include <iostream>
#include <string.h>
#include <Propietarios.h>
class Propiedades
{
public:
Propiedades();
virtual ~Propiedades();
void setTamano(float);
void setLimite_personas(short int);
void setTipo(const char*);
v... | true |
00968bfda856785619a54459e32a2f5a2c379fab | C++ | Sambor33/StudyMake | /TablMarshCIpher/description.cpp | UTF-8 | 2,362 | 2.96875 | 3 | [] | no_license | #include "MyClass.h"
#include "Exception.h"
MarshCipher::MarshCipher (const wstring &wkey)
{
MyException::CheckKey(wkey);
key=stoi(wkey);
}
int MarshCipher::StrNum (const wstring &text)
{
double dkey=key,dsize=text.size(),dstr;
dstr=ceil(dsize/dkey);
int str = dstr;
return str;
}
int MarshCipher... | true |
e9e15d98677f90009c3e869c7d3c35cb36a9a361 | C++ | habara-k/ICPCLibrary | /test/geometry/2D_template/common_tangent.test.cpp | UTF-8 | 632 | 2.75 | 3 | [] | no_license | #define PROBLEM "https://onlinejudge.u-aizu.ac.jp/courses/library/4/CGL/7/CGL_7_G"
#define ERROR "1e-5"
#include "../../../lib/geometry/2D_template.cpp"
int main()
{
cout << fixed << setprecision(10);
double x1, y1, r1, x2, y2, r2;
cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
vector<Line> lines = common... | true |
b4ba28cb2744c334c51b0b752c0bc91c070f9a3e | C++ | i22bomui/IMC | /P1/practica1/practica1.cpp | UTF-8 | 2,459 | 2.953125 | 3 | [] | no_license | //============================================================================
// Introducción a los Modelos Computacionales
// Name : practica1.cpp
// Author : Pedro A. Gutiérrez
// Version :
// Copyright : Universidad de Córdoba
//=====================================================================... | true |
bf64ad80a417c2467c75fc8a7885f2d26269438d | C++ | drufino/minTLS | /tests/test_helpers.hpp | UTF-8 | 3,228 | 2.796875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | #ifndef test_helpers_hpp
#define test_helpers_hpp
#include <iostream>
#include <iomanip>
#include <cstring>
#ifndef _MSC_VER
#include <cxxabi.h>
#endif
#include <gtest/gtest.h>
#include <fstream>
#include <algorithm>
#include <stdint.h>
bool is_hex(char p);
std::ostream& operator<<(std::ostream & os, std::vector<uint8... | true |
aba7930cb8e4d044733bce8534eeeb85d3185b03 | C++ | sys-bio/Libstructural | /dependencies/libsbml-vs2017-release-32/include/sbml/Compartment.h | UTF-8 | 94,920 | 2.640625 | 3 | [
"BSD-2-Clause"
] | permissive | /**
* @file Compartment.h
* @brief Definitions of Compartment and ListOfCompartments
* @author Ben Bornstein
*
* <!--------------------------------------------------------------------------
* This file is part of libSBML. Please visit http://sbml.org for more
* information about SBML, and the lates... | true |
028228fa3421e3235d6e9a7171775500c2eed7da | C++ | baocl18ctt2/Book_OOP | /Oop/Admin.cpp | UTF-8 | 1,501 | 2.9375 | 3 | [] | no_license |
#include "Admin.h"
#include <iomanip>
Admin::Admin()
{
}
Admin::Admin(string kind, string account, string password, string name,float age)
{
mkind = kind;
mAccount = account;
mPassword = password;
mName = name;
mAge = age;
}
Admin::~Admin()
{
}
void Admin::read_1_information(ifstream& FileIn)... | true |
1bf5438613ffd433dc51ea5845703485a81161b5 | C++ | rodetas/vsss-rodetas-2017 | /src/utils/Manipulation.h | UTF-8 | 2,779 | 3.09375 | 3 | [] | no_license | #ifndef MANIPULATION
#define MANIPULATION
#include "../Header.h"
#include "Commons.h"
#include <fstream>
#include <ctime>
#include <iomanip>
using namespace rodetas;
class Manipulation{
private:
//variaveis de calibragem
vector<Hsv> colorsHSV;
vector<Rgb> colorsRGB;
Point point_cut_field_1;
Point point_cut_fie... | true |
b0e0640e6581382c912943b8ce3a18adb0f9b076 | C++ | Tifloz/Tek2 | /Piscine_CPP/cpp_d17_2018/ex02/main.cpp | UTF-8 | 1,531 | 2.9375 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2022
** cpp_d17_2018
** File description:
** Created by Florian Louvet,
*/
#include "Cesar.hpp"
#include "OneTime.hpp"
#include <string>
#include <iostream>
static void encryptString(IEncryptionMethod &encryptionMethod,
std::string const &toEncrypt
)
{
size_t len = toEncrypt.size();
... | true |
f9a8825301c0d29efdfb384a41097ec96519764f | C++ | tuananh100502/BT-code--week5 | /BT So nguyen to.cpp | UTF-8 | 331 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
int check (int n){
int count =0,i;
if(n<2) return 0;
if(n>=2){
for(i=2;i<=sqrt(n);i++){
if(n%i==0)
count+=1;
}
if(count==0) return 1;
else return 0;
}
}
int main(){
int n;
cin >> n;
int 1 = check (n);
cout << 1 << endl;
r... | true |
fd051a3d7455c658829ce0f72e334846fd8d2cad | C++ | amritsingh1097/OpenGL-Project | /Circle.h | UTF-8 | 1,505 | 2.640625 | 3 | [] | no_license | #ifndef CIRCLE_H
#define CIRCLE_H
#include "object.h"
#include <bits/stdc++.h>
#include <conio.h>
#include <gl/glut.h>
using namespace std;
class MidPoint_Circle : public Object
{
int shapeID;
public:
int centerX, centerY, clickedRadiusX, clickedRadiusY, radius;
// bool isFilled;
list< pair<int,... | true |
34a0f1a4c52c1c4447633712e8dbebfc89e7a2ec | C++ | pro1710/leetcode | /562_longest_line_of_consecutive_one_in_matrix.cpp | UTF-8 | 956 | 2.640625 | 3 | [] | no_license | class Solution {
public:
int longestLine(vector<vector<int>>& mat) {
struct Cell {
int hor;
int vert;
int diag;
int adiag;
};
vector<vector<Cell>> dp(mat.size()+2, vector<Cell>(mat[0].size()+2));;
int ans = 0;
for (int... | true |