[Golang] 影片心得整理- Google IO 2012- Go in Production

https://www.youtube.com/watch?v=kKQLhGZVN4A 每次剛學一個新的程式語言,自己的心裡總是會想著“這個新的語言特點是什麼?他究竟能夠為了產品或是你工作的事情上帶來哪些幫助?” 學習Golang的時候,我也是會這樣想.剛好找到了這一段影片,把它的一些內容做個整理,如下: Juju - Ubuntu (Canonical) 語言轉換: Python -> Golang 這是什麼? Juju 是ubuntu上面管理軟體的一個工具,這裡有詳細的解釋. Golang帶給Juju的好處: Juju原本是使用Python來寫的,會換到Golang上面其實有相當多的理由,稍微整理一下: Error Handle: 這大概是基本上Golang最強大的功能.  Concurrency: 這也是Golang被人喜愛的主要原因,目前我也還在努力地摸索. 他其實有更多沒有提到的,我稍微截個圖讓大家看一下 Heroku 語言轉換: Ruby ->  Golang 這是什麼? Heroku 算是現在幾個知名的PaSS (Platform as a Service)之一,主要就是讓人host你的網路相關的service. 這裡有更詳細的解釋. Golang帶給Heroku的好處: Heroku 主要有一個Routing Table Service  來記錄超過 190萬個App的操作.這樣的service主要就是透過REST API然後與後方的PostgreSQL資料庫.原本是使用Ruby來撰寫一個部分的控制.詳細的流程圖我截取下來如下: 問題來了,bootstrapping new instance由於要產生一些資料所以是不夠快的,根據講者的說法,這跟Ruby產生initial JSON dump有關. 所以他們使用Golang在幾個小時內完成Streaming update部分的原型並且測試上線, 結果帶來以下的結果: 速度增加十倍以上(?) 產生新的資料在Golang上面再也不會成為整個流程的瓶頸,網路處理速度也變快. 目前他們也在思考把其他的部分開始改成Golang StatHat 語言轉換: 一開始似乎就是用Go打造(99%)有部分也從RoR轉換到Go 這是什麼? StatHat是一個記錄資料的服務,他提供多個語言的支援(接近15個).可以提供給其他網路服務公司做一些資料的追蹤, 可以顯示各種的圖形與方式. Golang帶給StatHat的好處: 提了幾個優點 Fast: 速度比較上,Golang在網路處理上算是真的相當快速的. Resource Friendly 他指的比較偏向社群資源多 Easy to deploy Go binaries are self-contained No shared libraries, no gem and dependency Fun 這邊有他們Open Source出來跟他們產品有關的code,可以參考. Iron.io 語言轉換: Ruby -> Golang 這是什麼? Iron.io 是一個網路服務提供商,主要分成以下幾個產品: ironWorker 平行的工作平台,本來用RoR寫但是有點慢,用Go改寫後就變快很多. ironMQ 訊息序列傳送廠商,是一個可以擴充的服務 Golang帶給Iron.io 的好處? 在ironWorker裡面很大一部份的工作是需要分配工作與平行處理架構,這是Golang主要能提升的部分,而他們會使用Golang的原因如下: 速度快 執行快而且編譯也快 Still reasonably express Rich standard library 也就是因為build-in 標準函示庫是足夠使用的,所以容易散佈跟編譯. Not tie to VM 指的是編譯好之後可以直接執行,不用綁太多環境. Awesome 寫起來很開心(我目前也是感覺相當有趣…) Q&A: (標記的公司為回答的代表) [Heroku] 如何決定哪些產品要轉換到Golang?  [StatHat] 比起Go而言,Ruby 有著龐大的資源與社群那為什麼要轉換到Go呢?  要用Go重寫其實是不難的(指的是他們用到的部分) [Heroku][Juju] 你最喜歡的Go library 不用懷疑~當然是Go fmt . (我也覺得Go fmt幾乎把所有功能都用到了~) [StatHat][Juju]  你們覺得學習Golang 要多久呢? [StatHat] 我們大概學了幾個禮拜 [Juju] 我認為我從來不曾停止學習,能上手是很快但是要能真正了解其中含義,就要不斷學習.(這讓我想到這篇文章) [StatHat] 你有任何推薦的Go書籍嗎? Golang.org? 其實我並沒有讀任何的Golang 的書籍.  其他關於Golang 與其他語言的比較 http://www.slideshare.net/weijr/coscup2013 [COSCUP2013] Python, F#, Golang and Friends
繼續閱讀

