星期日, 11月 08, 2009

NET中的策略配置文件

1. 假设你想通过指定程序集加载程序可以搜索的子目录来帮助程序集加载。下列哪个选项可使你实现该操作?

计算机配置文件中的bindingRedirect元素
计算机配置文件中的codeBase元素
应用程序配置文件中的probing元素
发行者策略文件中的publisherPolicy元素


2. 假设你想指定可被一个新版本替换的依赖程序集的版本范围。在哪个XML元素中指定新旧版本?

dependentAssembly
codeBase
assemblyIdentity
bindingRedirect


3. 选择assemblyIdentity元素中的属性。

culture
name
publicKey
Tokenversion
xmlns



4. codeBase 元素在强名称程序集的版本和href属性中指定它的版本和位置。

星期六, 11月 07, 2009

使用.NET程序集的动态属性

(1) 辨别有关动态属性的正确描述。

任何可移植可执行(PE)文件都可以存储和检索动态属性
在运行时中,Windows应用程序把它们的动态属性存储在app.config文件中
动态属性通常存储在XML配置文件的节中
Web应用程序自动重读被更改的配置文件项,且不需要重新启动或重新部署
只有在重新部署Web应用程序后配置文件项所做的更改才能生效


(2) 辨别有关动态属性的正确描述。

在设计阶段,Windows应用程序把它们的动态属性存储在app.config文件中
动态属性可以在任意数量的配置文件中显示
Web应用程序把它们的动态属性存储在Web.config文件中
Windows应用程序若要读取被更改的属性值配置项,则必须重新启动


(3) 动态属性存储在相关XML配置文件的哪个元素中?

<appsettings>
<assemblybinding>
<codebase>
<runtime>

星期五, 11月 06, 2009

CS3161 (A) OPERATING SYSTEM PRINCIPLES (DR. LIU WENYIN) (09CS3161_LW) - Answers to Tutorial 9 Questions

Q1 When does page fault occur ? Describe the action taken by the operating system when a page fault occurs.

A page fault occurs when an access to a page that has not been brought into main memory takes place (invalid page bit set in page table).
Page Fault Handling procedures,
(1)Scan the page table entry, the page is invalid – page fault occurs;
(2)O.S. generate TRAP interrupt;
(3)Locate the page with data in secondary storage;
(4)I/O requested to read the needed page into the available free frame;
(5)Upon completion of I/O, the process table and page table are updated as valid page and address in memory;
(6)The instruction is restarted.






Q2 (i) What is a page replacement ?(ii) What does the dirty bit mean ?


(i) Page replacement is the scheme (algorithm) to identify a victim page for replacement when all available frames (memory) are all currently used.
Page replacement operation involves selecting a frame (preferably not currently in use) as a victim for replacement; swap it out; swap in the desired page into the free frame; restart program.
Available page replacement scheme include FCFS, LFU, NRU.
(ii) A bit stored in the page table, if set, the page has been modified (dirty page), and must be written back to backing store before being use as a victim for page replacement to create a free frame in physical memory.
It is desirable try not to replace a dirty page, since it will take longer (with the write-back operation).




Q3 (i) What is Thrashing ?(ii) How does the system detect thrashing ?(iii) What can the system do to eliminate it ?


(i) Thrashing in a virtual memory system is a high page fault activities situation, where the system spends most of the time in page swapping than executing processes.
Thrashing is caused by under-allocation of the minimum number of pages required by a process, forcing it to continuously page fault.
(ii) The system can detect thrashing by elevating the level of CPU utilisation as compared to the level of multiprogramming.
The sudden drop in CPU utilisation while increasing the level of multiprogramming (increasing the number of processes) identifies the thrashing point.
(iii) Thrashing can be eliminated by reducing the level of multiprogramming, (that is to decrease the number of processes in the system).

星期二, 11月 03, 2009

CS3161 (A) OPERATING SYSTEM PRINCIPLES (DR. LIU WENYIN) (09CS3161_LW) - Answers to Tutorial 8 Questions

Q1 Explain the difference between internal and external fragmentation in memory management. Suggest ways to reduce or solve of both types of fragmentation.


Internal fragmentation is the area in a region or a page which is not used by the job occupied that region or page. This space is unavailable for use by the system until that job is finished or the region is released.

External fragmentation is a region which is unused and available, but it is too small for any of the waiting jobs.

