HackDay – It wasn’t for me

I have to admit, Hack Day wasn’t for me. The early afternoon was great, however when the hacking started the interest started to drop off for me for some reason.  So, I left 🙁  It was a shame, I had a few good ideas and things started to come together however I just wasn’t feeling the staying overnight and hacking.  At home I stay up easily, however I just wasn’t that interested yesterday. Oh well, you win some you lose some.  Everyone else seemed to be having a good time. 

HackDay Diary – Post One

Just arrived here at Alexandra Palace for HackDay. So far its very very different.  Sitting in the main hall which is darkened out with loads of tables in the middle of the hall with a large stage with the guys playing Halo.  Good news is, every table looks to have a series of power adapters underneath them so no worry about battery life – my laptop is currently hovering around the two hours left mark.

The first session was on “Your Inbox To Go – BBAuth and the Yahoo! Mail API” which how to link into the web services Yahoo offer for their Mail services. Sadly the wireless network went down because someone created their own BTOpenworld network – never mind.  The second session was based on BBC Backstage which demonstrated some of the prototypes developed using their API’s.  They offer a lot, hopefully I will be able to hook into them.  Third session was based on the new Geo services coming from Yahoo. 

However half way thought this the roof was hit by lightening, and the skylights opened up in the main hall.  It’s a little bit wet.  Still lightening and now everyone has been moved into the main foyer for there own safety.  So new blog post title:

HackDay a Washout

I think its pretty funny, I know its potentially dangerous but its not something which happens at every conference and will go down in history 🙂  However, it looks like we are going to be in here for some time.  Shame I haven’t got wifi and my battery is running low.

WiFi back up, battery charged.  Everything back to ‘normal’.

Technorati tags: ,

HackDay London Tomorrow

Tomorrow and Sunday I will be attending HackDay at Alexandra Palace.  Not really sure what to except, but i’m excited about it. Haven’t got a clue what i’m going to create, hopefully some of the pre-sessions will inspire me.  Sure it will end up being some mashup.  I am planning on posting how I’m getting on throughout the weekend so keep an eye on the blog. 

Technorati tags: ,

SQL Server 2008: SQL MERGE Statement

In an effort to get up to speed on SQL Server 2008, I decided to write a series of posts on some of the new features, as and when they are included in the CTP releases.  This post relates to the new SQL Merge statement.  Now, I say new but this was included within SQL Server 2005 Beta 2 however was pulled from RTM.  This kind of thing is one of the reasons why the team are only including near-complete features in the CTP.

The feature allows you to merge two tables together based on a set of criteria. The Merge works by stating a table where all the data should be merged into; the table, or query, where the data is coming from; and the criteria to decide if they match.  Based on this, the query can perform an action for each row such as insert, update or delete.  However, the action performed depends on the result of a row being matched from one table to the other.  There are three different matched clauses:

  • WHEN MATCHED THEN
    • Rows that meet the criteria.
  • WHEN [TARGET] NOT MATCHED THEN
    • Rows that do not match another row in the target table
  • WHEN SOURCE NOT MATCHED THEN
    • Rows that do not match another row in the source table

You can also set additional conditions on the matched clause, with different outcomes for each clause, for example
WHEN MATCHED AND tab.aValue > 100 THEN
WHEN MATCHED AND tab.aValue < 100 THEN

This example will demonstrate how the MERGE statement works.  Nothing interesting but helps the explanation.

Firstly, I have created two tables and inserted two rows into each table.

CREATE TABLE DataTable1 (ID int, DataValue varchar(50), Msg varchar(50))
CREATE TABLE DataTable2 (ID int, DataValue varchar(50), Msg varchar(50))
GO

INSERT INTO DataTable1 VALUES (1, ‘TDV1’, ‘Inserted’), (2, ‘TDV2’, ‘Inserted’)
INSERT INTO DataTable2 VALUES (1, ‘TDV3’, ‘Inserted’), (3, ‘TDV4’, ‘Inserted’)
GO

This is when the Merge query to merge DataTable1 into DataTable2.

