<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hanury.NET &#187; 프로그래밍</title>
	<atom:link href="http://hanury.net/wp/tag/%ed%94%84%eb%a1%9c%ea%b7%b8%eb%9e%98%eb%b0%8d/feed" rel="self" type="application/rss+xml" />
	<link>http://hanury.net/wp</link>
	<description>하늘이, 형거니, 규영이 홈피입니다.</description>
	<lastBuildDate>Mon, 21 May 2012 05:15:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>[Ruby] 한글날 기념 코딩. 한글 자소 분해</title>
		<link>http://hanury.net/wp/archives/2149</link>
		<comments>http://hanury.net/wp/archives/2149#comments</comments>
		<pubDate>Fri, 08 Oct 2010 18:47:14 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[프로그래밍]]></category>
		<category><![CDATA[한글]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/?p=2149</guid>
		<description><![CDATA[치매방지겸 한글날 기념으로 한글 음절을 자소로 분해하는 코딩. 즉 Unicode2.0에서 초,중,종성으로 조합가능한 모든 현대 한글 음절 11172를 빠짐없이 배치하였기에, 완성형 코드인 유니코드가 조합형 코드로서의 특징을 가지게 된다는 걸 보여주기 위해 [...]]]></description>
			<content:encoded><![CDATA[<p>치매방지겸 한글날 기념으로 한글 음절을 자소로 분해하는 코딩.</p>
<p>즉 Unicode2.0에서 초,중,종성으로 조합가능한 모든 현대 한글 음절 11172를 빠짐없이 배치하였기에,<br />
완성형 코드인 유니코드가 조합형 코드로서의 특징을 가지게 된다는 걸 보여주기 위해 코딩.</p>
<p>원래 조합형 코드에서 자소 분해는 비트를 잘라 초중종을 얻어 낸다면,<br />
유니코드에서는 아래와 같이 나누기만 잘하면 초중종성을 얻어낼 수 있다.</p>
<hr/>
<p>한글의 과학성에 또 한번 감탄</p>
<p>소스 코드</p>
<div class="codecolorer-container ruby vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#008000; font-style:italic;">#!/usr/bin/env ruby</span><br />
<br />
<span style="color:#0066ff; font-weight:bold;">@chosung_list</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;ㄱ&quot;</span>,<span style="color:#996600;">&quot;ㄲ&quot;</span>,<span style="color:#996600;">&quot;ㄴ&quot;</span>,<span style="color:#996600;">&quot;ㄷ&quot;</span>,<span style="color:#996600;">&quot;ㄸ&quot;</span>,<span style="color:#996600;">&quot;ㄹ&quot;</span>,<span style="color:#996600;">&quot;ㅁ&quot;</span>,<span style="color:#996600;">&quot;ㅂ&quot;</span>,<span style="color:#996600;">&quot;ㅃ&quot;</span>,<span style="color:#996600;">&quot;ㅅ&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#996600;">&quot;ㅆ&quot;</span>,<span style="color:#996600;">&quot;ㅇ&quot;</span>,<span style="color:#996600;">&quot;ㅈ&quot;</span>,<span style="color:#996600;">&quot;ㅉ&quot;</span>,<span style="color:#996600;">&quot;ㅊ&quot;</span>,<span style="color:#996600;">&quot;ㅋ&quot;</span>,<span style="color:#996600;">&quot;ㅌ&quot;</span>,<span style="color:#996600;">&quot;ㅍ&quot;</span>,<span style="color:#996600;">&quot;ㅎ&quot;</span> <span style="color:#006600; font-weight:bold;">&#93;</span><br />
<span style="color:#0066ff; font-weight:bold;">@jungsung_list</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;ㅏ&quot;</span>,<span style="color:#996600;">&quot;ㅐ&quot;</span>,<span style="color:#996600;">&quot;ㅑ&quot;</span>,<span style="color:#996600;">&quot;ㅒ&quot;</span>,<span style="color:#996600;">&quot;ㅓ&quot;</span>,<span style="color:#996600;">&quot;ㅔ&quot;</span>,<span style="color:#996600;">&quot;ㅕ&quot;</span>,<span style="color:#996600;">&quot;ㅖ&quot;</span>,<span style="color:#996600;">&quot;ㅗ&quot;</span>,<span style="color:#996600;">&quot;ㅘ&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#996600;">&quot;ㅛ&quot;</span>,<span style="color:#996600;">&quot;ㅙ&quot;</span>,<span style="color:#996600;">&quot;ㅚ&quot;</span>,<span style="color:#996600;">&quot;ㅜ&quot;</span>,<span style="color:#996600;">&quot;ㅝ&quot;</span>,<span style="color:#996600;">&quot;ㅞ&quot;</span>,<span style="color:#996600;">&quot;ㅟ&quot;</span>,<span style="color:#996600;">&quot;ㅠ&quot;</span>,<span style="color:#996600;">&quot;ㅡ&quot;</span>,<span style="color:#996600;">&quot;ㅢ&quot;</span>,<span style="color:#996600;">&quot;ㅣ&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
<span style="color:#0066ff; font-weight:bold;">@jongsung_list</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot; &quot;</span>,<span style="color:#996600;">&quot;ㄱ&quot;</span>,<span style="color:#996600;">&quot;ㄲ&quot;</span>,<span style="color:#996600;">&quot;ㄳ&quot;</span>,<span style="color:#996600;">&quot;ㄴ&quot;</span>,<span style="color:#996600;">&quot;ㄵ&quot;</span>,<span style="color:#996600;">&quot;ㄶ&quot;</span>,<span style="color:#996600;">&quot;ㄷ&quot;</span>,<span style="color:#996600;">&quot;ㄹ&quot;</span>,<span style="color:#996600;">&quot;ㄺ&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#996600;">&quot;ㄻ&quot;</span>,<span style="color:#996600;">&quot;ㄼ&quot;</span>,<span style="color:#996600;">&quot;ㄽ&quot;</span>,<span style="color:#996600;">&quot;ㄾ&quot;</span>,<span style="color:#996600;">&quot;ㄿ&quot;</span>,<span style="color:#996600;">&quot;ㅀ&quot;</span>,<span style="color:#996600;">&quot;ㅁ&quot;</span>,<span style="color:#996600;">&quot;ㅂ&quot;</span>,<span style="color:#996600;">&quot;ㅄ&quot;</span>,<span style="color:#996600;">&quot;ㅅ&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#996600;">&quot;ㅆ&quot;</span>,<span style="color:#996600;">&quot;ㅇ&quot;</span>,<span style="color:#996600;">&quot;ㅈ&quot;</span>,<span style="color:#996600;">&quot;ㅊ&quot;</span>,<span style="color:#996600;">&quot;ㅋ&quot;</span>,<span style="color:#996600;">&quot;ㅌ&quot;</span>,<span style="color:#996600;">&quot;ㅍ&quot;</span>,<span style="color:#996600;">&quot;ㅎ&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
<br />
<span style="color:#9966CC; font-weight:bold;">def</span> unicode_of<span style="color:#006600; font-weight:bold;">&#40;</span>a<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; a.<span style="color:#9900CC;">unpack</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;U*&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">pop</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC0066; font-weight:bold;">String</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> succ<br />
&nbsp; &nbsp; &nbsp; &nbsp; head = <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">unpack</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'U*'</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; tail = head.<span style="color:#9900CC;">pop</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> head.<span style="color:#9900CC;">pack</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'U*'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#006600; font-weight:bold;">&#91;</span>tail <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">pack</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'U*'</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span> <br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
<span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span> ch <span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; offset = unicode_of<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;가&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; unicode = unicode_of<span style="color:#006600; font-weight:bold;">&#40;</span> ch <span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">print</span> ch <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;=(&quot;</span> <br />
&nbsp; &nbsp; <span style="color:#008000; font-style:italic;">#초성출력</span><br />
&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">print</span> <span style="color:#0066ff; font-weight:bold;">@chosung_list</span><span style="color:#006600; font-weight:bold;">&#91;</span> <span style="color:#006600; font-weight:bold;">&#40;</span>unicode<span style="color:#006600; font-weight:bold;">-</span>offset<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">/</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#40;</span>@jungsung_list.<span style="color:#9900CC;">length</span> <span style="color:#006600; font-weight:bold;">*</span> <span style="color:#0066ff; font-weight:bold;">@jongsung_list</span>.<span style="color:#9900CC;">length</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;+&quot;</span> &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#008000; font-style:italic;">#중성출력</span><br />
&nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">print</span> <span style="color:#0066ff; font-weight:bold;">@jungsung_list</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span>unicode<span style="color:#006600; font-weight:bold;">-</span>offset<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">%</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#40;</span>@jungsung_list.<span style="color:#9900CC;">length</span> <span style="color:#006600; font-weight:bold;">*</span> <span style="color:#0066ff; font-weight:bold;">@jongsung_list</span>.<span style="color:#9900CC;">length</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@jongsung_list</span>.<span style="color:#9900CC;">length</span> <span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;+&quot;</span> &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#008000; font-style:italic;">#종성출력 &nbsp; </span><br />
<span style="color:#CC0066; font-weight:bold;">print</span> <span style="color:#0066ff; font-weight:bold;">@jongsung_list</span><span style="color:#006600; font-weight:bold;">&#91;</span> <span style="color:#006600; font-weight:bold;">&#40;</span>unicode<span style="color:#006600; font-weight:bold;">-</span>offset<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%</span> <span style="color:#0066ff; font-weight:bold;">@jongsung_list</span>.<span style="color:#9900CC;">length</span> <span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;)<span style="color:#000099;">\n</span>&quot;</span>&nbsp; &nbsp; <br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;가&quot;</span>..<span style="color:#996600;">&quot;힣&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>x<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span>x<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</span></div></div>
<p>결과</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">가=(ㄱ+ㅏ+ )<br />
각=(ㄱ+ㅏ+ㄱ)<br />
갂=(ㄱ+ㅏ+ㄲ)<br />
갃=(ㄱ+ㅏ+ㄳ)<br />
간=(ㄱ+ㅏ+ㄴ)<br />
갅=(ㄱ+ㅏ+ㄵ)<br />
갆=(ㄱ+ㅏ+ㄶ)<br />
갇=(ㄱ+ㅏ+ㄷ)<br />
갈=(ㄱ+ㅏ+ㄹ)<br />
갉=(ㄱ+ㅏ+ㄺ)<br />
...<br />
힛=(ㅎ+ㅣ+ㅅ)<br />
힜=(ㅎ+ㅣ+ㅆ)<br />
힝=(ㅎ+ㅣ+ㅇ)<br />
힞=(ㅎ+ㅣ+ㅈ)<br />
힟=(ㅎ+ㅣ+ㅊ)<br />
힠=(ㅎ+ㅣ+ㅋ)<br />
힡=(ㅎ+ㅣ+ㅌ)<br />
힢=(ㅎ+ㅣ+ㅍ)<br />
힣=(ㅎ+ㅣ+ㅎ)</div></div>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/2149/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iCal을 이용한 EPG</title>
		<link>http://hanury.net/wp/archives/1187</link>
		<comments>http://hanury.net/wp/archives/1187#comments</comments>
		<pubDate>Sat, 31 Jan 2009 03:40:14 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[epg]]></category>
		<category><![CDATA[ical]]></category>
		<category><![CDATA[iptv]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/?p=1187</guid>
		<description><![CDATA[EPG(Electronic Program Guide) 방송 편성표를 어떻게 하면 쉽게 볼 수 있을까 하다가, xml을 xslt를 이용해 html로 변환 RSS형태로 publishing 을 생각하다가 iCal에서 사용하는 ics 형태로 하면 iCal이 알아서 다 표현도 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Electronic_program_guide">EPG(Electronic Program Guide) 방송 편성표</a>를 어떻게 하면 쉽게 볼 수 있을까 하다가,</p>
<ol>
<li>xml을 xslt를 이용해 html로 변환</li>
<li>RSS형태로 publishing</li>
</ol>
<p>을 생각하다가 <a href="http://en.wikipedia.org/wiki/ICalendar">iCal</a>에서 사용하는 ics 형태로 하면 iCal이 알아서 다 표현도 해줄것이고,</p>
<ul>
<li>MacOSX에서는 iCal에서 구독 하면 되고</li>
<li>iCal과 동기되는 iPod Touch/iPhone에서도 볼수 있고</li>
<li>Windows Vista도 ics를 지원하는 캘린더가 기본 포함 되었고,<br />
	아마 Outlook도 지원할것이고</li>
<li>Google Calender도 같은 ics를 구독하면 언제 어디서나 볼수 있고</li>
</ul>
<p>그래서 EPG 데이터를 ICS 포맷으로 변환하면 멋지겠다는 생각이 들었다.</p>
<p>방송사 별로 ICS를 생성하고 각 방송사 별로 ICS는 최대한 추려서 다음과 같이 쓰기로 했다.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">BEGIN:VCALENDAR<br />
PRODID:-//TTA//EPG DATA//KO<br />
VERSION:2.0<br />
CALSCALE:GREGORIAN<br />
METHOD:PUBLISH<br />
X-WR-TIMEZONE:Asia/Seoul<br />
X-WR-CALNAME:MBC<br />
BEGIN:VEVENT<br />
DTSTART:20090131T223500<br />
DTEND:20090131T235500<br />
UID:MBC20090131T223500<br />
CLASS:PUBLIC<br />
DESCRIPTION:장르 : 연예/오락-토크쇼<br />
출연 : 윤종신,김국진,김구라,김성주,신정환,이하늘,박미선<br />
연출 : 여운혁,김유곤<br />
SUMMARY:명랑 히어로<br />
TRANSP:OPAQUE<br />
END:VEVENT<br />
END:VCALENDAR</div></div>
<p>ruby로 만든 ics를 iCal에서 읽어보니<br />
결과는 일단 성공&#8230;</p>
<p><a class="imagelink" href="http://farm4.static.flickr.com/3352/3239660781_5fc66938cc_b.jpg" rel="lightbox[epg]"><img src="http://farm4.static.flickr.com/3352/3239660781_5fc66938cc.jpg" /></a></p>
<p>대충 상상했던 EPG형태로 보여주기는 하나, 실생활에 편히 쓸만큼 보기 편한거 같지는 않다.</p>
<p>그리고, 당장 쓰기에는 또 다른 문제가 좀 있다.</p>
<ol>
<li>주기적으로 책임감 있게 변환 script를 돌려줄 서버가 필요하고,</li>
<li>CalDAV로 iCal에서 쓰려면 WebDAV 호스팅이 되어야 하는데, 그렇지 아니하고,</li>
<li>ics로 변환해서 그냥 web에 두고 google calendar에서 구독하면 그걸 다시 iCal에서 불러올 수 있다.<br />
	그래서 google calendar에서 읽어보니 한글이 깨진다&#8230;<br />
	(분명 UTF-8으로 저장되어 있는데, KSX1001을 UTF-8으로 읽었을때 처럼 깨진다..)</li>
</ol>
<p>OTL 일단 오늘은 여기까지&#8230;..</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/1187/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>XSLT로 만든 XMLViewer</title>
		<link>http://hanury.net/wp/archives/1152</link>
		<comments>http://hanury.net/wp/archives/1152#comments</comments>
		<pubDate>Thu, 29 Jan 2009 16:15:33 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xslt]]></category>
		<category><![CDATA[소개]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/?p=1152</guid>
		<description><![CDATA[xml의 많은 장점에도 불구하고 떨어지는 readability엔 불만이다. 업무상 xml을 자주 만지다 보니 xml 내의 정보를 쉽게 보는 도구가 간절했고, 그래서 예전에 java로 만든 TreeView 형태의 XmlViewer도 만들었다. 이번에는 xlst로 만들었는데 [...]]]></description>
			<content:encoded><![CDATA[<p>xml의 많은 장점에도 불구하고 떨어지는 readability엔 불만이다.<br />
업무상 xml을 자주 만지다 보니 xml 내의 정보를 쉽게 보는 도구가 간절했고, 그래서 <a href="http://hanury.net/wp/archives/275">예전에 java로 만든 TreeView 형태의 XmlViewer</a>도 만들었다.</p>
<p>이번에는 xlst로 만들었는데 생각보다 깔끔하고 맘에 든다.<br />
TreeView 형태보다 쉽게 포함관계를 표현한다.</p>
<p>맨 처음, element와 attribute를 일일히 지정하면서 xslt를 작성하다 보니 1000라인이 넘어 섰다.<br />
그래서 거의 90% 완성된 시점에서 처음부터 다시 시작해 element와 attribute의 이름을 지정하지 않는 형태로 바꾸었더니 css, javascript를 포함해서 120라인 가량으로 끝낼 수 있을 뿐더러 특정 dtd/schema의 xml 뿐만 아니라 범용 XMLViewer로 사용가능해 졌다.</p>
<p>만들다 보니 포함관계만 표시하는 심플한 뷰, 모든정보를 빠짐없이 보여주는 뷰를 표현하기 위해 javascript를 이용했고 <a href="http://www.anyexample.com/webdev/javascript/javascript_getelementsbyclass_function.xml">web에서 찾은 코드</a>를 근간으로 했는데<br />
원리는 숨기거나 보여질 영역을 < div class="ClassName" >으로 설정한뒤 해당 class를 가지는 element를 돌면서 처리하는 루틴이었다.</p>
<p>문제는 C 스타일의 for 루프문</p>
<div class="codecolorer-container c vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> var i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>Max<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;BLOCK<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>이 내가 주로 사용하는 브라우저인 safari에서는 돌지 않았다.</p>
<p>그래서</p>
<div class="codecolorer-container c vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> var i in Collection<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;BLOCK<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>형태로 바꿔서 브라우저 의존성을 제거하고,</p>
<p>포함관계를 색상으로 표현하기 위해서 CSS에서</p>
<div class="codecolorer-container css vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #00AA00;">*</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span><br />
div &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#6666ff</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span><br />
div<span style="color: #00AA00;">&gt;</span>div &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7777ff</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span><br />
div<span style="color: #00AA00;">&gt;</span>div<span style="color: #00AA00;">&gt;</span>div &nbsp; &nbsp;<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#8888ff</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></div></div>
<p>형태로 가능했다.</p>
<p>내가 javascript/CSS 쪽은 거의 문외한이라 이게 최적의 코드인지는 모르지만, 내가 원래 의도했던 기능이나 목표는 다 동작해서 맘에 든다.</p>
<p>그리고 지금까지</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt; xsl:apply-templates/&gt;</div></div>
<p>는 select로 자식 element를 지정해야지만 되는줄 알았는데,<br />
그냥 apply-templates만 불러주니 알아서 자식 element들을 알아서 불러주네&#8230;(오늘 첨 알았음 ^^;)</p>
<p>Simple View<br />
<a class="imagelink" href="http://farm4.static.flickr.com/3330/3236045033_9c39888f08_b.jpg" rel="lightbox[xmlview]"><img src="http://farm4.static.flickr.com/3330/3236045033_9c39888f08.jpg" /></a></p>
<p>Complex View<br />
<a class="imagelink" href="http://farm4.static.flickr.com/3378/3236888888_ee48507506_b.jpg" rel="lightbox[xmlview]"><img src="http://farm4.static.flickr.com/3378/3236888888_ee48507506.jpg" /></a></p>
<div class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">'1.0'</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">'utf-8'</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:stylesheet</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">'2.0'</span> <span style="color: #000066;">xmlns:xsl</span>=<span style="color: #ff0000;">'http://www.w3.org/1999/XSL/Transform'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>XML Viewer<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;style</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
div.element{<br />
&nbsp; &nbsp; float: &nbsp; &nbsp; &nbsp;left; <br />
&nbsp; &nbsp; display: &nbsp; &nbsp;block; <br />
&nbsp; &nbsp; padding: &nbsp; &nbsp;1em; &nbsp; &nbsp;<br />
&nbsp; &nbsp; border: &nbsp; &nbsp; solid 1px black; &nbsp; &nbsp;<br />
&nbsp; &nbsp; margin: &nbsp; &nbsp; 1em;<br />
}<br />
<br />
/* <br />
&nbsp; &nbsp; element의 이름과 attr을 header-area로 싸는 이유<br />
&nbsp; &nbsp; attr 옆에 하위 element가 붙는게 보기 싫어서...<br />
&nbsp; &nbsp; 정답은 &nbsp; overflow:auto;<br />
*/<br />
div.header-area{<br />
&nbsp; &nbsp; overflow: &nbsp; &nbsp; &nbsp; &nbsp; auto;<br />
&nbsp; &nbsp; background: &nbsp;none;<br />
}<br />
<br />
div.attr{<br />
&nbsp; &nbsp; float: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;left; <br />
&nbsp; &nbsp; margin-right: &nbsp;2em;<br />
&nbsp; &nbsp; background: &nbsp;none;<br />
}<br />
<br />
i.att_name{ color: &nbsp;#333333}<br />
i.att_value{ color: #666666}<br />
<br />
/*<br />
&nbsp; &nbsp; nested elemement를 다른 색으로 표시하기<br />
&nbsp; &nbsp; 이게 제일 좋은 방법인지는 모르겠지만...<br />
*/<br />
* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{background: none;}<br />
div &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{background: #6666ff;}<br />
div&gt;div &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{background: #7777ff;}<br />
div&gt;div&gt;div &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{background: #8888ff;}<br />
div&gt;div&gt;div&gt;div &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{background: #9999ff;}<br />
div&gt;div&gt;div&gt;div&gt;div &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{background: #aaaaff;}<br />
div&gt;div&gt;div&gt;div&gt;div&gt;div &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{background: #bbbbff;}<br />
div&gt;div&gt;div&gt;div&gt;div&gt;div&gt;div &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{background: #ccccff;}<br />
div&gt;div&gt;div&gt;div&gt;div&gt;div&gt;div&gt;div &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{background: #ddddff;}<br />
div&gt;div&gt;div&gt;div&gt;div&gt;div&gt;div&gt;div&gt;div &nbsp; &nbsp; &nbsp;{background: #eeeeff;}<br />
div&gt;div&gt;div&gt;div&gt;div&gt;div&gt;div&gt;div&gt;div&gt;div &nbsp;{background: #ffffff;}<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">language</span>=<span style="color: #ff0000;">&quot;JavaScript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> <br />
<br />
&nbsp; &nbsp; function toggle(obj){<br />
&nbsp; &nbsp; &nbsp; &nbsp; if(obj.style.display != &quot;block&quot;)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.style.display = &quot;block&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; else <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.style.display = &quot;none&quot;;<br />
&nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; function toggle_all_attr(){<br />
&nbsp; &nbsp; &nbsp; &nbsp; var divs = document.getElementsByTagName('div');<br />
&nbsp; &nbsp; &nbsp; &nbsp; var tcl = &quot; attr &quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; for( var i in divs ){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var test = &quot; &quot; + divs[i].className + &quot; &quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(test.indexOf(tcl) != -1){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; toggle(divs[i]);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h2<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;toggle_all_attr()&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>simple/complex<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/h2<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
<span style="color: #808080; font-style: italic;">&lt;!-- element 처리 --&gt;</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;element&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- 본인의 attr 처리하고 --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;header-area&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h3<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;name(.)&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/h3<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;@*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- sub element들 처리... --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
<span style="color: #808080; font-style: italic;">&lt;!-- attribute 처리 --&gt;</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;@*&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;attr&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;i</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;att_name&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;name(.)&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/i<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;i</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;att_value&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/i<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:stylesheet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/1152/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>airclick으로 eyetv 컨트롤 하기</title>
		<link>http://hanury.net/wp/archives/872</link>
		<comments>http://hanury.net/wp/archives/872#comments</comments>
		<pubDate>Wed, 07 Jan 2009 13:12:47 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[생활]]></category>
		<category><![CDATA[airclick]]></category>
		<category><![CDATA[eyetv]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[다운로드]]></category>
		<category><![CDATA[소개]]></category>
		<category><![CDATA[팁]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/?p=872</guid>
		<description><![CDATA[내 방에서는 TV를 MacOSX 상에 pinnacle HDTV stick과 eyetv로 보고 있다. Windows에서 TV를 볼때는 마지 못해 보는거였지만, Mac에서는 TV로 보는거 보다 훨씬 더 편하고 좋다. MacOS 탓이라기 보다는 EyeTV라는 프로그램이 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://hanury.net/wp/wp-content/uploads/2009/01/pinnacle.png" alt="pinnacle" title="pinnacle" width="150" height="49" class="alignnone size-full wp-image-1009" /><br />
내 방에서는 TV를 MacOSX 상에 pinnacle HDTV stick과 eyetv로 보고 있다.<img src="http://hanury.net/wp/wp-content/uploads/2009/01/eyetv2.png" alt="eyetv2" title="eyetv" width="87" height="79" align="right" /><br />
Windows에서 TV를 볼때는 마지 못해 보는거였지만, Mac에서는 TV로 보는거 보다 훨씬 더 편하고 좋다.<br />
MacOS 탓이라기 보다는 EyeTV라는 프로그램이 훌륭해서다.<br />
물론 신호 내의 한글로 된 EPG는 다 깨먹지만 말이다.</p>
<p><img src="http://hanury.net/wp/wp-content/uploads/2009/01/airclick.jpg" alt="airclick" title="airclick"    align="right"/><br />
pinnacle HDTV stick용 리모콘이 요즘 안보인다. 하늘이 소행으로 보이지만 물증이 없다.<br />
그래서 불편하던 차에, 원래 가지고 있던 AirClick으로 EyeTV를 컨트롤 하려고 찾아봤더니 <a href="http://forum.insanelymac.com/lofiversion/index.php/%22http:/t97842.html">insanelymac</a>에 해당 정보를 찾았다.<br />
Windows용은 컴파일해야 하지만, Mac은 script로 만들어 놓고, functions.plist만 편집하면 되는 형태.<br />
앞으로도 다양한 용도로 활용 가능해 질거 같은 느낌이다&#8230;.</p>
<p><br/><br/><br/></p>
<p><div class='download-link'>
							<a href='http://hanury.net/wp/download.php?file=http://alexken.homeip.net/files/airclick-eyetv.zip'><img alt='Download' class='leftalign' src='http://hanury.net/wp/wp-content/plugins/dBeautifier/icons/downloads.png' /></a>
							<h4>
								<a href='http://hanury.net/wp/download.php?file=http://alexken.homeip.net/files/airclick-eyetv.zip'>EyeTV 컨트롤 파일</a>
							</h4><p>Downloads: 13 File Size: 0.0 KB </p>
						</div></p>
<blockquote><p>functions.plist파일을<br />
/Applications/AirClick.app/Contents/Resources/<br />
나머지 applescript 파일들을<br />
/Applications/AirClick.app/Contents/Resources/scripts/<br />
폴더에 복사하면 된다.
</p></blockquote>
<p><img src="http://hanury.net/wp/wp-content/uploads/2009/01/eyetv.png" alt="eyetv" title="eyetv" width="389" height="492" class="alignright size-full wp-image-1010" /></p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/872/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[.NET] 달랑 3줄로 동영상 플레이어 만들기</title>
		<link>http://hanury.net/wp/archives/549</link>
		<comments>http://hanury.net/wp/archives/549#comments</comments>
		<pubDate>Wed, 21 May 2008 15:42:40 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/549</guid>
		<description><![CDATA[1. 무작정 Visual Studio 2008을 띄우고 C# WinForm 프로젝트 생성 2. [Add Reference]에서 Microsoft.DirectX.AudioVideoPlayback를 추가해주고(DirectX는 깔려 있어야 함) 3. Form을 더블 클릭하고 다음과 같이 쳐준다. using Microsoft.DirectX.AudioVideoPlayback; private void Form1_Load&#40;object [...]]]></description>
			<content:encoded><![CDATA[<p>1. 무작정 Visual Studio 2008을 띄우고 C# WinForm 프로젝트 생성<br />
2. [Add Reference]에서 Microsoft.DirectX.AudioVideoPlayback를 추가해주고(DirectX는 깔려 있어야 함)<br />
3. Form을 더블 클릭하고 다음과 같이 쳐준다.</p>
<div class="codecolorer-container csharp vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">Microsoft.DirectX.AudioVideoPlayback</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> Form1_Load<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; Video v <span style="color: #008000;">=</span> Video<span style="color: #008000;">.</span><span style="color: #0000FF;">FromFile</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">@&quot;c:\test.avi&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; v<span style="color: #008000;">.</span><span style="color: #0000FF;">Owner</span> <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; v<span style="color: #008000;">.</span><span style="color: #0000FF;">Play</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>4. F5를 누른다.</p>
<p>근데 안된다.</p>
<p>[Debug]-[Exceptions]-[LoaderLock]의 Thrown 항목을 꺼준다.</p>
<p><img src='http://hanury.net/wp/wp-content/uploads/2008/05/loaderlock.png' alt='loaderlock.png' /><br />
5. F5를 누른다.</p>
<p>ㅋㅋㅋ 성공 &#8230;.<br />
<img src='http://hanury.net/wp/wp-content/uploads/2008/05/form1.jpg' alt='form1.jpg' /></p>
<p>[잡설]<br />
이번 일주일간 WDM 디바이스 드라이버 프로그래밍 교육중이다.<br />
Kernel Mode 프로그램에서는 좀만 잘못하면 블루 스크린&#8230;<br />
오랜만에 보는 VisualStudio&#8230; 안보던 사이 많이 바뀌었었네&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/549/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[ruby] (가..힣).each{&#124;x&#124; print x}</title>
		<link>http://hanury.net/wp/archives/544</link>
		<comments>http://hanury.net/wp/archives/544#comments</comments>
		<pubDate>Tue, 13 May 2008 16:46:22 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/544</guid>
		<description><![CDATA[루비 공부 시작한지 다음날 문득 Unicode의 한글 영역을 전부 출력하는 프로그램을 ruby로 짜면 어떻게 될까 궁금해 졌다. 머리 속에서는 직관적으로 &#40;가..힣&#41;.each&#123;&#124;x&#124; print x&#125; 란 코드가 떠 올랐다. 겁나 멋지다. &#8216;가&#8217;의 [...]]]></description>
			<content:encoded><![CDATA[<p>루비 공부 시작한지 다음날 문득<br />
Unicode의 한글 영역을 전부 출력하는 프로그램을 ruby로 짜면 어떻게 될까 궁금해 졌다.</p>
<p>머리 속에서는 직관적으로</p>
<div class="codecolorer-container ruby vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#006600; font-weight:bold;">&#40;</span>가..힣<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>x<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC0066; font-weight:bold;">print</span> x<span style="color:#006600; font-weight:bold;">&#125;</span></div></div>
<p>란 코드가 떠 올랐다. 겁나 멋지다.<br />
&#8216;가&#8217;의 Unicode가 AC00인지 모르더라도 (&#8216;힣&#8217;의 코드 값은 외우고 있지도 않다.) Range가 지원해주지 않을까?</p>
<p>다른 언어라면 분명 루프가 빙빙 돌고,<br />
&#8216;가&#8217;가 아닌 AC00부터 code값을 증가시키면서&#8230;. 어쩌구 저쩌구 하는 코드가 될터인데&#8230;.</p>
<p>근데 안돈다.<br />
더 정확히는 도는듯 하다 만다.</p>
<p>이유는 ruby String의 내부처리가 UTF-8이어서 그랬다.<br />
이런 젠장&#8230;.</p>
<p>UTF-8도 Unicode 인코딩 기법중 하나 맞고, 나름 장단이 있는 유니코드 인코딩이지만,<br />
직렬화나, 네트웍 전송시에나 적합한 인코딩이고, 메모리 내부 처리는 UCS2나 하다 못해 UCS4로 처리함이 맞다고 본다.<br />
그래야 기껏 Unicode에서 욕먹어 가면서 현대 한글 11072자 모두 할당 받아 한글 처리가 조합형처럼 처리가 가능하고, 한글 소팅 문제나&#8230;..<br />
기타등등&#8230;(욕까진 안먹었나? 하지만 눈치 보면서&#8230;)</p>
<p>아마도 ASCII가 1byte로 인코딩되는 점 때문에 (영어권 프로그래머의&#8230;)힘에서 밀린듯 하다.</p>
<p>암튼 String succ메소드를 건드리고야 말았다.(별 바람직해 보이진 않지만&#8230;)</p>
<div class="codecolorer-container ruby vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC0066; font-weight:bold;">String</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> succ<br />
&nbsp; &nbsp; &nbsp; &nbsp; head = <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">unpack</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'U*'</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; tail = head.<span style="color:#9900CC;">pop</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> head.<span style="color:#9900CC;">pack</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'U*'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#006600; font-weight:bold;">&#91;</span>tail <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">pack</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'U*'</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span> <br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;가&quot;</span>..<span style="color:#996600;">&quot;힣&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>x<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC0066; font-weight:bold;">print</span> x<span style="color:#006600; font-weight:bold;">&#125;</span><br />
<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;あ&quot;</span>..<span style="color:#996600;">&quot;ん&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>x<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC0066; font-weight:bold;">print</span> x<span style="color:#006600; font-weight:bold;">&#125;</span><br />
<br />
<span style="color:#008000; font-style:italic;">#&quot;가나다&quot;.each_char {|x| print x}</span><br />
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;가나다&quot;</span>.<span style="color:#9900CC;">succ</span></div></div>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">가각갂갃간갅갆갇갈갉갊갋갌갍갎갏감갑값갓갔강갖갗갘같갚갛개객갞갟갠갡갢갣갤갥갦갧갨갩갪갫갬<br />
갭갮갯갰갱갲갳갴갵갶갷갸갹갺갻갼갽갾갿걀걁걂걃걄걅걆걇걈걉걊걋걌걍걎걏걐걑걒걓걔걕걖걗걘걙<br />
...<br />
힟힠힡힢힣あぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとど<br />
なにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん가나닥</div></div>
<p>가능성은 희박하겠지만, ruby 2.0에서는 제발 UCS2나 4로 String 내부처리가 바뀌었으면 하는 바람이다.</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/544/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>[ruby] ruby 몰입교육중&#8230;</title>
		<link>http://hanury.net/wp/archives/540</link>
		<comments>http://hanury.net/wp/archives/540#comments</comments>
		<pubDate>Tue, 13 May 2008 16:13:45 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/540</guid>
		<description><![CDATA[회사 업무에, 용도에 따라 주로 다양한 언어를 사용하지만, 한번 쓰고 말거나, 간단한 처리는 주로 perl을 이용한다. 주로 하는 일이 UI가 필요없고, 주로 Unix환경인데다가, text처리가 대부분이라 regula expression 이 강력해서 perl이야 [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://hanury.net/wp/wp-content/uploads/2008/05/logo1.gif' align='left' />회사 업무에, 용도에 따라 주로 다양한 언어를 사용하지만,<br />
한번 쓰고 말거나, 간단한 처리는 주로 perl을 이용한다.<br />
주로 하는 일이 UI가 필요없고,<br />
주로 Unix환경인데다가,<br />
text처리가 대부분이라 regula expression 이 강력해서 perl이야 말로 아주 적격이다.</p>
<blockquote><p>ruby란 언어를 처음 접한건 1999년도 일본서 공부할때다.<br />
자연어처리 연구실이라 그곳 역서 text처리가 대부분이다.<br />
ruby 공부하던 인간도 몇 있었지만, 그저 취미 일뿐,<br />
실용적인 측면에서는 그 연구실 조차 perl이었다.</p>
<p>그래서 나도 perl을 그곳에서 배우기 시작했다.<br />
Unix + Emacs + Perl.</p></blockquote>
<p>그랬던 ruby가 몇년 전 부터 하도 유행이라, 나도 공부해 보고 업무에도 적용해 보고 싶었지만,<br />
팀에 초 고수 perl 본좌가 2명이나(noise &#038; gogma) 있는 바람에<br />
혼자서만 ruby코드를 양산할 수 없어서, 나도 친숙하고 모두가 다 아는 perl 이 주종이었다.</p>
<p>최근에 이 둘을 꼬셔서 루비 공부 시작&#8230;</p>
<p>꼬시는데 뭐 어려운거 없었다.<br />
황대산 님의 <a href="http://www.ruby-lang.org/ko/documentation/quickstart/">20분짜리 가이드</a>한번 보여줬더니<br />
바로 루비 광신도로 변신&#8230;</p>
<p><img src='http://hanury.net/wp/wp-content/uploads/2008/05/8991268250_1.jpg' align='right'/>회사 도서관에 있는 &#8216;Programming Ruby&#8217;를 죄다 빌려다 모두 공부 중.</p>
<p>근데 도대체 대충 읽을 수가 없다.</p>
<p>한줄 한줄 의미를 곱씹으니 아주 오묘하다는 것.<br />
특히 문법 설계가 아주 예술이다.</p>
<p>예전에 신군이랑 메신저로 잠깐 나눴던, Code Block이랑 Meta Programming이 왜 필요한지 왜 써야 하는지 이해가 가지 않았는데,<br />
이것참 물건이다.</p>
<p>당분간 루비 얘기로 블로그가 도배될꺼 같다.</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/540/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac에서 시리얼 로그 보기</title>
		<link>http://hanury.net/wp/archives/511</link>
		<comments>http://hanury.net/wp/archives/511#comments</comments>
		<pubDate>Wed, 05 Mar 2008 00:45:02 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[seriallog]]></category>
		<category><![CDATA[소개]]></category>
		<category><![CDATA[팁]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/511</guid>
		<description><![CDATA[21세기인 지금에도 많은 기계들이 시리얼 포트를 사용하고 있다. TV나 STB같은 경우는, AS나 디버깅 용으로, 그리고 많은 천체장비들은 아직도 시리얼통신이 주가 아닌가 싶다. 업무상 TV의 시리얼 로그를 봐야하는 경우가 종종 있는데&#8230;. [...]]]></description>
			<content:encoded><![CDATA[<p>21세기인 지금에도 많은 기계들이 시리얼 포트를 사용하고 있다.</p>
<p>TV나 STB같은 경우는, AS나 디버깅 용으로,<br />
그리고 많은 천체장비들은 아직도 시리얼통신이 주가 아닌가 싶다.</p>
<p>업무상 TV의 시리얼 로그를 봐야하는 경우가 종종 있는데&#8230;.</p>
<p>맥에서는 여태까지 어떤 프로그램으로 해야 하는지 몰랐는데.</p>
<p>일단<br />
Windows에서는 TeraTerm을 많이 사용하는거 같은데<br />
Mac용으로는 어떤프로그램으로 보는지 몰랐다.</p>
<p>시리얼 로그를 보는 프로그램으로는</p>
<ul>
<li>Minicom</li>
<li>Zterm</li>
<li>Screen</li>
</ul>
<p>이 있고</p>
<p>minicom이 가장 낳아 보였고, 간결함은 screen이 압도적인거 같다.<br />
심지어 screen은 설치도 필요없이 기본 내장이다.</p>
<p>Mac에 시리얼 포트가 없으므로 USB2Serial 젠더로 연결하고 해당 드라이버를 설치하면<br />
/dev/tty.usbserialXXXX 라는 디바이스가 보일 것이고</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$screen /dev/tty.usbserialXXXX 9600</div></div>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/511/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[java] reflect on java</title>
		<link>http://hanury.net/wp/archives/443</link>
		<comments>http://hanury.net/wp/archives/443#comments</comments>
		<pubDate>Tue, 13 Nov 2007 05:14:35 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[codemonkey]]></category>
		<category><![CDATA[codesnipet]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/443</guid>
		<description><![CDATA[회사서 Class를 조사할 일이 있는데 reflect를 까먹어서 한동안 googling 해서 다시 학습&#8230; java.lang.String의 method를 출력하는 루틴의 골자만 요약하면&#8230;. import java.lang.reflect.*; public class ClassExam&#123; &#160; &#160; public void printClassInfo&#40;String className&#41;&#123; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>회사서 Class를 조사할 일이 있는데 reflect를 까먹어서 한동안 googling 해서 다시 학습&#8230;</p>
<p>java.lang.String의 method를 출력하는 루틴의 골자만 요약하면&#8230;.</p>
<div class="codecolorer-container java vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.lang.reflect.*</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ClassExam<span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> printClassInfo<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> className<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">Class</span> a <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getClassLoader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">loadClass</span><span style="color: #009900;">&#40;</span>className<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003399;">Method</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> methods <span style="color: #339933;">=</span> a.<span style="color: #006633;">getDeclaredMethods</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>methods.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>methods<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ClassExam a <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ClassExam<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; a.<span style="color: #006633;">printClassInfo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;java.lang.String&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/443/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java programming시 유용한 사이트</title>
		<link>http://hanury.net/wp/archives/409</link>
		<comments>http://hanury.net/wp/archives/409#comments</comments>
		<pubDate>Thu, 05 Jul 2007 05:46:38 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[codemonkey]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[소개]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/409</guid>
		<description><![CDATA[나처럼 코딩할때, 웹브라우저 부터 실행하고, 각종 프로그램 조각들을 cut&#038;paste 해서 완성해가는 코드몽키들에게 Java Programming 할때, 아주 유용한 사이트. 회사서 testcase 개발할때, 아주 많은 도움이 되었기에 여기에 포스팅.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.exampledepot.com/egs/"><img src='http://hanury.net/wp/wp-content/uploads/2007/07/almanac14a.jpg' alt='almanac14a.jpg' align="left"/></a><br />
나처럼 코딩할때, 웹브라우저 부터 실행하고, 각종 프로그램 조각들을 cut&#038;paste 해서 완성해가는 코드몽키들에게 Java Programming 할때, 아주 유용한 사이트.</p>
<p>회사서 testcase 개발할때, 아주 많은 도움이 되었기에 여기에 포스팅.</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/409/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE7, FireFox, Safari 에서 블로그 검색을 쉽게 하기</title>
		<link>http://hanury.net/wp/archives/278</link>
		<comments>http://hanury.net/wp/archives/278#comments</comments>
		<pubDate>Thu, 15 Mar 2007 08:41:58 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[searchprovider]]></category>
		<category><![CDATA[sogudi]]></category>
		<category><![CDATA[소개]]></category>
		<category><![CDATA[팁]]></category>
		<category><![CDATA[표준]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/278</guid>
		<description><![CDATA[어느 블로그나 검색 메뉴가 있다. 나의 경우는 show menu를 누르면 사이드 바가 뜨고 검색 메뉴가 있다. 혹은 사전을 위해서 dic.naver.com을 찾아가거나 한다. 매번 해당 블로그나 사이트에 가서 메뉴가 있는 곳 [...]]]></description>
			<content:encoded><![CDATA[<p><img id="image277" src="http://hanury.net/wp/wp-content/uploads/2007/03/sp1.png" alt="하늘의 닷넷의 검색 메뉴" align="right"/><br />
어느 블로그나 검색 메뉴가 있다. 나의 경우는 show menu를 누르면 사이드 바가 뜨고 검색 메뉴가 있다. 혹은 사전을 위해서 dic.naver.com을 찾아가거나 한다.<br />
매번 해당 블로그나 사이트에 가서 메뉴가 있는 곳 까지 찾아 가서 검색을 하는게 가끔 번거러울 때가 있다.<br />
이를 좀더 쉽게 해보자.</p>
<p><img id="image279" src="http://hanury.net/wp/wp-content/uploads/2007/03/safari.png" alt="Safari" align="left"/></p>
<h2>safari</h2>
<p>MacOSX의 사파리의 경우에는 예전부터 <a href="http://www.kitzkikz.com/Sogudi">sogudi</a>라는 플러그인이 있어서, 이미 잘 사용하고 있었다.<br />
safari에 <a href="http://www.kitzkikz.com/Sogudi">sogudi</a>를 설치하면 다음과 같은 설정창에서<br />
hanury -> http://hanury.net/wp/index.php?s=@@@<br />
와 같이 검색할 파라미터를 @@@로 해서 검색 URL을 입력해 두면, 주소창에 URL 형태가 아닌 &#8220;hanury 검색어&#8221; 처럼 입력하면 @@@를 검색어로 치환해 주는 플러그인이다.<br />
이를 이용해서, 영어 사전은 eng, 이미지 검색은 img 등으로 설정해서 편하게 사용해 왔다.<br />
나에겐 <a href="http://hanury.net/wp/archives/39">MacOS 설치시 필수 항목</a>으로 자리잡았다.<img id="image280" src="http://hanury.net/wp/wp-content/uploads/2007/03/sogudi.png" alt="sogudi" /><br />
단점은 주소를 UTF-8으로 보내기 때문에 국내 사이트중 대부분이 KSC-5601_1987로만 받아서 깨지는 경우가 많다.<br />
Naver도 그중 하나이다. </p>
<p><img id="image281" src="http://hanury.net/wp/wp-content/uploads/2007/03/a9.gif" alt="OpenSearch" align="left"/>이런 와중에 <a href="http://opensearch.a9.com/">OpenSearch</a>에서 이런 부분을 xml 스키마 형태로 표준화 했고,<br />
IE7과 FireFox가 지원하기 시작했다.</p>
<p><img id="image282" src="http://hanury.net/wp/wp-content/uploads/2007/03/ff.png" alt="FireFox" align="left" /></p>
<h2>FireFox</h2>
<p><img id="image284" src="http://hanury.net/wp/wp-content/uploads/2007/03/ff-search1.png" alt="ff-search1.png" align="right"/><br />
<a href="http://opensearch.a9.com/">OpenSearch</a>에서 정의한 대로 Search Provider XML을 작성해서 searchplugins 폴더에 놔 두면 된다.<br />
MacOSX용 FF의 경우라면 Package 내 Contents/MacOS/searchplugins/ 에 해당한다.</p>
<p>직접 편집하는 만큼 자유도가 높다.<br />
재밌는건 아이콘을 넣을려면, Base64로 인코딩 된 스트링을 알아야 하는데, 내 경우에는 아이콘 파일을 나한테 보내서<br />
메일 메시지의 [본문 원본보기] 로 알아냈다. (아마 더 낳은 방법이 있을거 같은데&#8230;. 암튼.)</p>
<p>또 다른 방법으로 [검색 사이트 관리...] &#8211; [추가할 검색사이트 찾기]를 눌러보면<br />
<a href="http://mycroft.mozdev.org/">다른 사용자들이 올려놓은 사전등의 SearchProvider</a> 들이 등록되어 있다.<br />
입맛에 맞게 골라 쓰면 된다.</p>
<p>OpenSearch 용 XML내용은 대략 다음과 같다.</p>
<div class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SearchPlugin</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.mozilla.org/2006/browser/search/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ShortName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Hanury<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ShortName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Hanury.NET Search<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;InputEncoding<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>UTF-8<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/InputEncoding<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Image</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;16&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;16&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>data:image/ico;base64,Qk04AgAAAAAAADY<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AAAAoAAAAEAAAABAAAAABABAAAAAAAAICAAASCwAAEgsAAAAAAAAAAA<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AATlpvYm9mTmLTahRvsG7RbvJu8m7RDlYOUpNeem+8c5xze284Z5FW5Vk<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Wa753e284Z+tVhlVGUQRF4zwFOQ5Km3Obb/Veb1LDVa9 ...<br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Image<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Url</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/html&quot;</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;GET&quot;</span> </span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;http://hanury.net/wp/index.php&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Param</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;s&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;{searchTerms}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SearchForm<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://hanury.net/wp<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SearchForm<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SearchPlugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p><img id="image283" src="http://hanury.net/wp/wp-content/uploads/2007/03/ie.png" alt="IE 7" align="left"/></p>
<h2>IE 7</h2>
<p><img id="image287" src="http://hanury.net/wp/wp-content/uploads/2007/03/ie-search.png" alt="ie-search.png" align="right"/><br />
Microsoft IE7 도 OpenSearch 표준에 참가해서 IE 7 부터 FF 와 같은 방식의 SearchProvider를 제공한다.<br />
FF와 같은 표준을 구현하였기에 대략 비슷하지만 각각 차이가 있다.</p>
<ul>
<li>FF가 icon을 제공하는데 반해 IE는 제공하지 않는다.</li>
<li>FF, IE 모두 남들(혹은 서비스 제공자)가 만들어 준 SearchProvider를 쉽게 추가할수 있다.</li>
<li>하지만 IE에 좀더 후한 점수를 주고 싶은 건 [Find more Provider] &#8211; [직접 만들기] 기능이다.<br />
naver 사전이나, 가격 검색 등은 남들이 만들어 주겠지만, 나만을 위한 SearchProvider는 제공 받을리 만무 하다.<br />
이럴때 FF는 내가 직접 XML을 편집해서 만들 수 있지만, xml 편집 조차 부담스러워 하는 사람들에게는 IE의 [직접 만들기] 기능은 상당히 매력적이다.</li>
<li><a href="http://www.kitzkikz.com/Sogudi">sogudi</a>와 비교해서는 추가 설치하지 않아도 된다는 점</li>
<li><a href="http://www.kitzkikz.com/Sogudi">sogudi</a>가 UTF-8만 지원하는데 반해, [직접만들기]-[여기를 클릭]을 누르면 입력 옵션이 더 늘어서 인코딩 등을 추가 설정해 줄수 있다.(국내 사이트를 위해서 중요하다.)</li>
</ul>
<p><img id="image288" src="http://hanury.net/wp/wp-content/uploads/2007/03/ie-search1.png" alt="직접 만들기" /><br />
safari의 <a href="http://www.kitzkikz.com/Sogudi">sogudi</a>의 @@@ 처럼 검색어를 대문자 TEST로 해서 입력하고, 이름을 입력하고 바로 밑에 있는 [설치] 단추를 누르면 끝.<br />
한동안 시장 점유율만 믿고, IE6에서 개발을 한동안 중단했던 거만함도, MS가 몇년전부터 노래부르던 UX를 위해 IE7을 통해, 그동안 아쉬웠던, TabBrowsing, RSS 지원, OpenSearch 등등 긍정적인 방향으로 나아가는거 같다.</p>
<p>본인의 경우는 각종 사전류, 회사 프로젝트에 사용하는 trac, 그리고 내 블로그 검색 용으로 개인용 SearchProvider를 만들어 사용하고 있다.</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/278/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mac 용 Java program 만들기??</title>
		<link>http://hanury.net/wp/archives/275</link>
		<comments>http://hanury.net/wp/archives/275#comments</comments>
		<pubDate>Tue, 13 Mar 2007 13:48:48 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[다운로드]]></category>
		<category><![CDATA[소개]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/275</guid>
		<description><![CDATA[Hello.java 가 있다고 하면 $javac Hello.java 로 컴파일 가능하다. jar로 묶기 위해서 manifest.mf 파일을 만들고 안에 Main-Class: Hello 라고 public static void main(String[] args)을 포함한 시작 클래스를 적어둔다. $jar cvfm [...]]]></description>
			<content:encoded><![CDATA[<p>Hello.java 가 있다고 하면</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$javac Hello.java</div></div>
<p>로 컴파일 가능하다.</p>
<p>jar로 묶기 위해서<br />
manifest.mf 파일을 만들고 안에<br />
Main-Class: Hello<br />
라고 public static void main(String[] args)을 포함한 시작 클래스를 적어둔다.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$jar cvfm hello.jar manifest.mf Hello.class</div></div>
<p>를 실행하면 여러 파일을 묶을수도 있고, 압축도 해주며 java -jar 로 실행도 가능하다.<br />
여기까지는 일반 jar 만들기 이고&#8230;</p>
<p><div class='download-link'>
							<a href='http://hanury.net/wp/download.php?file=http://alexken.homeip.net/files/XmlViewer.zip'><img alt='Download' class='leftalign' src='http://hanury.net/wp/wp-content/plugins/dBeautifier/icons/downloads.png' /></a>
							<h4>
								<a href='http://hanury.net/wp/download.php?file=http://alexken.homeip.net/files/XmlViewer.zip'>XmlViewer 다운 받기(MacOSX용 어플)</a>
							</h4><p>Downloads: 12 File Size: 0.0 KB </p>
						</div><br />
<img id="image276" src="http://hanury.net/wp/wp-content/uploads/2007/03/xmlviewer.png" alt="xmlviewer.png" /><br />
허접하지만 내가 만든 Xml Viewer이다. xml 파일을 끌어다 속성창에 떨어뜨리면 swing tree 보기로 보여주는데, exception 처리를 거의 하지 않아 외부 entity나, dtd를 참조하거나 하면 여지없이 exception 발생<br />
암튼 본인 업무상 쓸일이 있어서 만들었다.</p>
<p>일반 macosx용 응용프로그램 처럼 보이지만 패키지 보기로 보면 jar로 묶인 자바 프로그램이란 걸 알 수 있다.</p>
<p>일반 macosx용 응용 프로그램 처럼 더블클릭으로 수행되며, 독에 포함 할 수도 있다.<br />
<img id="image274" src="http://hanury.net/wp/wp-content/uploads/2007/03/info.png" alt="info.png" /></p>
<p>ANT를 사용한다면 sorceforge에서 JarBundler라는 Task로 제공되어 쉽게 jar를 mac App로 만들어 주나 본데, 패키지 않에 있는 inpo.plist만 수정해주면 금망 jar로 mac App로 변신 가능<br />
스크린 샷에서 처럼<br />
Root-Java-</p>
<blockquote><p>
	• Arguments<br />
	• ClassPath<br />
	• JVMVersion<br />
	• MainClass
</p></blockquote>
<p>이정도 값만 세팅해주면 끝.<br />
자세한 내용은 <a href="http://developer.apple.com/documentation/Java/Conceptual/JavaPropVMInfoRef/Articles/JavaDictionaryInfo.plistKeys.html">Apple Dev 페이지</a>에&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/275/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>메시에 페이지 Ajax 도입</title>
		<link>http://hanury.net/wp/archives/270</link>
		<comments>http://hanury.net/wp/archives/270#comments</comments>
		<pubDate>Fri, 16 Feb 2007 17:24:48 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[천문]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/270</guid>
		<description><![CDATA[메뉴에서 [astro] 에 가서 [메시에]를 클릭하면 그냥 [메시에]가 있고, [메시에(Ajax)]라는게 지금 일시적으로 보인다. 비록 두 메뉴를 아무리 클릭해봤자 똑같이 보일 뿐이지만, 메뉴 이름 그대로 ajax를 도입한 쪽이 좀더 빠르게 느껴지고 [...]]]></description>
			<content:encoded><![CDATA[<p>메뉴에서 [astro] 에 가서 [메시에]를 클릭하면<br />
그냥 [<a href="http://hanury.net/wp/astro/messier">메시에</a>]가 있고, [<a href="http://hanury.net/wp/astro/messier-ajax">메시에(Ajax)</a>]라는게 지금 일시적으로 보인다.</p>
<p>비록 두 메뉴를 아무리 클릭해봤자 똑같이 보일 뿐이지만, 메뉴 이름 그대로 ajax를 도입한 쪽이 좀더 빠르게 느껴지고 반응이 신속하게 보일거다.</p>
<p>원래 http://hanury.net/wp/astro/messier?xsl=# 와 같이 xsl 번호를 GET으로 php를 넘겨주면<br />
messier.php 페이지는 xml을 가져와서 xslt를 적용해서 html로 변환하고 클라이언트에게 넘긴다.<br />
이 동안 클라이언트는 먹통이 된다.<br />
그리고 새로 가져온 페이지는 전체 리로드 하게 되어 화면이 한번 꿈뻑하게 된다.</p>
<p>하지만 [메시에(Ajax)] 페이지는 전체 리로딩 없이 아래 표시한 데이터 영역만 치환될뿐 페이지는 리로드 되지 않는다.<br />
페이지 내에서 생성한 XMLHttpRequest가 계속 서버랑 통신 할 뿐이다.</p>
<p><a class="imagelink" href="http://hanury.net/wp/wp-content/uploads/2007/02/messier-ajax.png"><img id="image271" src="http://hanury.net/wp/wp-content/uploads/2007/02/messier-ajax.png" alt="messier-ajax.png" rel="lightbox" wdith="500" /></a></p>
<p>다음과 같이 요즌 뜬다는 ajax 스타일로 변경하였다.</p>
<ol>
<li>그래서 messier.php에서 xml을 가져와서 xslt를 적용해서 html로 변환하는 부분을 다른 php로 뽑아내고	</li>
<li>컨텐트 부분에 &#038;t;div id=&#8221;messier&#8221;&gt;를 삽입하고</li>
<li>링크를 누르면 getMessier를 부르고 그 안에서 sendRequest를 다시 부르는데
<div class="codecolorer-container javascript vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> getMessier<span style="color: #009900;">&#40;</span>n<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; sendRequest<span style="color: #009900;">&#40;</span>on_loaded<span style="color: #339933;">,</span> <span style="color: #3366CC;">'&amp;xsl='</span><span style="color: #339933;">+</span>n<span style="color: #339933;">,</span> <span style="color: #3366CC;">'GET'</span><span style="color: #339933;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'/scripts/messier.php'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>XMLHttpRequest 내장객체를 생성해서 1에서 따로 뽑아주었다는 php로 렌더링할 xslt정보와 함께 GET으로 호출<br />
		이후 서버의 응답을 기다리는게 아니라</li>
<div class="codecolorer-container javascript vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>obj.<span style="color: #660066;">readyState</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">4</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; on_loaded<span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Ajax의 A가 Asyncrous 이듯, onload 상태가 되었을때 수행할 callback 함수만 지정하고 다음 일을 계속 할수 있다.<br />
		물론 막간을 이용해서 anymated gif로 진행중임을 표시해주는 센스가 있으면 좋겠지만 난 그냥 귀찮아서 아무것도 안해줌. 그래도 마우스 휠 조자 안 먹는 상태보다는 낳지 뭐.</p>
<div class="codecolorer-container javascript vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> on_loaded<span style="color: #009900;">&#40;</span>ob<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> res <span style="color: #339933;">=</span> decodeURIComponent<span style="color: #009900;">&#40;</span>ob.<span style="color: #660066;">responseText</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'messier'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> res<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<li>서버에서 처리가 다 되면 호출 했던 XMLHttpRequest가  서버로 부터 응답을 받고</li>
<li>callback함수로 지정한 on_loaded함수가 호출 되고</li>
<li>이 함수는 &lt;div&gt; 의 innerHTML에 서버로 부터 받은 결과를 써 넣어준다.</li>
</ol>
<p>복잡해 보이지만, 실제 코딩량도 별로 없고, 훨씬 직관적인거 같다.<br />
어느정도 더 다듬어 지면 그냥 버전을 ajax 버전으로 통합해 버려야 겠다.</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/270/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>3n+1</title>
		<link>http://hanury.net/wp/archives/218</link>
		<comments>http://hanury.net/wp/archives/218#comments</comments>
		<pubDate>Tue, 09 Jan 2007 16:55:55 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/218</guid>
		<description><![CDATA[이전글(messier 페이지에 type icon 표시 추가)을 올렸더니 allblog에서 같은 카테고리 blog article로 3n + 1 문제 코딩가 올라와서 호기심에서 perl 로 짜 보았다. 원 문제 내용http://acm.uva.es/p/v1/100.html 무지 간단해 보이는 데 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://hanury.net/wp/archives/217">이전글(messier 페이지에 type icon 표시 추가)</a>을 올렸더니 allblog에서 같은 카테고리 blog article로 <a href="http://cookiedev.pe.kr/53">3n + 1 문제 코딩</a>가 올라와서 호기심에서 perl 로 짜 보았다.</p>
<p>원 문제 내용<a href="">http://acm.uva.es/p/v1/100.html</a></p>
<p>무지 간단해 보이는 데 타이틀 까지 건 이유가 뭔지 궁금해 호기심에서 짜 보았다.<br />
게다가 정말 간단해 보이는데 이문제가 NP 문제라는게 더욱이 그러했다.</p>
<p>내가 짠 perl code는 이렇다. (짜는데야 타이핑 시간 1분여가 소요되었지만, 원 문제를 곱씹어 보면서 영어 해석하는데 좀 시간이 걸렸다. 쉽다고 댐볐지만, 내용의 깊이는 그리 간단한게 아니었다.)</p>
<div class="codecolorer-container perl vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span><br />
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">sub</span> three_n_plus_one<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$)</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$n</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">print</span> <span style="color: #0000ff;">$n</span> <span style="color: #339933;">.</span> <span style="color: #ff0000;">&quot; &quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">exit</span> <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$n</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$n</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; three_n_plus_one<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span> <span style="color: #339933;">*</span> <span style="color: #0000ff;">$n</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; three_n_plus_one<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$n</span> ／ <span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">sub</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; three_n_plus_one<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">22</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>문제의 특징은:</p>
<ul>
<li> <b>가정:</b> 자연수를 주면 반드시 끝난다.</li>
<li> 간단해 보이는 알고리즘에도 불구하고, 이 가정이 사실인지는 알려져있지 않다.(아직은??? 영원히&#8230;)</li>
<li>0 < n < 1,000,000사이에서는 그렇다는게 알려져 있다.</li>
</ul>
<p>이정도???&#8230;.</p>
<p>여러 숫자를 넣어 보니, 원 글에서 처럼,<br />
&#8230; 5 16 8 4 2 1 로 수렴하며 끝나긴 끝났다.</p>
<p>참고로, 입력이 1,000,000,000,000,000였을 때<br />
결과는 </p>
<p><span id="more-218"></span></p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">1e+15 500000000000000 250000000000000 125000000000000 62500000000000 <br />
31250000000000 15625000000000 7812500000000 3906250000000 1953125000000 <br />
976562500000 488281250000 244140625000 122070312500 61035156250 30517578125<br />
91552734376 45776367188 22888183594 11444091797 34332275392 17166137696 <br />
8583068848 4291534424 2145767212 1072883606 536441803 1609325410 804662705 <br />
2413988116 1206994058 603497029 1810491088 905245544 452622772 226311386 <br />
113155693 339467080 169733540 84866770 42433385 127300156 63650078 31825039 <br />
95475118 47737559 143212678 71606339 214819018 107409509 322228528 161114264 <br />
80557132 40278566 20139283 60417850 30208925 90626776 45313388 22656694 <br />
11328347 33985042 16992521 50977564 25488782 12744391 38233174 19116587 <br />
57349762 28674881 86024644 43012322 21506161 64518484 32259242 16129621 <br />
48388864 24194432 12097216 6048608 3024304 1512152 756076 378038 189019 <br />
567058 283529 850588 425294 212647 637942 318971 956914 478457 1435372 <br />
717686 358843 1076530 538265 1614796 807398 403699 1211098 605549 1816648 <br />
908324 454162 227081 681244 340622 170311 510934 255467 766402 383201 <br />
1149604 574802 287401 862204 431102 215551 646654 323327 969982 484991 <br />
1454974 727487 2182462 1091231 3273694 1636847 4910542 2455271 7365814 <br />
3682907 11048722 5524361 16573084 8286542 4143271 12429814 6214907 18644722 <br />
9322361 27967084 13983542 6991771 20975314 10487657 31462972 15731486 <br />
7865743 23597230 11798615 35395846 17697923 53093770 26546885 79640656 <br />
39820328 19910164 9955082 4977541 14932624 7466312 3733156 1866578 933289 <br />
2799868 1399934 699967 2099902 1049951 3149854 1574927 4724782 2362391 <br />
7087174 3543587 10630762 5315381 15946144 7973072 3986536 1993268 996634 <br />
498317 1494952 747476 373738 186869 560608 280304 140152 70076 35038 <br />
17519 52558 26279 78838 39419 118258 59129 177388 88694 44347 133042 <br />
66521 199564 99782 49891 149674 74837 224512 112256 56128 28064 14032 <br />
7016 3508 1754 877 2632 1316 658 329 988 494 247 742 371 1114 557 1672 <br />
836 418 209 628 314 157 472 236 118 59 178 89 268 134 67 202 101 304 <br />
152 76 38 19 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1</div></div>
<p><b>아!! 정말 영원히 풀 수 없는 문제란 말인가???</b></p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/218/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>messier 페이지에 type icon 표시 추가</title>
		<link>http://hanury.net/wp/archives/217</link>
		<comments>http://hanury.net/wp/archives/217#comments</comments>
		<pubDate>Tue, 09 Jan 2007 15:47:48 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[천문]]></category>
		<category><![CDATA[xslt]]></category>
		<category><![CDATA[메시에]]></category>
		<category><![CDATA[천체]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/217</guid>
		<description><![CDATA[메시에 페이지에 가면 메시에 DB가 있다. 테이블 보기에서는 모든 정보가 보이지만, 촬영 시기별 보기나, 촬영 장비별 보기에서는 대상이 은하인지, 성운인지 알 방법이 없어서, 모든 대상 옆에 icon을 붙였다. 각 대상은 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://hanury.net/wp/astro/messier">메시에</a> 페이지에 가면 메시에 DB가 있다.<br />
<a href="http://hanury.net/wp/astro/messier">테이블 보기</a>에서는 모든 정보가 보이지만,<br />
<a href="http://hanury.net/wp/astro/messier?xsl=4">촬영 시기별</a> 보기나, <a href="http://hanury.net/wp/astro/messier?xsl=5">촬영 장비별</a> 보기에서는 대상이 은하인지, 성운인지 알 방법이 없어서,<br />
모든 대상 옆에 icon을 붙였다.<br />
각 대상은 다음과 같다.</p>
<ul>
<li>행성상 성운/초신성 잔해물 :<img src="http://hanury.net/images/deepskyicon/PlanetaryNebular.png"></li>
<li>성운 :<img src="http://hanury.net/images/deepskyicon/DiffuseNebular.png"></li>
<li>은하 :<img src="http://hanury.net/images/deepskyicon/Galaxy.png"></li>
<li>산개 성단 :<img src="http://hanury.net/images/deepskyicon/OpenCluster.png"></li>
<li>구상 성단 :<img src="http://hanury.net/images/deepskyicon/GlobularCluster.png"></li>
<li>이중성, 성군(星群), 기타 :<img src="http://hanury.net/images/deepskyicon/BinaryStar.png"></li>
</ul>
<p>(icon 이미지는 <a href="http://astronote.org">천문노트</a>에 있는 <a href="http://astronote.org/note/?idx=441&#038;menu=2">별 있는거</a> 안에 있는 이미지를 편집해서 사용했다.<br />
이 글을 쓰고나서 제작자의 양해를 구해야지&#8230;)</p>
<p>messier페이지는 서버에서 html로 렌더링 해서 뿌리기 때문에, 소스보기해도 알 방법은 없지만,<br />
현재는 messier DB를 xml 로 저장해서</p>
<div class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;object<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;num<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>M1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/num<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ngc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>NGC1952<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ngc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;const<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Taurus<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/const<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constabbr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Tau<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/constabbr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Supernova Remnant<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;subtype<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>-<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/subtype<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ra<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>05 34.5<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ra<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>+22 01<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mag<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>8.4<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mag<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;diameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>6<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/diameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;distance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>6.3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/distance<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;desc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Crab Nebula<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/desc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>&nbsp; &nbsp; <br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/object<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>xslt를 여러개 만들어서 각 보기마다 실시간으로 렌더링해서 html을 생성하는 구조이다.<br />
이를 위해서 &lt;xsl:choose>&lt;xsl:when>을 사용했다.</p>
<p>아래 소스는 xslt  안에 있는 type에 대한 &lt;xsl:template>이다.</p>
<div class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;type&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:choose<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:when</span> <span style="color: #000066;">test</span>=<span style="color: #ff0000;">&quot;contains(.,'Open Cluster')&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;/images/deepskyicon/OpenCluster.png&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:when<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:when</span> <span style="color: #000066;">test</span>=<span style="color: #ff0000;">&quot;contains(.,'Galaxy')&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;/images/deepskyicon/Galaxy.png&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:when<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:when</span> <span style="color: #000066;">test</span>=<span style="color: #ff0000;">&quot;contains(.,'Globular Cluster')&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;/images/deepskyicon/GlobularCluster.png&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:when<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:when</span> <span style="color: #000066;">test</span>=<span style="color: #ff0000;">&quot;contains(.,'Nebula')&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;/images/deepskyicon/DiffuseNebular.png&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:when<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:when<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:otherwise<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;/images/deepskyicon/BinaryStar.png&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:otherwise<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:choose<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>몇가지 패턴을 알수 있다.</p>
<ul>
<li><a href="http://hanury.net/wp/astro/messier?xsl=3">거리순 보기</a>를 보면, 은하들은 죄다 거리가 멀다는 걸 알수 있다. &#8211; 당근 나머지 대상은 우리 은하 내의 대상이니까</li>
<li><a href="http://hanury.net/wp/astro/messier?xsl=4">시기별 보기</a>를 보면, 2~3월엔 거진 외부 은하들만 바글바글하고 5~6월(여름), 11~12월(겨울)엔 은하 찾기가 힘들다. &#8211; 여름 겨울철엔 은하수(즉 우리은하)가 흐르니까 우리은하내에 있는 성운, 성단들이 주로 보이는 게다.</li>
<li><a href="http://hanury.net/wp/astro/messier?xsl=2">밝기별 보기</a>를 보면, 은하들은 순위가 떨어진다. (독보적인 M31을 제외하면) &#8211; 역시 은하들은 거리가 머니까&#8230;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/217/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Perl에서 Getopt::Std 사용하기</title>
		<link>http://hanury.net/wp/archives/173</link>
		<comments>http://hanury.net/wp/archives/173#comments</comments>
		<pubDate>Wed, 30 Aug 2006 02:13:58 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[codesnipet]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/173</guid>
		<description><![CDATA[Unix스타일의 프로그램 파라미터 처리를 해주는 모듈이 Getopt인데 자주 사용하다 보니 codesnipet으로 사용하려고, 내가 사용하는 템플릿을 여기에 등록해 둔다. main::HELP_MESSAGE(), main::VERSION_MESSAGE() 를 구현해 두면 &#8211; -help, &#8211; -version 옵션에 반응하고, getopts(c:hv)에 [...]]]></description>
			<content:encoded><![CDATA[<p>Unix스타일의 프로그램 파라미터 처리를 해주는 모듈이 Getopt인데<br />
자주 사용하다 보니 codesnipet으로 사용하려고, 내가 사용하는 템플릿을 여기에 등록해 둔다.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">main::HELP_MESSAGE(), main::VERSION_MESSAGE()</div></div>
<p>를 구현해 두면 &#8211; -help, &#8211; -version 옵션에 반응하고, getopts(c:hv)에 사용할 옵션들을 나열하면 된다.<br />
위 예에서 c뒤에 : 의 의미는 파라미터를 받는 다는 의미이다.<br />
입력된 파라미터는 $Getopt::Std::opt_c로 사용할 수 있다.</p>
<div class="codecolorer-container perl vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span><br />
<span style="color: #666666; font-style: italic;"># vim: set sw=4 ts=4 si et nu:</span><br />
<br />
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">use</span> Getopt<span style="color: #339933;">::</span><span style="color: #006600;">Std</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">########################################################</span><br />
<span style="color: #666666; font-style: italic;"># Global settings</span><br />
<span style="color: #666666; font-style: italic;">########################################################</span><br />
<span style="color: #0000ff;">$Getopt</span><span style="color: #339933;">::</span><span style="color: #006600;">Std</span><span style="color: #339933;">::</span><span style="color: #006600;">STANDARD_HELP_VERSION</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">sub</span> main<span style="color: #339933;">::</span><span style="color: #006600;">VERSION_MESSAGE</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;$0 Version 0.5 &nbsp; hyeonkwen@gmail.com&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">sub</span> main<span style="color: #339933;">::</span><span style="color: #006600;">HELP_MESSAGE</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">print</span> <span style="color: #cc0000; font-style: italic;">&lt;&lt;END;<br />
Description of this program.<br />
Usage: $0 OPTION DIRECTORY<br />
<br />
OPTION<br />
&nbsp; &nbsp; -c &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; description of c option<br />
&nbsp; &nbsp; -h &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; view help message<br />
&nbsp; &nbsp; -v &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; view version information<br />
END</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">########################################################</span><br />
<span style="color: #666666; font-style: italic;"># main()</span><br />
<span style="color: #666666; font-style: italic;">########################################################</span><br />
<br />
<span style="color: #000000; font-weight: bold;">sub</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>getopts<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;c:hv&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #0000ff;">$Getopt</span><span style="color: #339933;">::</span><span style="color: #006600;">Std</span><span style="color: #339933;">::</span><span style="color: #006600;">opt_h</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; main<span style="color: #339933;">::</span><span style="color: #006600;">HELP_MESSAGE</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">exit</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">elsif</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$Getopt</span><span style="color: #339933;">::</span><span style="color: #006600;">Std</span><span style="color: #339933;">::</span><span style="color: #006600;">opt_v</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; main<span style="color: #339933;">::</span><span style="color: #006600;">VERSION_MESSAGE</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">exit</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/173/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>현재 한반도 구름 사진 2</title>
		<link>http://hanury.net/wp/archives/149</link>
		<comments>http://hanury.net/wp/archives/149#comments</comments>
		<pubDate>Mon, 03 Jul 2006 05:43:37 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[천문]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/149</guid>
		<description><![CDATA[- 현재 한반도 구름 사진 예전에 만들었던 한반도 구름사진 페이지  http://hanury.net/wp/astro/claud/ 가 호스팅 시작후에 서버 설정에 의해 안돌아 가고 말았다. 호스팅을 맏긴 cafe24에서 php 5를 지원 안해서 •php4에서 stream_get_contents()가 지원이 안되고, [...]]]></description>
			<content:encoded><![CDATA[<p><a title="위성 구름 사진" href="http://static.flickr.com/60/173246286_7dbe6e2a1e_o.gif" rel="lightbox"><img src="http://static.flickr.com/60/173246286_7dbe6e2a1e_m.jpg" width="150" align="left" /></a></p>
<p>- <a href="http://hanury.net/wp/archives/121">현재 한반도 구름 사진</a></p>
<p>예전에 만들었던 한반도 구름사진 페이지  <a href="http://hanury.net/wp/astro/claud/">http://hanury.net/wp/astro/claud/</a> 가 호스팅 시작후에 서버 설정에 의해 안돌아 가고 말았다.</p>
<p>호스팅을 맏긴 cafe24에서 php 5를 지원 안해서</p>
<p>•php4에서 stream_get_contents()가 지원이 안되고,<br />
•sensitive URL Open을 막아서 인데, 어쩔수 없이</p>
<div class="codecolorer-container perl vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">$fp</span> <span style="color: #339933;">=</span> fopen<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$url</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'r'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
<span style="color: #0000ff;">$str</span> <span style="color: #339933;">=</span> stream_get_contents<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>위에 2줄로 끝나던 코드를<br />
my_stream_get_contents란 함수를 추가해주고(php4에서 없으므로)<br />
fopen만으로 열던 것을 socket을 이용해서 열도록 수정해야만 했다&#8230;</p>
<div class="codecolorer-container perl vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">function my_stream_get_contents<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">$buf</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>feof<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">$buf</span> <span style="color: #339933;">.=</span> fread<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$fp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1024</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <br />
&nbsp; &nbsp; <span style="color: #000066;">return</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$buf</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
<span style="color: #009900;">&#125;</span> <br />
<span style="color: #0000ff;">$fp</span> <span style="color: #339933;">=</span> fsockopen<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$host</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$errno</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$errstr</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
fputs<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$fp</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;GET $url HTTP/1.0<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
fputs<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$fp</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;Host: $host<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
fputs<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$fp</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;Referer: http://$host<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
fputs<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$fp</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;User-Agent:Mozilla/4.0(compatible;MSIE6.0;Windows NT5.1)<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
<span style="color: #0000ff;">$str</span> <span style="color: #339933;">=</span> my_stream_get_contents<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>아! 점점 코드 지저분해 진다.</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/149/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hanury.NET Widget</title>
		<link>http://hanury.net/wp/archives/148</link>
		<comments>http://hanury.net/wp/archives/148#comments</comments>
		<pubDate>Fri, 30 Jun 2006 12:12:14 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[하늘이]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[다운로드]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/148</guid>
		<description><![CDATA[디카 리뷰 사이트로 유명한 dpReview의 RSS Viewer 위젯을 손봐서, Hanury.NET 전용 위젯을 만들었다. Hanury Widget for Mac OS X Downloads: 7 File Size: 0.0 KB 주의: 매킨토시 대시보드 전용이므로, 다른 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://static.flickr.com/61/178318334_a235a660c4.jpg" alt="HanuryWidget" /></p>
<p>디카 리뷰 사이트로 유명한 dpReview의 RSS Viewer 위젯을 손봐서,<br />
Hanury.NET 전용 위젯을 만들었다.</p>
<p><div class='download-link'>
							<a href='http://hanury.net/wp/download.php?file=http://alexken.homeip.net/files/HanuryWidget.zip'><img alt='Download' class='leftalign' src='http://hanury.net/wp/wp-content/plugins/dBeautifier/icons/downloads.png' /></a>
							<h4>
								<a href='http://hanury.net/wp/download.php?file=http://alexken.homeip.net/files/HanuryWidget.zip'>Hanury Widget for Mac OS X</a>
							</h4><p>Downloads: 7 File Size: 0.0 KB </p>
						</div><br />
주의: 매킨토시 대시보드 전용이므로, 다른 오에스 사람은 받아가지 마세요!!!</p>
<p>근데 내 블로그를 맥으로 접속해서 다운로드 받은 사람이 과연 몇명이나 될까???</p>
<p>참고로 앞면은 RSS를 짧은 텍스트로 보여주고, 뒷면은 카테고리를 선택해, 글을 필터링해서 볼수 있다.</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/148/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>하늘이 태어난지 몇일 째인지 표시</title>
		<link>http://hanury.net/wp/archives/131</link>
		<comments>http://hanury.net/wp/archives/131#comments</comments>
		<pubDate>Mon, 26 Jun 2006 04:16:38 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[하늘이]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/131</guid>
		<description><![CDATA[그림과 같이 하늘이가 태어난 지 몇일 지났는지 블로그 헤더에 붙였다. echo&#40;time&#40;&#41;-date&#40;&#34;U&#34;,mktime&#40;date&#40;&#34;H&#34;&#41;,date&#40;&#34;i&#34;&#41;,date&#40;&#34;s&#34;&#41;,2,21,2006&#41;&#41;&#41;/60/60/24+1; 다소 지저분해 보이긴 하지만, 헤더에 그냥 붙일꺼라서&#8230; 끝에 +1 한 이유는 우리나라에서는 태어난날을 1일로 친다고해서, +1일 해줌.]]></description>
			<content:encoded><![CDATA[<p><img id="image130" src="http://hanury.net/wp/wp-content/uploads/2006/06/header.png" alt="header.png" /><br />
그림과 같이 하늘이가 태어난 지 몇일 지났는지 블로그 헤더에 붙였다.</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;U&quot;</span><span style="color: #339933;">,</span><span style="color: #990000;">mktime</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;H&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;i&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">21</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2006</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">24</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span></div></div>
<p>다소 지저분해 보이긴 하지만, 헤더에 그냥 붙일꺼라서&#8230;<br />
끝에 +1 한 이유는 우리나라에서는 태어난날을 1일로 친다고해서, +1일 해줌.</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/131/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>개발자용 폰트</title>
		<link>http://hanury.net/wp/archives/126</link>
		<comments>http://hanury.net/wp/archives/126#comments</comments>
		<pubDate>Fri, 23 Jun 2006 01:18:09 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[소개]]></category>
		<category><![CDATA[폰트]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/126</guid>
		<description><![CDATA[Gnome에서 배포하는 Vera라는 폰트이다.(zeph님 사이트에서 봄) Bitstream-vera라고 적혀 있는거 봐서는 일찌기 부터 unicode 폰트를 개발해 왔던 BitStream사의 폰트인가 보지? 확인은 안해봤다. 0과O의 구분이나 1, I, &#124;의 구분이 명확히 두드러져 개발자 [...]]]></description>
			<content:encoded><![CDATA[<p>Gnome에서 배포하는 <a href="http://www.gnome.org/fonts/">Vera</a>라는 폰트이다.(<a href="http://izeph.com/tt/blog/trackback/203">zeph</a>님 사이트에서 봄)<br />
Bitstream-vera라고 적혀 있는거 봐서는 일찌기 부터 unicode 폰트를 개발해 왔던 BitStream사의 폰트인가 보지?<br />
확인은 안해봤다.</p>
<p>0과O의 구분이나 1, I, |의 구분이 명확히 두드러져 개발자 폰트라 하나 보다.</p>
<p>bold, italic등 다양한 폰트셋으로 구성되어 있고, 무엇보다도, 폰트는 공짜란 인식이 많은 한국에서 별 의미 없는 일이지만, 공개 폰트라 맘 놓고 써도 되는 폰트이다.</p>
<p>기존에 Mac에서 제공하는 기본 고정폭 폰트인 Monaco와 비교 사진을 올린다.<br />
근데, 원래 Monaco도 훌륭했던 지라, 크게 나아진점은 모르겠고,<br />
Monaco에 비해 높이가 작아, 더 많은 줄을 표시할수 있는게 가장 두드러진 장점인듯&#8230;.</p>
<p>기존의 모나코 폰트<br />
<img id="image123" src="http://hanury.net/wp/wp-content/uploads/2006/06/monaco.png" alt="monaco.png"  rel="lightbox"/></p>
<p>새로 설치한 베라 폰트<br />
<img id="image124" src="http://hanury.net/wp/wp-content/uploads/2006/06/vera.png" alt="vera.png" rel="lightbox"/></p>
<p>Bitstream Vera Sans Mono 다운받기 : <a href="http://www.gnome.org/fonts/">http://www.gnome.org/fonts/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/126/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>현재 한반도 구름 사진</title>
		<link>http://hanury.net/wp/archives/121</link>
		<comments>http://hanury.net/wp/archives/121#comments</comments>
		<pubDate>Thu, 22 Jun 2006 14:20:31 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[천문]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/121</guid>
		<description><![CDATA[장마라, 별 볼일 없지만, 날씨 좋은날 주말이 다가오면 자주 찾아가는 곳 중의 하나가 기상청 위성 사진 페이지이다. 그래서 기상청에서 현재 위성 이미지를 가져와서 보여주는 페이지를 astro 메뉴 밑에 작성하려고 짜 [...]]]></description>
			<content:encoded><![CDATA[<p><a title="위성 구름 사진" href="http://static.flickr.com/60/173246286_7dbe6e2a1e_o.gif" rel="lightbox" ><img src="http://static.flickr.com/60/173246286_7dbe6e2a1e_m.jpg" width="150" align="left"/></a><br />
장마라, 별 볼일 없지만, 날씨 좋은날 주말이 다가오면 자주 찾아가는 곳 중의 하나가 기상청 위성 사진 페이지이다.<br />
그래서 기상청에서 현재 위성 이미지를 가져와서 보여주는 <a href="http://hanury.net/wp/astro/claud/">페이지</a>를 astro 메뉴 밑에 작성하려고 짜 보았다.<br />
php에서 httprequest 같은거 없나 하고 한참을 찾았는데, 그냥 파일처럼 처리하면 되네&#8230;<br />
역시 모르면 고생&#8230;</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://www.kma.go.kr/kor/weather/picture/picture_01.jsp'</span><span style="color: #339933;">;</span> <br />
<span style="color: #000088;">$base_url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://www.kma.go.kr'</span><span style="color: #339933;">;</span>   <br />
<span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'r'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
<br />
<span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #990000;">stream_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">ereg</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;(/kma_sat/DATA/MTSAT/GPL/wli[0-9]+\.gif)&quot;</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #339933;">,</span> <span style="color: #000088;">$reg</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   <br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt; img src='http://www.kma.go.kr<span style="color: #006699; font-weight: bold;">$reg[0]</span>' / &gt;&quot;</span><span style="color: #339933;">;</span>  <br />
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>   <br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;fail to get image&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>xml로 제공해주면 좋으련만&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/121/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Astronomy Picture of the Day 페이지 추가</title>
		<link>http://hanury.net/wp/archives/116</link>
		<comments>http://hanury.net/wp/archives/116#comments</comments>
		<pubDate>Wed, 21 Jun 2006 15:08:42 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[천문]]></category>
		<category><![CDATA[apod]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xmlhttprequest]]></category>
		<category><![CDATA[xslt]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/116</guid>
		<description><![CDATA[이전 글에 이어서 계속&#8230;. 바로 밑에 Ajax가 어쩌구 XMLHttpRequest가 저쩌구 했는데, 브라우저간 약간 씩 서로 다른 동작이나, IE인 경우엔 ActiveX 경고창이 뜨고해서, 서버에서 렌더링 해서 내리기로 변경&#8230;. 코드도 의외로 간단. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://hanury.net/wp/archives/115" title="나의 첫번째 Ajax 프로그램">이전 글</a>에 이어서 계속&#8230;.<br />
바로 밑에 Ajax가 어쩌구 XMLHttpRequest가 저쩌구 했는데,<br />
브라우저간 약간 씩 서로 다른 동작이나, IE인 경우엔 ActiveX 경고창이 뜨고해서,</p>
<p>서버에서 렌더링 해서 내리기로 변경&#8230;.</p>
<p>코드도 의외로 간단.</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DomDocument<span style="color: #339933;">;</span><br />
<span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.jwz.org/cheesegrater/RSS/apod.rss&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$xsl</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DomDocument<span style="color: #339933;">;</span><br />
<span style="color: #000088;">$xsl</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;apod.xsl&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$proc</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> xsltprocessor<span style="color: #339933;">;</span><br />
<span style="color: #000088;">$proc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">importStyleSheet</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$xsl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$proc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">transformToXML</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$xml</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">apod.rss와 apod.xsl을 읽어와서<br />
apos.rss를 apod.xsl을 이용해서 렌더링 해서 그냥 화면에 뿌려줌. &nbsp;끝</div></div>
<p>apod.xsl파일</p>
<div class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:stylesheet</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">xmlns:xsl</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/XSL/Transform&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:output</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;html&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;/rss/channel&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;pubDate&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> by NASA<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;item/description&quot;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; disable-output-escaping = <span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:stylesheet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>/rss/item/description의 내용이 <a title=" &gt; 가 & gt; 로 보이는...  ">escape처리된 html 소스</a>인데, 그냥 처리하면 화면에 html 소스가 출력된다.<br />
value-of의 disable-output-escaping 속성 &#8220;yes&#8221;로 해주어야 한다.(이거 몰라서 한참을 찾았음)</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/116/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>나의 첫번째 Ajax 프로그램</title>
		<link>http://hanury.net/wp/archives/115</link>
		<comments>http://hanury.net/wp/archives/115#comments</comments>
		<pubDate>Wed, 21 Jun 2006 14:07:56 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[천문]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[apod]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[xmlhttprequest]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/115</guid>
		<description><![CDATA[요즘 Web2.0이니, Ajax니 무척이나 시끄럽다. MS에 있었을 때 부터 MsXml은 워낙이나 친숙했던 터라, 그리 새삼스럽지 않았지만, 최근 구글에서 선보이고 있는 새로운 User Experience들(ActiveX 없이도 충분히 interactive하게 만들어 낸 구글맵이나 Gmail)을 [...]]]></description>
			<content:encoded><![CDATA[<p>요즘 Web2.0이니, Ajax니 무척이나 시끄럽다.<br />
MS에 있었을 때 부터 MsXml은 워낙이나 친숙했던 터라, 그리 새삼스럽지 않았지만,<br />
최근 구글에서 선보이고 있는 새로운 User Experience들(ActiveX 없이도 충분히 interactive하게 만들어 낸 구글맵이나 Gmail)을 보자면, MS는 같은 걸 가지고도 참 본 가치를 못 이용한다는 걸 느낀다.<br />
(게다가 XmlHttpRequest는 MS가 얼마나 일찍부터 표준화 하고, 선도하고, 마케팅에도 얼마나 읅어 먹었던가? &#8211; 앞으로 다 이렇게 개발해야 한다고&#8230;)</p>
<p>정작 주인은 따로 있나 보다.</p>
<p>잡소리 그만하고,</p>
<p>오늘 문득 NASA가 제공하는 Astronomy Picture of the Day(오늘의 천체 사진) 페이지를 붙이고 싶었다.</p>
<p>운 좋게도 누군가가 RSS로 제공하는 것도 알았다. 이를 이용하면</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">XmlHttpRequest로 apod.rss를 가져와서, <br />
DOM 객체 돌아댕기며, <br />
필요한 Element만 끄집어 내서 페이지를 완성...</div></div>
<div class="codecolorer-container javascript vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> isIE <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> req<span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">function</span> loadXMLDoc<span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// branch for native XMLHttpRequest object</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">XMLHttpRequest</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; req <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> XMLHttpRequest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; req.<span style="color: #660066;">onreadystatechange</span> <span style="color: #339933;">=</span> processReqChange<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; req.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;GET&quot;</span><span style="color: #339933;">,</span> url<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; req.<span style="color: #660066;">send</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// branch for IE/Windows ActiveX version</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">ActiveXObject</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; isIE <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; req <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> ActiveXObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Microsoft.XMLHTTP&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>req<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; req.<span style="color: #660066;">onreadystatechange</span> <span style="color: #339933;">=</span> processReqChange<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; req.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;GET&quot;</span><span style="color: #339933;">,</span> url<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; req.<span style="color: #660066;">send</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<div class="codecolorer-container javascript vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> processReqChange<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// only if req shows &quot;loaded&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>req.<span style="color: #660066;">readyState</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// only if &quot;OK&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>req.<span style="color: #000066;">status</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">200</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">//req.responseXML 을 가지고 원하는 페이지를 구성</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;There was a problem retrieving the XML data:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; req.<span style="color: #660066;">statusText</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>이 소스는 <a href="http://developer.apple.com/internet/webcontent/xmlhttpreq.html">developer.apple.com</a>에서 참조했고,<br />
예전엔 당연히 new ActiveXObject(&#8220;Microsoft.XMLHTTP&#8221;);<br />
만 사용했는데, 어느덧, Safari나, Firefox가 XmlHttpRequest 객체를 내장하게 되었고, 요즘 탈 Active X 분위기 이므로(IE 7.0에서는 MS도 XMLHttpRequest를 내장 할 계획이라니), MSXML만 고려한 코딩은 피해야 겠다.</p>
<div class="codecolorer-container javascript vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">req.<span style="color: #660066;">onreadystatechange</span> <span style="color: #339933;">=</span> processReqChange<span style="color: #339933;">;</span></div></div>
<p>에서 XMLHttpRequest의 onreadystatechange 상태 시 Callback 함수로 processReqChange 함수가 비 동기적으로 처리하게 하는 부분이 보이니, <- 이게 맨 첨부터 요란히 말했던 아약스의 실체 아님감.<br />
아약스가 뭔지 아직까지 정확한 정의는 모르지만<br />
그까이꺼 대충 client단에서 XMLHttpRequest로 비동기 적으로 서버랑 통신 하면서 사용자에게 좀더 interactive한 환경을 제공하믄 아약스 아닌가???</p>
<hr />
결국은 포기했다&#8230;<br />
일단 IE에서는 SP2이후에 살벌해진 보안 분위기에 ActiveX 경고창이 뜨고, OS에 따라 브라우저에 따라 각기 다른 결과를 보여서<br />
서버에서 처리하기로 했다.<br />
클라이언트 CPU좀 슬쩍 사용해 보려고 했는데&#8230;.<a href="http://hanury.net/wp/archives/116" title="Astronomy Picture of the Day 페이지 추가">이어서&#8230;.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/115/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Perl에  Hash는 없다???</title>
		<link>http://hanury.net/wp/archives/111</link>
		<comments>http://hanury.net/wp/archives/111#comments</comments>
		<pubDate>Tue, 20 Jun 2006 06:35:55 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/111</guid>
		<description><![CDATA[Perl에서 array는 my @array = &#40;1,2,3,4,5,6&#41;; 과 같이 정의하고 @를 앞에 붙여준다. 반면 hash는 my %capitals= &#40;'china' =&#62; 'beijing', 'england' =&#62; 'london'&#41;; 과 같이 정의하고 %를 붙여준다. 그리고 사용법은 my [...]]]></description>
			<content:encoded><![CDATA[<p>Perl에서 array는</p>
<div class="codecolorer-container perl vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@array</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>과 같이 정의하고 @를 앞에 붙여준다.<br />
반면 hash는</p>
<div class="codecolorer-container perl vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%capitals</span><span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'china'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'beijing'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'england'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'london'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>과 같이 정의하고 %를 붙여준다.</p>
<p>그리고 사용법은</p>
<div class="codecolorer-container perl vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$a</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$capitals</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'china'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></div>
<p>$key로 $value 값을 읽어오는 문법이니, 영락없이 Java의 Hash Class같은 놈으로 생각하고 만 있었다&#8230;..<br />
(array of ($key -> $val )) : 즉 각각의 $val을 refer하는 $key의 array</p>
<p>하지만 오늘 회사에서 perl로 hash를 함수의 인자로 넘기는데, 안넘어 가는 것이었다.</p>
<div class="codecolorer-container perl vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">sub</span> getHash<span style="color: #009900;">&#40;</span><span style="color: #339933;">%</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%hash</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">%_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$key</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #000066;">each</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">%hash</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>가 안되는 것이다.<br />
책을 뒤져봤는데도 없었다.</p>
<p>왜일까???</p>
<p>정답은 모든 Array와 Hash를 출력하는 두개의 함수를 보면 알수 있다.</p>
<div class="codecolorer-container perl vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">sub</span> printHash<span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%h</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$key</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #000066;">each</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">%h</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">print</span> <span style="color: #0000ff;">$key</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot; =&gt; &quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$val</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">sub</span> printArray<span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@a</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000066;">print</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">,</span> <span style="color: #0000ff;">@a</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>그랬다. Perl에서 Hash는 Arrary 그 자체였다.</p>
<div class="codecolorer-container perl vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:680px;"><div class="perl codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%capitals</span><span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'china'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'beijing'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'england'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'london'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@capitals</span><span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'china'</span> <span style="color: #339933;">,</span> <span style="color: #ff0000;">'beijing'</span> <span style="color: #339933;">,</span> <span style="color: #ff0000;">'england'</span> <span style="color: #339933;">,</span> <span style="color: #ff0000;">'london'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>즉 둘중 아무렇게나 선언한뒤<br />
%capitals라 선언하고 @captitals처럼 사용해도 되고,<br />
반대로 @captitals로 선언하고, 이후에 %capitals처럼 써도 된다.</p>
<p>하지만 후자처럼 사용할 경우, 홀수개의 인자를 가진 array를 hash처럼 사용했을때 어떤 sideeffect 가 있는지 알수 없음.</p>
<p>Perl하는 사람중에서 나만 몰랐던 내용인가???<br />
넘 당연한 거였나???<br />
암튼 재미난거 하나 알았다.</p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/111/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>100만원 어치 책</title>
		<link>http://hanury.net/wp/archives/107</link>
		<comments>http://hanury.net/wp/archives/107#comments</comments>
		<pubDate>Mon, 19 Jun 2006 07:47:45 +0000</pubDate>
		<dc:creator>alexken</dc:creator>
				<category><![CDATA[기술]]></category>
		<category><![CDATA[oreilly]]></category>
		<category><![CDATA[책]]></category>
		<category><![CDATA[프로그래밍]]></category>

		<guid isPermaLink="false">http://hanury.net/wp/archives/107</guid>
		<description><![CDATA[개당 3만원으로 치고 총 33권이니까 딱 만원이 모라란 99만원 어치 오라일리 책을 내손안에&#8230;. 가끔 나한테 유용할 것 같아서 링크 달아봄? 주의 : 이 사이트는 본 사이트랑 아무 상관도 없고, 언제 [...]]]></description>
			<content:encoded><![CDATA[<p>개당 3만원으로 치고 총 33권이니까 딱 만원이 모라란 99만원 어치 오라일리 책을 내손안에&#8230;.<br />
가끔 나한테 유용할 것 같아서 링크 달아봄?<br />
<em>주의 : 이 사이트는 본 사이트랑 아무 상관도 없고, 언제 없어질지 장담 못함.</em></p>
<p><strong><a href="http://www.serve.com/~josh/books/">O&#8217;Reilly&#8217;s CD bookshelf</a> </strong><br />
<a href="http://www.serve.com/~josh/books/"><img title="O'Reilly BookShelf" alt="O'Reilly BookShelf" id="image110" src="http://hanury.net/wp/wp-content/uploads/2006/06/oreilly1.png" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://hanury.net/wp/archives/107/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

