Saturday, February 21, 2009
The Reference Guide for the YouTube Data API is published at Google Code.  This API allows for you to get all sorts of cool stuff out of YouTube.  It's worth a look.

Today I am looking at just one of the functions available with this API: How do you link to all the videos published by a specified user. 

To get this data back, you will use a GET to a URL like this:

http://gdata.youtube.com/feeds/api/users/USERNAME/uploads?v=2

...making sure you substitute the USERNAME token for the YouTube user's account name.

Once you have fetched that XML, you can use the following XSLT Stylesheet to transform the XML data you get back into a HTML list of links:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
                xmlns:a="http://www.w3.org/2005/Atom" >
  <xsl:output method="xml" indent="yes"/>

  <xsl:template match="/">
    <xsl:element name="ul">
      <xsl:apply-templates select="a:feed" />
    </xsl:element>
  </xsl:template>

  <xsl:template match="a:feed">
    <xsl:apply-templates select="a:entry"/>
  </xsl:template>

  <xsl:template match="a:entry">

    <xsl:element name="li">
      <xsl:element name="a">
        <xsl:attribute name="href">
          <xsl:value-of select="a:link [@type='text/html' and @rel='alternate']/@href" />
        </xsl:attribute>
        <xsl:value-of select="a:title" />
      </xsl:element>
    </xsl:element>

  </xsl:template>

</xsl:stylesheet>


The first thing to notice is we have had to import the namespace of the ATOM format into our XSLT Stylesheet and have given it the alias of "a".  This makes the XPATH a lot simpler.

The other thing of interest if the condition put on the xsl:value-of in the a:entry template.  This is because there are a bunch of links against each entry.  Some for related ATOM feeds like the Related Videos feed and the Video Responses feed, there is also one for use with Flash.  But the one we are interested in is the alternate link with the type of text/html, and then select the href attribute of it.

It's been a while since I have posted an XSLT related item.  I've still been knee deep in XSLT, but this was just one thing that caught my eye.  Hope it helps.
Saturday, February 21, 2009 3:03:05 PM (AUS Eastern Standard Time, UTC+10:00)  #    Disclaimer  |  Comments [1]  | 
 Monday, January 19, 2009
Today I was looking at changing the filesystem path of a site in IIS using a command line tool or script.  Apart from general server maintenance, one use for this is when demo-ing a couple of sites from an XP machine.  The IIS on XP only allows one top-level site at a time, so a batch file was needed to re-purpose the site for different demos.

Method 1:  IIS 6.0 and ADSUtil:

For this one you will want to execute adsutil.vb that is installed by default in c:\inetpub\AdminScripts\

C:\Inetpub\AdminScripts>adsutil.vbs SET /W3SVC/87257721/ROOT/Path "C:\inetpub\temp


The script is self-documenting if passed the HELP parameter, and TechNet has some documentation, but these were both a little lacking and just using the script was easy enough to work out exactly which  parameters are required.

Method 2:  IIS 7 and PowerShell:


For this one you will want to install the PowerShell Snap-in for IIS 7.0 (In RC1 at time of writing) available in x86 and x64 downloads.

The command is then:

PS IIS:\> Set-ItemProperty IIS:\Sites\Blog\ -name physicalPath -value C:\inetpub\temp

You will of course want to substitute the site name and physical path with your own values.

Full Documentation for the IIS PowerShell Management Snap-In is over at IIS.NET

Monday, January 19, 2009 1:14:07 PM (AUS Eastern Standard Time, UTC+10:00)  #    Disclaimer  |  Comments [0]  | 
 Wednesday, September 17, 2008

I'm quite a fan of Google, and I have just had yet another unit of joy from them:

Earlier this year Google put together a new mobile version of their search site called Google LCB.  The L in LCB seems to be Location, but there isn't much of substance around the web on what the acronym really means.  Who cares!  It's the concept that matters.

So why is it good?

