Causes of Java coding and Solutions
I. file encoding
Unicode is the preferred encoding. Unicode is a global character encoding standard.
Conclusion: the conversion between GBK and unicode is performed through the gbk unicode ing table.
The conversion between UTF-8 and unicode is based on the Conversion rule Formula
Therefore, unicode is the core intermediary. To convert Gbk to UTF-8, convert it to unicode
Java calls the local graphics processing library when graphics are processed. When using Java for graphical processing (such as image scaling, image signing, generating reports), there is no problem when running on Windows. If the program is ported to Linux/unix, it is possible that graphics cannot display errors.Hint message: "Can ' t connect to X11 Window Server" This is because Linux graphics processing
Java calls the local graphics processing library when graphics are processed. When using Java for graphical processing (such as image scaling, image signing, generating reports), there is no problem when running on Windows. If the program is ported to Linux/unix, it is possible that graphics cannot display errors.Hint message: "Can ' t connect to X11 Window Server" This is because Linux graphics processing
The garbled problem should have been encountered by Java Web developers. At that time, it also affected my idea of learning Java and even gave up some ideas. At that time, I was young, haha. As a matter of fact, there are many causes of Garbled text, and there are also many problems to solve Garbled text. Now let's take a look at them one by one:
Garbled characters can be roughly divided into the following
issues-Dream it POSSIBLE-CSDN blog http://blog.csdn.net/hu_zhiting/article/details/52088245 (The tutorials are well written and there are many workarounds)
Request and Response Setcharacterencoding () method-Kong_lev's blog-csdn blog http://blog.csdn.net/kong_lev/article/details/ 73071198 (Dapper)
URL request in Chinese garbled processing-csdn blog http://blog.csdn.net/zhengyang7754/article/details/47263599 (Very long ... But did not read it)
Form form Submission Chinese garbled (f
Recently, I am working on a project. One of the problems is the communication between Java and. net. The specific problem is as follows:
The client uses Java and the server uses C #. The two use TCP-based socket communication. However, in a small test example, all the results from the client are garbled. So I hope I can find a solution through the Internet. However, there are a lot of answers on the Interne
? This is another new problem. Like most problems, there are also many solutions. Accordingjava.util.TimeZone.getDefaultFrom the source code of the method, the best way is to correctly setuser.timezoneAttribute. When starting a Java virtual machine, you can easily use-DOverride injava.lang.System.initPropertiesValue set in the method. For example:
java -Duser.ti
the method of call, reduce the size of the stack frame two ways.Outofmemeryerror: An oom on the stack is usually a multithreaded scenario.First of all, let's analyze how much space the stack can use, and take 32-bit operating systems for example. Maximum memory 2g-xmx (maximum heap capacity)-maxpermsize (most generous area capacity)-memory that is consumed by the virtual machine itself and by program counters. The rest of the memory is the space the stack can use, and when the parameters of the
done after your reference,
Here I will only talk about solutions that may cause problems.
After writing the code, run, test, and an exception occurs:
Java. lang. noclassdeffounderror: ORG/Apache/Oro/text/perl/perl5util
The following error message indicates that the class definition is missing: ORG/Apache/Oro/text/perl/perl5util.
And this class exists with the jakarta-oro.jar package, this package g
precision penalty for converting char into an integral type.6 ..Because there is a problem in the decimal and binary conversion in Java, double type of the value of 64bit, that is, 64 binary number, minus the highest bit to indicate the positive and negative signs of the bit, in the lowest bit will be with the actual data error, in simple terms, we give the value, in In most cases it takes more than 64bit of digits to be accurately represented (even
the configuration interface of the server, tick the options of the Publish module contexts to separate XML file option, but the method is only applicable to Tomcat6. under normal circumstances, this problem can be ignored in Tomact7, and the console will have a warning but will not affect the operation. if it does not work, then look at your webroot, that is, "Demo" above the use of Chinese? (I have witnessed the normal operation of the English after change.) )(3) appears similar to the Apache
Use Rational Rose Reverse Engineering (java) to generate class diagrams (tutorials and error solutions) and rational Reverse Engineering
When the project framework project code is obtained but there is no uml diagram, it is not easy to see the call relationship function flow between methods. How to generate a class diagram? The methods in the memory are as follows: 1. rose reverse engineering, 2. together
R
MyEclipse memory is not enough, but also show memory overflow and other issues what's going on? ( Java.lang.OutOfMemoryError:PermGen space and its solutions )
Solve:After MyEclipse memory overflow, you can modify the virtual memory size to resolve the following steps:1. Set Default VM ArgumentsIn MyEclipse, open windows-> preferences->java->installed jres-> Click on the Jdk->edit->default VM you are using
unregistered function will be reported this error. Generally easy to distinguish, some customers may be forbidden error interface, so the test is good, one put on the server will not come out, no error interface is not easy to find.Workaround: In a formal environment where a purchase has been registered, the feature is not available if some features are not purchased.If you want to know what features you have purchased, you can open the Web server and enter it in the browser: Http://localhost:8
Java file upload and file download is a relatively common function of program development, the following through this article to introduce Java in the implementation of file upload download three kinds of solutions, the specific details are shown below;
1th: Java code implementation file upload
Formfile File=manf
) { theans = words[i].length () *words[j].length (); - } - } - } + - returnans; + } A}Have not done a similar topic before, the topic to find out the string array of two not a single letter of the same string product of the maximum value, learned the practice of the great God.There are only 26 letters, and an int in Java has 32 bits.by Bitmap[i] |= 1 ), you can record the character of string cha
The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3):
"123"
"132"
"213"
"231"
"312"
"321"
Given n and K, return the kth permutation sequence.Note:given N would be between 1 and 9 inclusive.1 Public classSolution {2 PublicString Getpermutation (intNintk) {3StringBuilder ans =NewStringBuilder ();4StringBuilder tmp =NewStringBuilder ();5 f
In the Terminal (Terminal. app) environment of Mac OSX in simplified Chinese, java and javac output various information such as syntax errors and array access out-of-bounds information in GBK-encoded Chinese by default.However, the Mac terminal's default encoding is UTF-8, so javac and java will output garbled characters without configuration.There are three solutio
Comparison of Java toString Performance Optimization Solutions
Who cares about toString performance? No one! Unless you have a large amount of data in batch processing, using toString produces a lot of logs. Then, when you investigate why it is so slow, you will realize that most toString methods use introspection, which can be optimized.
However, let's take a look at what Object. toString should be consid
1. Importing SQL Package errorsWorkaround:Click Project Right-click Properties->java Build path-> libraries->jre System library–> EditSelect Workspace Default Jre->finish2. Import Javax.servlet Package ErrorWorkaround:Properties->java Build path->libraries->add libraries->server Runtime, select Tomcat Server3, run time-out, and even if the context to modify the longer time is the same result, I was in this
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.