Saturday, September 23, 2006

Recursive Hierarchies to XML with SQL Server 2005

Christian Wade's Blog - SQL Server Standard - Recursive Hierarchies to XML

"I wrote an article for the September issue of SQL Server Standard magazine:

The version that was finally published was a very cut down version with minimal code snippets. This was for obvious reasons; they had to fit the content onto small columns in the magazine. For the readers who would prefer the more verbose version, here it is! I guess this is further reference material for the published article; I’m sure my friends at SQL Server Standard won’t mind.

Suppose we have a sizeable recursive hierarchy in our SQL Server 2005 relational database. We want to export it to XML. This could be for a variety of reasons....

On the face of it, this seems like a simple nut to crack. However, there are various design options available to us. This article explores some of the options. Performance is deemed the overriding factor when evaluating the optimal approach.

..."

This is a cool article which looks at two approaches to providing hierarchal XML from a self-referencing SQL Server 2005 table (fish hook reference, parent - child keys, etc).

".Net 2 Solution to Serialization of Objects that Raise Events"

Rockford Lhotka - .NET 2.0 solution to serialization of objects that raise events

"In .NET 1.x there's a problem serializing objects that raise events when those events are handled by a non-serializable object (like a Windows Form). In .NET 2.0 there's at least one workaround in the form of Event Accessors.

The issue in question is as follows.

I have a serializable object, say Customer. It raises an event, say NameChanged. A Windows Form handles that event, which means that behind the scenes there's a delegate reference from the Customer object to the Form. This delegate that is behind the event is called a backing field. It is the field that backs up the event and actually makes it work.

When you try to serialize the Customer object using the BinaryFormatter or SoapFormatter, the serialization automatically attempts to serialize any objects referenced by Customer - including the Windows Form. Of course Windows Form objects are not serializable, so serialization fails and throws a runtime exception.

...

The end result is that we have declared an event that doesn’t cause problems with serialization, even if the target of the event isn’t serializable.

..."

Sigh... I SO could have used this just a few weeks ago.

(via del.icio.us/tag/.net - del.icio.us/burn_process/.net/)

IE/Windows VML Exploit - Short Term Fix

F-Secure Weblog : News from the Lab - VML Exploit - Internet Explorer

"...

It was discovered in the wild by Sunbelt. Microsoft published Microsoft Security Advisory (925568) yesterday regarding the issue. The update is currently scheduled for October 10th - the next regular patch Tuesday.

Like the WMF exploit it is advised to unregister the susceptible dll from the system as a workaround for the vulnerability.

To unregister the dll you should execute from Start, Run:
regsvr32 /u "%CommonProgramFiles%\Microsoft Shared\VGX\vgx.dll"

This differs slightly from Microsoft's recommendation - so as to include localized versions of Windows.

The vgx.dll component solely handles Vector Markup Language (VML). ..."

Note To Self: Do this on my all machines...

EAN-13 (and ISBN) Barcode Generation in C#

B# .NET Blog - EAN-13 barcodes in C#

"A couple of days ago I posted about Code 39 barcode generation in C# (and here). Today another more famous barcode is the subject of my blogpost: EAN-13. EAN stands for European Article Number and is a way to number products. It's an extension of UPC (Universal Product Code). More information over here.

One particular interesting application of EAN-13 is the fact that ISBN (International Standard Book Number) codes are also represented as EAN-13 codes. I'll blog about this too.

Mission goal

As we did with Code 39, we want to be able to do something like this:

Ean13 barcode = new Ean13("9780201734843", null);
barcode.Paint().Save("c:\\temp\\test.png", ImageFormat.Png);

The second parameter to the Ean13 constructor is an optional title to display on top of the barcode (will be handy for ISBN numbers).

..."

Another cool barcode generation example from Bart De Smet.

The ISBN reference is this reference that caught my eye (related to my long standing, yet uber lower low priority/paused background thread "My Bookshelf" project...).

Related Past Post XRef:
Creating Code 39 Barcodes in C#

Default Admin Passwords and Hacking ATM's

Peter Bromberg's UnBlog - Security WHAT? 75,000250,000 Hackable ATM's- and the manuals are ONLINE

"I just had to laugh at how incredibly stupid people can be after reading this Wired story about how some schmuck got the "Administrator" Keypad password (which you can get right out of the PDF manual, which you can search for, find, and download online -- and that's not the only ATM model you can do this with).

The password basically allows you to reconfigure the machine to think it is holding $5 bills instead of twenties and dispense four times the amount of money you ask for ..."

Sometimes I get bugged by systems/applications/web sites that require me to enter strong passwords or to choose a strong password on first use.

But there's a method to their madness. Some (some?) people seem to be pretty lazy, (err... um... I mean... very thrifty with their upfront time... um... yeah...) the above post helping prove that point.

If it's to hard to use a system, then don't. If you have to use it, understand its operation. And RTFM!

As a software developer, this is as much a "Note to Self" as a rant...  ;)

Wednesday, September 20, 2006

PrintForm Component 1.0 - Directly Print a WinForm

Microsoft Downloads - Microsoft PrintForm Component 1.0

"The PrintForm component is designed to bring back the ability to easily print a Windows Form. With this the new PrintForm component you can once again layout the Windows Form exactly as you want it and allow your users to print the form as a quick report."

Might be useful...

There have been times past where VB1-6's PrintForm did the trick for me...

Monday, September 18, 2006

TFS (and many more) Posters

DRP - developer readiness program - Posters

"Below is a list of posters in PDF.  These are suitable for screen-reading.  ..."

8 pages (at 10 per page) of PDF printable posters.

