Skip to content

Instantly share code, notes, and snippets.

@ZacCranko
ZacCranko / .juliarc.jl
Last active August 9, 2016 23:59
Current juliarc.jl
push!(LOAD_PATH, pwd())
# Run _init.jl at runtime if it exists
if VERSION < v"0.4-"
if isinteractive() && isfile("_init.jl")
info("Found ", joinpath(pwd(),"_init.jl"))
include(joinpath(pwd(),"_init.jl"))
end
else
atreplinit() do repl
@Ismael-VC
Ismael-VC / always_on_jupyter.sh
Last active September 11, 2015 16:57 — forked from jbn/always_on_jupyter.sh
Always On Jupyter
# Installation:
# - Put this in your .bash_profile
# - Replace my directory with your exobrain directory on line 10
#
# What you get:
# A Jupyter notebook open on a well-defined port that is always
# on for exobrain-ing your ideas...
exec 6<>/dev/tcp/localhost/10000 || (
source activate py27 &&
@jbn
jbn / always_on_jupyter.sh
Created September 10, 2015 14:12
Always On Jupyter
# Installation:
# - Put this in your .bash_profile
# - Replace my directory with your exobrain directory on line 10
#
# What you get:
# A Jupyter notebook open on a well-defined port that is always
# on for exobrain-ing your ideas...
exec 6<>/dev/tcp/localhost/10000 || (
source activate py27 &&
@jbn
jbn / julia_type_hierarchy.jl
Created July 17, 2015 22:44
Julia Type Hierarchy
# Requested gist of code to produce:
# https://www.scribd.com/doc/271871142/Julia-Type-Hierarchy
#
# I just redirected the output to a dot file, then executed:
# dot -Tpdf julia.dot -o julia.pdf
function print_type_tree(t, parent=Any, seen=Set{DataType}())
# Avoid redundant edges.
t ∈ seen && return
push!(seen, t)
@meggart
meggart / .juliarc.jl
Created July 16, 2015 15:26
Macroexpand shortcut in the REPL
if VERSION > v"0.4.0-dev+4268"
const marcoexpandkeys = Dict{Any,Any}("^I" => function (s,o...)
if !isempty(s)
line = parse(Base.LineEdit.input_string(s))
s.kill_buffer=Base.LineEdit.input_string(s)
Base.LineEdit.edit_clear(s)
Base.LineEdit.edit_insert(s,string(macroexpand(line)))
end
@Andy-P
Andy-P / StreamAnalytics.jl
Last active July 25, 2024 20:59
High Performance Streaming Analytics in Julia
# This code is part of a presentation on streaming analytics in Julia
# It was inspired by a number of individuals and makes use of some of their ideas
# 1. FastML.com got me thinking about inline processing after
# reading his great Vowpal Wabbit posts
# 2. John Lanford and his fantastic Vowpal Wabbit library.
# Check out his NYU video course to learn more (see below)
# 3. John Myles White's presentation on online SDG and his StreamStats.jl library
# Thank you all!
@nrshrivatsan
nrshrivatsan / httpGetJSON.jl
Last active November 28, 2016 21:26
Julia lang - Read JSON from URL
#Importing Requests package
Pkg.add("Requests")
using Requests.get;
import JSON;
url = "http://query.yahooapis.com/v1/public/yql?q=select%20DaysRange%20from%20yahoo.finance.quotes%20where%20symbol%20in%20%28%22EBAY%22,%22GOOG%22%29%20&env=http://datatables.org/alltables.env&format=json";
#Reads the data from HTTP URL
es = get(url);
@kimwalisch
kimwalisch / segmented_sieve.cpp
Last active July 31, 2020 08:33
Simple segmented sieve of Eratosthenes implementation
/// @file segmented_sieve.cpp
/// @author Kim Walisch, <[email protected]>
/// @brief This is a simple implementation of the segmented sieve of
/// Eratosthenes with a few optimizations. It generates the
/// primes below 10^9 in 0.8 seconds (single-threaded) on an
/// Intel Core i7-6700 3.4 GHz CPU.
/// @license Public domain.
#include <iostream>
#include <algorithm>
@Ismael-VC
Ismael-VC / caminos.py
Last active August 29, 2015 14:17 — forked from knkillname/caminos.py
## Algoritmos de caminos más cortos
from estructuras import Cola, ColaMin
from conectividad import ordenamiento_topologico
inf = float('inf') #Tratar infinito como un numero
def recorrido_a_lo_ancho(G, s):
dist, padre = {v:inf for v in G}, {v:v for v in G}
dist[s] = 0
@knkillname
knkillname / caminos.py
Last active May 5, 2020 17:39
Algoritmos de optimización combinatoria
## Algoritmos de caminos más cortos
from estructuras import Cola, ColaMin
from conectividad import ordenamiento_topologico
inf = float('inf') #Tratar infinito como un numero
def recorrido_a_lo_ancho(G, s):
dist, padre = {v:inf for v in G}, {v:v for v in G}
dist[s] = 0