It seems if I select a vertical block in the 2003 IDE (hold down the Alt key and select an area with the mouse), and then go to the Edit menu and select “Advanced” -> “Untabify Selection”, CPU usage for devenv.exe spikes and control never returns to the GUI. Easy to reproduce in any .cs file where tabs exist in the selected region.
If you are thinking of trying it – save everything first. Annoying, but easy to work around.
Update: Just tried this in the PDC Whidbey bits and there is still a problem.
Last night Ron Jacobs talked about Shadowfax to the CMAP user group in Columbia, MD. I enjoyed the presentation and found it informative. I think it’s great that people from Microsoft like Ron take the time to come to user groups and give these talks. Is it just my perception - or does no other technology circle get this type of community support?
Speaking of user groups, Geoff Snowman's blog is the place to see what events are happening in the mid-atlantic region.
I have a stack of technical magazines sitting beside my desk right now that I have not gotten to because I’d rather be reading blogs. I’m also a fan of constructive criticism, so I’m trying to go scan through the pile to see what I would do to make these magazines more appealing to me by listing what I do like.
First, Game Developer. The one highlight of every issue is the Postmortem, which will be written by someone inside a gaming company who just released new software. The postmortems will always list the top 5 things that went right and the top 5 things that went wrong, making it much more interesting than the fluffy case study that tells you how great your life can be if you were just using tool XYZ. There is a level of candidness here that generally never makes it into other print articles, but certainly makes it into blogs. There is also a level of human interest, as you can read about conflicts between different stakeholders and how they were resolved. How did they approach bug fixes? How close to the wire did the project go? What features did they have to drop and how did they prioritize them? How did the build process work? Even though it’s the game industry, it’s still software development and the issues are real and I learn from them.
Embedded Systems Programming. Every month Jack G. Ganssle has a column at the end of the issue. Jack has been around the block and is interesting because he tells stories when he writes. Sometimes the column is technical, sometimes not, but it is always down to earth and never pulls punches. This month it looks like he will tell developers how to explain to their managers the ROI on an investment in new tools – something we all need to do at some point.
Dr. Dobb’s Journal. I like Dr. Dobb’s because it contains such a diverse range of content. The April cover looks interesting because it covers everything from data mining, to developing USB device drivers, to adventures in palindromes – which sounds interesting. Also, Michael Swaine writes intellectually stimulating prose every month. This is comparable to the blog world, which contains lots of diversity and often gives you something to chew on with the brain for a bit.
Software Development magazine is generally interesting. It’s different because it is touching on topics like management, design, process, interviews, and other touchy feely subjects not covered in other technical publications. These topics are admittedly difficult to cover without sounding like theory from a college text book – so I wish they could do some more down to earth practical advice, perhaps some interviews and case studies from teams who are doing aspect oriented programming or extreme programming and let us know what went right and wrong.
So after a bit of review, I’d say there are three things technical publications could do to increase their appeal (to me, at least).
First: be real. Tell stories. There is more to creating software than cookie cutter solutions. These stories come out in blogs and they are interesting. Interview developers - tell us what it is like to work at Oracle, or any company from a startup to an industry leader.
Second: Stop trying to stir up controversy on topics like “C# versus VB”. In newsgroups we call this trolling. Also, the editorials on well trodden subjects like offshoring are completely uninteresting unless you have something original to say.
Finally: Look for more diversity in the topics and make some thought provoking topics. Some publications just seem to repeat themselves every three months with slight variation. Performance tips for ADO.NET, Using XML Web Services, yawn, yawn, yawn. Don’t cater to the lowest common denominator and give us something to think about when we are done reading. I want to know what books I could read that do not have .NET in the title that can help me professionally.
So now, it's late, and I still wont get to these magazines.
I had an interesting experience this week with a client using Analysis Services. They have an OLAP cube which holds all the transactions at a hospital for the past 3 years. There are 35 million records to keep track of every $3200 pacemaker and $3 aspirin tablet used.
The cube reprocesses on schedule every weekend – this typically takes less than 8 hours. This week the cube had not refreshed and I had an email asking to investigate. I logged in over a VPN and saw the SELECT statement from Analysis Services was still going strong after 52 hours. Not good!
First we checked current activity to see if any SPIDs were blocked - no. Any other extraordinary activity on the servers? No. As the plot thickened, I decided to look at the estimated query plan for the OLAP SELECT statement in Query Analyzer.
The cube has 8 date dimensions, meaning 8 joins to a date dimension table that yields the fiscal quarters and calendar quarters and other date attributes analysts love to use when producing trendy charts for board meetings. The estimated query plan showed SQL Server was thinking each join would double the size of the resultset. By the time all the joins are complete SQL estimates there will be almost 9 billion rows instead of the 35 million there should be.
I’m making a wild guess that when SQL Server thinks it needs to process 9 billion rows it figures 2GB of RAM won’t cut it and goes straight to the hard drive. Even though the query wasn’t producing 9 billion records – it was certainly taking a long time and not using much CPU.
I immediately thought this had to do with indexes or index statistics. I looked at the indexes on the date dimension table. The clustered index was on the column used in the 8 joins. I realized the column was not the primary key column but did hold unique date values – one row for each day over a 20 year span. Unfortunately, nobody told SQL Server the values were unique. Just adding a unique constraint put everything back to normal- the query plan looked better and processing finished in 8 hours.
The moral of the story is: proper design can also yield better performance. The more you can tell SQL Server about the data the less it has to guess and prepare for worst case scenarios.
Driving home the other day I was thinking about various snippets of recent conversation over Yukon. One underlying theme is the question: Will developers go crazy with the CLR integration and hang themselves? String and array manipulation will be much easier, but the ability to throw blocking I/O statements into stored procedures is a sobering thought.
I started to do some googling to see what has turned up in the other database circles where JVM hosting has been around for a few years. It appears there are not too many complaints, and hardly any “best practice” documents to address performance related problems when mixing SQL and Java in the database.
I don’t think this sets a precedence, however. The J2EE camp often avoids stored procedures because they don't port to other platforms easily. In contrast, Microsoft has long advocated the use of stored procedures as good practice for performance and security, and as a layer of abstraction. Also, (and this section is based on my experience and may bear no relation to reality), the J2EE teams are generally bigger and have a dedicated DBA who keeps procedural thinkers from mucking up the prize jewel. At some companies the DBAs even carry small taser pistols so they can incapacitate developers who start tinkering in SQL code.
In any case, it should be interesting to see what turns up in the forums and message boards when Yukon goes live. You always have the people who say “Doc, it hurts when I do this”. Answer: “Then stop doing that!”.
Although Bill Gates says it won’t happen, here are 10 things I’d like to see if Microsoft would acquire Disney:
10. Free passes to Epcot Center for all MSDN Universal subscribers.
8. Windows ships with “It’s A Small World After All” as startup wav file.
7. Office Assistants Clippy the paperclip and Kairu the dolphin replaced by Grumpy and Sneezy dwarves. [“For crying out loud, you still need help with the mail-merge?”]
6. “Tomorrowland” attraction replaced with “Longhornland”.
5. “Honey I Shrunk The Kids Movie Set Adventure” replaced by “Windows Build Lab and War Room adventure”.
4. Wrong memo sent to Magic Kingdom security guards - incoming patrons inspected for buffer overflows.
3. The namespace System.Drawing.Animations.ToyStory
2. Free theme park advocates build the amusement park “Lisney”. Patrons disappointed when they need to edit /etc/lilo.conf with vi before gaining entrance to the “Rural Bear Jamboree”.
1. .NET Rocks! on the Disney Channel.
I finally put some time into Longhorn this weekend. At times I was a little bit frustrated (detail below), but overall the experience was exciting. Working with just what I had installed on the Longhorn Virtual PC, I decided to do a little Visual SourceSafe automation to display the file changes between two labels. Here is a screenshot:
If anyone is interested in the code I’ll be happy to post it up for download, but I would like to improve the app some (details below). At this point I wanted to play with some of the basic Avalon controls, including the GridPanel, and of course I had to try out a gradient fill.
(Update: Here is the code, just remember, no warranties express or implied, etc. etc.. Feedback and constructive criticism more than welcomed...)
Along the way I kept some notes on what I liked, what I didn’t like, and what I need to find out more about. I’m sure some of the problems I experienced are just alpha software glitches that will be fixed soon. These notes are not particularly focused on any specific area, but more general to the overall experience.
GUI design with XAML is going to be fun. Using XAML will bring some of the best parts of web design to WinForms while leaving behind all the restrictions. The idea of having a Style element to make sweeping changes to the appearance of a form is particularly powerful.
The refactoring features in Whidbey are worth the price of admission alone. The Extract Method and Rename commands are going to save untold hours of error prone work.
I find the task based documentation (How Do I?) in the SDK extremely useful, particularly when first delving into a new area.
I like the way the Internet Explorer menu and toolbar can occupy the same horizontal area. I’ve always set my IE toolbar icons to “small icons” to conserve space, but this is even better.
When doing a search in the Longhorn SDK (local copy), the “Location” for the search results always returns “Longhorn SDK”. When doing a search in the Longhorn SDK online, I can at least take a guess where I am going to end up by peeking at the URL. For instance, when looking for control documentation, the URL will tell me if I am going to end up in the MSAvalon.Windows.Controls area or the System.Web.UI.WebControls area.
The title bars are so tall they seem to waste space. At first look the contrast to previous versions is pleasing, but when I get down to work I’d like to have more space for real content.
After 20 hours or so of uptime, Internet Explorer (and dexplorer.exe) become so unresponsive as to require a reboot. Is this just me?
I’m starting to wonder what impact Avalon will have on the makeup of software development teams. These days, you can bang out a UI that competes with Microsoft Office applications (in terms of look and feel) as a solo developer. Taking a look at the Longhorn concept videos reminds me of the gaming industry. If you look at the postmortems for today’s best selling games – the skills required go far beyond bit twiddling. The teams usually have half as many graphic designers and artists as there are developers. Plus sound FX people, camera people, voice-over people, and an occasional composer.
Post build steps do not appear to function as yet in Whidbey.
It appears the automagic copying of app.config and COM interop assemblies does not function as yet in Whidbey. I also had some difficulties successfully referencing an interop assembly until I TLBIMP’ed it myself and added a reference by hand.
The app currently does all the work on the UI thread. I didn’t see an Invoke method on the Control class to marshal back to the UI thread, so I abandoned my plan to use a background thread for the VSS automation calls. I did notice the UIContext parameter on the control constructor, which is new, so I’ll need to dig around some more.
Databinding with the GridPanel control? The app currently builds the GridPanel from scratch in the C# code. The next step is to read more about databinding in Longhorn – I’m looking for something similar to today’s DataGrid in Avalon with sorting built in.
Is there an Avalon status bar control?
I’ve heard there is another version of Whidbey coming along soon to play with, but I’m also wondering when there will be another rev of Longhorn to experiment with. Overall - a fun experience with the new technology.