Friday, October 15, 2010

Development Workflow of Yii Framework


This article is just for reference. All credit goes to http://www.yiiframework.com/doc/guide/basics.workflow

Development Workflow

Having described the fundamental concepts of Yii, we show the common workflow for developing a web application using Yii. The workflow assumes that we have done the requirement analysis as well as the necessary design analysis for the application.

  1. Create the skeleton directory structure. The yiic tool described in Creating First Yii Application can be used to speed up this step.
  2. Configure the application. This is done by modifying the application configuration file. This step may also require writing some application components (e.g. the user component).
  3. Create a model class for each type of data to be managed. The Gii tool described in Creating First Yii Applicationand in Automatic Code Generation can be used to automatically generate the active record class for each interested database table.
  4. Create a controller class for each type of user requests. How to classify user requests depends on the actual requirement. In general, if a model class needs to be accessed by users, it should have a corresponding controller class. The Gii tool can automate this step, too.
  5. Implement actions and their corresponding views. This is where the real work needs to be done.
  6. Configure necessary action filters in controller classes.
  7. Create themes if the theming feature is required.
  8. Create translated messages if internationalization is required.
  9. Spot data and views that can be cached and apply appropriate caching techniques.
  10. Final tune up and deployment.
For each of the above steps, test cases may need to be created and performed.

Wednesday, August 11, 2010

[Ubuntu] How To Restore GRUB - Problem With Reloc Offset Is Out Of Segment

My Ubuntu 10.04 suddenly cannot boot after the update process... I suspect that the BOOT Record is messed up or the Boot Manager is corrupted, but I have no experience in dealing with this problem in Ubuntu...so I google it..and found a solution from
http://forums.linuxmint.com/viewtopic.php?f=46&t=41555

The solution is as below:

Just had the same problem, which was specifically thanks to Dell DataSafe. First encountered the problem when Dell DataSafe did an update and restart and then Grub bailed at a very early stage leaving me with no interaction with the system at all.

After the panic subdued, and many hours googling, a restoration of Grub solved the problem. First thing I did after that was to log in to Windows 7 and uninstall Dell DataSafe - which of course, borked my MBR again! Doh! Thankfully, its a painless process to restore the mbr once I knew what I was doing.

Always read the more detailed topics for thorough advice, but Ill outline the solution that worked for me in case it helps others:

1. Boot up from live CD.
2. Open terminal.
3. Mount linux partition - sudo mkdir /mnt/mint; sudo mount /dev/sdb1 /mnt/mint (Needed in order for grub-install to work).
4. Restore grub to the mbr: sudo grub-install --root-directory=/mnt/mint /dev/sda

This installed a fresh copy of grub into the mbr but did not seem to pick up the correct configuration - on reboot, I at least managed to get to a grub> prompt rather than it just aborting, but there was no dual boot menu. Some research on manual booting taught me the following for booting from grub:

4.9 If you do not know which partition grub/kernel is installed on, use "find /boot/grub/stage1" to let grub locate it for you. This should return a partition locator in the form, (hdx, y). Use this value in the following commands.

5. root (hd1, 0)
6. "kernel (hd1, 0)/vmlinuz ro root=/dev/sdb1" - vmlinuz will autocomplete.
7. "initrd (hd1, 0)/initrd" - initrd will autocomplete.
8. boot

This booted my Linux Mint install... and helped me relax a bit. :) The last steps I had to do were:

9. Once booted, open a terminal.
10. sudo update-grub2 - this regenerates the grub config data. This might not be needed, but I definitely did it so Im not sure if its essential. Its likely the previous config was still OK I think.
11. Restore grub to the mbr again with sudo grub-install /dev/sda - since we are booted/running from the correct install, there is no need for --root-directory.

After this, my system was restored. Im sure there might be some steps that arent quite essential, and probably a slightly more efficient solution, but it worked for me.

Tuesday, August 10, 2010

How to Upgrade From Discuz! 7.0 -> Discuz! 7.2

第一步:

将下载的压缩包解压,将解压后upload目录下的文件和目录(除了install目录和config.inc.php文件之外)上传到论坛根目录

第二步:

将解压后 utilities目录下的d70to72.php文件上传到论坛根目录,然后在浏览器地址栏输入http://你的网站地址/d70to72.php,运行升级文件,升级文件会自动运行,运行完毕后会提示升级成功,升级完成。

第三步:

访问论坛后台工具 ——更新缓存里面更新缓存,升级完成。

温馨提示:升级前已经要做好文件和数据库备份,以防万一。

Saturday, August 7, 2010

Monday, August 2, 2010

Configuring Ubuntu

Softwares installed:
(Through Ubuntu Software Center)
Adobe flash plugin

X-pdf

