Refuse collection Fun History (reproduced)

  Refuse collection Fun History (reproduced) 

  Fun history ??????????????????????????????????????????? refuse collection (to ) 

  ?????????????????????????????????????????????????? ? Yong Wang Gang, December 2003 

  Writing the original intention of this paper is to share with you refuse collection (Garbage Collection) technology simple and interesting history of the development.    Start, I stood window, Wangliaowang shipment of garbage in the area is clean cars.    And the life of sanitation workers refuse work similar to Qingyun, software development, refuse collection is actually an automatic cleaning and garbage removal of the memory technology, it can effectively prevent dynamic memory allocation may occur in the two dangers: refuse because of memory caused by excessive depletion of memory (this plug and garbage and sewage pipes dangerous no essential difference), as well as improper release of memory caused by the illegal use of memory (similar to us in this life buy a bottle of 2003 has expired milk). 

  According to historians, more than 4,000 years ago the ancient Egyptians has been in the city for improving the building of the sewage and garbage Clearance facilities, more than 1,000 years ago the Chinese people is to build the capacity of the world at the time cleaning the strongest city - Chang'an.    Today, as we experience in software development in the automated refuse collection convenient and comfortable, we should at least know that this kind of refusal, cluttered, clean and the pursuit of the "garbage collection" is the spirit of mankind since ancient times has had on the. 

?

  Wild times 

  ————————————————– ————————————————– — 

  Most domestic programmers in the Java language is the first time in refuse collection technology feel the tremendous charm, and so many people to see Java and garbage collection has become inseparable from the overall.    But in fact, refuse collection technology in the Java language come out as early as 30 years ago has been developing and mature, the Java language is doing this wonderful technology to the majority of programmers around it. 

  If it must be for garbage collection techniques to find a twin brother, then Lisp language is worthy candidates.    Was born in 1960 after the MIT Lisp language is the first highly dependent on dynamic memory allocation technical language: Lisp data in almost all "table" in the form of, and "Table" is the space occupied by the pile The dynamic allocation.    Lisp language is innate to the requirements of dynamic memory management features of the Lisp language designers must address each and every pile of automatic memory block release (Otherwise, Lisp programmers in the process is bound to be countless free or delete words drowned), This led directly to the garbage collection techniques to the birth and development - say the way, the university, a teacher told us, Lisp modern software development is the biggest contribution to the technical language.    At that time, I take exception to this statement: full of parentheses, the maze looks like the same language how can Lisp language than C or Pascal language more great?    But now, when I know that garbage collection techniques, data structure technology, and artificial intelligence techniques, parallel processing technology, virtual machine technology, metadata technologies, as well as programmers familiar with the origin of many of technologies in the Lisp language, I would particularly like him, teachers face-to-face apology, and then withdraw my naive idea. 

  Know the Lisp language and refuse collection close relationship, we would not difficult to understand why the two refuse collection technology pioneer J. McCarthy and ML Minsky Lisp language is also an important figure in the history of the development of the.    J. McCarthy is the father of Lisp, he invented the Lisp language at the same time the first complete description of the garbage collection algorithm and the realization; ML Minsky in the Lisp language development in the process of becoming today several mainstream refuse collection Algorithm of the founders of - and then a number of technical experience similar to the Masters, J. McCarthy and ML Minsky in many different areas of technology has been achieved is the envy of many achievements.    Perhaps, in the 1960s that the history of the pioneering software development era, their thinking is quick, strong-willed researchers more easily become omnipotent Western tough guy bar. 

  In the understanding of the origin of the refuse collection algorithm, it is necessary to look at the main form of memory allocation.    We know that the majority of mainstream language or operating environment supports three basic memory allocation, they are: 

  A static allocation (Static Allocation): static variables, and global variables of the form of distribution.    We can be as static allocation of memory is the home durable furniture.    Usually, they will not release and recovery, because no one will be the big day as garbage thrown into the window wardrobe. 

  Second, the automatic distribution (Automatic Allocation): stack memory allocation for local variables approach.    Stack memory with the code block can withdraw from the operation of a stack automatically released.    Guanmen similar to the home in which the visitors, the weather will be back for one night each, in addition to nine weeks unless the individual other than those, we generally do not need to bundle guests in the garbage bag扫地出门. 

  Third, the dynamic allocation (Dynamic Allocation): Reactor dynamic allocation of memory space to store data approach.    Reactor block of memory we use every day like the napkin, used a litter bins have to throw, it will be Montreal狼藉house.    The lazy people like me want to have a dream home with the robot around cleaning.    In software development, if you bother to release memory, then you also need a similar robot - this is actually a specific algorithm for garbage collection. 

  In other words, all mentioned below, the garbage collection algorithms are in the process of operating procedures for the collection and liquidation of used "napkin" algorithm, and their operation is not a static object variable, not local variables, but all have been allocated Reactor memory block. 

