BBC NEWS | Programmes | Click | Designing a more accessible web

This article on the BBC site purports to be about how to create accessible websites, but reading between the lines I get the feeling there’s a press release from the company that built J K Rowling’s site behind it.

It looks like quotes have been taken out of context to me:

However, [CSS is] quite a new technology, it’s only been around a couple of years, and a lot of designers are still very wary of using it.

Flash is a very interesting topic in terms of web accessibility. It’s actually capable of being very accessible indeed.

This makes the article come across as ‘use Flash to make accessible websites because it’s better for it than CSS’ which is quite far from the truth. Initially I thought it was just a case of poor expert quotes, but it seems that it’s just poor journalism that’s behind it.

BBC NEWS | Programmes | Click | Designing a more accessible web

Why VB.Net is bad

If a language is going to be loosely typed, then that’s fine as long as you know how to use it. If it’s going to be strongly typed that’s even better. So in JavaScript:

var i=1;
var j="1";
if(i==j)alert("Loose typing ahoy!");

Everything’s fine and you get an alert. And if you go:

var thingArray = new Array();
thingArray[i]="Loose typing still ahoy!"
alert(thingArray[j]);

You get the same thing.

Try something similar in C#, and you’ll get a compile error:

int i = 1;
string j="1";
if(i==j)Response.Write("Oooooh badness");

So it will never work.

In VB.Net, though, we’re in a funny middle-ground where things are sometimes the same, and sometimes different:

Dim i as Intger = 1
Dim j as String = "1"
If i = j Then
Response.Write("They're the same here.")
End If

So far, so ropey, and not that dissimilar to JavaScript. But then:

Dim thingArray as new ArrayList
thingArray.Add(i)
If thingArray.Contains(j) Then
Response.Write("They're still the same...")
End If

will never write anything out. Because despite the fact that 1 = “1”, an ArrayList that contains 1 doesn’t also contain “1” because they’re different…

It’s a cop-out of a language, I say.

.Net file locking on compile

I kept on getting a problem whereby on trying to recompile a project in Visual Studio a dll assembly would be locked when I loaded the project up in a browser with a message such as:

Cannot copy assembly […] to file [..].dll. The process cannot access the file because it is being used by another process.

With a note that the error was something around:

Which wasn’t very helpful. Googling for the error message didn’t help much as there were all kinds of reasons for files being locked, but Googling for asp.net compile file locking did and I was lead to
this page which explains it.

I tried various ‘fixes’ of my own, such as rebuilding the entire solution, starting and stopping IIS through services, and sometimes it seemed to work and sometimes it didn’t. It was very bizarre and very annoying, but the file lock was starting to cause me real problems.

The solution

It was quite easy: disable the Indexing Service from the Services list. Apparently the indexing service was locking the file and it would be released after ‘a bit of time’, which was why my random attempts at fixes sometimes seemed to work, and sometimes didn’t.

Microsoft: sometimes, I really hate you.

Preventing compiled dll’s from being locked in Visual Studio.

Alter tables with MySQL replication

I couldn’t find anything particularly useful about how to alter MySQL table structure in a situation where replication was being performed so I pretty much had to try something out to see if it worked.

What I found was that MySQL was remarkably clever at replicating changes through from one database to another. I don’t know whether just running a straight ‘ALTER TABLE’ command would work or not but I took the added precaution of running a ‘STOP SLAVE’ command (on the slave) first. Then, once the new column had been added to the master, running ‘START SLAVE’ kicked it off and the database automatically picked up where it had left off by propagating the table alteration and then updating the data.

Replication in MySQL from the manual

DomDocument::loadXml not throwing exceptions in PHP

For some reason, Zend have decided not to make PHP throw an exception when you try and load invalid XML into a DomDocument object. This includes XML with invalid characters e.g. &. This means wrapping a try/catch around anything does absolutely no good whatsoever, which is annoying.

Is there a good way of trapping runtime errors using loadXml with the DomDocument library?