Skip to content

Instantly share code, notes, and snippets.

View estebanz01's full-sized avatar
🤓
I'm scared, I see data everywhere.

Esteban Zapata Rojas estebanz01

🤓
I'm scared, I see data everywhere.
View GitHub Profile
@estebanz01
estebanz01 / Benchmark.rb
Last active August 29, 2015 14:19
Benchmark between concat function (that belongs to the Array class) and flat_map (that belongs to the Enumerable class)
require 'benchmark'
arr = 1_000.times.map { (1..100).to_a }
Benchmark.bm 10 do |x|
x.report('#concat') { arr.each_with_object([]) { |x, memo| memo.concat([1001]) } }
x.report('#flat_map') { arr.flat_map { |x| x << [1001] } }
end
@estebanz01
estebanz01 / splitdf.r
Created May 11, 2015 16:05
Split function to divide data frames in trainset & testset.
splitdf <- function(dataframe, seed=NULL) {
if (!is.null(seed)) set.seed(seed)
index <- 1:nrow(dataframe)
trainindex <- sample(index, trunc(length(index)/2))
trainset <- dataframe[trainindex, ]
testset <- dataframe[-trainindex, ]
list(trainset=trainset,testset=testset)
}
#Source of this function: http://www.gettinggeneticsdone.com/2011/02/split-data-frame-into-testing-and.html
// Example program
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Node {
public:
int data;
@estebanz01
estebanz01 / listaDobleLigadaCircular.cpp
Created September 20, 2017 02:21
Listas doblemente ligadas circulares
// Example program
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Node {
public:
int data;
@estebanz01
estebanz01 / PilaConListas.cpp
Last active October 4, 2017 02:24
Pilas implementadas con listas
// Example program
#include <iostream>
#include <string>
using namespace std;
class Elemento {
public:
int dato;
Elemento* siguiente;
@estebanz01
estebanz01 / Colas.cpp
Created October 13, 2017 01:58
Colas en C++
// Example program
#include <iostream>
#include <string>
using namespace std;
class Elemento {
public:
int dato;
Elemento* siguiente;
@estebanz01
estebanz01 / BinaryTree.cpp
Last active November 14, 2017 05:06
Binary tree with multiple operations
// Example program
#include <iostream>
#include <string>
using namespace std;
class Leave {
public:
int data;
Leave* left;
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
class Leave {
public:
int idNumber;
string name;
@estebanz01
estebanz01 / openpgp.txt
Created November 29, 2017 13:06
Identité reliée à OpenKeychain
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:d97d4f52f25a2a8d5e8874a061dea3a7bf851a0f]

Keybase proof

I hereby claim:

  • I am estebanz01 on github.
  • I am estebanz01 (https://keybase.io/estebanz01) on keybase.
  • I have a public key ASBd7idQRbpevu7U2Qy50R8IEZPCf9scloEWWPAoy-bLFwo

To claim this, I am signing this object: