Tuesday, 31 March 2009

Visual Studio 2008 at 100% CPU scrolling text

The Visual Studio text editor has been feeling very sluggish. It finally got so annoying, when just holding down the down arrow to scroll down was taking 1 second per line (and devenv.exe would peak in CPU % Task Manager), that I decided I needed to figure out what the problem was.

Running devenv.exe with the /safemode option resulted in a well-performing editor, so the next step was to isolate which add-in(s) was the culprit..

  1. Resharper 4.5 nightly build..
  2. TestDriven.NET
  3. Gallio
  4. CAT.NET
  5. Spelling add-in
  6. VisualSVN
  7. Visual Studio SDK
  8. WiX

And that did the trick. Looks like this bug has been identified in WiX, so hopefully the next public build will resolve the problem. In the meantime, the workaround is to unload any WiX projects in your solution.

Now to re-install everything again :-)

Monday, 30 March 2009

SAS and typeperf

It’s nice to learn new things.

For instance at last week’s Adelaide SQL User Group, as part of Dan Grecu’s talk on how he manages his SQL Server infrastructure, he showed a script that uses typeperf.exe. That was new to me, even though it’s been around since at least Windows NT 4.0. It records the values of specified performance counters to the command window or a file.

Then this morning on the bus I was listening to RunAs Radio episode 101, where Alan Sugano mentioned SCSI, SATA and SAS. I’d heard of the first two, but not the third. Fortunately Richard asked Alan to define them. So SAS uses SCSI but rather than having 8 or 16 devices all sharing the same bus, each device is on its own connection, so they don’t have to wait their turn to send or receive data. For this reason it sounds like it’s becoming quite popular, particularly for servers.

Saturday, 21 March 2009

Famous again?

My parents actually noticed this photo on the front cover of the “Belair line renewal” brochure (PDF), and then my son happened to notice the brochure and asked “Why are you in this photo Dad?”

Passengers boarding train at Blackwood Station

Have a close look at the tallish guy closest to the left of the train. Yes, I reckon that might be me! You may recall, as a regular train commuter this isn’t my first brush with fame. Moving to ABB Grain (who are on South Tce) I did stick with the Belair train for a while (hopping off at Unley Park station to transfer to a bus down King William Rd), but then realised that the 218 bus is generally quicker.

The Belair line is being fixed up this year, however it’s the only line that isn’t being electrified, which is just ridiculous. I’ve heard that “it’s tricky because the Belair line runs next to an existing freight line and also goes through some tunnels”. Give me a break! These are simple engineering problems that can easily be solved.

The Belair line has never been the same since the government sold off one of the lines to become a standard-gauge freight line. Reducing it to a single track has meant that trains now need to wait on sidings to pass each other, and as a consequence the trains virtually never run on time.

What I would love to see is they fix up the line, electrify and standardise the gauge and lease back the other line so that services could finally return to normal. That seems sensible and logical to me, but I’m not going to hold my breath.

Thursday, 19 March 2009

ASP.NET MVC 1.0 and Ouch

Looks like version 1.0 of ASP.NET MVC is finally released. I’ve had a tiny play with some of the previews, but I really want to spend a bit of time getting up to speed with this.
On a completely unrelated note, I’ve managed to injure my back today. I was riding to work and all of a sudden it felt like my lower back had a big spasm. I started to walk back home and quickly realised that I wasn’t going to get very far. Happily my Dad was able to come over and pick me up. He’s had personal experience himself of doing his back very badly, so was quite concerned – plus it happened that it was his bike I was riding (mine not having survived the trip home from this year’s tour). I’m a reasonably tall fellow and I wonder if the fact that Dad’s bike is a bit smaller might have been a contributing factor.
So a rapidly-booked appointment with the Chiro and some Nurofen Plus leaves me a little more mobile now that I was earlier today, but it sounds all going well the pain will be there for a little while longer, and cycling and basketball might have to take a break for a bit. I had also been hoping to still get over to Wagga for CodeCampOz but sitting in a car all day doesn’t really sound that comfortable right now either.

Friday, 13 March 2009

‘Severe error’ in SQL Server 2008

