この記事は、Lispアドベントカレンダー2012 の 11日目 の記事です。前日は、nitro_idiot さんがライブコーディングで凄まじい勢いでWebサイトを作る 記事 でした。
今日のネタは、いろいろ考えた挙句 sqlkorma にしました。
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'. |
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: |
<?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> |
(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)) |
(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 |
;;; 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. | |
;;; |
;;; 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)) |
;;;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]) |
(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* " ") |
この記事は、Lispアドベントカレンダー2012 の 11日目 の記事です。前日は、nitro_idiot さんがライブコーディングで凄まじい勢いでWebサイトを作る 記事 でした。
今日のネタは、いろいろ考えた挙句 sqlkorma にしました。