Quantum Bogosort

2010.07.01 21:31 by Leo Antunes - 3 Comments

Sometimes Wikipedia shows it even has a somewhat humorous side. My finding it funny may be a product of late night learning sessions and semi-random clicking-sprees, but still, worthy of a chuckle for those with the right (wrong?) inclinations.

Quantum computing could be used to effectively implement a bogosort algorithm with a time complexity of O(n). It uses true quantum randomness to randomly permute the list. By the many-worlds interpretation of quantum physics, the quantum randomization spawns 2^N (where N is the number of random bits) universes and one of these will be such that this single shuffle had produced the list in sorted order. The list is then tested for sortedness (requiring n-1 comparisons); should it be out of order, the computer destroys the universe – implementation of this step being left as an exercise for the reader. The only observers will then be in the surviving universes and will see that the randomization worked the first time and that the list is in sorted order.

Note, however, that while this algorithm is O(n) in time, permuting the list requires O(n log n) bits of quantum randomness. It also assumes that destroying the universe is O(1) in operation.

Found here.

Re: Firefox/Iceweasel/Chromium smart-bookmarks

2010.06.27 13:31 by Leo Antunes - 3 Comments

Neil Williams recently commented on the lack of smart-bookmarks in Firefox/Iceweasel/Chromium and since the post doesn’t accept comments, counter-post FTW.
Maybe I didn’t understand exactly what was meant, but I’m personally trying to see the advantage of having a smart-bookmark sit on the toolbar as opposed to just being used via a label. Both FF/IW and Chrome can do the label thing, where you bookmark something like “http://bugs.debian.org/%s” with a shortcut like “bugs” and can then simply Ctrl-L to the address bar and type “bugs 999999″. Done.
Can the way Epiphany does this be more effective? (actually this is the way Galeon did it way back then and I used to love it before I found out I could be way quicker with the keyboard+shortcut thingy. Not to mention having less clutter in the toolbar.)

