Welcome

This is the generic homepage (aka Aggregate Blog) for a Subtext community website. It aggregates posts from every blog installed in this server. To modify this page, look for the Aggregate skin folder in the Skins directory.

To learn more about the application, check out the Subtext Project Website.

Powered By:
Powered by Subtext

Blog Stats

  • Blogs - 7
  • Posts - 716
  • Articles - 40
  • Comments - 194
  • Trackbacks - 741

Bloggers (posts, last update)

Latest Posts

GiveCamp UK 2011

This weekend was GiveCamp, a global weekend of charitable software development, organised in the UK by Rachel Hawley and Paul Stack. No one really knew what to expect, least of all Rachel and Paul, who’ve put in a monumental amount of effort of the last few weeks to pull this event off. It’s a simple concept; talk to some charities to find out what software they need, get a bunch of geeks together and code for 48 hours solid to produce that software. Easy in concept, right?

It all started rather chaotically; Andy & I turned up early at UCL to help Paul, but he was caught up in traffic after having to go collect the T-shirts after a delivery screw up. We managed to get a name for our local contact at UCL, who knew as much as us – almost nothing; she knew where we’d be and what time we were allowed into set rooms, but beyond that most of the information was stuck in Paul’s head. But things did start happening over the afternoon; people drifted in, the tea arrived and a fridge for the drinks. Then Paul arrived with a car full of soft drinks, and disappeared again for another cash and carry run and we had enough drinks for most of UCL. In the end we had stacks left over, much of which went to a local homeless shelter; yet more giving.

The room gradually began to fill, and then everyone decamped to the lecture theatre for the opening, then came back and coalesced into working groups for the projects. It was interesting to see how well this worked – order from chaos – with people spreading fairly evenly between the projects; 115 people, 9 projects. Herding cats has always been a phrase associated with getting developers organised, but this self-assembling worked and within an hour the project teams were formed; the team leads had been set before hand and knew a bit about their projects, but it was only during Friday night that everyone really found out the requirements. And this is the hardest thing, working with the charity representatives and setting only those requirements that could be achieved in 48 hours.

I was originally a roving agent, free to help out on anything, but was royally stitched up by Phil who introduced me the Latin American Women’s Aid team, whose project was going to be Microsoft Access based, trying to replicate their entirely manual process of filling in complex paper forms. And not only was it Access based, but the backend database was going to be MySQL, to ensure the data was safe in their one Linux server. My history of Access development had re-surfaced, like an ex-lover who you look on fondly, but then realise why you left them. Still, good cause so dig in I did. The technology choices proved to be a major hurdle in a project like this; Access is good at many things, but multi-user development isn’t one of them. To solved this, PDD was used – Plate Based Development – (s)he who holds the plate has control of the master database. It was particularly difficult going back to a product I hadn’t used in 10 years. It was frustrating trying to bend Access to do things it just isn’t really designed for. At 12am I gave in and headed back to the hotel - I’m too old to be kipping on floors – but despite the tiredness I couldn’t sleep, so got the laptop out and carried on, then realised how much I’d forgotten.

Back at the venue at 8am a few hardy soles were still coding, but sausage and bacon butties along with tea and coffee fuelled an influx of devs back to work and coding continued. We continued to fight Access and MySQL; we laughed, banged our heads in frustration and carried on. I even ended up remoting into my home server and downloading the original chapters from my old Access book so I could read up on how to do things, that’s how desperate it got. I made it until 1am.

Sunday started much as Saturday had; tiredness and an overwhelming feeling of despair that we wouldn’t get our project finished. The challenges were just too much, but we carried on so that at least we’d have a start of something and LAWA would have a way forward. We didn’t finish and didn’t deliver; the only team to do so; it hurt. Code freeze was at mid-day and we were nowhere near.

After a great hog roast in the sunlit quad, we had the wrap-up presentations where the teams showed their projects; some had yet to show what they’d done to their charity representatives, so it was nervous time for both sides. I sat and watched these with awe – really, it was awesome – seeing how much had been achieved within so little time. One charity representative started crying; they have three people and the web application they were presented with will save them a day per week of time. A day per week. Think about how much time that is and how important it is for a small charity. All the other projects were equally impressive – one was even already live – and one is a starting point for an open source CRM designed for charities; they delivered the first part and there’s a plan for future features. Go contribute.

So what have we learned over this weekend, the first GiveCamp in the UK.

  • There are a large number of people willing to give their time and effort into helping others.
  • It’s amazing what can be achieved in a short amount of time. None of these projects had much planning, features were defined quickly and coding started. No fuss, no arguments – well, none that really mattered – we just got on with it.
  • Charities have little in the way of resources; money, hardware, skills. Every little bit we do can have a big impact.

Would I do it again? Hell, yes. It was tiring, hugely frustrating, but exhilarating and fun. And it’s going to change lives. I think Paul and Rachel deserve a huge amount of thanks (Rachel will probably settle for Haribo) for pulling this off; no one knew how it was going to work, or indeed, if it would work at all, but work it did and very successfully so. Well done all.

My photos for the day are on Flickr.

posted @ 10/24/2011 1:01 PM by Dave Sussman

Xunit and Moles

This is more a reminder to myself, but I hope it’s useful to others. If you’re using xunit for unit testing and Moles for isolation/mocking then you may run into a problem using the moles test runner, whereby you receive an error stating “error: missing filename”.

For example, consider the following in the build file:

moles.runner /x86
  /runner:"d:\tools\xunit\xunit.console.clr4.x86.exe"
  "d:\project\foo.dll"
  /args:"xml d:\project\foo.xml"

While a similar command works at the command line, in the runner it fails. The answer, as supplied by Heather, is to supply the arguments separately:

moles.runner /x86
/runner:"d:\tools\xunit\xunit.console.clr4.x86.exe"
"d:\project\foo.dll"
/args:"xml" /args:"d:\project\foo.xml"

posted @ 10/21/2011 7:56 AM by Dave Sussman

Simple.Data is Simple; type conversion isn’t

I’ve recently started using Mark Rendle’s rather lovely data framework Simple.Data. There’s a really big clue in the name; it’s very simple to use. Eg:

var db = Database.OpenConnection(ConnectionString);
db.Zones.FindByZoneID(ZoneID);

 

That’s it; everything is dynamic and database columns are mapped to properties automatically. Searching by columns is easy as FindBy can be followed by any column (or multiple columns, just put And between them) or using lambdas. Dead easy.

The one downside Simple.Data has is a lack of a way to define how the types are mapped; there is plenty of built-in intelligence, but what, for example, if you need a char column mapped to a byte array? As yet, Simple.Data doesn’t have a way of doing this (char columns are mapped to strings), although there’s an issue raised suggesting a way it could be done. For the moment though it can’t be done within Simple.Data.

If you’re in this situation with POCOs that have types different from the underlying data store (or more accurately, different from the standard type conversion), then you could pick the solution I’ve chosen to get me over this, which is to create two POCOs: one with the Simple.Data types and one with the custom types. I then use AutoMapper to map from one type to another, using a custom type converter to convert the appropriate columns. It’s a bit more work, but is fairly simple to achieve; first set up the mappings:

Mapper.CreateMap<string, byte[]>().ConvertUsing<StringToByteArrayTypeConverter>();
Mapper.CreateMap<byte[], string>().ConvertUsing<ByteArrayToStringTypeConverter>();
Mapper.CreateMap<PanelSD, Panel>();
Mapper.CreateMap<Panel, PanelSD>();

 

The type converters are simple, as AutoMapper provides an interface to implement:

public class StringToByteArrayTypeConverter : ITypeConverter<string, byte[]>
{
     public byte[] Convert(ResolutionContext context)
     {
         return Encoding.ASCII.GetBytes((string)context.SourceValue);
     }
}
public class ByteArrayToStringTypeConverter : ITypeConverter<byte[], string>
{
     public string Convert(ResolutionContext context)
     {
         return Encoding.ASCII.GetString((byte[])context.SourceValue);
     }
}

 

And yes, I’m aware I’m using ASCII encoding here; in my case I know my data is ASCII; your mileage may vary.

Then fetch the data and map it:

List<PanelSD> panelssd = Database.Default.Panels.All().ToList<PanelSD>();
<Panel> panels = Mapper.Map<List<PanelSD>, List<Panel>>(panelssd);

 

I’ll obviously map the other way around when writing to the database. In my case both the read write can easily be abstracted and there’s actually only one object where I need the mapping, so it’s of minimal impact.

posted @ 9/29/2011 3:43 PM by Dave Sussman

I applaud the IE team

Yes, you read that right.

The IE team have been doing good work over the last couple of years, bringing IE into the standards world, but I never thought I’d hear myself saying I applaud them. I always had this niggling feeling that something would get in the way; I’m a FireFox user, but that’s mainly because of Firebug, which I prefer to the IE Developer Tools; there’s not much in it, but it’s enough. The browser itself, well, I’m not that bothered which browser I use to be honest; sure there are small differences, but in most day-to-day browsing it makes no difference. Development is another matter, where all of the browsers are required, and IE still causes issues here; only minor ones for IE9, but more so for older versions, and that’s the big issue we have when creating sites – cross-browser and backward compatibility.

With the previews of Windows 8 though, we have another issue – the Metro Browser, which as has been discussed on the Building Windows 8 blog, doesn’t support plugins. The Desktop Mode, which is also IE10, does support plugins, but not when used in Metro-Mode. It’s a brave move and one that I applaud. Too long have the IE team been the whipping boy of browsers, a situation they created themselves and one they’ve acknowledged, but this move is clever and astute; it places them firmly at the forefront of standards, where HTML5 and JavaScript rule. Admittedly they have Desktop Mode to fall back on, and not supporting plugins there would be suicide, but still, it’s a major leap for any browser not to support plugins at all; no Silverlight, not Flash, no PDF; that’s pretty ground-breaking.

So what does this mean for your browsing experience? Any site using a plugin will just show the default content; in the case of Silverlight or Flash sites it’s a “download now” message, which actually does no good, since even if you download and install the plugin it won’t work in the Metro browser. You can however, just tap an icon and select “Use desktop view”, where the standard Desktop Mode browser is launched with the same URL. If the plugin is installed you’re good to go, otherwise you download and install as normal. Where this model falls down I think is that there’s no real notification; users won’t be aware that the plugin won’t work, even if installed, and the option to switch to the desktop view is a user choice, two clicks away. Personally I’d like to see more pro-active involvement, where if a plugin is detected an indicator makes it obvious that content isn’t being displayed and that desktop view can be used. This is going to be very common; you’d be surprised how ubiquitous Flash is.

