More Avalon Album Sparklines

The previous post in the series is here.


Continuing with the quest for a quick’n’easy Sparkline…


After reading Ian’s post, I experimented with dumping the multiple-Transform-element approach, trying the LayoutTransform attribute instead.


Results are good:


<TextBlock>I like this album
 <Polyline Points=”1,5 2,1 3,3 4,4 5,5 6,4 7,5 8,3 9,4 10,4 11,4 12,5″ Stroke=”#933″ StrokeThickness=”1″ LayoutTransform=”scale 1 -1″>
 </Polyline>
 The second song sucks, but overall it’s pretty good.
</TextBlock>


The LayoutTransform “scale” value I just messed around with to get it working, and it looks like it solves the vertical offset problem that required a TranslateTransform too.



Now, I’d like it to be wider and a little taller, so I’ll scale the X by three with “scale 3 -1.5”.



Not bad, but the stroke width seems to have been scaled as well. Todd mentioned in the comments from the last post that I could solve that with StrokeThickness 1/n (thanks Todd!) but that tends to work best only when the aspect ratio is maintained – I wouldn’t try this on a 100-foot copy. Well, actually I probably *would*. As an aside, I’d have guessed a RenderTransform would scale the post-drawing image, but I expected LayoutTransform only to affect the pre-Stroke geometry (Stroke as a point list, rather than a “scaled brush” extruded, if that’s the right word), but I could argue that either way.


OK, looks like I’m rapidly falling off the edge of my understanding of Avalon, and need to spend some Quality Time with the SDK to get a better understanding of The Basics.


So, I’ve got roughly what I want my line to look like – now I’d like to add an overall rating and some type of background.


Rating first:


 <TextBlock>I like this album
   <Polyline Points=”1,5 2,1 3,3 4,4 5,5 6,4 7,5 8,3 9,4 10,4 11,4 12,5″ Stroke=”#933″ StrokeThickness=”.3″ LayoutTransform=”scale 3 -1.5″>
   </Polyline>
  <Inline FontFamily=”Arial” FontWeight=”Bold”>4</Inline>
     The second song sucks, but overall it’s pretty good.
 </TextBlock>



That was nice and easy, now to try to get a background rectangle under the Polyline.



Um, right.


After some random Intellisense experimentation, I found the Canvas, and it looks promising. At least mostly.


 <TextBlock FontFamily=”Garamond”>
 I like this album
 <Canvas Width=”40″ Height=”9″>
 <Rectangle Width=”38″ Height=”10″ Canvas.Left=”0″ Canvas.Top=”0″>
  <Rectangle.Fill>
   <SolidColorBrush Color=”#EEE” />
  </Rectangle.Fill>
  </Rectangle>
 <Polyline Points=”1,5 2,1 3,3 4,4 5,5 6,4 7,5 8,3 9,4 10,4 11,4 12,5″ Stroke=”#933″ StrokeThickness=”.3″ LayoutTransform=”scale 3 -1.5″>
 </Polyline>
 </Canvas>
 <Inline FontFamily=”Arial” FontWeight=”Bold”>4</Inline>
  The second song sucks, but overall it’s pretty good.
 </TextBlock>



I’m not sure if Canvas is what I should be using here, but it seems to be working pretty well for the Rectangle stacking, and I thought that as it was a graphicky thing, the Polyline should go there too. Looks like a good guess so far.


So, some further position tweaking… It occurred to me that Media Player uses a 5 point 1-based rating system, so I need to exclude about a unit from the vertical measurement – I’ll add Canvas.Left=”0″ Canvas.Top=”1″ to the PolyLine.


This also lets me translate the units into more-easily-worked-out numbers – for 12 tracks, with a scale of 3, a “36” width Rectangle and Canvas is about right.


   <TextBlock FontFamily=”Garamond”>
    I like this album
   <Canvas Width=”36″ Height=”9″>
   <Rectangle Width=”36″ Height=”10″ Canvas.Left=”0″ Canvas.Top=”0″>
    <Rectangle.Fill>
     <SolidColorBrush Color=”#EEE” />
    </Rectangle.Fill>
   </Rectangle>
   <Polyline Canvas.Left=”-1″ Canvas.Top=”1″ Points=”1,5 2,1 3,3 4,4 5,5 6,4 7,5 8,3 9,4 10,4 11,4 12,5″ Stroke=”#933″ StrokeThickness=”.3″ LayoutTransform=”scale 3 -1.5″>
   </Polyline>
   </Canvas>
    <Inline FontFamily=”Arial” FontWeight=”Bold”>4</Inline>
    The second song sucks, but overall it’s pretty good.
   </TextBlock>


