Pages

Monday, October 8, 2007

I don’t know why cyclists get a bad name

I have nothing against people who ride bikes on the road.
Sometimes it would be nice not to have them there, but they normally don’t do anything wrong.

Then I seen this guy.

Yup, that’s right. On his bike and using a mobile.

-= Comments
1. Mark | October 8th, 2007 at 9:39 pm
You always have a camera at the ready

You just solved a riddle though, this morning I wondered why the exhausts on busses shoot out of the right side and fill my car with fumes.. It’s for the benefit of the one armed cyclists talking on mobiles, I mean he couldn’t possibly stay on his bike AND talk on the phone AND breathe fumes…

2. Matthew Delves | October 8th, 2007 at 11:59 pm
Most cyclists do use a handsfree.

As for me, just as when I’m driving, I refuse to answer the phone.

Thanks,
Matthew Delves

Monday, October 1, 2007

iTunes and meta data

I started out hating iTunes from day one, but I feel that I’m stuck with it to get videos and podcast feeds updated on my iPod video.

I have recently been ripping some of my DVD collection to the machine to keep me entertained.
The application I’m using by default uses the disks name and track information as the default name for an mp4 file. This is obviously fairly useless to someone who pants to pick a clip based on the series I’m ripping and the episode.
Not a problem, I’m used to manually changing invidual items. I’m good at it.

