Thứ Sáu, 30 tháng 4, 2010

Tổng hợp "mẹo vặt" để sử dụng Firefox tốt hơn

Trong khi trình duyệt Internet Explorer của Microsoft vẫn là sản phẩm phổ biến nhất nhưng Firefox vẫn có những điểm mạnh riêng của nó. Các thủ thuật sau đây sẽ giúp bạn tăng tốc và tối ưu hóa trình duyệt Firefox của mình.1. Tận hưởng cùng "Tab"
Một trong những đặc điểm đáng giá của Firefox là cho phép người dùng hiển thị nhiều trang web khác nhau trong cùng một cửa sổ nhờ chức năng duyệt web bằng tab. Nhưng bạn không cần thông qua menu File --> New Tab để mở một tab mới, bạn chỉ việc nhấn tổ hợp phím Ctrl-T là một trang trắng sẽ tự động mở trên tab mới với con nháy đã sẵn sàng ở thanh Address.
Để mở một liên kết trong một tab mới, thông thường bạn phải nhấp phải chuột và chọn "Open Link in New Tab" nhưng có một cách đơn giản hơn là bạn chỉ cần di chuyển con trỏ lên liên kết sau đó bấm vào nút cuộn của chuột.
Nếu bạn muốn mở liên kết trong một tab mới hoặc trong một cửa sổ mới, bạn chọn menu Tools --> Options --> nhấn biểu tượng Tabs --> chọn "a new window" hay "a new tab"
Để đóng tất cả các tab khác ngoại trừ tab đang hiển thị, bạn nhấn phải cuột, chọn "Close Other Tabs" . Trong trường hợp đóng nhầm một tab, bạn có thể nhấn tổ hợp phím Ctrl-Shift-T để mở trở lại.
2. Tiết kiệm thời gian với phím tắt
Việc sử dụng bàn phím thay cho chuột trong việc thao tác luôn luôn đem lại hiệu quả cao về mặt tiết kiệm thời gian. Sau đây là một số phím tắt
Ctrl - L : di chuyển trỏ chuột đến thanh Address nhằm gõ địa chỉ trang web)
Bạn chỉ cần gõ "thongtincongnghe" và nhấn Ctrl-Enter để điền tên miền ".com" hoặc Ctrl-Shift-Enter để điền tên miền ".org" và Shift-Enter đề điền ".net"
Ctrl - K : di chuyển trỏ chuột đên khung tìm kiếm của Google
Ctrl - F : để thực hiện tìm kiếm trong trang web đang hiển thị
F11 : Để bật tắt chế độ xem toàn màn hình
3. Quản lý Bookmark
Bookmark là chức năng rất hay trong các trình duyệt web, nó cho phép người dùng lưu lại những trang web yêu thích để tiện việc truy cập sau này. Nhưng đôi khi số lượng bookmark quá lớn, nếu bạn không sắp xếp, phân loại chúng thì việc gặp khó khăn trong tìm kiếm là điều sẽ xảy ra. Để quản lý Bookmark, bạn vào menu Bookmarks --> chọn "Organize Bookmarks Manager". Tại đây bạn có thể tạo ra các thư mục tương ứng với từng thể loại sau đó di chuyển các bookmark đến vị trí mới.
Để đánh dấu một trang web bạn có thể nhấn tổ hợp phím Ctrl - D. Trong cửa sổ Add Bookmark bạn chọn thư mục chứa trang web tương ứng trong mục "Create in". Nếu không thấy thư mục cần tìm bạn nhấn vào nút mũi tên chỉ xuống để hiện danh sách đầy đủ các thư mục.
Sau một thời gian sử dụng sẽ có một số trang web trong danh sách bookmark không tồn tại. Để xác định trang web không hoạt động, bạn nhấn phải chuột lên thư mục bookmark tương ứng và chọn "Open All in Tabs". Những tab nào hiển thị "404 Not Found" bạn nên xóa khỏi danh sách vì các trang web này đã không còn tồn tại.
4. Sao lưu registry của Firefox
Cũng giống như Registry của Windows, Firefox Registry cũng bao gồm các thông tin cấu hình quan trọng của trình duyệt này. Trước khi có những thay đổi về cấu hình, bạn nên tạo một bản dự phòng registry trước. Để làm việc này, bạn đóng Firefox lại
Nhấn nút Start --> chọn Run --> gõ %appdata%\mozilla\firefox\profiles và nhấn Enter --> Kết quả xuất ra là một thư mục có tên dạng như "4hw0enat.default". Mở thư mục này ra và sao chép tập tin prefs.is đến một nơi an toàn dùng để phục hồi sau này
5. Hiệu chỉnh bộ máy tìm kiếm mặc định
Khi bạn gõ một từ trong thanh Address bar thì bộ máy tìm kiếm (search engine) mặc định sẽ hiển thị các kết quả tìm kiếm. Bộ máy tìm kiếm có thể là Yahoo hay MSN. Để thiết lập bộ máy tìm kiếm mặc định là Google ta thực hiện như sau.
Sao lưu toàn bộ registry của Firefox --> trên thanh Address bar gõ "about:config" và nhấn Enter --> trong hộp thoại Filter, gõ chuỗi ký tự sau "keyword.URL" --> Nhấp đôi chuột lên giá trị "keyword.URL", nhập đường dẫn "http://www.google.com/search?btnG=Google+Search&q=" --> Nhấn OK
6. Thêm thanh công cụ tìm kiếm
Bạn có thể thêm, xóa và tổ chức lại các dịch vụ tìm kiếm xuất hiện ở góc trên bên phải. Ta nhấn vào mũi tên hướng xuống ở bên trái thanh công cụ tìm kiếm --> Chọn "Manage Search Engines" --> Để xem toàn bộ các search engine hiện có nhấn vào liên kết "Get more search engines"
Để thêm một bộ máy tìm kiếm đơn giản chỉ việc chọn và nhấn nút Add. Nếu bạn muốn Firefox sử dụng nó là công cụ tìm kiếm mặc định thì đánh dấu vào ô "Start using it right away".
7. Sử dụng thanh công cụ của các trang web
Bạn có thể sử dụng các thanh công cụ tìm kiếm thường xuất hiện trong các trang web để tìm tài liệu trên trang web đó mà không cần phải truy cập vào. Ví dụ thực hiện với trang web www.pcworld.com
Nhấn phải chuột lên thanh tìm kiếm của trang web PCWorld, và chọn "Add a Keyword for this Search" --> trong cửa sổ bookmark xuất hiện bạn điền như hình với "pcw" là từ khóa dùng để gọi công cụ tìm kiếm của trang PCWorld.
Để kiểm tra, trên thanh Address bar bạn gõ "pcw laptop" kết quả xuất hiện là tất cả các bài viết liên quan đến máy tính xách tay có trên trang PCWorld.
8. Bảo mật mọi thông tin lướt web
Bạn không muốn người khác biết mình vào trang web nào, gõ mật khẩu gì hay bạn muốn những thông tin đó được xóa ngay khi đóng trình duyệt. Để cấu hình bạn vào menu Tools --> Options --> biểu tượng Privacy --> đánh dấu vào mục "Always clear my private data when I close Firefox."
9. Làm việc với History
Để xóa các trang web được lưu trong History ta chọn trong danh sách ở thanh Address bar và nhấn nút "Delete". Hoặc bạn có thể nhấn tổ hợp phím Ctrl - H để mở phần quản lý History, tại đây bạn sẽ có thể xóa cùng lúc nhiều trang web hoặc xem lại các trang được duyệt ở tùân trước.
10. Bảo mật việc lưu trữ mật mã
Firefox có tính năng quản lý mật mã giúp tự động điền mật mã vào các trang web khác nhau mà người dùng không cần phải nhớ. Điều này sẽ là hết sức nguy hiểm nếu không được bảo vệ bởi Master Password
Để bật tính năng này, chọn Tools --> Options --> nhấn vào biểu tượng Security --> đánh dấu chọn "Remember Passwords for sites" và "Use a master password" --> Trong hộp thoại Change Master Password, nhập mật mã dùng để quản lý việc điền mật mã vào các trang web.


Kể từ bây giờ trong mỗi phiên làm việc với Firefox, trước khi tự điền mật khẩu trong một trang web hệ thống sẽ yêu cầu bạn nhập vào mật mã quản lý.11. Tối ưu hóa băng thông
Mặc định Firefox đã tối ưu hóa tốc độ truyền dành cho kết nối dial-up nhưng với các kết nối băng rộng như ADSL, cáp quang bạn phải tinh chỉnh một vài thông số
Sao lưu toàn bộ registry của Firefox --> trên thanh Address bar gõ "about:config" và nhấn Enter --> tìm đến giá trị "network.http.pipelining", đổi lại thành "true" --> tìm giá trị "network.http.pipelining.maxrequests", nhập một số bất kỳ lớn hơn 4 --> tìm "network.http.proxy.pipelining", thiết lập thành "true"
Tạo một giá trị mới bằng cách click phải --> chọn New --> Integer --> nhập chuỗi "nglayout.initialpaint.delay" và thiết lập giá trị 0
12. Di chuyển các thiết lập Bookmark sang một máy tính khác
Bước 1 : Ở máy tính cũ, đóng trình duyệt Firefox --> nhấn nút Start, chọn Run --> gõ "%appdata%\mozilla" và nhấn Enter --> Chép thư mục có tên "Firefox" vừa được tạo đến máy tính mới
Bước 2 : Trên máy tính mới, cài đặt và mở Firefox. Khi phần Import Wizard xuất hiện, nhấn nút Cancel. Chọn Start --> Run --> gõ "%appdata%\mozilla" --> Đổi tên thư mục Firefox cho giống lúc cài đặt --> Chép thư mục Firefox của máy tính cũ vào đây --> Mở lại Firefox, mọi thiết lập đã y như cũ.
Vĩnh Duy (Theo PCWorld)

Nhà thiết kế máy tính cá nhân đầu tiên đã qua đời ở tuổi 68

 Henry Edward Roberts, nhà thiết kế của máy tính cá nhân đầu tiên Altair 8800, đã qua đời ở tuổi 68 hôm 1/4. Ông là người đã cuốn hút Bill Gates và Paul Allen vào lĩnh vực kinh doanh phần mềm.
Henry Edward Roberts
“Chúng tôi cảm thấy đau buồn sâu sắc với sự ra đi của một người bạn, người cố vấn của chúng tôi, Ed Roberts. Đó là người tiên phong trong cuộc cách mạng máy tính cá nhân”, hai nhà đồng sáng lập Microsoft, Bill Gates và Paul Allen phát biểu tối thứ năm.
Roberts là người sáng lập MITS, một hãng bán lẻ các bộ dụng cụ điện tử cho người say mê. Ở đó ông đã thiết kế Altair 8800, máy tính các nhân đầu tiên. Khi tạp chí Popular Electronics giới thiệu Altair trên trang bìa vào năm 1975, Gates và Allen đã được mời phát triển một phiên bản của ngôn ngữ lập trình Basic cho máy này, và thành lập lên tập đoàn Microsoft ngày nay.
“Ed sẵn sàng thử vận may với chúng tôi - hai chàng trai trẻ đam mê máy tính từ lâu trước khi nó trở nên phổ biến - và chúng tôi luôn luôn biết ơn anh”, hai nhà sáng lập Microsoft viết.
“Cái ngày chương trình chưa kiểm tra đầu tiên của chúng tôi chạy được trên Altair chính là một ngày khởi đầu của bao sự diệu kì. Chúng tôi sẽ luôn giữ những kí ức về những lần làm việc với Ed ở Albuquerque, trong văn phòng của MITS ngay trên đường 66”.
“Anh là người mạnh mẽ và vô cùng hài hước. Anh luôn quan tâm sâu sắc đến những người làm việc cùng, có cả chúng tôi”.
Thái độ quan tâm đó không chỉ dành cho các nhân viên của ông. Vài năm sau khi Altar được khởi động, ông đã bán MITS để chuyển đến Georgia, học Y khoa và trở thành một bác sĩ.
Chúng ta hãy dành 1 phút tưởng niệm cho sự ra đi của Henry Edward Roberts!

Thứ Năm, 29 tháng 4, 2010

Intelligent Search


Introduction

Problem solving requires two prime considerations: first representation of the problem by an appropriately organized state space and then testing the existence of a well-defined goal state in that space. Identification of the goal state and determination of the optimal path, leading to the goal through one or more transitions from a given starting state, will be addressed in this chapter in sufficient details. The chapter, thus, starts with some well-known search algorithms, such as the depth first and the breadth first search, with special emphasis on their results of time and space complexity. It then gradually explores the 'heuristic search' algorithms, where the order of visiting the states in a search space is supported by thumb rules, called heuristics, and demonstrates their applications in complex problem solving. It also discusses some intelligent search algorithms for game playing.

Common experience reveals that a search problem is associated with two important issues: first 'what to search' and secondly 'where to search'. The first one is generally referred to as 'the key', while the second one is termed 'search space'. In AI the search space is generally referred to as a collection of states and is thus called state space. Unlike common search space, the state space in most of the problems in AI is not completely known, prior to solving the problem. So, solving a problem in AI calls for two phases: the generation of the space of states and the searching of the desired problem state in that space. Further, since the whole state space for a problem is quite large, generation of the whole space prior to search may cause a significant blockage of storage, leaving a little for the search part. To overcome this problem, the state space is expanded in steps and the desired state, called 'the goal', is searched after each incremental expansion of the state space.
Depending on the methodology of expansion of the state space and consequently the order of visiting the states, search problems are differently named in AI. For example, consider the state space of a problem that takes the form of a tree. Now, if we search the goal along each breadth of the tree, starting from the root and continuing up to the largest depth, we call it breadth first search. On the other hand, we may sometimes search the goal along the largest depth of the tree, and move up only when further traversal along the depth is not possible. We then attempt to find alternative offspring of the parent of the node (state) last visited. If we visit the nodes of a tree using the above principles to search the goal, the traversal made is called depth first traversal and consequently the search strategy is called depth first search. We will shortly explore the above schemes of traversal in a search space. One important issue, however, needs mention at this stage. We may note that the order of traversal and hence search by breadth first or depth first manner is generally fixed by their algorithms. Thus once the search space, here the tree, is given, we know the order of traversal in the tree. Such types of traversal are generally called 'deterministic'. On the other hand, there exists an alternative type of search, where we cannot definitely say which node will be traversed next without computing the details in the algorithm. Further, we may have transition to one of many possible states with equal likelihood at an instance of the execution of the search algorithm. Such a type of search, where the order of traversal in the tree is not definite, is generally termed 'nondeterministic'. Most of the search problems in AI are non-deterministic.

