Friday, September 28, 2007

So over the last few weeks i've been working on improving the C# binding for libgphoto2.. Thankfully, the backend C wrapper was in fairly good shape with thanks to the guy who originally developed it, and trickv, who became the maintainer of it and is the guy responsible for implementing MTP support in banshee.

For me looking at the code as a newcomer to the libgphoto-sharp 'team', the first thing i realised was that the c# api was a direct copy/paste of the C api. There was no proper frontend which simplified the use of the libghoto2 library. For example, to get a list of connected devices and then connect to a specific one required detailed knowledge of the libgphoto2 API and over 100 lines of code and also required you to be very careful about disposing of objects correctly.

So, my first task in getting full MTP support in banshee was to write up a new API for libgphoto2-sharp which hid all that nastiness from the end-user. The new API is, i suppose, 80% complete. Quite a few of the methods in the API are blocking, and so asynchronous equivalents will have to be added. One of the more immediate benefits is that detecting and connecting to a camera takes 3 lines of code now ;)

So, if anyone out there wants to use the new simpler API (fspot and banshee devs, i'm talking to you) you can check the code out with this command:

svn co http://gphoto.svn.sourceforge.net/svnroot/gphoto/trunk/bindings/libgphoto2-sharp gphoto

The binding should be considered API unstable until (probably) the release of libgphoto3.x.

Friday, September 21, 2007

As both a cyclist and a humanitarian, i think i'm fully qualified to say: Women with babies should not be allowed out in public.

"What are you on about" i hear you ask. Well, the reason is simple. Whenever a woman sees a baby, they instantly become hypnotised by it's hideous features and are reduced to mumbling cryptic phrases such as "Goochie goochie goo" and "Who's a big boy then?" to said baby. Unfortunately, this distracts them from real-world issues such as how to cross the road safely.

I was cycling to college yesterday, as i've done for the last 3 years (i cycled to secondary school for the 6 years before that and primary school for 3 years before that). All was going well, i was a mere 2 minutes from my house and was just preparing to take a left turn (in ireland we drive on the left-hand side of the road) when all of a sudden, a woman with a baby decided to cross the road in front of me whilest talking to her baby. So there i was, travelling at approximately 25 miles an hour with a baby in a pram being pushed by an idiot a mere 15-20 metres in front of me.

I jammed on the brakes, the back tire locked, the wheel skidded on the wet ground and i went flying. Whilest i got away with some scrapes and bruises, my MP3 player wasn't quite so lucky. I only got music from the left earpiece. I was pissed! So, as an electronic engineer, i tried to fix it. A quick google got me instructions on cracking open the case, so i did.

Initial inspection made it look like very minor damage:
Start

However as i gently poked it, more and more bits started coming off:
middle

Finally, by the end of it, the entire lefthand side was toasted and the top bit was also completely broken off. I was none to happy:
end

So, my task now is to find something to wedge along the side of the earphone jack which will hold the metally bits in place. Everything works fine at the moment, but unless i support those metally bits, they will bend back out of position through use. Worst case scenario, it's a 30 gig portable harddrive which can play films on any tv via TV-Out. Still pretty useful.

Monday, September 10, 2007

I don't care how i get one, but i need one of these!

Clicky Linky.

It looks so, so, so nice! I just wish public free wireless was as prevalent in ireland as it is in the US.

Thursday, September 06, 2007

Have no fears my American friends, your President has your best interests at heart. Check out this interview where he reveals where that 50 billion in defense money is going:

Wednesday, September 05, 2007

I also care about the issues!

[quote]Sun Microsystems Demands University Study Retraction

The University of Washington, apparently hoping to capitalize on the recent hype around their controversial study on Baby Einstein™-style videos, followed up yesterday with another, similar study. In the new study, researchers found that Java programmers understand an average of seven fewer Computer Science concepts per hour spent with Java each day compared to similar programmers using other languages. Sun calls the study "seriously flawed", citing the fact that you can combine the names of Gang of Four Design Patterns to form new Computer Science concepts that all Java programmers understand, such as the ObserverFactoryBridge, the BridgeFactoryObserver, and the well-known FactoryObserverBridgeChainOfCommandSingletonProxy, beloved of Java programmers everywhere. Java experts at Sun say they're not sure how many combinations there are of the twenty-three pattern names, but there are "definitely a lot of them."
[/quote]

It's true. Java programmers do have a tendency to not be familiar with the new programming paradigms that Web 2.0 bring out daily. So, in an effort to do my bit to help these poor developers, i decided to calculate exactly how many combinations of the 23 pattern names there are. After spending hours with a pen and paper doing lots of complex multiplication, differentiation, division and.... addition, i came up with this answer:

There are 7 possible combinations of the 23 names.

So for all you java people out there, there's not much to remember. You can thank me later, a pint will do.

Saturday, September 01, 2007

So the summer is finally at an end. I've returned back to Ireland from what was probably the best summer I've had in a while. I got to work on something useful, with some cool people, on a project that is single handedly going to destroy all of linux (if you believe the people in groklaw).

When i arrived over to Boston just over 3 months ago, the team were in the middle of their 21 day hackathon to get a working demonstration of Silverlight working on linux. So, i was tasked with the job of creating a visual designer for silverlight. Of course, the first thing i did was panic. I knew nothing of silverlight, nothing of xaml and had 12 weeks to produce something useful.

So, 12 weeks after i started, i managed to produce something ;)

Basic features: Video
All your standard features are there. You can select items, resize, rotate, move, alter properties through the property pane on the right. You can undo and redo (most things are undo/redo-able).

Animation Recording: Video
The basics are there for recording animations. Not everything can be animated as of yet. The supporting infrastructure is all there. Its just currently it can only animate properties which take doubles as their value.

You can do cool stuff like record several keyframes, then move them around to make the time longer, or shorter, or you can completely rearrange the keyframes so things happen in a different order. You can also seek along the storyboard and see the positions of the elements at different times in the animation. It's not quite up to the standard in Blend, but it's usable ;)

Sample Animation: Video
This is an animation which was created entirely using Lunar Eclipse. Everything you see was done through the IDE. The xaml was then copied and pasted into a textfile and the only modification it needed was to alter the xaml so that the storyboard started as soon as the canvas was loaded. Other than that, the xaml used was all auto-generated in the designer.

So, the overall goal of this designer is to have a good base which can be integrated into MonoDevelop in the (hopefully near) future. As the designer is going to be written in Silverlight, it should be relatively easy to stick a web-based frontend on it and use it through a web-browser. How cool would it be to be able to create little animations all through a browser!

There is still a tonne of work which needs to be done, the next part of which is to make the XAML a little less verbose and the animations able to animate more than just doubles. After that, who knows! There's a bunch of stuff not done, a bunch of things which probably need updating or extending and a bunch of testing to be done.

So all in all, it was fun this summer. At the start, nearly every time i updated the moonlight codebase from the repository, either it broke my code or i found new bugs. Nearly every time i reported a bug, it was fixed within 30 minutes. Thats what life is like on the bleeding edge. I have to say, toshok was amazing, i definitely owe him a pint. I wouldn't be surprised if every time i wrote the word "bug" in irc, he shuddered. He was usually the guy who ended up fixing my problems.

For the rest of the people in the office in Cambridge (Miguel, Jeff, Aaron, Garett, Guy (if i spelled that right) and whoever else i've forgotten), it's been great! If you're ever around Ireland, gimme a shout. I know the best place for sushi ;) If not, sure i may see ye at the Mono Summit. Who knows.

The only question i have after the summer is: If he can't swing from a web, what can he do?!

Hit Counter