星期一, 2月 26, 2007

沒有NULL Iterator

把c++ 程式碼升級到vs2005後才發現,先前vector::iterator ite = NULL之類的程式碼都編譯不過了,經過google一番後才發現,似乎STL的iterator本來就不存在著NULL的觀念,只能利用其他的變數,或是利用ite = some_container.end() 來達到類似的效果。

參考資料:
  • http://www.mip.ups-tlse.fr/~grundman/stl-tutorial/tutorial.html

    Why doesn't STL have null iterator values? STL iterators are supposed to be generalized pointers, right? That phrase has been bandied about a great deal, but it is very misleading. STL iterators are generalizations of array pointers, that is, a pointer set to point into an array, and then incremented or decremented. It does not make sense to talk about such a pointer having a null value.

    In C and C++, null pointers are used to indicate errors, or abnormal conditions. When you have a C++ iterator type, there is normally only one kind of error value it will return: one indicating "I fell off the end of the list". It is natural, therefore, for most iterator classes to use null as the "past-the-end" value. If you find yourself wanting a null STL iterator, you probably want the past-the-end value.


星期二, 2月 20, 2007

.NET中的Plug-In設計

Orcas包含了一個新的System.AddIn namespace用來輔助製作plug-in技術

Agile之後是什麼

當一堆人還不清楚什麼是Agile Software Development/Agile Project Management時,已經有人開始在思考下一步了

Google, 微軟, Yahoo的人才培養

某人在這三大龍頭的工讀經驗: http://tastyresearch.wordpress.com/work-stories/

Google Summer of Code: http://code.google.com/soc/

  • Google預計於今年(2007)舉辦第三屆GSoC。由一堆公司擔任指導者來指導加入GSoC的學生。指導者與學生都必須要提出相關計畫報告。GSoC為期約三個月,若每個評鑑點都通過評鑑,則指導者與學生都能獲得完整的薪資,否則就只能得到部分薪資。

星期一, 2月 19, 2007

Regular Expression

輔助寫作regular expression的工具

Selenium Remote Control初體驗

今日首次使用Selenium Remote Control來測試網頁,感覺不錯,不過仍然遭遇到一些問題,還好最後都解決了。
  • 問題一: 連不上Selenium Server
    原本以為是被防火牆擋住了,弄了半天都沒辦法解決。後來才發現是VPN搞的鬼,關掉VPN就可以正常連線了。
  • 問題二: 無法下達type指令
    一直無法成功鍵入"cmd=type&1=question&2=This is a test&sessionId=1234"指令,總是回傳exception。開啟Selenium在瀏覽器端的log視窗也看不出什麼端倪。最後才發現原來是我耍白爛,在我所測試的網頁中,id question的控制項其實是個combo box,而我想測試的text box的id其實是txtquestion。因此只要將指令改成"cmd=type&1=txtquestion&2=This is a test&sessionId=1234"即可正常執行。
  • 問題三: 無法利用type指令送出中文
    直接送入中文, 如"cmd=type&1=txtquestion&2=馬英九", 會在瀏覽器端看到亂碼。如果將"馬英九"在utf8下編碼成url的%編碼 (%e9%a6%ac%e8%8b%b1%e4%b9%9d),就能在瀏覽器端正常收到"馬英九"三個字