My Software : Comments and observations related to the usage and installation of softwares on my systems.
Updated: 2007-02-01; 08:49:32.

 

Subscribe to "My Software" 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.


Categories: (Check them too. My content isn't all on the main page)

Knowledge Management
Technology
My Hardware
My Software
En français!
Top 20 topics!


Currently reading:

The Second World War, Volume 1: The Gathering Storm by Winston S. Churchill

Beginning Linux Programming (Programmer to Programmer) by Richard Stones and Neil Matthew



www.blogwise.com

Male/31-35. Lives in Canada/Ontario/Ottawa/Manor Park, speaks French and English. Spends 80% of daytime online. Uses a Faster (1M+) connection. And likes Cooking/Reading.
This is my blogchalk:
Canada, Ontario, Ottawa, manor Park, French, English, Male, 31-35, Cooking, Reading.


The Political Compass: Economic Left/Right: -3.50
Authoritarian/ Libertarian:
-2.26


Technorati Profile
Popdex Citations



 
 

5 avril 2003

Cool blog entry from Craig Andera.

[Craig Andera]

A question that comes up occasionally on the mailing lists revolves around how to manipulate arrays of things. The problem is that once created, arrays can't change size. But what if you don't necessarily know how big it'll be right off the bat. Here's my favorite way to deal with arrays.

ArrayList al = new ArrayList();

 

for (loop over some set of things)

{

  al.Add(thing);

}

 

Thing[] things =

  (Thing[]) al.ToArray(typeof(Thing));

In other words, System.ArrayList is a convenient way to keep track of a list of things that you can later turn into an array.

Even better is the fact that you can construct an ArrayList from any array, like so:

ArrayList list = new ArrayList(things);

And you can remove a particular item like this:

list.Remove(particularThing);

Combine these three things, and you have a convenient way to remove an item from a list: turn the array into an ArrayList, remove the item you care about, then turn it back into an array. Or use Add instead of Remove, and you've got a convenient way to append things.

For those who've never used the ArrayList for this purpose, you will be amazed at the convenience of this.  I use this technique all time.  One case where I especially like it is where I have a class for which I don't want to go through creating a type safe collection.  I just use this technique to return an array of the type of the class back from the method where I use the ArrayList internally.  Obviously, you lose the benefit of checking at compile time type safety.  However, for an internal function where I know what I'm getting myself into, using this technique well worth it to me.

[.NET Weblogs]
Another useful trick to remember.

12:09:03 PM    comment []  - See Also:  .NET 

.NET hosting for free?.

http://www.dotnetplayground.com/

Great for testing stuff! 
No banners.  Supports code behind. Has support for MS Access but no SQL Server.

Can't beat the price!

[.NET Weblogs]
Could be useful

12:03:27 PM    comment []  - See Also:  .NET 

© Copyright 2007 Charles Nadeau.



Click here to visit the Radio UserLand website.
 



-->
April 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      
Mar   May


Google
Search the whole web!
Search Charles radio!


www.flickr.com


Top 5 artists I listen to the most often during the last week:


I subscribe to:

Here's how this works.


Weather in Ottawa:
The WeatherPixie
Weather in Fukuoka:
The WeatherPixie