Skip to content

Instantly share code, notes, and snippets.

@ponkore
ponkore / emacs-24.3.txt
Created March 14, 2013 13:22
Emacs-24.3 に update したらいろいろと `obsolete` ってたwww
Loading /Users/masao/.emacs.d/functions/convenience.el (source)...done
Loading /Users/masao/.emacs.d/functions/local.el (source)...done
Loading /Users/masao/.emacs.d/config/builtins.el (source)...
Loading /Users/masao/.emacs.d/config/builtins/diff-mode.el (source)...done
Loading /Users/masao/.emacs.d/config/builtins/text-mode.el (source)...done
Loading /Users/masao/.emacs.d/config/builtins/cc-mode.el (source)...done
Loading /Users/masao/.emacs.d/config/builtins/emacs-lisp-mode.el (source)...done
Loading /Users/masao/.emacs.d/config/builtins.el (source)...done
Loading /Users/masao/.emacs.d/config/packages.el (source)...
`flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'.
@ponkore
ponkore / out.txt
Last active December 14, 2015 19:18
sagittarius build error (ffi)
Scanning dependencies of target sagittarius--ffi
[ 41%] Building C object build/ext/ffi/CMakeFiles/sagittarius--ffi.dir/sagittarius-ffi.c.o
[ 41%] Building C object build/ext/ffi/CMakeFiles/sagittarius--ffi.dir/ffi_stub.c.o
Linking C shared module ../../sagittarius--ffi.so
Undefined symbols for architecture x86_64:
"_ffi_call", referenced from:
_internal_ffi_call in sagittarius-ffi.c.o
"_ffi_prep_cif_machdep", referenced from:
_ffi_prep_cif in liblibffi.a(prep_cif.c.o)
"_ffi_prep_closure_loc", referenced from:
@ponkore
ponkore / private.xml
Created February 27, 2013 15:00
Mac Book Pro の JIS キーボードを KeyRemap4MacBook 8.0.0 で英字配列にして使うとき、Backquote(`) と Tilde(~) がアサインされなくなってしまうので、¥記号を Backquote(`) に割り当てる(SHIFT+¥で Tilde(~) になる)。 ~/Library/Application Support/KeyRemap4MacBook/private.xml
<?xml version="1.0"?>
<root>
<appdef>
<appname>Modify Yen Mark Key</appname>
<equal>com.github.ponkore</equal>
</appdef>
<item>
<name>Modify Yen Mark Key</name>
<item>
@ponkore
ponkore / camel-to-dash.clj
Last active December 13, 2015 17:09
CamelCase を dash-connected な string に変換する(日本語の取扱が今一つとか他にもバグあり)
(defn camel-to-dash
"convert `CamelCase` string to dash-connected string."
[s]
(->> (re-seq #"[A-Z]+[^A-Z]+|[a-z]+[^a-z]+" s)
(map str/lower-case)
(interpose "-")
str/join))
@ponkore
ponkore / problem_25.clj
Created January 9, 2013 14:18
Project Euler Problem 25
(ns projecteuler.problem-25
(:require [clojure.string :as str]
[clojure.math.numeric-tower :as math])
(:use clojure.test))
(defn fib-gen
"フィボナッチ数を generate する関数。初期値[1 1]から iterate する前提。"
[[a b]] [b (+' a b)])
(def fib-seq
@ponkore
ponkore / problem_18.clj
Created January 5, 2013 14:55
Project Euler Problem 18
;;; By starting at the top of the triangle below and moving to adjacent numbers
;;; on the row below, the maximum total from top to bottom is 23.
;;;
;;; 3
;;; 7 4
;;; 2 4 6
;;; 8 5 9 3
;;;
;;; That is, 3 + 7 + 4 + 9 = 23.
;;;
@ponkore
ponkore / problem_11.clj
Created December 23, 2012 13:47
Project Euler Problem 11
;;; In the 20x20 grid below, four numbers along a diagonal line have been marked in red.
;;; :
;;; (snip)
;;; :
;;; The product of these numbers is 26 * 63 * 78 * 14 = 1788696.
;;; What is the greatest product of four adjacent numbers
;;; in any direction (up, down, left, right, or diagonally) in the 20x20 grid?
(ns projecteuler.problem-11
(:use clojure.test))
@ponkore
ponkore / problem-4-1.clj
Created December 14, 2012 13:35
Project Euler Problem 4
;;;A palindromic number reads the same both ways.
;;;The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.
;;;Find the largest palindrome made from the product of two 3-digit numbers.
;;;左右どちらから読んでも同じ値になる数を回文数という。 2桁の数の積で表される回文数のうち、
;;;最大のものは 9009 = 91 × 99 である。
;;;では、3桁の数の積で表される回文数のうち最大のものはいくらになるか。
(ns projecteuler.problem-4
(:require [clojure.string :as str])
@ponkore
ponkore / compiler.clj
Created December 13, 2012 13:15
hiccup の魔改造。hiccup の jar には手を入れずに、hiccup 内プライベート関数を書き換えて、改行とインデントをサポート。 だいたいできたけど、a とか span とか h1〜h6 とかのように、改行をいちいち入れないほうが見栄えが良いタグをちゃんと サポートしたい。
(ns hiccup-mod.compiler
(:require [hiccup.compiler :as c]))
;;;
;;; CAUTION!!! hiccup.compiler の end-tag、render-element を書き換える。
;;;
;;; public vars
(def ^{:dynamic true :doc " default is two white space."}
*html-indent-characters* " ")
@ponkore
ponkore / sqlkorma-tutrial.md
Created December 10, 2012 18:16
sqlkorma 使ってみた (Lisp アドベントカレンダー 2012の 11日目の記事です)

sqlkorma 使ってみた

この記事は、Lispアドベントカレンダー2012 の 11日目 の記事です。前日は、nitro_idiot さんがライブコーディングで凄まじい勢いでWebサイトを作る 記事 でした。

今日のネタは、いろいろ考えた挙句 sqlkorma にしました。

動機