Sunday, November 21, 2010

Galaxy S capture Screen 方法 (Android)

在Galaxy S 度capture screen

按住BACK, 然後按HOME

就會有個toast box 寫住螢幕己擷取

然後在Internal SD -> Screen Capture 中找到的了

如果你不是 Galaxy S 用家, 而又用到, 請REPLY

Labels: , ,

Friday, November 19, 2010

ASP.NET Maximum Length Exceed Exception

找了好多google, 都話override 個begin request 就可以handle 到
但我公司的cms 都總是炒 ....


今日再看 ...
eee... 原來.. 是因為 trace ....

閂左. done!

Wednesday, November 17, 2010

The Story of Electronics (2010)


講得好

Authentication between Client and Server

剛才在諗有咩方法唔send password 下可以authenticate

Cilent request Server (Parameters: username)
Server generate a random key, encrypt with user password (plain text / hashed)
Server return the key
Cilent decrypt the password using her password (plain text / hashed)

咁樣大家就會shared 到個secret key
大家溝通就靠secret key
adv:
man in the middle attack: no
replaying attack: no (條random key 會有限時)

disadv:
not practical in http
server may have heavy loading (as key per client)

Tuesday, November 16, 2010

Full text
select * from (Select * from abc) as t1 where contains(t1.abc, 'def') 係會死的

Monday, November 15, 2010

Alpha Gradient

 重要野, 記低先 ... 
 
Read more »

Sunday, November 14, 2010

自制 FM 天線

根據這個網站 : http://www.mobile01.com/topicdetail.php?f=496&t=99913&p=1&cache=0

因為家住低層, 香港大厦林立, FM (主要是 90.3) 總是收不到 .... 沙沙聲, 聽唔到

所以今日弄個自制FM 天線

用了一個 放在 MON 後良久的KB 盒, 入便畫線
(300000 / 90.3 * 0.96 ~= 3189 mm ~= 3.18M)  確實冇咁大 ...
所以除了 32 ~= 10 CM... 然後根據那網站畫線, 再用條電線定型

再介個出線口,在蓋頂貼上錫紙..然後放在窗口

雖然仍有些沙沙聲, 但算聽到的了 = = 

Labels: ,

Saturday, November 13, 2010

大澳


大澳都有好景色 :D
Posted by Picasa

Friday, November 12, 2010

Notification In Android App (二)

原來google api 好多寶, 但佢個結構設計太差了

String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
 
int icon = R.drawable.notification_icon;
CharSequence tickerText = "Hello";
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, tickerText, when);
 
Context context = getApplicationContext();
CharSequence contentTitle = "My notification";
CharSequence contentText = "Hello World!";
Intent notificationIntent = new Intent(this, MyClass.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);

notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
 
private static final int HELLO_ID = 1;

mNotificationManager.notify(HELLO_ID, notification);
 
 
更多資料就繼續看吧 
Read more »

Labels:

Toast 方法

想要display 這類message 好簡單  
 
Read more »

Labels:

Galaxy S 看 mytv 的方法


在其他machine, 是用 about:debug, 但我在galaxy s 試過都找唔到
再問問google 大人
原來是用 about:useragent 



以後可以看mytv 了 

PS: 但係睇近排的片, 因為質素高問題 .... 窒 = = 

Labels:

Thursday, November 11, 2010

頭獎機率

中頭獎機會 = (1 / 49 / 48 / 47 / 46 / 45 / 44)
連續買n 期六合彩都唔中的機率 = (唔中頭獎機率) ^n = (1 - 中頭獎機會) ^n
如果想 買n 期六合彩都唔中的機率 細過 0.5, 就要買 2^33 次 (用電腦的CALC 可以POW 兩次65535 再SQUARE) = 8589934592期 ......

都係今晚再發下夢

Labels:

Notification In Android App

今晚再看 ... 來源

當我們寫好一支程式, 尤其是常駐型的程式,
多半我們要通知使用者, 除了鈴聲、振動外, 最常使用的應該就是在狀態列上
顯示所要表達的內容文字, 並且讓使用者可以點選後, 執行該相關的程式

底下是如何把訊息顯示在狀態列上

Read more »

Labels:

Wednesday, November 10, 2010

羅技無線太陽能鍵盤 K750


就是先前發表的那隻無 線太陽能鍵盤囉!雖然美國人已經寫了個簡單的開箱,但什麼也比不上自已親自打開來試用的感覺,不是嗎?Yeager 大有提到過說至少三家廠商有做過太陽能的鍵盤,不過這是小薑玩到的第一個,所以仍然是新鮮感十足。羅技在這把鍵盤上特別強調節約、環保的概念,這不僅體現 在它是太陽能的這點,連包裝 K750 都非常地環保,這點等一下可以看到。準備好了嗎?讓我們一起來看看這隻鍵盤吧!
來源: Engadget

