Effective Python Note 2

This article is composed of some notes from book Effective Python.

Use @property to define special behavior when attributes are accessed/set on your objects, if necessary

Another use case is to only specify getter to make that attribute read-only.

Effective Python Note

This article is composed of some notes from book Effective Python.

Scope Resolution

Python’s scope resolution follows the order below:

  1. current function
  2. enclosing scopes: like a outer function enclosing the current function
  3. global scope
  4. build-in scope

趨勢科技的 agile tour_by Joy Chen 心得分享 - Agile Tour Taipei 2014

https://www.slideshare.net/AgileCommunity/agile-tour-agile-v3
上禮拜參加 Agile Tour Taipei 2014,第一場 talk 的 Joy 分享趨勢科技實行 Agile 的經驗,上面是她的 slides

Agile 的優點與適用情境

Android 連續掃描多個 QR code 的實作

使用 GitHub 上 LivotovLabs/zxscanlibv0.9.0 版,目前上面有更新的版本,不過我那時候用的時候最新的就到這版

假如直接使用這個 library ,手機在掃到 QR code 的時候會震動,然後離開掃描的相機畫面回到前一個畫面,另外,它開相機的時候會把畫面變成橫的(landscape)。所以要達到我的要求的話就需要改一下裡面的 code,這邊分享一下把這個 library 應用到可以連續掃描多個 QR code 的經驗 (使用eclipse),可以搭配該 project 的 GitHub 頁面說明一起看

Use Retrofit with Dagger - simple example

RetrofitDagger 都是 Square 出的 library,網路上已經有很多相關介紹了,因為 Retrofit 的 REST API Interface 的實作建議採用 Singleton 的方式,所以搭配 Dagger 來管理是個蠻好的 paradigm

今天在這邊分享一個簡單的整合 example,希望可以讓第一次用且想要整合這兩個 libraries 的人快速上手,更 detail 的說明可以參考上面兩個連結~

Spring MVC 之 DispatcherServlet - url pattern設置問題 (/ vs. /*)

最近把我的 project 轉為 spring mvc 的架構,想說可以順便用 spring 的 RESTful。Controller 的 method 大概如下:

1
2
3
4
5
6
@RequestMapping(value = "/show_my_page", method = RequestMethod.GET)  
public String showMyPage(Model model) {
// do something

return "myPage";
}

Web Server 與 Application Server 的差別


圖片來源: https://media.amazonwebservices.com/architecturecenter/AWS_ac_ra_web_01.pdf

看到 AWS 關於 web application 的 architecture 這張圖之後,不太懂為何 server 要分為兩層,於是就google 了一下,找到一篇不錯的文章

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×