<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"> <channel><title>eincs.net</title> <link>http://rothlee.net</link> <description>eincs in computer science</description> <lastBuildDate>Wed, 22 Feb 2012 19:05:15 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/eincs" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="eincs" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>eincs in computer science</itunes:subtitle><item><title>[AirVideo] 아이폰 최고의 동영상 스트리밍 어플 AirVideo, 리눅스에서 AirVideo 서버를 돌리자!</title><link>http://rothlee.net/2010/05/install-airvideo-server-on-ubuntu-linux/</link> <comments>http://rothlee.net/2010/05/install-airvideo-server-on-ubuntu-linux/#comments</comments> <pubDate>Sat, 15 May 2010 07:37:33 +0000</pubDate> <dc:creator>eincs</dc:creator> <category><![CDATA[mobile]]></category> <category><![CDATA[AirVideo]]></category> <category><![CDATA[iPhone]]></category> <category><![CDATA[리눅스]]></category> <category><![CDATA[서버]]></category> <category><![CDATA[설치]]></category> <category><![CDATA[아이폰]]></category> <category><![CDATA[에어비디오]]></category> <category><![CDATA[우분투]]></category> <guid isPermaLink="false">http://eincs.com/2010/05/15/install-airvideo-server-on-ubuntu-linux/</guid> <description><![CDATA[전 아이폰 유저입니다. 작년 12월말 부터 아이폰을 사용하고 있습니다. 전 많은 어플들을 사용하고 있는데, 얼마 전부터 AirVideo라는 어플을 사용하기 시작했습니다. AirVideo 어플은 어떤 어플인가? AirVideo는 개인 컴퓨터에 서버를 띄워놓고 그 서버를 통해 컴퓨터에 있는 동영상을 스트리밍하여 자신의 아이폰에서 받아 볼 &#8230; <a
href="http://rothlee.net/2010/05/install-airvideo-server-on-ubuntu-linux/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>전 아이폰 유저입니다. 작년 12월말 부터 아이폰을 사용하고 있습니다. 전 많은 어플들을 사용하고 있는데, 얼마 전부터 <a
title="AirVideo홈페이지" href="http://www.inmethod.com/air-video/" target="_blank">AirVideo</a>라는 어플을 사용하기 시작했습니다.</p><h3>AirVideo 어플은 어떤 어플인가?</h3><p><a
title="AirVideo홈페이지" href="http://www.inmethod.com/air-video/" target="_blank">AirVideo</a>는 <strong>개인 컴퓨터에 서버를 띄워놓고 그 서버를 통해 컴퓨터에 있는 동영상을 스트리밍하여 자신의 아이폰에서 받아 볼 수 있게 해주는 어플</strong>입니다. 아이폰에서는 mp4 포맷의 동영상만 재생하기 때문에 아이폰에서 동영상을 보기 위해선 사용자가 직접 동영상을 mp4로 인코딩 해야되기 때문에 불편함이 있었습니다. 하지만 AirVideo서버에서는 <strong>자동으로 mp4 포맷으로 인코딩하여 스트리밍 해주기 때문에 사용자가 동영상을 직접 인코딩할 필요가 없습</strong>니다. 또한 생각 외로 동영상이 끊기는 일이 거의 없어 호평을 받고 있습니다. <strong>&#8216;평가용 무료어플을 다운 받을 필요 없이 바로 유료로 질러라&#8217;</strong>라는 말이 있을 정도입니다.</p><div
id="attachment_373" class="wp-caption aligncenter" style="width: 330px"><a
href="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/airvideo-loading-screen.jpg"><img
class="size-full wp-image-373" title="airvideo-loading-screen" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/airvideo-loading-screen.jpg" alt="airvideo-loading-screen" width="320" height="480" /></a><p
class="wp-caption-text">아이폰 AirVideo 앱의 로딩 화면. Google 이미지 검색에서 퍼왔다.</p></div><p>하지만 전 그동안 이 어플을 사용하고 있지 않았습니다. 그 이유는 AirVideo의 개발사인 inmethod에서 제공하고 있는 AirVideo 서버는 <strong>공식적으로 Windows, Max OS X만 지원</strong>하기 때문입니다. 하지만 집에 있는 PC는 WOL(Wake On Lan){{1}}기능도 없고, 회사 PC는 방화벽 등 네트워크 설정때문에 외부에서 접근이 불가능하여 AirVideo 서버를 사용하기 힘든 환경{{2}}이었습니다. 제게 개인 서버가 있긴 하나, 우분투 리눅스가 깔려있기 때문에 공식적인 AirVideo서버를 사용할 수 없었습니다. 또한 설치된 우분투가 서버버전으로 GUI환경이 제공되지 않는 버전이라 와인 등으로 윈도우 바이너리를 돌리기 힘든 환경이었습니다[footnote]혹시 GUI환경이 제공되는 리눅스를 사용하고 계신 분은 윈도우용 바이너리를 리눅스상에서 실행시켜주는 와인을 이용하여 GUI버전의 Window AirVideo 서버를 직접 구동시키실 수 있습니다.[/footnote]. 따라서 그 동안 서버를 돌릴 마땅한 환경이 없어서 AirVideo 어플이 좋은건 알고 있엇지만, 사용하지 못하고 있었습니다. 하지만 방법을 찾던 중 리눅스에서 돌아가는 AirVideo 서버 모듈이 있다는 말을 듣고 우분투에 깔아보기로 하였습니다.</p><div
id="attachment_372" class="wp-caption aligncenter" style="width: 593px"><a
href="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/airvideo-server-support.jpg" target="_blank"><img
class="size-full wp-image-372 " style="max-width: 100%;" title="airvideo-server-support" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/airvideo-server-support.jpg" alt="airvideo-server-support" width="583" height="275" /></a><p
class="wp-caption-text">AirVideo 사이트에는 OS X 와 Windows 버전만을 다운 받을 수 있게 소개하고 있다.</p></div><p>AirVideo에 더 자세한 정보를 알고 싶으시면, <a
title="[http://www.inmethod.com/air-video/index.html]로 이동합니다." href="http://www.inmethod.com/air-video/index.html" target="_blank">AirVideo 홈페이지</a>{{3}}에 가셔서 확인하시기 바랍니다.</p><h3>AirVideo 서버를 우분투에 설치하자!</h3><p>AirVideo 서버를 우분투 리눅스에 설치하기 위해서는 서버를 설치하기전, <strong>서버 구동에 필요한 라이브러리 프로그램들을 먼저 설치</strong>해야 합니다. 이제 소개될 과정들을 차근차근 따라가시면 큰 어려움 없이 AirVideo 서버를 우분투 리눅스에서 돌리실 수 있을 것 입니다.</p><h4>1. AirVideo 서버 구동에 필요한 패키지 들을 설치하자!</h4><div
class="box"><ol
style="list-style-type: decimal;"><li>libx264-dev 최신 버전 설치를 위해 Stéphane Marguet의 PPA 리포지터리를 우분투에 추가한다.</li><li>libmp3lame-dev libfaad-dev libx264-dev libmp3lame-dev libfaad-dev mpeg4ip-server faac 패키지 들을 apt-get을 이용하여 설치한다.</li></ol></div><p>AirVideo 서버는 동영상 스트리밍 외에도 인코딩을 하기 때문에 몇 가지 패키지들을 추가로 필요로 합니다. 우분투 리눅스에서는 apt-get 명령어로 큰 어려움 없이 패키지를을 설치 할 수 있습니다. 하지만 한 가지 문제점이 있습니다. 다음 단계에서 설치할 FFmpeg는 libx264-dev를 필요로 하는데, <strong>현재 우분투 리포지터리에 올라와 있는 libx264-dev는 오래된 버전이라 최신버전(2010년)으로 설치해 줘야합니다.</strong> 오래된 버전을 설치하면 FFmpeg를 컴파일 할 때 오류를 내뱉게 됩니다. 최신버전이 있는 리포지터리를 우분투에 추가하여 최신 버전의 libx264-dev를 설치 할 수 있도록 합니다.</p><p>최신버전의 libx264-dev를 설치하기 위해 다음과 같은 명령어로 해당 버전이 올라와 있는 Stéphane Marguet의 PPA를 추가 합니다.</p><div
class="box">&gt; sudo add-apt-repository ppa:user_id/ppa<br
/> &gt; sudo apt-get update</div><p>위 명령어에 대한 자세한 정보를 알고 싶으시다면, <a
title="[https://launchpad.net/~stemp/+archive/ppa]로 이동합니다." href="https://launchpad.net/~stemp/+archive/ppa" target="_blank">PPA 관련 사이트</a>에서 확인하도록 합시다. 이 사이트에서 PPA를 추가하기 위한 자세한 설명에 대한 <a
title="[https://launchpad.net/+help/soyuz/ppa-sources-list.html]로 이동합니다." href="https://launchpad.net/+help/soyuz/ppa-sources-list.html" target="_blank">페이지</a>(<a
title="[https://launchpad.net/+help/soyuz/ppa-sources-list.html]로 이동합니다." href="https://launchpad.net/+help/soyuz/ppa-sources-list.html" target="_blank">https://launchpad.net/+help/soyuz/ppa-sources-list.html</a>)를 직접 참고하셔도 됩니다.</p><p>이제 최신 버전의 libx264-dev가 설치된 리포지터리를 추가하였으므로, 아래와 같은 명령어로 필요한 패키지들을 설치합시다.</p><div
class="box">&gt; sudo apt-get install libmp3lame-dev libfaad-dev libx264-dev libmp3lame-dev libfaad-dev mpeg4ip-server faac</div><p>필요한 패키지들이 자동으로 설치가 됩니다.</p><h4>2. 동영상 인코딩에 필요한 FFmpeg 를 설치하자!</h4><div
class="box"><ol
style="list-style-type: decimal;"><li>커스터마이징 되어 있는 FFmpeg 소스파일을 AirVideo 홈페이지에서 다운받는다.</li><li>서버에 올려 컴파일하여 ffmpeg 실행 파일을 만든다.</li><li>ffmpeg 파일의 퍼미션(755)과 소유자/그룹 조정을 하여 적당한 폴더에 복사한다.</li></ol></div><p>앞에서 말씀드렸다시피, AirVideo서버에서 mp4로 인코딩하기 위해 FFmpeg라는 프로그램이 필요합니다. AirVideo 서버 내부에서 FFmpeg 프로그램을 호출을 하는 형태로 되어있는데, 공식적으로 지원하는 Windows, OS X 서버에서도 이 프로그램을 사용합니다.</p><p>그런데 여기서 주의해야할 점은, <strong>AirVideo서버가 사용하는 FFmpeg는 AirVideo서버를 위해 커스터마이징 된 버전</strong>이라는 점 입니다. 따라서 <a
title="[http://www.ffmpeg.org/]로 이동합니다." href="http://www.ffmpeg.org/" target="_blank">FFmpeg</a> 에서 제공하는 정식버전을 사용하면 안되고, inmethod사의 홈페이지에서 커스터마이징된 버전을 다운받아 사용해야합니다.</p><p><a
title="[http://www.inmethod.com/air-video/licenses.html]로 이동합니다." href="http://www.inmethod.com/air-video/licenses.html" target="_blank">AirVideo 라이센스 페이지</a>(<a
title="[http://www.inmethod.com/air-video/licenses.html]로 이동합니다." href="http://www.inmethod.com/air-video/licenses.html" target="_blank">http://www.inmethod.com/air-video/licenses.html</a>)의 You can download the complete source code used to build FFMpeg here.에서 다운로드 받으시면 됩니다. 다운 받으면 압축파일이 있는데, 이 압축파일과 압축파일 안에 있는 아카이브를 모두 풀어 서버의 아무 폴더에 업로드를 시킵니다.</p><p><strong>소스파일이므로 컴파일 하여 사용해야 합니다.</strong> 다음과 같은 명령어로 FFmpeg 를 컴파일하여 실행 파일을 만들어 냅니다. 전 컴파일할 때 꽤 오래 걸렸으며, 15분 정도 걸렸다는 분도 있습니다. 아래 명령어들은 서버 설정에 따라 다르겠지만 보통은 root 권한으로 수행되어야 합니다.</p><div
class="box">&gt; ./configure &#8211;enable-pthreads &#8211;disable-shared &#8211;enable-static &#8211;enable-gpl &#8211;enable-libx264 &#8211;enable-libmp3lame &#8211;enable-libfaad &#8211;disable-decoder=aac<br
/> &gt; make</div><p>ffmpeg라는 파일이 생성되었을 것입니다. 이 파일이 실행파일입니다. 이 파일의 권한은 chmod 명령어를 이용하여 755로 줘야하고, 소속 그룹 및 사용자를 chown명령어를 이용하여 root:root 로 설정하여 줍니다. 사용자마다 다르겠지만 전 이 실행파일을 /usr/bin 폴더 안에 넣었습니다.</p><p>한 가지 팁을 더 설명드리자면, configure 할 대 libx264-dev가 오래된 버전이라는 에러메세지가 나오면 Stéphane Marguet의 PPA가 제대로 추가되었는지 확인하고 libx264-dev를 다시 설치해 주시기 바랍니다.</p><h4>3. AirVideo 서버를 설치하고 설정 파일을 설정하자!</h4><div
class="box"><ol
style="list-style-type: decimal;"><li>AirVideoServerLinux.jar 파일과 test.properties 파일을 다운받아 서버에 올린다.</li><li>test.properties파일을 자신의 서버에 맞게 수정한다.</li><li>적당한 계정으로 java -jar AirVideoServerLinux.jar test.properties 하여 서버를 실행한다.</li></ol></div><p>이제 AirVideo 서버를 설치할 준비가 모두 끝났습니다. 이제 AirVideo서버를 본격적으로 시작해 봅시다. <a
title="[http://www.inmethod.com/forum/posts/list/60/34.page#3935]로 이동합니다." href="http://www.inmethod.com/forum/posts/list/60/34.page#3935" target="_blank">AirVideo포럼의 한 포스팅</a>(<a
title="[http://www.inmethod.com/forum/posts/list/60/34.page#3935]로 이동합니다." href="http://www.inmethod.com/forum/posts/list/60/34.page#3935" target="_blank">http://www.inmethod.com/forum/posts/list/60/34.page#3935</a>)에서 AirVideoServer.jar 파일과 test.properties 파일을 다운 받습니다. AirVideoServer.jar 는 AirVideo 리눅스용 서버를 돌리기 위한 jar파일이며, java 머신으로 실행되어야 합니다. 따라서 서버에 JRE 혹은 JDK가 설치되어 있어야 합니다. iPad를 지원하는 Alpha 버전은 <a
title="[http://inmethod.com/air-video/download/linux/alpha2/AirVideoServerLinux.ja]로 이동합니다." href="http://inmethod.com/air-video/download/linux/alpha2/AirVideoServerLinux.jar" target="_blank">http://inmethod.com/air-video/download/linux/alpha2/AirVideoServerLinux.jar</a> 에서 다운 받을 수 있다고 합니다만, Alpha 버전에 대한 자세한 사항은 잘 모르겠습니다.</p><p>위 두 파일을 서버에 올립니다. 기본적으로 AirVideo서버는 root계정이 <strong>아닌 특정 유저의 권한으로 실행되는 것이 좋습니다.</strong> 왜냐면 AirVideo에서 스트리밍을 위해 참조하는 동영상 폴더와 동영상들이 AirVideo의 계정과 같아야 하기 때문입니다. 같지 않다면, 동영상들을 읽어오지 못하거나 자신의 사용자/사용자 그룹으로 파일의 설정을 바꿔버럽니다. 따라서 알맞게 권한과 사용자 그룹, 사용자를 설정합니다.</p><p><strong>이제 test.properties 파일을 바꿔봅시다.</strong> test.properties 파일에서 바꿀 설정 값들은 다음과 같습니다.</p><div
class="box"><strong>path.ffmpeg</strong> : 앞 단계에서 컴파일하여 생성된 FFmpeg 실행파일인 ffmpeg의 경로입니다. 서버에 따라 값이 다르므로, 직접 확인하여 설정하셔야 합니다. 제 경우는 ffmpeg파일을 /usr/bin 폴더에 옮겨놓있기 때문에, /usr/bin/ffmpeg 였습니다.<br
/> <strong>path.mp4creator</strong> : mp4creator 프로그램의 경로입니다. &#8216;whereis mp4creator&#8217; 명령어를 통해서 프로그램이 설치된 경로를 찾아 알맞게 수정합니다.<br
/> <strong>path.faac</strong> : faac 프로그램의 경로입니다. &#8216;whereis facc&#8217; 명령어를 통해서 프로그램이 설치된 경로를 찾아 알맞게 수정합니다.<br
/> <strong>password</strong> : 서버의 비밀번호를 설정합니다. 설정하게 되면 AirVideo어플로 서버에 접속하게 되면 비밀번호를 요청하게 되므로, 보안상 필요한 경우 설정합니다.<br
/> <strong>folders</strong> : AirVideo 서버에서 참조할 동영상 폴더를 지정합니다. &lt;폴더 1&gt;:&lt;폴더 1위치&gt;, &lt;폴더 2&gt;:&lt;폴더 2위치&gt;와 같은 형식으로 지정하시면 됩니다.</div><p>설정이 끝났다면, 아래 명령어를 통해 AirVideo 실행이 가능합니다.</p><div
class="box">&gt; java -jar AirVideoServerLinux.jar test.properties</div><p>만약 제대로 실행이 안된다면 나오는 메세지를 보고 수정을 하시거나, 특별한 메세지가 없는 경우, ffmpeg 등 프로그램이 제대로 설치되었나, 혹은 path값이 제대로 맞는지, 실행권한은 있는지 확인해보시기 바랍니다.</p><p>이제 아이폰의 AirVideo 어플에서 서버의 IP값을 넣어 제대로 접속되는지 확인합니다. 리눅스 서버 버전의 경우 PIN을 통한 접속은 지원하지 않으므로 꼭 IP를 쳐서 접속하여야 합니다.</p><h4>4. 기타 몇 가지 알아두면 좋은 사실들</h4><div><p><strong>컴퓨터가 켜질 때 자동으로 AirVideo서버를 구동시키기 위해선</strong> 다음과 같은 내용의 /etc/init/airvideo.conf 파일을 생성해주시면 됩니다. 파일 소유권은 root:root로 하시면 됩니다.</p><div
class="box">start on runlevel [2345]<br
/> stop on shutdown<br
/> respawn</div><p>exec sudo -H -n -u {계정명} LANG=ko_KR.UTF-8 /usr/bin/java -jar {jar파일경로}/AirVideoServerLinux.jar {설정파일경로}/test.properties</p><p>위에서 계정명은 동영상 파일의 소유자로 해주시면 됩니다. 위와 같이 설정하면 서버가 명시된 계정의 권한으로 구동되게 됩니다. 이제 서버를 껏다 켜도 AirVideo서버가 자동으로 실행됩니다. 수동으로 서버의 실행/종료를 하기 위해서는 다음과 같은 명령어를 이용하시면 됩니다.</p><div
class="box">&gt; sudo start airvideo<br
/> &gt; sudo stop airvideo</div><p><strong>서버는 반드시 동영상 폴더의 소유자와 같은 계정으로 구동되로록 합니다.</strong> 그렇지 않은 경우 동영상이 목록에 제대로 표시가 안되거나 동영상의 소유자가 맘대로 바뀌어버리게 되므로 주의합니다.</p><p>AirVideo 어플에서 폴더 혹은 동영상이 제대로 표시가 안된다면 서버에서 지원하는 LANG 변수 문제입니다. <strong>LANG 변수가 반드시 UTF-8(제 경우에는 ko_KR.UTF-8)로 되어있어야 합니다.</strong> 혹 EUC-KR등 다른 값으로 설정되어 있는 경우에는 동영상 혹은 폴더 목록이 제대로 표시되지 않는 것 같습니다. 전 기본값이 UTF-8로 설정되어 있어 별 문제가 없었지만 혹시 EUC-KR로 설정되어 있는 경우에는 쉘 스크립트를 이용하여 UTF-8 환경에서 서버를 구동시키도록 합시다.</p><p><strong>AirVideo의 리눅스 버전의 서버는 소개된 버전으로는 port 변경이 불가능 합니다.</strong> 무조건 기본 포트(45631)로 열리게 되고, 혹시 해당 포트가 열려져 있다면 포트 번호를 하나 증가(45632)시켜서 서버를 구동시킵니다. 만약 해당 포트로도 이미 열려있다면 번호를 하나 더 증가(45633)시켜서  서버를 구동시킵니다. 최대 45개 까지 증가시켜 여는 것으로 보입니다. 하지만 <strong>전 서버 소스를 변경하여 포트를 지정하여 열 수 있도록 변경하여 사용하고 있습니다.</strong> 이 방법으로 제 서버에는 AirVideo 서버를 여러개의 포트로 여러 대 구동시켜 여러 사람이 사용하고 있습니다. 이 방법에 대해선 추후 포스팅을 통해 소개하도록 하겠습니다.</p><p><strong>서버를 구동시키는 계정의 home폴더에는 숨긴폴더로 .air-video-server 폴더가 생깁니다.</strong> 이 안에는 서버가 필요한 정보들을 저장하게 되는데, 각 동영상의 썸네일 정보를 포함한 각종 정보 등을 저장합니다. 이런 방법을 사용하는 이유는 다음에 서버가 다시 구동되어도 이런 정보를 다시 추출하기 위해 또 다른 작업을 하지 않게 하여 더 빠른 속도를 추구하기 위함입니다.</p><p>그리고 당연하지만, <strong>설정파일을 바꾼 후 서버에 적용하기 위해선 서버를 재시작</strong>해야 합니다.</p><p>제 홈서버는 아톰 d510에 메모리는 4GB입니다. 그리고 OS는 우분투 2.6.31-14 서버버전입니다. 이번에 설치한 서버를 통해 WIFI로 동영상을 봤을 때, 초반 버퍼링은 평균수준이었고, 중간에 끊기는 현상은 없었습니다. 3G의 경우 버퍼링이 좀 길었고 가끔씩 끊기는 경우가 있었지만, 특별히 문제될 정도는 아니었습니다. 특히 이미 인코딩된 동영상을 스트리밍받는 경우 초반 버퍼링의 시간은 많이 단축되었습니다. 이 정도의 서버로 이 정도 퍼포먼스면 상당히 만족스럽습니다.</p><p>좀 더 자세한 AirVideo 리눅스 서버 설치와 관련된 정보는 아래를 참조해 주시기 바랍니다.</p><ol
style="list-style-type: decimal;"><li><a
title="[http://wiki.birth-online.de/know-how/hardware/apple-iphone/airvideo-server-linux]로 이동합니다." href="http://wiki.birth-online.de/know-how/hardware/apple-iphone/airvideo-server-linux" target="_blank">위키</a> (<a
title="[http://wiki.birth-online.de/know-how/hardware/apple-iphone/airvideo-server-linux]로 이동합니다." href="http://wiki.birth-online.de/know-how/hardware/apple-iphone/airvideo-server-linux" target="_blank">http://wiki.birth-online.de/know-how/hardware/apple-iphone/airvideo-server-linux</a>)</li><li><a
title="[http://clien.career.co.kr/cs2/bbs/board.php?bo_table=lecture&amp;wr_id=53889]로 이동합니다." href="http://clien.career.co.kr/cs2/bbs/board.php?bo_table=lecture&amp;wr_id=53889" target="_blank">클리앙의 서버 설치 팁에 관한 글</a> (<a
title="[http://clien.career.co.kr/cs2/bbs/board.php?bo_table=lecture&amp;wr_id=53889]로 이동합니다." href="http://clien.career.co.kr/cs2/bbs/board.php?bo_table=lecture&amp;wr_id=53889" target="_blank">http://clien.career.co.kr/cs2/bbs/board.php?bo_table=lecture&amp;wr_id=53889</a>)</li><li><a
title="[http://blog.naver.com/zetaloki?Redirect=Log&amp;logNo=30084302362]로 이동합니다." href="http://blog.naver.com/zetaloki?Redirect=Log&amp;logNo=30084302362" target="_blank">설치 관련 네이버 블로그 포스팅</a> (<a
title="[http://blog.naver.com/zetaloki?Redirect=Log&amp;logNo=30084302362]로 이동합니다." href="http://blog.naver.com/zetaloki?Redirect=Log&amp;logNo=30084302362" target="_blank">http://blog.naver.com/zetaloki?Redirect=Log&amp;logNo=30084302362</a>)</li></ol><p>&nbsp;</p></div><p>[[1]]Window가 설치된 PC에 AirVideo를 설치하여 시용하기 위해선 PC가 항상켜져있어야 하지만 전력소모가 심합니다. 아니면 WOL기능이 있어 필요할때만 인터넷상에서 PC를 켤 수 있어야 하는데 제 PC에는 그런 기능이 없습니다.[[1]]<br
/> [[2]]원래 PIN번호로 사용할 수 있어야 한다고 하는데, 실제로는 불가능했습니다. 이유는 모르겠지만 회사 운영팀의 네트워크 설정 때문이 아닌가 생각합니다.[[2]]<br
/> [[3]]유료 어플은 2.99 달러에 판매되고 있습니다. 평가용무료어플은 목록에 최대 3개의 동영상밖에 안보입니다.[[3]]</p> ]]></content:encoded> <wfw:commentRss>http://rothlee.net/2010/05/install-airvideo-server-on-ubuntu-linux/feed/</wfw:commentRss> <slash:comments>8</slash:comments> <enclosure url="http://inmethod.com/air-video/download/linux/alpha2/AirVideoServerLinux.jar" length="1761165" type="application/java-archive" /><media:content url="http://inmethod.com/air-video/download/linux/alpha2/AirVideoServerLinux.jar" fileSize="1761165" type="application/java-archive" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>전 아이폰 유저입니다. 작년 12월말 부터 아이폰을 사용하고 있습니다. 전 많은 어플들을 사용하고 있는데, 얼마 전부터 AirVideo라는 어플을 사용하기 시작했습니다. AirVideo 어플은 어떤 어플인가? AirVideo는 개인 컴퓨터에 서버를 띄워놓고 그 서버를 통해 컴퓨터에 있는 동영상을 스트리밍하여 자신의 아이폰에서 받아 볼 &amp;#8230; Continue reading &amp;#8594;</itunes:subtitle><itunes:summary>전 아이폰 유저입니다. 작년 12월말 부터 아이폰을 사용하고 있습니다. 전 많은 어플들을 사용하고 있는데, 얼마 전부터 AirVideo라는 어플을 사용하기 시작했습니다. AirVideo 어플은 어떤 어플인가? AirVideo는 개인 컴퓨터에 서버를 띄워놓고 그 서버를 통해 컴퓨터에 있는 동영상을 스트리밍하여 자신의 아이폰에서 받아 볼 &amp;#8230; Continue reading &amp;#8594;</itunes:summary><itunes:keywords>mobile, AirVideo, iPhone, 리눅스, 서버, 설치, 아이폰, 에어비디오, 우분투</itunes:keywords></item> <item><title>[삼바] SAMBA를 이용하여 윈도우에서 Unix, Linux시스템의 자원에 매우 편하게 접근하자!</title><link>http://rothlee.net/2010/03/file-transfer-between-window-unix-with-samba/</link> <comments>http://rothlee.net/2010/03/file-transfer-between-window-unix-with-samba/#comments</comments> <pubDate>Fri, 05 Mar 2010 11:01:40 +0000</pubDate> <dc:creator>eincs</dc:creator> <category><![CDATA[unix/linux]]></category> <category><![CDATA[File]]></category> <category><![CDATA[FTP]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[samba]]></category> <category><![CDATA[unix]]></category> <category><![CDATA[리눅스]]></category> <category><![CDATA[삼바]]></category> <category><![CDATA[서버]]></category> <category><![CDATA[오픈소스]]></category> <category><![CDATA[윈도우]]></category> <category><![CDATA[유닉스]]></category> <category><![CDATA[파일서버]]></category> <guid isPermaLink="false">http://eincs.com/2010/03/05/file-transfer-between-window-unix-with-samba/</guid> <description><![CDATA[얼마전, 개인용으로 사용할 서버를 마련했습니다. 개인서버를 장만하게 된 이유에는 여러가지가 있습니다. 웹서버를 돌리기 위한 것, 프로젝트 개발시 서버 프로그램을 돌리기 위한 것 등 여러가지 이유가 있지만, 가장 큰 이유 중 하나가 파일 서버를 돌리기 위한 것 입니다. 개인적으로 관리하고 있는 &#8230; <a
href="http://rothlee.net/2010/03/file-transfer-between-window-unix-with-samba/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>얼마전, 개인용으로 사용할 서버를 마련했습니다. 개인서버를 장만하게 된 이유에는 여러가지가 있습니다. 웹서버를 돌리기 위한 것, 프로젝트 개발시 서버 프로그램을 돌리기 위한 것 등 여러가지 이유가 있지만, 가장 큰 이유 중 하나가 파일 서버를 돌리기 위한 것 입니다. 개인적으로 관리하고 있는 파일이 꽤 되는데, 제가 사용하고 있는 여러 PC와 노트북등 다양한 기기에서 제 파일에 쉽게 접근하고 싶었습니다. 파일 서버를 돌리기 위해 몇 가지 방법을 생각해봤는데, 그중 FTP가 있었습니다. 하지만 <strong>FTP만을 사용하기엔 너무 불편</strong>합니다.</p><h3>FTP만으로는 불편하다.</h3><p>FTP란 원격지에 있는 컴퓨터에 파일을 전송 할 때 매우 많이 사용되는 프로토콜 입니다. 서버에 FTP 서버를 띄워 두고 FTP클라이언트를 통해 쉽게 파일을 업로드와 다운로드를 할 수가 있습니다. 플랫폼과 상관없이 프로토콜만 잘 구현하면 쉽게 파일 전송을 할 수 있지만 개인 서버용 파일 공유 시스템으로 사용하기엔 불편한 점이 있습니다.</p><div
class="wp-caption aligncenter" style="width: 540px"><img
class="  " src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/samba-0.jpeg" alt="FTP프로그램" width="530" height="466" /><p
class="wp-caption-text">ftp클라이언트를 통해 파일을 업로드/다운로드 할 수 있다.</p></div><p>이 불편한 점은 FTP를 통해 <strong>서버에 있는 파일을 바로 실행할 수 없다</strong>는 것입니다. 예를 들어 700MB짜리 동영상을 플레이하기 위해선 700MB 파일을 모두 다운로드 받은 뒤에 재생시켜야 합니다. 인터넷 속도가 매우매우 빠르면 상관 없겠지만, 다운 받는데 오래 걸린다면 동영상 재생시 오랜 시간을 기다려야 하겠지요. 또한 인터넷 속도가 매우 빨라도 <strong>FTP 클라이언트를 켜서 다운받고 재생해야한다는 몇 가지 단계가 더 필요[footnote]FTP를 통해 원격지에 있는 동영상을 재상하려면, 1. FTP클라이언트로 원격지 컴퓨터에 연결한다. 2.원격지 컴퓨터에서 동영상 파일을 로컬로 다운 받는다. 3. 다운 받은 동영상을 재생한다. 라는 단계가 필요합니다.[/footnote]</strong>하기 때문에 불편합니다.</p><h3>부족한 FTP의 대안은 <a
title="[http://www.samba.org/]로 이동합니다." href="http://www.samba.org/" target="_blank">SAMBA</a>!</h3><p><strong><a
title="[http://www.samba.org/]로 이동합니다." href="http://www.samba.org/" target="_blank">SAMBA</a>를 사용하면 이런 불편함이 해소</strong> 됩니다. <a
title="[http://www.samba.org/]로 이동합니다." href="http://www.samba.org/" target="_blank">SAMBA</a>가 왜 FTP보다 더 편한지 알아보기 전에 먼저 SAMBA가 무엇인지 간단히 살펴보겠습니다.</p><h3>SAMBA는 무엇인가?</h3><div><p><img
class="alignleft" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/samba-1.gif" alt="samba logo" width="150" height="73" /><a
title="[http://www.samba.org/]로 이동합니다." href="http://www.samba.org/" target="_blank">SAMBA</a><span
class="Apple-style-span" style="font-weight: normal;"><strong><span
class="Apple-style-span" style="font-weight: normal;"><strong>는 SMB(Server Message Block) 프로로콜을 유닉스 상에 구현한 프리웨어[footnote]http://www.terms.co.kr/Samba.htm 참조[/footnote]</strong> 입니다. SMB 프로토콜은 윈도우 시스템에서 파일이나 디렉토리 혹은 주변장치(프린터)를 네트워크를 통해 공유하는데 사용되는 메세지 형식[footnote]http://www.terms.co.kr/SMB.htm 참조[/footnote] 입니다. 윈도우에선 네트워크 상에 있는 파일이나 주변기기를 공유할때 SMB 프로토콜을 사용하는 거죠.</span></strong></span></p></div><div
class="wp-caption aligncenter" style="width: 570px"><img
class="  " src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/samba-2.jpeg" alt="smb 프로토콜 설명" width="560" height="150.6206896551724" /><p
class="wp-caption-text">윈도우가 깔린 컴퓨터끼리는 smb 프로토콜을 이용하여 네트워크를 통해 자원의 공유가 가능하다</p></div><p>따라서 윈도우에서 네트워크 연결을 하기 위해선, 대상이 SMB 프로토콜을 지원해 줘야 합니다. 원래 유닉스(혹은 리눅스)에서 SMB프로토콜이 지원 안되기 때문에 원도우에서 직접 유닉스 시스템에 접근할 수가 없습니다.</p><div
class="wp-caption aligncenter" style="width: 570px"><img
class=" " src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/samba-3.jpeg" alt="smb 프로토콜 설명" width="560" height="142.89655172413794" /><p
class="wp-caption-text">유닉스(혹은 리눅스)컴퓨터는 smb프로토콜을 모르기 때문에 윈도우 컴퓨터와 네트워크를 통한 자원 공유가 불가능하다</p></div><p>하지만 SAMBA를 이용하면 윈도우에서 Unix 컴퓨터에 일반 컴퓨터를를 네트워크로 연결하듯이 연결 할 수 있습니다. 윈도우 시스템에서 네트워크 연결이 되어 컴퓨터의 자원을 공유하기 위해선 SMA 프로토콜 지원이 필수인데, SAMBA가 Unix에서 SMB 프로토콜을 제공해주기 때문입니다.</p><div
class="wp-caption aligncenter" style="width: 570px"><img
class=" " src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/samba-4.jpeg" alt="smb 프로토콜 설명" width="560" height="154" /><p
class="wp-caption-text">unix컴퓨터에 samba를 설치하면 samba가 smb프로토콜을 대신 지원해 주므로 윈도우 컴퓨터와 자원 공유가 가능하다</p></div><h3><a
title="[http://www.samba.org/]로 이동합니다." href="http://www.samba.org/" target="_blank">SAMBA</a>를 통해 Unix서버를 하드디스크 처럼 사용하자!</h3><p>앞에서 살펴봤듯이, SAMBA가 SMB 프로토콜을 제공해주기 때문에, 윈도우 시스템에서 유닉스(혹은 리눅스) 시스템의 파일들에 매우 쉽게 접근 할 수 있습니다. 윈도우에서 네트워크를 통해 Unix컴퓨터를 접근 할 수 있다는 말인데, 쉽게 설명하기 위해 스크린샷을 통해 알아보겠습니다.</p><div
class="wp-caption aligncenter" style="width: 410px"><img
class=" " src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/samba-5.jpeg" alt="네트워크 드라이브 설정" width="400" height="234" /><p
class="wp-caption-text">내컴퓨터의 드라이브 설정에서 네트워크 드라이브를 연결할 수 있다.</p></div><div
class="wp-caption aligncenter" style="width: 510px"><img
class=" " src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/samba-6.jpeg" alt="네트워크 드라이브" width="500" height="367" /><p
class="wp-caption-text">네트워크 드라이브를 연결하면, 내컴퓨터에서 마치 하드디스크가 추가 된것 처럼 서버의 하드디스크 자원에 접근 및 사용 가능하다</p></div><div
class="wp-caption aligncenter" style="width: 510px"><img
class=" " src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/samba-7.jpeg" alt="네트워크 드라이브" width="500" height="345" /><p
class="wp-caption-text">삼바를 통해 만든 네트워크 드라이브. 로컬의 하드디스크 조회하는 것과 똑같은 인터페이스를 제공한다.</p></div><p>마치 일반 하드디스크 처럼 그림 미리보기 기능도 가능합니다.</p><div
class="wp-caption aligncenter" style="width: 510px"><img
class=" " src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/samba-8.jpeg" alt="네트워크 드라이브" width="500" height="345" /><p
class="wp-caption-text">로컬 하드디스크처럼 사진들 미리보기도 지원 된다.</p></div><p>동영상 파일을 더블클릭하여 바로 재생 할 수도 있습니다.</p><div
class="wp-caption aligncenter" style="width: 510px"><img
class=" " src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/samba-9.jpeg" alt="동영상 재생" width="500" height="384" /><p
class="wp-caption-text">동영상파일은 바로 더블클릭하여 재생할 수 있다.</p></div><p>FTP처럼 파일 다운로드 받을 필요도 없어서 굉장히 편합니다. <strong>인터넷만 연결되어 있다면, 하드디스크를 하나 더 달아둔 것 처럼 매우 편하게 사용</strong> 할 수 있습니다.</p><h3>SAMBA는 FTP보다 느리다.</h3><p>파일 전송 속도를 비교해 봤을때, FTP가 SMB 프로토콜보다 더 빠르다고 합니다. 시스템에 따라 2~3배 정도 차이가 난다고 하는데,  FTP의 구조가 SMB 프로토콜 구조보다 더 간단하기 때문에 어쩔 수 없는 사항이라고 합니다. 따라서 대용량의 파일을 전송할 필요가 있을 때에는 FTP를 사용하고, 단순히 파일에 접근하여 실행시키거나 내용을 보는 것에는 SAMBA를 사용하는 <strong>사용자의 유연함이 필요</strong>합니다.</p><p>저는 각 컴퓨터에 있는 제 파일들을 옮길 때에는 FTP를 사용하였고, 제가 사용하고 있는 각 PC 및 노트북에서 네트워크 드라이브를 설정하여 파일에 접근하고 있습니다.</p><p>다음 포스팅에선 SAMBA를 설치하는 방법에 대해 소개해 보겠습니다. 제가 장만한 서버에 설치되어 있는 OS가 Ubuntu이기 때문에, Ubuntu에서 SAMBA를 설치하는 방법에 대해 알아보겠습니다.</p> ]]></content:encoded> <wfw:commentRss>http://rothlee.net/2010/03/file-transfer-between-window-unix-with-samba/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>[안드로이드] 넥서스원의 바탕화면의 기능들을 파헤쳐 보자!</title><link>http://rothlee.net/2010/01/review-android-background/</link> <comments>http://rothlee.net/2010/01/review-android-background/#comments</comments> <pubDate>Wed, 27 Jan 2010 11:01:55 +0000</pubDate> <dc:creator>eincs</dc:creator> <category><![CDATA[mobile]]></category> <category><![CDATA[Android]]></category> <category><![CDATA[live wallpaper]]></category> <category><![CDATA[Nexus One]]></category> <category><![CDATA[Widget]]></category> <category><![CDATA[구글폰]]></category> <category><![CDATA[넥서스원]]></category> <category><![CDATA[라이브월페이퍼]]></category> <category><![CDATA[안드로이드]]></category> <category><![CDATA[안드로이드폰]]></category> <category><![CDATA[위젯]]></category> <guid isPermaLink="false">http://eincs.com/2010/01/27/review-android-background/</guid> <description><![CDATA[오늘 회사에 넥서스원이 도착하였습니다. 넥서스원을 이리저리 구경하면서 느낀 것은 인터페이스가 매우 좋다는 점 입니다. 앞서 작성한 개봉기에서는 아이폰이 넥서스원보다 반응성이 훨씬 맘에 든다고 하였습니다. 하지만 처음 만져봤을 때의 반응성은 아이폰이 더 좋았지만, 넥서스원의 기능들을 알아가면 알아갈수록 넥서스원이 더 맘에 드네요. &#8230; <a
href="http://rothlee.net/2010/01/review-android-background/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>오늘 회사에 넥서스원이 도착하였습니다. 넥서스원을 이리저리 구경하면서 느낀 것은 인터페이스가 매우 좋다는 점 입니다. <a
title="[http://blog.noain.net/entry/Unboxing-Nexus-One]로 이동합니다." href="http://blog.noain.net/entry/Unboxing-Nexus-One" target="_blank">앞서 작성한 개봉기</a>에서는 아이폰이 넥서스원보다 반응성이 훨씬 맘에 든다고 하였습니다. 하지만 처음 만져봤을 때의 반응성은 아이폰이 더 좋았지만, 넥서스원의 기능들을 알아가면 알아갈수록 넥서스원이 더 맘에 드네요. 이번에 초기화면, 즉 배경화면에 있는 넥서스원의 기능들에 대해서 알아보도록 하겠습니다. 제가 아이폰을 사용하고 있기 때문에 아이폰과 비교하는 부분이 많을 것입니다.</p><h3>배경화면의 라이브 월페이퍼</h3><p>넥서스원의 라이브 월페이퍼는 안드로이드 2.1부터 지원하는 기능입니다. 사용자의 자극에 따라 배경화면이 다이나믹하게 바뀔 수 있다는 점이 특징입니다.</p><div
class="mceTemp mceIEcenter"><div
id="attachment_411" class="wp-caption aligncenter" style="width: 287px"><a
href="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-1.jpeg" target="_blank"><img
class="size-full wp-image-411   " title="android-background-1" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-1.jpeg" alt="nexus-one-wall-paper" width="277" height="368" /></a><p
class="wp-caption-text">넥서스원 라이브 월페이퍼</p></div></div><p>오른쪽 사진이 월페이퍼 중 &#8216;수면&#8217;인가 하는 라이브 월페이퍼인데요, 사용자가 배탕화면을 터치하면 마치 수면을 터치 한 것처럼 물결이 일어나는 것이 특징입니다. 배경을 바꿀 수도 없는 정적인 아이폰의 배경화면과 매우 다르죠.</p><div
class="mceTemp"><div
id="attachment_412" class="wp-caption aligncenter" style="width: 287px"><a
href="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-2.jpeg"><img
class="size-full wp-image-412  " title="android-background-2" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-2.jpeg" alt="applying-nexus-one-wallpaper" width="277" height="368" /></a><p
class="wp-caption-text">라이브 월페이퍼를 적용 중에...</p></div></div><p>하지만 2.1에서 처음 도입된거라 약간은 불안정 한 모양입니다. (아니면 월페이퍼가 불량이거나)</p><h3>자주쓰는 어플리케이션만 바탕화면에!</h3><p>아이폰에서는 11페이지의 바탕화면에 모든 어플리케이션이 나열되어 있습니다. 하지만 안드로이드에서는 설치된 어플리케이션이 나열된 화면은 따로 존재하고, 바탕화면에는 자신이 원하는 프로그램 바로가기만 등록할 수 있습니다.</p><div
id="attachment_413" class="wp-caption aligncenter" style="width: 287px"><a
href="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-3.jpeg"><img
class="size-full wp-image-413  " title="android-background-3" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-3.jpeg" alt="nexus-one" width="277" height="368" /></a><p
class="wp-caption-text">어플리케이션 리스트에서 페이스북을 롱-클릭!</p></div><p>위와 같이 어플리케이션 리스트에서 바탕화면에 아이콘을 놓을 수 있습니다. 아이폰에서는 총 180개(16*11+4개)의 어플리케이션만 바탕화면에 존재하고 그 이상의 어플리케이션은 spotlight를 통해 검색하여 접근하여야 되는데, 매우 불편합니다.</p><h3>안드로이드 2.1의 막강한 기능, 위젯</h3><p>개인적으로 굉장히 맘에 드는 기능이 위젯이라는 기능입니다. iGoogle의 위젯과 비슷한 느낌인데요, 바탕화면에 컨텐츠를 놓을 수 있습니다. 아이폰에는 없는 기능입니다.</p><div
id="attachment_414" class="wp-caption aligncenter" style="width: 287px"><a
href="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-4.jpeg"><img
class="size-full wp-image-414  " title="android-background-4" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-4.jpeg" alt="android-widget" width="277" height="368" /></a><p
class="wp-caption-text">위와 같이 바탕화면에 위젯을 추가 할 수 있습니다.</p></div><p>facebook을 이용하는 경우, 아이폰의 경우에 notification이 오면, facebook 어플리케이션을 실행시켜 내용을 확인해야 했습니다. 하지만, 안드로이드에서는 위젯을 등록하여 배경화면만 보고도 바로 어떤 글이 올라왔는지 확인 할 수 있죠.</p><div
id="attachment_415" class="wp-caption aligncenter" style="width: 287px"><a
href="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-5.jpeg"><img
class="size-full wp-image-415  " title="android-background-5" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-5.jpeg" alt="android-music-widget" width="277" height="368" /></a><p
class="wp-caption-text">바탕화면에 추가된 음악 위젯</p></div><p>위 사진은 음악 위젯이 바탕화면에 추가된 화면입니다. 현재 재생목록이 비어있는데, 재생목록을 추가해 음악을 재생시켜 보았습니다.</p><div
id="attachment_416" class="wp-caption aligncenter" style="width: 287px"><a
href="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-6.jpeg"><img
class="size-full wp-image-416  " title="android-background-6" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-6.jpeg" alt="android-music" width="277" height="368" /></a><p
class="wp-caption-text">안드로이드의 음악 재생 화면.</p></div><p>음악 재생화면도 나름 이쁘네요. 음악 위젯을 통해 바탕화면에서 음악 재생을 컨트롤 할 수 있다는 장점이 있습니다. 위 사진에의 화면 왼쪽 상단을 보시면 재생버튼의 아이콘이 올라와 있는 것을 보실 수 있는데, 이는 서비스가 띄위 졌다는 의미입니다. 안드로이드폰은 멀티태스킹이 가능합니다!</p><div
id="attachment_417" class="wp-caption aligncenter" style="width: 287px"><a
href="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-7.jpeg"><img
class="size-full wp-image-417  " title="android-background-7" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-7.jpeg" alt="nexus-one" width="277" height="368" /></a><p
class="wp-caption-text">WiFi, 블루투스, 화면 조명등을 위젯에서 쉽게 컨트롤 할 수 있습니다.</p></div><p>뿐만 아니라 위젯을 통해 폰의 여러가지 기능을 컨트롤 할 수 있습니다. 아이폰에서 위피기능이나 블루투스기능을 끄거나 설정을 바꿀 때마다 설정에 들어가 일일히 바꿔줘야한다는 불편함이 있었으나, 안드로이드에서는 위젯을 통해 바탕화면에서 쉽게 변경 가능합니다.</p><p>몇 가지 위젯을 살펴봤는데요, 이뿐만아니라 굉장히 다양한 위젯이 있습니다. 아이폰을 사용하고 있는 저는 위젯 기능이 가장 탐나더군요. 아이폰에서 내용을 확인하기 위해선 어플을 직접 실행해야 하는 번거로움이 있기 때문입니다.</p><h3>필요한 어플을 모아두자! 폴더 기능!</h3><p>아이폰의 바탕화면에 어플이 많아지면 화면이 좌우로 너무 길어져 어플을 찾아다니기 힘들다는 단점이 있습니다. 그래서 해킹 아이폰에는 폴더기능이 있는 것으로 알고 있습니다. 하지만 안드로이드에선 기본적으로 폴더 기능을 제공합니다.</p><div
id="attachment_418" class="wp-caption aligncenter" style="width: 287px"><a
href="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-8.jpeg"><img
class="size-full wp-image-418  " title="android-background-8" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-8.jpeg" alt="nexus-one-folder" width="277" height="368" /></a><p
class="wp-caption-text">안드로이드에는 기본적으로 제공하는 폴더가 있다.</p></div><p>바탕화면에 위젯을 추가하듯이 폴더를 추가 할 수 있습니다.</p><div
id="attachment_419" class="wp-caption aligncenter" style="width: 287px"><a
href="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-9.jpeg"><img
class="size-full wp-image-419  " title="android-background-9" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/09/android-background-9.jpeg" alt="nexus-one-folder" width="277" height="368" /></a><p
class="wp-caption-text">폴더 안에 어플을 넣을 수 있습니다.</p></div><p>폴더에 어플을 정리 할 수 있으니 매우 편리한 기능입니다.</p><p>지금까지 넥서스원, 안드로이드 2.1 의 바탕화면에서 볼 수 있는 다양한 기능에 대해 살펴봤습니다. 아이폰에 비해 매우 다양하고도 편리한 기능들이 있다는 것을 알 수 있습니다. 아이폰의 바탕화면의 심플한 디자인도 무시 할 순 없지만, 전 안드로이드의 바탕화면더 훨씬 더 높은 점수를 주고 싶습니다.</p><p>그 동안 아이폰을 사용하면서 불편했던 문제점들을 안드로이드에서는 모두 해결됐다는 느낌일까요.</p><div
class="box">사진 찍을 때 도와주신 <a
title="[http://twitter.com/ranpark]로 이동합니다." href="http://twitter.com/ranpark" target="_blank">@ranpark</a>선임님 감사합니다^^</div> ]]></content:encoded> <wfw:commentRss>http://rothlee.net/2010/01/review-android-background/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>[안드로이드] 회사에 넥서스원이 도착했습니다. 넥서스원 개봉기!</title><link>http://rothlee.net/2010/01/unboxing-nexus-one/</link> <comments>http://rothlee.net/2010/01/unboxing-nexus-one/#comments</comments> <pubDate>Wed, 27 Jan 2010 09:13:39 +0000</pubDate> <dc:creator>eincs</dc:creator> <category><![CDATA[mobile]]></category> <category><![CDATA[Android]]></category> <category><![CDATA[Nexus One]]></category> <category><![CDATA[개봉기]]></category> <category><![CDATA[넥서스원]]></category> <category><![CDATA[안드로이드]]></category> <guid isPermaLink="false">http://eincs.com/2010/01/27/unboxing-nexus-one/</guid> <description><![CDATA[넥서스원이 정말 나온다고 들은지 얼마 되지 않았는데, 이번에 제가 다니고 있는 회사에서 넥서스원을 구입하였습니다. 안드로이드 개발을 위한 건데요, 조만간에 모토로이도 도착 할 것으로 보입니다. 어쨌든, 넥서스원 바다를 건너 오늘 택배가 도책해서 꺼내 보았는데, 신기하네요. 넥서스원 개봉하면서 찍은 사진들을 소개합니다. FeDex로 &#8230; <a
href="http://rothlee.net/2010/01/unboxing-nexus-one/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>넥서스원이 정말 나온다고 들은지 얼마 되지 않았는데, 이번에 제가 다니고 있는 회사에서 넥서스원을 구입하였습니다. 안드로이드 개발을 위한 건데요, 조만간에 모토로이도 도착 할 것으로 보입니다. 어쨌든, 넥서스원 바다를 건너 오늘 택배가 도책해서 꺼내 보았는데, 신기하네요. 넥서스원 개봉하면서 찍은 사진들을 소개합니다.</p><p>FeDex로 받았습니다. 상자를 개봉하여 넥서스원을 꺼내고 있습니다.</p><div
class="wp-caption aligncenter" style="width: 471px"><img
src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/unpacking-nexus-one-0.jpeg" alt="unboxing-nexus-one" width="461" height="614" /><p
class="wp-caption-text">넥서스원이 들어있는 상자</p></div><p>다음은 넥서스원을 꺼낸 모습입니다. 사진에서 보던 그대로네요.</p><div
class="wp-caption aligncenter" style="width: 471px"><img
src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/unpacking-nexus-one-1.jpeg" alt="unboxing-nexus-one" width="461" height="614" /><p
class="wp-caption-text">예쁜 넥서스원 상자</p></div><p>넥서스원이 나온다는 루머가 돌 때 넥서스원 박스에 대한 사진이 돌아다녔습니다. 역시 사진에서 보던 박스입니다. 굉장히 고급스럽다는 느낌이 든다고 생각합니다만, 개인적으로는 아이폰 박스가 더 맘에 드네요.</p><p>넥서스원은 처음에 배터리가 껴있지 않습니다. 동봉된 배터리를 껴야 전원을 켤 수가 있는데요, 배터리는 한칸이 채워져 있었습니다. 그리고 여분 배터리는 없고, 배터리 하나만 주네요. 여분 배터리가 필요하다면, 따로 사야 할 것 같습니다. 넥서스원 악세사리가 굉장히 많이 나올 것 같네요.</p><div
class="wp-caption aligncenter" style="width: 471px"><img
class=" " src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/unpacking-nexus-one-2.jpeg" alt="nexus-booting" width="461" height="614" /><p
class="wp-caption-text">넥서스원 부팅 첫 화면</p></div><p>정말 많이 보던 사진 구도. 넥서스원 액정에 아이폰으로 사진을 찍고있는 제 모습이 살짝 보이네요^^ 첫 구동이라 설렙니다.</p><div
class="wp-caption aligncenter" style="width: 471px"><img
src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/unpacking-nexus-one-3.jpeg" alt="nexus-booting" width="461" height="614" /><p
class="wp-caption-text">넥서스원 부팅화면</p></div><p>넥서스원 부팅화면입니다. 넥서스원 로고와 함께 애니메이션이 나옵니다. 어느 리뷰에서는 아이폰의 부팅화면은 심플하고, 넥서스원의 부팅화면은 화려하다고 표현했지요. 실제 부팅시간은 아이폰이 넥서스원보다 빠릅니다. 하지만 첫 구동이라 그런지 별로 오래 걸린 것 같지 않네요.</p><div
class="wp-caption aligncenter" style="width: 471px"><img
src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/unpacking-nexus-one-4.jpeg" alt="nexus-one" width="461" height="614" /><p
class="wp-caption-text">넥서스원 첫 화면</p></div><p>넥서스원을 처음 켜면, 간단한 사용법이 나옵니다. 일단 패스를 하니, 언어를 선택하라는 화면이 나왔습니다. 한국어를 선택을 한 후에 넥서스원을 구동하니 한글로 디스플레이가 됩니다. 하지만 한글 키보드는 없군요. 넥서스원은 한글 키보드를 기본 제공하지 않습니다. 하지만, 한글 키보드는 안드로이드 마켓이나 웹에서 쉽게 구하여 설치할 수 있다고 합니다. 그리고 기본으로 깔려 있는 어플들도 꽤 되는군요.</p><div
class="wp-caption aligncenter" style="width: 471px"><img
src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/unpacking-nexus-one-5.jpeg" alt="nexus-one" width="461" height="614" /><p
class="wp-caption-text">라이브 월페이퍼!</p></div><p>안드로이드 2.1부터는 라이브 월페이퍼를 제공합니다. 라이브 월페이퍼는 배경화면인데, 사용자의 입력에 따라 다이나믹하게 바뀌는 배경화면입니다. 예를 들어 수면 월페이퍼인 경우, 사용자가 배경화면을 누르면 수면이 퍼지는 애니메이션이 나옵니다.</p><p>제껀 아니지만 안드로이드를 만져보니, 뽐뿌질이 장난이 아니네요. 속도는 굉장히 빠릅니다. 하지만 아이폰을 사용하는 저로서는 그다지 특별하다고 생각되진 않네요. 아이폰 UI에는 물리엔진이 들어가 있지만, 넥서스원은 그렇지 않네요. 그리고 UI도 아이폰보다 직관적이진 않은 것 같습니다. (넥서스원 맥 주소 찾느라 힘들었습니다)</p><p>넥서스원의 진가를 느끼기 위해선, 안드로이드 마켓에서 어플을 다운받아 사용해야겠네요^^</p><p>읽어주셔서 감사합니다^^</p><div
class="box">사진 협찬: <a
title="[http://twitter.com/ranpark]로 이동합니다." href="http://twitter.com/ranpark" target="_blank">@ranpark</a> 선임님, 우리팀 팀장님^^</div> ]]></content:encoded> <wfw:commentRss>http://rothlee.net/2010/01/unboxing-nexus-one/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>오픈 소스 ROME 과 Twttier4j 를 이용하여 rss를 트위터에 등록해주는 데몬 만들기</title><link>http://rothlee.net/2010/01/using-rome-and-twttier4j/</link> <comments>http://rothlee.net/2010/01/using-rome-and-twttier4j/#comments</comments> <pubDate>Fri, 08 Jan 2010 02:52:29 +0000</pubDate> <dc:creator>eincs</dc:creator> <category><![CDATA[development]]></category> <category><![CDATA[java]]></category> <category><![CDATA[Rome]]></category> <category><![CDATA[RSS]]></category> <category><![CDATA[RSS 리더]]></category> <category><![CDATA[twitter]]></category> <category><![CDATA[Twitter4J]]></category> <category><![CDATA[아파치 라이센스]]></category> <category><![CDATA[안드로이드]]></category> <category><![CDATA[오픈소스]]></category> <category><![CDATA[트위터]]></category> <guid isPermaLink="false">http://eincs.com/2010/01/08/using-rome-and-twttier4j/</guid> <description><![CDATA[rss를 긁어 새로 등록된 글을 twitter에 자동으로 트윗 해주는 데몬을 만들어 보았습니다. rss를 읽을 때에는 java 오픈 소스 ROME을 사용하였으며, 트위터에 트윗을 등록 할 때에는 Twitter4j 라는 오픈 소스를 이용하였습니다. (저가 이 프로그램을 만들게 된것은, @winotb님과 나눴던 대화 때문 입니다. &#8230; <a
href="http://rothlee.net/2010/01/using-rome-and-twttier4j/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>rss를 긁어 새로 등록된 글을 twitter에 자동으로 트윗 해주는 데몬을 만들어 보았습니다. rss를 읽을 때에는 java 오픈 소스 <a
title="[http://rome.dev.java.net/]로 이동합니다." href="http://rome.dev.java.net/" target="_blank">ROME</a>을 사용하였으며, 트위터에 트윗을 등록 할 때에는 <a
title="[http://yusuke.homeip.net/twitter4j/en/index.html]로 이동합니다." href="http://yusuke.homeip.net/twitter4j/en/index.html" target="_blank">Twitter4j</a> 라는 오픈 소스를 이용하였습니다. (저가 이 프로그램을 만들게 된것은, @winotb님과 나눴던 대화 때문 입니다. (http://twitter.com/winotb/status/7462016652))</p><p><a
title="[http://rome.dev.java.net/]로 이동합니다." href="http://rome.dev.java.net/" target="_blank">ROME</a>은 java에서 rss와 관련된 처리를 할 때 가장 널리 쓰이는 오픈 소스라고 합니다. <a
title="[http://yusuke.homeip.net/twitter4j/en/index.html]로 이동합니다." href="http://yusuke.homeip.net/twitter4j/en/index.html" target="_blank">Twitter4j</a>는 트위터 관련하여 가장 널리 쓰이는 오픈 소스라고 합니다. 특히 <a
title="[http://yusuke.homeip.net/twitter4j/en/index.html]로 이동합니다." href="http://yusuke.homeip.net/twitter4j/en/index.html" target="_blank">Twitter4j</a>는 안드로이드 개발에도 사용 가능(Twitter4j 홈페이지에 가보면, 안드로이드 2.1부터 지원한다는 말이있는데, 하위 버전은 잘 모르겠습니다.)하다고 하니, 굉장히 편리 합니다.</p><h3>1. RSS Java 오픈 소스 ROME 사용하기</h3><p><a
title="[http://rome.dev.java.net/]로 이동합니다." href="http://rome.dev.java.net/" target="_blank">ROME</a>은 java에서 rss/atom을 처리하기 위한 api를 모아둔 오픈 소스 입니다. 라이센스는 <a
title="[http://www.apache.org/licenses/LICENSE-2.0.html]로 이동합니다." href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">Apche License 2.0</a>을 따릅니다. java에서 사용하기 위해선 두개의 jar 파일(rome-1.0.jar, jdom-1.0.jar)을 classpath에 include 해야 합니다. JDOM의 jar파일은 ROME 내부에서 사용하고, 이 것 또한 오픈 소스로, Apache-style의 라인센스를 따른다고 합니다.</p><p>기본적으로 다음과 같은 코드로 rss를 읽어옵니다.</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">URL</span> feedUrl <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">URL</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://eincs.net/rss&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
SyndFeedInput input <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SyndFeedInput<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
SyndFeed syndFeeds <span style="color: #339933;">=</span> input.<span style="color: #006633;">build</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> XmlReader<span style="color: #009900;">&#40;</span>feedUrl<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>SyndFeedInput의 build 메소드는 위와 같이 url을 인자로 받는 메소드 외에 다양한 source를 인자로 받는 메소드가 오버로딩 되어 있으므로 참고하시기 바랍니다.</p><p>각 rss feed의 속성을 받아오기 위해선 아래와 같은 코드를 이용합니다.</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>syndFeeds.<span style="color: #006633;">getTitle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>syndFeeds.<span style="color: #006633;">getLink</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>syndFeeds.<span style="color: #006633;">getDescription</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>syndFeeds.<span style="color: #006633;">getLanguage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>syndFeeds.<span style="color: #006633;">getPublishedDate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
SyndImage image <span style="color: #339933;">=</span> syndFeeds.<span style="color: #006633;">getImage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>image.<span style="color: #006633;">getTitle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>image.<span style="color: #006633;">getUrl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>image.<span style="color: #006633;">getLink</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>feed의 각 엔트리의 속성을 얻어오기 위해선 다음과 같은 코드를 이용합니다.</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;">List<span style="color: #339933;">&lt;</span>syndentry<span style="color: #339933;">&gt;</span> entries <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>List<span style="color: #339933;">&lt;</span>syndentry<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span>syndFeeds.<span style="color: #006633;">getEntries</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>SyndEntry entry <span style="color: #339933;">:</span> entries<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Title:&quot;</span> <span style="color: #339933;">+</span> entry.<span style="color: #006633;">getTitle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Link :&quot;</span> <span style="color: #339933;">+</span> entry.<span style="color: #006633;">getLink</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;URL  :&quot;</span> <span style="color: #339933;">+</span> entry.<span style="color: #006633;">getUri</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;DESC :&quot;</span> <span style="color: #339933;">+</span> entry.<span style="color: #006633;">getDescription</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;PUBD :&quot;</span> <span style="color: #339933;">+</span> entry.<span style="color: #006633;">getPublishedDate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>쉽게 rss를 읽어 올 수 있겠습니다.</p><h3>2. 트위터 Java 오픈 소스 Twitter4j 사용하기</h3><p><a
title="[http://yusuke.homeip.net/twitter4j/en/index.html]로 이동합니다." href="http://yusuke.homeip.net/twitter4j/en/index.html" target="_blank">Twitter4j</a>를 사용하는 방법은 매우 쉽습니다. <a
title="[http://yusuke.homeip.net/twitter4j/en/index.html]로 이동합니다." href="http://yusuke.homeip.net/twitter4j/en/index.html" target="_blank">Twitter4j 사이트</a>에서 <a
title="[http://yusuke.homeip.net/twitter4j/en/index.html]로 이동합니다." href="http://yusuke.homeip.net/twitter4j/en/index.html" target="_blank">twitter4j-2.0.10.jar</a> 파일만 다운 받은뒤 classpath에 추가 시켜 주면 됩니다. 기능은 매우 많지만, 이 프로그램에서 사용한 기능은 트윗하는 것 밖에 없으므로, 그 코드만 간단히 살펴 보도록 하겠습니다.</p><p>Twitter4j로 트윗 하기 위해선 다음과 같은 코드를 짜면 됩니다.</p><div
class="wp_syntax"><div
class="code"><pre class="java" style="font-family:monospace;">Twitter twitter <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Twitter<span style="color: #009900;">&#40;</span>cfTwitID, cfTwitPwd<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
twitter.<span style="color: #006633;">updateStatus</span><span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>매우 쉽죠? 트위터 아이디와 패스워드로 Twitter 객체를 만들고, updateStatus를 이용하여 트윗 내용(msg)를 입력 하시면 됩니다. 저가 이 프로그램을 만들 때에는 몇 가지 치환자를 써서 msg 내용을 설정 파일에서 동적으로 바꿀 수 있도록 하였습니다.</p><p>이전에 간단한 <a
title="[http://eincs.net/2009/12/simple-twitter-client-for-android]로 이동합니다." href="http://eincs.net/2009/12/simple-twitter-client-for-android" target="_blank">안드로이드용 트위터 클라이언트를 만들 때</a>는 Twitter4j를 사용하지 않고, Raw Http 통신을 사용했는데, Twitter4j를 사용했다면 훨씬 쉽게 할 수 있었을 것입니다.</p><p>그 외 api 명세를 보고 싶으시다면 <a
title="[http://yusuke.homeip.net/twitter4j/en/javadoc.html]로 이동합니다." href="http://yusuke.homeip.net/twitter4j/en/javadoc.html" target="_blank">Twitter4j java api</a> 를참고하세요^^</p> ]]></content:encoded> <wfw:commentRss>http://rothlee.net/2010/01/using-rome-and-twttier4j/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>[android] 안드로이드 플랫폼상에서 구동하는 초간단한 트위터 클라이언트를 만들어 봤습니다.</title><link>http://rothlee.net/2009/12/simple-twitter-client-for-android/</link> <comments>http://rothlee.net/2009/12/simple-twitter-client-for-android/#comments</comments> <pubDate>Thu, 10 Dec 2009 10:59:41 +0000</pubDate> <dc:creator>eincs</dc:creator> <category><![CDATA[mobile]]></category> <category><![CDATA[Android]]></category> <category><![CDATA[client]]></category> <category><![CDATA[Google]]></category> <category><![CDATA[twitter]]></category> <category><![CDATA[구글]]></category> <category><![CDATA[안드로이드]]></category> <category><![CDATA[트위터]]></category> <guid isPermaLink="false">http://eincs.com/2009/12/10/simple-twitter-client-for-android/</guid> <description><![CDATA[안드로이드 접한지 몇 일 됐는데, 아주아주 간단한, 트위터 클라이언트를 만들어 봤습니다. 아무래도 다른 언어에 비해 자바가 그나마 익숙하고, 안드로이드 플랫폼 자체가 배우기 어렵지 않아, 생각보단 금방 만들었습니다만, 역시 연습으로 만든거라 버그도 많고, 느리고, 고쳐야 될 것도 많이 보이네요. 일단 구현한 &#8230; <a
href="http://rothlee.net/2009/12/simple-twitter-client-for-android/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><img
class="aligncenter" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/twitter-client-1.jpeg" alt="" width="500" height="420" /></p><p>안드로이드 접한지 몇 일 됐는데, 아주아주 간단한, 트위터 클라이언트를 만들어 봤습니다. 아무래도 다른 언어에 비해 자바가 그나마 익숙하고, 안드로이드 플랫폼 자체가 배우기 어렵지 않아, 생각보단 금방 만들었습니다만, 역시 연습으로 만든거라 버그도 많고, 느리고, 고쳐야 될 것도 많이 보이네요. 일단 구현한 기능 public time line만 보여주는 건데(별로 의미가 없는 기능이긴하지만-_-), 후에 tweet/retweet기능 같은 것도 구현해볼 생각입니다.</p><ul><li>일정시간 (30초) 마다 public time line update</li><li>refresh 버튼 누르면 타임 라인 업데이트</li></ul><p>요새 아이폰 덕분에 말들이 많죠. 주변에 아이폰 가지고 다니는 분들도 몇 있고, 아이폰의 막강함을 많이 접해왔던 터라 (터치는 사용하고 있습니다), 정말 지르고 싶습니다만, 일단 안드로이드 폰을 기다리고 있습니다. (2년 약정 때문에 단말기 할부금 + 약정기간 포함해서, 해지시 30만원 정도 내야한다는 점 때문이 아닙니다 ㅠㅠ) 내년 1월에 SKT에서 안드로이드 폰이 나온다고 합니다. 통합메세지함이 있는 채로 나온다는 소리도 있고, 어떻게 될지도 모르겠지만, 일단은 기대해 봅니다.</p> ]]></content:encoded> <wfw:commentRss>http://rothlee.net/2009/12/simple-twitter-client-for-android/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>[NIO] Java NIO 패키지의 ByteBuffer의 allocate()와 allocateDirect()메서드 속도 비교!</title><link>http://rothlee.net/2009/09/compare-allocate-allocatedirect-method-of-bytebuffer/</link> <comments>http://rothlee.net/2009/09/compare-allocate-allocatedirect-method-of-bytebuffer/#comments</comments> <pubDate>Thu, 10 Sep 2009 10:01:17 +0000</pubDate> <dc:creator>eincs</dc:creator> <category><![CDATA[development]]></category> <category><![CDATA[allocate()]]></category> <category><![CDATA[allocateDirect]]></category> <category><![CDATA[ByteBuffer]]></category> <category><![CDATA[byte배열]]></category> <category><![CDATA[direct]]></category> <category><![CDATA[java]]></category> <category><![CDATA[NIO]]></category> <category><![CDATA[non-direct]]></category> <category><![CDATA[Performance]]></category> <category><![CDATA[비교]]></category> <category><![CDATA[속도]]></category> <category><![CDATA[자바]]></category> <category><![CDATA[퍼포먼스]]></category> <guid isPermaLink="false">http://eincs.com/2009/09/10/compare-allocate-allocatedirect-method-of-bytebuffer/</guid> <description><![CDATA[과거에 Java NIO관련 포스팅을 몇 번 했습니다. 그리고 꼭 allocateDirect()를 이용하여 커널버퍼를 직접 사용하는 것을 권장 했습니다. 하지만 allocateDirect() 메서드는 allocate()메서드에 비해 굉장히 오버헤드가 심하므로 한번만 allocateDirect()를 쓰고 해당 ByteBuffer는 재활용 해야합니다. 필요할 때마다 만들어 쓰지 않고 한 번 만들어서 &#8230; <a
href="http://rothlee.net/2009/09/compare-allocate-allocatedirect-method-of-bytebuffer/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>과거에 Java NIO관련 포스팅을 몇 번 했습니다. 그리고 꼭 allocateDirect()를 이용하여 커널버퍼를 직접 사용하는 것을 권장 했습니다. 하지만 allocateDirect() 메서드는 allocate()메서드에 비해 굉장히 오버헤드가 심하므로 한번만 allocateDirect()를 쓰고 해당 ByteBuffer는 재활용 해야합니다. 필요할 때마다 만들어 쓰지 않고 한 번 만들어서 필요할 때마다 다시 써야 좋은 퍼포먼스를 낼 수 있습니다. 하지만 allocate()로 할당할때와 allocateDirect()로 할당 할 때의 속도 차이는 대체 얼마나 나는 걸까요. 직접 비교해 보았습니다.</p><h3>1. 테스트 코드 작성</h3><p>테스트 코드를 작성하여 속도 비교를 하려고 했습니다. ByteBuffer를 allocate() 메서드로 할당, allocateDirect() 메서드로 할 당 한 것, 그리고 byte 배열을 할당한 것 3가지 케이스를 테스트 하려고 합니다. 모두 1024바이트의 버퍼를 생성해 보겠습니다. 테스트 코드는 다음과 같습니다.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">long</span> startTime <span style="color: #339933;">=</span> <span style="color: #003399;">System</span>.<span style="color: #006633;">currentTimeMillis</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<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;">&amp;</span>lt<span style="color: #339933;">;</span><span style="color: #cc66cc;">1000000</span> <span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	ByteBuffer buf <span style="color: #339933;">=</span> ByteBuffer.<span style="color: #006633;">allocate</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">//ByteBuffer buf = ByteBuffer.allocateDirect(1024);</span>
	<span style="color: #666666; font-style: italic;">//byte[] buf = new byte[1024];</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">long</span> endTime <span style="color: #339933;">=</span> <span style="color: #003399;">System</span>.<span style="color: #006633;">currentTimeMillis</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">long</span> elapsedTime <span style="color: #339933;">=</span> endTime <span style="color: #339933;">-</span> startTime<span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;elapsedTime = &quot;</span> <span style="color: #339933;">+</span> elapsedTime<span style="color: #009900;">&#41;</span></pre></td></tr></table></div><p>위에서 주석 처리한 부분을 하나씩 풀어 실행 시킬 것 입니다.</p><h3>2. 퍼포먼스 비교</h3><p>각 모두 for문을 통해 백만번 할당을 하면서 결과를 비교하겠습니다. 단위는 밀리새컨드입니다.</p><table
