Sunday, April 5, 2009

MacHeist – Two Days Left

April 05, 2009 Posted by Jason Irwin , , , No comments

This morning MachHeist (link) reached $400,000 donated to charity – thereby unlocking BoinxTV (valued at $189) for everyone (myself included) who purchased the bundle. The next unlock comes at $500,000 and with two days remaining in this year’s MacHeist will likely be reached…unlocking The Hit List and Espresso.

If you’re looking for some very reasonably priced Mac Software and like supporting good causes (25% of every purchase is donated to charity – you can even choose which of the listed charities your money goes to) then I suggest you get on down to MacHeist for a really great deal. MacHeist

Saturday, April 4, 2009

Visual Studio 2008 – PowerCommands Woes

April 04, 2009 Posted by Jason Irwin , , 1 comment

Today Visual Studio 2008 started crashing every time I attempted to open a specific XAML file. Ungracefully, the IDE shut down without warning, again and again and again…

Checking the event viewer I found the following error message:

The remote debugger is unable to communicate with Visual Studio, and must abort the remote debugging session. Please restart debugging.

The only recent update to my configuration is the installation of PowerCommands (link), an extremely useful toolkit that boosts (my) productivity by adding some additional commands to the IDE (other than this bug, it is definitely something I recommend checking out).

With this error message and hunch in hand, I set out to find the root of the problem and came across the following discussion on MSDN (discussion link), providing the following solution:

Using notepad (with elevated permissions in Vista/Windows 7) open the devenve.exe.config file in the path appropriate to your installation:

  • C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE – x86 path
  • C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE – x64 path

Add the following code to the assemblyBinding section of the config file:

<dependentAssembly>
   <assemblyIdentity name="Microsoft.PowerCommands" publicKeyToken="null" culture="neutral"/>
   <codeBase version="1.1.0.0" href="C:\Program Files (x86)\PowerCommands\Microsoft.PowerCommands.dll"/>
</dependentAssembly>


This solved my (and, if you got here from google, hopefully your) problem!

Friday, April 3, 2009

Free iPhone Goodness from Stanford University

April 03, 2009 Posted by Jason Irwin , , , , , No comments

A little while back I posted about going back to basics with Stanford School of Engineering computer Science lectures. Well, today things got a little sweeter for many of us interested in developing iPhone applications. As you may know, a while back apple dropped their NDA requirements for iPhone developers and today Stanford’s iPhone Application Programming class (CS 193P for those interested) was made available as a screencast through iTunes. Lecture 1, as expected, starts with the basic and is entitled ‘Intro to Mac OS X and Cocoa Touch’. I, for one, will be making full use of these classes – homework and all :o). For anyone interested, the class can be found here. Bon appetite.

sp_MSForEachTable

April 03, 2009 Posted by Jason Irwin No comments

I came across an interesting undocumented T-SQL command that I thought I would share. I wanted to refresh my testing environment and remove any tables in a given schema. My goal was to clear out everything before running my creation and data initialization scripts. Previously I have queried the INFORMATION_SCHEMA views in order to generate my delete queries, but the undocumented sp_MSForEachTable command provides a fantastic way of doing this in a single command (not counting disabling referential integrity…)

  1: -- disable referential integrity 
  2: EXEC sp_MSForEachTable 
  3:     @command1 = "ALTER TABLE ? NOCHECK CONSTRAINT ALL", 
  4:     @whereand = "and uid = (SELECT schema_id FROM sys.schemas WHERE name = ‘my_schema’)" 
  5: 
  6: -- drop tables 
  7: Exec sp_MSforeachtable 
  8:     @command1 = "DROP TABLE ? PRINT '? dropped'", 
  9:     @whereand = "and uid = (SELECT schema_id FROM sys.schemas WHERE name = ‘my_schema')"
 10: 


In two commands I was able to disable referential integrity on and drop all tables in the my_schema schema. Similarly, to get the size usage details for every table in the same schema, I simply use the following command:



  1: Exec sp_MSforeachtable     @command1 = "EXECUTE sp_spaceused [?];", 
  2: @whereand = "and uid = (SELECT schema_id FROM sys.schemas WHERE name = ‘my_schema')"
  3: 


A similar procedure exists to iterate through databases (sp_MSForEachdb) but I have not yet found an in-built version for views/procedures/etc.



Not rocket science, but a handy timesaver nonetheless!

Thursday, April 2, 2009

VS2008 Woes - An attempt was made to load a program with an incorrect format.

April 02, 2009 Posted by Jason Irwin , , 1 comment

Having recently re-imaged my PC, I attempted to load up a Visual Studio 2008 project that I haven’t touched since the build. It is a simple ASP.NET solution with three sub-projects. Attempting to build the application I received the following error:

Could not load file or assembly MyAssembly or one of its dependencies. An attempt was made to load a program with an incorrect format.

This one took me by surprise and the provided stack trace was of no use. Performing a quick google I came across the following post on Mark’s Blog of Random Thoughts:

Platform type observations..

The post pointed at the platform type (said so in the name) and issues with building for x86 VS. x64. It didn’t make sense in my context – I am using the exact same PC, exact same OS, exact same platform… - but I figured it was my only lead and, for each project in my solution set the Platform target to x86. Lo and behold, I’m back in business.