2013/09/09

Android Books



It's good to be able to wander in Safari's online shelves and pick up books that I am interested in. Though not having enough time coding, I still managed to quickly take glimpse over two Android books recently. One is 50 Android Hacks, and another one is Android Developer Tools Essential. Both are good to read and gave me some new nuance for my poor Android knowledge.

2013/07/01

Google Reader is going into history today.

I've been using Google Reader for very very long time. It's the most important news resource and knowledge source for me. Now it will be closed soon. Kind of  sad that such a good service will no longer exist.


2013/06/30

Get Rid of HTC Sync Manager autostart on Mac, and Android File Transfer Autostart

(Geneve.Swiss)

Tired of seeing autostart finder popups every time I plugged in my new hTc one into my mac. Here's a way to disable it:
1. Identify UUID:
   by using "diskutil info /Volumes/HTC\ Sync\ Manager
   you can get its volume UUID
2. sudo vifs
    add a line as below:
UUID=YOURVOLUMEUUID none hfs rw,noauto

= = = = =
As for disabling Android File Transfer app, you just need to rename file names of the so called Agent app:
1. /Users/user_name/Library/Application Support/Google/Android File Transfer
2. /Applications/Android File Transfer.app/Contents/Resources

REF:
http://blog.softwareispoetry.com/2013/05/disable-htc-syc-manager-autostarting.html


2013/06/18

showing relative line number in vim


Being a long time vim user, this is the first time that I heard vim supports relative line numbers, by which users can jump around the editor screen even more quickly. Just type :set rnu will do the trick.

Another good plugin that can improve navigation speed is EasyMotion. It works a bit like the "f" feature in vimperator for firefox. Too bad that it's not avaible for intellij's ideavim.

2013/06/17

How to push codes to Heroku from China

(Taipei.Taiwan)
Miss my One V.
****
Seems the IPs of Heroku are blocked, so "git push heroku" can not work normally. In order to fix this problem, add following lines to the .ssh/config file:


Oh, by the way, remember to change the user name to your own one.
REF:
Check this link

2013/06/10

在Lime HD中快速啟動語音輸入法

(富貴角.Taiwan)

剛剛試了一下谷歌的語音輸入,覺得有些時候應該蠻實用的。所以打算幫它在Lime HD中加個快速切換的功能。在Lime HD中原本就有開啟Google語音輸入法的方式,只是我覺得有點太麻煩了。原本的方式是:
1. 長按左下方的設定鈕,這時會跳出一個對話視窗,可以設定輸入簡繁中文的切換,分割鍵盤等一些選擇。畫面最下方則是切換成語音輸入法。

通常會想用語音輸入的時機,都是在手不方便慢慢點螢幕的時候,所以,操作步驟愈多,就愈麻煩。原本我是打算在長按(中/En)按鈕時,直接啟動語音輸入。目前這個按鈕的長按並沒有預設的作用,所以很適合。

可惜的是,我不知道怎麼debug InputMethodService,所以沒有辦法短時間內看清楚在LIMEService中的長按功能,是怎麼前後串起來的。一直找不到好的interception point。

無意中卻發現了,原來Lime有針對輸入的整個面版實作swipe的key listener!!做為一個多年的Lime HD愛用者,竟然不知道有這麼一回事。看了原始碼後,它的目前對應功能是:
滑上:開啟設定對話窗(跟長按設定按鈕一樣)
滑下:關閉輸入法
滑左:模擬刪除鍵
滑右:送出目前選擇的候選字

既然設定對話窗已經可以很方便地長按設定鍵來開啟,我把"滑上"給改成呼叫Google語音輸入法。程式碼很簡單,在LIMEService中的swipeUp(),把原本的code換成StartVoiceInput()就可以了。

2013/06/07

Adding macros in Android Studio (Intellij) -- take Adding Javadoc comment for example

(Geneve.Swiss) Climbing is pleasant, but it leads you to better views.

 Some shortcuts can be integrated into ideaVIM, but some are more complicated and need other tricks to make it more handy. One of the technique is to use macros. As Mac's Automator, you can ask Intellij or Android Studio to record your actions, and make it available as a keyboard shortcut.