The problem: On a 3meg mp3, the write operation is fairly quick. You blink and the whole file is re-written. Video on the other hand is a little bigger. Using iTunes, this means that I have to wait for the whole file to be re-written before starting to re-name the next file.
This takes forever.
I know with mp3’s the meta-data is at the beginning of a file and I just checked that an mp4 file also has the meta-data near the beginning.
If it had it near the end of the file, it could have at least just changed the end of the file instead of the whole lot :(. But that would mean that anything that wanted to read the meta-data would have to work out how to jump to the meta-data section (possibly taking longer to read)
I guess since reads would occur more than writes, the file structure is read optimised.

Bah.

-= Comments
1. Zooba | October 1st, 2007 at 11:34 am
As I understand, ID3 tags have fixed length fields, which means once the tag has been created the whole file doesn’t require rewriting to modify it.

Possibly an MP4 has a similar structure, in which case getting your ripping software to put a dummy tag in the video will mean you won’t have to rewrite the entire file to modify it later. Having said that, I’ve never played around with ripping videos, but it does work with MP3s.

Saturday, September 22, 2007

Just not thinking in portals

The last few days I’ve been looking into portals and portlets, specifically JSR168 compliant ones.
Reason: Our new intranet runs as a portal and they would like some additional developers working on it.

So I started looking around. The concept is really cool. You have a site the displays content: The portal. It provides things like authentication and page layout. You then have portlets that display information. They rely on the portal to provide a way to store state and session information, but they can do anything else you want with them. They don’t have to worry about how they are presented, just that they present some information.
In the world of cool ascii:
______________
|    PORTAL    |
|  ___    ___  |
| |   |  |   | |
| |___|  |___| |
|____\____/____|
      \  /
    PORTLETS
I had a look at a few of them (pluto, jetspeed, liferay, uPortal) and was disappointed from a development point of view. I have grown fond of the hot code replacement when developing j2ee application with tomcat. I would be able to debug and change logic. I could update jsps and have them recompile the next time I hit refresh in the browser. It is great. I wanted to do the same thing with portlets since it is really just an extension of servlets.

Pluto is the apache reference implementation of a portal server. It provides the basics to get a portlet running and visible on screen. Sounds like just what I am after. Unfortunately, to get portlets deployed to the portlet container, you have to provide pluto specific configuration information for pluto to detect your portlet. This is going to hinder development rather than assist.

Jetspeed was really easy to setup and get going. I had a play around with this one a little more because it was really easy to get into. Layouts where easy to play with, colours, portlets where all just simple to add to the page. From a site building tool perspective. It was great. I deployed the testsuite from the Pluto project to find out what it was like deploying additional portlets. Deploying was ok. But when I started testing these portlets, performance seemed to have taken a walk. My cpu usage would just skyrocket for a few seconds and then stop when the page returned. Whilst Jetspeed didn’t have to have any specific configuration information in the portlet to get it to load, the only way that a portlet does become registered is if you deploy to the portlet container. This means every time I want to make a change, I have to bundle my portlet and deploy. This would also hinder development rather than assist.

Liferay is very similar to Jetspeed and I feel sorry that I am discussing it after Jetspeed because I am just going to brush over it. I played with it for a while because it had the same usable simplicity that came with Jetspeed. The only difference I noted was that when I deployed the testsuite, it didn’t seem to suffer the same performance slowdown. Since I still have to deploy every time I make a change to my application, it’s not going to help development.

I couldn’t get uPortal to work out of the box, so there is not really much I can say. But it does raise an important point. If you have something that you want the world to use, it has to work out of the box. You have to be able to download, unzip and start. The hypersonic database is really cool for providing a light database that works just connecting to it.

So I was disappointed. I couldn’t believe that I had to jump through hoops to get an portlet to be recognised by the container. So I spent some time looking into how why they can’t determine the portlet information automatically. ServletContext has a getContext call which takes the context path, but it doesn’t seem like there is a way to find out all of the contexts deployed to the application.

So, there is my rant on Java portals and portlets. Most of the information I’ve been reading is from 2003-2006 which is kinda disappointing. Either I am looking in the wrong places or JSR168 portlets haven’t taken off. I am going to take a second look to see if I can find a way to list all of the contexts because when I first looked I thought I seen an old method that has been deprecated and just returns null, but now I can’t see it.

-= Comments
1. Xavier | September 30th, 2007 at 10:19 pm
oh god we used Oracle Portal with portlets to build My.Swinburne and there were so many headaches. Maybe that was the oracle bit and not the JSR bit. It was a while ago so I don’t have any useful criticism save to say I’m sufficiently burned that I’m staying well away from any job to do with portlets…

Sunday, September 16, 2007

Nothing but net

Mum asked me today if her phone added a timestamp to pictures she took.
I checked it out while she made a hot drink.
Found out how to do it and went to show her. As I was pushing the up key to get to the right menu, the phone slipped up my hands. I fumbled to grab it but just couldn’t get a good grip.
Then it landed in my hot chocolate.
I cursed. I took a moment to laugh at the situation then cursed again as I realised I should probably make an effort to get it out.
Covered it in tissues and rushed to pull it apart.

I let it sit in the tissues a while. I cleaned the dried hot chocolate off the phone and put it back together. The first time I turned it on, the camera didn’t work. I still had to put some screws in so I pulled it apart, cleaned it a little more, did the screws up and turned it on again. Camera works again.
There seems to be a little bit of a smear on the screen and it doesn’t seem like the speaker is as loud as it used to be, but it seems like everything will work.

Not the way I wanted to start the weekend :(

-= Comments
1. Matthew Delves | September 16th, 2007 at 4:10 pm
You are fighting a loosing battle my friend.

The phone won’t last too much longer no matter how much you try.

Thanks,
Matthew Delves

Wednesday, August 8, 2007

Welcome to the family

And the lastest to join the collection (the one on the right is the new one):

Another Dell, 17″ Dual Core 2ghz (64bit this time), 2gb ram, 512 mb video card, 80gb HDD, all the wireless options I could get and lots of light :D
The XPS feels really nice. There is just something different about the keys (althought it could just be the new feel).
I’ve tried Vista. I’ve customised it back to the win9x L&F but it just doesn’t feel right.
I always envisaged formatting it and putting linux on it, but it was worth a try.

Tuesday, July 31, 2007

Zombie processes and Forward momentum

I’ll get the easy one out of the way first: Zombie processes. This morning, it felt like someone flicked the switch because I feel like a zombie. 15th day programming without much of a weekend and I think it is starting to take its toll.
It does sort of lead onto the second thing though: Forward momentum.
A while ago, I started build one of my lego models:

And because that was rather relaxing, I built my spaceship:
So, from the looks of things, you would thing I was powering forward. My biggest drawback is that I still haven’t setup my server. It is sitting there, ready to go. Just got to get it up and running.
I was looking at writing a java port forwarding program just for the joy of writing something that requires a lot of thinking power. Given my current progress, I think I should just bite the bullet and use standard configuration items.

-= Comments
1. Xavier Shay | July 31st, 2007 at 2:06 pm
LOOKOUT YOU CAN’T PRINT ON VIDEO GAME CONTROLLERS

2. Jonathan | July 31st, 2007 at 9:31 pm
*

1. Xavier Shay | July 31st, 2007 at 2:06 pm

LOOKOUT YOU CANĂ¢'T PRINT ON VIDEO GAME CONTROLLERS

Ok, I laughed. God how I miss lego.

3. pimaster | July 31st, 2007 at 9:36 pm
Ah, so that is what I have been doing wrong.
oh, I forgot I clipped out the picture of the cups test page.

Wednesday, July 18, 2007

A physical weekend

So another weekend passes by. I didn’t do any coding this weekend as I was assisting my dad with installing some poles for a shade sale that we are putting up in the front lawn to give some protection to the cars.
It has been a while since I did some heavy lifting and manual labour, but it feels good. You can stand back and enjoy what you have built.

But there has been one thing bothering me this weekend. Friday afternoon, one of my colleagues put in an email a discussion of how we are currently tackling software problems.
In one short sentence, stated that MVC and OO design principals do not work together. I thought for a second: “I’m writing objects, I’m keeping logic separate. I am making them work together, what is she on about”. Moments later and a little more reading (and thinking back to Uni days): “MVC keeps business logic away from the business objects. OO is meant to have methods that modify the model close to the model. We are all taught that a Bird object should be able to fly (OO). You don’t pass a Bird thing to a Bird controller telling it to ‘make it fly’ (MVC)”.

Quite honestly, I’m a little lost. You can’t change your whole approach mid-project (especially when you are half way through and have 2 weeks to go), but what am I going to do after it?

Where do I begin?
It almost feels like everything I have learnt has just flushed out the ears…
Somewhere I am hearing “What works for one project may not work for the next” :D

-= Comments
1. Matthew Delves | June 18th, 2007 at 7:52 am
From my limited understanding of MVC, you would have a bird that knows how to fly, it is then the controller that tells the bird where to fly to.

Hope this helps.

2. Xavier Shay | June 18th, 2007 at 2:22 pm
Controllers are responsible for the “flow” of the application. In web based apps, 90% of controllers either just render something, or save a model then redirect based on the result (success/failure). Controllers are glue, and you want as little of it as possible.

(In the rails world, this concept is often referred to as skinny controller/fat model)

3. Xavier Shay | June 18th, 2007 at 2:24 pm
… and remember, you generally want one model per view/controller action, so if you need a composite form or something, look into the Presenter pattern.

4. Zooba | June 18th, 2007 at 7:25 pm
I agree with Matthew, that’s how I understand it as well. At least in OO terms.

If you apply MVC to a RDBMS your business logic is kept in the controller with the data/information kept in the entities/tables.

The issue here seems to be the divide between what is the controller’s responsibility and what is the object’s responsibility. IMHO, the entity should have entity logic while it is the controller that has business logic. To carry on with the previous example, a Bird knows how to fly, but the controller knows (and tells the Bird) when and where to fly.

5. Xavier Shay | June 19th, 2007 at 2:00 pm
No way … what is the point of having a Model layer if your model is just … data? A PurchaseOrder should encapsulate the “business logic ” of what happens when it gets paid for.

I don’t like the bird example … you don’t model a bird in software and it doesn’t map to real systems.