General Problem Solving Approaches

There exist quite a large number of problem solving techniques in AI that rely on search. The simplest among them is the generate and test method. The algorithm for the generate and test method can be formally stated as follows:

  • Procedure Generate & Test
    • Begin
      • Repeat
        • Generate a new state and call it current-state;
      • Until current-state = Goal;
    • End.
It is clear from the above algorithm that the algorithm continues the possibility of exploring a new state in each iteration of the repeat-until loop and exits only when the current state is equal to the goal. Most important part in the algorithm is to generate a new state. This is not an easy task. If generation of new states is not feasible, the algorithm should be terminated. In our simple algorithm, we, however, did not include this intentionally to keep it simplified.
But how does one generate the states of a problem? To formalize this, we define a four tuple, called state space, denoted by
{ nodes, arc, goal, current },
where nodes represent the set of existing states in the search space; an arc denotes an operator applied to an existing state to cause transition to another state; goal denotes the desired state to be identified in the nodes; and current represents the state, now generated for matching with the goal.
We will now present two typical algorithms for generating the state
space for search. These are depth first search and breadth first search.

Breadth First Search

The breadth first search algorithm visits the nodes of the tree along its
breadth, starting from the level with depth 0 to the maximum depth. It can be
easily realized with a queue. For instance, consider the tree, given in figure.
Here, the nodes in the tree are traversed following their ascending ordered labels.

The order of traversal in a tree of depth 3 by breadth first manner. The algorithm for traversal in a tree by depth first manner can be presented with a queue as follows:
Procedure Breadth-first-search
    Begin
    • i) Place the starting node in a queue;
    • ii) Repeat
      • Delete queue to get the front element;
      • If the front element of the queue = goal,
      • return success and stop;
      • Else do
      • Begin
        • insert the children of the front element,
        • if exist, in any order at the rear end of
        • the queue;
      • End
    • Until the queue is empty;
  • End.
The breadth first search algorithm, presented above, rests on a simple principle. If the current node is not the goal add the offspring of the current in any order to the rear end of the queue and redefine the front element of the queue as the current. The algorithm terminates, when the goal is found.



First few steps of breadth first search on the tree of fig. Time Complexity
For the sake of analysis, we consider a tree of equal branching factor from each node = b and largest depth = d. Since the goal is not located within depth (d-1), the number of false search is given by

Further, the first state within the fringe nodes could be the goal. On the other hand, the goal could be the last visited node in the tree. Thus, on an average, the number of fringe nodes visited is given by

Consequently, the total number of nodes visited in an average case becomes

Since the time complexity is proportional to the number of nodes visited, therefore, the above expression gives a measure of time complexity.
Space Complexity
The maximum number of nodes will be placed in the queue, when the leftmost node at depth d is inspected for comparison with the goal. The queue length under this case becomes bd. The space complexity of the algorithm that depends on the queue length, in the worst case, thus, is of the order of bd. In order to reduce the space requirement, the generate and test algorithm is realized in an alternative manner, as presented below.

Depth First Search

The depth first search generates nodes and compares them with the goal along the largest depth of the tree and moves up to the parent of the last visited node, only when no further node can be generated below the last visited node. After moving up to the parent, the algorithm attempts to generate a new offspring of the parent node. The above principle is employed recursively to each node of a tree in a depth first search. One simple way to realize the recursion in the depth first search algorithm is to employ a stack. A stackbased realization of the depth first search algorithm is presented below.
Procedure Depth first search
    Begin
    • Push the starting node at the stack,
    • pointed to by the stack-top;
    • While stack is not empty do
      • Begin
        • Pop stack to get stack-top element;
        • If stack-top element = goal, return
          • success and stop
        • Else push the children of the stack-top
        • element in any order into the stack;
      • End.
    • End while;
  • End.

Fig. A:Depth first search on a tree, where the node numbers denote the order of visiting that node.
In the above algorithm, a starting node is placed in the stack, the top of which is pointed to by the stack-top. For examining the node, it is popped out from the stack. If it is the goal, the algorithm terminates, else its children are pushed into the stack in any order. The process is continued until the stack is empty. The ascending order of nodes in fig. A represents its traversal on the tree by depth first manner. The contents of the stack at the first few iterations are illustrated below in fig. B. The arrowhead in the figure denotes the position of the stack-top.

Fig. B: A snapshot of the stack at the first few iterations.
Space Complexity
Maximum memory in depth first search is required, when we reach the largest depth at the first time. Assuming that each node has a branching factor b, when a node at depth d is examined, the number of nodes saved in memory are all the unexpanded nodes up to depth d plus the node being examined. Since at each level there are (b-1) unexpanded nodes, the total number of memory required = d (b -1) +1. Thus the space complexity of depth first search is a linear function of b, unlike breadth first search, where it is an exponential function of b. This, in fact, is the most useful aspect of the depth first search.
Time Complexity
If we find the goal at the leftmost position at depth d, then the number of nodes examined = (d +1). On the other hand, if we find the goal at the extreme right at depth d, then the number of nodes examined include all the nodes in the tree, which is

So, the total number of nodes examined in an average case

This is the average case time complexity of the depth first search algorithm. Since for large depth d, the depth first search requires quite a large runtime, an alternative way to solve the problem is by controlling the depth of the search tree. Such an algorithm, where the user mentions the initial depth cut-off at each iteration, is called an Iterative Deepening Depth First Search or simply an Iterative deepening search.

Iterative Deepening Search

When the initial depth cut-off is one, it generates only the root node and examines it. If the root node is not the goal, then depth cut-off is set to two and the tree up to depth 2 is generated using typical depth first search. Similarly, when the depth cut-off is set to m, the tree is constructed up to depth m by depth first search. One may thus wonder that in an iterative deepening search, one has to regenerate all the nodes excluding the fringe nodes at the current depth cut-off. Since the number of nodes generated by depth first search up to depth h is

the total number of nodes expanded in failing searches by an iterative deepening search will be

The last pass in the algorithm results in a successful node at depth d, the average time complexity of which by typical depth first search is given by

Thus the total average time complexity is given by

