java

Python, PyTables, Java - tying all together

Hello all, Question in nutshell What is the best way to get Python and Java to play nice with each other? More detailed explanation I have a somewhat complicated situation. I'll try my best to explain both in pictures and words. Here's the current system architecture: We have an agent-based modeling simulation written in Java. ...

Dashboard Application

I have a simple task that I feel there has to be an app out there for (or is easy to build or extend an open-source version). I need to run a mysql query repeatedly and look for changes in the results between runs (the data is coming in in real time). I have built several of these queries and throughout the day find myself jumping betw...

Turning Image object into BufferedImage object

Given an Image object, how do I turn that into a BufferedImage object without using any of the graphics stuff? Thanks. (P.S. I'm using Java ImageIO library) ...

Creating android app Database with big amount of data

Hi all, The database of my application need to be filled with a lot of data, so during onCreate(), it's not only some create table sql instructions, there is a lot of inserts. The solution I chose is to store all this instructions in a sql file located in res/raw and which is loaded with Resources.openRawResource(id). It works well but...

Logging into Jackrabbit with custom LoginModule

I am trying to write a LoginModule that authenticates users with Jackrabbit repository. However, I want it to check the credentials that are stored in repository itself. So the problem is, in my LoginModule I have to connect to the repository again, making it an infinite loop. Is there something I can do about it? ...

Service Browser for AMF calls (Flex to Java)

Has anyone used or is aware of a service browser to test AMF calls? I am looking for a tool similar to ZamfBrowser ( http://www.zamfbrowser.org ), but one that works for the Java environment. ZamfBrowser is geared towards AMFPHP. The idea here is to provide a service browser, that allows developers to test Java services using the AMF ...

How to make a mouseEvent from a Component to be recognized in a subcomponent?

I have a JTabPane, and i have added a MoustListener to it(for tab's title). When i press right click, a popup menu is created. i need to make it invisible when i press the mouse button in any place of window. how can i do this?? (the MouseListener is applied only for tab's title.) ...

Hibernate transaction problem

When I execute some queries inside Hibernate transaction -> the data successfully updated in my mysql, but in my application there are still old values. When i restart - it`s Ok. If i set autocommit mode - works fine, but i have to use transaction ;-). Any ideas? Thanks in advance. ...

Oracle connection compression?

I have an application that uses JDBC to connect to Oracle 11g. Unfortunately, the machine my app is running on and the Oracle machine are connected via a somewhat low bandwidth connection. I haven't sniffed the connection, but I am pretty sure the data streaming across the connection is not compressed. For my application, I'm more con...

Unicode aware CSV parser in Java

I'm looking for Java implementation of CSV (comma separated values) parser with proper handling of Unicode data, e.g. UTF-8 CSV files with Chinese text. I suppose such a parser should internally use code point related methods while iterating, comparing etc. Apache 2 license or similar would work the best. ...

Java static analyzer custom templating/specification

We have a Java project that uses TeamCity to do static analysis of our Java classes each night to find low hanging bugs in our code. We would like to tell TeamCity to look for a new type of bug that developers might introduce that has to do with the usage of == vs .equals For a particular type within the system we were using == to do c...

Can I make Swing JButtons have smaller margins?

I prefer buttons with minimal margins, about as wide as their text caption. Is there a way to achieve that in a JButton in Swing? What I am seeing in practice now is that even if I try to use setMaximumSize() and similar, it just ends up eating the text caption, cutting it off to the right. But it does not reduce the margins. ...

Stanford POS tagger in Java

I'm trying this: Sentence<TaggedWord> taggedString = MaxentTagger.tagStringTokenized("here is a string to tag"); which gives me: Error: \u\nlp\data\pos-tagger\wsj3t0-18-left3words\left3words-wsj-0-18.tagger (The system cannot find the path specified) I'm using Stanford's POS tagger. What can I do to overcome this problem? ...

Can't read and write a TIFF image file using Java ImageIO standard library

I don't know what to do with TIFF images, but I can't read or write any of them using straight Java standard ImageIO library. Any thoughts? Thanks. ...

Using CXF web service from java web start

UPDATE: I have submitted my question to the CXF User's mailing list, here. UPDATE: I have currently signed all of my jars. I still can't seem to get CXF setup in a way that it can find the WSDL. My last attempt was to place the WSDL inside of my WAr file so I can access it through a web browser. I set the wsdllocation inside of the clie...

SAX parsing problem in Android... empty elements?

I am using SAX to parse an XML file I'm pulling from the web. I've extended DefaultHandler with code similar to: public class ArrivalHandler extends DefaultHandler { @Override public void startElement(String namespaceUri, String localName, String qualifiedName, Attributes attributes) throws SAXException { if (qualifi...

Modification of shortest path algorithm (route from a node to itself)

I am applying the all-pairs shortest path algorithm (Floyd-Warshall) to this directed graph: The graph is represented by its adjacency matrix. The simple code looks like this: public class ShortestPath { public static void main(String[] args) { int x = Integer.MAX_VALUE; int [][] adj= { {0, 6, x, 6, 7}, ...

Does C++ programmer simulate features of Java?

As I read in Thinking in java, Interface and inner class provide more sophisiticated ways to organize and control the objects in your system. C++, for example, does not contain such mechanisms, although the clever programmer may simulate them. Is it true that C++ programmer simluate features that java owns,e.g. interface ...

How do I use the ADF propertyListener tag?

I have a class CustomerBean { Customer customer; public CustomerBean() {...} public getCustomer() {...} public void setCustomer(Customer c) {...} ... } When using normal JSF I can use a setPropertyLIstener tag (on say a commandLink) to update the customer property. I'm trying to do the same thing with Oracle ADF, ...

call python modules from java classes?

Hi is it possible, by using jython to call jython classes from java code? If yes, how please? ...