Skip to content

Instantly share code, notes, and snippets.

View excellent.csv
perl1 2 4.38690185546875e-05
perl2 2 2.78949737548828e-05
perl1 2 2.09808349609375e-05
perl2 2 1.97887420654297e-05
perl1 2 2.00271606445312e-05
perl2 2 2.09808349609375e-05
perl1 2 2.09808349609375e-05
perl2 2 2.09808349609375e-05
perl1 2 1.9073486328125e-05
perl2 2 2.00271606445312e-05
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(
agg[agg[:variant].!="julia3",:],
agg[agg[:variant].=="julia3",:],
on=:digits, kind=:left
)
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.pl
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 julia-users headers
Precedence: list
Mailing-list: list julia-users@googlegroups.com; contact julia-users+owners@googlegroups.com
List-ID: <julia-users.googlegroups.com>
X-Google-Group-Id: 756090033396
List-Post: <http://groups.google.com/group/julia-users/post>, <mailto:julia-users@googlegroups.com>
List-Help: <http://groups.google.com/support/>, <mailto:julia-users+help@googlegroups.com>
List-Archive: <http://groups.google.com/group/julia-users
Sender: julia-users@googlegroups.com
List-Subscribe: <http://groups.google.com/group/julia-users/subscribe>, <mailto:julia-users+subscribe@googlegroups.com>
List-Unsubscribe: <mailto:googlegroups-manage+756090033396+unsubscribe@googlegroups.com>,
@StefanKarpinski
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 libthreadzmq.so threadzmq.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <math.h>
#include <zmq.h>
#include <uv.h>
View gist:9494002
julia> s = sprint() do io
println(io, "hello")
println(io, "world"
end
"hello\nworld\n"
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 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