Search blog.co.uk

A matter of style

by cc0028 @ 2008-09-11 - 20:21:25

When people hear about stylesheets, they usually think of Cascading Stylesheets (CSS) used to style HTML Web pages. There are some other kinds, though, and one of them XSL (the eXtensible Stylesheet Language) - and particularly XSLT (Extensible Stylesheet Transformations) - has been giving me grief this week. Well, that's not altogether true. It's really something else that's causing the trouble.

Bosses always like to think that complicated things can be made easy, don't they? I well recall how the decision to use a particular development system, called Uniface, years ago, was taken on the grounds that programmers wouldn't have to write any program code. It could all be done by painting "Entities" onto a canvas. It didn't take us long to learn - those of us at the code face - that we were spending more time coding around the system's default behaviour than we were spending actually writing productive programming code.

When we started doing Web development, the powers that be went for a Microsoft system (ASP.NET): and I have to say that it's not half bad. I owe it some thanks for providing me with the means to get an MSc, anyway. But it does not fulfill the promise (swallowed whole by our bosses) that Web development would just become a matter of dragging and dropping Web page elements onto a canvas. We soon found out that the only reliable way to produce HTML of a professional standard was to hand code the HTML ourselves.

The latest addition to the gallery of, "You only have to drag-and-drop" tools is BizTalk, Microsoft's message broker software. I think I've mentioned it before. It sits between two disparate systems co-ordinating their behaviours by passing XML messages (almost exclusively) between them. Part of BizTalk's armoury is the BizTalk Mapper. With this tool, it is claimed, programmers can convert an XML message in one format to another XML message in another format. The first message is appropriate for the sender: the second is appropriate for the receiver.

I've spent all this week trying to get the BizTalk Mapper to convert a document obtained from our student database, in the format suitable for data retrieved from a relational database, to another document, in the format required by the recipient (the Higher Education Statistical Agency - HESA). This is for the annual HESA return, which is in XML format for the first time this year. It's pretty much late already and HE insitutions can be fined for late submission of the data. So no pressure there, then.

Well, it turns out that the BizTalk Mapper simply cannot, in practical terms, do the conversion that I want it to do. I've finished up writing custom XSLT to do the transformation. Now, if Microsoft had not written a mapper, and if they'd said up-front that conversion would have to be done via XSLT, they could have saved me several days of frustration. In the end the XSLT was not that hard to write. So all this draggy/droppy stuff has actually cost us time - when we really can't afford it.

But supposing Microsoft had said that. Supposing they'd said, "OK. Mapping is complicated. It needs a human being to sort it out", would our bosses still have bought the tool?

We've reached the silly situation where companies have to claim more automation than can actually be delivered in their products in order to sell them to people whose expectations of technology are way too high.

I read an article several years ago whose main thesis was that managers needed to accept that creating complex systems was and is a complex, difficult process. They should not expect to find magic wand solutions.

But they do ...


 
 

The late Helen Mary Bradley

by cc0028 @ 2008-08-10 - 22:08:27

I realise with a shock that I have not noted here my mother's passing, on the 4th May this year - the same day on which my father died fourteen years ago.  She had been admitted to hospital with back pains, but her condition was not considered to be serious and she was looking forward to coming home.

On the 3rd I asked my sister if I should go up to Sheffied to help, but Jane thought everything would be fine and we all relaxed.  Jane said she'd visited mum in hospital that evening and left when she went to sleep.  The following morning she rang to say that mum never woke up.  As ways to go, it probably tops the list.

Perhaps later I'll have more to say.

Install issues - harder than you think

by cc0028 @ 2008-08-10 - 21:39:24

Some recent email correspondence has set me thinking about different software installation policies: in particular the differences between Windows and Linux.

All software platforms face a problem when it comes to installing new software.  How do you ensure that each program that you install has all the resources that it will require?  For example, if you install a Java application it will need a Java virtual machine to run on.  At a somewhat deeper level, applications will need particular code libraries that provide functions that the application needs.  Jargon?  OK, so let's try and make the problem a bit more concrete.

The problem is that all programs have some dependencies - some external bits of code that they depend upon in order to run.  "No code is an island complete unto itself", you might say (if you were an Elizabethan metaphysical poet).  So how do Windows and Linux try to solve the problem of dependencies.

