Hi folks,
I have a little program allowing users to type-in some regular expressions. afterwards i like to check if this input is a valid regex or not.
I'm wondering if there is a build-in method in Java, but could not find such jet.
Can you give me some advice?
Best regards
Phil
Do any exist? Ideally it would also come with a library of basic PHP functions.
I have a bunch of simple PHP scripts (no extensions, no fancy dynamic hacks, etc) I'd like to convert to Java... It would be great if a tool could do 80% of the work while I do the other 20%.
Is there a way to force classes in Java to have public static final field (through interface or abstract class)? Or at least just a public field?
I need to make sure somehow that a group of classes have
public static final String TYPE = "...";
in them.
Is there a generic way to cache any type of object (be in a java class, or a word document etc.) to memory or disk?
Is simply serializing the object, and retaining the file extension (if it has one) enough to rebuild the object?
Hi,
I need a Java way to find a running Win process from which I know to name of the executable. I want to look whether it is running right now and I need a way to kill the process if I found it.
Thank you! Greetz, GHad
This is sort of the Java analogue of this question about C#.
Suppose I have a String object which I want to represent in code and I want to produce a string literal that maps to the same thing.
I was just about to write a state machine that ingests the string character by character and escapes appropriately, but then I wondered if there was a better way, or a library that provides a function to do this.
How can I read wireless signal strength In C++ and Java ?
Please provide a code snippet, a link to a library, or anything else that might show me how to accomplish this?
I'm working on an upgrade project and build management is done in Maven 1.0.2. Java version will change to J2SE 5.
Please include in your answer if you have first hand experience on that particular combination (Maven 1.0.2 and J2SE 5)
Thanks
hdk
I want to refer to a static Java variable in my styles.xml, is that possible? Here's a pseudo-xml example:
<style name="Artwork">
<item name="android:background">@drawable/border_{Constants.MY_COLOR}</item>
</style>
By using java reflection, we can easily know if an object is an array. What's the easiest way to tell if an object is a collection(Set,List,Map,Vector...)?
Why Javascript is called Javascript (there is no relation between Java and Javascript) why its not called HTMLScript or XMLScript. Any historical reason for this?
How and where do you define your own Exception hierarchy in Java?
My main question concerns package location where they your Exception classes must be defined.
Do we create a special package ourexceptions and put all classes inside it?
Say I have the following piece of java code
ArrayList<Double> myList = new Double[100];
for (Double x : myList)
x = randomDouble();
Does this actually modify myList or just the dummy variable?
I realize I should just try this code segment out, but I think this is the sort of thing I should be able to google or search for on this site, and several queries so far have turned up nothing useful.
I want to add files to java app in android so I'll know their path and can access them.
How can I do it? (It doesn't matter where they will be the most important is that I can access them and I'll know the relative path of the them)
Given:
Object innerProxy = ...
Object proxy = java.lang.reflect.Proxy.
newProxyInstance(Thread.currentThread().getContextClassLoader(),
new Class[]{type},
innerProxy);
How can I extract the innerProxy object from proxy?
I need to convert XML data to Java objects. What would be best practise to convert this XML data to object?
Idea is to fetch data via webservice (it doesn't use WSDL, just HTTP GET queris, so I cannot use any framework) and answers are in XML. What would be best practise to handle this situation?
A hypothetical scenario:
I've got a project whose source compliance level is specified to 1.5.
Now I compile this project with two different JDKs: At first with JDK 6 Update 7 and then with JDK 6 Update 20.
Do these two different JDKs produce different Java byte code, although they only differ in their Update version?
I'm on my way to programming a database application and in our course we are told to implement a library of elements using one of the Java Collections. Each of the elements has a unique ID with which it's supposed to be addressed. Now I am wondering how this can be done.
I though about using a ListArray but this won't work because the only way of addressing List elements is through the index which you can't control.
Do you have some advice for me?
Can you do the following with a Java ResourceBundle?
In the properties file...
example.dynamicresource=You currently have {0} accounts.
At runtime...
int accountAcount = 3;
bundle.get("example.dynamicresource",accountCount,param2,...);
To give a result of
"You currently have 3 accounts."
I have a java class containing all the columns of a database table as attributes (member variables) and corresponding getters and setters.
I want to have a method in this class called getColumnCount() that returns the number of columns (i.e. the number of attributes in the class)? How would I implement this without hardcoding the number? I am open to critisims on this in general and suggestions. Thanks.
I am in the process of creating a Java app and would like to have a bar
on the bottom of the app, in which I display a text bar and a status (progress) bar.
Only I can't seem to find the control in NetBeans neither do I know the code to create in manually.
Thank you so much for helping!
Paintrick
I need to convert XML data to Java objects. What would be best practice to convert this XML data to object?
Idea is to fetch data via a web service (it doesn't use WSDL, just HTTP GET queries, so I cannot use any framework) and answers are in XML. What would be best practice to handle this situation?