Recent Comments
Archives
- May 2012 (8)
- April 2012 (11)
- March 2012 (10)
- February 2012 (11)
- January 2012 (5)
- December 2011 (13)
- November 2011 (12)
- October 2011 (10)
- September 2011 (7)
- August 2011 (5)
- July 2011 (11)
- June 2011 (21)
- May 2011 (22)
- April 2011 (36)
- March 2011 (43)
- February 2011 (23)
- January 2011 (24)
- December 2010 (34)
- November 2010 (19)
- October 2010 (16)
- September 2010 (15)
- August 2010 (10)
- July 2010 (12)
- June 2010 (3)
- May 2010 (3)
- April 2010 (4)
- March 2010 (8)
- February 2010 (14)
- January 2010 (13)
- December 2009 (16)
- November 2009 (28)
- October 2009 (24)
- September 2009 (12)
- August 2009 (7)
- July 2009 (10)
- June 2009 (11)
- May 2009 (22)
- April 2009 (21)
- March 2009 (18)
- February 2009 (7)
- January 2009 (32)
- December 2008 (19)
- November 2008 (12)
- October 2008 (15)
- September 2008 (14)
- August 2008 (15)
- July 2008 (18)
- June 2008 (20)
- May 2008 (19)
- April 2008 (27)
- March 2008 (22)
- February 2008 (21)
- January 2008 (15)
- December 2007 (22)
- November 2007 (17)
- October 2007 (29)
- September 2007 (31)
- August 2007 (34)
- July 2007 (31)
- June 2007 (36)
- May 2007 (23)
- April 2007 (22)
- March 2007 (30)
- February 2007 (50)
- January 2007 (75)
- December 2006 (48)
- November 2006 (59)
- October 2006 (89)
- September 2006 (29)
- August 2006 (48)
- July 2006 (14)
- June 2006 (35)
- May 2006 (62)
- April 2006 (63)
- March 2006 (72)
- February 2006 (83)
- January 2006 (56)
- December 2005 (46)
- November 2005 (60)
- October 2005 (27)
- September 2005 (54)
- August 2005 (83)
Tags
amazon android api aws bittorrent browser cdn certificate chrome cloud cloudfront cpan database dns ec2 facebook firefox freebsd google hosting html https ie image ipv6 javascript jquery js linux mobile mozilla mysql p2p performance perl php secure security ssl twitter ubuntu video web wordpress yahooCategories
- Anime (25)
- AWS (51)
- BBS (17)
- Blog (201)
- Book (18)
- Bridge (1)
- Browser (283)
- CDN (21)
- Cloud (66)
- CMS (33)
- Comic (17)
- Computer (1980)
- Computer and Network Center (32)
- CSS (31)
- Database (132)
- DNS (50)
- Editor (11)
- Financial (37)
- Firefox (149)
- Food (11)
- FreeBSD (115)
- Game (25)
- GoogleChrome (25)
- Hardware (144)
- IE (64)
- Joke (131)
- Lab (3)
- Linux (72)
- MacOS (4)
- Mail (69)
- Movie (18)
- Murmuring (2056)
- Music (37)
- MySQL (97)
- NCTU (63)
- NetBSD (7)
- Network (1486)
- OpenBSD (3)
- Opera (21)
- OS (205)
- P2P (86)
- Photo (57)
- Political (48)
- Programming (315)
- Recreation (372)
- RSS (65)
- Safari (22)
- Science (28)
- Search Engine (126)
- Security (336)
- SMS (5)
- Social (60)
- Software (1062)
- Spam (86)
- Sport (4)
- Telephone (62)
- Television (35)
- Usenet (13)
- Vim (3)
- Wiki (25)
- Windows (48)
- WWW (782)
Blogroll
Meta
Category Archives: Programming
如果要自己寫 TOTP 的幾個要看的東西…
整理下來: HOTP: An HMAC-Based One-Time Password Algorithm TOTP: Time-Based One-Time Password Algorithm KeyUriFormat – google-authenticator – The format of URIs containing encoded keys – Two-step verification – Google Project Hosting 有玩過 HMAC 的人,讀這些文件應該不難… TOTP 在預設的情況下,其實就是 HMAC-SHA-1 後取後面 32bits,然後轉成數字取 100000 的餘數,而 … Continue reading
PHP 提供的資料結構…
從「How big are PHP arrays (and values) really? (Hint: BIG!)」這篇看到的。文章本身值得花些時間看過了解,不過對我來說重點在最後面的 SplFixedArray。 PHP 的 Datastructures 說明目前 PHP SPL 所支援的 data structure,在記憶體用量以及效率上面都會比自己實作來的小且快。 可以看到很多都支援 Countable、Iterator,以及 ArrayAccess,代表可以用 foreach() 或是對應的方式存取… 如果自己寫 library 的時候應該要善用這些 SPL。
Posted in Computer, Murmuring, Programming, Software Tagged array, data, php, spl, structure Leave a comment
BSD make 與 GNU make 的 Makefile…
前陣子看到 fcamel 丟出來的舊文章:「Debugging make」,花了一些時間看裡面關於 BSD make 與 GNU make 的相同處,之後寫 Makefile 的時候應該會相當有幫助。 目前的目標是 FreeBSD 與 Ubuntu,文章裡面有提到三個變數在兩個平台是通用的,分別是 $
安裝 Pretty Beautiful Javascript…
Posted in Browser, Computer, GoogleChrome, Murmuring, Network, Programming, Software, WWW Tagged chrome, extension, google, javascript 2 Comments
改用 jquery-ujs…
昨天聽 othree 提到 jquery-ujs (Unobtrusive scripting adapter for jQuery),裡面有不少 convention 可以直接套用。othree 在三月有寫一篇文章介紹:「jQuery-ujs」。 雖然 repository 看起來是給 RoR 使用,但直接把 rails.js 抓下來用「<script src=”rails.js”></script>」掛上來,還是可以用在非 RoR 環境裡。 直接看 code 也很好懂,舉幾個例子來說: <?php $sToken = hash(‘sha256′, session_id()); ?> <meta name=”csrf-token” content=”<?php echo $sToken; ?>”> <meta name=”csrf-param” content=”sToken”> … Continue reading
Posted in Computer, Murmuring, Network, Programming, Software, WWW Tagged javascript, jquery, ujs 1 Comment
jQuery 1.7 版,並計畫瘦身 jQuery…
jQuery 1.7 前幾天丟出來了,可以看到很多對 event 操作的改善,包括效能與功能 (新增了 .on() 與 .off()):「jQuery 1.7 Released」。 另外今天又看到瘦身計畫:「Building a Slimmer jQuery」,希望把一些「應該要拿掉」或是「應該要被修正」的問題處理掉… 所以在 jQuery 1.7 標為 Deprecation,預定在下個主版本就會處理掉這些問題。 目前 (對我家) 最主要的影響應該是 .live() 會被拔掉,以及之前有使用 .attr(‘value’) 取 current value (要 current value 應該用 .val() 取得)。 看起來是往好的方面進行…
Posted in Browser, Computer, Murmuring, Network, Programming, Software, WWW Tagged javascript, jquery, performance, size Leave a comment
擋掉 Google Plus,加快 Google Reader 速度…
Google Reader 這次改版另外一個為人詬病的問題是「變卡」,主要原因是 Google Plus。 第一個想到的解決是利用 Adblock Plus,將 http://www.google.com/reader/* 以及 https://www.google.com/reader/* 連到 https://plusone.google.com/* 的連線需求都都擋下來。但看了 Adblock Plus 的文件,不知道要怎麼設定… 後來想到的解法是自己寫 Google Chrome Extension,主要是很久沒寫都忘光了,剛好找個實際會用到的功能來寫… 主要是用到 chrome.tabs 與 chrome.experimental.webRequest 兩組 API 組合。其中後面這組 API 必須用 about:flags 打開權限才能使用。 成品在這:「google-reader-faster」,由於用到 Google Chrome 的 Experimental API 所以無法上傳到 Web … Continue reading
Posted in Browser, Computer, GoogleChrome, Murmuring, Network, Programming, Software, WWW Tagged adblock, api, chrome, experimental, google, plus, reader 2 Comments
用 RVM 安裝 Ruby 1.9.3
為了跑 heroku 才剛裝完 1.9.2,就看到 Twitter 與 Google Plus 有人說 1.9.3-p0 出了:「[ANN] Ruby 1.9.3-p0 is out」。 首先先用 rvm get head 更新,然後用 rvm list known 應該就可以看到 1.9.3-p0 了,接下來用 rvm use –default 1.9.3 將預設值換成 1.9.3,然後 gem install heroku 把 gem 裝起來…
Posted in Computer, Murmuring, Network, Programming, Software Tagged 1.9.3, ruby, rvm Leave a comment
PHP 5.3 的 anonymous function
在看到 PHPConf Taiwan 2011 的議程介紹後,看到有人在推薦 Slim Framework,一連上去就看到包含 anonymous function 的 sample code: <?php require ‘Slim/Slim.php’; $app = new Slim(); $app->get(‘/hello/:name’, function ($name) { echo “Hello, $name!”; }); $app->run(); ?> 然後回頭去翻 PHP 的說明:「Anonymous functions」,發現是從 PHP 5.3 開始支援。 於是在 JavaScript 上常用到的技巧就也可以在 PHP … Continue reading
Posted in Computer, Murmuring, Network, Programming, WWW Tagged anonymous, function, php, programming 2 Comments
Heroku 上跑 PHP 的心得與感想…
Heroku 不愧是 PaaS 中的領先品牌,deploy 的操作及穩定性都相當好,加上 Heroku 每個 project 都有 1 free dyno 可以使用,對於 prototyping 其實相當棒… 關於要怎麼在 Heroku 上跑 PHP,可以參考 xdite 寫的「Create PHP application on Heroku without Facebook account」這篇文章。 有幾個要抱怨的: PHP 是用 Apache HTTP Server 跑的,所以可以用 .htaccess 寫 rewrite rule,不過 Options … Continue reading
Posted in Cloud, Computer, Murmuring, Network, Programming, WWW Tagged cloud, gd, heroku, image, imagemagick, jpeg, php Leave a comment
