Saturday, 29 March 2008

Travelling salesman with N processors

XKCD applies one more... I have to say that in this case the problem is slightly changed, since it is no longer the travelling salesman, but N customers going to the distribution office, but heck, the joke is still good.

Add to Technorati Favorites

Tuesday, 25 March 2008

Blackberrying and eating gum

I am getting tired of famous magazines plagiarizing my blog. In this case, Time blatantly copied my post about Google reducing my lifespan. I hope my formula for profits works this time... I have a big time lawyer: his last client was SCO!

Add to Technorati Favorites

Monday, 24 March 2008

How to update Netgear WPN824

In this post I just want to single out a something from my previous post... If you have a Netgear WPN824, the auto-update feature doesn't work. You have to download the firmware image from the website and apply it.
Of course, applying a firmware upgrade is not for the faint of heart. It is one of those cases when reading the manual and following precautions is useful. You have to do it with the device firmly connected to the wall, in a sunny day, without cats, dogs or children around, praying to your favorite deity (in my case, Steve Jobs) that everything goes well.
In a related note, it reminds me of something I learned in my previous jobs. Electric companies don't apply patches to their EMS or other important systems in rainy or windy days, just in case there is a power failure.

Add to Technorati Favorites

The state of plug and play

Today I finally managed to configure my VOIP adapter, a Grandstream Handytone 286. Mind you, it was not easy, to say the least. And that's considering I am a graduate software engineer with 7 years of professional experience; the only way you have a chance is if you fully understand XKCD.
The first strange issue was that my router, a Netgear WPN824, crashed when I plugged the VOIP adapter into it. My first idea was to check if it had the latest firmware; the update system said so, and I went on. Since I had some problems with some VOIP providers and my softphone, and some reports on the Internet said that the firewall could crash the router, I tried to set the adapter in the DMZ. Since my router could only take one server in the DMZ, I had to disable DHCP and manually setup the address, which involved typing the MAC address in the router configuration. As that didn't work -I guess I would have needed to force the expiration of the DHCP address in the adapter- I had to set it statically in the adapter too.
It was really fun to find that the problem was still there: the bloody adapter still crashed the bloody router. I still had a couple of tricks left. I tried disable UPnP, which I read it also caused problems, but to no avail. I was thinking of setting up some port triggering, but I thought that if setting the adapter in the DMZ didn't work, port triggering would be quite useless too.
Going around the router documentation I come across some firmware downloads. I see the versions available and with the corner of the eye I see something strange: the latest version number seems to be different than the one I saw in my router. Fiddling a bit I check and, indeed, I had an old firmware version. All I had to do is a firmware upgrade.
For those of you who have never done it, firmware upgrades is something that really makes a person nervous. If something goes wrong you turn a piece of hardware into a nice decorative ornament; there is no undo, no turning back, it is the point of no return, you cross the Rubicon, you burn the bridges, etc.
Fortunately, the firmware upgrade worked OK and the router no longer crashed. So all I had to configure was the SIP address, the STUN server, the works. That was pretty simple in comparison.
In case you didn't notice the irony of plug and play, I included 11 very technical terms just to configure a bloody VOIP adapter, which took me 2 hours and lots of guesswork to make it work


Add to Technorati Favorites

Wednesday, 19 March 2008

Internet as a catalyst...

a catalyst of people with way too much time in their hands. Just check this video.... These guys would not have spent those days setting everything up if they couldn't show it in the web (and even if it is tricked and isn't continuous, I dare you to set up all that stuff). But what is even worse, the video has 538,169 views, which means, that if every person just saw 3 minutes (less than half), humankind has lost 3 man/years of people just for watching this video. Yes, 3 man/years were lost just because people were watching a video of boxes falling in a supermarket!

Add to Technorati Favorites

Sunday, 16 March 2008

Behold, mere mortals! My prophetic powers show themselves all seeing once again

Some time ago, I wrote a post about the Oyster card; I also mentioned some privacy concerns from a fellow blogger. Well, in this article it is stated that it is being discussed whether the government should be able to access those records. A very smart comment in Slashdot shows how stupid this idea is, since a not-completely-stupid-terrorist will still use single tickets (hey, you are going to blow up yourself, you are not going to need that pension fund)


Add to Technorati Favorites

Saturday, 15 March 2008

Bubblesort with N processors cannot still be reduced from O(n)

So, continuing with the previous post, let's assume we can make N comparisons simultaneously. Bubblesort won't still improve the speed from O(n); in the pathological case, where we have MAX, x, x2, x3, ..., x(N-1). Only one comparison per cycle will return that a swap has to be executed. so, we still have to do N-1 swaps.
Now, how we use all this comparisons? Well, a simple algorithm will be to make N/2 comparisons per cycle, comparing all elements xE with xE+1 (where E is all the even numbers). In the next cycle, we compare xE-1 with xE. Why not do both at the same time? It is very simple: we might have a problem that both return true, and we must execute both swaps; which is the equivalent of swapping xE-1 with xE+1. But how do we know that? We must compare the results of the comparisons, and we still have the problem of how xE+2 may compare with xE+1.

Add to Technorati Favorites

Thursday, 6 March 2008

Bubblesorting with N processors (where N is REALLY large)

I was reading this article in Slashdot, and after this comment an interesting question came to my mind: what may happen if you have a massively overpowered computer for solving a problem. By "massively" I mean that for an O(n) or O(n .log n) you have C.n or C.n.log n processors and equivalently ingent amounts of memory considering parallel memory access (usually memory is not a problem, since even if you solve problems with 1.000.000 integers, that doesn't make a dent in present computers).
So I will try to think how to implement some of this algorithms... if I have too much time (I won't) I will check if I can simulate them. Unfortunately, normal multithreading may not work optimally, since to have some real simulation I would need a per-instruction round-robin, so I don't think that will be possible.
Of course, I am not original. This is the same concept as the Chinese Lottery Cryptanalisis attack (there is even an RFC about it)

Add to Technorati Favorites