Sunday, 30 September 2007

Software that sucks #1: Why you should do your testing on the train

This is a new rant series where I moan and exhibit my frustration with using some software that has been designed or tested by monkeys. I'll try as much as I can to be constructive and propose reasonable solutions, but sometimes there's just nothing to do to save software with poor design or engineering.

One more week-end, once more another 03:50 hours train trip. I do like these travel times as I feel I knock down work for this blog the most efficiently when I'm on the train.

One thing I don't have is proper connectivity. I have a Vodafone Mobile Connect ExpressCard for my beloved MacBook Pro, which does ensure a nice and easy 3g+ connection to the Internet wherever I am (how I wish apple would include a UMTS/HSDPA chip in their laptop so I could do without the express card). But you see, while France has a vast network of high speed trains on which they ensure mobile phones work (and Paris even has phone connectivity in the tube!), Shakespeare's land is not as gifted. Reception on the London - Manchester line is dreadful, with a few areas with 3G or 3G+ (if the train is stopped), some areas with GPRS, and a few areas where the signal drops too much for anything to go through. As a result, my card disconnects and reconnects every couple of seconds. And that's where I'll do my strangest assertion to date: If you develop any kind of connected application that may be used on a laptop, plan for your testing to happen on the train.

The regular loss of connection for a short while should be and is supported by the TCP stack to a certain extent. But your application *should not* rely on the connection being there. Separating the use of the data from the reception / emission of the data should be priority number one of application developers, and timeout / crash / retry management should be baked in. Outlook does this with it's offline Exchange mode, that separates the caching and receiving of emails between local and remote store, and the displaying of the local store.

However, Internet Explorer doesn't seem to work the same way. It has trouble with displaying web sites if the TCP connection gets suddenly suspended for a while: after doing a small network trace with ethereal, the data gets received again, but for some reason wininet decides to hang in there for a while and do nothing, even if you start a new tab. Closing and reopening the browser solves the issue.

Where it makes me scream is when it's not software, but drivers that encounter these issues. Like the ExpressCard driver. Has any of the engineers working on this driver ever tried it in low reception areas? Expect crashes, hangs, your mouse blocking for a few seconds. Absolutely dreadful. And all this on Windows Vista of course.

Technorati Tags: , , , ,

Saturday, 29 September 2007

MediaElement and MediaPlayer, and the ocx control fairy tale

As some of you know I'm always monitoring the msdn forums. I usually only step in the conversation when no one else had or when it's a complex subject I know something about. That leaves me with very few contributions :)

That said, I often read from Microsoft people and from external people that anything that plays in Windows Media Player will play in the WPF video elements, that it uses the windows media player ocx under the hood, or that the content runs in WMP in another process.

So I thought I'll clear up a bit how the rendering of video is done, from the few sources I've found and from some experimenting.

First I created a small WPF application containing a small video, and I ran Process Explorer on it to see what was actually loaded.

image

There's a few interesting things happening there which I think are interesting to naute. First let's review the components that are running. wmp.dll is the core library for Windows Media Player; quartz.dll is DirectShow related; evr.dll is the Enhanced Video Renderer; wdmaud.drv and dsound.dll are audio related; d3d9.dll is what is used for WPF rendering and part of Direct3D; and a bunch of filters like msmpeg2vdec.dll and some .ax splitters files that don't show on that capture. Finally, we have MilCore.dll.

We know that MilCore.dll is the unmanaged part of WPF, and is responsible for composition and rendering. It's built on top of Direct3d. We can deduct that MilCore.dll is the one implementing the audio / video playing, because it exports functions such as MilMediaSetIsScrubbingEnabled, MilMediaOpen, etc.

What we do also know is that for WPF to render video inside the composited graph, it takes whatever default DirectShow graph created automagically for a specific file, and replaces the normal rendering surface by the EVR. As explained on msdn, the EVR is a new renderer shipping as part of Vista that can be used for both DirectShow and MediaFoundation pipelines for rendering and compositing video streams. It's been said before that the renderer is also shipped as part of .net 3.0. Don't be surprised if some media center applications not built on WPF still have a requirement of .net 3.0 exactly for that reason: Leverage the EVR to replace the ageing VMR9. You can find more information on these on Msdn. Finally, the EVR supports a model where you can replace Presenters, aka the surface on which the video gets rendered. And we know from an msdn post that WPF ships its own Presenter.

In passing, that's where you may encounter scrubbing issues on XP. The presenter is the only component knowing intimately about your hardware. It's as such the one that will know about the vsync on your monitor. In XP, the custom presenter synchronizes with the composition engine, but that engine is only on one window. The windows themselves are still in GDI/USER32 land. Without knowing enough of how the composition engine works, I still assume tearing still happens exactly for this reason, even though the WPF content is a retained mode scene. On windows Vista, the same composition engine is used to do a composition for a WPF application or for the whole desktop. As I understand it, it is actually only one rendering tree, where GDI apps are just a node in the tree with a graphic, whereas a WPF app has a whole visual tree, which in turn is what lets the magnifier on Vista to properly zoom on WPF content.

Well, there you are. The difference between plain old Windows Media Player and WPF is large enough (different renderer) that there's no guarantees that a video playing in WMP will play without issues on WPF. All this still begs the question as to why is the WPF team using wmp.dll rather than go straight to DirectShow? I would place my bet on not duplicating engineering work, as Windows Media Player now supports initializing either the MediaFoundation or the DirectShow pipeline based on the file, and leveraging that support would save code duplication. Or it could be something completely different.

But what we can say is that the Windows Media Player process *is not executed*. We can also say that while it's true that there's a linking to wmp.dll and the use of COM interfaces, it is not possible to say if an actual ActiveX control or OCX is used or if some code is not leveraged for DirectShow/MediaFoundation graph construction.

Friday, 28 September 2007

Office Outlook Connector for Windows Live Hotmail's new version doesn't work!

Well, I was forced to do an update this morning and of course I can no longer access my Windows Live Hotmail account from outlook!

Windows Live team, with auto update comes great responsibility, and you just failed me.

Programming WPF 2nd edition

Just received this morning as part of my review of all the major WPF books, and what a shock. The first edition was quite short, the second is 800 pages!

Half way through the ChrisA, and quarter of the way in Nathan's, i'll do the Petzold last so I expect to be reading Ian & Sells book sometime in the next two weeks.

Technorati Tags: , ,

Tuesday, 25 September 2007

WPF Tips'n'Tricks #7: Smooth(er) scrolling

A common request with ListViews and other scrollable components is to have a smoother scrolling. By default, when a scrollable control contains items that control their own scrolling, it jumps from one item to the other, by the whole item height. It's not smooth because it's not animated, a step back in usability that I still cannot explain (lack of time maybe?)

The culprits are mainly the Panels like StackPanel and ScrollContentPresenter that don't implement smooth scrolling animations. While changing their behavior to support smooth animation is a way to solve the issue, and it may well be that I start implementing it for a future Tips'n'Tricks, but for now it's out of scope for this entry.

So how to prevent this jumpy behavior? Don't let the content decide how it's going to scroll! It's very easily accomplished, by adding the ScrollViewer.CanContentScroll attached property and setting it to false. Here's a small example:

<Window 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Smooth Scrolling Demo" Height="300" Width="300">
<Grid>
<ListBox ScrollViewer.CanContentScroll="False">

<ListBox.Items>
<TextBlock Height="40">Text1</TextBlock>
<TextBlock Height="40">Text2</TextBlock>
<TextBlock Height="40">Text3</TextBlock>
<TextBlock Height="40">Text4</TextBlock>
<TextBlock Height="40">Text5</TextBlock>
<TextBlock Height="40">Text6</TextBlock>
<TextBlock Height="40">Text7</TextBlock>
<TextBlock Height="40">Text8</TextBlock>
<TextBlock Height="40">Text9</TextBlock>
<TextBlock Height="40">Text10</TextBlock>
</ListBox.Items>
</ListBox>
</Grid>
</Window>

[Update]
Ronan is absolutely correct in pointing out in my comments:

There's a drawback when using this trick: when ScrollViewer.CanContentScroll is set you loose default scrolling behaviour of the ListBox which uses a VirtualStackPanel. On big collections you will notice a great performance degradation.

