Stateless beans in Java do not keep their state between two calls from the client. So in a nutshell we might consider them as objects with business methods. Each method takes parameters and return results. When the method is invoked some local variables are being created in execution stack. When the method returns the locals are removed ...
I have developed in C++ many years ago, but these days I am primarily a Java software engineer. Given I own an iPhone, am ready to spring for a MacBook next month, and am generally interested in getting started with Mac OS developmentmt (using Objective C), I thought I would just put this question out there: What Next?
More specificall...
What is the fastest list implementation (in java) in a scenario where the list will be created one element at a time then at a later point be read one element at a time? The reads will be done with an iterator and then the list will then be destroyed.
I know that the Big O notation for get is O(1) and add is O(1) for an ArrayList, while ...
I need to validate this simple pick list:
<select name="<%= key %>">
<option value="ETC" SELECTED>Select an option...</option>
<option value="ONE">Lorem ipsum</option>
<option value="TWO">dolor sit amet</option>
</select>
So the user would never submit the form with the, excuse the repetition, "Select an option..." option ...
It's my understanding that a corelet is a Motorola-ism, but does anyone know what the difference is? Do corelets have certain abilities that midlets don't?
...
Hello,
I have a map in Java. I would like to compare a source string against all items in the map and return the best match based on a levenshtein ratio algorithm. I am wondering what the optimal way to perform this check on every element in the list would be.
Thanks, Matt
...
Is there any libraries in java that allow using mathematical matrices?
I am looking for a library that allows me to perform operations in matrices such as invert, scalar multiplication, linear transformations, etc. etc. etc.
In a nutshell, the operations required for lineal algebra.
...
I haven't been able to find an adequate answer to what exactly the following error means:
java.net.SocketException: Software caused connection abort: recv failed
Notes:
This error is infrequent and unpredictable; although getting this error means that all future requests for URIs will also fail.
The only solution that works (also, o...
If you have two jars in your classpath that contain different versions of the same class, the classpath order becomes critical.
I am looking for a tool that can detect and flag such potential conflicts in a given classpath or set of folders.
Certainly a script that starts:
classes=`mktemp`
for i in `find . -name "*.jar"`
do
echo "...
I've looked around for a good example of this, but I haven't run into one yet. I want to pass a custom string array from java to oracle and back, using the IBATIS framework. Does anyone have a good link to an example? I'm calling stored procs from IBATIS.
Thanks
...
I'm trying to send an email in Java but when I read the body of the email in Outlook, it's gotten rid of all my linebreaks. I'm putting \n at the ends of the lines but is there something special I need to do other than that? The receivers are always going to be using Outlook.
I found a page on microsoft.com that says there's a 'Remove ...
I have a several webapps which use java.util.logging. Tomcat 5.5 is configured to use the Juli logger so that each webapp has its own log file. The problem is that Juli does not have properties for maximum file size and file count. Using Juli the files will grow unbounded and only roll at the end of the day. Also, an unlimited number...
We recently started using maven for dependency management. Our team uses eclipse as it's IDE. Is there an easy way to get eclipse to refresh the maven dependencies without running mvn eclipse:eclipse?
The dependencies are up to date in the local maven repository, but eclipse doesn't pick up the changes until we use the eclipse:eclipse c...
Right now, I have two Eclipse projects - they both use Maven 2 for all their jar-dependency goodness.
Inside eclipse, I have project Foo included in project Bar's build path, so that I can use Foo's classes from project Bar. This works really well in eclipse land, but when I try:
mvn compile
inside Bar's directory, it fails because ...
I need to determine the current year in Java as an integer. I would like to be able to use this value as a counter that I can, for example, use to run from now until a specified year in the past (i.e. my value starts at 2008, and I have a "firstYearOfData" value that is set to 1994. I can now run my process from 2008 back to 1994). I cou...
I have a set of objects in a Vector from which I'd like to select a random subset (e.g. 100 items coming back; pick 5 randomly). In my first (very hasty) pass I did an extremely simple and perhaps overly clever solution:
Vector itemsVector = getItems();
Collections.shuffle(itemsVector);
itemsVector.setSize(5);
While this has the adva...
Does any one know of an opensource Java VNC server, that can be run from a web page, so requiring no installation on the server end, possibley applet based.
...
I'm writing an app and our designer's want to user gradient's for some of the backgrounds on a few of our composite's.
I wrote the following code:
composite.addListener (SWT.Paint, new Listener () {
public void handleEvent (Event e) {
GC gc = e.gc;
Rectangle rect = composite.getClientArea ();
Color color1 = new Color (displa...
I have a Hashtable<Integer, Sport> called sportMap and a list of sportIds (List<Integer> sportIds) from my backing bean. The Sport object has a List<String> equipmentList. Can I do the following using the unified EL to get the list of equipment for each sport?
<h:dataTable value="#{bean.sportIds}" var="_sportId" >
<c:forEach items=...
After reading this answer:
http://stackoverflow.com/questions/136474/best-way-to-pick-a-random-subset-from-a-collection#136513
It got me wondering, how does one pick a random seed in Java?
And don't say use System.currentTimeMillis() or System.nanoTime(). Read the article to see why not.
That's a hard question, but let me make it har...