In information theory, entropy is the measurement of the amount of randomness in a probability distribution. It's defined as In my code, it's (defn entropy [X] (* -1 (Σ [i X] (* (p i) (log (p i)))))) Compare the similarity of my code above with the actual definition. Having a language that lets you declare constructs that look very similar to their mathematical definition is a huge win for readabi
I ran into some very non-intuitive behavior from Clojure recently. See if you can guess what "foo" is in the following examples: Example 1: user=> foo 1 user=> (= foo 1) true user=> (= [foo 2] [1 2]) true user=> (= {foo 2} {1 2}) false Example 2: user=> foo false user=> (= foo false) true user=> (when foo (println "shouldn't print?")) shouldn't print? nil Yikes, huh? Here are the answers: Example
swank-clojureの機能なのかslimeの機能なのかclojure-modeの機能なのか知らないのですが。 M-. カーソル位置のシンボルを定義しているソースまで移動。jarの中のファイルも見れて便利! M-, 飛んでから戻る M-TAB 補完 (単にTABだけでいいと思うが特にカスタマイズする気はない) C-c C-z バッファをREPLに切り替える C-c C-k コンパイルする。ひとつのファイル全体。括弧が足りないとかがすぐ分かってよい。 C-c C-c 一番外側の式だけをコンパイル。 C-M-x カーソル位置の一番外側にある式を実行 C-x C-e カーソル位置の直前の式を実行 C-u C-M-x C-u C-x C-e 式の実行結果をカーソル位置に挿入 (使うかな?) C-M-k カーソル位置以降の、カーソル位置にあるS式を削除。C-k と似た感じで覚えれる C-c C-
Emacsで割と最近のclojure-mode+swank-clojure+slimeで環境を作りました。 かなりはまってしまったので作業内容をまとめておきます。 今回はMac OS X 10.6での環境作りを行いましたが、多分*nix系でも同じはずです。 ClojureWithEmacsSlimeSwankOnUbuntu を参考にインストールしましたが、私の環境ではうまくいきませんでした。 【この情報は2010/3/26時点でのものです。clojure-mode,swank-clojureは変更が多いので環境構築時にはその時点での変更が必要になる場合があります】 Windows Userへ 迷わずClojure boxを入れましょう。 作業内容をまずは手短に clojure-modeをダウンロード clojure-modeに手を入れ、.emacsの編集 emacs で M-x cloj
Saturday, September 12, 2009 My Clojure Setup Update: There is now an official Getting Started page for Clojure. Please refer to the instructions on this page for information about how to get started with Clojure in the environment that you are most comfortable with. The information below may now be irrelevant. I have just switched over to using SLIME instead of the basic Lisp interaction that wa
Monday, March 22, 2010 Learning Clojure by writing a (very) minimal Lisp interpreter I wanted to learn a bit of Clojure, but I only had a couple of Emacs Lisp notions.. So I thought it would be fun to try writing a mini Lisp interpreter, in Clojure (using Emacs, to add a level of self-reference!) and document the process. But first please consider (1) that I tried to not consult any book or websit
For the next couple of blog posts, I’ve decided to describe some of the software we use (and have developed) at Sonian. We have a few Clojure repos pushed to github that have documentation that is poor-to-none. I wanted to start with our main communication tool these days: our IRC server, Subrosa. We originally were using Skype to communicate, but finally got fed-up with stability and usability, w
I originally wrote this in a Google Groups thread, but I figured it’s worth repeating here. Somebody posted a Java and Clojure snippet to the Clojure Google group and mentioned that the Java code was vastly faster than the Clojure code and he wondered if Clojure could get within reach of Java’s speed. In my own clj-starcraft project, I faced — and actually, still face — performance problems vis-à-
Clojure and Android with Emacs on Ubuntu Prerequisites This tutorial assumes that the following tutorials have been successfully completed: Clojure on Ubuntu Emacs on Ubuntu Android with Emacs on Ubuntu Install Clojure for Android The current version of clojure requires some slight modifications for use on Android. Install and compile a patched version specifically for Android projects. ~$ cd ~
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く