What does it mean for the developer experience? Simple: standards. You want a web site or application that works everywhere, then HTML and JavaScript are your choices. Look into client frameworks that make things easy: HTML 5, jQuery, Knockout, Backbone and forget about proprietary plugs. Sensible web developers have been building these core skills for years, but if you haven’t, now is the time to start.

posted @ 9/16/2011 12:40 PM by Dave Sussman

Keep calm and carry on

Since the first videos of Windows 8 showing a Javascript based UI, many .NET developers have been in a panic, fearing for their future. Is .NET dead, is Silverlight dead? To some degree this confusion still reigns, despite the BUILD conference; there’s a mixed message about the future of apps and I think we’re all glowing in the metro-light a little dazed and confused. The fact is that Windows 8 is Windows; it will still run everything that Windows 7 does and still supports .NET and your .NET apps, in Desktop Mode. Doug Seven has a good balanced comment on Windows 8 applications.

What this means that your existing skills are still viable; if you’re building desktop apps for your business then you can continue to build them; Windows 8 isn’t going to be here for a year or so and even then the uptake will follow a familiar pattern, especially in corporations: ignore, evaluate, wait for SP1, delay because of disruption & training, etc. Consumer uptake will be quicker, as will the enthusiast and developer market, and tablets may well fuel that; Windows 8 is now a viable OS for tablets; compelling even. The upshot is that it’ll be a while before any of your application skills are out-of-date and you’ve plenty of time to transition.

And talking of transition, how do we see applications becoming metro-like? The fact is that most apps just aren’t suitable to be metro-style apps – full screen and touch enabled – and given that’s not the hardware your corporation has, that’s fine. For those that need the metro look, well, that depends; a WinForm app won’t transition, there’s no route here; it’s not a no-though road, just a never ending road without any exits. WPF and Silverlight will transition, although how much work is involved is app dependent; the keynote demos showed a Silverlight app with minor changes working as a metro-style one; your mileage may vary. Web apps? Well, they’re browser dependent; they won’t be metro-apps, but they’ll work just fine in IE10. Probably. Probably? Yes, if you’re using the full metro interface in Windows 8, IE doesn’t use plugins. Guess what Silverlight is? That’s right, a plugin (as is Flash), so Silverlight apps won’t work in the full metro browser (at the moment; that may change, this is a preview after all). This means that if you’re building web apps which rely on Silverlight, they won’t work in Windows 8 browser mode; they’ll work find in desktop mode – IE10 in desktop mode supports plugins – but your users may have a jarring experience and have to switch modes. I was hoping to see native XAML support in the browser, but then my technology predictions have never been very accurate.

So what does this all mean if you want to write Windows 8 Metro Mode applications? Well, most .NET skills are transferable: VB/C#, XAML, ASP.NET, Javascript; these are all key. WinForms? Start thinking about your future; much of app development is the same, it’s just the UI framework you’ll need to learn. The big question is web applications, where clearly HTML5/JS is the future; while you can continue to write Silverlight applications and they’ll work fine in Windows 8, they won’t run in Metro Mode, so if you’re building a publicly available website that uses Silverlight (or Flash for that matter), you may need to think about how that’ll work. What the mix of application modes does show is that backend services become key; that’s your route to transitioning more easily, by providing a thin skin for your UI.

I don’t see much of a panic and I like what I’ve seen so far. In fact I’m excited by what I’ve seen. I’ve at least one future application for a client that the Metro Mode interface is a perfect fit for.

posted @ 9/15/2011 10:48 AM by Dave Sussman

RSS versus Twitter

Helenfeels her RSS feeds are stale, mentioning that many feeds have dropped off due to twitter. This is probably true, twitter has become a micro-blogging medium, although I suspect the general effort of blogging is a factor too. But it raises an interesting question: where do you get your learning from? How do you keep up-to-date? I still use blogs for this; it’s generally a morning thing, catching up on what people are doing, what’s been released, and so on. For me, twitter is the stream of consciousness, the office banter in the background; a place to join in the conversation and ask questions. While it does produce links to blogs, that tends to be a select few and really, if you want content it has to be a blog; twitter just isn’t designed for content, pointers to content yes, but not the content itself. But, the people I follow on twitter aren’t always the same as those whose blogs I follow; there’s a crossover, but it’s not a big one.

So, what’s my list of reads? Here’s my OPML file. Not all of it is tech related; a few musicians, a few things I find funny, several that haven’t blogged in a long time, but I keep on the list, just in case. But it provides me with a few things to read each morning.

posted @ 6/22/2011 6:52 PM by Dave Sussman

The move to Windows Home Server 2011

Windows Home Server is a great product, if under-marketed and not that visible. When it was originally launched, the idea that you could just plug in any number of different sized drives and have all the storage pooled to one big space was highly attractive. Add that to a simplified interface and you’ve a perfect home / small business storage server.

With the 2011 release however, Microsoft controversially remove the Drive Extender, the technology powering this drive aggregation. It caused a lot of angry comment and I’m one of those people that thing it’s a bad move; this was the one piece of WHS that made it viable for non-techies. However, given that from what I see, WHS isn’t really used outside of the enthusiast market, so maybe Microsoft’s stance is correct; is it really worth their effort maintaining a technology that wasn’t 100% working, when the target audience can get around it easily enough? Their stance was that large drives are cheap (in the UK a 2Tb drive is roughly £50) and that if you need more security then you buy a RAID system. This misses the point really; RAID systems are expensive, at least comparatively so compared to discs, plus complex for people to understand; a lot more complex than just plugging a new drive into your existing WHS box and having the space appear.

