Archive for the ‘Uncategorized’ Category

Useful “standby” button

Monday, January 28th, 2008

Before I left Vienna, the Internet stopped working in my flat. There were some major electrical engineering works going on in the building, so I assumed this was the cause. Now I’ve come back, they’ve stopped, but my Internet hasn’t started working again.

The modem, from my ISP Chello, was an “ARRIS type”, and the “online” light (light 2 in the following diagram) was permanently flashing.

What was the modem trying to communicate to me? On the Chello homepage it says one should turn the modem off and on if this happens. Needless to say, by the time I read that helpful advice, I’d already done that quite a few times!

But it turns out there is a button on the modem, which is marked “standby”. Amazingly enough pressing this has the effect of

  1. making the Internet no longer work, and
  2. making the “online” light flash instead of being constant.

Why would one want that? How had it come to be in that state?

Anyway, pressing it resolved the problem, and freed me from the necessity of making a telephone call to Chello support.

Subscribe via Email or RSS

Wednesday, January 23rd, 2008

To keep up to date with new postings here on my blog you can use one of the following subscription facilities:

  1. Enter your email address on the subscribe by email page. You’ll get an email each time I do a post. You can unsubscribe any time. You can also subscribe to just some categories (e.g. Databases, or Life).
  2. Use an RSS reader. If you don’t already have one, you can sign up free for Google Reader. Find the “add feed” option (in Google Reader it’s on the left hand side) and just type in my URL, www.databasesandlife.com.

Deceptive practices in mobile data tariffs

Tuesday, January 22nd, 2008

As those who know me know, I was sent a bill for € 2600 from T-Mobile Austria because I’d used their data card in the T-Mobile UK network. I’d downloaded 260MB. T-Mobile Austria claimed that T-Mobile UK was a “foreign network” (choosing to be one brand only when it suits them) and charged me € 10/MB despite charging only € 39/month for 800MB when I’m in Austria. Quite a price difference. It clearly didn’t cost them that much, they only adopt this strategy to rip people off. I even went to the consumer protection agency in Austria who agreed it was outrageous. They wrote T-Mobile AT a letter asking them to reduce the bill. T-Mobile promptly wrote back and said “no”.

I considered switching operators in Austria, but I looked around, and it turns out all the other operators have a similar price structure. Apart from the operator 3. They have a no-roaming-fee policy, as long as one stays within their network.

So, now I have signed up for 3 UK (as I was in the UK at the time I needed it, and I figured with no roaming costs, it doesn’t matter where you sign up). If I’d been with 3 before rather than T-Mobile before, my monthly bill would have been £10 rather than € 2600.

But I was, nevertheless, still extremely suspicious of network operators, after my experience with T-Mobile. And with good reason, it turns out.

3 supply a tool (with a horrible UI! – but it works) to allow you to connect to the Internet. I have only used their tool to connect, not any other. And helpfully it tells you how many MB you have used. You get 1000MB included in the monthly fee and every extra MB costs 10p.

But the other day I booted my computer and found the number of MB used had gone down overnight! The display on the previous day had been around 400MB and now it was showing around 300MB. This couldn’t be right.

One of the things I learned from my T-Mobile experience is that operators have websites where you can check your current bill. Supposing that 3 also had such a facility, I went around looking for it and sure enough it does have one, called my3.

And I suspected, the tool was showing an incorrect amount.

  • Here is a screenshot of the tool which says that 439+91MB have been used, i.e. 530MB have been used, so 470MB should be remaining from my monthly 1000MB.
  • A screenshot of the website however clearly shows I only 228MB are actually remaining.

If I had believed the 3-branded tool which installs itself onto the computer the first time you plug the 3-branded modem into a USB slot on your computer, I would have surfed e.g. 242MB more than my 1000MB allowance – or maybe more if the used amount goes down again mysteriously. That would have cost £24 extra, which is not the end of the world, but it’s not the £10/month deal I signed up for.