MERGE DataTable2 AS mainData
USING (SELECT ID, DataValue FROM DataTable1) otherData
ON (mainData.ID = otherData.ID)
WHEN MATCHED THEN UPDATE SET Msg = ‘MATCHED’
WHEN TARGET NOT MATCHED THEN INSERT VALUES (ID, DataValue, ‘TARGET NOT MATCHED’)
WHEN SOURCE NOT MATCHED THEN UPDATE SET Msg = ‘SOURCE NOT MATCHED’;
GO

Breaking this down:
MERGE defines the target table which is the target for any insert, updates or deletes which are defined in the matched clauses.
USING specifics the source table. 
ON specifics the match condition.
When a row is matched, we change the message in the row from Inserted to Matched.
If the row (in the source table) does not match another row in the target table, we insert the row into the target table and set the message to Target not matched
If the row (in the target table) does not match another row in the source table, we update the message to Source not matched.

The actual statement which can be executed with the matched block has some restrictions, for example I couldn’t do WHEN TARGET NOT MATCHED THEN DELETE.

The result of this is merge is that DataTable2 has three rows:

1    TDV3    MATCHED
2    TDV2    TARGET NOT MATCHED
3    TDV4    SOURCE NOT MATCHED

Because we are matching on ID, ID=1 matched in both tables and because all changes affect the target table, the TDV3 row was kept and updated disregarding TDV1 row.  TDV2 was in our source table, however did not have a relating row in the target table and so was caught by our Target not matched clause. Finally, TDV4 was in our target table, but no row in the source data being merged in resulting in it failing under the source not matched clause.

In summary, this is a useful feature. Going to be a great help for people managing data warehouses.  It would be useful for synchronizing data, however I think there are more appropriate tools for that now (or to be) included. 

Reference in SQL BOL (Books Online) : ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_6tsql/html/c17996d6-56a6-482f-80d8-086a3423eecc.htm

Full SQL Query Statement : http://blog.benhall.me.uk/Code/Sql/SqlMerge.txt

Technorati tags: , ,

WWDC Keynote Roundup

The Apple Worldwide Developer Conference keynote was held today, this is a summary of the important announcements.

  1. Safari 3 Public Beta. Safari is now a available on both OSX and Windows with a public beta released today.  Apple are promoting quicker loading of pages (2x faster than IE7).  The beta is also available for OSX, and will be included within Leopard and as the browser on the iPhone.  Download now @ http://www.apple.com/safari/
  2. Electronics Arts (EA) are going to release games for the Mac.
  3. Leopard features demo’ed
    1. New menu bar, new dock, new feature called ‘Stacks’.  Stacks helps you keep a clean desktop by stacking the files in the dock and will fan out, or pop up in a grid.  Now all of your downloads are viewed this way. Keeps everyone happy with the GTD approach.
    2. New Finder, improved way to share documents
    3. 64Bit top to bottom
    4. Boot camp built in, no more burning drivers CD to install
    5. ‘Spaces’. Group applications in separate spaces, instantly switch between them.  Like desktop managers on Linux.
    6. 300 new features in Leopard.
    7. Basic costs $129.  Premium edition costs $129 😉
  4. iPhone will allow developers to write applications!  Based on Safari engine, uses Web 2.0 + Ajax, but integrate perfectly with iPhone services so they can make a call, check email, lookup your location all accessed via the web. No SDK required. Ajax on a mobile sounds impressive. Something which is missing on Windows Mobile.

Stacks sounds very useful and cool. Safari browser on Windows – do we really need another browser? However speed improves sound good and it will leave developers with no excuse for not having a Safari compatible site (I guess they are based on the same rendering engine) which is very good.  As for iPhone, great that they are allowing applications to link into the services, will be interesting to see their security model/approach, having Ajax support is definitely something which will attract developers. 

Technorati tags: , ,

SQL Server 2008 / Katmai June CTP

This week, Microsoft released SQL Server 2008 (Katmai) June CTP at TechEd. The ISO, or extractable zip, are available online at connect, just require registration to download, and are around 800mb in size.

