Skip to content

Instantly share code, notes, and snippets.

View master-q's full-sized avatar
🌴
On vacation

Kiwamu Okabe master-q

🌴
On vacation
View GitHub Profile
@master-q
master-q / install.sh
Last active September 16, 2015 13:16
Install ATS compiler from github source code
$ sudo apt-get install autoconf git libgc-dev libgmp3-dev
$ w3m http://sourceforge.net/projects/ats-lang/files/ats-lang/
$ tar xf ats-lang-anairiats-0.2.12.tgz
$ export ATSHOME=${PWD}/ats-lang-anairiats-0.2.12
$ export ATSHOMERELOC=ATS-0.2.12
$ cd ats-lang-anairiats-0.2.12/
$ ./configure
$ make all
$ cd ..
$ export PATSHOME=${PWD}/ATS-Postiats
@master-q
master-q / fun_signature.sats
Created September 11, 2015 12:17
fun_signature.sats
(* Normal Function *)
fun{a:vt0p}
list_vt_reverse_append
{m,n:int} .<m>. (
list_vt (INV(a), m), list_vt (a, n)
) : list_vt (a, m+n)
(* Mixed Function *)
fun{a:vt0p}
gflist_vt_revapp
@master-q
master-q / no_cast_cloptr.dats
Created September 5, 2015 21:53
no_cast_cloptr.dats
#include
"share/atspre_staload.hats"
//
(* ****** ****** *)
fun{
a:t@ype}{b:vt@ype
} list_map_cloptr{n:int}
(
xs: list (a, n), f: !(a) -<cloptr1> b
@master-q
master-q / Build.log
Created September 5, 2015 19:33
Takeout will change linear value
$ make atview
"/home/kiwamu/src/ATS-Postiats"/bin/patscc -I"/home/kiwamu/src/ATS-Postiats" -I"/home/kiwamu/src/ATS-Postiats"/ccomp/runtime -I"/home/kiwamu/src/ATS-Postiats-contrib"/contrib -IATS "/home/kiwamu/src/ATS-Postiats-contrib"/contrib -o atview atview.dats || touch atview
**SHOWTYPE[UP]**(/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS/CODE/CHAP_VVTINTRO/atview.dats: 3199(line=129, offs=21) -- 3203(line=129, offs=25)): S2Etyrec(flt0; npf=1; 0=S2Eapp(S2Ecst(@); S2Etyrec(flt0; npf=-1; 0=S2Efun(FUN; lin=0; eff=S2EFFset(1); npf=-1; S2Erefarg(1; S2Evar(env$7237$7238(12766))), S2Evar(a(7908)); S2Ewth(S2Evar(b(7909)); trans(1; S2Evar(env$7237$7238(12766))), none())), 1=S2Evar(env$7237$7238(12766))), S2Evar(l(7910))), 1=S2Eapp(S2Ecst(ptr); S2Evar(l(7910)))): S2RTbas(S2RTBASimp(2; viewtype))
**SHOWTYPE[UP]**(/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS/CODE/CHAP_VVTINTRO/atview.dats: 3244(line=131, offs=21) -- 3248(line=131, offs=25)): S2Etyrec(flt0; npf=1; 0=S2Ecst(unit_p), 1=S2Eapp(S2Ecst(ptr);
@master-q
master-q / template_scope.dats
Last active August 29, 2015 14:28
Template scope
#include "share/atspre_define.hats"
#include "share/atspre_staload.hats"
extern fun{} base (): int
fun{} plus (a: int): int = a + base ()
implement main0 () = {
implement{} base () = 2
val () = println! (plus 1) // => 3
@master-q
master-q / mysql.log
Last active August 29, 2015 14:27
MySQL error
2015-08-12 19:32:12 12461 [ERROR] Error reading packet from server: Could not find first log file name in binary log index file ( server_errno=1236)
2015-08-12 19:32:12 12461 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file', Error_code: 1236
@master-q
master-q / mindmap.md
Created March 7, 2015 06:51
mindmap
Title For paper For metasepi For advertising
Linux Bohai v v v
DWARF v v v
Queue Theory v v v
Error message v v
Scratch v v
Model checking v v
ATS internal v
SAT v
@master-q
master-q / integer.sats
Created March 6, 2015 02:01
integer.satsに見る #ATS2 のゼロ除算実装
(***********************************************************************)
(* *)
(* Applied Type System *)
(* *)
(***********************************************************************)
(*
** ATS/Postiats - Unleashing the Potential of Types!
** Copyright (C) 2010-2013 Hongwei Xi, ATS Trustful Software, Inc.
** All rights reserved
@master-q
master-q / statfs.c
Created March 3, 2015 08:36
#Linux の一部を #ATS2 で書き直してみた
extern struct super_block *user_get_super(dev_t);
extern void drop_super(struct super_block *sb);
extern int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf);
int vfs_ustat(dev_t dev, struct kstatfs *sbuf)
{
struct super_block *s = user_get_super(dev);
int err;
if (!s)
return -EINVAL;
@master-q
master-q / ubuntu14_on_virtualbox.md
Last active August 29, 2015 14:11
Can Mac OS X use USB host for OpenOCD?

Setup

Do not use USB 2.0.

$ sudo apt-get install libhidapi-dev
$ sudo apt-get build-dep openocd
$ git clone git://git.code.sf.net/p/openocd/code openocd-code
$ cd openocd
$ ./bootstrap