下記を実現するための手順書。
- roswell(lisp実行環境構築ツール)を導入する
- slimv(VimにおけるSLIME)を導入する
- roswellとslimvでcommon lispをコーディング、実行するための設定をする
下記の順番に環境構築する。
| :- use_module(library(clpfd)). | |
| piece(_, []). | |
| piece([_ | Frame], [[] | Piece]) :- | |
| piece(Frame, Piece). | |
| piece([[X | FrameLine] | Frame], [[X | PieceLine] | Piece]) :- | |
| piece([FrameLine | Frame], [PieceLine | Piece]). | |
| tail([], []). | |
| tail([_ | T], T). |
| Require Import List. | |
| (* A name defines a pair of channels. | |
| * We need countably many names, so we use nat. | |
| * | |
| * Denoted as "a", "b", "c", ... | |
| *) | |
| Definition Name := nat. | |
| (* A pair of channels looks like FIFO. |
| #!/usr/bin/env ruby | |
| #-*- coding: utf-8 -*- | |
| =begin | |
| Auto wget image | |
| Copyright (c) 2014 Takuma Nakajima | |
| This software is released under the MIT License. | |
| http://opensource.org/licenses/mit-license.php |
| (* parameters *) | |
| (* 最大次数 *) | |
| maxOrderNum = 200; | |
| (* 画像URL, もしくはローカルパス *) | |
| imageURL = "http://nex.fm/wp-content/uploads/2012/08/vim-editor_logo.png"; | |
| pointListToLines[pointList_, neighbothoodSize_: 6] := | |
| Module[{L = DeleteDuplicates[pointList], NF, lambda, | |
| lineBag, counter, seenQ, sLB, nearest, | |
| nearest1, nextPoint, couldReverseQ, d, n, s}, |
| # | |
| # Slightly tighter CORS config for nginx | |
| # | |
| # A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
| # | |
| # Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
| # Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
| # don't seem to play nicely with this. | |
| # |