A Playlist for 2008


A couple of days late but there were a few CDs in Santa’s sack so here’s my track list of highlights from 2008. Not all from 2008 but I bought them then, so hey.

Guns and Roses - Chinese Democracy
It has to be said that if even one track from the unicorn that was the new GnR album was any good, then Axl Rose was going to exceed expectations. Then lo and behold, two tracks turned out to be OK. Don’t think I’ll be holding my breath for the next album though.

Gutter Twins - Bete Noire
The Gutter Twins’ Saturnalia is probably my album of 2008 - a gleaming, polished piece of melancholia from the lead men of the Afghan Whigs and the Screaming Trees. The arrangements are simple yet heartfelt and their voices aged old from years of abuse. Bete Noire in this case showcases Mark Lanegan’s almost sub bass vocals brilliantly. The link above is to a live performance in Helsinki, but you can find the album track here if you prefer.

Alps - Hallucinations
It would be easy to pull a tracklist just from the output of Type Records 2008 releases but for me, this is the highlight, a seven minute aural spliff. Dry and desert-like, the rolling bass figure is a calm anchor for the shimmering sounds the trio put over the top.

Portishead - Machine Gun
We didn’t wait quite as long for the new Portishead album as we did for “Chinese Democracy”, but the Bristolians delivered a much bigger punch than did those from Los Angeles. Ten years later, Third is a different, angrier beast from Dummy or the eponymous album but the quality control is just as high. The highly sample drum machine and pure John Carpenter breakdown towards the end (80s synth soundtracks ahoy) are a joy.

Ihsahn - Threnody
The second solo album, AngL, from Emperor’s front man was a revelation. While The Awakening was an obvious attempt to move himself away from the black metal sounds of his former band, AngL saw him not afraid to tread wheresoever he broke a path, albeit not mix-and-matching styles within individual tracks as Opeth would. Threnody comes late in the album; a calmer moment amidst a tightly focused storm.

Joe Satriani - Andalusia
I am an unashamed Joe Satriani fan and will probably remain so for a good while to come. Unlike the previous album however, the “Professor Satchafunkilus” album that appeared last year hadn’t the immediate appeal and bright songs of Super Colossal in 2006. This one required more listening to get past the standard issue with his songs that intro, verse and solo often jarred rather than flowing into each other. The final track however doesn’t have that problem. A homage to Spain in his own inimitable style, it begins with flighty flamenco guitars laying down theme and variations until his electric enters with a longform solo and more variations on a par with classics such as ‘Echo’ and ‘Slow Down Blues’.

Vangelis \ Scott Bolton - Launch Approval
Besides Ridley Scott’s Final Cut of the film and various HD box sets to accompany it, the 25th anniversary also saw the release of a 3-disc issue of the Blade Runner soundtrack comprising the original 1994 release, a second disc of more inserts from the film and a final disc comprising original music composed by Vangelis and collaborators taking inspiration from the sounds in recognition of the anniversary. For me, Launch Approval recaptures the spirit of the film the best. You can hear the police cars flying through neon-drenched snow between pillars of flame.

Slipknot - Danger Keep Away
A revelation for me this one. While they had their moments, the first two Slipknot albums were in general a bit Meh! for me and so I ignored them for a few years. Then All Hope Is Gone came out last year and by chance I saw the previous album, ‘The Subliminal Verses’ in a bargain bin and bought it for a laugh. And then got blown away by it. In a reversal of happenstance, there was but one bad track here and 13 solid tunes with the nonet confident enough not to rage through every track. Danger Keep Away closes the album, a brooding warning to be heeded.

Kingdom of Sorrow - Hear This Prayer For Her
Side projects have a tendency to imitate marmite - you either love ’em or you hate ’em. The Kingdom of Sorrow album has been a long time in gestation and while Kirk Windstein (Crowbar, Down) and Jamey Jasta (Hatebreed) have obviously been busy, this debut album is a bit of a one track pony. Listen to it from track 1, Hear This Prayer For Her, and you’re drawn into a rhythm and groove for the rest of the album but join at any other point in time and the hook is lost. Hear The Prayer then - either five or fifty minutes long. Linked is the (better) five.