This is a complete oversight in this tips'n'tricks. Virtualization means that only visible items within a list will be created and added to the visual tree. Not an issue for a few items, but when you reach the hundreds or thousands, it becomes a necessity. When you set the CanContentScroll property, the virtualizing stack panel stops virtualizing and renders everything. Be aware of that!

And as is also pointed in that comment, making a smooth scrolling *virtualizing* panel is even harder.

Technorati Tags: , ,

Saturday, 22 September 2007

Multiple .config files

A good tip from Scott Hanselman. on how to manage multiple configuration files. I end up rewriting these pre-build batches every time I'm on a new project, now I'll have a central space to copy the code from!

Tuesday, 18 September 2007

Excel and Sql, or the joys of data massages

A problem we encounter too often is extracting data the business stores in an excel spreadsheet. The way some people deal with it is way too often to copy and paste all this in T-SQL code and have long integration scripts.

This causes two major problems. The first one is that you rely on your database to integrate data in your application from other systems. The vast majority of products have validation logic and application integrity checks into your application code, and rarely in the database schema. Not only that, but you suddenly expose as a public and exposed system what should remain an implementation detail of your service. In the end, you just made changes to your database structures an order of magnitude more difficult, which now decreases the maintainability of your code.

And don't even get me started on testability of T-SQL integration scripts, even with the new VS for database professionals unit testing. It just doesn't add up.

