Categories
article

Too much information!

So, I was looking for something to listen to whilst I decided what I was going to do today. Would I go and: hunt for a much needed filing cabinet, work a bit more on the tibco/rv project, try working some more on my pet internet project, or have another go at some Rails programming? Couldn’t decide.

So I hunted my music collection for inspiration.

Bizarrely, I chose Duran Duran‘s Wedding Album which I always kind-a linked even though I’m not a huge fan of Duran Duran or Weddings (apart from my own of, course).

I played it and I was immediately taken back to 1992/1993 when I drove around Tadley in a car not too dissimilar to this one.

Ford Sierra

It was sadly, not a Cosworth (like the one above) so was similar but not quite as good. Savour the scene. A 20 year old youth, with patchy stubble and DMs and driving around a nowhere-town in a 8 year old knackered family saloon playing Duran Duran. I probably thought I was cool. I was most definitely wrong.

There’s a few misty-eyed memories from that time, most of which I’m not going to share. But the thing I was doing at the time was working on a program called the “Fragment Data System” for a forensic research company. So I duly typed those words into the internet and discovered a link to something about it.

From the link I figured that it was from a table of contents from a book published in 2000 called “Forensic Interpretation of Glass Evidence”. One of the co-authors of which is an ex-colleague of mine (John Buckleton).

Forensic Interpretation of Glass 
Evidence

Now let’s get one thing straight, the Fragment Data System, was not a great product. It was probably the best I could have done in 1992/93 as an intern and it definitely worked. So, to have it mentioned in a book is kind-of surprising. But that’s not the most surprising thing. The most surprising thing is that I can find echoes of my 15 year old past on this damn internet. It probably has more things about me hidden in its dusty corners.

It gets you thinking. In 1992/93 the public internet was a new thing, it was starting to gain popular ground and dial-up was king. The youth of today have the internet available as soon as they want and it seems that disaffected youffs everywhere need to write about their deepest feelings on a myspace somewhere. Well fast forward 15 years and you’ll find most of your adult life documented in a publicly viewable place. Kind of scary. But not maybe for the reason you might think. If everything you do and everything you are is on the other end of a TCP/IP socket, and those boys are everywhere, you don’t need to remember anything. It’s all there. You just have to know how to find it.

This is great news! I just attach myself to a computer and I no longer need to know what I’m doing or who I am because the internet has all this information. A little like Memento but without the need for body defacement. Now if I could only remember what happened to my wife it would be really helpful …

Categories
tibcorv

Learning Ruby by Extension

So I’ve spent the past couple of months learning Ruby. My previous employers are python nuts. And I have to admit as languages go Python is pretty good. But then I heard about Rails and so I gave that a try.

Already a fan of MVC, Rails appealed to me for the same reasons it appeals to everyone else. It’s quick to develop! Still hunting for that killer Rails app I decided to take a look at what else Ruby could do and bought a copy of the pickaxe.

Now it just so happened that I learnt Python by writing a wrapper to the TibCo Rendezvous library. I learnt a lot about Python that way. Especially nasty, dirty stuff, like garbage collection, the GIL and other threading nasties. This is because the Rendezvous library does/requires a number of things internally:

  1. creates/destroys memory that could have been referenced by a Python object
  2. requires messages to be ‘pumped’ from its message queue and delivered possibly in the same or different threads
  3. requires a callback from the RendezVous library back into Python code

These things generate a few programming challenges and require you to understand some internals of the language before you can make much progress. So it was by some curious happen-chance that I ended up involved with the Ruby version of the project.

So now I get to do it all again, but in Ruby! I’m hoping to make a better job of it this time, and I’m also helped by having some of the hard work already done. I’ll be posting various bits and bobs about the progress of this project as time passes.

In the main though, learning Ruby by extension has been overall quite pleasant. I disliked Python’s extension mechanism because it’s a bit of a pain to use and in the end I used Boost::Python instead of using the C fn() calls. In contrast then the Ruby extension mechanism is as clean as it can be and once a few simple rules are observed things mostly just work how you’d expect.

Now then, every concept in computing these days seems to have a TLA to accompany it which is also its mission statement, e.g: REST, DRY, blah, blah. Well I’ve now got my own. Here’s mine: SANS., Simple And No Surprises.

That’s what I want, simple programs that work how you’d expect, SANS-crap.

Vive l’ordinateur!

Categories
c++

My C++ wants to kill your momma

… well actually it doesn’t. But it sounded good when I made it up. So recently I found myself needing to use a C++ partial function specialisation. No-one was as surpsied as me when this happened.

To say I was anti-templates would be too strong. I find the code they produce hard to follow, regardless of how elegant and efficient they really are. But then they do serve a really useful need. Obviously containers are an example of something where templates are indispensable. So you can’t just write them off.

But now that we have the standard library (and boost) do mere mortals really need to worry or bother about templates in the large? I think the answer to this is probably no.

But then again it depends on what you’re doing. And since I’ve started working on writing a wrapper around the TIBCo/RV library for Ruby I found myself writing a lot of C++ code that was very similar apart from the types involved. So then a little light bulb goes on in my head (40w supermarket own brand, cliche retardant) . Surely I can write a template to do this for me? This will mean that there’s only one code base for a bunch of similar behaviour and when I need to write that internationisation add-on (i18n) for my error messages I’ll only need to change one or two methods instead of a zillion.

Categories
.NET article patterns programming windows

MVP (a.k.a MVC) in VB.NET

Model-view-controller is an old, old, old but very good idea. It encourages the separation of model, presentation and control from each other. It’s used in so many places I can’t name them but frameworks like: Struts and Ruby-On-Rails actually enforce it.

For a long time it seems to me that Microsoft has lagged behind in allowing us to use this idea. Their once flagship product, Visual Basic 6, makes it almost impossible to write good MVC code. First of all, in VB6 there is no real inheritance which makes writing good models difficult. Secondly, if those models should contain any items that generate events then those items can not be defined in a class module and must be made public. Sure you can simulate and work-around these things by various means but in the end you will just be fighting the language. And that is never good.

So it’s good to see VB.NET, or .NET 2.0 to be precise, not only has excellent object support but a mechanism that can be used for MVC is actually built into the language.

Categories
article hardware

iriver clix

iriver clix 4gbSo I ripped 30% of my music as OGG-Vorbis a while ago. I don’t think that necessarily makes me a bad person.

So then you’re faced with the dilemma of how you listen to it. Yeah you want to support non-patented software but it’s really hard to find a player that is still for sale and can be easily purchased that also plays OGG.