달력

22025  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28

'DHTML > AJAX' 카테고리의 다른 글

http://www.christofwagner.com/  (0) 2007.02.05
[참고할곳] http://www.endless.com/  (0) 2007.01.19
The Lightbox Effect without Lightbox  (0) 2007.01.11
http://prototype-window.xilinus.com/  (0) 2006.11.30
[ajax] 우편번호 찾기 초보버전  (2) 2005.08.22
Posted by tornado
|

오토미션 관리상 가장 중요한 것은 주행습관, 미션오일교체, 오일량 3가지 입니다. 특히 미션오일이 생명인 만큼, 교체시기를 놓치지 말고 관리해줄 필요가 있습니다.




 보통 오토미션오일은 신차 출고 후 최초 1만 KM에서 신품으로 교환을 해주는 게 좋습니다. 1만 KM까지는 미션을 길들이는 와중에 내부 쇠 가루가 발생되고 침전되면서 미션내부의 미세한 통로와 기계장치에 문제를 야기해 수명을 단축 시킬 수 있기 때문입니다. 그 후부터 미션오일 교체 주기는 과속을 하느냐 그렇지 않느냐에 따라 달라집니다. 실제로 급가속을 하지 않고 고속으로 장거리를 운행하지 않는 경우에는 평균 수명보다 훨씬 더 길게 쓸 수가 있고 반대로 고속주행을 자주하거나 킥다운을 사용해 급가속을 자주 하는 경우엔 미션오일 온도가 오랫동안 높게 유지 되어 쉽게 점도가 떨어지고 변질되므로 평균 수명보다 현저하게 떨어질 수 있습니다.
하지만 일반 운전자들이 위와 같은 내용을 적용 시키면 어떻게 교체 주기를 계산해야 할지 잘 모르기 때문에 평균3~5만KM마다 교환을 해주면 된다고 보시면 됩니다.

 미션오일 교체주기는 색깔로도 간접확인이 가능합니다. 깨끗한 헝겊에 오일게이지 빼내고 묻어 있는 오일을 닦아서 색상이 맑고 투명한 빨강색 또는 선홍빛을 나타내고 있다면 양호하다고 볼 수 있습니다. 점도가 탁하거나 교체시기가 다가 오면 진한 갈색 또는 옅은 검정색에 가까운 색깔을 띄게 됩니다.


                         
 이제는 미션 오일을 체크해 볼까요?
 먼저 본네트를 열면 엔진 양쪽으로 노란색 손잡이와 빨간색 손잡이가 있습니다. 노란색은 엔진오일 게이지, 빨간색은 미션오일 게이지입니다. 어느 차나 다 똑같습니다.
 미션오일은 오일의 온도에 따라 냉간 시,온간 시로 나뉘어 오일량이 다르게 체크됩니다. 실제 미션오일 게이지를 빼내어 확인해보면 2가지 형태로 4개의 오일량 체크선이 그어져 있는데 일반 운전자들은 어느 부위에 오일량이 찍혀야 정상인지 알 수가 없으므로 다음과 같이 점검 체크 하면 쉽게 알 수 있습니다. 실제 전문가 들도 아래와 같은 방법으로 체크하고 있답니다. 따라 해보세요.



1) 엔진시동을 켠 후 계기판 내의 냉각수 온도 바늘이 중간까지 가도록 3~5분 정도 주행을 가볍게 하거나 공회전 시킨다.
2) 평탄한 도로에 시동을 켠 상태로 주차해 놓는다.
3) 브레이크 페달을 밟은 상태에서 변속레버를 P=>R=>N=>D=>3=>2=>1로 3초간 머무르면서 움직인다.
4) 반대로 1=>2=>3=>D=>N=>R=>P 변속레버를 3초간 머무르면서 움직인 후 레버를 N 위치로 고정시켜 놓는다.
5) 시동이 걸려 있는 상태에서 사이드 브레이크를 당긴 후 본네트를 연다.
6) 미션오일 게이지를 뽑아 깨끗한 헝겊으로 1차 닦아 내고 다시 찍어 보아 그림과 같이 근처에 오일이 찍히게 되면 오일량은 정상이다.

'이것저것 > 낙서장' 카테고리의 다른 글

의정부로 이사하다~!  (0) 2007.04.23
아파트 등기하는 법  (0) 2007.02.20
APE 파일 음악듣기와 MP3로 변환  (0) 2007.02.01
생일축하 이벤트!!!  (6) 2007.01.24
새 핸드폰.. 껍데기가 생각보다 불편함.  (0) 2007.01.14
Posted by tornado
|
Posted by tornado
|
Posted by tornado
|
Posted by tornado
|

1. Ape 파일이란?

 

APE 파일 Monkey's Audio 포맷으로 WAV,MP3,OGG 처럼 음악 포맷의 한 종류입니다.

Ape 음악포맷은 무손실 음악 포맷입니다.
wav 시디음원을 0% 손실도 없이 압축시킨 포맷중 하나가 ape 입니다.
이외 다른 무손실 포맷도 잇으나 ape 포맷이 압축율이 가장높습니다
(즉 어떠한 파일을 zip,rar 형식으로 압축한 것과 비슷합니다)
ape 는 음악포맷입니다 ape 상태에서도 청취가 가능합니다.

2. Ape 재생 방법

제트오디오 , Foobar2000 (기본적으로 Ape 파일을 재생할수 있는 플레이어)
Winamp 쓰시는분들은 첨부한 플러그인을 설치하셔서 재생하면 됩니다.

 

 

3. Ape 파일을 WAV파일로 변환 하기

 

Monkey’s Audio 3.99 (full installation)

 

위의 변환기를 다운받아 설치 하시고 변환하면 되겠습니다.

 


 

1. MODE 옵션에서 DECOMPRESS 선택합니다.

2. FILE > ADDFILE > 변환 하고자 하는 APE 를 선택 합니다.

3. DECOMPRESS (갈색상자 같은 그림) 그림을 클릭하시면 APE - WAV 로 변환됩니다. 
   마찬가지로 저장되는 폴더는 APE가 있는 폴더가 됩니다.

 

 

 

4. WAV 파일을 MP3로 변환하기

 

 

wav 파일을 mp3 파일로 변환 하는 방법은 일반적으로 많이 알려져 있으니 편하실 대로...

Sound Forge로 변환 하셔도 좋고 Shuffler를 이용 하셔도 좋겠네요.

제 블로그 utility 목록 첫번째 보시면 suffler를 이용한 mp3 변환 방법이 있으니 참조 하시길...

'이것저것 > 낙서장' 카테고리의 다른 글

아파트 등기하는 법  (0) 2007.02.20
오토미션오일주기  (0) 2007.02.12
생일축하 이벤트!!!  (6) 2007.01.24
새 핸드폰.. 껍데기가 생각보다 불편함.  (0) 2007.01.14
손석희의 지각인생  (0) 2007.01.12
Posted by tornado
|

80년대 로라장 음악 ㅋ

 

학교 안가고 로라장 갔던 추억이 -.-

 



< 출처 : youtube.com >

'이것저것 > 음악' 카테고리의 다른 글

[국산] SpearGuitar GLADIUS-1  (0) 2007.03.09
[Guitar] Dame Saint t290..  (0) 2007.03.09
Gary Moore - Still got the blues LIVE  (0) 2007.01.28
Spear Gladius-SP 사용기  (0) 2006.12.16
토미아저씨 Guitar boogie  (0) 2006.12.08
Posted by tornado
|





< 출처 : youtube.com >

'이것저것 > 음악' 카테고리의 다른 글