I’d like to make the Rectangle a Width=”100%” type affair so that I just had to set the size for the parent item and it would work it out, but I’m once again out of time. Here’s where I’m at:




Wider view:



<?Mapping ClrNamespace=”System” Assembly=”mscorlib” XmlNamespace=”Sys” ?>
<Grid
    xmlns:sys=”Sys” xmlns=”http://schemas.microsoft.com/winfx/avalon/2005
    xmlns:x=”http://schemas.microsoft.com/winfx/xaml/2005
  >
  <Grid Width=”400″ Height=”200″ Background=”#FFF”>    <TextBlock FontFamily=”Garamond”>
    I like this album
   <Canvas Width=”36″ Height=”9″>
   <Rectangle Width=”36″ Height=”9″ Canvas.Left=”0″ Canvas.Top=”1″>
    <Rectangle.Fill>
     <SolidColorBrush Color=”#EEE” />
    </Rectangle.Fill>
   </Rectangle>
   <Polyline Canvas.Left=”-1″ Canvas.Top=”1″ Points=”1,5 2,1 3,3 4,4 5,5 6,4 7,5 8,3 9,4 10,4 11,4 12,5″ Stroke=”#933″ StrokeThickness=”.3″ LayoutTransform=”scale 3 -1.5″>
   </Polyline>
   </Canvas>
    <Inline FontFamily=”Arial” FontWeight=”Bold”>4</Inline>
    The second song sucks, but overall it’s pretty good.
   </TextBlock>
  </Grid>
</Grid>


I’d prefer not to have to “fiddle” the layout items, and if I get to a code-driven layout, I’ll Do It Properly. Still, getting there on the XML-driven front.

More on the Support Lifecycle: Windows 2000 and IE

The IE team posted a reminder about the upcoming Windows 2000 Support Lifecycle events, and reading through the comments and some follow-up items, it’s clear that there’s some confusion surrounding support lifecycle dates and what they mean.


I’d like to try to help make it clearer. I’ve been interested in the Support Lifecycle since it was announced – as a long-time PSS barnacle, I support any initiative that provides clear guidance as to exactly what customers can expect from us – so I’ll try to answer any questions that you might have around this Lifecycle info.


As a note, I’m not the right guy to ask about future products or information not already posted on the Lifecycle site, and any advice should be considered informal, subject to change without notice, and in no way legally binding (that is, my employer won’t be held accountable for my mistakes, and you shouldn’t rely on my advice as being correct for all time).


As of the time of writing, I read the Microsoft Support Lifecycle Supported Service Packs page as follows:


Windows 2000


Windows 2000 Service Pack 3 support ends 30 June 2005, so we will not (typically) be producing updates that are designed to be installed on Windows 2000 Service Pack 3 after that date. This means for practical purposes that Windows 2000 SP4 becomes the “low watermark” for updates.


Upon this platform, you have a choice of two supported browsers from Microsoft:



  • IE 5.01 SP4, which is installed by Windows 2000 Service Pack 4 if you have a Windows 2000 installation (and haven’t upgraded your version of IE beyond the baseline version).

  • IE 6.0 SP1 on Windows 2000 SP4, which is the standalone version installable from the web at the moment.

What This Doesn’t Mean


Nothing is going to suddenly drop dead. Windows 2000 will still be around, and still be supported with security hotfixes. By 2010, when Extended Support for Windows 2000 ends, I’ll bet people are looking at Windows 2000 in much the same way as they currently look on NT4, but that isn’t how it is now. Now, we’re 5 years into a 10 year lifecycle. By then, um, we’ll be 10 years in. Which makes sense, when you think about it.


So, anything unclear about that? Comment away…

Avalon Experimentation: Sparklines

I decided to try to do something really simple to start learning Avalon: use someone else’s sample and try to come up with a Sparkline that described an album.


I quickly found the MSFT Sparkline, but mine never looked right using WinFX Beta 1 RC1 (avec VS2005 Beta 2).


