Let's summarize the wrong categories first.
1 Full-angle problem
2 = and = = Question
3 Space problem
4 spelling problems
5 negligence, forgetting to do the things that should be done
6 new things, not very familiar
The following is the details, hehe ah.
1 old Zhu Zi (java2000_net)
One of my most memorable times, is to be smart. Adds a semicolon after a for loop, and this error occurs occasionally at run time after a large number of code refactoring.
It probably took me nearly 1 weeks.
Since then, the braces for my code have been placed behind the line of code. for (int i=0;i<=10;i++); { // }
for (int i=0;i<=10;i++);
{
//
}
for (int i=0;i<=10;i++); { // }
for (int i=0;i<=10;i++); {
//
}
When the editor formats the code, it can be a great help.
Say that you have often made a low-level mistake, but also so that other friends have a psychological preparation, want to take a piece of tofu hit his head less than a few times the impulse.
2 JSP page inexplicable report empty pointer, and sometimes out. Finally found that the JSP code mixed with a full corner of the space, typesetting more chaotic when you can not see it. Then the space is a part of the variable name, but that variable is not commonly used. Tragedy ( ̄) ( ̄)
3 that year with VC, seems to write a similar to jtable things, in my machine everything is good, in the boss (small company, CTO is also one of the boss) machine on a run on the death ... Then found that my machine resolution is 640x480, the boss is 800x600, the result array overflow ....
4 wrote 2 preparestatement, a addbatch, however finally only wrote a preparestatement.executebatch (); Looking for n long time to see the problem.
The business logic layer within the 53-tier architecture is as follows:
public bool Add (HLink.Model.FavoriteInfo Model) {return DAL. ADD (model) > 0; }
public bool Add (HLink.Model.FavoriteInfo Model) {return
dal. ADD (model) > 0;
}
Written a
public bool Add (HLink.Model.FavoriteInfo model) {return ADD (model) > 0; }
public boolean ADD (HLink.Model.FavoriteInfo model) {return
ADD (model) > 0;
}
Fortunately met once, later reported StackOverflow ... Abnormal know what is wrong, hehe,
6 struct Cxtest_dat
{
...
WORD Wlen;
...
}
int TestData (..., DWORD dwlen);
When used:
Cxtest_dat Stdata;
TestData (..., stdata.wlen);
The length is always incorrect after automatically expanding to a DWORD
7 I also often make low-level mistakes, but I do not think it is ridiculous, every time I found myself making a low-level mistake, my impression is more profound, repeat the chance of making mistakes is a lot smaller.
For example, the first time I used a Java enumeration, I wrote this:
/** * sqlcommandtype sql Command Type enumeration * @author CodingMouse * @version 1.0.0.1 */ public enum sqlcommandtype { /** * sql Query data command */ select, /** * sql Insert Data command */ INSERT, /** * sql Modify data command */ UPDATE, /** * sql Delete data command */ DELETE &Nbsp; }
/**
* Sqlcommandtype SQL command Type enumeration
* @author codingmouse
* @version 1.0.0.1/public
enum Sqlcommandtype {
/**
* SQL query data command */
SELECT,
/**
* SQL Insert Data
command
*/INSERT,/* *
SQL Modify data command/
UPDATE,
/**
* SQL Delete data command */
Delete
}
When you switch an incoming enumeration parameter value in a method:
switch (enum variable) {case Sqlcommandtype.select//intermediate logic processing break; Case Sqlcommandtype.insert ...}
switch (enum variable) {case
sqlcommandtype.select
//Intermediate logic processing break
;
Case Sqlcommandtype.insert ...
}
Grammar old error, but do not know how, obviously Java Switch Branch is to support the enumeration ah.
And then the ferry came to know the original. The case enumeration in the switch branch does not require an enumeration type prefix.
8 Oracle, write SQL statements how always prompt errors, statements old, debugging a day, eyes look at the flowers, the result of a look, dropped a colon.
The home of old Zhu Zi
9 again installed a firewall running MyEclipse when the error, said the port has a problem, I thought is occupied or tomcat problem for a long time Baidu Google have no fruit, suddenly found to be blocked by the firewall
Ten struts.xml------>sturts.xml
11 in C speech
if (I=1)
{
I was trying to tell the truth.
Results......
12 in the modification of the configuration file, because of a space, and found a half-day error
The home of old Zhu Zi
13 in the maintenance of the company a relatively old project, smart to write a class (mainly for common database connection)
public class dataquery{
Static connection
private static Connection con=connectionfactory.getconnection ();
Private Collection <User> getusers (int groupId) {
Statement St=null;
ResultSet Rs=null;
try{
St=con.createstatement ();
String sql= "...";
......
}catch (Exception e) {
E.printstacktrace ();
}
}
Other query methods, sharing a connection ...
}
Because this project has been running for 5 years, Struts1.1 the time to do this project, the old Zi Zhu's home there is no way in the inside with connection pool, so smart-aleck in the inside do this kind of thing
Alas
The consequences are obvious.
Either it's connection too much, or it's a place where the connection is turned off. Causing other methods to throw empty pointers
Yes, I got it when something went wrong, and immediately realized the stupid question.
Alas...
14 have made a mistake before, in while () = =.
Because the beginning of the time to write is correct, then do not know how to accidentally delete an equal sign, the results of the program anyway wrong. At that time is on an embedded platform, the development environment is very rubbish, so still old thought is the compilation environment bug.
Yesterday wrote the program to pull out the n bugs, one is in finally added the return statement, the program output is just another exception, so did not consider this. It took half an afternoon to find out the problem.
The problem with pointers is the most troubling.
15 in the Chinese input method to enter the full angle of the semicolon, the result of compilation does not pass, also found no reason
The home of old Zhu Zi
SELECT * from a where A.idin (...)
17 first 10 minutes to write Java code, write and then write JavaScript code
Error:
for (int i = 0; i < xxx.length; i++) {
}
That's right:
for (var i = 0; i < xxx.length; i++) {
}
Old Zi Zhu remark: This mistake is too long to see, and I often do so
18 My first mistake is that the update is not the following conditions, the result, all data, UPDATE, hehe, the boss smashed ...
19 has this write stored procedure to pass in the parameter userid, has the sheet which relates to has the field UserID
A stored procedure has a condition of update * * * where userId = userId;
If you turn the database upside down, you're going to die of regret.
Not case-sensitive!
20 write the type of input tag inside the form as submit, originally this is normal, but my goal is to trigger a method in the input type, and then display the corresponding data on the page, not to submit the entire form, the result of my input in the button, the page has never responded, The new data just can't be shown and it took two days to find this simple problem.
for (int i = 0,len = Arr.size (); i < Len; i++) {
temp = arr.get (0);
}
。。。 The first element that is taken from the loop ...
22 Change the Linux kernel when the buffer length is defined as 128 bytes, and then changed the scheme, the old Zi Zhu's home needs 512 bytes of buffer, forgot to change the definition, the result of a buffer overflow, the kernel crash, check for a few months to find out what is the reason
23 Write SQL stored procedures when the length of the stitching string is too small, resulting in multiple conditional query always appear bad results ...
VB code
For I=1 to N
Next
Forgot to add one to I
The home of old Zhu Zi
25 operation of the registry is caused by overflow, the heap destroyed, resulting in the code, as long as the application New,malloc error, check for a half-day to find out.
The key is that the parameter of the function that writes the registry is an outgoing parameter, and the return refers to the length beyond the definition.
There is the C, segment error, array out of bounds, difficult to find, are run-time errors, access to inaccessible or invalid address.
26 Nested loops with the same variable:
int i=0; while (I<10) {for (i=0;i<5;i++) {...} }
int i=0;
while (i<10) {for
(i=0;i<5;i++) {
...
}}
}
27 Most impressive is a C # loop
If I forget to add {}
One afternoon.
28 reference Form class pointers are directly defined header files are not stored in the app to cause pointers to be different, you cannot adjust the corresponding member (VC)
29
Sring date = Request.getparameter ("date"); if (! "". Equals ("date")) {...} ........
Sring Date = Request.getparameter ("date");
if (! "". Equals ("date")) {
...
}
The lowest mistake ...
Old Zi Zhu remark: I have also made many times, used to add double quotes
30 loop variable wrong.
for (int i=0; i!=5; ++i)
{
for (int j=0 j!=5; ++i)
{
31 Remember when beginners Delphi, the program code saved in a Chinese named directory, according to F9 compiled plus run,
Always run failed, looking for help everywhere to see, the whole team of experts have looked all over, feel strange, toss for a long time, can not solve the various methods are exhausted,
is not normal operation, and then copied the program again, changed a folder, the problem solved.
Since then I dare not put the program in the Chinese folder, which has been remembered for the past five or six years.
The home of old Zhu Zi
32 Do not modify the database configuration file when packaged, but the user runs on the test database
33 When you write the conditional statement last night, you lose the parentheses of the if () to the full angle format. The If bracket is still nested, in the heat of the removal of all the Chinese input method, today again installed
341 times with the ImageButton, and the results of the submission with JS, as a redundant data, then know ImageButton will submit the ~
35 Case Statement on database
Case when Then
I always forget to write end.
36 Write SQL statements with Full-width commas then debug always quote SQL statement error mobilizing many colleagues to help me check the wrong, and finally found that colleagues despise a long time
37 I have recently been maintaining a website of the company, found that the original writing program is also used by the global static connection, resulting in the number of people visiting the data column does not exist in the error, he was in the data layer with a variable such as the above said I wrote the program has problems, Since the modification, there is no problem with no data columns. hehe.
Old Zi Zhu remark: Static this thing, old Zi Zhu's home you must know he to die is what to use again, otherwise you or remove the comparison insurance, although a waste of some memory. But the sooner the problem arises, the better.
381 variables named in 0 written o, do not know how many brothers can not wear glasses to find out
The form is written from ....
Text point here