[Guitar] Dame Saint t290..  (0) 2007.03.09
추억의 노래. Mr. Zibago - Little Russian  (0) 2007.01.28
Spear Gladius-SP 사용기  (0) 2006.12.16
토미아저씨 Guitar boogie  (0) 2006.12.08
런던보이스 - I'm Gonna Give My Heart  (0) 2006.12.02
Posted by tornado
|

사용자가 생성한 쓰레드내 (사용자 쓰레드) 에서, 메인 쓰레드가 소유한 컨트롤 객체를 제어하기 위해서는 Invoke 를 통해 해결하셔야 합니다.


간략히 이해하시려면 사용자 쓰레드에서 이벤트를 발생시켜서, 메인 쓰레드에서 이벤트로 받아 처리하라는 이야기 인데요. (이게 더 말이 어렵나??


개발자는 머니머니해도 소스 몇줄 보여드리면 이해가 팍팍..


        // 버튼을 누르면 쓰레드 동작..

        private void button1_Click(object sender, System.EventArgs e)

        {           

            hTread = new Thread(new ThreadStart(Test));

            hTread.Start();

        }


        private void Test()

        {

            try

            {

                while(true)

                {

                    // Form2 를 열기위한 이벤트 발생..

                    this.Invoke(new EventHandler(InvokeShowDialog));

                    Thread.Sleep(5000);

                }

            }

            catch(Exception err)

            {

                MessageBox.Show(err.ToString());

            }

           

        }

     

        // 이벤트 처리

        private void InvokeShowDialog(object sender, EventArgs e)

       {

            Form2 f = new Form2();

            f.Show();

       }

Posted by tornado
|

[링크] dhtml grid control

DHTML 2007. 1. 25. 16:54
Posted by tornado
|
01월10일은 돌풍님의 생일입니다. 축하해주세요!
Posted by tornado
|

아파치 튜닝 정리

JAVA/WAS 2007. 1. 19. 17:37
아파치 튜닝 정리

아파치 튜닝 정리

1. 웹 페이지 로딩시간 확인
#time -pa lynx -source http://www.gwise.com > /dev/null
real 0.74
user 0.16
sys 0.09
-------------
실제 접속시간 : 0.74-(0.16+0.09)=0.49초


2. 아파치 벤치 마킹
#man ab 사용법 보기
-n requests 요청을 수행할 개수
-c concurrency 요청을 만들 개수로 동시 사용자 개념으로 이해하면 되겠다.
-v verbosity 얼마나 자세한 정보를 화면에 출력해 줄 것인지 결정
-w HTML 문서형식으로 테이블로 만들어 결과를 화면에 출력
-k HTTP 프로토콜의 지속연결 (KeepAlive) 기능을 사용

#./ab -n 100 -c 10 http://www.gwise.com:80/
10 명의 유저가 동시에 http://www.gwise.com/index.html 을 요청하는 것을 모의 실험.
각각의 시뮬레이트 유저는 요청을 10 번씩 하게 됩니다

# ab -n 1500 -c 50 http://www.apache.kr.net:80/
요청을 30 x 50 (50 명의 사용자가, 각각 30 번의 요청)

Requests per second: 80.48
초당 80.48개를 요청 했음.

'MaxRequestsPerChild’ 는 메모리 누수현상(?) 등이 발생하지 않는다면 가능한 이 값을 높게 설정하시고요(파라미터의 값을 0 으로 설정해 무한대로 하실수도 있습니다) StartServers’ 는 프로세스가 active 되어 있는 경우가 적을 경우 값을 낮게 설정하시고, 접속량이 아주 많을 경우는 MaxClients 에 가깝게 조절하시기 바라며, MaxSpareServers 를 MaxClients 와 같게 설정합니다. MaxClients 는 너무 낮게 설정하지 않도록 주의하시기 바라며, 그렇다고 또 너무 크게 잡으셔도 안됩니다


3. 웹 서버 삽질 막기
BrowserMatch "WebZip" go_out
BrowserMatch "Teleport" go_out
BrowserMatch "GetRight" go_out



....
Deny from env=go_out


4. 아파치 튜닝
일반 서버에서는 다른것은 그냥 Default 값으로 둔다.
(대형 서버의 경우 말고는 특히 쓸 일어 없을 것이다.)

증가 시킬 경우 배수로 한다. 꼭 이렇게 해야 한다가 아니라
이렇게 하면 좋다.

Timeout 300
클라이언트의 요청에 의해서 Server와 연결 되었을때
클라이언트와 서버간의 아무런 메시지가 발생하지 않았을때
오류로 처리하는 시간
네트워크 속도가 나쁠수록 수치값을 높게 한다.

KeepAlive on
지속적인 접속, 즉 서버 연결에 대하여 한번 이상의 요청을 허용 여부.

MaxKeepAliveRequests 100
클라이언트가 접속된 시간동안 아파치 서버에 요청할 수 있는 처리 process 개수

StartServers 5 X ? =20 -> 초반에 뜰 process 그 이상 그이하의 의미도 없다.
MinSpareServers 5 X ? =20 -> Spare 프로세스가 이것 이하 일때 끌어 올려 준다.
MaxSpareServers 10 X ? =40 -> Spare 프로세스가 이것 이상 일때 진정(?)시켜 준다.
말 그대로 Spare.... 언제 있을지 모를 요청에 대해서 컴퓨터 스스로가
조절해 준다.

MaxClients 150
클라이언트들이 동시에 최대로 접속했을때 가능한 최대 서버이 수를 지정.
Ulimit -a ~~~ max process...이 수치 이상 증가 못함.
httpd.h
HARD_SERVER_LIMIT=250 조정해서 다시 컴파일 가능

MaxClient 150 -> 동시에 떠 있을수 있는 최대 process
더 많은 수를 원할시 httpd.h 소스 파일의
HARD_SERVER_LIMIT 값을 수정 한 다음 다시 컴파일 해야 한다.

#ulimit -a
core file size (blocks) 0
data seg size (kbytes) unlimited
file size (blocks) unlimited
max memory size (kbytes) unlimited
stack size (kbytes) 8192
cpu time (seconds) unlimited
max user processes 2048
pipe size (512 bytes) 8
open files 1024
virtual memory (kbytes) 2105343
-----------------------
위의 max user processes 의 수를 초과 할 수 없다.

MaxRequestPerChild 100
한 프로세스가 몇 번의 서비스를 하고 소멸될 것인지 정한다.
M$계열에서는 별 의미가 없으므로 0을 한다.
하지만 Unix 계열은 0을 사용하지 않는 것이 좋다.

가장 중요한 것은Timeout 설정입니다. 위에서 keep-alive 를 설정해 놓은
경우, 하나의 connection에서 계속해서 다음 request를 처리할 수 있기 때문에 효율적
이라고 하지만, 실제로는 그렇지 않습니다. keep-alive 를 허용하고 그 timeout을
5초로만 설정해도, 하나의 request를 처리한 후 적어도 5초동안은 그 httpd가 다른
작업을 하지 못하고 다음 request를 기다리게 됩니다.

보통 웹브라우저들은 서버로 동시에 4개의 connection을 만들게 됩니다. 한 페이지를
보는데 이미지 등등 해서 보통 4개의 connection을 만드는 것은 기본이죠. 이렇게 되면
httpd가 100개 떠 있다고 해도, 실제로는 동시에 25명의 방문자밖에 처리하지 못합니다.

그리고 keep-alive timeout이 5초인 경우, 한 명의 방문자를 처리한 후 적어도 5초동안은
계속해서 기다리면서 httpd가 놀게 됩니다.(그렇다고 해서 httpd의 수를 늘여주면 앞의
문제 때문에 load가 몰릴 때 순간적으로 부하가 지나치게 많이 걸리게 됩니다. 어떤
request는 수초가 지난 후 답을 받는 등 quality of service가 많이 떨어지죠.)

결국 한 명의 방문자를 처리하는데 4개의 httpd가 5초동안 작업한다는 뜻이고, 100개의
httpd를 띄워봐야 1초에 5명의 방문자밖에 처리하지 못하는 셈입니다. ( 1 명 / 5 sec /
4 httpd = 5 / 1 sec / 100 httpd )

그래서 검색엔진 서비스 등 traffic이 많은 사이트에서는 keep-alive 옵션을 반드시 꺼
놓게 됩니다. 그리고 connection timeout도 상당히 짧게 설정해 놓죠. 4~5초 이내로 말입니다


5. 아피치 튜닝-2(로그기록 로테이트로)
/home/apache/conf/httpd.conf
CustomLog /home/apache/logs/access_log common
TransferLog "|/home/apache/bin/rotatelogs /home/apache/logs/access_log 86400"
TransferLog "|/home/apache/bin/rotatelogs /home/apache/logs/error_log 86400"
--------------
24시간 마다 로그 화일을 갱신해 준다.
24X60X60=86400초


6. 아파치 에러 메시지 바꾸기
httpd.conf
Customizable error response (Apache style)
2) local redirects
ErrorDocument 404 /cgi-bin/missing404.pl