Joseph Arthur - Morning Cup
By far the best find on the KEXP Song of the Day podcast, Morning Cup is a gentle greeting for a fine, warm spring day. From Arthur’s Could We Survive EP, one of four he released in 2008, for this we can forgive the facial hair borrowed from Liam Gallagher.

Fatboy Slim - Wonderful Night
The man Norm doesn’t often put a foot wrong in the Big Beat department and this three minute wonder from his Greatest Hits album is just one of many I could have chosen. Right Here Right Now is probably the best single dance track in history, but Wonderful Night is pure joy.

Mark Ronson - God Put A Smile Upon Your Face
I’m a bit late to the Mark Ronson party - the smarmy grin on Buzzcocks spoiled him for me and Lily Allen collaborations didn’t help, but I’m happy to admit that cockney girl and one other track aside (Yes, please do “Stop”) it is genuinely good. And this big band cover of Coldplay’s only upbeat tune in three albums is a great way to start the morning.

Meshuggah - Combustion 
Meshuggah have been due a good album for a couple of years and ObZen delivered in spades for the Swedish math-metallers. Harsh angular riffs, uncomfortable time signatures and drill sharp vocals characterize the sound they have delivered over several albums - like Tool but with extra hatred.

Clint Mansell - Together We Will Live Forever
Whether you know it or not, soundtracks are a true treasure trove for great music and Clint Mansell has composed several blinders since Pop Will Eat Itself broke up. This is from The Fountain.

author: Dan Maharry | posted @ Monday, January 05, 2009 10:16 PM | Feedback (0)

What would you like to see in the next edition of Programming ASP.NET?


With the .NET 3.5 cycle out of the way and ASP.NET 4.0 on the horizon, it's time to try and figure out a way to incorporate the many new features and techniques that have emerged \ been released into the next editions of ASP.NET books.

So then, what would you put in 'Programming ASP.NET 4.0' and what would you NOT put in it? Books are supposed to be for the programming community so here's your chance to have your say.

Feel free to add comments here or in the thread I've started on Stack Overflow about the same topic.

author: Dan Maharry | posted @ Monday, December 01, 2008 4:05 PM | Feedback (0)

Gallio \ MbUnit v3.0.4 Released


Jeff Brown has announced the release of Gallio \ MbUnit v3.0.4.

Today we are releasing v3.0.4 of Gallio and MbUnit.  This release incorporates many new features as well improvements for robustness.

New asserts, assertion diffs, 0rdered tests, Rollback, Repeat, ThreadedRepeat, R# 4.1, VSTS, CSUnit, TeamCity, Gallio.Ambience, clickable report links (IE/Firefox integration), and more...

Try it out!  Please be aware that there are now separate x86 and x64 installers.

Download here: http://www.gallio.org/Downloads.aspx

Documentation here: http://www.gallio.org/Docs.aspx

[...]

The whole alpha / beta thing got too confusing in the end due to scope creep so I dropped it. In any case, this release is pretty much feature-complete.

The full announcement and complete rundown of the new features can be found here on Jeff's blog. Congrats to him, Vadim, Graham and the rest of the team.

author: Dan Maharry | posted @ Friday, October 17, 2008 1:44 AM | Feedback (0)

MbUnit.Framework v2 Docs October CTP


Well, it's been a while and as Jeff leads Gallio into the autumn sunshine, it's time to push out a little something for those still using MbUnit v2. You may recall, back in August last year, we launched docs.mbunit.com. Regrettably, it's been quite static since then but now the monster is complete there's some progress.

Here then is a first draft of complete documentation for all the assert classes, attributes, helper and exception classes in the MbUnit.Framework namespace only as found in MbUnit v2.4. Call it the October 2008 CTP if you will.

You can download it from here on HMobius until I find somewhere stable to put it. Feel free to let me know what you think of the style, what other MbUnit namespaces you'd like documented in full either here or via the MbUnit-User group.

