顯示具有 Code Call 標籤的文章。 顯示所有文章
顯示具有 Code Call 標籤的文章。 顯示所有文章

12/29/2008

Vista 效能雜談: superfetch

很多人感覺 Vista 越用越快, 這並不是錯覺, 而是因為 Vista 的 Superfetch 正在發揮它的功能. Superfetch 的前身是 prefetcher, XP 時代就有, 在 Vista 時期變得成熟並且更積極:


disk I/O 是系統效能的最大殺手, 現下 CPU 的指令是以 nano second 在算的, 而 disk i/o 則是以 millisecond 在算的, 這兩者相差百萬倍, 故而, 減少 blocking i/o, 能有效增加系統效能, 這是 superfetch 的基本精神.


當系統執行時, Superfetch 服務會在背景記錄每一支程式的 disk I/O, 包括啟動的頻率, 載入那些 DLL, 開啟那些資料檔等等. 這樣的使用計錄累積一段時間之後, superfetch 開始"猜"使用者最可能需要那些檔案, 然後利用系統閒置的時間把這些檔案預載到記憶體中, 等使用者真的要執行這支程式時, 因為所有需要的檔案已經載入記憶體中, 不再需要從磁碟中讀取, 所以可以大幅增加啟動速度.

 

除此之外, prefetch 也會要求系統的磁碟重組程式把這些檔案重組到鄰近的磁區. 等磁碟重組程式開始進行例行性的最佳化時, 會根據之前 superfetch 的提供的資料更精準地最佳化. 理論上, 檔案重組後, 因為 seeking 大幅減少, 所以存取速度會快很多. 讓 superfetch 的預載更有效率


預載檔案需要使用記憶體, superfetch 隨時監視系統記憶體的使用量, 當有應用程式開始需要大量記憶體時, superfetch 會動態地把記憶體歸還給系統, 讓應用程式有足夠的記憶體而不需要 paging. 反之, 等應用程式把記憶體釋回系統後, superfetch 會再次把檔案預載回記憶體中.


可想而知這樣的機置要有很多 ram 才能順暢, 所以如果可以的話, 最好讓 Vista machine 安裝 2G 以上的記憶體. 同時, 如果 CPU 不太差, 加插一支 USB 拇指碟啟動 ReadyBoost, 效能的改進將更為顯著

8/01/2008

Vista 究竟那裡比 XP 好

在 01 上大家吵得沸沸湯湯, 我來考考自己, 看 Vista 有那些 XP 沒有的東西:

1. Superfetch, Vista 內建智慧性的快取系統, 能夠分析使用者的使用習慣, 預先載入需要的系統檔案

2. Prefetch 開機最佳化. Vista 會分析系統開機時的檔案載入順序, 加以微調, 加快開機速度

3. ReadyBoost, 利用高速 flash memory 做為系統快取

4. UAC, 雖然有一點煩, 但它可以保謢系統, 減少中病毒或木馬的機會

5. Session separation. Services 都在 session 0 執行, 這樣不用擔心惡意程式使用 DoS 攻擊

6. Media Center built-in home premium edition or higher.

7. Better Error reporting and tracking.

8. Search integrated start menu

9. Better layout for all programs.

10, brand new thread pool API

11, a more secure TCP/IP stack

12, 開機的 glowing windows mark. 唔, 對使用者沒有任何幫助的東西, 但是是我做的, 哇哈哈

7/03/2008

True story, in a code review conversation...

BUG: ---------, *** leaking file handle upon operator new failure

It is hard not to be emotionally affected by *** code.

Nevertheless, ****** complains that *** leaks file handle when *********::operator new() failed. It is essentially a very simple change, but I couldn't help myself to do a clean up....

阿蛋:
"It is hard not to be emotionally affected by *** code."  Ha!  that's the understatement of the year.  They forced you to write a GOTO?  I'd be taking really long shower to make myself feel clean again.

4/29/2008

What does ACTRL_DS_CONTROL_ACCESS do?

So saith MSDN:

Access allowed only after extended rights checks supported by the object are performed. This flag can be used alone to perform all extended rights checks on the object or it can be combined with an identifier of a specific extended right to perform only that check.