missing404.pl
---------------
#!/usr/bin/perl
print<<"(END_HTML)";
Content-type: text/htmlnn

요청하신 http://www.gwise.com$ENV{'REQUEST_URI'} 이 존재 하지 않습니다.
서버관리자 에게 문의 바랍니다.

(END_HTML)
exit;
---------------


7. 아파치 에러 코드
HTTP 1.1 status codes [TOP]
100 : Continue
101 : Switching protocols
200 : OK, 에러없이 전송 성공
201 : Created, POST 명령 실행 및 성공
202 : Accepted, 서버가 클라이언트 명령을 받음
203 : Non-authoritative information, 서버가 클라이언트 요구 중 일부만 전송
204 : No content, 클라언트 요구을 처리했으나 전송할 데이터가 없음
205 : Reset content
206 : Partial content
300 : Multiple choices, 최근에 옮겨진 데이터를 요청
301 : Moved permanently, 요구한 데이터를 변경된 임시 URL에서 찾았음
302 : Moved temporarily, 요구한 데이터가 변경된 URL에 있음을 명시
303 : See other, 요구한 데이터를 변경하지 않았기 때문에 문제가 있음
304 : Not modified
305 : Use proxy
400 : Bad request, 클라이언트의 잘못된 요청으로 처리할 수 없음
401 : Unauthorized, 클라이언트의 인증 실패
402 : Payment required, 예약됨
403 : Forbidden, 접근이 거부된 문서를 요청함
404 : Not found, 문서를 찾을 수 없음
405 : Method not allowed, 리소스를 허용안함
406 : Not acceptable, 허용할 수 없음
407 : Proxy authentication required, 프록시 인증 필요
408 : Request timeout, 요청시간이 지남
409 : Conflict
410 : Gone, 영구적으로 사용할 수 없음
411 : Length required
412 : Precondition failed, 전체조건 실패
413 : Request entity too large,
414 : Request-URI too long, URL이 너무 김
415 : Unsupported media type
500 : Internal server error, 내부서버 오류(잘못된 스크립트 실행시)
501 : Not implemented, 클라이언트에서 서버가 수행할 수 없는 행동을 요구함
502 : Bad gateway, 서버의 과부하 상태
503 : Service unavailable, 외부 서비스가 죽었거나 현재 멈춤 상태
504 : Gateway timeout
505 : HTTP version not supported

////////////////////////////////////////////////////////////////////
이부분은 트래픽 양이 큰 곳에서 사용하시면 좋습니다.
설정파일에서 참고할 부분들을 적은 것이니, 꼭 이렇게 바꾸실 필요는 없습니다.

MaxKeepAliveRequests 100 -> 10000
웹서버 프로세스가 지속적으로 접속을 유지하면서 처리할 수 있는 요청 개수입니다.
KeepAliveTimeout 15 -> 30
서버에 접속시에 웹페이지 객체들의 전송시 새로운 프로세스를 생성하지 않고 지속적으로 접속을 유지하고 담당하며,
이 클라이언트의 요청에 대한 타임아웃에 대한 값입니다.
StartServers 5 -> 20
MinSpareServers 5 -> 20
MaxSpareServers 10 -> 40
폭주하는 서버일 경우 SpareServer가 많으면 빨리 대처할 수 있습니다.
스탠드얼론 방식일 경우 새로운 접속 요청을 받으면 기존의 Spare Child Process를 포크해 새로운 자식 프로세스를
만들어 내므로 적당히 있어주면 좋습니다.
MaxRequestsPerChild 0 -> 1000
웹서버 프로세스가 일정 횟수의 클라이언트 요청을 처리하고 종료되는 수치입니다.
※ MaxClients 256 -> 1024
동시에 실행될 수 있는 최대 프로세스 수를 제한 하는 것입니다.
하지만 옵션을 1024로 확장하려면 소스레벨에서
아파치 설치전에 apache/src/include/httpd.h 파일에서
HARD_SERVER_LIMIT 256 으로 된것을 1280 으로 변경한후 컴파일 하여야 사용 가능하다.

'JAVA > WAS' 카테고리의 다른 글

아파치 + 톰캣 연동후 8009 커넥터 조정  (0) 2007.02.22
PermGen Space  (0) 2007.02.13
[펌]아파치 + 톰캣 연동  (0) 2006.09.25
Apache 모듈 중 mod_expires -- 이미지 캐시  (0) 2006.02.22
[펌] [weblogic] 웹로직 문제점 방안  (0) 2006.02.07
Posted by tornado
|

http://www.endless.com/


잘 만들었네~

Posted by tornado
|

출처 : http://www.sitepoint.com/print/painless-javascript-prototype

 

SitePoint Sponsor

Article


Dan Webb

