Sunday, December 19, 2010

Why The PS3 Drives Me Crazy

Let me lead with a compliment. The PS3 is an amazing piece of engineering. The possibilities for this device are huge, which makes its overall sucking that much more sad. The best of the PS3 games clearly surpass its other console competition. Uncharted 2, for instance, is like being inside of a movie -- I can't say enough about it.

But that brings me to why I can't stand this device:

* every time you turn it on it requires a system update

* system updates block the entire UI ... oh you want to play a game? sitting for 10 minutes is pretty fun, too.

* the store is organized in ridiculous ways. you can't find anything. want to see the highest rated game demos? instead, they give you "A-F" "G-M" categories.

* buy something from the store. it doesn't download immediately. it brings you to a screen where you can decide to download it. bitch, i just spent $15 -- of course i want it now.

* the sounds in the store are super annoying. every selection is a really high pitched "ping" and scrolling through a long list will drive you crazy.

* the grid view in the store (which they use all over the place) has no linear navigation. you have to right, right, right, down, left, left, left, down, right, right ,right, down, left, left, left through it.

* when you download something from the store, there's no direct way to see that it's actually doing it -- you go all the way back out of the store to the "Download Manager"

* if you weren't sure it was downloading and clicked "download" more than once? yep .. you got it ... multiple concurrent downloads of the same fucking thing.

* if you want to remove a download from the download manager, you'd think "select it and then pick delete". instead when you select it, it takes you to a full screen that shows the icon and its file size. no options. if you go back out and instead hit the triangle button, THEN you get a menu of choices to "cancel" it.

* once you download something, it's not ready to play. you have to select it and then "install" it. are you serious? why in the world would i download something and not want it automatically installed?

* it's a total ui for nerds ... the FIRST menu item (after the login) is "settings," which has hundreds of advanced settings. why is that front-and-center? presumably after configuring it the first time, I never want to see this again.

* playing a blu-ray movie is a fun experience, too. you put the disc in ... and you sit ... and nothing happens ... so you start looking around, and the choice to play the movie is labeled something like "Play BD-ROM"

* the controls INSIDE a blu-ray movie are fantastic. there is no simple, common, controls ui -- it's every button you can possibly press in a tiny grid and you arrow over to the thing you want to press. i was pretty quickly lost in the controls trying to just navigate the menus reliably using the controller

* speaking of the controller, it took them quite a while top put out a system update that made it so your controller didn't just drain its batteries if you leave it sitting without remember to turn each one off. i'm still not sure that's the default setting even now.

* if you ever use the apps they provide in the "internet browser," you'll notice they're custom built for the PS3 and look TERRIBLE. them main menu labels on the youtube app don't fit in the buttons and all have ellipsis. it's BUILT for PS3. why would you custom build something that doesn't fit?

Wednesday, November 10, 2010

Switching from Subversive back to Subclipse

If you switch from Subversive to Subclipse, you will find that projects that were attached to subversive in existing workspaces will not offer you the option to Team=>Share... There are a couple workarounds for this:

Annoying and Tedious Way
  1. Before switching to Subclipse, Team=>Disconnect your subversive projects
  2. Uninstall Subversive
  3. Install Subclipse
  4. Team=>Share away

Annoying but Simple Way
  1. Toss everything and check it back out again with Subclipse

Atomic but Quick Way
  1. Uninstall Subversive
  2. Install Subclipse
  3. Quit eclipse
  4. Go to your workspace folder and run:
    find .metadata/.plugins/org.eclipse.core.resources/.projects -name 'properties.index' -delete
  5. Restart eclipse

Monday, February 22, 2010

Are Generic Methods evil?

Over the weekend I ran into an interesting design issue inside of ERRest. Java supports declaring generic methods that can perform a simple type inference:

public class NonGenericClass {
    public  T objectForKey(String key) { ... }
}

What this allows you to do is:

Person p = new NonGenericClass().objectForKey("person")

Notice that we don't have to cast to Person like you would if objectForKey returned Object. So ... is this bad form? The closest examples of Sun using type inference in the core libraries is Collections.emptyList(), which can give you a type-inferred List. The difference, though, is that this is an inherently safe operation. In the example above, that code is inherently unsafe. On the upside, your API becomes easier to use -- your users don't need to think about the cast. On the downside, you might say the API is misleading, implying that this operation is in some way typesafe when it clearly is not.

I came to a happy place with it. My decision was that if this API is impossible to make type-safe (think ResultSet.getObject(String)), and if that's fairly obvious to the user of the API, then taking advantage of type inference is OK and will just save your API users time.

One catch, by the way, is that javac appears to not like a double indirection of type inference:

public class ClassOne {
    public  T methodOne() {
        return ...;
    }
}

public class ClassTwo {
    public  T methodTwo() {
      return new ClassOne().methodOne(); // this is a compile error in javac
    }
}

For some reason, javac is not capable of returning an inferred type for a method call to a method that returns and inferred type. You have to cast to T:

public class ClassTwo {
    public  T methodTwo() {
      return (T)new ClassOne().methodOne(); // this makes javac happy
    }
}

Incidentally, the Eclipse compiler is fine with the first one and doesn't need the cast. I think this is a javac bug, personally.

Sunday, May 17, 2009

Maclipse 3.4.2 Fixed ... More

You may have noticed that Java=>Editor=>Templates throws an exception with Maclipse ... That's because there is some code that presumes there is a non-null vertical scrollbar. With Maclipse, we autohide scrollbars on Leopard, which causes an NPE in that code. I avoided fixing this because it brought in an entirely new plugin that we had to hack, but it's just one line, so .. meh.. at this point, why stop now.

So to prevent that exception, you will want to grab the Workbench Texteditor UI plugin provided in the links area.

cd /Developer/Applications/eclipse/plugins && curl -O http://webobjects.mdimension.com/wolips/preview/org.eclipse.swt.carbon.macosx_3.4.1.v3452b.jar && curl -O http://webobjects.mdimension.com/wolips/preview/org.eclipse.ui.workbench_3.4.2.M20090127-1700.jar && curl -O http://webobjects.mdimension.com/wolips/preview/org.eclipse.ui.workbench.texteditor_3.4.1.r341_v20080827-1100.jar

Maclipse 3.4.2 Fixed

The build from last night was missing a MANIFEST.MF, so it wasn't exporting the plugin info properly. I think this would only be a problem if you do plugin development, but regardless, you should grab the new build.

Saturday, May 16, 2009

Maclipse Eclipse 3.4.2 Updates

Maclipse has been updated with all the changes merged in from Eclipse 3.4.2 finally. Links on the right, same install process applies.

cd /Developer/Applications/eclipse/plugins && curl -O http://webobjects.mdimension.com/wolips/preview/org.eclipse.swt.carbon.macosx_3.4.1.v3452b.jar && curl -O http://webobjects.mdimension.com/wolips/preview/org.eclipse.ui.workbench_3.4.2.M20090127-1700.jar

You may also need to remove your eclipse configuration/org.eclipse.osgi/bundles folder (which contains the unjar'd SWT jnilibs).

Wednesday, January 21, 2009

Never hashCode on a mutable value Revisited

In the "Never hashCode on a mutable value" post, I talked about the pitfalls of using a mutable value in your hashCode/equals computation. Another subtle variant of this is using a Comparator for a mutable value in a TreeSet (or other similar data structures). Because the set is sorted internally, and optimized based on that sort information, if you change the sorted value of one of your objects in the set, it can "disappear" if you attempt to .contains(..) check it later. I wonder how many more of these stupid mistakes I'll find ...