The blogs of Black Marble staff

The Faint Smell of Popcorn, mmmm Popcorn

Wow Matt and I have just finished our presentation on Microsoft Volta Live Labs at the Irish Web Technology Conference , it is being held at the Cineworld complex in Dublin. Yes we did get to present on the Big Screen :) , it is totally surreal seeing your caricature displayed so big it is bigger than you ( Lauren's designs look even better 10' high , not that they don't look great when they are smaller , errr , I think my next caricature will be suddenly less flattering <sigh> ).

The presentation went well bar a technical failure necessitating laptop change midway through. I think we got the message that providing architectural level tools to match developer tools is as much a part of Volta as the JavaScript / il / browser implementations.

And with a short break , we also managed to fit in , LINQ , code quality and some other live coding demonstrations.

now off to attend some sessions and prepare to head home :)


Silverlight 2.0

As Ferris Bueller said "Life moves pretty fast".

Silverlight 1.0 was released last September, the first public beta of Silverlight 2.0 ain't that far away...check out Scott Guthrie's blog post here.

Calculation Settings in Excel

Sometimes Excel doesn't behave as you expect and you learn something. Excel is complex as Joel Spolsky pointed out last week.

Quite often clients will send data updates in Excel spreadsheets as this is the format they are used to working with; even if you as a programmer are not. One such workbook I have worked with this week had a worksheet with formulas to increment id's. The problem was the id's were not incrementing, even though the formula was correct.

After some investigation it turned out that the Calculation was set to manual (Tools -> Options -> Calculation Tab in Excel 2003), as shown below -

 Excel Calculation SettingsExcel Calculation Settings

"Automatic calculation" mode means that Excel will automatically recalculate all open workbooks at each and every change, and whenever you open a workbook - which is what I was expecting and wanted (if you are in "manual calculate" mode pressing F9 will update the formulas).

This "manual calculate" behaviour is by design and Excel tries to help you realise this by updating the status bar with the word "Calculate". In fact, as this behaviour is set by the first workbook opened, it may seem to randomly change depending on the sequence the workbooks are opened, and their settings.

As Joel Spolsky said in his article...

"Every checkbox, every formatting option, and every feature in Microsoft Office has to be represented in file formats somewhere."

Diagnosing referential integrity using TSQL

Quite often you work on databases that you didn't write. Getting up to speed on the structure of the tables and the relationships between them is not something you relish. The GUIs provided by SQL Server 2000 or 2005 don't always provide the best way, particularly with regard to complex referential integrity.

I've always used a few TSQL procedures to accelerate the process, and hopefully reduce the pain...

sp_help, returns information about a database object (any object listed in the sysobjects table), a user-defined data type, or a data type supplied by Microsoft SQL Server. There are quite a few "sp_helps", they are worth checking.

sp_fkeys, returns all tables that include a foreign key to the given table

sp_pkeys, returns primary key information for a single table.

'Aah, VSTO!' ... cooking up an OBA solution

I have been doing some Visual Studio Tools for Office (VSTO) development in Word of late, not exactly a pain free experience.

First thing to say is that even given all the marketing spiel, VSTO is not that different from VBA in older versions of Office.

To get going I create a new VSTO 2008 Word 2007 Template project based on an import of our old Word template (to get styles, layout etc.). I then basically cut and pasted the logic from our old VBA macros into an ActionPane in the new one and it just worked.

Well I said it just worked, I had out of habit I had picked a C# project, I should have chosen VB.NET (as is commonly recommenced for VSTO development) as then the code would have been virtually correct. As it was I had to spend a while adding {} and ; to do the language port.

So why did this work? VSTO is new(ish) any shiny and VBA is old and VB. However, they are both in effect wrapper APIs to the underlying Office COM Interop layer, so what they can do and how they do it is dependant on Office, in my case Word 2007. Ok you can do different things in Word 2007 to Word 2.0, but it is still in essence a Word processor where you manage content with ranges.

The reason people recommend VB.NET for VSTO development is due to the COM Interop. Visual Basic has always made it far easier to use COM objects, not least due to optional parameters and variant types.

Now as of yesterday some of these problems are addressed by the release of VSTO Power Tools and it COM wrapper API, but this API will certainly not address all issues.

Another thing that has has not changed over the years is the documentation, the MSDN references are OK but there is little is else. Especially when doing integration work with Sharepoint WebServices as I was. I have found I had to make heavy use of the debugger to investigate the XMLNode object being returned to work out that was going on.

In Word development I have commonly found that initially there are things I think I can't do because the object I need does not appear to be exposed by the object model; only to find what I am looking for in a place that is not that obvious to me. However you still have to use the object in some 'dark arts' style to get the effect you require. A classic example of this is managing programmatically the document cover page from the building block gallery. To get this to work there are many hoops to jump though.

VSTO is powerfully but not as flexible as you would hope as you have to live inside the design metaphor of the Office application you are hosted in. You have to consider carefully if the functionality you are trying to add is really relevant to the application it will be hosted in.

Microsoft DreamSpark

Anybody who has met me knows how passionate I am about teaching people to program and getting them to use their minds, Well Microsoft has excelled themselves , Any student in higher education can get

Visual Studio Pro 2008 , SQL Server 2005 , Expression Studio , Windows Server 2003 (Not sure on this one , but hey why not) , XNA Game Studio and XNA

Read More Here

I must say I think this is fantastic.


I love this world

Everyday I wake up,  I love the world we all live in even more ,  Technology marches on giving us the vital tools we have needed since the 1970's. Until today I wasn't looking for a new car but come to think of it although I have a newish car I feel the desperate need for a new one and a safari suit , curious.


Technorati tags: