Category Archives: c#

Moving to Ubuntu (….kind of)

I’ve signed up for a masters in UCD (Advanced Software Engineering in University College Dublin) starting in December. I’m really looking forward to it and as a treat I bought a new (used) laptop that’ll be just for Uni work. It’s an IBM Thinkpad T43 (Centrino 1.7Ghz and 1GB ram with 40GB HD, Wifi, Bluetooth, PCMCIA, Expresscard and all the other usuals) I bought it on ebay (where else?) for £240 delivered. The build quality is excellent and I’m very happy with it. I’ve got Ubuntu 8.04 running on it and it’s going quite well. I’ve encountered the following problems:

  • I get an “not enough memory” error when I try and hibernate
  • Wireless seems kind of flaky especially with the upgraded NetworkManager, I can’t connect to my Dad’s network and keep getting a 169 IP address but this happens on my Vaio too so I suspect it is the Intel Wireless hardware and my Dad’s DHCP server not playing nice together.
  • I can’t get mobile broadband working (either using the new NetworkManager or UMTSMON)
  • Audio when playing video took a while to get working and had to change from Pulse to the ALSA sound architecture.

Lest not forget that there are millions of positives with Ubuntu, especially the Synaptic package manager and power management.

I’m loving Gnome and I’m trying to find a few cycles to play with MonoDevelop properly. I’ve been trying to get the localising feature in MonoDevelop working with an ASP.NET web application but no joy yet. I can get it working on a command line app though :).

.Net Development – XslCompiledTransform with XMLWriter ignores output method

As XslTransform is now obsolete, I now use XslCompiledTransform to transform my XML and XSLT documents. When transforming I want an XmlDocument returned so that I can further manipulate the output, to achieve this I use XMLWriter but for some unknown and baffling reason XMLWriter does not respect the ouput method of the XSL document and will ALWAYS give you XML and by XML I mean closing self closing tags etc. which is no good when you’re outputting HTML with textarea, link and script elements. I hate to do it but the only way to be confident of correct output was to parse the output string and replace these elements using a beefy regular expression. Does anyone else know how to force XHTML or even HTML output when using XMLWriter and XslCompiledTransform. I’ve given up looking.

IE – why oh why do you taunt me so??

I’ve been working on a couple of plugins for the YUI editor to allow insertion of Flash Movies (YouTube and Google Video). It’s all working swimmingly well in Firefox and Safari but in IE – it just would not work. Why? because of IE’s JS engine bastarding implementation of innerHTML and pasteHTML. I know that innerHTML is not part of the ECMA spec but it is well supported across browsers and is alot quicker than document.createElement. The YUI editor uses it extensively too. I’ve also never encountered problems with it before.

My JS plugin for the editor takes and parses a Google Video URL and inserts it into the editor content area using the appropriate YUI editor action “inserthtml”. In Firefox – I get the alternate image as it doesn’t render the markup in the editor’s iframe properly and as such does not know to load the Flash plugin (this is fine and I have no problems with it). Internet Explorer inserts the HTML and then displays a broken flashmovie icon (white with red x in top left indicating it can’t find the movie specified), which is not fine. This is the markup I insert.

Correct markup

IE (6 and 7), in all it’s wisdom decides that that is not what I really want to insert -in fact what I really want is –

Incorrect markup

Hmmmmm….. No that’s not what I fucking well want – you piece of shit(or so I was shouting late last night). This is due to the JS engine’s HTML normalization – excuse me what?????. Very annoying. To get the editor to display the movie I had to (“shock horror”) add the deprecated embed element.

Another problem was that when submitted server side – we use a HTML parser and IE’s version of the markup would not parse correctly as the attribute values were not quoted. So I have one momma of a regex to fix the object element.It all works now and works well but it’s so disappointing that it happens like this.

In summary – firstly: beware of innerHTML especially when inserting an object element and finally: I hate internet explorer more than I ever did.

Where’s clown number three