?

  Reference count (Reference Counting) algorithm 

  ————————————————– ————————————————– — 

  Before 1960, people in the embryonic design language Lisp garbage collection mechanism, the first think of the algorithm is invoked counting algorithm.    Take Napkin example, the principles of this algorithm can generally be described as: 

  Lunch, in order to suddenly jumped out to the minds of the design inspiration remember, I napkin out of a paper napkin bag, intended to draw in the above blueprint for the structure of the system.    According to the "paper napkin use of the reference count version of the Statute," and drawing before, I must first of the iceberg in the paper napkin to write on a numerical terms, I said that in order to use this napkin.    At this time, if you would like to look at the blueprint of my paintings, then you should napkin on the numerical increase of 1, it will be 2, which shows that there are two individuals in the use of this paper napkin at the same time (of course, I do not This will allow you to use the napkin to Cabiti).    After reading you must be a reduction of value that you use the paper napkin has been concluded.    Similarly, when I will napkin on the contents of the notebook on the transcription of all, I will consciously on the paper napkin by a numerical terms.    At this time, no accident, of this paper napkin on the numerical should be 0, it will be garbage collection - an assumption that is dedicated to cleaning robot - picked up to throw litter bins, because refuse Ji traps the only mission is to find all of the values 0 and clean up their napkin. 

  Counting algorithm used the advantages and shortcomings equally clear.    In the implementation of this algorithm for garbage collection tasks faster, but the algorithm to process each memory allocation and operational guidelines put forward additional requirements (increase or decrease the reference count memory block).    More importantly, the reference count algorithm can not invoke the right to release cycle memory block, which, D. Hillis there is a witty and incisive exposition: 

  Day, a student come before Moon said: "I know how to design a better garbage collection on the planet. We must be recorded at each node of the target number." Moon patiently to the students at the Below this story : "One day, a student come before Moon said: 'I know how to design a better garbage collection for the……'" 

  D. Hillis stories and we often say that the child "There was once mountains, the mountains have a temple, the temple has a old monk," the story of a similar Miao.    This shows that the use of the reference count alone is not sufficient to solve the algorithm also refuse collection in all the problems.    Precisely for this reason, the reference count algorithm researchers also often excluded from the narrow garbage collection algorithm outside.    Of course, as one of the simplest and most intuitive solution, the reference count algorithm itself with its irreplaceable advantages.    Before and after the 1980s, DP Friedman, DS Wise, HG Baker, who counts the application of a number of improved algorithms, these improvements make reference count algorithm and its variants (such as delay counting algorithm, etc.) in a simple environment, or in some integrated a variety of algorithms in modern garbage collection system can still display its ability. 

?

  Marker - removal (Mark-Sweep) algorithm 

  ————————————————– ————————————————– — 

  The first practical and comprehensive garbage collection algorithm is J. McCarthy, who in 1960 proposed and successfully used in Lisp language markings - removal algorithm.    Still napkin for example, marked - removal of the implementation of the algorithm is this: 

  Lunch process, all the restaurants according to their own needs access to paper napkin.    When the robot to collect the refuse collection of waste paper napkin when it will all meals to the people to stop, and then were asked everyone in the restaurant: "You are used napkin? You which one is used Napkin? "robot according to each person's answer to the use of the napkin are being drawn mark.    Asked after the end of the process, the robot in the cafeteria for all scattered on the table and not in the marked paper napkin (these are clearly used scrap paper napkin), they threw all the bin. 

  As implied by its name, as markers - removal of the implementation of the algorithm is divided into "tag" and "get rid of" two major stages.    This step-by-step implementation of the ideas for a modern garbage collection algorithm ideological foundation.    And the reference count algorithm difference is that the marker - removal algorithm that does not require environmental monitoring every memory allocation and operation guidelines, as long as the "marker" in the track every stage of a pointer variable point - with similar ideas to achieve the refuse collection for future generations is often collectively referred to as track collection (Tracing Collector) 

  Lisp language along with the success of markers - algorithm also remove most of the early running Lisp environment at home.    Although the initial version of the marker - removal algorithm seems there are still not high efficiency (marking and clearance are two very time-consuming process), and many other flaws, but in the back of the discussion, we can see that almost all modern refuse Ji collection algorithms are marked - remove thinking of the continuation of this alone, J. McCarthy, and others in the technical aspects of the refuse collection at all inferior to their contribution to the Lisp language in the accomplishment. 