If I write a Windows program, I will make calls to code stored in Windows code libraries.  These are the things that will, for example, paint the visual elements like buttons and list boxes in my application.  Because it's a Windows program, I can be pretty sure that those libraries will be present (and in the standard locations) so I probably won't have a problem; although I might have to produce different executables for different versions of Windows.

But supposing I want something a bit more esoteric, like XML support.  I can't guarantee that the necessary XML support is going to be present on all the machines onto which my application might be installed.  So what do I do?  In the Windows world, the answer seems to be that I package up everything I need (Java VM, XML support etc etc) and install it all, whether it's needed or not.  The alternative is to search for the required libraries and only install the ones not present.  However, if I do that, what happens if the user updates the library?  The updated version may not be compatible with my application and so my application will break.  What happens if the user uninstalls the program that installed the library?  Will the library be deleted too?

In the Windows world, the only safe way of doing things seems to be to supply everything your program needs with the program, regardless of whether this means that the user finishes up with umpteen Java VMs and umpteen identical XML libraries or not.

I should add that .NET is making this less critical, because it allows what they call side-by-side installation, but it is still pretty inefficient in my view in terms of ensuring that the minimum amount of software necessary for the proper functioning of all installed software is present.

Linux installations take a completely different approach.  Most Linux distributions install software via some sort of package management system.  What this means is that you ask the package manager to download and install the software from a repository.

The package manager maintains a database of all installed software and their dependencies.  When you try to install something from a repository, the package manager will check the database to see if you have all the necessary external libraries etc, if not, it will try to find the necessary components in the repositories to which you subscribe and will check that it won't break anything else by installing them.  If it can satisfy all the dependencies without breaking anything, it will ask for your permission to install the extra libraries and, once it has permission, will do the installation for you.

If the package manager can't resolve the necessary dependencies it will tell you what the problems are and present you with some choices of strategy for solving the problems: which may mean uninstalling some incompatible software that you already have on your system.  But the choice is yours and you are in control.

Of course you can, if you must, install stuff directly on a Linux box, but then you become responsible for maintaining the dependencies.  Generally speaking this is not a good idea.  It is something you will do only if no package exists for the software you want to install: an increasingly rare eventuality.

I've heard Windows-oriented people remark that the Linux installation system is more complex than the Windows system.  This is true: but to my mind there is a perfectly good reason for this complexity.  It is to prevent the kinds of problems that can occur on Windows boxes - either of bloat, or of incompatibilities.  And it is also true that almost all Linux installations can be carried out without the slightest problem - so the amount of extra complexity is minimal.  Things only get complex when dependency problems arise.  Something I for one am glad to be told about, since it puts me in charge of what goes on my machine and how any resulting problems are resolved.

But then, I'm biased ...

At your service

by cc0028 @ 2008-07-16 - 21:00:37

Right.  Let's talk about SOA and WSS.

OK.  OK.  Let's talk about Service Oriented Architecture and Web Service Security.

The term, "Web Services" has, by now, got past the stage of being every boss's favourite buzz word, erm, phrase.  They are, instead, rapidly becoming a familiar part of the IT landscape, and have become a favoured way of implementing a Service Oriented Architecture (SOA).  So what's that?  Well, it's a way of building powerful applications made up in whole or in part of services provided by remote computers, possibly belonging to organisations other than your own.  Google, for example, provides a Web Service-based application programming interface (API).  You can use this to do keyword searches in your own application without having to worry about how a keyword search is actually done.  In other words what we are doing in a Web Service is to arrange for a client machine to ask a server machine to perform some service for it - i.e. to run some procedure or other and to return (send back) the result of executing the procedure.  In the case of the Google API, we ask one of Google's servers to run a search for us and to send back the search results.

In order for this to work, all the participants in the game have to agree on what the rules are.  Yes, we're back to standards again.  There are quite a few different standards in this field, probably reflecting its comparative youth.  No doubt a single standard will emerge over time.  For the purposes of this article, I'm going to assume that we're talking about the Simple Object Access Protocol (SOAP) and the Web Service Definition Language (WSDL) - so you should too, if there's to be any communication between us.

Now, the whole point of these standards is that it should not matter what kind of program is running at either end of the communication.  So long as they both stick to the protocol, everything should be fine.  A C# program using the .NET Framework, running on a Windows machine should be able to exchange messages with a Java program running on a Linux machine and using the Apache Axis framework absolutely seamlessly.  And that's pretty much what happens, but, as usual, there are exceptions.