System.Data.SqlClient.SqlException: A severe error occurred on the current command.  The results, if any, should be discarded.

That’s not a very helpful error message!

Googling doesn’t throw up much except for KB article 961283. However after installing Cumulative Update 3 the problem remained, so that wasn’t it.

Narrowing down the problem highlighted a stored procedure using a CURSOR while talking to a linked server.

Re-writing the stored procedure without a cursor gave back a more descriptive error (trying to set a non-nullable column to null!). Now it was easy to fix.

Thanks to Timothy, SQL guru :-) I’ll let him describe how he writes T-SQL that avoids cursors.

Wednesday, 11 March 2009

Sunday, 8 March 2009

Dr Dobb’s Journal, 1976 - 2009

Back in the golden days of computer magazines (I’m talking the mid-80’s to mid-90’s), I could spend ages in the newsagent browsing all the different available issues. You remember – when the US PC Magazine was as big as a phone book, and it seemed like every brand of computer had their own magazines – BBC Micro, Commodore 64 and Amiga, Sinclair ZX Spectrum, MicroBee and the rest. One particular periodical that caught my eye was Dr Dobb’s Journal (DDJ for short) – probably because it wasn’t so much aligned with a particular brand, but that it was about computer programming in general.

The first issue I bought was March 1990, which had an assembly language theme. For old times sake, let’s take a trip down memory lane and see what those 160 pages included. Descriptions are as printed on the contents page.

The following feature articles:

  • Assembly language lives (Michael Abrash) – Assembly language isn’t the be-all and end-all of PC programming, but as Michael states, it’s sometimes the only game in town when performance program size are important
  • Assembly language tricks of the trade (Tim Paterson) – Every programmer collects a personal bag of programming tricks. Tim’s been 13 years in the making, and he shares some of his favourites with you.
  • 68040 programming (Stephen Satchell) – The newest member of the 680x0 family provides some challenges for programmers at all levels, particularly when it comes to caching.
  • Homegrown Debugging – 386 style! (Al Williams) – Use the 80386’s hardware to debug your programs by including Al’s assembly language code to establish breakpoints.
  • Managing multiple data segments under Microsoft Windows: Part II (Tim Paterson and Steve Flenniken) – Last month, Tim and Steve presented a method for managing multiple data segments under MS Windows using the segment table. This month, the provide a sample Windows program that puts the segtable library to work.
  • Object-oriented programming with assembly language (Randall Hyde) – Randy makes a case that the object-oriented paradigm isn’t completely the domain of high-level programming languages. He believes that OOP techniques can be applied, and are worth considering for ASM programs too.
  • Inside Watcom C 7.0/386 (Andrew Schulman) – Andrew suspects that Watcom’s C 7.0/386 has launched the opening salvos in a 32-bit 386 development tool ware. he also looks at how Novell has implemented the compiler for its C Network Compiler/386.
  • Mixed-language programming with ASM (Karl Write and Rick Schell) – As Karl and Rick point out, it’s not only practical but often advisable to mix languages and memory models in order to achieve the best results. Assembly language is a vital part of this mix.

the following columns:

  • Programming paradigms (Michael Swaine) – List has been codified, gentrified, and now objectified. Michael looks at how the Common Lisp data-type system underlies the object system, and how Lisp functions have been extended in the object world.
  • C Programming (Al Stevens) – TEXTSRCH, Al’s text retrieval project, continues to grow. Now you can select and view one of the files from within the TEXTSRCH program itself. he then uses this feature to explore the CURSES function library.
  • Structured programming (Jeff Duntemann) – There really were some neat ideas at last fall’s Comdex, you just had to search them out. Jeff describes the jewels he discovered, then delves into sets in Modula-2.

plus the following:

  • Editorial (Jonathan Erickson)
  • Letters
  • Swaine’s Flames (Michael Swaine)
  • Of Interest (compiled by Janna Custer)

Wow! A bit of a blast from the past! At $AU5.95 it wasn’t the cheapest thing on the shelf, but you certainly got your money’s worth. And yes folks, that’s THE Tim Paterson.

