<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Life</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/" />
    <link rel="self" type="application/atom+xml" href="http://www.andyhuang.net/blog/atom.xml" />
    <id>tag:www.andyhuang.net,2011-10-10:/blog//12</id>
    <updated>2011-10-23T14:38:40Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 5.12</generator>

<entry>
    <title>Is Google Trying to Block Twitter in Favor for Google Plus?</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2011/10/is-google-trying-to-block-twitter-in-favor-for-google-plus.html" />
    <id>tag:www.andyhuang.net,2011:/blog//12.480</id>

    <published>2011-10-23T14:07:12Z</published>
    <updated>2011-10-23T14:38:40Z</updated>

    <summary>I did not notice this earlier, and I probably should have noticed sooner. But it seems like Google is doing a few things to try to boost its Google+ product. See this image here... Immediately, you&apos;ll notice that my Google+...</summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Personal" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[<p>I did not notice this earlier, and I probably should have noticed sooner. But it seems like Google is doing a few things to try to boost its Google+ product. See this image here...</p>
<img alt="SearchResults.png" src="http://www.andyhuang.net/blog/2011/10/23/SearchResults.png" width="746" height="537" class="mt-image-none" style="" />
<p>Immediately, you'll notice that my Google+ profile is ranked higher than my Twitter profile, despite the fact that I interact with Twitter {psst, follow @AndyHuang} a lot more than I do on Google+, and that I rarely post to Google+. Now, as an avid web person, we know that Google value in-bound links, so several educated guesses comes up:
<ul>
<li>Does my Google+ profile have a lot more in-bound links than my Twitter profile? No, I don't think so.</li>
<li>Does plus.google.com receive more in-bound links than Twitter? No: Google themselves proves it otherwise: <a href="http://www.google.ca/search?q=link:plus.google.com+-site:plus.google.com">169,000,000 Google+</a> vs <a href="http://www.google.ca/search?q=link:twitter.com+-site:twitter.com">3,150,000,000 Twitter</a></li>
<li>What about page rank? plus.google.com is sitting at 8, and twitter.com is sitting at 9, according to <a href="http://www.prchecker.info/check_page_rank.php" rel="nofollow">PageRank Checker</a> right now.</li>
<li>Keyword density? No, @AndyHuang, and even AndyHuang is mentioned much more frequently, and even in &lt;title&gt; tag of Twitter profile</li>
</ul>
</p>
<p>Furthermore, if you look carefully, you will notice something they've added a while back. Near the search result for my profile, you will notice a link that says "Block all twitter.com results". This is a feature added recently, which allows people who are logged in to block unwanted results. Now, granted that same thing can be done for Google Plus profile, but look, the profile magically wraps around at a much thinner width, burying the link in the middle of cluster of text.</p>
<img alt="BlockGPlus.png" src="http://www.andyhuang.net/blog/2011/10/23/BlockGPlus.png" width="478" height="136" class="mt-image-none" style="" />
<p>Given how I love Google products -- absolutely love Google Apps for Domain Owners, and can't find my way from home to campus without Google Maps -- I must give them the benefit of the doubt; that they are not trying to block out Twitter in favor for Google Plus, and that these are just simple coincidences. But I really hope that they hear voice of little guys like me, and either correct this problem, or become more transparent as to why this is happening, so that Twitter aren't being down-played by the search results.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Farewell Steve Jobs</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2011/10/farewell-steve-jobs.html" />
    <id>tag:www.andyhuang.net,2011:/blog//12.469</id>

    <published>2011-10-06T17:49:05Z</published>
    <updated>2011-10-11T02:48:36Z</updated>

    <summary>Steve, I may have never came in contact with you, and may never will in my life time, but your passion for your company and products have played a very big role in shaping who I am. For that, I...</summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[<p>Steve,<br />
I may have never came in contact with you, and may never will in my life time, but your passion for your company and products have played a very big role in shaping who I am. For that, I thank you deeply for. Please know that everything you've created will continue to change the rest of the world for a long time to come. While you may not received British Knighthood, you will always be the knight in shiny armor, liberating people on the forefront of technology and innovation, and leading humanity towards a better future. Farewell, great leader. We will all miss you dearly. </p><br />]]>
        
    </content>
</entry>

<entry>
    <title>Cities of Tomorrow: Improvement on Public Roads System</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2011/08/cities-of-tomorrow-improvement.html" />
    <id>tag:www.andyhuang.net,2011:/blog//12.466</id>

    <published>2011-08-30T13:00:00Z</published>
    <updated>2011-10-11T02:48:36Z</updated>

    <summary>Cities of Tomorrow is a section I am starting which deviates from my normal ramblings on life. This section will be some ideas I&apos;ve come up with over the years about how to improve cities of, well, today. Undoubtedly, I...</summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
    <category term="energy" label="Energy" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="green" label="Green" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="power" label="Power" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[<p>Cities of Tomorrow is a section I am starting which deviates from my normal ramblings on life. This section will be some ideas I've come up with over the years about how to improve cities of, well, today. Undoubtedly, I am not the first to come up with all, or even any, of these ideas. There are other visionaries out there. I will try to cite them if I am aware of their inputs on related subjects.</p>
<p>First up is an old idea. But this idea keeps on coming back to my random chatter with different people. The idea is simple. Since we can do almost anything with glass these days (<a href="http://www.corninggorillaglass.com/" target="_new" rel="nofollow">Gorilla Glass</a>, for example), we can most likely make a ultra-durable glass surface which provides sufficient traction for vehicle wheels. Under this ultra0durable glass, embed LED displays, and solar panels. This offers several benefits:
<ul>
<li>The first obvious benefit is free energy. How much energy? Well, a city block in North America is typically 100-200m in length <sup>[1]</sup>, and a residential area street is usually about 6m across (one lane <sup>[2]</sup> on each side). Solar panels have a rough dimension of 1.6m x 1m <sup>[3]</sup>, so we can roughly fit 60 of them under a single block's worth of street. Each one of them is manufacture rated to be able to provide 180W (28.5V, 6.9A) at optimal performance. The energy generated can be integrated into the grid, and provide cheaper power to everyone on the block.</li>
<li>A not so obvious benefit is ability to change pavement markings without the need to re-paint the street. This is particularly useful for larger streets, or local freeways that have interchangeable lanes whose directions change depending on rush hour direction. The integrated LED display can also show simple information such as speed limit, traffic condition, detour direction, etc. Since they are sitting on top of solar panels, they wouldn't need external power source to function, too! To conserve energy, pressure sensors can be integrated at intersections, so these displays can go into sleep mode if there are no near-by vehicles.</li>
</ul>
</p>



<div class="footnote">
<ol>
<li><a href="http://en.wikipedia.org/wiki/List_of_unusual_units_of_measurement#Block" target="_new" rel="nofollow">Wikipedia: List of unusual units of measurement</a></li>
<li><a href="http://en.wikipedia.org/wiki/Lane#Lane_width_and_capacity" target="_new" rel="nofollow">Wikipedia: Lane</a></li>
<li><a href="http://www.bdbatteries.com/pdfs/CanadianSolarPanelCS6P.pdf" target="_new" rel="nofollow">Solar Panel Specs</a></li>
</ol>
</div>]]>
        
    </content>
</entry>

