JAVA2 JSP absolute entry (1) (to)
Must see to novice Java
The article has a strong reading, beginner may be some difficulties, it does not matter, just let you know.
When you complete the configuration environment, and then read the article that many will learn (I was so)
It is one worth recommending to the US text!
â—† â—‡ many netizens asked me learning Java Is there any shortcut, I said "no other CD-hand cooked Seoul." However, I will be very willing to learn from their own experiences and write, to make detours less later, helping others is the greatest happiness!
â—† â—‡ order to learn Java, Java must first know the general classification. We know that, since Sun introduced Java, on trying to make it all-encompassing, so Java development to the present, according to the main application is divided into three large pieces: J2SE, J2ME and J2EE, which is Sun ONE (Open Net Environment ) system. J2SE is the Java2 Standard Edition, mainly for desktop application software programming; J2ME is mainly used in embedded system development, such as cell phones and PDA's programming; J2EE is the Java2 Enterprise Edition, mainly for distributed network procedures development, such as e-commerce sites and ERP systems. J2SE development of desktop applications than VC, VB, DEPHI these traditional development language, the advantage seems not obvious. J2ME for beginners, and seems a bit esoteric, but it is very difficult to develop a general development environment. So now, and the best use of the most extensive study is a J2EE. J2EE also includes many components, such as Jsp, Servlet, JavaBean, EJB, JDBC, such as JavaMail. Not up to study the matter 12 days.
â—† â—‡ then how should learn J2EE? Of course, in the first look at Java syntax, I / O package, Util package, you are all familiar with Lang package? And then learn from the JSP. If you learn HTML, then the matter should be handled more easily, and if not, then you taken to fill an HTML-based bar. In fact, the JSP or Java syntax, it is more like a scripting language, a bit like ASP. Then you learn that one of the Servlet. Servlet is the server-side small program, he was responsible for generating client sent to the HTML file. In the implementation of JSP, Servlet is first converted to run again. Although theoretically could completely replace JSP Servlet, this is the intention of JSP SUN launch, but Servlet Jump to control flow or very convenient, but also the procedures more clearly. Next you should learn to Javabean, you may have to see whether JSP Java embedded in the HTML code in the chaotic manner, in this way with what is the difference between ASP? Fortunately, SUN Javabean can provide your JSP code in the Java package, calling also facilitates easy reuse. Then that EJB, Enterprise JavaBean EJB is to see the name as if it is Javabean, but it Javabean and still be different. It is an architecture, you can build a safer and more stable enterprise applications. It has been the large number of middleware code (that is, we often hear the Weblogic, Websphere these J2EE servers) to complete, so we have to do very little of code, most of the work in the design and configuration of the middleware. As for JDBC on Needless to say, if you use java database access for the procedure, they should be very familiar with it. Also, if you use Java for e-mail program, you have to look at the Javamail.
â—† â—‡ Well, the Java and J2EE have some basic concepts, you should be for some of the procedures, do not empty talk, oh. Find some examples of the best and CD-ROM with the book, so that good procedures can be directly Ctrl + C to Ctrl + V, but also not the boss-you to personally bring it Zaishu again bar, also say directly copying not afraid of mistakes, Why not go ahead? There is always some good to the Java programming article, a good article to Cut down, a problem despite ask, as long as the problem is not too stupid, the general will answer your master.
â—† â—‡ Here are a few good aspects of Java programming site:
CSDN Forum http://www.csdn.net/ China's most famous Technology Forum, "programmers" that they published in the magazine, you can put in the above question was answered immediately, if you feel good, you can give The plus points;
Java Research Organization http://www.javaresearch.org/ above there are many original articles, expert or Tingzhi;
Java developers http://www.chinajavaworld.com/ where comparison of the whole Java;
Java.com.cn http://www.java.com.cn/ look at the domain name to know how cattle, nearing the 10,000 registered users, while the number is 1,000 online about Renqihenwang;
IBM's Developer Network http://www-900.ibm.com/developerWorks/cn/java/index.shtml IBM Big Blue forever;
â—† â—‡ Well, I read books, procedures have done, people ask me the question, I can be resolved, is not on a master? Of course not so simple, this is only taken the first step on Long March. Do not believe? Then you go out to a project, you know how you start, you know how you design, do you know how to organize personnel to make development? Now mind you, except for some scattered code, may no longer something else! You are the greatest shortages of actual work experience, rather than books to those created by the procedure. So you Kuaiquhua a Java programming work to do it (in the case of in-school students can do part-time ah), in the practice of improving, which is the fastest. But you have to pray in the company, get a master, and he is also willing to take the trouble to tell you, this seems to be hard for me, oh!
â—† â—‡ there is a way to read the open source process. We know that most from open source experts, the design reasonable, thoughtful, coupled with the participation of the broad masses of programmers, the value of the code is naturally every word Zhu Ji, sonorous, powerful (sorry, even recently, "Gold Sidacaizi" read more). Java required reading of the two open-source programs is that Jive and Pet Store.. Jive is a very well-known abroad the BBS process, completely open source. Forum designed with a lot of advanced technology, such as Cache, user authentication, Filter, XML, and the Forum of the database completely shield the visit can be easily transplanted in different databases. Forum also facilitate the installation and management procedures, and this is our peacetime programming easy to forget a part of (China programmers generally focus only on the technical content programming, but do not consider the feelings of users, this is our software and abroad where the gap). Jive information in the Web site are many, we can study found. I believe you read the code, there will be completely feeling. It is regrettable that after Jive from 2.5 on the open-source is no longer unconditional, while licence restrictions. But fortunately there are China-class Java programmers concerned about it, foreigners do not open source, and the Chinese people will not be able to raise revenue? Here we recommend a Chinese language version of the Jive - J Road. Jive (J Road version) by the Chinese community famous banq Java Jive in the 2.1 version based on the basis of all Chinese, an increase of some practical features, such as mapping, users and user information on the portrait, but also a development team in the continually escalating. You can visit the website http://www.jdon.com/ banq to download, or to the Technical Forum Tongji ftp://nro.shtdu.edu.cn to servers, installed on any issue can go to the Forum boost question. Pet Store. (Pet shops) SUN company to demonstrate its standardized J2EE programming launched by the open-source process should be very authoritative, wants to learn J2EE EJB and friends not to miss.
â—† â—‡ you will be glad to say, Hey, the original master on Java become so simple ah! Remember Tomjava have come across a project manager, they claim that Java is very simple, as long as three months can learn. In fact, those who said such things as small Japan was known as "China scored three months" as touted. Tomjava you not throwing cold water, you are just learned of the skeleton Java, Java has still not learned the essence. Next you have to design a model. Senior programmer is designed to truly master the core of object-oriented thinking of the required course. A design pattern is not specific "technical", it is about ideology, it is not displayed or abstract interface type in the actual case of the flexible application of and wisdom, so you can truly grasp the abstract class or interface applications, to the Java language in the original jump on the basis of further, more importantly, the design repeatedly emphasized that one purpose to you: let your procedures can reuse as much as possible. Information on the design model, we recommend banq or to the website of hthttp://www.jdon.com/, he GOF 23 models accessible to interpretation by the way, pure Java description is classic in the classic. htHave time to study it further MVC structure (the Model-View-Control separated from the design of) it, now it is popular Structs it is a way to achieve, but with up Structs is really complicated, as long as we learn the essence of that can be, we can design their own MVC structure. htThen you study it further Software Refactoring (restated) and limit XP programming, I believe you also at a higher level.
â—† â—‡ is done, you better finishing of your Java code, those classic procedures and common applications sorted out, then build a carefully, and improve their reusability and scalability. You find a few like-minded friends set up a studio bar, you can undertake a number of projects to do, there may be some difficulties in the beginning, but you have accumulated technology, and thoughtful, to take over the project can be quickly finished, I believe we will come after you, so Money on the Hualala come. . . . . .
â—† â—‡ course, you can also take part in some open-source projects, on the one hand can improve themselves and the other is to make contributions to China's software industry! Developers on the Internet by CVS cooperate in the development, use QQ, MSN, E-mail discussion contact Tiannahaibei programmers scattered around the same time but with a software development is not very interesting?
Here are two good open-source project web site:
Hubei public software development platform class=”blog_content” href=”http://209.85.135.104/translate_c?hl=en&langpair=zh%7Cen&u=http://gro.clinux.org/” target=”_blank”>hthttp://gro.clinux.org/
Building Union class=”blog_content” href=”http://209.85.135.104/translate_c?hl=en&langpair=zh%7Cen&u=http://cosoft.org.cn/” target=”_blank”>hthttp://cosoft.org.cn/
â—† â—‡ wow, am glad Oh, I have finally become a master! No, No.. There is an old saying: "the time." You know that the computer industry is the development of the situation? You know Microsoft's. SUN ONE NET blueprints and plans between the tinge? You know that the development of computer technology will be where? In fact, from the major computer makers recent moves that can be seen "Web services will be the next generation Internet Application of the commanding heights ", and Microsoft's. SUN ONE NET blueprints and plans focus of the struggle, which is Web services. Web services is a new distributed computing model, which is a series of comprehensive standards (XML, SOAP, UDDI, WSDL, and WSFL). It allows different languages can be easily prepared by the software integration, network resources and Web sites into a service rather than chaos dump. The near future, we will be able to click the mouse at home, we can go on sightseeing trips completed all preparatory work, including the air tickets, the tourist routes, will be good rooms. Please note that this all among all Web sites are automatically completed, it was not the same as now, e-commerce is on the surface, are actually many areas of operation. Perhaps you will feel that this is the Yetan days, but nearby, you may also undertake a project to integrate the two businesses ERP system. Likely upstream enterprises Dephi system is used for, and the downstream enterprise system is compiled using Java. You say that you are Java experts, we all do, how you do it. Therefore, ah, you will need to learn new technologies, such as Web services, and you have to understand that it Dephi (Dephi6 Web services are now provided by the controls). Part of the Java System you, and may have to. NET integration, so you. NET have to know that? In the end, you may find that you have become a Java master, but a lot of time it is engaged in other technologies. Tai Chi Master, said, the most powerful forms is not the forms, and this is probably the reason!
â—† â—‡ because emerging, so Web services available online is not much, I recommend to everyone bar several Web sites:
China UDDI Technology Alliance class=”blog_content” href=”http://209.85.135.104/translate_c?hl=en&langpair=zh%7Cen&u=http://www.uddi-china.org/” target=”_blank”>hthttp://www.uddi-china.org/
CSDN Chaixiao the Road column class=”blog_content” href=”http://209.85.135.104/translate_c?hl=en&langpair=zh%7Cen&u=http://www.csdn.net/develop/author/ColumnAuthor/fennivel/%2520%25EF%25BC%2588%25E6%25B3%25A8%25EF%25BC%259A%25E6%259F%25B4%25E6%2599%2593%25E8%25B7%25AF%25E4%25B9%259F%25E6%2598%25AF%25E4%25BA%2592%25E8%2581%2594%25E7%25BD%2591%25E4%25B8%258A%25E4%25B8%2580%25E4%25B8%25AA%25E6%259C%2589%25E5%2590%258D%25E7%259A%2584%25E4%25BA%25BA%25E7%2589%25A9%25EF%25BC%258C%25E4%25BB%2596%25E5%258F%2591%25E8%25A1%25A8%25E8%25BF%2587%25E5%25BE%2588%25E5%25A4%259A%25E5%2585%25B3%25E4%25BA%258EWeb%25E6%259C%258D%25E5%258A%25A1%25E7%259A%2584%25E6%2596%2587%25E7%25AB%25A0%25EF%25BC%258C%25E8%25BF%2598%25E5%2587%25BA%25E4%25BA%2586%25E4%25B8%2580%25E4%25B9%25A6%25EF%25BC%258C%25E5%25BA%2594%25E8%25AF%25A5%25E7%25A7%25B0%25E7%259A%2584%25E4%25B8%258A%25E6%2598%25AF%25E4%25B8%25AD%25E5%259B%25BDWeb%25E6%259C%258D%25E5%258A%25A1%25E6%258A%2580%25E6%259C%25AF%25E7%259A%2584%25E5%2585%2588%25E8%25A1%258C%25E8%2580%2585%25EF%25BC%2589″ target=”_blank”>hthttp://www.csdn.net/develop/author/ColumnAuthor/fennivel/ (Note: Chaixiao Road on the Internet is a well-known figure, he has published many articles on Web services, but also to a book, it should be said that the China is the pioneer of Web services technology)
IBM's Developer Network XML & Web Service column:
class=”blog_content” href=”http://209.85.135.104/translate_c?hl=en&langpair=zh%7Cen&u=http://www-900.ibm.com/developerWorks/cn/xml/index.shtml%3Fcsdn%2520%2520IBM%25E5%258F%25AF%25E6%2598%25AFWeb%25E6%259C%258D%25E5%258A%25A1%25E7%259A%2584%25E5%258A%259B%25E6%258E%25A8%25E8%2580%2585″ target=”_blank”>htBut http://www-900.ibm.com/developerWorks/cn/xml/index.shtml?csdn IBM Web services are pushing people
First install JAVA development environment, wrote HELLO JDK, HELLO INTELLJ IDEA.
Today install JAVA development environment: first inspected the IDE common to the market, there are basically ECLIPSE, NETBEANS, JBUILDER, JCREATOR, INTELLIJ IDEA, VISUAL CAFE. . . . . . Really too much, and that it does not exist, as in C + + VC as the Dongdong, under generally read like INTELLIJ IDEA Yes, users, the key point is that many people say that the development environment is very beautiful, huh, that is, it, and even to download a fee is charged, to register Oh, okay However, the Internet is more than a registration key, like a $ 499 sold, anyway by D version for a long time, do not think too much blush. Installed after the beginning of the establishment of the first project, (the interface is really very beautiful, much better than the VC6) to choose JDK, which do not know under, the so-called IDE, how will not JDK? JDK again for keywords, he no longer saw the article, at least know how installed JDK, from the official site under the JAVA JDK installation. . . NEXT way, the results of the first javac HelloWorld.java problems, and that it can not find javac, but the problem is that I will make a java tips into the ah, how do javac there will be problems, I am under the JDK absolutely authentic, the environment variable settings also should not be a problem, then went to CSDN consulted about the original process is the installation will be installed JDK JRE, if JRE JDK installation path with the same words JRE JDK will cover certain things in the swap, also said that access to information from the JDK 1.5 do not have to start setting JAVA_HOME, CLASSPATH, can be only a modification of PATH, then turn the JDK unloading heavy equipment, the installation process of the election JRE not really OK, smoothly produced Hello World. INTELLIJ IDEA and then engage in the preparations for new projects with the newly elected TIGER Unexpectedlyçž§è§above one can choose their own JDK INTELLIJ, (and then chose it useless TIGER, all the way down, and come up HELLO WORLD come, in this first here tomorrow Zailong. right, JETBRAINS the official website, there is a good flash manuals teach you download and install, until HELLO WORLD come first, and on the dubbing (E text ), quite good here: http://www.jetbrains.com/idea/training/demos/rob/hello_idea.html
If you do not see, can leave-mail, 5 MB, free transponder.
Software developer's hot (reproduced)
Software developer's hot
Below these words is not my original, I occasionally found in the Internet, I really fortunate to see these, I really hope you can be inspired by that article.
Author: IBM middleware company CTO Yuan HONGGANG
Software unwittingly done has been done for 10 years, the joy of success, but also the pain of failure, but that he is not the master, and in my mind, because the real experts are compared with the goal too far. The world has not become the master of the shortcut, but some of the basic principles can be followed.
- A solid foundation. Data structure, discrete mathematics, compiler theory, which are the basis of all computer science, if they do not know, it is difficult to write high-level procedures. According to my observation, learning computer professional than those of other professionals to write better quality software. All procedures will be written, but when you wrote that to some extent it is very difficult to further increase the time, we should think about is not to come back to learn these basic theory. Do not go to the beginning of OOP, even if you can master OOP, encountered some of the basic algorithm may also helpless when.
- Rich imagination. Do not rigidly adhere to a fixed way of thinking, the problems encountered some time to think of a solution, and others, never try the method. Rich imagination is built on the wealth of knowledge on the basis of, in addition to computers, more numerous other disciplines, such as astronomy, physics, mathematics, and so on. Also, see more science fiction film is a good way.
- The simplest is the best. This is perhaps all follow a scientific criteria, the quality can be such a complex exchange of Einstein's theory in the eyes is a simple but are not longer a simple equation: E = mc2. Simple method can be easily understood and more easily achieved, it would be easier maintenance. When they encounter problems, we should consider making the simplest programmes, not only simple solution to meet the complex requirements to consider options.
- Most do not. When you encounter obstacles, may temporarily away from the computer, look at the scenery outside the window and listen to light music, and friends chat. When I encountered problems will be the time to play games, and that is very violent fighting game, when the game is responsible for that part of the brain cells when stimulated extreme responsible for the programming part of the brain cells has been fully rest . When the work of the re-start, I will find that even those problems can be solved now.
- The answer to the thirst for. Science history of the development of human beings is a desire for the process to get an answer, even if the answer can only be a small part also deserves us to pay. If you firm conviction, we must find the answer to the question, you will have energy to explore, even if not the final answer, in the process, you will learn a lot of things.
- More exchanges with others. I visit there must be three divisions, and perhaps others in a casual conversation, we can Pengchu the spark of inspiration. More on the Internet to see if other people's views on the same issue, will give you a source of inspiration.
- Good programming style. Pay attention to develop good habits, code indented scheduling, variable naming rules should always consistent. We all know how to get rid of the code wrong, but often overlooked on the Notes of the debugging. Notes procedures is an important component of, it can make your code more easily understood, and if the code has been clearly expressed in your thinking, no need for the Notes, if the Notes and code inconsistencies, it even worse.
- Toughness and perseverance. This may be a "master" and the general programmer biggest difference. A good programming is 99 weat and a  ffee. Master who is not gifted, they are in countless days and nights of temper them. Success can bring us immense joy, but the process is extremely boring. You may wish to be a test, find a 10,000-within a few tables, copied them all down, and then check three times, and if we can complete the work without interruption, you meet this one.
- To peer-point proposal:
(1) proficiency in a programming tool, not what want to learn what not grasp.
(2) do not seek quick results, which often end up in failure.
(3) Code to regulate style, strict speed.
(4) to strengthen self-management, self-daily summary of their own error rate and fee rate.
(5) happy to open their own results, or will soon be obsolete.
Java string of mystery, test your level of understanding of Java
To a two interesting examples:
1. URL duping Is google SUN on the very special treatment? ?
(Public class BrowserTest
Public static void main (String [] args) (
System.out.print ( "iexplore:");
Http://www.google.com;
System.out.println ( ": maximize");
)
)
The above example will be able to run? You identify? Yes, I am sure that this example can be completely normal operation. Why? This example is equivalent to:
(Public class BrowserTest
Public static void main (String [] args) (
System.out.print ( "iexplore:");
Http:
/ / Www.google.com;
System.out.println ( ": maximize");
)
)
Hey, just as http label (label), as JAVA no goto statements, it is through the label and continue to simulate the statement. And / / www.google.com just notes. The first time I saw this example was when the mixed.
2. UNICODE fully with the procedure said: Below this the "code" into a Ugly.java document, compile it to run, the output Laodiaoya Hello World.
\ U0070 \ u0075 \ u0062 \ u006c \ u0069 \ u0063 \ u0020 \ u0020 \ u0020 \ u0020
\ U0063 \ u006c \ u0061 \ u0073 \ u0073 \ u0020 \ u0055 \ u0067 \ u006c \ u0079
\ U007b \ u0070 \ u0075 \ u0062 \ u006c \ u0069 \ u0063 \ u0020 \ u0020 \ u0020
\ U0020 \ u0020 \ u0020 \ u0020 \ u0073 \ u0074 \ u0061 \ u0074 \ u0069 \ u0063
\ U0076 \ u006f \ u0069 \ u0064 \ u0020 \ u006d \ u0061 \ u0069 \ u006e \ u0028
\ U0053 \ u0074 \ u0072 \ u0069 \ u006e \ u0067 \ u005b \ u005d \ u0020 \ u0020
\ U0020 \ u0020 \ u0020 \ u0020 \ u0061 \ u0072 \ u0067 \ u0073 \ u0029 \ u007b
\ U0053 \ u0079 \ u0073 \ u0074 \ u0065 \ u006d \ u002e \ u006f \ u0075 \ u0074
\ U002e \ u0070 \ u0072 \ u0069 \ u006e \ u0074 \ u006c \ u006e \ u0028 \ u0020
\ U0022 \ u0048 \ u0065 \ u006c \ u006c \ u006f \ u0020 \ u0077 \ u0022 \ u002b
\ U0022 \ u006f \ u0072 \ u006c \ u0064 \ u0022 \ u0029 \ u003b \ u007d \ u007d
Hey, is fun to look at the expense of the procedure, so to avoid using escape at it.
3. Look at this example, print?
(Public class LastLaugh
Public static void main (String args []) (
System.out.print ( "H" + "a");
System.out.print ( 'H' + 'a');
)
)
Kazakhstan? I smile in the second half of the sound, print out the Ha169. The reason is very simple, +, only to do the heavy-duty type String, and no char type, the first two sentences output is the char to int and then + operator, or 72 +97. This problem can be resolved in the preceding empty string:
System.out.print (""+' H '+' a ');
Or the use of printf JDK5, System.out.printf ( "% c% c", 'H', 'a');
4. String cheese:
(Public class StringCheese
Public static void main (String args []) (
Byte bytes = new byte [] [256];
For (int i = 0; i <256; i + +)
Bytes [i] = (byte) i;
String str = new String (bytes);
For (int i = 0, n = str.length (); i <n; i + +)
System.out.print ((int) str.charAt (i) + "");
)
)
You may think that will print from 0-255 Unfortunately, the results are not necessarily, it depends on your platform's default character set. My machine is GBK default, the process is only in the character set ISO-8859-1 that it is, we can read:
String str = new String (bytes, "ISO-8859-1");
The default platform in the use of string in JDK5 java.nio.charset.Charset.defaultCharset () to enquiries.
5. Another is the need to pay attention to the replaceAll String Method of a parameter is a regular expression, rather than constant string. String you can use the alternative method to replace.
Network selection of the [javamail online e-mail all the code, including the identification part]
Have just written a 163 examples of the use of precisely.
Import java.util.Properties;
Import java.util.Date;
Import javax.mail .*;
Import javax.mail.internet .*;
Import javax.activation .*;
(Public class Test7
/ **
* @ Param args
* /
Public static void main (String [] args) throws Exception (
Sendhtml (args);
)
Public static void sendhtml (String argv []) throws Exception (
String to = "XX@XX.XX"
Subject = "null"
From = "XXX@163.com"
Cc = null,
Bcc = null;
String mailhost = "smtp.163.com";
String username = "XXX";
String password = "XXX";
Boolean debug = false;
Properties props = System.getProperties ();
Props.put ( "mail.smtp.auth", "true");
SMTPAuth auth = new SMTPAuth (username and password);
If (mailhost! = Null)
Props.put ( "mail.smtp.host" mailhost);
/ / Get a Session object
Session session = Session.getDefaultInstance (props, auth);
If (debug)
Session.setDebug (true);
/ / Construct the message
Message msg = new MimeMessage (session);
If (from! = Null)
Msg.setFrom (new InternetAddress (from));
Else
Msg.setFrom ();
Msg.setRecipients (
Message.RecipientType.TO,
InternetAddress.parse (to, false));
If (cc! = Null)
Msg.setRecipients (
Message.RecipientType.CC,
InternetAddress.parse (cc, false));
If (bcc! = Null)
Msg.setRecipients (
Message.RecipientType.BCC,
InternetAddress.parse (bcc, false));
Subject = new Date (). ToLocaleString ();
Msg.setSubject (subject);
MimeBodyPart mbp1 = new MimeBodyPart ();
String html =
"<! DOCTYPE HTML PUBLIC \" - / / W3C / / DTD HTML 4.0 Transitional / / EN \ ">"
+ "<html>"
+ "<head> <title> </ Title> </ head>"
+ "<body>"
+ "<b> See the following jpg: it is a car! </ B> <br/>"
+ "<a Href=http://www.a.com/a.jsp> hello </ a> <br/>"
+ "<IMG Src=cid:7e2a34e1.jpg> <br/>"
+ "<b> End of jpg </ b>"
+ "</ Body>"
+ "</ Html>";
Mbp1.setContent (html, and "text / html");
FileDataSource fds = new FileDataSource ( "c: / 7e2a34e1.jpg");
MimeBodyPart mbp2 = new MimeBodyPart ();
Mbp2.setFileName (fds.getName ());
Mbp2.setText ( "This is a beautiful car!");
Mbp2.setDataHandler (new DataHandler (fds));
Mbp2.setHeader ( "Content-ID", "<" + fds.getName () + ">");
Mbp2.setDisposition (null);
MimeMultipart mp = new MimeMultipart ( "related"); / / alternative
Mp.addBodyPart (mbp1);
Mp.addBodyPart (mbp2);
Msg.setContent (mp);
Msg.setSentDate (new Date ());
Transport.send (msg);
System.out.println (mp.getCount ());
System.out.println ( "\ nMail was sent successfully.");
)
)
(Class SMTPAuth extends javax.mail.Authenticator
Private String user, password;
Public SMTPAuth (String u, String p) (
User = u;
Password = p;
)
Public void getuserinfo (String getuser, String getpassword) (
User = getuser;
Password = getpassword;
)
Protected javax.mail.PasswordAuthentication getPasswordAuthentication () (
Return new javax.mail.PasswordAuthentication (user, password);
)
)
================================================== ===================
See you use 21 CN.com mail sent, I changed my procedures.
I have to test you through the process.
Password encrypted.
Import java.util.Properties;
Import java.util.Date;
Import javax.mail .*;
Import javax.mail.internet .*;
Import javax.activation .*;
(Public class Test7
Public static void main (String [] args) throws Exception (
Sendhtml (args);
)
Public static void sendhtml (String argv []) throws Exception (
String to = "zhouxy@teklink.net"
Subject = "null"
From = "XX@21cn.com"
Cc = null,
Bcc = null;
String mailhost = "smtp.21cn.com";
String username = "XX";
String password = "XX";
Boolean debug = false;
Properties props = System.getProperties ();
Props.put ( "mail.smtp.auth", "true");
SMTPAuth auth = new SMTPAuth (username and password);
If (mailhost! = Null)
Props.put ( "mail.smtp.host" mailhost);
/ / Get a Session object
Session session = Session.getDefaultInstance (props, auth);
If (debug)
Session.setDebug (true);
/ / Construct the message
Message msg = new MimeMessage (session);
If (from! = Null)
Msg.setFrom (new InternetAddress (from));
Else
Msg.setFrom ();
Msg.setRecipients (
Message.RecipientType.TO,
InternetAddress.parse (to, false));
If (cc! = Null)
Msg.setRecipients (
Message.RecipientType.CC,
InternetAddress.parse (cc, false));
If (bcc! = Null)
Msg.setRecipients (
Message.RecipientType.BCC,
InternetAddress.parse (bcc, false));
Subject = new Date (). ToLocaleString ();
Msg.setSubject (subject);
MimeBodyPart mbp1 = new MimeBodyPart ();
String html =
"<! DOCTYPE HTML PUBLIC \" - / / W3C / / DTD HTML 4.0 Transitional / / EN \ ">"
+ "<html>"
+ "<head> <title> </ Title> </ head>"
+ "<body>"
+ "<b> See the following jpg: it is a car! </ B> <br/>"
+ "<a Href=http://www.a.com/a.jsp> hello </ a> <br/>"
+ "<IMG Src=cid:7e2a34e1.jpg> <br/>"
+ "<b> End of jpg </ b>"
+ "</ Body>"
+ "</ Html>";
Mbp1.setContent (html, and "text / html");
FileDataSource fds = new FileDataSource ( "c: / 7e2a34e1.jpg");
MimeBodyPart mbp2 = new MimeBodyPart ();
Mbp2.setFileName (fds.getName ());
Mbp2.setText ( "This is a beautiful car!");
Mbp2.setDataHandler (new DataHandler (fds));
Mbp2.setHeader ( "Content-ID", "<" + fds.getName () + ">");
Mbp2.setDisposition (null);
MimeMultipart mp = new MimeMultipart ( "related"); / / alternative
Mp.addBodyPart (mbp1);
Mp.addBodyPart (mbp2);
Msg.setContent (mp);
Msg.setSentDate (new Date ());
Transport.send (msg);
System.out.println (mp.getCount ());
System.out.println ( "\ nMail was sent successfully.");
)
)
(Class SMTPAuth extends javax.mail.Authenticator
Private String user, password;
Public SMTPAuth (String u, String p) (
User = u;
Password = p;
)
Public void getuserinfo (String getuser, String getpassword) (
User = getuser;
Password = getpassword;
)
Protected javax.mail.PasswordAuthentication getPasswordAuthentication () (
Return new javax.mail.PasswordAuthentication (user, password);
)
)
An inefficient Map Implementation: AbstractMap
AbstractMap Map provides for the realization of default, but in sub-categories are generally covered, because here are relatively low efficiency of the realization of this type of method to achieve almost all of what value is only realized!
The following statement:
Public abstract class AbstractMap implements Map
The Map:
The realization of this type are relatively simple, almost all through entrySet completed, so basically have done nothing of these codes can be used as reference:
Public int size () (
Return entrySet (). Size ();
)
Public boolean isEmpty () (
Return size () == 0;
)
Public boolean containsValue (Object value) (
Iterator i = entrySet (). Iterator ();
If (value == null) (
While (i.hasNext ()) (
Entry e = (Entry) i.next ();
If (e.getValue () == null)
Return true;
)
Else ()
While (i.hasNext ()) (
Entry e = (Entry) i.next ();
If (value.equals (e.getValue ()))
Return true;
)
)
Return false;
)
Public boolean containsKey (Object key) (
Iterator i = entrySet (). Iterator ();
If (key == null) (
While (i.hasNext ()) (
Entry e = (Entry) i.next ();
If (e.getKey () == null)
Return true;
)
Else ()
While (i.hasNext ()) (
Entry e = (Entry) i.next ();
If (key.equals (e.getKey ()))
Return true;
)
)
Return false;
)
Public Object get (Object key) (
Iterator i = entrySet (). Iterator ();
If (key == null) (
While (i.hasNext ()) (
Entry e = (Entry) i.next ();
If (e.getKey () == null)
Return e.getValue ();
)
Else ()
While (i.hasNext ()) (
Entry e = (Entry) i.next ();
If (key.equals (e.getKey ()))
Return e.getValue ();
)
)
Return null;
)
Public Object put (Object key, Object value) (
Throw new UnsupportedOperationException ();
)
Public Object remove (Object key) (
Iterator i = entrySet (). Iterator ();
Entry correctEntry = null;
If (key == null) (
While (correctEntry == null & i.hasNext ()) (
Entry e = (Entry) i.next ();
If (e.getKey () == null)
CorrectEntry = e;
)
Else ()
While (correctEntry == null & i.hasNext ()) (
Entry e = (Entry) i.next ();
If (key.equals (e.getKey ()))
CorrectEntry = e;
)
)
Object oldValue = null;
If (correctEntry! = Null) (
OldValue = correctEntry.getValue ();
I.remove ();
)
Return oldValue;
)
Public void putAll (Map t) (
Iterator i = t.entrySet (). Iterator ();
While (i.hasNext ()) (
Entry e = (Entry) i.next ();
Put (e.getKey (), e.getValue ());
)
)
Public void clear () (
EntrySet (). Clear ();
)
Transient volatile Set keySet = null;
Transient volatile Collection values = null;
Public Set keySet () (
If (keySet == null) (
KeySet = new AbstractSet () (
Public Iterator iterator () (
Return new Iterator () (
EntrySet private Iterator i = (). Iterator ();
Public boolean hasNext () (
Return i.hasNext ();
)
Public Object next () (
Return ((Entry) i.next ()). GetKey ();
)
Public void remove () (
I.remove ();
)
);
)
Public int size () (
Return AbstractMap.this.size ();
)
Public boolean contains (Object k) (
Return AbstractMap.this.containsKey (k);
)
);
)
Return keySet;
)
Here is the key to return to the Set, this method there are two categories of anonymity, relatively poor readability, is a subclass of AbstractSet then this sub-class of iterator () method has generated an anonymous categories: achieving Iterator interface If the relatively anonymous familiar, it should be no problem.
Public Collection values () (
If (values == null) (
Values = new AbstractCollection () (
Public Iterator iterator () (
Return new Iterator () (
EntrySet private Iterator i = (). Iterator ();
Public boolean hasNext () (
Return i.hasNext ();
)
Public Object next () (
Return ((Entry) i.next ()). GetValue ();
)
Public void remove () (
I.remove ();
)
);
)
Public int size () (
Return AbstractMap.this.size ();
)
Public boolean contains (Object v) (
Return AbstractMap.this.containsValue (v);
)
);
)
Return values;
)
Public abstract Set entrySet ();
Public boolean equals (Object o) (
If (o == this)
Return true;
If (! (O instanceof Map))
Return false;
Map t = (Map) o;
If (t.size ()! = Size ())
Return false;
Try (
Iterator i = entrySet (). Iterator ();
While (i.hasNext ()) (
Entry e = (Entry) i.next ();
Object key = e.getKey ();
Object value = e.getValue ();
If (value == null) (
If (! (T.get (key) == null & t.containsKey (key)))
Return false;
Else ()
If (! Value.equals (t.get (key)))
Return false;
)
)
) Catch (ClassCastException unused) (
Return false;
) Catch (NullPointerException unused) (
Return false;
)
Return true;
)
Public int hashCode () (
Int h = 0;
Iterator i = entrySet (). Iterator ();
While (i.hasNext ())
H + = i.next (). HashCode ();
Return h;
)
Public String toString () (
StringBuffer buf = new StringBuffer ();
Buf.append ("{");
Iterator i = entrySet (). Iterator ();
Boolean hasNext = i.hasNext ();
While (hasNext) (
Entry e = (Entry) (i.next ());
Object key = e.getKey ();
Object value = e.getValue ();
Buf.append ((key == this? "(This Map)": key) + "=" + (value == this? "(This Map)": value));
HasNext = i.hasNext ();
If (hasNext)
Buf.append ( "");
)
Buf.append ("}");
Return buf.toString ();
)
Protected Object clone () throws CloneNotSupportedException (
AbstractMap result = (AbstractMap) super.clone ();
Result.keySet = null;
Result.values = null;
Return result;
)
Also declared a static internal category, but not used here:
Static class SimpleEntry implements Entry (
Object key;
Object value;
Public SimpleEntry (Object key, Object value) (
This.key = key;
This.value = value;
)
Public SimpleEntry (Map.Entry e) (
This.key = e.getKey ();
This.value = e.getValue ();
)
Public Object getKey () (
Return key;
)
Public Object getValue () (
Return value;
)
Public Object setValue (Object value) (
Object oldValue = this.value;
This.value = value;
Return oldValue;
)
Public boolean equals (Object o) (
If (! (O instanceof Map.Entry))
Return false;
Map.Entry e = (Map.Entry) o;
Return eq (key, e.getKey ()) & & eq (value, e.getValue ());
)
Public int hashCode () (
Object v;
Return ((key == null)? 0: key.hashCode ()) ^ ((value == null)? 0: value.hashCode ());
)
Public String toString () (
Return key + "=" + value;
)
Private static boolean eq (Object o1, Object o2) (
Return (o1 == null? O2 == null: o1.equals (o2));
)
)
Java strings "Chaohuaxijie"
<!–[ If! SupportEmptyParas] -> <!–[ endif ]–><!–[ if! SupportEmptyParas] -> <!–[ endif] -> string is used A lot of class, even if this is the case, there are many strings to our confusion, there are many we do not have a clear place. Common usage, we have already Lanshu, here shall not repeat it. We just want to find some peace inadvertently place, we might have used, but it's not sure. Summed up by them, as "Chaohuaxijie". <!–[ If! SupportEmptyParas] -> <!–[ endif ]–><!–[ if! SupportLists] -> First, <!–[ endif] -> on the String object String objects on the issue, often in the debate on the bbs. Now the tendency is explained: String s = "abc"; this phrase is a quote s, which targets at "abc." As a result, the following statement: String s1 = "abc"; String s2 = "abc"; just had an object, namely: "abc." The String s = new String ( "abc"); the phrase s is an object. The following statements: String s1 = new String ( "abc"); String s2 = new String ( "abc"); producing two objects, they are s1 and s2. With the above explanation, we have not difficult to understand why our priority in the code before use an expression, because the former is a way to use it, whether you want to use the code number of the same quote, produced only an object. Then a number of ways even if the contents of the same object, they are different objects, to have their own memory overhead; This has greatly increased our memory overhead. Similarly, the code below, as well as their operating results can be explained. String s1 = "abc"; String s2 = "abc";
String s3 = new String ( "abc");
Code: System.out.println (s1 == s2); operating results: true code: System.out.println (s1 == "abc"); The result: true code: System.out.println (s1.equals ( s2)); operating results: trueSystem.out.println (s1 == s3); operating results: false code: System.out.println (s3.equals ( "abc")); The result: true <!–[ if! supportEmptyParas] -> <!–[ endif ]–><!–[ if! supportLists] -> Second, <!–[ endif] -> String and StringBuffer Since the distinction between statements: String s = "abc" in the s is a quote. Then, in the following statement: String s = "abc"; s = s + "d", it should have three targets: "abc", "d" and "abcd." S first point cited targets, "abc", after pointing, "and abacd." In this way we can see the difference between String and StringBuffer to. The following code: String s = ""; for (int i = 0; i <10; i + +) (
S = s + i;
) We will have more than 10 targets. And the following code:
StringBuffer sb = new StringBuffer ();
For (int i = 0; i <10; i + +) (sb.append (i);) produced only an object. Therefore, in the String object need to add time, the use of StringBuffer is obviously superior than the use of String, particularly in the combined cycle time. <!–[ If! SupportEmptyParas] -> <!–[ endif ]–><!–[ if! SupportLists] -> Third, <!–[ endif] -> other basic types String and the conversion of the actual coding process, often to other basic types into a String type, as in the above we are used to examples: String s = ""; for (int i = 0; i <10; i + +) (
S = s + i;
), S = s + i; statements on the need to integer i data into strings, and then combined with the s. In fact, apart from s = s +1; the way of such a transformation, and we are not a common approach to the conversion, as follows: s = s + Integer.toString (1) After all right right into the above two methods by the amount of time spent on testing and found that the manner in which the latter transformation is much lower than the time spent in front of a transformation of the manner in which consumption of time. Therefore, we in the process of coding, may wish to use the back of a transforming way. <!–[ If! SupportEmptyParas] -> <!–[ endif ]–><!–[ if! SupportLists] -> Fourth, <!–[ endif] -> Object class toString () Heavy toString () method is a public Object class, Java Object type is the father of all categories. Therefore, any other Java class can rewrite the method to his own use. For example, all the basic types of packaging, such as: Integer, Float, Double, have rewritten the toString () method, is the type of function into a String type. The toString () generally used to provide some rewriting of such basic information. As for a plural categories, as follows:
Public class Complex
(Private double real; private double image;)…… its toString () method can be written as:
Public String toString ()
(String ri = ""; if (this.image <0) (ri = ri +"-"+ Double.toString (Math.abs (this.image)) + "i";) else (ri = ri + "+" Double.toString (this.image) + "i";) return Double.toString (this.real) + ri;) above the toString () method just to express a complex mathematical formula, it is precisely in the Complex computing and want to complete the results. Again, for a staff categories: Employee. We most commonly used, most often want to see their names, as follows:
Public class Employee
(Private String firstName; private String secodeName;…… public String toString () (
This.secodeName return this.firstName +;
……)) So, in some categories, rewritten toString () method is very useful, and may often used as a display data may also be used in debugging statements. <!–[ If! SupportEmptyParas] -> <!–[ endif ]–><!–[ if! SupportLists] -> Fifth, <!–[ endif] -> Escape characters Escape character of the problem is our problem in the course of regular programming will be problems encountered. HTML programming such as encountered in the ">" or "<", the browser will retain their character as the HTML, such as tags at the beginning and the end of 1999 to look at this there will be some mistakes. Also JDBC Programming in the sql statement, if there is a "" "or" ' "characters, such as quotation marks, will go wrong, they will sql statement as a sql statement at the beginning or end. Moreover, URL phrase such as "?" characters, expressions URL will cause confusion. etc. encountered above these circumstances, we have to find some special characters on them be replaced, and then come back exhausted after replacement, Escape character is a special character, but we have to find their own escape characters First relatively trouble, but error-prone, easy to escape characters Zhangguanlidai situation. light of this, the Jakarta Commons package provides us with a set of characters escape solutions, the use of this programme, we do not need to go and find their own escape characters need only call the API Jakarta Commons packets can be, as follows:
String s = "There is always <(less) or> (more) than you want.";
String s1 = StringEscapeUtils.escapeHtml (s);
System.out.println (s1);
String s2 = StringEscapeUtils.unescapeHtml (s1);
System.out.println (s2.equals (s)); System.out.println (s2); output:
There is always <(less) or> (more) than you want.
True
There is always <(less) or> (more) than you want.
Is not very simple, we only need to introduce the above code Jakarta Commons in the corresponding packet can be. <!–[ If! SupportEmptyParas] -> <!–[ endif ]–><!–[ if! SupportLists] -> 6, <!–[ endif] -> English Cazi on the issue of mixed Chinese and English sentence Cazi problem is that I have seen in the bbs a peer solution. Find it very interesting, although I have not used until now, but put it in a summary of the article, the string is a collection of the usage of the bar. We all know that Java is used Unicode encoding, all of the characters are occupies a word, the two bytes. Then we mixed in a sentence in English, how the extracted one of the Chinese words and English words? Below is a simple solution: String s = "I was in the ab people of the country";
Byte [] = bt s.getBytes ();
Int i = 0;
While (i <bt.length) (String ss; if (bt [i] <0) (ss = new String (bt, i, 2) i + = 2;) else (ss = new String (bt, i , 1) i + +;) System.out.println (ss); }<!–[ if! supportEmptyParas] -> <!–[ endif] -> output results: I was in the ab people
JDBC rapidly changing - java.sql.SQLException: [Microsoft] [SQLServer 2000 Driver for JDBC] The specified SQL type is not supported by this driver
The java.sql.SQLException: [Microsoft] [SQLServer 2000 Driver for JDBC] The specified SQL type is not supported by this driver is returned from JDBC Driver (DataDirect Connect JDBC, WebSphere embedded Connect JDBC or Microsoft SQL Server 2000 Driver) when an application uses something that is not supported by the JDBC Driver.
The JDBC specification, Customized Type Mapping Chapter 17, section 17.7 on "NULL Data" states:
- "An application uses the existing getObject and setObject mechanism to retrieve
And store SQLData values. We note that when the second parameter, x, of method
PreparedStatement.setObject has the value null, the driver executes the SQL
Statement as if the SQL literal NULL had appeared in its place.
Void setObject (int i, Object x) throws SQLException;
When parameter x is null, there is no enforcement that the corresponding
Argument expression is of a Java type that could successfully be passed to that SQL
Statement if its value were not null. The Java programming language null carries
No type information. For example, a null Java programming language variable of
Class AntiMatter could be passed as an argument to an SQL statement that
Requires a value of SQL type MATTER, and no error would result, even though the
Relevant type map object did not permit the translation of MATTER to AntiMatter. "
Based on the JDBC specification, it is not recommended to use setObject (int, null). Solution The following three setObject methods are available for use with the PreparedStatement object:
- SetObject (int, Object)
- SetObject (int, Object, int)
- SetObject (int, Object, int, int)
Using the second method setObject (int, Object, int) where the third parameter is the targetJDBCType works fine. For example:
- SetObject (1, null, java.sql.Types.VARCHAR)
[Translation] Effective C + +, 3rd Edition, Item 15: In resource-managing classes (Resources Management) provided the raw resources (nude resources) visit
Item 15: In resource-managing classes (Resources Management) provided the raw resources (nude resources) visit
Author: Scott Meyers
Translator: fatalerror99 (iTePub's Nirvana)
Released: Item 13 on the use of similar auto_ptr or tr1:: shared_ptr such a smart pointers (smart pointer) to holders of similar createInvestment This factory function (factory function) call the results of ideas:
Std:: tr1:: shared_ptr <Investment> pInv (createInvestment ()) / / from Item 13
Suppose you intend to use a function to work together with the Investment objects when is this:
Int daysHeld (const Investment * pi); / / return number of days
/ / Investment has been held
Like this, you want to call it,
Int days = daysHeld (pInv); / / error!
But this code does not compile: daysHeld requires a bare the Investment * pointer, but you pass it a type tr1:: shared_ptr <Investment> the object.
You need a will RAII class (under the current situation is tr1:: shared_ptr) into the object it contains the raw resource (nude resources) (for example, the bottom of the Investment *) method. There are two conventional methods can be done: explicit conversion (Explicit conversion) and the implicit conversion (implicit conversion).
Tr1:: auto_ptr shared_ptr and provide a get member function (member functions) for the implementation of an explicit conversion (show) conversion, that is, for the return of smart pointer object (intelligent object pointer) internal raw pointer (nude pointer) ( A copy):
Int days = daysHeld (pInv. get ()) / / fine, and passes the raw pointer
/ / In pInv to daysHeld
Like virtually all the smart pointer classes (smart pointer), tr1:: auto_ptr shared_ptr and also override the pointer dereferencing operators (of the indicators cited operator) (operator-> * and operator), and thus allowed to Bottom raw pointers (nude pointer) implicit conversion of the (implicit conversion):
Class Investment (/ / root class for a hierarchy
Public: / / of investment types
Bool isTaxFree () const;
…
);
Investment * createInvestment (); / / factory function
Std:: tr1:: shared_ptr <Investment> / / have tr1:: shared_ptr
Pi1 (createInvestment ()) / / manage a resource
Bool taxable1 =! (Pi1-> isTaxFree ()) / / access resource
/ / Via operator->
…
Std:: auto_ptr <Investment> pi2 (createInvestment ()) / / have auto_ptr
/ / Manage a
/ / Resource
Bool taxable2 =! ((* Pi2). IsTaxFree ()) / / access resource
/ / Via operator *
…
When it is necessary because some of the RAII object within the raw resource (nude resources), so some of the designers of the RAII class by providing a implicit conversion function (implicit transfer function) to clean oil to the brakes. For example, consider the following this RAII class, it should provide for a C API primitive state of fonts (font):
FontHandle getFont (); / / from C API-params omitted
/ / For simplicity
Void releaseFont (FontHandle fh); / / from the same C API
Class Font (/ / RAII class
Public:
Explicit Font (FontHandle fh) / / acquire resource;
: F (fh) / / use pass-by-value, because the
() / / C API does
~ Font () (releaseFont (f);) / / release resource
Private:
FontHandle f; / / the raw font resource
);
Assume that there is a huge font-related (related fonts) C API only with FontHandle deal, which frequently need to switch to FontHandles Font objects. Font class may be provided as a get such explicit conversion function (show transfer function):
(Class Font
Public:
…
FontHandle get () const (return f;) / / explicit conversion function
…
);
It is unfortunate that, which requires each customer to dealing with this API call to get:
Void changeFontSize (FontHandle f, int newSize); / / from the C API
Font f (getFont ());
Int newFontSize;
…
ChangeFontSize (f. get (), newFontSize); / / explicitly convert
/ / Font to FontHandle
Some programmers may be found on the conversion of the need for explicit request is depressed enough to avoid the use of this class. This, in turn, increased by leaking fonts (font leakage) opportunities, and each of these things through a design to avoid the Font class
Alternative approach is to provide a Font to its FontHandle the implicit conversion function (implicit conversion functions):
(Class Font
Public:
…
Operator FontHandle () const (return f;) / / implicit conversion function
…
);
This will enable the C API call is simple and natural:
Font f (getFont ());
Int newFontSize;
…
ChangeFontSize (f, newFontSize); / / implicitly convert Font
/ / To FontHandle
Negative aspect is implicit conversions (implicit conversion) increased the wrong opportunities. For example, a customer may want to use the Font in the accidental creation of a local FontHandle:
Font f1 (getFont ());
…
FontHandle f2 = f1; / / oops! Meant to copy a Font
/ / Object, but instead implicitly
/ / Converted f1 into its underlying
/ / FontHandle, then copied that
Now, a procedure has been Font object f1 FontHandle management, but also through the direct use FontHandle to take advantage of f2. This is almost certainly what is not good. For example, when f1 been destroyed, fonts will be released, f2 was dangle (hoisted).
On whether or not to provide a RAII class from the bottom of its resources to the explicit conversion (Explicit conversion) (for example, through a get member function (member functions)), or whether to allow implicit conversion (implicit conversion) decision, we must rely on RAII class is designed to perform specific tasks, and it is planned to use the situation made. Design is the best possible means adhering to the recommendations of Item 18 (the interfaces (interfaces) easy to use right, and wrong to use) one. Usually, a similar get the explicit conversion function (Explicit conversion functions) is the preferred method, because it would accidents type conversions (type conversion) to keep to a minimum the chance. But sometimes, through implicit type conversions (implicit type conversion) increasing the use of the natural balance will tilt to that direction.
You may have already realized, the function returns a RAII class internal raw resource (nude resources) violation of encapsulation (encapsulation). That is correct, but this is not the beginning looks like it is a design as the scourge. RAII classes is not for the existence of what package; it is to ensure that the existence of a specific action - resource release (resources released) - happen. If you wish, resources encapsulation (encapsulation) can improve the status of the main functions of the above, but this is not necessary. In addition, some RAII classes to achieve the strict encapsulation and the underlying resources of a very generous package together. For example, tr1:: shared_ptr overall package its reference-counting machinery (reference count mechanism), but it still provides it contains raw pointer (nude pointer) a simple visit. Like most well-designed classes, it need not hide our customers see, but it also allows customers really need to use those things.
Things to Remember
- APIs often need access to raw resources (nude resources), so every RAII class should provide a method to obtain the management of its resources.
- Visits by the explicit conversion (Explicit conversion) or implicit conversion (implicit conversion). Usually, explicit conversion (Explicit conversion) more secure, and the implicit conversion (implicit conversion) for the customers as more convenient.
Visual Studio 2005 Team System: Software Project Management
Visual Studio Project Management Tools can achieve better planning, organization, coordination, communication, reporting and process control. Visual Studio Project Management Tools and Visual Studio integrated development environment (IDE), Microsoft Office, Windows SharePoint Services, and SQL Server 2005 Reporting Services integration. Visual Studio Project Management Tools allow the project data and processes is non-invasive (non-intrusive) Visibility and norms, thereby enabling IT departments to manage the project selection changes.
Click here to read
keep looking »