Here is what is on just the first page of posters (sorted by date)...

  • 0202 Microsoft Team System Project Panning
  • 0202 Microsoft Team System Project Source Migration
  • 3002 SDLC smartProcess
  • 3004 SDLC Unified Process
  • 3006 SDLC Scrum
  • 3010 SDLC MSF Design
  • 0000 PosterMap
  • 0000 System_NameSpace
  • 0001 Modeling Poster
  • 0002 Architecture

More than enough CuArt (Cubicle Art) for a while... ;)

(via Rob Caron - Decorate Your Cubicle or Office with Team System Posters)

Krypton Toolkit 2.2 Released

Component Factory Blog - Krypton 2.2 Released

"This release contains many new features including...

- New KryptonBorderEdge control
- Optional drawing of each border edge
- New gradient drawing styles
- 8 New Navigator Modes
- Various bug fixes and other minor improvements"
[Post leached in full]

The cool and still free (but valid email address required for download) Krypton Toolkit UI component library has rev'ed to 2.2.

I think I'm still using 1.0. Dogh! Time to upgrade I think... ;)

Related Past Post XRef:
Krypton Toolkit (Free WinForm UI Controls) 2.0 Released
Krypton Toolkit 1.0.0 Released
Krypton Toolkit 0.9.0 (Free Office-Like UI Controls)

Creating Code 39 Barcodes in C#

B# .NET Blog - Code 39 barcodes in C#

"Introduction

Code 39 is a specification for barcodes that allows coding of the following symbols: A-Z 0-9 - . $ / + % * space. The goal of this small project is to allow generation of barcodes using System.Drawing in .NET, with C#.

..."

In the far past (a few years ago) I was involved in a project that required barcode generation. One of the things I remember most is what a pain it was to deploy. Yes, deploy. Because it was done with the "simple" method of using a barcode font.

There wasn't time to create a setup, so the font had to be manually installed... OMG, never again. Either a setup (I know, I know... they don't take long...) or another method of barcode generation.

The font method is "okay" and easy at the time, but now it feels.. icky. It's an external moving part that I'd just rather not have to worry about. That is besides the price and licensing pain of a barcode font...

Which is why this article caught my eye...

If/when I play in barcode generation land again, I want to take a look at this approach.

SolutionZipper - VS2005 Addin to Clean and Zip in One Step

CodeProject - SolutionZipper: VS2005 Addin Cleans and Zips a Solution in One Step

"The code described in this article provides a simplified version of these add-ins. Specifically, SolutionZipper has a single-click-does-everything interface, which is what automation is all about -- saving time. There are no dialogs that present file lists, file names to be chosen, or user options to select. SolutionZipper does the following in a single step:

  1. Saves all unsaved project files.
  2. Cleans all available solution configurations (Debug, Release, etc.).
  3. Cleans all Deployment Projects.
  4. Zips all files in the entire solution:
    • The zip file is uniquely named: SolutionName_YYYYMMDD-HHMMSS.zip
    • The paths for all files are solution directory relative.
    • The zip file is placed at the same level as the solution directory.

..."

Nice.

(BTW this project is at v1.2 which was released yesterday, 9/17)

Now that I'm been able to start releasing some of my private/personal projects (like my WLW Text Template Plugin, etc) this will come in handy.

I'm currently playing the "Build/Clean/etc" game prior to zipping and releasing and it's just one thing I'd rather not have to remember. One click sounds cool... 

And if this one doesn't float your boat, check out the other two similar projects that Robert mentioned;

ProjectZip 1.6 - Zip up the source code for your latest CodeProject article

ZipStudio - A versatile Visual Studio add-in to zip up Visual Studio solutions and projects

(via .Net Adventures - A convenient tool for quick solution back-ups.)

Sunday, September 17, 2006

Text Template Plugin v1.1 for Windows Live Writer Released (and a Preview of v1.2)

V1.1 of my Text Template Plugin for WLW is now available on GotDotNet, WLW Text Template Download

Nothing changed between the beta and the release, so please check out my v1.1 Beta post for details on this release.

I'm now working on v1.2, which will include a number of refinements and suggested features (thank you Cynthia).

v1.2 Feature List:

  • Replacement of the listbox on the Select Template dialog with a grid, which allows sorting, filtering, etc of Templates.
  • Added Categories to Text Templates, which allow for cooler sorting and filtering
  • Added Icons to Text Templates, which let you associate an icon with a given template making it easier to identify and select a given template
  • Added a Preview feature to the Add and Select dialogs, which let you see your inserted HTML in its full HTML glory.

There's still a bit of coding yet to do on it (like actually implementing the Filtering  ;) so it's not quite ready for beta, but I'm thinking the coming week'ish.

Here are some screenshots of v1.2;

Here's a preview of the new Select dialog. Much prettier isn't it?


The updated Add dialog, showing off the Category feature.


Selecting an Icon for your new Template...

 


A preview of your new Template


The Categories are "smart" in that if you type in a new, non-existing category you'll be asked if you want to add it to your list (so you can use it again in the future)


The newly added Template


Showing off the sorting... Like most features of this plugin, the sort column and direction is remembered between sessions, so if you like to sort by Category, the next time you Select a Template the grid will already be sorted.

The Filter will work much the sample way. The last entered Title and Category used to Filter will auto-magically filled in for you, but will not be applied...

 

That's it for now... back to coding.  ;)

Related Past Post XRef:
WLW Text Template v1.1 Beta Test
WLW - Text Templates Plugin on WLWPlugins.com
My Windows Live Writer Plugin - Text Template