Archive for the ‘Uncategorized’ Category

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

The CD Saga gets worse

Saturday, October 6th, 2007

On my stereo at home it plays fine (although it doesn't work on my Windows computer) but put it into my girlfriend's DVD player and it reports itself to have 17 tracks even though the cover says it only has 15. I hadn't looked closely at the reported track count on the DVD player and just played the disk. After the peaceful ending of the last track on the CD i.e. the 15th, the speakers just erupted in loud white noise. I suppose that was the Windows "autorun" software being played…

Playing a CD on a computer

Friday, October 5th, 2007

… is not as easy as one might imagine.

I'm using Windows, and it seems that in one new aspect, I discover that Windows just doesn't work. (Or maybe it's the CD that doesn't work?)

Ideally I would have put the CD in the computer's drive and it would have just played it. This was Bill Gates' vision once. I think prior to Windows 95's launch, he said "I imagine a day when you can just put a Beethoven CD in the drive and Windows will play the song". (Although I couldn't find that quite on the Internet so maybe he didn't say that.)

So I put the CD into the drive and then some pop-up appeared inviting me to do all sorts of things. This was software on the CD, I think. It had a big friendly button "Play the CD" so I clicked on that but alas an error appeared asserting I needed to upgrade to a newer Windows Media Player. I should do that and the run "autorun" again, it instructed me.

I tried opening my old version of Windows Media Player and playing the CD. Then an amazing thing happened. It required me to enter a "license". It opened a small pop-up window for me to do so. At the bottom were two buttons, "Play" and "Cancel", but "Play" was in grey. In the middle of the small window was a web browser window, displaying some corporate homepage, No idea what I was supposed to do. Nor even if it had worked, what I would have done if I wanted to play the CD while not connected to the Internet.

So I tried downloading iTunes. I didn't want to do that as my notebook has physical buttons for "play", "pause" etc, and they only work with Windows Media Player. But iTunes simply didn't acknowledge the presence of a CD or CD drive at all. Possible it thought it was a data CD as opposed to an audio CD as Windows had probably mounted it as such.

So I figured, well, I'll have to install the latest Windows Media Player then, as per the original error message. So I went to Microsoft's site and downloaded it. But it wouldn't install, on the grounds that I hadn't certified my Windows to be Genuine. But I don't really want to do that, as if Microsoft software doesn't recognize the CD as genuine (and it didn't recognize a DVD as genuine once, so I had to use some software other than WMP to play it), I don't fully trust them to consider my computer genuine.

But it is genuine. All of it. I have a genuine computer with genuine Windows and a genuine purchased music CD in its original case with original cover art etc. And I indeed cannot just "play the song". I mean it all just doesn't work.

So I guess I'll have to listen to it on my stereo then.

EU Countries, ISO 3166-1 Alpha-3

Tuesday, September 11th, 2007

For various reasons I needed a list of 3-letter country codes for all the EU countries. (These are "ISO 3166-1 Alpha-3 codes"). It would have been much better if this software had used 2-letter country codes like everyone else.

And because I couldn't find this list on the Internet anywhere I had to make it myself from some huge list of 3-letter country codes for all countries in the world.

In case anyone else ever needs this (including but not limited to me), here it is.

EU Countries, ISO 3166-1 Alpha-3

Nextstep wins

Tuesday, August 28th, 2007

This article references this article which asserts that:

  • When you copy a directory into a place which already has a directory of this name, Windows 95+ asks you if you want to "replace" the directory. If you say yes, it replaces the individual files, i.e. merges the new directory into the old
  • On Mac OS X it also asks you if you want to replace the directory, but this actually deletes the old directory first
  • That the Windows behaviour is better as it's less destructive, and other reasons

I have a number of comments about this:

  • Independent of if the Windows behaviour is better, the word "replace" implies the Mac behaviour. I have been confused by this before (assuming that if I click "yes" to the "replace" question that it will delete the contents of the destination first, i.e. replace them)
  • There are times when you want merge (merging photos from a digital camera) and times when you want replace (replacing one source tree with another)
  • Nextstep would ask you if you want to replace the destination, or merge (or cancel)

Surely Nextstep's solution is the best. Maybe asking is annoying, but both Windows and Mac evidently ask a question as well, so Nextstep is not worse in that respect.

Just one more example of how technology gets worse with time. Or at least not better anyway, on average.

Tax

Friday, August 10th, 2007

This guy living in Somalia, a country without government and thus by definition in anarchy, does his job but has to give half of what he produces to gunman, who "protect" him. He isn't really very up for this situation, but what is one to do.

From http://news.bbc.co.uk/2/hi/africa/4040889.stm#mahamut:

I get about 20 rods a day but I have to give half of them to the gunman who controls the area I work.

This hammer is very heavy and if I had a choice, I would do something else.
But if I could not go to school and had to carry on doing this, at least if there were a government, I would not have to give half the rods to the gunman.


Right. This guy has not tried living in a country with a government recently.

On all of my without-VAT income I pay 47% tax (average) to the government. Then there's the 20% VAT charged on top of the without-VAT income.

And now I have just got a bill because I paid some tax late. I've no idea which tax I paid late or why. I pay the tax bills immediately I get them. I am not a fool. (= I am scared of the government.)

This late penalty is €104.47. Which is quite a lot, I think, for paying tax late (which I don't remember paying late anyway). I mean what's this money for? I wish I earned enough, that the interest on my monthly tax, that the government lost because I paid something a few days late, was over a hundred Euros. But alas, unless interest rates went up dramatically and I didn't notice, that's not the case.

Or maybe it was the money they had to pay to process my lateness. In which case I wish I was a computer. Processing some database row, collect €104.47. That's a well-paid computer.

So it doesn't matter where you are, or what the style of leadership is in the country you happen to do your work. There's stuff to be paid and there's little you can do about it. And if they decide you've done something wrong and have to pay even more stuff, there's nothing you can do about that either.