I installed the CTP within a Virtual Machine running Windows 2003 Enterprise SP1.  On my first attempt, I was having a “Error 193” with regard to installing .Net 2.0 Framework.  It sounded like the dvd was having a hard time being read, maybe it was a bad DVDR, so I switched to using the mounted ISO and it installed fine, nothing overly special.  The installation process is very similar to SQL Server 2005 and installed happily under the VM machine.

Microsoft have said they are taking a different approach with their CTP releases for 2008. Instead of having lots of half complete features, they are focusing their efforts a lot more on having end-to-end features/scenarios completed (as much as they can be) and including them within the CTP and leaving out the half done features.  This means when you are trying a new feature, not only should it work, but also be a true presentation of what it will be like within the final release.  The team says its to help focus the feedback and development of the product, so not a repeat of some of the issues with 2005 Beta. The product overview white paper defines their vision for the release.

With the 2008 release, they have identified four key areas for features and improvements:

  • Mission-Critical Platform
  • Dynamic Development
  • Beyond Relational Data
  • Pervasive Business Insight

But what does that all mean?  I have highlighted some of the features from the white paper I think sound useful.

Mission-Critical platform revolves around secure and available data. 2008 includes transparent data encryption where entire databases, data files and log files can be encrypted within the server by simply ‘tagging’ the item.  Another new feature is the Declarative Management Framework which allows policies to be setup for managing the database instead of using scripts.  This sounds like it could solve many problems for companies, as it allows for a policy to span all the servers within the business, or have a policy for each ‘type’ of server, so development would be different to production allowing for a consistent management and server environment.  This should also make life easier for the replicating live servers within a test environment as it would just require the policy to be included/published.

Dynamic Development is based around allowing developers to work at the business entities layer instead of tables and columns, which is the ADO.NET Entity Framework, this isn’t dependent on Katmai but is in the same marketing wave.  There is also improved support for synchronisation of data for those “Occasionally connected systems”, this includes a new SQL Merge statement.

Beyond Relational Data, includes support for a seamless transition between relational and nonrelational data.  By including a new FileStream data type, you can now store BLOBS (Binary Large Object) to be stored in the file system allowing them to be managed by the database, but stored on the file system.  This together with integrated full text search allows for the database to store more kinds of data, for example documents or videos.  Along with this, Microsoft are including Location data support for creating location aware applications. This then can be integrated into Virtual Earth, which could produce some amazing business line applications very quickly and effectively and increase the uptake of business mashups.  This is not included within the June CTP.

Pervasive Business Insight is based around improving the data warehousing technology, together with new reporting functionality.  Two main new reporting features are the ability to author reports directly within Word or Excel and publish them to SharePoint.  The second being that Microsoft have acquired Dundas’s data virtualisation technology and it will be included within 2008. Migration from Dundas to SQL Server 2008 will be ‘seamless’ and you can start working with their components today in preparation. Very cool.

Not sure how long Microsoft have been doing this, but there samples for SQL Server are now on CodePlex – http://www.codeplex.com/MSFTDBProdSamples

Sounds like a very interesting time, lots of different things to look at.  It’s applications like this which are one of the reasons why I enjoy working in the real world, as being a student you really can’t see/understand the benefit as much.

Technorati tags: , ,

UK ReMix

I just saw on the Mix RSS feed that the dates for the UK ReMix conference dates has been announced – September 11 – 12.  Guessing these are still unconfirmed, but does fit in with what Ian Moulster has said on his blog.

If you have not heard, ReMix is going to be a Mix like conference running at various locations around the world.

Source : http://visitmix.com/Blogs/Joshua/attend-a-remix-event-near-you/

Technorati tags: ,

Acropolis, Katmai, and Visual Studio 2008

Just a few announcements which I have saw on some posts, but I thought I would post some information here as well…

Acropolis CTP has been released – “set of components and tools that make it easier for developers to build and manage modular, business focused, client .NET applications.” http://windowsclient.net/Acropolis/

SQL Server 2008 (Katmai) June CTP is now available for download from connect. https://connect.microsoft.com/SQLServer

More information on those two during the week when I have a chance to download and play… always playing never actually releasing anything 🙁

Bad news – Orcas has been officially named “Visual Studio 2008” – No release this year? http://www.danielmoth.com/Blog/2007/06/visual-studio-2008-stack.html