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

Peter's Gekko

public Blog MyNotepad : Imho { }

November 2006 - Posts

  • Looking back, looking ahead, looking at (generated) documents

    It’s so long back I almost forgot it myself. Three days and 20 years ago, the 26th of November 1986, Gekko Software was founded. Coming from a biological background (hence the Gekko) I started my adventures in the world of professional software with an Olivetti M24 (known as the AT&T 6300 in the US) a copy of Turbo Pascal 2.0 and a copy of dBase III 1.0. Turbo, more specifically its creator Anders, has been the main theme over all the years. Had it included standardized database support from the start (it took Delphi to reach that point) all my sidesteps into dBase, Clipper and Access would not have been necessary.

    When it comes to databases a standardization (from the code’s point of view) has been pushed away in xml-datasets or whatever other object you can map them into. But not all data my customers work with is fit for databases. A lot of projects include the generation of documents. When you’re lucky your reporting tool will generate the document. These days a lot of them offer out of the box exports to most popular (Office) applications. When the specifications of the document get really nitty-gritty you’re back to good old coding by hand.

    20 years ago I had a book File formats for popular PC software. It described every byte of a document file. It took a lot of tedious programming but you could create very detailed documents that way. But the moment the consuming application had a new version it usually took a lot of work to get your output comprehensible again. A big step forward was OLE automation in MS office which hid the document format behind a giant object model which you could program against. It worked but had its drawbacks. One of them was performance. When programming against the user’s Word processor takes crossing a process boundary on every call. Given the hardware of those day (Pentium I with 8mb) generating a document from code was not much faster than typing it in by hand. Advances in speed are not the prime benefit of IT, but having to wait all afternoon for your documents was too long.

    You can automate an Office application in-process and forget about the UI. An interesting scenario became generating documents on a document server. This still had drawbacks. You had to install Office on the server; which could be done but needed a lot of explanation to the IT staff. What’s worse is that an Office application expects an UI. Which will hit hard on you when the document generation process hits an exception. The exception pops up on the server screen. The server itself is locked in a closet; nobody notices the dialog and the whole thing hangs.

    These days generating documents from code is more interesting than ever. A very promising direction is the new document formats for (open) Office. Basically they are compressed XML documents. The internals of the document format are no longer hidden behind an api but instead they are published in an XSD. Which could mean you no longer need an Office application to create the document, all you need is the schema and you can code away. In real life it’s more complicated than that. My neighbor, fellow blogger, has dived into the details and published an open source library on sourceforge. It’s dazzling!

    So the story doesn’t stop here. I’m looking forward to another 20 years. But after that it will be enough, time for retirement. Which I will enjoy with open XML everywhere in everything.

  • Vista RTM released. Back to Longhorn or on to mobile ?

    Hereby I join the happy crowd running Vista RTM. So far nearly everything is running. Including Virtual PC 2007, I blogged about before. Here it is running the first public Longhorn alpha bits, as handed out on the PDC 2003.

    Installing it was a snap. After installing Virtual PC additions straight from the Virtual PC menu, it’s running, fine. No it’s not useful, just for fun. Want to start all over again ?

    The only thing which does not work right under Vista is mobile development with VS 2005. The emulator runs fine, but cannot reach the network. Network connections were based on cradling the emulator. Vista does not use ActiveSync , so Akhune’s post does not help. Reading this tells me I just have to wait. Yes it is painful.

  • Firebird database, VS 2005 (sp1) and Vista

    Just like last time getting the Firebird database working on my new machine was a long way of trial and error. I have Visual Studio 2005, installed sp1 and it’s running on Vista. Installing FB has become easier but support is still very fragmented. Worse is that essential parts contain typos which will lead to complete VS crashes. Hereby the recipe which does work. I have to thank Kai Bøhli a lot for his help.

    1. Install the FireBird client. Found here. Having completed that you will see the firebirdclient in the GAC.

    1. Edit the machine.config file (in the directory $WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\). There are online instructions here but do not take these literally. The example contains the values for the firebird-client 2.0.0.0 The current download is version 2.0.1.0, which has also a different public key. This does work for 2.0.1.0:

    <section name="firebirdsql.data.firebirdclient"

    type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=2.0.1.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c" />

    <system.data>

      <DbProviderFactories>

        <add name="FirebirdClient Data Provider" invariant="FirebirdSql.Data.FirebirdClient"

    description=".Net Framework Data Provider for Firebird"

    type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory,

    FirebirdSql.Data.FirebirdClient, Version=2.0.1.0, Culture=neutral,

    PublicKeyToken=3750abcc3150b00c" />

    What is essential is that both version and publickeytoken should match the values of the assembly in the gac.

    1. Install the Firebird data designer for VS 2005, found here
    2. Perform the registry update found here.

    After these steps your VS 2005 supports FireBird.

    Firebird server running on Vista

    The firebird server does run on Vista (RC1) but one feature can completely trash your machine. Part of the setup is the control panel applet to start and stop the FB server. After installing this the Windows explorer crashes when trying to open the control panel. The good thing about the applet is that you do not have to install it; it’s an option in the setup. To start or stop Firebird just use the Window’s service manager.

    The FireBird guardian service (listed just above the FireBird service) does the actual stop/restart work. Use that one to control the FB server. (Thanks Kai, where would I be without you :?)

    Posted Nov 17 2006, 03:51 AM by pvanooijen with 7 comment(s)
    Filed under:
  • Blogmailr or Blog from Word ?

    New ways to publish blogposts  are popping up everywhere. I am pretty happy with blogging from Word 2007.  The good thing about Word is that it shines in spell and grammar checks.  Stand alone tools like blogjet and livewriter do have a check but one (by far) not as good as that of Office.  Word also shines in the html it produces. The weak point in Word is publishing pictures in your blog.

    BlogMailr is said to be very good in publishing a post. It works by sending an email to the blogmailr site which will publish the post to your blog.

    To write an email I can use Outlook and I have the Office proofing tools working for me.  So it’s worth a test to see if blogmailr can make the day.

    1.       Will this image show in my post?

    2.        

    3.       What does the emitted HTML look like ?

    4.       This is italic and bold.

    See you in the Community Server dashboard.

    <update from CS>

    The (lacking) image speaks for itself.

    And the HTML ? You don't want to know. Looks like Office 2003  :(

    This makes Word 2007 a clear winner !

    </update>

  • Yes you can use Word 2007 to write blogposts

    My test was successful. I wrote a blogpost in Word 2007 and pasted in some source code. The result was pretty impressing. Let’s give it one more try. This time without line breaks or numbers in CopySourceAsHtml

            public void SyncData()

            {

                DacProService.BasisData newBasis;

                try

                {

                    newBasis = webService.GetBasisData();

                    basisData.Clear();

                    basisData.Merge(newBasis);

                    SaveLocal();

                }

                catch

                {

                    MessageBox.Show("Niet kunnen synchroniseren");

                }

            }

     

    My test was not that successful when it came to images. Automatic picture upload sounds interesting but has a big drawback. In the blog configuration you have to tell Word where to store the images using ftp. This is a problem in Community Server. The URL to an image is a computed one. It’s something like http://codebetter.com/photos/peter.van.ooijen/images/152093/original.aspx. I cannot access the folder http://codebetter.com/photos/peter.van.ooijen/images/152093/ to write to. And Word cannot compute the url of the image when uploading. Support for other ways are in the pipeline.

    One other thing I missed was the possibility to add tags to my post. I’ll have to do that by hand in the CS dashboard. Together with inserting the images. But for the first, most elaborate part of publishing a draft Word is now my tool of choice. Goodbye Frontpage.

  • Can you blog from Word 2007 ?

    I used to write my blogposts in Frontpage. As a non-native speaker I do need the spell and grammar check to try to keep some standard. Frontpage produces pretty lean HTML which I pasted into the CS blog entry editor. Office 2007 does not include FrontPage. You are redirected to Publisher for Web content and to Word for writing a blog entry. A blog post by Joe Friend promises clean HTML and publishing straight from Word. So here I am trying this out.

    When blogging about .NET CopySourceAsHtml is your friend. It is a VS add-in to copy formatted source code and XML straight into any HTML editor. Let’s give it a try

       63         public void ReadLocal()

       64         {

       65             if (System.IO.File.Exists(naamBestand))

       66                 ds.ReadXml(naamBestand);

       67         }

    Looks good in Word.

    Another must have is images. An image is uploaded to the CB site after which I can reference it by URL in a blogpost. Let’s try that. Insert picture, create a link to file.

    <update>

    The image didn't show up. I'll try the other way

    </update> 

    This test is ready to be published. Word 2007 has a manage account dialog to fill in my blog settings. It also has some possibilities to upload pictures together with a post. Something to explore further; provided things work so far.

    Now I’m ready to publish. Meet you in CS. I’ll inspect the result there.

    <update>

    It worked ! Except for the picture. I'll get back on that. The HTML is really clean!

    </update>

  • Vista, Visual studio 2003, Virtual PC 2007 (and the right hardware)

    I made the jump and started using Vista on my main machine. The main concern was Visual Studio 2003 which is not supported by the brand new OS. Upgrading all running projects to VS 2005 is not an option so I needed a good alternative. In comes Virtual PC. I have long running and very pleasant experiences using that for keeping a Delphi environment alive. It is quite a hassle to install Delphi (5 or 6) and the installation often interferes with other software. To isolate all problems I have a virtual Delphi machine which I can move around from physical machine to physical machine. Works like a snap and a could be good way to tackle VS 2003.

    A Virtual PC is known to be not as fast as a “real” one. When running a beast like VS 2003 that can become cumbersome. In comes Virtual PC 2007, available as beta. Virtualization is making great progress. New hardware, like the new Intel duo-core processor, has features to support virtualization and Virtual PC 2007 uses this by default. The result is a Virtual XP, running inside Vista, which runs VS 2003 and it is really fast and snappy.

    A pleasure to work with.

    Virtual network

    Hooking the virtual machine in the network deserves some attention. VPC offers a lot of possibilities. A virtual PC can have up to 4 virtual network adapters. One option is to directly link one to a physical adapter on the host machine. Doing this lead in my case to strange behavior of both host and guest. I used to work that way in VPC 2004 and it always worked fine there. What always works fine is using shared networking. The VPC console has a DHCP server built in which serves all Virtual machines it is running. This way you can host a complete virtual network.

    Smart device emulator
    The smart device emulator of VS 2003 does not work inside a virtual machine. An attempt to start it displays one of the best error messages I’ve seen in years.

     

    On Channel9 there is a nice thread on this.

    Screen real estate

    I am a wide screen addict. One of nice new things in Vista is that the remote desktop client now supports a full-sized 1920*1200 screen. Alas, VPC still stops at 1600*1200. But resizing and switching from full screen to a PC in a window works so much better than in the former version.

    Conclusion

    Virtual PC 2007 provides an excellent solution to use Visual Studio 2003 under Vista. The performance is excellent and as an extra bonus I win in ease of administration. VS 2003 and 2005 can coexist on one PC but I have met tools (an SDK which targeted a Whidbey beta) which couldn’t distinguish the two and messed things up. Now I have just one virtual hard disk file to take care of, it contains a clean XP with just VS 2003. All I need to maintain my .net 1.1 apps.

More Posts

Our Sponsors

Free Tech Publications

This Blog

Syndication

News