java

What's in it for programmers from Google Chrome Operating System (don't mix with Google Chrome browser,please)?

What's in it for programmers from Google Chrome Operating System? I'm curious from Java, Scala, C++, C# perspective. ...

How to write a basic stackoverflow.com for self use?

I am not a web programmer...I am trying to write a basic stackoverflow.com or similar for internal knowledge exchange. I want to know what I should start from and what I need to learn. I am usually program in C++, and I have been programming in Java for a while for new job. I know html, python, and some javaee technology: EJB, Servlet et...

Regex to replace part of the string with spaces

It seems simple, but I can't get it work. I have a string which look like 'NNDDDDDAAAA', where 'N' is non digit, 'D' is digit, and 'A' is anything. I need to replace each A with a space character. Number of 'N's, 'D's, and 'A's in an input string is always different. I know how to do it with two expressions. I can split a string in to...

How to properly send an HTTP message to the client

I'm working on a RESTful web service in Java. I need a good way to send error messages to the client if something's wrong. According to the Javadoc, HttpServletResponse.setStatus(int status, String message) is deprecated "due to ambiguous meaning of the message parameter." Is there a preferred way to set the status message or "reason ...

Java 6 Update - Mac OS X application crash related to QuickTime libraries

I currently am looking at a bug related to an application crash when running on Mac OS X. The crash only seems to occur when using Java 6, with the Mac OS X 10.5 Update 1 (64 bit mode). The problem does not show up on 32bit Mac Java installs. From what I have read via google, the issue seems to be related to the fact that the applicatio...

Complex Class Hierarchy in Google AppEngine (Java)

Is it possible to have multiple classes that inherit/extends same class in Google AppEngine with Java (GAE/J) for my entities (JDO). For example I have: Content (Abstract class) Course and then my Course will have : list of Video that is extends Content list of Books At the same time Video has list of...

Cant open a doc file from the browser

I have a link using tag and it is linked to a .doc file in the server. When I click on the link, instead of giving the open, save box, it opens the file in the browser in the binary format. Has anyone encountered this problem? I am using a Weblogic server. ...

Mounting and untar'ing a file in Java

Hello all, I'm currently working on a web application that involves mounting a drive and extracting a tar.gz file, all in Java. Since the application runs in a linux environment, I figured I'd try using unix commands like "mount" and "tar". Runtime runtime = Runtime.getRuntime(); Process proc; String mountCommand = "mount -t cifs -o u...

Java and RTP - related experiences

Hi, I'm trying to collect some experiences about using a Java library to stream RTP. In your experience, which is the most suitable library for this task? I am currently evaluating: JMF, FMJ, jrtp, others? (that you might suggest) Thank you, Michele ...

Dropping support for JRE 1.3

We provide a popular open source Java FTP library called edtFTPj. We would like to drop support for JRE 1.3 - this would clean up the code base and also allow us to more easily use JRE 1.4 features (without resorting to reflection etc). The JRE 1.3 is over 7 years old now! Is anyone still using JRE 1.3 out there? Is anyone aware of any...

'Loading circle' or 'busy label' for Swing?

I've used this 'LoadingCircle' project in .net applications. Is there an equivalent component that provides a loading circle for Swing? Are there any other loading indicators available for Swing. ...

I want to make a web browser, but I'm not sure where to start?

I want to use WebKit as the layout/rendering engine, and I want to code it in Java. I am having troubles finding any useful info. I saw this question here which cleared things for me slightly, but I need more to get started. I would like to know: If I can use Java? Where can I find documentation on how to work with and use WebKit? ( I...

Convert a base25 String to binary String in Java

So I have a set of base digits like "BCDFGHJKLMNPQRSTVWXZ34679" how do I convert a value say "D6CN96W6WT" to binary string in Java? ...

Java: compare object values

I am trying to compare the value of 2 instances of x inside an iterator. x is a reference type containing its own data members. I am trying to compare one instance of x against another to determine if the values inside each are the same. if (x.equals(x)) keeps evaluating to true when actually the value of each instance of x is differe...

How do you determine if a character requires the shift key to be down to be typed?

I am writing some code to type strings using the Robot class. Everything is mostly good (well, I have to use a big switch statement to get character keycodes), except some keys don't have keycodes, because they are actually a combination of SHIFT + some other key. For upper case letters, it is easy to check, using Character.isUpperCase...

Why is this Java PreparedStatement throwing ArrayIndexOutOfBoundsException 0 with parameterIndex = 1?

The following method, when called with something like String val = getCell("SELECT col FROM table WHERE LIKE(other_col,'?')", new String[]{"value"}); (this is SQLite), throws a java.lang.ArrayIndexOutOfBoundsException: 0 at org.sqlite.PrepStmt.batch(PrepStmt.java:131). Can anyone take pity on my poor bumbling here and help me with why? ...

Localhost:8080 not loading - glassfish

hi I have installed Glassfish webserver version 10, successfully in MAC OS. I had no problem intalling or starting the server. the server is running, but when i try to run glassfish in port:8080, it is not loading and i get a blank page. however, localhost 4848 is loading and I can see webspace enabled there. I have tried with jdk5,6 and...

How to select the candidates to a course among 100+ suscribers?

My job is to spread the word about this free SCJA (Sun Certified Java Associate) course at my school. I'm also receiving all subscribers information such as e-mail, name, an phone no. I already have almost 100 suscribers, and there'll be possibly more in these days. The problem is that the course has limited capacity for just 60 of them....

Object is blank after getting it from Google Datastore

I asked question before asking if it is possible to save complex class composition in to the Google Datastore inside Google AppEngine with Java, but I was not clear enough and lazy to post all my class but after a lot of hours of struggle I start giving up. So here is more detailed question with the code. I know this kind of stuff shoul...

Exposing Entity IDs of Google Datastore data

Is it save to expose entity ids of data that is in Google Datastore. For example in my code i have entity with this id: @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true") private String id; The id is going to be similar to this: agptZeERtzaWYvS...