これは [Haskell Advent Calendar 2012][] の11日目の記事です。
Haskell でデータ設計を便利に行う発想・方法について書きました。
[persistent][] というライブラリを活用します。
Haskell を知らなくても読めます。
主な対象読者は [プログラミングHaskell][] か [すごいHaskellたのしく学ぼう!][] を読み、Haskell をより使いたい人です。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command! -nargs=+ lazy autocmd VimperatorEnter .* <args> | |
"googlespreadshet{{{ | |
autocmd LocationChange '((drive|docs)\.google\.com).*(/spreadsheet/).*[0-9]+$' <C-j> | |
"insert-modeでの<esc>キーはspreadsheetでのエスケープキーにする(insert-modeは抜けない) | |
lazy fmaps -u='((drive|docs)\.google\.com).*(/spreadsheet/).*[0-9]+$' -modes=i <esc> | |
"insert-mode/normal-modeの切り替え(iでinsert-mode/<C-j>でnormal-mode) | |
inoremap -u='((drive|docs)\.google\.com).*(/spreadsheet/).*[0-9]+$' <C-j> <esc> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.URL; | |
import java.security.SecureRandom; | |
import java.security.cert.CertificateException; | |
import java.security.cert.X509Certificate; | |
import javax.net.ssl.HostnameVerifier; | |
import javax.net.ssl.HttpsURLConnection; | |
import javax.net.ssl.KeyManager; | |
import javax.net.ssl.SSLContext; | |
import javax.net.ssl.SSLSession; | |
import javax.net.ssl.TrustManager; |
原文: http://apocalisp.wordpress.com/2010/07/02/higher-rank-polymorphism-in-scala/ 訳者は英語得意ではなく、訳が怪しいところがあるとおもうので、間違いやつっこみがあれば、ここのコメント欄に記入なりなんなり指摘お待ちしてます。
Tim Carstens のポスト Haskell features he’d like to see in other languages をよんで、そのなかの一つにrank-2 typesというものがありました。 Tim は、これ(rank-2 type)を使ったキラーアプリケーションとして、型システムを利用して、リソースへのアクセスの安全性を確保するといいます。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
/* | |
A basic lens library for the purpose of demonstration. | |
Implements a lens as the costate comonad coalgebra. | |
This library is not complete. | |
A more complete lens library would take from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://d.hatena.ne.jp/haru-s/20110405/1302006637 に答えがそのままあるが、一応メモ | |
# github fork 追従 で見つけた | |
$ git remote | |
origin | |
# 本家のリモートリポジトリの短縮名を登録する. | |
$ git remote add github git://github.com/liquidz/misaki.git | |
# 本家の更新をローカルで反映させる. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TMP=/tmp/gsay.mp3 | |
curl --silent --user-agent "Safari/1.0" "http://translate.google.com/translate_tts?q=$1&tl=ja" > $TMP && afplay $TMP && rm -f $TMP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s } | |
function rtrim(s) { sub(/[ \t\r\n]+$/, "", s); return s } | |
function trim(s) { return rtrim(ltrim(s)); } | |
BEGIN { | |
# whatever | |
} | |
{ | |
# whatever | |
} | |
END { |