What is "Extended right checks"?

 

Anyways it doesn't look like something that should get into the Security Dialog for AD object.

4/28/2008

寫程式: 會, 不會

01 上有這麼一則討論

"請問資工資管畢業生有幾%不會寫程式"

這是個月經話題了, 不過, 今天我想了一想, 在討論"會不會寫程式"之前, 必需先定義什麼是"會寫程式"

 

我不完整地劃分出幾個等級

 

1. Casual Scripter - a trained monkey can do

    1. 有能力編寫基本的 script 用來操控系統或資料庫
    2. 有能力編寫基本的 server side script. 或 dynamic web pages

2. 入門程式設計師 - showing potential

    1. 能使用業界慣用的工作做出 script 能做到的事, 並且效率更好
    2. 熟知, 並且能實作基本的演算法與資料結構
    3. 對 programming 與 computer science 具備廣泛的常識
    4. 大概知道那些服務應該由 OS 提供, 而那些又從 language 本身提供
    5. 能實作一支 10000 - 20000 行的程式

3. 中階程式設計師 - good implementation

    1. 對問題與執行環境有大略清楚的掌握
    2. 完整地處理所的錯誤
    3. 正確地使用 System API, 正確地 implement 一個 design.
    4. 程式碼條理清楚, 遵偱既定的 coding standard, consistent style.
    5. 能正確地選擇, 便用最合理的演算法 (e.g. tree v.s. list, standard library v.s. custom made), 並且能提出具體的理由支持自己的選擇
    6. 能有系統的 debug
    7. 能領導測試人員與 PM 一同達到最好的產品品質

4. 可堪獨立作業的程式設計師 - good designer

    1. 清楚地掌握問題與環境
    2. 清楚地比較各種設計的優缺點與限制
    3. 清楚地掌握各種 state 與行為
    4. 沒有不必要的 layering
    5. 預見, 處理所有的 edge case.

 

我預期一個科班畢業生最少達大一半以上的 level 2. 而在入行二年後達到大部份的 level 3.

 

合理嗎?

4/11/2008

GetTickCount64

In the past GetTickCount has been a good friend to scenarios where you want simple time counting. One typical usage is to count the timeout by yourself. Say, you want to wait for your objects for 10 seconds while allowing your Window messages loop to proceed uninterrupted. Instinctively you write code like:

1: DWORD dwTimeout = GetTickCount() + dwMilliseconds; 
2:   
3: while (dwTimeout > GetTickCount()) 
4: { 
5:   
6: 
.... 
7:   
8: MsgWaitForMultipleObjects(); 
9:   
10: .... 
11: } 
12:  

With some experience you know that this function has a seemingly innocent but in fact very serious restriction: GetTickCount() wraps every 49.7 days, which translates to: every 49.7 days, this block of code will have a dwMilliseconds millisecond Window to fail. Every n milliseconds per every 49.7 days may sound safe to ignore. Well, this might be true for casual freeware running on client computers. But for servers that run 24/7, or for components that ship with Windows. This will fail, and it will fail at the worst timing ever, period.

Starting Vista, Windows offer an 64 bits version of GetTickCount called GetTickCount64(). a 64 bits tick count is practically timeless (if it ever wraps, the speed of light will become negative and the universe will vanish). With this new API, the simple implementation became solid again and your logic can be as simple as you'd like.

Sound all good? Perhaps. Let's switch to API designer's seat and think about the problem again: GetTickCount is a API that looks simple, really simple, so simple that it attracts lots of usage. However, beneath the skin of oh-it-is-so-easy-to-use, the API itself is in fact cumbersome to use correctly. This illusion of simplicity invites bug that is very difficult to reproduce and investigate. So think the problem again, does it sound as good?

"When reviewing an API design, think about how it will be abused". I don't remember where this sentence came from but it has been proofing itself again and again. If the designer of GetTickCount thought about how this innocent API would lead many hard bugs, he or she will probably use the 64 bits time counter from day 0.

So, for you my dear reader, what can you take out today? I'll say two things:

