Skip to content

Instantly share code, notes, and snippets.

View path.jl
@unix_only begin
const path_separator = "/"
const path_separator_regex = r"/+"
const path_absolute_regex = r"^/"
const path_parse_regex = r"^(.*?/|)([^/]+?)(\.[^\.]+|)$"
splitdrive(path::String) = ("",path)
@windows_only begin
const path_separator = "\\"
View quintessence
Eight miles deep the well forgotten by mortals
Oh, I drank it empty in one single sip
Eight miles wide the valley beyond all hope
Oh, I filled the whole with one single fist
Five million christians on a ride towards us
Oh, I slaughtered the bunch with one single hit with my spear
Five million women so alone in the night
Oh, I had them all satisfied profusely every night by myself
View gist:5104246
JULIA test/all
From worker 2: * core
From worker 3: * numbers
From worker 2: * strings
exception on 1: ERROR: read: end of file
in read at iobuffer.jl:54
in read at stream.jl:373
in anonymous at task.jl:804
From worker 2: exception on 2: ERROR: read: end of file
From worker 2: in read at iobuffer.jl:54
View gist:9494002
julia> s = sprint() do io
println(io, "hello")
println(io, "world"
StefanKarpinski / threadzmq.c
Created Apr 8, 2014
thread communication with ZMQ
View threadzmq.c
// gcc -shared -fPIC -I$JULIAHOME/usr/include -L$JULIAHOME/usr/lib -lzmq -luv -o threadzmq.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <math.h>
#include <zmq.h>
#include <uv.h>
View julia-users headers
Precedence: list
Mailing-list: list; contact
List-ID: <>
X-Google-Group-Id: 756090033396
List-Post: <>, <>
List-Help: <>, <>
List-Archive: <
List-Subscribe: <>, <>
List-Unsubscribe: <>,
use Time::HiRes qw(time);
sub perl1 {
my $k = $_[0];
foreach my $n (10**($k-1) .. 10**($k)-1) {
my $front = $n * (10**$k + $n);
my $root = int(sqrt($front));
foreach my $t ($root-2 .. $root+2) {
my $back = $t * ($t - 1);
View excellent.jl
using Compat
function julia1(k)
for n = 10^(k-1):10^k-1
front = n*(10^k + n)
root = floor(Int,sqrt(front))
for t = root-2:root+2
back = t * (t - 1)
length(string(t)) > k && break
View excellent_analysis.jl
using DataFrames, Gadfly
exl = readtable("excellent.csv", names=[:variant,:digits,:time])
agg = aggregate(groupby(exl,[:variant,:digits]), median)
agg = agg[sortperm(agg[:variant], by=first, rev=true),:]
rel = join(
on=:digits, kind=:left