?

  Copy (Copying) algorithm 

  ————————————————– ————————————————– — 

  In order to address marker - removal algorithm in refuse collection efficiency shortcomings, ML Minsky in 1963, the Commission published a famous paper "a dual-language Lisp storage area of refuse collection (A LISP Garbage Collector Algorithm Using Serial Secondary Storage) . "    ML Minsky in the algorithm described in the paper was known as the replication algorithm, it is also ML Minsky I successfully introduced to the realization of a Lisp language version. 

  Replication algorithm ingenuity to heap space will be divided into two, and use simple copy operation to complete garbage collection, the very interesting ideas.    Napkin borrow an analogy, we can understand ML Minsky replication algorithm: 

  Restaurant robot refuse collection was divided into South and the North two identical size of the part.    Lunch, all first meal in the Southern District (because space is limited, the number of meals will also be reduced by half natural), dining, can use paper napkin.    When the refuse collection robot consider it necessary to the recovery of waste paper napkin, it will require all meals are the fastest transfer from the South to the North, at the same time carrying their own are using paper napkin.    Etc. all have shifted to the North, the robot can simply refuse collection in the Southern District all thrown into the rubbish bins scattered napkin even completed the task.    The next refuse collection process also broadly similar, the only difference is the direction of the transfer of a people from the North to the Southern District.    So on each garbage collection are simply transferred (ie copy) first, refuse collection rate unmatched - of course, the diner go back and forth between north and south between the two hard, refuse collection machinery people will not reveal the slightest compassion. 

  ML Minsky invention is calculated on a brainstorms.    Division, the idea of copying not only substantially increase the efficiency of the refuse collection, but also will be offered by the original fan complex memory allocation algorithms become an unprecedented concise and brief (since each memory recovery is the whole half of the recovery of memory distribution of debris memory will not consider such complex situations, as long as the top mobile stack pointer, in order to be a memory allocation), which it is a miracle!    However, any miracle to happen to a certain extent the cost of refuse collection in the technology, replication algorithm efficiency is the price artificially reduced memory will be available in half.    Call a spade a spade, the price would be too high a number also. 

  No matter how the advantages and disadvantages, in practice replication algorithm can be and have been marked - removal algorithm comparable to success.    In addition to ML Minsky I Lisp language in the work, from the late 1960s to the early 1970s, RR Fenichel and JC Yochelson, also have been different in the Lisp language in the replication algorithm to achieve an improved S. Arnborg more successful replication algorithm to be applied to the Simula language. 

  At this point, the three garbage collection techniques traditional algorithms - the reference count algorithm, marking - removal algorithm and replication algorithm - have been around in 1960 have been transformed algorithm three strengths, there are fatal flaws.    From the late 1960s, the researchers gradually shift the main energy of this three traditional integration algorithm to improve or to the non-adjustment process design language and operating environment on the efficiency of refuse collection and real-time nature of the higher requirements. 

?

  Toward maturity 

  ————————————————– ————————————————– — 

  From the beginning of 1970, with the application of scientific research and practice of in-depth, people gradually realized that an ideal garbage collectors in the operation should not lead to the suspension of applications should not take a lot of extra memory space and CPU resources , and three traditional garbage collection algorithms are unable to meet these requirements.    People must update algorithms or ideas to solve the practice of the many problems encountered.    At that time, the efforts of researchers objectives include: 

  First, to increase the efficiency of refuse collection.    Use markers - removal of the garbage collection algorithm for the job, to spend a considerable amount of CPU resources.    Lisp environment of the early running time garbage collection memory of the system has accounted for the total running time of 40 percent!    — Garbage collection directly to the low efficiency of the Lisp language created in the implementation of the reputation for speed; Even today, many people also conditioned reflex moment misconception that all Lisp programs Aiman immense. 

  Second, reduce the amount of garbage collected in the memory footprint.    This problem occurred mainly in the replication algorithm.    Although replication algorithm efficiency was a qualitative breakthrough, but the expense of half the cost of memory space is still huge.    Early in the development of the computer, the price to KB in memory of the day, wasted memory space, half of it is highway robbery or extortion in disguise. 

  Third, the search for real-time garbage collection algorithms.    No matter how efficient implementation of the three traditional garbage collection algorithms in the implementation of its mandate refuse collection procedures must interrupt the current work.    This garbage collection because the delay is caused by many procedures, in particular the implementation of mission-critical procedures not tolerated.    How to improve on the traditional algorithms, in order to achieve implementation of a quietly in the background, without affecting - or at least appear not affect - the current process of real-time garbage collector, which is obviously a more challenging task. 

  The researchers explore areas of the unknown and the research work of the determination of the rate of progress is equally surprising: in the 1970s to the 1980s in a short span of 10 years, a large number of practical systems in the outstanding performance of the new algorithm, and new ideas come to the fore.    It is precisely because these are maturing of the refuse collection algorithm, we can today or in Java. NET runtime environment in the allocation of memory segments as it pleases, without worrying about the risks of space release. 

?

  Marker - processing (Mark-Compact) algorithm 

  ————————————————– ————————————————– — 

  Marker - finishing algorithm is marked - removal algorithm and the organic integration of replication algorithm.    The marker - removal algorithm in the memory footprint on the merits and replication algorithm efficiency in the implementation of the talent together, this is all want to see results.    However, the two refuse collection algorithm integration is not as a plus 1 equal 2 as simple as that, we need to introduce some new ideas.    Before and after 1970, GL Steele, CJ Cheney and DS Wise, and other researchers have found the right direction, mark - finishing the contour algorithm gradually clear up: 

  We are familiar with the restaurant, this time, refuse collection robot to the restaurant no longer divided into two regions of North and the South.    The need to implement garbage collection tasks, the robot to the implementation of labeling - removal of the algorithm as a first step, for all the use of the napkin drawn in marker, and then ordered all the city of robot bring marked paper napkin to a restaurant on the south , and the unmarked waste paper napkin thrown at a restaurant north.    As a result, the robot only dissolve at the restaurant north, the embrace of litter bins, the waste paper napkin to meet Maryland on the trip. 

  Experiments show that, mark - finishing algorithm more efficient than the overall implementation marker - removal algorithm, and replication algorithm did not need to sacrifice half of the storage space, which is obviously a very positive outcome.    In many modern garbage collectors, people have used markers - or finishing their improved algorithm version. 

