From the 'day late and dollar short' department - I install Windows Vista beta 1

Tonight I installed Windows Vista Beta 1 on a virtual PC on my laptop. It required very little intervention, was a little long but otherwise un-eventful. After booting VPC took 100% CPU for quite some time and was a little sluggish, but after this has settled down to a CPU percentage in the high single-digits to low teens. Its quite usable for browsing and “normal” stuff (although I did notice a few redraw glitches). »

XPath tester in VS 2005

I got my VS 2005 package that does xpath syntax hilighting and hilighting of matched nodes working (in its most basic form) tonight. It uses some of the built-in text markers, doesn’t show the context node etc, but its a start. And if you haven’t wrangled with the VS API before don’t even bother speculating how hard/easy this might be. I’m just doing my bit to try and advance the Xml Nation (esp point #1). »

HOWTO: Write Namespace-Agnostic XPath and XSLT

XPath (and by extension XSLT) are affected by the namespaces present in the document you are traversing/transforming as described nicely by Dare here. It is possible to write XPath expressions that effectively ignore namespaces however by using the local-name() XPath function so in a sample document like this <fooxmlns=‘urn:foo’><?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” />/o:p <bar>/o:p <asdf/>/o:p </bar>            /o:p </foo>/o:p  /o:p This expression will match the “bar” element  //[local-name()=‘bar’] This one won’t //bar   Of course namespaces exist for a reason, so just blithely ignoring them is not necessarily the greatest idea except in the most ad-hoc circumstances. »

Irrefutable proof that those little 'What kind of &lt;X&gt; are you' on-line surveys are crap

I don’t normally go in for this kind of thing, but when I saw this “what kind of coffee are you“ survey I knew I had to try it out. According to it I am an Iced Coffee. Like hell I am! I am a double-espresso, there are just no two ways about it. I’ve drunk 3 double espressos a day since as long as I can remember, and before that? I drankĀ espresso con panna or viennas. I am not athletic. I don’t drink coffee when I’m out with friends, I drink coffee every single day to keep me alive. Friends? BAH! I don’t evenĀ HAVE friends! I have human endpoints I exchange [sometimes verbal] messages with. Caffeine addiction: medium - now this is just absolutely crazy. I get bad nasty pounding headaches if I don’t have a coffee before mid-day. What would I need to rate a high? Slurp tripple espressons in the shower while washing myself with think-geek caffeinated soap before eating a breakfast of ground-up beans foating in Jolt Cola? Hey, that doesn’t sound too bad, and breakfast is only about 5 hours away…..

You Are an Iced Coffee
At your best, you are: hyper, modern, and athletic At your worst, you are: cheap and angsty You drink coffee when: you’re out with friends Your caffeine addiction level: medium
What Kind of Coffee Are You?

Comments

Scott C. Reynolds
whoa…calm down…have a coffee, it will soothe you.

Agreed. This one is poorly done. Only one question even had anything to do with the coffee.


As for the caffeinated soap…yeah I love that stuff :) I think they have a body wash now too.
1/08/2005 5:45:00 AM
Kim Peacocke
My results said I was an espresso & I only drink one coffee a fornight!
2/08/2005 4:33:00 PM
David RealLastNameUnknown
Dude, I got burnt!
I was having a look back through your blog and thought I’d do the ‘Here, I’ll insult with you with a coffee analogy’ test. Soy Latte. Fuck that! I’m not even a proper coffee drinker and that is offensive.
31/08/2005 7:48:00 PM

»

I asked for UTF-8 Dammit!

You might be forgiven for thinking that given the same source document and the same transform doing a vanilla XSLT transform (no resolvers, parameters etc) would always give you the same output. Apparently not. The code below calls the same transform with the same source document 3 times in 3 slightly different ways. The first time the transform writes the output with an XmlTextWriter (which is internally writing to a stringbuilder). The second time the transform writes to a stringwriter (which internally is also writing to a stringbuilder). »

Altova releases XQuery and XSLT 2.0 Processor with .NET Bindings

Altova (makers of XML Spy, Authentic, Map Force etc) have released a free library called AltovaXML which includes XQuery 1.0 (feb working draft) and XSLT 2.0 (!sure which version) support. The library is available for free, redistributable and has .NET, COM and Java bindings. Obviously not as nice as a “pure” .net solution, but its nice that these emerging standards will be more readily available to .NET developers after Microsoft chose to remove them from . »

