<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Victor's Blog</title>
	
	<link>http://victor.csie.org/blog</link>
	<description>May the source be with you</description>
	<pubDate>Sun, 16 Nov 2008 07:17:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/tw/</creativeCommons:license>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/VictorsBlog" type="application/rss+xml" /><item>
		<title>LISP Practice</title>
		<link>http://feeds.feedburner.com/~r/VictorsBlog/~3/454503275/385</link>
		<comments>http://victor.csie.org/blog/archives/385#comments</comments>
		<pubDate>Sun, 16 Nov 2008 02:45:58 +0000</pubDate>
		<dc:creator>victor</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[lisp]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://victor.csie.org/blog/?p=385</guid>
		<description><![CDATA[Quick-sort

(defmacro for-all (x op xs)
 `(remove-if-not #'(lambda (y) (,op y x)) xs))
(defun qsort (nums)
 (if (not nums)
  ()
  (let ((x (first nums))
        (xs (rest nums)))
   (if (eq x nil)
    ()
    (append
     (qsort (for-all x [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Quick-sort</strong></p>
<p><code><br />
(defmacro for-all (x op xs)<br />
 `(remove-if-not #'(lambda (y) (,op y x)) xs))</p>
<p>(defun qsort (nums)<br />
 (if (not nums)<br />
  ()</p>
<p>  (let ((x (first nums))<br />
        (xs (rest nums)))<br />
   (if (eq x nil)<br />
    ()</p>
<p>    (append<br />
     (qsort (for-all x < xs))<br />
     (list x)<br />
     (qsort (for-all x >= xs)))))))<br />
</code></p>
<p><strong>Permutation</strong><br />
<code><br />
(defun remove-first (n nums)<br />
 (remove n nums :count 1))</p>
<p>(defun join-sublists (superlist)<br />
 (reduce #'(lambda (l1 l2) (append l1 l2)) superlist))</p>
<p>(defun permute-sorted-list (nums perm)<br />
 (if (eq nums nil)<br />
  (list perm)</p>
<p>  (let ((unique-nums (remove-duplicates nums)))   (join-sublists<br />
    (mapcar (lambda (n)<br />
             (permute-sorted-list (remove-first n nums) (append perm (list n))))<br />
    unique-nums)))))</p>
<p>(defun permutation (nums)<br />
 (permute-sorted-list (sort nums #'<) '()))<br />
</code></p>
<img src="http://feeds.feedburner.com/~r/VictorsBlog/~4/454503275" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://victor.csie.org/blog/archives/385/feed</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/tw/</creativeCommons:license>
	<feedburner:origLink>http://victor.csie.org/blog/archives/385</feedburner:origLink></item>
		<item>
		<title>LISP 初體驗</title>
		<link>http://feeds.feedburner.com/~r/VictorsBlog/~3/454497338/380</link>
		<comments>http://victor.csie.org/blog/archives/380#comments</comments>
		<pubDate>Sun, 16 Nov 2008 02:37:53 +0000</pubDate>
		<dc:creator>victor</dc:creator>
		
		<category><![CDATA[lisp]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://victor.csie.org/blog/?p=380</guid>
		<description><![CDATA[原本以為 LISP 只是一個普通的 functional language，所以之前都沒去接觸。但是在看完&#60;&#60;駭客與畫家&#62;&#62;之後，開始對 LISP 產生興趣。
書裡面提到 LISP 擁有許多最近新語言開始導入的 feature，而 LISP 也擁有一些其他語言沒有的功能。像我主要是被 LISP 的 macro 吸引（比 C 的 macro 強大多了。可以先把他想像成是 return 程式碼的 function，而且是在 compile 前先展開。），所以開始看 &#60;&#60;Practical Common Lisp&#62;&#62; 一書。目前為止，大家比較熟悉的語言中，我只有在 Perl 6 裡面看到 (http://en.wikipedia.org/wiki/Perl_6#Macros)。
大部分的人對 LISP 的印象就是一堆噁心的括號，寫個加法都要用 (+ 1 2) 這種前置式來敘述，實在是不符合人類的直覺。而 LISP 整個程式碼都是這樣 &#8212; 由一堆 &#8220;list&#8221; 所組成。(* (+ 1 2) (+ 3 4)) 有一個 list，第一個元素是 * 這個 [...]]]></description>
			<content:encoded><![CDATA[<p>原本以為 LISP 只是一個普通的 functional language，所以之前都沒去接觸。但是在看完<a href="http://www.oreilly.com.tw/product_others.php?id=a181" onclick="javascript:pageTracker._trackPageview ('/outbound/www.oreilly.com.tw');">&lt;&lt;駭客與畫家&gt;&gt;</a>之後，開始對 LISP 產生興趣。</p>
<p>書裡面提到 LISP 擁有許多最近新語言開始導入的 feature，而 LISP 也擁有一些其他語言沒有的功能。像我主要是被 LISP 的 macro 吸引（比 C 的 macro 強大多了。可以先把他想像成是 return 程式碼的 function，而且是在 compile 前先展開。），所以開始看 <a href="http://www.gigamonkeys.com/book/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.gigamonkeys.com');">&lt;&lt;Practical Common Lisp&gt;&gt;</a> 一書。目前為止，大家比較熟悉的語言中，我只有在 Perl 6 裡面看到 (<a href="http://en.wikipedia.org/wiki/Perl_6#Macros" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');">http://en.wikipedia.org/wiki/Perl_6#Macros</a>)。</p>
<p>大部分的人對 LISP 的印象就是一堆噁心的括號，寫個加法都要用 (+ 1 2) 這種前置式來敘述，實在是不符合人類的直覺。而 LISP 整個程式碼都是這樣 &#8212; 由一堆 &#8220;list&#8221; 所組成。(* (+ 1 2) (+ 3 4)) 有一個 list，第一個元素是 * 這個 &#8220;function&#8221;，第二、三個是另外兩個 list。類似這樣的語法，在定義 function、if、while 等等都一樣。</p>
<p>但這之前隱含了一件事實：LISP 本身的程式碼，就是一個資料結構! 所以 LISP 的 macro 做的事情就是生出程式碼的資料結構，我覺得這就比 Perl 6 的 macro 那種 template 的方式優雅多了。不過，這個優點是建立在令人卻步的括號海上的&#8230;</p>
<p>接下來，po 幾個我的 LISP 練習 XD</p>
<img src="http://feeds.feedburner.com/~r/VictorsBlog/~4/454497338" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://victor.csie.org/blog/archives/380/feed</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/tw/</creativeCommons:license>
	<feedburner:origLink>http://victor.csie.org/blog/archives/380</feedburner:origLink></item>
		<item>
		<title>zfs again</title>
		<link>http://feeds.feedburner.com/~r/VictorsBlog/~3/223044871/377</link>
		<comments>http://victor.csie.org/blog/archives/377#comments</comments>
		<pubDate>Fri, 25 Jan 2008 17:49:03 +0000</pubDate>
		<dc:creator>victor</dc:creator>
		
		<category><![CDATA[freebsd]]></category>

		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://victor.csie.org/blog/archives/377</guid>
		<description><![CDATA[今天才發現我弄錯了，昨天那篇提到的只是不會 cache，不會導致 kmem_map too small。
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c
version 1.4 調了一些參數試圖緩和 memory 用光的情形&#8230;
]]></description>
			<content:encoded><![CDATA[<p>今天才發現我弄錯了，<a href="http://victor.csie.org/blog/archives/376">昨天那篇</a>提到的只是不會 cache，不會導致 kmem_map too small。</p>
<p>http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c</p>
<p>version 1.4 調了一些參數試圖緩和 memory 用光的情形&#8230;</p>
<img src="http://feeds.feedburner.com/~r/VictorsBlog/~4/223044871" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://victor.csie.org/blog/archives/377/feed</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/tw/</creativeCommons:license>
	<feedburner:origLink>http://victor.csie.org/blog/archives/377</feedburner:origLink></item>
		<item>
		<title>zfs 雷</title>
		<link>http://feeds.feedburner.com/~r/VictorsBlog/~3/222366583/376</link>
		<comments>http://victor.csie.org/blog/archives/376#comments</comments>
		<pubDate>Thu, 24 Jan 2008 16:10:03 +0000</pubDate>
		<dc:creator>victor</dc:creator>
		
		<category><![CDATA[freebsd]]></category>

		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://victor.csie.org/blog/archives/376</guid>
		<description><![CDATA[i386 跑 zfs 很容易會遇到 kmem_map too small，然後 panic。（搞錯了，不是這個 patch，請看下一篇）
剛才 rafan 貼了一段 message 給我

  Change type of kmem_used() and kmem_size() functions to uint64_t, so it
  doesn&#8217;t overflow in arc.c in this check:
          if (kmem_used() > (kmem_size() * 4) / 5)
      [...]]]></description>
			<content:encoded><![CDATA[<p>i386 跑 zfs 很容易會遇到 kmem_map too small，然後 panic。（搞錯了，不是這個 patch，請看下一篇）</p>
<p>剛才 <a href="http://www.rafan.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.rafan.org');">rafan</a> 貼了一段 message 給我</p>
<blockquote><p>
  Change type of kmem_used() and kmem_size() functions to uint64_t, so it<br />
  doesn&#8217;t overflow in arc.c in this check:</p>
<p>          if (kmem_used() > (kmem_size() * 4) / 5)<br />
                  return (1);</p>
<p>  With this bug ZFS almost doesn&#8217;t cache.</p>
<p>  Only 32bit machines are affected that have vm.kmem_size set to values >=1GB.
</p></blockquote>
<p><a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/compat/opensolaris/kern/opensolaris_kmem.c?r1=1.3#rev1.3" onclick="javascript:pageTracker._trackPageview ('/outbound/www.freebsd.org');">src/sys/compat/opensolaris/kern/opensolaris_kmem.c#rev1.3</a>，還有 <a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/compat/opensolaris/kern/opensolaris_kmem.c.diff?r1=1.2;r2=1.3;f=h" onclick="javascript:pageTracker._trackPageview ('/outbound/www.freebsd.org');">diff</a>。</p>
<p>搞笑 XD</p>
<img src="http://feeds.feedburner.com/~r/VictorsBlog/~4/222366583" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://victor.csie.org/blog/archives/376/feed</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/tw/</creativeCommons:license>
	<feedburner:origLink>http://victor.csie.org/blog/archives/376</feedburner:origLink></item>
		<item>
		<title>SCSI–</title>
		<link>http://feeds.feedburner.com/~r/VictorsBlog/~3/219313609/375</link>
		<comments>http://victor.csie.org/blog/archives/375#comments</comments>
		<pubDate>Sat, 19 Jan 2008 09:55:43 +0000</pubDate>
		<dc:creator>victor</dc:creator>
		
		<category><![CDATA[freebsd]]></category>

		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://victor.csie.org/blog/archives/375</guid>
		<description><![CDATA[這一兩個學期來，實驗室買了幾台 RAID 來裝大家實驗用的資料。幾個禮拜前，file system 爆炸，我們損失了不少資料  
重點提要：

同一個 channel 不要接超過三組 RAID
同一個 channel 不要接不同廠牌的 RAID
SCSI 線跟 terminator 是消耗品

接 RAID 的機器是跑 FreeBSD 7.0-PRERELEASE。一開始發現異常，是 zfs 說他寫進去的資料跟讀出來的 checksum 不一樣，於是就爆了三個 zfs 的 partition。接在同一個 SCSI channel 的 RAID 共有四台，三台 proware 跟一台 festora(?)，zfs 叫有 error 的是其中兩台 proware，所以我們懷疑是 RAID 本身有問題。
後來找了 proware 的工程師來幫我檢查 RAID，他說我們接四組 RAID 太多了&#8230; 小時候學到的 SCSI device 不就是要用串的嗎，可是沒想到四組就算太多 orz 而且最好不要把不同廠牌的 RAID 接在一起&#8230;  [...]]]></description>
			<content:encoded><![CDATA[<p>這一兩個學期來，實驗室買了幾台 RAID 來裝大家實驗用的資料。幾個禮拜前，file system 爆炸，我們損失了不少資料 <img src='http://victor.csie.org/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>重點提要：</p>
<ol>
<li>同一個 channel <strong>不要</strong>接超過三組 RAID</li>
<li>同一個 channel <strong>不要</strong>接不同廠牌的 RAID</li>
<li>SCSI 線跟 terminator 是消耗品</li>
</ol>
<p>接 RAID 的機器是跑 FreeBSD 7.0-PRERELEASE。一開始發現異常，是 zfs 說他寫進去的資料跟讀出來的 checksum 不一樣，於是就爆了三個 zfs 的 partition。接在同一個 SCSI channel 的 RAID 共有四台，三台 proware 跟一台 festora(?)，zfs 叫有 error 的是其中兩台 proware，所以我們懷疑是 RAID 本身有問題。</p>
<p>後來找了 proware 的工程師來幫我檢查 RAID，他說我們接四組 RAID 太多了&#8230; 小時候學到的 SCSI device 不就是要用串的嗎，可是沒想到四組就算太多 orz 而且最好不要把不同廠牌的 RAID 接在一起&#8230;  因為訊號可能會互相干擾 @@ （我以為這應該有標準，可是看起來接在一起的確不太好&#8230;）</p>
<p>於是我們把四台 RAID 分到兩張 scsi 卡上（之前因為某些原因沒這麼做），其中一個 channel 是一組 proware + 一組 festora。然後今天下午一直發現 zfs 又開始抱怨了&#8230; 一個月前這麼接還沒事的耶 orz 真是 ooxx 現在改成三組 proware 接同一張 scsi card，另一組自己接一張，zfs 就不叫了。</p>
<p>(%&#038;$#@!*(%!#@^!)</p>
<img src="http://feeds.feedburner.com/~r/VictorsBlog/~4/219313609" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://victor.csie.org/blog/archives/375/feed</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/tw/</creativeCommons:license>
	<feedburner:origLink>http://victor.csie.org/blog/archives/375</feedburner:origLink></item>
		<item>
		<title>清朝奏章上的「囧」</title>
		<link>http://feeds.feedburner.com/~r/VictorsBlog/~3/190052084/374</link>
		<comments>http://victor.csie.org/blog/archives/374#comments</comments>
		<pubDate>Sun, 25 Nov 2007 02:12:43 +0000</pubDate>
		<dc:creator>victor</dc:creator>
		
		<category><![CDATA[fun]]></category>

		<guid isPermaLink="false">http://victor.csie.org/blog/archives/374</guid>
		<description><![CDATA[今天去故宮看到的 XD

]]></description>
			<content:encoded><![CDATA[<p>今天去故宮看到的 XD</p>
<p><a href="http://picasaweb.google.com/victorhsieh/Random/photo#5136456500048051554" onclick="javascript:pageTracker._trackPageview ('/outbound/picasaweb.google.com');"><img src="http://lh6.google.com/victorhsieh/R0hb-QGcPWI/AAAAAAAACsg/lxZakWWHqpU/s400/%E5%9B%A7.jpg" /></a></p>
<img src="http://feeds.feedburner.com/~r/VictorsBlog/~4/190052084" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://victor.csie.org/blog/archives/374/feed</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/tw/</creativeCommons:license>
	<feedburner:origLink>http://victor.csie.org/blog/archives/374</feedburner:origLink></item>
		<item>
		<title>Flickr API undocumented limitation</title>
		<link>http://feeds.feedburner.com/~r/VictorsBlog/~3/189285889/373</link>
		<comments>http://victor.csie.org/blog/archives/373#comments</comments>
		<pubDate>Fri, 23 Nov 2007 11:38:58 +0000</pubDate>
		<dc:creator>victor</dc:creator>
		
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://victor.csie.org/blog/archives/373</guid>
		<description><![CDATA[我目前在學校有個 project 需要從 flickr 抓取大量資料，包括照片的 tag、owner 等 meta data。但是我發現我拿到的 data 怪怪的，一些常用的 tag 竟然只有幾百筆。我用的 API 是 flickr.photos.search，它可以接受很多條件，然後傳回符合的照片，其中有兩個條件是最早跟最晚的上傳時間。於是我只好把時間間隔縮小很多。
直到昨天，我收到一封恐嚇^H^H警告信，說明 query return 回來的 offset 不能超過 4000，換句話說頂多拿到 4000 筆左右的結果。API 的文件沒提到這件事，query 傳回來的 status 也都是正常 &#8230;
還好我抓得夠暴力(?)，不然如果沒收到這封信，之後學校的實驗就可能是錯的了  

Greetings!
We have noticed that the api key 72157602728288126
registered to you is sending very large offset queries to
us.
example (offset=16893165)
Can you please check your usage and reconsider [...]]]></description>
			<content:encoded><![CDATA[<p>我目前在學校有個 project 需要從 flickr 抓取大量資料，包括照片的 tag、owner 等 meta data。但是我發現我拿到的 data 怪怪的，一些常用的 tag 竟然只有幾百筆。我用的 API 是 flickr.photos.search，它可以接受很多條件，然後傳回符合的照片，其中有兩個條件是最早跟最晚的上傳時間。於是我只好把時間間隔縮小很多。</p>
<p>直到昨天，我收到一封恐嚇^H^H警告信，說明 query return 回來的 offset 不能超過 4000，換句話說頂多拿到 4000 筆左右的結果。API 的文件沒提到這件事，query 傳回來的 status 也都是正常 &#8230;</p>
<p>還好我抓得夠暴力(?)，不然如果沒收到這封信，之後學校的實驗就可能是錯的了 <img src='http://victor.csie.org/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<blockquote><p>
Greetings!<br />
We have noticed that the api key 72157602728288126<br />
registered to you is sending very large offset queries to<br />
us.<br />
example (offset=16893165)<br />
Can you please check your usage and reconsider using these<br />
high offsets? They are heavy/costly queries that tax our<br />
backends.</p>
<p>Also to note: the search backend currently will not return<br />
any results greater than offset 4000.</p>
<p>If you could limit the max offset to below 4000, we would<br />
greatly appreciate it (and not have to disable the key -<br />
not because we want to, but because our backends can&#8217;t take<br />
very much of it).</p>
<p>Thanks!<br />
- Flickr Team
</p></blockquote>
<img src="http://feeds.feedburner.com/~r/VictorsBlog/~4/189285889" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://victor.csie.org/blog/archives/373/feed</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/tw/</creativeCommons:license>
	<feedburner:origLink>http://victor.csie.org/blog/archives/373</feedburner:origLink></item>
		<item>
		<title>.museum domain</title>
		<link>http://feeds.feedburner.com/~r/VictorsBlog/~3/183462706/372</link>
		<comments>http://victor.csie.org/blog/archives/372#comments</comments>
		<pubDate>Mon, 12 Nov 2007 08:41:04 +0000</pubDate>
		<dc:creator>victor</dc:creator>
		
		<category><![CDATA[network]]></category>

		<guid isPermaLink="false">http://victor.csie.org/blog/archives/372</guid>
		<description><![CDATA[太帥了，竟然有 .museum 這種 top level domain!
首頁: http://musedoma.museum/
所有 second level 的列表: http://index.museum/
Wikipedia 的 Top level domain list
]]></description>
			<content:encoded><![CDATA[<p>太帥了，竟然有 .museum 這種 top level domain!</p>
<p>首頁: <a href="http://musedoma.museum/" onclick="javascript:pageTracker._trackPageview ('/outbound/musedoma.museum');">http://musedoma.museum/</a><br />
所有 second level 的列表: <a href="http://index.museum/" onclick="javascript:pageTracker._trackPageview ('/outbound/index.museum');">http://index.museum/</a></p>
<p>Wikipedia 的 <a href="http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');">Top level domain list</a></p>
<img src="http://feeds.feedburner.com/~r/VictorsBlog/~4/183462706" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://victor.csie.org/blog/archives/372/feed</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/tw/</creativeCommons:license>
	<feedburner:origLink>http://victor.csie.org/blog/archives/372</feedburner:origLink></item>
		<item>
		<title>iGoogle _IG_FetchContent supports Big5</title>
		<link>http://feeds.feedburner.com/~r/VictorsBlog/~3/150542778/368</link>
		<comments>http://victor.csie.org/blog/archives/368#comments</comments>
		<pubDate>Fri, 31 Aug 2007 13:58:38 +0000</pubDate>
		<dc:creator>victor</dc:creator>
		
		<category><![CDATA[google]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://victor.csie.org/blog/archives/368</guid>
		<description><![CDATA[前幾天發現 iGoogle gadget API 的 _IG_FetchContent, _IG_FetchXmlContent 和 _IG_FetchFeedAsJSON 開始支援 Big5 了! 以前寫 gadget 時，只要遇到要抓取 Big5 的網頁，就沒辦法用。因為之前這三個 function 假設網頁的內容是 UTF-8。不過前幾天我抓了一個 Big5 的網頁，發現內容竟然正常了。看來他現在會幫你猜網頁的 encoding 了! 這樣開發 gadget 就方便多啦。
Mapplet 也是一樣，因為 mapplet 也可以用 gadget 的 API。
也許 Google 正在辦的比賽會有更多的 idea 跑出來。
]]></description>
			<content:encoded><![CDATA[<p>前幾天發現 <a href="http://www.google.com/apis/gadgets/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">iGoogle gadget API</a> 的 _IG_FetchContent, _IG_FetchXmlContent 和 _IG_FetchFeedAsJSON 開始支援 Big5 了! 以前寫 gadget 時，只要遇到要抓取 Big5 的網頁，就沒辦法用。因為之前這三個 function 假設網頁的內容是 UTF-8。不過前幾天我抓了一個 Big5 的網頁，發現內容竟然正常了。看來他現在會幫你猜網頁的 encoding 了! 這樣開發 gadget 就方便多啦。</p>
<p><a href="http://www.google.com/apis/maps/documentation/mapplets/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com');">Mapplet</a> 也是一樣，因為 mapplet 也可以用 gadget 的 API。</p>
<p>也許 Google 正在辦的<a href="http://www.google.com.tw/intl/zh-TW/events/gadgetawards/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.google.com.tw');">比賽</a>會有更多的 idea 跑出來。</p>
<img src="http://feeds.feedburner.com/~r/VictorsBlog/~4/150542778" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://victor.csie.org/blog/archives/368/feed</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/tw/</creativeCommons:license>
	<feedburner:origLink>http://victor.csie.org/blog/archives/368</feedburner:origLink></item>
		<item>
		<title>中研院數位典藏展</title>
		<link>http://feeds.feedburner.com/~r/VictorsBlog/~3/141982403/367</link>
		<comments>http://victor.csie.org/blog/archives/367#comments</comments>
		<pubDate>Wed, 08 Aug 2007 13:18:25 +0000</pubDate>
		<dc:creator>victor</dc:creator>
		
		<category><![CDATA[fun]]></category>

		<category><![CDATA[geo]]></category>

		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://victor.csie.org/blog/archives/367</guid>
		<description><![CDATA[今天下午去中研院看一個數位典藏的展覽，到下禮拜一之前展的是一些地圖、歷史地圖的東西。展出的單位是中研院 GIS 實驗室。
裡面還有幾張地圖是國民政府來台之後，跟美國合作，偷偷由中華民國飛行員開美國的偵察機 (好像叫 U2?)，飛到大陸那邊去照的數十(百?)萬張地圖。而且解析度還滿高的，不知道有沒有比 google earth 清楚。之前國家不允許這種東西展出，所以現在應該是剛出來見世人吧。
他們用了相當多 google earth 跟 map 來作 demo 平台，加上 multi-touch 的桌椅組 (MITSUBISHI 的 DiamondTouch) 配合 google earth 做簡單的平移、旋轉、跟縮放。
還有 google map 上古今地圖對照，可以看你家幾十年前或一百年前是農田還是什麼的。我們有清楚看到台北市的市民大道以前是鐵路，還有基隆河截彎取直前後的樣子。
其中我覺得最酷的是一個 3D 瑩幕 (他們買來的)。他是一個特殊的瑩幕 &#8220;直接&#8221;接上顯示卡，畫面上的 3D (OpenGL, DirectX) 就直接變成立體 (當然視角很有限)。身為 CMLab graphics 組的，當然要知道原理啦。我猜他應該是去讀 z-buffer! z-buffer 是顯示卡上記錄瑩幕上每一個 pixel &#8220;深度 (離眼睛的距離)&#8221; 的記憶體，3D 的程式通常會用到。於是有了景深，這個瑩幕就可以對左右眼射去不一樣的光線 (坐在椅子上)，看起來就有立體的感覺!
另一個也很酷的是 3D 印表機 (只展出影片跟成品 不過印表機本身不是他們做的)。他是在一塊板子上一層一層塗上粉，要留下的地方的粉上膠、不留的不上。一層一層塗完之後把粉倒掉，剩下的就是那些有上膠的部分。3D 的模型就這麼印出來了!
這一個下午真是不虛此行! 下禮拜一之前，如果大家有空，可以去看一看  [...]]]></description>
			<content:encoded><![CDATA[<p>今天下午去中研院看一個數位典藏的展覽，到下禮拜一之前展的是一些地圖、歷史地圖的東西。展出的單位是<a href="http://gis.ascc.net/" onclick="javascript:pageTracker._trackPageview ('/outbound/gis.ascc.net');">中研院 GIS 實驗室</a>。</p>
<p>裡面還有幾張地圖是國民政府來台之後，跟美國合作，偷偷由中華民國飛行員開美國的偵察機 (好像叫 U2?)，飛到大陸那邊去照的數十(百?)萬張地圖。而且解析度還滿高的，不知道有沒有比 google earth 清楚。之前國家不允許這種東西展出，所以現在應該是剛出來見世人吧。</p>
<p>他們用了相當多 google earth 跟 map 來作 demo 平台，加上 <a href="http://cs.nyu.edu/~jhan/ftirtouch/" onclick="javascript:pageTracker._trackPageview ('/outbound/cs.nyu.edu');">multi-touch</a> 的桌椅組 (<a href="http://www.merl.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.merl.com');">MITSUBISHI</a> 的 <a href="http://www.merl.com/projects/DiamondTouch/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.merl.com');">DiamondTouch</a>) 配合 google earth 做簡單的平移、旋轉、跟縮放。</p>
<p>還有 google map 上古今地圖對照，可以看你家幾十年前或一百年前是農田還是什麼的。我們有清楚看到台北市的市民大道以前是鐵路，還有基隆河截彎取直前後的樣子。</p>
<p>其中我覺得最酷的是一個 3D 瑩幕 (他們買來的)。他是一個特殊的瑩幕 &#8220;直接&#8221;接上顯示卡，畫面上的 3D (OpenGL, DirectX) 就直接變成立體 (當然視角很有限)。身為 <a href="http://cmlab.csie.ntu.edu.tw/" onclick="javascript:pageTracker._trackPageview ('/outbound/cmlab.csie.ntu.edu.tw');">CMLab</a> <a href="http://graphics.csie.ntu.edu.tw/" onclick="javascript:pageTracker._trackPageview ('/outbound/graphics.csie.ntu.edu.tw');">graphics 組</a>的，當然要知道原理啦。我猜他應該是去讀 z-buffer! z-buffer 是顯示卡上記錄瑩幕上每一個 pixel &#8220;深度 (離眼睛的距離)&#8221; 的記憶體，3D 的程式通常會用到。於是有了景深，這個瑩幕就可以對左右眼射去不一樣的光線 (坐在椅子上)，看起來就有立體的感覺!</p>
<p>另一個也很酷的是 3D 印表機 (只展出影片跟成品 不過印表機本身不是他們做的)。他是在一塊板子上一層一層塗上粉，要留下的地方的粉上膠、不留的不上。一層一層塗完之後把粉倒掉，剩下的就是那些有上膠的部分。3D 的模型就這麼印出來了!</p>
<p>這一個下午真是不虛此行! 下禮拜一之前，如果大家有空，可以去看一看 <img src='http://victor.csie.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> 地點在中研院圖書館。</p>
<img src="http://feeds.feedburner.com/~r/VictorsBlog/~4/141982403" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://victor.csie.org/blog/archives/367/feed</wfw:commentRss>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/tw/</creativeCommons:license>
	<feedburner:origLink>http://victor.csie.org/blog/archives/367</feedburner:origLink></item>
	</channel>
</rss>
