Xsl and excluding a child node
Posted by Brett Robinson in Programming on January 28th, 2008
I was writing an xsl stylesheet to do xml transformation and I wanted to eliminate nodes based on their children, specifically if the parent nodes were the same. It was taking way to long to figure out how to exclude an xml node based on its descendant or child and poking around on the internet. I finally got it working and thought it might save others some time. Here is the xml and xsl:
xml:
<test>
<parent>
<mychild>hello</mychild>
</parent>
<parent>
<ourchild>world</ourchild>
</parent>
</test>
xsl:
<?xml version=“1.0“?>
<xsl:stylesheet version=“1.0“ xmlns:xsl=“http://www.w3.org/1999/XSL/Transform“>
<xsl:template match=“test“>
<output>
<xsl:apply-templates select=“parent“/>
</output>
</xsl:template>
<xsl:template match=“parent“>
<xsl:if test=“not(./mychild)“>
<correctChild>
<xsl:value-of select=“.“/>
</correctChild>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
result:
<?xml version=“1.0“ encoding=“utf-16“ ?>
<output>
<correctChild>world</correctChild>
</output>
Knowbody Knows for Facebook
Posted by Brett Robinson in Programming, Random Thoughts on December 3rd, 2007
About 2-3 years ago a friend of mine wrote a board game called Knowbody Knows. I was able to play a prototype of the game when it was being developed and knew right then that this game would be great. So, over Thanksgiving we had some friends over and we played this game again. Well, afterwards I thought that Knowbody Knows would be a great game to play on Facebook. So I called up my buddy who came up with the game and he gave me his approval. Well…a week later I was able to get it up on Facebook! Feel free to try the game here: http://apps.facebook.com/knowbodyknows/ and purchase the full board game here: Knowbody Knows Website.
I used the Facebook.NET apis and they worked great, so take a look at that library for developing Facebook apps.
A non-technical post for the readers
Posted by Brett Robinson in Random Thoughts on November 13th, 2007
I was talking to a friend about a week ago, and he said to me being facetious, “Why don’t you post something non-technical on your blog”. So, this is a non technical post on my blog.
Well, I got married last week to Laura Lepley! So that was a big event in my life and I was lucky to have many friends and family attend to help make it an truly awesome event. We put disposable cameras on the tables at the reception and here are the photos that were taken by our guests, enjoy:
![]() |
| Wedding |
Design Patterns Repository
Posted by Brett Robinson in Programming on July 13th, 2007
I went to a talk yesterday by net objectives called “Mocks, stubs and patterns”. Towards the end Scott Bain (the instructor) made mention to a design patterns repository that they were attempting to grow. I made note of the site and after looking it over, find it to be a pretty good resource. The reasons that I like the site are that the pattern pages show analogs to a non-technical example, limitations of writing tests on the patterns, and the cost-benefit(gain-loss) to using the patterns. Its in a wiki style, so as they update I can see this site becoming a great reference point for new patterns that are used that are newer than what’s in the GoF book. So, if you want to know the best way to write a unit test around the Decorator pattern, this is the place for you!
The Net Objectives Pattern Repository: http://www.netobjectivesrepository.com/
Copy PC files to Windows Mobile Smartphone
Posted by Brett Robinson in Programming on June 13th, 2007
I use my Smartphone (Dash) to store files that I frequently update and carry them back and forth from work to home, etc. I was finding myself manually copying some of these files a couple times a day, and also ran into the situation where I needed information on a file at home that I had saved to the file at work. So, out of this frustration, I wrote another tool. This tool maintains syncing files from your PC to your smartphone. Here’s how it works:
Upon installation, it places a shortcut to the application in the startup folder. Now it will start when your PC does. In order to get it to run right after installation go to your startup folder under your start menu, and click the Phone File Sync item. You’ll notice a little phone icon in the bottom windows taskbar right panel: 
This icon will have 3 states:
1. Green - phone is connected
2. Yellow - phone is syncing files
3. Red - phone is not connected
If you right click on the icon you get three (3) options:
1) Show Files to Sync: Opens up the application for file mappings. (double click on the icon does the same thing).
2) Sync Files: Forces a sync.
3) Exit: Exits the application.
Once in the main application (option 1 from above), you’ll see this screen:

I labeled each section and here is an explanation on what each does:
A: The list of files or directories on your PC to be sync’d with your smartphone.
B: Click to add a file to be sync’d
C: Click to add a directory to be sync’d
D: Once you do [B] or [C], and select a location in [E], click this button to add the mapping.
E: Smartphone file system. Select the destination after clicking on an item in [A] and then before clicking [D] to add the mapping.
F: Displays the mapped path on your phone. Click an item in [A] to see the mapping. There will not be anything there if you haven’t added a mapping yet.
Here’s the screen once you added a file from the PC:

Same file but now after I have a mapping, notice the mapped path now says where it is mapped:

