The Wagner Blog
Development Notes, News and Trivia









Subscribe to "The Wagner Blog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.
 

 

Friday, March 07, 2003
 

Papersky is a cool short flash animation. Very nicely done. (its about 800KB).
7:28:43 PM    

Man arrested for wearing a Peace T-Shirt.

Cnn reports  that a man was arrested in a mall after putting on a T-shirt he bought there. What a damn mess this is! I'm beginning to see shades of Vietnam lately. On my commute home I crossed an intersection  that was crowded with some spontaneous protesters.


7:24:10 PM    

Rounding in .NET

Slavo mentions several discoveries about rounding numbers in .NET. It appears the framework uses what is called "bankers rounding" - aka rounding to the nearest zero.


6:55:35 PM    

Peter Blum's replacement for RegisterScript

Peter Blum explains RegisterScripts is a substitute for the System.Web.UI.Page class methods IsClientScriptBlockRegistered, IsStartupScriptRegistered, RegisterClientScriptBlock and RegisterStartupScript. It provides these enhancements to the process of registering scripts:

  • It fixes a problem with Microsoft’s methods where they are not always written to the page in a specific order. This WILL break order dependent client-side initialization code on pages where code and controls register 9 or more scripts. If you build a custom control that has ANY order dependent initialization code, in the field your control will break.
  • It allows you to omit <script> tags. It inserts them for you, often grouping several scripts under a common tag for better formatting and smaller page size.
  • It allows you to determine ordering on the page when scripts are dependant on others that come before them.

He also has a nifty class called AutoSortArrayList, which as he explains: fills a gap in the various collection classes offered within the Microsoft.NET framework. It maintains a list that is always sorted. The list does not use a key to identify each instance.
The .NET framework offers similar classes, each with shortcomings.

  • ArrayList - Can sort any type of object but cannot automatically add instances into the correct sorted position.
  • SortedList - Can keep any type of object in a sorted order. However, it demands a key for every instance. If you don't manage your objects by name, this won't work.
  • StringCollection - Can keep a list of strings without the requirement of a key. However, it can't keep them sorted.

AutoSortArrayList extends ArrayList by overriding methods that add, to automatically place objects in the correct position. You can turn on and off this auto sort functionality with a property.

It can sort any type of object, so long as that class implements the IComparable interface or you have a Comparer object. AutoSortArrayList has a property to assign your Comparer object. For instance, if you want to use AutoSortArrayList for strings, assign System.Collections.CaseInsensitiveComparer.


6:48:14 PM    


Click here to visit the Radio UserLand website. © Copyright 2004 Thomas Wagner.
Last update: 5/2/2004; 4:46:02 PM.
This theme is based on the SoundWaves (blue) Manila theme.
March 2003
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Jan   Apr