# Friday, 29 April 2005

MS are gonna lurv this

<canvas /> ... Do you have any idea how big this is? It is totally huge. Not the element itself, but the fact that developers are finally getting over playing follow-the-leader to Microsoft and the W3C and getting on with the job of innovating. I'm looking forward to a new age of incremental innovation. [via BitWorking]

Last time incremental innovation broke out MS won hands down with better technology and everyone whined that they weren't following standards - I am sure that now it is acceptable to do so they will be more than happy to open their own box of incremental innovation goodies. Probably too late for IE7 but IE8 could be very interesting.

#    Comments [0] |
# Thursday, 28 April 2005

and another XML/XUL/XAML/HTML thingy

Another declarative programming UI model.  Boxely, the runtime for the latest AOL IM client, gets exposed in a three part article by Joe Hewitt (part 1, part 2, part 3)... Sounds very interesting, simpler data binding, XML stylesheets, etc. I'm not positive but the inclusion of "9-slice backgrounds" (which sounds a lot like 9-grid bitmaps in XP themes), seems to indicate that they are going with a funamentally pixel based approach. Probably the right call for an application runtime... vectors for everything are actually really really hard. [via simplegeek]

Tons of these things now - its frightening the memory this thing seems to require though, but that might be down to the IM code rather than the UI.

#    Comments [0] |
# Wednesday, 27 April 2005


Ah, so *that's* how to use IObjectIdentity [via Fabulous Adventures In Coding : How Do Script Engines Implement Object Identity?]

Useful bloke Eric.

#    Comments [2] |

The myths and legends of Mr R Scoble

Its quite well done, this building of the myth but just occasionally, they over-egg it...

... The world may not like the answers he digs out, but because Robert is risk-his-job honest, you have a high degree of confidence that what he says is the truth as he finds it. [via Marquee de Sells: Chris's insight outlet]

If he was really risking his job he wouldn't be there any more. They (MS) might want to present him as being a revolutionary wunder-middle-aged guy but I see no risk, he is doing what he is being asked to do. The "truth as he finds it" - perhaps that is the truth as he is shown it? I have no problem with the job, just stop the "oh isn't this so wonderful"; it makes me more cynical and with an election going on here in the UK I'm on cynical overdose as it is.

#    Comments [0] |
# Saturday, 16 April 2005

More bananas in the Republic

Days after the controversial orders were issued in March, it was found the same reason was printed on each one.  [via BBC NEWS | UK | Apology over control orders error]

You would have thought that when he was signing orders effectively locking people up, just on his say so, he would have checked 'em out wouldn't you.

#    Comments [0] |
# Friday, 15 April 2005

Howto: Fun with ScriptX PrintHtml function in client (desktop) apps

The PrintHtml(sUrl) function is not widely used but has some nice uses. It is mostly used on server side usage of ScriptX where ScriptX is used by a custom service to do printing or a web server service such as IIS.

[Update: according to the department that should know: "It's popular as hell client-side and is used by *squillions* of licensees, usually to create selectable queues of reference docs to print out that don't have to be rendered when you're on some site or other." - just goes to prove the point that it has some nice uses :-).]

But, it is also useful in web applications hosted in IE (or for preference Zeepe) or in any sort of rich client application - the application does not have to be hosting the web browser control, it just has to be able to create the MeadCo ScriptX COM component and call the required properties and methods.

The nice thing about PrintHtml() is you can use it to provide really rich reports/output from information gathered from the user and you can do this in one of two ways:

  1. Create a rich html 'document' on the fly and print it, or
  2. Call a 'web service' (one based on REST, not SOAP) that returns the html document to be printed.

PrintHtml is a method that requires a license, applying a license is covered here.

On the fly

To create html on the fly, simply build the complete html as a string (it should be welformed, but given the flexibility of the Windows Web Browsing Platform you can get away with quite a lot) and pass that string in with the psuedo protocol html://. The built html can reference images and external css files but all such references must be absolute since there is no base url for the document (unless you include a definition within the html string).

For example, in VB (error checking etc omitted for brevity):

