基于事件驅動的串口通訊控件
消息幀數據格式:
1 0 A B X X
其中 10 為消息標識,
AB表示文本長度,L=A*100+B
XX為配位字符,任意
控制幀數據格式
0 1 A B M N
其中 01為控制標識,
AB為請求標識
MN為附加標識
11表示請求對方接收文件,M表示描述字串中文件名子串的長度
N表示描述字串中文件大小子串的長度
10通知對方放棄傳輸
00通知文件傳輸完畢
01請求對方發送數據, MN為10請求發送下一個
MN為00請求重發
數據幀數據格式
0 0 A B M N
其中 00 為數據標識,
AB表示數據長度,L=A*100+B
MN為校驗,M*100+N=A+B
Embest S3C44B0X Evaluation Board
RTC Test Example
RTC Check(Y/N)? y
Set Default Time at 2004-12-31 FRI 23:59:59
Set Alarm Time at 2005-01-01 00:00:01
... RTC Alarm Interrupt O.K. ...
Current Time is 2005-01-01 SAT
00:00:01
RTC Working now. To set date(Y/N)? y
Current date is (2005,01,01, SAT). input new date (yy-mm-dd w): 5-2-23 3
Current date is: 2005-02-23 WED
RTC Working now. To set time(Y/N)? y
Current time is (00:00:21). To set time(hh:mm:ss): 19:32:5
Current Time is 2005-02-23 WED
19:32:
E:\Visual_C__MFC擴展編程實例 例18
動態地抓取應用程序的屏幕圖像并將其打印。
上一個實例打印的是文檔的報表,而不是當前出現在屏幕上的內容。在本例中,將實現
屏幕抓取并打印其內容。M F C 為打印視提供了有限的支持, 但只要用M F C 在
C Vi e w : : O n D r a w ( )中所提供的設備環境,就可以繪制自己的視。在打印視的時候, M F C只需調
用具備打印機設備環境的O n D r a w ( )函數即可。但是,如果不繪制自己的視,例如,用一個或
者一個以上的控件窗口填充自己的視就不會打印任何東西。每個控件將使用自己的設備環境
將自己打印到屏幕,因此打印視的唯一途徑就是抓取屏幕(拷貝其內容到一個位圖對象)并將其
打印到打印機。由于該功能整個與位圖相關,因此將該功能封裝到了位圖類中。
acm HDOJ 1051WoodenSticks
Description:
There is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs some time, called setup time, for the machine to prepare processing a stick. The setup times are associated with cleaning operations and changing tools and shapes in the machine. The setup times of the woodworking machine are given as follows:
(a) The setup time for the first wooden stick is 1 minute.
(b) Right after processing a stick of length l and weight w , the machine will need no setup time for a stick of length l and weight w if l<=l and w<=w . Otherwise, it will need 1 minute for setup.