?

  Incremental collection (Incremental Collecting) algorithm 

  ————————————————– ————————————————– — 

  The real-time garbage collection algorithm research led directly to the birth of incremental collection algorithm. 

  Initially, people on the idea of real-time garbage collection is this: In order to carry out real-time garbage collection, the process can be designed more than one operating environment, such as the implementation of a garbage collection process, the process of the implementation of another code.    As a result, garbage collection looked on quietly in the background as if completed, would not interrupt the operation of the code. 

  Napkin examples in the collection, this line of thought can be understood as: refuse collection robot in people dining at the same time find the abandoned paper napkin and throw them in the rubbish bins.    This seemingly simple ideas in the design and realization of the process came when the conflict between problems.    For example, if garbage collection process includes two working marking and clearance stage, then, garbage collectors have worked hard in the first stage of the marked results are more likely to be another memory in the process of amending the code tore operation, so the second phase of the work not carried out. 

  ML Minsky DE Knuth and the real-time garbage collection process for the technical difficulties of the early research, GL Steele in 1975 published an article entitled "the process of finishing more garbage collection (Multiprocessing compactifying garbage collection)," the paper describes the one was later known as the "Minsky-Knuth-Steele algorithm" real-time garbage collection algorithms.    EW Dijkstra, L. Lamport, RR Fenichel and JC Yochelson, and others in this field have also made its own contribution.    In 1978, HG Baker issued a "serial form on the computer-processing technology (List Processing in Real Time on a Serial Computer)," an article on the multi-process system environment for the collection of refuse collection incremental algorithm. 

  Incremental collection algorithm is the basis of the traditional markers - removal and replication algorithm.    Incremental collection algorithm through the process properly deal with the conflict between allowing garbage collection process in a phased manner markings, clean-up or replication work.    Detailed analysis of the internal algorithm incremental collection mechanism is a very complicated thing, where readers need to know simply: HG Baker, who has been the efforts of real-time garbage collection will be a dream become a reality, we again they do not have to interrupt procedures for garbage collection and the operation of the trouble. 

?

  At the collection (Generational Collecting) algorithm 

  ————————————————– ————————————————– — 

  And the majority of software development technology, the statistical principle of technological development in the process of a powerful catalyst role.    Before and after 1980, and be good at the use of statistical analysis in the study of knowledge and technical personnel found that the majority of memory blocks shorter than the life-cycle, garbage collectors should be greater energies on the new inspection and cleaning up the allocation of memory on the block.    This found that the value of garbage collection techniques can be used paper napkin example can be summarized as follows: 

  If refuse collection robot smart enough in advance to ascertain the restaurant every person in the use of paper napkin dining habits - such as some people like before and after the meal spent a paper napkin, and some people like the one were formed throughout Zhang napkin tightly, and some people are fighting each spent a sneeze on a paper napkin - robot can be developed to improve the paper napkin recovery plan, and people always just throw away rubbish put napkin Not long haul walk.    Based on the statistical principle of this approach can certainly let the cleanliness of the restaurant improved several times over. 

  DE Knuth, T. Knight, G. Sussman and R. Stallman memory, and others refuse to do a deal with the classification of the earliest studies.    1983, H. Lieberman and C. Hewitt delivered a speech entitled "Object-based life of a real-time garbage collection (A real-time garbage collector based on the lifetimes of objects)" papers.    This famous paper at the gathering marked the official birth of the algorithm.    Since then, in the HG Baker, RL Hudson, JEB Moss and others to the concerted efforts of the generation algorithm gradually become a collection of refuse collection in the field of mainstream technology. 

  - Generation algorithm will normally collected a pile life by the memory block is divided into two categories, the elderly and the young.    Refuse collection for the use of different algorithms or collecting collection strategies, dealing respectively with these two types of memory blocks and, in particular, to the main work of the time spent on dealing with young memory block.    Algorithm-generation collection of the refuse collection in conditions of limited resources, they can work more effectively - this increase in the efficiency of today's Java Virtual Machine have been the best proof. 