For example, if you want to add javadoc comment to a funtion, you need to move to the first line of a certain function, and type in /**. After pressing Enter, it will generate javadoc template for that specific function. Though it's already very convenient, it still takes time if you're not quite familiar with how to move the cursor to the first line of the function.

So, to add javadoc comment from anywhere in codes, you can record a macro to move to the first line of the func, and type /** , and Enter for you. Here's the actions:
  1. Start recording a a macro in Edit - Macros - Start Macro Recording
    1. Press Down
    2. Press Ctrl + Up
    3. Press ⌘ + Left
    4. Write /**
    5. Press Enter
  2. Stop the macro recording in Edit - Macros - Stop Macro Recording
  3. Give it a cool name
And then you can add a keyboard shortcut for this macro in Keymapping in Preferences.

REF:

2013/06/06

Some hacking articles about IdeaVIM under Intellij

 (Leiden.Netherlands)

IdeaVIM is a vim-like input plugin for intellij IDE, good for text editing but not so powerful if you want to use it for other IDE tasks, for example accessing menu actions by defining keyboard shortcuts.

Fortunately, someone in Japan branched the source codes on GitHub, and wrote some tweaks to make it possible to configure all kinds of Intellij menu items to keyboard shortcuts as you wish in a config file.

Tried downloading the modified codes and built it in Intellij; installed the plugin in my Android Studio environment. Working like a charm~

my settings in _ideavim.groovy


REF:
http://d.hatena.ne.jp/masanobuimai/20120720/1342764219
http://d.hatena.ne.jp/masanobuimai/20080323#1206277040


2013/06/04

How to make testing work under Android Studio

(Geneve.Swiss)

It's such a pain to look for solutions for tasks on Android Studio. When can it be mature enough and more well documented for developers?

I would like to write some test cases for my small app, but I couldn't find a way for adding test cases into Android Studio project and have it run successfully.

After wandering around on the internet for a long time, eventually I found a link that did helped me out (see reference below). As Google I/O 2013 video said, a new android build system made of gradle is released, which will be more flexible, more powerful, more etc, etc. However, currently, it 's not well integrated into Android Studio. Some modification in Android Studio won't be directly reflected in gradle build scripts. Well... then, how do I know when I should modify build scripts my self? And to write it by myself, I have to learn groovy first, because that's the language Gradle used to write its build configuration files. How could I master these things in a short time...

Anyway, the solution for my pain point above is to modify build.gradle under the root directory of app project, and make sure all the instrument source folders are well set up. Now I can use cradle to run test cases and generate report files. However, I can't make it work in Android Studio still. orz...


REF:
http://blog.crowdint.com/2013/05/24/android-builds-on-travis-ci-with-gradle.html

2013/06/01

Gradle build error in comman line for Android Studio app projects

I saw someone met the same problem on StackOverflow. Fortunately,  I found out how to make it work. So leave some notes here:
1. upgrade Gradle version to 1.6
2. Afterward, running "gradle build --stacktrace", you will see that ANDROID_HOME environment variable is required to be set up.
3. on Mac, add following line to your ~/.bash_profile
export ANDROID_HOME="/Applications/Android Studio.app/sdk/"

Now it should work like a charm!

2013/05/31

Open downloaded files directly in Firefox on Mac

(Annecy.France)

It's annoying that I have to click on torrent files every time I download them in firefox. Although I tried to check the option to open always with a certain application in SaveFile dialog, it never worked.

 However, the solution seems so simple that I should have searched the internet earlier to make my life easier. In firefox official support website, it mentioned that this is configurable in Peferences:
  1. On the menu bar, click on the Firefox menu and select Preferences...
  2. Select the Applications panel.
  3. The Applications panel will display. Select the type of file for which you want to change the default action. 
Voila. Let's keep surfing the internet!

REF:
 https://support.mozilla.org/en-US/kb/change-firefox-behavior-when-open-file#w_changing-download-actions

2013/05/28

OrientationEventListener on Android to get current rotation degree

(Central Park.New York)

Strangely, it's not possible to get current rotation angle in android directly, except for getting the fixed 4 rotation modes: 0, 90, 180, 270. In order to get precise rotation degrees instead of rotation modes, OrientationEventListener can be used. Once it's implemented, you can get the rotation degree in onOrientationChanged(). It's a lot easier than manipulating values from all the sensors like gyroscope, accelerator, etc.

REF:





2013/05/24

Tips for using AdMod module in Android Studio

(Geneva.Swiss)
It's pain in the ass to use Android Studio now, since it's just published, which implies bugs appear every now and then, and you're not sure it's due to your misunderstanding of this IDE, or it's really an issue. In addition, it's  relatively hard to find How-to answers comparing to ADT plugin with Eclipse.

While trying to set up AdMob module in my project on Android Studio, it took me some time to fix some external library import errors that should be clearly mentioned in online AdMob doc, or even better, just integrate it into "Android Studio".  Isn't Android Studio meant to make Android developers' life easier?

Problem 1: Add com.google.ads.AdView element  in my layout xml as doc says, but it generates compilation error.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">
  <com.google.ads.AdView android:id="@+id/adView"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         ads:adUnitId="MY_AD_UNIT_ID"
                         ads:adSize="BANNER"
                         ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID"
                         ads:loadAdOnCreate="true"/>
</LinearLayout>
Anser: Pay attention!! You also have to add the red line attributes to the container layout!! It's not clearly mentioned in document. What I just did in adding com.google.ads.AdView component. Obviously, it told me that it can't compile.

Question 2: Don't know how to add the AdMob library to my project in Android Studio. The AdMob doc only has flows for eclipse. I always meet "NoClassDefFoundError" during runtime. This took me most time to wandering on the internet, looking for a right answer.

Answer: it's a bit tedious. Please just check detail information in reference link below. In brief:
1. Put the jar into the libs folder
2. Right click it and hit 'Add as library'
3. Do a clean build (you can probably do this fine in Android Studio, but to make sure I navigated in a terminal to the root folder of my app and typed gradlew clean (I'm on Mac OS X, the command might be different on your system)

Question 3: sometimes, even questions above are all fixed, you still can't get the AdMob View. Why? You have to declare a specific Activity for it including configChanges. This is mentioned in Introduction, but ... I just have ignored it, since who would have thought that creating a View in my own activity needs to declare a specific Activity for it?

    <activity android:name="com.google.ads.AdActivity"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
 

REF:








2013/05/20

Enhance Reading Experience for Android Dev website


Recently I spend most of my time reviewing documents on google's android official site. It annoys me that the left side of the screen is always occupied by the content index; however, I just need to change articles once in a while by using it. It makes me feel bad that one third of the screen is wasted. In addition, it also distracts me while I was reading.

As a consequence, I searched internet to see if there's any extension, plugin, or script to help me hide the navigation panel when I want to do so. Out of luck, no. Maybe it's too tiny to have someone work on it.

Therefore, I decided to write one by myself, after reading a book about jQuery. My choice is to write a userscript for greasemonkey, which is supported on Chrome now as well. The logic is very simple and the lines of codes are few, although it still took me sometime to find right APIs to implement this feature.

Here's the screenshots:

The userscript is uploaded to following site:

2013/05/17

JavaScript & jQuery: The Missing Manual



很容易讀的一本書,花了兩天把它翻完。
前半部的javascript,因為已經看過一些基本的語法介紹,就沒細看。
後面的jQuery介紹,把selector的使用和網頁的一些操作都帶到了。
比較讓人不解的是,最後一章的debugger介紹,為什麼不是放在整本書的最前面呢?
中間在測一些小範例時,老是卡住;還是靠自己摸索才知道firefox和chrome都有console之類的component可以協助debugging。

REF:
Amazon link

2013/05/15

Eclipse/Java code completion not working with Android development

(GreatWall.Beijin.China)

While watching some video tutorials about android development, I found that the lecturer can call out the class completion helper dialog during typing class names. However, I only have the function/variable autocompletion feature after typing a . after a class name in my eclipse. Without entering the class name correctly, I can not get any help from eclipse, which is quite strange comparing to what I've seen for others.

Well, it seems that many people encountered the same problem as I did. This is being discussed on various posts. One way to make it work is to check the "Java Proposal" in Eclipse's Preferences > Java > Editor > Content Assist > Advanced'.

But for me, it seems that something's wrong with my workspace configurations too. The answer from hoipolloi in following reference post helped me to fix this issue. Here's his suggestion:
  • Quit Eclipse
  • Go to workspace/.metadata/.plugins/org.eclipse.jdt.core
  • Remove *.index and savedIndexNames.txt
  • Restart Eclipse and search Ctrl+T for the offending type. The indexes will be rebuilt.

REF:
http://stackoverflow.com/questions/908489/eclipse-java-code-completion-not-working

2013/04/18

vrapper

最近常遇到 limeHD 選字不對的問題。不知道能不能加個小方法,讓它可以按著使用者的意思,針對某種打法,強制某個字是自己要的第一候選字呢?所以去抓了limeHD的程式碼,想要來研究研究一下。

為了要在eclipse上順暢地閱讀程式碼,先裝上了仿vi的plugin--vrapper。官網在此:
http://vrapper.sourceforge.net/home/

2013/04/12

QNAP TS-112 再復活

(Annecy.France)
Mountain climbing with my good friends.

****
很久前試著把我買的QNAP TS-112升級,
結果升級完就GG了。
在裡頭寫的wordpress post一開始以前,在重灌時搞爛了,
後來好像那個partition還在。

打了線上客服,他請我還是再買一顆硬碟吧。
原本那顆好像有點問題。
換上2TB的新硬碟再重灌之後,就真的可以了!
重新開張的第一件是就是,再把wordpress給啟動。
不過,這次我可以不敢再放什麼東西上去了。
先來看看有什麼其他好的應用再說吧。

2013/04/10

How to de-compile android apk for studying purpose

(Redmond.Seattle.US)
Oh, How I miss it.

****
Due to interview purpose, I wanna know some inside implementation details about a certain apk. In order to do further investigation, I searched how to de-compile apk files on the internet. The reference article below is so wonderful that it lists necessary tools and also the commands how to trigger them.

In brief, you need dex2jar and  JD-GUI. If you want resource, or read smali files, apktool will do the trick too.

REF:
https://kkinder.com/2011/11/27/so-you-want-to-reverse-engineer-an-android-app-apk/

2013/04/08

好久沒騎腳踏車了

(Red Leaves.Seattle.US)
好久沒騎腳踏車了。這幾天台北都在下雨,每天待在家裡都快發霉了。
趁著最後一天沒下雨,把很久沒騎的小白折疊車從五樓抬到一樓,
將早已經消氣的前後輪充飽氣後,拿著快沒電的手機,
出發到老路線,萬隆→大稻埕。

一路上氣溫相當涼爽,帶點涼意,
是個怎麼騎都不會流汗的好日子。
看來台北人都跟我一樣被悶久了,
今天騎車出來逛逛的人特別多,
河濱一路上的籃球場、壘球場,足球場,網球場,
全都有人在使用。
連大稻埕也一如往常般,堆滿了人。
咦,今天竟然很輕鬆地騎到了大稻埕。
明明腳都還沒有累的感覺!
看來,跑了一個月的慢跑,對體力真的有很大的幫助。
所以,今天一路往下騎,把社子島騎了一圈,
然後再乖乖地返回原路。
騎車跟跑步比起來,果然輕鬆多了。

Link: Here

2013/04/06

如何批次下載教育廣播電台的教學節目有聲資料

(Jellyfish.Osaka.Japan)
去水族館看水母,已經成了到各地水族館既定的行程。在微光下,要拍攝出動人的水母照片,難度頗高。若是能拍攝到,當天的心情一定會特別好。

****
新版的教育廣播電台網站,把原先可以直接下載的連結全變成了網頁。有些課程只能線上收聽(而且得要特定的browser才行,我用firefox和chrome都不可以,在mac只能使用safari才聽得到)。對於這種限制,個人不知道是出於什麼樣的考量。如果是在沒有網路的環境下,那就沒辦法自學了。另一點是線上播放的player是固定的,無法提供快讀或是慢讀,或是A-B播放的功能,對於語言學習來說,很不好用。為此,決定把這些audio都下載下來,在自己的電腦上使用。

打開網頁原始碼來看,其實它javascript裡頭已經包含了錄音檔可以下載的URL,但是並非所有的教學節目都有把這個javascript function指定給一個button。有button的話,使用者就可以透過按button來下載該集的內容;有些節目故意不提供button的話,即使html source code中看得到,一般使用者還是無法很直接的下載。學過點html的人,倒是可以很簡單地把javascript中的relative URL,再加上教育廣播電台的網址,輕鬆組出完整網址,下載錄音檔。


如果還有一點點程式基礎的話,就可以像我這樣,觀察一下每一課的URL變化,歸納出URL最後面的28488,是會隨著課程集數,往上累加2的。這麼一來,就不用浪費人力,一課一課去組裝網址下載mp3,只需要寫個小script,就可以把某個節目的所有課程下載下來。

目前我想學習的是「開心學德語」,所以在此附上下載從第5課到第107課的python script(前幾課的我已經手動下載了)。有興趣的人可以拿去改一改,自行下載其他課程的語音內容。

****
現在網路上很流行網路教學,除了各種簡單容易上手的網頁呈現方式,語音、視訊的完美整合外,有的還加入與學習者的互動內容,務求使用者可以更有參與感,提高學習的效果。可是反觀教育廣播電台的改版和推出的app,似乎仍舊像是個大學生的專案,覺得有點痛心。明明有這麼好的教學內容,卻因為網站的呈現方式不好,大大地降低了它的實用性。期待未來它能夠朝更好的方向改善。

REF:
codes



ATW-WP169-3 無線遙控開關.家庭自動化.遙控開關.無線開關◎安得王科技◎


(Taipei.Taiwan)
花博時拍的。雖然市政府花了大錢蓋了一堆博覽會之後就沒啥用處的建築,但是我想參加花博的遊客應該都還是玩得很盡興吧。盡管是個自high的博覽會,讓台灣人多個去處未嘗不是件好事。像這麼漂亮的鬱金香,如果不是花博的話,還真不知台北上哪兒可以看得到拍得到。

****
從搬到現在住的地方之後,這幾年來,一直對於房間內電燈的開關很反感。原本開關是設計在門旁邊的,但是由於風水還是格局的關係,後來又請師傅把門改到房間的另一側去,造成現在電燈開關在床的上方。進門後得要跨到床上才能開關電燈。偶爾一兩次是還好,可是久了,就覺得很煩。生活中的小瑣事,如果不能解決的話,常會影響到一個人的心情。

這幾天這樣子的感覺又愈來愈強烈了。所以在網路上找了一下,看是不是有方式可以把電燈開關改成搖控的。這樣子我就可以把搖控器放在門邊的櫃子上,不管是要進出都不用再那麼麻煩。不過,似乎現在這種需求沒有很多?找來找去,網路上的產品就那麼幾樣。現在網路那麼發達,應該很多人會想要透過無線的方式來控制家裡的電器吧。

目前看上眼的有Panasonic的Cosmo ART系列產品,和我後來下單的 ATW-WP169-3 無線遙控開關。我買的這款是可以直接把牆上的開關按鍵置換掉的線路,外加一組搖控器。希望幾天後到貨就可以解決這困擾了我多年的小麻煩。

[20130410]
4/8寄出,今天到貨。拿到手後,馬上把電燈開關拔下來,換上搖控開關。
電線很粗,所以在從舊的開關拔下來時費了不少勁,
再裝到新的無線開關時,也很費力。
塞回牆壁時,因為牆壁是木板隔間的,上頭的鏍絲齒痕都快掉了。
但是,總算是裝好了!
可以從門邊就開關房間電燈,真是幸福啊!

不過,搖控器似乎是用兩根小鏍絲合起來的。
不曉得之後沒電時,是不是要整個拆開來才可以換電池呢?

REF:
露天拍賣網址

2013/04/05

難用的教育廣播電台網站和android app

(YanmingShan.Taipei)

是因為經費的關係嗎,為什麼把網站做得那麼難用。之前的系統提供的應該是錄音檔的直接連結,新版的把每課的連結全改成是網頁的形式,在網頁裡內嵌播放器播放該課錄音。然後有的網頁有提供下載的button,有的沒有。接著,再試用了一下Android上的app,介面很陽春就算了,畫面中的分頁數字也是小得可憐。明明是給手機使用的軟體,為什麼沒有考慮到字型大小呢。更誇張的是,選了課程來播放後,沒有聲音呀!!!可是用網頁去連,卻又可以聽到該課程的錄音檔。而針對節目的每個item,點下去則提供了Play和Stop的Action。明明就還沒有點下去,怎麼會有選Stop的時機呢?我實在是搞不懂這個app啊…

奇怪,這種粗製濫造的app,為什麼還可以放到market上呢。

2013/03/31

monster

(Me and Snow.Sapporo University)

Finished reading this comic in two days. The story is so interesting and dramatic that I just couldn't help but keep reading it. It's been a long time that I didn't find good comic books; however....it seems that I should focus on other things now..instead of reading comics.

AVPlayer and AVAudioPlayer on iOS

(Polderpark.Netherlands)
I like the bright color in this picture. Although this photo was taken almost 10 years ago, the image quality is so great that I still can't believe it's taken by a cheap camera at that time.

****
It's easy to play and control local mp3 files by using AVAudioPlayer. However, if someone wants to stream playing mp3 files from the internet, he should try AVPlayer instead.

Spend most of my time trying to find a remote mp3 for testing. Too bad that I just can't even find one. Eventually, I gave up searching on the internet. Instead, I use following python command to create a simple http server locally on my mac:

python -m SimpleHTTPServer
 
 

2013/03/28

Starbuck 2011

(Annecy.France)

結局還蠻不錯的。
不過加拿大的法文腔聽起來幾乎全部不懂呀…

REF:
IMDB link

Macbook Pro Freezes When USB Plugged In

(Touchen.Taiwan)
Symmetry brings harmony.

****
Encountered this problem for a while. It bothers me a lot although it does nothing harm. Well...the solution is quite simple, but hard to find by myself: just uninstall "Android File Transfer" app!! Don't know why this app causes the symptom. I am glad that I don't have to keep moving around on the touch panel to make sure I re-gain the control of mouse movement while pluging anything into usb port.


REF:
https://discussions.apple.com/thread/4509069?start=0&tstart=0

2013/03/27

App程式設計入門 iPhone . iPad

(Taipei.Taiwan)

這本書寫得很淺顯易懂,
但缺點是,每一個章節都是點到為止,
而且用字有點太過白話。
做為第一本iOS入門書還不錯,
只是想要深入了解iOS programming,或是要可查詢的工具書的話,
要再多買幾本書才行。

REF:
博客來連結

Dans la maison

(Toronto.Canada)
Haven't thought that I would be able to have a biz trip to Canada, let alone a city in the middle area of it.
Toronto is a clean city which is suitable for living, for sure.
I like the clear sky and freezing temperature in winter.

****
不是很好看。
一個教文學的老師看到一個作文不錯的小朋友,
開始逐步引導他怎麼寫,
漸漸地,小說內容和現實世界之間的界線模糊了。

REF:
IMDB 連結

Priceless

(New York.US)
Look remotely, it's a picture of woods;
Once you get closer to it, you will find it's made up of newspaper strips.
Very creative piece.
I like the deepness of the work.

****
木村拓哉主演。女主角沒有很正,
倒是演次角的女生外型比較搶眼。
這部日劇還是很日本,鼓勵人向上,
透過主角楔而不捨的意志力,逐漸地感化每個人。
雖然主角似乎有點積極過了頭,
但也總比看台灣連續劇亂七八糟灑狗血劇情來得好。

REF:
官網

Objective-C 2.0 iPhone/iPad/Mac OS X 程式設計講座

(田子坊.Shanghai.China)
Brought ex-colleague to visit this old district in Shanghai.
It's full of exotic atmosphere while wandering around.
Sitting in the coffee shop by the street corner, you can't even tell whether you're in western countries or somewhere else.
Walking-by passengers are visitors from around the world.

***
這本書翻譯的不是很好,看得有點頭昏。
加上年代有點久,有些章節在新的平台上應該有更好的作法了。
應該找本新一點的書來看才是。

REF:
博客來連結

操作介面設計模式

(Annecy.France)
Relaxing on a boat trip in Annecy lake.
What a life.

***
這本書整理得很好,把常見的UI模式都整理了出來,而且一個個說明優缺點。
雖然沒辦法從中學習到如何完整地搭起讓使用者喜歡或是順手的介面,
但是可以做為工具書,需要時拿出來做參考。
本書主要是以網頁的元件為主,如果也能有本書是專門在描述手機平台的,
那就更好了。
另外,這本書真是不便宜啊…得要多翻個幾次才夠本。

REF:
博客來連結

How to find and turn on USB debugging mode in Android 4.2 and higher

(Paris.France)
Tranquille dans la ville de belle Paris.

****
While trying a certain app recently released by a company that I had interviewed with, it crashed every time I triggered it. I wanna get the logs for them to do further investigation. Howevever, I couldn't find the developer option in my Galaxy Nexus with android 4.2.2. Not sure why; I did some search on the internet. Seemd that google thought it's not so useful for normal users so they just hide it from settings app by default. If this feature is required by developers or someone boring enough, just like me, they can always find the solution on the internet: You can enable/disable it whenever you desire by going to “Settings” -> “Developer Options” -> “Debugging” ->” USB debugging”.

Voila, I can successfully get logs by using adb logcat now.

REF:
http://dottech.org/87439/how-to-unlock-usb-debugging-mode-on-android-4-2-jelly-bean-and-higher-guide/

2013/03/23

Pitch Perfect

(Muzha.Taipei)
吃完午餐,散散步。

****
喜歡電影劇情裡有唱歌或是跳舞。
雖然情節很老套,但是光聽整部電影裡不停的唱歌,
就覺得很享受。

2013/03/22

The Complete Idiot's Guide to LinkedIN

(Central park.New York)

****
看了好像沒有什麼用處 ,可能是我太idiot了吧。

REF:
Amazon Link

2013/03/20

LimeChat -- Mac上的irc軟體

(MatuShima.Japan)
因為雲層過厚,沒得看太陽從港口中間出來,
但是看看金邊的雲,享受陽光漸漸征服黑音,佔滿整個天空的感覺
讓人覺得很舒服。

****
最近比較有空(應該是非常有空),再回來玩玩Open Source吧。
加入irc先。

REF:

2013/03/11

人心

(Osaka.Japan)
水母漂

****
買車,沒想到是件這麼容易踩到地雷的事。
在這個資訊如此透明的時代,竟然還可以利用人的無知,
來大口大口的吸別人辛苦的血汗錢。
不知道有沒有什麼好的方式可以讓整個制度透明化,
不要讓廣大的買車民眾再這麼傍偟無助了。

2013/03/09

考過SCJP

(Flower Festival.Taipei)
好像是霜降牛肉牛包出來的花。
如果可以一片片花瓣摘下來,丟到鍋裡變肉片,那該有多好。

****
昨天忙著看世界精典棒賽中日之戰,前幾天則是忙著面試的事,
今天早上的SCJP考試,完全是在還沒唸完半本書前就硬著頭皮上場的。
除了有看完Java技術手冊的官網投影片外,就做了那麼幾十題的考題。
報名是在兩週前的,
一方面想要給自己一點時間壓力,讓自己可以更加投入一點,因為報名費不便宜,
另一方面是想順便再覆習一下Java的基礎概念。
邊看邊覺得,好多考題和概念太detail,
其實eclipse寫下去一compile就知道有沒有問題,
沒事用人腦來當compiler,實在是沒有這個必要。
不過,既然報名費都繳了,
還是乖乖地看看書比較實在,再抱怨也沒用。

好在,低空飛過及格邊緣,這錢,應該不算白花的吧。

2013/03/04

如何在中國以外地區撥打中國移動服務電話

(Central Park.New York)
若不是出差,怎會有機會來紐約呢?
****
人不在大陸,卻又想開通門號的國際漫游時,怎麼辦呢?
在大陸時,一般都會撥打10086進行門號功能的操作和設定;
出了大陸,連訊號都收不了了,光從手機大概是沒辦法再完成任何設定變更。

這時,其實可以用skype或是別隻手機打下面的電話來操作:
+8613800100186
這是北京的服務電話,打過去後,會幫你轉接到對的省份的服務單位。
只要你還記得你原本的門號服務密碼,就一樣可以做一些設定。
 
REF:
http://zhidao.baidu.com/question/89313813.html 

2013/02/28

Android上的日文語音合成方案 SVOX 和 N2 TTS

(Rome.Italy)
快忘了自己曾經去過這個城市,這個國度。
在隨處可見古蹟的城市中游盪,照片怎麼拍,都很賞心悅目。

****
之前在這一篇中介紹到svox這個在android上,提供多國語音合成資料庫的軟體,拿來搭配moon+ reader確實很不錯;可惜的是,在台灣竟然沒有辦法購買它的語言資料庫,只能下載free trial version下來試用個一陣子。雖然網路上有提供怎麼可以變成永久試用版,但這始終不是個好的方法。

所以,又再找了一下,看是不是有可以在台灣購買的軟體,或是免費,但是品質又不會太差的替代方案。N2 TTS似乎是個不錯的選擇。這是由日本KDDI的某個lab製作的,除了有免費版可以使用外,還有官網和twitter帳號。就官網來看,它有以下幾點特色:
 - 不佔容量:有男聲,女聲,總共才5.4MB
 - 不需要網路,android單機即可使用
 - 有男聲也有女聲
 - 符合android標準的TTS 介面 (到Settings中可以做切換,並讓其他ap p使用)
 - 可以個別調整語音 (這功能就得付費才有囉)

馬上把它裝到android上測試,試用okay~~ 聽書去!

REF:
官網
網路上可以下載的地方

Big Data and Hadoop

 Spring.Taiwan

Read the book "Understanding Big Data" today. Half way done.
Here's some excerpts from the book:

Understanding Big Data

2013-02-28 15:45:37
the term Big Data applies to information that can’t be processed or analyzed using tradi-tional processes or tools
2013-02-28 15:46:12
An IBM survey found that over half of the busi-ness leaders today realize they don’t have access to the insights they need to do their jobs
2013-02-28 15:48:45
Even if every bit of this data was relational (and it’s not), it is all going to be raw and have very different for-mats, which makes processing it in a traditional relational system impractical or impossible
2013-02-28 15:49:05
variety combining to create the Big Data problem
2013-02-28 15:51:31
Three characteristics define Big Data: vol-ume, variety, and velocity.
2013-02-28 15:54:17
the opportunity exists, with the right technology platform, to ana-lyze almost all of the data (or at least more of it by identifying the data that’s useful to you) to gain a better understanding of your business, your customers, and the marketplace
2013-02-28 15:55:35
a fundamental shift in analysis require-ments from traditional structured data to include raw, semis-tructured, and unstructured data as part of the decision-making and insight process
2013-02-28 15:56:27
To capi-talize on the Big Data opportunity, enterprises must be able to analyze all types of data, both re-lational and nonrelational: text, sensor data,
2013-02-28 15:56:50
Dealing effectively with Big Data requires that you perform analytics against the volume and variety of data while it is still in motion, not just after it is at rest
2013-02-28 15:58:11
Hadoop-based platform is well suited to deal with semistructured and unstructured data, as well as when a data discovery process is needed
2013-02-28 16:07:26
it is about dis-covery and making the once near-impossible possible from a scalability and analysis per-spec-t
2013-02-28 16:09:19
creator Doug Cutting’s son gave to his stuffed toy elephant
2013-02-28 16:09:44
duce)—more on these in a
2013-02-28 16:10:23
this redundancy provides fault toler-ance and a capability for the Hadoop cluster to heal itself
2013-02-28 16:10:55
Some of the more notable Hadoop-related projects include: Apache Avro (for data serializa-tion), Cassandra and HBase (databases), Chukwa (a monitoring sys-tem spe-cifically designed with large distributed systems in mind), Hive (provides ad hoc SQL-like queries for data aggregation and summariza-tion), Mahout (a machine learning library), Pig (a high-level Hadoop programming language that provides a data-flow language and execution framework for parallel computation), ZooKeeper (provides coordination services for distributed ap-plications), and more
2013-02-28 16:12:23
throughout the cluster
2013-02-28 16:13:54
For Hadoop deployments using a SAN or NAS, the extra network commu-nica-tion overhead can cause performance bottle
2013-02-28 16:14:59
an individual file is actually stored as smaller blocks that are repli-cated across multiple servers in the entire cluster
2013-02-28 16:16:09
default size of these blocks for Apache Hadoop is 64 MB
2013-02-28 16:21:41
All of Hadoop’s data placement logic is managed by a special server called NameNode
2013-02-28 16:28:14
All of the NameNode’s infor-mation is stored in memory, which allows it to provide quick response times
2013-02-28 16:30:33
Any data loss in this metadata will result in a permanent loss of corresponding data in the cluster
2013-02-28 16:32:25
devel-oper doesn’t have to deal with the concepts of the NameNode and where data is stored—Hadoop does that for you
2013-02-28 16:38:42
The first is the map job, which takes a set of data and converts it into another set of data, where individual elements are broken down into tuples
2013-02-28 16:38:51
reduce job takes the output from a map as input and combines those data tuples into a smaller set of tuples
2013-02-28 16:41:20
All five of these output streams would be fed into the reduce tasks, which combine the in-put results and output a single value for each city, producing a final result set
2013-02-28 16:43:08
MapReduce program is referred to as a job. A job is executed by subse-quently breaking it down into pieces called tasks
2013-02-28 16:43:45
An application submits a job to a specific node in a Hadoop cluster, which is running a daemon called the JobTracker
2013-02-28 16:44:39
In a Hadoop cluster, a set of continually running daemons, referred to as TaskTracker agents, monitor the status of each task
2013-02-28 16:46:39
This direct-ing of records to reduce tasks is known as a Shuffle, which takes input from the map tasks and directs the output to a specific re-duce task
2013-02-28 16:47:29
under Hadoop are written in Java, and it is the Java Archive file (jar) that’s distributed by the JobTracker to the various Hadoop cluster nodes to execute the map and reduce tasks
2013-02-28 16:48:00
BigDataUniversity.com and download Info-Sphere BigInsights Basic Edi-tion (www.ibm.com/software/data/infosphere/ biginsights/basic.html
2013-02-28 16:49:58
Hadoop Common Components are a set of libraries that support the var-ious Hadoop subprojects
2013-02-28 16:50:50
When you delete an HDFS file, the data is not actually gone (think of your MAC or Windows-based home computers, and you’ll get the point). Deleted HDFS files can be found in the trash, which is automatically cleaned at some later point in time
2013-02-28 16:52:46
we cover three of the more popular ones, which admit-tedly sound like we’re at a zoo: Pig, Hive, and Jaql
2013-02-28 16:53:09
Pig was initially developed at Yahoo
2013-02-28 16:56:02
you can FIL-TER out rows that are not of interest, JOIN two sets of data files, GROUP data to build aggrega-tions, ORDER results, and much more
2013-02-28 16:58:01
There are three ways to run a Pig program: embedded in a script, embedded in a Java program, or from the Pig command line, called Grunt
2013-02-28 16:58:51
Some folks at Face-book developed a runtime Hadoop sup-port structure that allows anyone who is already fluent with SQL (which is commonplace for rela-tional data-base developers) to leverage the Hadoop platform right out of the gate. Their cre-ation, called Hive
2013-02-28 16:59:50
You can use the Hive Thrift Client within applications written in C++, Java, PHP, Python, or Ruby
2013-02-28 17:01:19
Hive is read-based and therefore not appropriate for transaction processing
2013-02-28 17:03:11
JSON is built on top of two types of struc-tures. The first is a collection of name/value pairs
2013-02-28 17:03:35
The sec-ond JSON structure is the ability to create an or-dered list of values much like an array, list, or se-quence you might have in your existing applica-tion
2013-02-28 17:09:13
The operand used to signify flow from one operand to another is an arrow: ->. Unlike SQL, where the output comes first (for example, the SELECT list)
2013-02-28 17:15:16
Jaql is a flexible infras-tructure for managing and analyzing many kinds of semistructured data such as XML, CSV data, flat files, relational data, and so on

REF:
http://www.ibm.com/developerworks/wikis/display/db2oncampus/FREE+ebook+-+Understanding+Big+Data

2013/02/21

在未參加iOS developer program的前提下,在iPhone/iPad實機上測試開發中app

(Taipei.Taiwan)

該做的正事不認真,寫程式倒是花了不少時間。
今天總算有了點進展,先是把addTags的功能搞定,
再來是加上了Favorites的頁面,可以顯示自己加過特定tags的照片。

有了這些自己想要的功能之後,光是在emulator上測試,
就開始覺得不大過癮,想找辦法把程式放到iPhone上玩。
為了要把app deploy到手機上開發測試,
一般來說,得要加入US$99/year的developer program才可以。
加入了這個program之後,除了可以在真機上測試,
還可以發佈app到AppStore上去。
不過,目前我還沒有這樣的需求也沒有這打算,
因此實在是很不想花這筆錢。
而且,也不確定自己之後是不是還有時間研究iOS...

由於我的手機已經JB了,想說總會有辦法藉此到達我的目的吧。
果不其然,網路上從很早以前就有很多教學在講怎麼設定和patch xcode。
但是…全都好複雜呀:
又要加certificate,又是改plist,還要加入scripts。
只要其中哪個步驟沒弄好,應該就不行了吧。

好在,找到有人直接提供了懶人包的程式,
只要輕鬆按幾個按鈕就可以把所有的patch給搞定。
步驟如下:
1. 下載JailCoder,在Mac上執行它
2. 根據畫面最上方的Guide button操作,把certificate先搞定
3. 按左下方的patch xcode
4. 再按右下方的patch project,選擇自己想要deploy的project
5. 替自己的iOS device裝上AppSync (前提是要先JB)
    AppSync的source repo path下面有,
    把它加到Cydia的軟件源中,再尋找AppSync這支app就可以了

REF:
JailCoder
AppSync Installaion Source:
http://cydia.myrepospace.com/Bl00dra1n

2013/02/20

難搞的oAuth Process和文件不夠清楚的flickr Developer Documentation

(JingMei Bridge.Taipei)

試圖為抓下來的圖片加上一個tag,查了flickr api dev guide,對於這種request應該要使用post method才行。可是flickr上的api explorer還是用舊的token方式,而api說明頁又說得不清不楚,只說舊版的token要deprecated,要用新版的oAuth。卻沒說清楚oAuth的signature要怎麼生出來。

後來又回頭看了幾次oAuth signature的生法,並且在我原本找來做oAuth認識的class中找到相關的code;這才把它們改了一下搬到我需要的logic中。

結果發現用post method還是會有問題,可是我把整串request直接貼給browser竟然可以了!這是說如果用oAuth機制的話,不需要用post method也可以嗎?那我又何必大費周章的去改用NSURLConnection呢?再改回原本的[NSString URLWithString]]就好了。

REF:
gitk documentation
oAuth 簡介

2013/02/18

iOS Programming

(Chamonix.France)

看了幾課教學後,總算是有點小進度了。
不看還不曉得,原來xcode的開發環境這麼完整和方便,
是我太久沒有接觸開發環境了嗎?
感覺上eclipse的android開發環境還是那麼地原始呀。

不過,寫程式常會遇到鬼打牆…
需要花時間…

REF:
Stanford CS193p

2013/02/17

如何快速移除iTunes中找不到檔案的mp3 tracks

(GuYiYuan.Shanghai)
冬陽,雖不暖身
但暖人心

****
之前把mp3加到iTunes時,都沒有選擇copy一份到iTunes中,
因為我的MBP是SSD硬碟,容量沒有大到在裡頭放一堆音樂檔。
但是問題來了,一旦外部的mp3檔被我手賤砍掉時,
在iTunes中常常會遇到播放不了的問題。
iTunes又沒有介面可以很方便地移除這些已經找不到檔案的mp3 track。

網路上找了一下,似乎在Windows上有javascript的解法,
只要下載個js檔,從檔案總管中執行一下就可以;
另外,也有很多要錢的軟體可以幫忙解決問題。
(有沒有搞錯啊…這個也需要花錢去買?)
最後,終於找到了Mac上可以使用的解法:
方法是去下載一個applescript的執行檔,
把它塞到iTunes的scripts目錄下,
再想辦法執行它就可以了。
我一直找不到從iTunes執行該script的方式,
最後,還是直接點了該app,它還是很乖地完成了工作。

現在,iTunes乾淨多了,我又可以放新的mp3進去了。

REF:
Windows:
http://www.makeuseof.com/tag/effectively-remove-duplicate-tracks-itunes-windows/
Mac:
http://dougscripts.com/itunes/scripts/ss.php?sp=removedeadsuper


2013/02/15

我可能不會愛你

 (Hualien.Taiwan)

過年期間,花了不少時間把這部老連續劇看完了。
雖然劇情有點老套,大部分的情節也都在掌握之中,
但是,總會不由自主地一集接著一集看下去,
直到看到結局的那一刻。

李大仁,程又青,在沒有看過這部劇之前,
在網路上頂多只會聽到李大仁,和大仁哥的名字。
看來,陳柏霖真的把這個角色給演活了。
雖然在某些劇情上他演起來還是有點生澀,
但由於角包比較討喜,
大仁哥的知名度硬是比更會演戲的林依晨演的程又青更讓人難忘。

2013/02/12

Water Drop

想用iPad上的Paper畫畫,卻發現自己已經忘了怎麼用每隻筆刷。
試了幾次都得不到自己想要的效果,
最後還是只能回到用Brushes來畫。
一開始還有些不習慣,一直想用用兩隻手指來redo畫錯的部分,
不過,沒多久又找回了之前的感覺。
單純地利用color picker來選畫面上的顏色,
然後透過淺透明度來不斷地抹平色塊。

放大來看,老實說,離真實的水滴還有好大的距離。
不過,縮小看起來還不錯就是了。

得再去多找些paper和brush的教學來看看了。

騎士團長殺人事件 --村上春樹

今年的日文小說看完了。篇幅很長,但規模不大,故事都繞著幾個主要的人物。情節裡有些超現實的場景,但最後卻讓人有點意猶未盡,因為有些想搞懂的疑點,在還沒講清之前就結束了。