Google Print, And Clue Barriers

It’s long been stated that if you put your images up on the web, there’s no real way of stopping people downloading them and using them for their own purposes. That’s still basically true, although one of the interesting things about the new “Google Print” service is the unusual lengths it goes to to prevent the average web user from doing exactly that.

Google Print allows you to search “printed books” (although Google obviously has the data in electronic form). Here’s a sample results page that you can play with as you follow along.

The first thing that prevents you from saving the JPEG of the printed page to disk is that right-click is disabled. They’ve used the standard JavaScript tricks (for Gecko, returning false from the oncontextmenu handler) to disable the context menu for the entire page. This is no problem for those taking back the web. Go to Tools | Options | Web Features | Advanced JavaScript and uncheck “Disable or replace context menus”. Score one for Firefox.

The next obstacle is that View Image on the newly-working context menu seems to show you a blank page. Actually, the printed page consists of a clear GIF <img> overlaying the actual page image, which is a CSS background on a container <div>. So if we just click View Image, all you end up with is a large transparent GIF. And because there’s a foreground image, Firefox suppresses View Background Image on the context menu, for reasons of usability and brevity.

OK, so let’s use the Media tab of the Page Info dialog. This lists all the media on the page, and has a “Save As…” button which allows you to save any media to disk. Except that it doesn’t – it currently works for images inserted using <img>, <input> and <embed>, but not backgrounds or <object>.

The next idea was to copy and paste the URL out of page source. However, Google likes to serve pages without newlines, and there are a lot of similar URLs in it, so this seemed like a pain to track down the right one by scrolling two and a quarter miles to the right. I did note, however, that they are using <style> inside the <body>. Tut tut.

So instead, we can try and delete the clear GIF from in front using the DOM Inspector. We inspect the URL, locate the GIF and press Delete. Bang! The entire image disappears! How did that happen? Well, the <img> was providing a size for the <div> – so when the <img> disappears, the <div> collapses. No problem: we manually edit the CSS style rules to give it a width and a height. This allows us to view the background image again. However, the DOM Inspector doesn’t support the content area context menu, so we still have no way of saving it!