Dan Webb Dan is a rehabilitated DHTML hacker turned web application developer for Vivabit, organisers of the @media conference. His current weapons of choice are Ruby on Rails and modern, unobtrusive DOM scripting. On those occasions he's not programming, he enjoys blogging on Vivabit's blog, (The Web's Bollocks), hording vast amounts of vinyl and eating cheese slices.

Dan Webb has written 2 articles for SitePoint with an average reader rating of 9.3.

View all articles by Dan Webb...

Painless JavaScript Using Prototype

By Dan Webb

February 22nd 2006

Reader Rating: 9.6

Prototype is an object oriented JavaScript [1] library (written by Sam Stephenson and friends) that makes JavaScript fun. So it says on the site [2], anyway. Those of you who are familiar with the open source community's latest and greatest application framework, Rails, may recognise Prototype as it actually forms the backbone of Rails' JavaScript helper. However, Prototype can be used independently of Rails to aid the coding of many JavaScript doodads and Web 2.0 thingy wangles.

Personally, I think the jury's out on the whole 'fun' JavaScript thing, but nevertheless Prototype is a really well executed JavaScript library which, although the situation has been improving of late, has had notoriously sparse documentation. This article provides a whirlwind tour of the whole library. It aims to give you enough examples and resources to get started using Prototype in your DOM [3] scripting projects.

First, we'll examine the basic building blocks of Prototype: its $ functions, its additions to the String, Number, Array [4] and Function objects, its form handling capabilities and its DOM functions. Then, we'll move on to look at Prototype's well-known AJAX [5] helpers. Finally, we'll finish with a brief discussion of other interesting projects that are based on it.

I'd like to note that the current stable version of Prototype at time of writing is 1.4.0. I have a feeling that the library will change quite quickly in response to Rails' lightning-quick development cycle, so things will change. The final boring note is that at this time Prototype only supports the newer browsers -- as you might expect of a DOM and XMLHttpRequest based library. See the Prototype site [6] for details of browser support.

Getting Started

The latest version of Prototype can be downloaded from the prototype site [7]. Simply download prototype.js and link it to your pages with a <script> tag:

<script type="text/javascript" src="path/to/prototype.js"></script>

If you're on Rails, you don't need to download Prototype: it's included in the distribution. You can include it into your views by putting this into the <head> of your pages:

<%= javascript_include_tag 'prototype' %>

Now, let's get into it!

Prototype's Little Helpers

One of the really nice things about using Prototype is the deadly simple helper functions that it provides for very common scripting tasks. The $ function has already been getting some attention. Give it one or more element IDs, and it'll return references to them:


// reference to the element with the ID 'nav'
$("nav")
// an array of element references
$("img1", "img2", "img3")

It's like a souped-up document.getElementById and it's amazing how much more convenient coding seems when you use it.

Another incredibly useful function is document.getElementsByClassName, which does what it says on the tin: it takes a CSS [8] class name and returns a list of all elements with that class:

// all elements with class 'navlink'
document.getElementsByClassName("navlink")
// all elements with class navlink and inside the element with ID 'nav'
document.getElementByClassName("navlink", $("nav"))

Also, as this article was being written, Prototype version 1.5.0_rc0 gained the powerful $$ function, which allows you to select elements using standard CSS selector syntax:

// an array of all input elements inside 'commentform'
$$("#commentform input")
// an array of all links with the class 'external'
$$("a.external")

Please note that, at the time of writing, unless you download the very latest version of Prototype from Subversion [9], this function won't be available to you.

$F takes an ID and returns the value of any form field, for instance, a select box like this:

<select name="country" id="country">
 <option selected="selected" value="UK">United Kingdom</option>
 <option value="FR">France</option>
 ...
</select>

$F('country') // 'UK'

Making JavaScript Suck Less

Oops, I've stolen another JavaScript library [10]'s tag line. JavaScript library developers just can't seem to keep from trying to make JavaScript be like another language. The Mochikit guys want JavaScript to be Python, countless programmers have tried to make JavaScript like Java [11], and Prototype tries to make it like Ruby. Prototype makes extensions to the core of JavaScript that can (if you choose to use them) have a dramatic effect on your approach to coding JavaScript. Depending on your background and the way your brain works, this may or may not be of help to you.

OO the Ruby(ish) way: Class.create and Object.extend

The Class.create method allows you to define classes in a more Ruby-like way, although this is purely aesthetic as it essentially just calls the initialize method you define as the constructor, rather than the taking the traditional JavaScript approach of creating objects with constructor functions.

var DOMTable = Class.create();
DOMTable.prototype = {
 initialize : function(el) {
   this.el = el;
 },
 ...
}

However, much more powerful is the stupidly simple but effective Object.extend method. All it does is copy one object's properties and methods to another object, but its uses are many. Here's a quick taster:

// make a (shallow) copy of obj1
var obj2 = Object.extend({}, obj1);

var options = {
 method : "post",
 args : ""
};

// merges in the given options object to the default options object
Object.extend(options, {
 args : "data=454",
 onComplete : function() { alert("done!"); }
});

options.method // "post"
options.args // "ata=454"
options.onComplete // function() { alert("done!"); }

It's most commonly used to "mix in" methods from one object with another. For instance, you could create a set of functions that make certain DOM elements sortable:

var Sortable = {
 sortBy : function(func) {
   ...
 },
 sortByReversed : function(func) {
   ...
 },
 reset : function() {
   ...
 }
};

Then, if we wanted to make our DOMTable from above sortable, we could mix in these methods to the DOMTable object:

var myTable = new DOMTable("table-id");
Object.extend(myTable, Sortable);

Now we can call those methods on the table:

// sort the table using the given function
myTable.sortBy(function (itemA, itemB) { ... });

Function Binding

Prototype also adds to the Function object two really useful methods: bind and bindAsEventListener. These are used mainly to bind a function to a particular object so that the this keyword points to that object. This is incredibly useful when you're setting event handler functions. Imagine you try something like this:

var myObject = new Object();
myObject.message = "Hello!";
myObject.eventHandler = function() {
 alert(this.message);
}

$("mydiv").onmouseover = myObject.eventHandler;

Traditionally, you'd get an error because, when the event triggers the handler function, this refers to the mydiv element, not myObject, so this.message is undefined. You can solve this problem using the bind method like so:

$("mydiv").onmouseover = myObject.eventHandler.bind(myObject);

Now it all works fine, because the this keyword is bound to myObject. Further to that, bindAsEventListener does that same thing, though it passes the event object through to your function in a cross-browser compatible way, so you no longer need to worry about window.event in IE. [12] Try this:

myObject.eventHandler = function(event) {
 alert(event.srcElement.nodeName);
}

$("mydiv").onmouseover = myObject.eventHandler.bindAsEventListener(myObject);

Now our eventHandler function has access to the event object. Much more detail on these two methods is available at their creator's site [13].

New String and Number Methods

Prototype has added an enormous number of useful methods to the built in String object. Let's have a quick look at some of the best.

// "backgroundColor"
"background-color".camelize()

camelize turns hyphenated strings to camel case strings that you can use to work with CSS properties.

// "I am a piece of HTML"
"I am a piece of <strong>HTML</strong>".striptTags()

// {a : 10, b: "thing"}
"a=10&b=thing".toQueryParams()

Prototype adds a great method to Number, too. Say goodbye to your for loops!

// alerts "1", "2", "3" ... "50"
50.times(function(n) {
 alert(n);  
}};

Here, the times method takes a function that will be called the given number of times, and passes in the current iteration number as an argument. This use of an iterator function is common when using Enumerable, which we'll discuss next.

Iterating the Ruby way: Enumerable and Hash

One of the hidden gems of Prototype is the Enumerable mix-in and the Hash object, which have been poached straight out of Ruby. If you're not familiar with Ruby, don't worry. I'll explain it all here.

We'll start with Enumerable. In short, when we add Enumerable to an object using Object.extend, it gives the object in question lots of really useful functions for working with its properties. Enumerable has been added to Array's prototype, so any array has these new methods. Here are a few examples of what you can do with the new "enumerated" arrays [14]:

// alerts "a is at 0" then "b is at 1" then "c is at 2"
["a", "b", "c"].each(function(item, index) {
 alert(item + " is at " + index);
});

// [80,50]
[1, 80, 3, 50].select(function(item) {
 return (item > 20);
});

select creates a new array that contains only the elements that make the function return true.

// ["A", "B", "C"]
["a", "b", "c"].invoke("toUpperCase");

invoke calls the specified method of each element of the array and returns the resulting array.

// ["cat", "rat"]
["cat", "dog", "rat", "mouse",].grep(/at/);

grep returns all elements that match the given regular expression.

Enumerable offers a large number of incredibly powerful functions that can make many tedious DOM scripting tasks a breeze. I strongly suggest you have a good look at the Enumerable methods in \">Sergio Pereira's extremely useful developer notes [15].

There's a small problem here, though. In JavaScript, you can come across many types of objects that, to all intents and purposes, act like arrays but aren't Array objects. Objects such as DOM NodeLists and function arguments won't have Enumerable available to them automatically. This is easy to rectify, though; to add the Enumerable functions to any array-like object, use $A:

// add Enumerable to childNodes
var children = $A($("mydiv").childNodes);

// sets class="highlighted" for all child nodes of "mydiv"
children.each(function(child) {
 child.setAttribute("class", "highlighted");
});

To create a hash, call the magic function $H on any object. This turns all the properties of the object into a set of key-value pairs with Enumerable mixed in. Let's take hashes for a spin:

// create a hash by feeding an object to $H
var contact = $H({
 name : "Dan Webb",
 email : "dan@danwebb.net",
 address : "None of your Business, London",
 postcode : "a111111"
});

// ["name", "email", "address", "postcode"]
contact.keys()
// ["Dan Webb", "dan@danwebb.net","None of your Business, London", "a111111"]
contact.values()
// "name=Dan Webb&email=..."
contact.toQueryString()

Hash extends Enumerable as well, so all those useful methods are also available...

// alerts "name contains Dan Webb" and so on
contact.each(function(item) {
 alert(item.key + " contains " + item.value);
});

At first, if you're not a Rubyist, Enumerable and Hash may seem a bit of a hassle but I can assure you, once you start using them, you'll wonder why you ever bothered getting RSI writing all those for loops! When you use one or more of them together, you'll realise the massive power of these new methods. You can \">read about Enumerable and Hash in more detail [16] at Encyte Media.

The Event object helps to provide what, to many, is the holy grail of JavaScript: simple, cross-browser event handling:

function eventHandlerFunction(e) {
 // the element that triggered the event
 var element = Event.element(e);
 // gets the mouse position
 var mouseX = Event.pointerX(e),
     mouseY = Event.pointerY(e);
 // stop default behaviour and event propagation
 Event.stop(e);
}

// register eventHandlerFunction to the onclick of myObject
Event.observe(myObject, "click", eventHandlerFunction, false);

// removes the event handler
Event.stopObserving(myObject, "click", eventHandlerFunction, false);

In a rather pleasant way, Prototype tries to avoid those pesky memory leaks in IE by automatically removing every observer when the page unloads.

In my opinion, though, this is a rather under-developed event handling solution at the moment, so it might be worth considering using something a bit richer like Dean Edwards's addEvent [17] for the time being.

Handling Forms

The Form and Field objects provide a number of simple but convenient functions for working with forms and input fields, as well as code that supports Prototype's AJAX implementation.

The Form Object

Generally, methods of the Form object take either an ID or an object reference to an element:

// disables the form making all elements read only
Form.disable(form)
// enables a form again
Form.enable(form)
// clears values from all form elements  
Form.reset(form)
// returns an array of all form fields in the form
Form.getElements(form)
// focuses on the first form field
Form.focusFirstElement(form)

The Field Object

The Field object deals with individual form elements, and its methods typically take an ID or an object reference to the element in a similar way to the Form object:

// clears the field, will accept any number of arguments
Field.clear(field)
// returns true if all given fields have a value
Field.clear(field, anotherField)
// gives focus to the field
Field.focus(field)
// selects any text in the field
Field.select(field)

Form Serialisation

In Prototype terms, serializing a form means reading all the form's elements and turning them into a URL-encoded string (nearly) identical to the one that would be sent if you submitted the form. For example, consider this form:

<form id="search" action="search.php [18]" method="post">
 <input type="text" name="query" value="thing" />
 <select name="field">
   <option value="artistname">Artist Name</option>
   <option value="title" selected="selected">Title</option>
 </select>
 <input type="submit" name="submit" value="Search" />
</form>

// query=thing&field=title&submit=Search
Form.serialize($("search"))

Notice that Form.serialize cleverly smoothes over the differences between the ways in which different form elements are accessed, so that inputs, selects, checkboxes and radio buttons are handled properly. Form.serialize is useful for several tasks, but comes into its own when we're working with AJAX, as we'll see shortly.

Form.serialize exhibits some strange behaviour that's worth mentioning here. You'll remember that I said the URL-encoded string that Form.serialize produces is nearly identical to the one that would be sent if you submitted the form. Well, it's "nearly identical" because Form.serialize doesn't deal with submit button or image inputs properly. It includes all submit buttons in the string, regardless of whether or not they've been pressed, and completely ignores image and button inputs. As long as you're aware of this, you can code around it.

Form Observers

Form.Observer and Form.Element.Observer allow you to watch a form (or, in the latter case, a single form element) and trigger callbacks when the data changes. There are actually two flavours of each observer that check for value changes. The first is a periodic observer, which works like this:

new Form.Observer($("myform"), 1, myCallBackFunction);
new Form.Element.Observer($("myfield"), 1, myCallBackFunction);

These observers check every second whether or not the data has changed and, if it has, will call myCallBackFunction.

The second type of observer is event-based and will only perform the check when change or click events are produced for the elements. You can use it like this:

new Form.EventObserver($("myform"), myCallBackFunction);
new Form.Element.EventObserver($("myfield", myCallbackFunction);

If all the fields in the form you're observing support an event handler, this is a much more efficient way to observe the form. However, if you want to watch for changes in elements that don't support these events, use the periodic observers.

Working the DOM

Prototype has 4 objects (Element, Insertion, Observer, and Position) that allow various forms of DOM manipulation and smooth over many of the browser differences that make dealing with the DOM so screen-smashingly infuriating. Instead of throwing your computer out the window, have a look through this section.

The Element Object

The Element object works in the way you've probably come to expect by this point: most of Element's methods simply take an ID or an object reference to the element you want to manipulate. Here's a peek at some of the most useful methods:

// Hides an element
Element.hide(element)
// Shows an element
Element.show(element)
// Adds a CSS class to the element
Element.addClassName(element, "cssClassName")
// Removes a CSS class from the element
Element.removeClassName(element, "cssClassName")
// Returns true if element has the CSS class
Element.hasClassName(element, "cssClassName")
// {width: 394, height: 20}
Element.getDimensions(element)
// replaces the innerHTML of element with newHtml
Element.update(element, newHtml)

See the full list at Sergio Pereira's site [19].

The Insertion Object

I know what you're thinking: this sounds a bit weird, right? Well, the Insertion object adds chunks of HTML in and around an element. There are 4 types of insertion: Before, After, Top and Bottom. Here's how you'd add some HTML before an element with the ID "myelement":

new Insertion.Before("myelement", "<p>I'm before!</p>");

This diagram shows where each type of Insertion will drop your HTML content in relation to the given element.

1514_insertions

The Position Object

The Position object offers a load of methods that can tell you about a given location on the screen, and provide information about that location relative to other elements, in a cross-browser compatible way. This should take much of the fiddliness out of writing animations, effects and drag-and-drop code. Have a look at the Position reference [20] for more details.

Get your Web 2.0 On

"Finally!" you're thinking, "He's got on to what we really want to know about." Yes, I've left it to the end to get into Prototype's AJAX helpers, because they're built on top of all the other stuff we've been going through, and it helps to understand Prototype's form serialization, observers and insertions when we talk about AJAX.

AJAX, in case you've been buried in a very deep hole for the past couple of years, refers to using the browser's XMLHttpRequest object (or equivalent) to communicate with the server without reloading the page. Prototype smoothes over most of the detail, but it's still good to get a bit of background on XMLHttpRequest, which you'll find in this article by Cameron Adams [21].

So, now you're all pumped to get some Web 2.0 action, let's look in to a really simple AJAX request:

new Ajax.Request("hello.php", {
 onSuccess : function(resp) {
   alert("The response from the server is: " + resp.responseText);
 },
 onFailure : function(resp) {
   alert("Oops, there's been an error.");
 },
 parameters : "name=Fred"
});

The Ajax.Request constructor takes a URL and an options object. In this case, we're sending a parameter (name) to hello.php, and alerting its response (or alerting an error if it doesn't work). It's worth taking the time to get familiar with what options are available; here's an overview of the options, along with their defaults:

1514_options

Prototype adds a custom HTTP header to all its AJAX requests so that your server application can detect that it's an AJAX call, rather than a normal call. The header is:

X-Requested-With: XMLHttpRequest

Here's an example PHP function used to detect an AJAX call:

function isAjax() {
 return isset($_SERVER['HTTP_X_REQUESTED_WITH']) &&
     $_SERVER ['HTTP_X_REQUESTED_WITH']  == 'XMLHttpRequest';
}

Using this approach, you can write AJAX applications that work even if the user is using an old browser or has JavaScript disabled, but that's a whole other article...

Using Form.serialize to Pass Data to Ajax.Request

As we've seen above, the parameters option is used to pass a URL-encoded string of variables. If the data you need to send is set by a form, as it is with most AJAX applications, you can simply use Form.serialize to generate a URL-encoded string from all of your form fields and pass that into the parameters option like so:

function addComment(e) {
 // submit the form using Ajax
 new Ajax.Request("comment.php", {
   parameters : Form.serialize(this),
   onSuccess : updateComment
 });
 Event.stop(e);
}

Event.observe($("commentform"), "submit", addComment, false);

Writing AJAX Event Handlers

In the example above, onSuccess and onFailure are two examples of AJAX event handlers. Event handler functions given in the options object of an Ajax.Request call are given one argument, which is the XMLHttpRequest object for that AJAX call. I normally call this argument response or resp. You can use this argument to get the response from the server like so:

function successHandler(resp, jsonObj) {
 // returns the response from the server as raw text
 resp.responseText
 // returns the response as an
XML [22] document that you can navigate with the DOM
 resp.responseXML
 // alert some property of the returned JSON
 alert(jsonObj.name);
}

Remember, though, that resp is just the XMLHttpRequest object, so all of those properties are available.

You can send data as JSON [23] from your server by adding the JSON data to the X-JSON response header. This will then automatically be evaluated by Prototype, and sent as the second argument.

The Ajax.Updater and Ajax.PeriodicalUpdater

Many AJAX operations simply involve updating some HTML on your page with HTML returned from the server. The Ajax.Updater object wraps Ajax.Request and simplifies this common use case for us. Here's a simple example:

new Ajax.Updater("mydiv", "hello.php", {
 parameters : "name=Fred",
 onFailure : function(resp) {
   alert("Oops, there's been an error.");
 }
});

The above snippet would simply replace the contents of the element whose ID was "mydiv" with whatever content was returned from the server. Ajax.PeriodicalUpdater is similar, but makes the Ajax call repeatedly at an interval that you set:

new Ajax.PeriodicalUpdater("mydiv", "hello.php", {
 // initial number of seconds interval between calls
 frequency : 1,
 decay : 2
});

The decay option allows you to give your server a bit of a break if it's returning a lot of identical responses. Essentially, every time PeriodicalUpdater makes a request, it compares the results with what the server returned last time. If the values are the same, it multiplies the interval by the decay value. So, for the above example, it would make the next request two seconds later, then four seconds later, and so on, until it received a different result from the server. At that point, the interval would be reset to one second.

AJAX with Responders

AJAX responders allow you to register global event handlers that are triggered for each and every AJAX request that happens on the page. They're very useful for managing applications with large amounts of AJAX activity. For instance, you can use them to show a standard loading animation whenever an AJAX request is happening:

Ajax.Responders.register({
 onCreate : showLoader,
 onComplete : hideLoader
});

If you are looking for some working examples of AJAX with Prototype, try this article [24].

Where to Next?

As we've seen through this article, Prototype not only is useful on its own, but provides an excellent starting point for writing other, more specialized libraries. That's exactly what a growing number of people have been doing.

Script.aculo.us and Moo.fx

Thomas Fuchs' script.aculo.us [25] is getting a lot of attention at the moment for its whiz-bang effects and clever UI [26] widgets. It was originally part of the core Prototype library, but soon grew out of control and broke free of its parent.

Using Prototype as a basis, script.aculo.us specialises in providing a rich user experience through animated effects, simple to use drag and drop functionality, and powerful UI components. There's a nice Wiki on the site, with a rapidly growing store of quality documentation to help you get started, and examples pages to get your creative juices flowing. As script.aculo.us is getting rather large in file size, it's been split into several files, so your users won't have to download the whole library just so you can use a few slide effects. However, even the individual files are pretty bulky.

If you're after some simple effects, I'd really recommend Moo.fx [27]. It's only 3k in size, and gives you some toggling slide and fade effects that, often, are all that's required in a simple AJAX application. It's also a great starting point if you want to write your own effects. Have a look at the code to see a great example of programming using Prototype's Object.extend to provide simple inheritance. Valerio is obviously very focused on keeping his script file sizes down, so he even has a 'lite' version of Prototype (chopped to around 10k), and a lean version of Ajax.Request [28], which I find myself using more often than the full Prototype library. It's definitely worth a look.

Behaviour

Behaviour [29] is a great addition to your DOM scripting toolkit that allows you to use CSS selectors to add behaviour to your documents. Here's a sample of what it allows you to do:

Behaviour.register({
 "#comment_form form" : function(el) {
   // catch form submission and complete with XHR if possible
   el.onsubmit = function() {
     Form.disable(this);
     new Ajax.Request(this.action, {
       method: this.method,
       postBody: Form.serialize(this),
       onComplete: updateComments});
     return false;
   };
 }
});

Read more about this over at the Behaviour site [30]. It's now possible to achieve a similar type of thing using the brand new $$ function discussed earlier, so this may eventually become redundant.

jQuery

jQuery [31] is a compact little library that plays well with Prototype and creates a superhero version of the $ function that can take XPath and CSS 3 selectors. It couples that capability with some extremely clever method chaining approach that makes for very concise code. Watch out for this one.

Wrap up

Prototype is a powerful piece of kit when it comes to adding some DOM scripted spice to your web applications. Unfortunately, its capabilities and tools have grown at a much faster rate than its documentation! We've managed to cover every corner of Prototype in this article, but not every method. I hope, though, that you now know where to go to get the extra information you need.

If you want to know more try Ronnie Roller's prototypedoc.com [32], a resource that keeps up with the growing body of Prototype documentation. Have fun!

Back to SitePoint.com

[1] /glossary.php?q=J#term_9
[2] http://prototype.conio.net
[3] /glossary.php?q=D#term_39
[4] /glossary.php?q=%23#term_72
[5] /glossary.php?q=A#term_73
[6] http://prototype.conio.net
[7] http://prototype.conio.net
[8] /glossary.php?q=C#term_8
[9] http://dev.rubyonrails.org/browser/spinoffs/prototype/
[10] http://mochikit.com
[11] /glossary.php?q=J#term_65
[12] /glossary.php?q=I#term_30
[13] http://www.brockman.se/writing/method-references.html.utf8
[14] /glossary.php?q=%23#term_72
[15] http://www.sergiopereira.com/articles/prototype.js.html#Reference.Enumerable

[16] http://encytemedia.com/blog/articles/2005/12/07/prototype-meets-ruby-a-look-at-enumerable-array-and-hash

[17] http://dean.edwards.name/my/events.js
[18] /glossary.php?q=P#term_1
[19] http://www.sergiopereira.com/articles/prototype.js.html#Element
[20] http://www.sergiopereira.com/articles/prototype.js.html#Position
[21] http://www.sitepoint.com/article/remote-scripting-ajax
[22] /glossary.php?q=X#term_3
[23] http://www.crockford.com/JSON/
[24] http://24ways.org/advent/easy-ajax-with-prototype
[25] http://script.aculo.us/
[26] /glossary.php?q=U#term_67
[27] http://moofx.mad4milk.net/
[28] http://www.mad4milk.net/entry/moo.ajax
[29] http://bennolan.com/behaviour/
[30] http://bennolan.com/behaviour/
[31] http://jquery.com
[32] http://www.prototypedoc.com/

» Page 1

SitePoint Kits

The Search Engine Marketing Kit
The Search Engine Marketing Kit

Proven methods to increase your Traffic!

Download Sample Chapter
The Web Design Business Kit
The Web Design Business Kit

Winning strategies to increase your Income!

Download Sample Chapters

NEW! - September 2006

Book:The Photoshop AnthologyThe Photoshop Anthology: 101 Web Design Tips, Tricks & Techniques

At last a Photoshop CS2 book that takes Web design seriously!

Download the FREE sample chapters

NEW! - July 2006

Book: Deliver First Class Web Sites: 101 Essential Checklists

The ultimate roadmap for web developers, project managers, and anyone involved in the process of building web sites.

Download the FREE sample chapters

NEW! - November 2006

Book: Build Your Own ASP.NET 2.0 Web Site Using C# & VB, 2nd EditionBuild Your Own ASP.NET 2.0 Web Site Using C# & VB, 2nd Edition

Tap the Power and Speed of Microsoft’s Next Generation Framework -- ASP.NET 2.0

Download the FREE sample chapters

'DHTML' 카테고리의 다른 글

[link] 실전 웹 표준 가이드  (0) 2007.04.23
[링크] dhtml grid control  (0) 2007.01.25
Firebug !!!  (0) 2006.12.21
이미지 없이 둥근 모서리 박스 만드는 소스  (0) 2006.11.02
http://www.codingforums.com/  (0) 2006.01.26
Posted by tornado
|

자바로 zip 파일을 다룰때(압축 풀기/압축하기) 영문이름으로 된 파일은 정상적으로 잘 되지만

한글이름으로된 파일을 다룰때에는 Exception이 발생한다.

간단하게 예제를 살펴보자.


import java.io.File;
import java.io.FileInputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;


public class ZipTest {

    public static void main(String[] args) throws Exception {
        File file = new File("e:/교육자료/이클립스단축키.zip");
        ZipInputStream in = new ZipInputStream(new FileInputStream(file));
        ZipEntry entry = null;
        while((entry = in.getNextEntry()) != null ){
            System.out.println(entry.getName()+" 파일이 들어 있네요.");
        }
    }

}


위 예제는 이클립스단축키.zip 라는 zip 파일안에 어떤 파일들이 압축되어 있는지 단순하게 리스트를 출력해보는 프로그램이다. 이클립스단축키.zip 파일안에는 다음과 같은 파일 2개가 압축되어 있다.

Keyboard_shortcuts.pdf

이클립스단축키.txt


이 프로그램을 실행시켜보면 아래와 같은 에러가 발생한다.


Keyboard_shortcuts.pdf 파일이 들어 있네요.
java.lang.IllegalArgumentException
 at java.util.zip.ZipInputStream.getUTF8String(ZipInputStream.java:284)
 at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:237)
 at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:73)
 at ZipTest.main(ZipTest.java:29)