In the early days of Web Services, nobody gave too much - some would say that no-one gave enough - thought to security.  As Web Services have become more popular and organisations have started using them to pass confidential information about the place, security has become a much more pressing issue.  As a result there are a number of standards dealing with Web Sevice security.  If you're really having difficulty sleeping you can read about them on the OASIS site.  They are extremely complex and, of course, add a layer of complexity to any programs that use them.  They also increase the chances that the parties at both ends of the Web Service communication might misunderstand each other - either because there are bugs in the implementation at one end or the other, or because the implementations have interpreted the standard differrently.

So why am I telling you this?  Well, it's been my misfortune over the past few weeks to try to use a Web Service exposed by one of our partners (the UK Student Loan Company).  My program, like all those I write at work, is written in C#, a .NET language.  The Web Service I've been trying to communicate with uses the Java Apache Axis Framework.

Normally, this wouldn't be a problem, but this service demands a certain amount of security because of the nature of the information being passed.  It's not terribly confidential.  We're not talking about student loan details, for instance; but it's a private conversation nevertheless.  The Web Service therefore has the following characteristics:

  • Communication is over an encrypted connection (SSL)
  • The SOAP header (the first part of a Web Service message) must contain the client's user name and password in clear text
  • The server authenticates to the client using an X509 Certificate
  • The client does not authenticate to the server
  • No encryption over and above the transport layer (SSL) encryption is to be carried out.
Wouldn't you know it?  This is not one of the standard configurations that can easily be configured using the .NET Framework (and the Visual Studio integrated development environment).  There also seem to be some strange features in the Apache Axis Framework implementation, which mean that:
  • Sending a message under these particular circumstances with a <Timestamp> element in the SOAP header - supposedly a mandatory field - will generate an error from the server
  • The response to at least one message results in an XML document that does not conform to the schema set out in the WSDL file.  Our partners believe this to be a bug, but whatever it is, it has to be dealt with.
It turns out that on the client side, the solution is:
  • To create a custom policy assertion class that filters both output from and input to the Web Service.  This is done by creating two custom SoapFilter classes that are called to filter (alter) the input to and output from the Web Service client.
  • The filter for outgoing messages looks for the <Timestamp> element and deletes it before the message is sent up the wire.
  • The filter for incoming messages looks for the malformed XML (which is on the <code> elements) and corrects them by adding a namespace definition.  As it happens the attribute that the namespace is defined for is entirely redundant, but it turned out to be easier to add the namespace definition than delete all the unnecessary attributes.  The corrected XML is then fed to the .NET Framework Web Service client handling plumbing.
They don't tell you this sort of thing in any of the standard texts or on any of the standard courses and, for the first time in my experience, all my newsgroup and mailing list postings went unanswered (with one exception - and my grateful thanks to Evan Freeman of the microsoft.public.dotnet.framewok.aspnet.webservices newsgroup for his moral and practical support).

In the hope, therefore of preventing frustration-driven rapid hair loss syndrome amongst .NET programmers, I have published a document on my personal Website that goes into all the gory details of what was done and why:

Microsoft dotNet WSE 3 Web Services.pdf

I hope it helps someone.  And if anyone has any suggestions as to how the document could be improved, or corrections or other improvements, then I'll be only too happy to act on them if I agree they'll help.

The standard way of working

by cc0028 @ 2008-06-27 - 13:35:23

I've been taken to task, in absolutely the nicest way possible, for introducing into this corner of the blogosphere a whole lorry-load of acronyms and abbreviations without taking the time properly to explain them. Hopefully this article will explain some of them and introduce some other matters that many think are important.

You'll no doubt agree with me that the world has been changed radically by the recent advances in the communications industry. This applies across the board: from iPods to iPhones and from email to the World Wide Web. Given that we agree, I'd like you to consider for a moment whether or not you think that this could have happened had there not been large numbers of open standards for implementors to follow in producing their wares. Without standards, would an Orange phone be able to talk to its Virgin peer; would you be able to download your music from your iPod to your computer; would you be able to send an email from Thunderbird to have it read in MS Outlook?

When you think about it, you soon see that all these things can happen because sets of standards exist that allow products from different manufacturers to interact. Your email, for instance, is sent using SMTP (the Simple Mail Transfer Protocol) and received using, probably, POP - the Post Office Protocol.

Where do these standards come from?