I’d decided I wasn’t going to upgrade my WHS server, but after a power outage which left the boot drive dead – it wouldn’t even spin up – I decided to install WHS 2011. I’ve plenty of large discs and really don’t have that much data; excluding the DVDs I could fit it all on a 500Gb drive. As it happens, the existing disc controller I was using supports hardware RAID, but I’d decided to swap it out as I’d lost faith in it; discs randomly being disconnected and being fixed by a reboot had left me wondering what else it might do. I toyed with buying another RAID controller and using the RAID functionality on that, but decided that I’d need to spend more money than I wanted to.

So on went WHS 2011 and many reboots later it’s up and running and the data is being restored. Am I going to miss the drive extender? Possibly; certainly the ability to just unplug a drive and replace it with a new one will be missed, but with 2 * 2Tb and 2 * 500gb that won’t happen for a while. Also, though the new admin interface is shinier, it’s a little more though provoking because you have to think about storage locations; with no single aggregated storage pool, you’re in charge of the data – more work, but more transparent, nothing is hidden; the drive is just a normal drive, so it does make it easier to move the drives to other machines.

The biggest problem was during installation; early on in the process you’re asked for your location and keyboard layout, for which I selected UK. Later on you’re asked for the admin password, and mine contains sever special characters. After rebooting I couldn’t log in, until it occurred to me that the language bar had been visible during installation and still had US on it; so even though I’d been asked for my keyboard layout, the input layout isn’t changed until after you set the admin password; thus the special characters didn’t match those on my keyboard.

I’m still not convinced that the move to remove the Drive Extender was s sensible idea, but I think I now come to accept it.

posted @ 5/20/2011 10:16 AM by Dave Sussman

SQLBase .NET Provider Problems

This post is on the off chance that someone else may find it useful; I doubt many people are using some of the old technology detailed, but you never know.

My arch-nemesis, on and off, over the last few years has been SQLBase. A client I work with uses this as both the development platform and database for one of their products, a product I interface with. They have long term plans to rewrite their product, but time and money dictate it stays where it is; if it ain’t broke …

The biggest issue is that we’re pegged to an old version of the drivers, version 8.5, which has a number of problems, one of which hit me recently when trying to extract blob data from their database. The code is pretty simple, something like this:

string sql = "SELECT Image FROM IMAGES WHERE ID=1";
 
using (SQLBaseConnection conn = new SQLBaseConnection(cs))
using (SQLBaseCommand cmd = new SQLBaseCommand(sql, conn))
{     conn.Open();     using (SQLBaseDataReader rdr = cmd.ExecuteReader())     {         if (rdr.Read())         {             return BytesToImage(rdr[0]);         }     }
}

 

Fairly innocuous, yes? But, and this is a documented issue, you receive an exception and the closing brace of the using statement, indicated a “long operation has not finished” (or words to that effect). A string of tests indicated that version 9 of the drivers fixed this issue, but when implemented in my solution, the error re-surfaced. More tests and I found that with both versions of the drivers, you can get around the problem by changing the if to a while. Yep, this works:

while (rdr.Read())

The if causes the exception, the while doesn’t. Weird, huh. There’s no side effect in my code, since the query will only return a single row. Hours and hours of testing, and yet a simple solution. It just goes to show that sometimes you have to try odd things, and sometimes you get lucky.

posted @ 4/1/2011 10:15 AM by Dave Sussman

Multiple Monitors

The eternal quest for monitor space took a step forward today, as I took delivery of a Kensington Universal Multi-Display Adapter. I already have a couple of 20” monitors, the excellent Dell UltraSharps, running at 1600x1200; only one is a newish one, two are fairly old, but they are superb screens, and perfect for developers with their high vertical resolution. My PC is in a cupboard, a couple of metres behind me, to minimise noise, so the monitors are connected via 5 metre DVI cables, both from a single nVidia GT950 graphics card. I’ve long been wanting to plug in the third monitor, which occasionally gets used for the laptop, but the machine is old(ish) so I’d need to find older graphics cards to fit the older slots, then get another long DVI cable, and so on.

Until now. Craig Murphy mentioned he’d just got one of the Kensington adapters and that it worked well for him, so given the price, I ordered one too and it arrived this morning. A simple, easily openable package (ie, not one you need industrial strength shears to open), with the adapter, a very short USB (mini USB for the adapter) cable, and a DVI to VGA converter; you need a DVI cable as the adapter itself has a female DVI socket. Plugged into Windows 7 the drivers were automatically loaded, windows recognised the monitor and set the default resolution; 1600x1200 again. That’s it, nothing else, it just works.

I had been a bit worried about the cable length issues, given the PC is far away, but I plugged the new USB cable into the USB ports on the back of the old monitor, which is itself plugged into a powered USB hub, in turned on the end of a 5 metre USB cable to the back of the PC. I needn’t have worried, since everything works seamlessly. If you’re after a second monitor and don’t want the trouble or cost of upgrading graphics cards, then this is a very cost effective route. It has virtually no impact on the PC resources (this is a Core2 Duo 2.4 with 4Gb memory running Windows 7 23-bit), and I see three DisplayLink processes running, totalling 25Mb, and occasionally 1% CPU usage).

