~经言/歌词~

I find that the harder I work, the more luck I seem to have.
~ Thomas Jefferson (1743-1826)

Tuesday, November 29, 2011

Home Guard

Do you have any idea what is the term Home Guard meant? Yupe, for those who are very good or were very good with our country history, Home Guard is a familiar term to them. But sorry lah, as for me, I had no idea what the term meant until this morning, when I checked with my sister who just sat for her PMR. Home Guard was actually a team of people team up to patrol the village during the night curfew when communists were active back in the days. 

Why am I checking this term? Well, the story started with my grandfather, who already passed away, was one of the member of the Home Guard, and his friend heard of the news few days ago saying that the Home Guard or their partners (if the Home Guards already passed away) can register themselves to claim for, I dont know, maybe payment, maybe fund. Well, this isnt the first time already, my mother told me that they had done it about 10 years ago, and claimed RM1000. Seriously, I had no idea about this, yesterday was the first time I ever heard of this claim.  

And since I am at home, I got the work to register for my grandmother, and the registration center is set at Police Station. But seriously, I only knew that my grandfather was a some kind of night guard during that period and how in the world I was supposed to explain to the police why I was there? I had no way to turn to, then I realized I can actually check with the history books, and since my sister just finished her PMR, and she is proud with her history results all the time, I should probably ask her. She checked, and found the term, Home Guard, I wasnt so sure about that, but at least, I got a term, and it is better than I go to the police and yi yi ye ye, confusing the police. Luckily, it turned out that my sister was right, before I even speak it out, the stationed policemen spoke it out when I only said the word "register...". 

Therefore, for once in my life, the first time I ever stepped in the police station, was to register for the claim for the Home Guard for my grandmother, she is the beneficiary.  

Now I only realize how amazing these old folks in receiving news!!! The newspapers never mentioned a thing, I think, and no letters received, yet these old folks are still able to know when to register, where to register. Hand up!!!



Wednesday, November 23, 2011

Android: Splash Screen

I guess almost every app has its own splash screen, maybe by showing the title of the app in an interesting way, or promoting own company or own production, but an interesting splash screen had became a must-have component to show some sophistication of the product.

As usual, starts with creating a new project. 
Remains the originally created .java file and main.xml file untouched.


We need a splash screen page and a main page, and since we already had the main page when we first created the project, we need to create another class file for the splash screen page.

Hence, the next step is to create a new layout and a new page for the splash screen. Dont forget to include an image into the @drawable folder. I named the layout as splash.xml.


After that, i create a new page for the splash screen and i named the class file as SplashClassApp.


Splash screen will disappear itself after few seconds, hence, we need to apply Thread activity to initialize the splash screen activity. In the code above, the splash screen will display for 5 seconds, sleep(5000), and once it is done, the app will continue with the next activity which is showing the first page of the app, by the codes below,

One thing to bear in mind, when we first created the project, the originally created page will always serve as the first page to be displayed when we execute the app. Splash screen however should display before anything else, so now, we need to change the manifest.xml, to alter the order of the page displaying.


And that's it. You will have ur app with a nicely designed splash screen!!!



Monday, November 21, 2011

20-11-2011

昨天,是11月20日,其實我一直都不知道昨天是有著這麼一個意義的日子, 20-11-2011,兩個2011,難怪昨天那麼多人擺喜宴,而且還都是下午1點正入席!!

我一位中學的朋友就在昨天結婚擺喜宴,也因着他的大日子,我們幾個中學朋友有個機會見見面,聚一聚,不然每一年都是只有在年初二的同學會上見一次。不要誤會,我不是特別熱衷於一定得有個聚會,和老朋友見面的人,但是前天和昨天和朋友見面的氛圍,其實還真的挺不錯的。大家說說笑笑,也少提大家工作生活上的事務,有時開開黃腔,大家都不提自己生活上的壓力,朋友聚一起,沒有比較,沒有吹水,也沒有晒命,大家就開開彼此的玩笑,聊聊一些小八卦,例如,誰誰誰拍拖了,誰誰誰分手了。雖然有點對不起結婚的朋友,因為我們基本上就是把它當成一個同學聚會,新郎哥其實也沒有時間和我們一起胡扯,哈哈。喜宴的散場,就也代表我們同學會也該散場了,大家都說,明年見!是啊,就是明年同學會再見面了。

大家都有各自的生活腳步,面對不同的生活人際壓力,久久一次的見面,把自己原本生活上的一切暫時拋在腦後,忙裡偷閒,也挺不錯的。