width="600" bgcolor="#ffffff" style="text-align: center;border-collapse: collapse; " cellpadding="1" cellspacing="1"><tbody><tr><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;byte[]</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">non-direct ByteBuffer&nbsp;</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">direct ByteBuffer&nbsp;</td></tr><tr><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;1차</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;328</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;375</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;10063</td></tr><tr><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;2차</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;360</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;391</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;8719</td></tr><tr><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;3차</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;312</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;375</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;8656</td></tr><tr><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;4차</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;344</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;375</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;8625</td></tr><tr><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;5차</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;313</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;375</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;8875</td></tr><tr><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;6차</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;296</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;359</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;8516</td></tr><tr><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;7차</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;313</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;375</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;8625</td></tr><tr><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;8차</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;312</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;375</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;8594</td></tr><tr><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;9차</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;297</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;375</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;8641</td></tr><tr><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;10차</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;313</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;406</td><td
style="text-align: center;border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(218, 218, 218); border-right-color: rgb(218, 218, 218); border-bottom-color: rgb(218, 218, 218); border-left-color: rgb(218, 218, 218); " width="25%">&nbsp;8734</td></tr></tbody></table><p>결과를 보면 byte 배열 할당보다 non-direct ByteBuffer 할당이 살짝 느린 것으로 나타납니다만 그렇게 큰 차이는 아닙니다. channel을 이용할 수 있다는 점에서 때론 byte 배열 할당보다 non-direct ByteBuffer를 이용하는 것이 효과적일 때도 있으니 그리 큰 차이는 아닙니다.&nbsp;하지만 direct ByteBuffer는 위 두가지 경우와 큰 차이를 보입니다. 속다가 25배가넘네요.</p><p>참고로 1차의 기록은 JVM초기화에 필요한 시간도 포함이므로 큰 의미는 없습니다.</p><h3>3. Direct ByteBuffer는 재활용 하자!</h3><p>보시는바와 같이 byte[]와 non-direct ByteBuffer에 비해 direct ByteBuffer의 할당 속도가 매우 느린 것으로 나타납니다. 따라서 ByteBuffer가 필요할때마다 그때그떄 할당해서 사용한다면 프로그램 퍼포먼스에 큰 영향을 줄 수 있습니다. 이 오버헤드는 무시 할 수 있을 것 같지 않습니다. 따라서 ByteBuffer를 재활용하여 사용합시다. 재활용 방법으로는 ByteBufferPool이 가능 할 것입니다. 자세한건 Pool패턴을 참고합시다.</p> ]]></content:encoded> <wfw:commentRss>http://rothlee.net/2009/09/compare-allocate-allocatedirect-method-of-bytebuffer/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>[NIO] FileSequence를 이용한 JAVA NIO와 IO의 퍼포먼스 비교해보면… NIO의 압도적인 승리!</title><link>http://rothlee.net/2009/09/compare-java-nio-and-io/</link> <comments>http://rothlee.net/2009/09/compare-java-nio-and-io/#comments</comments> <pubDate>Wed, 09 Sep 2009 12:15:21 +0000</pubDate> <dc:creator>eincs</dc:creator> <category><![CDATA[development]]></category> <category><![CDATA[ByteBuffer]]></category> <category><![CDATA[FileChannel]]></category> <category><![CDATA[IO]]></category> <category><![CDATA[java]]></category> <category><![CDATA[NIO]]></category> <category><![CDATA[randomaccessfile]]></category> <category><![CDATA[sequence]]></category> <category><![CDATA[구현]]></category> <category><![CDATA[자바]]></category> <guid isPermaLink="false">http://eincs.com/2009/09/09/compare-java-nio-and-io/</guid> <description><![CDATA[프로그래밍을 하다보면 고유한 값이 필요할 때가 있습니다. DB와 연관되서 받아와야 되는 key값이라면 순차적으로 만들어야 될 필요가 있을 수도 있고, 그것이 쓰레드간 동기화, 프로세스간 동기화가 보장되어야 하는 경우도 있겠지요. 멀티쓰레드 프로그래밍은 요즘 너무나 당연시 되고 있고, 여러 프로세스를 띄워 업무를 처리하게 &#8230; <a
href="http://rothlee.net/2009/09/compare-java-nio-and-io/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>프로그래밍을 하다보면 고유한 값이 필요할 때가 있습니다. DB와 연관되서 받아와야 되는 key값이라면 순차적으로 만들어야 될 필요가 있을 수도 있고, 그것이 쓰레드간 동기화, 프로세스간 동기화가 보장되어야 하는 경우도 있겠지요. 멀티쓰레드 프로그래밍은 요즘 너무나 당연시 되고 있고, 여러 프로세스를 띄워 업무를 처리하게 만드는 아키텍쳐 또한 굉장히 레어한 일은 아니지요. 이런 일을 처리할 때 File로 구현한 Sequence가 필요하겠죠. Sequence는 오라클의 Sequence를 생각하시면 될거 같네요.</p><p>이전 포스팅에서 File Queue를 이용하여 NIO와 일반 IO의 퍼포먼스를 비교해 본 적이 있습니다.<a
title="[http://eincs.net/2009/08/java-nio-bytebuffer-performance/]로 이동합니다." href="http://eincs.net/2009/08/java-nio-bytebuffer-performance/" target="_blank">[→보러가기]</a> 이제 FileSequence를 이용하여 퍼포먼스 비교를 해보겠습니다.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileNotFoundException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.RandomAccessFile</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.nio.ByteBuffer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.nio.channels.FileChannel</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.nio.channels.FileLock</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.concurrent.locks.Lock</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.concurrent.locks.ReentrantLock</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> <span style="color: #003399;">Sequence</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> LONG_BYTE_LENGTH <span style="color: #339933;">=</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> ByteBuffer buffer <span style="color: #339933;">=</span> ByteBuffer.<span style="color: #006633;">allocateDirect</span><span style="color: #009900;">&#40;</span>LONG_BYTE_LENGTH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> 			fileName <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">RandomAccessFile</span>	seqFile	 <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> FileChannel 		channel	 <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> FileLock 		lock	 <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&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> createSequenceFile<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">long</span> value, <span style="color: #003399;">String</span> directory, <span style="color: #003399;">String</span> fileName<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">Sequence</span> getNewInstance<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> directory, <span style="color: #003399;">String</span> fileName<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">Sequence</span> getNewInstance<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> directory, <span style="color: #003399;">String</span> fileName, <span style="color: #000066; font-weight: bold;">long</span> value<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> IBSequence<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> directory, <span style="color: #003399;">String</span> fileName<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">synchronized</span> <span style="color: #000066; font-weight: bold;">boolean</span> open<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SysException
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">synchronized</span> <span style="color: #000066; font-weight: bold;">long</span> next<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SysException
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">synchronized</span> <span style="color: #000066; font-weight: bold;">long</span> currentValue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SysException
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> setValue<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">long</span> value<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">long</span> getValue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div><p>자세한 구현은 어렵지 않으니 생략하였습니다. next() 메서드로 값을 하나 증가시키면서 그 값를 얻을 수 있으며 currentValue() 메서드로 현재 값만 얻어오고 값을 증가 시키진 않을 수도 있습니다. 다음은 일반 IO를 이용한 setValue(), getValue() 메서드의 구현입니다. 보시는바와 같이 RandomAccessFile의 메서드를 이용하여 구현하였습니다.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> setValue<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">long</span> value<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span>
<span style="color: #009900;">&#123;</span>
	seqFile.<span style="color: #006633;">seek</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	seqFile.<span style="color: #006633;">writeLong</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">long</span> getValue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">long</span> res <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	seqFile.<span style="color: #006633;">seek</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	res <span style="color: #339933;">=</span> seqFile.<span style="color: #006633;">readLong</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">return</span> res<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div><p>다음은 NIO를 이용한 구현입니다. fileChannel과 ByteBuffer을 이용하여 구현하였습니다. 여기서 주의할 점은, 위에서 ByteBuffer.allocateDirect(LONG_BYTE_LENGTH); 로 ByteBuffer를 할당했다는 점입니다. allocateDirect() 메서드로 할당했을 때와 allocate() 메서드로 할당했을 때의 퍼포먼스를 비교해보면 큰 차이는 안나는 듯 합니다. 하지면 여전히 allocateDirect() 메서드를 이용하는 것이 더 좋은 퍼포먼스를 냅니다.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td
