First impressions of Linq Expression<>

While at work yesterday, I saw a whole bunch of code like

if (memberid > 0) parameters.Add(new SqlParameter(”@memberid”, memberid)); if (groupid > 0) parameters.Add(new SqlParameter(”@groupid”, groupid)); if (industryid > 0) parameters.Add(new SqlParameter(”@industryid”, industryid)); …

and so on.

It would be easy enough to squeeze it down to something like

InsertIfGz(”@memberid”, memberid); InsertIfGz(”@groupid”, groupid);

but it seemed a shame to have to [...]

Continue Reading...

No Comments

DefaultButtons for Asp:Login and Asp:CreateUserWizard

Today, I was tasked with making some Asp:Login and Asp:CreateUserWizard controls work. Specifically, the enter button was acting with an effluence inherent only to Asp.net[1]: it was submitting the search button.

After playing with various schemes, I settled upon the following for the Login control:

<asp:Panel ID=”pnlLogin” runat=”server” DefaultButton=”lgMain$LoginButton”> <asp:Login runat=”server” ID=”lgMain” /> </asp:Panel>

I originally [...]

Continue Reading...

No Comments

Notes on compiling LinuxSampler

I just installed Ubuntu 9.04 (64-bit) on a new machine and am currently in the middle of compiling LinuxSampler, and for some reason had to make source changes to the latest stable to get it to compile.

For starters, I had to run configure with –prefix=/usr. Don’t know whether that’s a 64-bit thing, a me-being-noob thing, [...]

Continue Reading...

No Comments

Regex Fu: Not Followed By

Everyone has their own regular expression implementation; especially text editors. One is good, while the rest range from absurd to almost usable.

Sometimes, despite your best efforts, you’ll find yourself in a strange environment needing to do some funky regex fu.

So for the sake of argument, let’s imagine we have a standard no-frills regex engine:

( ) [...]

Continue Reading...

2 Comments

Valid and Accessible Collapsible Panels with Mootools

The other day my friend Matt Stow mentioned Mootools as a lightweight alternative to prototype and scriptaculous, so I decided to check it out.

Yet another collapsible panel!

On the whole, I think I’m impressed with Mootools/Moofx. Firstly, check out the download page. It lets you choose and pick exactly what components you want, it will find [...]

Continue Reading...

2 Comments

Valid and Accessible Collapsible Panels with Scriptaculous

Believe it or not, creating collapsible panels — and “rich web elements” in general — requires some careful thought and planning. Some things need to be taken into account, such as:

Not all users have mice - some only have keyboards (or equivalent) Some people don’t have JavaScript - whether by choice or necessity Some people don’t have [...]

Continue Reading...

4 Comments

Dynamic Robots.txt with ASP.NET 2.0

I needed to do this recently and I couldn’t find any instructions on the web. There were bits and pieces here and there, but nothing all in one place - and you need to know what you are looking for.

So here it is - step by step explanation on how to create a dynamic robots.txt file (or any text file for that matter) with IIS 6.0 and ASP.NET 2.0

Continue Reading...

5 Comments

OpenSocial - Google’s Social Networking Platform

Google has recently stepped right into the social networking realm, releasing an open API for social networking called OpenSocial. So what is it? Is anyone using it yet?

I had a bit of a peek - it looks sorta interesting.

Continue Reading...

No Comments