1. Windows Vista is better from fundamental API support

2. When designing API, think about how they can be abused and how likely they're abused

I really hope my API won't be picked for bad API design discussion. oh well.

1/13/2008

Shell API Makes sense this time

With all due respect: Shell API is powerful. No doubt about it, but it is so complex that it brings all sorts of extra stuff you don't really anticipate until it is too late. This price tag made Shell API less likely to be the first choice when facing a typical programming problem.

Today I witted a rare chance where the Shell API became the most reasonable choice.

My problem was to validate an user input and see whether it is a network path. For example, given something like \\server\share\dir1\dir2 , if the path is valid, I should return true.

When I first get this, I thought this is like a 5 minutes of work. Call FindFirstFile, if the call returns a valid handled, check whether WIN32_FIND_DATA.dwFileAttributes contains FILE_ATTRIBUTE_DIRECTORY. However, it was during my dev test, I found this FindFirstFile works fine on almost all scenario, except a very fundamental case: \\server\share. If you feed FindFirstFile with \\server\share, it will simply fail. So what do I do?

With remote impression, I found an API called NetShareCheck(). According to msdn this is what I needed. So my code became something like


 

HANDLE handle = FindFirstFile(…);

If (INVALID_HANDLE_VALUE != handle)
{

// Do what I used to do
}

else

{

//

// 15 lines of code or so to parse and setup

// the params for NetShareCheck

//


NET_API_STATUS result = NetShareCheck(…);

If (NERR_Success == result)
{

// ok this is what we want
}

}

So go to dev test again. Bah, no luck. Unfortunately NetShareCheck doesn't work the way I expected and I always get some asynchornize I/O like error. I was blocked and having a bad headache.


 

Problem always got resolved after a night of sleep. When I drive my wife to exam the next day, I suddenly realized there are shell API I might be able to use. After all, if explorer can see it, it is likely that your code using the same API can see it. I know Shell offers SHParseDisplayName (ref link) and SHGetPathFromIDList(ref link). The former one let you convert a path into Shell's "Item ID List" (ref link), and the later let you convert the item id list into its display name plus getting attributes we'd need. So my 3rd attempt wiped out all existing code and did something like this:


 

Pidl = SHParseDisplayName (szPath, xxxxx);

If (pidl)

{

hr = SHGetPathFromIDList(…pidl,…, attrResult)

if (IsWhatIWanted(attrResult))

hrRet = true;..

}


 

Did it worked? Oh yeah, flawlessly. Loved it.


 


 

Alright, now let's see how much we paid for this convenient function:

As soon as I called into ShParseDisplayName, the system loads all these jazz:


 

'Generic.exe': Loaded 'C:\Windows\System32\uxtheme.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\apphelp.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\networkexplorer.dll', No symbols loaded.

'Generic.exe': Unloaded 'C:\Windows\System32\networkexplorer.dll'

'Generic.exe': Loaded 'C:\Windows\System32\networkexplorer.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\oleaut32.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\propsys.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\wininet.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\normaliz.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\iertutil.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\mpr.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\ntlanman.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\netapi32.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\psapi.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\secur32.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\drprov.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\davclnt.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\cscapi.dll', No symbols loaded.

'Generic.exe': Loaded 'C:\Windows\System32\userenv.dll', No symbols loaded.


 

Huh, warned you, didn't I


 

1/08/2008

YouTube HD

跨年當天, 我上 YouTube 找 101 的煙火給家人看,突然後知後覺地意會到, 短短的兩年之內,隨選視訊變成一種唾手可得, 理所當然的東西. 好像在不知不覺之間, 時代又向前邁進了一步似的. 我幾乎可以看到 YouTube 在不久的將來, 會變成和 google 一樣的動詞. 一旦一個產品的名字變成動詞, 那表示這家公司的"獲利"也會從名詞變成動詞. 我相信 YouTube 會變成 google 的另一顆大搖錢樹, 甚至扮演廣播世代終結者的角色.