?

  Application wave 

  ————————————————– ————————————————– — 

  Lisp garbage collection technology is the first beneficiaries, but apparently not the last one.    In the Lisp language, many traditional, modern, post-modern language of the refuse collection technology has been dragged into the embrace of their own.    It lightly a few examples: born in 1964 in Simula language, Smalltalk language of the 1969, 1970, Prolog language, the ML language in 1973, in 1975 the Scheme language, in 1983 the Modula-3 language, the 1986 Eiffel language, the 1987 Haskell…… language they have used the automated refuse collection technology.    Certainly, the use of a language of the refuse collection algorithm may not be the same, the majority of language and runtime environment even at the same time using a variety of garbage collection algorithms.    But no matter what, these examples demonstrate, garbage collection technology from the birth of the day is not a Qugaohegua "School" technology. 

  We are familiar with the C and C + + language, refuse collection technology can play a tremendous effect.    As in our schools on already know, C and C + + language itself does not provide garbage collection mechanism, but this does not prevent us from the procedures used in garbage collection function of a library or libraries.    For example, as early as in 1988, HJ Boehm and AJ Demers on the successful realization of a conservative use of garbage collection algorithm (Conservative GC Algorithmic) library (see http://www.hpl.hp.com/personal/Hans_Boehm / gc).    We can be in the C language or C + + language used in the completion of the library automated refuse collection functions and, when necessary, they can even let the traditional C / C + + code and the use of automatic garbage collection function of C / C + + code in a collaborative process, work. 

  1995 birth of the Java language in the overnight garbage collection technology into the software development field one of the most popular technology.    From a certain angle, it is difficult to distinguish between what is Java benefit from the refuse collection, refuse collection technology itself or by the popularity of Java and fame.    It is worth noting that different versions of the Java virtual machine use of the refuse collection mechanism is not exactly the same Java virtual machine has also been a fact from simple to complex development process.    In the Java Virtual Machine 1.4.1 version, people can experience the refuse collection points generation algorithm including collection, reproduction collection, incremental collection, labeling - finishing, parallel replication (Parallel Copying), parallel clearance (Parallel Scavenging) , with (Concurrent) collection, and many other species, the speed of Java programs run in the continuous improvement should be attributed to garbage collection to a large extent the development and improvement of technology. 

  Although history has many refuse collection contains the application platforms and operating systems, but Microsoft. NET is the first truly practical, refuse collection mechanism contains the common language runtime environment.    In fact,. NET platform for all languages, including C #, Visual Basic. NET, Visual C + +. NET, J #, etc., you can almost identical manner. NET platform provided by the garbage collection mechanism.    It seems that we can assert that. NET is the refuse collection in the application of technology in the field of a major change, it makes garbage collection technology from a pure technology into the operating system and application environment of an inherent culture.    This change in the future software development technology's influence may be far from over. NET platform itself, the commercial value. 

?

  The trend of the times 

  ————————————————– ————————————————– — 

  Today, the garbage collection techniques to study people still unremitting efforts, the direction of their research, including Distributed System garbage collection, complex environment affairs under the garbage collection, database and other system-specific refuse collection and so on. 

  But programmers in the middle, there are still many people refuse collection technology dismissive, they prefer to believe their own progressive prepared by the free or delete orders, and unwilling to refuse collection to the heavy responsibility of those who, in their view not only stupid Also stupid garbage collector. 

  I personally think that the popularity of refuse collection technology is the trend of the times, it is like life, like no doubt will become better and better.    Today's programmers may be because the garbage collector to occupy some of its resources away from CPU, but more than 20 years ago because the high-level language programmers also slow and persist in using the machine language written procedures?    Advances in hardware speed today, we have to be a little bit Linxi the wear and tear of time not hesitating Chu, or stood firmly in the code and runtime environment purification agent - refuse collection side? 

?

  Posted on 2006-11-04 16:10 Ma Jianan reading (144) Comments (0) edit their collections quoted Category: Technical Aspects 

WEB Print Daquan

  WEB Print Daquan 

  1, a longitudinal control, Wang fight "and" page margins. 
  (1) <script defer> 
  Function SetPrintSettings () ( 
  / / - Advanced features 
  Factory.printing.SetMarginMeasure (2) / / measure margins in inches 
  Factory.SetPageRange (false, 1, 3) / / need pages from 1 to 3 
  Factory.printing.printer = HP DeskJet 870C 
  Factory.printing.copies = 2 
  Factory.printing.collate = true 
  Factory.printing.paperSize = A4 
  Manual feed factory.printing.paperSource = 

  / / - Basic features 
  Factory.printing.header = This is MeadCo 
  Factory.printing.footer = Advanced Printing by ScriptX 
  Factory.printing.portrait = false 
  Factory.printing.leftMargin = 1.0 
  Factory.printing.topMargin = 1.0 
  Factory.printing.rightMargin = 1.0 
  Factory.printing.bottomMargin = 1.0 
  ) 
  </ Script> 

  (2) 
  <script Language=javascript> 
  Function printsetup () ( 
  / / Print Page Setup wb.execwb (8, 1); 
  ) 
  Function printpreview () ( 
  / / Print Preview pages wb.execwb (7,1); 

  ) 

  Function printit () 
  ( 
  If (confirm ( 'Print identified?')) ( 
  Wb.execwb (6,6) 
  ) 
  ) 
  </ Script> 
  </ Head> 
<body>
  <OBJECT classid = CLSID: 8856F961-340A-11D0-A96B-00C04FD705A2 

  Height = 0 = id = wb name wb width = 0> </ OBJECT> 
  <Input type = button name button_print value = = print 

  Onclick = javascript: printit ()> 
  <Input type = button name = button_setup value = Print Page Setup 

  Onclick = javascript: printsetup ();> 
  <Input type = button name = button_show value = Print Preview 

  Onclick = javascript: printpreview ();> 
  <Input type = button name button_fh value = = Close 

  Onclick = javascript: window.close ();> 

————————————————
  On the other components of usage, are listed below: 
  WebBrowser.ExecWB (1,1) Open 
  Web.ExecWB (2,1) closed all the IE window now, and opens a new window 
  Web.ExecWB (4,1) stored pages 
  Web.ExecWB (6,1) Print 
  Web.ExecWB (7,1) Print Preview 
  Web.ExecWB (8, 1) Print Page Setup 
  Web.ExecWB (10,1) Show Page Attributes 
  Web.ExecWB (15,1) seems to be revoked, pending confirmation 
  Web.ExecWB (17,1) SELECT ALL 
  Web.ExecWB (22,1) refresh 
  Web.ExecWB (45,1) closed form Silent 

  2, page Print 
<HTML>
<HEAD>
<STYLE>
  P (page-break-after: always) 
  </ STYLE> 
  </ HEAD> 
<BODY>
  <% While not rs.eof%> 
  <P> <% = Rs (0 )%></ P> 
  <% Rs.movenext%> 
  <% Wend%> 
  </ BODY> 
  </ HTML> 

  3, ASP page print removed from the bottom of the page, how the path and the top of the page numbers (1) ie documents -> Page Setup -> stresses inside headers and footers, there are things removed, Print not out. 
  (2) <HTML> 
<HEAD>
  <TITLE> New Document </ TITLE> 
  <META NAME=Generator CONTENT=EditPlus> 
  <META NAME=Author CONTENT=YC> 
  <script Language=VBScript> 
  Dim hkey_root, hkey_path, hkey_key 
  Hkey_root = HKEY_CURRENT_USER 
  Hkey_path = \ Software \ Microsoft \ Internet Explorer \ PageSetup 
  '/ / Print Web pages in the air for the header footer 
  Function pagesetup_null () 
  On error resume next 
  Set RegWsh = CreateObject (WScript.Shell) 
  Hkey_key = \ header 
  RegWsh.RegWrite hkey_root + + hkey_key hkey_path, 
  Hkey_key = \ footer 
  RegWsh.RegWrite hkey_root + + hkey_key hkey_path, 
  End function 
  '/ / Print Web pages in the header footer to the default value 
  Function pagesetup_default () 
  On error resume next 
  Set RegWsh = CreateObject (WScript.Shell) 
  Hkey_key = \ header 
  RegWsh.RegWrite hkey_root + + hkey_key hkey_path, Page & b & w, & p / & P 
  Hkey_key = \ footer 
  RegWsh.RegWrite hkey_root + + hkey_path hkey_key, & u & b & d 
  End function 
  </ Script> 
  </ HEAD> 

<BODY>
<br/>
<br/>
<br/>
<br/>
<br/>
  <br/> <p Align=center> 
  <input Type=button value= Qingkongxiema onclick=pagesetup_null()> <input type=button value=恢复页吗onclick=pagesetup_default()> <br/> 

  </ P> 
  </ BODY> 
  </ HTML> 
  4, the floating frame Print 
  <SCRIPT LANGUAGE=javascript> 
  Function button1_onclick () ( 
  Var odoc = window.iframe1.document; 
  Var r = odoc.body.createTextRange (); 
  Var stxt = r.htmlText; 
  Alert (stxt) 
  Var pwin = window.open (and print); 
  Pwin.document.write (stxt); 
  Pwin.print (); 
  ) 
  </ SCRIPT> 
  4, FileSystem components used in the realization of the local WEB application specific Print 
  <script Language=VBScript> 
  Function print_onclick / / Print function 
  Dim label 
  Label = document.printinfo.label.value / / HTML pages of data 
  Set objfs = CreateObject (Scripting.FileSystemObject) / / create examples of FileSystem Component Object 
  Objfs.CreateTextFile set objprinter = (LPT1:, true) / / printer connection with the establishment 
  Objprinter.Writeline (__________________________________) / / output print the contents of 
  Objprinter.Writeline (| |) 
  Objprinter.Writeline (| you to print the data: & label & | ") 
  Objprinter.Writeline (| |) 
  Objprinter.Writeline (|_________________________________|) 
  Objprinter.close / / disconnect and connect the printer 
  Set objprinter = nothing 
  Nothing set objfs = / / Close FileSystem Component Object 
  End function 
  </ Script> 
  Server-side scripting: 
<%………
  Set conn = server.CreateObject (adodb.connection) 
  Conn.Open DSN = name; UID = XXXX; PWD = XXXX; 
  Set rs = server.CreateObject (adodb.recordset) 
  Rs.Open ( "select……"), conn, 1,1 
  ……….%> / / Interact with the database 
  HTML pages code: 
<HTML>
………
  <FORM ID=printinfo NAME=printinfo> 
  <INPUT Type=button value=打印>> id = print print name => / / Print function call 
  <INPUT type = hidden id = text1 name = label value = <% =………%>> / / Retention Data transmitted from the server-side……… 
  </ HTML> 

  Posted on 2006-11-02 22:48 TrampEagle reading (1069) Comments (0) edit collections cited 

Original: Structure function in the application of Java

  Original: Structure function in the application of Java 

  As recent project, we need to. Net to the development of a project to Java, which uses Java in the structure function, now, it said that the use of concrete. 
  First a new Java class named: structure.java 
  Definition of a structure: 
  (Class DBUserXX 
  ? String DLName = ""; 
  ? String TrueName = ""; 
  ? String Jh = "";??? 
  ?) 

  New pay structure to the function of: 
  Public DBUserXX GetUserXX () throws Exception ( 
  ?? DBUserXX dbUserXX = new DBUserXX (); 
  ?? DbUserXX.DLName =? "Dlname"; 
  ?? DbUserXX.TrueName = "Truename"; 
  ?? DbUserXX.Jh =???" jh "; 
  ? Return dbUserXX; 
  ?) 

  Testing of the new main () function. 

  Public static void main (String args []) throws Exception 
  ? ( 
  ?? DBUserXX? E = new DBUserXX (); 
  ?? System.out.println ( "DLName =" + + e.DLName "TrueName =" + + e.TrueName "Jh =" + e.Jh); 
  ?) 
  This completed the test. 

  Now we come to talk about the use of more complex. 
  Assume that now need to pay more of the structure of the group values, then we need to speak the above methods expansion needed for a ArrayList. 
  Expansion GetUserXX () function: 
  Public List GetUserXX () throws Exception ( 
  ????? String sql = "select dlname, Truename, jh from UserXX"; 
  ????? OracleConnection oc = new OracleConnection (); 
  ????? Oc.open (); 
  ????? ResultSet rs = oc.executeSelect (sql); 
  ????? List list = new ArrayList (); 
  ????? While (rs.next ()) ( 
  ???????? DBUserXX dbUserXX = new DBUserXX (); 
  ???????? DbUserXX.DLName =?? Rs.getString ( "dlname"); 
  ???????? DbUserXX.TrueName =? Rs.getString ( "Truename"); 
  ???????? DbUserXX.Jh =? Rs.getString ( "jh ");??? 
  ???????? List.add (dbUserXX); 
??????}
  ????? Rs.close (); 
  ????? Return list; 
  ) 

  This GetUserXX () return value on DBUserXX contains multiple types of structure of the (on the database connectivity in this small stresses, there are many on-line information in this regard). 

  The DBUserXX (): 
  Laws main (): 
  Public void main (String args []) throws Exception 
  ? ( 
  ? System.out.println ( "Start ………"); 
  ? GetUserXX List list = (); 
  ? For (int i = 0; i <list.size (); i + +) ( 
  ??????? DBUserXX e = (DBUserXX) list.get (i); 
  ??????? System.out.println ( "DLName =" + + e.DLName "TrueName =" + + e.TrueName "Jh =" + e.Jh); 
????}
  ?? System.out.println ( "End ………"); 
  ?) 
  So that it could be tested. 

  End! 

  Posted on 2006-04-03 18:54 HHJ reading (878) Comments (1) edit collections cited 

Myql pdf reference

  Mysql pdf reference 

  Mysql downloaded from the official pdf files can not be used acrobat reader to restore last view setting when reopening documents functional, very easy to read. 

  Use Acrobat Professional Initial View to set the Resize window to initial page can be. 

  Hey, real trouble. Mysql pdf may be generated by the fop factors. 

  Posted on 2007-05-19 23:07 water ye read (234) Comments (0) edit their collections quoted Category: mysql 

Regular exercise and text processor 2.0

  Regular exercise and text processor 2.0 is the practice of the text processor 2.0 

Celebrity Name

  Celebrity names revealed no parade on small slit slit small wedding unbeaten anal duck Li Peng posted on 2005-07-22 17:25 buhuiwang Reading (42) Comments (0) edit collections cited 

Must See story of the six adults teach you learn life

  Must See story of the six adults teach you learning to be a tolerance 

  A piglet, a sheep and a cow, and was in the same Chulan Lane.    Once, I caught pastor piglets, it loudly Xiaojiao, fiercely resisted.    Sheep and cows hate it Xiaojiao, said: "He often catch us, we do not Dahexiaojiao. Piglets listened replied:" I got you and it is completely different from catching, he got you, you just want to hair and milk, but catch me, it is necessary to my life? 
  Different positions, different people and their environment, it is difficult to understand each other's feelings of others so frustrated, frustration, grief, not schadenfreude, but should be caring, understanding of the mood.    Be tolerant heart! 

  2, on its own 

  Small snail mother asked: Why do we have from birth, it is necessary to bear this and the hard shell again? 
  Mom: Because our body does not support the bone, can only crawl, crawl unhappy.    Therefore, to the protection of the shell! 
  Small snails: Caterpillar sister no bones, climbing unhappy, why she did not back again this is the hard shell? 
  Mom: Because Caterpillar sister can become butterflies, the sky will protect her ah. 
  Small snails: But no bones brother earthworms crawl unpleasant, it will not become what he is not butterflies back again this is the hard shell? 
  Mom: Because earthworms brother will be drilled soil, the earth will protect him ah. 
  Small snails into tears: We sympathize with, the sky is not protected, nor the protection of the earth. 
  Snail's mother comforted him: "So we have a shell ah!" 
  We do not rely on, nor rely on, we rely on ourselves. 

  3, sharks and fish 

  Experiment has been done, will be one of the most ferocious sharks and tropical fish in the same group of a pond, then strengthened glass separated Initially, the crash That day sharks do not see the glass, this is what tolerance futile, and it has always been not to have to the opposite, and staff every day. release of a number of carp in the pond yard, so no lack of sharks prey, but it is still to think the opposite, would like to try the taste of the beautiful, still day That is the constant collisions glass, it tried every corner of each are fully exhausted, but always make each of the numerous injuries, several have every bleeding, for a good number of days, whenever a glass cracks, laboratory personnel immediately with a thicker glass. 
  Later, the Sharks no longer crash That glass, and for those who Colorful tropical fish are no longer concerned about, as if they are just moving to the wall murals, which started waiting for the day the carp will be fixed, and then used his quick instincts hunting, as if to return to the sea insufferably arrogant vicious domineering, but it is all just fake like just experiment at the end of the stage, glass laboratory personnel will be removed, but sharks did not respond, every day is still in the fixed Regional travel to its tropical fish not only for those who turn a blind eye, even when those carp escaped to the side, he would immediately abandon the chase, and said not wish the past, the end of the experiment, laboratory personnel nautical miles ridiculed it is the most cowardly of fish. 
  But Lovelorn the people know why, it Patong. 

  4, miracles 

  France in a remote town, reported that there is a special efficacious springs, and often there will be miracles, healing of various diseases.    One day, a拄着crutches, a leg fewer veterans, a lame lame in one of the road through the town, with the nearby town of sympathy to kiss said: "The poor guy, he would Is God pray for another one leg? "This remark was heard ex-soldiers, and he turned to them said:" I pray to God not to have a new leg, but to pray for him to help me, no one asked me legs, knows how to live. " 
  Just imagine: Learning for the loss of Thanksgiving, but also to the loss of the fact that, regardless of the gain and loss of life, always let their own life is full of bright and glamour, no tears for the past, efforts Guochuziji life. 

  5, poles 

  There is a river fishing in the elderly, to see a child through his fishing, the elderly skills mature, so long as it did not catch on the baskets full of fish, the elderly see very lovable child, should the entire baskets of fish gave him, child shook his head, the elderly surprised and asked him: "Why are you not?" the child replied: "I want you the hands of the poles." elderly person asked: "What do you want to poles?" the child said: "This fish was soon baskets After, if I have the fishing poles, I can catch their lifetime eat too many. " 
  I think you will say: Well, the smart kids.    Wrong, as long as fishing poles if he, he can not eat a fish.    Because he did not know the skills of fishing, light rods is a useless, because the fishing is not important "poles" and "fishing skills." 
  Too many people feel that they have a life over the poles, no longer on the road without fear of wind and rain, and so will inevitably fall on the muddy ground.    See children as the elderly, as long as they are poles are eating too many fish, such as staff see the boss, as long as they sat office, the money will roll into. 

  6, integrity 

  Citie availability is not easy, after undergoing untold hardships.    Please read comrades treasure landlord labor results help to the top, the top simply to not waste your time more than three seconds!    Man must have integrity, desire, but also in order to allow more people to see Citie, which can be learned or what Ganwudao to reach my objective.    Posted on 2007-05-03 07:21 Bai Jie reading (116) Comments (5) edit collections cited 
  Comments: # re: the six adults Must see the story you learn life 2007-05-03 15:51 | JAVA we walk in the bright road of good indeed!    Reply comments more 
 
# Re: the six adults Must see the story you learn life 2007-05-03 17:09 | Hisaki Oh, it honest about that.    3,4 Yes!    Reply comments more 
 
# Re: the six adults Must see the story you learn life 2007-05-03 23:07 | keen 
 
Comments can also restore more 
 
# Re: the six adults Must see the story you learn life 2007-05-14 17:04 | zqh 
 
!    Reply comments more 
 
# Re: the six adults Must see the story you learn life 2007-07-09 14:36 | fds 
 
Ding back more comments 

Java cold joke

  Java cold joke 

  Interviewers: know what type called Mody candidates: I really this person, hard-working, I do not know what is tired interviewers: know what packages? 
  Candidates: I really unusual that people do not have a non-package companies prepared interviewers: Interface know what? 
  Candidates: the people I work seriously.    Never find an excuse lazy 
  M: know what is inherited Mody 
  Y: I am a little orphans can be inherited 
  M: What is that object? 
  M: Yes, but I am hard-working, motivated, and has no plans for the time being targeted. 
  M: Polymorphism know? 
  Y: Yes, I am conservative.    I think that for women to their own beloved momentary happiness to abortion is immoral act!    Is and What is the relationship between Java?    ? 

  Posted on 2007-05-28 14:47 Scott @ JAVA reading (77) Comments (1) edit collections cited 

Emac topic

  Emacs show to the topic of: 

  Step 1: Installation setnu.el to / usr / share / emacs / site-lisp directory; 
  Step Two:. Add emacs 
  (Require 'setnu) 
  (Setnu-mode t) 
  Step 3: After the commencement of Mx setnu-emacs mode that can be! 

  Posted on 2007-05-14 10:07 liunix Reading (23) Comments (0) edit collections cited 

Javacript wrote Quick Sort Algorithm

  JavaScript written in the past two days rapid sorting algorithm with js wrote a quick sort algorithm, we hope that in future, or will用得着. 

keep looking »