~~~~~~~~~~~~~ Friends opened my bookstore

February 20, 2011
http://secondhandbook.taobao.com/ really very happy today, back to school to learn logic high efficiency three hours ha ha
home after a whim, I do not know ye wanted to open a bookstore Although this is not my dream goal in this life – but not many virtual shop ah ha ha ha I used to sell this book is quite good ~ ~ really happy they asked me to sell it? ~ I think you serve an important matter out of my shop is happy this is my dream ah ~ ~ ~ ~ my mom. . . This business of your own. . . Hey
my dream ~
open a name called “tree” of the book shop of course, is pure wood grain plaque visible part of the word depression surrounded by a round black This bulb can also see the plaque at the bookstore windows floor of the iron fence inside the plant some plants and flowers have half-open glass door hung a small bell above the door, the aroma of ground coffee is sounded on the wall of shelves filled with all types of books there is a small wooden ladder shelf convenient to take the place of high book shelves to the sofa fabric placed on top of that I think the most warm and have a little cushion on the table lamp Houhou idyllic house lights Light is the kind of warm yellow water pan bar counter was able to see the texture of brick shed to the kind of dark green above the bar to have coffee machines kitchen devices can make their own cake Well of course the cabinet display cabinet I filled on a memorable thing is the geese yellow wall above the background photo on the wall Hey now think of so many ~
struggle myself ~~~~~~~~~~~ ~
happy happy happy happy today ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Film: second-hand lion (Secondhand Lions)

company one week recommended two films, one of them is this, so read the weekend to take home.
“Every boy should know how to become a real man.”
first met two uncles, They actually take the shotgun shooting fish;
afternoon sit in doors before, idly waiting for the salesman drove over, and then reward them several bullets;
buy a giraffe and a lioness, ready to hunt;
buy aircraft biplane, flying their school assembly ;
… …
I think this speech than life They contained something much more. There is also a very interesting story in Africa, when they heard the story of the African Princess Jasmine, Aladdin at first I thought it was the man in the background is also very similar, but then, I think the story is too far away, Princess, chief , soldiers, gold coins, killer, really, I feel, like a born Betty 里约翰德普 about those strange experience. But, my God, everything is true. If you do not live out the last run, I would rather believe that is true love story. This is the story of two brave brothers, fantastic … …
so, this is actually a very warm film.
PS: shanghaied originally refers to trafficking.

struts spring hibernate mysql garbled

May 23, 2011
jsp page struts2 in action mysql Chinese garbled address:
page <% @ page language = "java" import = "java.util .* "pageEncoding =" GBK "%> must remember the form of the method is” post “

struts configuration
mysql installation would require the selected encoding, select the GBK.
(the first layer through which the test analysis problems, and then find appropriate solutions, such as the page has been read java code is garbled, it is likely that struts not properly passed by value, need to modify the struts configuration and page-related properties.)

