Preface Working on Android application development, you will need to have IAP (In-App Purchase) items. Normally it is simple, if your application is standalone not connect to any server. If you app need connect to server for IAP items (such as game server, database service …), it might have risk that here might be a fake app (or crack app) to fake the purchase command in your app to get privilege action or items. In this case, our server will need to do a sever-to-server side certification with Google Play. Android has done great documentation in their Android portal. But it separate into different part, so I am trying to summarized it here. Hope it help. Google Service Entrypoint - Google API When we want to communication with any Google Service, the only entry point is using Google API Console.. So, here let’s start to connect to Google API. According...
Preface: This article is a note about I study XMPP spec recent days. To maniplate a XMPP client, it might be easy to deal it with IP*WORKs 3rd party XMPP client. But it could not fulfil some custom request such as: Not response friend request immediatelly, once we got it. Handle roster (friend list) programmatically Maniplate VCard as custom information storage. In those case, we might need to handle XMPP XML commands to Ejabberd Ejabberd is a XMPP server(which twitter use it at first). It written by Erlang, it is powerful to handle multiple user connectivity. XMPP Command Both we could have two ways to manipulate XMPP, one by 3rd party XMPP framework. We will use IP*Work for a example which you can find sample code from web here. Another one is using basic XML send to XMPP server directly. Actually we still use IP*Works. sendCommand to send our XML...
##雜七雜八感言: 開始把一些內容分成別篇文章,最近多花了很多時間讀XMPP Spec挺有趣的. ##筆記: [Golang] 關於Golang 有趣的網頁與小工具 GRPC: Go Project 支援HTTP/2之外,還支援九種以上的語言.並且可以擺脫net/rpc原本需要管理gob的痛苦. Gore: Yet another Go REPL that works nicely. Featured with line editing, code completion, and more. 另外一個Go REPL的工具,支援許多shortcut跟即時顯示… Viper: A configuration tool of Go 用來讀取與使用Config的工具,開發者是spf13 Hugo的開發者.當然,Hugo也有使用Viper Wide: A Web-based IDE for Teams using Golang. https://wide.b3log.org 相當酷的網站,可以online 寫go而且有資料夾的概念.並且有syntax highlighter的. [Golang] Meetup Youtube Playlist: London Go Gathering February 2015 FOSDEM 2015 Video list Go at CoreOS by +Kelsey Hightower This session will discuss using Go to build products that make distributed computing as stress-free as installing a Linux distribution. Finding Bad Needles in Worldwide Haystacks by Dmitry Savintsev Experience of using Go for a large-scale web security scanner Moving MongoDB components to Go by +Norberto Leite We love Go and this train is unstoppable! CockroachDB by +Tobias Schottdorf Towards an Open-Source Spanner HTTP/2 for Go by +Brad Fitzpatrick Overview of HTTP/2 and the design of Go’s support for it Go and...
前言: 原本的問題是出現在Stackoverflow,有人發問template.HTML(“test”) == “test” 可以過,但是template.HTML(“test”) == some_str 卻不能成 功compiler. 原因: 主要的原因是由於Go 本身是static typing的程式語言,而constant本身的型別是未定,並且對於constant在compiler的狀態下是會有一些型別轉換的. // 型別尚未確定 const hello_string = "Hello, 世界" // 型別確定為字串 fmt.Printf(" type is %T \n", hello_string) //type is string 範例程式碼: 根據The Go Blog: Constants 裡面有詳細提到關於Go 是 statical typing的一些問題. 接下來用幾個範例解釋: package main import ( "fmt" ) func main() { // hello Type is not define for now. const hello = "Hello, 世界" // Type is String const typedHello string = "Hello, 世界" // hello type is cast to string fmt.Printf("Type of hello is=%T, typedHello is=%T \n", hello, typedHello) // hello is non-type it convert to string and compare fmt.Println(hello == typedHello) //Another sample. Define MyString as a string type type MyString string var m MyString // m is non-type for now. m = "Hello, 世界" // It will introduce error, because m type is MyString and typeHello is string. //fmt.Println(m == typedHello) // hello is non-type until compare with...