[研討會心得] GDG Taipei #9 - Furnish you app with Maps

心得: 這次來聽Google Map GDE Homing Tam講解關於Google Map的簡介,由於時間的因素主要都是在講解Google Map相關延生的產品.不過內容上相當的有趣.也有新舊版本上的使用差異,從眾多的Google Map所衍生出來的產品也更容易了解Google Map API與Google Map如何使用的想法. 會後其實也花了一些時間好好地觀看了一下Google IO帶回來的三星Android Wear實體機.也知道了台灣除了Colin Su之外又多了一個GDE  David Chen (不過台灣現在都是Google Cloud 的Expert). 速記: Google Maps Feature update introducing the Google Maps product families https://www.google.com/maps/about/partners/businessview/ Google business view (business photo) http://maps.google.com/gallery/ Google map with data in gallery https://www.google.com/mars/ Google Mars Map https://www.google.com/moon/ Google Moon Map https://www.google.com/sky/ Google Sky View https://www.google.com.tw/mapmaker Google Map Marker (自定修改地圖) https://mapsengine.google.com/map/ Google Map Engine 有分Lite,Pro與Mobile版本. http://www.google.com/enterprise/mapsearth/products/coordinate.html  Google Map Coordinate  可以追蹤人用的,安裝之後手機GPS會強制打開. Google Earth 安全台灣  利用Google Earth Enterprise 自己建立local Google Map Client https://support.google.com/fusiontables/answer/2571232 Google Fusion Table 地理資訊資料庫,不過有漸漸被淘汰的趨勢 indoor map != indoor street view yellow point -> business view certificated agency to take photo and upload to google map. indoor map is a flat map indoor map User upload. indoor street view is using street car to take photo Provide by Google 範例: 雪山隧道人行步道  舊版地圖與新版地圖的差異 舊版地圖可以分享 (參考)  原因是因為新版地圖的網址是不固定的,所以無法分享.也有IFrame的整合. Google Map API Currently it use v3.13 v2 already out of date since 2013/09 Why use version 3 差異 (Google Map vs Google Map API...
繼續閱讀

[iOS]MapKit 與 Google Map SDK的使用筆記

週三又有GTUG的活動,這次是Google Map SDK的講解,於是剛好把iOS 內建的MapKit與Google Map SDK都玩了一次. 順便記錄一下簡單的心得與可能容易遇到的問題,如下: iOS MapKit 心得: 先不論功能上與GoogleMapSDK的比較,iOS內建的MapKit真的容易使用多了.也不需許多麻煩的東西(等等會提到) 教學可以參考: http://www.raywenderlich.com/21365/introduction-to-mapkit-in-ios-6-tutorial http://www.raywenderlich.com/13160/using-the-google-places-api-with-mapkit 其他: 比較需要知道的可能就是如何把地址字串直接找到位置而不是使用經緯度.這篇可以參考.  Google Map SDK 心得: 看起來功能似乎很多,但是使用上有許多的地方要注意. 教學可以參考: https://developers.google.com/maps/documentation/ios/start?hl=zh-TW 可能遇到問題: Crash when use Google SDK API  Add “-ObjC” in  “Build Setting”->”Other Linker Flag” UIView 與 GMSMapView的使用問題 參考這篇,裡面提到的三種方式都很清楚. 其他: 也是可以從字串定點,不過需要透過Google Map API來查然後去讀取JSON回復,這裡有整理好的code https://gist.github.com/kkdai/7e7cb6d626794829771b 最後放一篇關於 Google Map SDK與MapKit 更深入研究的一篇文章 http://www.fastcolabs.com/3006725/open-company/depth-comparison-between-ios-map-frameworks-apple-mapkit-vs-google-maps-sdk
繼續閱讀

[Golang][Mac]準備Golang開發環境

