java

How do you Edit Video ID3v2 Tags in Java

I have been doing some research on ID3V2 tags and Video Formats such as MP4 and WMV. The two top libraries for editing ID3V2 tags seem to be: Entagged and Jaudiotagger Both of these support only audio formats. ( They support M4A and WMA but not MP4 and WMV ) I guess first off why is this? Then are they any alternatives. ...

Programming References Anyone?

Since I started working I go to StackOverflow for everything. But as we all know it is good to have many ways to skin a cat. where is your other favorite website to visit for programming Reference? ...

simple Java "service provider frameworks"?

I refer to "service provider framework" as discussed in Chapter 2 of Effective Java, which seems like exactly the right way to handle a problem I am having, where I need to instantiate one of several classes at runtime, based on a String to select which service, and an Configuration object (essentially an XML snippet): But how do I get ...

Is there (an automated) way to backup Hudson CI files?

Here at my company we have three Hudson CI servers with 100+ jobs configured. We are looking for an automated way to periodically backup job configurations and build history. Currently we have an ant script that we configure as a job but it's not easy to maintain and not elegant. Have any of you found a way to manage this? ...

Why does this code with generics compile?

This seems like a stupid question, but I'm tripping over it at the moment. Why does this compile? import java.util.*; public class Test { public static void main (String[] argv) throws Exception { Map<String,String> map = new HashMap<String,String>(); map.get(new ArrayList<String>()); } ...

What's the most practical way to have "functions in a dictionary" in Java?

Hello folks, When programming with C/C++ or Python I sometimes used to have a dictionary with references to functions according to the specified keys. However, I don't really know how to have the same -- or at the very least similar -- behavior in Java allowing me dynamic key-function (or method, in Java slang) association. Also, I did...

Need help removing strange characters from string

Currently when I make a signature using java.security.signature, it passes back a string. I can't seem to use this string since there are special characters that can only be seen when i copy the string into notepad++, from there if I remove these special characters I can use the remains of the string in my program. In notepad they look ...

OO game design question

Hi SO, I am programming a simple game in Java but I am trying to do it 'right' with a nice clean design and no hacks. I have two classes GamePanel that receives clicks and keypresses and Model which contains all the Entities and is responsible for their updates. The Model needs to know where the user's mouse is but I can't decide on...

How do I marshal nested lists as JSON using Jersey? I get an array of nulls or an array of one-element dictionaries containing an array.

I'm working on a project which uses Jersey to convert objects to JSON. I'd like to be able to write out nested lists, like so: {"data":[["one", "two", "three"], ["a", "b", "c"]]} The object I'd like to convert first represented data as a <LinkedList<LinkedList<String>>>, and I figured Jersey would just do the right thing. The above wa...

Commonly Misunderstood Elements of Java?

I was making an array of objects, and wanted to run the constructor for the object on every element of the array to initialize them like so: cells = new Cell[cols]; Arrays.fill(cells, new Cell()); But I started to doubt that it did what I wanted and sure enough Arrays.fill(Object[] o, Object val) doesn't do what I want it to. Esse...

MouseEvent weirdness

I'm trying to create a MouseEvent with certain modifiers for UnitTesting. I'm using J2SE and the following code fails to pass: public void testMouseEventProblem() { MouseEvent event = new MouseEvent(new JPanel(), 1, System.currentTimeMillis(), InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK, 1,1, 0, false); assertEquals(I...

Getting list of objects referring to an Object

Given a Java Object, how can I get a list of Objects that referring to it? There must be extension mechanisms in the GC for doing this kind of thing, just can't seem to find them. ...

JDBC Connection to SQL Server 2000 reset randomly on Solaris server

Hey all, I have the following method being called in a Java EE web application. public static void submitToPending() { Db db; ResultSet rs; try { db = new Db("Database.properties"); rs = db.issueQuery(getDescriptorList()); while (rs.next()) { db.insertApplicationData(rs.get...

TextMate equivalent to gVim Ctrl+P

To auto complete a previously written string. Is it possible? EDIT I'm editing javascript/java if that matters. ...

JSESSIONID collision between two servers on same ip but different ports

I've got a situation where I have two different webapps running on a single server, using different ports. They're both running Java's Jetty servlet container, so they both use a cookie parameter named JSESSIONID to track the session id. These two webapps are fighting over the session id. Open a Firefox tab, and go to WebApp1 WebApp1's...

Copying files from one directory to another in Java

Hello, I want to copy files from one directory to another (subdirectory) using Java. I have a directory, dir, with text files. I iterate over the first 20 files in dir, and want to copy them to another directory in the dir directory, which I have created right before the iteration. In the code, I want to copy the review (which represent...

How to handle OUT OF MEMORY error for multiple threads in a Java Web Crawler

Hi! I'm fairly new to programming and am working for my dissertation on a web crawler. I've been provided by a web crawler but i found it to be too slow since it is single threaded. It took 30 mins to crawl 1000 webpages. I tried to create multiple threads for execution and with 20 threads simultaneously running the 1000 webpages took on...

GWT wrap() method iterates whole DOM unnecessarily?

I'm using a custom GWT component that wraps around an existing textbox in my html page. The page returns a list of information - so as larger sets of information are loaded - the GWT loading process takes longer and longer. Looking at the source code of the wrap() method - it appears it iterates through the DOM looking for matching i...

Eclipse is trying to build the files in my .svn directories... how can I tell it to stop?

I'm storing my Android project in a Subversion repository. After recently shuffling a bunch of stuff around I started getting tons of errors like: syntax error entries /project_name/src/.svn line 1 Android AIDL Problem syntax error don't know what to do with "" entries /project_name/src/.svn line 28 Android AIDL Problem etc. It ...

JCIFS Window Authentication in Java

Currently I was using jcifs to manage the window authentication. I've got few questions: The first time the user run the page and types in wrong password, when user try to key in again the password remain there. Even if I close the browser run again the password still remain there. How to remove the password? Can I implement like after...