What in the name of all things XML have I been up to. Well as y’all have probably gathered, I’ve been relatively offline, what with my new job. Trying to get settled in Ireland, trying to sell my house in Wales and generally trying to get my shit together.

I’ve been going to the gym alot and playing football twice a week (when we get the players) resulting in a loss of just short of a stone. I’ve had a super quick trip back to Wales (booked at 12 o’clock while still in bed – waiting at gate at 2 o’clock) and back at 8 o’clock the next evening. I’ve started the process of importing my car. I went to the Oxegen music festival which was awesome and muddy and awesomely muddy. I’ve also booked my holidays, I’ll be spening 10 days at the family’s summer house on an island in the Helgeland area of middle/north Norway.

I checked the other day and was shocked to see that I have been in Ireland (with all my posessions) for three months and three days. My house has been up for sale for nearly four months and I’ve been in my new job for nearly two months. Time seemed to drag during that time but looking back – it’s just flown.
Onwards and upwards folks – onwards and upwards.

Congrats to my brother who passed (with merits) his Carpentry exams and only has a year left and he’ll be earning more than me.

The clown reference in the title is from the fact that our house is now referred to the “Clown College” where myself Ronan and Colm live.

Geek resolutions

As it’s new year and my motivation is at an all time low, I think a list of TODOs (or new years resultions) is needed. Some of those listed are techy and some are not but all of them are aimed at improving my life.

I will

  • Finish the new design of this site – as you can see, it’s still a work in progress
  • Comment my code
  • Finish projects I have started
  • Document my code properly
  • Use UML – even if it’s just in my head
  • Move to Ubuntu on my home machine
  • Caption all my photos – all 8500 of them
  • Read all the books I bought
  • Read non-techy books too
  • Cook more
  • Eat less
  • Eat healthier
  • Find some way of feeling healthier that I can actually stick to (Gym is a bit too much commitment)
  • Start to budget my outgoings properly
  • Stop calling my dog “the rodent”
  • Learn that Friday does not have to equal “getpissedday”
  • Stop watching soap operas – comedy series like King of Queens and Scrubs will remain on my Sky+ planner though
  • Contribute to an open source project
  • Help fellow developers more
  • Always keep in mind that I know only a fraction of what I think I know
  • Be in a good mood
  • Write another useful Firefox extension that uses a custom XPCOM component
  • Use Patterns in code more
  • Stop driving like an idiot just so I can get home quicker
  • Go to Ireland to see my friends and family more
  • Go to the summer house in Norway
  • Save money
  • And finally – keep this blog up to date

There’s quite a few there so I think it’s more of a two year plan. I have been working on an eight year plan with Gill too, but it’s still a bit up in the air but very exciting – as along as all goes well –

I will also (I thought of some more)

  • Move to IMAP instead of POP email
  • Backup more
  • Learn how to use SVN properly
  • Go to LinuxWorld in London (as long as it’s not on Gill’s birthday like last year)
  • Get a whiteboard at home
  • ……..I’ll add some more as I think of them

Krugle Firefox search plugin

I was cursing krugle.com and it’s bastard (yet brilliant) ajax as I could’t write a Firefox search plugin. Then today I saw on their blog that they have the “Krugle Search Environment” which allows you to bookmark searches and thus create a firefox search plugin.

In the archive which you need to save to “C:\Program Files\Mozilla Firefox\searchplugins”. I have included a Firefox 1.5 version krugle.src and krugle.png for a C# search and also a Firefox 2.0 Opensearch krugle.xml which also searches C#. The language is quite easy to change or remove if you open the src or xml files.

Graduate c# devleopers x2 wanted

As part of Karova‘s expansion, we are looking at taking on 2 more graduate developers. If you want to apply, you’ll need at least a 2:1 in a technical degree, knowledge of object oriented programming techniques, XML and XSLT, web standards and CSS. C# would be benifical, as would a good grasp of IIS. If you want good pay and a chance to be part of a growing and exciting company – please see http://www.karova.com/jobs for more detail. We are after a sales manager too for you sales guys.