author: Dan Maharry | posted @ Monday, October 13, 2008 10:54 PM | Feedback (1)

Expressing the Meme


Chris Hart has tagged me, so here are six random facts about me which are moderately interesting.

  1. I have, at various points, been referred to as 'Bamber', 'The Milky Bar Kid' and 'Beep', mostly in a friendly way. Sometimes not.
  2. The worst holiday I ever had was in Nice (sic). I intend one day to return and prove this was a fluke.
  3. I was, at one point, going to quit tech and become a session guitar player. It's still tempting
  4. For ten years, I helped out at the National Student Drama Festival. I still miss it.
  5. The first girl who ever kissed me was called Ruth. The first girl I wanted to kiss was called Angelique
  6. Of the schools and universities I attended, only one still exists as it was when I was there. And it ain't the university.

And, to perpetuate the meme, I tag Emma Jones, Emma Vieceli, Lou Barr, Ariana Osborne, Julia Gilbert and Vanessa Yaremchuk.

These are the rules. Should you break them, do it in an interesting fashion...

  1. Link to the person who tagged you.
  2. Post the rules on the blog.
  3. Write six random things about yourself.
  4. Tag six people at the end of your post.
  5. Let each person know they have been tagged. 
  6. Let the tagger know when your entry is up.

author: Dan Maharry | posted @ Saturday, September 06, 2008 7:22 PM | Feedback (1)

Programming ASP.NET 3.5 Is Slated For PDC


9780596529567_cat Well, it’s been a while coming but it looks like Programming ASP.NET 3.5 will finally hit the shelves in late October just in time for this year’s PDC. Hurrah! So, to take a leaf out of John Papa’s blog, it’s time to take a few seconds out and thank those who were involved in its creation.

First off, my co-authors Jesse Liberty and Dan Hurwitz for their support and words. And to Lou Franco and Mike Pope as well for their contributions to the book. They were both timely and well received by those of us all worded out.

Second, to the reviewing team for the necessary evil of reminding the authors that their words are not the be all and end all of the subject and should never treat them as such. Especially when trying to incorporate ever-changing technology into a set of static pages. So, to Don Kiely, Eugene Osovetsky, Frank Wang, Scott Isaacs, Christy Henriksson, Kyle Beyer, and Miles Whitener my humble thanks, even if some of your comments made me want to throw the laptop in the bin because I knew you were right and it would mean writing another five or ten pages to cover the point.  Lou Franco and Mike Pope also get a second vote of thanks here because they not only provided really solid comments, they also decided to back their own comments up with words.

Next, thanks to the folks at O'Reilly. Lou Barr initially mentioned me to John Osborn as a potential co-author, so I thank her for the mention and John for getting in touch and then letting me get on with it at a pace I could manage. Brian MacDonald, Audrey Doyle and Rachel Monaghan have also been great as technical, copy and production editors respectively. I hope I'll work with them again (preferable on something smaller).

And finally, thanks to Jane for putting up with about thirteen or so months of the book-writing process.

Programming ASP.NET 3.5 is already up for pre-order on Amazon UK and Amazon US. Why not buy a copy?

author: Dan Maharry | posted @ Monday, September 01, 2008 10:31 PM | Feedback (0)

Red Gate Reflector


Well, it looks like one of the best .NET utilities out there has changed hands. Lutz Roeder, the original creator and developer of Reflector has agreed with Red Gate software (they of SQL Compare and SQL Toolkit fame) to let them continue development of it from now one. An interview with both Lutz and James Shore of Red Gate outlining the deal and what Red Gate hopes to do with Reflector can be found here on simple talk.

Red gate are quite clear that they “will continue to offer the tool for free to the community.” but don’t categorically state that they may not offer a corporate, paid-for version later down the line. As long as there’s a free version I’m not too fussed. Reflector’s new home is http://reflector.red-gate.com/

Technorati Tags: ,

author: Dan Maharry | posted @ Thursday, August 21, 2008 9:20 AM | Feedback (1)

RadioButton Groups, Table Rows And NamingContainers


