This is as days pass by, by Stuart Langridge

Drowning in the backscatter

Every now and again, some shit-eyes of a spammer decides to send a million spams and forge my address as the sender. So I come back to my email and find four hundred messages, all of which say something along the lines of "your message was rejected because it was spam", or "the user arsefish@example.org does not exist", or "I'm on holiday until Dec. 31st". This is pretty annoying. What I want to know is: how can I not drown under the weight of this backscatter? I can't go round to each mail server admin that does it and forcibly administer a fatal beating, much as I'd like to. I read my mail with Gmail, so I can't use procmail to filter it all first (not to mention the fact that trying to use procmail has a very similar pain/productiveness ratio to trying to insert the Empire State Building down my urethra). I'm frightened to actually mark these backscattered bounces as spam in Gmail, because if I myself actually mail someone and get a message back saying "I'm on holiday for two weeks" then I don't want that marked as spam -- I want to see it. Part of the problem here is that everything at kryogenix.org goes to me, so when spam is forged from non-existent addresses at kryogenix.org, I get the bounces. I could avoid this by blackholing all addresses that aren't specific ones that I use, but I really like the convenience of being able to subscribe to mailing lists with the address "name-of-your-mailing-list at kryogenix.org", so i can tell if people sell their subscription list to spammers. Suggestions welcomed. I tried creating a Gmail filter that looked for mail that (a) wasn't addressed to one of my main addresses (b) wasn't a mailing list mail (c) contained words like "bounce", "account", "spam", etc and then adding the label "probably-spam-bounce" to it, so that I could see if this technique would work. It doesn't; on an average "get 400 bounces" day, it catches about 60% of them, which isn't much good, and worse it occasionally matches real actual email I get, like Amazon "you have just purchased this item" emails. If anyone has suggestions for a better Gmail filter, or can confirm that I'm OK to tell Gmail to classify these messages as spam without much risk of many false positives, speak up. If your suggestion is "don't use gmail" or "fetch all your email with POP and run it through procmail", then I don't want to do that; I understand that those methods might be better, and if deleting five hundred bounces every week is the price I pay, then I'll pay that price.

Reigniting the browser wars