Consequently, the ratio of average time complexity of the iterative deepening search to depth first search is given by

The iterative deepening search thus does not take much extra time, when compared to the typical depth first search. The unnecessary expansion of the entire tree by depth first search, thus, can be avoided by iterative deepening. A formal algorithm of iterative deepening is presented below.
Procedure Iterative-deepening
  • Begin
    • 1. Set current depth cutoff =1;
    • 2. Put the initial node into a stack, pointed to by stack-top;
    • 3. While the stack is not empty and the depth is within the
    • given depth cut-off do
      • Begin
        • Pop stack to get the stack-top element;
        • if stack-top element = goal, return it and stop
        • else push the children of the stack-top in any order
        • into the stack;
      • End.
    • End While;
    • 4. Increment the depth cut-off by 1 and repeat
    • through step 2;
  • End.
The breadth first, depth first and the iterative deepening search can be equally used for Generate and Test type algorithms. However, while the breadth first search requires an exponential amount of memory, the depth first search calls for memory proportional to the largest depth of the tree. The iterative deepening, on the other hand, has the advantage of searching in a depth first manner in an environment of controlled depth of the tree.

Hill Climbing

The 'generate and test' type of search algorithms presented above only expands the search space and examines the existence of the goal in that space. An alternative approach to solve the search problems is to employ a function f(x) that would give an estimate of the measure of distance of the goal from node x. After f(x) is evaluated at the possible initial nodes x, the nodes are sorted in ascending order of their functional values and pushed into a stack in the ascending order of their 'f' values. So, the stack-top element has the least f value. It is now popped out and compared with the goal. If the stack-top element is not the goal, then it is expanded and f is measured for each of its children. They are now sorted according to their ascending order of the functional values and then pushed into the stack. If the stack-top element is the goal, the algorithm exits; otherwise the process is continued until the stack becomes empty. Pushing the sorted nodes into the stack adds a depth first flavor to the present algorithm. The hill climbing algorithm is formally presented below.
Procedure Hill-Climbing
  • Begin
    • 1. Identify possible starting states and measure the distance (f) of their closeness with the goal node; Push them in a stack according to the ascending order of their f ;
    • 2. Repeat
      • Pop stack to get the stack-top element;
      • If the stack-top element is the goal, announce it and exit
      • Else push its children into the stack in the ascending order of their f values;
    • Until the stack is empty;
  • End.

Moving along a ridge in two steps (by two successive operators) in hill climbing.
The hill climbing algorithm too is not free from shortcomings. One common problem is trapping at local maxima at a foothill. When trapped at local maxima, the measure of f at all possible next legal states yield less promising values than the current state. A second drawback of the hill climbing is reaching a plateau. Once a state on a plateau is reached, all legal next states will also lie on this surface, making the search ineffective. A new algorithm, called simulated annealing, discussed below could easily solve the first two problems. Besides the above, another problem that too gives us trouble is the traversal along the ridge. A ridge (vide figure above) on many occasions leads to a local maxima. However, moving along the ridge is not possible by a single step due to non-availability of appropriate operators. A multiple step of movement is required to solve this problem.

Simulated Annealing

'Annealing' is a process of metal casting, where the metal is first melted at a high temperature beyond its melting point and then is allowed to cool down, until it returns to the solid form. Thus in the physical process of annealing, the hot material gradually loses energy and finally at one point of time reaches a state of minimum energy. A common observation reveals that most physical processes have transitions from higher to lower energy states, but there still remains a small probability that it may cross the valley of energy states [2] and move up to a energy state, higher than the energy state of the valley. The concept can be verified with a rolling ball. For instance, consider a rolling ball that falls from a higher (potential) energy state to a valley and then moves up to a little higher energy state (vide figure below). The probability of such

A rolling ball passes through a valley to a higher energy state.
transition to a higher energy state, however, is very small and is given by

where p is the probability of transition from a lower to a higher energy state, ΔE denotes a positive change in energy, K is the Boltzman constant and T is the temperature at the current thermal state. For small ΔE, p is higher than the value of p, for large ΔE. This follows intuitively, as w.r.t the example of ball movement, the probability of transition to a slightly higher state is more than the probability of transition to a very high state. An obvious question naturally arises: how to realize annealing in search? Readers, at this stage, would remember that the need for simulated annealing is to identify the direction of search, when the function f yields no better next states than the current state. Under this circumstance, ΔE is computed for all possible legal next states and p' is also evaluated for each such next state by the following formula:

A random number in the closed interval of [0,1] is then computed and p' is compared with the value of the random number. If p' is more, then it is selected for the next transition. The parameter T, also called temperature, is gradually decreased in the search program. The logic behind this is that as T decreases, p' too decreases, thereby allowing the algorithm to terminate at a stable state. The algorithm for simulated annealing is formally presented below.
Procedure Simulated Annealing
  • Begin
    • 1. Identify possible starting states and measure the distance (f) of their closeness with the goal; Push them in a stack according to the ascending order of their f ;
    • 2. Repeat
      • Pop stack to get stack-top element;
      • If the stack-top element is the goal,
      • announce it and exit;
      • Else do
      • Begin
        • a) generate children of the stack-top element N and compute f for each of them;
        • b) If measure of f for at least one child of N is improving
        • Then push those children into stack in ascending order of their f;
        • c) If none of the children of N is better in f
        • Then do
        • Begin
          • a) select any one of them randomly, compute its p' and test whether p' exceeds a randomly generated number in the interval [0,1]; If yes, select that state as the next state; If no, generate another alternative legal next state and test in this way until one move can be selected; Replace stack-top element by the selected move (state);
          • b) Reduce T slightly; If the reduced value is negative, set it to zero;
        • End;
      • End.
    • Until the stack is empty;
  • End.
The algorithm is similar to hill climbing, if there always exists at least one better next state than the state, pointed to by the stack-top. If it fails, then the last begin-end bracketed part of the algorithm is invoked. This part corresponds to simulated annealing. It examines each legal next state one by one, whether the probability of occurrence of the state is higher than the random value in [0,1]. If the answer is yes, the state is selected, else the next possible state is examined. Hopefully, at least one state will be found whose probability of occurrence is larger than the randomly generated probability.
Another important point that we did not include in the algorithm is the process of computation of ΔE. It is computed by taking the difference of the value of f of the next state and that of the current (stack-top) state.
The third point to note is that T should be decreased once a new state with less promising value is selected. T is always kept non-negative. When T becomes zero, p' will be zero and thus the probability of transition to any other state will be zero.

Heuristic Search