I wrote to customer services explaining the situation and suggesting they file a bug report against their software, as it displays incorrect data, and the data is directly relevant to billing. Amazingly a customer services representative called me and explained to me that only the value on the my3 website was the authoritative value. I explained that I understood that, but he should still get the program fixed, or at least display a warning. He said he’d “look into it” but it didn’t sound to me like he had any power to do anything about that. But maybe I’m wrong.

But basically, be very careful of mobile companies concerning data tariffs.

  1. T-Mobile AT charging € 39/month for 800MB is € 0.04 per MB. They charge € 0.20 for any MB used over the 800MB limit. But roaming to the network apparently with the same brand in the UK, they charged me € 10 per MB, which is 50x € 0.20. But they’ve got the UMTS equipment in the UK anyway, for their UK customers who are on similar price-plans. The only extra complexity is provisioning and billing. I don’t believe that costs 50x more than building the UMTS network in the first place.
  2. 3 UK produce a 3-branded tool installed from a 3-branded modem which came with my 3 contract, which displays blatantly incorrect data. Upon calling customer services one learns one cannot trust the tool, one can only trust the my3 website. But that is far from obvious. Anyone trusting the number on the tool will end up with a bill for a higher number of MB than they had believed they had used.

Bosses used to be called “administrators”

Thursday, January 17th, 2008

I was talking to my father over Christmas and he said that in his career, job titles of bosses had been various things, such as “leader of”, “head of”, etc. But he said when he started, they were called administrators.

I think that’s a great name for a boss. It emphasises that the job of the boss is to get out of the way of the employees and let them get on with their jobs. It also emphasises the positive aspects of a boss from the perspective of the employee, i.e. certain things which do not directly relate to the job, yet have to be done—such as coordinating holidays, managing pay, managing the office—should be done by the boss, to let the employee focus even more solely on their area of competence.

Imagine “administrator of software development” rather than “head of software development”. That sounds to me much more like how it should be!

Regular automated backup of WordPress blog

Monday, January 14th, 2008

For my old uboot blog I had a very simple backup strategy.

The whole blog was available as an RSS feed. (I.e. not just the latest entries: the feed included every article right back to the beginning.) I set up a crontab job on a friendly Linux machine to download that with “wget”, then commit the resulting file to my private Subversion repository.

A similar technique is available with Wordpress. It has an “export” feature which allows you to download the entire blog in an “extended” RSS format, including comments etc.

You have to be logged in to the Wordpress admin system to use the export. However “wget” takes the “–accept-cookies” parameter which takes a “cookies.txt” file. The documentation assumes you’ll be running your browser on the same machine so it expects you’ll have a “cookies.txt” file available. I didn’t but it was a small matter to take the “cookies.txt” file from my Windows machine – where Mozilla correctly stores the file under the “Documents and Settings” Windows directory – find the two lines for the cookies “wordpressuser_nnn” and “wordpresspass_nnn” (the “nnn” is a long hex string) and strip out the rest. “scp” across to the Linux machine and “wget” accepted the file fine.

A small change to my script now downloads this Wordpress export, and commits it into my Subversion as before.

There was the slight inelegance that Subversion only creates a new revision when the files being committed have actually have different content: and I like this feature. This worked fine with the Uboot RSS feed but the Wordpress export includes a comment “generated on <date/time to minute accuracy>”. So every night when the script runs a new revision would be created. No matter, I entered a line using “sed” to strip that out from the comment, committed it, then did a “svn diff” to check that really only that line had been changed.

So now my script looks like:

#!/usr/local/bin/bash

# in crontab:
# 0 4 * * * ~/private-svn/blog/backup/download-backup.sh

cd ~/private-svn/blog/backup
export SITE=http://www.databasesandlife.com/
export FILE=databasesandlife.wordpress.xml

wget --quiet \
  --output-document $FILE.tmp --load-cookies cookies.txt \
  "$SITE/wp-admin/export.php?author=all&download=true&submit=xx"