To reduce or solve problems of fragmentation :
Internal fragmentation - reduce size of individual region / allocation unit.
External fragmentation - break down request into non-contiguous portions, compaction, swapping.



Q2 What is compaction ? Why use it ?


Movement of processes to eliminate small free memory partitions. Compaction is used to eliminate memory fragmentation (external) and to increase memory utilization.

It allows smaller memory partitions to form fewer bigger ones, thus allowing larger processes to run.





Q3 Given memory partition of 100K, 500K, 200K, 300K, and 600K (in order), how each of the First-fit, Best-fit, and Worst-fit algorithms place processes of 212K, 417K, 112K, and 426K (in order) ? Which algorithm makes the most efficient use of memory ?


(1) First-fit :
212K is put in 500K partition
417K is put in 600K partition
112K is put in 288K partition (new partition 288K = 500K - 212K)
426K must wait
(2) Best-fit :
212K is put in 300K partition
417K is put in 500K partition
112K is put in 200K partition
426K is put in 600K partition
(3) Worst-fit :
212K is put in 600K partition
417K is put in 500K partition
112K is put in 388K partition
426K must wait

In this example, the best-fit turns out to be the best algorithm.



Q4 (i) What is paging ?(ii) What is a frame ?(iii) What is contained in the page table ?(iv) How many frames are needed for each page ?(V)Draw the diagram to show how paging works.


(i) Splitting program up into a group of fixed-equal-sized partitions, allowing the parts to be non-contiguous in memory, during the execution of the process.
(ii) Fixed-size block of physical memory, each block must be of the same size as one page.
(iii) Page number, frame number, base address of each frame, presence, protection (permission), dirty bit.
(iv) One.

星期一, 11月 02, 2009

商業大亨 - 員工深造機率說明

如下是有關說明:(內容較多,請耐心細看)

白升綠,基礎成功機率 40%;能力值每增加10點,成功機率增加1%,最多累積 10%;熟練度每超過基礎值的20%,成功機率增加10%,最多累計 40%;公司等級加成=公司等級 * 1%。最高機率 99%

綠升藍,基礎成功機率 20%;能力值每增加10點,成功機率增加0.5%,最多累積 5%;熟練度每超過基礎值的20%,成功機率增加5%,最多累積 10%;公司等級加成=公司等級 * 1%。普通情況最高機率為 44%,週六基礎成功機率雙倍,即40%,最高成功機率 64%。

藍升紫,基礎成功機率 5%,能力值每增加10點,成功機率增加0.1%,最多累積 1%;熟練度每超過基礎值的20%,成功機率增加2%,最多累計 2%;公司等級加成=公司等級 * 1%。普通情況最高機率為 17%,週六基礎成功機率雙倍,即10%,最高成功機率 22%

紫升紅,基礎成功機率 1%,能力值每增加10點,成功機率增加0.05%,最多累積 0.5%;無熟練度加成;公司等級加成=公司等級 * 1%。普通情況最高機率 10.5 %,週六基礎成功機率雙倍,即2%,最高成功機率 11.5%

總結:
白升綠,成功率40%〜99%
綠升藍,成功率20%〜44%,週六為:40%〜64%
藍升紫,成功率5%〜17%,週六為:10%〜22%
紫升紅,成功率1%〜10.5%,週六為:2%〜11.5% .
能力值,熟練度,公司等級高,相對成功率也高。
週六要抓住機會深造!

星期日, 11月 01, 2009

black magic - 風水師

風水師幫過咩野睇相 ??


劉羽琦有, 陳法拉有, 陳奕冇
無線有, 亞視冇,
外圍賭錢有, 香港賽馬會冇,
新版銀紙有, 紀念馬票冇,
2012 末日預言冇, 宮心計都冇, 但係皇上有.
咁佢仲有睇過咩野 ??







====







開估:
















有金木水火土既字就有..
所以...劉(金)羽琦(土), 陳法(土)拉, 無線(水) ,外圍賭錢(金), 新(木)版銀(金)紙, 皇(土)上都有 ~

星期六, 10月 31, 2009

查看 Windows 7 RC 使用期限

近日有很多人嘗試破解 win 7 Release Candidate, 轉為 OEM 版的Windows 7 Ultimate 。
但如何得知成功與否?

WINVER: 版本顯示器, 它可以快速打開顯示系統版本資訊的視窗, 包括版本及有否使用期限。

推薦此文