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

<channel>
	<title>web technologist &#187; Programming</title>
	<atom:link href="http://www.shinstudio.com/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shinstudio.com/blog</link>
	<description>web 2.0, frontend, ajax, flash, css, dhtml, php</description>
	<lastBuildDate>Thu, 26 Jan 2012 09:50:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>note to myself on mongoDB procedure</title>
		<link>http://www.shinstudio.com/blog/personal/note-to-myself-on-mongodb-procedure/</link>
		<comments>http://www.shinstudio.com/blog/personal/note-to-myself-on-mongodb-procedure/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 07:17:07 +0000</pubDate>
		<dc:creator>sh.kim</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.shinstudio.com/blog/?p=514</guid>
		<description><![CDATA[TweetFor PHP MongoDB Driver sudo apt-get update sudo apt-get install php5-dev php5-cli php-pear sudo pecl install mongo // if apache2 cd /etc/php5/apache2 sudo vim php.ini add "extension=mongo.so" without double quotes /wq! and enter sudo /etc/init.d/apache2 restart For MongoDB Server sudo apt-get adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 sudo vim /etc/apt/sources.list add "deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen" without [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton514" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fpersonal%2Fnote-to-myself-on-mongodb-procedure%2F&amp;text=note%20to%20myself%20on%20mongoDB%20procedure&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fpersonal%2Fnote-to-myself-on-mongodb-procedure%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.shinstudio.com/blog/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>For PHP MongoDB Driver<br />
<code><br />
sudo apt-get update<br />
sudo apt-get install php5-dev php5-cli php-pear<br />
sudo pecl install mongo<br />
// if apache2<br />
cd /etc/php5/apache2<br />
sudo vim php.ini<br />
add "extension=mongo.so" without double quotes<br />
/wq! and enter<br />
sudo /etc/init.d/apache2 restart<br />
</code></p>
<p>For MongoDB Server<br />
<code><br />
sudo apt-get adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10<br />
sudo vim /etc/apt/sources.list<br />
add "deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen" without double quotes<br />
/wq! and enter<br />
sudo apt-get update<br />
sudo apt-get install mongodb-10gen<br />
</code></p>
<p>To launch mongodb commandline<br />
<code><br />
mongo<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shinstudio.com/blog/personal/note-to-myself-on-mongodb-procedure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learning generics in Java</title>
		<link>http://www.shinstudio.com/blog/programming/learning-generics-in-java/</link>
		<comments>http://www.shinstudio.com/blog/programming/learning-generics-in-java/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 02:00:22 +0000</pubDate>
		<dc:creator>sh.kim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[java generics]]></category>

		<guid isPermaLink="false">http://www.shinstudio.com/blog/?p=489</guid>
		<description><![CDATA[TweetGood learning if you are interested in learning Java. Link]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton489" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fprogramming%2Flearning-generics-in-java%2F&amp;text=Learning%20generics%20in%20Java&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fprogramming%2Flearning-generics-in-java%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.shinstudio.com/blog/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Good learning if you are interested in learning Java. <img src='http://www.shinstudio.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf">Link</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shinstudio.com/blog/programming/learning-generics-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pulling query string in node.js</title>
		<link>http://www.shinstudio.com/blog/programming/pulling-query-string-in-node-js/</link>
		<comments>http://www.shinstudio.com/blog/programming/pulling-query-string-in-node-js/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 08:54:19 +0000</pubDate>
		<dc:creator>sh.kim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.shinstudio.com/blog/?p=468</guid>
		<description><![CDATA[Tweetin web development, pulling data from query string is the basic and fundamental task. In node.js, the syntax is like this: http://{host}:{port}/?name=shinstudio.com 1 2 3 4 5 6 7 var http = require&#40;'http'&#41;, url = require&#40;'url'&#41;; http.createServer&#40;function&#40;request, response&#41; &#123; response.writeHead&#40;200, &#123;&#34;Content-Type&#34;:&#34;text/plain&#34;&#125;&#41;; var urlObj = url.parse&#40;request.url, true&#41;; response.write&#40;&#34;Hello &#34; + urlObj.query&#91;&#34;name&#34;&#93; + &#34;!\n&#34;&#41;; response.close&#40;&#41;; &#125;&#41;.listen&#40;8000&#41;; you [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton468" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fprogramming%2Fpulling-query-string-in-node-js%2F&amp;text=pulling%20query%20string%20in%20node.js&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fprogramming%2Fpulling-query-string-in-node-js%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.shinstudio.com/blog/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>in web development, pulling data from query string is the basic and fundamental task. In node.js, the syntax is like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">http://{host}:{port}/?name=shinstudio.com</pre></div></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> http <span style="color: #339933;">=</span> require<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> url <span style="color: #339933;">=</span> require<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
http.<span style="color: #660066;">createServer</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>request<span style="color: #339933;">,</span> response<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    response.<span style="color: #660066;">writeHead</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">200</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;Content-Type&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;text/plain&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> urlObj <span style="color: #339933;">=</span> url.<span style="color: #660066;">parse</span><span style="color: #009900;">&#40;</span>request.<span style="color: #660066;">url</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    response.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hello &quot;</span> <span style="color: #339933;">+</span> urlObj.<span style="color: #660066;">query</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    response.<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">listen</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">8000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>you can actually test my test app here:</p>
<p><a href="http://www.groupstick.com:8001/?name=shinstudio.com">http://www.groupstick.com:8001/?name=shinstudio.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shinstudio.com/blog/programming/pulling-query-string-in-node-js/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>memcached with java</title>
		<link>http://www.shinstudio.com/blog/backend-tech/memcached-with-java/</link>
		<comments>http://www.shinstudio.com/blog/backend-tech/memcached-with-java/#comments</comments>
		<pubDate>Wed, 05 May 2010 18:26:48 +0000</pubDate>
		<dc:creator>sh.kim</dc:creator>
				<category><![CDATA[Backend Tech]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[java memcached]]></category>

		<guid isPermaLink="false">http://www.shinstudio.com/blog/uncategorized/memcached-with-java/</guid>
		<description><![CDATA[TweetI found a great post regarding the subject. It&#8217;s a very good read.]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton415" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fbackend-tech%2Fmemcached-with-java%2F&amp;text=memcached%20with%20java&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fbackend-tech%2Fmemcached-with-java%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.shinstudio.com/blog/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>I found a <a href="http://sacharya.com/using-memcached-with-java/">great post</a> regarding the subject. It&#8217;s a very good read.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shinstudio.com/blog/backend-tech/memcached-with-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile App Engineer Trend</title>
		<link>http://www.shinstudio.com/blog/personal/mobile-app-engineer-trend/</link>
		<comments>http://www.shinstudio.com/blog/personal/mobile-app-engineer-trend/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 14:51:50 +0000</pubDate>
		<dc:creator>sh.kim</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://www.shinstudio.com/blog/?p=395</guid>
		<description><![CDATA[TweetWeb vs. Mobile web I may be wrong, but it seems to me that many tech companies are investing more resources (engineering, marketing, and budget) into mobile strategy. The example? Apple. It&#8217;s still that web pages are more dominant than mobile web pages, but more and more companies are providing alternative web pages just for [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton395" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fpersonal%2Fmobile-app-engineer-trend%2F&amp;text=Mobile%20App%20Engineer%20Trend&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fpersonal%2Fmobile-app-engineer-trend%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.shinstudio.com/blog/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p><strong>Web vs. Mobile web</strong></p>
<p>I may be wrong, but it seems to me that many tech companies are investing more resources (engineering, marketing, and budget) into mobile strategy. The example? Apple. </p>
<p>It&#8217;s still that web pages are more dominant than mobile web pages, but more and more companies are providing alternative web pages just for mobile devices (mobile webkit).</p>
<p><span id="more-395"></span><br />
Also mobile browsers added mobile specific JavaScript APIs and opened opportunities for better mobile web browsing experience.</p>
<p><strong>Web engineers(FE/BE)</strong></p>
<p>No matter what, backend engineers and frontend engineers are crucial to mobile software products (in web application form and native application form). However, Backend engineers are winner over the frontend engineers because they write data access layer to provide data to whichever client is and do not have to learn completely new programming language or new process.</p>
<p>On the other hands, frontend (client UI) engineers need to learn client programming language to build client applications for apple iPhone os (objective c), google android os(java), adobe flash lite(actionscript), and webkit/web browser(HTML,JavaScript, and CSS). </p>
<p><strong>Transition to mobile UI engineer</strong><br />
I&#8217;ve personally seen so many people who were a web UI engineer mainly using flash transformed to objective-c programmer for iPhone app. The main reason that I think made it possible was the similarity of how programmer approaches application development in both platform although IDE and APIs are quite different. It&#8217;s like when there is a good programmer who has very strong fundamental of programming languages, that programmer has a very high chance of getting to pick up another programming language in no time. So transition from ActionScript to objective-c should be fairly easy if you are already familiar with actionscript 3 well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shinstudio.com/blog/personal/mobile-app-engineer-trend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript String.replace with regex</title>
		<link>http://www.shinstudio.com/blog/frontend-tech/javascript-string-replace-with-regex/</link>
		<comments>http://www.shinstudio.com/blog/frontend-tech/javascript-string-replace-with-regex/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 03:23:44 +0000</pubDate>
		<dc:creator>sh.kim</dc:creator>
				<category><![CDATA[Frontend Tech]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://www.shinstudio.com/blog/?p=391</guid>
		<description><![CDATA[TweetI often use String.replace in JavaScript whenever I have to use JavaScript. Today was the day that I ended up with using it for my work. I know that String.replace supports regular expression to match your string, but I was not clear if I could use &#8220;capturing groups&#8221; and &#8220;quantifiers&#8221;. As I guessed, I was [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton391" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Ffrontend-tech%2Fjavascript-string-replace-with-regex%2F&amp;text=JavaScript%20String.replace%20with%20regex&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Ffrontend-tech%2Fjavascript-string-replace-with-regex%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.shinstudio.com/blog/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>I often use String.replace in JavaScript whenever I have to use JavaScript. Today was the day that I ended up with using it for my work. I know that String.replace supports regular expression to match your string, but I was not clear if I could use &#8220;capturing groups&#8221; and &#8220;quantifiers&#8221;. As I guessed, I was able to use quantifiers in the replace string like the sample below:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #003366; font-weight: bold;">var</span> link_template <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;ol&gt;<span style="color: #000099; font-weight: bold;">\</span>
        &lt;li&gt;&lt;label&gt;Link 1 Title:&lt;/label&gt;&lt;input class=&quot;text&quot; id=&quot;relLink1title&quot; name=&quot;relLink{1}title&quot; value=&quot;&quot; /&gt;&lt;/li&gt;<span style="color: #000099; font-weight: bold;">\</span>
        &lt;li&gt;&lt;label&gt;Link 1 URL:&lt;/label&gt;&lt;input class=&quot;text&quot; id=&quot;relLink1url&quot; name=&quot;relLink{1}url&quot; value=&quot;&quot; /&gt;&lt;/li&gt;<span style="color: #000099; font-weight: bold;">\</span>
        &lt;li&gt;&lt;label&gt;Link 1 Img URL:&lt;/label&gt;&lt;input class=&quot;text&quot; id=&quot;rellink1imgurl&quot; name=&quot;rellink{1}imgurl&quot; value=&quot;&quot; /&gt;&lt;/li&gt;<span style="color: #000099; font-weight: bold;">\</span>
        &lt;li class=&quot;btn&quot;&gt;&lt;span&gt;&lt;a href=&quot;#&quot; class=&quot;new-related-link&quot;&gt;Add a New Link&lt;/a&gt; | &lt;a href=&quot;#&quot; class=&quot;remove-related-link&quot;&gt;Remove&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;<span style="color: #000099; font-weight: bold;">\</span>
        &lt;/ol&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
    link_template <span style="color: #339933;">=</span> link_template.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/(&lt;label&gt;.*?)(\d)(.*?&lt;\/label&gt;)/im</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'$1 2 $2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.shinstudio.com/blog/frontend-tech/javascript-string-replace-with-regex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ByteArray in Flash slide</title>
		<link>http://www.shinstudio.com/blog/news/bytearray-in-flash-slide/</link>
		<comments>http://www.shinstudio.com/blog/news/bytearray-in-flash-slide/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 17:34:50 +0000</pubDate>
		<dc:creator>sh.kim</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ByteArray]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flash on the beach]]></category>

		<guid isPermaLink="false">http://www.shinstudio.com/blog/?p=384</guid>
		<description><![CDATA[TweetI found this ByteArray slides by Lee Brimelow, which he presented at the Flash on the beach. I knew that low level manipulation is so powerful tool, but had very little idea of how I could use them. This slide shows a good start for a beginner like myself. Peronally, I used bitwise operators to [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton384" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fnews%2Fbytearray-in-flash-slide%2F&amp;text=ByteArray%20in%20Flash%20slide&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fnews%2Fbytearray-in-flash-slide%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.shinstudio.com/blog/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>I found this ByteArray slides by <a href="http://theflashblog.com/">Lee Brimelow</a>, which he presented at the Flash on the beach.</p>
<p>I knew that low level manipulation is so powerful tool, but had very little idea of how I could use them. This slide shows a good start for a beginner like myself.</p>
<p>Peronally, I used bitwise operators to extract red, green, blue color values. However, with the bitwise operators it works for many other things.</p>
<p>One of samples that Lee Brimelow presented was this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span><span style="color: #CC0000;">100</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">&amp;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// i is odd</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// i is even</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>To check whether the number is odd or even and according to Lee, it&#8217;s 600% faster than using the modulus operator.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shinstudio.com/blog/news/bytearray-in-flash-slide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RESTful web services</title>
		<link>http://www.shinstudio.com/blog/programming/restful-web-services/</link>
		<comments>http://www.shinstudio.com/blog/programming/restful-web-services/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 01:55:23 +0000</pubDate>
		<dc:creator>sh.kim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[restful]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.shinstudio.com/blog/?p=367</guid>
		<description><![CDATA[TweetMany developers heard/use/implement/develop RESTful web services daily basis including myself. It seems likely that we all know what it is and how it works. However, if we ask ourselves why we are using it, what would be your answer? My answer to this question is this: To make *services* more sense. We all know that [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton367" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fprogramming%2Frestful-web-services%2F&amp;text=RESTful%20web%20services&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fprogramming%2Frestful-web-services%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.shinstudio.com/blog/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Many developers heard/use/implement/develop RESTful web services daily basis including myself. It seems likely that we all know what it is and how it works. However, if we ask ourselves why we are using it, what would be your answer? </p>
<p>My answer to this question is this:</p>
<p>To make *services* more sense.</p>
<p>We all know that RESTful web services utilizes http methods such as GET, POST, PUT, and DELETE. Most commonly used methods to me are GET and POST. And technical aspects of discussion can keep going. However, the question is how we can utilize RESTful web services and how we can make it so that other developers can consume them in easy way? Eventually RESTful web services is for openness. Facebook opens up their RESTful API so that other developers or 3rd party application of facebook can pull up information on users or something like that.</p>
<p>With RESTful API, it is *possible* that you can organize calls.</p>
<p>Let&#8217;s look at this imaginable API path for getting a particular movie info.</p>
<p><code>http://RESTfulAPIHost:Port/movie/</code></p>
<p>By just looking at the API path, you can take a good guess of what it might return to you. And then after that, you naturally think ahead and append movies name to it.</p>
<p><code>http://RESTfulAPIHost:Port/movie/dark-knight/</code></p>
<p>Looking at the API path, I would naturally think that I could expect movie information for the movie &#8220;Dark Knight&#8221;. This natural thought process leads to more details API paths like these:</p>
<p><code></p>
<p>http://RESTfulAPIHost:Port/movie/dark-knight/actors/</p>
<p>http://RESTfulAPIHost:Port/movie/dark-knight/credits/</p>
<p>http://RESTfulAPIHost:Port/movie/dark-knight/showtimes/</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shinstudio.com/blog/programming/restful-web-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pretty xml &amp; json</title>
		<link>http://www.shinstudio.com/blog/news/pretty-xml-json/</link>
		<comments>http://www.shinstudio.com/blog/news/pretty-xml-json/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 09:20:53 +0000</pubDate>
		<dc:creator>sh.kim</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[highlighter]]></category>
		<category><![CDATA[pretty json]]></category>
		<category><![CDATA[pretty xml]]></category>
		<category><![CDATA[printer]]></category>

		<guid isPermaLink="false">http://www.shinstudio.com/blog/?p=352</guid>
		<description><![CDATA[TweetI was working on a feed project at work and dealing with lots of XML and JSON data. If data were well indented and formatted, my tasks would have been a lot smooth. However, the reality was not like how I imagined as usual. At first I googled about it. I kinda found one but [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton352" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fnews%2Fpretty-xml-json%2F&amp;text=pretty%20xml%20%26%23038%3B%20json&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fnews%2Fpretty-xml-json%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.shinstudio.com/blog/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>I was working on a feed project at work and dealing with lots of XML and JSON data. If data were well indented and formatted, my tasks would have been a lot smooth. However, the reality was not like how I imagined as usual.</p>
<p>At first I googled about it. I kinda found one but the application required actual file, which could be okay. However, I could see myself copying and pasting xml into a file and upload, which is not quite ideal. </p>
<p>So I decided to make one for myself and my tasks. Let me know if it works well for you or you find a bug.</p>
<p>Here they are:<br />
<a href="http://www.shinstudio.com/tools/pretty-xml">http://www.shinstudio.com/tools/pretty-xml</a><br />
<a href="http://www.shinstudio.com/tools/pretty-json">http://www.shinstudio.com/tools/pretty-json</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shinstudio.com/blog/news/pretty-xml-json/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rotating view in iPhone app</title>
		<link>http://www.shinstudio.com/blog/programming/rotating-view-in-iphone-app/</link>
		<comments>http://www.shinstudio.com/blog/programming/rotating-view-in-iphone-app/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 09:57:49 +0000</pubDate>
		<dc:creator>sh.kim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://www.shinstudio.com/blog/?p=306</guid>
		<description><![CDATA[TweetWhen iPhone came out for the first time, I was amazed at how iPhone rotated safari web browser. I wondered how iPhone would rotate it and was not aware that not all iPhone applications are rotatable, but now I know how. Let&#8217;s assume that we already have your own extended UIViewController class. UIViewController class has [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton306" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fprogramming%2Frotating-view-in-iphone-app%2F&amp;text=Rotating%20view%20in%20iPhone%20app&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fwww.shinstudio.com%2Fblog%2Fprogramming%2Frotating-view-in-iphone-app%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://www.shinstudio.com/blog/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>When iPhone came out for the first time, I was amazed at how iPhone rotated safari web browser. I wondered how iPhone would rotate it and was not aware that not all iPhone applications are rotatable, but now I know how.</p>
<p>Let&#8217;s assume that we already have your own extended UIViewController class. UIViewController class has these two classes for the rotate feature:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="c_mac" style="font-family:monospace;"><span style="color: #000000;">-</span><span style="color: #000000;">&#40;</span>BOOL<span style="color: #000000;">&#41;</span>shouldAutorotateToInterfaceOrientation<span style="color: #000000;">:</span>
	<span style="color: #000000;">&#40;</span>UIInterfaceOrientation<span style="color: #000000;">&#41;</span>interfaceOrientation <span style="color: #000000;">&#123;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">-</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #000000;">&#41;</span>willRotateToInterfaceOrientation<span style="color: #000000;">:</span>
	<span style="color: #000000;">&#40;</span>UIInterfaceOrientation<span style="color: #000000;">&#41;</span>orientation
		duration<span style="color: #000000;">:</span><span style="color: #000000;">&#40;</span>NSTimeInterval<span style="color: #000000;">&#41;</span>duration <span style="color: #000000;">&#123;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>shouldAutorotateToInterfaceOrientation method. You simply just return &#8220;YES&#8221; so that the viewcontroller rotate its views automatically. The 2nd method &#8220;willRotateToInterfaceOrientation&#8221; is the one you want to implement.</p>
<p>Let&#8217;s say you already had one UIView object with white color background. When you rotated your iPhone or iPhone simulator to landscape orientation, the UIView would be rotated. However, the view wouldn&#8217;t fit the screen. To make the view to stretch to the all 4 edges of the screen, I would write something like this:</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="c_mac" style="font-family:monospace;"><span style="color: #000000;">-</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #000000;">&#41;</span>willRotateToInterfaceOrientation<span style="color: #000000;">:</span>
	<span style="color: #000000;">&#40;</span>UIInterfaceOrientation<span style="color: #000000;">&#41;</span>orientation
		duration<span style="color: #000000;">:</span><span style="color: #000000;">&#40;</span>NSTimeInterval<span style="color: #000000;">&#41;</span>duration <span style="color: #000000;">&#123;</span>
	CGRect appFrame;
	appFrame.<span style="color: #00eeff;">origin</span> <span style="color: #000000;">=</span> CGPointMake<span style="color: #000000;">&#40;</span><span style="color:#800080;">0.0f</span>, <span style="color:#800080;">0.0f</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #0000ff;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>orientation <span style="color: #000000;">==</span> UIInterfaceOrientationLandscapeLeft<span style="color: #000000;">&#41;</span> ||
			<span style="color: #000000;">&#40;</span>orientation <span style="color: #000000;">==</span> UIInterfaceOrientationLandscapeRight<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
		appFrame.<span style="color: #00eeff;">size</span> <span style="color: #000000;">=</span> CGSizeMake<span style="color: #000000;">&#40;</span><span style="color:#800080;">480.0f</span>, <span style="color:#800080;">300.0f</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #0000ff;">else</span>
		appFrame.<span style="color: #00eeff;">size</span> <span style="color: #000000;">=</span> CGSizeMake<span style="color: #000000;">&#40;</span><span style="color:#800080;">320.0f</span>, <span style="color:#800080;">460.0f</span><span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #000000;">&#91;</span>contentView setFrame<span style="color: #000000;">:</span>appFrame<span style="color: #000000;">&#93;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>As you can see, every time view gets rotated, you would need to use setFrame method to set the new frame with a new size and new origin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shinstudio.com/blog/programming/rotating-view-in-iphone-app/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

