Skip to content

Instantly share code, notes, and snippets.

@kurohuku
kurohuku / sharp-backquote-reader.lisp
Created November 24, 2010 07:15
sharp-backquote-reader
(asdf:oos 'asdf:load-op :kmrcl)
(defun |#`-reader| (stream ch numarg)
(declare (ignore ch numarg))
(let (acc-fmt acc-args)
(loop
:for curr = (read-char stream)
:until (char= curr #\`)
:do
(if (char= curr #\\)
(defun split-method-call (str)
(let* ((strs (coerce (jcall "split" str "/") 'list))
(method (car (last strs)))
(class (format nil "~{~A~^/~}" (butlast strs))))
(list class method)))
(defun static-field-p (str)
(destructuring-bind (class field)
(split-method-call str)
(and (not (string= "" class))
@kurohuku
kurohuku / ps.el
Created September 22, 2010 04:12
(defun postscript-process ()
(get-buffer-process (get-buffer "*postscript*")))
(defun run-postscript ()
(interactive)
(require 'comint)
(switch-to-buffer (make-comint "postscript" "gs")))
(push '("postscript" . utf-8) process-coding-system-alist)
(require 'cl)
(defgroup popup-forward-backward nil
"Minor mode for popping up lines which surround forward/backward point")
(defcustom popup-forward-backward:idle-delay 5
"Number of seconds of idle time to wait before popping up"
:type 'number
:group 'popup-forward-backward)
(require 'cl)
(defvar popup-matching-paren-open-parens "([{\"")
(defvar popup-matching-paren-close-parens ")]}\"")
(defun popup-matching-paren (&optional lines)
"popup 1+`lines'*2 lines"
(interactive)
(unless lines
(setq lines 0))
;;; -*- coding:utf-8 mode:emacs-lisp -*-
;;; helm-eshell-dirstack.el
(eval-when-compile (require 'cl))
(require 'helm)
(require 'eshell)
(defun helm-eshell-dirstack-popd (n)
(eshell/popd (format "+%d" n))
(eshell-begin-on-new-line)

Gnupack設定

プロキシ

config.iniファイルを編集する

apt-cyg

apt-cyg -m http://ftp.iij.ad.jp/pub/sygwin/ update
apt-cyg update
# Octaveでチャープ信号を書く
# E(t) = E0 cos(2πfct + at^2)
# t: 時間変化
# E0: 振幅
# fc: 中心周波数
# a: チャープ定数 (a/π: チャープ率)
function fn = mkchirp(E0, fc, a)
fn = @(t) E0 * cos(2 * pi * fc * t + a * power(t, 2));
endfunction;

Mavenのローカルレポジトリにjarファイルを追加する

JavaFXのjarファイルをローカルのMavenレポジトリに追加してみます。

mvn install:install-file -DgroupId=local.oracle -DartifactId=javafxrt -Dversion=x.y.z -Dpackaging=jar -Dfile=/usr/lib/jvm/jdk1.7.0/jre/lib/jfxrt.jar

leiningenのdependenciesに以下を追加すればjfxrt.jarを使えます。

Markdownプロセッサ PegDown

JavaのMarkdown処理ライブラリ、PegDownを使ってみます。

;; leiningen :depencencies
[org.pegdown/pegdown "1.2.0"]

コンストラクタの引数に拡張機能を表すオプションを指定できます。