As can be seen in some of the screen shots around the web, users get to save a couple of locations in a list, and then drill through various categories of content to find what they want, including a distance estimate.  The key thing is you do this without typing on your keypad!  This makes it very quick to navigate.

I've made it my new home page on my N73!

Other Google services I can't live without on my phone are:

This is made all the more exciting with the news that the first ever phone using Google Linux-based phone OS - "Android" is about to hit the market.

Now all we need is mobile data plans that are a tad more reasonable on the hip pocket!

Wednesday, September 17, 2008 9:39:12 PM (AUS Eastern Standard Time, UTC+10:00)  #    Disclaimer  |  Comments [0]  | 
 Sunday, July 13, 2008
Is it just me?   Or does the new Yahoo!7 search bar look like a cigarette?



Not convinced?  The search bar at My Yahoo!7 is even less subtle:



Don't worry, I'm not one of those smokers who tries to quit and then sees cigarettes everywhere... I'm not even a smoker.  It just struck me as an odd choice for a visual motif.

...and it's not even the oh-so-cool, Breakfast at Tiffany's kind of cigarette.  Google would be the Audrey Hepburn of search cigarettes.  Yahoo7 are more the Danny Crane of search.
Sunday, July 13, 2008 10:35:34 PM (AUS Eastern Standard Time, UTC+10:00)  #    Disclaimer  |  Comments [0]  | 
 Tuesday, May 20, 2008
Today at REMiX '08 Sydney (Also see VisitMIX) along with a good show and a grand feed, attendees also got a copy of Expression Studio 2.  After seeing it in action I'm quite looking forward to taking it around the block.  I never quite got into [Macromedia|Adobe]Flash, and am quietly hoping Silverlight can find a spot next to it in the web ecosystem.

First thing I did when I got home was install Expression Studio, I got a little curious to find that there is a Visual Studio 2008 Standard disk in the box.  It got me to wonder what really is the difference between VS Pro which I am using at the moment and VS Standard?

I can't remember the product comparison pages for any version of Visual Studio on MSDN ever being completely illuminating.  The 2008 version is about as good as it gets it seems

The one that I am most interested in somehow is down the end of the list:  the inclusion of the Unit Testing features in VSPro 2008, when it was only included in Team System versions of VS 2005.  Here is a slightly abridged summary of the other features included in VS Professional that you do not get in VS Standard:

Debugging Tools:
  • Attach to Remote Process
  • SQL-CLR Debugging
  • XSLT Debugger
  • T-SQL Debugging
Data Tools:
  • Database Projects
  • SQL Server Projects
  • Server Explorer
Reporting:
  • Crystal Reports Application & Crystal Reports for Visual Studio
Office development:
  • VSTO for Office 2003 and Office 2007
  • Sharepoint 2007 State Machine workflow template
Smart Device Development:
  • Device Emulator
  • Project Templates
  • Debugging Tools


...but surely this can't be it?

It's not.  Well, this is the story if you are comparing VS Pro and VS Standard alone, but there is one other thing to consider:
  1. In my timezone, the full boxed retail VS Standard is less than half the price of the equiv. VS Professional... but;
  2. You can't get an MSDN Subscription including VS Standard.  They are only available with Professional and above, and imho the licensing benefits of MSDN for developers is well worth the look.
So there you have it.  If an MSDN Subscription is on your radar, enjoy using VS Pro.  If it is not, and you can live without the above listed features, well maybe there is no need to spend more than you have to.

Tuesday, May 20, 2008 10:56:04 PM (AUS Eastern Standard Time, UTC+10:00)  #    Disclaimer  |  Comments [0]  | 
 Monday, May 05, 2008
I recieved the following question yesterday, and I have had it before, so I decided to blog the answer.

Hiya James

I am not sure if you would be willing to help answer a question on sharepoint?

Sounds really stupid but just using MOSS and I have not had to deal with any SQL database ... so where

can I actually view it or find it?

Thank you

Ray



First up, it's far from a stupid question!  especially is Windows Internal Database (a.k.a SQLEE is used).  Let me explain:

