Skip to content

Instantly share code, notes, and snippets.

@aviks
aviks / Makefile.new
Created March 23, 2020 15:41
Snowball-Makefile
include mkinc.mak
CFLAGS=-O2
CPPFLAGS=-Iinclude
all: libstemmer.$(dlext) libstemmer.o stemwords$(exeext)
$(bindir):
mkdir -p $(bindir)
$(libdir):
mkdir -p $(libdir)
libstemmer.o: $(snowball_sources:.c=.o)
$(AR) -cru $@ $^
@aviks
aviks / dash_pi.jl
Created November 6, 2019 21:58
Calculate Pi with Dash
using HTTP
using Dashboards
using PlotlyJS
function compute_pi(N::Int)
n_landed_in_circle = 0
for i = 1:N
x = rand() * 2 - 1
y = rand() * 2 - 1
r2 = x*x + y*y
@aviks
aviks / hadoopJuliaHDI.sh
Last active August 11, 2019 07:29
Julia Start script for Hadoop on Azure HDI
#!/usr/bin/env bash
# An example shell script that can be used on Azure HDInsight to install Julia to HDI Spark cluster
# This script, or a derivative should be set as a script action when deploying an HDInsight cluster
# install julia v0.6
curl -s https://julialang-s3.julialang.org/bin/linux/x64/0.6/julia-0.6.2-linux-x86_64.tar.gz | sudo tar -xz -C /usr/local/
JULIA_HOME=/usr/local/julia-d386e40c17/bin
# install maven
@aviks
aviks / langdetect-demo.ipynb
Created December 12, 2017 17:23
Language Detection Demo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aviks
aviks / langdetect-demo.ipynb
Created December 12, 2017 17:23
Language Detection Demo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aviks
aviks / langdetect-demo.ipynb
Created December 12, 2017 17:23
Language Detection Demo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
using DataValues
julia> for n=1:25 [29/1811]
a=DataValueArray(rand(2^n))
@time map(x->isnull(x) ? 0.0 : x, a);
end
0.118944 seconds (24.93 k allocations: 1.254 MiB)
0.000013 seconds (8 allocations: 368 bytes)
0.000007 seconds (8 allocations: 400 bytes)
0.000007 seconds (8 allocations: 480 bytes)
@aviks
aviks / datavalues.jl
Created October 28, 2017 13:37
DataValues Inference
using DataValues
for n=1:20
a=DataValueArray(rand(2^n))
@time map(x->isnull(x) ? 0.0 : get(x), a);
end
0.090726 seconds (15.83 k allocations: 838.608 KiB)
0.000010 seconds (24 allocations: 1.219 KiB)
0.000011 seconds (62 allocations: 3.156 KiB)
0.000017 seconds (186 allocations: 9.531 KiB)
0.000048 seconds (626 allocations: 33.531 KiB)
#!/usr/bin/env bash
# install julia v0.6
curl -s https://julialang-s3.julialang.org/bin/linux/x64/0.6/julia-0.6.0-linux-x86_64.tar.gz | sudo tar -xz -C /usr/local/
JULIA_HOME=/usr/local/julia-903644385b/bin
# install maven
curl -s http://mirror.olnevhost.net/pub/apache/maven/binaries/apache-maven-3.2.2-bin.tar.gz | sudo tar -xz -C /usr/local/
export M2_HOME=/usr/local/apache-maven-3.2.2
export PATH=$M2_HOME/bin:$PATH
git diff
diff --git a/src/led.jl b/src/led.jl
index 549a546..0380f6e 100644
--- a/src/led.jl
+++ b/src/led.jl
@@ -30,10 +30,10 @@ end
-typealias U5 UFixed{UInt8,5}