Wednesday, February 20, 2008

Total Lunar Eclipse

It looks like it is going to be a clear sky for tonight's total lunar eclipse. Hmm...I thought I would have heard more about it in the usual Eclipse news channels today. The event should start around 8:45pm (EST) with the total eclipse happening at around 10pm (EST). If you live in Toronto, you could always attend the free* party.

*Free? I should hope so! I know I wouldn't pay to "look up".

Sunday, February 10, 2008

Updating UI Elements From Command Handlers

I struggled a bit with this tonight so I figured it was worth a post. I am piddling around with command handlers as part of my background work for my upcoming talk at EclipseCON (should I keep plugging EclipseCON, or is that enough already?), and one of my simple samples was building on the Hello World, Command PDE sample. I wanted a simple toggle command instead of the default push-style command, but I could not get the menu item to toggle state (checked versus unchecked) when I executed my command with the keybinding. A little searching led me to this newsgroup post, and an eventual solution.

The secret sauce seems to be:

Make your class implement IElementUpdater:


public class SampleHandler extends AbstractHandler implements IElementUpdater {
//...
}


Implement said interface with your required logic (this code is for my particular case):

/**
*@Override
*/
public void updateElement(UIElement element,
Map parameters) {
element.setChecked(this.image != null);
}


Now, you need to get the command service to call updateElement. The easiest way to do this is in your execute method like so:


public Object execute(ExecutionEvent event) throws ExecutionException {

//... actually do something here ...

// Refresh the UI elements
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
ICommandService service = (ICommandService) window.getService(ICommandService.class);
service.refreshElements(event.getCommand().getId(), null);
return null;
}

Saturday, February 9, 2008

StSanders Banned!

Apparently YouTube has pulled all the StSanders videos for copyright infringement, according to Wired. I guess it is their policy to pull videos after three complaints and someone complained a third time. Rumor has it Yngwie Malmsteen may have been one of them.

I'm not sure how you can not have a sense of humor about something like this. Just watch this video and tell me it is not hilarious:



Haha - that one has to be my favorite. I can't imagine the effort that went into overdubbing some of these. Anyway, Wired Video is mirroring them all anyway. I guess they don't have any sort of copyright infringment policy. ;)

Wednesday, February 6, 2008

PDE Nuggets

I find myself constantly amazed at the hidden gems you can find in Eclipse. Today's nugget is brought to you by the PDE, and is the Plug-In Registry View. I found it very useful while playing with namespace wackiness for my upcoming EclipseCON talk.



Some of you may say "What's so new about that?". Well, what can I say - I'm a little behind the times I guess. Most of my extension development has been done in Eclipse 3.2 or earlier, and this view seems to have appeared in Eclipse 3.3, so I'm sure there are others who don't know of its existence. (Correction: It looks like this view has been around far longer than that; as early as Eclipse 2.0, in fact. It just did not look or behave the same.)

I'm a little disappointed, however. I had this plan to write my own "extension registry spy" plug-in as sample code to accompany my presentation, but this view already does most of what I was going to implement. Oh well, I guess I'll have to think of another application to hack on for sample code purposes.

I guess it's more of a diamond in the rough than a gem as there are still some limitations and little bugs to be ironed out, but it is worth a look. So if you're a plug-in developer - check it out:

Window > Show View > Other > PDE Runtime > Plug-in Registry, or simply press Ctrl+3 (another Eclipse nugget), type "plu", and select it from the list.

Monday, February 4, 2008

An Empty House

Well, we got Michelle off to the airport and back home last night and she managed to make it home to Glasgow with only one minor injury. Turns out she took a nasty fall one morning last week and dislocated her knee-cap! I've updated the photos in the gallery, so you can see her stylish knee brace there. So not only did she get to see real Canadian snow, she also got to experience our health care system first-hand with a three-hour stint in the emergency room. Welcome to Canada!

Thanks for visiting and staying with us Michelle, we had a great time and we hope you did too (despite your Canadian ice-induced injury)!

Thursday, January 31, 2008

Lucky's Laptop Repair

Recently a friend of mine asked me if I could look at his laptop for him. The screen (both LCD and external monitor) was showing multi-colored, vertical bars and was generally screwed up. I tore it down and did a lot of searching and came to the conclusion that the graphics chip was screwed. Since these are soldered directly to the mainboard I searched high and low for a reasonably-priced one from HP (yeah, right...) and on eBay. While the eBay prices were about a third of the cost of a new one, it was still prohibitively expensive and wasn't worth fixing.

Not one to be thwarted so easily, I kept scouring eBay for parts and busted laptops of the same model to no avail. Eventually, while searching one night for a potential source or method of replacing the chip itself, I stumbled upon a thread in a Mac forum about iBooks that apparently had a known flaw where the graphics chip would flake out. Someone figured out it was due to a poor connection between the chip and the motherboard (rather than the chip itself being screwed) and decided to try to fix it themselves with a heat gun. The graphics chips on most modern laptops are surface mounted using a ball grid array type configuration. If you can heat up the solder underneath enough to re-melt it (without melting the graphics chip or the motherboard, of course) you can fix the poor connection.

Well, since I had spent so much time on this and it was really starting to irk me, I figured what the hell, I've got nothing to lose at this point. So I borrowed a heat gun from a friend (thanks, Todd!), and tore the sucker down again.



I grabbed a bunch of aluminum foil and shielded the surrounding areas.



Then I threw caution to the wind and cranked up the heat.



I then re-assembled it all (with no extra screws, I might add; which rarely happens when I start tearing stuff down like this) and flipped the switch. Would it work....?

.
.
.

OH GOD!



Initially, the screen stayed black for a few seconds and I figured I had finally pooched it for good with too much heat. And then...



Nice. I fricking rule. Although with the amount of time I have spent on this particular challenge, I probably could have earned enough money to buy a new one 10x better. Oh well. That's not the point, right?

Tuesday, January 29, 2008

Revenge of the Gamers

Well, on one hand I am glad there has finally been someone to come forward and apologize for propagating the outright lies told by various members of the media about the game Mass Effect, but I think Cooper Lawrence got the short end of the stick. Gamers totally blasted her books on Amazon, giving her a little taste of her own medicine, and while she was at fault for blindly spouting off on TV the real culprit should be tarred and feathered in my opinion. Why has he not apologized? Could it be he was just looking for publicity to make himself feel important, or is he really that stupid?