This section is devoted to solve the search problem by a new technique, called heuristic search. The term 'heuristics' stands for ' thumb rules', i.e., rules which work successfully in many cases but its success is not guaranteed.
In fact, we would expand nodes by judiciously selecting the more promising nodes, where these nodes are identified by measuring their strength compared to their competitive counterparts with the help of specialized intuitive functions, called heuristic functions.
Heuristic search is generally employed for two distinct types of problems:
i) forward reasoning and
ii) backward reasoning.
We have already discussed that in a forward reasoning problem we move towards the goal state from a pre-defined starting state, while in a backward reasoning problem, we move towards the starting state from the given goal. The former class of search algorithms, when realized with heuristic functions, is generally called heuristic Search for OR-graphs or the Best First search Algorithms. It may be noted that the best first search is a class of algorithms, and depending on the variation of the performance measuring function it is differently named. One typical member of this class is the algorithm A*. On the other hand, the heuristic backward reasoning algorithms are generally called AND-OR graph search algorithms and one ideal member of this class of algorithms is the AO* algorithm. We will start this section with the best first search algorithm.

Heuristic Search for OR Graphs

Most of the forward reasoning problems can be represented by an OR-graph, where a node in the graph denotes a problem state and an arc represents an application of a rule to a current state to cause transition of states. When a number of rules are applicable to a current state, we could select a better state among the children as the next state. We remember that in hill climbing, we ordered the promising initial states in a sequence and examined the state occupying the beginning of the list. If it was a goal, the algorithm was terminated. But, if it was not the goal, it was replaced by its offsprings in any order at the beginning of the list. The hill climbing algorithm thus is not free from depth first flavor. In the best first search algorithm to be devised shortly, we start with a promising state and generate all its offsprings. The performance (fitness) of each of the nodes is then examined and the most promising node, based on its fitness, is selected for expansion. The most promising node is then expanded and the fitness of all the newborn children is measured. Now, instead of selecting only from the generated children, all the nodes having no children are examined and the most promising of these fringe nodes is selected for expansion. Thus unlike hill climbing, the best first search provides a scope of corrections, in case a wrong step has been selected earlier. This is the prime advantage of the best first search algorithm over hill climbing. The best first search algorithm is formally presented below.
Procedure Best-First-Search
  • Begin
    • 1. Identify possible starting states and measure the distance (f) of their closeness with the goal; Put them in a list L;
    • 2. While L is not empty do
      • Begin
        • a) Identify the node n from L that has the minimum f; If there exist more than one node with minimum f, select any one of them (say, n) arbitrarily;
        • b) If n is the goal Then return n along with the path from the starting node, and exit; Else remove n from L and add all the children of n to the list L, with their labeled paths from the starting node;
      • End.
    • End While;
  • End.
As already pointed out, the best first search algorithm is a generic algorithm and requires many more extra features for its efficient realization. For instance, how we can define f is not explicitly mentioned in the algorithm. Further, what happens if an offspring of the current node is not a fringe node. The A* algorithm to be discussed shortly is a complete realization of the best first algorithm that takes into account these issues in detail. The following definitions, however, are required for presenting the A* algorithm. These are in order.
Definition: A node is called open if the node has been generated and the h' (x) has been applied over it but it has not been expanded yet.
Definition: A node is called closed if it has been expanded for generating offsprings.
In order to measure the goodness of a node in A* algorithm, we require two cost functions: i) heuristic cost and ii) generation cost. The heuristic cost measures the distance of the current node x with respect to the goal and is denoted by h(x). The cost of generating a node x, denoted by g(x), on the other hand measures the distance of node x with respect to the starting node in the graph. The total cost function at node x, denoted by f(x), is the sum of g(x) plus h(x).
The generation cost g(x) can be measured easily as we generate node x through a few state transitions. For instance, if node x was generated from the starting node through m state transitions, the cost g(x) will be proportional to m (or simply m). But how does one evaluate the h(x)? It may be recollected that h(x) is the cost yet to be spent to reach the goal from the current node x. Obviously, any cost we assign as h(x) is through prediction.
The predicted cost for h(x) is generally denoted by h’(x). Consequently, the predicted total cost is denoted by f’(x), where
f ’(x) = g(x) + h’ (x).
Now, we shall present the A* algorithm formally.
Procedure A*
  • Begin
    • 1. Put a new node n to the set of open nodes (hereafter open); Measure its f'(n) = g(n) + h' (n); Presume the set of closed nodes to be a null set initially;
    • 2. While open is not empty do
      • Begin
        • If n is the goal, stop and return n and the path of n from the beginning node to n through back pointers;
        • Else do
        • Begin
          • a) remove n from open and put it under closed;
          • b) generate the children of n;
          • c) If all of them are new (i.e., do not exist in the graph before generating them Then add them to open and label their f' and the path from the root node through back pointers;
          • d) If one or more children of n already existed as open nodes in the graph before their generation Then those children must have multiple parents; Under this circumstance compute their f' through current path and compare it through their old paths, and keep them connected only through the shortest path from the starting node and label the back pointer from the children of n to their parent, if such pointers do not exist;
          • e) If one or more children of n already existed as closed nodes before generation of them, then they too must have multiple parents; Under this circumstance, find the shortest path from the starting node, i.e., the path (may be current or old) through which f' of n is minimum; If the current path is selected, then the nodes in the sub-tree rooted at the corresponding child of n should have revised f' as the g' for many of the nodes in that sub-tree changed; Label the back pointer from the children of n to their parent, if such pointers do not exist;
        • End.
      • End.
    • End While;
  • End.
To illustrate the computation of f' (x) at the nodes of a given tree or graph, let us consider a forward reasoning problem, say the water-jug problem, discussed in chapter 3. The state-space for such problems is often referred to as OR graphs / trees. The production rules we would use here are identical with those in chapter 3, considered for the above problem.
Example: Let us consider the following heuristic function, where X and Y denote the content of 4-liter and 3-liter jugs respectively and x denotes an arbitrary node in the search space.
h’ (x) = 2, when 0 < X < 4 AND 0 < Y < 3,
= 4, when 0 < X < 4 OR 0 < Y < 3,
=10, when i) X = 0 AND Y = 0
OR ii) X = 4 AND Y = 3
= 8, when i) X = 0 AND Y = 3
OR ii) X =4 AND Y = 0
Assume that g(x) at the root node = 0 and g(x) at a node x with
minimum distance n, measured by counting the parent nodes of each node
starting from x till the root node, is estimated to be g(x) = n. Now let us
illustrate the strategy of the best first search in an informal manner using the
water-jug problem, vide figure.

Fig.: Expanding the state-space by the A* algorithm.
Another important issue that needs to be discussed is how to select a path,when an offspring of a currently expanded node is an already existing node. Under this circumstance, the parent that yields a lower value of g+h' for the offspring node is chosen and the other parent is ignored, sometimes by de-linking the corresponding arc from that parent to the offspring node.

Dấu chấm hết cho kỉ nguyên của đĩa mềm 3,5 inch


Sony ngừng bán đĩa 3,5 inch tại Nhật Bản. Ảnh: Sony Japan.
Trong một thông cáo báo chí ngày 23/4, Sony cho biết công ty sẽ ngưng bán đĩa mềm 3,5 inch tại Nhật Bản kể từ ngày 1/4/2011. Đây là một trong những cột mốc quan trọng đánh dấu chấm hết cho kỉ nguyên của loại đĩa mềm 3,5 inch.

