10/11/2018

Taiwan points exchange rates

當你要推出一個贈送點數的行銷方案時, 是否考慮過可能產生無窮迴圈被用戶洗點數?

台灣紅利點數轉換率一覽 是一個工具
計算台灣各種點數之間的最優交換比率(轉換路徑)。 計算是否有任何迴圈會造成無限增長點數?
利用python networkx的深度優先搜尋算法, 以及graphviz 做出下圖


7/26/2018

Using Nexmo to receive incoming calls


Reference
https://www.nexmo.com/blog/2017/01/26/handle-inbound-text-speech-phone-call-node-js-dr/


# Buy a virtual number

First you make a payment (with credit-card/paypal) in order to buy virtual numbers. At least 10 Euro to start.
Here I bought an Indonesia number +628557467xxxx .

# Setup a webserver to receive webhooks.

The target is When anyone (from PSTN/GSM) calls your virtual number, Nexmo platform intercepts the call and
sends it to the application you created.
To setup a web server on your laptop to listen the webhook, you can use any web framework.
For me i use CodeIgniter . Download and unzip it anywhere.
Create a controller named event.php under application/controller with the following

defined('BASEPATH') OR exit('No direct script access allowed');
class event extends CI_Controller
{
public function index()
{
var_dump($_POST);
}
}

and a answer.php like the following,

defined('BASEPATH') OR exit('No direct script access allowed');
class answer extends CI_Controller
{
public function index()
{
var_dump($_POST);
}
}

Then under the same folder, run
>php -S localhost:4001 -t ./
will start a web server listening on port 4001.
Then we setup a ngrok which is an auto registering dynamic https endpoint.
On a macOS laptop, use
>brew cask install ngrok
>ngrok http 4001
For example, you see the following:

ngrok by @inconshreveable (Ctrl+C to quit)
Session Status online
Session Expires 7 hours, 59 minutes
Version 2.2.8
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://e69a8532.ngrok.io -> localhost:4001
Forwarding https://e69a8532.ngrok.io -> localhost:4001
Connections ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00

Now everything is ready on your laptop.
Then we tell Nexmo to send webhook to https://e69a8532.ngrok.io

# Install nexmo command line interface
>npm install nexmo-cli -g
>npm i npm to update
>nexmo setup

Find your application id on the page.
>nexmo app:update "My First App" https://e69a8532.ngrok.io/answer https://e69a8532.ngrok.io/event
>nexmo link:app

# Testing

Call the virtual number like +628557467xxxx from your mobile phone (GSM) or Skype out
and you'll see the variable dumped in php.
[Thu Jul 26 16:41:55 2018] ::1:65010 [200]: /event
[Thu Jul 26 16:41:55 2018] ::1:65011 [200]: /event
[Thu Jul 26 16:41:56 2018] ::1:65012 [200]: /event
[Thu Jul 26 16:41:56 2018] ::1:65013 [200]: /event
[Thu Jul 26 16:42:12 2018] ::1:65017 [200]: /event
[Thu Jul 26 16:42:12 2018] ::1:65015 [200]: /event
[Thu Jul 26 16:42:13 2018] ::1:65016 [200]: /answer?to=628557467xxxx&from=4434xxxxxxxxxx&conversation_uuid=CON-xxxxxxxx-7a9e-426d-961b-828bc7726d49&uuid=93b62d17c960c0209xxxxxxxxxx

12/04/2017

Block incoming calls. How to extract offline database from Whoscall


Prepare apk and root phone
Download apk of gogolook whoscall from some website like this.

Install apk to a rooted android phone, I recommend samsung i9001.
A little bit old, but great performance running CyanogenMod. Here's how you can root your i9001

Download offline database
Update offline database following instructions in Whocall app, this will create a database named

Under android /data/data//databases/offline.realm

Use Android studio device monitor tools to navigate to above path,
Click the button (top-right) to "pull file from device"
Save it to your Download folder on your laptop, say whoscall_database

.realm is a client-side database that helps you seamless integrate a sqlitedb and scale-up if needed. Realm database help manage db when gets larger.


Download real browser from above site to your Mac laptop

Open Download/whoscall_database/offlinedb.realm

I'm using a Taiwan number so most of the database are numbers in Taiwan.



Looks like when a call comes in, whoscall is using a hash function to calculate from the phonenumber to a hash value and then search from the offline database for a hit. If so, shows a warning triangle on the lock screen. 

4/25/2017

Scaled Agile for The Enterprise

最近聽關於專案管理的podcast 很有感覺
原來專家們已經遇過要從50位RD成長100位RD的瓶頸。

當我們從scrum抽取 Agile 概念用於backlog 工作項目以及排序優先順序, 已經某種程度上已經契合 Agile的精神。

但是Business operation management layer 相當於原本PMP當中提到的PMO (Project management Office的角色,管理階層往往希望「每一項功能」在產出方面希望得到日期保證,實際上這是waterfall的精神。

這兩種方法在原理上是衝突的。

解決方法是:

1. 經常溝通或教育PMO認知到為何Agile比較快deliver一些feature到客戶手上、修改對於壓日期的「預期心理」。PMO鎖定策略面就好,缺點是可能因為策略不明導致下一round的Agile process卡輪。

2. CEO直接頒布本公司採用Agile 方法,會比較硬性而且大家需要學習Agile的名詞與方法。
12相比第一是靠潛移默化我覺得比較好。


3. 如果研發的throughput 要再scale上去的話、可能需要建立中間整合層的人,有幾種方法學像是leSS, nexus。 不過我還沒有學習過相關的framework以及管理技能, 研究之後再分享。