Note for Google Develop Group Taipei 2014/01/15- Google Cloud Platform, Google Compute Engine

Google Cloud Platform

  • Slide:

  • What  is google cloud platform

    • Using google storage 

    • Goole bandwidth 

    • Cloud encapsulation 

  • Cloud Platform:

    • Cloud SQL

    • it is MySQL 5.5

    • Cloud Datastore

    • NoSQL (Non-Relationshop SQL) storage. Much faster than normally SQL.

    • Cloud Storage:

    • Protection, similar with Google Drive

    • GAE

    • It much better performance for now.
  • Full Functional Service

    • feature:

    • Scalable 

    • Normally

    • LAMP

    • Apache2 (three apache )with one  DB.

    • Master/Slave DB mapping with Apache2.
  • PaaS (Platform as a Service)

  • GAE (Google App Engine)

    • Language:

    • PHP,JAVA, Python

    • GO: (New language), refer https://developers.google.com/appengine/docs/go/gettingstarted/helloworld

    • Communication:

    • Channel:

      • Using Web socket
    • Mail:

      • Using specific mail alias to pass some email to GAE to parsing.
    • XMPP:

      • message like Facebook and google talk.
    • Outbound socket

      • Only outbound could pass socket to another service from GAE.
    • Process manager:

    • Cron Job: Similar with Crontab.

    • Computation:

    • Image API: For image resizing or scaling.

    • Map-reduce: Like OpenCL or multiple threading.

    • Application:

    • Big Query:

      • Terabyte data analysis 

      • SQL-like

Google Compute Engine:

  • IaaS (Infrastructure as a Service) — all related could be plug as component to add/remove.

    • Instance—  You could create VM via compute engine for this. [Speed]

    • Similar with MSFT Azure setting but faster and support command line.

    • Persistent Disc— PD [Storage]

    • only 1 for R/W. multiple only support read only.

    • Bound by Zone.

    • Security base on AES-128.

    • Networking— It about communication speed.

    • Block port SMTP(port 25) and block SMTP on SSL.

    • No matter your instance is in US or Euro it also could 

    • API

    • JSON, OAuth2, RESTful.
  • Why using Google Compute Engine:

    • Speed

    • Scale

    • The computing power could be change or scale it up according to your request.

      • Using an agent which create by GAE and it could monitor current status

      • And run CLI if working flow is archive the boundary. (Add VM or Add PD).

    • Global footprint:

    • you could easily to expend your business to whole world.s
  • Google has world record about transfer 1TB data and compute it done within 55 sec.

  • Out side is open API outbound, but it could has its own storage, service, internet. All working on API.

  • Every charge is by request:

    • Every request has its own storage and internet transfer.
  • Zone different management:

    • It could be separate to different zone to manage your service.

[Android]學習心得 (1) - 環境設定與EvernoteSDK