So, there are a couple of choices for setting up the database:

1. Windows Internal Database

It is really easy to set the system up with this option, and frankly, I don't like it for my systems.  The reason I don't like it is because it splits my DR plan.  

For every other application I have a nice unified backup & recovery strategy in SQL Server Management Studio.  Using WIDB for Sharepoint introduces exceptions to the rule, and from my experience, the systems with the most moving parts are the ones that are most likely to fail under pressure, and DR can have pressure!  Of course YMMV.

What is Windows Internal Database?  It is an instance of SQL Server Express configured to be accessed only by services over named pipes, although it is possible to connect to it with SQLCMD or Management Studio Express.  It works just as well as SQL Express, but I feel like I am never fully in control of it.

If you are using SQLEE for your Sharepoint installation and you want to have a look at the database, I'd suggest the following:
  1. Backup your Sharepoint instance using Central Administration
  2. Setup a test instance of Sharepoint using SQL Express
  3. Restore your Sharepoint backup into your new test instance
  4. Use Management Studio to work on your new test database

2. Using "real" SQL Server. 

This is a much easier case.  Log into the Sharepoint Central Admin section and view the content database settings.  That will give you the server & database names that you can connect to with Management Studio.  (please work on a copy, not the production database)

...but...

...is it wise to get hands-on with the MOSS/WSS database?

Well yes, for general curiosity to see how the Sharepoint team decided to implement a system where entities can be so customizable, there is some good, subtle design to learn from.

However for reporting and other fiddling, I'd suggest not.  Once you see the tables I think you will agree that it was not a design goal for the developer community to be accessing them directly.

A good alternative would be learning some CAML or the Object Model first and see if you can leverage that.  Those ways to access the data abstract out the complexity of the physical database and are quite user friendly.

How to setup Sharepoint to use SQL Express rather than SQLEE/WIDB?

It is easy and free to set up a testing environment for Sharepoint:

All you need to do is download the following:

How to setup Sharepoint to use SQL Express rather than SQLEE/WIDB - Part II, The Install...

When installing Sharepoint, choosing Basic/Stand Alone will leave you with a WIDB install of Sharepoint.  To install a it with a "regular" SQL Server, or with SQL Express, first choose Advanced from the installation wizard:





When asked if you want to create a Web Front End server, or a Stand-alone install, choose Web Front End - even if it is your only server:



Continue the install and launch the Sharepoint Product and Technologies configuration wizard.   Choose to create a new server farm.  Enter the database server and database name settings into the wizard when prompted...




Now you have configured Sharepoint to not use WIDB/SQLEE.

If you have already installed SQLEE and now wish to remove it, please see my prior post on uninstalling SQLEE.
Monday, May 05, 2008 12:19:32 AM (AUS Eastern Standard Time, UTC+10:00)  #    Disclaimer  |  Comments [1]  | 
 Saturday, May 03, 2008
I offer the following evidence:




For those not familiar with the idea of a Googlewhack, Urban Dictionary explains it is:

a combination of two words that when searched through the popular search engine "google" only give one result.

Wikipedia goes into more depth, yet is silent on the topic of spelling.

I argue that stsadmin, or it's correct form, stsadm are not words, so can't be typos - and as such I'm claiming it!  :-)
Saturday, May 03, 2008 7:44:25 PM (AUS Eastern Standard Time, UTC+10:00)  #    Disclaimer  |  Comments [1]  | 
 Friday, April 25, 2008
This is just a quick note with some linkage for anyone who is looking for an easy way to make Sharepoint look less like Sharepoint ;-)

Some sample master pages have been released and are available for download.   They are good examples for basing new master pages on, but also look good too!   For screen shots see the post on the Sharepoint Product Group blog.

I'm using the "Clarity" one now and like it

Also, check out the Templates available at the MOSS site.

Listening to:  ANZAC Day pipes and drums

Friday, April 25, 2008 4:56:26 PM (AUS Eastern Standard Time, UTC+10:00)  #    Disclaimer  |  Comments [0]  |