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
steinwaywhw / README.md
Last active Aug 29, 2015
A quick script for installing ATS2. Just make sure you have libgmp installed already.
View README.md

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
steinwaywhw / client.js
Last active Feb 24, 2020
A minimal term.js server/client demo. To be used with node.js
View client.js
var client = {};
client.run = function (options) {
options = options || {};
var socket = io.connect(options.remote || "http://localhost:8080");
socket.on('connect', function() {
var term = new Terminal({
@steinwaywhw
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
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
steinwaywhw / install.sh
Created Apr 3, 2014
Install Java on Ubuntu Server
View install.sh
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu saucy main" >> /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu saucy main" >> /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install -y oracle-java8-installer
@steinwaywhw
steinwaywhw / README.md
Last active Aug 29, 2015
Enigma Machine in ATS
View README.md

Enigma Machine in ATS

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

License: GPL v3

View update.sh
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
@steinwaywhw
steinwaywhw / log_files.yml
Last active Aug 29, 2015
Gist for ats-pad deployment provisioning.
View log_files.yml
files:
- /var/log/tomcat7/*
- /home/vagrant/server/*log*
destination:
host: logs.papertrailapp.com
port: 20895
View README.md

#Installing Node.js and NPM in 30s

You can’t perform that action at this time.