(In which AJAX-enhanced CheckBoxes become more useful than RadioButtons but inheritance saves the day, and a simple RadioButton-derived control establishes the purpose of a control's naming container)

The RadioButtonList. Very handy for inviting users to select just one item from a list although because of the screen real estate it takes up, used less and less in favour of the DropDownList. In plain HTML, the browser knows to enforce the unique selected value amongst a list of radio buttons because they all have the same value for their name attributes.

<input type="radio" name="RadioButtonList1" value="1" />
   <label for="RadioButtonList1_0">Orlando Gee</label><br />
<input type="radio" name="RadioButtonList1" value="2" />
   <label for="RadioButtonList1_1">Keith Harris</label><br />
<input type="radio" name="RadioButtonList1" value="3" />
   <label for="RadioButtonList1_2">Donna Carreras</label> 

And in ASP.NET, the RadioButtonList control lets you set the name attribute for each radio button in the list using the control's ID property. 

<asp:RadioButtonList ID="RadioButtonList1" runat="server" /> 

Alternately, you can group individual RadioButton controls together using their GroupName property.

<asp:RadioButton runat="server" ID="rbSelectUnique" GroupName="selectList" /> 

And the effect is still the same; each HTML radio button (with the same GroupName) has its name attribute set to the same value.

The Problem

The main problem with RadioButtons though is that by default you cannot span a group of them across table rows. Let's take an example, I have a sortable, pageable GridView of customers which I like, but I want to make sure the user can select only one of those customers as we go down the list. The obvious (in my mind anyway) solution is to add a template field to the GridView containing a RadioButton for each row and make the table generated by a GridView into a big radio button list by setting their GroupName attribute the same.

<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="customerid"
    DataSourceID="SqlDataSource1">
    <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:RadioButton runat="server" ID="rbSelectUnique" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="name" HeaderText="name" ReadOnly="True" SortExpression="name" />
        <asp:BoundField DataField="customerid" HeaderText="customerid" InsertVisible="False"
            ReadOnly="True" SortExpression="customerid" />
    </Columns>
</asp:GridView> 

Perfectly sensible except that because each RadioButton is dynamically added to a table row by the GridView, ASP.NET generates the name attribute of each radio button by appending the value you give it in GroupName to the internal name it generates for it when rendering the GridView. Hence we get this code for the <asp:GridView> above.

<table cellspacing="0" rules="all" border="1" id="GridView2" style="border-collapse:collapse;">
   <tr>
      <th scope="col">&nbsp;</th><th scope="col">name</th><th scope="col">customerid</th>
   </tr>
   <tr>
      <td>
         <input id="GridView2_ctl02_rbSelectUnique" type="radio" 
            name="GridView2$ctl02$rbSelectUnique" value="rbSelectUnique" />
      </td>
      <td>Orlando Gee</td><td>1</td>
   </tr>
   <tr>
      <td>
         <input id="GridView2_ctl03_rbSelectUnique" type="radio" 
            name="GridView2$ctl03$rbSelectUnique" value="rbSelectUnique" />
      </td><td>Keith Harris</td><td>2</td>
   </tr>
   <tr>
      <td>
         <input id="GridView2_ctl04_rbSelectUnique" type="radio" 
            name="GridView2$ctl04$rbSelectUnique" value="rbSelectUnique" />
      </td><td>Donna Carreras</td><td>3</td>
   </tr>
</table> 

As you can see, the radio button's name value takes the form GridView2$ctlXX$rbSelectUnique, where XX changes for each row and renders the list of the radio buttons useless. You can select them all at the same time if you wish. And it turns out that this issue is by design, according to the bug report on MS Connect.

Each row in a GridView is its own naming container so the controls' names don't collide. However, RadioButtons do not support spanning multiple naming containers and having their groupname attribute still work correctly. We will be looking at solving the RadioButton GroupName/multiple naming container issue in future versions of the product.

Or, in English, asp.net generates a unique NamingContainer for each cell in a table generated by a GridView and then uses that as a basis for all control IDs within the cell. It seems to be the only way to keep track of which events occurred where when the page posts back.  That was written in April 2005 and it hasn't been fixed in VS2008, so it's time to look at workarounds.

The Solution

If you're using AJAX already on the page, or are prepared to use it on the page, one way to get a radio button list of sorts into your GridView is to use checkboxes and a MutuallyExclusiveCheckBoxExtender in each TemplateField.

<ItemTemplate>
    <asp:CheckBox runat="server" ID="chkSelect" />
    <cc1:MutuallyExclusiveCheckBoxExtender ID="mecbe1" runat="server" 
        Key="chkSelectGroup" TargetControlID="chkSelect" />
</ItemTemplate> 

Now this works fine, but if you're trying to keep your pages lean, the additional script for each MECBE added to the page might not be so good. From a UI point of view, you might also object to having checkboxes work like radio buttons and so might your users.

Fortunately, a quick check in Visual Studio’s Object Browser reveals that the RadioButton derives from a CheckBox, so you can easily swap out one for the other. And behold your RadioButtonList is back, spanning table rows.

<ItemTemplate>
    <asp:RadioButton runat="server" ID="rbSelect" />
    <cc1:MutuallyExclusiveCheckBoxExtender ID="mecbe1" runat="server" 
        Key="rbSelectGroup" TargetControlID="rbSelect" />
</ItemTemplate> 

Not The Solution, But Good To Know

If you’re not willing to use AJAX, the issue is always with the naming container clashing with the radio button list’s name property. Perhaps an obvious solution is to use your own RadioButton Control which overrides the name attribute for the button when it is rendered. Something like this.

using System;
using System.ComponentModel;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TryOuts
{
    public class MyRadioButton : RadioButton
    {
        public string GroupName2
        {
            get  {
                String s = (String)ViewState["GroupName2"];
                return ((s == null) ? "" : s); }
            set { ViewState["GroupName2"] = value; }
        }

        public bool Checked
        {
            get { return base.Checked; }
            set { base.Checked = value; }
        }

        protected override void Render(HtmlTextWriter writer)
        {
            StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);
            HtmlTextWriter hw = new HtmlTextWriter(sw);

            base.Render(hw);

            if (String.IsNullOrEmpty(GroupName2))
            {
                writer.Write(sb.ToString());
            }
            else
            {
                string html = Regex.Replace(
                   sb.ToString(), @"name=""[\w\$]+""", 
                   String.Format("name=\"{0}\"", GroupName2));
                writer.Write(html);
            }
        }
    }
}

