Skip to content

Instantly share code, notes, and snippets.

View briandiaz's full-sized avatar
💭
💻 🌴 🇩🇴

Brian Díaz briandiaz

💭
💻 🌴 🇩🇴
View GitHub Profile

Keybase proof

I hereby claim:

  • I am briandiaz on github.
  • I am briandiaz (https://keybase.io/briandiaz) on keybase.
  • I have a public key ASAUpzo-iI3fyYtusLVGflj4EI4fQaGbha-oywpEwD-1PAo

To claim this, I am signing this object:

@briandiaz
briandiaz / get_url_params.js.coffee
Created May 29, 2015 17:27
Get url Params by a GET Request and then set the values in a form.
jQuery ->
set_employee_registration_params = () ->
url_params = window.location.search.replace("?","").split("&")
for params in url_params
key_value = params.split("=")
id = key_value[0]
value = key_value[1]
$(id).val(value)
@briandiaz
briandiaz / decision_trees.rb
Created May 26, 2015 21:08
Data Mining - Decision Tree Induction
def entropy(total, yes, no)
yes_div = (yes.to_f/total.to_f)
no_div = (no.to_f/total.to_f)
yes_log = (yes == 0 ) ? 0 : -((yes_div) * (Math.log2(yes_div)))
no_log = (no == 0) ? 0 : ((no_div) * (Math.log2(no_div)))
yes_log - no_log
end
def info(total, args, gain)
value = 0
@briandiaz
briandiaz / MaximunMinimunQuantityOfFolders.cs
Created June 3, 2014 03:22
Get the max number of folders to choose in a way that minimizes the quantity of folders that a person have to check.
/*
* Se tienen 3 personas y los siguientes archiveros:
* k = 3 personas
* Archiveros:
* 10 3 7 8 15 9 4 5
* Cuál es el número de folder máximo a escoger de forma tal que se minimice la cantidad
* de folders que cada persona debe chequear?
*
* Se puede tener:
* 13 30 18: Esto sale de 10+3,7+8+15,9+4+5
=begin
Author: Brian Díaz
=end
require 'prime'
File.open(ARGV[0]).each_line do |line|
if(line != nil)
/*
Author: Brian Díaz
*/
using System;
using System.Text;
using System.IO;
using System.Collections.Generic;
/*
Author: Brian Díaz
*/
using System;
using System.Linq;
using System.Text;
using System.IO;
@briandiaz
briandiaz / programmers_day.rb
Last active December 23, 2015 00:39
In honor to Programmer's Day
require 'date'
PROGRAMMERS_DAY_NUMBER = 0x00000100.to_i
module Programmers
def self.Day
(Date.today.yday() == PROGRAMMERS_DAY_NUMBER) ? "Happy Programmers Day!" : "Keep on Working"
end
end
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuperConjunto_Dinapoles
{
class Punto
{
@briandiaz
briandiaz / RapidaExponenciacion.cpp
Created June 7, 2013 00:11
Rápida Exponenciación
/*
* Entidad: Pontificia Universidad Católica Madre y Maestra
* Autor: Brian Díaz
* Fecha: 28/05/2013
*/
#include <iostream>
using namespace std;