Alex Russell calls for a return to the browser wars, citing (among other things) the stagnancy of the W3C as a part of the problem, with the argument that browser makers are the ones who can innovate and they're being prevented from doing so by a slavish insistence on "standards". Meanwhile, Andy Clarke calls for the current W3C CSS Working Group to be immediately disbanded, Opera file an antitrust complaint against Microsoft, the HTML5 spec removes a recommendation for non-patent-encumbered video formats after pressure from Nokia and Apple, and all the old fights start up again. Fire and brimstone coming down from the skies. Rivers and seas boiling. Forty years of darkness. Earthquakes, volcanoes. The dead rising from the grave. Human sacrifice, dogs and cats living together. Mass hysteria. Alex has a point. There is nothing but truth in the old saw that a camel is a horse designed by committee. Evolutionary theory tells us that actual forward progress happens faster in small communities, not in big ones. Browser manufacturer innovation is exemplified by Microsoft creating XMLHttpRequest, which ushered in the shiny world of Ajax; standards committee "innovation" is exemplified by XHTML 2.0, about which no-one gives a shit. Forward the innovation. Let the browser builders off the leash of blind and feverish compliance with "standards" made up by committee. However. Let us not forget that the problem with the browser wars wasn't that it fragmented the world in lots of different directions. The problem with the browser wars was that it fragmented the world in lots of different directions that weren't possible to eventually implement everywhere. Don't think of the output of this "innovation" as XMLHttpRequest. Think of it as the IE filter property, which is, as described on that page, "not available on the Macintosh platform". For those of you innocent of such things, this allows you, in Internet Explorer, to apply a visual effect to a bit of an HTML page, where that visual effect is actually implemented by DirectX, Microsoft's graphics library. Good luck porting that to Safari if it takes off. Oh no, hang on, it's "not available on the Macintosh platform", even in Mac IE, is it? Not that Mac IE exists any more. The point here is very much the same as the point behind objections to DRM technologies on music. When browser manufacturers are told "go ahead and innovate -- we want to see progress", it's jolly difficult for them to not think "hey, I know, why don't we take this opportunity to provide something that we can do and other browsers can't? Then, when people start using it, we've locked all their users into our browser!" There are corporate executives the world over furiously masturbating themselves into unconsciousness at the very thought of that technique being open to them again. Perhaps you've bought a few products from their corporations in the past. Standards bodies aren't really there to think up ideas, although that's what they seem to have evolved into. They're there to say, now, hang on a second, if you do that then what about all the people with no working eyes / some other operating system / touchscreens / no money for patent licences. They're there to make sure that the web, which is meant to be there for everyone, isn't separated into the haves and the have-nots, where the have-nots is everyone who won't or can't jump on the latest bandwagon. This is precisely why Silverlight is trying to supplant the web: to divide us into haves and have-nots. It's why Flash is trying to supplant the web: to divide us into haves and have-nots. It's why XUL as an application-development language for web apps was doomed. It's possible that the people Alex is calling on to do "innovation" in the browser will put the best interests of the web first, and the best interests of their companies and their browsers second. It's also possible that a duck will fly in the window right now, juggle some lemon pies, and then deliver IE8, but I don't think that that's very likely either. The current mess over the proposed <video> element is a perfect case in point here: Nokia and Apple have refused to contemplate using the suggested Ogg Theora video codec as a baseline format, because they fear submarine patents despite the Theora project's assurances. OK, they may have a point. However, the HTML5 people have stated, after this pressure from Nokia and Apple, that "we need a codec that is known to not require per-unit or per-distributor licensing, that is compatible with the open source development model, that is of sufficient quality as to be usable, and that is not an additional submarine patent risk for large companies". It is just not possible for such a codec to exist. So, what we, the ordinary web developers of the world, are left with is precisely the same cluster-fuck that we currently have when publishing video: it is still not possible for me to make a video and put it on the web with some assurance that everyone can actually see the fucking thing. How is browser vendors' "innovation" going to help with this? If they were truly "innovative" then we'd see them trying to co-operate on issues like this, because how can it be bad for ordinary web users and web developers to make it easier to publish and watch video? Standards organisations aren't there to dictate what Microsoft and Apple and Mozilla and Opera are "allowed" to implement. They're there to provide a voice for people who will otherwise be merrily buttfucked and then thrown over the side in the pursuit of "innovation". Think Web Standards Project rather than W3C. Of course, the WaSP seems to have lost its way and its voice a bit recently; are they coming back? It's easy to just say "no, no, no" to new ideas, but it's equally easy to say, well, I'm alright, Jack, if you're not coming along with us then you'll just get left behind, regardless of whether you're not coming along because you're unable to. If you think that Apple were right to resist video formats, ask yourself if you'd have been happy if the HTML5 spec had suggested Windows Media format as the default. If you think that browser vendors should innovate, ask yourself how happy you'd be implementing DirectX on a Macintosh. Fix things, yeah. Put some innovation back in, yeah. Let's, though, try to not throw out the baby along with the bathwater.

On the radio

Blimey, tonight I'm on the radio. Specifically, the Wolverhampton Politics show on WCR FM. I'm talking about digital rights and DRM and that sort of thing. It's available as a stream -- I should be on somewhere around 7.15pm this evening -- and it's also downloadable (episode should be available on Sunday or thereabouts). And if you're in Wolverhampton itself you can listen to it on the actual radio. Cool.

Negative numbers in the Google Chart API

