Paging (asynchronous refresh) and paging (asynchronous refresh)
<Script type = "text/javascript"> _ jsonData = []; $ (function () {// Generate Test Data -- json for (var I = 0; I <200; I ++) {_ jsonData. push ({name: "James" + (I + 1), pwd: "123456abc" + (I + 1), age :( I + 1)});} pageTotal. getDate (1, 1); // alert (_ jsonData. length) ;}); // encapsulate the paging data var pageTotal = {current: 1, // pageCount: 8 on the current page, // The data volume displayed on each page count: 0, // total data volume total: 0, // total page number first: 1, // homepage last: 0, // last page pre: 0, // previous page next: 0, // Next page getPages: function () {// calculate the page information pageTotal. total = Math. ceil (pageTotal. count/pageTotal. pageCount); pageTotal. last = pageTotal. total; pageTotal. pre = pageTotal. current-1 <= 0? 1 :( pageTotal. current-1); pageTotal. next = pageTotal. current + 1> = pageTotal. total? PageTotal. total :( pageTotal. current + 1) ;}, // get data getDate: function (pageno, type) {// clear all content data and elements $ ("# tbcontent "). empty (); if (pageno = null) {pageno = 1 ;}// set pageTotal on the current page. current = pageno; pageTotal. count = _ jsonData. length; // set the number of data entries displayed on each page. pageTotal. pageCount = 8; // paging information for (var I = (pageno-1) * pageTotal. pageCount; I <(pageTotal. current) * (pageTotal. pageCount); I ++) {$ ("# tbcontent "). appen D ("<tr> <td>" + _ jsonData [I] ["name"] + "</td> <td>" + _ jsonData [I] ["pwd "] +" </td> <td> "+ _ jsonData [I] [" age "] +" </td> </tr> ");} // obtain the pageTotal style. page (type); // type indicates the page bar style}, page: function (type) {// clear the page bar element $ ("# pages "). empty (); // fill in the paging style. pageTotal is not to be loaded. getPages (); if (type = 1) {var x = 6; // set the upper and lower pages $ ("# pages "). append (pageTotal. current + "/" + pageTotal. total + "<a href = 'javascript: pageTotal. getDate (1, "+ type + ");'> Homepage </a> "); var index = pageTotal. current <= Math. ceil (x/2 )? 1 :( pageTotal. current)> = pageTotal. total-Math.ceil (x/2 )? PageTotal. total-x :( pageTotal. current-Math. ceil (x/2); var end = pageTotal. current <= Math. ceil (x/2 )? (X + 1) :( pageTotal. current + Math. ceil (x/2)> = pageTotal. total? PageTotal. total :( pageTotal. current + Math. ceil (x/2); for (var I = index; I <= end; I ++) {if (I = pageTotal. current) {$ ("# pages "). append ("<a href = 'javascript: pageTotal. getDate ("+ pageTotal. current + "," + type + "); 'class = 'on'>" + I + "</a> ");} else {$ ("# pages "). append ("<a href = 'javascript: pageTotal. getDate ("+ I +", "+ type +"); '> "+ I +" </a> ") ;}} if (end! = PageTotal. total) {$ ("# pages "). append ("<span>... </span> ") ;}$ (" # pages "). append ("<a href = 'javascript: pageTotal. getDate ("+ pageTotal. last + "," + type + "); '> last page </a>") ;}}; </script>
What are the differences between DRAM's centralized refresh, decentralized refresh, and asynchronous refresh policies?
The charge of the capacitor in DRAM is lost every 2 ms, so it must be supplemented within 2 ms. Charge filling is performed by row. In order to [all] the memory can save the charge, you must supplement the [all] rows.
Assume that the refresh time for one row is 0.5 μs (the refresh time is equal to the access cycle. Because the refresh process is the same as an access, but the input and output are not on the bus. By the way, the access period> the real time used for access, because it still takes some time to change the status after the access period and the end of the access operation. -- This is also true for SRAM, especially for DRAM ).
It is assumed that the storage unit (1B/unit) is divided into 64 rows and 64 columns.
(64 × 64 units × 1B/unit = 2 ^ 12 units × 1B/unit = 4 kb memory ).
Centralized Refresh: when the time is approaching 2 ms, stop all read operations on the memory, and use 0.5 μs x 64 to refresh 64 rows in sequence. This will take up 3.2 μs. In these 3.2 μs, the memory is only used to refresh and block all access operations.
I would like to add: Why cannot refresh and access be done in parallel? : Because the memory is a set of address decoding and chip selection devices, the refresh process is similar to the access process. It needs to select a line. During this period, the line selection, address line, and address decoder are all occupied. Similarly, refresh operations cannot be parallel-meaning that only one row can be refreshed at a time.
Distributed Refresh: bind a refresh operation after each access operation. In this way, the access cycle becomes 0.5 μs + 0.5 μs =
1 μs. It extends the access period. However, because it is bound to an access operation, you do not need to refresh it for a period of time. In this way, every 64 read operations will refresh all rows 0 to 63 (64 rows in total. Because the refresh process is interrupted and cyclically refreshed 64 rows in sequence, for the same row, every 64 reads will be refreshed-its refresh cycle is 1 μs × 64 = 64 μs <2 ms, which will be promptly supplemented before 2 ms of charge loss.
Asynchronous Refresh: The refreshing cycle of distributed refresh is 64 μs. In fact, it does not need to be so frequent, which is a waste of resources. asynchronous refresh is just stuck at the time point of 2 ms. It is sufficient for each row to take 2 ms as the refresh cycle, and the refresh cycle must be 64 refresh operations. The interval of 2 ms to 64 is used as the [refresh cycle ], (note that each refresh cycle is different from the refresh cycle of a specific row: The interval between each refresh refers to the interval for the memory to perform a refresh operation, the refresh row is the next row of the last refresh row-two different rows, but it is indeed the interval of two refresh operations for the global memory. The refresh cycle of a specific row: The interval between the next refresh, during which it will be obtained after 64 memory refresh cycles .) After 64 times, the refresh cycle of each row is guaranteed to be 2 ms. The refresh operation cycle is 2 ms to 64. However, this time is not bound to the access period, so it is still the time when access is denied. But it is small. Therefore, this refresh policy is very feasible.
Asynchronous MVC Paging
Asynchronous: ajax. I usually use jquery here.
$. Ajax ({
Url: "controller location/method name ",
Type: "post ",
Data: {pageIndex: page number, pageCount: page number },
Success: function (data)
{
// Bind data to the page
}
});
Controller code:
Public ActionResult method name (int pageIndex, int pageCount)
{
// Access The bll layer to obtain data
}