基本上其實只要參考 Simple Patrick:My Go Development Environment那篇應該就可以.只是我這邊記錄一下我遇到的問題,不知道其他人會不會遇到. brew install go 會成功但是一直跳出要 brew link go,然後如果你打brew link go就會跳出permission不足.找不到答案,於是去官方網站抓下來裝 Sublime text2跟GoSublime 是可以完美結合.DashDoc 也可以正常用,只是要先裝Dash App Store裝好. 弄好了這一切,其實看起來是完美了.但是就Golang的特性,沒有debugger似乎很難做更一步地解決問題. 於是去找了這篇文章裝LiteIDE然後跑Golang http://www.goinggo.net/2013/06/installing-go-gocode-gdb-and-liteide.html 幾個大方向 抓GDB安裝 建立一個codesign 把GDB 簽署當作可以信任的執行檔 記得要codesigbn gdb codesign -f -s "gdb-cert" /usr/local/bin/gdb [更新2016/02/05] 記得每次gdb更新都要跑…. 一開始LiteIDE可能會出現go bin not found 的錯誤,需要把設定重新跑好 [View] -> [Edit Environment]  (我的可以參考一下) GOROOT=/usr/local/go GOBIN=/usr/local/go/bin/ GOARCH=amd64 GOOS=darwin CGO_ENABLED=1 PATH=$GOROOT/bin:$PATH LITEIDE_GDB=/usr/local/bin/gdb LITEIDE_MAKE=make LITEIDE_TERM=/usr/bin/open LITEIDE_TERMARGS=-aTerminal LITEIDE_EXEC=/usr/X11R6/bin/xterm LITEIDE_EXECOPT=-e 不過text highlighter 跟 dash無法整合有點痛苦,可能會拿LiteIDE作為debug 的工作. 其實Sublime Text2 也是有 GDB support 的,繼續得研究看看  
繼續閱讀

[Docker Taipei Meetup#2] 關於Docker & Jenkins 跟 Docker in Golang

其實是很臨時去參加的,所以一發現有空位馬上就參加,對於Docker本身也是一知半解,也希望能透過這些聚會能有更多的了解. 這裡簡單的記錄一下我的心得,後面是我的速記: 心得: Docker & Jenkins by Casear Chu 這一篇演講相當的特別,讓你與一般Docker 與Jenkins 能想到的不一樣. 主要的架構是根據在Docker in Docker (DinD) 想出來的.也就是在Docker裡面自己再去建立並且讀取其他的docker. 這裡的方法主要如下: 先建立一個ubuntu docker 去安裝Jenkins 然後Jenkins 有兩個工作專案: 一個是下載node.js 系統的image build 成另一個docker 一個是去下載修改的node.js 程式碼,並且定期地在第一個docker上跑測試 整個方法相當特別,測試完之後.可能需要完全移除才會乾淨.不過簡單又不會影響太多部分. Docker in Golang by Jamie Sa slide 主講人相當的有趣的,主要是來探討為什麼docker會用到golang 來撰寫 所以一開始會講到當初 docker 創辦人遇到一個什麼樣的狀況,以及簡單的介紹LXC (docker 系統的核心) 並且很有趣的來觀察github 上面docker project的狀態,並且分析第一個submit的整個架構與當初兩個創辦人是如何去思考整個系統的架構. 令人相當驚訝的是第一個docker的submit竟然就是撰寫我們看到的web docker console  (是應該花一點時間好好了解人家的架構設計的用心) http://www.meetup.com/Docker-Taipei/events/188846162/ Docker & Jenkins by Casear Chu Except Jenkins (other CIs)  Travis Door.io (not sure) Docker in Docker Scenario: Jenkins in one Docker Use Jenkins to launch other docker for CI testing WebSite: https://github.com/jpetazzo/dind Detail: Launch one ubuntu docker and install docker in this ubuntu. Docker Jenkins Need apt-get jenkins from ubuntu image not jenkins image Because need Docker in Docker in site.  Jenkins using docker  (two processes)  https://docs.docker.com/articles/ambassador_pattern_linking/ Docker System building process Check github periodically  download node.js system(private repository) and build docker node.js image process Git pull node.js code run docker system to load node.js run test Note about report: docker...
繼續閱讀

[WDK] Note about propitiatory driver develop and install

WDK  building build -cefw build -cgz Driver launch  Service Using SC (Service Control) Device driver Using *.Inf to install it Disable digital signing check ( forever) If failed need go to BIOS setting to disable Security Boot in Boot-> Authentication-> Security Boot “bcdedit -set test signing ON” Disable digital signing for once Win8 -> 變更電腦設定 -> 還原 -> 進階開機 Install driver step [裝置管理員] -> node 0 -> [動作] -> [新增傳統硬體] -> 選擇 inf remember  inf file need  exist with x86 driver x64 need another place according to your inf setting. Still occur error because the SYS still need to signed   Install Digital signature and sign your SYS file (x64 only is enough if you using  Note, there might be an error if the category file error Error: 裝置管理員 -> Digital signature still failed event you already signed it. Solution: Using “infract”  refer here Note: Need use WDK 8.1 if you...
繼續閱讀