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

June 2004 - Posts

Firefox and Mozilla search plug-ins for SharpToolbox

I have created Mozilla-Search plug-ins for SharpToolbox.

I tested them with Firefox 0.8/0.9 and Mozilla 1.7. You can install the plug-ins using the following page.

Let me know if everything's OK or if you have problems.
Search results do not appear in Mozilla's Search Sidebar. If you have any idea why, please help :-)

Update: search results appear correctly in Mozilla's Search Sidebar now.

Symposium DotNetGuru 2004

Réservez dès aujourd'hui votre journée du 8 octobre !

Au plaisir de vous y retrouver.

Demo TV

In case you need some entertainement for the week-end, you can watch great demos. All this online, without downloading EXEs or installation, just with Winamp.

You can turn to http://www.scene.org for more downloads, or even internet TV: Yodel broadcasts 24/7 demos from then and now at: http://62.65.8.228:8000/;stream.nsv (winamp)

[Frans Bouma]

Souvenirs, souvenirs...
Do you remember groups like Future Crew?

Posted: Jun 26 2004, 11:51 PM by Fabrice Marguerie | with no comments
Filed under:
Associating string values to items in code

In a comment to my previous post about advanced enums, Chris Martin provided code for a custom attribute as a solution.

In fact I use something similar to associate string values to class or class members. See my StringValueAttribute class.
This works the same as Chris' implementation, and allows things like:

enum Colors
{
  [StringValue("#FF000")]
  Red,

  [StringValue("#00FF00")]
  Green,

  [StringValue("#0000FF")]
  Blue
}

Color color = Colors.Red;
Console.Write(StringValueAttribute.GetValue(color));

Too bad we can associate only scalar types, as strings or integers, and not objects...

C# feature request for Anders

Hello Anders,

Could you add to C# support for things like this?

enum Colors {Red, Green, Blue};
string[Colors] htmlColors = new string[] {"#FF000", "#00FF00", "#0000FF"};

This is something we have in Delphi (you remember Delphi, don't you?) that I miss in C#. I don't think it would be difficult to add to the compiler. But if we don't have it yet, maybe there is a problem somewhere?

Of course, we can find more examples where this syntax would help, and not only with strings.
If we go a bit further, we can even imagine something like this:

enum Colors<string> {Red = "#FF0000", Green = "#00FF00", Blue = "#0000FF"};

Let me know what you think,
Yours truly,
Fabrice

Patcher: easy assembly patching

This is an idea I had some time ago. I think this picture speaks by itself:

The idea is about a tool that would allow easily patching code (remove, add, update).

Typical scenario: you have this DLL (assembly) you'd like to modify to add some tracing code, but you don't want to (or can't) go back to the source code.
You can also think of this as Edit&Continue for every assembly...

Read more...

Tabbed MDI and Grid controls for Windows Forms

Here are some solutions I found for Tabbed MDI (à la Visual Studio .NET). If you don't know what I'm talking about, just click on the links, you'll immediately understand!

They all look great, but I haven't tried any...

Need advanced Grid controls for you Windows Forms applications? Here are some, to list just a few:

Mozilla Firefox 0.9

Mozilla Firefox 0.9 is out.

New:

  • Extension Manager
  • Theme Manager
  • Data Migration/Import
  • New Visual Theme
  • Better Bookmarks
  • Better Search
  • Smaller Download
  • Online Help
Posted: Jun 15 2004, 11:44 PM by Fabrice Marguerie | with 2 comment(s)
Filed under:
lock potential hazards

As a follow-up to my previous post about the Singleton design pattern potential hazard, I think it is useful to point out another potential hazard in multithreading scenarios.

Some solutions for the implementation of the Singleton design pattern are using a construct such as the following:

lock (typeof(MyType))
{
  ...
}

This is not a good idea as it can cause problems, as the .NET Framework SDK documentation explains:

In multithreading scenarios, do not lock Type objects in order to synchronize access to static (Shared in Visual Basic) data. Other code, over which you have no control, might also lock your class type. This might result in a deadlock. Intead, synchronize access to static data by locking a private static (Shared in Visual Basic) object.

The bad news is that this is the help for the Type class, and not for the lock keyword. The help for the lock keyword (here and there) does not talk about this.

Links about Domain-Specific Languages (DSL)

In case you need something to read this week-end (I'd like to find some time for that), here are some interesting weblogs, articles and web sites about Domain-Specific Languages (DSL).

Domain-specific languages are programming languages that are dedicated to specific application domains. They are less comprehensive that general-purpose languages like C or Java, but much more expressive in their domain. As a result, they have properties that are crucial for the software industry:

  • Productivity: programming, maintenance and evolution are much easier (in some cases, development time can be ten times faster); re-use is systematized.
  • Verification: it becomes possible or much easier to automate formal proofs of critical properties of the software: security, safety, real time, etc..

[Compose project]

More Posts Next page »