Now I have a great three monitor setup.

posted @ 3/8/2011 11:49 AM by Dave Sussman

DDD9

I love the UK developer community. Such passion, commitment and energy. Such desire to learn and to help others learn. You do yourselves proud.

This weekend was DDD9 - our best DDD yet, reaching within a few places of our maximum (sold out in 12 minutes). Had everyone turned up who was registered, the security staff would have been very nervous about fire safety limits. As it happens though, we were full, but not too full to cause any real concerns. And that fullness helped, with every session being packed; this makes the sessions much more enjoyable I think, from both speakers and attendees perspectives; more people means more people who’ll challenge you, more questions, better interaction.

Things I think worked particularly well were the opening of Chicago 1 & 2 for the Grok Talks and the number of sessions. We first opened up the rooms for lunchtime Grok Talks at DDD8a; having the big space available means more people join in. Next time I’d like to see some 20/20 talks too; maybe if you’ve done a talk before, you have to do it as a 20/20. Having 6 sessions in the day means that breaks are a little more compressed, but that also means less milling about; everything is a little more focused. Sure, you get information overload and are frazzled by the end of the day, but what the heck, it’s only for one day, and is surely worth it.

Personally I didn’t get to many talks, as often happens when you’re an organiser. I caught the end of Helen Emerson’s one on CSS, which I enjoyed for the brief moment I was in there. I also caught the packed session by John Price on home automation, which was a blast; John doesn’t do things by halves and brought along a real, functioning holodeck*. If you follow individual speakers, then they’ll have made their slides and samples available, but we’re collating these at the moment and will make a central list available on the main DDD site.

Overall, I loved the event and I think they get better every time we run them. If you want to see how much fun we had, check out Flickr galleries from Phil and Craig.

So what about the future? Can we grow DDD or have we reached our limit? Are there ways to improve what we do? We’re certainly going to look at numbers; increasing capacity is a problem with room availability, security, staff, cost and fire safety all being issues we face. We’re not going to mess with any of the basic format; it’s still a conference by the community for the community and we’re all committed to that ideal, but we always want to make it better if we can. If you’ve ideas then let us know, as we’re always happy to hear your views.

If you can’t wait for the next DDD then remember that this is a global event now. Coming up we have DDD Belfast on 17 March [note – link not yet live, but will be later today], DDD Scotland on 7th May and DDD South West on the 11 June; they’ll be a call for speakers for DDD South West soon, so get your proposals ready. We’ve also a new venue – DDD North East, which is currently in planning but will probably be around September. If you’re interest in this then follow NEBytes and Andrew Westgarth on Twitter. Oh, and if you’re in Australia, then DDD Sydney will be back again this year.

All in all, another great event. Long may it continue.

* this may be a lie

posted @ 1/31/2011 12:02 PM by Dave Sussman

DDD South West

This weekend was DDD South West, part of the ever increasing DDD brand, run by Guy and his crew, who did a most excellent job as usual. Situated at the University of West England in Bristol, we had perfect weather to accompany the great talks, and for once I saw a talk in every slot. I started out with Liam’s talk on software development and how not to go bust, a feat which I’ve barely managed to accomplish. Next was Chris Alcock and reactive extensions; I’d seen Jon Skeet do a talk on this a few weeks ago and wanted to learn more, and Chris’s talk was pitched perfectly; lots of simple examples, giving a really good overview of the features and uses. I finished off the morning with Phil talking about crap code, a session that was mostly a WTF list of things not to do. It turned into a good discussion and really brought the audience together, since it seems almost everyone has seen (and written perhaps) code like this.

After lunch was jQuery with George Adamson, which for me was the best talk of the day. I know enough about jQuery to not have to concentrate too much, which left me to really enjoy George’s style; there’s a little bit of mad professor in him I think, and I really enjoyed both his style and the talk itself.

I finished off with my talk on Clean User Interfaces with WebForms, which despite the good marks, I wasn’t really that happy with. It needs more content I think. Phil suggested taking a few bad WebForm pages and working through them to clean them up, and since I’m doing this talk at NxtGenUG next month, I’m going to make some changes to add a bit more practicality to it. I was generally happy with the deck though, which was a big change for me; just pictures, no bullet points. I’m not sure that style will fit every talk I do, but I think it worked for this one. Plus it had kittens. The deck and sample application can be downloaded from the samples page.

Overall it was a great weekend, and with 300 people attending it shows what a great community we have in the UK. Lots of motivated people, new speakers, great talks.

Flickr Tags:

posted @ 6/8/2010 9:24 AM by Dave Sussman

Site Map Security Trimming With WebForms and Routing

The routing framework that was introduced with MVC has been available for use in WebForms since version 3.5, but doesn’t integrate well with some existing features, notably security trimming with site maps. This is where the site map provider will honour authorisation, only showing nodes for which the user is authorised. The trouble is, the url in the site map would be a route url, not the url of the physical file, so the security checking on the node doesn’t work. It doesn’t fail, just doesn’t work at all.

The solution is to customise the provider, which is easy enough since the code for all the providers is available at http://tinyurl.com/ASPNETProviders. Modifying the XmlSiteMapProvider, you can add the following:

