2013년 1월 31일 목요일

하노이 타워


#lang racket
(define (hanoitower disc src aux dst)
  (cond
    [(> disc 0)
     (hanoitower (- disc 1) src dst aux)
     (displayln (format "Move ~s from ~s to ~s"disc src dst))
     (hanoitower (- disc 1) aux src dst)]))

(hanoitower 3 1 2 3)

emacs 컬럼모드

http://kb.iu.edu/data/afhg.html

C-spc 로 선택후

맨 마지막의 컬럼을 가서 

M-x kill-rectangle 



List max size

fastutil이 뭔가 궁금해서 찾아보다가. 
collection util 관련 내용도 찾아봤습니다.

1.
http://b010.blogspot.kr/2009/05/speed-comparison-of-1-javas-built-in.html

2.
http://stackoverflow.com/questions/629804/what-is-the-most-efficient-java-collections-library


Generally, a List implementation can hold any number of items (If you use an indexed List, it may be limited to Integer.MAX_VALUE or Long.MAX_VALUE). As long as you don't run out of memory, the List doesn't become "full" or anything. 
링크에 이런 말이 있네요. 
2^31-1 개 만큼 list 를 담을 수 가 있어서 이 이상의 데이터는 리스트에 못 담네요. 

그래서 위의 fastutil에서 int[][] 이렇게 해서 64bit에서 된다는 건가요? ^^;;

http://stackoverflow.com/questions/3767979/how-many-data-a-list-can-hold-at-the-maximum

http://stackoverflow.com/questions/7632126/maximum-size-of-hashset-vector-linkedlist

http://stackoverflow.com/questions/3038392/do-java-arrays-have-a-maximum-size

http://stackoverflow.com/questions/816142/strings-maximum-length-in-java-calling-length-method


http://fastutil.di.unimi.it/docs/it/unimi/dsi/fastutil/BigArrays.html

2013년 1월 27일 일요일

haskell monad

http://stackoverflow.com/questions/2704652/monad-in-plain-english-for-the-oop-programmer-with-no-fp-background/2704795#2704795