然後又到了敝人最喜歡的趨勢猜猜猜時間了. YouTube 接下來會怎麼發展呢?

  1. YouTube HD: 讓使用者下載 480P+ 的影片. 這個很有可能. 因為現在數位相機隨便拍也嘛是 640 x 480. 只要 YouTube 花多一些錢 (反正 google 銀彈無限), 就可以留下高畫素版本的影片. 因為 480P+ 的影片需要太多 bandwidth, 影片將可以被選擇性的下載. 這樣的功能, 會讓 You Tube 完全稱霸 PC based VOD. Hollywood 可能會因此狀告 Google, 不過, 只要 YouTube 再多花一些錢 (反正, again, google 銀彈無限), 就可以與 Hollywood 從相怨變成相戀.


     

  2. TV based VOD, 被 MS 拿下來, 但是普級速度緩慢: MS 會和 Hollywood 搭上更多線, 然後用 Xbox 360 與 Vista Media Center 做為平台攻下 TV-based VOD. NetFlix 會變成主要的 VOD 系統商, 並且和 Media Center 合作. Blockbuster 被 busted. MS 和 Cable companies 目前亦敵亦友的態式, 會更火熱.


     

  3. ITunes, iPod, iPhone, 會加入 YouTube 訂閱與下載的功能. 然後繼續賺錢.


     

以上.

12/26/2007

SX Geo Tagger