class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> setValue<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">long</span> value<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span>
&nbsp;
	seqFile.<span style="color: #006633;">seek</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	buffer.<span style="color: #006633;">clear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	buffer.<span style="color: #006633;">putLong</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	buffer.<span style="color: #006633;">flip</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	channel.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span>buffer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">long</span> getValue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">long</span> res <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	seqFile.<span style="color: #006633;">seek</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	buffer.<span style="color: #006633;">clear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	channel.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span>buffer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	buffer.<span style="color: #006633;">flip</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	res <span style="color: #339933;">=</span> buffer.<span style="color: #006633;">getLong</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">return</span> res<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div><h3>자바 NIO와 일반 IO 퍼포먼스 비교해보기</h3><p>다음은 일반 I/O로 구현한 Sequence와 NIO를 이용하여 구현한 Sequence의 퍼포면서 비교 표입니다. next() 메서드와 currentValue() 메서드를 for문으로 1000000번  호출하면서 걸린 시간을 비교해 보았습니다. 단위는 밀리세컨드 입니다.</p><table
style="border-collapse: collapse; text-align: center;" width="620" cellspacing="1" cellpadding="1" bgcolor="#ffffff"><tbody><tr><td
style="text-align: center; border: #dadada 1px solid;" width="25%"></td><td
style="text-align: center; border: #dadada 1px solid;" width="25%"> 일반 IO로 구현</td><td
style="text-align: center; border: #dadada 1px solid;" width="25%">NIO (allocate)</td><td
style="text-align: center; border: #dadada 1px solid;" width="25%">NIO (allocateDirect)</td></tr><tr><td
style="text-align: center; border: #dadada 1px solid;" width="25%"> 1차</td><td
style="text-align: center; border: #dadada 1px solid;" width="25%">87814</td><td
style="text-align: center; border: #dadada 1px solid;" width="25%"> 17016</td><td
style="text-align: center; border: #dadada 1px solid;" width="25%"> 15844</td></tr><tr><td
style="text-align: center; border: #dadada 1px solid;" width="25%"> 2차</td><td
style="text-align: center; border: #dadada 1px solid;" width="25%">85236</td><td
style="text-align: center; border: #dadada 1px solid;" width="25%"> 16982</td><td
style="text-align: center; border: #dadada 1px solid;" width="25%"> 15562</td></tr><tr><td
style="text-align: center; border: #dadada 1px solid;" width="25%"> 3차</td><td
style="text-align: center; border: #dadada 1px solid;" width="25%">87642</td><td
style="text-align: center; border: #dadada 1px solid;" width="25%"> 17454</td><td
style="text-align: center; border: #dadada 1px solid;" width="25%"> 15656</td></tr></tbody></table><p>현저히 차이가 납니다. 자바 NIO는 ByteBuffer를 통한 퍼포먼스 향상은 거의 없고 Scalable하고 Efficient한 Server를 제작 할 수 있다는 것과 Non-Blocking IO를 제작 할 수 있다는 점에 의의가 있다고 말씀하시는 분들이 있습니다. 하지만 이전 포스팅에서도 확인했던 것과 같이 커널 버퍼를 이용함으로써 더 NIO에서 얻는 퍼포먼스 향상도 상당하다는 것을 알 수 있습니다.</p> ]]></content:encoded> <wfw:commentRss>http://rothlee.net/2009/09/compare-java-nio-and-io/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>인터넷은 모니터링 되고 있다? 모니터링 전문 업체의 존재에 대한 생각</title><link>http://rothlee.net/2009/09/monitoring-web/</link> <comments>http://rothlee.net/2009/09/monitoring-web/#comments</comments> <pubDate>Wed, 09 Sep 2009 06:28:18 +0000</pubDate> <dc:creator>eincs</dc:creator> <category><![CDATA[web]]></category> <category><![CDATA[Internet]]></category> <category><![CDATA[monitoring]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[모니터링]]></category> <category><![CDATA[웹]]></category> <category><![CDATA[웹 모니터링]]></category> <category><![CDATA[인터넷]]></category> <category><![CDATA[인터넷 모니터링]]></category> <guid isPermaLink="false">http://eincs.com/2009/09/09/monitoring-web/</guid> <description><![CDATA[오늘 출근하여 블로그의 유입키워드를 잠시 살펴봤습니다. 검색엔진 외에 메타사이트를 통합 유입이 당연히 많았는데, 전혀 보지 못한 사이트로부터의 유입이 있었습니다. 과거에도 몇번 모르는 사이트에서의 유입이 있어 들어가본적이 있습니다. 이번에도 어떤 사이트인지 궁금하여 한번 링크를 타고 들어가 봤습니다. 아이디 패스워드를 요구하는 사이트였습니다. &#8230; <a
href="http://rothlee.net/2009/09/monitoring-web/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>오늘 출근하여 블로그의 유입키워드를 잠시 살펴봤습니다. 검색엔진 외에 메타사이트를 통합 유입이 당연히 많았는데, 전혀 보지 못한 사이트로부터의 유입이 있었습니다.</p><p
style="text-align: center;"><img
class="aligncenter" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/monitoring-0.jpeg" alt="" width="400" height="338" /></p><p>과거에도 몇번 모르는 사이트에서의 유입이 있어 들어가본적이 있습니다. 이번에도 어떤 사이트인지 궁금하여 한번 링크를 타고 들어가 봤습니다.</p><p
style="text-align: center;"><img
class="aligncenter" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/monitoring-1.jpeg" alt="" width="600" height="585.7142857142857" /></p><p>아이디 패스워드를 요구하는 사이트였습니다. 이전에 커뮤니티의 게시물에 제 블로그로 유입이 되는 경우가 있었습니다. 싸이월드클럽이나 미니홈피, 기타 다른 커뮤니티 동호회 사이트에도 제 블로그가 링크된 경우가 몇 번 있었습니다. 그 당시에도 로그인 하지 않고는 볼 수 없었는데, 위 화면을 자세히 보면 Internet Monitoring Service 라는 문구를 있는데, 이 문구를 보고 흥미가 생겨 좀더 찾아보았습니다.</p><p
style="text-align: center;"><img
class="aligncenter" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/monitoring-2.jpeg" alt="" width="600" height="511.4285714285714" /></p><p>말 그대로 Internet을 모니터링 하는 사이트였습니다. 사이트를 잘 살표보면 서비스 소개도 꽤 자세히 볼 수 있습니다.</p><p
style="text-align: center;"><img
class="aligncenter" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/monitoring-3.jpeg" alt="" width="521" height="801" /></p><p>모니터링 전문 업체에 대해선 생각하지 못하고 있었던 저였기에 가장 먼저 &#8216;아 이럴수도 있구나&#8217;하는 생각이 들더군요. 과연 무었을 모니터링하고 있었을까요. 제 블로그의 어떤 포스팅이 모니터링 대상으로 가지고 간걸까요. 궁금한데 알 수 있는 방법이 없네요. 알 수 있는 방법이 있으면 좋을텐데요. 사실 인터넷 모니터링 사례는 유명 포탈에서 검색만 해보면 바로 찾으실 수 있습니다.<a
title="[http://market.hankyung.com/news/app/newsview.php?aid=2008062985821&amp;nid=006&amp;sid=0106&amp;type=0&amp;nv=]로 이동합니다." href="http://market.hankyung.com/news/app/newsview.php?aid=2008062985821&amp;nid=006&amp;sid=0106&amp;type=0&amp;nv=" target="_blank">[→관련기사보기]</a> 이 말고도 과거에 행정부에서 각 포탈에서 네티즌들의 부정적인 댓글 등을  모니터링 하고 있다는 것을 생각할 수 있을만한 스크린샷이 유출되기도 했습니다.<a
title="[http://studioxga.net/824]로 이동합니다." href="http://studioxga.net/824" target="_blank">[→관련포스팅보기]</a> 해당 업체에서는 실제로 서비스 되고 있는 것이 아니라 샘플 화면일 뿐이라고 합니다. 모니터링이 자칫 위험해 질 수 있는 이유는 위와 같은 사례에서 잘 알 수 있겠지요.</p><p>사실 모니터링 한다는 것 자체가 나쁜 것은 아닐 듯 합니다. 이런 기능으로 얼마든지 좋은 방향으로 나아갈 수 있으니까요. 웹의 여러 정보를 통합하여 그 정보로 더 좋은방향으로 나아갈 수 있겠죠. 하지만 웹이 웹 답지 못하게 되진 않았으면 좋겠습니다.</p><div
class="box"><strong>[2009년 9월 9일 오후 4:02분 첨부]</strong><br
/> 정확히 언제 어떤 포스팅으로 유입 되었는지는 모르겠는데요,<br
/> 그 사이에 또 한번도 보지 못한 사이트에서 들어왔습니다. 들어가보니 국정원 사이트입니다.<br
/> <img
class="aligncenter" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/monitoring-4.jpeg" alt="" width="533" height="162" /></div><div
class="box"><strong>[2009년 9월 9일 오후 4시 36분 첨부]</strong><br
/> 방금 알게 된 사실입니다. 저가 언급한 위의 사이트와 글 중에 행정부 인터넷 모니터링 시스템 관련 스크린 샷이 유출된 모니터링 서비스 업체는 동일 업체네요.</div> ]]></content:encoded> <wfw:commentRss>http://rothlee.net/2009/09/monitoring-web/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>이제 브라우저에서 네이트온을 하자! 웹에서 네이트온 기능을 제공해주는 웹트온2</title><link>http://rothlee.net/2009/09/web-based-nateon/</link> <comments>http://rothlee.net/2009/09/web-based-nateon/#comments</comments> <pubDate>Tue, 08 Sep 2009 12:40:22 +0000</pubDate> <dc:creator>eincs</dc:creator> <category><![CDATA[web]]></category> <category><![CDATA[imbots]]></category> <category><![CDATA[nateon]]></category> <category><![CDATA[기반]]></category> <category><![CDATA[네이트온]]></category> <category><![CDATA[네톤]]></category> <category><![CDATA[센스가이]]></category> <category><![CDATA[웹]]></category> <category><![CDATA[웹기반네이트온]]></category> <category><![CDATA[웹에서 네이트온]]></category> <category><![CDATA[웹트온]]></category> <category><![CDATA[웹트온2]]></category> <guid isPermaLink="false">http://eincs.com/2009/09/08/web-based-nateon/</guid> <description><![CDATA[지난 7월 30일, 한국 IBM은 클라우드 환경 구축을 위한 &#8216;스마트 비즈니스&#8217;를 국내에 발표했습니다.[→관련페이지] 또한 HP 아태지역, 일본 ESS 총괄 부사장인 &#8216;닐 클래퍼&#8217; 또한 클라우드 컴퓨팅을 이 새로운 시장에 지속적으로 투자를 해야 할 것이라면서 긍정적으로 바라보고 있는 것 같습니다.[→관련페이지] 하드웨어를 주로 &#8230; <a
href="http://rothlee.net/2009/09/web-based-nateon/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>지난 7월 30일, 한국 IBM은 클라우드 환경 구축을 위한 &#8216;스마트 비즈니스&#8217;를 국내에 발표했습니다.<a
title="[http://www.ibm.com/ibm/cloud/]로 이동합니다." href="http://www.ibm.com/ibm/cloud/" target="_blank">[→관련페이지]</a> 또한 HP 아태지역, 일본 ESS 총괄 부사장인 &#8216;닐 클래퍼&#8217; 또한 클라우드 컴퓨팅을 이 새로운 시장에 지속적으로 투자를 해야 할 것이라면서 긍정적으로 바라보고 있는 것 같습니다.<a
title="[http://www.dt.co.kr/contents.html?article_no=2009081702010560745002]로 이동합니다." href="http://www.dt.co.kr/contents.html?article_no=2009081702010560745002" target="_blank">[→관련페이지]</a> 하드웨어를 주로 취급하는 IBM과 HP 두 업체에서 이런 시각을 바라보고 있다는 점에서 정말 클라우드 컴퓨팅이 이제는 기정 사실로 되어 있는 것 같습니다.</p><p>구글에서 지원하는 서비스도 클라우드 컴퓨팅과 관련이 깊고, 웹에서 포토샵도 가능하는 등 웹 기반 어플리케이션이 굉장히 많은데, 이제 네이트온마저 웹에서 실행이 가능합니다. <a
title="[http://theomachy.wo.tc/]로 이동합니다." href="http://theomachy.wo.tc/" target="_blank">지인</a>이 알려줬는데 나름 신기하더군요. 웹트온2를 소개합니다.</p><h3>1. 웹트온2를 이용하여 네이트온을 하자!</h3><p>웹트온2는 웹에서 네이트온을 통해 대화를 할 수 있는 웹 어플리케이션입니다. 따로 네이트온을 설치하지 않고도 인터넷 환경과 브라우저만 있으면 어디서나 네이트온에 접속하여 친구들과 대화를 할 수가 있습니다. 웹트온2를 이용하려면 센스가이(<a
title="[http://www.imbots.co.kr/]로 이동합니다." href="http://www.imbots.co.kr/" target="_blank">http://www.imbots.co.kr/</a>)에 접속하시면 됩니다.</p><p
style="text-align: center;"><img
class="aligncenter" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/web-nateon-0.jpeg" alt="" width="600" height="501.9047619047619" /></p><p>위 화면은 <a
title="[http://www.imbots.co.kr/]로 이동합니다." href="http://www.imbots.co.kr/" target="_blank">센스가이</a> 메인 페이지입니다. 상단을 보시면 웹트온2라는 메뉴가 있습니다. 클릭하시면 로그인 페이지가 나옵니다. 기존 네이트온 로그인 아이디/비밀번호로 로그인 하실 수 있습니다.</p><p
style="text-align: center;"><img
class="aligncenter" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/web-nateon-1.jpeg" alt="" width="434" height="601" /></p><p>로그인을 하시면 위와 같이 접속자가 뜹니다. 기존 웹트온에서는 접속자가 네이트온 UI와 비슷하게 이미지로 설정되어있는데, 아무래도 개인 개발자가 돌리는 서버라서 트랙픽 문제 때문에 모두 텍스트로 표시되고 있습니다.</p><p
style="text-align: center;"><img
class="aligncenter" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/web-nateon-2.jpeg" alt="" width="320" height="490" /></p><p>위와 같이 대화도 가능합니다.</p><p>게다가 더 특별한 것이 있습니다. 많은 회사에서 네이트온을 차단하고 있는데요, 업무에 방해된다는 이유 때문입니다. 하지만 웹트온 까지 막을 수는 없겠죠. 실제로 네이트온을 차단한 회사 직원 분들이 웹트온2를 사용하고 있다고 합니다.</p><p>그리고 또한 네이트온에 접속할 수 없는 환경에서 웹 접근성만 보장된다면 네이트온에서 친구들과 대화할 수 있다는 장점도 있겠네요.</p><h3>2. 웹트온2, 어떻게 구현했을까?</h3><p>과연 어떻게 개발했을까요? 웹트온2의 개발자는 SK컴즈에서와 관련된 분이 아닌 듯 합니다. 웹트온2를 개발하기 위해서는 네이트온에서 사용되는 프로토콜의 분석이 필요합니다. 네이트온에서는 패킷을 암호화 하는 기능을 기본 제공하고 있습니다.</p><p
style="text-align: center;"><img
class="aligncenter" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/web-nateon-3.jpeg" alt="" width="585" height="554" /></p><p>위에서 암호화 기능을 끄게되면 TCP dump 패킷을 덤프뜨는 프로그램으로 컴퓨터에서 나가고 들어오는 패킷을 감시할 수가 있습니다.[footnote]그 외 몇가지 무료 소프트웨어는 많습니다. 하지만 포스팅을 하고 있는 컴퓨터에 해당 프로그램이 깔려 있지 않네요. 시간이 나면 이런 패킷 덤프 프로그램에 대해 소개해 보도록 하겠습니다.[/footnote] 네이트온으로 여러가지 상황을 만들어보면서 프로토콜만 딴다면 개발하는 내용은 일반 웹 어플리케이션 개발과 비슷하겠죠.</p><p>정말 근성있으신 분입니다.</p><h3>3. 웹트온2, 과연 믿을 수 있을까?</h3><h4>패킷 역엔지니어링은 일반적으로 불법이다.</h4><p>웹트온2에는 몇 가지 이슈가 있습니다. SK컴즈에서 허가되지 않았기 때문에 웹트온2은 패킷을 임의로 역엔지니어링하여 제공되는 서비스입니다. 따라서 불법으로 입니다.[footnote]SK컴즈, 즉 네이트측에서 불법이긴 하지만 이런저런 이유로 눈감아 주려는 것 같고, 사실상 별 문제 없으면 네이트측에서 허용한 것으로 간주하여 웹트온2관련 포스팅을 하는 것입니다. 요즘엔 포스팅 거리를 찾는 것도 조심스럽네요.[/footnote] 기본적으로 어플리케이션이나 그와 관련된 프로토콜의 역엔지니어링은 금지되어 있죠. 네이트온 약관을 살펴봐야하겠지만요. 하지만 이부분에 대해서 SK컴즈 측은 별 문제가 발생되지 않는 이상 문제 삼지 않겠다는 입장인 듯 합니다. 하지만 보안상 문제로 언제든지 웹트온2를 차단할 수 있다고 했습니다.<a
title="[http://www.imbots.co.kr/board/articleRead?MENU_CATE_ID=community&amp;MENU_ID=3&amp;BDID=notice&amp;SEQ=1562]로 이동합니다." href="http://www.imbots.co.kr/board/articleRead?MENU_CATE_ID=community&amp;MENU_ID=3&amp;BDID=notice&amp;SEQ=1562" target="_blank">[→관련페이지]</a></p><h4>웹트온2는 공공PC에서 안전하지 못하다.</h4><p>또한 아이디/패스워드 전송 http요청이 암호화 되어 있지 않아 공공PC에서 사용하면 보안상 문제가 발생할 수 있습니다. 다음은 fiddler로 웹트온2 접속시 나가는 http요청을 덤프 떠본 결과입니다.</p><p
style="text-align: center;"><img
class="aligncenter" src="http://media.wp.eincs.net.s3.amazonaws.com/wp-content/uploads/2011/10/web-nateon-4.jpeg" alt="" width="578" height="485" /></p><p>아이디/패스워드가 고스란히 보이는 것을 알 수 있습니다. (저 아이디와 패스워드는 임의로 적어둔 겁니다) 공용 PC에 http 덤프 뜨는 해킹 프로그램이 있다면 크래커에게 고스란히 네이트온 아이디를 바치는 일이 되는 거죠. 공용 PC에서 웹트온2 사용은 고려해봐야겠습니다.</p><h4>네이트온 아이디 패스워드가 웹트온 어플리케이션에 고스란히 넘어간다.</h4><p>또한, 웹트온2 운영자를 믿어야 되는 문제가 있습니다. 웹트온2 로그인시 네이트온 아이디 및 패스워드가 고스란히 웹트온2 어플리케이션에 넘어가게 됩니다. 웹트온2 개발자가 이 정보를 따로 로그를 남긴다면 네이트온 아이디와 패스워드가 털리는것이죠. 이 점도 고려해야 할 듯 합니다. 정 걱정되신다면 웹트온 로그인시 따로 패스워드를 바꾼 뒤 로그인을 하는 등의 작업이 필요하겠죠.</p><p>또한 현재 구현되어 있는 웹트온2에 접속해 보면 나를 삭제하거나 차단한 상대방이 고스란히 뜹니다. 그 리스트를 보고 있으면 슬퍼지겠죠. 다행히 저는&#8230;;</p><p><strong>하여간 클라우드 컴퓨팅 시대가 도래할 날이 머지 않았나 봅니다. 여러가지 이슈사항이 있더라도 웹트온2는 굉장히 관심이 가는 웹 어플리케이션에는 틀림 없습니다.</strong></p><div
class="box">저는 웹트온2, 웹 네이트온의 존재를 <a
title="[http://theomachy.wo.tc/]로 이동합니다." href="http://theomachy.wo.tc/" target="_blank">SIC</a>님을 통해 알게되었습니다. <a
title="[http://theomachy.wo.tc/]로 이동합니다." href="http://theomachy.wo.tc/" target="_blank">SIC</a>님 IT관련 블로그인지 자전거 여행 블로그인지 하여튼 잡다한 것을 다루는 <a
title="[http://theomachy.wo.tc/]로 이동합니다." href="http://theomachy.wo.tc/" target="_blank">NEW CHALLENGE</a>라는 블로그와 (업데이트 안된지는 굉장히 오래됐지만) 직접 찍은 사진을 정리하는 <a
title="[http://snapshot.wo.tc/]로 이동합니다." href="http://snapshot.wo.tc/" target="_blank">se0photow0rk</a>를 운영하고 있답니다. 하여튼 신기한 웹 어플리케이션을 소개해준 <a
title="[http://theomachy.wo.tc/]로 이동합니다." href="http://theomachy.wo.tc/" target="_blank">SIC</a>씨께 감사드립니다.</div><div
class="box"><a
title="[http://theomachy.wo.tc/]로 이동합니다." href="http://theomachy.wo.tc/" target="_blank">SIC</a>님의 추가 제보로 알게된 사실입니다. 마이라인업(<a
href="http://www.mylineup.co.kr/index.action#">http://www.mylineup.co.kr/index.action#</a>)라는 사이트도 있군요. 네이트온을 포함하여 MSN메신저도 웹에서 사용가능합니다. 버디버디, 야후메신저도 준비 중인듯 하네요. 참고하면 좋을 듯 합니다.<a
title="[http://dev.haz3.com/trac/nateon/]로 이동합니다." href="http://dev.haz3.com/trac/nateon/" target="_blank">http://dev.haz3.com/trac/nateon/</a><br
/> <a
title="[http://www.neoplanner.co.kr/cgi-bin/ZeroBoard/view.php?id=NP_DevStory&amp;no=125]로 이동합니다." href="http://www.neoplanner.co.kr/cgi-bin/ZeroBoard/view.php?id=NP_DevStory&amp;no=125" target="_blank">http://www.neoplanner.co.kr/cgi-bin/ZeroBoard/view.php?id=NP_DevStory&amp;no=125</a><br
/> <a
title="[http://returnaddr.org/b0d/zboard.php?id=news_notice&amp;no=17]로 이동합니다." href="http://returnaddr.org/b0d/zboard.php?id=news_notice&amp;no=17" target="_blank">http://returnaddr.org/b0d/zboard.php?id=news_notice&amp;no=17</a><br
/> 여기서 볼 수 있듯이 네이트온 패킷 분석 자료도 있네요.</div> ]]></content:encoded> <wfw:commentRss>http://rothlee.net/2009/09/web-based-nateon/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> <media:rating>nonadult</media:rating></channel> </rss><!-- Dynamic page generated in 3.268 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-02-23 04:41:15 --><!-- Compression = gzip -->

