Kikkoman

Current Spotting

Flower

Archive for the ‘java’ Category

Spring Bean “Inheritance”

Is wonderful. Read all about it here.

USB Interface kits

here

Quite cool looking, cheapish hardware, sensors, and motors that with interface kits that are USB enabled on Win/Mac/Linux with Java too supposedly. Spiffy.

Beware the Ant that ships with Fedora Core 2

Ran into a nasty bug at work with the version of Ant that is shipped with Fedora Core 2. It is broken wrt our builds AND I didn’t know it was installed. GRRRRR. It is clicked by default under the Development Tools selection on the install. So I spent alot of time trying to figure out why the Ant that I installed wasn’t working.

FC2 ships with a gcj compiled version of Ant 1.5.3, which if you are not careful with your PATHs will get used instead of the regular Ant.

The FC2 version threw two different errors. On one build file, it couldn’t find javac, ‘Can’t find com.sun.tools.javac.Main’ or something like that. On another build file it seemed to find javac, but javac died by trying to allocate 1.7 gigs of ram.

Strange.

“Shows” for programmers

The .NET show

The Server Side Tech Talks

While you probably won’t many specifics, but they are a great way to learn “what’s going on” by osmosis.

Milo S.

SXSW: Developing Apps for the Cellular Market

Jim Trudeau, from Metroworks.

25 million Palm devices sold
5 million Symbian in its first year (2003)
more smart phones that handhelds in Europe in 2003

Symbian is projected to have 75% of the cell market.

Java on a cell phone is a “theortical advantage”. Write once, test everywhere. Slower than os specific code. Sandbox limitations. That said MIDP 2.0 is much better, networking, https, etc.

Network restrictions: Unless you are signed, you can’t access any place but
where you came from.
Sandbox: You might not be able to go fullscreen.
Write once, test everywhere. Crazy stuff like the pixel aspect ration between phones are different.

Symbian: From the ground up specifically for cell phones. C++. Specifically not MS.
Not portable across Symbian phone, eg can’t write an app for a Nokia Series 60 and have it run on UIQ. Eg, base core with UI patched in on top.

Btw, this guy is a very good presenter.

mmmm Developing for cell emulators. Metroworks is the only way you can get good debugging on Symbian.

Metroworks actually runs the developer community/forum stuff for alot of the manufacturers and carriers.

MIDP 2.0 does have support for bluetooth access but it depends if it is implemented on the phone. The P900/800 supposedly has it.

3000 word blog entry on getting started with Eclipse

here.

Makes me willing to pay for Intellij. Not trying to dis Eclipse at all, it looks like a very powerful platform, just not so much of a good application yet.

Ideally there would be a few different builds of Eclipse available, with all the plugins “common” plugins bundled in, and a sensible layout.

BareBones Eclipse download #1.
JSP/web development (no EJB) download #2
JSP/web/EJB development download #3
Applet/Standalone app development download #4

After installing Eclipse, it takes like a half an hour before you see your code and can do anything useful with it. That needs to be reduced to 5 mins.

Swing Goodies

Origional Post


Cool Swing-ish Stuff

After a ton of interesting feedback last time, I’ve scoped out some interesting Swing bits and pieces. I’ve got most of what I needed, but here’s the summary so far:

JGoodies Forms for layout management - I finally have found a layout manager that I understand and that does what I want!

l2fProd provides exactly the button bar I was after (very Mozilla-ish)

exe4j is a very polished little exe maker for Windows to give you that nice icon/launch option.

Still looking for a nice grid… but something will come up…

Caching Images that are dished out with a Servlet

   You can find examples of how to dish out an image via a servlet online, but they don’t go into the caching of the image. Basically, you ‘name’ the servlet in the “src” of your img tag and in your web.xml file.

<img src=”imageServlet.imageServ?imageId=xxxx”>

and in the web.xml:
<servlet-mapping>
   <servlet-name>ImageServlet</servlet-name>
   <url-pattern>*.imageServ</url-pattern>
</servlet-mapping>

Caching: My coverage is an extension of a post here.

To get the browser to cache the image you need to set some headers.
response.setDateHeader( “Last-Modified”, image.getModifiedDate() );

On the next access of the image, the browser will/should respond with a “If-Modifed-Since” header. Compare the image’s timestamp on the server with the timestamp from the browser. If the browser has an old copy or didn’t set the header, send out the image. If the browser has the image, you set a HTTP response of 304 “Not-Modified”.

So in the end it looks something like this:

long browserTime = request.getDateHeader( “If-Modified-Since” );
long imageTime = image.getModifedDate();
if ( browserTime == -1 || imageTime > browserTime )
{
   // send the image
   response.setDateHeader( “Last-Modified”, imageTime );
}
else
   response.setStatus( 304 );

and you’re done.

JVM as a cramfs filesystem

Turns out that the jars that make up the Linux 1.4.2 JRE aren’t compressed very much.

Eg, if you unjar and rejar rt.jar, it will be significantly smaller: 23 –> 12 megs. Uncompressed rt.jar weighs in at 49 megs.

Useful if you are trying to get the jvm in a cramfs filesystem, where the max input filesize is 16 meg.

Also, you can save 7.5 uncompressed megs by dropping the server vm from the lib/i386 directory.

Where is java on the mac?

FYI, The JRE on the mac is located in:
/System/Library/Frameworks/JavaVM.framework/Home

Need that to create a project in Intellij on the mac.