Thursday 12 February 2009

my god I am really a geek

I never thought I was a trekie, I hate Voyager and the Bill Shatner originals, I have never watched Enterprise and yet today I had a room of IT people calling me a trek nerd!! It all started when discussing a personal HUD as a pair of glassed that made you look like data, I corrected this statement by saying Jordy was the one with the glasses, it was played by Levar Burton. Strike 1, knowing the difference between data and jordy I then went on to say yes data was the android played by Brent Spiner Strike 2, knowing what Data was and who played him I followed this up with, you know the doctor from Independance day Strike 3, the nail in the coffin, knowing another sci-fi film that a guy from Star Trek was in. D'oh! Note to self: must remember when to stop talking :)

Friday 6 February 2009

The typical UK drivers guide to driving in the snow

1. when driving in heavy snow make sure you leave no more than 2 inches between you and the car in front, because remember it'll only get you there quicker. 2. When moving away from stationary always rev the crap out of your engine before popping the clutch up, if you don't get grip straight away simply rev more the wheel is spinning so at some point you should start moving. 3. When turning corners ALWAYS whack the steering wheel to hard lock as fast as you possibly can, if you notice the car isn't turning in the desired direction be sure to once again rev the fuck out of the engine. 4. When you need to stop make sure you slam on those breaks as hard as possible, after all whats the point in having abs then not using it! 5. Before setting off remember that it doesn't matter that the MET office has said don't travel unless its a necessity you want to drive and your damned if your gonna let 'The Man' tell YOU what to do. You must have a f**king big exhause a f**king loud stereo and virtually black tinted windows. 6. To defrost the car its simpl, boil the kettle and pour all over the windscreen, ignore that creaking cracking sound it just means the snow is being scared away! 7. Never drive slowly in the snow it'll only make your tires cool down and they may become frozen to the floor. If some other guy is driving slowly, especially if they are doing 28mph in a 30mph zone, overtake them as no one tells YOU how fast to drive. 8. When its snowing always chose the most out of the way routes with plenty of hills. 9. If you are fortunate enough to enter a spin the only way to stop is to turn out of the skid, if it doesn't work first of all turn faster and harder its the only way. 10. The most important thing is, if you see anyone in trouble, especially if its a woman with small children in a ditch, wind down the window laugh, shout, turn the radio up and maybe even flip them off for being lame and not having a car with twice the amount of bhp as your IQ points!

Thursday 5 February 2009

half arsed and happy

I have recently decided to have a crack at making some sort of editor, there are several formats of documents that I would like represented in a specific way and have been as yet unable to find any editors that meet my needs. Plus it would be a great opportunity to learn some of the finer points of Swing or whatever I eventually decide to use. As a side note: it may suit my purposes to make the editor using GTK since it is looking more and more like this is the best solution to the interface for my media centre. For the Swing MVC ( well in the style of mvc but more like message-delegate, I think ) you get a series of interfaces I'll add to this blog as time goes on but for now it looks like this A JEditorPane is an uneditable representation of some styled document, it editable subclass is the JTextPane - to be honest I would have named these the other way round to avoid confusion but thats me. a JEditorPane displays a StyledDocument, this is an extended version of the Document class which consists of lots of Elements that are held in a tree like structure, all of which makes sense. Each Element can have Attributes ( for example bold, italic, size... ), these attributes are what are translated to the visible difference in text and other objects. The Document itself does not carry state, so we don't know where any caret may be or anything that is selected, it is just the data that forms the Document. In order to have state and hence to be able to 'View' the data the Document is added to the JEditorPane inside an EditorKit, this kit is then responsible for displaying the styling defined in the Document as represented by the Style interface. After looking at all this it does kinda make your head ache but it does make sense after a while...as you may have noticed I haven't looked into the Styleing of the Document much yet I have only got as far as the Pane and Document stuff. Therefore I shall add to this blog as the murky waters begin to clear

Monday 2 February 2009

Wiki - what a great tool

I have been on projects that have used a wiki and even more that have not. The difference tends to be that projects that have taken to using a wiki for the most part have far more valuable documentation. It won't be the best presented documentation but it will exist, and it will convey exactly what the author wanted it to. By using a wiki it makes creating and maintaining system documentation so simple and easy that it no longer becomes a chore, in fact by using a wiki developers keen to get one over their colleagues tend to try and make their pages look better than the next guys thus improving the documentation effort. The alternative is to have lots of versioned documents that have standard styling and corrected SPG (spelling, punctuation and grammar) and this makes the task long, tedious and sometimes daunting which normally means its the task that gets put off till the last minute, and as every developer knows the last minute tends to be where frantic dev work goes on to squeeze that extra feature in. So heres to the wiki, I salute you :)

Code Practice

Are public variables bad? Simple answer YES, of course their bad! How on Earth can a class maintain control of its inner working if there are parts that can be set without it knowing, this is like puling the carpet out from under an object. In java there is a very simple specification for how simple data should be accessed within a class, the bean specification says provide a series of getters for items that are externally readable, a series of setters for items that are writable. The simple caveat to this is that items of type boolean have an 'is' method instead of get.
 
Stack Overflow profile for Richard Johnson at Stack Overflow, Q&A for professional and enthusiast programmers