Skip to content

Instantly share code, notes, and snippets.

Hanwen Wu steinwaywhw

  • Google
  • US
Block or report user

Report or block steinwaywhw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View matrix.dats
#include "share/atspre_staload.hats"
typedef matrix (a:t@ype) = mtrxszref (a)
extern fun {a:t@ype} matrix_transpose (matrix (a)): matrix (a)
extern fun {a:t@ype} foreach (matrix (a), (a, size_t, size_t) -<cloref1> void): matrix (a)
extern fun matrix_print (matrix (int)): void
implement {a} foreach (m, f) = let
val nrow = mtrxszref_get_nrow (m)
steinwaywhw /
Last active Aug 29, 2015
A quick script for installing ATS2. Just make sure you have libgmp installed already.

Installing ATS on Linux

Just copy and execute the code, and you get the latest ATS. Just make sure you already have libgmp3-dev installed. Also make sure to setup PATSHOME environment variable.

steinwaywhw / lazy.dats
Last active Aug 29, 2015
An exercise for lazy evaluation in ATS
View lazy.dats
#include "share/atspre_staload.hats"
staload UN = "prelude/SATS/unsafe.sats"
//make patscc -o lazy lazy.dats -DATS_MEMALLOC_LIBC
datatype list (a:t@ype) =
| list_cons of (a, lazy (list (a)))
| list_nil of ()
#define nil list_nil
steinwaywhw /
Created Apr 3, 2014
Install Java on Ubuntu Server
echo "deb saucy main" >> /etc/apt/sources.list
echo "deb-src saucy main" >> /etc/apt/sources.list
apt-key adv --keyserver --recv-keys EEA14886
apt-get update
apt-get install -y oracle-java8-installer
steinwaywhw / Dockerfile
Created Apr 3, 2014
A docker image for ATS development.
View Dockerfile
FROM stackbrew/ubuntu:13.10
RUN apt-get update
RUN apt-get install -y libgmp3-dev
RUN apt-get install -y make
RUN apt-get install -y gcc
RUN apt-get install -y build-essential
RUN apt-get install -y wget
RUN apt-get install -y bash
steinwaywhw /
Last active Aug 29, 2015
Enigma Machine in ATS

Enigma Machine in ATS

This is an Enigma Machine implementation in ATS programming language. Please visit this blog for more information.

License: GPL v3

sudo npm cache clean -f
sudo npm install -g n
sudo n stable
steinwaywhw / log_files.yml
Last active Aug 29, 2015
Gist for ats-pad deployment provisioning.
View log_files.yml
- /var/log/tomcat7/*
- /home/vagrant/server/*log*
port: 20895

#Installing Node.js and NPM in 30s

steinwaywhw / Util.groovy
Last active Aug 29, 2015
Get server IP address at runtime in Grails/Groovy
View Util.groovy
def getIPAddress() {
return "ip route show dev eth0".execute().getText().tokenize()[9]
You can’t perform that action at this time.