For the wider internet, the body that oversees the standards process is the Internet Engineering Task Force (IETF). These are the people that brought you SMTP and POP(see above). They also brought you the HyperText Transfer Protocol (HTTP) - the protocol behind the World Wide Web - and some of the worst formatted Web pages you are ever likely to see.

The standards produced by the IETF are enshrined in Requests For Comments (RFCs) - a rather quaint nomenclature that I'll leave you to research on your own.

You will have noticed that the word Protocol crops up a lot. It's the final P in SMTP, POP, HTTP, FTP, EPP and so on. A protocol is a standard way of behaving. If a program adheres to a protocol, we can predict how it will behave. If we can predict how it will behave, we can interact with it.

The World Wide Web has its own set of standards that are overseen by the World Wide Web Consortium (W3C). They are responsible for the likes of the HyperText Markup Language (HTML) and Cascading Style Sheets (CSS). These two standards define how content is to be presented in Web browsers. If you write standard HTML and CSS, you should be able to guarantee how your page will look in any browser - as long, of course, that the browser implements the standards. And thereby hangs a tale.

This is the moral of today's story. When standards are undermined, we all suffer.

In the 1990s, Microsoft and Netscape went head-to-head in what became known as the Browser wars. Both companies added their own proprietary Extensions to HTML, meaning that you had to have their browser in order to Take advantage of the extra functionality. Of course, there was no advantage, and the HTML standard became thoroughly subverted to the extent that it became referred to in this context as Tag soup.

Worse was to come, however. Microsoft, through the use of illegal tactics for which it has since been punished (if not punished enough) in US courts, won the browser wars hands down. Having done so, the only way to view the Web sensibly was in their browser (IE5 and later IE6), which they hooked into their operating system so effectively that this meant, in effect, you had to run a Windows computer to view the most important new communication medium since Gutenberg. Microsoft owned the Web.

Or nearly ...

By the skin of our teeth we have been spared the nightmarish conclusion to the history above. Due to a combination of factors - Microsoft's increasing unpopularity, anti-trust findings against Microsoft in the USA and Europe, the professionalism of some Web developers, the growth of the Open Source movement, the resurgence of Apple and the popularity of Firefox - Microsoft's position gradually became untenable. Forced by the courts to Unbundle Internet Explorer from the Windows operating system, and harried by Web developers for whom IE6 was a totally unnecessary evil that just made their jobs harder, they eventually had to capitulate and cover over most of the worst of the IE6 bugs in Internet Explorer 7. Internet Explorer 8 promises to be standards-compliant Out-of-the-box.

This means that fairly shortly, you will be able to view Web pages in any browser, confident in the knowledge that you will be seeing exactly what everyone else is seeing. You win, because you can choose the browser you like, not just the one that the Operating System manufacturer wants you to have; developers win because they can guarantee how their pages are going to look, and browser makers win because they can be guaranteed a level playing field. The only losers are those who do not want to play fair and who want to own what is, in effect, a public resource: the World Wide Web.

So that says it for the Web, but I'd like you also to think a bit wider. What about your word processing documents and spreadsheets? What about your slide presentations? Is it right that the format of these files should be in the hands of a single vendor, kept secret to make sure that others can't compete?

Isn't the logical outcome of this that your Office Suite vendor actually owns your data? If they won't supply you with their program (because they think you're a Pirate or because you're simply too poor to afford to buy it, or because they can't because they've gone bankrupt), doesn't this mean that you only have access to your data if they let you? What does this say about your privacy? If you can't see their code, how do you know that they aren't reading your documents and sending copies back to S.M.E.R.S.H. headquarters in - erm - Washington?

It follows, for me at least, that proprietary Office Suite formats suppress competition, make innovation outside of the inner circle impossible and make it possible for office suite makers to supply buggy, intrusive and possibly dangerous code without anyone being any the wiser. I'm not saying that this happens, but it could. I would say, though, that innovation has been stifled and that the quality of code in proprietary products is sometimes horrific.

It is for this reason that the Open Document Format (ODF) has been developed and adopted as an international standard by the International Standard Organisation (ISO)

Microsoft, unsurprisingly, have been fighting the adoption of ODF tooth and nail. They have tried to push through their own, competing standard (OOXML), despite there being an existing standard (ODF) and despite the fact that OOXML is not a complete standard (language warning). There have also been allegations of committees being stuffed with Microsoft representatives, of coercion if not bribery and of a lack of diligence in following voting procedures.

Be that as it may, Microsoft do seem to be on the point of capitulating on this one. There is an ODF converter for Microsoft Office (produced by Sun Microsystems) and Microsoft have promised full ODF support in the next version of Office.

I haven't often used this blog for propoganda, but I would urge you to get the ODF converter for Microsoft Office and to use it when exchanging documents. When native support for ODF arrives you can use it with even less hassle. Alternatively, you could use openOffice.org, which already contains full native support for ISO ODF. You can download and install it for free. It's free and open source.

It is, after all, your data. The best way you can protect it is to support the standard.

Declare your independence!

Beyond lies the Web

by cc0028 @ 2008-06-25 - 09:20:28

It's about time I explained my absence from the blogosphere.

As retirement approaches, I find myself increasingly engaged in private projects, in the hope - I suppose - that something will turn up that will keep me busy when I don't have to get out of bed to go to work. So when my niece asked me to look at her Web site, I was only too pleased ...

She's a writer, and it turns out that she has two sites. Her personal site relates to her writing activities: but she also runs a consultancy business, called UrbanWords, that has its own Web site. The former was already up and running, whilst the second was mainly at a planning stage.

When I first looked at it, Sarah's personal site was a complete mess. It had been produced using some Microsoft tools, failed every validity test in the book and simply didn't work in any other browser apart from Internet Explorer. So I agreed to correct it and to develop the consultancy site, using the same look and feel.

This in itself would not explain my prolonged absence. Neither site is particularly big or particularly complex. In fact, they were up and running within a couple of weeks - with every page passing the W3C validator tests at the XHTML 1.0 strict level. The real work arrived afterwards.

During the time the Sarah Butler and the UrbanWords sites were being implemented, Sarah won an Arts Council grant, partly financed with lottery money, to undertake a project that had as one of its deliverables a Web site. So I agreed to do that one as well.

The result is the A Place For Words site.

As you will see if you follow the link, this was a much bigger project and involved working with a graphics designer. The intention is to get this site into a Content Management System as soon as we can, so that Sarah can update the content of the site as time goes by. For this purpose, we chose the open source Joomla! application. So I've now acquired a small library of books about Joomla! and will be trying to move the site over the next few months.

All this has been quite a lot of work. I have had a very nice box of chocolates from Sarah out of it, though. It arrived totally out of the blue just before Sarah left on holiday recently: a hat-box shaped container with some of the most luxurious chocolates I've ever tasted. John Lewis partnership, it says on the label. Highly recommended.

So, what with three Web sites and the EPP module I blogged about yesterday, time has been a little short.

Oh! and I'm still learning French. Next month I go to Caen in Normandy for a one-week residential course. Carole and I will then meet up in Paris and have a few days there before returning to Cardiff in time for the Eisteddfod Genedlaethol (National Eisteddfod), that is taking place in the fields just across the road from where I work, this year.

The plan is to return to France this autumn, perhaps going to the south - Montpelier appeals. But we've no definite plans yet, so who knows. I guess it partly depends on how many Web sites I find myself developing ...

EPP

by cc0028 @ 2008-06-24 - 22:32:37

The 'Extensible Provisioning Protocol'. No, I'd never heard of it either, but it's the subject of the IETF RFC 4930 and a few others as well. Basically it's a protocol used by internet domain registries to receive commands from and send replies to their registrars concerning the domains under their control.

Say I was interested in buying one or more domains that began with 'peredur'. I could express this interest to a domain name registrar who would, on my behalf send a 'check' command to one or more registries to see what domains beginning with 'peredur' were available. To do that, they would send a <check> query to various registries and come back with a list of what was available, if anything. Let's say that peredur.com and peredur.org.eu were available and that I wanted to buy them.

The next step would be for me to enter into an agreement with the registrar to buy those domains and then the registrar would send the appropriate EPP <create> commands to the appropriate registries.

Now, my son happens to be a domain name registrar, amongst his other talents, and he wanted to make an EPP client (the bit that talks to the registry, by issuing the commands) available to potential domain holders, and since his site is powered by the DotNetNuke content management system, he hunted around to see what was available in C# to do this job. It turns out that there's very little, if anything, available; so he employed an outside developer to produce something for him.

Unfortunately, they soon hit problems, so he turned to me to see what I could do.

I haven't programmed at this low level for years, and never in C#; but as a matter of fact it turns out not to be all that hard, once you've got your mind around the RFC. So we currently have a class library and a console-based user interface that can connect to an EPP server, parse the returned <greeting> message, login, send a <check> command and receive the response from the server and, ultimately, log out. It's not very pretty as yet, but it does work.

