Fabrice's weblog

Tools and Source

News


Read sample chapters or buy LINQ in Action now!
Our LINQ book is also available on AMAZON

.NET jobs

Emplois .NET

The views expressed on this weblog are mine alone and do not necessarily reflect the views of my employer. The content of this weblog is independent from Microsoft or any other company. transatlantys hot news

Contact

Me

Others

Selected content

November 2004 - Posts

Re-throwing exceptions with variants of throw

At least a clear explaination of the difference between "throw;" and "throw ex;". Thanks Oleg.

[via Jackie Goldstein]

Posted: Nov 30 2004, 05:47 PM by Fabrice Marguerie | with 2 comment(s)
Filed under:
Big media and technologies melting pot

Did you notice how the different media and technologies are converging?

We have:

  • movies + computer graphics (almost every movie is concerned if we take special effects into account)
  • internet + games (is an example really needed?)
  • games + movies + animation (Machinima, Half Life 2 - chef-d'oeuvre!)
  • internet + radio (SHOUTcast)
  • internet + phone + TV (Free)
  • computer + phone (Skype)
  • computer + books (still not really catched on, we're waiting for the electronic paper...)
  • internet + music (remember that Napster thing?)
  • internet + pictures (c'mon, we all know pix from your last holidays are online somewhere!)
  • computer + music + pictures + video (personal computer is hosting all digital media)
  • phone + photos + video + music + text + internet (new phones)
  • ...and a lot more combinations (which would also include news and e-mails, for example)!

Hard to think of an appliance or technology that is dedicated to one thing only nowadays.
According to you, what's coming next?

Nouveau site sur la BD : Clair de Bulle

A tous les amateurs de BD, un nouveau site sur la bande dessinées est né ce week-end : Clair de Bulle.

Chaudement recommandé ;-)

Posted: Nov 29 2004, 12:31 PM by Fabrice Marguerie | with no comments
Filed under:
Copy Constructors vs ICloneable

Shawn A. Van Ness presents various approaches for cloning objects, problems with ICloneable, and of course solutions. The discussion mainly revolves around copy constructors vs the ICloneable interface.

An interesting read because cloning is a common task... well for software objects at least.

Updated HTTP module for URL redirections
I updated my HTTP Module for redirections, adding support for ignoring case. See the ignoreCase attribute.
ASP.NET HTTP module for URL redirections

For my own web sites, I needed to perform multiple URL rewritings, both in order to get short URLs and to charm Google and friends. You can see this at work for the SharpToolbox for example.
I improved Fritz Onion's HTTP Module, which performs redirects based on entries in your web.config file. It is regular expression-based, and is an easy way to perform automatic redirection for one set of URLs to another in your site.

I improved performance by keeping Regex instances, and added support for the ~ character.

Here is what the config file can look like:

<redirections type="Madgeek.Web.ConfigRedirections, Madgeek.RedirectModule">
 
<add ignoreCase="true"
   
targetUrl="^~/FalseTarget.aspx"
   
destinationUrl="~/RealTarget.aspx"
/>
 
<add permanent="true"
   
targetUrl="^~/2ndFalseTarget.aspx"
   
destinationUrl="~/RealTarget.aspx"
/>
 
<add
   
targetUrl="^~/(Author|Category|Tool)([A-Za-z0\d]{8}-?[A-Za-z\d]{4}-?[A-Za-z\d]{4}-?[A-Za-z\d]{4}-?[A-Za-z\d]{12}).aspx$"
   
destinationUrl="~/Pages/$1.aspx?$1=$2"
/>
  <add
   
targetUrl="^~/SomeDir/(.*).aspx\??(.*)"
   
destinationUrl="~/Pages/$1/Default.aspx?$2"
/>
</redirections>

I joined a small demo to the source code. Download.

Update: 2004/11/19 - added support for ignoring case. See the ignoreCase attribute.
Update: 2005/05/12 - works with .NET 2.0, you just have to replace the calls to ConfigurationSettings.GetConfig() by calls to the new ConfigurationManager.GetSection()

Manipulating .NET assemblies

Guys from the Operating Systems and Middleware Group at HPI (University of Postdam) have collected links to APIs and libraries to manipulate PE files, access metadata and IL.

Joel Pobar from the CLR team gives more details and also writes about the new features part of Whidbey regarding reflection.

There is also introspection.

More Posts