' generate some html and print it 
' The html must be complete and valid - any references to images etc by
' url must be absolute references (e.g. you can reference external style sheets)
sHtml = "<html><head><title>ScriptX Sample</title></head><body>"
sHtml = sHtml + "<table border=""0"" width=""100%"" height=""100%""><tr><td align=""center"">"
sHtml = sHtml + "<h1>ScriptX Printing of HTML</h1><p>This report is for:</p><h2>"
sHtml = sHtml + txtName.Text
sHtml = sHtml + "</h2><p>and was printed on:</p><h4>" & Now() & "</h4></td></tr></table></body></html>"

On Error GoTo printError

Set sx = CreateObject("ScriptX.Factory")
Set p = sx.printing

' Some headers and footers.
p.header = "ScriptX - Dynamic PrintHTML"
p.footer = "&d - page: &p of &P"

' The print will actually occur in a separate process.
' tell it it is a string to print by using the html:// psuedo protocol
p.printHtml ("html://" + sHtml)

Web service/document

Calling a RESTfull webservice, or requesting any document for printing is trivial - just give PrintHtml the url and it will download and print it with the full glories of the capabilies of the Windows Web Browsing Platform; get as rich with the output as you like. For example, in VB:

Set sx = CreateObject("ScriptX.Factory") 
Set p = sx.printing

' Some headers and footers.
p.header = "ScriptX - PrintHTML document"
p.footer = "&d - page: &p of &P"

' The print will actually occur in a separate process.
sUrl = sHostUrl + "?name=" & txtName.Text
sUrl = Replace(sUrl, " ", "%20") ' trivial url encoding
p.printHtml (sUrl)

The full (VB) sample is available here.

NOTE: The sample requires ScriptX 6.2 - please contact MeadCo to join the test program for this release (or it may be released by the time you are reading this!).

#    Comments [0] |

Windows Update: 893066

This update arrived on two machines on the network here, a standard XP SP2 box and a Tablet PC also running XP SP2. Post arrival, I lost outbound e-mail from either Outlook or Outlook Express - on both machines. An unpatched machine had no problem. The network here is connected to the Internet over wet string via ICS on Win98 with a software firewall (SP2 firewall is also on). The only solution I found was to uninstall 893066 at which point all outbound mail was fine again - with 893066 I had no other Internet connectivity problems so a fix to cure DoS attacks gave me a DoS attack.

If anyone can enlighten me as to a method whereby 893066 can be installed but keep my outbound mail, let me know. How are you supposed to report these adventures to MS?

A recent update (a couple of issues ago I think) caused two (different) machines to be completely hosed (they were both shutdown while the updates hadn't been completely downloaded, wanted permission to install updates before shutdown, which they got, and then didn't like the slow connection) - a system restore, boot into safe mode and all sorts of messing about was the only way out. I am beginning to gbet well fed up with Windows Update.

If Scoble or anyone at MS is listening; my mother wouldn't be able to cope with this; it is getting to the point that I cannot trust Windows Update which is rather ironic since most of the updates are probably coming about through MSs 'trustworthy' computing mantra.

#    Comments [0] |
# Thursday, 14 April 2005

Howto: Licensing MeadCo ScriptX within a client (desktop) application.

The previous couple of articles (here and here) have shown applying a MeadCo License to a client web browser custom host application and then injecting the ScriptX object into arbitrary html content displayed in the web browser control so that the contents displayed in the control can be printed.

