病左三日
兩天前,和同事討論了個理論。
受過project management training 的manager (e.g. production stream) 和沒有受過相關訓練 (e.g. sales & marketing stream) 的思考模型是很大差別。
若取雙方的精英比較,
Mkt 人,思維主體是紅海模式。Only details matter, 盡在細節中。
Product 人,思維主體是藍海。任你怎樣打,飛高十萬呎,無人爭。
Tech Businesses, Entrepreneurship, Fintech, Cloud Cybersecurity & Architectures, Products & Projects
Steps
1. Register/Create a new app on Facebook
2. Add Android section
3. Generate Key Hash with your keystore and put to Facebook Developer
keytool -exportcert -alias your.alias -keystore your.keystore > key.bin
openssl sha1 -binary key.bin > sha.bin
openssl base64 -in sha.bin -out output.txt
4. Import Facebook SDK into your Eclipse
5. Eclipse > Project > Properties > Android > Reference. Add Facebook SDK.
6. Follow Facebook tutorial at
https://developers.facebook.com/docs/android/login-with-facebook#config
7. Facebook tutorial missed out two part. First is the meta-data with appid.
< meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id" />
Then put your app id in string.xml
8. Add the com.facebook.LoginActivity to your AndroidManifest.xml.
Done.
Optimized Debug Process
1. Reproduce the problem
2. Analysis possible point of error
3. Reproduct problem with point of error caught by console log = Proof
4. Find Methodology of Fix
5. Plan Fix
6. Fix it
7. Success
Crash Bug – how to fix? Best algorithm
Crash Bug are some bug which don’t output anything, just crash. Often the engineer has completely no idea where the problem is.
1. Remove lines of codes. Trace back to a point where there is no crash. Set it as a Starting Point (A).
2. Mark the current point as (B).
3. Use a divide and conquer approach. Between (A) and (B), find a middle point (C) which is no crash. Removing and adding back lines of codes, or mark them comment.
4. Minimize the scope until you find which line is the cause of problem.
5. Go to Optimized Debug Process (3) above
IT 行內有不明文事業階梯
Programmer/Engineer: 專注 Scope、Time和Quality,務求做到準確的Scope、Time,並在合適的Quality之下。
Analyst Programmer: Scope和Time複雜程度較大,Quality和技術要求較高。都是務求做得準確。
System Analyst: base on AP + Reuse, Architecture issue, Module control
Lead Programmer / Debug Expert: take over all bug issues in a company
System Architect: SA + DE
Project Coordinator/Producer: Biz, Product, Strategic Planning
Project Manager / Senior Project Manager: SA + Producer
今天,寫一些基本功。
用來訓練新員工很適合的教程。
新員工,需要有態度、團隊能力、責任心、學習能力、技術。尤其是前四樣。
這些是較長期才能訓練到的soft-skill。單靠工作訓練,很難短期能有明顯改善。
個人做法都是在selection process中已filter走不合格的。
任何訓練總有個開始點。而這文的開始點就是以上條件。
1. Scope Sense
先訓練員工明白甚麼是scope。IT Project 都是些抽象產品,員工若對scope不熟悉,通常會不是做少了就是做多了,結果只會影響進度和準期。
Steps:
1.1. PM自己先清楚整個 Project 的 Scope。
1.2. PM將Project分成不同的Task和Module。每一份都是manageable state。
1.3. PM 和Engineer 開 Sprint Planning / Daily Scrum,傳遞Task/Module
1.4. Engineer 要清楚知道Task/Module的definition,才算是傳遞到。
2. Agile Scope
知道Scope,另外的就是時間。
估計時間,最有效的,是PM和Engineer 都估計一份,比對,然後若有分別找出差別的原因。
正常有實力的PM和Engineer,坐在一起估計,應該不會差太遠。若其中一方欠缺估計能力,則另作別話,也不適合參與估計過程,或只適合作培訓用途。
估計到時間,按需要加上一點緩衝或休息時間,就可以pack成module。
若有些task因一時間欠缺資料而不能作出估計的話,可以分作兩份:一份是調查用的時間,另一份是工作時間。
3. Agile XP
1和2都是Agile的實戰版。若公司除了PM外,還有Senior Engineer(SE),如何分工?
refer to post: https://dayios.wordpress.com/2013/09/11/xp-scrum-agile/
若有SE,則需要訓練E學懂配合SE。
寫一篇Base64 Encoding Algorithm
= Base64, Why? =
有Base64的原因,是因為電腦內部(e.g. ASCII)是用8-bit 編碼的。但這些編碼大部份都不是 printable character,就是可以在螢幕上顯示的字。
將內部的8-bit,轉換成可以在螢幕上顯示的字,就是Base64最簡單的定義。
= Base64, How? =
== Base set ==
Base64之所以叫Base64,就是選用了64個printable的字作為編碼基組。
即是,任何Bit stream都可以以這64個字編碼後當printable的字來傳送。
64個字符選哪些,Base64 有多個不統一的implementation。一般最常用的是以A-Z, a-z, 0-9, +, /,這64個字符。
還有一個 = 作padding,下文再述。

== Algorithm ==
1. 將byte 變成8個bit 的1010,排成bitstream。
2. 每6個bit 一組(2^6 = 64)。不足的尾數,補上零(0)。
3. 每6個bit 編碼成base64。
4. 如此,必定會形成了「每3個byte就編成4個base64」(3*8=4*6)。
5. base64結果的長度必需為4的倍數。不足處補上等號(=)。完成。
== Check ==
1. 要檢查一個Base64是否正確,其長度必然是4的倍數。
2. 尾部只會有三個可能。一是沒有=(即應是一個Base64的字符),二是有一個=,三是有兩個=。不會有兩個=以上或其他。因為,Base64的原理,是將3個byte編成4個base64。
3. 分析。若byte除以三後:
– 剩1:兩個=(1byte=8bit,補4個零12bit,編成兩個Base64,補上兩個=,成為四個一組Base64)
– 剩2:一個=(2byte=16bit,補2個零18bit,編成三個Base64,補上一個=,成為四個一組Base64)
– 除盡:無=
完。
= Supplementary =
留意有某些SDK implementation,會有在編碼中,插入了newline character的情況。只需要看Base64的總長是否4的倍數即可分辨。
XP: Extreme Programming
SCRUM + XP
兩個人做development。
Team Setting: 一個Senior Engineer(SE) 加一個Engineer(E)。
Planning: 先和Project Manager (PM) 做Scrum Agile。Daily Scrum,夾Scope 和Schedule。
Analysis: SE和E 夾分工方法,夾個別部件的做法。
Implementation: Engineer 專注push forward進度;SE專注解決所有技術問題、研發Library、測試、其他雜項handling、Product問題等等。
Previously:
array = [NSArray arrayWithObjects:a, b, c, nil];
Now:
array = @[ a, b, c ];
Previously:
dict = [NSDictionary dictionaryWithObjects:@[o1, o2, o3] forKeys:@[k1, k2, k3]];
Now:
dict = @{ k1 : o1, k2 : o2, k3 : o3 };