Exception in thread "main"


[Keyboard_shortcuts.pdf] 파일명을 처리할때는 문제가 없다가 [이클립스단축키.txt] 처럼 한글이름으로 된 파일명을 다룰때는 Exception 이 발생함을 알 수 있는데, 이문제는 java.util.zip 패키지의 한글처리 인코딩로직의 버그이다. 하지만 한글 인코딩 문제는 의외로 아주 간단하게 해결된다.


Jochen Hoenicke 가 만든 jazzlib.jar 라이브러리를 다운받아 클래스패스에 추가하면 된다. 소스는 전혀 수정할 필요가 없고 단지 import 문만 아래와 같이 수정해 주면 된다.


import java.io.File;
import java.io.FileInputStream;
import net.sf.jazzlib.ZipEntry;
import net.sf.jazzlib.ZipInputStream;


public class ZipTest {

    public static void main(String[] args) throws Exception {
        File file = new File("e:/교육자료/이클립스단축키.zip");
        ZipInputStream in = new ZipInputStream(new FileInputStream(file));
        ZipEntry entry = null;
        while((entry = in.getNextEntry()) != null ){
            System.out.println(entry.getName()+" 파일이 들어 있네요.");
        }
    }

}


다시 프로그램을 실행시켜 보면 아래와 같이 정상적인 결과를 확인할 수 있다.

