Somehow I don't like IDE very much,
but I don't find a particular good tool to build java applications from source yet.
I welcome all kinds of feedbacks!
How can I express "not preceded by" in a Java regular expression? For example I would like to search for ":" but only when it is not directly preceded by "\". How can I do this?
I was wondering how Java sorts items in the Map (HashMap or Hashtable) when they are added. Are the keys sorted by the hashcode, memory reference or by allocation precedence...?
It's because I've noticed same pairs in the Map are not always sorted in the same order
I'm wondering how I could make this into a popup dialog. I designed this with Netbeans gui editor. I looked at option dialog, but all the examples only had a textfield or a combobox, not more than one thing like I have. So what would be the best way to make this in Java.
If I obfuscated python code, would it provide the same level of 'security' as c#/java obfuscating?
i.e it makes things a little hard, but really you can still reverse engineer if you really wanted to, its just a bit cryptic.
Are there a replacement for the follow Java code that will not block? I want only ping a possible waiting thread. I does not want change any on a possible thread that is already in the monitor.
synchronized( monitor ) {
monitor.notify();
}
For instance:
private final Object o;
public void doSomething(){
final Object local = this.o;
//access methods of local;
}
This practice is followed in lots of java classes (such as ArrayBlockingQueue). What's the benefit of this?
I'm quite happy to rig up a bash script to do this, but it would nice to have an automated tool to sort java files into the correct directories (after creating them).
Thanks!
How do you check if you can connect to the internet via java? One way would be:
final URL url = new URL("http://www.google.com");
final URLConnection conn = url.openConnection();
... if we got here, we should have net ...
But is there something more appropriate to perform that task, especially if you need to do consecutive checks very often and a loss of internet connection is highly probable?
I'm just getting my head around java (and OOP for that matter), the only thing I am familiar with is MySQL. I need to keep the DB connection open throughout the duration of the application, as well as a server socket.
I'm not even sure if they both need separate classes, but here's what I have so far:
http://pastebin.com/qzMFFTrY
(it wouldn't all go in a code tag)
The variable I need is con for line 86.
What is the equivalent of Java's final in C#?
EDIT: Sorry, I should have been clearer. I meant what is the equivalent when applied to a member variable - so it must be assigned once and only once.
in java can you have an array of variables?
if so what is the syntax?
here's an example if your confused:
varint[] ArrayOfVariablesThatAreInts = new varint[#]
or
var[] ArrayofVariables = new var[#]
is something like this legal?
I want to cut the svn/cvs recods in pieces and then put in to database. After that i can make use of those data easily.
Any java function can get out the record? and How?
If possible, please provide a example. Thank you.
I am currently facing a situation where i have a table with almost 80 millions data and i have to take a dump of that table and store it into a csv file. Currently i am using a not so professional approach( with a perl script+DBI interface , printing the values to stdout and redirecting to a csv file). Now i am planning to use java threading approach. Can you suggest a way forward. Thanks in advance
Many Java framework classes implement Iterable, however String does not. It makes sense to iterate over characters in a String, just as one can iterate over items in a regular array.
Is there a reason why String does not implement Iterable?
Hey,
many builtin classes in Java implement Iterable, however String does not. It makes sense to iterate over chars in the String, just as one can iterate over items in regular array. Is there a reason behind it?
When launching a thread or a process in .NET or Java, is there a way to choose which processor or core it is launched on? How does the shared memory model work in such cases?
Under what circumstances would java.util.zip.ZipFile.close() throw an IOException? Its method signature indicates that it can be thrown, but from the source code there doesn't seem to be any place where this could happen, unless it's in native code. What corrective action, if any, could be taken at the point where that exception is caught?
Hi there:
I just want to inject some design patterns into my Java code, but I don't know which style to use -- is inherence or interface preferred? And why?
Thanks!
Kind regards!
Possible Duplicate:
Java Generics
To be more specific, whats the role of the <String> in the following line of code?
private List<String> item = new ArrayList<String>();