Skip to content

Instantly share code, notes, and snippets.

View alphaKAI's full-sized avatar

Akihiro Shoji alphaKAI

View GitHub Profile
@hsk
hsk / poly.rs
Last active October 27, 2017 07:44
Algorithm W on Rust
/*
Algorithm W
*/
use std::collections::BTreeMap;
use std::collections::BTreeSet;
type X = String;
type U = i32;
type Assump = BTreeMap<X, Scheme>;
type Subst = BTreeMap<U, T>;
@sayurin
sayurin / tinyBase64Decoder.fs
Last active June 29, 2016 22:25 — forked from alphaKAI/tinyBase64Decoder.fs
Tiny Base64 Decoder in F#
module tinyBase64Decoder
open System
open System.Collections.Generic
// Declare fundamental functions
// Generate n length Integer List (0 upto n - 1)
let iota n = [0..n-1]
// Generate n length List of x
@matsubara0507
matsubara0507 / introduction2Pwn.md
Last active May 12, 2024 14:14
楽しいPwn入門

たのしいPwn入門

What is This ?

IGGG Advent Calender 2015のために書いた記事です。
常設CTFで遊んでたらPwnable系の問題を解いてるうちにいろいろと勉強になったのでまとめます。

Pwnable

PwnableとはCTFのジャンルの1つで、プログラムの脆弱性をつき、本来アクセスできないメモリ領域にアクセスして操作し、フラグを取得する感じの問題です。
別名としてExploitがあります。

@ykst
ykst / gist:6e80e3566bd6b9d63d19
Last active May 5, 2024 03:40
WebAudio+WebSocketでブラウザへの音声リアルタイムストリーミングを実装する

WebAudio+WebSocketでブラウザへの音声リアルタイムストリーミングを実装する

WebRTCでやれよ!と言われそうなところですが、 WebSocket+WebAudioの組み合わせで音声ストリーミングをシンプルに構成する方法を紹介してみます。

サーバーサイド(Node.js + ws + pcm)

サーバーサイドは何でも良いのですが、 とりあえずNode.jsでtest.mp3というサンプルファイルをpcmモジュールでデコードし、 wsでクライアントに垂れ流す作りにしておきます。

@pocarist
pocarist / hindleyMilnerTypeInference.fs
Last active June 27, 2023 18:25
Hindley-Milner型推論アルゴリズムをF#で書いてみた - http://d.hatena.ne.jp/pocarist/20141220/1419087653
(* Groovy:
/**
* Hindley-Milner type inference
* Ported to Groovy from Scala by Example Chapter 16 code.
* (http://www.scala-lang.org/docu/files/ScalaByExample.pdf)
* refered also
* https://github.com/namin/spots/blob/master/hindleyMilner/typeInference.scala
* Japanese page of 'Scala by Example':
* http://www29.atwiki.jp/tmiya/pages/78.html
*/ *)
@alphaKAI
alphaKAI / test.ll
Last active December 20, 2017 11:05
Idea of my programming language : lambdang
(main {string[] args} : bool;
string (str "HelloWorld");
bool (res {
(io (writeln (str)))();
return true;
});
return res;
)
/**
* Hindley-Milner type inference
* Ported to Groovy from Scala by Example Chapter 16 code.
* (http://www.scala-lang.org/docu/files/ScalaByExample.pdf)
* refered also
* https://github.com/namin/spots/blob/master/hindleyMilner/typeInference.scala
* Japanese page of 'Scala by Example':
* http://www29.atwiki.jp/tmiya/pages/78.html
*/
import groovy.transform.*
@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

超雑にまとめました。修正してください。

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。