Teamviewer


Command Line(sudo apt)
Sysinfo -> sudo aptitude install sysinfo

avast! antivirus -> wget http://files.avast.com/files/linux/avast4workstation_1.0.6-2_i386.deb
-> sudo dpkg
avast4workstation_1.0.6-2_i386.deb


scim -> sudo apt-get install scim-qtimm im-switch scim-pinyin
-> $im-switch -z YOUR LOCALE -s scim # replace "YOUR LOCALE" by something like "en_US.UTF-8"

VMware Workstation -> BUILD essential 1st with the following command:
sudo aptitude install build-essential linux-kernel-headers linux-kernel-devel
-> gksudo bash ./VMware-Workstation

Monday, July 19, 2010

New life begin.

Hope that everything goes smoothly.
Ignore what other people said,
do what i want, go for what i want.

Sunday, June 27, 2010

Lavera Naturkosmetik Products

What's the right organic skin care product for me?

Here are some organic skin care product recommendations for you based on your skin type:

Skin Type:

Normal / Combination

Oily / Acne

Sensitive

Dry /
Mature

Allergy / Eczema / Dermatitis

Damages / Aging / Wrinkles

CLEANSER

Calendula
Cleansing
Gel

Mint
Cleansing
Gel

Aloe
Cleansing
Milk

Wild Rose
Cleansing
Milk

Neutral
Cleansing
Gel

LAVERE
Power Cleanser

EXFOLIATION

Calendula Exfoliating
Wash

Mint
Exfoliating
Mask

Energy Effect Mask
(Use once every 2 wks)

Wild Rose Exfoliating Wash

Use
Exfoliators Sparingly

Wild Rose Exfoliating
Wash

TONER

Calendula
Toner

Mint
Toner

Aloe
Toner

Wild Rose
Toner

Aloe
Toner

Wild Rose
Toner

DAY
MOISTURIZER

Calendula
Balancing
Cream

Mint Moisturizing
Fluid

Aloe Moisturizing Fluid

Wild Rose Moisturizing Cream

Neutral Facial Fluid
(Normal /
Combi. Skin)

Neutral Face Cream
(Very Dry Skin)

LAVERE Power Royal Day
SPF 5

EVENING MOISTURIZER

Wild Rose
Liposome
Cream

Calendula Balancing
Cream

Aloe
Protection Cream

Wild Rose
Liposome
Cream

Neutral Face Cream
(Very Dry Skin)

LAVERE Power Royal Night

EYE CARE

Wild Rose
Eye Gel
(Puffiness)

Energy
Cool Eye

(Puffiness)

Wild Rose
Eye Gel
(Puffiness)

Energy
Cool Eye

(Puffiness)

Wild Rose
Eye Gel
(Puffiness)

Wild Rose
Eye Gel
(Puffiness)

Power
Eye Glow

(Fine Lines / Wrinkles)

Wild Rose
Eye Gel
(Puffiness)

Wild Rose
Eye Gel
(Puffiness)

Power
Eye Glow
(Fine Lines / Wrinkles)

SPECIAL TREATMENT

LAVERE Energy Lift
(Fine Lines / Wrinkles)

Blemish Stick
(Spot Treatment & Concealer)

Blemish Stick
(Spot Treatment & Concealer)

LAVERE Energy Lift
(Fine Lines / Wrinkles)

LAVERE Energy Lift
(Fine Lines / Wrinkles)

** Avoid using too many products on this skin type

Power Glamour
(Fine Lines / Wrinkles)

Power Lip Expert

MASKS

Wild Rose
Moist. Mask

(Dry Skin)

Mint
Exfoliating Mask

(Deep Exfoliation)

Mint
Exfoliating
Mask

(Deep
Exfoliation)

Wild Rose
Moist. Mask

(Dry Skin)

Wild Rose
Moist. Mask

(Dry Skin)

Wild Rose
Moist. Mask

(Dry Skin)

Test Patch
First

Wild Rose
Moist. Mask

(Dry Skin)

Thursday, January 21, 2010

如何治療打嗝

最近狂打嗝, 不知道是吃到味精還是怎麼樣...可能是少了老婆的照顧, 身體也不聽話了. 只好自己上網找找有關這方面的資料, 順便看看自己能不能把打嗝停止. 然後就發現了下面這篇文章.

(轉自中藥網原出處)

打嗝,醫學上稱「呃逆」,是膈肌不自主的間歇性收縮運動,空氣突然被吸入呼吸道內,並伴有吸氣期聲門突然關閉而發出一種特別的短促聲響。膈肌連續收縮使胸腔內壓力減低,可產生胸內的不適感。健康人受精神刺激或快速吞嚥乾燥食物而同時較少飲水,可發生呃逆,但能自行消失。

情況一
進餐時,你還會喝礦泉水、果汁或其他飲料麼?

如果你喝了很多飲料,把胃塞得滿滿的,就沖淡了消化液,消化液濃度越低,打嗝就會越重。

建議:
吃飯時最好不要喝水或者其他飲料。

情況二
頭痛時,你是否服用過治頭痛的「冒泡」藥片?

有些藥片,例如阿司匹林,溶解在水裡會冒出碳酸氣。這種碳酸氣會引起打嗝。

建議:

在服用阿司匹林等易冒泡的藥物的同時服用凝膠,它能擊碎大的碳酸氣泡使其變成小泡,容易被血液吸收,並迅速在胃裡破滅。

情況三
喜歡充氣飲料嗎?中

從香檳酒瓶或者可樂罐裡衝出來的壓縮氣體以同樣的力量從消化系統冒出來。

建議:
忘掉這類飲料吧,不要喝用吸管的飲料,不嚼口香糖。這些東西讓消化系統充滿過量空氣,從而引起打嗝。

情況四
有什麼事讓你焦慮不安嗎?

當你處於精神壓力大的狀態,身體對氧氣的需求就會增加。結果,就會像魚那樣機械地用嘴吸進很多空氣,引起打嗝。

建議:
來一杯含氧雞尾酒或充氧礦泉水補充氧。

情況五
剛剛喝過熱咖啡或熱茶嗎?

美國鹽湖城大學的科學家證明,熱湯熱飲料的蒸汽會隨大量空氣一起吸入體內,並且為了讓熱的東西很快冷卻,你就吹氣,這樣也會把大量空氣吸入體內。

建議:
等熱湯熱飲料稍涼再喝。

情況六
吃飯吃得太快了?

在快餐店用餐後常會打嗝。匆匆忙忙進食的時候,會吸入很多空氣。

建議:
不要一下子就把盤裡的食物消滅了——小塊小塊地吃,細嚼慢咽。保證足夠的用餐時間,不要急於趕路。

情況七
吃飯時是不是說話太多?

這種情況也會引起打嗝。

建議:
吃飯時,最好安靜地吃。如果已出現打嗝,可以盡量地憋氣,在你覺得下一個嗝來臨時,把食物吞下。如此2至3次,然後,深呼吸一下,接著再重複前述動作。

情況八
打嗝時發出異味?

伴隨打嗝,胃裡發出咕嚕咕嚕聲。如果異味是酸味,表明胃酸過強;如果是苦味,表明膽汁劇增;如果是腐爛(臭雞蛋)味,則和硫化氫有關,食物糊狀物長時間阻留在胃裡形成硫化氫。

建議:
找醫生求治。這樣的嗝和胃病、腸病、肝病、膽囊等疾病有關。

治療打嗝小貼士

治療打嗝,首先要治療引起呃逆的原發疾病,其次才是對症治療。下面介紹的是一些簡便而且實用的方法,能夠阻斷神經反射而使呃逆中止。

1.分散注意力,消除緊張情緒及不良刺激。

2.先深吸一口氣,然後憋住,盡量憋長一些時間,然後呼出,反覆進行幾次。

3.喝開水,特別是喝稍熱的開水,喝一大口,分次嚥下。

4.洗乾淨手,將食指插入口內,輕輕刺激咽部。

5.將混合氣體裝入塑料袋中吸入,混合氣體中含90%氧氣和10%的二氧化碳。

6.嚼服生薑片。

7.將生韭菜洗淨,搾出菜汁後口服。

8.柿蒂(指新鮮柿子或柿餅的蒂)每次20枚,煎水成100毫升,分兩次口服,一次50毫升。也可酌情加韭菜籽同煎。

此外,還有一些方法,或許可幫你盡早結束打嗝。比如,吃一茶匙糖,干吞(不配水),是有效方法。可以在數分鐘後止住打嗝,因為糖在口腔裡會改變原來的神經衝動,以阻撓橫膈膜的肌肉作間歇性地收縮。再有,打嗝時可用拇指按壓中指第二個關節處約10秒鐘,對治打嗝也很有幫助。


我是用2, 3這兩種方法把打嗝停止了. 不知道對其他人有沒有效.

Tuesday, January 19, 2010

What is Digsby?

 

 

For someone who is interested in Digsby, please take a moment to watch the following video:

 


 



Isn’t this amazing and convenient!

But there is one thing that concern me…the SECURITY issue! Since the email/internet messenger/social network accounts are all bind together, how are we going to make sure that our email/im/social network  accounts and passwords are safe?



Therefore I pay a visit to the Digsby’s FAQ, and after reading the Commitment to Security , I decided to give Digsby a try!