That said, the not to do is often the was done and conflicts with the needs to be done by tomorrow. Often enough a project cannot (or doesn't want to) afford a proper integration between their systems, as these projects come in expensive. Often, good enough is what the business wants, and the business controls the budget.

And in these cases, you often have to deal with data from Excel and Access. Few people actually know that you can query these files from within your T-SQL code, by using the OPENROWSET command, which gives you whichever table you want to select, through the table name or through a query.

In this instance I've just spent a good hour trying to understand why my excel spreadsheet opened through the OpenRecordset would return me a column full of null values when the spreadsheet itself had the correct values.

As usual, the answer is hidden in the knowledge base, KB194124. Excel tries to guess the datatype of a column, and gives you null if it fails. Rule of thumb, never trust anything that tries being smart.

Solution is to switch excel to import mode, by changing the connection string you use to add IMEX=1:

SELECT * INTO #xl FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=file.xls;IMEX=1;', ['Festival List$'])

And I'm back in business!

[UPDATE: Added some commentary. Also changed the text around a bit, sometimes I realize my English gets fuzzy when I don't proof read before posting. Sorry chaps.]

Technorati Tags: , ,

Friday, 14 September 2007

Executing Sql scripts from powershell

Realizing I still have 6 Tips'n'Tricks articles nearly ready to go to follow up on the series, but none of them are finished, I thought I'd give you another powershell trick.

One of the main issue on windows when interop has to be achieved between powershell and cmd is the issue of CreateProcess trying sometimes to be too smart about quotes. That's why powershell supports being called with a base64 encoded parameter as command line parameters, and why attempts to use variables when calling sqlcmd.exe fail miserably.

So I wrote a quick hack script that concatenates data in a nice batch file and then executes the batch file. I've used it on several projects by now. Anyone wanting to make it more fancy don't hesitate.

function Execute-SqlFile($file, [string]$Server, [string]$dbName, [hashtable]$variables, [switch]$WindowsAuthentication=$true, [string]$Username, [string]$Password) {
        $batch = (join-Path (cat env:TEMP) "exec_sql.bat")
        write-Host Connecting to $Server
    
        $output = (join-Path $env:TEMP "output_sql.txt")
        if (test-Path $batch) {
           Remove-Item $batch -force
        }
        $data = ""
        if (test-Path $batch) { Remove-Item $batch }
        $data += "sqlcmd -S $Server"
        
        if ($WindowsAuthentication) {
            $data += ' -E'
        } else {
            $data += " -U $Username -P $Password"
        }
        if ($dbname) {
            $data += " -d $dbName"
        }
        
        if ($variables -and $variables.Count -gt 0) {
            $data += ' -v '
            $isFirst = $true
            foreach($key in $variables.keys) {
            
                if (! $isFirst) { $data += ' ' } else { $isFirst=$false }
        
                $val = $variables[$key]
                $data += "$key="
                $data += "`"$val`""
                
            }
        }
        $data += " -i `"$file`""
        
        
        $data += " -o `"$output`""
        
        $data | Add-Content $batch -force
        
        cmd /c (Resolve-Path $batch)
        
        gc $output

    }

Which lets you call it like so:

PS C:\WINDOWS\> Execute-SqlScript "local.sql" "dbserver" @{key="value"; key2="value2"}

Enjoy!

Technorati Tags: , , ,

Wednesday, 12 September 2007

Mix:UK 07: Sneak Peeks

Bamboo flute playing with the audience.

Demo of 3D application showing someone's head captured with an MRI, followed by a foot, with bones and flesh being coloured. A sneak peek within us.

Sea Dragon: How to deal with high resolution images, that will be included in Silverlight 1.1 [EDIT: This is the technology used by PhotoSynth]. This lets you stream high resolution images. Demonstration of a commercial for a car that lets you zoom in very deeply until a corner of the image reveals text and a dashboard.

Technology to deliver ads. Project Gatineau is part of adCenter. Some of the demo should be available in beta by the end of the month. Through a report, you can see graphs based on the age of users, which is collected through LiveID.

There's also visualization technology which lets you see where people navigate. There's also a marketing campaign which shows a timeline.

There's a treemap visualization of traffic. This provide tools to let a web site owner to know where people navigate. You can subscribe for the beta on the advertisement web site.

Simon Peyton Jones from Microsoft Research does a presentation about the multicore challenge. Because of the increase in the number of cores, processors are not getting faster anymore. So you need to do task parallelism.

To do parallelism, you need to use concurrent programming objects that have been the same for 30 years, with no progress.

What's wrong with locks? First you can forget the lock, and you have a race condition. Or you take them in wrong order and you have a deadlock. Condition variables get threads to block if someone forgets to notify. And error recovery is very difficult. But theres worse. Locks are absurdly difficult. Sequential code is doable by undergraduate, locks and condition variables done right gets you a publishable paper at an international conference.

Atomic memory transaction: If we could wrap code inside an atomic clause, there would be all-or-nothing semantics: That's the Atomic from ACID. They execute in Isolation. And there's no lock.

How could it work? With Optimistic concurrency. Execute the code without taking locks. Each read and write in the code is logged to a thread-local log. Writes go to the log only, not to memory. At the end, the transaction tries to commit to memory. Commit may fail, then transaction is re-run.

How to do blocking? You could add retry. Retry says "abandon the current transaction and re-execute it from scratch". The system could keep a reference to all the reads you did and only re-exeute the transaction when one changes.

Locks don't compose well. If within an atomic code block there's a request for retry, the whole transaction retries. They also compose well with choice, which lets execute either a segment of the code or another. If code1 retries, execute code2. If code2 retries, the whole transaction will be retried.

There's a run-time cost, but a compiler technology and hardware support can reduce it a lot. It's better to have a correct program than a fast program. Finally transactions can even be faster as there's no locks and it's more fine-grained.

Graphs shows that it's actually faster than fine-grained locking, while being more scalable.

Atomic blocks will be a step forward. IT's like using a high level language instead of assembly code. It's not a silver bullet, you can still have concurrency errors. You can still introduce bugs, but they're much more interesting bugs.

There's a implementation available today in STM Haskell: http://haskell.org/ghc Theres a tutorial on STM in the book beautiful code And there's other papers at http://research.microsoft.com/users/simonpj/

Demo of a video tool that lets you drag and drop videos on a timeline in low-resolution, done in Silverlight with Sharepoint integration.

Expression Web 2 supports PHP!

LiveStation: Silverlight application streaming video from a peer2peer network. There is no browser!

There's a game coming out soon: Halo3! With actual footage from the game.

[EDIT: And finally, we've all received a copy of Vista Ultimate and a copy of Expression Studio! Which is fabulous considering I moaned about wanting a license to Expression Studio at the dinner the night before!]

Technorati Tags:

Tuesday, 11 September 2007

Mix:UK 07: Cloud versus Client

Panel debate. [EDIT: You'll have to excuse me but too many names to write down.]

Chairman: First question, for Danny that comes from Google that worked on Gears. Danny: One of the first question is, what if you loose the connection? You have offline storage. Google Gears have that, Isolated Storage in Silverlight is another one. When you look at rich applications, versus rich apps on the client, you always need a backup plan for offline. For a game, where content is downloaded, you can run offline. For a big database system like email, you can emulate or proxy until you go back online.

ScottGu: The concept of offline storage is an interesting one in the web. It's usefulness is questionable, because of interop. When you build apps, you have a responsibility to make it work. It can be daunting if a new browser come, etc, if you want to guarantee availability.

Danny: I think it's a question of how in the long term we want the browser to involve.

Speaker 5: Offline issue is less a problem because silverlight streaming is highly redundant. Writing is on the wall for traditional hosting. If it's highly available, and can be delivered in the cloud, it lower my cost, why would I need traditional hosting?

Michael Ford: I commute 2h a day. I have a 3G card. I use Google reader, it's integrated with Google gear, download the feeds and as the connection goes in and out the connection is seamless. In my company we're working on a desktop application that is computationally intensive. What silverlight lets us offload the calculation engine on the client. It's also better security as it runs in a sandbox makes it interesting.

Rob Blackwell: What bothers me is the user experience piece. The evolution has been to provide richer and richer interfaces. If you look at the horse power of chips and networks, everything is available. We're nearly at the point where it's an exponential curve. We're going to see tremendous increase on the client and people will want to increase the quality on the UI, like HD DVD. When I go on holiday i easily fill 10GB.

Chairman: Angus arrived.

Danny: There's two points. The client cloud offline storage there's two model. First there's a copy of the client, or there's a cache on the client. You still need to think of it being on the cloud. As PC and devices use expands, people have access to the Internet on many different devices. Their personal life experience is available on all this, this is very empowering.

Public: We do that on email, flicker, etc.

Danny: How long after gmail did someone hacked it for a GDrive.

Public: How do you keep people confident with storing their data in the cloud?

Speaker 5: There's a lot of issues with that and it all comes down to terms of services. Service agreements are usually missing, you can contribute with terms of uses that don't guarantee you'll get your data back. Microsoft does a lot of work on that.

Michael: I have a gmail account, I archive everything, but I always have half an eye that someone is keeping it.

Rob: What about the enterprise scenario, they're not always technologically savvy.

Danny: With Oracle, if you stop paying, they take your data away. With the advent of larger data centers, on top of that there's SO. Microsoft has audits about privacy but thats just because of antitrust. There should be audits for everyone.

Public: Large amount of need for space is copyright material. If we move t the web, who controls that, if they move copyrighted dvds, music, etc.

Danny: On the thousand people uploading the same CD, there are tricks and techniques to recognize patterns. Don't know how many data centers do that. If it's cruelly high security type storage that most vendors don't do, theyre not the same bits because partitioned. There should be personal backup copies as per the law so shouldn't be an issue.

Phil Winstanley: Copyright is a big issue. Cloud based projects go and create mash ups. People can create more and share more, rather than distribute songs like they used to do.

Public: What about mesh computing and going on other machines.

Speaker 5: Silverlight streaming is about storing and delivering. I get the ability to build applications on top of other platforms that i couldn't have done on my own. It provides a model for distributing computing.

Danny: The mesh computing causes an issue if there's a single point of failure thats covered but if your connection go down you're screwed.

Public: What about WiMax? I have 250Gig hard drive on an ipod, connect it to the network. If you have enough bandwidth at home you don't need the local storage. But if the connection goes down, you dont have it.

Danny: And the more bandwidth available for you, the backbone needs to be able to scale. Not sure if the economics work.

Public: You're held hostage by people providing the bandwidth. They want a share of it for high bandwidth providers.

Dany: AT&T blames google for that situation. If google makes money out of ads on youtube then they should pay a share of the money.

Public: We're on a technological rift. We were client-server. Then the web. Now we put the execution engine back on the client, stil going to the servers. What about an execution platform on the crowd.

Michael: I prefer client applications to web applications. I don't think the browser is a fantastic platform for a rich client. With silverlight its getting better but I need my calendar always available.

Public: Why use google reader instead of outlook?

Michael: Outlook? Ouch. No there's probably clients I could use.

Speaker 5: It's different this time becase there's a huge network. Now were looking at the web as a platform. We have more functionality and services.

Danny: There's a balance that's hard to drive in either direction. There's more processor time available than a user will use at any time, whereas how many technical problems fit into a mesh network. It doesn't work on little probems very well.

Phil: Browsers are not designed to do what we make them to do. We can't wait for the browser to give the functionality anymore. Thats a fact of development.

ScottGu: The browser has a lot of challenges. From the distributed perspective, the browser changed some things for the better. Each app used to be a silo talking to one database. Now you can link to a blog, to a profile, my mom using an app doesn't know using the application goes to the web. Silverlight, flash or server processing. The web taught us asynchronous programming in a distributed way. The expectation is for the app not to freeze. Considering how wide is the network we work on. You gonna see people use AJAX, client, Silverlight, Flash, and combine them. The end result will be richer than it's been on either the server or the client.

Danny: Cross domain security for the browser. The browser is secured for cross domain. At the time it was a reasonable compromise, vertical and monolithyc, except viruses. But vendors have evolved faster the browser and we now hit the issue.

Speaker 4: If you use the conchango application on the USB stick, its going online for some services, but it works offline. If you have a client running many operating systems then you want the browser. If you control the platform, you can do client. With Silverlight you have an easy way to leverage your assets.

[EDIT: Missed a question there]

Public: What can the panel say about issues with the cloud?

Danny: Issues with the cloud, there were vulnerabilities, then they could get a huge amount of data in a very short time. That's why datacenters have proactive security, and kill parts of the network as needed.

Angus: There's a bot that's more powerful than the fastest supercomputer in the world. That's waht happens. Security: first version of facebook. Viral invites of people, the installation of the application exponentially.

Speaker 1: What happens with privacy, there's been a couple of password. Did the password come back or is it a new password. If it comes back, it's been stored unprotected. What if someone hacks in the system, suddenly they have all the passwords.

Danny: On the same vein, to do our Live Services available to developers, we have to do these exercises, the user has to see the data transferred. That puts the load on the user and makes the process more difficult.

Angus: It's at the detriment at the user experience. Nothing can be rosy when you share a bed around.

Public: TKMaxx had issue, it's not only the cloud, it's the same issue.

Public: Originally, we did online bank access. They now send card readers to swap your card and PIN [EDIT: SmartCard]. But on the other hand they send faster. If i'm in the USA I can't. The very big commerce sites will start doing propriotary ways.

Public: The net will end up in anarchy and end the human race.

Danny: I'd like to comment on the behavior changes. We see that already. The young generation have a completely different view of their personal data. Things like myspace, they don't have much worry about who see their data. There's already a cultural shift.

Phil: People are more open, they write a public diary 16-24, and what they put in there is quite, hum, interesting. Personal knowledge of someone is very powerful.

Public: Cambridge people were showing themselves on pictures getting drunk and they got fired.

Rob: My father used to distrust banks, and keep the money under the mattress. There's been a change there.

ScottGu: Same issue existed 10 years ago. Now they just take this for granted. If a company wants to stay running they have to protect my information. Today there's a lot of issues with law firms, can you buy people's private data. That's going to be an interesting shift.

Angus: Some company wants to spend money to know me to tell me what I want.

Public: From a disaster recovery point of view, with the cloud everything is still available. If you need high availability you're better off on the cloud. Access is not an issue.

Danny: In your home network you have the same reliability issues. You share documents but if a machine goes offline or your wifi goes offline you can't edit your word document

Angus: I think replication across the cloud is the killer application.

Public: Is there a way to have server only code?

ScottGu: First, can we have a core framework, with core set of libraries? That's what we use in silverlight, Server Core in Windows Server Core with no GUI, with IIS. You can't run .net code yet but we'll see in the future. You'll see more factored versions. Silverlight is the first version where we pulled all these things out.

Public: There's so much data now compared to a few phone numbers before. Young persons now just drop their email address when there's too much junk. Data becomes very disposable. As we go on how do we deal with that volume of data ad use it to our advantage.

Danny: I think someone said that information available in our day to day life per person is equivalent to one you had at all 10 years ago.

Public: 8 or 9 years ago, it was LiveJournal, then myspace, facebook. But they change, trends change. Wikipedia may be available for a few years.

Public: How do we get around legal issues across boundaries, data stored in the US about users in Europe for example. How does that work with a cloud.

Danny I do know that companies specialize in offshore data.

Phil Winstanley: mp3.com has shown that it was legal in their countries. It's unresolved.

Angus: if you shift a lot of data to China, its going to be expensive, you're better off having a datacenter there.

Danny: As for corporate use, privacy and protection, security metrics will be about IP addresses and MAC addresses access. As part of SLAs and Terms of Use, there will be clauses about where the data have to be stored. It's building fences that data centers traditionally don't have.

Michael: its no more of a problem if a small company starts trading in another country. Like antifascist laws in Germany prevents you from providing Nazi content.

Danny: Can a local market censor for everyone what one country sees.

[UPDATE: Added names for speakers and corrected some spelling mistakes]

Technorati Tags: ,

So far so good...

Lot of typing but its worth it. Hopefully people will find the content useful. Note that I mostly retranscript what's being said, so when I type I its not me talking. My comments are in bracket with a big EDIT: in the front :)

I am the culprit

Two softies blog about someone blogging like crazy at the back, that would be me!

http://blogs.msdn.com/dthorpe/archive/2007/09/11/blogging-at-remix07-london.aspx

http://blogs.msdn.com/angus_logan/archive/2007/09/11/blog-envy.aspx

Mix:UK 07: Building next generation web applications using Windows Live Services

Integrate different applications together. End users will go and download the messenger client and interact with the messenger service though that tool. Our idea is to open that service to empower developers. They'll benefit from our scale, user base and services.

There's a break down in the live platform: Rich media expriences. Silverlight well push it and stream it for you. Storing and sharing, we have messenger, all your contacts is a shared infrastructure across all our services. If you have a blog and use spaces, it goes there. We also have photo sharing. Automated agents with AI on messenger. Alert infrastructure, we send million of them at 9am and they'll turn up instantly on messenger and a few minutes later by sms.

Live.com, search, maps is the Find and Locate.

And what we announced last year at mix was to say we'd have one set of use for everyone. As a developer, a company, you read these TOCs let you use everything for free, within a cap.

Dynamics Live, Office Live, XBOX Live exist too but they're not tightly integrated, so they're not handled by us and we don't look at them.

Silverlight streaming. It's on microsoft infrastructure, and it's free. You take your application, your video, the application in its whole, like the Scrum board, and uploaded on our infrastructure where we'll manage the storage, the distribution, the backup of it, you don't need to pick up the bill for streaming it. When we go from alpha to beta, you'll be able to stream a million minutes a month for free, and above that we'll figure out a way to solve that issue.

How to use it? If you 're a developer, you go to http://silverlight.live.com with your windows live ID, it'll give you an account and you get your 4GB bucket for all your code. Once you have the application and signed up, you can upload through the web interface, which is more for a one off. If you do this a lot, user generated content, thousand of files, you can use a REST (some would say HiREST), with PUT/POST/GET/DELETE. It gets distributed to our CDN and you don't have to worry about it. Someone in China will get in a local cache for fast access over there.

How do you fetch information from there? For the Halo3 Service, all the videos come from Silverlight straming. When a user browse to http://halo3.msn.com they get all the html and javascript from that server. But you can either do a javascript or an IFRAME integration. The browser will then call our Silverlight CDN and pull down everything from there. Or you can just decide to pull down the videos, and keep the flexibility to keep your application and use our servers for the video.

Three steps, Creating, Uploading and Consuming.

Demo

Opening Expression Encoder. Was released in final version last week on the web. If youre running Vista there's three default videos, import them in Encoder, decide the encode rate, but what we want is look at the output. We choose a template. There's one small window called Publish thats an add-on to Encoder that we'll see in a bit.

We encode the video, the template gets outputed in the output directory. This encoding will take a short time, 10 seconds microsoft time.

Question: Why Microsoft gives this for free? It's a big bill, but we're saying upload your content, at a later time when you go over your limit we'll exchange more bandwith with ads. We don't know yet. The long part of the tail, the free bits, are paid for by the top of the tale, the ones that pay for it.

I got all my rendering done in my otput directory, and there's a few files i want to delete, silverlight, csproj and htm files that are used to be opening in Blend, delete them as they're not needed on the sliverlight CDN. I'll go to http://dev.live.com which should be your favourite web site. It's got SDK, samples, RSS, etc. One of the tasks is creating apps with the encoder, which gives you a full tutorial for it.

You need to create a manifest file which is an xml file. Its a silverlight 1.0 application, you can also upload 1.1. You decide which js files and which functions are called. You right click it and zip the manifest and add all the other files. Make sure you zip them at the root of the zip file or the content won't get uploaded.

You can go to the silverlight web, and you can manage all your applications from there. You can from there upload the zip file you created, choose a name and upload.

We only allow you to upload 30meg chuncks. The video portion needs to be less than 22MB. If you go over 12 minutes of content, you go over the MPEG limits, break your license.

You can launch the test application page from there and will load the content from agappdom which is the silverlight CDN network. We can do up to a terabyte per second of bandwidth for video streaming.

That was the slow way, let's look at the quick way. I have a web service in a solution within visual studio 2008 and i'm going to debug it to show what is going on. There's a couple of webmethods. One is UploadFiles. You pass the file from the test page, give a title and click Invoke. The code in the demo sets the URL to the address for the account id (http://silverlight.services.live.com/accountid), pass the data as a POST which returns an OK response. And it's been uploaded programmatically automatically.

So how do we fetch this data programmatically? We call a GetVideos method. Same URL, call a GET. One thing we're lacking a way of capturing additional metadata, for example GeoCode. You can do it manually by escaping data and uploading fake names. The web service can then return this data after decoding it. From the web service data, we get the address for the IFRAME we can put on our application. You can also get the IFRAME address manually.

Question: How did you add these extra attributes? I encoded the data and Base64 encoded them and put them as filenames. It's a hack and we'll hope to fix up.

Question: What happens if you use all your minutes for bandwidth time? It won't disconnect you, we haven't locked it down yet. Someone will shoot you an email telling you you're popular and wanting to help you more popular.

Virtual Earth is used a lot in the UK. There's a lot of aspects to it. The user experience is from http://local.live.com you can get maps, or see my street on birds eye view, or New York on 3D. They have not much to do with development. What we do is manage all the data, 14 petabytes of data, for our service. A while ago we opened it up for developers to leverage. You can use the mappoint service you have a SOAP api. You can embed a map with a javascript control. If you want to do tricky stuff like overlaying things then you can use things like Map Cruncher.

Demo of Virtual Earth.

From http://dev.live.com, you have cookbooks containing examples, that show the example, source code, references from msdn and interesting links. It shows the javascript code to show based on Longitude / Latitude, which you can get easily by lookig at the URL when you're browsing the live maps.

In this demo it's all javascript so no code behind. There's a reference to the javascript map control, and we call the GetMap, Load the Map, set the zoom level except you can't look up, we don't have that yet. We have a map showing up, its all running off the live code.

We want to push the video we saw earlier onto this map, and we do that with a pushpin. How do we do that? Back to the virtual earth SDK. There's a tool to add custom shapes, you can look at the code, and see the javascript to do that. Copy and go back to the code, we add the pushpin, add an icon, change the style, add a description. Then we call the javascript code to pull the videos. What we do is add the ScriptMethod and AJAX extensions to call that web service.

In action, there's now 3 pushpins on the map. In the Virtual Earth SDK you can add HTML content to the pushpin which lets you show HTML data whenever you click on the pushpin.

You can also switch to bird eye view or hybrid view, the pushpin is still there.

SportsDo shows a bird eye view of the trajectory of a run above a map. The thing works to where people were swimming, and in bird view you can follow their trajectory!

Another is skiing in Les Arcs, in 2d View you have a pushpin of a geo coded picture. If you switch to 3d mode. The 3d is an ActiveX control, so you can choose high ef or low def experience.

Looking in 3d you can see the contour of the mountain, and you can sin the demo around and the track followed by the skiers is still there. There was no programming changes done at all.

If you have an xbox controller, you can plug it into your PC, it will control your 3d view.

Switching to hubrid mode you can see the textures on top of the geometry of the mountain.

Last one is booking a tour of Toronto. Pictures on a Windows phone, everything gets uploaded and geo-coded. In building view you can zoom in and see the pictures overlayed on the map in 3d view of the buildings. As the track followed gets animated, the icon is automatically put behind the buildings which lets you follow where he was going. I encourage you to have a play on our site. We thnk it's a great example of what can be done with 3D.

Windows Live is opening. People have their worlds in Hotmail, Messenger, etc. If you;re doing any silverlight development, deploy it on Silverlight streaming. With one click of a button from encoder you can publish immediately. On Virtual Earth, you code once in javascript.

We have another session covering everything else on Wednesday at 12:15, covering Messenger, and some pre-release things.

Question:

What is the 700kbs limit? If you load 5 files from your domain you'd get 5 times the bandwidth. What we enforce is the average. We've capped to test how good we push on the server.

How much does it cost for Virtual Earth license for a company? I don't know come see me and leave me your email. Mappoint is another technology, which is a sister of VirtualEarth you may have to choose between the two.

Is it possible to host asp.net services on silverlight streaming? No it's about silverlight content only. You'll still have a web host for a rich asp.net experience, we only provide the silverlight answer. 3 million map tiles for free, above that there's a charge, we can put you in contact with people. There are commercial terms on search, 750k queries for free even for commercial terms.

The 22MB limit, is it going to change over time? Although it's streaming, are you doing http download of the videos? First, 22MB is a temporary which will be changed over a time limit, as long as it stays under 10 minutes limit. We'll be able to offer commercial terms, but there's MPEG royalties involved. The streaming, it's only Http.

What about live video? We don't support live video, but we offer the Windows Media Services as part of Windows Server.

On the Virtual Earth API, it looks different from maps.live.com? No answer. There's nothing different from the demo.

You mentioned an IFRAME part, where do you get the IFRAME URL from? It's in the SDK and it's released so you should be able to get it through there. It's appID and accountID.

Is there a Silverlight compatible api for VirtualEarth? Right now it's not possible, someone may be working on that. An aspect of that is that silverlight 1.1 can call out on javascript, so you can reach to the javascript code from silverlight 1.1 .net code.

Is there any plan for windows live access to receive and send live messenger? From a server point of view, we bought a company which are Windows Live Agents with an SDK ported from Java to .net to program bots against the Messenger platform. We're running an alpha and search for Windows Live Agents you'll find it. There's a lot of things that will be included in the future with contact lists.

Technorati Tags: , ,

Mix:UK 07: Building Silverlight applications using .net Part 2

I wonder if I made the right decision to only blog the second part, we shall know very soon.

Questions:

Availability: The control toolkit for silverlight, will be full source soon.

Is it possible to rename assemblies to help with SharePoint? By the next refresh, instead of building the assemblies in separate files, everything will be zipped in a common package: Secure request and dynamically compressed.

Is there a date for CE support? There's a CE version of Silverlight that was shown at the Las Vegas Mix conference. The issue is the distribution aspects on phones. We're trying to sort out a few of these issues.

For those that missed Part 1 [EDIT: I'm the only one in the room it seems], there will be a link to the slides at the end of the session.

As it happens, Part 1 was about Shapes, Controls, UI, with no code. Part two we'll talk about events and write some code, how you can create your own controls, and tak about some of the non UI aspects like networking.

You need to name your controls, which then lets you address them programatically. That's what you'll use to bind events.

The Page_Loaded event is called when the app has been downloaded, which means everything referenced inside the XAML file, including images and videos, the event won't be fired until they've all been downloaded.

What you would want to do is to load all your assets as a background task instead of waiting for everything has been loaded.

Everything youve downloaded goes through the browser cache. You don't have to download assemblies or videos twice, the browser cache handles that.

Question: Can you download byte level access to what gets downloaded? Yes we'll see that later.

You can go and bind event on any UIElement, like MouseMove, MouseEnter, tc. Al shapes and controls derive from UIElement.

You can wire your event inside your XAML file, passing it the method name that will get executed, which is similar to the way it's done in asp.net. Instead of having OnMouseEnter uses MouseEnter and doesn't have the OnXx syntax.

You can also use the Handles keyword from code in VB, or in CSharp in the Page_Loaded event handler.

Question: Can you link to external handlers? Absolutely, not declaratively, but procedurally.

Demonstration: It's a blank page, and wherever you click, it shows a text saying "Clicked". It shows code getting the point where the mouse clicked, create an element, and set the Canvas.Top and Canvas.Left attached property to the newly created element.

Another demo changes the color of a sphere whenever clicked on. By having an Ellipse in the XAML, and in code behind, the Brush, Stroke and Fill properties are being modified programmatically.

It would be painful to add shapes every time you add a button, so let's look at example 3. Three buttons. They're wired to handlers.

Dependency properties will be supported in 1.1, but not sure if property triggers will be supported.

We want people to use Events for designers to stylize the buttons without having developers writting all the wiring code.

To build your own controls, you can do that. You derive from the Control base class. You have full encapsulation, use any shape, controls, brushes, transforms, etc, and expose your properties methods and events you want. They get hooked up to XAML.

As a control developer you can take advantage of the InitializeFromXaml method that lets you get a XAML tree from a string.

To be XAMLable, you have to have a parameter-less constructor, have public properties and public events.

Demo of creating a custom control

You can crate a Silverlight class library. Once it's created, you can add a Silverlight User Control. The XAML from the resource is serialized as a resource, and the partial class loads it from the resource and uses InitializeFromXaml to load it.

There are still a lot of feature missing: TextBox and Input controls are coming on. Layout managers are coming in the final release too. Databinding and DataTemplates, and styling support. All these features will show up in 1.1.

For business apps they are essentials, so it would be a bit hard to develop Silverlight business applications, so you may want to wait.

Is there a licensing model for third party licensing model: There will be a DRM system within Silverlight so you can implement your own.

Is there a way to share common controls so they don't get downloaded all the time? There will be a mechanism for trusted web sites for clients to download only once. There is a versionning policy so if there's a specific version, you bind to that, and we bind versionned, so theres no conflcit there.

One of the core things we try to do is to integrate with existing document to use .net or javascript and HTML in the same application. If you build a .net application, you can import System.Windows.Browser which lets you reach outside and get the HTML DOM, works on all browsers. There's an HtmlPage object so you can navigate to other pages or get all the documents. You can use the GetElementByID to return a reference an object in the page from your code. You can use an AttachEvent to attach a DOM event and give a reference to your .net method, in any language, CSharp, VB, Python, etc. The code for AttachEvent works across all browsers because it's the .net code, it is not related to the javascript way of attaching events.

Question If you want have a client side event handler, what happens? AttachEvent respect the existing attachments.

You can reach out from Silverlight in HTML. You can then do the reverse by exposign public methods in the silverlight controls that you want your javascript in the page. You can mark it with a Scriptable attribute, and register the Scriptable object. Then you can call the FootballData object you registered and call the method marked with the Scriptable.

Question: Would you get a Javascript error before the Silverlight control is loaded? Yes you will, you can check a method to see if the silverlight control is loaded.

You can use Permalinks, integrate forward / backward navigation, etc. We support both simple and complex types across (complex type support not ready yet).

Question: Can you render HTML within Silverlight control? Absolutely. Someone build an HtmlTextBlock for Silverlight, to render HTML within Silverlight (needs to be well formatted) and you can compose HTML and Silverlight controls in the same space.

Demo: HTML interaction.

The title is a silverlight control, the textbox and button are standard html. Enter text and click the button, the sliverlight control update its text by hooking the click event of the html element and updating the TextBlock element within it.

Question: What if you want to gain access to the ClientID? You can for example embed the value as a hidden field or a javascript value.

Demo: Pure HTML page

All the UI is done in HTML. Enter text, click the button, the text appears. What is being used is to hook the button click DOM event, and call silverlight from it. From within silverlight, the .net code creates an html element and adds it to the DOM page. You could then leverage network calls from Silverlight to update data in your html page.

You can also use OpenFileDialog. Often in HTML pages people ask how to add several files in one go. For mutliple files you need several input elements, so you have to do them one at a time. With the OpenFile support in HTML you can't have access to the file from the client. You have to upload to the server, then the client goes back to the server through AJAX or other for the client to consume. The OpenFileDialog makes things easier. You can select single or multiple files, provide filters, dialog, and get what the user sleected (OK, Cancel. etc)

You cannot have access to the original file path or the default path. The user has to explicitly find the phone.

Question: Can it be persisted locally after loaded? We don't give you the path to the file. Can we see the file size: Yes, as well as the file content type.

Let's create a text file. Open a sample, open a file dialog filtered for text files, select the document, the client reads the file and puts it into the silverlight control, the server didn't get hit. You could've done selection of multiple files too.

The code has a OpenFileDialog, with a DialogResult enumeration (very similar to WPF), then reading the content.

What about the network? Same as the .net framework. There's HttpWebRequest (called BrowserWebRequest), which lets you get byte streams in the alpha.

Question: Using local URI? Will throw a security exception. The browser is responsible for cross domain calls. Is there Asynchronous? Yes absolutely, there's a demo.

There's a button, we select an image and upload it to the server. Picture of Scott's sister before the ceremony.

You can also use the web services stack. Instead of using raw HTTP you can create a proxy for JSON (supported in the alpha) and WCF & SOAP (coming soon).

Question: Cross domain? Not supported now, but policy file on the server to give rights supported for release. You can now call any service and integrate it, which opens new opportunities. Will the WCF support will be Duplex? Don't know. Send me an email I'll find out.

You can do an async callback when downloading, prevents the client freezing.

Demo: Two buttons, one call GetMessage method synchronously, the other one asynchronously, which will call another method when downloading is done, freeing your UI thread. Synchronously, the button is frozen while downloading, whereas asynch everything stays responsive.

Question: Is there a need to marshal to the correct thread? For async no because we do it for you. If you use the background thread, you don't marshal but need to let the background thread know. Is it in there? No we pulled it out because it didn't work consistently on all browsers, one of them didn't work so we pulled it out. We won't ship this new thread model when we fix it. Do services call still use the borwsing stack? For Http traffic we still use that so we integrate with the cache. For browsers you can increase the number of connections to a server. There's also sockets support coming. System.Net will work in the sandbox in the future, even though it doesn't work for WPF in xbap.

For anyone building on Amazon S3 servers you'll be able to upload files there. It's great so you don't have to have a server farm to upload your data. You can do most work on the client, a few web servers on the backend, and pay as you go.

Once you download data, you can use the IE / Safari / Firefox cache. But you can also use Isolated Storage as a giant cookie. It's a feature in .net today [EDIT: been since .net 1.0!]. You can read and write from it. There's a 1MB limit for silverlight right now, but we may give the possibility for the user to change it.

Question: Can you have access to other isolated storage from other applications? For the alpha you get a separate store. The plan is for it to be shared per site. Can users turn on and off? The user can clear the cache which clears the IsolatedStorage. We should give the users a way to not allow IsolatedStorage. That's what consumers want.

Silverlight provides LINQ support, but you cannot use LINQ to SQL. This is not using LINQ but the SQL technology, LINQ is a general purpose query language. We'll provide LINQ to XML in the final release, so you can search and sort your xml data you download. We provide LINQ to objects right now. Because LINQ lets you provide your own dataproviders, you'll see LINQ to Flickr, LINQ to S3, which will get translated, so you don't have to know the actual web services to access these services.

Question: Is there a schedule for a refresh? There's no public date for that at the moment. Next milestone will have a lot of low level plumbing to get the layout system and core text input, but there won't be a lot of surface features appearing. It will be later this year but we don't know when yet. We're thinking of not doing a refresh on this infrastructure milestone. Is there a way to have a transform over time (animation support).

Is there support for animation? Demo of animating a transform over time in Blend, which works for Silverlight. You can change the transform type you want, you can loop it, reverse, etc.

The other nice thing from an architecture perspective is that with the increase in multiple core, it's hard from the UI. Silverlight ahs built-in in multicore support, everything gets partitionned on different cores automatically. All the graphics and animations get calculated on separate threads. That means better performance.

Is there a draw API? No we have a retained mode graphics system, so we draw objects on the screen. On multicore and having retained mode, we know how to redraw without you having to write sync, and we know how to draw it efficiently without having to ask you. We can choose to go hardware accelerated without breaking your code. BitmapEffects are not in 1.1, we've not decided to include them or not.

Is there a notion of frame rate? There's a notion of a frame rate, there's an api for that. But because of keyframes this is probably not reliable.

Which platforms are you supporting? Win200, XP, 2003, Vista, Tiger and Leopard, potentially Panther for Microsoft, Novell does Linux called moonlight on redhat, freebsd, solaris, and mobile devices will be announced. Safari and firefox on the max, Firefox and IE, with Opera planned on windows.

Technorati Tags:

Lunch time open mic session

Spent too much time eating, think I may have missed the beginning.

Expression Web and Dynamic web template: Showing designer support to create a template for new web pages. Whenever creating a new page, different regions can be marked as editable. Whenever a user will open the page in the designer, only the regions marked as editable are changeable.

Whenever changing the template, the two pages created from that template get updated dynamically.

Default standars for Expression Web is XHTML 1.0 Transitional and CSS 2.1. Whenever you import old content from a web page done when other standards existed, you often end up importing it into a new design. You may break the new standards. Expression Web helps you with that.

It automatically highlights validation errors. You can change them very easily, and the validation engine will show everything in real-time.

In a complex scenario, it's very time consuming to fix every error manually. An old page run through a compatibility report shows 380 errors. It will take an hour to change everything. There's three options when you right click. Apply XML formatting rules will fix all xhtml errors. We're down to 24 errors.

You can then select Reformat HTML, and only 3 errors are left, which can be fixed easily.

Mix:UK 07: Building Rich Client Applications with Blend, WPF & Silverlight.

Presented by Jon Harris. May I start by noticing that all the laptops in the room are a MacBook Pro or another. And to answer the question of why I attend this session and not the .net development one, it's because I want to have a better insight at the workflow a designer goes through, whereas the .net part I can fairly easily teach myself on the net.

Jon used to work at Macromedia, and is a User Experience Evangelist. Concentrating on the workflow between blend, WPF and silverlight.

The video showed in the keynote being split in the jiggsaw puzzle was not 70 video files but only one split dynamically in 70 bits.

Build components, data binding, 3d stuff, are all things that we're going to do, and all this with no code.

Look at 3D first. Running the 3.5 beta framework because there are new improvements for 3d.

We start by seeing how we can change the look and feel of a button. Simple animation with a normal windows gray button. Copy a button and drag the copy. By default a guide helps dragging the button aligned with the previous one. Because the text is so small when you switch to a huge screen, the workspace zoom lets you resize the whole UI in the application. The whole panels of Blend can be put away when you need more space.

The first time you use Blend you can be overwhelmed by the amount of properties each component has. Using the filter list on top of the properties you can search for different tools. On the left you have objects, timelines and event management.

Click on a button, choose the button click, what do you do? The UI shows When button_Copy Click is raised, choose a new animation to create a new storyboard / timeline / animation [Edit: 3 names for one concept is a bit weird]. If you ever used Flash before, a new timeline was created, there's a red light which shows the timeline is animated.You turn it on and off by clicking on the red button.

Grab the body of the bird object, move in the timeline, move the bird and create a key frame. There's a faint dotted line showing the animation that is being created.

When clicking the button on the left, the animation moves the bird to the left, with the right button it animates to the right. If you click too fast though, suddently the animation jumps. That's because of the use of key frames.

Blend has this idea of hand-off timelines to do an animation from wherever an object is done to the keyframe. You remove the start key frame and only keep the end key frame. Now when you click the animation, even when clicking fast, the animation moves from wherever it is to the keyframe rather than from one key frame to another.

The buttons still look ugly though. A button is split between the code of how it works and how it looks. You can right click the button and edit a template for the button. A button is made up of a Grid, with a border, and a ContentPresenter that can contains anything. You can grab the border and delete it. It's not going to look better, it's going to look different. Use an ellipse, change the fill, change the stroke. In Blend you can click and drag on the stroke size and it adjusts in realtime. You can add an opacity mask to add a gradient.

The button looks have been changed. It's still a button. This confuses developers, giving the rollodex that is in fact a listbox. Only the style has been changed.

If you want to do a rollover for the button, you have options to trigger things based on when the mouse is over or not. Click Add a new timeline, select the new time on the timeline, and add a rotation transform. Add an option to repeat forever.

As soon as you put the mouse over, the whole circle keeps on circling around, even when you leave. Add a new action for deactivate, select the previous timeline and ask it to stop. Whenever the mouse leaves, the animation leaves.

Question: When you roll out does it reset the animation or stops where it was? If you choose stop as we did it goes back to the original position, if you click pause the animation will pause.

On the right you have a resource panel. You can modify all the styles that have been done. Choose an existing style, drag and drop it to the button, and suddenly the button changes styles but don't change any behavior. Same happens if you choose a 3d flower.

But as you saved the previous style, you can drag and drop it back on the button.

Another example used in Blend is for a bathroom with color wheels on the right. The control that shows the colors is a control. Let's see how it's done.

Create a new control in Blend. You have an empty application and put a yellow background. There's a whole list of controls you can use. Whenever you drag and drop it, it is just the default gray look. You create a new UserControl and set it to the correct size.

Add a Rectangle, round the corners. With vector tools, you do round corners and when you resize so do the corners. They stay to the same size in Blend. Add a fill color, and create a gradient in that rounded corners rectangle. Create a circle, as soon as it gets close to the edge it gets magnetted at a user-defined distance from the border, move it a bit more and it sticks on the border itself.

The original example had a few colors, so if you want to show a list of colors, you use a listbox. It's the default one which is a white box. Remove the background, remove the border, and keep the text black. How do we get data in the listbox? Go to the data window, and choose an xml data. The developer export data in an xml document, the designer uses this, and when the app gets released the developer re-hooks it to the database. Now that it opens you see the content of the xml. You can drag and drop the color list on the list box and shows the create Data Template window.

It lets you choose how you want the data being bound to your control. It now looks like a list of text, not quite right yet. We're going to do what we did with the button, and edit the template for the ListBox. There's two templates: the ControlTemplate controls what the control looks like, the grid, the border. You can choose the ItemTemplate to control how the item is bound. You can grab the content and start resizing it. You can draw a rectangle instead of having the text. Each of the properties have a small square next to it. Click on it and you have the databinding window. It hsows you the data you can bind to. Were going to databind the filling colour with the colour that was in the xml file.

Move back to the default area and draw a line on top of it, put some color with a gradient. Sets everything to white and add transparency. Copy the background and this highlight and combine them.

You can now go back to your application design view. You have to rebuild the project before the control you gave it can work. Build and your control appears, double click and the control gets added.

When you rotate it's done from the center. But if you drag the small circle in the middle of the object, you can drag and drop it to become the new rotation center point. Rotate and it now rotates from the bottom border.

Add an animation saying when a window is loaded, start a new animation, which creates a timeline, move later in the timeline, add an angle, go further, add yet another angle.

The fantastic thing is that because you used a ListBox, the keyboard behavior still works perfectly without adding any code and no work from the designer.

Question: Is there an ease-in and ease-out function? See that in a few minutes.

Introducing some layout controls in WPF and Blend. Showing a photo application that shows different group of pictures.

Change the size and the color scheme of the application. What do these things scale? Well Blend is written and designed with Blend and Visual Studio. When you move the mouse over the edges of a window, you can define slices. [EDIT: I assume he's talking about the Grid control].

You can copy and paste content between two different versions. When you move the element on the page, there's a very think line from the side of the object to the side of the application. The chain icon does the same thing to keep the object resized to the section defined earlier.

When you run the application, as you resize, the sides resize and move as expected. If you click on the lock symbol on the side of one of your slices, it preserves the size instead of resizing it, so that it's a fixed size.

You can add a Grid splitter. It lets you draw over that slice you defined. As you drag it on the surface it's default window gray style, You can restyle it. On the left of it draw a gradient. Run the application and drag and drop the splitter, and it resizes correctly.

The data has a parent / child relationship. The data is an xml file, master / details. As before, we drag a list box on the left, style it, and databind it to the gallery array from the xml file. When the Create Data Template window opens, you can remove all the content you don't want. Let's keep the gallery name and remove the pictures. Style the lsitbox to see the text and automatically it's bound and all the galleries defined in your xml file are presented.

Now the right hand side of the application is empty. We want to change the content based on the selection on the left. First, give the controls sensible names. Let's called the left hand part called menu. On the right hand side, we're going to select the DataContext and it opens the databinding. We choose to bind an element property. We choose the menu we created, and you can see all the properties you can bind to. We bind to the SelectedItem property. Now we want to decide whant we want to databind to, so we choose explicit datacontext, and choose the photo. Its only the path of the image path. You can redefine the binded value to Picture instead of text, and Blend will automatically show an Image. [EDIT: The demo didn't work for DataBinding, I still think setting the datacontext to menu.SelectedItem and binding to the object itself would've worked, or set the DataContext to the menu and choose the binding as the SelectedItem property. The presenter recovered admirably though].

You can create a VisualBrush from your application. Then create a Grid and sets its filling as the brush you just created. Do another one, turn it around and add some transparency. Whenever you change anything on the left side of the application, the right side shows the two grids and they change dynamically as you move your mouse over your main application.

You can reuse the same idea with a visual brush on a 3d sphere, and the effeect is the same.

Let's try something different, like a Video. Drag and drop it on the project, then add it to your window. Make it as a visual brush. In your 3d object, change the material to that new brush. When you test it, the video plays on the left, and the 3d object on the right is showing the video wrapped around.

Opening another sample. A couple of events are hooked up (beginning with ZAM3D) and the video plays on the screen and moves around.

Finally, to talk about designer / developer workflow. For silverlight, you need Blend 2, which look mostly the same, but there's a difference. When you create a new project, you now have the choice of Silverlight Javascript, Silverlight .net, WPF application or WPF control library.

Designers have done an application: 12 movies, all named differently.The developer has written the javascript to put them in 3d, because the designer doesn't know much about javascript. Start it, it runs in a browser. The 12 videos are playing at the same time. Went from flat to three dimensional, the designer did the look and feel, the developer did the 3d part.

Technorati Tags:

My take on the keynote

Overall I'm feeling a tiny bit let down. The demos were cool, but nothing very new or very exciting, except of course for adventureworks and the free silverlight hosting and streaming.

Some of the presentations failed to impress me much, with the video player for the government and the tax cut presentations being the least impressive. The video player suffered a bit of scrubbing, was it due to the presentation environment I couldn't tell, but definitely no wow factor there. The forms application was much more form processing oriented, something you'd have expected for a more business intelligence talk rather than a designer / developer conference.

But then again everybody knows I moan a lot. :)

Mix:UK 07: Keynote

As it happens my badge got lost and arrived late, so I missed the Conchango bits, so straight on with Windows Live Services.

New code to be released tomorrow on codeplex: AdventureWorks. Provides storage and streaming of your Silverlight content.

Windows Live login control was shiped a few weeks ago [EDIT: That's the login experience that is used on the new hotmail]. .

Upload of videos is queued on MSMQ, send to Expresion Video Encoder that transcode it to the correct media format, and streams the resulting Windows Media Video content anywhere the user wants. Audio works the same way.

Photos and friend lists can be imported through spaces.

All the code from QuickApps is on codeplex.

Demo built on QuickApps.

From Sentient. Gathering of running data: The TrackMe application. Looking at friends uploading content, getting alerts whenever new content is available. Social tol on a map like application. Sign in to the tool. By linking the identity between Windows Live and TrackMe gives access to the contact list. All is done through XML [EDIT: Mind blogging, XML in this day and age?].

Deo obviously uses Live Earth for map data. From a contact within that application, using a Messenger control you can initiate a live discussion. [EDIT: Live Messenger control shows the beta logo, maybe the next refresh of 8.5?]

Silverlight videos can be geo-tagged and viewed on the correct place.

They were able to bootstrap their help with the QuickApps demos.

ScottGu arrives. .net was either IIS / asp.net for te web, or desktop with Windows Forms, and Office, as well of course as WPF.Now there's a new category for RIA & media with Silverlight. But all these are using the .net environment, one set of tools, one set of APIs, and whichever language you want. You can leverage your developer skills and the designers can too.

When you integrate with a designer, you go through an initial design, the developer tries to integrate the changes and the CSS / HTML is then done by the designer again. But it doesn't always work very smoothly. Often the tools do't integrate very well, so you have to make compromises.

With Expression Studio the aim is to provide integrate tools that work on the same code, same file formats, which makes collaboration better: Visual Studio for developers, Expression studio for designers.

Blend, Web, Design and Media: the 4 components of the Expression family.

Where's the innovation? Web developer space. Later this year, asp.net gets a new version with .net 3.5 (orcas): AJAX support in the box, LINQ support, and ListView, pure CSS data output. Visual Studio 2008 also comes with new features: Javascript code completion, and debugging support. Design and source view can be shown in split view, as well as richer CSS editor. [EDIT: They finally replaced the IE engine by the... frontpage one! As it happens its better at providing CSS rendering than IE in a few scenarios].

To show this capability, Paul Curtis for EasyJet showing something for EasyJet Holidays.

For the easyet Holidays website, they use the AJAX Image control. Below there's details for the holiday, using AJAX. Everything was done with AJAX Toolkit with Whidbey.

To find your preferred hotel, uses AJAX to provide code completion.To book a holiday for Milan, click find a holiday: At the top you can refine the search by using ajax. The right side of the application *should* be using Virtual Earth. It's production code. But it doesn't work... "Its live code, so users have the exact same problems as we speak". It works. pinpoints hotels on a map. Click on a name, map zooms on it. Birds Eye view available. Star rating for hotels. Each hotel can be atted to a short list, just like a scratch pad. Using a cookie, it saves the list of hotels and can be chosen later.

[Screenshots available at http://blogs.msdn.com/angus_logan/, cool!]

WPF 3.5 updates: LINQ support, FireFox support. and VS Orcas brings Visual Studio designer (Cider), good workflow with Expression.

Silverlight is a cross-browser and cross-platform: IE, Safari, Firefox, Windows and MacOS from Microsoft, and MoonLight from Novell (and the mono team, kudos to Miguel and his team). Mobile devices will be supported in the future.

You can use either the .net programming model or the javascript model. It includes a slimmed down version of the real CLR and a reduced surface library only in 5 megs.

It's the way to build Media Experiences and new applications called RIA: Rich Internet Applications. Brings some richness from the desktop on the browser.

One of the core scenarios is Videos. It includes codecs VC-1, WMV and MP3, can be streamed from any web server, or use a free windows media server for optimized content. Supports HD high quality video from the browser. Much higher quality for a fraction of the cost.

Demo to build Silverlight 1.0 and Expression Studio.

Demo. Expression Media grabs all the files being used and tag them. Supports more than a 100 formats. Can step through photoshop layers from within the application. The quick search lets you filter.

The video plays in the thumbnail too. Take the video, use Expression Encoder. It's not a video editing package. It's a preparation tool to release it after using Final Cut. You can put markers that get stored in an XML file.

The tool can encode bits for the application and check the quality as you go.

The video is showing an iPhone...

You can generate the output with code and buttons. If you're not happy with the result, as it's a project, you can go back and edit it and for example change it with Expression Blend.

You can modify things in Expression Design and export it to Silverlight, and open it in Expression Blend. Through XAML both tools show the same thing. You can then export that content back into the player that was created earlier. You can move the video around in Expression Blend and does a curvy thing around the video and clips around the edge of the video. This is all still XAML.

Some animation can be added. With other packages, there's no timeline. In Blend you only get the timeline when you use it. You create a new timeline, can move it around the screen. Change the scale starting very small and transparent on the timeline. [EDIT: hates quick stuff done the demo way for a designer, not enough time spent on it!]

The nice thing is you can take the project and move it back into Media Encoder, and create it as a template file. The next time a video gets encoded, it will be wrapped in the template you created.

Demo shows a video split in 70 pieces in real time by silverlight.

Real application built for the government, Ben Stirling and Lee Atkinson from Twofour.

Need for more immersive expereince to stream their windows media files. Didn't want to have to re-encode everything. Video of Nelson Mandella and Gordon Brown [EDIT: typical government i suppose].

You can bookmark videos, move them around the screen, and click on a video to play it. Videos can be played across platforms, which is needed for governments. Windows Format SDK and Windows Media Services are leveraged.

From a developer point of view, Silverlight reuses your current skills. By using the same tools, the Live TV platform already built works out of the box.

[EDIT: As I find the demo fairly boring so far, I'm playing around with the USB key given by conchango. It contains the latest Blendables and a copy of the conchango web site, plus the conchango mix reader] 

All this is already shipping today. The programming model for silverlight can be programmed two ways. First, Javascript in existing pages. It's lightweight, easy to get started, and blends silverlight very well with AJAX. In 1.1, .net is included, across platforms. Can use any .net language. It includes a WPF based model like in the desktop.

Why use .net in the browser? You can use any language you want: VB, CSharp, Ruby, Pascal, or any of the 65 supproted languages. It provides a high performance runtime, up to a thousands times faster than javascript. You can use very rich UI controls, graphics and media. Silverlight 1.1 will have a whole suite of controls. You can program against the HTML DOM too. You can have very strong networking support all the way to TCP/IP. And Data can be integrated very easily.

dot net solutions, Dan Scott. Software + Services and Silverlight. Scrum master, definition of what is scrum.

Scrum project wall: One column has backlog, a sprint column, and a column for tasks (Scrum backlog?). They want to do a virtual version of the SCRUM wall. It's a represetation of the normal SCRUM wall.

Pop out a bit from the backlog into a sprint. Each backlog can have a complexity level. Several applications are synchronized across several browser sessions. There is no direct channels between browsers. Using software+services, the data is pushed back and forward. It is just like indirect push for emaisl on on Windows phones.

Accounting: Software for accountants, about 19,000. In the taxation ream, accountants are using the software to do the tax returns and send them over the internet. One of the big issues is integrating the tax returns in such a way that users can interact with them.

Normal form is a pd format. [EDIT: Can they really get me to be interested in tax returns? Oh dear!] Print the acrobat file through the XPS printer, and opens in Internet Explorer. It's all XAML (XPS is XML Paper Specification, based on XAML).

A WPF application lets you import an XPS form (the same one from the Acrobat document). From there metadata can be added to where the fields are. You select a field, give it a key, which data type it is, and when switching to viewing mode it is now an editable column.

You have to tweak the XAML as XPS is only a subset. The form is now usable in a Silverlight application. A Python script is attached to modifications in a field. The code can be changed dynamically from the phone, refresh the browser page, it downloads the script again which is executed against the DLR.

The use of silverlight gives a clean separation between the content of the form and the form itself. Because the script is only a text file, the script can be modified and end users could change the interaction of fields through a GUI. [EDIT: I heard that before...]

Silverlight lets reuse existing skills in the web world, and narrowing the gap between desktop and browser.

Today: Silverlight 1.0 Expression Studio, Encoder 1.0. Silverlight 1.1 Alpha is shipping too, preview of Siverlight 1.1 Tools for Visual Studio 2008.

Later this year, .net 3.5 is shipping with visual studio 2008.

Next year, Silverlight 1.1, Expression Studio 2, and visual studio 2..0 tool support for Silverlight 1.1.

Links for the community: http://www.asp.net for asp.net, http://www.windowsclient.net for any client technology like WPF, and Silverlight on http://www.silverlight.net

Technorati Tags: