Skip to content
accelerando

Monthly Archives: April 2007

Java crazyness

24-Apr-07

Someone must be hit really hard with some curly braces when he implemented the following behaviour:

public class Braindead {
	public static void main(String[] args) {
		Integer i1 = 10;
		Integer i2 = 10;
 
		Integer i3 = 128;
		Integer i4 = 128;
 
		compare(i1, i2);
		compare(20, 20);
		compare(i3, i4);
	}
 
	public static void compare(Integer i1, Integer i2) {
		System.out.println("Comparing " + i1 + " and " + i2);
 
		if(i1 == i2)
			System.out.print("same ");
		else
			System.out.print("different ");
		System.out.println("Objects");
 
		if(!i1.equals(i2))
			System.out.print("not ");
		System.out.println("meaningfully equal");
		System.out.println("---");
	}
}

I’d expect the following output:

Comparing 10 and 10
different Objects
meaningfully equal
---
Comparing 20 and 20
different Objects
meaningfully equal
---
Comparing 128 and 128
different Objects
meaningfully equal
---

What you get is:

Comparing 10 and 10
same Objects
meaningfully equal
---
Comparing 20 and 20
same Objects
meaningfully equal
---
Comparing 128 and 128
different Objects
meaningfully equal
---

In order to save memory, two instances of the following wrapper objects will always be == when their primitive values are the same:

  • Boolean
  • Byte
  • Character from \u0000 to \u007f
  • Short and Integer from -128 to 127

So in order to save a handfull of bytes we present you some really inconvenient feature ;)

Security by definition

23-Apr-07

So lets say you’ve written your mindtwisting, brilliant trojan virus… how’d you name the file? maybe install.exe? Probably not… as the user would be required to enter his admin password under Microsoft Windows Vista… Just use any other name and there will be no annyoing dialog to confirm extended admin rights. Just brain dead.
Read on the gaybar.

But hey, it fits well with the convenient “desktop.ini”, just have a look here, “Der Explorer lügt noch mehr” (The explorer lies even more).

Longer than expected…

18-Apr-07

Wow, that THING is huge….

No, not what you expected ;) , just installing .NET on a virtual pc machine:

Longer than expected…

Apple delays Leopard release until October

13-Apr-07

Damn, i was looking forward to install Leopard in my vacancy… But it seems it’s not gonna happen:

“We can’t wait until customers get their hands (and fingers) on it and experience what a revolutionary and magical product it is,” Apple said. “However, iPhone contains the most sophisticated software ever shipped on a mobile device, and finishing it on time has not come without a price — we had to borrow some key software engineering and QA resources from our Mac OS X team, and as a result we will not be able to release Leopard at our Worldwide Developers Conference in early June as planned.”

Apple Insider

Malformed pingback or trackback text

10-Apr-07

If you’re wordpress pingbacks or tracksbacks show everything but the post text it’s possible that you don’t have the right css class in your div. The div element that contains the entry text should be classed with “entry”.

Mint 2.x advanced preferences

09-Apr-07

I use Mint for two domains. One 1.x version and a newer 2.x version. I wasn’t pleased, that the option to keep the databasesize under a certain limit was removed from preferences in version 2.x. Also, the possibility of limiting individual visitor statistics was gone…

Today i stumbled upon admartinator. Obviously a mac user, he is also minted…

If you click on your mint preferences, append a &advanced to the url and the two options are back in the game.

Hello again…

07-Apr-07

Just get rid off K2, it was way to slow… Now i use a slightly modified theme from plaintxt.org, which i like a lot.

More to come after the easter holidays.

WordPress and UTW Upgrade

03-Apr-07

Why on earth has my ‘post_type’ column on my wp 2.0.x based blog no default value? Ultimate Tag Warrior UTW3-14159265 will break and show no tags.

If anyone else has this problem, add

$typelimitsql = "(post_status = 'publish' OR post_status = 'static')";  // From previous version of utw

in ultimate-tag-warrior-core.php right before the class definition. It’s taken from the previous UTW Version.

Edit:
Upgrading to WP 2.1.x changed the table structure… A little hint would have been nice in the utw changelog.

Close
E-mail It