Here’s what I’m working through, as a total first-timer:



The Basic Framework:



<?Mapping ClrNamespace=”System” Assembly=”mscorlib” XmlNamespace=”Sys” ?>
<Grid xmlns:sys=”Sys” xmlns=”http://schemas.microsoft.com/winfx/avalon/2005”  xmlns:x=”http://schemas.microsoft.com/winfx/xaml/2005“>
<Grid>
 <!– Stuff goes here –>
</Grid>


I know I shouldn’t be intimidated by the boilerplate at the top, but I can’t help but feel twingy when I look at it.



PolyLines



OK. Looking at the MSFT thing, the PolyLine data is simply numbered 1-n, and the stock value is given for each value of n. Too easy, though I wonder why the series needs to be numbered in n,v format…? 


Jumping in, VS2005 Intellisense says no TextPanel. There’s a TextBlock, so let’s try that.


Try it in AVPad, yep, that’s good. I have text.


Now – I’m really here for the PolyLine, so let’s try that.


<TextBlock>I like this album
 <Polyline Points=”1,5 2,1 3,3 4,4 5,5 6,4 7,5 8,3 9,4 10,4 11,4 12,5″ Stroke=”#933″ StrokeThickness=”1″>
 </Polyline>
 The second song sucks, but overall it’s pretty good.
</TextBlock>



 


Now that doesn’t look right. The Polyline is inline with the text, which I want, but it looks upside down. A bit of experimentation shows that the points listed are actually coordinate points; not simply “first value is 5, second value is 1, third value is 3, and so on, which I wrongly assumed from the MSFT Sparkline example. Worse, the coordinates are screen geometry coordinates, and so 0,0 is the top left corner of something (wonder how the origin is defined) – I need to draw upside down. No using “real values” in a dataset to do the drawing. Yet.


I know I have a five point album rating scale (my hope is to plug this into Media Player’s album ratings at some point), so I could probably try some “mod 5” maths on the dataset to correct it, but for now I’d really like to just plug the data in mindlessly, HTML style.



Transforms (Not Transformers, Robots In Disguse)



So I need to find a way of displaying the sparkline upside down. TransformDecorator looks like it’s MIA, so that’s out.


Intellisense to the rescue, mostly, with RenderTransform providing the clue – first attempt:


<TextBlock>I like this album
 <Polyline Points=”1,5 2,1 3,3 4,4 5,5 6,4 7,5 8,3 9,4 10,4 11,4 12,5″ Stroke=”#933″ StrokeThickness=”1″>
  <Polyline.RenderTransform>
   <ScaleTransform ScaleX=”5″ ScaleY=”-1″ />
  </Polyline.RenderTransform>
 </Polyline>
 The second song sucks, but overall it’s pretty good.
</TextBlock>


 


Well… that was interesting. Scaling Y by -1 seemed like a good idea at the time, but now the coordinates are simply negative, not flipped. Great.



Pure Hackery



I could try another transform to offset that (just for fun, it’s not serious, guv), but AVPad/Avalon doesn’t like more than one transform:


<Polyline.RenderTransform>
 <ScaleTransform ScaleX=”5″ ScaleY=”-1″ />
 <TranslateTransform Y=”5″></TranslateTransform>
</Polyline.RenderTransform>


Error: “Only a single tag should be placed under the property element ‘UIElement.RenderTransform’.”


Intellisense bails me out again with TransformGroup (though it’s awkward trying to work out when I’m looking for an attribute vs an element – I’m sure I’ll get the hang of it with experience):


  <Polyline.RenderTransform>
   <TransformGroup>
    <ScaleTransform ScaleX=”5″ ScaleY=”-1″ />
    <TranslateTransform Y=”5″></TranslateTransform>
   </TransformGroup>
  </Polyline.RenderTransform>




It’s a dodgy hack, but I’m persevering for the time being because I’m interested in how much I can do without having to produce any actual code-behind.


Aargh, It’s Broken


Now we’ve got the line in roughly the right place, but it overruns the text. IanG’s blog on RenderTransform vs LayoutTransform popped up at exactly the right time, and suggests I’m simply doing it wrong… except that the desktop’s stopped responding, so I’m going to call it a night and fiddle with this some more tomorrow. I was going to blame Avalon for some made-up DirectX reason, turns out Maxthon had a hung session that was doing Bad Things with the Desktop (eg, it wouldn’t repaint). Bleh.