The checkbox next to the item means that it is active and will sync with your device.
If you would like to delete a mapping, right click on an item in [A] from above and you’ll get a menu that pops up with the delete item:

The application will sync with the phone every 3 hours, or if you right click on the taskbar icon and force a sync.
You can use this with my password app and have some very cool ways of having your data on you at all times!
Also - I only tested this app using the Dash which has Windows Mobile 6 standard on it, and ActiveSync 4.5.
Download here: Phone File Sync [ 396 Downloads ]
JamBase.com Yahoo Widget
Posted by Brett Robinson in Music, Programming on April 23rd, 2007
I just created a widget that you can use in the yahoo widget engine for JamBase. The “hidden” screen displays today’s date and the number of venues that have bands playing there. The full “open” screen shows all the events and has an info link back to JamBase.com so you can view the event. Now it’s as easy as a glance to see who’s playing in your home town.
Yahoo JamBase Widget: download
I recently ported the code to work as a Vista / Windows7 gadget, just rename the zip extension to “gadget” and you can load it up. Plus you can tweak more preferenes than in the Yahoo widget.
Vista Sidebar Gadget: JamBase Gadget [ 208 Downloads ]
Here’s a screen shot from my desktop:

Low Vs. Diamond
Posted by Brett Robinson in Music on April 16th, 2007
I haven’t written anything about music lately, so I thought I would write a post about a band that I really like. The band is called Low vs Diamond and they’re out of Los Angeles. I actually grew up with the drummer, but we lost touch when we were about 13 and when I found out that he was in a band a year or two ago, I went to the site and listened to a few songs (back when they were called Colored Shadows). Anyways, they have a great sound and recently we got to see them play a show in Seattle on a small west coast tour they did. We hadn’t seen eachother in about 15 years, but it was just like old times when we hung out. They also just got signed by Marrakesh Records in London and Epic here in the U.S. Here’s their latest song called “Heart Attack”:
Also, check them out at their MySpace page and their official site: http://www.lowvsdiamond.co.uk/
BRobinson.net’s Readers
Posted by Brett Robinson in Random Thoughts on January 23rd, 2007
So, every so often I check out what keywords are used to hit my blog, referrals…basically all the stats of the site. It’s always interesting to see how people found the site and what they were looking for. Here’s a shot of all the locations of visitors that came by BRobinson.net recently:

So, thanks for stopping by! Also, check out my blog at Microsoft from time to time.
Widget Engine for Microsoft smartphone home screen?
Posted by Brett Robinson in Uncategorized on January 16th, 2007
The other day I was trying to tweak my homescreen on my SDA. I’m not fond of how it is setup and would prefer to have different items on the screen and in a different order. One thing that I was really looking for was a way to add another clock with a different time zone to my homescreen (and not have to buy a component for it). So, this had me poking around on a way to do it and I found a way to re-arrange the homescreen layout by building images and defining the x and y coordinates on where smartphone components would go. The thing is that you can place items wherever on the screen, but they HAVE to be defined as an element already in the smartphone OS. So, in order to get the clock, you specify
Here’s some images I prototyped:

One program to manage all my passwords
Posted by Brett Robinson in Uncategorized on January 1st, 2007
Recently I went to flickr and attempted to login and didn’t remember my password. Flickr then prompted me to enter in information that would help me remember my password (birthplace, first car, etc). When I register with sites, I usually put in almost garbage for every field. Then when it asks me to enter in “hints” that I left when I registered, I can’t remember. Another problem is that every site has their own idea of what a strong password and they make you change your most frequenly used password to fit their standard. Also if a site decides to have your login be a user name instead of email, your preferred user name could be taken already, so what you end up with is a lot of usernames and passwords to manage. So, after getting my account locked twice at Flickr, I decided to write a little application that would store my passwords. I finally had some time over the holidays and I wanted to refresh my C++ skills, so I wrote this application in managed C++ (I’ll attempt the native C++ version at a later time). There might already be a program that does this on the internet that’s available to download, but I didn’t look and just wanted to tackle it myself.
The basics of the program is a tree that has your websites listed and gives you a field entry for site name, username, and password. In the password field you can put a hint, or whatever you want to help you remember. Then when you save the file, it encrypts it and saves off the file. The only password you will NEED to remember is the one to open and unlock the application file so that it can be decrypted.
Now I just have this one encrypted file with all my sites, usernames, and passwords in it! I think I’m up to around 20 sites in my file, and find myself constantly opening it to find information.
Here’s a screen shot:
and the encrypted file opened in textpad:
I will never see your passwords, and there is nothing in this program that goes to any other web service or anything. (you can use reflector if you are still unsure).
As of 7/12/07 I have 44 entries stored in mine! Holy cow - it seems like every site makes you register now.
Use at your own discretion. Downloads as a zip file, and then run Setup.exe.
Download here: Store My Information [ 552 Downloads ]
Manage your passwords for free!

Recent Comments