記錄一下,本來是寫英文後來還是決定改成中文的

  • 我的環境:

    • MBA (Mac Book Air 2012 Ivy-Bridge) with 8G Ram, 128G SSD.
  • 環境設定與準備:

    • 主要有兩種方向可以給Android開發者,我兩種都有試試看來決定最容易與方便使用的IDE.

    • Eclipse with ADT (Android Development Tool)

      • 最常使用的開發環境,設定算簡單,不過個人覺得界面使用起來總是哪裡怪怪的,可能因為Eclipse本身屬於開放式架構的關係.

      • 下載 http://developer.android.com/sdk/index.html

    • Android Studio

      • 2013年發佈的Android Studio,我覺得開發新的應該會很棒.不過似乎在打開一些舊的檔案會因為檔案架構的原因出現一些問題.

      • 這個部分對於剛開始學習開發得人是比較麻煩的,可能要等後面版本在修改得時候看看能不能解決得好.

  • Android 模擬器 – AVD (Android Virtual Device)

    • AVD 就是一個Android的模擬器可以來執行你的程式.

    • Android Development Tool所提供的模擬器,其實相當不好用.我發生以下的一些問題:.

      • 啟動這個ADT的模擬器(AVD)時間相當的久.在我的環境裡面大概需要3~5分鐘才能夠開完Android的模擬器.更別說把App部署(deploy)到模擬器上面,當然如果要debug那就更殘忍了.

      • 可能是因為需要太多的系統資源,所以常常在編輯過後要重新部署的時候都容易發生錯誤.

    • 利用虛擬機器 Virtual Box所執行的模擬器  Genymotion 

  • 關於Evernote SDK in Android:

    • 這篇文章是官方的文章,其實可以很快地建立出Evernote的程式 http://www.evernoteapi.com/tagged/android

    • 除了裡面的範例程式之外,其實只剩下一些需要注意的地方

    • Evernote API key 申請

      • 可以去這裡申請 (http://dev.evernote.com/doc/) 不過要注意的是裡面的API 是對應另外一台伺服器的帳號 (Sandbox.evernote.com).跟你所平時在用的並不相同,除非你有寄出Production Server的申請

      • 由於是Sandbox的伺服器上面,所以你可能需要另外在這個伺服器上面去註冊你的帳號(Evernote的帳號)才能用你在Sandbox的API Key去存取他.

    • 申請好之後其實很快速就可以寫出一個login與logou的範例程式.

    • 關於Login/Logout的部分:

      • 不過這邊還有一個可以註記一下的是由於登入Login 是透過OAuth的方式來登入,所以App會離開後然後再度回來,在這裡要注意到的是會由 OnResume回來

      • 但是Logout卻不會遇到這樣的狀況.這是可以注意的.

 

接下來應該要努力嘗試 Android Development Tool with Eclipse 的程式 porting 到 Android Studio了…

[Parallel Programming][C++AMP] Survey summary

Basic requirement:

  • VS2012 runtime

  • DX11 runtime

  • Use test program “VerifyAmpDevices” to verify it

Advantage:

  • Compatible with any GPU which could run DX11 with one EXE.

    • NVIDIA GPUs

    • AMD GPUs (and APUs)

    • Intel GPUs (Ivy Bridge and later)

    • ARM GPUs from various IHVs (soon, e.g. see Mali design)

  • Could use Visual Studio IDE for GPU threading debugging

  • Could use Visual Studio IDE for GPU profiling

  • Base on C++ and STL

Performance Comparison: (refer here)

**
** Video Clip:

Code Resource:

[OpenCL] Some survey summary about OpenCL

  • Related code survey found:

    • Debugging in Intel is easy refer Using the Intel® OpenCL SDK Debugger

      • Add file path when you build cl program

        • Note: Must using original path not copy path.

          • EX: If you copy your CL file in post build process, need add original path not debugging CL code path.
        • Note: Path need full path

      • Enable Intel OpenCL SDK debugging in toolIntel SDK

        • Note: Work item set 0,0,0 as default is enough.
  • OpenCL kernel need warm up

    • Run any other kernel code first (even not the same application), it will speed up your major CL kernel code

    • AMD’s magic number is to run “twice” on dump kernel

      • Testing result: (SW/CPU 160ms)

        • Intel:

          • 1st time setup 700ms, effect 160
        • AMD:

          • 1st time

            • setup 6000ms

            • effect 16ms

          • 2nd time

            • setup 160ms

            • effect 16ms  (it might goes to 0ms some time)

      • It could be reduce time to pre-load *.cl file but no way to not reduce clBuildProgram. (Program will cache result as previous one, even you reset twice the argument.

      • Run two times the same kernel code:

        • After second time, (no matter the same program or not) the CL kernel will cache it and very fast.

        • Run second time, the CL setup code will faster the first time (Found on AMD GPU)

        • Note: IVB don’t have such issue.

  • Refer: 

[MH4][MonsterHunter4]旅團操蟲棍畢業考心得

今年九月發售在3DS上的MH4~一發售之後~就佔據了我的3DS
發售的當天還因為相當想玩而買了下載版 18XX含稅 
由於這次有支援網際網路對戰的功能,也就是不用拿著主機去外面找人連線
好處是~可以隨時隨地都找的到人來連線遊戲(而且~台日版跟原版可以共連) 
壞處就是~其實單人的部分難度有一點變高了
主要是因為狂龍化的關係~每一隻龍似乎都開了外掛一樣

回過頭來~在此還是記錄一下我單人旅團畢業考的心得
其實主要是因為旅團的任務一直卡住 
卡在炎王龍的火焰爆爆樂 ~ 每次爆完就貓車
好不容易防禦力撐到了五百~ 相關的武器也都升頂才過關

這一次畢業考不過也才考兩次~
第一次用的是裝備是: 斬味+1 + 回性3 + 回距
不過用的由於是不是很熟的太刀~結果打到天迴 還是打到時間快結束前被三貓 

後來乖乖的聽著網路上的文章改成蟲棍
裝備:  蒼火混黑狼鳥  配出: 高耳 + 見切 +  高磨 + 精靈守護 (主要)
結果貓飯沒注意到的吃到 “防禦大 + 不眠術”
裝備全部都帶回家玉跟秘藥的原料去混

由於不小心吃到不眠術~結果整場都不能睡(是整場~我以為貓車後會結除~結果沒有 orz)

一開始雷狼龍跟金獅王~其實很好打~  
用蟲棍就不斷地跳起來扁雷狼龍
唯一要小心的就是金獅王從後面用嘴炮
騎乘個三四次~雷狼龍就掛了~
金獅王也就是一塊小蛋糕

 

不過由於白馬貓貓夯(不眠術)的關係~
我也浪費了許多的回復劑   orz
打到天迴就是硬仗
第一貓其實有點故意~想要看看不眠術會不會消除~結果不會
後來打著打著~不小心二貓了~
於是我開始緊張了~手也開始冒汗~

回到場上~先放個蟲~準備開打

 ~準備開打

                  ~準備開打 

                                    ~準備開打  

                                                       結果重補了尾刀~

媽~~ 我過關了~   雖然遊戲應該改成魔物獵蟲… orz

 

[Three20][Nimbus] Porting Three20 to Nimbus for Facebook Photo Album

This article is a record to summarized my project to migration from Three20 to Nimbus.

Here is specific step by step to help you porting (migrate) your three20 

Original project is a Facebook photo album which implement base on http://www.raywenderlich.com/1430/three20-tutorial-for-ios-how-to-use-the-three20-photo-viewer

  • Add Nimbus in your project

    • Sync code

      • git clone https://github.com/jverkoey/nimbus.git

      • Goes to nimbus path

      • git submodule init

      • git submodule update

    • Include nimbus code in project

      • Core

      • Photos

      • Paging Scroll View

      • Models

      • Overview

    • Include Thirdparty in your code

      • JSONKit

        • remember to add “-fno-objc-arc” on Targets -> Build Phase -> Compiling Phase to disable ARC compiling
      • AFNetworking

    • Add framework

      • libz.dylib

      • MobileCoreServices.framework

      • SystemConfiguration.framework

      • CFNetwork.framework

    • Add those three include in your pch

    #import “NimbusCore.h”

    #import “NimbusPhotos.h”

    #import “NimbusModels.h”

  • Remove original Three20 project

    • Remove all Three20 xproj in your framework.
  • Replace using to replace TTPhotoViewController to FacebookPhotoAlbumViewController

    • Remove photo.h Photo.m

    • Remove PhotoSet.h PhotoSet.m

    • Remove PhotoViewController.h PhotoViewController.m

    • Drag NimbusPhotos.bundle from src/photos/resources into your project.

    • Add follow file into your project

      • NetworkPhotoAlbumViewController.m NetworkPhotoAlbumViewController.h

      • FacebookPhotoAlbumViewController.m FacebookPhotoAlbumViewController.h

      • CaptionedPhotoView.m CaptionedPhotoView.h

    • Replace PhotoSource related code to follow direct using album ID

    LikePersonAlbum *myEntity = [_fetchResultControllerobjectAtIndexPath:indexPath];

 

    Class vcClass = [FacebookPhotoAlbumViewControllerclass];

    id initWith = _Facebookalbum_id;

    NSString* title = @”test1”;

    UIViewController* vc = [[vcClass alloc] initWith:initWith];

    vc.title = title;

    [self.navigationControllerpushViewController:vc animated:YES];

  • Done, less than 2 hours.

Advantage

  • Fast, easy to porting your code to source version control without any setting.

  • Compiler time reduce a lot. (Really~~~  a lot)

TODO:

  • According to Nimbus “Three20 migration Guide”,  we should use NIToolbarPhotoViewController. Will check it later.