This final article in this brief series (sounds well posh, as my daughter would say) shows another way of using ScriptX in the more usual case where the html content is under the authors control, probably distributed with the client application as either a resource or content folders on disk - in this sample, the latter is used for simplicities sake (aka I don't know how to create html resources in VB).

To date, licensing ScriptX in this scenario has not been great, but with 6.2 it is dead easy. As before, the license is applied during the client application's form onload event:

Private Sub Form_Load() 
   Dim path As String
   path = CurDir()
   On Error GoTo noLicense
   Set secMgr = CreateObject("MeadCo.SecMgr")
   ' A url to the license file must be passed in, for simplicity we assume that the license file
   ' resides in the same directory as this application but it could be put in the exe as
   ' a resource and the res: protocol used.
   Call secMgr.Apply(path & "\advanced2.mlf", "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}", 3)
   ' Now navigate the web browser control to our apps content.
   WebBrowser1.Navigate path & "\advanced2.htm"
   Exit Sub
   MsgBox "Unable to apply the ScriptX License (" & (path & "\advanced2.mlf") & ") because [" & Err.Description & "]"

End Sub

The html content in advanced2.htm is licensed, so it makes use both of advanced ScriptX features (listing of the available printers and allowing selection and MaxiPT extended print templates for some nice headers and footers). All that needs to be done is declare the ScriptX and MaxiPT objects on the page and apply some script as per usual.

All the techniques shown here are applicable in any host, VB, Delphi, C++, C#, VB.NET et all. So, if you are writing rich clients using the web browser control (and for some bizarre reason are not using Zeepe) and want control over printing the html content, ScriptX provides all you can want and probably a little bit more besides.

The full (VB) sample is available here.

NOTE: The sample requires ScriptX 6.2 - please contact MeadCo to join the test program for this release (or it may be released by the time you are reading this!).

#    Comments [0] |

MSF For Agile

MSF for Agile Software Development is a scenario-driven, context-based, agile software development process that utilizes many of the ideas embodied in Team System. This process incorporates proven practices developed at Microsoft around requirements, design, security, performance, and testing.

Proven by what exactly, just how many, and which, sucessful bits of software can MS point to that were developed with these practices?

#    Comments [0] |
# Wednesday, 13 April 2005

Howto: print html documents from a desktop app.

Continuing the theme of using ScriptX for printing html within desktop apps (a sample of free use is here), there is a problem when it comes to using the more advanced features of ScriptX, namely how to license the components.

ScriptX was developed to work in IE way back in the days of IE 4 where the licensing model supported by IE was terrible. ScriptX has its own licensing model provided by the MeadCo Security Manager, this provides for licensing and for ensuring that the components cannot be abused; licenses are tied very tightly to domains. A problem is that, to date, that licensing model has only worked in IE.

With ScriptX 6.2, licensing is sucessfully extended to desktop applications.

To license a desktop app, the MeadCo Security Manager component is instantiated and then the apply method is called (for example in VB):

Set secMgr = CreateObject("MeadCo.SecMgr")

' For evaluation, ask MeadCo for a machine license, install it and then reference it like this...

' For real (compiled exe) use, buy an application license, by applying the license,
' this application process will then become licensed.
' A url to the license file must be passed in, for simplicity we assume that the license file
' resides in the same directory as this application but it could be put in the exe as
' a resource and the res: protocol used.
Call secMgr.Apply(CurDir() & "\lic.mlf", "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}", 1)

Provided the "MeadCo.SecMgr" object exists for the duration of the process, all licensed ScriptX methods will then work. Licensed working enables promptless printing, selecting the required printer and control of behaviour such as disable controls while printing is in progress.

The following sample is an an extension of the free usage sample, it uses the same technique for creating the components but shows that licensed methods can be used. It is available here.

NOTE: The sample requires ScriptX 6.2 - please contact MeadCo to join the test program for this release (or it may be released by the time you are reading this!).

#    Comments [0] |

Howto: Use free MeadCo ScriptX to print html

Those nice people over at MeadCo (that includes me <g>), have a suite of components that provide for complete control over printing html documents from within IE. A whole bunch of the functionality is available for free and it will work with the web browser control just as well as with Internet Explorer.

When working with good old fashioned VB, though in the absense of .NET 2 that's as good as WinForms (.NET 1), there are a number of way of using it, but here is a cute way inspired by some work by a user:

Assume there is a web browser control (called WebBrowser1) on a form and a button labelled print, then an onclick handler for the button could be:

Private Sub commandPrint_Click() 
Dim factory As Object
Dim b

' Attempt to find a ScriptX factory object on the page.
' factory is the standard id used so this will probably find any already
' existing object on the page - or the one we previously created
' if print is hit twice.
Set factory = WebBrowser1.Document.getElementById("factory")
If factory Is Nothing Then
' There isn't one, so create one.
   WebBrowser1.Document.body.insertAdjacentHTML "beforeEnd",
      "<object id=""factory"" style=""display:none"" classid=""clsid:1663ed61-23eb-11d2-b92f-008048fdd814""></object>"
   Set factory = WebBrowser1.Document.getElementById("factory")
End If

' use some of the free features, like headers and footers
factory.printing.header = "This is my header"
factory.printing.footer = "Page Footer: &D - &P"

' We'll ask for no prompt, but, unlicensed, anything from the Internet Zone
' will get a prompt. Intranet/trusted/my computer content *will not*
b = factory.printing.Print(False)

End Sub

A full sample can be downloaded from here. (Please note that to run the sample, ScriptX must already be installed - it is available from the MeadCo Site).

#    Comments [0] |
# Saturday, 09 April 2005

HTA is alive

Someone somewhere inside MS is still playing with HTAs (and script):

HTA Helpomatic.  Utility to help script writers create HTML Applications (HTAs). [via Microsoft Download Center]

The trouble is, the download doesn't work (corrupt header) - anyone managing to get it to download OK?

[Update: Rename the downloaded .exe as a .zip and it can be opened and the main file extracted. Not really worth it though - not very impressive].

#    Comments [1] |
# Thursday, 07 April 2005

Is it - isn't it (Alastair)

The alleged Alastair says Could really have done without all the bloody fuss....  [via Alastair Campbell]

The concensus seems to be that it isn't his shiftiness himself but it doesn't matter; it is very well done and well worth subscribing to. (Thought, is it Tom Baldwin?, given that he wouldn't appear at the Hutton enquiry to answer questions about whether Alastair Campbell had leaked info to him there probably isn't a lot of point in asking).


#    Comments [0] |
# Wednesday, 06 April 2005

All politics is slieght of hand...

The Guardian's election coverage [Guardian Unlimited: Election 2005] points to this article by Nick Herbert, one of the shortlist to replace Howard Flight at Arundel and South Downs. The "hot" snippet is this:

"The whisper is that there is a top-secret, extremely clever strategy afoot: go along with spending rises now, but return to a tax-cutting agenda when — if — the party is re-elected. So the repositioning of the Tories is to be based on a lie; a fact that is unlikely to escape the public."

As commentators such as Mathrew Parris have pointed out, hardly anything new here; if you read the whole article it puts the snippet into the context of what probably a majority of Conservative voters think.

What is more interesting is this hardly any different from what Labour did in 1997; expunge the word "redistribution" and publicly commit to stick to the previous Government's spending plans for at least 2 years and not mention all the other juicy plans they had.

Whose fault is it that no one seems to feel they can present their policies in an honest way; the politicians, the media or the voter?

#    Comments [0] |

Can a logo be biased?

It is noticable that despite it being the 'email of the day' there is no response given to this:

"I'm intrigued by your election logo - the colours are not evenly spread between parties. A brief calculation shows they are distributed as follows:
Labour 41.7%
Tory 28.0%
Lib Dem 26.8%
Other 3.5%
Is this the status quo or will the colour distribution move with the latest opinion polls? Is it your desired outcome or is it a knowing prediction? I think we should be told.

[via BBC NEWS | Election 2005 | Weblog | E-mail of the day]

The email interested me because in watching the 10 O'clock News last night I thought "that is going to get complaints" - switching over to Newsnight revealed that their logo is 4 coloured spots (all the spots the same size) but on the back-drops the blue circles are less prominent (they drift around half off screen) - another case of the Beeb seeming to want to pick fights for no good reason at all. After being found out for making up quotes in their PR department, could be yet another shoot the foot week. Mind you, the PR department aren't exactly making a case for avoiding the man with the big axe, it is pretty basic PR that you clear those made up quotes before you use them.

And while I'm complaining <g>, why do all their RSS feeds, including the election ones, only include headlines hence forcing me to their website - they are not advertising funded, I have paid for the content why force me to a particular place to read it? 

#    Comments [0] |
# Tuesday, 05 April 2005

To vote, NOT Blair

Blair to call May 5 election [via Top News Article | Reuters.co.uk]

I don't vote, never have in the past, usually they are all as bad as each other but this time one candidate has put himself out as worse than the others. So maintaining that they are all as bad as each other, except one, I shall stick a pin amongst the other choices (it doesn't much matter round where I live, the Conservatives will win here) but for once I shall have a vote counted in the national totals and it will be counted not Blair. Its a shame that fine MPs such as Peter Kilfoyle (who has never knowingly appeased anyone other than Mrs Kilfoyle, and that didn't work - from his Iraq Debate contribution) get lumped in with Blair but that is the way the system is/has become. As I was told many times, it is not the place of enquiries to cause Prime Ministers to quit, whatever they may have done, only the electorate can do it. I've had enough of the death and destruction and "the Christian virtue of war" (link to Times Online article).

#    Comments [0] |