<entry>
    <title>TRON: What happened to Lora&apos;s &quot;life&apos;s work&quot;?</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2010/12/tron-what-happened-to-loras-li.html" />
    <id>tag:www.andyhuang.net,2010:/blog//12.465</id>

    <published>2010-12-19T06:54:05Z</published>
    <updated>2011-10-11T02:48:36Z</updated>

    <summary>In the origina TRON (1982) movie, minutes before Kevin Flynn entered the digital world for the first time, Lora mentioned something about her work: Lora: &quot;Remember, this laser is my life&apos;s work, so don&apos;t spill anything.&quot; Lora&apos;s Laser in 1982...</summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[<p>In the origina <a href="http://www.imdb.com/title/tt0084827/">TRON (1982)</a> movie, minutes before Kevin Flynn entered the digital world for the first time, Lora mentioned something about her work:<br />
Lora: "Remember, this laser is my life's work, so don't spill anything."<br />
<a href="http://www.andyhuang.net/blog/assets_c/2010/12/Tron-Old-Laser-71.html" onclick="window.open('http://www.andyhuang.net/blog/assets_c/2010/12/Tron-Old-Laser-71.html','popup','width=640,height=288,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.andyhuang.net/blog/assets_c/2010/12/Tron-Old-Laser-thumb-100x45-71.png" width="100" height="45" alt="Tron-Old-Laser.png" class="mt-image-none" style="" /></a><br />
<span style="font-size:small">Lora's Laser in 1982</span></p>

<p>Fast forward a little, towards the end of the original movie, as well as at the beginning of <a href="http://www.imdb.com/title/tt1104001/">TRON Legacy (2010)</a>, Kevin Flynn is portrayed as the owner of Encom. Over these last few years, Lora is most probably still working on the same technology. We are also able to catch a glimpse of the laser in a newer state in the new movie.<br />
<a href="http://www.andyhuang.net/blog/assets_c/2010/12/Tron-New-Laser-74.html" onclick="window.open('http://www.andyhuang.net/blog/assets_c/2010/12/Tron-New-Laser-74.html','popup','width=1279,height=552,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.andyhuang.net/blog/assets_c/2010/12/Tron-New-Laser-thumb-100x43-74.png" width="100" height="43" alt="Tron-New-Laser.png" class="mt-image-none" style="" /></a><br />
<span style="font-size:small">Lora's Laser in 2010</span></p>

<p>Since Flynn was in control of the company, and he is good friends with her, there is no reason she would have stopped working on her laser. It is also a very useful piece of technology -- imagine in directions of teleportation (scan in at one location, scan out at the destination location) or infinite storage (scan in large objects into disk storage to save physical space). So why haven't anything come from this technology? Additionally, Lora was also not mentioned or shown in the new movie. What exactly happened to her, and her work? I hope this will be answered in the bonus features section of DVD!</p>]]>
        
    </content>
</entry>

<entry>
    <title>Optimizing SmartOptimizer</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2010/10/optimizing-smartoptimizer.html" />
    <id>tag:www.andyhuang.net,2010:/blog//12.464</id>

    <published>2010-10-07T22:27:23Z</published>
    <updated>2011-10-11T02:48:36Z</updated>

    <summary>Sorry, couldn&apos;t wait until 1 year anniversary of last post... I&apos;ve been poking around with optimizing my sites&apos; performance over the last few days, and found a real nice tool called SmartOptimizer. SmartOptimizer is acts as a middle-ware between your...</summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
        <category term="PHP" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="optimization" label="Optimization" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="php" label="PHP" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[<p>Sorry, couldn't wait until 1 year anniversary of last post...</p>
<p>I've been poking around with optimizing my sites' performance over the last few days, and found a real nice tool called <a href="http://farhadi.ir/works/smartoptimizer">SmartOptimizer</a>. SmartOptimizer is acts as a middle-ware between your data and your webserver. When a request is made, .htaccess will pick up, and forward specific file(s) to the optimizer, particularly, images, css, and static HTMLs. This is useful because the optimizer can then compress them using gzip, cache the compressed file, add some http header information to help caching, and serve the compressed optimized file. However, using GTmetrix, I found out that some things are missing, so I decided to add some fixes.</p>

<p>GTmetrix suggested static content should send "Vary: Accept-Encoding" http header, because some public proxies will not cache things properly. And I've found the most effective way to add this is to add the said header in index.php like so:</p>
<p>Find in index.php:</p>
<div class="code_container">
  <div class="code_header">PHP Code</div>
  <div class="code_body"><pre>header("Last-Modified: " . $mtimestr);
header("Cache-Control: must-revalidate");</pre></div>
</div>

<p>And replace with:</p>
<div class="code_container">
  <div class="code_header">PHP Code</div>
  <div class="code_body"><pre>header("Last-Modified: " . $mtimestr);
header("Vary: Accept-Encoding");
header("Cache-Control: must-revalidate");
</pre></div>
</div>

<p>Another recommendation made was that some files did not had a far enough future expire date. As such, I've modified my index.php to output a further expiry date for most documents. This is not required, and may cause funny caching if your static HTMLs are updated frequently. But, if you want to change it, you may do so like this:</p>
<p>Find in index.php:</p>
<div class="code_container">
  <div class="code_header">PHP Code</div>
  <div class="code_body"><pre>if (!$settings['clientCache'] || !$settings['clientCacheCheck'] || !isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || $_SERVER['HTTP_IF_MODIFIED_SINCE'] != $mtimestr) {</pre></div>
</div>

<p>Add before it:</p>
<div class="code_container">
  <div class="code_header">PHP Code</div>
  <div class="code_body"><pre>// 1 year far future expire time:
$now = time();
$mtexpirestr = gmstrftime("%a, %d %b %Y %H:%M:%S GMT", $now + 31550600);</pre></div>
</div>

<p>Then, find:</p>
<div class="code_container">
  <div class="code_header">PHP Code</div>
  <div class="code_body"><pre>header("Last-Modified: " . $mtimestr);
header("Cache-Control: must-revalidate");</pre></div>
</div>
<p><i>*may be different if you did the previous modification.</i></p>
<p>Replace with:</p>
<div class="code_container">
  <div class="code_header">PHP Code</div>
  <div class="code_body"><pre>header("Last-Modified: " . $mtimestr);
header("Expires: " . $mtexpirestr);
header("Cache-Control: must-revalidate");</pre></div>
</div>

<p>And that should be it... You get a little bit more caching done on client's end, which hopefully in turn will save you some bandwidth, as well as offer your visitors a snappier browsing experience. Hope this helped!</p>]]>
        
    </content>
</entry>

<entry>
    <title>Posting to blog from Windows 7</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2009/10/posting-to-blog-from-windows-7.html" />
    <id>tag:www.andyhuang.net,2009:/blog//12.463</id>

    <published>2009-10-26T04:25:05Z</published>
    <updated>2011-10-11T02:48:36Z</updated>

    <summary>This is just a test to post something to blog from Windows 7.&#160; Let’s see how butchered Microsoft’s Windows Live Writer will make this post be…&#160; If the image is in wrong directory etc., I’ll have to edit / remove...</summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[<p>This is just a test to post something to blog from Windows 7.&#160; Let’s see how butchered Microsoft’s Windows Live Writer will make this post be…&#160; If the image is in wrong directory etc., I’ll have to edit / remove them later..</p>  <p>&#160;</p>  <p><a href="http://www.andyhuang.net/blog/WindowsLiveWriter/PostingtoblogfromWindows7_12D22/Windows7.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Windows7" border="0" alt="Windows7" src="http://www.andyhuang.net/blog/WindowsLiveWriter/PostingtoblogfromWindows7_12D22/Windows7_thumb.png" width="244" height="235" /></a></p>  <p>&#160;</p>  <p>Ah well, not too bad, I’m lazy, this will stay for now.</p>]]>
        
    </content>
</entry>

<entry>
    <title>My Snow Leopard Upgrade Experience, and General Impressions</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2009/08/my-snow-leopard-upgrade-experi.html" />
    <id>tag:www.andyhuang.net,2009:/blog//12.462</id>

    <published>2009-08-31T22:30:26Z</published>
    <updated>2011-10-11T02:48:36Z</updated>

    <summary><![CDATA[Snow Leopard came in the mail today (finally).&nbsp;Thank you Apple, for killing a small tree to deliver me one DVD. Using a box large enough to house at least 16 retail packages to ship 1 single disc to an end...]]></summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
        <category term="Apple" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Memo" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="OSX" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="1password" label="1Password" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="apple" label="Apple" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mailapp" label="Mail.app" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="osx" label="OSX" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="quicksilver" label="Quicksilver" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="snowleopard" label="Snow Leopard" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="soundflower" label="Soundflower" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="spaces" label="Spaces" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="systempreferences" label="System Preferences" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="upgrade" label="Upgrade" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="wiretapstudio" label="WireTap Studio" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[Snow Leopard came in the mail today (finally).&nbsp;Thank you Apple, for killing a small tree to deliver me one DVD. Using a box large enough to house at least 16 retail packages to ship 1 single disc to an end line consumer is definitely the right choice!! Seriously, if I'm paying you $40 for the rights to kill a tree, I better be the one doing the killing, not you!<div><br /></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.andyhuang.net/blog/assets_c/2009/08/IMG_0101-34.html" onclick="http://www.andyhuang.net/blog/assets_c/2009/08/IMG_0101-34.html','popup','width=1600,height=1200,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.andyhuang.net/blog/assets_c/2009/08/IMG_0101-thumb-100x75-34.jpg" alt="IMG_0101.JPG" class="mt-image-none" style="" height="75" width="100" /></a><a href="http://andy.hwang.tw/assets_c/2009/08/IMG_0102-35.html" onclick="window.open('http://andy.hwang.tw/assets_c/2009/08/IMG_0102-35.html','popup','width=1600,height=1200,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://andy.hwang.tw/assets_c/2009/08/IMG_0102-thumb-100x75-35.jpg" alt="IMG_0102.JPG" class="mt-image-none" style="" height="75" width="100" /></a><a href="http://andy.hwang.tw/assets_c/2009/08/IMG_0103-36.html" onclick="window.open('http://andy.hwang.tw/assets_c/2009/08/IMG_0103-36.html','popup','width=1600,height=1200,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://andy.hwang.tw/assets_c/2009/08/IMG_0103-thumb-100x75-36.jpg" alt="IMG_0103.JPG" class="mt-image-none" style="" height="75" width="100" /></a></span></div><div><br /></div><div>The upgrade took just about 1 hour from inserting disc to the green check mark with "Install Succeeded" text... &nbsp;Maybe they could've done it faster, I don't know. But what's important is I am now on Snow Leopard.</div><div><br /></div><div>The upgrade was, unfortunately, not quirk free. &nbsp;Read on for a few problems that I encountered and how I fixed them.</div><div><br /></div>]]>
        <![CDATA[One of the very first things I noticed is that my "Tap To Click" no longer works... This was an easy fix though. &nbsp;System Preferences &gt; Trackpad, and enable it. &nbsp;But, in the process of attempting to launch System Preferences, I noticed that my Quicksilver no longer works.<div><br /></div><div>Quicksilver required not only an upgrade, but also removal of a few plugins. &nbsp;The plugins I had to remove are:</div><div><ul><li>AirPort Module</li><li>File Tagging Module</li><li>Services Menu Module</li></ul><div>They can be yanked from ~/Library/Application Support/Quicksilver/PlugIns/</div><div><br /></div><div>Slightly annoyed with Quicksilver not working, I had many many many safari windows open to help me search for a solution. &nbsp;And this is when I really started to dig the new expose. &nbsp;The new expose have two things I really enjoy: Application specific expose, allowing you to show all windows of one application, and the nice little blue glow that tells you which one you're highlighting. &nbsp;This enables me to have a much better work flow than the older version.</div><div><br /></div><div>After Quicksilver was fixed, I wanted to listen to some music. &nbsp;It appears that my USB DAC is some how choppy if I plug it in directly w/o sound flower. &nbsp;I do not yet know why, and will need to check it out again. &nbsp;So I tried to launch sound flower, only to find that sound flower was not installed. Attempting to install also gave me some kext error. &nbsp;It was a short lasted problem though, there is a fixed 3rd party package available, google for Snow Leopard Sound flower and you'll be on your way. &nbsp;DAC sounds great after that.</div><div><br /></div><div>I started chatting with some friends, and got quite a pleasant surprise when I tried to change language. &nbsp;The new international (input manager / kotoeri) have a "command + tab" like interface for selecting the language. &nbsp;Very nice, no longer need to stare at menu bar for the tiny icon to change to the right language I want... &nbsp;If you're wondering I work with Romaji (English), Hiragana, Katakana, Pinyin - Chinese Traditional, and Pinyin - Chinese Simplified, so this really helps.</div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://andy.hwang.tw/assets_c/2009/08/Screen shot 2009-08-31 at 16.26.58-43.html" onclick="window.open('http://andy.hwang.tw/assets_c/2009/08/Screen shot 2009-08-31 at 16.26.58-43.html','popup','width=288,height=395,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://andy.hwang.tw/assets_c/2009/08/Screen shot 2009-08-31 at 16.26.58-thumb-100x137-43.png" width="100" height="137" alt="Screen shot 2009-08-31 at 16.26.58.png" class="mt-image-none" style="" /></a></span></div><div><br /></div><div>Other things that doesn't really work for me...</div><div><ul><li>Menu Meters -- Dev says will fix soon</li><li>Insomniax -- Not sure when it will be fixed</li><li>Several apps thinks it is downloaded from the web and need me to approve again, not really a problem, just a pest...</li><li>WireTap Studio required re-activation, that isn't an issue, but when it did re-activate, I lost my recording library... haven't dug the file system to see if the files are actually lost yet though.</li><li>1Password 3 Beta doesn't really work for popup passwords (IE: .htaccess + .htpasswd sets) for me yet... not sure why, but since its beta, its only as expected...</li><li>1Gb = 1024Mb, 1Mb = 1024Kb, 1Kb = 1024b, not 1000. Apple, PLEASE don't be lame and count like harddrive manufactures!!??</li><li>Snow Leopard seems to make the system warmer in general. &nbsp;I'm coasting at 60℃ to 64℃ as opposed to the usual 45℃ to 50℃...</li></ul><div><br /></div><div>Other things that I like but not sure if its new or not...</div><div><ul><li>Spaces changing icon on screen (the one with white box traveling to the space you're going to) seems to look a bit prettier than before?</li><li>System Preference's spotlight some how magically fixed itself (I lost the highlight last week and can't get it back for whatever reason).</li><li>Mail.app's db upgrade was ridiculously quick, even for a 6gb db like my.</li><li>Spaces / Expose's edge of screen feature (throw your mouse to edge of screen to activate feature) no longer have ugly hit zone.</li></ul></div></div></div>]]>
    </content>
</entry>

<entry>
    <title>URL Shortener and Base 62 Encoder / Decoder</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2009/08/url-shortener-and-base-62-enco.html" />
    <id>tag:www.andyhuang.net,2009:/blog//12.461</id>

    <published>2009-08-05T23:43:03Z</published>
    <updated>2011-10-11T02:48:36Z</updated>

    <summary><![CDATA[I'm creating yet another URL shortener script. &nbsp;Why? &nbsp;Because I'm not keen on over paying for simple scripts -- because, well, I'd be over paying -- and I'm not too keen on using open source scripts -- because the more...]]></summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
        <category term="Memo" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Misc." scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PHP" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Projects" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="base62" label="Base62" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="bcmath" label="BCMath" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="class" label="Class" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="largeinteger" label="Large Integer" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="math" label="Math" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="php" label="PHP" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="unitconversion" label="Unit Conversion" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[I'm creating yet another URL shortener script. &nbsp;Why? &nbsp;Because I'm not keen on over paying for simple scripts -- because, well, I'd be over paying -- and I'm not too keen on using open source scripts -- because the more people using the same script, the more likely people will find exploits in it. &nbsp;So with all that in mind, I set out to create my own script.]]>
        <![CDATA[<div>
<p>One of the main components of URL shortener script is the base 62 encoder / decoder.  Base 62 is just another way of counting, which allows us to pack more numbers into a shorter string.  In base 10, we count: 1,2,3,...,9,10,11, etc. That's good, everyone knows how to count that, but the down side is, it's not very short.  If we do URL shorteners like that, pretty soon, we'll have long URLs because 5 digits will only encompass 99999 links, etc. You might say, hey, 99999 links isn't too bad, but I say why end there?  In base 62, we count like this: 1,2,3,...7,8,9,A,B,C,...,X,Y,Z,a,b,c,...x,y,z,10,11,12, etc.  Notice by the time we got to "10", we're already at 63?  Now, with the same 5 digits, we're looking at 62^5 instead of 10^5 links.</p>

<p>Computers generally don't know how in fancy bases unless you teach it to do so, and teaching MySQL to count like that is way over my head -- hey, cut me some slacks, I'm a PHP guru, not a MySQL guru -- so I'm letting MySQL count in its native auto increment on an unsigned integer. With that, I also get a fancy pool of numbers to work with... Unsigned BIGINT in MySQL goes up to 18446744073709551615 to be exact.  That's eighteen quintillion, four hundred and forty six quadrillion, seven hundred and seventy four trillion, seventy three billion, seven hundred and nine million, five hundred and fifty one thousand, and six hundred and fifteen.  Or in short: quite-a-mouth-full (see, wasn't that easier?).</p>

<p>Now, we obviously don't expect to house that much links in the URL shortener database, but its always fun for a small challenge.  PHP can't count that much in integers (default int size is 4 bytes, and we'd need around 8 to 9 bytes to match that), and floats aren't that accurate when we're doing math (decimal precision issues), so we'll obviously need something better.</p>

<p>In comes BCMath Arbitrary Precision Mathematics.  BCMath allows us to work with arbitrary large numbers with arbitrary precision through some nifty <span class="del">black magic</span> API function calls. So anyways, after a few minutes of tinkering and editing, I present you a quick and simple base62 class for you to use in your application!</p>

<div class="code_container">
<div class="code_header">PHP Code</div>
<div class="code_body">
<pre>&lt;?php
/**
 * Base 62 Encoder / Decoder Class
 * (c) Andy Huang, 2009; All rights reserved
 *
 * This code is not distributed under any specific license, 
 * as I do not believe in them, but it is distributed under
 * these terms outlined below:
 * - You may use these code as part of your application, even if it is a commercial product
 * - You may modify these code to suite your application, even if it is a commercial product
 * - You may sell your commercial product derived from these code
 * - You may donate to me if you are some how able to get a hold of me, but that's not required
 * - You may link back to the original article for reference, but do not hotlink the source file
  * - This line is intentionally added to differentiate from LGPL, or other similar licensing terms
 * - You must at all time retain this copyright message and terms in your code
 */
class base62 
{
	static $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
	static $base = 62;

	public function encode($var) 
	{
		$stack = array();
		while (bccomp($var, 0) != 0)
		{
			$remainder = bcmod($var, self::$base);
			$var = bcdiv( bcsub($var, $remainder), self::$base );
	
			array_push($stack, self::$characters[$remainder]);
		}
	
		return implode('', array_reverse($stack));
	}
	
	public function decode($var) 
	{
		$length = strlen($var);
		$result = 0;
		for($i=0; $i&lt;$length; $i++) 
		{
			$result = bcadd($result, bcmul(self::get_digit($var[$i]), bcpow(self::$base, ($length-($i+1)))));
		}
	
		return $result;
	}
	
	private function get_digit($var) 
	{
		if(ereg('[0-9]', $var))
		{
			return (int)(ord($var) - ord('0'));
		}
		else if(ereg('[A-Z]', $var))
		{
			return (int)(ord($var) - ord('A') + 10);
		}
		else if(ereg('[a-z]', $var))
		{
			return (int)(ord($var) - ord('a') + 36);
		}
		else
		{
			return $var;
		}
	}
}</pre>
</div>
</div>
<p>If copy &amp; paste isn't your thing, you can download the file directly: <span class="mt-enclosure mt-enclosure-file" style="display: inline;"><a href="http://www.andyhuang.net/blog/assets/class_base62.phps">class_base62.phps</a></span>.</p>

<p>Since it is a static class, you can invoke it directly without having to instantiate it.  Simply do this:
<div class="code_container">
<div class="code_header">PHP Code</div>
<div class="code_body">
<pre>
require_once("class_base62.php");
base62::encode("100"); // returns "1c";
base62::decode("LygHa16AHYF"); // returns "18446744073709551615";</pre>
</div>
</div>

<p>Happy coding! But please do let me know if you encounter any problems with the script, so I can fix it!</p>
</div>]]>
    </content>
</entry>

<entry>
    <title>Unlock iPhone OS 3.0 With Push Support and no Rapid Battery Drain</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2009/07/unlock-iphone-os-30-with-push.html" />
    <id>tag:www.andyhuang.net,2009:/blog//12.460</id>

    <published>2009-07-21T10:23:42Z</published>
    <updated>2011-10-11T02:48:35Z</updated>

    <summary><![CDATA[With the 3.0 iPhone OS, new baseband, and everything, there are several problems floating about. &nbsp;First, there are a large handful of users plagued by the rapid battery drain problem. &nbsp;How do you know if you have this problem? &nbsp;Well,...]]></summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
        <category term="Apple" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Memo" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="iPhone 3G" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="apple" label="Apple" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="iphone" label="iPhone" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="iphone3g" label="iPhone 3G" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="jailbreak" label="Jailbreak" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="pushnotification" label="push notification" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="unlock" label="Unlock" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[<div>With the 3.0 iPhone OS, new baseband, and everything, there are several problems floating about. &nbsp;First, there are a large handful of users plagued by the rapid battery drain problem. &nbsp;How do you know if you have this problem? &nbsp;Well, its quite simple actually. &nbsp;Before upgrading to 3.0, your battery is good for 12 hours, 8 hours, whatever. &nbsp;After upgrading to 3.0, it discharges even if you have the phone plugged in, and you're generally looking at no more than 3 hours idle time. &nbsp;Second, if you hacktivate your iPhone, you don't get youtube and you don't get push notifications.</div><div><br /></div><div>I've found that the battery depletion problem is usually to do with activating using an official SIM, and then hacktivating the device, because apparently it leaves some messed up APN settings on the phone. &nbsp;As for the push notifications, hacktivating it directly is not going to work because you're not going to get the certificates required for push notification.</div><div><br /></div><div>Luckily for me, having an official SIM card and a third party SIM card means I can have the best of both worlds, and not have to worry about either problems. &nbsp;Unfortunately, though, it does mean restoring the phone is a bit more time consuming.</div><div><br /></div><div>Now, I must note that this is a memo for myself, and nothing but. Don't complain if you do not have an official SIM card so you cannot get it to work. Don't ask me for my certificates, because I don't want to share my pushed email messages and risk getting banned. &nbsp;With that said, let's start.</div>]]>
        <![CDATA[<h5>Getting the certificates</h5><div>This part is actually easy and straight forward...</div><div><ol><li>Eject your unofficial SIM</li><li>Insert your official SIM</li><li>Restore using standard 3.0 ipsw through iTunes &lt;-- Very important, we don't want 3.0.1 or 3.1 or etc. because those will have different baseband which could permanently lock your devices</li><li>Activate your device over iTunes</li><li>Quit iTunes completely</li><li>Jailbreak the device using redsn0w, it doesn't really matter if you install Cydia or Icy, you will need one of them, but this restore is going out the window later so just choose whatever</li><li>Use PhoneView, or other tool to drop nimble from dev-team's push fix package to /private/var/Keychains/</li><li>Install MobileTerminal or OpenSSH so you can have access to your device</li><li>Install at least one application which uses push notification via AppStore, I used Beejive IM, but you can use IM+ or whatever</li><li>Launch the application, enable push notification</li><li>Launch MobileTerminal or SSH into your device (No, close Cyberduck or CuteFTP or whatever, SSH, not SFTP)</li><li>Change nimble to 777 permission, su up, execute nimble as root</li><li>Copy the 4 output files (<span class="Apple-style-span" style="font-family: 'Lucida Grande', helvetica, hirakakupro-w3, osaka, 'ms pgothic', sans-serif; font-size: 12px; ">push-cert.bin, push-key.bin, youtube-cert.bin, youtube-key.bin; no, you're not getting them from me) to your machine.</span></li></ol><div><font class="Apple-style-span" face="'Lucida Grande', helvetica, hirakakupro-w3, osaka, 'ms pgothic', sans-serif" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br /></span></font></div></div>

<h5>Unlocking for other provider</h5>This next part is the tricky part...<div><ol><li>Eject your official SIM</li><li>Insert your unofficial SIM (you can put away your official SIM for safe keeps now)</li><li>Restore using standard 3.0 (again, I can't stress enough, not any other version or you may lose your unlock permanently!)</li><li>Jailbreak using redsn0w, install the package manager of your choice -- I'm biased because I appear on Cydia's thank you page, so I go with Cydia.</li><li>Setup your iPhone as a <b>new iPhone</b> when iTunes ask you, do <b>NOT</b>&nbsp;use one of the backups. &nbsp;If you use a backup you will face the rapid battery depletion problem!</li><li>PhoneView (or other tools) to drop the four files to /private/var/Keychains/</li><li>PhoneView (or other tools) to drop nimble and inject to /private/var/Keychains/</li><li>PhoneView (or other tools) to DELETE keychain-2.db from /private/var/Keychains/</li><li>Install MobileTerminal / OpenSSH from package manager</li><li>Launch MobileTerminal or SSH into your device</li><li>Go to /private/var/Keychains/ and chmod 777 both nimble and inject</li><li>Su up, and execute inject</li><li>Reboot your device (IE: Power button until you see red slider, slide it, wait for apple icon to go away, power button again)</li><li>Sync your data, install your push notification app (if you installed it before this step, push will not work. &nbsp;Restart from step 3 again)</li><li>Go back to package manager, add repo666.ultrasn0w.com and install ultrasn0w (so you can use your unofficial carrier)</li><li>Launch youtube app, you would probably be asked for your WiFi password, enter it, and verify that it works -- if not, go back to step 6 and repeat.</li><li>Launch your push notification app, and verify that it works -- if not, go back to step 6 and repeat.</li><li>Setup your Exchange/MobileMe account (if you've set it up before this step, push may not work. &nbsp;Restart from step 3 again).</li></ol><div><br /></div><div>That should do the trick for you. &nbsp;Please post comments to let me know if this works or doesn't work for you so we can refine these steps together!</div></div>]]>
    </content>
</entry>

<entry>
    <title>Sideways Hacking Time Machine to Work with SMB (Windows) and Potentially Other Shares</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2009/06/sideways-hacking-time-machine.html" />
    <id>tag:www.andyhuang.net,2009:/blog//12.459</id>

    <published>2009-06-19T05:50:19Z</published>
    <updated>2011-10-11T02:48:35Z</updated>

    <summary> I have a NAS with four 400GB harddrives running a RAID 5 installation, which means I won&apos;t lose data on there unless two of the drives go bad. It&apos;s done through my TS-409 (shown to the right). Since I...</summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
        <category term="Apple" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Memo" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="OSX" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="apple" label="Apple" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="backup" label="Backup" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="networkdrive" label="Network Drive" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="osx" label="OSX" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="samba" label="Samba" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="smb" label="SMB" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="timemachine" label="Time Machine" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="windows" label="Windows" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[<div>
<div style="float:right">
<iframe src="http://rcm.amazon.com/e/cm?t=andhua-20&amp;o=1&amp;p=8&amp;l=as1&amp;asins=B00138UKE4&amp;md=10FE9736YVPPT7A0FBG2&amp;fc1=000000&amp;IS1=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=FFFFFF&amp;bg1=FFFFFF&amp;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
<p>I have a NAS with four 400GB harddrives running a RAID 5 installation, which means I won't lose data on there unless two of the drives go bad.  It's done through my TS-409 (shown to the right). Since I have all these space, I might as well use it to backup my MacBook regularly so I don't lose any of my important data. OS X users know, Time Machine is awesome.  It helps you take hourly, daily, and weekly snapshots of your computer.  But unfortunately, it only works with additional harddrives attached to the machine, OR Time Capsule on your network... right?  Wrong.  Today, we will sideways hack Time Machine, and make it work with your SMB (Windows) share folder.</p>
<p>Before you get started, counter intuitive as it may seem, please be sure to have your data backed up before proceeding.  While the memo is written with the best of intentions to help people make backups, I will not be responsible for any data loss as result of you following through this memo of my.  You have been warned.</p>
</div>]]>
        <![CDATA[<div>
<p>Now then, let's move on.</p>
<p>If you head straight over to System Preferences -> Time Machine, you will notice that it does not allow you to select your SMB based share.  This is probably because Apple wants you to buy Time Capsule / external hard drives, or it could be because hdiutil doesn't work too well with SMB based share.  Either ways, we'll hack it to work with our SMB share.</p>
<p>First, head over to the terminal; typically Applications -> Utilities -> Terminal, or if you're like me, QuickSilver -> iTerm.  Once you have your terminal launched, issue this command:</p>
<div class="code_container">
<div class="code_header">Terminal Command</div>
<div class="code_body">defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1</div></div>
<p>It's pretty long, and it might've gotten squeeshed here, but that's all in one line.  What that does is that it modifies a hidden configuration setting set by Apple, for the System Preferences application, to get Time Machine to show unsupported network drives.  Guess what's unsupported?  Yep, you guessed it, SMB / Windows share drives.  Now that if you have it enabled, you will see your drive as an option to back up to... but you're not done yet!  As this alone will not work -- remember what I said about hdiutils?</p>
<p>The next step gets a little bit more complicated, so please read carefully and look at the screenshots I am attaching.  What you'd need to do now is figure out what is your ethernet's MAC address.  Go back to your terminal (if you've left it already) and enter this command:</p>
<div class="code_container">
<div class="code_header">Terminal Command</div>
<div class="code_body">ifconfig en0 | grep ether</div>
</div>
<p>You should get something like this as result:</p>
<div class="code_container">
<div class="code_header">Terminal Result</div>
<div class="code_body">chiisana-osx:~ Andy$ ifconfig en0 | grep ether<br />
        ether 00:23:df:90:5f:e8</div>
</div>
<p>Copy down the series of hexadecimal numbers without the colons; in my example, it would be: "0023df905fe8".  You will need this number later, so don't lose it.</p>
<p>Next, head over to System Preferences -> Sharing, and look near your computer name.  While your computer name can be anything (I, for example, have it in Japanese), the identifier on networks MUST BE alphanumeric, and some basic symbols.  This is typically deduced from your computer name's ascii parts.  Take a look at this screenshot:</p>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.andyhuang.net/blog/assets/2009_06_18_machine_name.png"><img alt="2009_06_18_machine_name.png" src="http://www.andyhuang.net/blog/assets_c/2009/06/2009_06_18_machine_name-thumb-200x77-31.png" width="200" height="77" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></a></span>
<p>Notice my says "chiisana-osx.local"?  You want to note down the part before .local.  So for my example, it'd be "chiisana-osx".  Write yours down, and don't lose it, you'll need this later too.</p>
<p>Finally, ask yourself the question: "How big is my harddrive?" If you don't know this information, go to your desktop, select "Macintosh HD", and click "Command + I".  In the new window, it should tell you your harddrive's capacity.  Note down that number, and give or take double it, because you'll need some extra space to keep historical copies in the Time Machine.  Now we have all the information we'd need.</p>
<p>Go to System Preferences -> Time Machine, and setup your Time Machine on your desired network drive.  Please keep in mind that Time Machine will create the backup file at the root of that network share, so if you want it in a specific folder, make sure you adjust your share accordingly before mounting.  It should get started creating the backup... but after a while, it will fail (oh no!)... because hdiutil doesn't really work with SMB shares.  Now what?  Now we create our own backup file...  Your backup file should be named machine identifier, underscore, MAC address, dot, sparsebundle.  In my example, it would be "chiisana-osx_0023df905fe8.sparsebundle", make sure you make your own backup file name correctly, or Time Machine will not work.  Once you have your backup file name constructed, go back to the terminal and issue this command:</p>
<div class="code_container">
<div class="code_header">Terminal Command</div>
<div class="code_body">cd<br />
hdiutil create -size xxxg -fs HFS+J -volname "My Time Machine Backup" yyyyyyyy_zzzzzzzz.sparsebundle</div></div>
<p>Replace xxxg with numbers of GB you would like to allocate for backup; IE: 200g for 200GB, 300g for 300GB, 1T for 1TB, etc.</p>
<p>Replace yyyyyyyy_zzzzzzzz.sparesbundle with your backup file name; IE: chiisana-osx_0023df905fe8.sparsebundle</p>
<p>The first line, cd, will set you to your home directory, regardless of where you are.  The second line will create the backup sparsebundle for you.  In my case, the 200G sparse bundle worked out to be around 115M, but your sizes may vary.  Once you have this file, move it to your SMB share, and set your Time Machine to backup again. This time, Time Machine will magically work! But because you're copying your entire harddrive's contents (in my case, upwards to 100GB), the first time making the backup will take some time...  After it is done once, it will be much more snappy in the future.  Happy time traveling!</p>
</div>]]>
    </content>
</entry>

<entry>
    <title>Fiio E5 Review</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2009/06/fiio-e5.html" />
    <id>tag:www.andyhuang.net,2009:/blog//12.458</id>

    <published>2009-06-10T22:55:36Z</published>
    <updated>2011-10-11T02:48:35Z</updated>

    <summary><![CDATA[Well, those that follows me on twitter knows, my net died on me earlier.&nbsp; And to make the best of the situation, I decided to go bowling: Well, no, that wasn't fun actually.&nbsp; What's more fun is, I picked up...]]></summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
        <category term="Audiophile" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Personal" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="audiophile" label="Audiophile" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="pocketamp" label="Pocket Amp" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[Well, those that follows me on twitter knows, <a href="http://twitter.com/AndyHuang/status/2105121501">my net died on me earlier</a>.&nbsp; And to make the best of the situation, I decided to go bowling:<br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.andyhuang.net/blog/assets/2009_06_10_001.jpg"><img alt="2009_06_10_001.jpg" src="http://www.andyhuang.net/blog/assets_c/2009/06/2009_06_10_001-thumb-200x136-15.jpg" class="mt-image-center" style="margin: 0pt auto 20px; text-align: center; display: block;" height="136" width="200" /></a></span><br /> <div>Well, no, that wasn't fun actually.&nbsp; What's more fun is, I picked up my <a href="http://www.fiio.com.cn/en/showproduct.asp?id=309">Fiio E5</a> from the post office today!&nbsp; The postal system did a good job on damaging the package, but thanks to my crappy iPhone's auto-no-focus camera, I won't be able to show that...<br /><br /><a href="http://andy.hwang.tw/assets/2009_06_10_002.jpg"><img alt="2009_06_10_002.jpg" src="http://andy.hwang.tw/assets_c/2009/06/2009_06_10_002-thumb-200x275-16.jpg" class="mt-image-none" style="" height="275" width="200" /></a><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.andyhuang.net/blog/assets/2009_06_10_003.jpg"><img alt="2009_06_10_003.jpg" src="http://www.andyhuang.net/blog/assets_c/2009/06/2009_06_10_003-thumb-200x200-17.jpg" class="mt-image-none" style="" height="200" width="200" /></a></span><br /><br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.andyhuang.net/blog/assets/2009_06_10_005.jpg"><img alt="2009_06_10_005.jpg" src="http://www.andyhuang.net/blog/assets_c/2009/06/2009_06_10_005-thumb-200x238-19.jpg" class="mt-image-none" style="" height="238" width="200" /></a></span><a href="http://andy.hwang.tw/assets/2009_06_10_006.jpg"><img alt="2009_06_10_006.jpg" src="http://andy.hwang.tw/assets_c/2009/06/2009_06_10_006-thumb-200x226-20.jpg" class="mt-image-none" style="" height="226" width="200" /></a><br /><br />To be honest, aside from the out-dated iPod Shuffle look alike, the controls made it looks (and feels) kind of cheap:<br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.andyhuang.net/blog/assets/2009_06_10_008.jpg"><img alt="2009_06_10_008.jpg" src="http://www.andyhuang.net/blog/assets_c/2009/06/2009_06_10_008-thumb-200x85-22.jpg" class="mt-image-none" style="" height="85" width="200" /></a></span><br /><br />Oh well, I can live with that I guess.&nbsp; Let's try to plug it into my Audio Technica A700 and see how it sounds...<br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><a href="http://www.andyhuang.net/blog/assets/2009_06_10_010.jpg"><img alt="2009_06_10_010.jpg" src="http://www.andyhuang.net/blog/assets_c/2009/06/2009_06_10_010-thumb-200x266-29.jpg" class="mt-image-none" style="" height="266" width="200" /></a></span><br /></div><div><br />Because the E5 is intended to be a pocket amp, my guess is that its target earphones aren't usually too good with bass.&nbsp; The frequency range it supports is 10Hz to a ridiculous 100KHz.&nbsp; But my A700 does 5Hz to 35KHz, so I guess I'm going to be missing out some bass... oh well, not like I can hear those 5Hz anyways (I might feel it, but that's for another discussion)...<br /><br />Preliminary testing gives good impression on the iPhone, because it did as promised, improve the output quality, and sound volume.&nbsp; I can hear the layering of different instruments and sounds a bit better than without it, which is definetly a plus.&nbsp; But on the other hand, I'd still need to put the phone's output volume to be pretty high to hear the quality, so it is by no means going to help save battery.<br /><br />Next up, MacBook.&nbsp; When it gets plugged into my MacBook, unfortunaetly, it didn't sound so great...&nbsp; I got the feeling of literally plugging something in between my earphone and my laptop, which acts as nothing more than an external volume control...&nbsp; There might even be a little bit of distortion to the higher sound spectrum (16 to 18KHz range, beyond that I can't really hear, but only feel, so I can't really judge it)...&nbsp; and the sound layering feel isn't as obvious as well... that's probably because the MacBook already gives a pretty decent sound output. Oh well, you get what you paid for...<br /><br />In general, I did noticed that the sound seems to be muddled a bit... that is to say, I wasn't able to tell the exact direction of the instruments anymore.&nbsp; Also, I noticed that the "Bass boost" switch is best remained off.&nbsp; When the bass boost is enabled, the entire sound sounds like it is being covered under something.&nbsp; Not my kind of preference, maybe it'll float some other people's boat better.&nbsp; <br /><br />All in all, I think it's a good buy.&nbsp; For pocket amps, anything under $100 USD is probably as good as a fancy toy with volume control... and this one is only $17.&nbsp; So its ability to make my iPhone sound better is good enough.&nbsp; I don't foresee myself whipping out my MacBook to plug E5 and A700 in, but I do foresee myself keeping it plugged to my iPhone.<br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>Not just an iPod anymore</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2009/05/not-just-an-ipod-anymore.html" />
    <id>tag:www.andyhuang.net,2009:/blog//12.457</id>

    <published>2009-05-31T02:24:26Z</published>
    <updated>2011-10-11T02:48:35Z</updated>

    <summary>Those that may remember my other post a while back, where my iPhone had no modem usage, will probably be glad to see that my iPhone is no longer just an iPod with phone anymore... Finally gotten around to get...</summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[Those that may remember my other post a while back, where my iPhone had no modem usage, will probably be glad to see that my iPhone is no longer just an iPod with phone anymore...

<br /><br /><center><a href='http://blogpress.w18.net/photos/09/05/30/392.jpg'><img src='http://blogpress.w18.net/photos/09/05/30/s_392.jpg' border='0' width='187' height='281' style='margin:5px'></a></center><br /> 
Finally gotten around to get it a data plan... And from the looks of it, my 500mb/mn isn't quite enough!!

-- Post From My iPhone<br />]]>
        
    </content>
</entry>

<entry>
    <title>Google Gears, Fluid, RTM, and Greasemonkey</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2009/02/google-gears-fluid-rtm-and-gre.html" />
    <id>tag:www.andyhuang.net,2009:/blog//12.456</id>

    <published>2009-02-20T10:33:27Z</published>
    <updated>2011-10-11T02:48:35Z</updated>

    <summary><![CDATA[I started using RTM a while ago, and it works great.&nbsp; It helps me keep all my to-dos together in one place, and allows me to set different deadlines so I don't forget them. But the problem is, there is...]]></summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
        <category term="Apple" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Memo" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="OSX" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="fluid" label="Fluid" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="googlegears" label="Google Gears" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="greasemonkey" label="Greasemonkey" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="osx" label="OSX" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="rtm" label="RTM" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[I started using <a href="http://www.rememberthemilk.com/">RTM</a> a while ago, and it works great.&nbsp; It helps me keep all my to-dos together in one place, and allows me to set different deadlines so I don't forget them. But the problem is, there is no way to manage my to-do list while I'm on the go... you know, the boring bus commute, and things like that...&nbsp; Until I ran into an <a href="http://walkah.net/blog/walkah/fluid-desktop-web-apps">article</a> on how to use <a href="http://fluidapp.com/">Fluid</a>, an OSX application that converts webpages into small Applications for you. Fluid is nice because it offers both userscript (Greasemonky) and Google Gears (offline syncing) support.&nbsp; But this is where my problem begin...<br /><br />There is a really <a href="http://userscripts.org/scripts/show/38591">nice GM script</a> I want to use, but it seems to cause problems with the Google Gear synchronization.&nbsp; Whenever I have the script enabled, and Google Gear tries to sync, everything goes wonky and the page refuse to load.&nbsp; I must disable the script, have Gears sync, and then re-enable the script.<br /><br />If anyone knows how to make these work in harmony, please do leave a comment to let me know how!&nbsp; In the mean time, I'll have to keep the script disabled...<br />]]>
        
    </content>
</entry>

<entry>
    <title>Making Your OSX Run Faster</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2009/02/making-your-osx-run-faster.html" />
    <id>tag:www.andyhuang.net,2009:/blog//12.455</id>

    <published>2009-02-20T00:20:30Z</published>
    <updated>2011-10-11T02:48:34Z</updated>

    <summary><![CDATA[As you guys are aware of, I just got my MacBook, and I'm still experiencing the should-not-exist-learning-curve...&nbsp; Anyways, today, I noticed something funny, and I figured I'd share with all of you.Earlier today, I was unable to start any applications...&nbsp;...]]></summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
        <category term="Apple" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Memo" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="OSX" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="apple" label="Apple" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="firefox" label="Firefox" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="itunes" label="iTunes" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="lastfm" label="Last.fm" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mailapp" label="Mail.app" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="memorymanagement" label="Memory Management" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="osx" label="OSX" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tips" label="Tips" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="utorrent" label="uTorrent" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[As you guys are aware of, I just got my MacBook, and I'm still experiencing the should-not-exist-learning-curve...&nbsp; Anyways, today, I noticed something funny, and I figured I'd share with all of you.<br /><br />Earlier today, I was unable to start any applications...&nbsp; I'd type the application name via QS, and QS would go away, but no app.&nbsp; I'd use Finder to go to /Applications and attempt to manually launch it, and nothing would happen.&nbsp; Finally, when I tried to start iTerm, it told me it was unable to fork.&nbsp; Linux instincts kicked in and told me that the problem came from lack of resources or PIDs.&nbsp; So I quickly quit a few apps (I had upwards to 30 applications running at that time), and long and behold, I was able to start applications again.&nbsp; I checked my processes list via terminal, and noticed a bunch of idle perl processes -- It's still a mystery to me as to what they are, as I was unable to kill them individually, nor through killall, nor could I see them via Activity monitor, but that's besides the point.&nbsp; I rebooted the system, and it seems to be running fine now (and the idle perl processes have yet to return *touch wood*).<br /><br />I decided I want to pay attention to my resources usage, and make sure my system doesn't lock up on me.&nbsp; I have the habit of leaving commonly used applications running...&nbsp; this is even the case when I was still on Windows.&nbsp; This is when I started to notice a funny trend.&nbsp; It'd appear that applications on OSX suffers even more evident memory leak/consumption problem than their Windows counter part!&nbsp; Here's a quick break down of memory usage oddities after around 12 hours of me working:<br />iTunes - Real Memory: 220.8MB, Virtual Memory: 2.0GB<br />Firefox - Real Memory: 208.4MB, Virtual Memory: 1.7GB<br />Mail - Real Memory: 150.2MB, Virtual Memory: 1.4GB<br />Last.fm - Real Memory: 92.7MB, Virtual Memory: 1023.49MB<br />uTorrent - Real Memory: 16.28MB, Virtual Memory: 973.33MB<br /><br />iTunes I understand, I have tons of music (library of 1699 tracks, 14.13 GB total) and most of them are tagged with album art, so it takes resource to load when I play songs.&nbsp; But on Windows, my iTunes usually floats at around 150MB of memory usage, not 220MB!&nbsp; So I quickly quit iTunes and restarted it.&nbsp; Surely, it dropped down to 70MB of real memory, and arond 1GB of virtual memory -- though, as I wrote these, it grew slowly to 85.52MB and 1.07GB already.<br /><br />Firefox I understand...&nbsp; The prefetching "feature" and caching of tabs etc. does eat up quite a bit of resources...&nbsp; On Windows I've seen it gone up to as much as 600MB of memory, too... So I just killed it and restarted.&nbsp; It's coasting at around 107MB right now...<br /><br />Mail - I wonder if it downloaded all my mails from gmail, even though I said IMAP, and tries to load them into memory over time... Mail is now consuming only 51MB and 1.0GB after quit and relaunch.<br /><br />Last.fm - WHY?!&nbsp; It's a tiny icon that does nothing but scrob my musics! ... and I don't even listen to music from it.&nbsp; Restarted it and its now only eating 21MB and 986.49MB of memory.<br /><br />uTorrent - This one is tiny, but still worth mentioning...&nbsp; Because I didn't do anything with it!&nbsp; I simply decided to download it to see if it is exactly the same as the Windows counter part.&nbsp; Forgot about it, and left it idling.&nbsp; No downloading, no seeding, no hash checking, nothing.&nbsp;&nbsp; Main window isn't even open (so I don't see it on expose)!&nbsp;&nbsp; Restarting it seem to have make it go down to 13.17MB, and 966.61MB though.<br /><br />So, yeah...&nbsp; tip to make your OSX run faster?&nbsp; Just quit your apps and restart them every now and then!&nbsp; It's surprising to see their memory grows so rapidly, even if you're not doing anything with them...<br />]]>
        
    </content>
</entry>

<entry>
    <title>Toggle Nocturne via Quicksilver on OSX</title>
    <link rel="alternate" type="text/html" href="http://www.andyhuang.net/blog/2009/02/toggle-nocturne-via-quicksilve.html" />
    <id>tag:www.andyhuang.net,2009:/blog//12.454</id>

    <published>2009-02-07T22:50:59Z</published>
    <updated>2011-10-11T02:48:34Z</updated>

    <summary>Getting into the Mac world, I encountered two awesome tools from the same author; Nocturne, a tool which allows you to invert screen colors so your eyes doesn&apos;t go blind in dark places, and Quicksilver, a rapid application launcher allowing...</summary>
    <author>
        <name>Andy Huang</name>
        
    </author>
    
        <category term="Apple" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Memo" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="OSX" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="apple" label="Apple" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="applescript" label="AppleScript" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="nocturne" label="Nocturne" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="osx" label="OSX" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="quicksilver" label="Quicksilver" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-us" xml:base="http://www.andyhuang.net/blog/">
        <![CDATA[<p>Getting into the Mac world, I encountered two awesome tools from the same author; <a href="http://docs.blacktree.com/nocturne/nocturne" rel="nofollow">Nocturne</a>, a tool which allows you to invert screen colors so your eyes doesn't go blind in dark places, and <a href="http://docs.blacktree.com/quicksilver/quicksilver" rel="nofollow">Quicksilver</a>, a rapid application launcher allowing you to perform complex tasks with just a few key strokes.  However, they don't integrate well together....  I can't seem to use Quicksilver to toggle Nocturne.... not until I wrote a quick AppleScript for it...  And you can do it too!</p>

<p>Here's how I did it.</p>

<p>First, start Nocturne normally, and go to the preferences panel.  Disable sensor auto switch... that will bump you right out of invert mode if you are in a bright enough place.</p>

<p>Then, enter night mode, and quit the application... it will auto revert back to day mode upon exit, but when you launch it again, it will start in night mode, which is what we want.</p>

<p>Next, go to script editor (Quicksilver > Script Editor, Enter) and create this script (copy & paste should do the trick):<br />
<div class="code_container">
<div class="code_header">Apple Script</div>
<div class="code_body">property Disabled : false<br />
tell application "System Events"<br />
	set TheList to get name of every process<br />
	repeat with i from 1 to the count of TheList<br />
		if item i of TheList contains "Nocturne" then<br />
			tell application "Nocturne" to quit<br />
			set Disabled to true<br />
		end if<br />
	end repeat<br />
	if Disabled is false then<br />
		tell application "Nocturne" to activate<br />
	end if<br />
end tell<br />
</div>
</div></p>

<p>Save the script you've just created into ~/Library/Application Support/Quicksilver/Actions as Nocturne.scpt and you're almost ready to rock!  Trigger your Quicksilver, use Command + R to force refresh of your catalog, and type Nocturne into the first box of Quicksilver.  Because Quicksilver weights the application more heavily than your script, you need to hit down a few times to find the script instead of launching the application directly.  I gave it three times and then Quicksilver learned that I want to use the script instead of real app... it might take you lesser or more, depending on how many times you've launched Nocturne via Quicksilver.  But once it learns that, its all good.</p>

<p>Now, each time you want to toggle mode, just trigger Quicksilver, type Nocturne, and it'll switch day and night mode for you.  Pretty neat huh?</p>

<p>Got it to work?  Please let me know how things are working out for you via comments section :)</p>]]>
        
    </content>
</entry>

</feed>