Next idea: use the DOM Inspector to inspect the entire browser XUL. This means that the context menu will still work. It’s more difficult to do, because you can’t locate elements by clicking in the content area – it only works for the chrome. Still, we finally track down the clear GIF <img> and delete it. Boom! This time Firefox crashes (taking with it an earlier version of this blog post.) :-(

OK, let’s try another approach. Let’s find the surrounding <div> in the DOM Inspector, look at its computed style, and copy the URL out of it. Except that the Computed Style view doesn’t support copying. Undeterred, and feeling close to the goal, we view the applied styles for the <div> and try and copy the URL out of the individual background style rule.

Success! This works. We can chop off the CSS gubbins, paste the result into a web browser URL bar, and finally get an image we can save.

In fact, you can also get the URL of the page graphic by viewing the source. It turns out that it’s not as hard as I made out, because currently, the <div> in question has a sensible class name:

.theimg { background-image:url("http://print.google.com/print?id=ULQSG0Zs7vcC&pg=3&img=1&sig=gv2nFptEf0dj7Gzb8eZ4U8UdtUo") }

so it’s easy to find.

So what’s the point? Well, this is an example of what I call raising a clue-barrier. At my university, they didn’t have the resources to chase after everyone playing online games, but needed to prevent them from becoming a bandwidth problem. So, they blocked the port used for a popular online game’s “server discovery” mechanism. Those without clue fired up the client, tried to find servers, didn’t find any and gave up. However, if you bothered to research server IP addresses and type them into the client manually, you could play to your heart’s content. The clue barrier filtered out a large proportion of the population, thereby preventing bandwidth problems.

The key characteristics of a clue barrier are that it’s easy to put up, and it’s not perfect, but it’s good enough to solve the problem. Google’s techniques won’t prevent anyone technical from saving their images to disk, but it will prevent 99.99% of people (at least until someone writes a specialised Firefox extension). And for Google, that’s good enough.

XML Inclusions (XInclude)

The W3C‘s XML Inclusions standard has just reached Proposed Recommendation status.

This document specifies a processing model and syntax for general purpose inclusion. Inclusion is accomplished by merging a number of XML information sets into a single composite infoset. Specification of the XML documents (infosets) to be merged and control over the merging process is expressed in XML-friendly syntax (elements, attributes, URI references).

This seems really like our overlay mechanism, but a bit more complicated. The listed authors are two guys, one at Microsoft and the other at BEA Systems. Does anyone know if any Mozilla people were involved?

Java 1.5 (“Tiger”) Released

Java 1.5 has been released for Solaris, Windows and Linux.

This version of the Java language includes support for generic types, autoboxing, enums, printf, varargs, and more in-code metadata. In the referenced article, each feature is introduced by the relevant stanza of a verse written for the occasion; the quality of the scansion clearly demonstrating that while hackers may be like painters, they certainly aren’t poets. Stick with the original, lads.

This version of the Java platform now has three possible version numbers – the internal version number “1.5”, the generation number, “2” (as in J2SE), and the new version number, “5.0”. Laugh as they try and explain what on earth they were thinking.

All Your Programs Are Belong To Us

Does this article scare anyone else?

With this in mind, ASU [Arizona State University] gives every student an ACE software image that includes Windows, an application stack, a productivity suite and any other files needed for a particular quarter. ASU cuts off access to the USB and floppy drives for this software image and basically blocks the students from changing the container’s configuration. After a given quarter is over, the image – or container – expires and is deleted from the laptop.

Bring a new meaning to the term ‘vapourware’…

Colour-Coded Connector Confusion

Ever wondered why all of your PC’s connectors are weird colours, and who gets to decide what colour is what?

Intrigued by the fact that my old Gateway keyboard (on which I wore out the spacebar after less than a year of use) had an orange connector and my new Dell one had a purple one, and that my microphone connector was a rather effeminate shade of pink, I went in search of the answer. It turns out that the colours are defined by the PC99 standard (careful, it’s 1.5MB of PDF). The standard uses Pantone rather than RGB, so I’ve converted them to a swatch for you.

Connector Colour name Pantone
Analog VGA Blue 661C    
Audio line in Light blue 284C    
Audio line out Lime 577C    
Digital monitor/flat panel White    
IEE 1394 Grey 424C    
Microphone Pink 701C    
MIDI/Game Gold 131C    
Parallel Burgundy 235C    
PS/2-compatible keyboard Purple 2715C    
PS2-compatible mouse Green 3395C    
Serial Teal or Turquoise 322C    
Speaker out/subwoofer Orange 157C    
Right-to-left speaker Brown 4645C    
USB Black 426C    
Video out Yellow 123C    
SCSI, network, telephone, modem, and so on None    

So now you know. (Bad Gateway! No cookie!) How does your computer score? Start with 10 points, and subtract one for each incorrectly-coloured connector or plug.

Strip Club Source Code

From Reuters via Slashdot: Microsoft are making the Office source code available to world governments so they can audit it for security flaws. This follows on from a program to make Windows available in a similar way.

Of course, this is “strip club source code”[0] – look, but don’t touch. Are these governments allowed to make fixes, compile the code and use and redistribute the resulting binaries? No? Well then…

Microsoft: Here. Use these binaries. They are made from the source code you audited.

Government: How do we know that?

Microsoft: Er… because we say so, and we’re nice people?

Diebold: And if you believe that, we have some voting machines to sell you…

You need the freedoms free software gives you to guarantee the integrity of your IT infrastructure. With any other form of “access to source code”, you are just doing free QA for the company concerned.

[0] I’ve never visited a strip club, and never would, but I still think it’s a catchy name.

BIFF

I was looking at BIFF programs, and came across this wonderful demonstration of the fact that geeks understand the word “useful” in a completely different way to the rest of the world.

tkbiff is yet another program to alert you to incoming mail. tkbiff allows arbitrary commands to be executed upon mail reception. If you like programs like xbiff++ but wish they were more flexible, then you’ll like tkbiff. For example, suppose you want to play your favorite song when you get mail that mentions “windsurfing” but play a groan when you get mail from your manager unless you’re mentioned in the cc in which case don’t play anything. This kind of thing is easy to do with tkbiff.

Someone has Too Much Time.

Dell Tech Support Scripts

Hixie writes (about half way down) about “reverse-engineering the Dell Support Broken Disk Script” in order to persuade Dell to fix his Inspiron.

This week, due to lack of 31337 script reverse-engineering skills, I had to execute the entirety of the Dell Support Broken CD-Writer Script with a nice lady from Bangalore. The writer had died part way through a batch of CDs, and was refusing to recognise that I’d inserted a blank disk. Several bits of the conversation went like this:

“But it can’t be a software problem, because it won’t write CDs under Linux either.”

“Of course, sir. Now, if you’ll just roll back your Windows install for me…”

Dell technical support people have an amazing way of agreeing with everything you say and then politely ignoring it. Executing the script took the best part of an hour, and would probably have taken much longer if I didn’t know what I was doing and so was able to do it very quickly when asked.

It’s almost not worth it for a £30 component. Hey, wait, maybe that’s their plan…

More Disruptive Innovations

I need to go on holiday more often, if people come up with smart ideas like HTML overlays while I am away. Kudos to Dan Glazman and Laurent Jouanneau of Disruptive Innovations (obviously a wise hiring, Dan :-).

My first thought is: if and when we get browsers with native overlay support, how do you prevent the backwards-compatibility JavaScript executing and thereby including two copies of the overlay contents? You’d need to mark the script in some way to indicate that it was the special overlaying script, so the UA could ignore it. I see four options, all horrible:

  1. Require that the script have a specific name, e.g.”HTMLoverlays.js”
  2. Specify a correct “type” attribute and then abuse the deprecated “language” attribute (assuming this works in common browsers), e.g. language=”HTMLOverlays”.
  3. Put a magic value inside the <script> tag, e.g. <script src=”…” …>HTMLOverlay</script>. This content should be ignored by compliant UAs if the <script> has a src attribute.
  4. Use a <link> tag with a special “rel” to provide an alternate link to the script; the UA matches up the two filenames and ignores the script.

Any more ideas for solving this problem?

Edit Any Web Page

I just came across Editive – a way to use Mozilla’s support for page editing (OK, and perhaps that of other browsers too) to WYSIWYG edit any random web page in a browser window, and then save it out to disk. This goes further than your average text editing widget – there’s selection indicators, and you can remove or cut and paste images.

It also has the ability to “purify”, or cut down, common web pages to remove ads and banners. Could be useful for accessibility purposes.

Neat trick: Edit this page.

Unredistributable Code (Part 2)

A “mini-editorial” about the cdrecord licensing issue over at OSNews begins:

Basically, the author of cdrecord modified its license to not allow modifications of his code by distros without doing so in cooperation with the author.

Many critisized[sic] the author as a free software-sellout, however, in my opinion, the author has the right to do these modifications and so I am with him…

The link there is to my original blog entry on the issue.

I think it’s clear in my original post, but I feel I should reiterate that I was not criticising Mr Schilling, merely pointing out some of the legal ramifications of his actions. I agree with the OSNews author, that he has the right to license his code how he likes; my point was merely that his change made the code unredistributable, which is probably not what he intended.

I am told (although I haven’t verified this) that the problematic comment has been removed in the latest release, so it looks like the matter has been happily resolved.

EuroFoo Day 2

Yesterday was more fun than I’ve had in a long time. I now know several scary things about locks, including how to pick simple ones (I’ve been practising). I heard a very interesting talk on the BBC’s Creative Archive – they hope to release the first piece of content this year sometime. And I gave a lightning talk (5 mins) on my new idea, and another on Patch Maker, which were both well received.

I’ve also discovered an excellent new game called Zendo, which would be even cooler if it didn’t have a Buddhism theme. I guess I have to think about how much I object to that; on the one hand, it’s all in fun, and Buddhism is a false religion anyway, so how can it hurt? On the other hand, one needs to be seen to be doing the right thing, and to be careful of appearing to condone idolatry.

EuroFoo Day 1

Having just discovered that UTwente‘s campus-wide WiFi (why do UK universities not have this?) works in my hotel room, I thought I should make like Ben Hammersley, Guardian tech-writer and UK blogorati (who’s also here) and blog the conference “live”.

I had to get up at 7am to get a train to Heathrow for my flight to Schipol, eventually ending up in Enschede (which I now know is pronounced En-sked-ee) just after five. I took a taxi to the conference hotel to meet up with the other attendees.

EuroFoo is a very informal conference – the idea is that the participants determine the agenda. So after dinner, we spent the evening doing introductions (with 138 people, it’s strictly name, country and five words to describe yourself) and designing the conference programme on some large boards. As a result, tomorrow I plan to go to sessions on (among other things) Lockpicking, Hacking the Human Brain, 3D printing, and the Digital Divide.

This is so cool.