'잡동사니'에 해당되는 글 13181건

  1. 2013.01.19 lisp backquote / 유사인용
  2. 2013.01.19 올림픽 공원
  3. 2013.01.19 다들 이렇게 냥덕후가 되어가는거야
  4. 2013.01.18 피곤하다.. 2
  5. 2013.01.18 일하기 싫어 2012년 한해정리 주저리 4
  6. 2013.01.17 중선관위 개표 시연회?
  7. 2013.01.17 lisp rem, mod
  8. 2013.01.17 lisp i/o
  9. 2013.01.17 lisp file i/o
  10. 2013.01.16 lisp savefun / load
Programming/lisp2013. 1. 19. 23:19
어떻게 보면.. printf()의 기분?

> (defun tt-path (edge)                                               
'(there is a ,(caddr edge) going, (cadr edge) from here.))            
tt-path                                                               
> (tt-path '(garden west door))                                       
(there is a (comma (caddr edge)) going (comma (cadr edge)) from here.) 

> (defun t2-path (edge)                                   
`(there is a ,(caddr edge) going, (cadr edge) from here.))
t2-path                                                   
> (t2-path '(garden west door))                           
(there is a door going west from here.)                   

'Programming > lisp' 카테고리의 다른 글

lisp eval & apply  (0) 2013.01.22
xlisp에서 incf 오류  (0) 2013.01.19
lisp rem, mod  (0) 2013.01.17
lisp i/o  (0) 2013.01.17
lisp file i/o  (0) 2013.01.17
Posted by 구차니


겁나빠름.. 1/1000초로 찍었는데 흐려지다니.. -_-


열매 뫄이쪙!




올림픽공원에 서식중인 토선생님


만렙토...끼?



'개소리 왈왈 > 사진과 수다' 카테고리의 다른 글

비오는 날의 올림픽 공원  (4) 2013.04.06
많이 늦은 CPL 필터 사용기  (0) 2013.02.02
올림픽공원 청둥오리  (0) 2013.01.12
올림픽 공원 스케이트 장  (8) 2013.01.05
서울 남산 한옥 마을  (2) 2012.12.30
Posted by 구차니
개소리 왈왈2013. 1. 19. 16:13

'개소리 왈왈' 카테고리의 다른 글

슈니볼  (2) 2013.04.29
어제의 멘붕 ㅋㅋㅋ  (0) 2013.04.27
구글 번역 ㅋㅋㅋ 앜ㅋㅋㅋ  (0) 2012.12.16
잉여로운 주말  (0) 2012.12.09
멘붕 리커버 / 성격개조 모드  (0) 2012.11.05
Posted by 구차니
벌써 18일이라니.. 시간만 드럽게 잘가는구나..


그나저나 이제서야 4대강 보에 대해서 욕하시는 부모님..
4대강 진행할때 그렇게 반대했는데 이제와서 멀 그러냐고 한소리 하니
반대할때 제대로 반대해야지 무조건 반대했자나!! 라고 하시는데
이걸 보면서 도대체 멀 어떻게 반박을 해야하나?

결국 부모님 세대가 보기에는 반대하는 사람은 이유없이 반대하는걸로 밖에 안보는거구나.
지금에 와서 결과가 어떻게 되었던 간에... 
Posted by 구차니
작년의 승리자는.... 아빠?

1. 어쩌다 보니 G830 데탑 한대(신품)
2. 어쩌다 보니 아이패드2 한대(중고) 
3. 벼르다 보니 Canon Powershot SX50HS 50배줌(신품)
4. 노리다 보니 카메라용 온갖 필터들


나 스스로에게 해준게 없었던게 조금 서글프지만
그래도
그래도 지금까지 키워주신 보답으로
이정도는 해드려야지 라는 기분? 

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

내일 울산... ㅠ.ㅠ  (0) 2013.01.26
ytn 아나운서의 난해한 패션  (2) 2013.01.25
2013년 새해가 밝았구나  (4) 2013.01.01
2013년 할일  (2) 2012.12.31
해를 마무리 하며  (0) 2012.12.30
Posted by 구차니
이런 재미난 이벤트가 있는지도 몰랐네 -_-
아무튼 무효표 2000장 하는데 90장 비는데 문제없이 개표된걸로 시연하고
6000장 개표하는데 2시간 15분 걸렸다고 하는데 전국 개표소 수를 고려했을때
빨라야 새벽 2시 즈음에나 결과가 나올수 있다는 내용도 있고
선관위에서도 30일간만 투표용지 보관한다는 이야기도 있고..

참내..
예전 선관위 홈페이지에 30일 이후에는 선관위 규칙에 의해서 처리한다고 되어 있고,
30일 이내에 선거무효소송을 통해 할수 있다고 해서
최소 30일 이상은 보관할거라고 생각을 했는데...
정말 30일 뒤에 바로 없애려고 한다니..
최소한 임기 끝날때 까지는 보존해야 하는거 아닌가?


선관위 측은 이에 대해 "만약에 선관위가 부정한 의도로 지시를 했다면 그런 증언이 있었을 것"이라며 "(투표지)보관은 잘 돼있다. 원래 투표종료 한 달 후에는 절차를 거쳐 폐기하지만 그 절차를 생략하고 보관하고 있겠다. 우리도 투표지를 보여드릴 기회가 있으면 좋겠다"고 말했다.

[링크 : http://media.daum.net/politics/others/newsview?newsid=20130117180211461

Posted by 구차니
Programming/lisp2013. 1. 17. 19:26
reminder 나 modulo 나 둘다 나머지 연산인데
왜 굳이 두개의 이름으로 별도로 존재하나 했더니

양수에서는 차이가 없으나, 음수에서 차이가 발생한다.
2> (mod  5 2) 
1             
2> (mod  5 -2)
-1            
2> (rem  5 2) 
1             
2> (rem  5 -2)
1              


    Rem(x, 5):

                       5+         o         o
                        |       /         /
                        |     /         /
                        |   /         /
                        | /         /
    *---------*---------*---------*---------*
   -10      / -5      / 0         5        10
          /         /   |
        /         /     |
      /         /       |
    o         o       -5+

    Mod(x, 5):

              o        5o         o         o
            /         / |       /         /
          /         /   |     /         /
        /         /     |   /         /
      /         /       | /         /
    *---------*---------*---------*---------*
   -10        -5        0         5        10

    Rem(x, -5):

                       5+         o         o
                        |       /         /
                        |     /         /
                        |   /         /
                        | /         /
    *---------*---------*---------*---------*
   -10      / -5      / 0         5        10
          /         /   |
        /         /     |
      /         /       |
    o         o       -5+

    Mod(x, -5):

    *---------*---------*---------*---------*
   -10      / -5      / 0       / 5       /10
          /         /   |     /         /
        /         /     |   /         /
      /         /       | /         /
    o         o       -5o         o
 
[링크 : http://mathforum.org/library/drmath/view/54377.html

'Programming > lisp' 카테고리의 다른 글

xlisp에서 incf 오류  (0) 2013.01.19
lisp backquote / 유사인용  (0) 2013.01.19
lisp i/o  (0) 2013.01.17
lisp file i/o  (0) 2013.01.17
lisp savefun / load  (0) 2013.01.16
Posted by 구차니
Programming/lisp2013. 1. 17. 18:53
c언어로 치면 printf() 와 scanf()인데
어짜피 stream 이기 때문에 file을 열어 놓은 스트림을
read나 printf 계열 함수에 연결해서 써도 문제는 없을듯 하니
c언어 보다 더욱 범용성이 있어 보인다고 해야하나
c보다는 리눅스의 FMIO(File Mapped IO)에 가까운 느낌이라고 해야하나?

read an expression
(read [<stream> [<eofp> [<eof> [<rflag>]]]])

print an expression on a new line
(print <expr> [<stream>])

print an expression
(prin1 <expr> [<stream>])

print an expression without quoting
(princ <expr> [<stream>])

pretty print an expression
(pprint <expr> [<stream>])

print to a string
(prin1-to-string <expr>)
(princ-to-string <expr>) 

> (print "test string") 
"test string"           
"test string"           
> (print '(test string))
(test string)           
(test string)            
 
> (princ "test string") 
test string             
"test string"           
> (princ '(test string))
(test string)           
(test string)           

> (prin1 "test string") 
"test string"           
"test string"           
> (prin1 '(test string))
(test string)           
(test string)           

'Programming > lisp' 카테고리의 다른 글

lisp backquote / 유사인용  (0) 2013.01.19
lisp rem, mod  (0) 2013.01.17
lisp file i/o  (0) 2013.01.17
lisp savefun / load  (0) 2013.01.16
xlisp  (0) 2013.01.16
Posted by 구차니
Programming/lisp2013. 1. 17. 18:50
C언어로 치면 feopn() / fclose() / fseek() / fread()

xlisp.exe의 경로에 생성됨.
ubuntu의 clisp는 실행된 "현재경로"에 생성됨.
> (setq out-stream (open "my-temp-file"))                    
error: file does not exist - "my-temp-file"                  
1> (setq out-stream (open "my-temp-file" :direction :output))
#<Character-Output-Stream 4:"my-temp-file">                  
1> (close out-stream)                                        
t                                                            
1> (setq out-stream (open "my-temp-file"))                   
#<Character-Input-Stream 4:"my-temp-file">                   
1> (close out-stream)                                        
t                                                            
1>                                                            

[링크 : http://psg.com/~dlamkins/sl/chapter03-11.html]

open a file stream
(open <fname> &key :direction :element-type :if-exists :if-does-not-exist)

close a file stream
(close <stream>)

check for existance of a file
(probe-file <fname>)

delete a file
(delete-file <fname>)

get length of file
(file-length <stream>)

get or set file position
(file-position <stream> [<expr>])

read a byte from a stream
(read-byte <stream>[<eofp>[<eof>]])

write a byte to a stream
(write-byte <byte> <stream>)

'Programming > lisp' 카테고리의 다른 글

lisp rem, mod  (0) 2013.01.17
lisp i/o  (0) 2013.01.17
lisp savefun / load  (0) 2013.01.16
xlisp  (0) 2013.01.16
lisp 연관리스트  (0) 2013.01.14
Posted by 구차니
Programming/lisp2013. 1. 16. 22:05
xlisp의 경우 실행파일 위치가 XLPATH 인듯 하고
해당 위치에 자동으로 *.lsp 파일을 읽거나 저장한다.

load a source file
(load <fname> &key :verbose :print)

An implicit errset exists in this function so that if error occurs during loading, and *breakenable* is NIL, then the error message will be printed and NIL will be returned.  The OS environmental variable XLPATH is used as a search path for files in this function.  If the filename does not contain path separators ('/' for UNIX, and either '/' or '\' for MS-DOS) and XLPATH is defined, then each pathname in XLPATH is tried in turn until a matching file is found.  If no file is found, then one last attempt is made in the current directory.  The pathnames are separated by either a space or semicolon, and a trailing path separator character is optional.

<fname> the filename string, symbol, or a file stream created with open. The extension "lsp" is assumed.
:verbose the verbose flag (default is T)
:print the print flag (default is NIL)
returns T if successful, else NIL 

save function to a file
(savefun <fcn>)

defined in init.lsp

<fcn> function name (saves it to file of same name, with extension ".lsp")
returns T if successful  


사용예
> (defun add (a b) (+ a b))
add                        
> (savefun add)            
"ADD.lsp"                   

> (load "add")        
; loading "add.lsp"    
t                      
> (add 2 3)           
5                      
> #'add               
#<Closure-ADD: #9b92b0> 

'Programming > lisp' 카테고리의 다른 글

lisp i/o  (0) 2013.01.17
lisp file i/o  (0) 2013.01.17
xlisp  (0) 2013.01.16
lisp 연관리스트  (0) 2013.01.14
lisp의 con cell 과 NIL  (0) 2013.01.14
Posted by 구차니