java

Is there a way to make the Maven build independent of the network connection?

I'm working in a Continuous Integration environment and part of the automated build process includes the compilation of Maven managed projects. What I want to know is if there is a way to make the Maven build independent of the network connection. Currently we have the all the jar's that we need installed in the repository but the pro...

How to create a spanning tree

I have a directed graph for all kinds of available address formats in Java, which includes cycles. I want to store user Address which is a span of this graph in addition to the above template. My graph is obtained from the XML below: <address> <city start="true"> <minicity /> <street /> <square /> </city>...

Live video streaming using Java?

Are there any good libraries for streaming live video using Java? Ideally both ends of the pipe should be written in Java but I am mostly concerned about the video player. What software would you recommend? UPDATE: It seems that VLC introduces a 1-2 second delay. I need video streaming that is truly live. The record-to-playback delay mu...

How do I control the overall size constraints of a panel with MigLayout?

I am testing out MigLayout for a project, and I can't seem to figure out the MigLayout way of controlling the size of the whole panel which is being layed out. I am adapting the example in the MigLayout whitepaper. Also, I am writing in Python and using Jython rather than writing in Java. That said, here is my current code. layout = Mig...

Up to date gwt-incubator jars for Maven

I want to use the latest gwt-incubator drop - gwt-incubator-july-14-2009.jar - in a Maven project. The most recent version published on central is 1.5-Dec_28. Is there a more up-to-date maven repo for the gwt-incubator jar? ...

Most efficient way to reverse a stack and add to an ArrayList

So, this is an efficiency question. I have two collections - an ArrayList and a Stack. I use the stack because I needed some simple pop/push functionality for this bit of code. The ArrayList is essentially the out variable as this is a small section of code in the function. So, I the variables are defined as such, then code is run to ...

Maven offline - problem with mvn-plugins

Hi all. I'm using maven in my project and I need to run the build in a non-internet-access machine. When I test my project build everything is working, but when I run the build in a future moment, the maven try to update the mvn-plugins and this sht* is broking my build. My config file: settings.xml from mvn. <profile> <id...

Avoiding casts when translating public APIs to internal glue code

So, I have this public API that my application exposes, allowing customers to write plug-ins. For the sake of this example, let's say it's a fairly simple key-value pair system, something like: public interface Key { // marker interface, guaranteed unique in some scope } public interface KVPService { Set<Key> getKeys(); Object ge...

Efficient Tree Sort

I'm not really happy with my methods to build a tree structure in my J2ME Application. Can anybody point in a more performant direction? If you need some more code to understand my snippets, just comment below. Java Version is 1.4. Many thanks, rAyt if(companyList != null) { companyList.setNodeStructure(null); Hashtable nodes...

How do I prevent button surround from displaying in Java?

Hello, Sorry for the odd choice of words for the title, however, "border" seems to be the inappropriate term. While it is true that the visible line surrounding an icon in a JToggleButton can be made invisible by using setBorderPainted(false), the same is not true for JCheckBox and JRadioButton. I can not use the JToggleButton and the...

PDF to PCL conversion

In my Java application, I have PDF files that I eventually need to convert to PCL and send to a RightFax server. I'll also need to embed codes in the PCL files that RightFax will read to know where to send the fax. What's the best approach towards doing this? Searching online, it seems like I could use Java's StreamPrintService to pr...

Timer accuracy in java

I'm timing some things, which I can't just put in a long loop. And I need to time them to see how long they take to complete, but it seems like the timer has a 15-16 ms accuracy in java? How can i get around this? ...

Is it possible to specify the TCP port in mappings in the axis NSToPkg.properties file?

Hi, I'm using the Axis 1.4 axis-wsdl2java ant task to create stub code for a web service hosted on port 8080 of a webserver. I've used the NStoPkg.properties file successfully in the past to map the webserver namespace to a convenient java package name with config lines like this: http\://webserver/somedir/service=com.blah.blah But w...

Jersey - Redirection Using Get Not Put, Causes Redirection Loop

Hello chaps, I'm working on a web app that uses Jersey. I'm trying to implement a get-after-post sort of thing using a URIBuilder and a seeOther response. The aim is to redirect to the same URI the browser is already on, but to force a GET. It works a bit like this: Request comes in via PUT PUT request processed SeeOther response retu...

drools expert / solver - 5.0.1 matches

I am fairly new to drools and I'm running into some issues I can't really understand. I'm trying to solve an allocation problem and one of my LHS goes like this $leftAlloc: SlotAllocation($leftRes: resource ) $rightAlloc: SlotAllocation(this != $leftAlloc, resource == $leftRes) for some reason the second statement does not match anyt...

Using threads and ProcessBuilder

I am really unfamiliar with working with threads, so I was hoping someone could help me figure out the best way to do this. I have a JButton in my java application...when you click on the button, I have a Process Builder that creates a process which executes some external python code. The python code generates some files, and this can t...

How do I retrieve images within Postgres into Matlab using Java?

Hi, I have been given a bit of a strange task, there are around 1500-2000 jpeg images all of around 1-50kb in size. They are currently stored in a simple database I made with Postgres. It's been a long time since I used Matlab and Postgres heavily so any help or suggestions is really appreciated! I need to get the images that are store...

project ideas on algorithms ,data structures and parallel programming

Hi, I am a final year Computer Science and Engineering student.As part of the final year project i was planning to implement a graph algorithms library(using parallelization) for c++ but came to know that they have already been implemented. I would be very grateful if you people could suggest me some other project ideas related to my...

Using external properties files in weblogic

I am working on deploying a J2ee application that I have previously been deploying in JBOSS into Weblogic 10.3.1.0. I am running into an issue with external properties files. In Jboss I can just put the properties files into $JBOSS_HOME/server/default/conf, and they are loaded onto the system classpath and I can access them without any...

Spring JDBC connection pool and InputStream results

I am writing a webservice that allows users to post files and then retrieve them at a URL (basically think of it as the RESTful Amazon S3). The issue I came across was rather then return a byte[] from my Oracle query (Spring JDBC) I am returning an InputStream and then streaming the data back to the client in chunks. This (IMO) is a mu...