public override bool IsAccessibleToUser(HttpContext context, SiteMapNode node)
{
    if (!this.SecurityTrimmingEnabled)
        return true;

    SiteMapNode newNode = node.Clone(true);

    if (!string.IsNullOrEmpty(node["routeName"]))
    {
        Route r = (Route)RouteTable.Routes[node["routeName"]];

        if (r != null)
        {
            newNode.Url = ((PageRouteHandler)(r.RouteHandler)).VirtualPath; ;
        }
    }

    return  base.IsAccessibleToUser(context, newNode);
}

This simple looks up the route name in the route table and gets the url of the physical file, passing that through to the base security checks. You also need to add the routeName attribute to your siteMapNode, so that an easy lookup can be done. You could iterate over the site map nodes finding the right one, but this is a slightly faster solution, although “faster” may not be that measurable.

posted @ 6/2/2010 9:15 AM by Dave Sussman

Fixing Internationalisation in ASP.NET

I’ve just read this blog post and while I’m keen to encourage localisation of web application and anything that makes it easier, I’m curious as to why Jason feels the need to say that localisation is “hopelessly broken in ASP.NET” and you have to do all the localisation by hand, for every control. There’s no comments feature on his blog, which is why I’m commenting here.

I’d agree that localisation in ASP.NET isn’t perfect; the server code has to have the additional meta resource keys, and you have to wrap all text to be localised, but this doesn’t have to be done by hand. Visual Studio will automatically parse the page, adding the meta resource keys to all controls that are localisable and creating the resource file for you. Yes it’s an XML file, but Visual Studio has an editor for it, and there are other tools I’ve seen that allow editing of resource files, so it’s not like you have to hand edit the XML. It’s obviously harder if you need an external person to do the translation, but not that much harder.

The other issue I have is Jason says:

In practice, it's so much extra work that nobody actually does it. That, my friends, is the reason you hardly ever see any multi-language websites written with ASP.NET.

That’s a really sweeping statement and completely misses the point. Most people don’t do localisation because they don’t care; English is their major language, a language spoken by the majority of the people they target their site to, so it’s just not relevant. It’s also a much bigger issue than just the text on the page, with database text (eg product descriptions, etc) requiring the same treatment, support for right-to-left languages, etc.; those, I’d agree, are areas where ASP.NET’s localisation falls down.

In the spirit of fairness, I too admit to not having localised many sites, but those I have done have been done very quickly. Yes you have to process each page, which is a burden, but a relatively small one since Visual Studio does it for you. I have a fairly large application to localise soon and it will take me a while to go through all of the pages, but the real effort of what I need to do is support right-to-left languages, so it’s not just the text that needs changing, but the entire site layout. That though, is another issue.

Jason’s idea is sensible in some areas, in that if you code from scratch using his method, then localisation is simply a matter of the source text, so you don’t need to touch your site at all. Likewise, I could have done the same with every site I’ve done, using the built-in features. Jason’s method might fit you better if you’re in the MVC space or have come from another framework.

I don’t wish to be negative about this Jason; please continue to localise sites and to push localisation as a good thing to do. Use whatever method is suitable. But don’t discourage people from using the built-in methods when the tools provide some great features; let’s tell everyone all the methods available, give guidance on the pros and cons of each and let them pick the best for their needs.

posted @ 3/2/2010 9:45 AM by Dave Sussman

Windows Media Centre &ndash; Does the UK care?

I’ve been a big fan of PVRs for years, buying a TiVo for the few months they were available in the UK. I retired that and bought an Acer Aspire iDea 500 as soon as it was released in 2006, it being the first MCE machine designed for the UK; Core 2 Duo, quiet(ish), plenty of connections, including SCART, which given my ancient CRT TV is a requirement. To this day it’s one of the few, if perhaps only, machine with SCART. These days plasma and LCD TVs are easy to connect to, but any CRT TV in the UK is SCART based.

Recently the power supply on the MCE box failed (a common problem it seems, which could be why Acer don’t make it any more), but a new one was sourced, more memory was added and I installed Windows 7. It’s perhaps a little underpowered, the VFD display doesn’t work, but otherwise is mostly excellent. Occasionally, and for the last few days, a couple of channels are suffering massive breakup and are therefore unusable and won’t record. It could be the transmitter, the weather, or maybe one of those fat pigeons I see in the garden, sitting on the aerial. My Windows 7 machine upstairs has no problems, nor does the TV itself, which puts it down to a tuner/driver issue, but given the MCE box under the TV isn’t officially supported by Windows 7, I have little come back. But I can’t live without it and can’t afford a new one. So I’m left to rant, like the old man I am.

Looking around, there are very few dedicated MCE machines in the UK, even fewer designed as one you’d want under the TV. There are a fair number of dedicated PVRs, obviously cheaper, but more limited in capabilities than MCE and from what I’ve seen, mostly having awful UIs that are hard to use. No one seems to care. Hardware manufacturers don’t, and I doubt Microsoft do either. There’s so little MCE in stores that most people haven’t heard of it. A PVR is a consumer product, sold alongside TVs, literally, shelved underneath them in the stores. An MCE machine? Well, computers are over the other side of the store; they’re computers, not PVRs, right?