Now this approach works to a degree. Replacing a standard RadioButton with this control does indeed override the control’s Name property and the RadioButtons all work within the table as required.

<cc2:MyRadioButton runat="server" ID="mrbTest" GroupName2="test" />

However, do anything simple such as select a row and post back the page (by clicking a button) and you’ll see that you can’t determine which radio button has been clicked.

foreach (GridViewRow row in GridView.Rows)
{
   RadioButton rb = (RadioButton)row.FindControl("mrbTest");
   if (rb.Checked)
   {
      lblSelected.Text = row.Cells[1].Text;
   }
}

And that’s because the NamingContainers for the cells containing the RadioButtons in the table generated in the GridView can no longer identify the RadioButtons in the cells in the table. Because our custom control has overridden the name attribute for each RadioButton to “test”, ASP.NET can’t find any controls called GridView2$ctlXX$mrbTest which is what it expects them to be called and why the naming container exists in the first place. Without the naming container producing these unique names in the way it does, we can’t do useful things like iterate over the rows in a GridView and why AJAX is the way forward when it comes to this particular problem.

Now strictly speaking, it should be possible to write a HttpModule that rewrites a RadioButton’s name attribute as it is sent to the browser so it works as part of a RadioButtonList and then rewrites the name attribute back as the page is posted back so the naming container appears to still be intact. But think about it, that’s a lot of effort for a small thing. Is the AJAX-free convenience worth the hassle?

author: Dan Maharry | posted @ Thursday, August 14, 2008 5:42 PM | Feedback (4)

