Friday, March 31, 2006

Commutativity of [] operator in C

Standard acknowledgement crap: I was enlightened about the following by a book I was reading while very bored. Hehe.

Consider the following program written in C.


/* program 1 */
#include <stdio.h>

int main()
{
   char *s=&"Hello world!!\n"[0];
   printf("%s\n",s);
   return 0;
}



Being so short, it is quite intuitive what this program does. This program will print out "Hello world!!" and a new line.

Now, consider the following program.


/* program 2 */
#include <stdio.h>

int main()
{
   char *s=&0["Hello world!!\n"];
   printf("%s\n",s);
   return 0;
}



Question: Does this program run? Answer: Yes, it does. Not only does Program #2 compile without any errors or warnings under GCC, it runs equivalently to Program #1 above.

Similar examples can be derived easily. To illustrate my point, here's another working program.


/* program 3 */
#include <stdio.h>

int main()
{
   int a[1];
   
   a[0]=5;
   printf("%d\n",*(&0[a]));
   
   return 0;
}



Next question: Does this have any application? Answer: No. It simply looks fun.

Thursday, March 30, 2006

Apple's 30th Birthday



If you are looking at that giant iPod above... and you find it unbelievable, see it here.

Rumours have it that Apple is planning something BIG for their 30th birthday... which includes the world's first advertisement that can be seen from space (that picture above).

Tuesday, March 28, 2006

Microsoft Marketing and Opensource

Robert Scoble points out that there is a problem with Microsoft's branding...

Consider the following...

Google: Google Finance, Google Video, Google Groups, Google Talk, Google Maps

Yahoo: Yahoo! Finance, Yahoo! Mail, Yahoo! Groups, Yahoo! Messenger, Yahoo! Maps

Microsoft: MSN Money, Windows Live Mail, MSN Groups, Windows Live Messenger, MSN Video, Windows Live Local
We need names that are:

1) Consistent.
2) Simple.
3) Easy to tell a friend (Try saying Windows Live Local five times really fast, for instance).
4) One word that’s less than eight characters (Google wins!)
5) A domain that we own. Spend the money if we don’t have it.

As you can tell, I'm still not sure what the difference is meant to be between stuff branded MSN and stuff branded Windows Live besides confusing the heck out of people.



Anyway, Eric Raymond, opensource evangelist, has an interesting viewpoint:

Closed-source software development has a scaling limit, a maximum complexity above which it collapses under its own weight. [...] Microsoft hit this wall six years ago, arguably longer; it’s why they’ve had to cancel several strategic projects in favor of superficial patches on the same old codebase. [...] Apple has been able to ship four new versions in the last five years because its OS core is open-source code. Linux, entirely open-source, has bucketed along even faster. Open source evades the scaling limit by decentralizing development, replacing top-heavy monoliths with loosely-coupled peer networks at both the level of the code itself and the organizations that produce it.

Sunday, March 26, 2006

E=MC^2 Explained

This is my first entry here. So for a start, I shall post up this link which I think is interesting.

E=mc2 explained

How would 10 top physicists—two Nobel Prize winners among them—describe Einstein's equation to curious non-physicists?

The above link shows how the physicists interviewed see E=mc2 as. I can see quite different views from all of them...

Enjoy...

Wednesday, March 22, 2006

Flickr Photo of the Day: Sir Tiny

Sir Tiny, originally uploaded by dooda.

Size is relative. So is perspective.

Thursday, March 16, 2006

Blogger Hack

I was looking around the source code of this blog when I noticed such a line:
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.blogger.com/rsd.g?blogID=11708271" />

So I opened it up and found that the XML data actually contained a link to my website! And then... I decided to randomise some "valid" numbers after "blogID" in the url, and found that I could find links to other blogs under Blogger as well.

Implications:
  1. That line is inserted by Blogger.
  2. That line is very useful. For example, web crawlers (or crawlers building up a blog directory, newspage, etc) can capitalise on this information. By permutating the numbers at the back of "BlogID", it is possible to get hold of millions of valid weblogs URLs. And Blogspot is a really good place to start. With millions of blogs... we have millions of valid URLs to other blogs as well, from a list of blogs.
  3. It means that your blog, even if you don't publicly list it or show it to anyone, can get onto the hands of any web crawler or search engine for that matter.

Eulid Infinitude of Primes

I was browsing through sci.math on Google Groups when I came across the newest post... from Archimedes Plutonium... (yes! THE Archimedes Plutonium [his website])

And the topic of discussion is... proving that there are infinite primes ("Which is more flawed and erroneous, MathWorld's Euclid Infinitude of Primes or Wikipedia's")

Well... some people do have all the time in the whole universe...

Wednesday, March 15, 2006

On the cruelty of really teaching computing science

