CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Peter's Gekko

public Blog MyNotepad : Imho { }

October 2004 - Posts

  • Petition for a text update on the DNJ

    I have been a regular complainer about the Text engine. Blogging is fun but the error messages text keeps throwing at you are really spoiling that. According to Stefano, in a comment to my complaint, an update world fix a lot.

    So, please, please, update.

    Spread the word!

    Peter

  • What's new in the .TEXT technology ?

    According to the site we have “new .TEXT technology”. But the dreaded error message “parameter allready in another collection” keeps popping up. Almost every posting results in “Post failed, the sqlparamter..bla,bla” But almost every time the post appears to have succeeded... So, what's new  ?

    Peter

  • Using Firefox (and IE) to debug your apps in Visual Studio

    The demand for Firefox is rising. If I may repeat my favourite feature: increasing and descreasing fornt size with ^+ and ^- is a delight for my eyes. Almost saves me from a new pair of glasses. It would be nice to start using FF in Visual Studio when building the app. Which is not that difficult but took some searching. Let me share with you how to set up FF in VS (2003).

    • In the file menu is a “browse with“ option. Select this.
    • Add Firefox to the list of supported browser and check “default“

    In the options of your project set “always use IE“ to false

  • That's all.

    Now FF wil be the default browser when you launch your app from VS. Breakpoints and everything work as usual. When your project leans heavely on IE, for instance because you don't want to miss smart navigation, you can instruct VS to keep using IE on a project basis. When you drop IE you also drop the possibility for remote debugging. But that's something I had already given up.

    Peter

  • "You've Earned Your ASP.NET Gifts"

    It's ASP.NET webcast week. The sessions offered looked really good so I signed up for a couple. The idea is to be an on-line part of the show and when you visit 3 or more MS will send you a book and/or an express version of VS. When registering I had to cheat to fill in my address. US/Canadian only ? Come on, in Europe (and Australia !) we're also part of the civilized world. The whole registration process was a mess. In the end I had apparantly signed up twice. Trying to see the show was another mess. The site adds alerts to your Outlook. They fire but make you wonder what time it is in Redmond. Nevertheless I made it to enter a broadcast. Well that is, I saw a lot of error messages and some power point slides. That was all. Perhaps because is was a remote desktop ?

    But, yesterday my inbox had a message "You've Earned Your ASP.NET Gifts". Twice. For the effort ?

    Peter

  • DotNEd, the Dutch user group, celebrates its second birthday

    Missed the last dotned meeting. But there is another one coming up. Thursday, october 28th. Register here, it's free ! It will be a special meeting to celebrate the 2nd aniversary of the UG. Speakers will be

    • Christan Weyer from thinktecture doing 'File - New - Project - ASP.NET Web Service' and 'Add Web Reference' reconsidered - extending .NET's Web Services functionality  
    • Ernst Raedecker on databinding

    Going to be good. See you there

    Peter

  • needscripts ?

    This week I got a message that my link was approved at needscripts. Took a look over there and it seemed OK. It was a link to an article of mine on the dnj. The only thing is that I never requested this link myself ? Or did I ? When ? How ?

    Anybody got any experinces with this site ?

    Peter

  • Shared (static) members and global variables

    Every time I try to explain shared (static) members I end up in a discussion over global variables. Usually the discussion goes like this : “Hey I just heard there are no global variables in .NET and now I don't see the differnece between MyGlobalvar and MyCalss.GlobalVar”.

    I have several answers :

    • A shared member has identity. It is member of typeX.
    • The shared members does not exist without the type is a member of
    • Public types are “global” to your application. And also to any code referencing the class.
    • Not every type is public
    • Not every shared member is public

    These don't convince everybody. Does anybody know of a simpler way of explaining the difference ?

    Peter

  • The right type (of a Linksys access point)

    In a further step to clean up my office I threw out a lot of outdated equipment out to replace it with one box.

    I threw out:

    • A broadband router/dhcp server. Chinese stuff, three years old and by now drowning in the tremendous speed of our @home ISP
    • An 8 port switch. Chinese  stuff, three months old. Still fine
    • An 11 mbps wifi access point. Chinese stuff, did not cover every corner of the house and was in continuous batlle with the onboard 54 Mbps adapter of my tablet.
    • About 10 metres of cabling
    • 3 power supplies

    All of them replaced with a single Linksys access point. No doubt made in China as well. The point of the post is that I almost bougth the wrong one. Almost got myself a WR54G but ended up with a WRT54G. The difference is one letter, the built in router and 2,5 euros including VAT. That's easy to overlook in the enormous variety of models available.  The router is quite essential.

    I'm not going to delve into the details of the thing itself. Just great, easy to setup and works like a charm. A complete (inter-) net- work, just plug or broadcast in with anything at all.Recomended !

    Peter

  • Linuxworld

    As I'm allways open to cross-anything and had been reading good things about Mono I wanted to get an idea of the Linux world over here. So I paid a visit to Linuxworld (asp-site :>). It was supposed to be the big tradeshow on Linux. Quite disappointing. The show was combined with storage-world and infosecurity.nl. Just a couple of boots with Linux stuff, the main thing they had on display were things like VM -ware and server distributions. Talking about Mono did not ring many bells. Talking about any application development at all was hard. It all reminded me very much of the world of system-administrators. Most I know do care about their network but don't give a damn about user demand for real applications.

    Was today a waste of time ? Not really, now I know I will not give that much attention to Linux for the coming time. Which saves time :) I'll stay a Mono-theist with Windows.

    Peter

  • Generics C# and VB 2005

    With some amusement I have read the recent threads on VB versus C#. My stand is quite simple, it's the framework not the language. My personal favorite is C#, Pascal, VB, Simula, you name it. All except Simula (?) are available for .NET. I have to admit I like C# best but that is just a matter of taste, for the moment I have my reasons to focus on VB. VB 2005 has many new language features, more than C#. Working with generics I used some of these to write some “real C#-style” code in VB.

    Generics are a nice way to work with typed collections. In a project I have a number of classes, all having the Car class as base class. Coding a generic collection in C#

    Collection<Car> myCars;
    myCars:= new Collection<Car>();

    and in VB

    Dim MyCars as Collection(of Car)
    MyCars = new Collection(of Car)

    There is more you can do with generics. Take a generic CarWash class which washes cars and maintains a collection of washed cars of a give subtype. This generic class has two type parameters, one for the type it will wash and one for the type it will list. Coding the class in C#:

        public class CarWash<CarToWash, CarToList>
            where CarToWash : Car
            where CarToList : Car
        {
            private Collection<CarToList> carList;

            public CarWash()
            {
                carList = new Collection<CarToList>();
            }

            public void Wash(CarToWash thisCar)
            {
                CarToList dirtyCar = thisCar as CarToList;
                if (dirtyCar != null)
                {
                    carList.Add(dirtyCar);
                }
            }

        }

    The class uses the CarToList type parameter to type the collection. It also uses the type parameter to test a car object against it with the as operator. As tries to convert an object to the type, when this fails the object is set to null. As is favorite operator of mine. Delphi has it as well.

    But you can code the same in VB 2005 with the new TryCast function

    Public Class CarWash(Of CarToWash As Car, CarToList As Car)

        Private TheList As Collection(Of CarToList)

        Public Sub New()
            TheList = New Collection(Of CarToList)
        End Sub

        Public Sub Wash(ByVal TheCar As CarToWash) 
            Dim DirtyCar as CarToList = TryCast(TheCar, CarToList)
            If DirtyCar IsNot Nothing Then
                TheList.Add(DirtyCar )
            End If
        End Sub

    End Class

    The TryCast function, new in VB 2005, behaves just like the as operator. Note also the new IsNot operator.

    All cool stuff here is not in the languages but in the framework itself. If you want to bash VB first take a look at all the changes from VB 6 to VB.NET and the many new features in VB 2005. You have to C really sharp to spot the difference.

    Peter

  • (Dramatically) improving the performance of virtual (sp2) PC

    To start with a disclaimer: I did not find this out myself. It was posted sometime last week on the dnj. I can't find it again, if anybody recognizes the post, please tell so. The guy needs a statue. May I repeat it ?

    <Update>
    The original post I read was by Jon Galloway on the asp.net blogs. Geoff had been pointing to it as well. That makes two statues. :>
    </Update>

    Virtual PC does have some overhead. But some of the last machines I created were sluggish inresponsive creatures. And they stayed like that regardless of the amount of RAM and processor resources they were given. These were virtual XP sp2 machines. The problem with them appeared to be the virtual machine additions. These improve interaction with the hosting OS and performance. Installing them is an option in the Virtual machine's menu.

    Virtual PC has two related products, Virtual PC for the mac and now there is Virtual Server. The virtual hard disks created by the products are compatible. And so are the virtual machine additions. The additions coming with virtual server are an enormous improvement. They did magic to my virtual machines. An update of virtual PC will be out some time soon. For the moment you can upgrade you machines this way.

    1. Download the virtual server trial
    2. Part of the program installed is a Virtual Machine Additions folder
    3. Load the ISO file found there in the CD drive of your virtual PC
    4. Let the setup do its work
    5. The setup will notify you it is upgrading the additions.

    After resetiing the virtual machine it runs so much better. For an sp2 machine the results are no less than dramatic. Absolutely recomended.

    Peter

More Posts