喜宴散場回家後,我很累,我也不知道我為什麼那麼的疲倦,但是我又接到一個教會朋友的電話,問說晚上要出來喝茶嗎,因為有朋友從KL回來,即將結婚的朋友。我拒絕了這個朋友在上個星期五的邀約,再拒絕的話,其實就真的不大好,所以,我也只能點頭了。和中學朋友不一樣,昨晚出來的朋友,都是一雙一對的,都結婚了和即將結婚的,只有我單身,而且當中又有懷孕的,話題和中學朋友就真的不是同一個等級的了。中學朋友,就是聊聊當下的事情,天寬地闊的聊。和教會的朋友,已經踏入人生第二階段的他們,聊的,既然就是結婚,兩個人生活,孩子類似的話題,我的天,我還真的有點格格不入呢。

不過因為我和即將成為新娘的朋友很要好,所以基本上我就只能和她聊了,有不少的想當年,哈哈。但是基本上還是不錯的,這一聊,也是晚上8點多聊到將近12點。

20-11-2011,對我來說基本上是沒有什麼意義,其實它也沒有什麼意義,就是有點紀念象徵性,就是特別的一個日期。但是在這個我認為沒有意義的日子,我卻過得還蠻有意義的,一天,和兩班不同的朋友見見面,找回一些我們認為已經遺失的東西,原來我們以為生疏了的友情,其實只要一個簡單的見面聊聊天,其實我們就能找回當年大家吵吵鬧鬧,哭哭笑笑的日子了。

不是每段愛情,都能一輩子;但是一些友情卻是,一輩子的。

這是我第200篇文,我也很久沒有寫寫自己的生活故事了,這篇文,我就獻給我的朋友們,我也許是個冷淡的混蛋,但是就像我說的,有些友情,其實是一輩子的,也許沒有常見面,常聯絡,但是只要有個機會聚在一起,一切,都有可能回到當年我們瘋狂吵鬧的日子。

時間會遺失,但是它留下了痕跡;
記憶會模糊,但是它刻下了永恆;
熱情會冷淡,但是它創造了悸動;
過去,也許是真的過去了,
但是只要我們回頭看,
過去,也許就還歷歷在目,
有些事情,真的,
是一輩子。






Friday, November 18, 2011

張衛健 -月圓了

“我什麼都沒有,只是有點吵
如果你也感到寂寞,我帶給你熱鬧...”

對張衛健的印象,自然大多都是來自於他主演的的電視劇裡的痞子形象。我個人其實是非常排斥痞子風格,每回看到以痞子形象為主的電視劇,我的心總是癢癢的,總想一拳打在他們臉上,呵呵。

既然是自己的電視劇,張衛健自然有時不只現身,還獻聲,唱唱片頭片尾。對於張衛健的歌,我印象最最最為深刻自然就是這篇文一開始的那首了,《你愛我像誰》。查過了,張衛健其實也出了蠻多張的專輯了,但是,我基本上也沒有什麼印象,較有印象的可能就是那些片頭片尾了。

雖然張衛健主演的角色老是給我一種吊兒郎當的感覺,但是他唱起歌其實一點也不郎當啊,感覺上句句都是穩打穩紮的,唱進我心,沒有電視裡的吊兒郎當。唱歌的張衛健給我一種成熟穩重的感覺,他的聲音其實是厚實,感覺上一句一句打樁似的,慢慢的滲進人心。

揮別5年,張衛健在7月帶著全新的專輯《月圓了》回返樂壇。

月圓了,第一個感覺就是中秋了。至於中秋了,最讓人有所感發的自然就是,回家。

《月圓了》這歌其實就是述說那些在外為生活奔跑的遊子們想家的心思。身為藝人,回家成了他們最奢侈的想法,這歌,不只是唱出了遊子的思鄉之情,更唱出了張衛健自己四處奔走而不得回家和家人聚聚的無奈。歌詞裡有幾句唱的非常的好,

年少还不懂离别 只想飞的更远
一心只想着外面的世界
长大以后才发现 家已离得很远
突然有想哭的感觉


《你值得我等待》,副歌的第一句給我一種在2008中國奧運會時推出的奧運歌,那種,情緒高昂澎湃,拼勁十足的感覺。雖然有點突兀,但是感情裡,其實有時候就是需要這種勇往直前的一種拼勁,《你值得我等待》,顧名思義,自然就是得勇敢堅持!我覺得這歌還真的不錯!只是,這MV怎麼,是和狗的互動啊??!!


《一夜年少》找來了梁漢文合唱,他們之間的友情在圈內圈外都為人熟之。年少時一起玩樂,受罰,歡笑,哭泣的玩伴,長大後,是不是還是那個不變的朋友呢?是不是當兩個人各奔前程時,回頭依然還看得見他的背影呢?這歌唱的,就是一輩子的朋友,一個當全世界背叛你時,還有個朋友默默的站在身邊,支撐你走下去!張衛健和梁漢文的聲線竟然如此的搭,我還真的聽不出那個是哪個聲音。