# the created="xx" attribute in a comment causes each download
# to be a new commit; yet i only want actual changes to show
# up in the subversion revision history
sed 's/created="....-..-.. ..:.."-->/-->/' < $FILE.tmp > $FILE

svn commit -m '* Automatic blog download from crontab' $FILE

Domain-name search Firefox feature

Wednesday, December 12th, 2007

Installing this into Firefox (takes < 1 minute and doesn’t require a download) allows you to check for the availability of domain names straight from the browser.

It was created by my colleague, who works with me at easyname.eu, but it was his idea, and I genuinely think it’s a cool feature!

Beispiel

Sunday, December 2nd, 2007

Christina and I have a cool HDD/DVD recorder in Macau. One can set up timed programs and it records them from the TV when one is away. You can even copy them to removable media (DVD).

I wish I had something similar in Vienna! Ah yes I do, I realize, I own a VHS recorder :)

To set up a timed program, I have to first the device date/time. I'd never done that (Blinking "–:–" situation). I took a look at the instructions, and there was the "Beispiel" (example) of setting the clock to December 1998. Ah yes, I remember I bought the device in the summer of 1999.

And only today, 2nd December 2007, for the first time, do I set the clock and create my first timed recording :)

P.S. The summer of 1999 is so far away in the past, when I bought the recorder I was seriously stumped by the fact the manual was only in German and I didn't speak German back then.

Vector graphics in the browser

Thursday, November 22nd, 2007

I’ve taken a look at the state of vector graphics in the browser.

Since the beginning of the web, people have been using GIFs to display their headline texts; tables and CSS to do layout; and GIFs for rounded corners etc. A lot of this would become a lot simpler if the browser was able to display vector graphics.

There are numerous systems for displaying vector graphics but the two I looked at in detail were the <canvas> tag and DOJO. Initially I realized that the <canvas> tag could not plot text, and I thought the DOJO system could. But it turns out it can’t either. So I concentrated on the <canvas> tag.

The <canvas> tag, which works on Firefox, Safari and Opera, and a 1-line Javascipt include of excanvas, also works on Internet Explorer. It works well for trivially simple things. But there are a few things that don’t work like I expected.

(1) No callback for painting. Essentially a <canvas> is just a bitmap (like an <img>) which you can draw into programmatically using Javascript. This contrasts to traditional vector programming, where you register some kind of callback, and the system calls you when it needs the part of the window under your control to be redrawn.

The traditional way is certainly more complex, but it has a few advantages. If you are doing any kind of document editing, e.g. you are programming Word, then documents get big. But only a small amount is displayed on the screen at once. This gets more marked if you zoom in to 500%. With the callback mechanism, your application only get asked to draw the small part of the window on display. With the <canvas> approach, you have to draw everything, all the time. Imagine a grid which needs to draw lines every 5 pixels. That’s a lot of lines on a 1,000 x 1,000 pixel screen; but it’s a lot more if you need to draw everything in a 10,000 x 100,000 pixel workspace that the user could scroll around on.

It simply takes too long to draw everything the user could possibly see if you have a large workspace, or view a large document at a higher zoom. On a 5k x 5k pixel <canvas> with such a grid, Firefox complains “script seems to be unresponsive”, whereas on a 1k x 1k grid (which is all you can see) it works fine.

(2) Large <canvas> takes up lots of memory. As a <canvas> is just a bitmap, if you create a large one, a large amount of memory is immediately allocated. So if you are programming a Word using this technique, and the user scales the document to 500%, immediately their computer will slow down as the browser needs to allocate a huge amount of memory just to store all the pixels the user could potentially scroll around to see. And the Internet Explorer control and the Opera <canvas> seem to have a limit somewhere around 5k pixels.

(3) You can’t draw text. This is surely the most amazing limitation. Look at all the vector graphics examples in the web and you’ll see e.g. beautiful clock examples – but they use a JPEG as the background to the clock including the numbers. That’s hardly the way I had imagined vector graphics would be used!