The next step is to pretty it up a bit and use it as a demonstration prototype to see if anyone else is interested in it - and to use it for Matthew's purposes as well, wrapped up in a DotNetNuke module.

Looking around the Web, we see lots of interest in a piece of software like this, and we're surprised how little there is available. Maybe we'll have something sellable here. Who knows?

Who dares, wins

by cc0028 @ 2008-01-28 - 23:15:05

A streaming video follow-up

Well, I'd written to the Welsh TV channel (S4C) and told them that I didn't think that they could justify telling their viewers that they needed Windows media player when I'd just proved that you could use at least three others on Windows and four others on Linux, and fair play they had altered their wording a bit. They changed it to say that other players were available for non-Windows platforms, but that there was no guarantee that they'd work, or that they would support sub-titles.

I confess that this annoyed me a bit. Firstly, I thought that they were deliberately avoiding saying that there were other players available for Windows, and secondly I thought that it was a bit rich to suggest that these other pieces of software somehow might not work. So I wrote again and also translated my feelings to English for the benefit of the developers of Microsoft's rivals, to whom I sent the following:

I've just got annoyed with my favourite TV channel because of their treatment of non-WMP video players. I thought you might at least like to know what's being said, even though I doubt very much that there's anything anyone can do about it.

The story's a long one, so I'll cut it short.

I'm referring to the Welsh TV channel, S4C. Until recently they said on their website, "You will need Windows Media Player" in order to watch their programmes. I pointed out to them that in my experience at least the following worked on Windows:

* xine
* MPlayer
* vlc

... and that those all worked on Linux too, along with Kaffeine, of course.

They have now changed their wording to the following:

"You will require a media player capable of playing windows media 9 files, such as Windows Media Player. Other players are available for non-windows platforms, but these aren't guaranteed to work, nor support subtitles (sami) files."

There are two things wrong with this in my view:

* The alternatives are not just for non-Windows platforms
* There is no reason to suppose that the alternatives are any less likely to work than WMP (except for the sub-titles, where they may be correct. I wouldn't know. I don't need them).

I've told them what I think, but I doubt if it will make a difference.

Guenter Bartsch, the main xine developer, wrote back and said that he understood that I was annoyed, but that perhaps we should accept that they were just trying to avoid having to support anything but the Microsoft software, and should just be happy that they'd altered their wording at all. He also pointed out, as I had when talking to S4C, that the main problem was in the use of proprietary codecs instead of public ones like Ogg.

And I thought that would be the end of it.

This evening, just out of a vain hope, I again accessed the S4C site: and guess what. Yep, they've altered their wording again. Here's how I announced the change to the South Wales Linux User Group:

S4C have now changed their site to read:

"Byddwch angen chwaraewr cyfryngau sydd yn gallu chwarae ffeiliau
Windows Media 9, er engraifft Windows Media Player. Mae chwaraewyr
eraill ar gael ond nid oes sicrwydd y bydd rhain yn cefnogi ffeiliau
isdeitlau (sami)."

That is ...
"You will need a media player that can play Windows Media 9 files, for
example Windows Media Player. Other players are available but there is
no certainty that these will support subititle files (sami)"

Fantastic.

No sooner had I sent this off, than an email dropped into my mailbox from S4C confirming that they'd changed their wording.

I have written back thanking them for their patience and saying that I could not have written it better myself.

Well done S4C. My faith is restored.

Streaming video in Linux

by cc0028 @ 2008-01-05 - 20:25:07

Or how to watch telly on Linux when the channel thinks everyone uses Windows ...

Up until yesterday, you could have written on the back of a postage stamp everything I knew about streaming video. You might need, perhaps, half a sheet of A4 now: so I still don't know a lot, but I know more than I did. Here's why.

On a visit to the S4C Web site recently, I noticed that they were offering the facility to view some of their programmes on a computer. These were either programmes that had already been broadcast and had been saved to a file, or programmes currently being televised. "Ooh! There's lovely" I thought, as you do if you live in this part of the world, and clicked on a link to a programme shown earlier of a concert by the harpist Catrin Finch. I have this Catrin Finch problem: but let's not go into that.

