This piece of code moves all current versions of files from one folder to another but leaves all older versions unmoved. (Context is java code of DFC accessing Documentum.)
String strObjId = versionColl.getString("r_object_id");
com.documentum.fc.common.IDfId curObjectID = new DfId(strObjId);
IDfSysObject curObj = (IDfS...
I've been doing some research into taking my programming experience and moving into the java programming marketplace, due to a combination of personal interest and local market forces. As you can gather from the title, the vast majority of my experience has been in building web-based sites and applications, and I'd like to move as much o...
Is there a platform independent way to detect the number of physical and/or virtual processors in Java? One potential solution is to detect the operating system and use the Windows environment variable "NUMBER_OF_PROCESSORS". Do Linux and Mac OS X have a similar offering? This however may not be the best solution.
...
For Java Web Start is there a default place to store and access data related to my program? Or do I need to create a folder? For Java Web Start (assuming I don't get a program folder) is it standard to just create on in Program Files for window, Applications for mac, etc?
...
Hi. Im looking to call a simple http service from my Java servlet to check the price an availability of domain names from my site.
Basically, i want to do something like this checker here... http://www.123-reg.co.uk/
I know i can just to a get on the target url and parse the response, but I'm looking for an exising service this just gi...
The following code prints out "3", not "4" as you might expect.
public class Foo2 {
public static void main(String[] args) {
int a=1, b=2;
a = b + a++;
System.out.println(a);
}
}
I understand how. The postfix increment happens after the value of "a" has been loaded. (See below).
What I ...
What's the best way to tell if one joda time DateTime object is within 4 hours of another if I don't know which object is earlier than the other?
The Joda Time Duration object seems to do this job well if I know that object A comes before object B, but since Duration is signed it doesn't seem to do what I want if I don't know the order....
Hi, is possible to turn header text bold when I select a cell of its column? How to do it?
Thanks
Leandro
...
On startup, Tomcat recursively scans the WEB-INF directories for TLD (Tag Library Descriptor) files. As a result, if a webapp has a lot of files under that directory, it slows down the startup process. Does anyone know if there is a way in that situation to turn off scanning completely, or at least provide a filter to narrow the search...
I have always worked on staticly typed languages (c/c++,java). For the poast months i have been playing with clojure and i really like it. One thing i am worried about is, say that i have a windows that takes 3 modules as arguments and along the way requirements change and i need to pass another module to the function. I just change the ...
Hi!
I'm writing an application that's basically a midlet that connects via WiFi to a server on the internet. Everything's running fine, once I load the midlet onto the phone and start it, I get prompted on which way would I like to connect to the internet, so I select a WiFi access point and connect to the server.
Now, I would like to...
I draw a triangle using mouse drag.
After drawing many different triangles, I wanted to move some of the triangles into different location using mouse drag, however I don't know how to drag the triangle to different location. Help please :=(
...
I am trying to create a 30 second sample from a 2 minute MPEG-4 video. We are looking for a 100% java solution as an alternative to ffmpeg. So far, we have tried IsoParser, which lacks example code and documentation splitting MPEG-4. Has anyone used this tool or others to create cut/split MPEG-4 video?
...
I'm developing a Java ME app and I want to give it social features. Is it possible to connect to Facebook or Twitter directly from the app, without an intermediate server?
...
Here is my code:
Object[] data = GeneComparison.readData(files);
MyGenome genome = (MyGenome) data[0];
LinkedList<Species> breeds = (LinkedList<Species>) data[1];
It gives this warning for the LinkedList:
Type safety: Unchecked cast from Object to LinkedList<Species>
Why does it complain about the linked list and not MyGenome?
...
I need to hide an element if certain values are present in the JSP
The values are stored in a List so I tried:
<c:if test="${ mylist.contains( myValue ) }">style='display:none;'</c:if>
But, it doesn't work.
How can I evaluate if a list contains a value in JSTL, the list and the values are strings.
...
I have two classes. SpeciesReader takes files and parses them. Species stores certain data about a species, which has been parsed from the file.
Currently, I have a method: SpeciesReader.generateSpecies(), which uses the file with which it was instantiated to create a Species object. Is this bad practice/design? Should I somehow find a ...
hi all,
After making a tcp connection to a server, I close my linux application and Socket.close() is called.
Checking netstat -pant, I see the connection is in TIME_WAIT status.
This prevents me from making an immediate connection back to the server since I'm using the same port to connect from. Instead, I have to wait for the conne...
Hi,
Having ignored it all this time, I am currently forcing myself to learn more about unicode in Java. There is an exercise I need to do about converting a UTF-16 string to 8-bit ASCII. Can someone please enlighten me how to do this in Java? I understand that you can't represent all possible unicode values in ASCII, so in this case...
I have a readData() function that reads files a returns a few different objects of parsed data. Right now, the return type of readData() is Object[]:
Object[] data = readData();
MyGenome genome = data[0];
Species[] breeds = data[1];
//etc
This feels awkward. Is there a better way to return this data? I don't want to have separate func...