But there is a “solution”, as we see in this nice windowing example. As the browser can already display text, and the background to a <canvas> is transparent, you can layer one <canvas> on top of another, and put <div> objects inbetween.

If one is to display e.g. a Word document, with various vector graphics and various pieces of text, one would have to create lots of <canvas>es and lots of <div>s and absolute-position them on top of one another. That seems to me like a lot of programming work to create this structure, and to maintain it. And it can’t be easy or quick for the browser to render such a document.

There is a solution in sight though. There will be a <canvas> drawText command in Firefox 3. Currently nobody has Firefox 3 and none of the other browsers support it. But that will no doubt be different in a few years time.

(4) There is no way to query text metrics. If you want to have vector graphics and text on the same page, you need a way to find out the size of text in pixels. For example you want to center text on the screen. Or fit text into a weirdly shaped object. Thankfully this is supported with the Firefox 3 drawText command.

(5) Opera zooming doesn’t work. Maybe this is just an implementation issue, but as the vector graphics are turned into a bitmap at the time the Javascript commands to draw into the canvas are executed, if you say “scale to 200%” in Opera, it scales the generated bitmap, as opposed to scaling the original vectors and re-rendering them.

I always object to the name SVG on the grounds that it stands for “Scalable Vector Graphics”, and vector graphics are scalable by their nature, so I don’t understand why the file format wasn’t just called VG. But it seems someone has indeed managed to implement what I thought was impossible: “non scalar vector graphics”.

Conclusion

So what is one to do to implement a client-side app manipulating vector-based documents? It is clearly the way of the future.

As far as I can see, it’s still not very easy. Which may explain why there are none of them around. The only one I can think of is Gliffy – and that’s written in Flash.

(a) An alternative scrolling technique will have to be found. If the user is manipulating a large document, or a small document at a high zoom, then creating one big <canvas> and using the browser scrolling isn’t going to work. One will have to implement ones own document-navigation (i.e. scrolling) system. This will not be what the users expect. But it’s the technique that Google Maps uses: it doesn’t have windowing-system scrollbars to let you pan the viewable area within the original document (the world map): it has its own navigation system.

(b) Displaying text is going to be a pain. No more myDocument.display(graphicsContext) – where the code to display the document is decoupled from the particular drawing implementation.

The code to display a document is going to have to be quite tightly coupled with the display system (create and maintain <canvas> and <divs>). And for making modifications, I’m not sure if it’s going to look nice to delete those <canvas> and <divs> and recreate them each time, maybe one is actually going to have to modify them e.g. during a drag operation, which will make the code particularly front-end specific.

Sony support: Day 35 (approx)

Friday, October 26th, 2007

I realized I never finished the story about Sony laptop Support.

The laptop was returned after about 5 weeks, and it did work. In the mean-time some plastic is coming a bit detached around the screen (that was one of the things they replaced), but if you handle it gently, it's OK.

It was returned to the wrong place. Well I asked them to call me before they returned it, as they picked it up from one of the offices I work in, but I work in lots of different offices so I wasn't sure I was going to be in that particular office whenever they delivered it back. But of course they didn't, I just got an email from the boss of the company in the office they picked it up from, telling me it'd arrived back in that one.

Then about 2 weeks later, they called me to ask me how satisfied I was with the service, on a scale of 1 to 5. That was wonderful. I just told him everything that'd gone wrong. Then he repeated: "no sir, I need to know your satisfaction on a scale of 1 to 5". He wasn't actually interested in what'd gone wrong; he was only interested in this single metric! I also told him that I was happy to be contacted by Sony if they were interested in improving their processes. So far they haven't contacted me, so I suppose they aren't interested.

Mr O'Reilly still uses "vi"

Thursday, October 25th, 2007

Cool

http://radar.oreilly.com/archives/2007/10/iphone_blackberry_excel.html