And granted: Chromium’s interface doesn’t allow the editing of this shortcut and they only work when imported from FF/IW, but I expect this to be fixed eventually. Doesn’t make much sense to have such a “hidden” feature. [UPDATE: nevermind. As handily pointed out by Chris Butler, you can edit the shortcuts under Options→Basics→Default Search→Manage. It might not be the most intuitive of places to put it, but it's there.]

As for the rest of the reasons for switching mentioned in the original post, I can certainly see where they’re coming from. No real solid counter-arguments there.

The Portability Dance

2010.04.11 22:15 by Leo Antunes - 0 Comment

I don’t presume to know what’s going to happen – if anything – now that Apple outlawed third-party API abstractions, but it did make me think a bit about the different ways people see portability.

The whole dance seems strangely fascinating: developers have obvious reasons to want their applications to run on the most diverse number of architectures – specially in a market which still isn’t so clearly defined as the PC market – and platform vendors have an equally obvious interest in having the best applications around run on their platforms.
But it gets further muddled up when platform vendors control the gateways to the platform, something that’s – as far as I can tell – unique to the mobile market. Now the platform vendor not only wants the best applications for themselves, they can filter out competing applications and leverage the system to keep good applications out of competitors’ platforms.

But back to portability. Portability becomes progressively harder – and less efficient – the higher we go in the abstraction scale.
Hardware portability may have many pitfalls, but is homogenous enough to be achievable in a wide range of targets without sacrificing too much functionality, as is the case for the Linux kernel.
OS portability gets a bit trickier. Even though the underlying hardware may have conceptually similar interfaces, the exposed APIs may vary greatly and the problem becomes two-fold: keeping the amount of OS-specific code low and providing an integrated experience in the different OSs. This can still be somewhat solved either with additional abstraction layers, like Java’s Swing, or with using one ported toolkit, like Gtk for Windows, but both options make sacrifices.
The current mobile market takes these problems a step further, by having wildly different hardware platforms, even more incompatible APIs and to some extent even different interaction paradigms (while most other PC architectures agree on folder/file, click/drag and window/desktop paradigms).

All this culminates in the only non-dubious argument for Apple’s move: quality assurance. They’re hold on developers might turn out not to be as strong as they wanted, but at least in terms of quality, demanding applications to be written specifically for them is a certain win.

Or course, this rambling is pretty much moot when it comes to Apple, which has a force-choke grip on their specific market niche and an equally force-related hypnotic influence over masses of developers and users. They can pretty much put “receive a kick to the balls/tits” as an EULA requirement and you’d still see millions flocking to Apple Stores to buy whatever cute gadget they’ve got next.

It’s just interesting as an open-source developer, to whom portability is such an obvious advantage, to see it being used as leverage tactic.

And in the end I’m only slightly annoyed by Apple’s decision because it’s another reminder of a possible 1984-esque future where access to technology – both by users and developers – is metered out by our not-so-benevolent corporate overlords.
There are certainly other giants out there intent on keeping general-purpose computing alive, but the thought is still haunting, that a sort of K-T extinction event might creep on us without our noticing and cause all the PC dinosaurs to die of uselessness when the mobile devices become powerful enough, suddenly taking away all our hacking freedoms.
Haunting indeed.

On buying drugs…

2010.04.03 18:56 by Leo Antunes - 2 Comments

pile'o'books

I guess you should start worrying if buying a big stack of books is the biggest endorphin rush in your day-to-day. Specially considering the time it’ll take to actually go through them…

Yeah, about that…

2010.02.03 18:23 by Leo Antunes - 2 Comments

I was trying not to complain about it, but now that the number of people asking me about it is getting bigger, my frustration got the best of me.

I'm NOT going to FOSDEM 2010

So unfortunately I won’t see you all there.

Away-on-lock 0.5.2

2010.02.01 14:28 by Leo Antunes - Comments Off

Changes:

  • added an INSTALL file by popular request
  • use LIBPURPLE_LIBDIR in install target

Get it here

The Cat Piano

2010.01.04 02:07 by Leo Antunes - 0 Comment

Well, what do you know? Sometimes you can actually find some pretty interesting things, when looking for something totally unrelated.

My heathen gods bless the internet.

Original site: catpianofilm.com

Re: Making pbuilder just that little bit faster

2009.12.29 23:45 by Leo Antunes - 1 Comment

Absolutely, but there are at least two workarounds:

  1. Adding
    BINDMOUNTS="/var/cache/apt/archives"
    APTCACHE=""

    to your .pbuilderrc, in case you don’t need any special separation of local and pbuilder caches (that’s my case).

  2. Using apt-proxy or the like, which has its overhead, but also its other advantages.

None of them seem all that bad to me, considering the sensible speed improvements to pbuilder, but the ultimate decision probably depends on the amount of disk-access the packages in question need.

“Pocahontas 3D with Aliens” review

2009.12.29 22:14 by Leo Antunes - 3 Comments

After watching Avatar twice – first the normal version then the 3D one – I must say it’s a pretty interesting movie.

If nothing else for being another brilliant example of media as message. The plot exists as a simple support for the astounding aesthetic voyage, being specially appealing for those that appreciate the fact most of it was drawn, technically assisted as it may have been. The eye-candy blurs the line between reality and animation so successfully it barely needs any suspension of disbelief.

The plot, on the other hand, needs plenty. If you’re only interested in the higher art of story telling or the myriad social and cultural implications of human-alien interaction, the movie will probably disappoint. It’s not a bad story per se, but it’s just too basic to be of interest, even if well told and superbly assisted by the visuals.

It’s a pity the producers didn’t deign the story worthy of a more serious take, specially considering the extreme graphic violence. It’s certainly no kiddie movie so I see no reason why the story couldn’t have been sensibly improved and turned into a compelling argument about several different interesting dilemmas with only a few basic twists.

As it stands it surely takes the prize as the most beautiful film I’ve seen in a while and the 3D experience only adds to it, but it could have achieved classic status had they taken just a few more risks.

A picture is worth 2 and a half words

2009.12.20 18:25 by Leo Antunes - 0 Comment

When I moved here someone told me “nah, it almost never snows here“.

2009-12-18

Granted, that’s not a lot of snow, but it’s been there for a couple of days already and it’s still snowing, so certainly more than “almost never”. Specially considering we’re not even in winter yet.

On a different note, I think this cellphone camera can actually do some half-decent pictures, with good lightning conditions:

2009-12-14

2009-12-14

That doesn’t mean I don’t want to buy a real camera in the near future, but it counts for something.