Google's new Chart API is a useful little thing that returns a PNG of a chart based on the URL you feed it, so you can create graphs like this: a simple example line graph by just specifying the <img> src attribute as http://chart.apis.google.com/chart?cht=lc&chs=200x125&chd=s:helloWorld&chxt=x,y&chxl=0:|0|10|20 However, as Marty Alchin rightfully complains about, it doesn't handle negative numbers at all. Obviously Google, being the internet success story that it is, never has any numbers for anything that dip below zero, but not everyone's so lucky. However, there are ways to handle negative numbers in the Google Chart API. Sort of, anyway. This is a bodge. Hold your nose and dive in. I'm sure Google will forcibly inject clue into their charting engine at some point, but until then you can sorta-kinda get around the problem like this. a simple line graph with negative numbers For line graphs with negative numbers, you need to do two things. First, lie about the values on the y axis (so you display on the graph that the y axis goes between -10 and 10, in the above example, even though it actually goes between 0 and 20). You'll obviously need to transform your numbers appropriately, so a data series [-10, -5, 0, 5, 10] should be fed to the graphing engine as [0, 5, 10, 15, 20]. The second thing to do is to draw a horizontal line at 0 on the y axis; if we had real negative number support then that's where the x axis should be, and so the extra drawn line "stands in" for it. That's easy enough to do, using the grid lines chg parameter; just make the grid only exist horizontally, and have the grid divide the graph into two 50% parts, with chg=0,50,1,0. The four parameters 0, 50, 1, 0 mean "don't draw vertical grid lines (0)", "draw a horizontal grid line every 50% of the y axis (50)", and "make the line solid with no gaps (1,0)". It's also possible for bar graphs, although it requires a small amount more ingenuity. a bar graph with negative numbers This graph has negatives, right? Well, how it's done might be clearer if you see this graph: a bar graph without negative numbers, with the parts 'below the line' coloured in Yep, you just stack up the bars, and make the bottom bit of the stack be transparent (note that in the first graph we have chco=00000000,ff0000,0000ff, which specifies colours for each data series; the first item in there is 00000000, which is in format RRGGBBAA, meaning 0% red, 0% green, 0% blue, and 0% visible. Actually, it could have been ffffff00, or deaded00, or anything; all colours are the same when they have 0 opacity! The second graph is exactly the same, except now the transparent bars are shown in green so you can see how it's done. You'll note that all these graphs still have the "real" x axis (the line at the bottom of the graph) still visible. This is because there's no way to turn it off, which is unfortunate both for this fake-the-negatives approach and because you can't do decent sparkline graphs if you have to display the axes. Both of the tricks above are horrible fudges which only need to exist until the Google Chart people rediscover the minus sign on their keyboards, which I'm sure is already in their bugtracker somewhere. If it's not, then here, Google, take some of these: - - - - - - - - - - - - - - - - - - - -. Hope you find them useful.

Epiphany

A little while ago I decided to try out Epiphany instead of Firefox as my main browser. It's excellent. It's a proper Gnome application, which Firefox isn't -- it just fits in to my desktop because it has a proper Gnome interface, and I really like that. It starts up and runs way faster than Firefox does; it doesn't crash like Firefox does; it does everything. Huge applause for the Epiphany team, I say. Install the epiphany-browser package on Ubuntu to get it. It uses the same rendering engine as Firefox, so the whole web still works perfectly. I've heard a fair few people bitch about not having access to Firefox extensions, but, frankly, it turns out that I don't actually need any of them. Epiphany actually comes with a load of extensions (install epiphany-extensions on Ubuntu to get them) and there are third-party extensions too if you like. I've changed my opinion on this; I did think that it was bad that extensions need to be written in C or Python rather than XUL/JavaScript, but hey. Of course, the one big missing thing for me, when I have my web hacker hat on, is Firebug, which is the greatest web development tool that's ever existed. Wish that existed. Epiphany is also the default browser in the next release of Gobuntu, which is what I run, so I'd have been migrating to it anyway -- it's jolly pleasing to note that it's actually better, too.

Capturing Caps Lock

Another JavaScript usability tweak from Stuart's House Of JavaScript Weirdness: alert users if they've got Caps Lock turned on when they're entering passwords into your web applications. Capturing Caps Lock Just install the script and go! The other nice thing about this is that it's part of 24 ways, the thing Drew McLellan runs every Advent showcasing 24 cool web things. I'm pretty pleased to have been invited. Drew is pretty pleased that this year I didn't promise him something and then renege :)

This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.