The only response I got to clicking on the link was an error message saying that, "mms is not a registered protocol". The protocol MMS, it appears is a Microsoft proprietory video streaming format, and so not a lot of help to those of us who do not run Windows computers. Now, I've lived for nearly sixty-one years without needing mms so I'm pretty certain I could carry on without it, but it did appear to me that it was a bit unfair of S4C to provide content for Windows users only. So I wrote to S4C to see what they had to say.

I had an email back from them explaining that they felt that they had to use the most popular video streaming format, and referring me to some Web sites that turned out not to be of much use. It was pretty obvious from the reply that they weren't going to change their policies just for me, although I did point out that Linux users, minority or not, paid just as much for S4C as anyone else and ought therefore to get the same service as everyone else. It also occurred to me that if they applied their argument to language usage, S4C would not exist. It is the highest cost per capita television channel in the UK and serves 1% of the UK population. I didn't say that, though. Instead I just wrote that we'd have to agree to differ.

All this did start me thinking though, which is usually a dangerous thing, but in this case turned out fairly well.

I'm on the mailing list of the South Wales Linux User Group, so I posted there asking if anyone could suggest a way of getting the S4C programmes on Linux. Their combined help was truly amazing.

The first thing that I learnt was that you could obtain MPlayer for Linux. MPlayer is free, and supports the mms format. So I downloaded it and installed it. The result was that I could do this from a command line to watch Catrin Finch:

mplayer "mms://s4c.unique-media.tv/s4c_uk/bsm/hsbc_jazz_
aberhonddu___catrin_finch_ai0000803d21b8.wmv?sami=http:
//www.s4c.co.uk/sami/A290559874.smi"

The bit in quotes is the URI, and I got it by right-clicking on the link on the S4C Web page and selecting "Copy Link Location" from the context menu in Firefox. I then pasted the link text onto the command line I was using.

The results were not impressive, though. In fact the results were unwatchable with the picture stopping and starting all the time and the sound totally out of sync with the video. However, not to be deterred, I learnt next from the SWLUG faithful that you could do this:

mplayer -dumpstream "mms://s4c.unique-media.tv/s4c_uk/
bsm/hsbc_jazz_aberhonddu___catrin_finch_ai0000803d21b8.wmv
?sami=http://www.s4c.co.uk/sami/A290559874.smi"

This downloaded the stream to a file called stream.dump in the same folder as the folder from which the mplayer command was issued. Once the file had been downloaded, you could do this:

mplayer stream.dump

The results of this were better, because the stream was no longer downloading in real time: however the picture quality was still disappointing. By the way, I'm not sure how happy S4C would be to know that you could download the stream to a file like that. Does it make me a pirate?

Once again, the group had a suggestion. Had I tried xine? Well, no, I hadn't. In fact even though it came with my SUSE Linux distribution, I'd never installed it. Ten minutes later I had xine installed and tried:

xine stream.dump

The results were perfect. So I thought I'd try real time:

xine "mms://s4c.unique-media.tv/s4c_uk/bsm/hsbc_jazz_
aberhonddu___catrin_finch_ai0000803d21b8.wmv?sami=http:
//www.s4c.co.uk/sami/A290559874.smi"

No luck. Nothing.

Another post to the group and I discovered that xine didn't want to know about the final bit of the URL above: the bit starting with the question mark and ending ".smi". So I tried with this:

xine "mms://s4c.unique-media.tv/s4c_uk/bsm/hsbc_jazz_
aberhonddu___catrin_finch_ai0000803d21b8.wmv"

Absolutely perfect. Streaming video in real time.

And that would be it, really, you would think. I certainly did. I wrote back to S4C explaining to them how it was done and settled back to do some serious Catrin Finch watching. Just then another email from the SWLUG dropped into my mail box. It said:

While I was playing around with this I found this link, now I can click
on an mms link in firefox and it opens xine.

http://www.cinlug.org/node/316

