RE: Disabling Windows Authentication in Visual Studio 2005’s built-in ASP.NET server

File this one away…

Here’s a handy trick I learned today after attempting to test my ASP.NET site in Opera and found it wouldn’t work.

Opera does not ship with support for Windows Authentication (NTLM). By default, Visual Studio 2005’s ASP.NET Development Server demands that you authenticate with Windows Authentication. To disable this requirement, do the following:

  1. In Solution Explorer, right-click on your Web Application’s project node and select Property Pages
  2. Under the Start Options node, uncheck NTLM Authentication and click OK

And that’s it! This also has the effect of removing that annoying authentication dialog in Firefox.

[Via Managed from down under]

RE: Thread-safe Format

Oh, the joy of writing multiple threaded applications. I like this little tip that will keep string formatting calls from stepping over each other.

The Format function isn’t thread-safe unless you use the overload which takes a FormatSettings argument (because the FormatSettings-less version uses global variables). I use it to compose error messages in a thread I’m writing, and I want to use the same FormatSettings as the user would normally see in a GUI app. So here’s what I did. I added a TFormatSettings field to my thread class:

TMyThread = class(TThread)
FFormatSettings: TFormatSettings;
procedure Execute; override;

Then I set it at the start of the Execute method:

procedure TMyThread.Execute;
GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, FFormatSettings);

This seems to work well.

[Via Craig Stuntz’s Weblog]

RE: Strings are immutable

Sahil has a good post that explains why you should use StringBuilder to concatenate strings instead of just doing “string a” + “string b”

So lets see now, look at this code below —


str = “Sahil ” + “is” + ” a” + ” modern” + ” man”;

So right in the code above, how many times did the memory get allocated, and then de-allocated? Dude in the above code, first the framework will declare memory for all 5 strings, and as you concatenate them, it will have to reallocate, and copy memory all over, and over, and over and over again until it gets the final “str”. This is why, you should use StringBuilder – because that is not an immutable object. It has the ability to reuse the same memory.

Now this has other implications too, but as long as you remember to say “Strings are immutable” and sufficiently explain what you meant by that, your interviewer will be more or less happy.


[Via Sahil Malik [MVP C#]]

Delphi Basics

Here’s a cool site that has a lot of reference information for Delphi.

This web site provides help and reference for the fundamentals of the Delphi© language. It is gives an introduction to the Delphi Object Oriented Language for newcomers, and provides a ready reference for experienced programmers.
It limits itself to a broad base of the language in order to keep things simple and manageable. The approach taken is to present the most useable basics of Delphi in as accessible a manner as possible.

And now, a word from Phil…

If you want a refreshing take on the current state of Google, Microsoft, Flikr, and of course, Open Source, you have to read this rant from causticTech.

…we are in the software equivalent of elvis in his vegas years…fat, bloated, barely functional…

It’s good stuff, but not for the easily offended.