Keyboard_shortcuts.pdf 파일이 들어 있네요.
이클립스단축키.txt 파일이 들어 있네요.


jazzlib.jar 파일은 인코딩 문제를 해결한 라이브러리이므로 압축할때와 압축을 풀때 모두 잘 작동한다.


Reference is jazzlib

Posted by tornado
|




'이것저것 > 낙서장' 카테고리의 다른 글

APE 파일 음악듣기와 MP3로 변환  (0) 2007.02.01
생일축하 이벤트!!!  (6) 2007.01.24
손석희의 지각인생  (0) 2007.01.12
음... 제사를 지내라는 아버지의 엄명인가...  (0) 2007.01.08
푸마 패러디 모음  (0) 2007.01.05
Posted by tornado
|

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
남들은 어떻게 생각할지 몰라도 나는 내가 지각인생을 살고 있다고 생각한다.
 대학도 남보다 늦었고 사회진출도, 결혼도 남들보다 짧게는 1년,
 길게는 3∼4년 정도 늦은 편이었다.
 능력이 부족했거나 다른 여건이 여의치 못했기 때문이었을 것이다.
 모든 것이 이렇게 늦다 보니 내게는 조바심보다 차라리 여유가 생긴 편인데,
 그래서인지 시기에 맞지 않거나 형편에 맞지 않는 일을 가끔 벌이기도 한다.
 내가 벌인 일 중 가장 뒤늦고도 내 사정에 어울리지 않았던 일은 나이 마흔을 훨씬 넘겨
 남의 나라에서 학교를 다니겠다고 결정한 일일 것이다.
 1997년 봄 서울을 떠나 미국으로 가면서 나는 정식으로 학교를 다니겠다는 생각은 하지
 않았다. 남들처럼 어느 재단으로부터 연수비를 받고 가는 것도 아니었고,
 직장생활 십수년 하면서 마련해 두었던 알량한 집 한채 전세 주고
 그 돈으로 떠나는 막무가내식 자비 연수였다. 그 와중에 공부는 무슨 공부.
 
 학교에 적은 걸어놓되 그저 몸 성히 잘 빈둥거리다 오는 것이 내 목표였던 것이다.
 그러던 것이 졸지에 현지에서 토플 공부를 하고 나이 마흔 셋에 학교로 다시 돌아가게
 된 까닭은 뒤늦게 한 국제 민간재단으로부터 장학금을 얻어낸 탓이 컸지만,
 기왕에 늦은 인생, 지금에라도 한번 저질러 보자는 심보도 작용한 셈이었다.
 
 미네소타 대학의 퀴퀴하고 어두컴컴한 연구실 구석에 처박혀 낮에는
 식은 도시락 까먹고, 저녁에는 근처에서 사온 햄버거를 꾸역거리며 먹을 때마다
 나는 서울에 있는 내 연배들을 생각하면서 다 늦게 무엇 하는 짓인가 하는 후회도 했다.
 20대의 팔팔한 미국 아이들과 경쟁하기에는 나는 너무 연로(?)해 있었고
 그 덕에 주말도 없이 매일 새벽 한두시까지 그 연구실에서 버틴 끝에
 졸업이란 것을 했다.
돌이켜보면 그때 나는 무모했다. 하지만 그때 내린 결정이 내게 남겨준 것은 있다.
그 잘난 석사 학위? 그것은 종이 한장으로 남았을 뿐, 그보다 더 큰 것은 따로 있다.
첫 학기 첫 시험때 시간이 모자라 답안을 완성하지 못한 뒤 연구실 구석으로 돌아와 억울함에 겨워
찔끔 흘렸던 눈물이 그것이다. 중학생이나 흘릴 법한 눈물을 나이 마흔 셋에 흘렸던 것은
내가 비록 뒤늦게 선택한 길이었지만 그만큼 절실하게 매달려 있었다는 방증이었기에
내게는 소중하게 남아있는 기억이다.

혹 앞으로도 여전히 지각인생을 살더라도 그런 절실함이 있는 한 후회할 필요는 없을 것이다.

 

 

 

 

 

Posted by tornado
|

좋습니다~


하지만~~~ 익스 특정 버전에서 div background-image 가 100% 가 안되서 자바스크립트로 살짝 고쳐주던가, explorer hack 를 알아내야 한다는거~


http://www.pjhyett.com/posts/190-the-lightbox-effect-without-lightbox

Posted by tornado
|
출처 : swynk.com

내용 : Information Schema Views에 대한 종류와 그 내용. 샘플을 다룹니다.