And anyway, I’m not sure I’d recommend it for the general public anyway. So many have enough problems with PCs that a PC under their TV controlling the recording of their shows, just isn’t sensible. A dedicated PVR, at around £100 and you don’t expect perfection and is almost an impulse buy; a PC for £500, well, you think twice about the cost and expect it to work. All the time. No problems.

The MCE interface itself is consumer ready, but everything around it isn’t and until these things get to the white goods level of simplicity I doubt they’ll ever take off big time. Apart from Windows and Office, Microsoft’s penetration into the consumer market in the UK is so small that it’s no wonder things don’t get released here. The vicious cycle of “no product, no demand” just escalates. The Windows Phone 7 Series will be interesting once it reaches these shores; a device firmly aimed at consumers might raise awareness and might be the tip of the iceberg for Microsoft realising that the UK actually exists.

posted @ 2/25/2010 12:31 AM by Dave Sussman

Want to be an author?

Since I don’t have time to write books at the moment, I’m forwarding this to world. Packt Publishing, are expanding their portfolio and looking for books on Visual Studio Integration, Administration and Reporting.

Packt Publishing today announced their plan to advance their line up of Enterprise focused titles, and invited potential authors with Visual Studio skills and book ideas.

When it says today, it actually means last week, but I’ve just found out about it. If you’re interested in writing Visual Studio books, Packt wants to hear from you! Please visit the Packt Authors Website for submitting your book ideas and title suggestions.

Other publishing companies exist. Your royalties may go up or down depending upon the economy.

posted @ 2/10/2010 12:09 PM by Dave Sussman

The Conference Speaker&rsquo;s Dilemma

Gary has an interesting post about conference feedback, in particular around the usefulness of a session. As both a speaker and organiser, I was going to reply in the responses, but maybe it’s worth a broader audience. Is the usefulness of a session actually relevant to anyone at all? I go to plenty of sessions that aren’t useful in my day to day job, but that doesn’t mean it wasn’t a good session or I didn’t enjoy it. Here’s what I make the choice based on:

  • Do I have a pressing need to learn the topic and will the session give me the knowledge I need? It’s mostly about pointers to the technology, the speaker’s insight, that one nugget of information that makes it worthwhile.
  • Do I enjoy the speaker? Sometimes a session is worthwhile just because the speaker is entertaining, even if I know I’ll get nothing out of it.
  • Is it something I know nothing about? I sometimes attend sessions I know will have little or no impact on my daily work, just because I feel I ought to have a passing knowledge of the topic; sometimes that’s even as slight as what the heck it is.
  • Is it something I know I’ll never master? I’ll attend lots of design and user experience talks, because those are particular interests of mine. I know I have limited (none, some would say) design skills and am intensely jealous of people who do. But I go in the faint hope that some of the sparkle will rub off.

Assuming I stay through the session, or the majority of it at least, I’ll always leave feedback, because as a speaker I know I value that feedback. If I did badly I want to know why, which is why it’s so frustrating to receive a low score with no indication of why. I once had “terrible session” written alongside a low score; if I’m so bad, how am I going to know why you thought it was terrible? My response is “terrible feedback”. Still, it beats “didn’t like his accent”; sorry, but it’s the only one I’ve got.

Now technical knowledge, speaker ability, etc, are easier to score numerically, and these are valuable to the organiser. But usefulness? Maybe for a big conference, trying to gauge the sessions to include, but for smaller events such as DDD, where the topics are picked by the public? Don’t blame the conference or the speaker if it wasn’t useful, you picked it. Now it’s a different matter it the session didn’t match the abstract, as that’s what you made your decision on, and that is useful information; maybe the speaker didn’t write a concise enough abstract, or got off topic, or any number of other reasons, but don’t just say it wasn’t useful, say it didn’t match the abstract.

I’m not suggesting we get rid of usefulness altogether as a question, it can help balance the other scores (eg a new speaker, with nerves, who doesn’t perform well, but still provides useful information). Maybe we just need to force a textual response if the usefulness is scored low. Or perhaps if any session is scored low.

Once of the biggest problems conference organisers have is getting feedback, and therein lies an immediate dilemma. The paper feedback form, handed in at the end of a session (or the day) gives you the immediacy; you’re less likely to forget what you thought of the session, but sometimes you need time to think about it. Plus, the organisers need to type all this information in if they want any form of analysis. On the other hand, the online form is convenient for later analysis and probably easier for attendees, but lacks the the ability for immediate response, unless it’s available during the session and there’s a network connection available.

So ultimately this comes down to a plea. If you attend an event, no matter what size, and are asked for feedback, please give it; make it useful feedback though, tell us what did and didn’t work, what you liked and what you didn’t. Certainly for UK events, where we have an active community, all of that information gets shared, so all events benefit.

posted @ 2/8/2010 12:20 PM by Dave Sussman

ASP.NET Web Forms and MVC

I’m not really sure I need to blog this, because if you read this blog and not Scott Guthrie’s I’d be very surprised, but Scott just posted about technical debates, including WebForms versus MVC. Worth a read, including the comments.

posted @ 1/25/2010 8:47 AM by Dave Sussman

RedGate SQL Search

I’m a big fan of RedGate’s tools, and their next little one has hit beta. SQL Search provides a quick and simple way to search for, and through, objects on SQL Server and is invaluable if you have a large number of objects. It’s fast, unobtrusive and works really well. Go give it a try.

posted @ 1/21/2010 12:29 PM by Dave Sussman

