free geoip Jayson's Blog - jaysonKnight.com
jaysonKnight.com
A conduit to the voices inside my head.

Jayson's Blog

  • Code Formatting for Community Server 1.1 -- Posting From BlogJet

    Now let’s see if it picks up the [code] tag from BlogJet; if so this will make me very happy:

    
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    protected override void Dispose( bool disposing )
    {
     if( disposing )
     {
      if (components != null) 
      {
       components.Dispose();
      }
     }
     base.Dispose( disposing );
    }
    

    Well, the formatting is a little off (indents), but I can deal with that.  What a great CS add-in!  Here's the link again.

  • Free Service to Transfer Large Files

    This is something I've been looking for for a while now; a free service to transfer large files.  I know that GMail (and my ISP, Road Runner) limit email attachments to 10 megs…trying to send music/large image files/videos to friends has usually been an arduous task of RAR’ing it into peices under 10 megs and sending each one seperately (and then getting all my non-geek friends who’ve never heard of WinRAR to install it, and then walk them through reassembling the archive…fun stuff), not a trivial task.  This is a godsend.
  • My Favorite Time of the Year

    College basketball has March Madness.  The NFL has January for the Superbowl.  My favorite time of the year for sports is now:  Wimbledon finals…and the start of the Tour de France (my 2 favorite sports).  Federer has changed the face of tennis (and his match with Roddick will be one for the books IMO), and of course Armstrong has changed the face of cycling (one of many things he’s had a profound impact on)…no doubt he will capture his 7th (and final) yellow jersey in The Tour this year.  Armstrong is quite simply the most amazing athlete of our time.  Good luck to both Federer and Armstrong (and all the athletes for that matter).
    Filed under:
  • Google Toolbar (BETA) is Now Available for Firefox

    From Slashdot (full article here):

    Google has released their toolbar, available in 10 languages for the Firefox browser, and available for 3 operating systems (Windows, Mac and Linux). You can download it from the Google Toolbar homepage, and you can read the Google Blog for more information."

    I like toolbars and all, but I’m running out of real estate in my Firefox window because either A) Firefox doesn’t support rearranging toolbars (i.e. 2 toolbars on the same line) or B) I’m too stupid to figure it out.  In IE you simply unlock the toolbars and drag them around to your heart’s content.  In this case, I would like to replace the search bar with the Google toolbar (or have the Google toolbar on the same line as the address bar).  Regardless, here’s the link again for the beta toolbar.

  • What's Your Favorite .Net Namespace?

    When I moved from the legacy VB6/ASP realm a few years back, it was a huge jump…the sheer amound of classes and namespaces in .Net took me close to 6 months to get my head wrapped around.  Ironically enough, the (IMO) scariest namespace for me at the time is most definitely my favorite:  System.Reflection.  It’s one of the larger namespaces, and the amount of functionality exposed by it is staggering.  I’ve used reflection of some sort on virtually every project I’ve worked on (it’s an absolute neccessity for building any kind of application framework I think).  Early on in the .Net days, I actually lost a couple of project bids due to my lack of knowledge of (and complete misunderstanding of how to use) reflection.  I don’t claim to be an expert on it now by any means, but after having gained a better understanding of it, I can’t imagine not having this functionality.  System.Runtime.Remoting (with all of it’s quirks and intracacies) runs a close second for me, though most applications don’t really benefit from the classes exposed by this namespace unless specifically called for…it is mighty powerful though if used correctly.  Least favorite namespace?  Most definitely System.Text.RegularExpressions, which is something I really need to change.
  • Applied .Net Attributes -- A Great Read

    Attributes in .Net are given the red headed stepchild treatment; misunderstood, misused, and widely ignored (at least in most of the projects I’ve worked on).  They were one of those new features exposed by .Net that most of us coming from a legacy background simply didn’t understand…for me personally it was a matter of “I’ll learn about them when I get around to it, or when a project calls for their use.”  I’ve done a sprinkling of custom attribute work, but nothing that I would consider hard core.  I picked up Applied .Net Attributes this weekend; at just over 200 pages it’s a quick read (and probably the shortest book in my technical library), took me all of 2 hours…but a very good one.  We’ve all heard the TLA Aspect Oriented Programming being thrown around like it’s the next OOP; admittedly I know next to nothing about AOP beyond the basics, but this book does a good high level job of explaining how custom attribute development lends itself to the AOP paradigm and has some great sample code to illustrate this.

    It also explores some advanced .Net concepts such as context bound objects and custom context attribute development (2 concepts I was largely unfamiliar with outside the realm of seeing them mentioned from time to time in various reads, nothing in depth though).  After reading about the above mentioned concepts and how they relate to .Net attributes, I can definitely see the benefits of exploring this some more.  I have an old exception management/logging library (mundane plumbing code that no one really likes to write..well, I do) that I wrote a while back, I started gutting it recently (in what little spare time I have) to see what AOP/custom attributes can bring to the table for this type of scenario.  Of course, anyone having used nUnit (which should be all of us) knows how powerful custom attributes can be.

    So all in all, a highly recommended read…and short enough that it won’t take too many brain clock cycles out of your day gig.

  • Resource Management in Visual Studio 2005

    Resource management is changing in Visual Studio 2005/.Net 2.0, moving from a string based lookup mechanism (i.e. ResourceManager.GetString([value])) to a strongly typed system.  This is a welcome change, and one I’ve been exploring recently (finally getting around to learning VS2005 and all of the new features).  I’ve written a short, high level article about the new resource management changes, so have a look and let me know what you think!
  • Gallery Updates

    Uploaded some new pics, check ’em out.  More to come.
  • Longhorn Team RSS Blog

    Amidst all the news of Rss being baked into Longhorn, it turns out the Longhorn Rss team has started a blog.  Subscribed.
  • Strongly Typed Datasets and XML

    I’ve posted numerous times before about my feelings on Xml parsing (and not just as it relates to .Net, but Xml in general), so I won’t rehash my feelings on the subject here except for one sentence:  I love Xml, but I abhor querying/parsing/handling it.  It’s great in principle, but in practice there is a lot to be desired (IMO).  It is getting better though with XQuery support in 2.0, but it’s not quite there yet.

    So, I found myself with some free time this weekend to work on a small project I’ve wanted to do for a while now, ever since Ray pointed out that our favorite online music streaming company publishes an Xml file of their playlists; build a WinForms gui that wraps up this playlist and offers more functionality than their website (which is *painfully* slow I might add).  The structure of the Xml file is pretty straightforward, but I’m always hesitant to parse Xml files due to the reasons mentioned above, and lack of strong typing (I really don’t like seeing a lot of strings in my code, it’s error-prone and I usually end up anti-debugging methods that deal with Xml parsing).

    I initially set out to consume the file in a dataset, then realized that setting up all the relationships manually was going to be tedious at best and would end up taking more time than just XPath’ing the document.  I don’t know why I didn’t think of this before, but it hit me that I should be able to create a strongly typed dataset based on the schema of the file.  I’ve worked with typed datasets before, but it’s always been with RDBMS structured data, never with Xml.  It turned out the be quite simple actually…in short I was blown away with how simple it was.

    • Create a new System.Data.Dataset.
    • Create a new XmlTextReader and point it towards the Xml file to write the schema for (in this case, the Xml file published by DI).
    • Load the file into the dataset by calling ds.ReadXml, passing in the XmlTextReader as a parameter.
    • Call ds.WriteXmlSchema and specify the path for the resulting .xsd file.
    • Open a .Net command window and run xsd <path\name of file>.xsd /d to create the C# class file.
    • Add the resulting class file to your project.
    • Instantiate the new class, and read in the original Xml file via the steps mentioned above.

    I was a little skeptical if this would work as DI’s file has no schema information in it, but through the magic of WriteXmlSchema it was all inferred.  What you now have is a fully typed container for your Xml data…no messy XPath navigation, traversing nodes…and did I mention it’s fully typed?  No more f5’ing just to see if your XPath statements do indeed return the results you need (well, in my case at least…I highly doubt someone of say, Dino Esposito’s stature would ever doubt their own code).  It may be a bit of an overkill for a file as simple as DI’s (the resulting class file from xsd.exe is close to 3000 lines of code), but why not leverage the built-in functionality of the runtime wherever possible (plus I’m partial to typed datasets, for WinForms at least).  What would have taken me who knows how many lines of XPath to parse/navigate the document took me only a dozen lines (and virtually no rebuilding…since it’s typed you know that it will “just work”).  All of the relationships are built in, so finding child rows is easy as this (where ChannelInfo is my typed dataset and ContentSection is a homegrown user control to house the data retrieved).

    That’s it.  Minimal code, minimal testing.  As for performance, I don’t have any raw data in front of to see if it’s actually faster than the comparable XPath…my guess is that it would be though.  As far as the application I’m writing to wrap up the DI playlists, it’s a secret for now…but I plan on building some pretty cool stuff into it.  I have the shell built which mimics DI’s interface, but I plan on adding a lot to it (basically just a utility that sits in your systray, will enable full control of streaming media from any site, will be completely pluggable/extensible/the usual stuff…plus features like pinging you when a specific track comes on, etc…lots of ideas, so little time to code).

    I’ve been a web guy for as long as I can remember, haven’t really worked on any WinForms stuff on any scale…I’m pretty impressed with what I’ve seen thusfar.  This is gonna be a fun hobby project!

« First ... < Previous 83 84 85 86 87 Next > ... Last »

Copyright © :: JaysonKnight.com
External Content © :: Respective Authors

Terms of Service/Privacy Policy