A few years later I started to subscribe and began my collection. What I’ve really enjoyed was the variety of articles. Whilst there was almost always something of direct relevance, it was the exposure to other languages, hardware platforms and specialty areas that I really liked. And you never know when sometimes something might actually be useful in your own field too.

Here’s almost all of my collection that I’ve accumulated over the years. Funny how other magazines and journals dated quickly and weren’t that hard to throw out, but I always felt that inside most issues there’d be something, if not timeless then at least worth keeping around for a while yet.

So the years passed, some things changed, but DDJ continued on. I did notice some differences – the page count slowly dropped, some of the columnists changed or finished, but Jonathan continued to be the editor and Michael’s “Swaine’s Flames” continued to be on the last page. Actually now that I look more closely, it does look like Jonathan and Michael ended up carrying most of the work towards the end.

I’d previously seen the same happen to BYTE magazine (to which I’d also subscribed to until its demise just over 10 years ago), and I suspected DDJ was heading in the same direction. February 2009 and my fears were confirmed by Jonathan Erickson’s editorial – DDJ’s time had finished, it was to become a monthly insert to Information Week. Ironically I received the early-January edition of Information Week in late February (not that handy for a weekly publication to arrive that late!) and the DDJ inclusion turned out to be nothing more than a column written by Jonathan. Information Week is aimed at “IT professionals and business managers”. Somehow I don’t think they’re going to be running to many assembly language articles anymore.

So let’s compare the final issue. From 160pages down to just 48. You can tell when a magazine or journal is getting smaller when they no longer print the title on the spine of the publication, because there isn’t a spine anymore (just staples). I’d guess the art budget must have also been slashed, as instead of clever/thought-provoking covers, for the last few issues we’ve been greeted with with photos of one of the subjects of the “Developer Diaries” page.

It contains the following feature articles:

  • Computing in the Clouds (Dana Moore and John Hebeler) - Cloud computing offers virtually unlimited, on-demand computing resources. Our authors examine how you can you can create cloud applications through Amazon Web Services and the Google Application Engine.
  • Software Development in the Cloud (Nick Gulrajani and Darryl Bowler) - Software development in the cloud brings adaptability and flexibility to any size project team.
  • Videos and Oracle Forms 10g (Greg Williams) - Greg shows how you can take advantage of unstructured data in the database - video, in this case - and access this data from Oracle Forms.
  • Parallel LINQ (Paul Kimmel) - Parallel LINQ, which is part of the Parallel FX extensions for .NET, lets you use basic LINQ keywords to tap into the extra power that multicore systems provide.
  • Decoupling C Header Files (R. Samuel Klatchko) - One issue with the common C compilation model is that it can easily lead to unnecessary coupling between files. But decoupling those files isn't necessarily easy either.

the following columns:

  • Effective Concurrency (Herb Sutter) - When it comes to lock-free programming, volatile is a volatile subject - no matter what name it goes by.
  • Disciplined Agility (Scott W. Ambler) - Package implementations look great from a business point of view but can easily run into trouble if the bureaucracy gets out of hand.

plus the following:

  • Friday Night Fish Fry (Jonathan Erickson) - Change happens as Dr. Dobb's steps up to the next level.
  • Alia Vox (Tieren Zhou) - Specification Driven Development is an agile development methodology with two deliverables: working software and product design.
  • Developer Diaries (edited by Michael Swaine) - Profiles of programmers, descriptions of developers.
  • Conversations (Jonathan Erickson) - According to Lori McVittie, cloud computing is a deployment model leveraging on-demand computing to scale and serve applications through a shared resource model.
  • Swaine’s Flames (Michael Swaine) - Michael wonders why if Twitter is so great, why do they have to promote it by e-mail?

Still some interesting stuff, but a shadow of its former self. Most of these articles are only one or two pages, contrasting with the detailed content from 1990. I see we also lost the “Letters” section at some stage. I reckon I finished reading the whole thing in 30 minutes.

I don’t know why it died, but you would have to guess that online media has a big part to play. There’s so much information online (a lot of rubbish, but some good quality too) that it’s probably hard for a paper-based medium that you’re charging customers for to compete against anything free. DDJ have been pushing their online content for a while, but

Farewell DDJ. Thanks for helping me be a better informed programmer. You’ll be missed.