SQL Server 2008 – Repeat Elements without a parent plural node

To Produce this: 
================
<ProductModelData ProductModelID="7" ProductModelName="..."
ProductIDs="product id list in the product model" >
<ProductName>...</ProductName>
<ProductName>...</ProductName>
...
</ProductModelData>

You need this:
==============

SELECT ProductModelID as "@ProductModelID",
Name as "@ProductModelName",
(SELECT ProductID as "data()"
FROM SalesLT.Product
WHERE SalesLT.Product.ProductModelID =
SalesLT.ProductModel.ProductModelID
FOR XML PATH ('')) as "@ProductIDs",
(SELECT Name as "ProductName"
FROM SalesLT.Product
WHERE SalesLT.Product.ProductModelID =
SalesLT.ProductModel.ProductModelID
FOR XML PATH (''), TYPE) as "ProductNames"
FROM SalesLT.ProductModel
WHERE ProductModelID= 7 or ProductModelID=9
FOR XML PATH('ProductModelData')

The key is the ", TYPE" after the "FOR XML PATH(''), the example on MSDN is missing this key component.

Spotify – How to snatch defeat from the hands of certain victory

First let me say I love Spotify and use it everyday at work, because I love it I feel compelled to discuss the company’s failure to captialize on their initial brilliant idea to use P2P networks as a way for people to choose the music they want to listen with either the advert subsidised or premium service.

What they got right was the business model and the user interface design. The software is easy to use, the obvious feature that is missing is improved playlist management. What I cannot get my head around is how long it has taken for new functionality to be added to the client to illustrate my point I trawled the Spotify blog for the details of releases during 2008 the list is below. Bear in mind development started in September 06′ and the first beta was released in May 07′ so by 2008 the software should have been pretty stable.

New features added in 2008 for Windows Client

  • User settings can be changed.
  • We mark all collaborative playlist (including your own) with a padlock icon.
  • Context menus have been added for the artist title on artist and album pages. (0.2.12)
  • a new start page with top lists has been added (0.2.12)
  • Spotify now pauses when waking up from hibernation (0.2.13)
  • A new view has been added to visualize the play queue. (0.2.14)
  • Growl support has been added. (0.2.14)
  • Dropping a link to a playlist, artist or an album on the play queue will cause Spotify to play future tracks from that source.
    (0.2.15)
  • History now shows the currently playing track as well.
    (0.2.15)
  • New streaming protocol (0.3.0)
  • Proxy Server Support (0.3.3)
  • Improved Buffering Algorithm (0.3.3)
  • Undo for playlist operations has been added (0.3.8)

So in the course of a year there are no notable features added, there was a ton of bug fixes and load of work done to polish the UI. The big question is why, were the team too busy firefighting or doing lots of work to the infrastrcuture or were they hampered by their choice of language and tooling whatever the reason it is shocking.

Spotify’s main failures

  • Not Entered the US Market / gone global
  • Not solved the scalability issues
  • Still missing some important labels / artists (ACDC / Oasis / Beatles etc.)
  • Not delivered any meaningful features to the Windows client for 3 years (with the exception of collaborative playlists)

As things stand they have left a clear path for competitors to come into the marktet and take the lions share. The barriers to entry are deals with the record lables and the p2p technology.
If you want to send feedback to spotify email feedback@spotify.com