Skip to content

Instantly share code, notes, and snippets.

@mbeltagy
mbeltagy / SandPile.ipynb
Last active January 13, 2017 23:49
Sandpiles from Numberphile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mbeltagy
mbeltagy / kaprekar.jl
Last active April 14, 2017 22:07
Kaprekar's constant from Numberphile
# We work out the Kaprekar's constant
function breakdown(x::Int)
y=[j for j in "$x"]
end
function put_together(y::Vector{Char})
sum(parse(Int,y[i])*10^(i-1) for i=1:length(y))
end
"""
@mbeltagy
mbeltagy / RelMathinJulia.ipynb
Last active April 14, 2017 22:08
Analysis of the rate of growth of different relgions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mbeltagy
mbeltagy / nonLinearHW9.1.ipynb
Last active April 14, 2017 22:09
Homework from complexity explore course.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mbeltagy
mbeltagy / MohRafeaIntroToJuila.ipynb
Created April 25, 2017 19:38
First intro to Mohammed Rafea to Julia for NN
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mbeltagy
mbeltagy / TupperFormula.ipynb
Created June 7, 2017 10:09
Tupper's_self-referential_formula in Julia
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mbeltagy
mbeltagy / PoolJumpCalc.ipynb
Last active June 23, 2017 12:10
Jumping from second floor to pool
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mbeltagy
mbeltagy / readFusionTable.jl
Created July 15, 2017 01:24
Opening up fusion table from Julia
# Reading a fusion table from Julia
using Requests, DataFrames
request_url = "https://www.googleapis.com/fusiontables/v2/query"
query = "SELECT * FROM 1KlX4PFF81wlx_TJ4zGudN_NoV_gq_GwrxuVau_M"
resp=get(request_url,query=Dict("sql"=>query, "key"=>"somekey","alt"=>"csv"))
myTable=readtable(IOBuffer(resp.data));
@mbeltagy
mbeltagy / extractcerts.jl
Last active November 26, 2017 21:33
Getting TensorFlow.jl to build properly
#=
I was getting the following errors when running
Pkg.update("TensorFlow")
On my ubunutu 14.04
INFO: Building TensorFlow.jl for CPU use only. To enable the GPU, set the TF_USE_GPU environment variable to 1 and rebuild TensorFlow.jl
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
@mbeltagy
mbeltagy / Makefile
Created April 4, 2017 03:01
For the Julia calling C minimal example
CC=gcc
CFLAGS=-c -Wall -fPIC
SOURCES=calc_mean.c
OBJECTS=$(SOURCES:.c=.o)
.c.o:
$(CC) $(CFLAGS) $< -o $@