So, where I’m up to is this:


<?Mapping ClrNamespace=”System” Assembly=”mscorlib” XmlNamespace=”Sys” ?>
<Grid
    xmlns:sys=”Sys” xmlns=”http://schemas.microsoft.com/winfx/avalon/2005
    xmlns:x=”http://schemas.microsoft.com/winfx/xaml/2005
  >
      <Grid Width=”400″ Height=”200″ Background=”#FFF”>
  
<TextBlock>I like this album
 <Polyline Points=”1,5 2,1 3,3 4,4 5,5 6,4 7,5 8,3 9,4 10,4 11,4 12,5″ Stroke=”#933″ StrokeThickness=”1″>
  <Polyline.RenderTransform>
   <TransformGroup>
    <ScaleTransform ScaleX=”5″ ScaleY=”-1″ />
    <TranslateTransform Y=”5″></TranslateTransform>
   </TransformGroup>
  </Polyline.RenderTransform>
 </Polyline>
 The second song sucks, but overall it’s pretty good.
</TextBlock>
   
</Grid>
 


Scary, and fun.

Watch for Competition and Convergence In The Physics Space

As I mentioned beforethis’d make a killer addition to a GPU.


People originally found 3D add-in boards to be the perfect complement to their 2D Graphics boards, but in the longer run, the integrated solution ended up winning there. Convergence comes to those who don’t buy instantly.


I’ll have to get a PPU board now anyway, because I’m Just That Kind Of Early Adopter (wonder if x64 drivers will be an issue? (grin)).


I can see the marketing wars between physics accelerator leaders now, as features are added while vendors scramble up the stack to provide more and better and easier features for game programmers:


“NewtonX does 30,000 bones with 16-bit accuracy”.


“Well HawkinG 3000 does 60,000 bones with 32-bit accuracy, and hardware assisted broken teeth simulation”.


“Ah, but NewtoNeXT will do 280,000 broken bones with 64-bit accuracy, hardware assisted broken teeth and nose, full CPU offload for many Volkswagen-crashing-into-shop scenarios, and inbuilt support for meteor storms that threaten to destroy a planet.”


“One word: DirectHuman!”


“DirectSmallCrowd.”


And so on, all the way up to “DirectWorldRavagedByWarOrOtherUnspecifiedDisasterButSomePeopleProbablySurvivedAndNowWantToBuildMoreShoppingMallsAndByTheWayThisIsAnFPSLikeNoOther”.


Or, more hopefully by that time, they’ll just have stuck it on the video card and called the overall package something fun, like “Project Kneescrape”.

The Unending Quest For Drivers

I’m still manually going round-robin on a bunch of sites offering drivers for X64 systems that don’t have RSS feeds (or DVD Decoder stores for that matter, are you listening Nvidia? Nope, it’s still due in exactly 30 days), and I’m thinking there has to be a better way.


I’ve been toying with the idea of setting up a bunch of self-maintained RSS feeds for drivers that I’m waiting on, so that others can share my wait with me. A nice, easy, hand-rolled RSS feed for each hardware device driver I’m interested in. Perhaps a feed for Beta drivers and a feed for WHQL drivers for each device, if applicable. An aggregate feed – or even custom aggregate feeds – that could be consumed by a feed reader or a little toast application that could eagerly throw little pieces of tasty drivery hot bread to the user. Well, links to download pages, anyway.


I wonder about community participation in a project like that – assuming some brave headkicker sorted out the categorization and aggregation of feeds, could (would?) a community be able to maintain those feeds, Wiki-style, or is the potential for ‘sploits just too huge? I think so.


So it probably won’t scale, and it probably won’t work well, but that’s what I’m nearly annoyed enough to try doing for now. I just need to work out how to make it easy for myself to do it, and whether there’s actually some value to it.


/me shrugs.

Working Late with Microsoft Office Communicator 2005

It’s probably been noted in a hundred other places by now, but the new corporate IM client (link to Trial Version, the Office website hasn’t caught up yet) was just released.


I’m using it against the Microsoft LCS2005 implementation while signed in from home for some late, late case work. I really like being able to securely use corporate IM across the Internet, and stay signed into play-Messenger at the same time for socializing*.


