Skip to content

Instantly share code, notes, and snippets.

View mrkz's full-sized avatar
👍
Don't Panic!

Marcos Simental mrkz

👍
Don't Panic!
View GitHub Profile
@mrkz
mrkz / big_sum.py
Created October 19, 2013 03:18
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
#!/usr/bin/env python
# coding=utf-8
import string
big_number = """
37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
@mrkz
mrkz / sigmoidal
Last active December 23, 2015 23:19
Código para graficar función de activacion tipo sigmoidal
#!/usr/bin/env octave
% funcion de activacion -> sigmoidal
function answer = sigmoidal(a, v)
answer = 1 / (1 + exp(-a*v))
return
endfunction
x = linspace(-5,5,10000);
@mrkz
mrkz / proof.c
Created July 2, 2013 02:42
Codethical proof that 42 is the answer to the ultimate question of life, the universe and everything else.
#include <stdlib.h>
#include <limits.h>
#define SECONDS_IN_A_YEAR 31557600LL
void wait(long long int seconds){
while (seconds > 0){
int s = seconds > INT_MAX ? INT_MAX : seconds;
sleep(s);
seconds -= s;