Skip to content

Instantly share code, notes, and snippets.

View alejandrofloresm's full-sized avatar

Alejandro Flores alejandrofloresm

View GitHub Profile
@alejandrofloresm
alejandrofloresm / NormSInv.php
Last active August 10, 2023 15:57
Implementation of the function NORMSINV of EXCEL in PHP
<?php
/**
* Returns the inverse of the standard normal cumulative distribution.
* The distribution has a mean of zero and a standard deviation of one.
* Resources:
* http://board.phpbuilder.com/showthread.php?10367349-PHP-NORMSINV
* http://www.source-code.biz/snippets/vbasic/9.htm
* @param integer $week number of week
* @return float sales
*/
@alejandrofloresm
alejandrofloresm / get_this_location_path.php
Created August 18, 2016 19:05
Get the url path of the current file
<?php
function get_this_location_path() {
$parts = parse_url($_SERVER['PHP_SELF']);
if (!isset($parts['scheme'])) {
$parts['scheme'] = "http";
if (isset($_SERVER["HTTPS"]) &&
$_SERVER["HTTPS"] == "on")
{
$parts['scheme'] .= "s";
@alejandrofloresm
alejandrofloresm / hello-world.py
Created April 16, 2016 18:16
Hello World for Google
# Code example for:
# Hello World - Machine Learning Recipes #1 - Google Developers
# https://www.youtube.com/watch?v=cKxRvEZd3Mw
from sklearn import tree
# Bumpy = 0, Smooth = 1
features = [[140, 1], [130, 1], [150, 0], [170, 0]]
# Apple = 0, Orange = 1
labels = [0, 0, 1, 1]