如果真的不用電, 我都想買...

Labels:

漢王搶彩色 e-ink 電子書閱讀器頭香,是 10" 觸控螢幕機種

Read more »

Labels:

一朵在海濱公園的花

Labels:

Tuesday, November 9, 2010

雖然我唔咁覺得.....

Labels:

筆電才是殺蟲劑

「筆電」的英文字有兩個:小台點的習慣叫「Notebook」,而大台的習慣叫「Laptop」-- 後者很明顯地隱含著讓你放在大腿上用的意思。問題是,筆電放大腿上所散發出來的無限熱力,對同樣在那附近的男性敏感部位來說,想必不是什麼好事吧?畢竟天 氣一熱就會懶散,可是人之常情啊!

現在我們有了真實的實驗數據來佐證這一點了。跟據最近在 Fertility and Sterility 期刊上刊出的一篇新研究顯示,將筆電放在大腿上使用,會讓你的外接式精蟲產生器的運作溫度上升,但原因並不只是附近有熱源這麼單純。事實上,更大的問題是 為了保持筆電的平衡,將筆電放在大腿上使用時,人們會不自覺地夾緊兩腿,而會導致子孫袋通風不良,因而容易過熱。所以以這個研究結果來說,膝上型散熱墊或 許對降低筆電溫度有良效,但對悶在大腿中間的小老弟(們)卻是幫助不大。

更糟糕的是,實驗結果顯示大部份的受測的人在使用中並不知道自已的小寶貝們已經在熱當的邊緣上(這點跟一般人使用電腦很像,噗)。所以唯一安全的保證,就是別把筆電放在大腿上,乖乖的找張桌子工作。當然,這樣是更保險啦~

 來源 : Engadget

Labels:

\uXXXX 的取代法

事緣有個project, 佢地send 黎d data 的中文字都是用 \uXXXX 的方式存在
佢地又死都唔肯改

咁點樣解決呢 ?

用c#度打 "\u5b89\u672c\u74b0\u7403\u4e9e\u592a\u80a1\u7968\u57fa\u91d1",
e ... 好正常咁出到 "安本環球亞太股票基金"

Read more »

Labels:

幾時先可以再去多次日本呢 ...

防止被logout 方法 (anti lock mouse)

返得工多, 遇得多server, 都總會遇到 行開一陣就被screen lock,
如果有個batch job 行緊,重可能被強行 logout
但我搵極都搵唔到方法reset佢
結果就寫左個program
個program 其實好簡單
定期去移一移隻 mouse
但遇到個問題, 應該幾耐郁一次, 郁幾遠呢 ?
我冇深究這問題, 但幸運地, 佢令到個server唔會auto lock .... :D

有興趣可以自己抄一份

Read more »

Labels: , ,

將html 變成 image

因為某一part 工作係要將個 email 變成pdf,
而email本身係html format, 咁應該點轉成 pdf 呢 ?
結果就寫左以下這個tools, 利用.net 本身的ie core
將html 變成一幅image, 然後再變成pdf
當寫順左就會好好用

但出了問題, pdf 容許放大文字的
但轉左做image 後, 放大就會起格仔
解決方法:在整個image 時, 變成 2 倍闊 ...
雖然只是治標, 但夠使 ...


Read more »

Labels: , ,

clone mssql database with full text catalog

總會有些project 是用到 full text catalog
好地地launch 左之後, 個user report, 點解個 search 冇反應架 ...

原來個user 就咁copy個mdf + ldf 就算
但佢有個好重要的東西叫 full text catalog
如果只是一個db 就好地地
兩個db 用同一set full text catalog 就會lock 死了 (都唔明microsoft 唔識detect 這些問題)
所以在copy database 時要花d 工夫, 連full text catalog 都要copy 埋出黎

確實microsoft msdn 有這段tutorial ...programmer 都應該要看看

Read more »

Labels: ,

read the xml by relative path to flash

CMS 網站的flash 總會要求可以edited by cms
所以寫flash時都要support load 一d xml
但是flash 在 local 行同在 server 又是兩回事
因為flash 個path 係根據個webpage 的path
所以在寫as 時就要加返d 心思


Read more »

Labels: ,

無眠

2 點幾醒了, 在想著賺大計 ....

每端端經google checkout 買左個 heeae.com 這個 domain,

1 年 10蚊美金, 還可以吧