Red Baron

POST : 일상

새벽1

새벽1

기말 고사 기간 새벽 학교..
사범대에서 3공 건물을 가다
동트는 모습..
(공모 참여)
top

posted at

2006. 12. 12. 21:56


POST : 일상

Kreisler_liebesleid


겨울날 저녁에 외딴곳에서 들었던것 같은 음악이다.
20세기 초반 많이 들었을 법한 음악..
그냥 괜찮아서...
top

posted at

2006. 12. 11. 11:10


POST : Program

lisp study1

(defun make-cd (title artist rating ripped)
  (list :title title :artist artist :rating rating :ripped ripped))

(defvar *db* nil)

(defun add-record (cd) (push cd *db*))

(defun dump-db ()
  (dolist (cd *db*)
  (format t "~{~a:~10t~a~%~}~%" cd)))

(defun prompt-read (prompt)
  (format *query-io* "~a: " prompt)
  (force-output *query-io*)
  (read-line *query-io*))

(defun prompt-for-cd()
  (make-cd
  (prompt-read "Title")
  (prompt-read "Artist")
  (or (parse-integer (prompt-read "Rating") :junk-allowed t) 0)
  (y-or-n-p (prompt-read "Ripped [y/n]:"))))

(defun add-cds()
  (loop (add-record (prompt-for-cd))
(if (not (y-or-n-p "Another? [y/n]: ")) (return))))


-. list --> macro for list strucrure

-. (list :title title :artist artis)
   :<- make index for data

-. ~is likely % from printf in C
-. or make not null to input data that is null ,and make default value of 0
-. y-or-n-p make constraint to input y or n (common lisp function)


top

posted at

2006. 12. 10. 22:37


POST : Program

ping program

//제작은 제가 한거 같은데...어디서 참고를 한건지는 기억이 잘..-_-;;

//쓰실때 출처는..코멘트를 해주세요.....흐..

//아마도 제가 기억하기로는 linux source쪽에서 가져 온거로 알고 있습니다..

//모 거의 모든 부분이 linux source쪽 그대로지 않나 싶네요..

//수정한 부분이 있긴 있을텐데..기억이 잘 안나네요..2년전에 작성한거라서리..-_-;;


top

posted at

2006. 12. 9. 14:38


POST : Program

memory leak prof - valgrind

출처:http://smiletw.myscan.org/wiki/moin.cgi/valgrind
$ valgrind --leak-resolution=high --trace-malloc=yes --leak-check=yes --show-reachable=yes -v [프로그램 풀 경로] 

실행이 끝난 다음에 malloc/free 된 메모리들에 대한 현황을 ERROR SUMMARY라는 이름으로 알려줍니다. leak된 것들이 있다면 어떤 종류이고 어떤 내용이 들어있는지 등등을 자세히 알려주니 그것을 보시면 디버깅이 손쉬울 겁니다. 혹 출력되는 메시지가 너무 많아 방해가 되면 --trace-malloc=yes 를 빼주셔도 이 경우에는 별 상관 없을겁니다. malloc/free 될때마다 뿌려주는 메시지를 출력안하는 것입니다.

만약 한번의 alloc에 대해 두번의 free가 가해졌다면 아래와 같은 메시지가 그 위치를 알려줍니다. 보시다시피 main.c의 52번째줄에서 이미 free한 메모리 블럭에 대해 main.c의 53번째줄에서 잘못된 free를 수행한 걸로 나옵니다.

 ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) 
==29279== 
==29279== 1 errors in context 1 of 1: 
==29279== Invalid free() / delete / delete[] 
==29279== at 0x40025E87: free (in /usr/lib/valgrind/vgskin_memcheck.so) 
==29279== by 0x80489C3: main (main.c:53) 
==29279== by 0x4024190A: __libc_start_main (in /lib/libc-2.3.2.so) 
==29279== by 0x80488E0: (within /home/youlsa/src/montgomery/actiontag) 
==29279== Address 0x4109C024 is 0 bytes inside a block of size 200 free'd 
==29279== at 0x40025E87: free (in /usr/lib/valgrind/vgskin_memcheck.so) 
==29279== by 0x80489B2: main (main.c:52) 
==29279== by 0x4024190A: __libc_start_main (in /lib/libc-2.3.2.so) 
==29279== by 0x80488E0: (within /home/youlsa/src/montgomery/actiontag) 
==29279== IN SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) 
top

posted at

2006. 12. 9. 14:38


CONTENTS

Red Baron
BLOG main image

RSS 2.0Tattertools
공지 아카이브
최근 글 최근 댓글 최근 트랙백
카테고리 태그 구름사이트 링크