Richard Szalay

Sunday, August 10, 2008

Braid

I try to keep my blog programming related (for some reason), but I feel I have to bring to light to that one guy somewhere who reads my blog a new game for Xbox Live Arcade that came out last week called Braid, and it's a difficult game to explain without selling short.

In its simplest form, Braid is a time-based puzzle platformer, but it is so much more than that. What it is, is the closest thing to art I've seen in a video game in a long time. The levels are water painted and swirl and shimmer in a subtle way that gives the feel of a dream. The music is beautifully orchestrated and is perfectly matched with the visuals (and even sounds good playing in reverse while you reverse time). The story is enigmatic, philosophical and deep. Who thought a 2D platformer could leave you thinking?

Last, but not in the slightest bit least, the gameplay is addictive as hell. Each stage has some of the greatest puzzles involving time I've ever seen. I think what is different in Braid is that time control is not a gimmick tacked on but the center of the game itself. For example, its impossible to die. When you are hit by an enemy or fall into a spike pit you simply reverse time. Once you get used to the mechanic, you'll discover that the game is only 30% platformer and 70% puzzler.

I can't really say anymore without spoiling anything (story or puzzle) but all I can do is strongly recommend you download the demo. At 1200 points it's pretty steep but the demo gives you a good preview of the types of puzzles and a gimpse into the story. It might not be everyone's cup of tea but for me it may just be one of the greatest games I've ever played.

Thursday, February 28, 2008

FTP for IIIS7 RTM

The replacement for the FTP service in IIS 7 that I mentioned recently has just been released. Click through to download in x86 or x64.

Labels: ,

Tuesday, February 26, 2008

SQL 2005 XML DML cannot make multiple changes to the same value

With the advent of xml columns in SQL 2005, I was looking forward to the data manipulation that XML Data Manipulation Language (DML) provides.

Unfortunately, it appears that the implementation is horribly limited in that it cannot make an arbitrary number of modifications to the same value in a single update. Take the example below, where we attempt to insert one node for every value in @IntData (3 total) into the xml column of our first row in @XmlData.

DECLARE @XmlData TABLE (ID INT NOT NULL, Data XML NOT NULL)
INSERT INTO @XmlData (ID, Data) VALUES (1, '')

DECLARE @IntData TABLE (ID INT NOT NULL)
INSERT INTO @IntData (ID) VALUES(2)
INSERT INTO @IntData (ID) VALUES(4)
INSERT INTO @IntData (ID) VALUES(6)

SELECT XD.Data, INTD.ID
FROM @XmlData XD
CROSS JOIN @IntData INTD