Cách đây 3 thập kỉ, Sony giới thiệu loại đĩa mềm 3,5 inch đầu tiên trên thế giới vào năm 1981 và bắt đầu bán ra hai năm sau đó tại Nhật Bản. Theo Sankei News, doanh số đĩa mềm 3,5 inch đạt mức cao nhất vào những năm 2000 với 47 triệu đĩa, tuy nhiên đến năm 2009 vừa qua con số này chỉ còn 8,5 triệu.
Sony là hãng cung cấp đĩa mềm 3,5 inch lớn nhất thế giới. Năm 2008, công ty chiếm 40% thị phần trên cả thế giới, và 70% ở Nhật Bản.

Đĩa mềm 3,5 inch. Ảnh: wikimedia.
Gần như mọi công ty đã ngưng sản xuất cũng như hỗ trợ đĩa mềm 3,5 inch. Sony ngưng bán đĩa mềm 3,5 inch ở nước ngoài từ tháng trước, ngoại trừ Ấn Độ và một vài khu vực khác. Đến cuối tháng 3/2011, đĩa mềm 3,5 inch của Sony sẽ chính thức chấm dứt sự tồn tại trên thị trường.

Thứ Hai, 26 tháng 4, 2010

Bài quả banh di chuyển

Version 1: 1 quả banh di chuyển.
Chú ý: Hàm GetClientRect
The GetClientRect function retrieves the coordinates of a window's client area. The client coordinates specify the upper-left and lower-right corners of the client area. Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0).

// Single_Bound_Version1.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "resource.h"

#define MAX_LOADSTRING 100

// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text
//-----------Khai bao Single Ball-----------
enum {ID_MOVE_TIMER=1, ID_CHANGE_COLOR=2};
// Foward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
MSG msg;
HACCEL hAccelTable;

// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_SINGLE_BOUND_VERSION1, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);

// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}

hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_SINGLE_BOUND_VERSION1);

// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}

return msg.wParam;
}



//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// This function and its usage is only necessary if you want this code
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
// function that was added to Windows 95. It is important to call this function
// so that the application will get 'well formed' small icons associated
// with it.
//
ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;

wcex.cbSize = sizeof(WNDCLASSEX);

wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_SINGLE_BOUND_VERSION1);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = (LPCSTR)IDC_SINGLE_BOUND_VERSION1;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);

return RegisterClassEx(&wcex);
}

//
// FUNCTION: InitInstance(HANDLE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;

hInst = hInstance; // Store instance handle in our global variable

hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

if (!hWnd)
{
return FALSE;
}

ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

return TRUE;
}

//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
TCHAR szHello[MAX_LOADSTRING];
LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
//----------Khai bao cac bien trong bai Single Ball---------------
static int x=40, y=50, rBall=10, dx=5, dy=5, nCrIdx;
static COLORREF aColorTab[]={RGB(0xff,0xff,0xff),RGB(0,0xff,0),RGB(0xff,0,0),RGB(0,0,0xff),RGB(0xff,0xff,0),RGB(0xff,0,0xff),RGB(0,0xff,0xff)};
static int nColors= sizeof(aColorTab)/sizeof(aColorTab[0]);
//*********The End khai bao bien***************
switch (message)
{
case WM_CREATE:
SetTimer(hWnd,ID_MOVE_TIMER,10,NULL);
SetTimer(hWnd,ID_CHANGE_COLOR,1000,NULL);
break;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_TIMER:
switch(wParam)
{
case ID_MOVE_TIMER:
RECT rClient, r;
GetClientRect(hWnd, &rClient);
r.left=x-rBall-abs(dx);
r.right=x+rBall+abs(dx);
r.top=y-rBall-abs(dy);
r.bottom=y+rBall+abs(dy);
x=x+dx;
y=y+dy;
if(x+rBall > rClient.right && dx>0) dx = -dx;
if(x-rBall < 0 && dx<0) dx = -dx;
if(y+rBall > rClient.bottom && dy>0) dy=-dy;
if(y-rBall < 0 && dy<0) dy=-dy;
InvalidateRect(hWnd, &r,TRUE);
break;
case ID_CHANGE_COLOR:
++nCrIdx %=nColors;
break;
}
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
RECT rt;
GetClientRect(hWnd, &rt);
DrawText(hdc, szHello, strlen(szHello), &rt, DT_CENTER);
//---------Ve qua banh----------
HBRUSH hbr;
hbr=CreateSolidBrush(aColorTab[nCrIdx]);
SelectObject(hdc,hbr);
Ellipse(hdc,x-rBall,y-rBall,x+rBall,y+rBall);
DeleteObject(hbr);
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
KillTimer(hWnd, ID_MOVE_TIMER);
KillTimer(hWnd, ID_CHANGE_COLOR);
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}

// Mesage handler for about box.
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
return TRUE;

case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
}
return FALSE;
}

Những lí do khiến Wii bị loại khỏi cuộc chiến console

Cuộc chiến console đã bước vào năm thứ tư. Tuy nhiên khác với quãng thời gian trước đây, năm nay được dự báo là sẽ là một năm đánh dấu sự đi xuống của Nintendo cũng như của chiếc máy Wii lừng danh. Việc Wii sắp bị loại khỏi cuộc chiến console là một bất ngờ lớn nhưng với những phân tích dưới đây thì khả năng trên là hoàn toàn có cơ sở.

Mọi chuyện trong thời gian gần đây cũng đã thể hiện rõ nhận định trên. Trong khi PS3 và Xbox 360 đang cạnh tranh nhau quyết liệt thì Wii đang càng ngày càng được người ta nhắc đến ít hơn. Và khi công nghệ cảm ứng chuyển động vốn là lợi thế lớn nhất của Nintendo sắp không còn khi bộ đôi tay cầm NatalMove đến từ Microsoft và Sony sắp được phát hành thì số phận của Wii sẽ còn bi đát hơn nữa.
Rất nhiều người tin rằng Wii sẽ bị loại ra khỏi cuộc chiến console vào đầu năm sau. Một việc dường như là rất khó tin khi một năm trước chiếc console này còn độc tôn ở vị trí đầu bảng. Nhưng với những lí do dưới đây thì nhận định trên là hoàn toàn có cơ sở.

Chất lượng dở tệ của WiiWare

WiiWare là dịch vụ hỗ trợ khách hàng của Nintendo giống như PlayStation Network trên PS3 hay Xbox Live của Xbox 360. Thời gian đầu, dịch vụ này hoạt động khá tốt nhưng đến thời điểm hiện tại, khi mà hai đối thủ cạnh tranh phát triển không ngừng và liên tục đưa ra những bản cập nhật về cả nội dung lẫn tính năng thì WiiWare dường như vẫn “dậm chân tại chỗ” sau hơn 4 năm trời được phát hành. Nintendo không đưa ra được những cải tiến mới cho dịch vụ này của mình. Trên kho game của WiiWare vẫn chỉ là những trò chơi đơn giản và nhàm chán như World of Goo, Cave Story hay Bit. Trip...