SX GT (StarterX's GPS Tagger)

Disclaimer

This document denotes a software project purely of my personal interest. I do not make any promise of anything mentioned in this document and all technology I used in this project is NOT related to my day job. This project only use published API and SDK tool. No trade secret or confidential information from my day job was used in this project.

Abstract

SX GT is a Geo Tagging application that incorporates Windows Mobile 5 (and up) and a Windows application. The main audiences are photographers who have GPS enabled Windows Mobile devices and wish to imprint the position information into their digital images.

This system is consisted of two main components:

The Recorder: An application runs on top of Windows Mobile 5 or higher. This piece of software enables the device to record geographical position information in a specified frequency. At the end of a recording, the application produces a position log, which contains the detailed GPS readings during the recording time. The log will be passed to a Windows based PC for further processing.

The tagger: An application runs on top of Windows Vista (or higher) that writes the GPS information into a specified set of digital images. When writing, the tagger retrieves the shooting time of the given image, and calculates the most probable location. The tagger also supports auto keyword tagging, which is, automatically apply keyword to the image's metadata when the image was taken at a specified area.

Scenarios

(The be filled…)

V1 development phases:

  1. The Tagger (console based):
    1. Geo Writter – write GPS info into metadata
    2. Auto keyword tagger –automatically adding keyword if the image was taken at a specified area
    3. Blackout – Automatically remove GPS information if the image was taken at a specified area
    4. Tag with keyword – Tag the image with a predefined value if a specified keyword is found. (e.g. translate "space needle" to 47º 37' 12.49" N 122º 20' 55.19" W)
  2. The Recorder (basic functionality)
    1. Start/Stop logging
    2. Persist safely so an unexpected lose of power won't corrupt the log
  3. ActiveSync integration
    1. Produce a extension for ActiveSync and download the log automatically to a specified location

12/18/2007

déjà vu all over again, on security

The more I stay in Windows Programming, the more I know I don't know. Windows Security has been one that I have been unconsciously avoiding. This is the time I shall confront security, then I will become Jedi……or will I?

Jedi or not, I'm on the destiny of prototyping an app that creates a security property page for an object. Meaning I'll be dealing jargons like Security Descriptor, DACL, SACL, this, and that. This is so not fun.

Ok, enough whiny, start the hard to read MSDN document. Long live emperor…

12/08/2007

求圖, 有 GPS 定位資訊的照片

這大概是一個有點奇怪的求圖.

我試著在閒暇之餘寫一個 GPS tagging 的工具. 目前大概的想法是用 GPS 手機把 location history 計錄下來, 再寫入圖檔.

在實驗的過程中, 想要參考一般市售的 GPS tagger 寫入的資訊種類. 我不會把圖檔移作他用. 同時, 這是個人的興趣, 無關工作. 如果有大大剛好有這樣的圖片願意借給我測試, 請留言給我. 吾將不勝感激.

11/27/2007

Leopard’s Blue Screen Of Death

今天看到這篇 Getting Leopard's BSOD? Try uninstalling APE, 心裡有一種平反的爽快.

我一定是對 Mac 太 Defensive 了, 也或許是對電視上那個 Hi I am Mac 的廣告太不以為然. 總是想找 "Mac is just another ordinary OS" 的證據. 如果把 crash rate 除以 install base, 不知道它還能屌到那裡去.

到了最後, 系統穩不穩定, 還是要看使用者本身的習慣, 如果使用者熱情奔放, 什麼軟體都愛裝來玩一玩, 那不管是什麼系統, 都可以死給你看.

11/20/2007

我的 Leopard 初體驗

大概一個月前左右, 妻子的電腦開始出現一些零星的問題, 於是我們開始討論替代的機種. Mac Book Pro 是我們的侯選機種之一. 原因之一是妻子任的是 designer 的工作, 遲早會有機會需要使用 Mac. 其次是我工作的緣故, 讓我很想自己體驗 Mac 與 Windows 的差異. 好巧不巧, 妻子的電腦在今天正寢, 我們依先前的討論, 買了一台 Mac Book Pro. 於是開始了我第一次的水果接觸

所以, 我的第一印像

硬體作工與設計: 十分優良.機體美感當然是久享盛名. 除了造型之外, 鍵盤的手感也很好. 按鍵回饋的力道掌握得恰到好處. 整個機體的建構十分紮實, 完全沒有一些國產筆電那種邊角按一按會有怪聲甚至凹下去的問題.

Leopard UI 第一印像: 明亮, 生動: Mac 的配色與 Windows 系統差很多. 如果說 Windows Vista 是正經八百, 一板一眼, 那 Mac 大概可以用生動活潑來型容. 很多 Window transition 用動畫處理地很棒, 讓整個系統看起來好像有生命一般. 反觀 Windows XP 與 Vista, Dialog box 不管怎麼改, 看起來都是那一副死樣子, 尤其是 XP, 配色沒品味的程度令人..

當然也是有一些問題

首先, 三句不離本行, 我試著連上書房 Vista 系統的 HP 印表機, 但是, 雖然我能從網路連線中看到我的主電腦, 但看不到 Printer. 我試了幾次, 都無法成功. 當然, 我還不熟 Mac, 做異質平台資源共享本來就會有難度 , 我只能說, 身為一個新使用者, 這個經驗讓找感到有點挫折. 光就這一點, 我在 Vista 的流程比較容易使用, Add Printer Wizard 可以自己搜尋 subnet 裡可以使用的印表機, Driver 也可以自己下載與安裝. 一切都很自動.

第二, (目前) 無法連到 Windows 的隱藏共享目錄: 在 Windows 裡, 如果 share folder name 的後面加一個 '$' 符號 (例如: foo$), 那這個目錄就不會被列在共享清單裡, 只能直接連線. 這是很重要的功能, 然而, 我今天也試了好一下, 還是無法讓 Mac 連線到我主電腦的隱藏共享目錄. 這讓我無法把先前備份的資料拷貝到新 Mac 上.

UI language 與 system default language 無法分開設定. 所以在 Mac 上無法使用英文 UI, 又同時讓 default codepage 設為中文. 這讓 iTunes 在解我的 MP3 metadata 時完全失敗. 我覺得這方面 Windows 做得比較好. Windows 的 MUI 系統與語系設定, 在 XP 時代就作得十分成熟. 到 Vista, 雖然並沒有大改, 但是在 API level 改進不少.

以上

11/19/2007

Connecting Mac to a Vista Print Server

Looks like this is a way worth trying.

Citing the original post from Obsidianspider of PA:

After clicking the + on the Print & Fax screen a window will come up. If you right click in the toolbar and Control-Click in the toolbar you can then select "Customize Toolbar". You can then add the "Advanced" icon to the toolbar and then by selecting "Advanced" you can manually configure your printer.

http://discussions.apple.com/thread.jspa?messageID=5779905

10/22/2007

Cryptology, and all that jazz

One unresolved puzzle in my mind is public key encryption. I've heard this jargon for more than 10 years. I know it is an asynchronous encryption mechanism, but I never really know how it works. Luckily, today I find this web site that talks about it. Better yet, it is in Trad Chinese, with sample code. Oh Yes!!


 

http://blog.yam.com/luyuanhsiung/article/9599539

10/10/2007

Bug of the week

Today I was called to take a look at a problem: A bug that was created by me. Given the context I couldn't figure out why this is happening. Looking at my computer screen, scratching my head, I couldn't figure out why the problem. The line that has the problem looks like this:

SHGNO flag = static_cast(SHGDN_FORPARSING (check()) ? SHGDN_INFOLDER : 0);

The design was, if useRelative() returns true, we apply the SHGDN_INFOLDER flag, otherwise we just use SHGDN_FORPARSING alone. However, with this code, the 'flag' was always set to SHGDN_INFOLDER and made some dev manager send me a furious in Tuesday morning.

So eventually my boss figured out the problem, and the answer is as simple as one damn word: order. Turns out that the bit-wise or operator has higher priority. That is, I assumed that after the code was compiled, the order will be:

SHGDN_FORPARSING (check()) ? SHGDN_INFOLDER : 0));

