在Twitter API文件:GET trends/:woeid裡的woeid原來是Yahoo! Where On Earth ID,由Yahoo提出的。
1 表示全球,要知道自己所在地區的trends,還得要先用Yahoo的Service去查到所在的woeid,才能再去問Twitter。
Just thinking more…
在Twitter API文件:GET trends/:woeid裡的woeid原來是Yahoo! Where On Earth ID,由Yahoo提出的。
1 表示全球,要知道自己所在地區的trends,還得要先用Yahoo的Service去查到所在的woeid,才能再去問Twitter。
簡單的說是遞迴的特例,好處是可以避免call stack的損耗。Stack Overflow上的回答蠻清楚的,還附了python範例:algorithm – What is tail-recursion?,英文維基百科上的說明:Tail call比中文維基百科上的來的好。
跟遞迴比較大的差別,目前我認知到的是會利用另外一個參數來傳遞結果,實際應用上應該只要是遞迴都可以改寫成Tail call吧,再想想可以怎麼應用。