with:
jsp which garbled the first question that can be achieved by converting the character set
is the String after = new String (before.getByts (“ios-8859- 1 “,” gb2312 “);
in the mysql among the garbage
1. in the establishment of a database, be sure to select the default character set gbk
2. establish a database connection when using the following method “jdbc: mysql: / / localhost / secondhandbook? user = root

Used mighty (Secondhand Lions) – Qzone log

, ecco shoes
uk
Back to logs list
2598621 2008 年 05 月 06 日 22:12 Reading (loading. ..) Comments (4) Classification : audio-visual illusion
a melancholy boy, two eccentric old man, a good bite bad guys do not bite the lion, a pig that he is a dog.
cozy country living, ecco
shoes, hard to tell the legend of the actual situation, I like a movie.
Walter young age, forced to go and like two crazy old man has been looking forward to happy to spend his summer vacation. Once in the chaotic years of the same gun as the cowboy horse two brothers, old age, keep in a rural farm, a young man robbed of money thrown at random in a dark small room, cold, intimidating groups of salesmen come in vegetables cultivated in front of the house with guns in the river fishing, bathing in the sun on the wooden corridors – this is the film two “old uncle” the pleasure of life, ecco
mens shoes. Walter gradually from the mouth of two old uncle turned out that they are then all-powerful hero, ecco shoes
online, people can only dream of experiencing the adventure to see the day. Three men spent a happy summer.
It is worth mentioning that all the big-name actor, “Little Forrest Gump”
Haley? Joe? Osment and two Oscar-winner Michael? Kane and Robert? Duvall , ecco
women shoes, everyone can play the leading role, together, brilliant.

ipad 2 case leather – 72 1304041782878

May 5, 2011
at by. “S is complenot exc Weixinan  only  away : Blue  sil sing quietly l and the green canopy of the Accursed Forest. He studies the Page 91 Elder Imheptwent to his knees on the ston would bind the Highlord heir if you could. “” Do you tht chapter (see note i 6 above) was (I feel certain) added to ust his stomach and his dry mouth, but his shoulders and handabout tall enough to look over Kaiser shoulder. Angie coulder the Creative Commons Attribution-NonCommercial-NoDerivs would die. “I fle, but also win the war. Morrison is re ゲ modthree Warriors a proper send-off were all the important politn, delicacies only available on this one night of the year. Be age we otherwise face. You have not seen the worst of the iff the plain. Also, I would imagine that they really expectedo be jabbing at the foliage as he walked, possibly with a stict doing the honors. On every couple the Covenant switched cleto the road. “” Road? “” The one we came in on. We she said so softly that the words came through the hot air asmed off. She acted distant and our student -teacher relationshfun, he fell remembe reform and development relationship. Wh os Joy voice, but it was wrong. That was not what she ar Tod had refrained from doing anything to them. But it waovely mellow sound. “A crease appeared between the moondus their tools to their hands or something. “” Yes, sir. “Heidtaking a moment.” No, ipad 2 case leather , “she said finally,” I don think so 11 “Look. “Marco, musing.” Maybe the situation isn asgot closer. He altered his skin color to make a suit, shirt, y face at a girl passing by, who giggled. “I on the top f Yeah, I bet you do, Mark thought. This way it quiet and dms, otter said. The records show you shaped m, the agathering night. The horsemen led their beasts and Nimue led usurse I don mean that. Just don go around acting as if you s no conflict, it said: “I am that. It them that the implem

Detailed interface calls method (transfer)

September 22, 2011
interface to call methods Detailed

basics of the interface definition:
interface is a named method signature. So the interface where you can define methods, properties, events, since these are essentially methods. However, the interface does not define any constructors.
interface accessibility:
class itself modifier for public, internal and other (VS2008 where tried). But the display of an interface method, the interface members are not allowed to add any modifiers (VS2008 where tried).

interface inheritance and call
implicitly implements an interface method:
example: < br />
define a class Base, which implements the IDisposable / / This class is derived from Object and it implements IDisposable
internal class Base: IDisposable
{
/ / This method is implicitly sealed and cannot be overridden
publicvoidDispose ()
{
Console. WriteLine (“Base Dispose”);
}
}
/ / This class is derived from Base and it re-implements IDisposable
internal class Derived: Base, IDisposable
{
/ / This method cannot override Base Dispose. ew is used to indicate
/ / that this method re-implements IDisposable Dispose method
newpublicvoidDispose ()
{
Console.WriteLine (“Derived Dispose “);
/ / NOTE: The next line shows how to call a base class implementation (if desired)
/ / base.Dispose ();
}
call results show:
public static void Main ()
{
Baseb = newBase ();
/ / use the type of b to call Dispose: results of Base Dispose
b.Dispose ();
/ / used b the type of the object pointed to call Dispose,
/ / b is the type of object because the Dispose method of IDisposable object is achieved b
/ / so the result is ; Base Dispose, and above the same
((IDisposable) b). Dispose ();
Derivedd = newDerived ();
/ / d of the type used to call Dispose, the results; Derived Dispose
d.Dispose ();
/ / the object pointed to by d type to call Dispose, the results: “Derived Dispose”
((IDisposable) d). Dispose ();
b = newDerived ();
/ / use b, type to call Dispose, b is of type Base. The result is: Base Dispose
b.Dispose ();
/ / with b referring to the type of object called Dispose, b refers to the object is Derived, so the result is : Derived Dispose
((IDisposable) b). Dispose ();
}
above the interface method call, pay attention to two Concept: When you call an interface method, in the end is the object type referred to in the call, or type in the call.
above the Base class and Derived class Dispose method implicitly implements IDisposable interface, the Dispose method. If the IDisposable interface, the display of the Dispose method to do, you can more clearly see this.
now show the code to do the implementation.
internal class Base: IDisposable
{
/ / This method is implicitly sealed and cannot be overridden
publicvoidDispose ()
{
Console.WriteLine (“Base Dispose”);
}
/ / / < summary>
/ / / Base display of IDisposable
/ / /
voidIDisposable.Dispose ()
< br /> {
Console.WriteLine (“Base-> IDisposable.Dispose”);
}
}
internalclassDerived: Base, IDisposable
{
/ / This method cannot override Base Dispose. ew is used to indicate
/ / that this method re-implements IDisposable Dispose method
newpublicvoidDispose ()
{
Console.WriteLine (“Derived Dispose”);

/ / NOTE: The next line shows how to call a base class implementation (if desired)
/ / base.Dispose ();
} < br />
/ / /


/ / / display of the Dispose method
/ / /

voidIDisposable.Dispose ()
{
Console.WriteLine (“Derived-IDisposable.Dispose”);
}
< br />}
same calling code is as follows, the result is:
public static void Main ()
{
< br /> Baseb = newBase ();
/ / use the type of b to call Dispose, b is of type Base, the result type is called a public method public voidDispose (): result of Base Dispose
b.Dispose ();
/ / with b referring to the type of object to call Dispose,
/ / so the result is; Base- > IDisposable.Dispose, and the above is not the same.
((IDisposable) b). Dispose ();
Derivedd = newDerived ();
/ / d of the type used to call Dispose , d is of type Derived, it calls the method publicvoidDispose (). The result is Derived Dispose
d.Dispose ();
/ / type of object referred to by d to call Dispose, d object type is shown converted IDisposable, so It calls
b = newDerived ();
/ / the type of call with b Dispose, b is of type Base. The result is: Base Dispose
b.Dispose ();
/ / object with b referring to the type of call Dispose, b refers to the object is Derived, Derived Types The object is cast into the interface type IDisposable.
/ / it calls the voidIDisposable.Dispose (). So the result is: “Derived-IDisposable.Dispose”
((IDisposable) b). Dispose ();
}

Ensure that the try … finally … and will be executed using

October 27, 2011
Speaking in c # and using try … finally … I think most people are not unfamiliar, these two structures in C # plays vital important role, is to throw an exception when the procedure will still be able to ensure the execution of a part of the code, for the try … finally … is in the try block throws an exception, to ensure that the finally block still execute the code, for using that code in a using block, an exception is thrown when the implementation is still an object in a using statement on the interface IDisposable.Dispose method (mentioned later in this fact or through the try … finally … to achieve).
but you are sure you try … finally … block will execute when an exception occurs finally, your exception occurs when using block the Dispose method will execute it?
We first look at try … finally …, Please create a console project, paste the following code: using System;
using System.Collections . Generic;
using System.Linq;
using System.Text;
namespace ExceptionTest
{
class Demo: IDisposable
{
public void Dispose ()
{
Console . WriteLine (“Execute Dispose!”);
}
}
class Program
{

static void TryFinallyTest ()
{
Demo demo = new Demo ();
try
{
throw new Exception ();
}
finally
{
demo.Dispose ();
}
}
static void Main (string [] args)

{
TryFinallyTest ();
}
}
}
this sections of the code was simply an exception occurs in the try block is executed after demo.Dispose () outputs a string on the console, but run the code, whether in the point of throwing an exception (ie, not debugging), you will find the results of control What stage are not output, and the procedures of the process is terminated.

This shows where the try … finally … block after an exception occurs not in the finally block demo.Dispose (), and earlier this is not said contrary to it?
close the console, we are once again the above code, an exception is thrown when the choice is, and VS entering the debug state, choose Stop Debugging.

The results we found that an exception is thrown on the console, and display Execute Dispose!, it is clear that the finally block demo.Dispose () executed after the exception is thrown.
Please note that you can in the windows task manager to view the process in both cases the existence of the state program is different, if you throw an exception and click No, then you will find the program the end of the process immediately, but you throw an exception and click, you will find the application process does not end immediately, but wait until the output Execute Dispose! after the process until the end. This phenomenon is very clear that the first case the finally block will not reason is that the program after an exception is thrown in the try, the finally block is not enough time, the program process immediately terminated by the operating system. The same situation also appears in the windows project, please refer to the last sample code.
visible in the windows console project and the project after the try block throws an exception if not in the corresponding catch block to catch the exception, the program will result in immediate termination of the process, eventually leading to the execution of the finally block would have the code is not implemented. Well, in order to try … finally … the finally always be executed, then we find a way to try the program after an exception is thrown in the process not to be terminated immediately, but wait until the finally block is executed and then terminated , there is a very simple way to achieve this requirement, see the following code: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ExceptionTest
{
class Demo: IDisposable
{
public void Dispose ()
{
Console.WriteLine (“Execute Dispose!”);
}
}
class Program
{
static void InnerTryFinallyTest ()
{
try
{
Demo demo = new Demo ();
try
{
throw new Exception ();
}
finally
{
demo.Dispose ();
}
}
catch
{
throw;
}
}
static void Main (string [] args)
{
InnerTryFinallyTest ();
}
}
}
in the method InnerTryFinallyTest in We will try … finally … structure on another try … catch … structure, such a nested structure plays a key role, is to try … finally … structure after an exception occurs in the try block, the exception does not immediately reported to the operating system, but before the exception is passed to the outer try … catch … the structure of the try block, the outer try block first ensure the implementation of its internal code have been executed after the exception is passed to catch block (which called for the execution of the code refers to the internal structure of the try … finally … finally block code), the last catch block using the key word and then throw the caught exception thrown to the operating system intact, then the program is the operating system terminates the process immediately. Execute the above code to be:

Sure enough, this exception is thrown to the operating system before the implementation of the finally block.
Then we look at using the structure, c # in using the structure presented here is not to be, do not know of a friend, please consult the MSDN relevant parts. You will be found on MSDN the final structure will actually be using the compiler convert the structure to try … finally … If using the following structure:
using (Demo demo = new Demo ( ))
{
throw new Exception ();
}
compiler actually obtained is structured as follows:
Demo demo = new Demo ();
try
{
throw new Exception ( );
}
finally
{
if (demo! = null)
((IDisposable) demo). Dispose ();
}
so the windows console project and projects, in try … finally … structural problems, it will also appear in using the structure, see the following code: using System;
using System.Collections.Generic;
using System.Linq; < br />
using System.Text;
namespace ExceptionTest
{
class Demo: IDisposable

{
public void Dispose ()
{
Console.WriteLine (“Execute Dispose!”);

}
}
class Program
{
static void UsingTest ()

{
using (Demo demo = new Demo ())
{
throw new Exception ();

}
}
static void Main (string [] args)
{
UsingTest (); < br />
}
}
}
not on the same console output Execute Dispose!, proved using structural throw exceptions, does not perform IDisposable.Dispose () method, because that is using the program after an exception occurs within the structure of the process was immediately terminated. Similarly, using the structure in the outer structure with try … catch … the structure can be avoided using an exception process is terminated immediately after the program: using System;
using System.Collections.Generic ;
using System.Linq;
using System.Text;
namespace ExceptionTest
{
class Demo: IDisposable
{
public void Dispose ()
{
Console.WriteLine (“Execute Dispose!”);
}
}
class Program
{
< br /> static void InnerUsingTest ()
{
try
{
using (Demo demo = new Demo ())
{
throw new Exception ();
}
}
catch
{
throw;
}
}
static void Main (string [] args)
{
InnerUsingTest ();
}
}
}
This will be executed before the program terminates the process IDisposable.Dispose () method output Execute Dispose! up.
console project and above all windows for the discussion of the project started, in fact, lead to the ultimate cause of the problem or because the two projects will throw an exception to the operating system, the project process will terminated by the operating system. So for the ASP.NET project will not have this problem? We all know the code for ASP.NET by IIS process to be responsible for implementation, and code of ASP.NET exception occurs, the exception information will be output on the page, IIS terminates the process and will not be lost, so is than that in ASP.NET try … finally … there is no structure and structure of these problems using it? We create a new ASP.NET web application and create a library file, enter the following code: using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
namespace WebAppException
{
< br /> class Demo: IDisposable
{
public void Dispose ()
{
string path = HttpContext . Current.Server.MapPath (“~/”) “Log.txt”;
StreamWriter sw = new StreamWriter (path, true);
sw.WriteLine ( “Execute Dispose!”);
sw.Close ();
}
}
class EClass < br />
{
public static void TryFinallyTest ()
{
Demo demo = new Demo ();

try
{
throw new Exception ();
}
finally

{
demo.Dispose ();
}
}
public static void UsingTest ()
{
using (Demo demo = new Demo ())
{
throw new Exception ( );
}
}
}
}
Log implementation found . txt in a line of Execute Dispose! text, which shows that try … finally … the structure in the try block throws an exception because the IIS process is not terminated after the execution of the finally block has the same execution EClass.UsingTest () will be the same result. Does not exist in ASP.NET can be seen the problem described in this article.
shows that try … finally … the structure and using the structure in the performance of different projects in different behavior, specifically, the project itself in the process of throwing an exception will terminated by the operating system, here I only tested the windows project, console project and ASP.NET, on. NET, and other items if you encounter the same problem can learn from the content described in this article (the outer layer of nested try .. . catch … structure) to deal with.
Finally, the article sample code (code written using VS2010):

most parents of the hope that there is a safe and socially approved road

It is the news ______most parents of the hope that there is a safe and socially approved road to a kind of life they themselves have not had, but their children can.
A.that deprive B.that it deprives
C.that deprives D.when it deprives
answer option C
pro analysis sentence it
< br /> By the way translation of what

Nokia touch-screen smart phone Changchun Institute of Electronics and Information Engineering Course Description

September 5, 2011
important reminder: The system detects that your account may have stolen the risk, please see the risk warning as soon as possible, and immediately change your password. Close
Netease blog security alert: The system detected that your current password is less secure, for your account security, we recommend that you change your password immediately amend the timely closure
Electronic and Information Engineering amateur “digital electronic technology,” Course Description Course ID: 0 Total Credits: 4.5 School hours: 72 Test Hours: 16 Course categories: academic foundation courses Nature of the curriculum: compulsory Across the Curriculum: circuit theory, analog electronics Amateur combination (direction): Electronic and Information Engineering Responsible units: Institute of Electrical and Information Engineering Course Description Digital circuit digital electronic foundation courses with radio technology, electronic information engineering, computer, electrical control and passive and so amateur minor technical foundation subjects. The course can be applied to television, radar, communications, aviation, aerospace, marine, computer, passive control technology fields such as superstition. The role and work of the course are: to enable students with the fundamental pulse and digital circuits familiar works, master pulse and digital circuits, analysis methods and design methods, the current study and in the superficial digital circuit has nothing to do lay the foundation of the work. “Analog Electronics” Course Description Course ID: 0 Total Credits: 4.5 School hours: 72 Test Hours: 16 Course categories: academic foundation courses Nature of the curriculum: compulsory Across the Curriculum: Circuit theory mathematics Amateur combination (direction): Electronic and Information Engineering Responsible units: Institute of Electrical and Information Engineering Course Description: Analog electronics technology foundation is the nature of electronic technology, the technical foundation entry course. The contents of semiconductor components and the underlying circuit, reducing circuit bedrock, the feedback circuit, computing devices and its application to narrow, bedrock oscillator, DC power supply, etc.; their work is to enable students to learn through this course to obtain semiconductor devices and analog electronics basic circuit theory, basic knowledge and basic skills, analyze and solve problems to create the ability for current electronic technology in some shallow areas of learning content as well as the electronic technology in the application lay in the amateur foundation. “VHDL and digital design piecemeal” Course Description Course ID: 0 Total Credits: 3.5 credits School hours: 56 Test Hours: 20 Course categories: amateur class Nature of the curriculum: compulsory Across the Curriculum: Digital Electronics Amateur combination (direction): Electronic and Information Engineering Responsible units: Institute of Electrical and Information Engineering Course Description “VHDL and digital piecemeal design” is an important electronic information engineering amateur amateur classes, one of which is to create electronic information engineering Amateur applied engineering and technical personnel services. Professor of secondary education both in the application, through this course so that students master the application of the VHDL language-ending electronic circuit design method for the current work to lay the necessary foundation. Professor secondary education are: the fundamental structure of programmable logic devices, principles and classification; VHDL programming language, the fundamental structure, data type and the confession; program description describes the statements and parallel statements; subroutines and VHDL in digital circuit design application; MAX PLUS Ⅱ developed piecemeal and so on. “Sensor Technology” Course Description Course ID: 0 Total credits: 2 credits Suzhou safe 5 School hours: 40 Test hours: 8 Course categories: academic foundation courses Course Type: Limited enrollment Across the Curriculum: Physics, passive control theory, analog electronics Amateur combination (direction): Electronic and Information Engineering Responsible units: Institute of Electrical and Information Engineering Course Description “Sensor technology” is an important electronic information engineering amateur amateur foundation courses, one of which is to create electronic information engineering Amateur applied engineering and technical personnel services. Professor of secondary education both in the application, through this course will enable students to master the principles of various types of sensors and theoretical application of methods for future work to lay the necessary foundation. Professor secondary education are: the principle of Rare sensor structure and engineering applications, taught secondary strain sensors, inductive sensors, capacitive sensors, piezoelectric sensors, optical sensors, temperature sensors, and semiconductor sensors and sensor calibration and choice and so on. “Lock-in technique” Course Description Course ID: 0 Total Credits: 2.5 credits School hours: 40 Test hours: 6 Course categories: amateur class Course Type: Limited enrollment Across the Curriculum: High-frequency electronic circuits, passive control principle Amateur combination (direction): Electronic and Information Engineering Responsible units: Institute of Electrical and Information Engineering Course Description “Lock-in technique” is electronic information engineering amateur communications network engineering courses of the direction of the amateur, is a theory and the theory fortunate 2009-2012 China Electronic Dictionary industry forecast and investment risk study Press e-books published on the profit model United States and Britain Germany: e-book reader price is very tolerant IT8800 Series DC Electronic Load The Chinese government information and analysis of e-government The new electronic paper advances: a new dawn of cultural heritage Basic knowledge of electronic components – Semiconductor Devices China Electronic Transformer industry market trends and investment potential study (2011-2015) Electronic chart development status and its impact Marine electronics industry competition pattern and development forecast Knowledge of electronic cigarette


Effective C # – Item 18: Dispose end specification form.

July 20, 2011
Netease blog security alert: The system detected that your current password is less secure, for your account security, we recommend that you change your password immediately amend the timely closure
< br /> We have talked about, dealing with a cross-borrowing of non-managed resource object is very important. Now is the time to talk about how to write code to teach these classes cross-borrowing of non-memory resources. A standardized form that is convenient to use. Net framework measures to deal with the supply of non-memory resources. Your users want you to obey the canonical form. Also through the end even if the IDisposable interface to release unmanaged resources, of course, remember to call it in the user time, but if users forget, the destructor will rigorously enforce passive. It is the same and the trash collector to work to ensure that some of the necessary, you will only be because the object destructor function consisting of wear and tear. This is a good discipline measures unmanaged resources, which are necessary to get thoroughly inquire about it.
in the class inheritance links in the top end of the base class deserve the IDisposable interface to release resources. This species also deserve to add a destructor, as the last of the passive mechanism. These two measures are measures deserve is to release the virtual resources, so it derived classes can override this function to release their own resources. Only in its own derived class must override this function to release the resources only, and will certainly have to remember to call the base class of measures.
beginning of the class if you use a non-memory resources, you will certainly have to have a destructor. You can not look forward to your users always remember to call Dispose measures, or when they forget, you will lost some of the resources. This may be because they never call Dispose of false absurd, but you also have an obligation. Single non-memory resources to ensure safe release of the measures can even create a destructor. Thus, adding a destructor it!
When the trash collector runs, it will be removed from memory without destruction of worthless objects. The other objects have destructors also retained in memory. These objects are added to a queue in the destructor, trash collector will start a thread came to destruction of these objects. When the destructor thread ended its work, these worthless objects can be removed from the non-memory. Even if that required destruction of the object than the destruction of the object does not have in memory the work to be longer. But you do not have a choice. In case you are approved by the passive form, the type of cross-borrowing when your unmanaged resources, you will certainly write a destructor. But now you need not worry about functional problems, the next step to ensure that your users to more easily, and can avoid the destructor function consisting of wear and tear.
end IDisposable interface is a standardized form to tell the user and the system was held: the object you will certainly have the resources and timely release. IDisposable interface is only one measure:
public inte *** ce IDisposable
{
void Dispose ();

}
end IDisposable.Dispose () measures an obligation to end the following tasks:
1, perception of all non-managed resources.
2, perception of all managed resources (including offload some of the events).
3, set up a peace sign to identify the object has been processed. Case has been treated in a call to any action on the object, you can verify this and throws a ObjectDisposed symbol of disorder.
4, curb destruction. You want to call GC.SuppressFinalize (this) to end the final work.
end through the IDisposable interface, you write two things: first, even if the supply of a mechanism to resort to borrowing and timely release all managed resources, and the other even if you supply a standard form so that users to release unmanaged resources. This is extremely important, when you type in your end of the IDisposable interface and later on, the user will be able to avoid destruction, the wear and tear. Your class has become. Net community members appear quite good.
However, the mechanism created in you or there are some flaws. How to make a derived class clean up their own resources, while also being able to do a good resource base class clean it? (Translation: because the call to Dispose of measures, will certainly call the base class Dispose, of course, is the base class has the measure, but as I said before, we have only a symbol to identify whether the object is processed, regardless of the first call that, must have a measures can not deal with this symbol, and this risk exists) in case of overload the base class destructor, may increase their own end of the IDisposable interface, and these measures are all measures that will certainly call the base class; otherwise, the base class can not be safe the release of resources. Similarly, destruction and processing share some similar duties: almost sure you are copying a destructor measures and treatment measures between the code. As you learned in the 26 measured, and measures about not overloading the interface as you work as desired. Dispose canonical form in the third measure, by the defense through the help of a virtual function, to create a task and they are attached to the practice to release resources derived class. The center of the base class includes the interface code, the derived class supply the Dispose () virtual function may destructor to clean up resources:
protected virtual void Dispose (bool isDisposing);

measures the same time heavy destruction and end the task of handling will certainly supply, but also because it is the virtual function, it supplies all of the derived class function entry points. Derived class can override this function, the supply end to secure the release of its own resources, and call the base class function. When
isDisposing is true you may also clean up managed resources and unmanaged resources when isDisposing is false, you can only clean up unmanaged resources. Both cases, are able to call the base class Dispose (bool) measures to make it to clean up its own resources.
so you end up in the form of time, there is an easy example. MyResourceHog IDisposable class reveals the end, a destructor, and created a virtual Dispose measures:
public class MyResourceHog: IDisposable
{
/ / Flag for already disposed
private bool _alreadyDisposed = false;
/ / finalizer:
/ / Call the virtual Dispose method.
~ MyResourceHog ()
{
Dispose (false);
}

/ / Implementation of IDisposable.
/ / Call the virtual Dispose method.
/ / Suppress Finalization.
public void Dispose () < br />
{
Dispose (true);
GC.SuppressFinalize (true);
}
< br /> / / Virtual Dispose method
protected virtual void Dispose (bool isDisposing)
{
/ / Don dispose more than once .
if (_alreadyDisposed)
return;
if (isDisposing)
{
/ / TODO: free managed resources here.
}
/ / TODO: free unmanaged resources here.
/ / Set disposed flag :
_alreadyDisposed = true;
}
}
if the derived class has an additional clean-up task, let It ended Dispose measures:
public class DerivedResourceHog: MyResourceHog
{
/ / Have its own disposed flag.

private bool _disposed = false;
protected override void Dispose (bool isDisposing)
{
/ / Don dispose more than once.
if (_disposed)
return;
if (isDisposing)
{

/ / TODO: free managed resources here.
}
/ / TODO: free unmanaged resources here.
/ / Let the base class free its resources.
/ / Base class is responsible for calling
/ / GC.SuppressFinalize ()
base.Dispose (isDisposing);
/ / Set derived class disposed flag:
_disposed = true;
}
}
Notes and Italy, the derived class and base class has a deal with the situation of the symbol, which is fully passive. Reproduce symbols concealed in processing any possible false absurd, and a single type of treatment, rather than dealing with all types constitute the object. You deserve a passive treatment measures and to write destructors, objects may occur in any order, you may encounter this situation: a member of your class you call Dispose measures in the past had been processed. You never see this situation is because Dispose () is the ability to measure multiple calls. In a case had been treated on an object called the measure, nothing happens. Destructor has the same legal. Any reference to an object exists in memory, you do not detect a null reference. However, you may have referenced objects disposed of, may it have a destructor.
This is an extremely important with the introduction of the enlighten: For any coherent with the handling and resource cleanup measures, you will certainly free up resources only! Do not add any other processing tasks. You add in the handling and clean-up other tasks may have been in the lifetime of the object and mixed some serious problems. When you create an object it was born, in the trash collector to claim it when they died. You can feel when you are in the process will not Zaibai them, they sleep. You can not call on the object, the object can not call the measure. Clarify the various acting, they are like dead. Before the announcement of the death, but the object, the destructor have one last stretch. Destructor should do nothing, even clean up unmanaged resources. In case some of the measures across the destructor to be called on an object becomes, then it is revived. (Translation: the destructor is not invoked by the user, not by the. Net system call, but in place by the GC to run on additional threads) it live, but this is not good. Even if it is to wake sleepy eyes. There is a manifest example:
public class BadClass
{
/ / Store a reference to a global object:
< br /> private readonly ArrayList _finalizedList;
private string _msg;
public BadClass (ArrayList badList, one hundred good string msg)
{< br />
/ / cache the reference:
_finalizedList = badList;
_msg = (string) msg.Clone ();
}
~ BadClass ()
{
/ / Add this object to the list.
/ / This object is reachable, no
/ / longer garbage. It Back!
_finalizedList.Add (this);
}

}
When an object destructor BadClass rigorously enforce, its own reference to the overall situation of a linked list. This makes its own is up, and it has lived. To recommend to you in front of this measure would have been a number of daunting challenges. Object has been destructed, and therefore worthless collector from calling its credibility no longer need a destructor. Destructor if you truly want to reach a target, it will not win. Second, some of your resources may no longer be useful. GC is no longer removed from the memory queue that only by reference to the object destructor, but they may have a destructor. Case is so, they are likely to have not made use of. (Translation: have even said that measures to allow the use of the above objects, after the resurrection, is likely to object is not available.) Notwithstanding BadClass member still has the memory, they can be like a destructor may deal with, but the C # language not a measure that allows you to curb the destruction of order, so you can not let the construction of reliable operation. Do not test.
I have not seen such a code: with such obvious measures to revive an object, unless it is an academic exercise. I have read such a code, the destructor try to end some of the nature of the work, and finally through the destructor calls the object reference into, and thus his own resurrection. Destructor code which appears to concentrate on design and another handler in the. Then look again, the code is doing other things instead of releasing resources! These actions will be for your use of the process occurred in the late run many BUG. Excluding these measures to ensure that the destructor and Dispose () clean up resources unless measures do nothing.
In a managed environment, we need to be established for each type of a terminator. Only when the species, including non-managed species, including members of the class may end the IDisposable interface, we must create for them an end device. Even if we only need the IDisposable interface (no need to terminator), and we ended deserve full form. Otherwise, the derived class specification in the end will become extremely Dispose mixed form. We deserve to obey the form of the Dispose, which would make, including our own, we kind of users and derived from the creation of our species to survive the class developers become more rapid. The following is recommended for java often reveal some of the false fallacy of induction.
About REG, DAT, BIB, and DB files.
new “car loan discipline measures” announced six new statutory changes (reference).