turns out, it was actually:

(SHGDN_FORPARSING (check())) ? SHGDN_INFOLDER : 0);

Huh, what a shame, a simple bug cuased a high profile break...

10/04/2007

More on Active Directory and security stuff

Gosh, this week have been painfully tiring. Yesterday I ran into Rob in the hall way and he said he was tired and stressed out. Rob always appear to be confident and with great pride. If it wasn't I heard it myself, I wouldn't believe Rob actually said he is tired. Wow, I have a mixed feeling knowing that I am not the only one suffering from the schedule.

Anyways, some good news on the progress:

  1. Now I can do standard operations on my AD objects: Creation, update, deletion, all works well. I'd still need some time to make code up to production level, though, but it is really good.
  2. I can tell whether the AD is read-only now. To do that, simply make a call using ADsOpenObject, if it failed, try ADsOpenObject again with ADS_READONLY_SERVER flag. If the 2nd call succeeded, it means the main directory was down and we're using a RODC. Wait, is RODC even related to AD? Huh…hum..

But bad news here too, I'm still blocked on detecting whether the user has write/delete permission on a particular object. GetNamedSecurityInfo keeps failing on me…huh, that sucks. :-(

 

10/03/2007

Blocked, Active Directory and security stuff

Huh, it is the painful 1:06am by the time I came to write this post. In the past few days I need to build a wrapper object for Active Directory. The wrapper object is to interface my code (yet to write) and ADSI. The objective is to:

1. Read/Write my AD class instance
2. Determine whether the AD is read only
3. Determine whether the current user has the privilege to write to a particular object.

Call myself bad luck or simply under estimated the complexity of AD. I have been trying this for 3 days and still couldn't even create the AD class I wanted using ADSI Edit. It is indeed a painful shame yet I still couldn't have any breakthrough. I find myself hopeless. By the way, my work is one day past due and I still have little progress. gee I'm in trouble. :-(

Anyway, anyhow, my log of the day is: little progress, but I do have plan for tomorrow:

1. Get myself a private domain:
- Setup a Win2k3 domain myself and create schema there. Since the private domain I borrowed from colleague doesn't really work (the way I expected).

2. Trying to get access privilege on a DS object:

- call GetNamedSecurityInfo to get the ppSecurityDescriptor
- use AccessCheck to determine whether writing is granted to the current user.
- If all attempt failed and the light of hope dims, try win32prg for help

3. Trying to know whether the DS is read only.

- Search for ADS_READONLY_SERVER in existing code base and see how it's used. Rob had done something similar and I just need to borrow the work from him...

4. Test, try to finish it as soon as possible and move the heck on.

9/21/2007

TED, Ideas worth spreading

Today I took a brief glaze on this web site: TED, Ideas Worth spreading. Quite an interesting web site and here is the link to the demo to PhotoSync:

http://www.ted.com/index.php/talks/view/id/129