Is there a way, either in code or with JVM arguments, to override the current time, as presented via System.currentTimeMillis, other than manually changing the system clock on the host machine?
A little background:
We have a system that runs a number of accounting jobs that revolve much of their logic around the current date (ie 1st of...
Is there any way I can compare values like this?
if (ci.getNumber() == (6252001|5855797|6251999)) { ... }
...
When I try to declare a Dictionary as such:
private Dictionary<String, int> map;
The compiler gives me the following error:
Syntax error on token "int", Dimensions expected after this token
But it works fine with Integer. I'm vaguely aware that java treats int / Integer differently (I come from a .NET background), but I was hopi...
I've been a .NET developer for over 8 years now and I've been placed on a Java project and I'm trying to get up to speed. I'm using Eclipse EE 3.5.1, JBoss 5.1, and Struts 2.1.8.1 (all the latest versions as AFAIK).
I'm trying to create a new project with a simple login and home page. But when I run my project from Eclipse I get the fo...
I have two very simple classes, one extends the other:
public class LocationType implements Parcelable {
protected int locid = -1;
protected String desc = "";
protected String dir = "";
protected double lat = -1000;
protected double lng = -1000;
public LocationType() {}
public int getLocid() {
...
are there any things that once can do ignorantly that can prevent a java web application from being cross platform? (windows/linux/mac)
Tools I am planning to use are java/spring framework/hibernate
...
I have a somewhat large file (~500KiB) with a lot of small elements (~3000). I want to pick one element out of this and parse it to a java class.
Attributes Simplified
<xml>
<attributes>
<attribute>
<id>4</id>
<name>Test</id>
</attribute>
<attribute>
<id>5</id>
<name>Test2</name>
</attribute>
<!--3000...
I am looking for an efficient way to solve the following problem.
List 1 is a list of records that are identified by a primitive triplet:
X | Y | Z
List 2 is a list of records that are identified by three sets. One Xs, one Ys, one Zs. The X, Y, Zs are of the same 'type' as those in list one so are directly comparable with one another...
I am working on converting an excel spread sheet into an xml document that needs to be validated against a schema. I am currently building the xml document using the DOM api, and validating at the end using SAX and a custom error handler. However, I would really like to be able to validate the xml produced from each Cell as I parse the e...
I have an application in which I want to display various charts, mostly bar graphs, pie graphs, etc. In the past, I've used JFreeChart, but (at least by default), JFreeChart does not allow an easy way of editing things like the bar colors. The "properties" popup menu that comes by default by right click is pretty limited.
Is there a mor...
is struts (1 or 2?) used strictly for MVC type architecture or is there more to it?
reason I am asking is I am looking at a web application and they seem to be using both spring and struts.
...
Scenario
I am attempting to implement supervised learning over a data set within a Java GUI application. The user will be given a list of items or 'reports' to inspect and will label them based on a set of available labels. Once the supervised learning is complete, the labelled instances will then be given to a learning algorithm. Thi...
I am currently working on securing a web application using spring-security 3.0. I have gotten most of my issues figured out but I am trying to gain a better understanding of exactly what I am doing (copy and paste FTL).
I watched this video in which he stated that the @Secured should not be used anymore except for certain situations. H...
which class/jar file in fisheye hooks into subversion and GIT?
I want to use it to extend the functionality a bit.
...
I happened upon these values in my ColdFusion code but the Google calculator seems to have the same "bug" where the difference is non-zero.
416582.2850 - 411476.8100 - 5105.475 = -2.36468622461E-011
http://www.google.com/search?hl=en&rlz=1C1GGLS_enUS340US340&q=416582.2850+-+411476.8100+-+5105.475&aq=f&oq=&aqi=
Java...
Hi. I have an insertOrUpdate method which inserts an Entity when it doesn't exist or update it if it does. To enable this, I have to findByIdAndForeignKey, if it returned null insert if not then update. The problem is how do I check if it exists? So I tried getSingleResult. But it throws an exception if the
public Profile findByUserNam...
//key & hash are both byte[]
int leftPos = 0, rightPos = 31;
while(leftPos < 16) {
//possible loss of precision. required: byte, found: int
key[leftPos] = hash[leftPos] ^ hash[rightPos];
leftPos++;
rightPos--;
}
Why would a bitwise operation on two bytes in...
I have setup Spring / WTP in eclipse as well as successfully started a Tomcat 6 server within eclipse. I'm at the point where I can create a new Spring project and add source files as necessary.
Could somebody please describe (or point me to) how I can setup of some sort of 'Hello World' test and how to run it? I have experience devel...
Hi all,
Been developing a game for a while, and currently re working the GUI, or at least trying to. Had the massive problem of not being able to resize the frame (without issues), as I didn't understand layout managers very well. A few projects later, and time to come back and do some more on the game, and I hit a problem...
The basic ...
I'm working on JasperReport Report that generates Excel file. For some reason my cell formats/types are not how they should be. For example I have Date object in my cell but when I generate Excel file it sets cell type to Number, or Long type is text in the cell but cell's format is number (see THIS excel file for example) and also when ...