UPDATE XD SET Data.modify('
 insert <Node value="{sql:column("INTD.ID")}" />
 as last into /
 ')
FROM @XmlData XD
CROSS JOIN @IntData INTD
WHERE XD.ID = 1

SELECT Data FROM @XmlData

As you can see from the output, the cross join returns 3 records but the update only inserts one node. The only way around this is to use a cursor, which is a shame. Here's hoping that they fix that up in SQL 2008.

Labels: ,

Tuesday, February 19, 2008

Toshiba Announces Discontinuation of HD DVD Businesses

Toshiba has officially discontinued the HD DVD business, resulting in the end of the format war that was helping nobody.

Although this comes as no surprise to anyone, I've always preferred HD-DVD as a format. Oh well, no use being sour grapes; at least we are down to only one format.

IIS 7 FTP Publishing Service

The replacement for the FTP service in IIS 7 is almost here, and it's looking better everyday.

Although still only a release candidate (RC0), the new service supports a myriad of new features:

  • FTP over SSL
  • Membership Providers
  • UTF8
  • IPv6
  • (Significantly better) User folder isolation
  • Hostname support (ie. multiple sites on the same port)

The FTP service can also be added as a module to a website, logically binding a website to its FTP site.

In addition, FTP also brings the IIS Managers Service to the table. The IIS Managers Service is basically an IIS specific membership provider that allows creation of users with access to modify an IIS Website or upload to an FTP but without having a windows user counterpart (which means they can't log in to the machine.

I for one am looking forward to the day when IIS7 is commonplace amongst hosting companies.

Labels: ,

Monday, February 18, 2008

Advanced Debugging Lab Series

Over the past few weeks Tess Ferrnandez, an escalation engineer at Microsoft, has been releasing the first of her 10 part series of labs advanced ASP.NET debugging. At the time of writing there are three labs covering Hangs (deadlocks), Crashes, and Memory Leaks.

I really can't recommend these labs enough. Not only do they take you through step by step on how to look at the problems, but each lab asks you questions (eg. "What thread owns the lock?") that are later answered in a review post.

Absolutely top notch quality so far and I am really looking forward to the rest of the series.

Labels: , ,

Microsoft opens the binary formats and starts an open source conversion project

As part of their Open Specification Promise, Microsoft have finally released documentation for their binary office formats (DOC, PPT, XLS). Additionally, they have started an open source project to convert these formats into their respective 2007 package formats.

I've gotta say, this has taken me quite by surprise. I had always assumed that the binary formats would be ignored now that the new model is so easily accessible from code. Just my luck that it comes out about 18 months after I could have really used it.

Stupid word automation.

Labels: ,

My first gripe with Vista

I've been using Vista for quite a while now and I often defend it in the face of naysayers. For example, I am 100% behind Microsoft when it comes to people complaining that their applications don't work in Vista because, frankly, it means the developers of said applications chose not to read the countless documents available on running as least privilege.

It's somewhat fitting, then, that my actual peeve is entirely Microsoft's fault: Despite Windows Vista Home Premium being suitable for web developers (it comes with IIS7, albeit without a kerberos/ntlm authentication module), it seems that the Vista product managers, in their infinite wisdom, decided that the Local Users and Groups MMC snapin was more than the Vista HP user could handle. What's worse, IIS uses an account (IUSR) that I cannot manage (from a group membership perspective) because its not an account that's shown in the control panel sections. Seriously, that's just poor form.

Obviously the APIs are still there, so I wonder if there is an opensource MMC snapin that replicates the functionality out there. If anyone is aware of one, please let me know.

End Rant

Labels: ,

Monday, January 28, 2008

Preventing application configuration inheritance in ASP.NET

It's an extremely common problem: you create a virtual directory to house a supporting application, but accessing it throws an exception because it is trying to initialise the httpmodules/httphanders from the root application. Attempting to <clear /> them doesn't work because the clear happens after they are added, which means they need to exist in order to remove them.

Thankfully there is a solution. Introduced in .NET 2.0, the SectionInformation.InheritInChildApplications property, when set to false, stops the runtime from even attempting to load anything from that location when in a child application (like a virtual directory).

Now, as SectionInformation maps directly to the <location> configuration element, it means the offending sections will need to be wrapped in a <location>. When referring to the root application, you can either leave out the path attribute or assign it to "."

What is strange is that the inheritInChildApplications attribute is not document on the location Element MSDN page, or is it in the schema that is included in VS.NET. This would explain why its existence is not common knowledge

For clarity, I have modified the default web.config template to include the change

<?xml version="1.0"?>

<configuration>

  <appSettings/>
  <connectionStrings/>

  <location inheritInChildApplications="false">
    <system.web>
      <!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
      <compilation debug="true" />

      <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
      <authentication mode="Windows" />
      <!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
    </system.web>
  </location>
</configuration>

Labels: ,

Friday, October 12, 2007

SmoothAttach Release Candiate

I have just finished uploading the Release Candidate of my SmoothAttach AddIn for Visual Studio.NET 2005 to SourceForge. Please download it and tell me what you think!

SmoothAttach simplifies attaching the debugger to an IIS website, and is particularly handy in multiple website/AppPool environments. How SmoothAttach helps you depends on which version of IIS you are running:

  • On IIS 6 (Server 2003), SmoothAttach automatically determines which w3wp.exe process is assocated with your website or Application Pool and attaches to it. It even starts it if its not running.
  • On IIS 5 (XP), SmoothAttach automatically stops all other websites and starts the website you need to attach to.
  • While IIS 7 (Vista/Server 2008) is theoretically supported it has not been tested.

Please add any bugs or feature requests to the sourceforge project page.

Labels: , , ,