I have an axis web service running in Tomcat. Clients are making connections without sending a Connection: close header in HTTP 1.1 which means that the default is Keep-Alive. Unfortunately the client seems to be having a problem and when it gets an exception the client is not closing the connection. Since these clients are sending lots ...
I've seen this come up here a few times, but in the postings I've seen, no one explained it. Why shouldn't I extend JFrame (or any component)? Are there conditions where I should extend a component, or is this a firm rule that you don't?
...
The title pretty much says it all. What's the simplest/most elegant way that I can convert, in Java, a string from the format "THIS_IS_AN_EXAMPLE_STRING" to the format "ThisIsAnExampleString"? I figure there must be at least one way to do it using String.replaceAll() and a regex, but I've really never understood Java regexes.
My initial ...
Are there philosophical differences between Smalltalk OOP and Simula OOP ?
This is a question related to Java & C# vs C++ indirectly. As I understand, C++ is based on Simula but Java and C# are more or less from the Smalltalk family.
...
Let's say I have the following (assume restricted to java 1.4 so no generics) :
public class CacheManager {
static HashMap states;
static boolean statesLoaded;
public static String getState(String abbrev) {
if(!statesLoaded) {
loadStates();
}
return (String) states.get(abbrev);
}
...
what should the following java code do?
public class foo{
public static void main(String[] args){
boolean mybool=false;
assert (mybool==true);
}
}
Should this throw an assertion error? and if not why not? (I'm not getting any errors!)
...
We have a Java application that uses some C++ libraries through JNI. The application used to work just fine in Windows XP, but it does not work in Windows Vista, it just crashes the JVM right away.
We also wrote the C++ libraries and produced JNI bindings using SWIG.
We are a little bit clueless on where to start looking for a way to f...
A small program of mine just broke because, it seems, the site I was programmatically browsing now assumes a Java request comes from a mobile phone, and the link I was looking for is not on their mobile page.
So I want to fake an Internet Explorer access. How do I do that with java.net?
...
Possible Duplicate:
What is the difference between a stack overflow and buffer overflow ?
What is the difference between Buffer Overflow and Buffer Overrun?
What is the difference between Buffer Overrun and Stack Overflow?
Please include code examples. I have looked at the terms in Wikipedia, but I am unable to match with pr...
Hi
just a quick help ,
i have this line of html -- its ugly:
<ul><li><a href="/web3/showProfile.do;jsessionid=812E1C87A4FB4184650C551F27ADADAB.6-1?clientId=ZGVfX05FWFQ-&cid=6-1&activity=userdata&levelFirstItem=0">Zugangsdaten</a></li><li><a href="/web3/setBookingTemplate.do;jsessionid=812E1C87A4FB4184650C551F27ADADAB.6-1?...
I have code I'm working on to instantiate a CRC algorithm dependent on a polynomial passed in, and a string s that contains "crc8" or "crc16" or "crc32".
The classes CRC8, CRC16, and CRC32 all extend a class CRC and implement an interface HashAlgorithm. Each of them has a constructor CRCx(int polynomial).
My problem is, I get this erro...
We have a project with a pretty considerable number of EJB 2 stateless session beans which were created quite a long time ago. These are not the first-line beans which are accessed from our client via RMI, rather they are used by that code to perform specific functions. However, I've come to believe that there's nothing to be gained by h...
Heres a class executing PreparedStatements on a Connection.
public class doSomething {
private PreparedStatement ps;
public setPS (Connection conn) throws SQLException {
String sql = "select * from table where id = ?";
ps = conn.prepareStatement(sql);
}
public void runSomething(String var){
ps....
Hi,
is there a way to use somehow IHardwareService.
It is not visible, but documentation concerning it can be found. So looks like there should be some way to use it.
Could you please advice how to do this?
Thanks.
...
Over time, Sun's JVM and JIT have gotten pretty smart. Things that used to be common knowledge as being a necessary micro-optimization are no longer needed, because it gets taken care of for you.
For example, it used to be the case that you should mark all possible classes as final, so the JVM inlines as much code as possible. However...
I hava a Java program that needs to monitor a directory tree for changes. I have JNI code that uses ReadDirectoryChangesW(). The directory is opened like:
HANDLE dirHandle = CreateFile(
path, FILE_LIST_DIRECTORY, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL
);
and then I pass dirH...
Fairly easy, if the BigInteger number is 543 I want it to cut off the last digit so that it is 54.
Two easy ways to do this can be :
Use strings, get substring and create new biginteger with the new value.
Use BigIntegers divide method with number 10. ( 543 / 10 = 54.3 => 54 )
The thing is I will be performing this a lot of times wi...
Hi,
also I wanted to ask following. In class:
\\android 1.5 source\frameworks\base\services\java\com\android\server\HardwareService
I have found method that looks like would help me in solving my Screen
Brightness problems (smooth transitions):
public void pulseBreathingLight()
could you please advice how to invoke this mysterio...
I am trying to find a way to access the Mac OSX system icons. Does anyone know their default location on a Mac? Or know of a way using Java to have them returned?
There is a method of using JFileChooser for Mac to retrieve an Icon for a file, but the file has to exist on the file system (in my app the file could be streaming from a serv...
Using the Android SDK, there doesn't seem to be any way to set the style on a table row. I want to do the equivalent of:
<TableRow
style='@style/TableRow_classic' >
in code. I would like something like:
TableRow row = new TableRow(this);
row.setStyle(R.style.TableRow_classic);
Does anyone know how to find this?
...