Posts for April, 2008

One more thing to love about .NET generics: events with custom event args

Lists are a killer app for generics in .NET 2.0 but one of my favourite uses that gets less attention is declaring event handlers without having to create a custom delegeate. Imagine a situation where you want to pass a piece of custom information to the event handler so it can decide whether to cancel […]
Published in .NET on Saturday, April 26th, 2008

Objects, event handlers and "this" in javascript

One recurring problem I’ve had when using a function from a custom javascript object as an event handler is that when the event handler is called the “this” property of the function no longer references the object it originally belonged to. To show you what I mean, take a look at this simple javascript object. […]
Published in Javascript on Saturday, April 26th, 2008

Importing contacts into gmail from Thunderbird and Yahoo mail

The first thing I wanted to try as part of my using gmail as my mail client experiment was importing all my contacts, half from Thunderbird and half from Yahoo mail. Gmail supports importing comma separated (CSV) lists and both Thunderbird and yahoo mail support exporting in that format so it’s pretty straight forward. I’ve […]
Published in Sysadmin on Friday, April 25th, 2008

First impressions of gmail – maybe the end of desktop mail for me

Today I found out that gmail supports checking and storing POP3 mail and it made me wonder if I even need a desktop email client any more. It has everything I use in Thunderbird (sorting, filtering, searching, address book) with the big advantage of being on the network and therefore accessible from any computer. So […]
Published in Web development on Thursday, April 24th, 2008

Filtering DataView by DateTime

Just a little code snippet to remind me how to do date comparisons in a DataView using DataView.RowFilter. It needs # characters around the date and you seem to need to generate the date string using InvariantCulture: DataTable table = GetList(); table.DefaultView.RowFilter = string.Format("date = #{0}#", DateTime.Today.ToString(CultureInfo.InvariantCulture)); this.GridView1.DataSource = table.DefaultView; this.GridView1.DataBind();
Published in .NET on Saturday, April 5th, 2008