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

Peter's Gekko

public Blog MyNotepad : Imho { }

August 2003 - Posts

  • Be there or be square

     

  • DotNed flashmob

    Last night, august the 28th, I went for the first time to the monthly meeting of dotned, a Dutch .net user group. The meeting was in one of those 13 in a dozen hotels you are probaly all to familiar with. At first there was noone to befound but all of a sudden we were with 20 people listening to a quality presentation and having a quite interesting discussion. I was struck by the level of both presentation and discussion. In the presentation on plug-ins things like appdomains, reflection and attributes came by if they were plain vanilla. The code demonstrating them looked that way allright. Isn't .net great, the sofisticated things you can do with so little code. Do more with less, to speak with Microsoft. Most attendees were quite deep in .net and the discussion was great. All of a sudden the meeting was over and everybody disapeared into the night. Next month there is a new meeting. Absolutely recommended.

    There is one more thing I want to mention. Quite a few of the attendees had (a lot of) Delphi experience. We all agreed on vs.net being the new Delphi. I wasn't alone in my scepitsim on C# builder. One quote for those of you who do understand Dutch : “.Net is Anders”.

     

  • A short look at Borlands's C#builder

    C# builder

    Having worked with Delphi for years I just had to give C# builder, Borlands throw at the C#/.NET market, a try. I downloaded the enterprise trial and started exploring. Csb is "just" a collection of designers. It uses the .net framework classes and the framework C# compiler to build .net apps.

    My very first impressions were not that good. The behavior of csb on a double monitor system is just hilarious. It always maximizes to the size of the primary monitor, in my case the smallest. Worse is that you cannot stretch the main window to a greater height than the primary monitor. But you can stretch the window to any desired width. But a 3200 by 768 window doesn't work well. Having worked some time with csb all felt a little better. The product seems to be pretty stable, only occasionally the "error in xxx.bpl" (well known to Delphi people..) boxes pop up. Code completion is a little slower then vs.net and by far not as intelligent as in vs.net. Apps start a little faster in Csb.

    Csb looks and feels a lot like a stripped down vs.net. Some very essential tools, like the dataset designer, are missing. Csb works with the same components as vs.net. It is a pity the tools to set their properties are not there. When you have a datagrid there is no property builder. What is worse there is no template designer either, which makes components like a datalist un-designable. In the property window there are no builders for things like a database connection string or a sql statement. There are property builders if you use the borland data components, if you use ado,net you're on your own. The webform designer is the only place which has more to offer than vs.net. In vs.net you have to use frontpage with vs.net to do some serious static html editing. Csb has a lot of the tools on board. But not a spelling checker.

    Csb apps can consume webservices. To add a web reference to a project you start a dialog from the project manager, just like vs.net. Csb works with wsdl files. If you have a webservice built with Vs.net you have to request the wsdl in the querystring like http://localhost/MyService/Service1.asmx?wsdl. Csb generates the class wrappers for the webservice slightly different than vs.net. Vs.net will generate a new namespace for every webservice consumed. Csb generates the service classes in the namespace of the consuming application. The result is that you run into trouble when you consume two webservices with the same name (Service1) in the same csb application. In vs.net the name conflict is solved by a better usage of namespaces.

    Creating asp.net apps works different than vs.net. You have to access your web server using a windows filename, like C:\inetpub\wwwroot\..., you cannot access a webserver over http. The dialog has some server options. At first I did not check the execute flag. My Csb apps hung up IIS. Temporarely stopping IIS did bring back csb but asp.net had died. Rebooting my machine solved that. Having set the checkbox I could build webforms and webservices. Did some experiments with a webservice returning a typed dataset, which worked well. Vs.net was a happy consumer. Imported vs.net webapp with a datalist. As mentioned before, the template's were unreachable. And the app did not run : "Unable to scan program header". Interesting.

    So far my first impressions. The nice thing about C# builder that it provides vs.net with some competition. The bad thing is that the product is at this moment, IMHO, to weak to impress MS. Too many things don't work good, too many tools are missing. The only thing I prefer in C#builder is the static html part of the web-form designer. At all other point vs.net has C# builder running circles. Sorry Borland.

    Anonymous methods

    In my previous post I mentioned anonymous methods. Don Box in his blog has pointed that the syntax of these anonymous methods will not be as in the document on which my post was based. It will even be simpler. Read all about that here.

  • Anonymous methods and Clipper

    One of the new features of C# in the upcoming Whidbey release are anonymous methods. What they are and how they work is clearly explained in the gotdotnet page Vijay pointed to in his blog. And Don Box uses them reguarly in his blog. Take this snippet taken from the page pointed at :

    public MyForm()
    {
          listBox = new ListBox(...);
          textBox = new TextBox(...);
          button = new Button(...);
         
    button.Click += new EventHandler(sender, e)
          {
          listBox.Items.Add(textBox.Text);
          };
      
    }
    }

    A new eventhandler is created, the implementation of this eventhandler immediately follows this creation. I am not among the happy few who already have a copy of Whidbey running, but I think you can code like this as well :

    public MyForm()
    {
          listBox = new ListBox(...);
          textBox = new TextBox(...);
          button = new Button(...);

          otherButton = new Button(...);
          EventHandler myAnonymousHandler =
    new EventHandler(sender, e)
          {
          listBox.Items.Add(textBox.Text);
          };
          button.Click += myAnonymousHandler;
          otherButton.Click += myAnonymousHandler;
      
    }
    }

    I think that's pretty cool. When describing anonymous methods they are compared to lambda functions found in Lisp and Eiffel. But I have seen something very similar years ago in Clipper, a very more down to earth language.

    Clipper started as a compiler for dBase III applications. Quite some interesting things were added to the dBase language, making it, at the time, quite a nice tool to build applications for DOS. In Clipper 5 you had code blocks which were, according to the documentation, unnamed assignable functions. This is a snippet of Clipper code with a code block

    MyCodeblock:= { | a, b| c:= a+b, c}

    Function UsingBlock(theBlock, param1, param2)
      @1,1 SAY EVAL(theBlock, param1, param2)
    Return .T.

    On the screen will appear the sum of the parameters passed. So a codeblock is a piece of code which can be passed around, just like the EventHandler in C#. Only the Eval function (and two derived ones) could execute it. You could even compile a code block at runtime, like

    MyCodeBlock:= &ThisStringContainsCode

    That can be done in C# as well but thank goodness, it is a little more organized there.

    I don't want to compare C# and Clipper. Actually Clipper is a crude language, all variables are variants and OOP was still being re-invented at the time. Database support is a disaster compared to today's SQL based tools. And a Clipper app behaves horrific in a Windows (NT) environment. For instance, one running Clipper app can literally cripple a terminal server.

    But I considered it worth mentioning. Stay tuned.

  • Some virus attacks are more successful

    Microsoft has pretty well survived the attack, I was less lucky. This one went to my nose and throat and I'm not feeling too well. The main problem is not being able to think straight. Last weekend I was trying to create a post for the Apress forum but I ended up in a piece of garbage that, thanks goodness,  I didn't post. It will have to wait. So for the moment I'll do some short takes for my blog. See if I can manage this.

    Newsaggregators

    I am still interested in seeing comments in my newsreader and also still interested in comments on comments. Bandit showed me once a little treelike structure. The post had subnodes pointing to the post referred to. And these subnodes had subnodes again. The next time I opened bandit all subnodes had gone, Bandit had even forgotten which post I had already read. So still a little flaky. Maybe it has to do with my IP-address ? There is a NAT router between the private IP address of my machine and the web. Just a guess...

    To see all posts in full glory I  visit the dnj website. .TEXT shows the post there very well. Great tool Scott ! Please take comments on comments on the wishlist, the db is ready for it. Or is this just my wish ? Have I been using too muck Oulook Express ? I would love to reply to comments, now I have to do this in a new blog post.

    "DN Junkie XL on the 7th floor" must be another Dutchie. He blogs on another webbased newsagregator. Going to try that.

    Cool MS keyboard

    If you happen to use a Microsoft Natural Keyboard Pro treat it like the treasure it is. MS no longer sells it and nowhere on the web I found a keyboard with all of these features.

    • USB connector
    • On board USB hub
    • Ergonomic layout
    • Web function keys
    • Classical 2 by 3 PgUp PgDn block

    Even if you drop the latter nothing pops up. I am going to try to repair mine.

    Using Frontpage and VS.NET simultaneously to edit a page

    VS.NET is a great tool to create web pages but when it comes entering pure text it's HTML editor can't rival FrontPage. That's natural, they are both quite different tools. The good thing is that you can work in FP and VS.NET simultaneously on the same page.

    Let's suppose you have the page open in VS.NET. In FP (XP) all aspx pages are included in the  file open dialog (Files of type : web page). You should not open the file over http (use c:\inetpub\wwwroot\MyProject or the like), then you have to tackle some security  issues. The page will open fine, FP treats the asp.net stuff as just another form. And now you edit your static text and include your images using all FP tools available. Not the least being the built in spelling checker. When you save the page in FP vs.net will immediately see the page has changed and will suggest a reload. After that your page looks great in VS.NET as well. FP will not respond to updates saved by VS.NET. You have to click the refresh button yourself.

    I am using FP more and more. Also to write this. The .text admin tool is really great but it lacks the spell-check. Some other pages on the web are just plain crap. Long live cut and paste.

    Including a setup with your app

    I know, asp.net has xcopy deployment, but I am surprised by the fact that a lot of the tools I download don't include (or consist) of a simple (msi) installer file. Creating a setup with your project has been made so extremely easy by VS.net that it almost doesn't deserve to be described. It's a marvel. Creating setup's is something which is almost skipped in all documentation. Should I write a contribution on it for the DNJ ? No, not yet, the pipeline hasn't been cleared yet. Just add a setup project to your solution and give it a try yourself.

    At this moment I am spending my R&D time on reading "Inside VS.NET" by Microsoft Press. It describes loads of gems to be found in VS. And it does contain good coverage of customizing setups. This book is an easy reader and I would advise anybody using VS.net to read it. It's a little like a missing manual. A pity you have to buy it separately but MS offered quite a huge discount at the 2003 introduction.

     

    That's it. Pharmacy.update is at work and I am going to take a nap.

  • Cool(-ing) Microsoft hardware

    The heat is taking caualties. Last night I spilled a glas of cool water over my “MS natural keyboard Pro“. Didn't pay much attention. This morning I found the keyboard gone mazurk. Dissection reveiled a lot of water and corrosion of the “printed wire”. I got the keyboard working again but some of my keys, like the left alt, are dead. What am I to do ?

    Option A : buy a new keyboard. My model is no longer sold, desired specs for the new kbd:

    • Ergonomic, aka melted.
    • Good click
    • USB connector
    • On board USB hub
    • Function keys like mail and web

    That is going to be difficult. MS doesn't have it.

    My mouse is plugged into the keyboard. The keyboard is plugged into an USB switch. Computers plug into the switch. I can use mutiple PC's, like notebook, server and “gameboy”, with just one keyboard and mouse. So the onboard hub is important.

    Option B: Repair the keyboard.

    The hub still works, I think some of the wiring, which connects the switch-dots is corroded/burnt. Not badly. Does anybody have any experience with repairing “printed wire” sheets ? All suggestions welcome.

     

  • Once more on weblogs, newsaggregators and responses

    Sharpreader

    Having allready blogged about RSS Bandit and NewsGator I took a look at sharpreader, another newsagregator, this time. Sharpreder looks and feels a lot like bandit without a built in browser. All worked fine but a little extra option puzzled me. In the context menu is an item "Link Cosmos'" which directed me to Tecnocrati. What that is excatly is not clear, seems to be some kind of blog-watcher. I can become a member for a couple of $'s  year. The info given is not very clear, I read things like "Get alerted when your Google Ranking changes". Yuck, not my cup of tea. This is the only extra thing I can find in Sharpreader. The other extra, grouping posts, is found in Bandit and the DNJ weblog as well.

    I will stick with RSS bandit. Please don't take my opinion on the tools too serious. It is just my short impression between installation and (temporary) adoption or uninstall. As Donny knows I am not very patient :/ So if you really want to know what a tool is like you have to try it yourself.

    Grouping posts

    Using the aggregators, toying with .TEXT , it's source and database as well as browsing the dnj weblogs I am beginning to get the idea how aggregators group posts. Every post has a full URL which points to it, like http://dotnetjunkies.com/weblog/petergekko/posts/984.aspx. A post can contain a link to another post, I just did so typing (copying in) the URL into this very post. Bandit (and sharpreader) will add a treenode with the link. It will do the same with the post linked too, there it will add a treenode with a link back to the post. .TEXT seems to do this by analyzing the content of the post, looking for URL's. :?

    In a weblog you can add a comment. This comment has its own url as well, like  http://dotnetjunkies.com/weblog/petergekko/posts/987.aspx  (The URL's used here are real life, feel free to try them. Inspecting the .TEXT database shows all posts and their comments happily together in the blog_content table. Every post has a a parentID field. In a normal post this is -1, in a comment this the ID of the post on which this post is a comment. This info is enough to build a full tree of comments and comments on comments. You can add a comment on a comment by browsing to the URL of the comment (there is no link to that on the page, you have to use the address bar) and add the comment just as you would enter a comment to a post. The comment ends up in the .TEXT database with the ID of the comment commented on as ParentID. Alas this is to much for Bandit, Sharpreader or .TEXT. Comments on comments don't show up. But the info is there in the database so you can create visual threads Outlook express style in blogs.

    On my wishlist.

    Peter

  • C sharp to read the difference

    At first sight sharpreader does look a lot like bandit. What struck me is that a nice feature of sharpreader, grouping related posts, is there in bandit as well, it even looks the same. To take one more look I will refer in this posting to my first post on newsagregators and to the second.

    Am I “reviewing” tools or a specification ?

  • Testing news aggregators, maybe expecting too much and going wiki-wacky

    My last post on newsagregators got some interesting comments. At the moment I am taking a look at sharpreader as well. To do that I need a liitle test post. So this one links back to my previous post on newagregators. I wonder what it is going to look like in bandit and sharpreader.

    Another thing which drew my attention are wiki's. The first thing which comes in my minds are kwi-kwis, that are tropical catfishes which make lovely gentle pets but according to the (Surinam) people in the Netherlands they are best fit to make a good soup. But a Wiki is a way of discussing something in public on the net. Sounds like the discussing “tool“ I was looking for. Bandit has a Wiki item in the help menu but the project is repoted to be “no-longer-maintened”.

    Anyway, I'll let you know.

     

  • Whidbey book for Apress

    I am working on a Whidbey book to be published by Apress and looking forward to all “feed-forward” on the Apress forum.

    Peter

  • News-(letter) flooding and news aggregators

    Today I received the latest DNJ newsletter for the third time... Never mind. I don't consider it spam at all :> I really do like the way the dnj site has changed and how lively it has become. But I allso do see how it is eating Donny and Doug. I would like to see more new articles appearing, have a submission floating around over there as well and am working on another one. I know the stack of material is is getting big. Any sponsors out there who can help getting them getting it on the site ? (just a suggestion)

    Evaluating some news aggregators

    Trying to streamline all info coming in I tried two news aggregators, RSS bandit and newsgator.

    Bandit is freeware and still a little flaky. The largest problem is that it will occasionaly forget to save your news feeds. I had collected some interesting blogs but the next time I fired up bandit it had forgotten al of them. Which is a known bug according to the bandit forums (You can jump to them straight form the help) Giving it another chance I tried to reproduce the problem, this time all worked fine. Bandit does include (tabbed !) browser windows. Very nice but the things I miss are my favourites, so I end up opening a separate IE to find my favourite sites, copy the URL to bandit and have Bandit find the RSS feeds. Another thing not working in Bandit yet are the Back/forward buttons of my mouse and keyboard. The Bandit forum does have a wish list :).

    Newsgator is a commercial product. It sells for $29 but you can download a fully functional (14 day) trial. The nice thing about it is that it integrates in Outlook and that it allso understands nntp newsgroups. All news is now in an Outlook folder. It all looks very nice and very professional. It is supposed to hook into IE as well, in the context (right mouse button) menu should be a “discover Rss feeds on this page” item. This did not work for me, could be a rights problem. There is one thing I did not like about Newsgator. If I oversaw a setting  please correct me, but I don't like the way it organises posts. In a nntp all post are listed in a “linear” list. Outlook express, which is my nntp newsreader, shows discussion in a tree-view. You can see which message was a response to what and how message threads evolve. In rss feeds this problem gets even worse. You won't see any responses to a post untill you actually link to the webpage itself.

    Imho RSS bandit understands my basic idea behind news, posts and an evolving discussion on them, far better than Newsgator. So I'll accept the flakes, save myself a little money and use RSS Bandit.

    Peter

  • Info-drowning by weblogs

    It's summer in the Netherlands that much that it's almost impossible to do “real” work. Spend half of the day with the family at the Zuidlaardermeer (<Dutch>Er gaat niets boven Groningen !</Dutch>) and the other half of the day on weblogs. My main “problem” with weblogs is that there is far to much to read and follow, you just have to make a selection. I gave the news agregator RSS bandit a second chance and this time it seems to be working well with the dnj weblogs. Last time, before the .text era, it got stuck in the XML feeds. Having set up RSS the next problem is whose logs you are going to read. It will be a growing list, I keep watching the general dnj weblog (and others) to see whatever comes by.

    What struck me was the appearence of a number of blogs in German. English is has become a second language to me as all the software I use is in English. You can get Dutch versions of some software, but not all. Besides that most of the translations are bad, even of the MS stuff. So when working behind my screen it is English, switching from app to app won't give much of a culture shock. Imho there is another point : <German/>Ich kan Deutsch lesen und (ein wenig) schreiben. Die meiste leser aufs net aber nicht. Die Deutsche sprache hat sehr schoene worte fuer (int kbd funktioniert hier nicht, deswegend keine umlaute) rechner and aehnliches, aber die machen Deutsche IT literatur schwer zu lesen. Ohne fuercht zu haben vor “kulturele dominaz” glaub ich das es besser ist die Aenglische sprache aufs net zu benutzen.</German> For those of you who could not follow this : that's exactly my point.

    To get a better feel for weblogs I decided to install the .text weblog server on own machine. I used the source code setup, the source is where you learn the most. It gave me quite some troube setting it up. All info is there, loud and clear, but due to the weather I just didn't get it right. Let me share some of my experiences.

    Setting up .TEXT

    First you have to create a database to store the logs. Administrating databases is a science and culture on itself, if you don't do it every day its a puzzle every time. You need two tools, the enterprise admin to create the database and its users. To create the database tables and stored proc's there is a sql script included. You have to run that in the Query Analyzer. And when you run it, make sure you have selected the proper database, else all is created in the master database. Oops. But the script is fine.

    Installing the sources is a matter of copying. Copy the web.config and blog.config, update the database connection string and you're ready to build the app.

    Next comes IIS. Creating a virtual dir is no problem. Creating the IIS mapping for the virtual setup was something which I didn't get done. Filling in the dialog worked but the OK button, to save the mapping, stayed gray. This is a known bug in (my version (XP-pro) of) the IIS manager. Workarounds I found on the web didn't work either. Does anybody know a workaround which does work ? Somewhere in the registry ? (Long live IIS 2003 with it's xml metabase) I left this a problem and created a directory by hand.

    The last thing was setting up a weblog itself. It is so simple but it took me so long to see what was meant. In the database is a table blog_config. Here you enter a row for every blog you want to serve. Where application is the name of the virtual dir. Makes sense in IIS speak. And all is wriiten here.

    Now I am up and running. I have a weblog on my notebook, can study all the source and toy around with it. Great stuff.

     

More Posts