Here is all you have to do (quoted from the site):

  • Open Firefox, type "about:config" (no quotes) in the address window, and click enter.
  • Right click on the window and choose <New>, then <String> from the pop-up menu that appears.
  • In the first pop-up box, enter: "network.protocol-handler.app.mms" (no quotes, and it might just be easier to cut 'n paste this into the box).
  • In the next pop-up box enter the path to Kaffeine (e.g. "/usr/bin/kaffeine").
  • Now, click in the main window again but choose <New> <Boolean>
  • In the first pop-up box, enter: "network.protocol-handler.external.mms"
  • In the second pop-up select <True>.

This only works, obviously, if you have Kaffeine - which most Linux distributions do. It would probably also work with any player that accepted the entire link location (i.e. including the bit from the question mark until the ".smi"). You would just have to change the "path to Kaffeine" bit, to "path to MPlayer", or whatever.

Now all I have to do is to click on the link in Firefox and the video opens in Kaffeine. Just, wouldn't you agree, as nature intended.

This prompted another email to S4C and the suggestion that they publish an article on their Web site explaining how to do it. Alternatively, I suggested - rather generously, I thought - that they might want to ask me to write an article that they could link to from their Web site. That way they don't have to accept any responsibility for its content.

So what do we learn from all this? A few things, I reckon.

Firstly, I learnt a fair bit about streaming video, and that can't be a bad thing.

Secondly, I learnt that the Linux community have the most incredible knack of working together to pool knowledge and to solve each other's problems. They've never failed me yet.

Lastly, I learnt that whatever it is, in the Open Source world someone will have had a crack at it and will have produced a solution. Not one of the applications that I have mentioned in this article is owned by a private company or individual. They are all the fruit of co-operative code hacking by a community of programmers interested in solving a problem. This is what programming should be like. It is more akin to a research activity than to product development: and it is done best when done openly and in a spirit of co-operation. It's why open source software works and closed source software often doesn't.

Vista, anyone? No? Didn't think so.

Happy new year to one and all - or "Blwyddyn Newydd Dda" as they say on S4C.

:)

A cat's tale

by cc0028 @ 2007-12-17 - 21:27:05

Saturday was the day the cat had her annual check up. No problems. The vet said she’d gained a bit of weight, which she needed to do, and that her heart was strong. Apart from a hole in one of her teeth that needed sorting out, she was in fine shape. So she had her injections and came home.

By lunch time, we’d started to notice that the cat was behaving a bit out of character. She’s an old lady, so she doesn’t move about a lot at the best of times, but she does go outside occasionally and she does walk around pointing out the deficiencies in cat care of which we are guilty. “Why hasn’t the litter tray been cleaned?” “Surely you don’t expect me to eat cat food, again, do you?” The usual stuff: but Saturday afternoon and evening she was completely immobile in front of the living room radiator and nothing could stir her.

Both Carole and I had a lot of work to do this weekend. Carole’s working on a publication and I had some work to do on a couple of Web sites. So we made sure the cat had food and water, and basically got on with our lives. By 7:00 p.m., though, the cat had gone missing. She must just have gone for a prowl around, we thought; but it was very cold and when she hadn’t returned after an hour we started to worry. Neither of us had seen her go out, so we hunted around the house, in all the places she would normally go (under the sofa, on top of the wardrobes …). The cat was not to be found.

By 8:00 p.m. we were really worried that she’d done a Capt. Oates on us. We hunted around the garden. We knocked on the neighbours’ doors and hunted around their gardens. Nothing. We went around the block and found a number of other cats all of whom expressed a willingness to accompany us back into the warm, but Bitzi was not to be seen and we began to accept that the worst had happened.

So we sat a bit on the sofa feeling miserable and telling ourselves that this was the sort of thing that cats did when they heard the call of the great litter tray in the sky. She was an old cat after all and it was bound to happen sooner or later. It would have been better if we could have let her die peacefully in the warm, but with cats, well, they do what cats do.

By 10:00 p.m. Carole had roused herself a bit and decided that, despite everything, she just had to get some work done. So with a heavy heart she went upstairs to pull out some paper she had “filed” under the bed.

As she peered into the sub-duvetic gloom, she fancied that she saw a cat shape at the furthest corner of the bed. “No,” she told herself, “It’s just that I want to see a cat shape. My mind is playing tricks.” She did look again, though, and there did seem to be something vaguely cat-like, barely perceptible through the darkness. When the bed was moved, guess who was sitting there, sulking. You guessed it.

She was definitely not a happy cat, but we googled for feline reactions to vaccination and found that they could lead to up to 24 hours of lethargy and depression.

Yesterday morning after a night in which the cat moved just once from her nest (to go downstairs and use the litter tray) I was sent to Sainsbury’s for cat supplies. One tin of salmon and half a dozen Whiskas cat sweets later, the cat was back to normal.

Capt. Oates, indeed!


 
 
:: Next Page >>

Footer

The content of this website belongs to a private person, blog.co.uk is not responsible for the content of this website.