tag:blogger.com,1999:blog-34620601611727510482024-03-17T22:03:06.030-05:00Substancesharing the substance of my thought and life.Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-3462060161172751048.post-47310700663378859272020-02-18T18:41:00.004-06:002020-02-18T18:41:47.540-06:00Moving my blog to falcond.aiInstead of staying on the blogger platform, I started blogging on a new fully static personal site <a href="https://falcond.ai/blog">falcond.ai/blog</a>. The main advantage is that I have more complete control over the site, e.g., it supports mathematical expressions via KaTeX. I will keep this blog and the posts--some of them are hopefully still providing useful information to some visitors.Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com2tag:blogger.com,1999:blog-3462060161172751048.post-31774839169513659672014-04-02T12:07:00.000-05:002014-04-07T20:26:44.087-05:00Quick & easy way to mount Google Glass onto eyeglassesI recently got my Google Glass. I was very excited about the product and the future of head mount displays in general but a very practical problem arose as soon as I tried to setup the device: I wear prescription lenses and without them I cannot see anything on the Glass display.<br />
<br />
After giving up the sophisticated idea of 3D printing some custom mounting parts, I had a hack solution:<b> twist ties</b>! (<a href="https://www.google.com/search?q=twist+ties">https://www.google.com/search?q=twist+ties</a> the malleable metal wires that often appear around your new gadgets' charger/USB/headset cables)<br />
<br />
I happen to have kept, or rather that I haven't thrown them out yet, some twist ties from my Kinect package: they are long and they have good-looking insulator skin. I imagine that the availability of such material should not be a problem for people owning electronic gadgets. I immediately anchored Glass onto my prescription frame with two of them. They worked terrifically since the first setup.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghRCTN11RBt7EAW-Gk8vG6kdm1prSWBheG6aOjz3lByTFsk_i0slJ1toWlt8CgMlp0fdTU32PBUzqLrI9ZzEalZwbDBqjSU5C5AmRQoMjsan2CMH7FFCVTe02cbgDQ6_nx3w7uUsUrn89v/s1600/IMG_20140330_164742.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghRCTN11RBt7EAW-Gk8vG6kdm1prSWBheG6aOjz3lByTFsk_i0slJ1toWlt8CgMlp0fdTU32PBUzqLrI9ZzEalZwbDBqjSU5C5AmRQoMjsan2CMH7FFCVTe02cbgDQ6_nx3w7uUsUrn89v/s1600/IMG_20140330_164742.jpg" height="640" width="480" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 12.666666984558105px;">my eyeglasses with Google Glass mounted</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWYkAu8wGB1ZoTvOGl2AJpyGzIaObtKNbXZAZeCwcovTgWF9V3u6w4DdERWp_T_H-lgNQYfE6h6Hts6UJBWA2z1L26pM3AvBtGdsEShwEJ1GycwF1m1rILz4p4SAbCk3gSD3j-DoGVd717/s1600/IMG_20140330_172213.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWYkAu8wGB1ZoTvOGl2AJpyGzIaObtKNbXZAZeCwcovTgWF9V3u6w4DdERWp_T_H-lgNQYfE6h6Hts6UJBWA2z1L26pM3AvBtGdsEShwEJ1GycwF1m1rILz4p4SAbCk3gSD3j-DoGVd717/s1600/IMG_20140330_172213.jpg" height="480" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">To keep enough space between the lens and Glass, a little touch sensitive space (anterior to the anterior twist tie) is sacrificed. But I had no trouble using the touch pad between the ties.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXlQ3QvLM9AZ2HqqAaQLvtWcXt9EqOYy_iO_g1k5iFRZfMmHHbaj1ajHPCMzUgA8b1ChkrRrwX58FBn5YvwjNv1gcpHqWeqZJtQ7Z111yjl2FTvndJwoeFxqf-es2SShUjaSEnhde8Vli_/s1600/IMG_20140330_164411.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXlQ3QvLM9AZ2HqqAaQLvtWcXt9EqOYy_iO_g1k5iFRZfMmHHbaj1ajHPCMzUgA8b1ChkrRrwX58FBn5YvwjNv1gcpHqWeqZJtQ7Z111yjl2FTvndJwoeFxqf-es2SShUjaSEnhde8Vli_/s1600/IMG_20140330_164411.jpg" height="480" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">details of the anterior twist tie</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8NyzkD2fHmBw9HmdfYZaScULmvYu-dbTu9BToBrSKi1bRWKxtvu0vDRW3oDDEZJF6XXhbJgsf95aC7swR04_CZdjPYxElm3tFH6WjA0dLQHXZFHOYhJpgRstdikKWOTvB29pWbC4646rY/s1600/IMG_20140330_164354.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8NyzkD2fHmBw9HmdfYZaScULmvYu-dbTu9BToBrSKi1bRWKxtvu0vDRW3oDDEZJF6XXhbJgsf95aC7swR04_CZdjPYxElm3tFH6WjA0dLQHXZFHOYhJpgRstdikKWOTvB29pWbC4646rY/s1600/IMG_20140330_164354.jpg" height="480" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 12.666666984558105px;">details of the posterior twist tie</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9hZeb65i-pll7M79H5-_OfP9uaAFxkxpJgEc_ibZkAt_0dR8mnS09ru65FW1wLhwrT5cC9qQUnlk6w3P8prM9HIGVaOufIFpHtpBRsUN1kd7mVrMaBGbWvXx1q-wqNZNZCVeuITtKfF7a/s1600/IMG_20140330_164448.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9hZeb65i-pll7M79H5-_OfP9uaAFxkxpJgEc_ibZkAt_0dR8mnS09ru65FW1wLhwrT5cC9qQUnlk6w3P8prM9HIGVaOufIFpHtpBRsUN1kd7mVrMaBGbWvXx1q-wqNZNZCVeuITtKfF7a/s1600/IMG_20140330_164448.jpg" height="480" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">I secured the first tie on the front piece instead of the tempo. This prevents my eyeglass from folding but that was okay for me.</td></tr>
</tbody></table>
I think this works nicely on my eyeglasses because the side is rectangular providing enough support. The malleability of the twist ties offer a lot of room for adjustment and experimentation. The other important thing is that this method does not damage Glass.<br />
<br />
If you decide to try this, remember to twist the ties at the end to provide enough tension. And the usual disclaimer applies, this solution works for me and I believe that it works in general but I don't know if it will work in your case and I cannot be responsible for its consequences. So proceed with caution and common sense.<br />
<br />
Update: you will need to detach Glass from its original frame first by unscrewing the Torx screw near the camera button (the screw stays in the socket afterwards as seen in the images).<br />
<br />Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com1tag:blogger.com,1999:blog-3462060161172751048.post-15730007597092613742013-10-17T01:53:00.000-05:002013-11-28T00:07:12.113-06:00Fixing Galaxy Nexus's IMEI NumberI have been using Galaxy Nexus for quite some time and it worked fine as an everyday+development phone until its IMEI number got blocked on T-Mobile recently. If your IMEI number is <b>004999010640000 </b>(you can see your IMEI number by dialing *#06#), then this post <i>might</i> help you restore your connectivity. It did for me: I got my GN off eBay long ago. It was a DoCoMo phone from Japan and it was unlocked with the F*ckDoCoMo app by the seller.<br />
<div>
<br /></div>
<h3>
For the confused audience</h3>
<div>
You used Galaxy Nexus on T-Mobile (or other networks) and someday you found it suddenly stop to register onto the cellular network. After rounds of unhelpful customer service calls, you were told that your IMEI number (004999010640000) is <i>blocked </i>on the T-Mobile network (and possibly other networks too). Furthermore, the customer representative could do absolutely nothing about it (aside from filing an effectless unblock request). If you have a blocked IMEI other than the stated one, this post will <i>not</i> help: it does NOT teach you how to change to an arbitrary IMEI. Legality aside, software-based IMEI change on Galaxy Nexus seems to remain an unsolved problem (unlike some other phones). </div>
<div>
<br /></div>
<h3>
Solution</h3>
<div>
The gist of my approach is to <i>restore</i> the original, unique IMEI number (it is on the sticker on the back of your phone under the battery) from your phone's <b>/factory/.nv_data.bak </b>file. And if you do your backups right, you shouldn't lose any of your data. The usual disclaimer for hacking guides applies: <i>It worked for me and I believe it works in principle, but I cannot guarantee that it will work for you and I cannot be responsible for any damage. </i></div>
<div>
<br /></div>
<div>
The basic ideas/facts behind the solution are:</div>
<div>
<ol>
<li><b>/factory/.nv_data.bak</b> (and maybe <b>/factory/nv_data.bin </b>too?) stores the system backup of your IMEI (and other information). Note since this file is hidden (its filename starts with a dot), you can only list this file by "$ ls -a"</li>
<li>similarly <b>/data/radio/nv_data.bin</b> stores your <i>current</i> IMEI (and other information)</li>
<li>both files store the IMEI in some non-obvious way. This prevents easy IMEI modification with a Hex editor. This is why we cannot just make up a new IMEI number for your GN, unlike some other phones which lacks such protective mechanisms.</li>
<li>the android system uses <i>salted</i> md5 checksums stored in <b>/factory/.nv_data.bak.md5 </b>and <b>/data/radio/nv_data.bin.md5</b> to detect tempering of the aforementioned files. We don't know how to generate these salted checksums but a glitch/oversight in ICS (Ice Cream Sandwich, Android 4.0.x) can effectively generate them for us: it logs an offending checksum along with its correct counterpart.</li>
<li>if both nv_data files fail the checksum test, the android system will create a "default" <b>/data/radio/nv_data.bin</b> containing the infamous generic IMEI (along with the unlock status). In fact, F*ckDoCoMo app achieved unlocking GN via this side-effect of tempering nv_data and leaving the checksums out-of-sync. The nice thing is that the app does edit your <b>/factory/.nv_data.bak</b> in a sensible way so your phone will remain unlocked with this nv_data file.</li>
</ol>
</div>
<div>
<br /></div>
<div>
If your <b>/factory/.nv_data.bak </b>has not been overwritten inadvertently -- that is a big "if" which can only be tested by experimentation --, then we should be able to recover your original IMEI by acquiring the correct checksum for <b>/factory/.nv_data.bak</b>. </div>
<div>
<br /></div>
<h3>
Instructions</h3>
<div>
(I assume that you are familiar with <b>adb</b>, <b>fastboot</b>, and other basic tools or can easily acquire such knowledge via the Web. Upon requests, I will edit this post to expand/clarify on any unclear steps. The XDA threads mentioned at the end are also helpful.)</div>
<div>
<br /></div>
<div>
0. backup your entire phone to <b>/sdcard</b> with the <a href="http://clockworkmod.com/rommanager" target="_blank">ClockworkMod recovery</a> (CWMR) boot image's backup utility. <u>In additon, as there is risk that you will lose your unique IMEI <i>forever</i>, you should carefully backup the entire <b>/factory </b>and <b>/data/radio </b>directories onto your laptop/desktop/cloud/etc. </u>You can do that by $ adb pull.</div>
<div>
<br /></div>
<div>
1. install a rooted ICS-based ROM (root is probably not necessary since you can get that in CWMR, but it will make life easier), e.g. <a href="http://download.cyanogenmod.org/get/jenkins/5789/cm-9.0.0-maguro.zip">cm-9.0.0-maguro-stable</a> from <a href="http://download.cyanogenmod.org/?type=stable&device=maguro" target="_blank">cyanogenmod</a>. The glitch we rely on is fixed in later versions. (I tried JellyBean 4.2 and it was no good.)</div>
<div>
<br /></div>
<div>
2. (You will need root to do this and the following steps.) Take note of the content in <b>/data/radio/log/nv.log</b></div>
<blockquote class="tr_bq">
$ cat /data/radio/log/nv.log </blockquote>
<div>
It should look something like this:</div>
<div>
<blockquote class="tr_bq">
Thu Jun 28 19:54:08 2012: /data/radio/nv_data.bin does not exist.<br />
Thu Jun 28 19:54:08 2012: MD5 fail. orignal md5 '672f544c3d4c3c4f5bc699966bac6210' computed md5 '3b93401f8fb129a51aba4e70a8b47fbb' (rild)<br />
Thu Jun 28 19:54:08 2012: MD5 fail. orignal md5 '92d39f2375e581f8bd8095486c8758b1' computed md5 'a4bc620886c51f712caa377adf90cf24' (rild)<br />
Thu Jun 28 19:54:09 2012: default NV restored.</blockquote>
</div>
<div>
Find the original md5 that is the same as <b>/factory/.nv_data.bak.md5 </b>(in my case, it is 92d39f2375e581f8bd8095486c8758b1) and then you should copy the computed md5 in the same line (so in my case, it is a4bc620886c51f712caa377adf90cf24). The computed md5 is the salted md5 checksum we want. FYI- The other set of md5's corresponds to <b>/factory/nv_data.bin</b>.<b> </b>You don't really need to worry about them unless .nv_data.bak is corrupted and nv_data.bin is not. Then you might want to try the process with <b>/factory/nv_data.bin</b>.</div>
<div>
<br /></div>
<div>
3. Remount /factory as read/write and then replace .nv_data.bak.md5 with the correct salted md5 checksum from last step.</div>
<blockquote class="tr_bq">
$ mount -oremount,rw /factory<br />
$ echo <i>salted-md5-checksum</i> > /factory/.nv_data.bak.md5</blockquote>
<div>
<br /></div>
<div>
4. $ rm /data/radio/nv_data.bin*</div>
<div>
<br /></div>
<div>
5. $ reboot. Now <b>/data/radio/nv.log</b> should contain no new complaints about failed checksums and the IMEI should be restored to some non-generic number! (If you don't care about restoring your data or the ROM/Android version you were using, you are done now.)</div>
<div>
<br /></div>
<div>
6. restore your backup from /sdcard using CWMR. Note that <b>/data/radio</b> (but not <b>/factory</b>) is replaced by your restored backup, so your IMEI is the generic one again! </div>
<div>
<br /></div>
<div>
7. Since we have the correct salted md5 checksum in <b>/factory/.nv_data.bak.md5 </b>to go with <b>/factory/.nv_data.bak</b>, you only need to remove <b>/data/radio/nv_data.bin*</b> and then reboot to let the system automatically restore from <b>/factory/.nv_data.bak</b>. Finally, after rebooting, you should see the same non-generic IMEI as what you saw in step 5, while having your phone restored!</div>
<div>
<br /></div>
<div>
If this works and you want to thank me, buy me a cup of coffee and/or follow me on twitter: <a href="https://twitter.com/falcondai" target="_blank">@falcondai</a> :)</div>
<h3>
</h3>
<h3>
</h3>
<h3>
<br /></h3>
<h3>
Additional Resource</h3>
<div>
You can check whether your IMEI is blocked on T-Mobile: <a href="http://www.t-mobile.com/VERIFYIMEI.ASPX">http://www.t-mobile.com/VERIFYIMEI.ASPX</a> (004999010640000 is confirmed to be blocked. Such a <i>generic</i> IMEI should never get blocked... maybe someone reported their phone with that IMEI as stolen to T-Mobile?) This IMEI number seems to be a default for many Samsung phones.</div>
<div>
<br /></div>
<div>
According to some people on Reddit, this generic IMEI number was blocked on T-Mobile as early as 2013/2: <a href="http://www.reddit.com/r/Android/comments/17yizs/anyone_else_running_a_custom_rom_and_have_your/">http://www.reddit.com/r/Android/comments/17yizs/anyone_else_running_a_custom_rom_and_have_your/</a> But mine somehow managed to survive till recently, about one month ago, i.e. 2013/9. I called T-Mobile to add the generic IMEI number to my account explicitly after the first time it showed symptoms (likely back in February) and that solved the problem for me until it happened again.</div>
<div>
<br /></div>
<div>
My method is inspired mainly by these two threads on XDA:</div>
<div>
<a href="http://forum.xda-developers.com/showthread.php?t=1606982">http://forum.xda-developers.com/showthread.php?t=1606982</a> (very insightful post that spotted the glitch)</div>
<div>
<a href="http://forum.xda-developers.com/showthread.php?t=1850808">http://forum.xda-developers.com/showthread.php?t=1850808</a></div>
<div>
<br /></div>
<div>
Most, if not all, software-based IMEI modification discussions/methods do not generalize and almost certainly won't help in the case of Galaxy Nexus due to obfuscation in nv_data. (If you find anything applicable, feel free to share them in comments.)</div>
<div>
<br /></div>
Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com49tag:blogger.com,1999:blog-3462060161172751048.post-86455997043665208002013-06-20T11:28:00.003-05:002013-07-19T18:36:58.025-05:00666 and How Twitter Samples Tweets in Streaming API After having played around with Twitter data <a href="http://twithinks.com/" target="_blank">for a while</a>, I had a question: how Twitter samples the supposedly <i>random</i> tweets to send out through its <a href="https://dev.twitter.com/docs/api/1.1/get/statuses/sample" target="_blank">sample streaming API</a>?<br />
<br />
I vaguely remember that it used to say "1% random sample" somewhere on the official documentation but I can no longer find that statement. So I decided to investigate the question by experiments. The result turns out to be far more fascinating than I expected (such as the appearance of 666).<br />
<br />
This task would be trivial if I had <a href="https://dev.twitter.com/docs/api/1.1/get/statuses/firehose" target="_blank">firehose</a> access but I do <i>not</i>. I initially thought of crawling tweets with ID's near the ones received in the stream sample and then do the counting. But I quickly found out how terribly inefficient that was: the tweet ids seem often to be very <i>sparse. </i>Then, thanks to Twitter's commitment to open source, I found their tweet ID generator on Github, wittily named <a href="https://github.com/twitter/snowflake" target="_blank">snowflake</a> (after a snowflake's large number of possible configurations, I suppose). In order to create a distributed solution to global unique ID generation, the essential idea of snowflake is to use <i>timestamp</i> and unique worker ID together to ensure uniqueness in an independent manner.<br />
<br />
The first thing I noticed in snowflake is that whereas the 'created_at' property of the returned JSON tweet objects provides timing information at per-second resolution, one can recover <b>per-millisecond timing information from snowflake</b>! With this more precise timing information, some intriguing pattern emerges from the tweets in sample stream: within each second, all received tweets fall within a 10-millisecond-wide window. So we get 10/1000 = 1% of the millisecond timestamps which translates to <b>roughly 1%</b> of all tweets (<i>assuming</i> good randomness in tweet creation time) confirming the claim in my memory. But the surprise does not stop there, that sampling window is the same for every second! It is <b>fixed exactly between the 657th and the 666th millisecond</b>. So there is the 666 in the title. I wonder what is the story behind choosing 666 and this particular scheme of "random" sampling.<br />
<br />
To make the post more complete, I should add that: 1. snowflake is used not only for tweet ID's but also direct message ID's. 2. before snowflake was activated sometime on <a href="https://groups.google.com/d/msg/twitter-development-talk/ahbvo3VTIYI/0eMJbIpAC8MJ" target="_blank">11/4/2010</a>, Twitter used incremental ID's (the earliest existing tweet being <a href="https://twitter.com/jack/status/20" target="_blank">20</a>).<br />
<br />
To start playing with snow, you can use my little <a href="https://github.com/falcondai/python-snowflake" target="_blank">python module</a> to create and melt a snowflake ID. (Indeed, you might soon find that not every tweet is delivered even in that 10 milliseconds window.)<br />
<br />
If you find this interesting, leave a comment. We can also talk on twitter: <a href="https://twitter.com/falcondai" target="_blank">@falcondai</a>Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com25tag:blogger.com,1999:blog-3462060161172751048.post-2367590751933834762013-05-22T16:33:00.000-05:002013-05-22T16:33:13.298-05:00The New (Time-of-Flight) Kinect Sensor and SpeculationsIn the official Xbox One release yesterday (2013/5/21), it is mentioned that the new Kinect sensor employs a time-of-flight camera to acquire depth image instead of using the Light Coding technology from the original Kinect (which is patented by PrimeSense). It amazed me because I heard about how expensive a time-of-flight camera is: <a href="http://www.acroname.com/robotics/parts/R317-SR4000-CW.html" target="_blank">SwissRanger 4000</a> (a popular choice in academic research) with 176x144 resolution at 50 FPS costs more than $4,000. So I started digging and found how ignorant I am to the recent development of the field.<br />
<br />
To understand how time-of-flight (or TOF) cameras acquire a depth image, <a href="http://en.wikipedia.org/wiki/Time-of-flight_camera" target="_blank">its Wikipedia page</a> is a good place to start. The basic idea is that you need to measure the round-trip time (RTT) of the photons that are emitted by the sensor and reflected back. Given the speed of light being 3x10^8 m/s, the sensor would need the precision to measure 6 <i>pico</i>seconds difference in time to measure 1 millimeter difference in depth (1mm is the <i>best</i> precision the original Kinect could achieve). This high precision requirement, i.e. high frequency RF, makes the chip and circuitry design more challenging and costly. The surprise for me is that 3DV Systems (and <a href="http://www.vision-systems.com/articles/print/volume-9/issue-7/technology-trends/image-capture/cmos-single-chip-sensor-captures-3-d-images.html" target="_blank">Canesta</a>) seemed to have found a way to lower the cost drastically and planned to release a RGB-Depth sensor, called <a href="http://www.engadget.com/gallery/microsofts-project-natal-roots-revealed-3dv-systems-zcam-2/2056902/" target="_blank">ZCam</a>, for <a href="http://www.pcmag.com/article2/0,2817,2247044,00.asp" target="_blank">under $100</a>. (But before 3DV could sell it, the company was bought by Microsoft.)<br />
<br />
Let's venture deeper into the hardware. Thanks for WIRED Magazine's exclusive report, we can see the performance and internals of the new Kinect sensor.<br />
<br />
We can see from the picture of the circuit board that the three crucial components, RGB camera, infrared (IR) sensor, and IR illuminator, not unlike the original Kinect except that the IR sensor and illuminator are no longer exposed.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvCFWJ6hQoVcgUuBoF-H6WY2dvNltwtZQSFR2a2WqdQpN5b17EaGBfPHvpJeBReCsWXCMjSReXmdUhNMpe4OTSxu7wSNQW7qg5VklE0RwMvKxKLCb_RSNpMVxKHiHEePmTgNPo4ho8QV7c/s1600/new-kinect-external.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvCFWJ6hQoVcgUuBoF-H6WY2dvNltwtZQSFR2a2WqdQpN5b17EaGBfPHvpJeBReCsWXCMjSReXmdUhNMpe4OTSxu7wSNQW7qg5VklE0RwMvKxKLCb_RSNpMVxKHiHEePmTgNPo4ho8QV7c/s640/new-kinect-external.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The external of the new Kinect sensor unveiled with Xbox One</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioXupFgEpJ4DxVqfREilf0Yg6yY5Jw6QispYu09OyVagkIcCzTjcmABbqLA4cKV_vtwsw-xGgUwf_g1H5h6kqzIrX74m0aXLfEq6Hbfk_bsjOiuh6fNSgs6ztWk5PkHFf-hVwbdCaNJjXh/s1600/new-kinect-internal.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="428" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioXupFgEpJ4DxVqfREilf0Yg6yY5Jw6QispYu09OyVagkIcCzTjcmABbqLA4cKV_vtwsw-xGgUwf_g1H5h6kqzIrX74m0aXLfEq6Hbfk_bsjOiuh6fNSgs6ztWk5PkHFf-hVwbdCaNJjXh/s640/new-kinect-internal.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Photo of the internal of a new Kinect from <a href="http://www.wired.com/gadgetlab/2013/05/xbox-one-development-photos/#slideid-138499" target="_blank">WIRED</a> with labels added by me</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbEfFwWQHwagUFYCWXLT2_HtUVONE2vKMClxrQs1jXIpEnygxFLBMpTOObP-fe-d8e7ou36p7DnQpKvapSrb4i3jnw4_JMax0TVsqjesmjw7TVqJc7LU6Sv-yDwKVNtlm7nqR7-GNKJqKf/s1600/old-kinect-labeled.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="220" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbEfFwWQHwagUFYCWXLT2_HtUVONE2vKMClxrQs1jXIpEnygxFLBMpTOObP-fe-d8e7ou36p7DnQpKvapSrb4i3jnw4_JMax0TVsqjesmjw7TVqJc7LU6Sv-yDwKVNtlm7nqR7-GNKJqKf/s640/old-kinect-labeled.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Photo of an original Kinect sensor with components labeled. </td></tr>
</tbody></table>
<br />
Thus the IR sensor and RGB camera are still separated (also confirmed by the different field of view when switching between the two streams in the WIRED video: <a href="http://youtu.be/Hi5kMNfgDS4?t=5m27s">http://youtu.be/Hi5kMNfgDS4?t=5m27s</a>). If the sensor can capture both RGB and IR simultaneously from the same sensor (or just switching quickly between the two at 60Hz/60Hz or 30Hz/30Hz), texture mapping alignment in KinectFusion type of application would get better.<br />
<br />
In case you wonder, the reason why I argue that the IR illuminator is the big rectangular block to the left of the IR sensor (instead of the other way around) is because the active IR image shows shadow due to IR illumination on the <a href="http://youtu.be/Hi5kMNfgDS4?t=1m21s" target="_blank">left</a> but the screen we see is a mirror image: <a href="http://youtu.be/Hi5kMNfgDS4?t=5m8s">http://youtu.be/Hi5kMNfgDS4?t=5m8s</a>. This shows that the IR illuminator is on the left to the IR sensor (which by the way should have a lens like the exposed RGB camera).<br />
<br />
Comparing to the original Kinect, the most noticeable improvement of the new Kinect is the <i>almost</i> shadow-less depth image (see video <a href="http://youtu.be/Hi5kMNfgDS4?t=37s">http://youtu.be/Hi5kMNfgDS4?t=37s</a>) due to the closer placement of IR sensor and illuminator. In fact, TOF technology allows for more flexibility with the illumination placement and design (thus better depth image). For comparison, google "kinect shadow" and take a look at the images.<br />
<br />
Looking forward, the natural question to ask is <i>when </i>will depth sensing technology go mobile? Canesta seems to have some prototype for product can fit into the form factor of a phone: <a href="https://www.youtube.com/watch?v=5_PVx1NbUZQ">https://www.youtube.com/watch?v=5_PVx1NbUZQ</a> and the video is two years old.<br />
<br />
The trail that led to this new design of Kinect sensor is clear in retrospect. Microsoft acquired <a href="http://en.wikipedia.org/wiki/ZCam" target="_blank">3DV Systems</a> and <a href="http://en.wikipedia.org/wiki/Canesta" target="_blank">Canesta</a> a few years ago which have both worked on TOF technologies extensively. The acquisitions obviously clear up some patent concerns for Microsoft (Bye, PrimeSense...). The down side is that we, as developers and consumers, might not see a more open-source friendly alternative with similar technology anytime soon. And we would have to rely on Microsoft to release good SDK and live with Windows when using the new Kinect in commercial applications.Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com11tag:blogger.com,1999:blog-3462060161172751048.post-360047002867807142013-02-15T23:40:00.000-06:002013-02-16T01:49:22.097-06:00Visualizing Geo-location Data with Google MapVisualizing geo-location data is often more involved than other types of data because you probably want to put them into the context of places instead of just latitude-longitude values. There are many solution to this problem and mine might not be the best or the easiest. Please share your thoughts in comments if you have a better solution. So my solution is to place your data on Google map with their <a href="https://developers.google.com/maps/documentation/staticmaps/" target="_blank">static image API</a>: it can provide street views too!<br />
<br />
<b><span style="font-size: x-large;">Using Google Map Static Image API</span></b><br />
To illustrate how easy this is, I will use some examples as well as links to the relevant entries in the reference. The basic idea is that all data (and other parameters) are passed in a request to Google in the URL string and then the rendered static image will be returned as a response.<br />
<br />
<br />
<div>
<span style="font-size: x-large;"><b>Marking locations</b></span><br />
This self-explanatory URL will give you a map with four lat-long pairs <i>(41.791421,-87.598077), (41.791391,-87.599692), (41.790013,-87.599676), (41.790021,-87.599193)</i> marked on a map:<br />
<a href="http://maps.googleapis.com/maps/api/staticmap?size=800x800&markers=41.791421,-87.598077|41.791391,-87.599692|41.790013,-87.599676|41.790021,-87.599193&sensor=false">http://maps.googleapis.com/maps/api/staticmap?size=800x800&markers=41.791421,-87.598077|41.791391,-87.599692|41.790013,-87.599676|41.790021,-87.599193&sensor=false</a></div>
<br />
<div>
<div>
which will return the image below:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://maps.googleapis.com/maps/api/staticmap?size=800x800&markers=41.791421,-87.598077|41.791391,-87.599692|41.790013,-87.599676|41.790021,-87.599193&sensor=false" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="http://maps.googleapis.com/maps/api/staticmap?size=800x800&markers=41.791421,-87.598077|41.791391,-87.599692|41.790013,-87.599676|41.790021,-87.599193&sensor=false" width="400" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
The basic syntax for the parameters is: </div>
<div style="text-align: center;">
markers=[<i>markerStyles</i>|]<i>markerLocation1</i>| <i>markerLocation2</i>|...</div>
<div>
For more details, please consult <a href="https://developers.google.com/maps/documentation/staticmaps/#Markers">https://developers.google.com/maps/documentation/staticmaps/#Markers</a><br />
<br />
</div>
<span style="font-size: x-large;"><b>
Marking a path</b></span></div>
<div>
<div>
To link up the lat-long pairs marked in the previous section, simply substitute "marker" with "path": </div>
<div>
<div style="text-align: left;">
<a href="http://maps.googleapis.com/maps/api/staticmap?size=800x800&path=41.791421,-87.598077|41.791391,-87.599692|41.790013,-87.599676|41.790021,-87.599193&sensor=false">http://maps.googleapis.com/maps/api/staticmap?size=800x800&path=41.791421,-87.598077|41.791391,-87.599692|41.790013,-87.599676|41.790021,-87.599193&sensor=false</a> </div>
<div style="text-align: left;">
which will return the image below:</div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://maps.googleapis.com/maps/api/staticmap?size=800x800&path=41.791421,-87.598077|41.791391,-87.599692|41.790013,-87.599676|41.790021,-87.599193&sensor=false" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="http://maps.googleapis.com/maps/api/staticmap?size=800x800&path=41.791421,-87.598077|41.791391,-87.599692|41.790013,-87.599676|41.790021,-87.599193&sensor=false" width="400" /></a></div>
<div>
<br /></div>
<div>
For more details, please consult <a href="https://developers.google.com/maps/documentation/staticmaps/#Paths">https://developers.google.com/maps/documentation/staticmaps/#Paths</a><br />
<br /></div>
<span style="font-size: x-large;"><b>
Note</b></span></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<ol>
<li>You can apply different styles (e.g. color) to paths (or markers) to discern multiple paths in one image.</li>
<li>Since there is often a limit on the length of request URL, you might need to squeeze your lat-long pairs in by encoding them: <a href="https://developers.google.com/maps/documentation/staticmaps/#EncodedPolylines">https://developers.google.com/maps/documentation/staticmaps/#EncodedPolylines</a>. </li>
<li>You can also have both markers and path at once by concatenating the parameters like such: <a href="http://maps.googleapis.com/maps/api/staticmap?size=800x800&markers=41.791421,-87.598077|41.791391,-87.599692|41.790013,-87.599676|41.790021,-87.599193&path=41.791421,-87.598077|41.791391,-87.599692|41.790013,-87.599676|41.790021,-87.599193&sensor=false">http://maps.googleapis.com/maps/api/staticmap?size=800x800&markers=41.791421,-87.598077|41.791391,-87.599692|41.790013,-87.599676|41.790021,-87.599193&path=41.791421,-87.598077|41.791391,-87.599692|41.790013,-87.599676|41.790021,-87.599193&sensor=false</a></li>
<li>You can use addresses instead of latitude-longitude pairs: <a href="http://maps.googleapis.com/maps/api/staticmap?size=800x800&markers=Chicago|DC|San%20Francsico&sensor=false">http://maps.googleapis.com/maps/api/staticmap?size=800x800&markers=Chicago|DC|San%20Francsico&sensor=false</a></li>
</ol>
</div>
<div style="background-color: white; border: 0px; margin-bottom: 4px; outline: 0px; padding: 0px;">
<ol>
</ol>
</div>
Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com0tag:blogger.com,1999:blog-3462060161172751048.post-68890841480303264612012-09-23T11:10:00.002-05:002012-09-23T11:15:14.127-05:00Infinite IFrame DemoI just made a demo on how to produce infinite nested iframes: <a href="http://infinite-frame.herokuapp.com/" target="_blank">http://infinite-frame.herokuapp.com/</a><br />
When I tested this, Chrome 21 and IE 9 are both susceptible to fetching and rendering all nested frames which could crash the browsers, i.e. a denial of service attack. (I set a limit on the demo to 100 frames as not to harm your browser or waste resource on my server but it can go on forever.)<br />
The app is deployed on <a href="https://www.heroku.com/" target="_blank">Heroku</a>, a lovely deployment service for development/small projects. Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com0tag:blogger.com,1999:blog-3462060161172751048.post-32140339382323320482012-08-02T11:26:00.000-05:002012-08-02T11:26:32.380-05:00用代理服务器翻墙体验墙内网络生活<b>背景</b><br />
很多人都发现很多以前能在国内网站上观看的视频现在都不能看了:显示的解释为你所在地区不能观看该视频。让人很有翻回墙内享受“受限制的幸福”:这样的状况实在讽刺。最近的一个热点是2012年伦敦奥运,转播权管制比较严,在海外不付费一般只能看到照片,很没劲(我觉得视频与照片的差别很少如此明显)。反观国内则有多个网站如<a href="http://cntv.cn/" target="_blank">cntv.cn</a>大量进行免费网络转播(当然,视频前广告不少),而且其关注的赛事也更符合国人的观看偏好(海外的转播会更关注本国运动员参与的赛事)。<br />
<br />
<b>原理</b><br />
因为所谓的“你所在的地区”是简单地通过检查<a href="http://en.wikipedia.org/wiki/IP_address" target="_blank">IP</a>地址区段来实现的,所以只要使用在中国境内的<i>代理服务器</i>(<a href="http://en.wikipedia.org/wiki/Proxy_server" target="_blank">proxy server</a>,一个在你与访问网站之间充当信息中转的角色),就能让访问网站看到一个中国区段内的IP,通过检测。(VPN,<a href="http://en.wikipedia.org/wiki/Virtual_Private_Network" target="_blank">Virtual Private Network</a>,也能实现这样的效果但这些服务需要收费——当然了,因此它们也相对更可靠。)<br />
<br />
<b>方法</b><br />
如何找到这些代理服务器呢?我的办法是用过Hide My Ass这个网站(呵呵呵,这个站名够逗的),它提供一个实时更新的可用公共(=免费)代理服务器的列表:<a href="http://hidemyass.com/proxy-list" target="_blank">http://hidemyass.com/proxy-list</a><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMx0Wva06WoP6n6vbI71Y8_KhD63jTXtvfpVZWvOp5-7Jtx0ExpbFRgymGMx_NjhA2rKsXo3NJ8o0vrsyCTybTYU4rSyvhNt8KI_68DtC-rFlfyGGWVbkPco3jkwCDdHmsoVLeyEaao6Tb/s1600/proxy_list.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="470" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMx0Wva06WoP6n6vbI71Y8_KhD63jTXtvfpVZWvOp5-7Jtx0ExpbFRgymGMx_NjhA2rKsXo3NJ8o0vrsyCTybTYU4rSyvhNt8KI_68DtC-rFlfyGGWVbkPco3jkwCDdHmsoVLeyEaao6Tb/s640/proxy_list.PNG" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">地区为中国的代理服务器列表截图</td></tr>
</tbody></table>
找到位于中国的代理服务器后,只需要把IP和Port的信息填入浏览器的代理设置里,之后浏览器的对外通讯就会经过你填入的代理服务器。在具体的浏览器里如何设置代理可参照(推荐使用Firefox,设置不需要改动系统设定而且很细节化,网上有带<a href="http://www.wikihow.com/Enter-Proxy-Settings-in-Firefox" target="_blank">图片的说明</a>):<br />
<h4 style="background-color: white; border: 0px; color: #4a4c46; font-family: 'Lucida Grande', 'Lucida Sans', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif; font-size: 16px; list-style-type: none; margin: 10px 0px; padding: 0px; text-align: left;">
Web browser instructions</h4>
<ul style="background-color: white; border: 0px; color: #4a4c46; font-family: 'Lucida Grande', 'Lucida Sans', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif; font-size: 13px; list-style-type: none; margin: 0px; padding: 0px; text-align: left;">
<li style="border: 0px; list-style-type: none; margin: 0px; padding: 0px 0px 5px;"><strong>Mozilla Firefox:</strong> Tools > Options > Advanced > Settings > Manual proxy configuration.</li>
<li style="border: 0px; list-style-type: none; margin: 0px; padding: 0px 0px 5px;"><strong>Google Chrome:</strong> Options > Under the hood > Network > Change proxy settings > LAN settings > Use a proxy server > Advanced > HTTP.</li>
<li style="border: 0px; list-style-type: none; margin: 0px; padding: 0px 0px 5px;"><strong>Internet Explorer:</strong> Tools > Internet options > Connections > LAN settings > Use a proxy server > Advanced > HTTP.</li>
<li style="border: 0px; list-style-type: none; margin: 0px; padding: 0px 0px 5px;"><strong>Opera:</strong> Tools > Preferences > Advanced > Network.</li>
</ul>
<div style="text-align: left;">
<span style="color: #4a4c46; font-family: Lucida Grande, Lucida Sans, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif; font-size: x-small;">(instructions from <a href="http://hidemyass.com/" target="_blank">hidemyass.com</a>)</span></div>
<div style="text-align: left;">
<span style="color: #4a4c46; font-family: Lucida Grande, Lucida Sans, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span></div>
<b>安全</b><br />
因为设置代理后该浏览器的所有对外通讯(除了设置为例外的目标地址)都会经过代理服务器,有隐私上的隐患(比如登录人人这种只用HTTP协议的网站):代理服务器会不会偷看你发送给访问网站的信息我们无法控制。所以我的建议是:<br />
<br />
<ol>
<li>使用两个浏览器 :Firefox加上Chrome/IE/Opera/others其一,并通过Firefox来使用代理服务器,因为它不需要改动系统设置,这样只有Firefox的对外通讯通过代理服务器,另一个浏览器能如常使用(保持原IP,通讯不经过代理服务器)。</li>
<li>不要在使用代理服务器的浏览器里登录你在任何网站上的帐号,以免<a href="http://en.wikipedia.org/wiki/Man-in-the-middle_attack" target="_blank">man-in-the-middle attack</a>以其登录信息、隐私数据的泄漏。只用来浏览网页,看看视频就好。</li>
</ol>
<div>
<b>结语</b></div>
<div>
除了用于体验“墙”内的网络生活,其实使用这些代理服务器还能干很多别的,比如躲过某些网站对同一IP注册账户数的限制,测试某个网站在某个地区具体的浏览效果,当然了除了回中国还可以去体验其他国家的网络生活。
</div>Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com1tag:blogger.com,1999:blog-3462060161172751048.post-24627029652447375802012-07-10T03:50:00.001-05:002012-07-10T10:36:30.015-05:00Donation Buttons GadgetI spent some time today to put two popular payment processing services' -- <a href="https://wallet.google.com/" target="_blank">Google Wallet/Checkout</a> and <a href="https://paypal.com/" target="_blank">PayPal</a> -- donation buttons together: this will hopefully capture a wider stream of donation by providing more convenience to my readers.<br />
<br />
The gadget validates the donation amount (with <i>friendly</i> responses to errors) before submitting them to respective services. It also tracks button clicks with Google analytics event tracking (with the two payment services differentiated by labels).<br />
<br />
The HTML/Javascript source code is hosted at <a href="https://gist.github.com/3082002" target="_blank">https://gist.github.com/3082002</a>. The gadget looks like the one here in the sidebar. You can copy and paste it into your blog or website (the instruction is given in comments). Before you can accept Google checkout donation from the gadget, you also need to uncheck "My company will only post digitally signed carts." at your Google merchant account's settings>integration setup page.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsQoBpO89dTGTo4zzBG6m3aFK9Rom9EBGVMakRBjmgBjSVpTjkiRffzdO_LhX7zTKzIHOelIJF-RHuKbfnf499_D-YLJvWC6Gsq1zDCDQ51eFftdi8DupVjZGUTRWA0DO9J50_SenSwt9T/s1600/donation_gadget.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsQoBpO89dTGTo4zzBG6m3aFK9Rom9EBGVMakRBjmgBjSVpTjkiRffzdO_LhX7zTKzIHOelIJF-RHuKbfnf499_D-YLJvWC6Gsq1zDCDQ51eFftdi8DupVjZGUTRWA0DO9J50_SenSwt9T/s320/donation_gadget.PNG" width="236" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The donation gadget should look like this.</td></tr>
</tbody></table>
If you like it, you can always buy me a coffee. Leave me a comment if you have a question or suggestion.<br />
<br />
(Check out the error messages by typing in "abc", "0.5", and "999" in the donation gadget before you go. Let me know if you have better ideas for the messages.)Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com0tag:blogger.com,1999:blog-3462060161172751048.post-3509103476621346902012-05-07T15:23:00.002-05:002012-05-09T19:38:59.541-05:00Free Will and DeterminismI recently read the introduction to <i>History of Civilization in England </i>by Henry Thomas Buckle (1821-1861). In this long essay, he outlined his dissatisfaction of history study being a collection of facts and called for its transformation into a proper science, which generates knowledge in the form of causal connection. He made many insightful remarks and one that got me thinking is about free will vs. determinism. He Obviously took the determinist position when he claimed that if he has enough information about the circumstance which his well acquainted friend is in, he can predict with certainty what his friend will do next. He keenly pointed out a problem of free will. Before we can have a meaningful discussion, I want to make explicit the essential conception of a <i>free will</i>. We think of a free will as an <i>active</i> agent capable of dictating one's thoughts and actions <i>independent </i>of one's experience or the given circumstances. Buckle's insight is that in order to <i>freely</i> will, we need to have another authoritative agent independent of deterministic laws to inject such decision into our consciousness given that the physical universe evolves according to deterministic laws. But how does that agent operate? Given that it lives in a world also evolves according to some deterministic laws, since it has to be free as well, it would require yet another free active agent. (This kind of reasoning is not unlike Descartes's notion of mind-body duality, which is wittily summarized as "ghost in the machine" by Gilbert Ryle.) Thus we enter an infinite regression that unsuccessfully evades the contradiction between determinism and free will.<br />
<br />
This is a tough question because one is reluctant to give in entirely to either side. Some people suggested that quantum physics might hold the answer due to the truly<i> <a href="http://en.wikipedia.org/wiki/Hardware_random_number_generator#Physical_phenomena_with_quantum-random_properties" target="_blank">rando<span id="goog_1118460890"></span><span id="goog_1118460891"></span>m</a> </i>events allowed in quantum physics. I initially felt unsatisfied by such proposal because we want to think of will <i>actively, </i>instead of <i>randomly</i> decides on things. But lately I came to realize that <i>in observation</i> <i>of a single act</i>, the two are <i>indistinguishable</i>! My worry was due to my subjective experience of <i>activeness.</i> Let's put aside the subjective content and imagine an experiment in which Buckle watches his well acquainted friend for a while and then predicts what his friend will do next. If free will exists, Buckle's friend will be able to decide on things <i>independent </i>of his experience and as a consequence, Buckle will not be able to predict with certainty even with all the information. In observation, that is precisely what you expect from a random event whose outcome is independent of the past. Although our subjective experience is too intricate to give us direct clues, the unexpectedness of a certain decision might have germinated from a seed of randomness allowed by quantum physics.<br />
<br />
This resolution proposes that we give up the deterministic view, which arguably is suggested and supported by classical physics, to allow for some non-deterministic events, which is supported by quantum physics, our current best knowledge. This answer might still upset people believing in free will, because randomness seems to dismiss one's active <i>control </i>over his or her life. But the pursuit for the possibility of <i>control </i>only pulls us back to the infinite regression. While the moral implication in absence of an active agent is interesting to consider, I think I will spend more time on pondering about how quantum mechanics allows for randomness when all its laws, like those in classical physics, are <i>deterministic</i> (in probability)<i>. </i>In quantum mechanics, randomness creeps in at the act of <i>measurement </i>whose outcomes' probabilities are predicted by input and laws, but not the outcome itself. I will subject further discussion on this topic to a future article. Let's revisit our thought experiment and introduce a modification: instead of predicting the exact action of his friend, Buckle will predict the probability of each possible action and we shall repeat the experiments many times (maybe with identical clones of his friend). If free will can actively control one's decision, Buckle's friend can decide how frequently he wishes to do a certain thing and thus he can manipulate the frequencies of each action rendering Buckle's prediction of probability incorrect. This is why the condition of "a single act" is needed in my statement of indistinguishability. However, this experiment is hard, if not impossible, to carry out because after each decision, the state of Buckle's friend changes and <a href="http://en.wikipedia.org/wiki/No-cloning_theorem" target="_blank">cloning the quantum state of Buckle's friend is impossible</a>: we need to find some decision whose probability does not change when repeated. Hence a definite answer to whether free will exists, and if so whether it exists in the weak, random form or the strong, ghost form, is not known yet.Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com6tag:blogger.com,1999:blog-3462060161172751048.post-46831020159449189582012-05-02T12:30:00.001-05:002012-05-02T20:04:13.943-05:00Text Encoding Conversion<div>
I recently learnt about text encoding and was motivated to write <a href="https://gist.github.com/2578542" target="_blank">a simple program</a> to convert the MP3 tags in batches (most of my Chinese songs' tags were not encoded in UTF-8, the standard across many platforms nowadays). I will try to give a list of the essentials about text encoding and conversion and then talk a bit about the program I wrote.<br />
<br />
<b>What are Encoding, Decoding and Conversion?</b><br />
1. the characters, i.e. symbols, need to be stored in a (binary) physical representation on the computer. The mapping from the symbols to the physical representation is called <i>encoding </i>and the inverse mapping is called <i>decoding</i>. For example, when you read a text file from your hard drive to display on the screen, the program decodes the file content to know what to draw on the screen, and when you save the text file, the program encodes the content into the file. As you might imagine, there are many encoding schemes or <i>codec</i> out there. This creates a problem when a program reads a file with a codec different from the one used to save it.<br />
<br />
2. <i>Conversion </i>is a mapping from one physical representation to another such that the decoded text of the output are the same as the decoded text of the input. Conversion is tedious since we need to construct the mapping between the desired encoding pair that might follow very different structures and thus it is hard to automate. (If you are lucky, people have written it before you.) Then <a href="http://unicode.org/" target="_blank">Unicode</a> comes to rescue us. Unicode solidified the identity of symbols, which are the abstract beings that we human really care, into code points for each linguistic symbol in every major languages in the world. So now, we can simplify the conversion between any encoding pair by first decoding the binary to Unicode -- this mapping is written for most encoding normally used -- and then encoding them into the desired encoding. Python provides very good <a href="http://docs.python.org/howto/unicode.html" target="_blank">Unicode support</a> and Python 3's string is represented in Unicode (handy in handling file names).<br />
<br />
3. It is hard for a program to determine what encoding the file is saved in given only the file content in binary. There are various protocols to communicate this information, e.g. the charset declaration in HTTP response and Windows's BOM prefix to txt files. Another solution is to agree on using an encoding large enough to accommodate most, if not all, linguistic symbols, so every program from now on can assume this encoding: like everything is written down in the same language. The standard now is <a href="http://en.wikipedia.org/wiki/UTF-8" target="_blank">UTF-8</a> and so you usually want to convert text encoded in other encoding to UTF-8 for compatibility with latest software.<br />
<br />
<b>What does my program do?</b></div>
<div>
As you expect, it converts MP3 tags encoded in <encoding> into UTF-8. You<i> need to supply</i> your guess for <encoding> -- I will talk briefly about auto-detecting encoding later. In default, I set the guess to GBK, the most common encoding present in Chinese songs' MP3 tags. This is the culprit that caused all the mess in displaying song information on mobile devices. For a list of acceptable codecs, look here: <a href="http://docs.python.org/library/codecs.html#standard-encodings">http://docs.python.org/library/codecs.html#standard-encodings</a>. One cool feature of my program is that it converts the tags character by character and preserves<span class="Apple-tab-span" style="white-space: pre;"> well-formed </span>UTF-8 characters. This design has two advantages. First, I observed that some tags have mixed characters in UTF-8 and other encodings: the other encoding does not have the needed character so some characters were encoded into UTF-8. This technique solves the problem easily. Second, more importantly, this technique makes it safe to run this program<span style="white-space: pre;"> </span>multiple times over the same files because it won't change the previously converted content in proper UTF-8.<span style="white-space: pre;"> </span></div>
<div>
<span style="white-space: pre;"><br /></span><br />
<span style="white-space: pre;"><b>Using my program</b></span></div>
<div>
To use this utility (you will need python and mutagen library), download and save the program here: <a href="https://gist.github.com/2578542">https://gist.github.com/2578542</a>. And in your command prompt or shell, type:<br />
<div style="text-align: center;">
<i>python mp3_tag.py</i> [<dir>]
</div>
</div>
<div style="text-align: left;">
where <dir> is the directory of MP3 files (handles the current directory if <dir> is missing). This is an example output (a log file will be created too):<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGbuaSYtJWu22DYi8zP2rMYmhm8U6eE_upBa2dfSo-fqp_QIiEf9RD9mpkPK_f_h4c0kSTF6xgfNhFQ-J4ST1iBeLqkcTcqkhR0rKNiHy2e33SDYm0mYKNK5im_54vbnyHtNK2uE8MfpuR/s1600/mp3_tag_output.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="448" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGbuaSYtJWu22DYi8zP2rMYmhm8U6eE_upBa2dfSo-fqp_QIiEf9RD9mpkPK_f_h4c0kSTF6xgfNhFQ-J4ST1iBeLqkcTcqkhR0rKNiHy2e33SDYm0mYKNK5im_54vbnyHtNK2uE8MfpuR/s640/mp3_tag_output.PNG" width="640" /></a></div>
</div>
<div>
<br />
<br />
<div>
<b>A note for Windows users</b></div>
<div>
I used <a href="http://code.google.com/p/mutagen/" target="_blank">mutagen</a> to access and save MP3 tags. It reads many different formats of MP3 tags but saves all output tags uniformly in ID3v2.4 format which works fine on mobile devices and various modern MP3 players but it is not supported by Win 7 file explorer and the Windows Media Player. (They only support tag versions up to ID3v2.3.) So after conversion, you will see many "?" in the MP3 tags. To solve this problem, you will need to convert the tags to ID3v2.3 with other tools. I used iTunes to do that (right click on the highlighted song(s) and choose "Convert ID3 Tags..." and then select ID3v2.3):</div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7Hi8Orcos4YjfqvSosxfT8DxRQi_K-43Ogy6booluiHI2Cy5RC6A_IkkN8n66WfUZLdqhlcKfGQnepzTF9b2vnmybsfMdYkkqsxISpb_40W22Nh6EdW3D-XL88Rb72JkxRY6ti6G5LAzf/s1600/itunes_convert_id3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7Hi8Orcos4YjfqvSosxfT8DxRQi_K-43Ogy6booluiHI2Cy5RC6A_IkkN8n66WfUZLdqhlcKfGQnepzTF9b2vnmybsfMdYkkqsxISpb_40W22Nh6EdW3D-XL88Rb72JkxRY6ti6G5LAzf/s400/itunes_convert_id3.png" width="303" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>How to detect the encoding?</b></div>
<div class="separator" style="clear: both; text-align: left;">
This is a nontrivial problem because it takes more than a program to determine whether the decoded text <i>makes sense</i>. The funny symbols you get by using a wrong codec are perfectly normal in a different language. It takes a lot intelligence to determine if you use the correct codec. Some modern browsers provides some capabilities to detect the encoding on a page. One idea would be to see if the decoded text fall into some range of frequent characters of some languages. But this only solve some wrong guesses since a page might contain a wide mix of symbols than your assumption. In the context of MP3 tags, let's suppose that Big5 and GBK both decode this same binary but to very different texts and so the assumption on songs using only frequent characters is not a good one because some songs' names do use rare characters. One solution I thought of is to use search engines to select the codec that gives most result on the web: one problem is that many songs are decoded wrongly in the same way of the one sitting in your computer (so wrongly decoded texts often yield much more result than you expect). The other solution I thought of (and actually used to fix conversion errors) is to use <a href="http://www.soundhound.com/" target="_blank">SoundHound</a>, a very cool app that can reverse search songs, to listen to a song and return me the song information. (This method could also help you recover the names of forgotten songs in your computer.) Right now, it is a bit silly and time-consuming to do this to a lot of songs as it must be done by hand (unless you reverse engineer SoundHound). I am hoping that SoundHound will release an API soon so this could be automated. (Besides one can use its API do make a Sing Something!)</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: -webkit-auto;">
<b>Coda</b></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="text-align: -webkit-auto;">Regarding the source code, I do not provide any warranty but you are free to do whatever with my code. It edits some tags of your MP3 files, specifically only the album, artist, album artist, performer, and genre fields (you can modify the code to edit more or less fields) so you might wanna test it on a few duplicates before running it on your entire music library.</span>
</div>
</div>
</div>
<div>
</div>Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com0tag:blogger.com,1999:blog-3462060161172751048.post-10306751857188705732012-05-01T01:02:00.002-05:002013-04-02T17:01:57.301-05:00Campus Safe Ride Lookout App<span style="vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;">This is my submission to <a href="http://techincubator.uchicago.edu/page/vote-your-favorite-app" target="_blank">2012 UChicago Mobile App Challenge</a>. It is a rather simple idea inspired by the need to wait for University of Chicago safe ride shuttle outside at night (possibly in bad weather) due to the lack of arrival information of the shuttle ahead of time. This app aims to solve exactly the information communication problem.</span></span><br />
<b><span style="font-family: inherit;"><span style="vertical-align: baseline; white-space: pre-wrap;"><br /></span></span></b>
<b id="internal-source-marker_0.7880965508520603"><span style="font-family: inherit;"><span style="vertical-align: baseline; white-space: pre-wrap;">The Idea</span></span></b><br />
<b id="internal-source-marker_0.7880965508520603"><span style="font-family: inherit;"><span style="font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">This app will be in constant look out for the safe ride shuttle for you. </span><br /><span style="font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="vertical-align: baseline; white-space: pre-wrap;">The Problem</span><br /><span style="font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Safe ride is a great service provided by the University and many friends I know use it regularly to get to places not served by the University shuttle at nighttime or in bad weather. The most important concern -- they put it in the name -- safe ride tries to meet is safety. Arguably, convenience of the rider is another concern. But these commitments have been challenged by the unpredictable wait time. This creates problems: standing in the cold or at very late hours is not very pleasant, much less is it safe. At the same time, safe ride drivers would like the riders to be ready to get on the shuttle when they arrive. It is a very reasonable request that saves everyone's time, but in practice, because the approach of the shuttle is not always well communicated in advance and the wait time is unpredictable, many riders and drivers miss each other. The result is that both the riders and drivers are unhappy.</span><br /><span style="font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">My app will solve these problem to make using safe ride even safer and more convenient. By providing users with more information about the location of the shuttle and notifying the user when it comes within the vicinity of the user, the user can minimize their time exposing in the cold or to danger and the shuttle can wait less and run more efficiently. </span><br /><span style="font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="vertical-align: baseline; white-space: pre-wrap;">The App</span><br /><span style="font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">This location-based service (LBS) app notifies its user to walk outside when a safe ride shuttle is approaching the user's location. There will be two components to this app. One component lives on the shuttle driver's smartphone to acquire location data (via GPS or Wifi) and send the update of the shuttle location back via data network or SMS message to a server backend. The other component lives on the user's phone to acquire the user's location (via GPS or Wifi) and show the safe ride shuttle's latest location on a map (only) when it comes within the proximity of the user. So the user can get prepared and head outside before the shuttle arrives. </span><br /><span style="font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"></span><br /><span style="font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">The limit on the viewing of the shuttle location to the user's vicinity is designed to enhance security by only informing the needed audience. Also, the app will require a UChicago email address to sign in to make the information of location of the shuttle even more secure. There are a lot more this system can do beyond these basic capabilities. For example, the user can make reservation from his or her app with a click since the app knows his or her location (and with this feature, we can only disclose the shuttle location to users that have made a reservation).</span></span></b><br />
<b><span style="font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;"><br /></span></span></b>
<b><span style="font-weight: normal; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;">This is my very first youtube video in which I proposed this app:</span></span></b><br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/fMmmyrrAmfQ?feature=player_embedded' frameborder='0'></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you like the idea, like the video, share it with your friends and vote for Safe Ride Lookout at the <span style="white-space: pre-wrap;">2012 UChicago Mobile App Challenge! I will update the progress here before it becomes significant enough to move to its dedicated space.</span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="white-space: pre-wrap;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="white-space: pre-wrap;"><b>Update</b></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="white-space: pre-wrap;"><b><br /></b></span></div>
<div class="separator" style="clear: both; text-align: left;">
<b>5/10/2012</b></div>
<div class="separator" style="clear: both; text-align: left;">
Vote for this app at: <a href="http://techincubator.uchicago.edu/page/vote-your-favorite-app">http://techincubator.uchicago.edu/page/vote-your-favorite-app</a> so safe ride may survive and improve. My hope is that this app along with an automated reservation-dispatch system, which I suggested above, might save the cost needed to keep this service alive.</div>
Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com4tag:blogger.com,1999:blog-3462060161172751048.post-21341924427939503512012-04-09T01:04:00.003-05:002012-04-09T02:28:33.503-05:00One Cause of Slowdown in Android PhonesI think many Android phone users are <i>misled </i>into flashing their ROM's frequently and do so as a routine to improve their gradually slowed down phones. Custom ROM's have their indisputable utility but without understanding the cause of system slowdown, changing the ROM only obscures the diagnosis by introducing new factors into the problem and thus it might not solve the problem at all.<br />
<br />
I used a <a href="https://www.google.com/search?q=Moto+Milestone" target="_blank">Moto Milestone</a>, one of the early popular Android phone, with Android 2.2 a.k.a. Froyo (the ROM was built for some European carrier because Milestone, the GSM counterpart of Moto Droid, was not sold by any carrier in the US). The system was very responsive when I wiped all the data and first flashed it on. Then noticeable slowdown appeared as time passed. After trying a few things, I discovered one simple (and easy) cause:<br />
<div style="text-align: center;">
<i>much of the slowdown is due to the growth of user generated data and that</i><i> some of them are regularly loaded into memory for access (via <a href="http://developer.android.com/guide/topics/providers/content-providers.html" target="_blank">content providers</a>). </i><br />
<i><br /></i></div>
<div style="text-align: left;">
Thus by regularly (backing up if you want to keep the data and) clearing <i>call log, messages, </i>etc,<i> </i>I restore the speed on my phone with ease (without worrying about what is in a new ROM). With the exponential growth in phones' RAM, this will become less a problem and if the programmer practices more care and loads only a small portion of all data at a time: for example, the user does not usually need to see the call history from last week everytime he or she goes into call log. </div>Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com2tag:blogger.com,1999:blog-3462060161172751048.post-27264027249704853332012-02-22T09:41:00.008-06:002013-03-03T18:26:08.784-06:00Insyde BIOS Advanced SettingsI like to focus on details, often to a painstaking degree: I feel the constant need to adjust the balance between the details and the whole. So when I got my new laptop, I quickly went its BIOS settings and tried to examine all its available settings and whether they are fine tuned for the best performance (CPU states/voltages, memory latency/clock, etc are crucial to achieving this goal).<br />
<br />
So I got a <a href="http://www.shopping.hp.com/series/category/notebooks/dv6tqe_series/3/computer_store" target="_blank">HP Pavilion dv6tqe</a> recently and its BIOS is from Insyde. I have never seen this vendor: back when I got my last laptop, I only saw Award, AMI, and Phoenix BIOS around in the market. Anyhow, that only shows how remote I have been from the field. The BIOS settings very much disappointed me with its about ten options with the only meaningful one being the boot order configuration. I went online and searched for something relevant to<i> enabling advanced settings on Insyde BIOS </i>and there are quite some discussion around this topic, including flashing a modded firmware to BIOS and this wonderfully simple solution of<br />
<div style="text-align: center;">
<i>pressing the A key (for "Advanced"?) after pressing the F10 key (this gives your the BIOS setting page)</i>.<br />
<br /></div>
I verified that this works with my BIOS with BIOS version F.13 (update: and F.1B). And here is a screenshot.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvaxcZ0zpCSBT_5LsszDIAV6TZKZy9T4oZ1vqPntRHeHdAeJWRQtDb4bmNcARJHTid2DNStqKH79SDUqOVU3_tMYw2UzOZAuEjwQyNLVbxbDv7ENBeUL5Kw_r53Q4mc4zBWa2YaesBMij-/s1600/2012-02-22_09-03-33_218_Chicago.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="478" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvaxcZ0zpCSBT_5LsszDIAV6TZKZy9T4oZ1vqPntRHeHdAeJWRQtDb4bmNcARJHTid2DNStqKH79SDUqOVU3_tMYw2UzOZAuEjwQyNLVbxbDv7ENBeUL5Kw_r53Q4mc4zBWa2YaesBMij-/s640/2012-02-22_09-03-33_218_Chicago.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Notice that there are two new tabs named Advanced and Power.</td></tr>
</tbody></table>
There is one thing to note though: if you set a BIOS administrator password (which you should and many people forget to do), pressing the A key cannot get you to the advanced mode. You will have to clear your admin password and follow the procedure.Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com56tag:blogger.com,1999:blog-3462060161172751048.post-84005069879758655692012-02-19T16:33:00.002-06:002012-02-19T16:34:46.881-06:00Google Multiple Sign-in<div class="separator" style="clear: both; text-align: left;">
Google multiple sign-in is a handy feature if you have more than one Google account and you want to switch between them without logging in and out every time. (This log in and out action is still needed for a technical reason which I will point out at the end.) I use it often to switch between my accounts when checking emails (in this way, you can easily have multiple Gmail storage). Note that you need to enable multiple sign-in for your accounts at the <a href="https://www.google.com/settings/" target="_blank">account setting page</a> before you can use this feature.</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD9uGlYMSqNuENVHDdVbvnF6BoU5JTR6_Ur6-XDOEf1CB6cftI6gNceufgmXWyjdvRIN3Bfsj_ZtzzumajAxsjJiuWFQaV13glX797ZGdNrHFQCjqi47Y2jc7-q6FhFJYLVumd3zUzz7zN/s1600/multi_signin1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="177" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD9uGlYMSqNuENVHDdVbvnF6BoU5JTR6_Ur6-XDOEf1CB6cftI6gNceufgmXWyjdvRIN3Bfsj_ZtzzumajAxsjJiuWFQaV13glX797ZGdNrHFQCjqi47Y2jc7-q6FhFJYLVumd3zUzz7zN/s640/multi_signin1.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The switch account button is highlighted on the right.</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi2145xqi62OJGLm9TfKzlGNUvN94HWCQfSVMJLIPD6J5iDNhiRN1ITKCXT-1d_8cZsAFzop4CFHphLQMwP9XPb1LyJkj0cqkYu69Q7ar-1shaFaiEHVIGpH_rZ-yqbgxEBFa28USL3u0q/s1600/multi_signin2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="174" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi2145xqi62OJGLm9TfKzlGNUvN94HWCQfSVMJLIPD6J5iDNhiRN1ITKCXT-1d_8cZsAFzop4CFHphLQMwP9XPb1LyJkj0cqkYu69Q7ar-1shaFaiEHVIGpH_rZ-yqbgxEBFa28USL3u0q/s640/multi_signin2.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">On the list of signed in accounts, the one that you first signed into is marked with (default).</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
Although this feature is convenient, it is not supported uniformly well across all Google services. In any case, all sites will recognize your account as the default account which is the one that was first signed in and some of them will let you switch between signed in accounts. The implementation on the popular services such as Gmail, Google docs, and Google Calendar are seamless but not so for some others like Google Wallet (a.k.a. Google checkout). In fact, it can be really confusing sometimes.</div>
<div class="separator" style="clear: both; text-align: left;">
If you want to change the default signed in account, there is no click-a-button method to accomplish that at the moment (which should be implemented soon by Google I hope) and so you have to log out (which logs you out of all signed in accounts) and log into the account you wish to make default.</div>Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com4tag:blogger.com,1999:blog-3462060161172751048.post-78521647300322507252012-02-12T04:41:00.000-06:002012-02-12T04:41:50.589-06:00Regular Fasting in WeekendI think the feeling of hunger is a vital part to one's sensitivity which aids the individual's survival by <i>reminding that his or her mental state is bound to the physical being of the body</i>. However, in daily life, I found that eating has often become a scheduled task which occurs at a regular schedule without regard to whether or not one feels the need to do so. (This is made possible by the modern efficiency in producing food and there is undoubtedly good reasons for it.) Arguably in modern age, an overwhelming emphasis is placed on the <i>intellectual</i> as opposite to the <i>bodily</i> in a fashion as if the two were separable and the body mainly exists to sustain the intellect. Gradually, eating as a task becomes mechanical and contrived. We often seek to disrupt this growing numbness by trying new food, but I think a better solution is to feel the essential feeling of hunger again by fasting. For the past few years, I usually skipped a meal on Saturday and/or Sunday and that helped restore my integral sense of body and mind.Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com0tag:blogger.com,1999:blog-3462060161172751048.post-29108682518428579742012-01-19T20:26:00.002-06:002012-01-21T08:29:18.254-06:00What If a Tree Fell in a Forest and No One Hears...This is a classic philosophical puzzle: what if a tree fell in a forest and no one hears, did the tree fall? I take this essentially as a question on <i>existence</i>: does something exist if it does not register on anyone's mind? The tempted answer is yes followed by the further question "but how do you know that?" The difficulty lies in the confusion of the knowledge of existence and existence itself. In physics, quantum mechanics has provided an amazing distinction between the two and I shall explicate that in a later article.<br />
<br />
My answer is simple. The event exists, i.e. the tree fell, and if you ask how I know it, I will respond: you just told me <i>that</i>. My point is that the knowledge of existence requires existence whereas the converse does not hold in general or there is no way to test such condition: in the example, you have to convey that to me in the question. Because for us to <i>know</i> that something <i>exists</i>, we must observe it, i.e. in daily experience, existence and our knowledge of it are bundled together. (That explains the common confusion of the two concepts.)<br />
<br />
P.S. Existence is a deep issue in many disciplines and it fascinates me for long. I will try to remark on it<a href="http://blog.falcondai.com/search/label/existence" target="_blank"> from different perspectives in the future</a>.Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com2tag:blogger.com,1999:blog-3462060161172751048.post-35921475889972434522012-01-19T19:42:00.001-06:002012-01-21T08:23:13.147-06:00Anxiety over OptionsI thought at length how to "allocate" my content on the web. Nowadays, in stark contrast to the past, there are many portals for hosting/presenting personal content: social network sites, blogs, video hosting sites, photo hosting sites, etc. Sometimes, this creates anxiety as where to share a specific piece of content: maybe LinkedIn for professional stuff, Facebook for fun, etc. And the ease-of-use offered does come with a price which is the uniqueness of representation, what many people long for. So I have come to these conclusions:<br />
<br />
<ol>
<li>personal websites are definitely not dead yet and I think its niche lies in the radical pursuit of identity, e.g. it is cool to own the domain name same as your name.</li>
<li>there is inherent ambiguity in the intended use of web services, e.g. your mother just friended you on Facebook, using Google forms as database (I recently went to a business school workshop in which the speaker built his minimal viable product using free/very cheap web services), etc.</li>
</ol>
<br />
I think seeing all the web services as tools is helpful. Like what Marx once said, <i>the discovery of functions of an object is history</i>, as opposed to viewing functions of an object limited to its initial design. A good example is apple, i mean, a real apple, not Apple, Inc. Imagine that scientists discovered besides of being a delicious snack, some scientists discover its anti-cancer effect someday. It might be argued that the anti-cancer effect has always been a function of apples and my point is really about the human knowledge of functions. But that is crucial bit: even if the function is eternally associated with a certain object, it is useless without our discovering it (c.f. <a href="http://blog.falcondai.com/2012/01/what-if-tree-fell-in-forest-and-no-one.html" target="_blank">the question about existence</a>). And in fact, I do not subscribe to the view of regarding functions as inherent properties of objects, but human constructs instead.<br />
<br />
Okay, back to the question on personal content allocation, my solution is to use this blog really as a public log (the term blog came from web log) and will share most of my meaningful thoughts here for the ease to maintain (and then put the links onto other social sites) and build a very simple website as a portal for unique identity.Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com0tag:blogger.com,1999:blog-3462060161172751048.post-38977359021705600582012-01-16T10:55:00.003-06:002012-01-21T08:30:26.642-06:00Polishing My Blog<div>
As I have mentioned in <a href="http://blog.falcondai.com/2012/01/rebooting-my-blog.html" target="_blank">a previous post</a>, I stopped blogging for a while and I blogged when <a href="http://wordpress.org/">Wordpress</a> did not exist (and Blogger was still Blogspot). The balance between ease to use and detailed customization is hard to achieve. Wordpress chose the radical strategy to provide its source code, thus the (almost) ultimate customizability while supporting an extensive set of add-ons (similar to blogspot's): I think the opensource aspect arguably popularized Wordpress and made its extensions more successful.<br />
<br />
My experience with Wordpress comes from the building of a few websites for my friends and organizations: Moneythink China (<a href="http://www.moneythink.cn/">http://www.moneythink.cn/</a>) and CSSLC (the site I built was closed and this is the new site: <a href="http://csslc-focus.com/">http://csslc-focus.com/</a>). Overall, I had a positive experience: there are some issues with add-on compatibility but it is not hard to fix it with some PHP knowledge.<br />
<br />
I have played around with the new gadgets and customization Blogger provides over the weekend to polish my blog a bit. I started with a ready-made template by Awesome, Inc. for better browser compatibility (the dynamic template does not run on iPad) and adjusted some <a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets" target="_blank">Cascading Style Sheet</a> (CSS) code, added my own title background image (I guess I will call it <i>Beyond Limits: </i>it is a wooden fence common in Texas in the foreground) that suits the color theme of the template, drew <a href="http://blog.falcondai.com/favicon.ico" target="_blank">my own favicon</a> (and that was fun), etc. One complaint I have for Blogger is the long load time which is probably due to the amount of redundancy in CSS code:<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWKE_fxUS3l3VsYb62iS1Oin4hh20zpy9DtlmyzH8-ngLw7nIssUVFueXHPpu7_XJhzAYnX65WRirvdqeI1Onryhf0JlDoGMii8dwtEV13TC8doXvfTHnU-dVBWUXRrziVGZrqylmJ9CJY/s1600/load_time.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWKE_fxUS3l3VsYb62iS1Oin4hh20zpy9DtlmyzH8-ngLw7nIssUVFueXHPpu7_XJhzAYnX65WRirvdqeI1Onryhf0JlDoGMii8dwtEV13TC8doXvfTHnU-dVBWUXRrziVGZrqylmJ9CJY/s640/load_time.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small; text-align: -webkit-auto;">the page is rendered 2.41s after GET request: I think that is quite slow considering that I have very little static assets on the page.</span></td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSw2oQ8no7vZ2BZG-l9pPR5LxLZJ6qmp75wOwnTBD-Rev74DoUGrBxK4kXECOobHLaJHOszf27iOsVrweF6JnMnP85otIFjZnWbLU3an7ySovotcBjD_WqvjoOwapwhj89IqhAsydJVmh_/s1600/css_redundancy.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="342" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSw2oQ8no7vZ2BZG-l9pPR5LxLZJ6qmp75wOwnTBD-Rev74DoUGrBxK4kXECOobHLaJHOszf27iOsVrweF6JnMnP85otIFjZnWbLU3an7ySovotcBjD_WqvjoOwapwhj89IqhAsydJVmh_/s640/css_redundancy.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">A cleanup of redundant CSS code is recommended by <a href="http://code.google.com/chrome/devtools/" target="_blank">Google Chrome Developer Tools</a>. </span> </td></tr>
</tbody></table>
<span style="text-align: center;"><br /></span></div>
<div>
<span style="text-align: center;">I am not </span><span style="text-align: center;">surprised by the redundancy since the add-on's come with their CSS and the template will try to override them and then there is user customization but if a user is allowed to go in and have more control over how a page is rendered: in case of Wordpress, you can edit (almost) everything! </span></div>
<div>
<span style="text-align: center;"><br /></span></div>
<div>
<span style="text-align: center;">The other complaint I have is the</span> customizability <span style="text-align: center;">for the mobile template: the default page is usually clean and slick but the way how customized items from the web version are used in the mobile version is outside of user control and that might mess things up. </span></div>
<div>
<span style="text-align: center;"><br /></span></div>
<div>
<span style="text-align: center;">Please let me know if you have any suggestions about the look of my blog.</span></div>Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com4tag:blogger.com,1999:blog-3462060161172751048.post-72797897907879006212012-01-13T08:54:00.003-06:002012-01-13T08:54:41.882-06:00Refining My Google+ Profile<div>
Continuation of the talk on online presence management.<br />
<br />
As you might notice, yesterday Google undertook an aggressive move to push its social network <a href="http://plus.google.com/" target="_blank">Google+</a> by <a href="https://www.google.com/insidesearch/relatedpeople.html" target="_blank">integrating results from Google+ into Google search result</a>. I am excited to see this because I planned to talk about how to make yourself <i>more visible</i> while controlling the content with Google+.<br />
<br />
Visibility is subtle: you want to show the right people the right content. And Google+ lets you do just that with circles. I had updated <a href="https://plus.google.com/100753323689686892506/about" target="_blank">my Google+ profile</a> to include my contact information and associated my profiles elsewhere: you can even control whom to share the information (almost) per text field. </div>Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com0tag:blogger.com,1999:blog-3462060161172751048.post-52318393158339998162012-01-09T13:06:00.001-06:002012-01-21T08:32:17.987-06:00Monitor Your Online Presence<div>
Online Presence Management is a big topic and is growing with ther availability of personal info online. I am learning how to do things right in this area and I intended to <a href="http://blog.falcondai.com/search/label/online%20presence" target="_blank">log what I did</a> and hopefully this will be useful for others. <br />
<br />
The approach I took to accomplish the <i>goal</i> <br />
<div style="text-align: center;">
controlling what others see about me on the web</div>
starts with understanding how someone finds <i>you</i>.<br />
<br />
The answer is rather obvious for most people: Google. Therefore we should care about the google search results of our names on the first few pages (or as many as you feel adequate). Seeing what others will probably read about you will guide the future moves.<br />
<br />
The natural question here is:<br />
Google search results change with time (like everything else), how do I keep up with it?<br />
<div style="text-align: center;">
set up a <a href="http://www.google.com/alerts" target="_blank">Google alerts</a>!</div>
<div style="text-align: left;">
I have set up Google alerts for my name and email addresses so I can receive notice as soon as new search result regarding them appear.<br />
<br />
You might also want to know <a href="http://support.google.com/websearch/bin/answer.py?hl=en&answer=136861&rd=1" target="_blank">a few handy Google search operator</a>: <item1> OR <item2> returns search results that matches either item1 or item2 and * is the wildcard that matches anything.</div>
</div>Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com0tag:blogger.com,1999:blog-3462060161172751048.post-60153822545654567122012-01-09T07:22:00.000-06:002012-01-19T20:41:58.026-06:00Weibo Redirecting Loop Fixed (Finally)Yep, I used Sina Weibo and this is <a href="http://weibo.com/falcondai" target="_blank">me @ weibo</a>. I have been annoyed by their redirect loop for quite a while. So if you use the handy tool <a href="http://curl.haxx.se/" target="_blank">curl</a> to look at weibo.com with<br />
<div style="text-align: center;">
<i>curl -I weibo.com</i></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPGxyyJRB0YiObzmSBfkdiyaVXaCtvOFTu3PCJddrdINT6Oed03UqgMHNXDcPIvRxDfOOd4RTUAMvDfeWIlikn2I4LxJLxr7EU_6cTmW-xzQdCa2HWP8AVHi5aHUDDr-6fBjl2Yg4kCC1u/s1600/weibo_redirect.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPGxyyJRB0YiObzmSBfkdiyaVXaCtvOFTu3PCJddrdINT6Oed03UqgMHNXDcPIvRxDfOOd4RTUAMvDfeWIlikn2I4LxJLxr7EU_6cTmW-xzQdCa2HWP8AVHi5aHUDDr-6fBjl2Yg4kCC1u/s640/weibo_redirect.png" width="640" /></a></div>
<div style="text-align: left;">
(the -I switch gives only the returned header). You see that the domain is redirected to www.weibo.com. It used to be that www.weibo.com redirects back to weibo.com, thus the loop. (The way you get out of it was to directly visiting your weibo profile (such as <a href="http://www.weibo.com/falcondai">www.weibo.com/falcondai</a>). I think they just fixed this problem in the past few days and www.weibo.com no longer redirects back to weibo.com</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxDvdVF6g1rL9YXbL2jk9qjF_k68dx6jZgByblB-VPlaAQwNuec2SCu6t5HtbTQ-LUODhiqe8kwM3ORd8dPM3qSzuNMQeJdNnyjCP17EFlBfsDq6jO_tEhxhfGTn0YjY84dk5Wye7qxRjE/s1600/weibo_redirect_fixed.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="235" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxDvdVF6g1rL9YXbL2jk9qjF_k68dx6jZgByblB-VPlaAQwNuec2SCu6t5HtbTQ-LUODhiqe8kwM3ORd8dPM3qSzuNMQeJdNnyjCP17EFlBfsDq6jO_tEhxhfGTn0YjY84dk5Wye7qxRjE/s640/weibo_redirect_fixed.png" width="640" /></a></div>
<div style="text-align: left;">
<br /></div>Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com3tag:blogger.com,1999:blog-3462060161172751048.post-5984057619898112462012-01-05T11:54:00.000-06:002012-08-24T11:11:44.270-05:00Domain Mapping Verification with Nslookup CommandI have been setting up my domain name(s) and redirection in the past few days. This process is frustrating for me, a starter for the speed of <a href="http://en.wikipedia.org/wiki/Domain_Name_System" target="_blank">DNS</a> record propagation in the web which might take up to 48 hrs. Basically main name servers around the world will update their records with each other. And my default DNS server which is provided by my ISP might not have a updated record of my zone file and this delays my testing.<br />
<br />
I used Windows to do most of my development and I found a good use of its <i>nslookup</i> command to speed up this process by designating the <a href="http://en.wikipedia.org/wiki/Name_server" target="_blank">nameserver</a> to the one hosting my zone file using this command<br />
<div style="text-align: center;">
<i>nslookup -d </i><your_domain_name> <your_nameserver_url></div>
<nameserver>(the "-d" is optional and with it the command returns more details.)</nameserver><br />
<nameserver><br /></nameserver>
<nameserver>
For example, I used GoDaddy to host my domain zone files and my updated zone file lives on ns65.domaincontrol.com (and ns66.domaincontrol.com) as indicated in the screenshot:</nameserver><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-FWdtpP9gJtqXskmtE3o7ONTCVxv3AXLtJS2roKJUAhdfhZzbqKKc0N78vK1iblz8re6xdgH4c527FlZDdLxAFSyFPRFqC4Cu8kB1dwY1WetJ3duG2w8RYj-yxX1TvJzP0VG4X9sTflCp/s1600/nameserver.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-FWdtpP9gJtqXskmtE3o7ONTCVxv3AXLtJS2roKJUAhdfhZzbqKKc0N78vK1iblz8re6xdgH4c527FlZDdLxAFSyFPRFqC4Cu8kB1dwY1WetJ3duG2w8RYj-yxX1TvJzP0VG4X9sTflCp/s640/nameserver.png" width="640" /></a></div>
<br />
<br />
<nameserver>
For more info on <i>nslookup </i>on Microsoft Support: <a href="http://support.microsoft.com/kb/200525">http://support.microsoft.com/kb/200525</a></nameserver>Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com9tag:blogger.com,1999:blog-3462060161172751048.post-57784236187382237902012-01-04T18:15:00.001-06:002012-01-19T20:41:58.011-06:00Rebooting My Blog<div>
Recently struck by the urge to share what I have been thinking and the need to persuade myself that I have learnt something during my soon-to-end undergraduate life at University of Chicago, I decided to pick up blogging as a channel to share my ideas, passion, and above others, life.<br />
<br />
What will change? Well, I have been learning to develop mobile app and web app whereas most of my previous experience with programming has been with non-network apps.<br />
<br />
So what am I going I planned to mainly write about the following categories: my path into the dev space (I hope to share my experience and learn from my readers), tech ideas, physics/math/philosophy meditation and perspective (my majors and lifetime curiosity), cooking (I love to eat and experiment with food), maybe art and social issues like my old posts.<br />
<br />
As for style, I will try to keep things concise and clear. I might also post in both/either English and Chinese. </div>Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com0tag:blogger.com,1999:blog-3462060161172751048.post-47145513033014214592007-09-27T03:22:00.000-05:002007-09-27T03:39:51.048-05:00The Footprints In A Desert(inspired by the idea of Deep Spring College and the stories of Walden)<br /><br />The idea of leaving a trace behind does not sound popular in a city where concrete surface prevents so. Without such artificial accommodations, like it or not, every walking man will leave a series of footprints as he or she makes a move. In doing so, one is at a higher risk if there is ever a predator. Hence, for the sake of our own, with the enormous power developed along the history from when bare-foot walking was popular, we erased our traces by changing the face of earth to conceal our ancient instinctive fear of being a prey. Cleanness is an alias of making no contact with anything. Sometimes nor even with other people. Without sympathy, city is nothing but a true desert, a place of nothing.<br />Conversely, looking at a desert, despite the assumption which is usually supported by the seemingly void appearance, there are zings. They face extreme adversity yet surviving in their own unique ways. Since it is almost always the minority who are rebellious and determined enough to keep a life away from the traditions of the majority, the animals seem to be in an actually less competitive environment.<br />Not having lived in the wild long enough, many may not realize the dynamics of the apparently static environment. This may be the sensational difference between life and death, nature and artificial world. Nature has a grand mind, but a slow one comparing to the rates of our solutions. Slow, but gradual, cyclical and progressive. Thus we may be blinded by the pace of our own within a narrow perspective ignoring the largo movements of nature. More sadly, our desires and fears drove us to contemn the efficiency of such elegant processes.<br />But after all, even without a dead, solid surface, our footprints will not stay long under the convection of air in a desert. Perhaps, without any untold mystery, simply, nature just loyally marks what we did, indifferently presents them and finally, unconditionally forgives us.Falconhttp://www.blogger.com/profile/06020754181545210408noreply@blogger.com0