Archive for the ‘sci-tech’ Category.

OpenID, a Neat Idea

If you’re anything like me (wait, that’s not an insult!) you live a busy life online. You have a multitude of registrations and user IDs and passwords for many sites on the net. There are many ways to manage this inherent mess with different trade offs between convenience and security.
One methods that I came across recently is using an Open ID (here’s the Wikipedia page.) I first saw this when leaving a comment on a Blogger weblog. I noticed that one of the authentication methods it supported was a single URL, and the caption read “Open ID”.
Well, suffice it to say that after a couple of hours I had my own personal Open ID provider up and running, using phpMyID. Even if you don’t have an Internet-reachable box at your disposal, you can use one of the free ID providers (listed on the above pages.)
I’m yet to investigate the security of the whole system in depth, but it seems well enough. In the least, it let’s me be in charge of my own security instead of some random web site.
But such a scheme does not work if it’s not adopted, not by users, but mainly by software developers. As a developer, I’m going to consider giving the users of my next web-based application (if I ever develop such an application again) the option of logging in using their Open ID. I hope others do so as well.

VN:F [1.9.13_1145]
Rating: 7.8/10 (4 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

Simplest Turing Machine

One of the cellular automata that were made famous by Stephen Wolfram in his fascinating book “A New Kind of Science” (or NKS for its worshipers) has proven to be a universal Turing machine. It’s the 2,3 machine (named 2,3 because it has 2 states and 3 colors for each state.)
Apparently, it had been proven before that no universal Turing machines with 2 states and 2 colors or less existed (it should not be difficult, because the number of all such machines is really limited.) Now, after a $25’000 prize was announced a few months back, an undergraduate student has proven that the said automaton is indeed universal and can perform any computation that the original Turing machine was capable of.

Two notes: First, I’m not a fan of NKS and Wolfram. He really over-estimates himself and his book. On the other hand, he is a genius and NKS is interesting and a mind-opener. Besides, people wanted to burn Galileo at stake in his own time! Who am I to decide who is right and who is wrong?!
Second, whenever I hear/read/write “Wolfram”, I can’t not think of “Wolfram & Hart” (in Angel TV series) and therefore Buffyverse! Joss Whedon rulz!

UPDATE 2007-10-30: It seems that I was in too much hurry in announcing this. The proof has come under scrutiny and now it seems that it has flaws. Read more on Slashdot.

VN:F [1.9.13_1145]
Rating: 7.8/10 (4 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

How Do You Setup Windows?

A friend sent me this link into the blog of the creator of VirtualDub (a very impressive piece of code.) In it, he describes how he installs Windows XP and how he configures his installation. The thing is that his procedure was freakishly similar to mine! Except that I don’t use Perforce!
By the way, I have been thinking about writing a guide on how to rip DVDs into high-quality, compressed MPEG4 formats. Is there any interest in such a thing?

VN:F [1.9.13_1145]
Rating: 7.8/10 (4 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

Playful Pluto

As you probably know, a 10th planet (called UB313, or Xena) was discovered (not too) recently in our very own Solar System, but beyond Pluto. The reason that it has evaded our eyes till now is that its orbit forms quite an angle with the rest of the planets (with the first 8 at least, since Pluto’s orbit is not aligned with us either.)
Actually lots of stuff are discovered beyond Pluto everyday, but the important thing about UB313 is that it’s slightly larger than Pluto!
The discussion whether Pluto itself should be considered a planet has been going on for some time now. There are many things wrong with Pluto (or at least irregular) :
First, it has a very large (relatively) satellite, named Charon (pronounced kay-ron) with a diameter more than half of the diameter of Pluto, and a mass about 1/9 of that of Pluto. This ratio of mass causes the center of rotation of the Pluto-Charon system to be somewhere outside of both of them. Therefore, neither of them revolves around the other.
As a comparison, the mass of Earth’s Moon is 1/80th of the mass of the Earth. This means that the center of rotation of the Earth-Moon system is 1/80th of the way along the line that connects their centers. Since this distance is ~400’000km, and Earth is the bigger object here, this point would be at about 400’000/80 (or 5000) km from the center of the earth. Again, as you all know Earth’s radius is ~6300km, so the center of the Earth-Moon system is well inside the Earth, and Moon undoubtedly revolves around us. Also, have in mind that Moon is really big relative to Earth compared to other planet’s satellites.
Let’s go back to Pluto now. The second thing about Pluto is it’s orbit. Not only it forms an angle with the plain that all other planets’ orbits more or less lie on, it’s a longer ellipse than typical for other planets. The orbit is so far from a circle that during a portion of its year, Pluto actually gets nearer to Sun than Neptune!
The third issue with Pluto is its size. Pluto is the smallest of all the 9 planets. It’s diameter (2300km) is far smaller than Mercury‘s (4900km,) the second small planet in the Solar System. What’s more annoying is that Pluto is actually smaller than Triton (Neptune’s moon,) Titan (Saturn‘s,) Callisto, Europa, Ganymede and Io (all Jupiter‘s) and even our very own Moon! (It might be interesting to know that Ganymede and Titan are even larger than Mercury, but who dares touch Mercury?)
And now this UB313 business. That’s why last month (August 2006) the International Astronomical Union changed the definition of “planet” so that it no longer included Pluto or UB313. They are called “dwarf planets” now and I think Ceres (a 1000-km asteroid!) and Charon are included in the definition. Of course, this redefinition, like any other radical change, is the subject of heavy controversy.
In any case, for now, the Solar System has 8 planets!

VN:F [1.9.13_1145]
Rating: 7.0/10 (3 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

IEEE 754

That’s the floating point number format standard. What do you know about how floating point numbers are stored? (We are not talking about arithmetic.)
My experience with programmers is that many of them don’t know anything about these formats. Sure, they know that the real numbers are stored as sign, fraction and exponent triplets, but nothing more. After all, who needs to know how computers actually work these days, right?

Well, if you think like that, I’m sorry for you. These line of thought may be practical (I hate that fact,) but it’s not at all part of the hacker/geek spirit. Here’s a brief description about how floating point numbers are stored, according to IEEE-754.

I thought there were 3 formats for floats, but as it turns out, there’s four. They are 32, 43, 64 and 80 bits (who’ve ever heard of a 43-bit float? Honestly?) The most widely used form is the 64-bit, or “double precision” one.
This format (and all others) have a single sign bit (the MSB), with “0″ for positive and “1″ for negative numbers. Then comes an 11-bit exponent field. And after that, a 52-bit fraction part, for a total of 64 bits (it’s 8 and 23 bits for the 32-bit single precision format.)
As you know, floating point numbers are stored as some for of scientific notation, with base 2. Basically, that means that the value is the result of the multiplication of a M by two to the power of E.

But that’s not the whole story. First of all, you have to realize that every number you write in binary, has a ’1′ as it’s leftmost bit. Think about it! Without zero-padding on the left, every number must have a non-zero digit at its left, and in radix-2, that means a 1. So we omit that 1 and save one bit. In our scientific notation, the M must be normalized to be greater or equal to 1, and less than 2.
Second of all, the E is not the exponent, but the exponent minus 1023. That is, if you want 2 as E, you have to set the exponent to be 1025. This way, you can accommodate negative values as well. You might wonder why the common two’s-complement method why not used. Well, I don’t know all the reasons, but one of them probably has been the side effect that using this method, and the field layout being what it is (first exponent, then fraction) you can compare normalized floating point values just as integers, using the bit pattern! (not considering the sign bit, of course.)

More precisely, the final number is calculated like this:

value = -1sign bit * 2exponent – 1023 * (1 + fraction / 252)

The above is used when 0 < exponent < style="font-style: italic;">normal number. There are also a few special case values that you need to know about as well:

  • If exponent is 0 and fraction is 0, the value is ±0.0;
  • If exponent is 0 but fraction is nonzero, the value is denormal and equal to ±F/21022+52;
  • If exponent is 2047 and fraction is 0, the value is ±∞;
  • If exponent is 2047 and fraction is nonzero, the value is ±NaN (Not a Number. There are 252-1 of these!)

Single-precision format is similar to the above, except that -127 is added to the exponent, and other changes to accommodate the smaller size.

VN:F [1.9.13_1145]
Rating: 7.0/10 (3 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

Wall-socket PC

A very cool thing I saw on Slashdot. It’s a thin client PC, with the size of a hand. Just look at the picture. I think all the ports and connectors take more room than the chips!

VN:F [1.9.13_1145]
Rating: 7.0/10 (3 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)