WebForms aren&rsquo;t dead

The post could equally be about me, given my lack of content recently, but clients, lack of time and general apathy all play their part. However, what I really want to say is mostly explained by the title, that of the future of WebForms, in particular that they have a future. A lot of what we read in blogs, articles, etc is MVC related and that’s fair; it’s still relatively new to the ASP.NET arena, and new and shiny always gets press; WebForms had lots of coverage when it was released – it was “A Big Thing”. Those that blog and speak at conferences and user groups tend to be the ones passionate about their technology, the vocal few who believe strongly, and it’s easy to get sucked into the new technology vortex, the belief that what they are saying applies to every project you are on.

Recently on a mailing list I’m on, there’s been a thread about MVC versus WebForms. Lots of good arguments and one exceedingly well constructed message from someone important; I hope it gets blogged because it will go a long way to quell the fears that many have, that WebForms is a dying technology. It’s not. It’s still being actively developed (the WebForms and MVC teams are about the same size) and still plays an important part in Microsoft’s web strategy.

The thing is, there are good and bad points for both frameworks and which one you use depends on many factors: the project requirements, available skills, etc. Here’s my take.

MVC

Advantages

  • Complete control over UI. With no server control framework you can construct exactly what you want, how you want, making it easier to use script frameworks.
  • Great for Test Driven Design. The separation between components makes TDD much easier. It doesn’t solve all your TDD problems, but it does make them easier.

Disadvantages

  • More UI work. Since you don’t have a rich set of controls, you have to create your UI yourself, although there are helpers to, well, help.
  • Learning curve. While MVC isn’t hard to learn, it’s very different from WebForms, so don’t think you can just jump in.

WebForms

Advantages

  • Maturity. It’s a well established, stable framework. Don’t confuse older with superseded.
  • Control framework. The rich set of controls make pulling together a UI very quick. That can have disadvantages, but if you know what you’re doing the UI can be almost as clean as an MVC one.
  • Postback and ViewState. Yes they are hacks on top of HTTP and can cause many issues, but they work very well for what they were designed for. The event based lifecycle is very easy to understand, especially for beginners.

Disdvantages

  • ViewState. The defaults produce more ViewState than is really necessary, leading to larger pages.
  • Test Driven Development can be hard, especially testing UI code. Abstracting as much code out of code-behind files can help, but you’re still bound to the postback architecture.

That’s just my top picks, there are plenty of other points worthy of mention. I’m a big fan of WebForms, but that doesn’t mean I don’t like MVC too. Bits of MVC I don’t like, in particular the standard view engine (I’ve never really liked inline <%%> code , even in ASP and ASP.NET WebForms, but that’s a personal thing), so I’d probably use Spark View instead. The one thing I’ve said right from the very first previews of MVC is that it needs some form of control architecture; not server controls, because remember, there’s no page lifecycle, but controls to abstract the common rendering; some people, including myself, find the <%%> hard to read, while a declarative control is easier. I doubt a control framework will appear when the helpers work so well, hence my preference for another view engine, which is another advantage – better pluggability. I like the controller architecture, and routing (oh, and routing is supported in WebForms too).

It’s also important to remember that not every project has the same requirements. Two projects I work on are WebForms, mainly because they predate MVC, but even if they didn’t, I’d still use WebForms. Why? Well they are both Intranet/Extranet applications, low numbers of users; one has lots of data editing via forms, the other less so, but still enough that WebForms and the UpdatePanel (yes, I use the UpdatePanel) work perfectly well. Page size and rendering performance aren’t an issue in these applications (and considering that one of them uses databases with 30-50 million rows of data; rendering is a minor issue compared to database performance).

And furthermore, both MVC and WebForms are just a part of ASP.NET; remember all the services (membership, roles, etc), providers, and so on, that are fully supported by both frameworks. ASP.NET 4.0 improves WebForms and although the changes look small, they have an important impact on the framework. Just because WebForms isn’t evolving at the same rate as MVC, doesn’t mean it’s been forgotten. WebForms doesn’t need to evolve so fast.

Scott Hanselman did a blog post on Dynamic Data, which is a good read in itself, but at the bottom there are a bunch of links to WebForm resources. Some may talk about MVC, but there’s still plenty of movement on the WeForm front.

posted @ 1/21/2010 11:42 AM by Dave Sussman

Silverlight Bing Maps Zoom Scrolling Bug

If, like me, you’ve just upgraded to the V1 release of the Silverlight Bing Maps Control, and are wondering why the mouse wheel no longer zooms the map on browsers other than IE, it’s because you’ve got Windowless set to true. Eg:

<asp:Silverlight ID="Xaml1" runat="server"
Source="~/ClientBin/SilverlightApplication1.xap" MinimumVersion="2.0.31005.0" Width="100%" Height="100%"
Windowless="true" />

 

The solution is to set Windowless to false, or remove the attribute since false is the default. Of course, if you need windowless, then you might have to wait for a fix, or use IE.

There’s a post on the forums where you can document and discuss bugs.

posted @ 11/11/2009 12:24 PM by Dave Sussman

Latest Images

From Me Photos
From Ebay
From General pictures
From Misc
From Me Photos
From Me Photos
From Friends
From Friends
From Friends
From Friends
From Friends
From Friends
From Friends
From Friends
From Friends
From Friends
From Friends
From Friends
From Friends
From Friends