Read the paper written by Edsger Dijkstra (remember Dijkstra's algorithm) in 1988.
Links: Handwritten manuscript in PDF, HTML, More info from Wikipedia

Note: although the paper is targeting the domain of computer science, it is still very readable. In fact, the paper is largely on education, mathematics and thinking.

Tuesday, March 14, 2006

on10

http://www.on10.net [Microsoft]
The website speaks for itself.

Microsoft update:
Prominent Microsoft blogger Robert Scoble's son has a blog: http://pscoble.wordpress.com
And his son (Patrick Scoble) has an iBook (instead of er... laptop running Windows?)
and Patrick mentions his dad on almost every post!

Monday, March 13, 2006

Troubleshooting IE

Amy: You know the best part of IE?
Corey Donohoe: The x in the upper right corner?
David Favram: Chemical neutering?
Amy: No, we have three different computers running the same version of IE and sometimes all three behave differently. Like, REALLY differently.
David Favram: Yeah. Because parts of IE are written in only electrons. Since it's impossible to know the exact position and velocity of said particle, those parts of the software are somewhat unpredictable.
Amy: "Why does it work on yours and not mine??" "I blame the Heisenberg Uncertainty Principle."
Amy: "IE is both a particle and a wave"
David Favram: It's more like a wave and a plop, if you ask me.

From Slash 7

Google now on Mars


Today, google's logo at the top of the search page looks special again. Click on it to view Mars!



Technorati: Google

Saturday, March 11, 2006

Microsoft Alexandria




A new, mysterious product called Microsoft Alexandria in the pipeline? Anyway, the video advertisement is pretty cool.

Friday, March 10, 2006

Freedom

Recently, I read an essay on the subject "Eternal Vigilance is the Price of Freedom."

So... the writer mentioned such a quote that goes like this, "your freedom ends where my nose begins."

So a Google search... and this website says...
Some people say "your freedom ends where my nose begins" why not say "your honesty begins where my elbow ends" or "My democracy grows where his big toe ends" or "Your happiness starts where his doornob ends."

Typically hilarious.

Back to the issue - freedom. What freedom? How about managing political dissent?

The wind of freedom blows.

Thursday, March 09, 2006

From Haiku to Origami



We now know what this "Origami" hype is about... another technique by Microsoft to create some noise. So Microsoft is trying to market this device called UMPC (Ultra-Mobile PC)

And according on the development blog, Otto, a developer writes:
I can’t believe it’s been four years from the start of this particular journey to this point – it doesn’t seem that long ago that Horace Luke and I were first brainstorming around the potential of a new type of highly mobile PC. Even today we’re just getting started. Then again, it doesn’t seem that long ago that I was stepping through BIOS code either.

So really... its not any "new idea". In fact, someone commented that there is a similar device called DualCor, which closely resembles the whole thing. DualCor is better compared to this Origami thing.
Does the origami have instant on? The DualCor does... By using another Microsoft OS called Windows Mobile. Why isn't Microsoft embracing companies like them?
Does origami have the speed a DualCor does? No .. DualCor is running 1.5GHz Origami 1GHz
Does origami have 5-8 hour battery life? DualCor does...
Does origami have 1 gig of RAM? DualCor does..


Otto, no offense but $500 more than an origami its a no brainer to go with the DualCor.. I can see OQO since its in the 2100 price range but am I nuts?


well... read more on the DualCor website.

Maybe Microsoft simply needs a reality check.


Technorati: Origami, Microsoft

Tuesday, March 07, 2006

Get a Vista or not

Some say Windows ME stands for Major Errors and Windows XP stands for Extra Problems. How about Windows Vista? Apparently, some people thinks it should be called Very Idiotic System To Abuse.

Recently, a certain beta user, recounts a (standard Microsoft) horror story of how his father got locked out of his laptop running Vista
So virtually my dad was completely shut out of his system. Safe Mode didn't work either. So he tried to go back to his previous network, plugged in and all by since the Network Center was configured for that IP address and network settings that caused the problem in the first place, he was stuck.

Of course, fortunately, its Beta. So lots of excuses? In fact, a reader even commented...
"That man is either extremly brave or extremly stupid... or both." ~ quote from hundreds of movies and books

No offense meant to your dad with that quote, it's just that swapping in a beta anything on your main computer is, like the quote says, a bit brave and a bit... foolhardy.

The moral of the story? Don't try anything labelled "Microsoft" and "Beta".


Beta or not... I guess its an inevitable fact that the first few commands a new computer user learn will continue to be the famed ALT-CTRL-DEL. And I have no doubts that we will continue to see messages like the one below, in Vista.



Technorati: Vista, Windows

Sunday, March 05, 2006

Google Analyst Day

Read the 10 MB PDF File from Google on Google Analyst Day. And there is also speculation of a Google GDrive.

Saturday, March 04, 2006

Pirates of Silicon Valley

I have always wanted to watch this -- Pirates of Silicon Valley. Well... here is a short snipet.



Anyway... while looking at the YouTube website, I noticed that some of the videos were linked from ScreenHead.com.

Friday, March 03, 2006

A little Microsoft humor...

Wikipedia - One Million Articles

Yeah! Wikipedia published its one millionth article on 1st March 2006.
A really great effort by the internet community!
And this, I believe is what the Internet stands for - the collective wisdom of Mankind, accessible at the touch on a mouse.