星期五, 5月 29, 2009

Facebook 遊戲:愛貓•愛情冒險

近日沉迷於新的Facebook 遊戲:愛貓•愛情冒險

http://apps.facebook.com/aimaomao/?pid=95000255

遊戲要求玩家完成各項任務及與其他朋友冒險,
從而開啟地圖及收集提升各款貓貓。

以下是第一章章尾的問題:

1、貓貓冒險時,兩只貓貓____有指南針
a. 都必須 b.至少有一只 c.都不需要

2、老村長派發口糧時,可以領到
a. 金幣和魔晶 b.魔晶和冒險點 c. 金幣和冒險點

3、增加智慧的裝備是
a. 斧子 b.法杖 c.戒指

4、加工斧子需要的基本材料是
a. 力量石 b. 智慧果 c. 魅力水

5、支付孵化蛋蛋的費用
a. 只能使用金幣 b.只能使用魔晶 c.金幣、魔晶都行

6、冒險時,可以得到金幣的操作是
a. 【拾金子】 b.【親密】 c. 【尋找水晶】

7、什么種類的貓可穿豆服?
a. 只有豆豆貓 b.可以是惜惜貓 c.所有種類

8、表示第6級的裝備的圖案是
a. 紫星星 b. 紫月亮 c. 紅太陽

9、冒險地圖中,距離【愛貓村】最近的兩塊地方是
a. 【山坡羊】和【在水一方】b.【青翠谷】和 【天高云淡】c.【青翠谷】和【在水一方】

10、加工裝備時
a. 成功裝備等級+1 b.失敗裝備消失 c. 以上都對

=================

第二章 遙遠的傳說~章尾:老村長的考核

1、貓貓冒險時,如果玩家沒有選則操作,那么系統會
自動隨機操作 偶爾自動操作 不做任何操作

2、冒險時設置的目的地與當前地點較遠,那么系統會
行走到下一個地點就停下 系統不允許這樣設置 自動一步一步地前往目的地

3、【痛扁GM】成功后可以獲得
金幣 魔晶 金幣和魔晶

4、新地圖是通過什么操作開拓的
【親密】 【拾金子】 【痛扁GM】

5、個人稱謂的提升是通過
個人等級 個人總貓里數 學徒數量

6、冒險點自動恢復速度與____相關
學徒數量 個人等級 個人稱謂

7、招募學徒可通過
發送招募邀請給好友 到游戲之外的地方張貼招募鏈接 以上兩種都可以

8、服裝可通過【修改款式】變成其他貓種的服裝,但是
有可能會失敗 4級以上服裝才能【修改款式】,修改后衣服等級-3 需要收取一定的費用

9、給服裝【鑲嵌水晶】失敗時
衣服等級下降 衣服消失 等級為1消失,否則-1

10、本章故事中的老獨和喵大媽
是年幼時的玩伴 青梅竹馬的戀人 一對夫妻

星期二, 5月 12, 2009

分頁檔概述

相信很多人都知道pagefile的存在,但是甚麼是pagefile?

在很久以前(大概是windows 3.1的時候吧),microsoft推出了支援multitasking的GUI mode視窗。
無論是graphical user interface還是多重任務處理的能力,皆需要使用RAM。
但當時RAM的價錢真的有點貴,於是微軟便利用相對較便宜的硬盤,
製作分頁檔來分擔RAM的工作。

例如你同時開啓MSN和Ms Word,當你由Ms Word切換到MSN時,
windows便會將你在Ms Word中的狀態暫存在RAM中,
直至切換回Ms Word時把狀態「叫」回來。
但若果RAM不足時怎麼辦?
RAM可以把資料放到速度相對較慢的硬盤中(pagefile),
以放出空間擔任其他工作。
故在RAM較少時分頁檔實在不可或缺。

但現時RAM的價格日益平宜,大部份人的電腦動不動便是2GB、3GB甚至8GB RAM,
一般情況下便不應使用分頁檔了。
由於windows預設了當設定了使用分頁檔時,即使RAM有足夠空間,
依舊會使用分頁檔。
相信大家都可以理解,單單在RAM運行資料快,還是經RAM轉到 harddisk 再轉回RAM快。
故使用windows xp一類時,假若已有2GB RAM以上,可以嘗試停用分頁檔,
看看有沒有分別。

即使真的需要使用分頁檔,也請勿在 boot drive 及 安裝 os 的harddisk 上使用,
可以的話請用另一隻實體硬盤(不要分割硬盤來自欺欺人),情況也會好一點。

星期五, 5月 08, 2009

EE3120 (B) MP & ASSEMBLY LANGUAGE PROG (02EE3120) Assignment 2 Solution

Assignment 2 Solution 2008/9
Question 1 (34 marks)

