Skip to main content
xenoveritas.org

Main navigation

  • Categories
  • Home
  • Links
  • Name Generator
  • Scramble
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Technology

Java

Technologies based on Sun's Java platform.

By Xenoveritas, 6 December, 2007

Java, Copy Constructors, and clone()

Topics
Java

The need to copy objects come up frequently in object-oriented programming. The are many times when an object needs to be copied, so a new object with the same state can be modified.

There are several solutions for this. Which one is best? That's, unfortunately, debatable.

By Xenoveritas, 29 November, 2007

Java 6, font anti-aliasing, and brain-dead API...

Topics
Java

One of the big features that Java 6 added was the ability to use subpixel anti-aliasing when rendering fonts. This greatly improves the way fonts look on LCD screens, making it far more readable. By default, Swing now uses these AA settings.

Unfortunately, for what I can only imagine must be backwards compatibility reasons, text rendered by user components in Java still uses no font anti-aliasing. (Period.)

Fortunately there's API that allows you to enable subpixel rendering.

By Xenoveritas, 17 September, 2007

Worthless Error Messages

Topics
Java

This error message is just priceless:

Problem Occurred: Reason: org/eclipse/ui/IWorkbenchPreferencePage

I love the title. It's really wonderful. "Problem occurred." You know, I did figure that out. I figured it out because an error message is being displayed.

"Unable to create the selected preference page" - this is basically the only helpful message for users on the entire box. And it's not very helpful because once you close the dialog, the same text appears in the preferences dialog anyway, making the error dialog practically worthless.

By Xenoveritas, 14 December, 2006

Singletons and Double-Checked Locking in Java

Topics
Java

I've seen the double-checked singleton pattern before, and at first thought it would work. It's an attempt to reduce the penalty of requiring synchronized access to obtain a singleton.

Essentially the pattern is as follows:

public class Singleton {
    private static Singleton instance;

    public static Singleton getInstance() {
        if (instance == null) {
            synchronized(Singleton.class) {
                if (instance == null) {
                    instance = new Singleton();
                }
            }
        }
        return instance;
By Xenoveritas, 6 December, 2006

WTF Indeed

Topics
Web
Java

This thread on The Daily WTF is rather depressing. Essentially, the original poster is complaining about the following code:

By Xenoveritas, 5 December, 2006

Eclipse Error

Topics
Java

So I'm trying to build an Eclipse application using Eclipse's ANT toolset. This would allow me to build an Eclipse application from the command line without having to go through the Eclipse GUI.

But whenever I try and run the build script, I get the following errors (path names changed):

By Xenoveritas, 23 October, 2006

Where's Java SE 6?

Topics
Java

I seem to recall Sun announcing they were going to open source Java, with some hints that Java 6 would be released open source around October.

Well, it's October. Actually, it's late October.

Where's Java SE 6, open or not? Java SE 6, Beta 2 has been available for months, since May if I recall correctly. (A beta, at least, if not beta 2 itself.)

It's fall 2006. Where's Java SE 6? Why have there been no status updates? When are they going to release it?

By Xenoveritas, 12 August, 2006

UUID Library

Topics
Java

I've created a library for generating UUIDs with Java, based on RFC 4122. If you're using Java 1.6, this will use a hardware MAC address to generate a UUID as specified in the RFC. If not, it uses a randomly generated number for the node.

Note that while Java 1.5 added a UUID class, this library uses its own UUID class.

Update: Version 0.9.1 no longer requires Java 1.6 to compile and now runs under Java 1.5. You may also now choose whether or not to use your MAC address as the node value using the built-in generator under Java 1.6.

Pagination

  • Previous page
  • 2
Java

Current Games

I'm currently playing:

  • Final Fantasy XIV: Endwalker

I intend to maybe get around to finishing:

  • Literally anything else

Video Games Section

Thought for the Moment

I never have thoughts any more.

Old Thoughts

Has the LHC Destroyed the Earth?

  • Create new account
  • Reset your password
RSS feed
Powered by Drupal