Microsoft SQL Server ships with some information schema views that are very helpful for
getting information about the meta-data. And Microsoft suggests to use these views
instead of querying the system tables like systypes, sysreferences, sysindexes etc. since
they can change from release to release.
I personally prefer to have a good knowledge of the system tables and occasionally use
them for database administration purposes but for the application it's good if your SQL
queries are based off these views so you are sure that when you migrate from one
version to the other of SQL Server, you are not going to be breaking something.
All these information_schema views exist in SQL Server 2000 and detailed information on
all of them is available in BOL so I wont' go into details of what each view does. Here is
the list of the views:

Information_Schema.Check_Constraints
Information_Schema.Column_Domani_Usage
Information_Schema.Column_Privleges
Information_Schema.Columns
Information_Schema.Constraint_Column_Usage
Information_Schema.Constraint_Table_Usage
Information_Schema.Domain_Constraints
Information_Schema.Domains
Information_Schema.Key_Column_Usage
Information_Schema.Parameters
Information_Schema.Referential_Constraints
Information_Schema.Ruotine_Columns
Information_Schema.Routines
Information_Schema.Schemata
Information_Schema.Table_Constraints
Information_Schema.Table_Constraints
Information_Schema.Table_Privileges
Information_Schema.Tables
Information_Schema.Views
Information_Schema.View_Column_Usage
Information_Schema.View_Table_Usage
Some examples:
1)For getting a list of constraints, column_names and their position in the constraint:


SELECT COLS.CONSTRAINT_NAME,COLS.COLUMN_NAME,COLS.ORDINAL_POSITION
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS COLS
INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS CONS ON
COLS.CONSTRAINT_NAME = CONS.CONSTRAINT_NAME
WHERE COLS.CONSTRAINT_CATALOG = DB_NAME()
AND COLS.TABLE_NAME = 'TASK_DTL'
AND CONS.CONSTRAINT_TYPE = 'PRIMARY KEY'
ORDER BY COLS.CONSTRAINT_NAME, COLS.ORDINAL_POSITION

You can replace the name of the table to whatever you want and can also replace the
constraint_type if you want to search for constraints other than the Primary Key.


2) SELECT CONSTRAINT_NAME,
COLUMN_NAME,
ORDINAL_POSITION
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE CONSTRAINT_CATALOG = DB_NAME()
AND TABLE_NAME = 'X'
ORDER BY CONSTRAINT_NAME, ORDINAL_POSITION

Subsitute x with the name of the table and you will get the name of the constraints defined
on the table (Primary Key as well as the Foreign key constraints), the names of the
columns involved and the position of the columns in the constraint, for example, which
column is number 1 in the case of a covered primary key.

3) For a list of tables, their columns, data-type for the columns, NULL/Not NULL criteria:


SELECT A.TABLE_NAME, B.COLUMN_NAME, B.DATA_TYPE, B.IS_NULLABLE
FROM INFORMATION_SCHEMA.TABLES A, INFORMATION_SCHEMA.COLUMNS B
WHERE A.TABLE_NAME = B.TABLE_NAME
ORDER BY A.TABLE_NAME
Posted by tornado
|

저희집은 기독교 입니다.

 

물론 저는 오리지날 사이비 신자이고, 주말은 음주가무를 즐기지요 ^^

 

 

 

2005년 7월에 아버지가 돌아가셨는데, 기독교 이다 보니 제사를 지내지 말고 가족들끼리

 

예배를 드리자~ 라는 어머니 말씀에 그렇게 하지요. 라고 대답하고 제사를 지내지 않았습니다.

 

몇일전에 중계동 어머니 집에 갔더니, 어머니께서 꿈 이야기를 하시더군요.

 

요즘 아버지 꿈을 자주 꾸는데, 아버지가 허기가 진다고 하셨다고 합니다.

 

이야기를 듣는 순간, 아~ 어르신을 제대로 모시지 않아서 꿈에 나타나셨구나...

 

하는 느낌이 들더군요.

 

처음에 예배를 드리기로 할때 저와 집안에서 충돌이 좀 있었습니다.

 

저는 제사를 지내야 한다는 쪽이고, 어머니와 누나는  평소에 아버지가 교회를

 

다니셨기 때문에 예배를 드려야 한다는 쪽이였습니다. 또 저희 삼촌이 목사님 이십니다.

 

영향이 좀 컸죠. 그래서 예배를 드리기로 했습니다.

 

꿈이야기를 듣고나니 참 꺼림직 합니다. 제사를 지냈어야 하는데~ 라는 생각도 들구요.

 

 

저번에 제 친구녀석이 그러더군요.

 

아버지 제삿날에 자기 딸이 제사상 앞에서 엄청나게 무서워 하면서 울더랍니다.

 

애를 살살 달래고, 왜 갑자기 우느냐 라고 물어보니 "하부지..하부지..." 하더랍니다.

 

그 이야기 듣고 참 충격이였습니다.

 

믿거나 말거나 어르신이 제삿날 자식들 보러 오셨다는거죠...

 

 

어머니 꿈이야기를 들으면서 참 많은걸 생각했고, 또 어머니도 한발 양보하셔서

 

제사를 다시 지내기로 했습니다.

 

 

끝으로.. 조상님들 잘 모셔야겠습니다.

 

 

'이것저것 > 낙서장' 카테고리의 다른 글

새 핸드폰.. 껍데기가 생각보다 불편함.  (0) 2007.01.14
손석희의 지각인생  (0) 2007.01.12
푸마 패러디 모음  (0) 2007.01.05
40000 히트 이벤트!!!  (0) 2006.11.30
TatterTools 설치했습니다.  (0) 2006.11.17
Posted by tornado
|