It’s a tad disconcerting to look at the status of a possible IM target and see the “Free at 2am” message (and makes me want more coffee) but it’s so useful, especially when working across timezones.


LCS 2005 also provides support for third-party IM networks, which will be useful for communicating with customers, but I think I’ll keep the friendlies confined mostly to MSN Messenger instead.

MSN Toolbar and Windows Desktop Search, Final Release

It’s all over the blogosphere already, so on the off-chance you haven’t seen it yet, I’ll link to the best wrap-up I’ve seen so far: Dare’s.


To skip the commentary and jump right in: http://toolbar.msn.com/ , and if you’re into PDFs (and others), the IFilter Addins are at http://addins.msn.com/


I’m playing with it now on my work machine; there’s no x64 version right now.


For those new to the whole Desktop Search thing – the Windows Desktop Search bit indexes your Outlook and Outlook Express email, and documents on your hard drive, so that you can quickly retrieve files based on keyword searches. I mean really quickly. It takes a while to build the initial index, so you might want to leave it running overnight.


The MSN Toolbar for IE part includes a form filler utility and some level of MSN Spaces integration along with the usual search bumf, and I found it to be a compelling IE addon in the beta release.

Maybe Rory was Right? Missing my Xbox again.

Rory – in what was widely* hailed as the Worst Idea Ever – suggested that single-purpose well-optimized OSs might be an Interesting Idea.


I tried to gently shoot him down with a soft, loving nuke or two at the time, but now, I find myself wondering if he was actually clinically ill, or a prescient speaker of the future. See, I have this Xbox. Yeah, the same Xbox I’ve whined about on this blog before. It has a problem again, since the x64 upgrade. In a word: drivers. Yeah, I know an Xbox doesn’t use drivers, but to play one via a PC, you need video capture drivers.


Or do you…? The problem is mostly the Apple 20″ widescreen monitor I use. It has DVI only, because it’s built for use with an Apple only. A couple of friends picked up a Dell 24″ Wide 2405FPW for $AUD1500 (um, about $USD1100 or so, ish), which I thought was *amazingly* cheap, and they noted that it has DVI, S-Video, Composite, component in – generally everything you need to plug a non-PC device into it, plus picture-in-picture, picture-by-picture.


“Hahahaha”, they laugh, “Hahahaha! How much did you pay for yours again?”


$2200.


“Hahahaha! No, really, I’m sure it’s wonderful.”


Yes.


“Hahahaha!”


You know, you’re really not very good friends.


“Hahahahahaaahahahahaha!”


All of which got me thinking, while I was trying to find some lime with which to fill the pit – let’s review the current situation.



  • DVICo FusionHDTV card with TV input – no x64 drivers (and I really appreciate their being upfront about it).
  • Nvidia Geforce 6600GT w/ VIVO – no WDM Video Capture drivers for x64.
  • Monitor: no non-DVI inputs, so any solution pretty much has to go via the PC.

Which is rapidly leading me to an unpleasant choice:



  • Buy an $AUD900 (on special this week) Dell 2005FPW (all the same inputs as the 2405FPW), and give the Apple to my parents. Apple cost $2200 at the time. Retrospective economic pain may outweigh level of generosity.
  • Buy a small LCD TV for the Xbox – for more money than the Dell Flat Screen!? (are LCD TV makers insane!? How much can a tuner and a couple of speakers cost?) er – so while I tried to impulse-buy one this weekend, I was left upset and confused. I think it may have showed, the store people kept well away…

  • Buy a second hard drive and plonk a dedicated dual-boot copy of Windows XP, 32-bit with all the drivers I need on it for Xbox gaming only. Not allowed to use it for anything else.

See, Forza Motorsport just came out, and I’m hungry for a taste of the action. Plus, it solves my Splinter Cell: Chaos Theory problem neatly, by letting me get the Xbox (avec Live) version. Though it could be argued that with a 32-bit dual boot, I could just install it in that copy. But that defeats the purpose. It has to be a targeted, short-duration boot.


The buy-another-20-inch-monitor-and-give-the-current-one-away idea appeals to me, mainly on the basis that I could paint the bevel silver in a futile attempt to hide it from my girlfriend, before angrily accusing her of having problems with her short term memory, but I think I’ve played that card already this year.


Sigh. What would you do?