Answer 1(a)(i)In asynchronous serial transmission, the transmitter's clock and receiver's clock are not synchronized. In order toreceive data correctly, it is necessary to define a protocol on how the data are packed, how many bits constitute acharacter, and when the data begins and ends. Generally, this is done by placing a character between start and stopbits as shown in the following figure. This is called framing.Framing ASCII “A”(41H)When a start bit is received, the receiver will delay a fixed amount of clock cycles which is roughly equal to thehalf period of the data bit width, then sample the data line at roughly the middle of the data bit. If the clockfrequencies for the transmitter and receiver ends are close enough, this provides highly reliable data reception.However, both parties must agree upon the same number of data bits and parity bits in a frame.[5 marks]Answer 1(a)(ii)In 8-bit UART variable mode, the shift clock is derived from the system (x'tal frequency) clock through a series ofdividers shown in the figure below. First the system oscillating frequency will be divided by 12. Timer 1 whichhas to be programmed into 8-bit auto reload model is the second stage of clock division. The dividing constant isdetermined by the value stored in TH1 register. The overflow clock is further divided by 2 if the SMOD bit in thePCON register is 0, otherwise no division is result. Finally, the clock will be divided by 16 before entering into theserial port shift clock. The baud rate can be computed according to the formula:Baud rate =2SMOD32 12 (256-TH1)osc × f× ×Assuming system clock is 11.0592MHz and SMOD=0, for a value of TH 1=253 (i.e., -3 in 8-bit sign integer), thebaud rate is20 11.0592 10632 12 (256-253)× ×× × =9600[6 marks]Answer 1(a)(iii)Main:Continue:Wait:Forever:Sting:Answer 1(b)(i)ORG 0200HMOV DPTR, #StringMOV TMOD, #20HMOV THl,#-24MOV SCON, #50HSETB TR1CLR AMOVC A, @A+DPTRJZ ForeverMOV SBUF, AJNB TI, WaitCLR TIINC DPTRSJMP ContinueSJMP ForeverORG 0400HDB "City University of Hong Kong", 0END; load DPTR with String address; Timer 1, 8-bit auto reload; 1200 baud; 8-bit UART variable; start Timer 1; Read character of Sting»; write to serial port; wait for TI to set; wait TI; increase pointer; continue to transmit next char; do nothing[8 marks]Vector-table approach to interrupt handling is to assign a fixed location in program memory for storing the jumpvector for each interrupt source. When an interrupt happens, processor will finish the current instruction and savethe PC value on stack and then jump to the corresponding location according to the interrupt source. Generally, ajump instruction to the starting address of the interrupt service routine (ISR) will perform. In the case of 8051,there are six interrupt sources including RESET. We can place a LJMP ISR_Address instruction in thecorresponding location. For example, the following instructions put a jump vector for timer 0 interrupt:ORG 0000BHLJMP Timer1_ ISRTimerl1_ISR:ORG 0100H............RETISince the gap between interrupt vectors (except RESET) is eight bytes, we can put the interrupt service routinedirectly in the jump vector location if the size of its ISR is less than or equal 8 bytes. This helps to speed upinterrupt handling for fast real time response.Interrupt ROM Location (Hex) Pin[5 marks]Flag ClearingReset 0000 9 AutoExternal hardware interrupt 0 (INTO) 0003 P3.2(12) AutoTimer 0 interrupt (TFO) 000B AutoExternal hardware interrupt 1 (INT1) 0013 P3.3(13) AutoTimer 1 interrupt (TF1) 001B AutoSerial COM interrupt (RI and TI) 0023 Programmer clears it.Answer 1(b)(ii)ORG 0000H ; Reset vectorLJMP Main;ORG 000BH ; Timer 0 interrupt vectorCPL P2.1 ; toggle P2.1 for square wave outputRETI ; return from ISR;ORG 0023H ; Serial port interrupt vectorLJMP Serial ; jump to serial ISRRETIMain: ORG 0030HMOV P1,#OFFH ; make P1 an input portMOV TMOD, 22H ; timer 0 and 1 are 8-bit auto reloadMOV TH1,#-12 ; 1200 baud rateMOV SCON, #50H ; 8-bit UART with REN enableMOV THO, #-46 ; period for 10 kHz square waveMOV IE, #92H ; enable serial and timer 0 interruptsSETB TR1 ; start timer 1SETB TRO ; start timer 0Back: MOV A, P1 ; read data from Port 1MOV SBUF, A ; write it out to serial portSJMP Back ; loop indefinitely;ORG 0100H ; serial ISR locationSerial: JB TI, Trans ; jump if tx interrupt otherwise rxinterruptMOV A, SBUF ; get the received dataMOV P0,A ; and write it to P0CLR RI ; clear RI (non auto-cleaning)RETI ; return from ISRTrans: CLR TI ; clear TI (non auto-cleaning)RETI ; return from ISREND[10 marks]Question 2 (34 marks)Answer 2(a)ALE is the address latch enable signal output from the 8051 family of microcontrollers. It is a pulse for latching the low-order byte of taccesses to external memory or I/O. Because the low-order byte address (AO-A7) is time-multiplexed with the data (DO-D7) on the phyAD7). A latch, e.g. 74LS373, can be used to latch the address (AO-A7), while data bus (DO-D7) will be available after the addrefollowing circuit can be used. The advantage of using multiplexed bus in 8051 is to save a number of physical pin sfor the chip to codevices. However, by doing so, the speed of external access will be reduced because address and data are multiplexed on the sameaddress has to be latched first, then come the data.[6 marks]Answer 2(b)(i)ROM with an address range 0000 - 3FFF has a size of 16 kbytes. EPROM with an address range 0000 -1FFF has a size of 8 kbytes; RAM with an address range COOO - DFFF has a size of 8 kbytesROM chip required is 1 EPROM chip required is 1 RAM chiprequired is 2[5 marks]Answer 2(b)(ii)[11 marks]Answer 2(b)(iii)

星期三, 5月 06, 2009

Step for reset ESDA password

學校大約一年便會使用ESDA一次,所以忘記了系統管理員密碼並不奇怪。
既然ESDA是用MYSQL儲存數據,那麼重設密碼並不是難事了。

1. 到 c:\Program Files\esda\mysql\bin>
2. 輸入以下指令:
Step1: mysql –u sep
Step2: use sep;
Step3: update users set password='admin' where loginid='admin';
3. 密碼變更為「admin」成功.

推薦此文