July 2004 - Posts

Someone at the office passed me this great find. Distro is, essentially, a replacement for RegisterClientScriptBlock() and similar functions in ASP.Net.  Some of the problems it tries to solve are:

  • API requires mixing of .NET and JavaScript code in the code-behind.
  • JavaScript code is compiled into the code-behind, which means constant recompilation during development, debug, and QA.
  • JavaScript in code-behind breaks separation of style and logic - the JavaScript should be in the ASPX or ASCX with the rest of the HTML.
  • No way to control the order in which the scripts execute in.
  • No good way to link a javascript function to the client-side events of an ASP.Net Server Control.

Learn more here...
http://www.youngpup.net/2004/distro

Posted by brian_ritchie | with no comments
Filed under:

After posting a rave review on the Media Portal project, I figured I'd better get it setup with my entertainment center.  This weekend I installed it on an extra PC connected to my television. 

Hardware Configuration
My PC is a Sony VAIO 1.5ghz, 512MB RAM with a GForce4 card (I'm sure you could probably get by with less)  I've connected the s-video out on the card to the television for video and used a Belkin RCA converter cable from the sound card for audio.  The wireless keyboard and mouse were “borrowed” from my new Dell as was the Cyberlink remote control.  A Linksys Wireless USB adapter provides connectivity to my home network.

Media Portal Installation
Setting it up was a breeze.  Just make sure you have .NET 1.1 and DirectX 9 installed.  Download the latest Media Portal binaries from SourceForge, and run the install.  After the install, I'd advise running the configuration.exe app in the Media Portal directory.  From here, you can setup the paths to your music, pictures, videos, etc.  (There is a menu option from within the main program, but the external application has a better configuration UI)

Cooking with Gas
Things are going very smoothly...I am really cooking with gas now!  My digital photos are available, and so are my home videos and music.  To top things off I even have a weather page updated from the Weather Channel.  While the software is still under development, it is running very well. 

 

DVD Support
Next, I wanted to check out the DVD functionality.  Well, my PC didn't have a DVD codec installed.  Bummer.  After some time on Google, a free download from Cliprex Video Software came to rescue and I was back in business.

Taking it to the next level
While exploring the software, I found the ability to turn on a few additional plug-ins.  One of the plug-ins is a news browser for RSS feeds.  The only problem is you can't configure it from the GUI yet.  Luckily the source code was available, and after a bit of detective work I found the solution.

Here it goes...after turning on the news plug-in with the configuration app, add the following XML snippet to the mediaportal.xml file.  (Feel free to customize it with your favorite feeds)

  <section name="rss">
    <entry name="siteName1">Slashdot</entry>
    <entry name="siteURL1">http://slashdot.org/index.rss</entry>
    <entry name="siteName2">Weblogs@asp.net</entry>
    <entry name="siteURL2">http://weblogs.asp.net/MainFeed.aspx</entry>
  </section>

The RSS browser is still pretty basic and doesn't format the HTML embedded in some feeds.  But, it is definitely a cool feature and is bound to improve in the future.

And the verdict is...
This software is off the hook!  The developers have done a great job and it is very stable.  They are also continuing to improve its functionality.   For example, I saw a recipe plug-in is in the works.  So give it a try, after all...its free!

 

Posted by brian_ritchie | with no comments
Filed under:

I've posted a new c# library called SharpRepositoryLib. It provides an abstract interface for accessing different source repository providers over a remote connection.

Features include:

  • Plug-in architecture for accessing different providers.  Currently supports CVS, Subversion, and GotDotNet Workspaces.  I've been working on a Vault provider as well.
  • Directory Listing
  • File Listing
  • Revision History (with comments)

This library and SharpDbSchema are utilized by my DevCenter project (a development project portal).  You can see an online demo of SharpRepositoryLib within DevCenter here.  I'll post more information on DevCenter soon.

Posted by brian_ritchie | 2 comment(s)
Filed under:

A new release of everyone's favorite zip compression library is out! (btw, it does GZip, BZip2 and Tar too!)  Thanks to John Reilly & Mike Krueger for providing this to the .NET community.  Download #ziplib 0.8 here.

The new goodies include:

  • Add functionality to support cleaning of names to Zip file convention added to ZipEntry class
  • External file and attributes are now handled
  • IsDirectory now handles the attributes for archives made on DOS/Windows
  • ZipFile class now has an indexer property
  • ZipFile class has new functionality for searching for entries by name
  • ZipFile class now reads external attributes from central header entries
  • Fixed bug in ZipInputStream class where extra bytes containing unix attributes altered date and time causing checking of password to fail
  • ZipInputStream class now checks version required to extract.
  • ZipOutputStream class version made by is now fixed at 2.0
  • Cleaned up summary comments all over the place.
  • Some changes to Tar classes to allow Compact Framework compilation.
  • Add checking for invalid entries when scanning through extra data.
  • Decryption of entries from Zip files created on non-seekable output now works.
  • Deflating of zero length files is automatically converted to stored if possible to save a little space.
  • More tests.
  • Posted by brian_ritchie | with no comments
    Filed under:

    XSLT is extremly powerful but limited in many important ways.  For example, it lacks basic date handling functions.  I recently ran into this problem when I was trying to format an RSS feed for my home page.  Luckily, eXSLT solves many of these problems.  Even better, there is a .NET implementation on GotDotNet Workspaces.

    I found this RSS xslt stylesheet out on the net (can't remember where) and adapted it to use eXSLT for date formatting. 

    Here's how...

    First, add the namespace for the functions you want to import:
    (such as the date namespace below)

    <xsl:stylesheet version="1.0"
       
    xmlns:xsl
    ="http://www.w3.org/1999/XSL/Transform"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:rss="http://purl.org/rss/1.0/"
        xmlns:ns="http://my.netscape.com/rdf/simple/0.9/"
        xmlns:msxsl="urn:schemas-microsoft-com:xslt"
       
    xmlns:date
    ="http://exslt.org/dates-and-times"
        xmlns="http://purl.org/rss/1.0/">

    Next, use a function within your stylesheet.

    <xsl:value-of select="date:format-date(./rss:pubDate|./pubDate|./ns:pubDate,'M-dd-yyyy')"/>

    Finally, perform the transformation within your Page_Load event.  Since eXSLT has it's own transform object, we can't use the XSL Server Control.  In this example, I just stuff the rendered HTML into the text of a label.

    using System.IO;
    using
    GotDotNet.Exslt;
    using
    System.Xml.XPath;

    private void Page_Load(object sender, System.EventArgs e)
    {
        MemoryStream ms=
    new
    MemoryStream();
        XPathDocument doc =
    new
    XPathDocument(“http://dotnetweblogs.com/Britchie/Rss.aspx“);
        ExsltTransform xslt =
    new ExsltTransform();
        xslt.Load(MapPath("rss.xslt"));
        xslt.Transform(doc,
    null
    , ms);
        ms.Seek(0,System.IO.SeekOrigin.Begin);
        StreamReader reader=
    new
    StreamReader(ms);
        XslPlaceHolderLabel.Text=reader.ReadToEnd();
        reader.Clse();
    }

    That's it!  This opens even more power to the XSLT developer than ever before.  I hope you find eXSLT helpful, I sure did!

     

    Posted by brian_ritchie | 7 comment(s)
    Filed under:

    Well, I wasn't under a rock...just on vacation. :-)  Our family had a great time on a cruise to Alaska and visiting family in Oregon.

    After the trip, it gave me a chance to try out FotoVision. Click below to see the pictures:

    There are many .NET-based web photo albums out there, but what I liked about this one was it had a windows application to manage everything on the client side before publishing the photos to the server.  The photos are automatically resized and uploaded using a web service.  Cool Stuff!

    Posted by brian_ritchie | with no comments
    Filed under:

    Mono version 1.0 has been released!

    What is Mono? An open source implementation of the .NET framework for use on Linux, Unix, MacOS X and Windows system.

    Congrats to everyone who contributed to the release!

    Posted by brian_ritchie | 2 comment(s)
    Filed under:
    More Posts