tag:blogger.com,1999:blog-58108316571279367032024-03-05T12:12:48.503+08:00ansoncat's blogAbout a father, programmer and gourmandUnknownnoreply@blogger.comBlogger44125tag:blogger.com,1999:blog-5810831657127936703.post-45082156453018282222017-10-20T16:12:00.003+08:002017-10-20T16:12:32.659+08:00Github Pages with Cloudflare CDN and HTTPS放在 Github 上的網站也可以支援 HTTPS 連線,但是使用自訂網域的用戶還是要透過其他方式才能支援,最簡單的方式還是透過 Cloudflare,來啟用 CDN 和 HTTPS 支援,可參考:<br />
<br />
<a href="https://www.minwt.com/website/server/18538.html">透過Cloudflare 免費憑證,將GitHub Pages綁定個人網域也支援SSL加密連線</a><br />
<br />
設定上不難,跟<a href="https://blog.ansoncat.com/2017/10/blogger-with-cloudflare-https-and.html">上次</a>差不多,也是要注意網站是否有載入不安全的檔案,相關連結要修改成使用 <b>https://</b> 或者是只寫 <b>//</b>。<br />
<br />
有空再來搞 <a href="https://blog.ansoncat.com/2017/10/404.html">404 頁面</a>。<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-44604405388671313962017-10-20T15:26:00.000+08:002017-10-20T16:12:50.989+08:00Blogger with Cloudflare, HTTPS and OpenGraph今天把部落格升級成只支援 HTTPS 了!<br />
<br />
之前 Blogger 早就支援 HTTPS 了,不支援使用自訂網域的站台。最簡單的解決方式就是透過 CDN 業者(如 Cloudflare)來幫忙處理使用者到部落格這一段連線。Cloudflare 部分的設定很簡單,就是把自己網域的 name server 轉到 Cloudflare ,針對特定網址啟用 CDN,並設定好要套用 SSL 連線的網站 pattern,細節可以參考:<br />
<a href="https://sofree.cc/cloudflare-free-cdn/"><br /></a>
<a href="https://sofree.cc/cloudflare-free-cdn/">[教學]Cloudflare 免費不限流量CDN、DNS代管,網站全球加速、減輕伺服器負擔</a><br />
<br />
另外,在 Blogger 端則需要注意網站上是否有載入非 HTTPS 連線的物件,如圖檔/script/iframe 等等,最好是一起設定成使用 HTTPS 連線來載入。Chrome 的developer console 會顯示不安全的部分,可以參考修改之。主要參考如下:<br />
<br />
<a href="https://www.techcoke.com/2017/01/blogger-cloudflare-flexible-ssl-https-step.html">[教學] BLOGGER 自訂網址套用 CLOUDFLARE FLEXIBLE SSL 設定全流程</a><br />
<a href="http://www.howtoshout.com/enable-https-blogger-blog-custom-domain/">How To Migrate From HTTP To HTTPS On Blogger Blog With Custom Domains</a><br />
<br />
我主要改掉了圖檔的連結 tag 和幾個內嵌 iframe,並修改 blogger template search widget 李的連結,改成 data:blog.searchUrl.https,並且關掉導覽列。blogger template 裡關於 url 的 tag 幾乎都多了 https 的屬性可以使用,我在修改 opengraph 屬性時,用到不少。<br />
<br />
之前參考以下資訊作了 facebook opengraph的meta data屬性支援:<br />
<br />
[1] http://www.wfublog.com/2015/04/facebook-meta-og-setting-thumbnail-title-description-author.html<br />
[2] http://philotech1982.blogspot.tw/2014/12/metatagsforbloggersharing.html<br />
[3] http://www.technohalf.com/2015/01/how-to-add-facebook-open-graph-to-blogger-blog.html<br />
[4] https://gist.github.com/pathawks/1343315<br />
[5] https://developers.facebook.com/tools/debug/og/object/<br />
<br />
這次就順便重新整理,加上 HTTPS 的部分並移到前面,取代掉 all-head-content 這部分的 blogger template ,因為這部分 template 不會自動產生 HTTPS 連結。最後的成果如下:<br />
<br />
<script src="https://gist.github.com/ansoncat/b0ebc4198e3e56e4e9e8.js?file=new_meta_https_blogger.html"></script><br />
另外也順便調整了版面寬度和 title 格式。之後可能會再加上 logo,或再調整樣版。<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-40000601411678765652017-10-13T14:06:00.002+08:002017-10-20T10:57:02.876+08:00404協尋兒少專案<a href="https://404page.missingkids.org.tw/">404協尋兒少專案</a>出來一陣子了,剛剛又看到就想來支持一下。這邊先簡單利用 Blogger 內建的功能加入一段該專案提供的 html snippet就行了,大概會長的像<a href="http://blog.ansoncat.com/404">這樣</a>,版面還要調整一下,之後換佈景主題時再一起弄吧。Github 上還有一個小網站,改天再參考<a href="https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/">官方說明</a>來實做。Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-6394373966878132042017-04-16T13:05:00.000+08:002017-04-27T20:03:30.288+08:00強制 Google Drive Mac 版使用繁體中文介面<div>
<span style="color: #1d2129; font-family: inherit; font-size: 15px;">不知從那個版本開始,Google Drive 在繁中版 macOS 上會預設使用簡體中文介面。</span></div>
<div>
<br /></div>
<div>
<span style="color: #1d2129; font-family: inherit; font-size: 15px;">解決方法如下:</span></div>
<div>
<br />
<ol>
<li><span style="color: #1d2129; font-family: inherit; font-size: 15px;">安裝完後先不要開啟登入</span></li>
<li><span style="color: #1d2129; font-family: inherit; font-size: 15px;">開 termainal 輸入 (以下為一行): </span></li>
</ol>
</div>
<div>
<blockquote class="tr_bq">
<span style="color: #1d2129; font-family: inherit; font-size: 15px;"> </span><span style="color: #1d2129; font-family: inherit; font-size: 15px;"> </span><span style="color: #1d2129; font-family: inherit; font-size: 15px;">defaults write com.google.GoogleDrive AppleLanguages '("zh-TW</span><span style="color: #1d2129; font-size: 15px;">”</span><span style="color: #1d2129; font-family: inherit; font-size: 15px;">)'</span></blockquote>
</div>
<div>
<br /></div>
<div>
<span style="color: #1d2129; font-family: inherit; font-size: 15px;">感謝 LogDS 大大 (</span><a href="https://www.ptt.cc/bbs/MAC/M.1491021738.A.D5C.html" style="color: #365899; font-family: inherit; font-size: 15px;">https://www.ptt.cc/bbs/MAC/M.1491021738.A.D5C.html</a>)</div>
<div>
<br /></div>
<div>
<a href="https://www.facebook.com/hashtag/google%E6%90%9E%E5%B1%81?source=feed_text&story_id=10213241023678372" style="-evernote-webclip: true; color: #4267b2; font-family: inherit; font-size: 15px;">#</a><a href="https://www.facebook.com/hashtag/google%E6%90%9E%E5%B1%81?source=feed_text&story_id=10213241023678372" style="-evernote-webclip: true; color: #365899; font-family: inherit; font-size: 15px;">Google搞屁</a></div>
<!--?xml version="1.0" encoding="UTF-8"?-->
<br />
<div>
<a href="https://www.facebook.com/hashtag/%E4%B8%8D%E7%84%B6%E5%B0%B1%E6%94%B9%E7%94%A8%E8%8B%B1%E6%96%87%E7%89%88macos%E5%90%A7?source=feed_text&story_id=10213241023678372" style="-evernote-webclip: true; color: #4267b2; font-family: inherit; font-size: 15px;">#</a><a href="https://www.facebook.com/hashtag/%E4%B8%8D%E7%84%B6%E5%B0%B1%E6%94%B9%E7%94%A8%E8%8B%B1%E6%96%87%E7%89%88macos%E5%90%A7?source=feed_text&story_id=10213241023678372" style="-evernote-webclip: true; color: #365899; font-family: inherit; font-size: 15px;">不然就改用英文版macOS吧</a></div>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-5810831657127936703.post-68628166480776319642013-08-23T16:51:00.000+08:002015-12-09T00:06:37.254+08:00Exception handling in Spring MVCJust very rough notes for handling exceptions in Spring MVC/Servlet<br>
<br>
1. Servlet:<br>
<error-page> ==> *.jsp/servlet (hard to use spring mvc classes)<br>
or<br>
<error-page> ==> spring mvc controller (fail if spring failed)<br>
<div>
<br>
ps: in Servlet 3, one can set default page for all exceptions/status codes<br>
<br>
Ref:<br>
<a href="http://blog.csdn.net/c5153000/article/details/6236815">http://blog.csdn.net/c5153000/article/details/6236815</a><br>
<a href="http://kahimyang.info/kauswagan/howto_blogs/997-custom_error_pages_for_tomcat_jsf_applications">http://kahimyang.info/kauswagan/howto_blogs/997-custom_error_pages_for_tomcat_jsf_applications</a><br>
<a href="http://stackoverflow.com/questions/2748220/how-to-show-user-friendly-error-page-instead-of-tomcat-log-with-stack-trace-in-b">http://stackoverflow.com/questions/2748220/how-to-show-user-friendly-error-page-instead-of-tomcat-log-with-stack-trace-in-b</a><br>
<a href="http://blog.newsplore.com/2010/08/04/restful-error-handling-with-tomcat-springmvc">http://blog.newsplore.com/2010/08/04/restful-error-handling-with-tomcat-springmvc</a><br>
<a href="http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-ann-customer-servlet-container-error-page">http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-ann-customer-servlet-container-error-page</a><br>
<a href="http://stackoverflow.com/questions/995248/how-to-get-the-message-in-a-custom-error-page-tomcat">http://stackoverflow.com/questions/995248/how-to-get-the-message-in-a-custom-error-page-tomcat</a><br>
<div>
<br>
<br>
2. Spring MVC:<br>
Use @ExceptionHandler (must set for each controller)<br>
or<br>
@ContollerAdvice (3.2 only)<br>
or<br>
HandlerExceptionResover (need to set and implement yourself)<br>
<br>
Ref:<br>
<a href="http://stackoverflow.com/questions/3230358/spring-3-create-exceptionhandler-for-nosuchrequesthandlingmethodexception">http://stackoverflow.com/questions/3230358/spring-3-create-exceptionhandler-for-nosuchrequesthandlingmethodexception</a><br>
<a href="http://fuliang.iteye.com/blog/947191">http://fuliang.iteye.com/blog/947191</a><br>
<a href="http://www.stormpath.com/blog/spring-mvc-rest-exception-handling-best-practices-part-2">http://www.stormpath.com/blog/spring-mvc-rest-exception-handling-best-practices-part-2</a><br>
<br>
3. hybrid<br>
Use 2 for spring mvc and 1 for the rest. View can be shared(JSP)<strong style="background-color: white; border: 0px; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 13.600000381469727px; line-height: 17.600000381469727px; margin: 0px; padding: 0px; vertical-align: baseline;"><br></strong></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-28113772246414532792011-04-29T16:44:00.002+08:002011-10-06T09:46:25.034+08:00Leaving only what is truly important ..."For the past 33 years, I have looked in the mirror every morning and asked myself: "If today were the last day of my life, would I want to do what I am about to do today?" And whenever the answer has been "No" for too many days in a row, I know I need to change something...almost everything - all external expectations, all pride, all fear of embarrassment or failure - these things just fall away in the face of death, leaving only what is truly important. Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose." -- Steve Jobs<br />
<br />
[1] <a href="http://news.stanford.edu/news/2005/june15/jobs-061505.html">http://news.stanford.edu/news/2005/june15/jobs-061505.html</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-75146643669794572702011-03-30T23:05:00.007+08:002011-05-05T20:08:52.322+08:00About Blogger Now<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">距離上次開始玩 Blogger 到現在事情還真的改變了不少,以下是針對五年前 <a href="http://blog.ansoncat.com/2006/12/blogger-beta.html">Blogger Beta</a> 這篇文章作補充,簡單的回顧發生的事情:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">原文:</div><blockquote><i>花了一點時間轉換到 <a href="http://beta.blogger.com/">Blogger Beta</a>,因為目前 <a href="http://www.google.com/">Google</a> 還沒提供簡便的轉換法,因此我就用手動的方式將舊站裡的文章和範本轉了過來,幸好資料不多。</i></blockquote><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">現在已經沒有 Blogger Beta 了,改叫 <a href="http://draft.blogger.com/">Blogger in Draft</a> XD,新的範本系統好用多了,雖然和舊的不相容了。<br />
<br />
<a name='more'></a></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">原文:</div><blockquote><i>Blogger Beta 最大的不同點就是,所有的 blog 頁面不再是靜態產生的,而是採用動態網頁的方式,這提供了很多可能性,其中之一是權限控管。</i></blockquote><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">應該是我搞錯了,事實上還是靜態產生的,不過動態許多,託 AJAX 的服。</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">原文:</div><blockquote><i>另外就是 Google 帳號的整合了,現在同一個帳號可以使用的服務真是越來越多了,想必這是 Google 霸業的一部份了吧?</i></blockquote><br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Google 繼續坐大,不過也面臨新的競爭對手。</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">原文:</div><blockquote><i>操作上大致和原本的 <a href="http://www.blogger.com/">Blogger</a> 相同,只有一些微小的差異,文章多了類似 <a href="http://gmail.com/">Gmail</a> 貼標籤的功能,可惜沒有把 <a href="http://docs.google.com/">Google Docs</a> 的功能整合進來,不過 Google Docs 本來就有支援Blog的編寫了。</i></blockquote><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Google Docs 越來越強大了,但似乎把 <a href="http://www.google.com/support/forum/p/Google%20Docs/thread?tid=4207ea9031f77c84&hl=en">Blog 文章撰寫功能拿掉</a>了。不過聽說 Blogger 之後會有<a href="http://www.metamuse.net/2011/03/2011-blogger.html">新的 editor</a> ,功能更強大。</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">原文:</div><blockquote><i>另外最大差異就是網站範本的編輯功能了,多了類似 <a href="http://pages.google.com/">Google Pages</a> 的所見即所得編輯方式,如下圖: ...<br />
我目前還是使用舊的文字範本,因為新的編輯方式不相容舊的文字範本,等之後有空在仔細把玩新的系統。</i></blockquote><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">到現在整個介面還是差不多,不過真的越來越好用了,我已經把舊的文字範本丟了。BTW Google Pages 死了,換了個 wiki 式的 <a href="https://sites.google.com/">Google Sites</a>。</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">原文:</div><blockquote><i>比較麻煩的是, <a href="http://picasaweb.google.com/">Picasa Web Albums</a> 不支援直接上傳 <a href="http://en.wikipedia.org/wiki/Png">PNG</a> 圖檔,而 blogger 的圖檔上傳功能有問題目前是暫時放在 <a href="http://www.flickr.com/">flickr</a>。</i></blockquote><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Picasa Web Albums 新的上傳介面已經支援 PNG 圖檔了,而且不會自動轉換成 JPG,算是相當方便。倒是 <a href="http://picasa.google.com.tw/">Picasa 桌面版</a>不能批次上傳和編輯 PNG ,只能用 Picasa Viewer 自動轉換成 JPG 來上傳。而 Picasa Web Albums 也另外支援不少新功能,像是臉部辨識,線上影片播放,線上編輯 (整合了 <a href="http://www.picnik.com/">Picnik</a> )等等。Blogger 的圖檔上傳功能也比較好用了,和 Picasa Web Albums 也整合得很好。我反而很少使用 flickr。</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">原文:</div><blockquote><i>另外, Google 各種服務似乎都有其獨特性,而且相似功能也都逐漸整合,不像 <a href="http://tw.yahoo.com/">Yahoo</a> 提供了三個相當相似的網路相簿功能: flickr 、<a href="http://tw.photos.yahoo.com/">我的相簿</a>、部落格相簿等...不知道是否有任何整合的計畫,否則可能會讓使用者相當困擾吧?</i></blockquote><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Yahoo 的確把我的相簿移掉了,而讓 flickr 及部落格相簿獨立運作,但又多了<a href="http://www.wretch.cc/">無名小站</a>的相簿XD</div>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-5810831657127936703.post-40220519481641988602011-02-12T01:41:00.000+08:002011-02-12T01:41:08.586+08:00Simple Note for KVM這篇主要是用來紀錄,如何使用KVM來執行實體硬碟上的Windows作業系統。方式很簡單,先安裝好KVM,並確定kernel module有正確啟動(注意,會和VirtualBox的module衝突),並擁有寫入/dev/kvm的權限。一般來說,Ubuntu應該會幫你處理好以上細節。接著確認好硬碟裝置檔名稱後,就可以輸入以下命令來啟動:<br />
<blockquote>kvm -m 1024m -soundhw ac97 -hda /dev/sda &</blockquote>要注意的是,KVM不能像<a href="http://blog.ansoncat.com/2009/06/using-virtualbox-to-execute-windows.html">VirtualBox一樣使用額外的MBR來開機</a>,因此必須啟動原本硬碟上的MBR和開機管理程式,所以啟動時要特別注意不要讓KVM執行HOST作業系統。<br />
<br />
因為新版的VirtualBox還算順暢,且使用上較為方便,因此目前我還是以它為主。Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-30378973689281235832011-01-26T00:40:00.017+08:002017-10-20T10:04:24.640+08:00Enable LCD of Sony VAIO VPCS116FW on Ubuntu 10.10Because SONY has modified BIOS for the Nvdia chip in VAIO, official Nvidia drivers can't drive built-in LCD correctly on Ubuntu 10.10. To make LCD usable, one need to:<br /><br />
<div>
1. <a href="http://blog.ansoncat.com/2011/01/install-updated-nvidia-driver-on-ubuntu.html">Use the latest Nvidia graphic driver from X updates PPA</a> (260.19.29/270.18 is tested).</div>
<div>
2. Modify /etc/X11/xorg.conf to add the two lines to the "Device" section:</div>
<div>
<span class="Apple-style-span"></span></div>
<blockquote>
<div>
<span class="Apple-style-span">Option "ConnectedMonitor" "DFP-0"</span></div>
<div>
<span class="Apple-style-span">Option "CustomEDID" "DFP-0: /proc/acpi/video/IGPU/LCD0/EDID"</span></div>
</blockquote>
<div>
With these two steps, LCD should work well. Additional external monitors can be added. Also, support of brightness control can be added. Following are my xorg.conf:</div>
<div>
<br /></div>
<iframe src="https://pastebin.com/embed_iframe.php?i=AcE8CNQp" style="border: none; width: 100%;"></iframe><br />
<div>
<br /></div>
<div>
Reference:</div>
<div>
<a href="http://code.google.com/p/vaio-f11-linux/wiki/NVIDIASetup">http://code.google.com/p/vaio-f11-linux/wiki/NVIDIASetup</a></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-83814598678804218682011-01-26T00:02:00.007+08:002011-02-10T22:01:33.274+08:00Install Updated Nvidia Driver on Ubuntu<div>Since Ubuntu updates binary drivers infrqeuently, one can update them from the X Updates PPA. Just use these commands:</div><div></div><blockquote><div>$ sudo add-apt-repository ppa:ubuntu-x-swat/x-updates</div><div>$ sudo apt-get update</div></blockquote><div>Then you can get stable release of X.org components, drivers from upstream. Please be aware that those packages are not supported by Ubuntu. Nextly, if you have installed the binary driver for an Nvidia card, you can just type:</div><div><blockquote>$ sudo apt-get upgrade</blockquote></div><div>to upgrade it. Otherwise you can use the "Additional Drivers" tool or just type:</div><div><blockquote>$ sudo apt-get install nvidia-current</blockquote></div><div>to install it. If CUDA/OpenCL headers are also needed, they can be installed by executing this command:</div><div><blockquote>$ sudo apt-get install nvidia-current-dev</blockquote></div><div>After installing all Nvidia packages, a GPGPU (OpenCL/CUDA) development environment is established successfully.</div><div><br /></div><div>PS: You may need to manually delete some files/links from old version of drivers under the /usr/lib directory.</div><div><br /></div><div>Reference:</div><div><a href="https://launchpad.net/~ubuntu-x-swat/+archive/x-updates">https://launchpad.net/~ubuntu-x-swat/+archive/x-updates</a></div><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-10366330541331980722011-01-18T18:31:00.004+08:002011-01-18T18:43:10.666+08:00Enable DirectVobSub with WMP on WIN7<div>Reference to : <a href="http://www.codecguide.com/faq_subtitles.htm#item11">http://www.codecguide.com/faq_subtitles.htm#item11</a></div><div><br /></div><div>To make DirectShow works, you can use <a href="http://www.codecguide.com/windows7_preferred_filter_tweaker.htm">win7dsfiltertweaker</a> to disable formats support of the Media Foundation Framework (E.g.: MP4). This is a workaround, actually.</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-60047552801896557452010-12-08T23:54:00.003+08:002010-12-09T00:00:41.203+08:00無題<div>"Will you love me for the rest of my life?"</div><div><br /></div><div>"No, I'll love you for the rest of mine."</div><div><br /></div><div>From "Phenomene"</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-22812809314490646652010-12-08T23:39:00.001+08:002011-02-10T21:45:21.276+08:00無題死生契闊,與子成說。執子之手,與子偕老。Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-63380508762149910752010-10-20T10:11:00.003+08:002010-10-20T10:14:22.223+08:00關於愛情A: 如果愛情是不斷的妥協,那我究竟得到了些什麼?<div><br /></div><div>B: 愛不是索取,而是給予。</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-33446801406510942682010-08-20T22:54:00.000+08:002010-08-20T22:56:13.862+08:00人生如果說,我無聊的人生之中真有什麼值得大書特書的事情,那也只有"遇見了你"這件事吧...Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-73908333667463022762010-06-30T21:44:00.003+08:002010-06-30T21:49:18.475+08:00無題孤單一人總容易萌生不好的念頭,或許,不要試著有所期待,就不會在失望時幾乎鯁噎了...Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-5810831657127936703.post-26340693082602987982010-03-25T09:07:00.001+08:002010-03-25T09:13:04.737+08:00Android離線地圖相關資訊好站<div><a href="http://android-map.blogspot.com/">Dr. TYT 的 Android 地圖</a></div><div><br /></div><div>提供了不少好用軟體的相關使用及下載資訊。比如說,可以先使用MOBAC下載所需地圖,然後將資料庫丟到Android手機上供RMaps存取,就可以在手機上查詢地圖,非常好用。可惜沒支援景點搜尋和導航功能(廢話...)</div><div><br /></div><div>題外話,Android 2.1 for Hero啥時才要出啊?再不出就只好DIY了...</div><div><br /></div><div><br /></div><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-27504501161124473462009-10-19T15:01:00.002+08:002009-10-19T15:03:56.989+08:00[連結]用 USB 隨身碟做為 Windows Vista/7 安裝來源 (使用 grub4dos)<a href="http://chwong.net/">http://chwong.net/</a><br /><br />感謝OGC >///<Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-88290901159653939032009-06-03T21:43:00.006+08:002011-02-10T22:43:59.578+08:00Using VirtualBox to Execute Windows Installed on Physical Disk<div>更新:新版VirtualBox效能已沒有太大的問題。</div><div><br /></div>基本上這篇算是VirtualBox使用上的筆記,目標是讓VirtualBox載入位於實體磁碟上的Windows作業系統(這裡是用XP)。<br /><br />首先要確認Windows本身需不要需修改或安裝不同的驅動程式或者修改虛擬機器的組態,請參考:<br /><a href="http://www.virtualbox.org/wiki/Migrate_Windows">How to migrate existing Windows installations to VirtualBox</a><br /><br />在建立對應的VMDK之前,要準備好開機磁區映像檔。因為VirtualBox無法讓grub載入原先儲存在linux分割裡的設定,所以我們準備好替代用的開機磁區讓VirtualBox用來載入Windows。在Ubuntu底下可以安裝"mbr"套件來取得相容Windows的簡單bootloader。安裝完"mbr"套件之後執行(<a href="http://forums.virtualbox.org/viewtopic.php?p=1486#p1486">參考</a>):<br /><blockquote>install-mbr --force win.mbr<br /></blockquote>就可以取得開機磁區,接著下一步就是建立對應實體分割的VMDK:<br /><blockquote>VBoxManage internalcommands createrawvmdk -filename \<br />win.vmdk -rawdisk /dev/<span style="color: rgb(255, 0, 0);">sda </span>-partitions<span style="color: rgb(255, 0, 0);"> 1</span> -relative -register \<br />-mbr <span style="color: rgb(255, 0, 0);">win.mbr</span><br /></blockquote>要注意的是,必須要在~/.VirtualBox/HardDisks目錄底下執行此命令,否則可能會有錯誤訊息。相關操作說明可以參考<a href="http://www.virtualbox.org/manual/UserManual.html#rawdisk">此網頁</a>。接著就很直覺了,你只需要執行VirtualBox來建立新的虛擬機器,並使用win.vmdk當作虛擬磁碟。執行後應該就可以順利看到Windows在VirtualBox中執行了。<br /><br /><s>值得一提的是,開啟VT-x的支援,反而會讓Windows XP的效能變差。將VT-x關閉後,我又對Windows的顯示效果做了些調整,整體的反應速度才稍微比較能讓人接受。這和執行Ubuntu的情況完全不同,真是令人費解。</s><br /><br />總之,目前就可以把非Windows不可的程式移到VirtualBox裡面執行囉,但要打電玩的話可能還是要在實體電腦上執行Windows吧,因為VirtualBox的3D加速效能<s>還是很差</s>比直接執行還差一些。<br /><br />之後大概會再試試看VMware、kvm和xen等等方案...Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-77048100109128105722009-05-30T14:08:00.014+08:002012-10-18T19:55:08.225+08:00JavaSE 6u14推出,終於支援escape analysis...最近Sun更新了JavaSE 6推出了<a href="http://java.sun.com/javase/6/webnotes/6u14.html">6u14</a>這個更新版,裡面不少有趣的新特色,其中和VM本身最為相關的部分有三(目前都是選用或實驗性的功能):<br />
<ol>
<li>Optimization Using Escape Analysis</li>
<li>Compressed Object Pointers</li>
<li>Garbage First (G1) Garbage Collector </li>
</ol>
其中第一項,我在兩年半前的<a href="http://blog.ansoncat.com/2006/12/stack-allocation.html">文章</a>裡提過(事實上,更早就有相關研究了),但直到現在,新版的hotspot才開始支援以escape analysis為基礎的優化(像是stack allocation、lock elimination等)。這也許可以說明一件簡單的現象:學界講求的是research,而業界重視的則是quality...<br />
<br />
<b>補充:<a href="http://www.cs.nctu.edu.tw/~byshen/">sby</a>大神提示,<a href="http://harmony.apache.org/">Apache Harmony</a>早在<a href="https://issues.apache.org/jira/browse/HARMONY-3729">兩年前</a>就支援escape analysis及相關的優化技術了。</b><br />
<br />
<b></b>第二項其實也不新了,早在兩三年前的學術界裡就出現過相關的<a href="http://www3.interscience.wiley.com/cgi-bin/fulltext/111082816/PDFSTART">討論</a>了。簡單的來說,為了避免64bit pointer帶來的space overhead,可以用類似offset的方式來記錄objects的address。缺點就是,存取時會帶來一些execution time overhead,heap的大小也會有限制。優點當然就是heap空間的節省了。也可以參考這篇<a href="http://blogs.sun.com/nike/entry/compressed_object_pointers_in_hotspot">簡介</a>或<a href="http://wikis.sun.com/display/HotSpotInternals/CompressedOops">這裡</a>。<br />
<br />
第三項Garbage First (G1) Garbage Collector,主要演算法來自於2004年的一篇<a href="http://research.sun.com/jtech/pubs/04-g1-paper-ismm.pdf">paper</a>,內容還沒有時間好好看過,但據說有不少好處:<br />
<blockquote>
Garbage First, or G1, is a <b>low pause</b>, server style collector. G1's primary advantages over the Concurrent Mark-Sweep (CMS) collector include<b> incremental compaction, better predictability</b> and <b>ease of use</b>.</blockquote>
<s>比較值得注意的是,目前若想將G1應用在production的用途中,必須要與Sun簽署合約。</s><a href="http://developers.solidot.org/article.pl?sid=09/06/04/0724205">後續發展。</a><br />
<br />
以上提到的新特色,其中一部分將會成為<a href="http://openjdk.java.net/projects/jdk7/features/">JDK 7</a>的標準功能,可以想見這些特色在未來將會更為成熟完整。<br />
<br />
BTW,Hotspot中有不少功能或優化技術,實際上是學業界合作的成果,除了上面提到的部分外,像是client compiler裡的SSA support,也是學界的成果。研究的成果能夠被用在實際的產品中,其實是很棒的事,除了代表成果有實際的用途外,也代表了來自業界的肯定,真是令人嚮往啊...Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-12339819614637750012009-05-26T23:30:00.003+08:002011-02-10T22:50:11.003+08:00感謝Josh提供關於標籤雲製作的中文文件更新:新版的官方範本已直接支援標籤雲。<br /><br />感謝Josh提供的<a href="http://joshnote.blogspot.com/2007/01/label-clouds-for-blogger.html">Label Clouds(標籤雲) For Blogger</a>文章,非常實用呢。當然,原作者也是非常值得尊敬的!!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-89933005317692706072009-05-26T22:51:00.003+08:002011-03-09T21:05:56.483+08:00感謝阿伯特贊助照片更新:阿伯特當然順利畢業了也希望他能早日結婚;本站版面也經過修改了。<br />
<br />
感謝<a href="http://albert361.twbbs.org/blog/">阿伯特</a>贊助美麗的照片,還幫忙裁切和做影像處理。整個版面看起來真是不一樣了,多謝,希望他明天的presentation能夠順利進行,也希望他能夠早點畢業。Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-84470985966768388002009-05-23T20:43:00.003+08:002009-05-24T12:04:27.634+08:00Don't be afraid!!Life is so short!! Hurry up !!<br />You should not be afraid!!<br />Just do it, just do what you really want to do!!<br />You know, you are not alone!!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-40715525721598210632009-05-22T23:19:00.011+08:002009-05-23T14:47:59.134+08:00Some Notes about Android<span style="font-weight: bold;">May not be correct and useful for you...</span><br /><br />About WebKit in Android:<br /><ol><li>Java script JIT is disabled.<br /></li><li>Graphics: WebKit => Skia=> OpenGL/ES (libEGL, libGLESv1_CM)</li></ol><br />About Java Script JIT in WebKit:<br /><ol><li>Supports X86 currently.<br /></li><li>Port for ARM is <a href="http://lists.macosforge.org/pipermail/webkit-dev/2009-April/007253.html">announced</a> and should be integrated later.</li><li><a href="http://www.andestech.com/">The Andes Tech</a> also claimed that they have a port for NDS.</li></ol><br />About OpenGL/ES implementation:<br /><ol><li>Software: agl (libagl) => PixelFlinger (libpixelflinger, JIT supports ARM only)</li><li>Hardware: hgl (libhgl, vendor specific)</li></ol><br />Some Random Thoughts:<br /><ol><li>Skia => PixelFlinger for software rendering?</li><li>Is Java script JIT in WebKit useful?</li><li>Dalvik + JIT in WebKit or PixelFlinger?</li><li>Dalvik, WebKit, PixelFlinger => LLVM?<br /></li></ol><br />Related Code Location:<br /><ol><li>WebKit: <span style="font-style: italic;">external/webkit</span></li><li>Skia: <span style="font-style: italic;">external/skia</span></li><li>OpenGL/ES: <span style="font-style: italic;">frameworks/base/opengl/libs</span></li><li>agl:<span style="font-style: italic;"> frameworks/base/opengl/libagl</span></li><li>PixelFlinger: <span style="font-style: italic;">system/core/libpixelflinger</span></li><li>hgl:<span style="font-weight: bold;"> Not available</span><br /></li></ol><br />Reference:<br /><ol><li><span style="font-size:100%;"><a href="http://jserv.blogspot.com/2009/05/android-opengles.html">Android 上的原生 OpenGL/ES</a></span></li><li><span style="font-size:100%;"><a href="http://blog.linux.org.tw/%7Ejserv/archives/002095.html">淺談 Google Skia 圖形處理引擎</a></span></li><li><span style="font-size:100%;"><a href="http://android.git.kernel.org/">Android Source Code</a><br /></span></li></ol>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5810831657127936703.post-19065544551791068272009-05-22T13:15:00.010+08:002011-04-13T10:29:56.683+08:00調整Firefox的網頁顯示區尺寸<div>Update again: <a href="http://www.google.com/chrome">Chrome</a>會是更簡單的選擇,不過<a href="http://www.mozilla.com/zh-TW/firefox/">Firefox 4</a>和<a href="http://windows.microsoft.com/zh-TW/internet-explorer/products/ie/home">IE 9</a>似乎也改善了不少。<br />
<br />
Update: <a href="http://champyen.blogspot.com/2010/08/firefox-on-netbook.html">續Firefox on Netbook</a>又增加了一些有用的Tips,感謝。</div><div><br />
</div>前幾天試著按照<a href="http://champyen.blogspot.com/2009/05/firefox-on-netbook.html">Firefox on Netbook</a>及<a href="http://www.ghacks.net/2008/11/19/setup-firefox-to-use-minimal-screen-estate/">Setup Firefox To Use Minimal Screen Estate</a>兩篇文章的介紹來修改<a href="http://www.moztw.org/">firefox</a>的外觀。主要目的是為了增加網頁的可視範圍,雖然我的notebook解析度為1280x768,但有時候還是會覺得不夠用。<br />
<br />
修改的原理主要是把不常用的部分移動到適當的位置以及自動隱藏。細節不多說,那兩篇文章說的很清楚了,總之就是安裝<a href="https://addons.mozilla.org/zh-TW/firefox/addon/1455">Tiny Menu</a>,然後將選單及瀏覽工具列整合。<s>接著安裝<a href="https://addons.mozilla.org/en-US/firefox/addon/1530">Autohide Status Bar</a>讓狀態列可以自動隱藏。我大概做到這邊就覺得效果不錯了,</s>有興趣的人可以試著安裝<a href="https://addons.mozilla.org/zh-TW/firefox/addon/9256"> Hide Caption</a> 與 <a href="https://addons.mozilla.org/firefox/addon/1337">Hide Tab Bar</a>兩個extension,但要注意它們似乎和目前新版的firefox不太相容。<a href="https://addons.mozilla.org/en-US/firefox/addon/1530" style="color: #ff6666;">Autohide Status Bar</a><span style="color: #ff6666;">讓狀態列可以自動隱藏,也是一個不錯的選擇,但很容易影響網頁靠近底部的某些選項或按鈕的位置,有時會讓人很煩躁。</span><br />
<br />
另外,如果沒有特殊需求的話,其實按下F11進入全螢幕模式也是個不錯的選擇。Unknownnoreply@blogger.com0