Three Different Ways To Find The Currently Edited Row In A GridView


The GridView, and indeed all the other templated data bound controls, are lifeblood to an ASP.NET developer when it comes to creating websites. A little DataSource control here, a GridView there and even if it isn't exactly what you want, you've got a prototype page up and running in no time to start the real development with. Today's chores involved tweaking the contents of a GridView's EditItemTemplate so that the contents of one DropDownList (Clients) would change based on the contents of another (Roles) and should the Update button be clicked the values of both DropDownLists saved out to the database.

EditItemTemplate

The roles DropDownList always contained the same items, so it was bound to a DataSource control separate to the GridView itself and then its selected value bound to the current value for the row in the GridView. The RoleId is two-way bound to the SelectedValue of the DropDownList so clicking Update works correctly.

<EditItemTemplate>
   <asp:DropDownList runat="server" ID="ddlRolesForEditUserDialog" AutoPostBack="true"
      DataTextField="Name" DataValueField="RoleId" 
      DataSourceID="RolesDataSource" SelectedValue='<%# Bind("RoleId") %>'
      OnSelectedIndexChanged="ddlRolesForEditUserDialog_SelectedIndexChanged" />
</EditItemTemplate>

The clients DropDownList on the other hand, needed

  1. to be populated dynamically when the the GridView's row was switched to Edit mode
  2. to be populated dynamically when the choice in the roles List changed. 
  3. to be accessed when Update is clicked and the DataSource is making changes to the database.

As it turns out, each occasion used a slightly different way to find the row being edited and through that, using FindControl to access the ClientList.

In case 1, by the time a GridView's OnRowEditing event (raised when 'Edit' is clicked on the GridView) is handled, the EditItemTemplate for the row hasn't become accessible yet, so the client list can't be found. The option instead then is to handle the GridView's OnRowDataBound event at which point the EditItemTemplate has been created and the client list is accessible. The trick is to identify the row being edited is to use its RowState property. Every row on a GridView is rebound when Edit is clicked, so we can use the following.

protected void grdUsers_RowDataBound(object sender, GridViewRowEventArgs e)
{
   if ((e.Row.RowState == DataControlRowState.Edit) || 
       (e.Row.RowState == (DataControlRowState.Edit|DataControlRowState.Alternate)))
   {
      //Get the client dropdownlist
      DropDownList clientList = (DropDownList)e.Row.FindControl("ddlClients");

      //more stuff here
   }
}

In case 2, the EditItemTemplate already exists. Indeed, we're capturing an event on the roles List within a cell in the EditItemTemplate. One option to then find the client List in the cell next to it is to start with the object that raised the event, find the control that contains both it and the client List and then call FindControl.

protected void RulesList_SelectedIndexChanged(object sender, EventArgs e)
{
   //Get the roles dropdownlist
   DropDownList ddlRoles = (DropDownList)sender;

   //Get the client dropdownlist
   DropDownList clientList = 
      (DropDownList)ddlRoles.Parent.Parent.FindControl("ddlClients");

   // more stuff here
}

Or, as in Case 3, because we know the EditItemTemplate is visible, we can locate the row being edited through the GridView's EditIndex template. This returns -1 if no row is being edited or the index of a row in the GridView.

protected void usersDataSource_Updating(object sender, EventArgs e)
{
   GridViewRow row = grdUsers.Rows[grdUsers.EditIndex];
   DropDownList clientList = (DropDownList)row.FindControl("ddlClients");

   // more stuff here

}

Case 3 is the easiest way to find the currently edited row, though the other two are no less valid.

author: Dan Maharry | posted @ Tuesday, August 05, 2008 5:06 PM | Feedback (2)

Is this the truth of it?


Achieving perpetual mass for any community only takes place if the underlying purpose of the community is appealing to enough users that they decide to contribute some of their cognitive surplus to its furtherance.

More of that discussion here. Discuss

author: Dan Maharry | posted @ Monday, August 04, 2008 9:49 PM | Feedback (0)