HOWTO do the wrong thing: Declaratively cache a page by the value of a usercontrol's child control

Scenario: You have an ASP.NET 1.x page that contains a user control with a drop-down list [1] in it. You want to declaratively output-cache the whole page based on the value selected in that drop-down list [1], but not by anything else (yes, this is very-much a niche scenario). Howto (bad): Use the @ OutputCache directive and specify the name of the drop-down list (as it appears in the generated HTML - the name that will form part of the HTTP POST) as part of the varybyparam attribute. »

Developers! Developers! Developers! Speech now available in t-shirt form

jcooney.net proudly presents the new “Developers! Developers! Developers!” t-shirt design. After untold minutes of feverish design work (from a team who usually don’t even get to design UIs much less anything else) comes a t-shirt that captures all the energy, enthusiasm and profuse sweating of Microsoft CEO Steve Balmer’s famous speech. Packed with tasteless word-art and some screen grabs from the original video (and not much else) you can print this one out, iron it on [1] to your favourite garment and just wear it on in to work. »

Attributes++ - A feature suggestion for Orcas and beyond

Joel is soliciting suggestions for new framework features on [ausdotnet] at the moment, so its time for me to get something off my chest. While attributes in .NET are cool I think they could be so much more. As it currently stands attributes are a way of annotating classes, methods, fields etc with extra meta-data and not much more. To actually DO something with an attribute you need to implement some kind of processing pipeline that reads the attributes (via reflection) an then takes some action. The [Serializable]/[XmlElement]/[XmlAttribute] attributes are read by their respective serialization “pipelines”, [WebMethod] is read and used by the ASP.NET processing pipeline etc. This is great for 3rd party “pipeline” builders (NUnit uses attributes to decorate methods and classes to mark them for unit testing) and the respective framework teams, but kinda limited for those of us who need to play in the pipelines of others. The only example where attributes can actually take some action is when you apply a ProxyAttribute to a ContextboundObject, in which case the attribute can intercept calls to the method…hey, doesn’t that sound cool? The problem is of course that we may not want or be able to change our bass class to contextboundobject just to get this cool interception feature. This brings me to suggested attribute enhancement #1

1. Attributes on methods should be able to perform interception without your object having to inherit from any one particular bass class.

Effectively what I’m asking for (or what I think I’m asking for) is the CLR to throw up contexts around an object without it having to explicitly inherit from ContextBoundObject. I don’t mind having to be explicit about this - maybe a [ContextBound] attribute? It’s either that or give me multiple-inheritance (ok…I’ll wait for you to stop laughing).

My next suggestion for attributes is that

2. Attributes which are applied to a class or member variable should get passed that thing, when the instance of the thing is constructed.

This (to my mind anyway) would render our recent discussion of extender providers fairly moot as it would let you write code like this:

[SecureControl(RequiresRole=”Admin”)]
System.Windows.Forms.Button myButton;

or this

[SaveToViewState]
int myCounter;

My third suggestion (and maybe this just shows I don’t get the “they’re like a tattoo - static and permanent” nature of attributes) is

3. Attributes should be able to be dynamically added and removed from things they’re applied to.

I don’t have any strong use-cases for this one, but I get the feeling the dynamic language folks might.

Feel free to flip the bozo bit accordingly.

Disclaimer: I haven’t really checked to see if/how attributes may have changed in framework 2.0, but I haven’t heard of any significant enhancements in this area. If you can do any of these things NOW in 1.x or 2.0 let me know as I would love to use them for a few different things. No considerations of how this all might be implemented, what the implications for performance, security or ending hatred and intolerance were made during the making of this weblog post. Bits may have shifted during transit.

Comments

Paul Glavich
Amen brother. I am definitely with you on points 1 and 2. #1 would be a killer feature I think.
21/07/2005 4:26:00 AM

»

Clayton Firth joins blogland

My friend and former coleague Clayton Firth has created a weblog for himself. Back in my earlier days of weblogging I tried to convince Clayton to start one too. I even thought about signing him up with dotnetjunkies (who were hosting my weblog) and just sending him the URL and his user-name/password. It looks like he’s finally taken the plunge - I’m looking forward to some interesting stuff from him. Lets hope his foray into the realm of weblogs is more productive than some of my other friends (hint hint). »