這張專輯其實還真的很不錯,沒有華麗的技巧,沒有高亢的高音,只有淡淡,溫和的唱出思鄉,對愛的堅持,豁達,友情的慶幸。

【專輯曲目】:
01. 月圓了
02. 你值得我等待
03. 對她好一點
04. 如果你只是怕寂寞
05. 抄首情歌說愛你
06. 一夜年少
07. 如果我們堅持下來走到今天會怎樣
08 我的秘密情人
09 一夜年少(獨唱版)
10 她的微笑
11 嘻嘻哈哈





Wednesday, November 16, 2011

Android: Flipping Gestures Activity

Flipping feature, I guess that is a feature that is inevitable to all touch screen apps. It is very cool to see the pages changed just by a fling, buttons no longer required. Sometimes, buttons could be very tedious!!!

As for android programming, in order to perform the flipping gesture, the best way of doing it is to include the OnGestureListener. However, be aware of the library to be imported, there are two libraries contain this listener with different implementation, which is the android.view.GestureDetector and android.gesture.GestureOverlayView. You should import android.view.GestureDetector in the project.

Since OnGestureListener is a interface class, there are several functions you need to include into your project, whether you like it or not.
  • boolean onDown(MotionEvent e) 
  • boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
  • void onLongPress(MotionEvent e)
  • boolean onScoll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
  • boolean onShowPress(MotionEvent e)
  • boolean onSingleTapUp(MotionEvent e)
Since this post is working with the flipping feature, we will only work with onFling function.

First of all, starts with a simple layout.


As you can see from the layout above, a new component, ViewFlipper is included into the xml declaration file. ViewFlipper is working as a flipper that contains the multiple views of your design. From the layout above, I created three TextView where each represent different pages when I fling my apps later. 


As usual, declare a ViewFlipper instance in the main file.


After that, in the onFling() function, add the code below,

velocityX is indicating the x-axis coordination when you fling, if you fling to the left, velocityX is less than 0, therefore it will show the previous page, it shows the next page otherwise.



android.R.anim.fade_in and android.R.anim.fade_out are animation moves that provided by android itself. These animations help to show an animation movement when we fling the pages. Refers here for more animation movements.

If we only included the codes above, it wasnt done yet! The codes above are written for the when a fling gesture detected. However, how did a touch screen device detect the fling or scroll, or other gesture activities? 

In android programming, we need to declare GestureDetector instance to detect the gestures that were applied to the screens. Includes the codes in the red boxes into the onCreate() and creates new function onTouchEvent(). 


That's it!!! You can now fling your apps!!!


Tuesday, November 15, 2011

許茹芸 - 許茹芸的微醺音樂,你聽見了(我)嗎?

我忘了我第一次聽許茹芸是什麼時候了,但是我記得那時是因為《淚海》這歌才認識了許茹芸。但是我對許茹芸的印象一直就停留在《淚海》這歌。當然不是說許茹芸後來的歌不好聽,只是實在不是本人的那一杯茶啊。

許茹芸的芸式唱腔,輕輕飄飄的,用著氣音柔柔的唱出每一首歌,可能是因為這樣的唱法讓我每次聽得昏昏欲睡,所以我就下意識的少聽許茹芸的歌,但是我還是有比較喜歡的一些歌,例如,《獨角戲》,《心得》。

許茹芸最近推出了一張翻唱專輯,《許茹芸的微醺音樂,你聽見了(我)嗎?》。

我覺的這專輯名稱取得還真的是很貼切,整張專輯聽下來,爵士的慵懶,舒服,真的就有微醺的感覺。聽著聽著,感覺自己就好像閉著眼,微微搖晃著手裡拿的一杯紅酒,慵懶的躺在一張黑色沙發上,偶爾微微伸展自己的肢體,彷彿自己就好像生於歐洲中世紀的貴族。



專輯歌單
1. 夜。微醺
2. 老實情歌
3. 巴黎草莓
4. I wanna be loved by you
5. 浪人情歌
6. 只愛陌生人
7. 藍色啤酒海
8. 春光乍泄
9. 秘密
10. 向前走

我絕對不是爵士的粉絲,但是這張專輯卻很合我的胃口,可能是新的編曲的關係,打翻原先對這些歌的印象,有種既陌生又熟悉的感覺,所以我還蠻喜歡這裡頭的歌。

這兩首歌是我這專輯裡最喜歡的,其實還有《老實情歌》,但是youtube裡找不到,就算了吧。

許茹芸 - 秘密

許茹芸 - 向前走


Thursday, November 10, 2011

Android: Font Style

Tired with all the common fonts provided originally by Android code? Well, we can always do some alterations and bring some fun in it!

Default Font Types: 
There are five font types provided by Android, DEFAULT, DEFAULT_BOLD, MONOSPACE, SANS_SERIF, and SERIF. In order to change the font style, one can add android:typeface attribute into the XML declaration file of the components that support font styling, TextView for instance.




Other Font Type:
Do not like any of these default font types? Wanna something different and eyes catching font? Sure, get the ttf file of the font you wanted, and place it in ./assets folder (normally it is auto generated when you create a new project, else, create one manually). In this example, I downloaded a font here, named JoeHand2. Since we are going to apply the custom font, we do not include android:typeface into the TextView declaration like  what we did above.

Then in the onCreate() method, add the codes below:



Font Size:
Wanna change the font size? Sure you can, add android:textSize attribute into the XML file. There are several commonly used units, sp (scale pixels), px (pixels), dp (density-dependent pixels)



Font Style:
Surely we cannot forget one of the biggest attributes of a font, the typical font style, NORMAL, BOLD, and ITALIC. Add android:textStyle attribute, and the available values for this attributes is "normal", "bold", "italic". You can also specify "bold|italic" to apply two styles at once.


Font Color:
Sick with only black and white font colors? You can make a different too! Add android:textColor attribute!


Text Shadow:
Whenever I design with Photoshop, I am super thrilled with all the appearance properties provided by Photoshop. Though I had been complaint a lot about not to "shadow" everything, I just cant get enough!! 
There are four properties used to customize the text shadow.
  • android:shadowColor
  • android:shadowRadius
  • android:shadowDx
  • android:shadowDy
Unlike FontSize attribute, these attributes do not require any specific unit 


That's it!!! Now you can change the font properties whenever you like!!

Wednesday, November 9, 2011

兩瓶礦泉水 訓練全身肌肉

羨慕別人強壯的身體嗎? 沒關係,我們一步一步的練好肌肉。



上臂二頭肌的鍛鍊

1.雙腳與肩同寬站立,雙膝稍微彎曲,上腹部用力,把肌肉縮緊,背部挺直。雙手垂於身體前,各握一重物,如水瓶或書本等。

2.彎曲手肘,慢慢將重物舉起到肩膀的高度,保持這個姿勢,再慢慢把手放下,回到原來的姿勢。每次大約持續做12到15次。

上臂後方肌肉及三頭肌的鍛鍊
1.gif
1.站直,雙腳打開至與肩同寬,腹部用力,把肌肉縮緊,背部挺直。單手握一重物,先高舉過頭部,再將手肘彎曲,將重物至於頭後方,此時舉起的上臂要與身體成一直線。
2.伸直彎曲的手臂,使整隻手臂與身體成一直線。保持這個姿勢大約幾秒後再回覆到原來的姿勢。每次大約重複做15到20次。

肩部三角肌的鍛鍊
2.gif
1.上身挺直,膝蓋張開與肩同寬並微微彎曲,雙手各拿一重物,如水瓶或書本,垂放於身體兩側。

2.緩緩將雙手水平側舉至與肩平行,持續一會兒後,再緩緩將雙手放下至原來姿勢。每次大約持續做12到15次。

背部肌肉的鍛鍊
3.gif
1.雙腳與肩同寬站立,雙膝稍微彎曲,彎下腰讓上身與地板平行,雙手各握一 重物,如水瓶、書本等,自然下垂,與地面垂直。  

2.上臂往側後方提高,到與地面平行的位置,此時握著重物的雙手位於胸前或胸側,雙腿仍保持原來姿勢。保持這個姿勢一會兒,再將雙手慢慢放下,回到原來的姿勢。每次大約持續做12到15次。

胸肌的鍛鍊
4.gif
1.伏地挺身是在沒有任何器材時最好的健胸運動,方法如下:面向下,以手掌撐著地面,雙手伸直,略比肩寬;雙腳伸直,以腳尖頂著地面,以手掌和腳尖支撐身體的重量。


2.雙手彎曲,讓身體平行下降,接近地面或輕觸地面,以這個姿勢暫停一下,再伸直雙手回到原來的姿勢。每次大約持續做12到15次。

腹部肌肉的鍛鍊
5.gif
1.仰臥起坐是在沒有任何器材時,最好訓練腹肌的運動,方法如下:臉朝上平躺在地上,背部打直,雙腿彎曲,雙手放在頭兩側。

2.用力將肩膀往膝蓋處伸展,維持此姿勢一會兒,再徐徐回到原來姿勢,特別要注意起身時吐氣,下來時吸氣,重複約20次。

大腿肌肉的鍛鍊
6.gif
1.站直,雙腳打開至與肩同寬,雙手握著力量可以負擔的重物,如裝滿水的礦泉水瓶或字典等,將它們舉到與肩同高,腹部用力,把腹部肌肉縮緊,背部挺直。


2.屈膝,彎曲角度不可超過90度,以免膝蓋和背部受傷;上身仍保持挺直,這個姿勢大約持續幾秒後再回覆到原來的姿勢。每次大約重複做15到20次。

文章來源: 這裡