WiiWare nghèo nàn về mặt nội dung
Không phải bất kỳ lúc nào game thủ cũng muốn thỏa sức phiêu lưu trong thế giới ảo, họ cũng có những nhu cầu giải trí khác và khi mà WiiWare không đáp ứng được nhu cầu này, sẽ có rất nhiều game thủ bỏ Nintendo để sang với các dịch vụ của Sony hoặc Microsoft.

Những món phụ kiện…vô bổ

Trong quá khứ, chuyện này đã từng xảy ra khi Nintendo phát hành camera cho Gameboy Advanced, một món phụ kiện mà nhiều game thủ vẫn thắc mắc không hiểu để làm gì. Mọi chuyện có vẻ như được lặp lại trên Wii thêm nhiều lần nữa.

Wii Motion Plus không có đột phá về công nghệ
Những sản phẩm như Wii Speak – thiết bị hỗ trợ game thủ chat bằng tiếng với bạn bè không có tác dụng nhiều lắm trong việc chơi game. Balance Board – thiết bị hỗ trợ cảm ứng trên Wii chỉ là một bản sao của Wii Fit và hoàn toàn không có tính năng gì đặc biệt. Ngay cả Wii Motion Plus, chiếc tay cầm được quảng cáo rầm rộ cũng không thành công như mong đợi do không có sự đột phá về công nghệ. Nintendo cần nhìn sang Microsoft với sản phẩm Project Natal – chiếc tay cầm vô hình, đó mới là một bước tiến đang kể trong làng game.

Cấu hình phần cứng lạc hậu

Yếu tố chính cho thành công của Wii trong suốt quãng thời gian qua là ở giá rẻ so với hai đối thủ cạnh tranh. Vào năm 2006, khi mới được phát hành, giá của Wii chỉ là 249 USD, bằng một nửa so với hai đối thủ PS3 và Xbox 360. Tất nhiên để có được mức giá trên, Nintendo đã phải giảm thiểu chi phí bằng cách xây dựng một nền tảng cấu hình thấp trên chiếc console này.

Game trên Wii thường có đồ họa đơn giản
Thời gian qua đi, khi mà Sony và Microsoft liên tục giảm giá sản phẩm của họ và cho đến nay cả hai hãng phát hành này đều có những mẫu máy có giá ngang ngửa với Wii thì cấu hình chính là điểm yếu lớn nhất được bộc lộ.
Các nhà làm game rất khó để xây dựng những trò chơi có đồ họa cao cấp hoặc cách chơi phức tạp trên một hệ máy đã lạc hậu quá xa về phần cứng như Wii. Ổ đĩa DVD cũng ngăn cản sự phát triển của chiếc máy này.
Trong khi đó, ngành công nghiệp game lại vẫn cứ phát triển với tốc độ vũ bão, và cuộc chạy đua về chất lượng hình ảnh trong game của các nhà phát hành càng khiến cho Wii bị đẩy xa hơn trong cuộc chiến console.

Chế độ chơi trực tuyến nghèo nàn


Wii không có nhiều game hỗ trợ phần chơi trực tuyến
Trong khi những phần chơi trực tuyến đã trở thành một phần không thể thiếu đối với bất cứ tựa game nào phát hành trên Xbox 360 hay PS3 thì dối với Wii, đây là một sự xa xỉ. Rất ít game trên hệ máy này có mục chơi mạng và có thì cũng rất nghèo nàn về mặt nội dung. Wii đúng là chiếc máy hướng đến giải trí gia đình chứ không phải cộng đồng nhưng tiếc thay xu thế của game thủ ngày nay là tham gia vào các mục chơi mang tính cộng đồng càng nhiều càng tốt. Điều này cũng góp phần làm Wii càng trở nên thua thiệt.

Sự quay lưng của các hãng phát hành

Wii có một lợi thế rất lớn đó là sự hậu thuận của Nintendo – một trong những hãng phát hành game lớn nhất toàn thế giới. Chính nhờ Nintendo mà những nhân vật đình đám nhất của làng game như Mario, Zelda hay Metroid M xuất hiện liên tục trên Wii.

Không có nhiều hãng phát hành thứ ba hỗ trợ Wii
Sức mạnh của “gà nhà” thì không phải bàn cãi nhưng Wii lại thiếu sự hỗ trợ của các hãng phát hành thứ ba. Do nền tảng phần cứng thấp cộng với cách chơi có phần lạ lùng nên không nhiều công ty lớn có hứng thú phát triển game cho hệ máy này. Những công ty hàng đầu thế giới như Activision chưa bao giờ làm game cho Wii.
Theo VTCnews

Chủ Nhật, 25 tháng 4, 2010

Giới thiệu SQL Server 2008

Microsoft SQl server là một hệ quản trị cơ sở dữ liệu quan hệ (relational database management system – RDBMS) do Microsoft phát triển. SQL Server là một hệ quản trị cơ sở dữ liệu quan hệ mạng máy tính hoạt động theo mô hình khách chủ cho phép đồng thời cùng lúc có nhiều người dùng truy xuất đến dữ liệu, quản lý việc truy nhập hợp lệ và các quyền hạn của từng người dùng trên mạng. Ngôn ngữ truy vấn quan trọng của Microsoft SQL server là Transact-SQL. Transact-SQL là ngôn ngữ SQL mở rộng dựa trên SQL chuẩn của ISO (International Organization for Standardization) và
ANSI (American National Standards Institute) được sử dụng trong SQL Server
.

Quay lại lịch sử, lúc đầu Microsoft đã quay sang kết hợp với công ty Sybase để cùng hợp tác làm ra một sản phẩm thuộc loại hệ quản trị cơ sở dữ liệu (Database Management System). Với sự hợp tác tốt đẹp, hai công ty này đã thành công cho ra đời một sản phẩm thuộc loại cơ sở dữ liệu có tên là Ashton-Tate vào năm 1989, sản phẩm này hoạt động trên môi trường OS/2. Sau đó một thời gian, Sybase đã phát triển sản phẩm này trên môi trường UNIX và đổi tên riêng là DataServer mà ngày nay còn có tên khác là Sybase Adaptive Server. Microsoft quyết định không phát triển hệ điều hành OS/2 mà thay vào đó cho ra đời một hệ điều hành mạng máy tính có tên là Windows NT Server. Và thế là SQL Serverchỉ hoạt động độc lập trên môi trường Windows NT Server mà thôi. Lần lượt các phiên bản của Microsoft SQL Server đã ra đời sau sự kiện này, từ 4.2 sau đó được nâng cấp thành 4.21, 6.0, 6.5, 7.0 và hiện giờ là Microsoft SQL Server 2000, 2005 và mới nhất là Microsoft SQL Server 2008.
II. Theo dòng lịch sử

SQL có nhiều phiên bản, ở đây tôi xin nhấn mạnh một số phiên bản nổi bật:

- SQL Server 2005: SQL Server 2005, được phát hành vào tháng 11 năm 2005, là phiên bản tiếp theo của SQL Server 2000. SQL Server 2005 tập trung vào khả năng xử lý giao dịch trực tuyến trên diện rộng OLTP ( large-scale online transactional processing), ứng dụng thương mại điện tử (e-commerce applications) và kho dữ liệu (data warehousing). Ngoài ra, những cải tiến quan trọng trong SQL Server 2005 là thêm các dịch vụ mới như: dịch vụ báo cáo Reporting Services, Service Broker và sự thay đổi đáng kể trong Database Engine.

- SQL Server 2008:Đây là phiên bản mới nhất của SQl Server, có tên mã là “katmai”. Ngày 27/02/2008 , Microsoft tổ chức một sự kiện có tên Heroes Happen Here nhằm giới thiệu sản phẩm mới SQL Server 2008 (cùng với những sản phẩm khác như Windows Server 2008; Visual Studio 2008). Bản SQL Server 2008 Release Candidate sẽ được trình làng trong quý II, trong khi đó, bản hoàn chỉnh sẽ mắt trong quý III (2008).

III. Microsoft SQL Server 2008 – người bạn đường tin cậy:

Để xứng đáng là một người bạn đường tin cậy, Microsoft SQL server 2008 có những điểm mới, tiến bộ sau:

Một trong điểm nổi bật khi xem xét về SQL Server 2008 của Microsoft là tính năng phân loại biệt ngữ mới và các lợi ích vào trong nhóm hoặc các vùng chính. Có bốn vùng chính đó là Enterprise Data Platform, Dynamic Development, Beyond Relational Database, và Pervasive Insight.

SQL Server 2008 có tác dụng đòn bẩy cho công nghệ .NET 3.0 (Dot Net Framework 3.0) với LINQ (Language Integrated Query – ngôn ngữ truy vấn tích hợp). Thêm vào đó là sự hỗ trợ hiệu quả hơn cho các thực thể dữ liệu doanh nghiệp cùng với các tùy chọn đồng bộ dữ liệu.

Tóm lại: SQL Server 2008 có nhiều cải thiện hữu dụng và thiết thực. Có liệt kể một cách sơ lược như sau:

- Mã hóa dữ liệu: trong suốt cho phép toàn bộ cơ sở dữ liệu, các bảng và dữ liệu có thể được mã hóa mà không cần phải lập trình ứng dụng. Trong SQL Server 2008, toàn bộ cơ sở dữ liệu đều có thể được mã hóa bằng SQL Engine. Phương pháp này mã hóa tất cả dữ liệu và các file bản ghi cho cơ sở dữ liệu. Bằng sử dụng phương pháp này, tất cả các chỉ mục và bảng cũng được mã hóa.

Tính năng mã hóa tiếp theo là Backup Encryption. SQL Server 2008 có một phương pháp mã hóa các backup dùng để tránh lộ và can thiệp của người khác vào dữ liệu. Thêm vào đó, việc phục hồi backup có thể được hạn chế với từng người dùng cụ thể.

Cuối cùng, có một số tùy chọn mới cho External Key Management. Nếu bạn có dính dáng tới việc xử lý thẻ tín dụng hoặc PCI (thẻ trả trước), thì SQL Server 2008 sẽ hỗ trợ Hardware Security Modules (HSM) – mô đun bảo mật phần cứng. Các mô đun này là giải pháp phần cứng của nhóm thứ ba được sử dụng để lưu các Key ở một địa điểm phân biệt với dữ liệu mà chúng bảo vệ.

- Backup có thể được mã hóa để ngăn chặn việc lộ và thay đổi dữ liệu. Sự thay đổi và truy cập dữ liệu có thể được thẩm định Thêm vào việc thẩm định chuẩn cho logon / logoff và các thay đổi được phép, SQL Server 2008 cho phép kiểm tra sự thay đổi hay truy cập dữ liệu.

- Fact Tables có thể được nén với hiệu suất cao.. SQL Server Data Compression đã thực sự thực hiện được mục tiêu chính là giảm kích thước của Fact Table. Vì vậy liên quan với việc lưu trữ trên các ổ đĩa cứng, với các file vật lý nhỏ hơn, số lần backup được giảm

- Tài nguyên chủ có thể được bảo đảm an toàn. Quản lý tài nguyên - Resource Governor - trong SQL Server 2008 cũng là một điểm mới. Governor được sử dụng để hạn chế người dùng hoặc nhóm người dùng chi phối các lớp tài nguyên mức cao. Điểm mới trong SQL Server 2008 phải kể đến nữa là Performance Studio. Studio là một trong các công cụ hiệu suất. Cùng với đó chúng có thể được sử dụng cho việc kiểm tra, xử lý sự cố, điều chỉnh và báo cáo. Thành phần Data Collector của Studio có thể cấu hình. Nó hỗ trợ một số phương pháp chọn gồm có các truy vấn TSQL, SQL Trace, và Perfmon Counters. Dữ liệu cũng có thể được chọn bằng lập trình. Khi dữ liệu được chọn, có các tùy chọn báo cáo chung.

- SQL 2008 hỗ trợ Hot Plug CPU. trong SQL Server 2008, các CPU cắm thêm có thể được bổ sung vào nếu phần cứng của hệ thống hỗ trợ nó

- Bộ đếm hiệu suất được mở rộng. Số bộ đếm hiệu suất trong SQL Server 2008 đã được mở rộng hơn so với phiên bản trước đó. IO và các bộ đếm hiệu suất bộ nhớ là một cặp có thể được chọn để kiểm tra hiệu suất. Dữ liệu đã được chọn bằng bộ đếm sẽ được lưu trong trung tâm lưu dữ liệu tập trung. Microsoft phát biểu rằng việc chạy thiết lập hiệu suất mặc định liên quan đến các kiểm tra sẽ tốn ít hơn 5% tài nguyên bộ nhớ và CPU.Có một công cụ Performance Dashboard có thể đọc dữ liệu hiệu suất đã được lưu.

- Việc cài đặt đã được đơn giản hóa. Bộ đặt SQL Server 2008 cũng có nhiều nâng cao. Dữ liệu cấu hình và các bit “engine” được tách biệt vì vậy nó có thể tạo một đĩa hệ thống không cấu hình cơ bản phân phối đến một số máy chủ dễ dàng hơn. Cài đặt có thể cập nhật được các nâng cấp mới nhất từ website Microsoft. Tính năng khác là khả năng cài đặt SQL Server, gói dịch vụ và các bản vá. Đi cùng với tính năng này là khả năng gỡ bỏ cài đặt các gói dịch vụ một cách dễ dàng.



Link download SQL Standard 2008
Part 12: http://www.mediafire.com/download.php?mikzztemtjl

Sau khi giải nén xong thành 1 file có dạng ISO bạn có thể dùng Nero hay Ultral Iso để ghi, hoặc sử dụng ổ đĩa ảo để sử dụng. Chúc các bạn thành công.


(Theo  heroeshappenhere.vn)

Bài đăng phổ biến