Monday, August 31, 2009

TAXICAB IN PYTHONLAND

THE TAXICAB NUMBER Ta(2) TYPES

The Taxicab Numbers Ta(2) types are expressed as,



The name is attributed to a historical discussion between Ramanujan and G.H Hardy.

"I remember once going to see him when he was lying ill at Putney. I had ridden in taxi-cab No. 1729, and remarked that the number seemed to be rather a dull one, and that I hoped it was not an unfavourable omen. "No", he replied, "it is a very interesting number; it is the smallest number expressible as the sum of two [positive] cubes in two different ways."
--G.H Hardy

1729 is the smallest Taxicab Ta(2) number and can be expresses as cubes of 2 different sets of numbers (12, 1) and (10, 9).

A Python program for generating such numbers placing range conditions on a,b,c, and d yielded


as the highest Taxicab Number for a,b,c,d in the range of 1 to 100 and



for a range from 1 to 1000.


The crux of the Python program is obviously summed up as;


REFERENCES
(1) Taxicab Numbers
(2) Source code

Sunday, August 30, 2009

A COMMON ERROR IN PYTHON !

= AND ==

A common error in Python is a mix-up of == and = , this example illustrates this

Fig 1. The mix up !

Fig 2. The solution


Fig 3. Moral of the story





REFERENCE
(1) Allen Downey, ' Think Python'

Monday, August 24, 2009

HELLO HASKELL !

HELLO WORLD

Seems I am into some 'Hello World' frenzy !. The Haskell 'Hello World' is similar to that of Python .

Fig 1. Hello Haskell








REFERENCES

(1) Haskell in 5 easy steps

Sunday, August 23, 2009

HELLO ANDROID !

ANDROID

Android is a Google platform for mobile devices. IDE Eclipse allows for the Android plug in and the programming is in Java.

Fig 1. Android Logo

The 'Hello World' program was indeed some struggle, not because of the code but rather since one has to wait for about a minute as the emulator executes the program.

Fig 2. Hello Android

Fig 3. Hello Android code

Fig 4. 'Home' in the emulator

Fig 5. 'Hello Android' in the menu

Fig 6. The blog spot




Monday, August 17, 2009

2+2 = 4199232

2+2 = 4199232

If only C++ was not so notorious !

Fig 1. 2+2 = 4199232

Trying out this simple program in Quincy gives a weird output !

What is happening is that, The printf statement: printf("The answer is %d\n"); tells the program to print an integer, but fails to supply one. The printf function doesn't know this, so it will take the next number off the stack (some random number) and print it.

The correct code should be: printf("The answer is %d\n", answer);


Fig 2. Corrected Program, 2+2 = 4

Running the program in Unix (Ubuntu) gave another result ! 2+2 = 134518880

Fig 3. 2+2 = 134518880






REFERENCES

(1) Oualinne, Steve "How not to Program in C++", No Starch Press 2003
(2) Quincy

Thursday, August 13, 2009

MY PROJECT LOGO

MY PROJECT LOGO !

Now ! ..... to stamp my mark on my projects, I had to think of something ! ...

This logo has a 60s looks to it !...
but looks snazzy ! .... this logo can be seen on top left of all my google-codes pages !

Fig 1. My Personalised logo


Thursday, August 6, 2009

HOW DID I GET A SOFTPEDIA PAGE ???

I JUST DO NOT KNOW !

I had uploaded my recent game PIRATE SLOT MACHINE 1.1 on google codes with links on Pygame page ! ...... and voila I now have a softpedia advertisement ! ..... seems open source goes places .... all across the web!

Pic1. How did it happen ??

Fig2. It keeps getting weirder !

REFERENCE
(1) Softpedia page 1 !
(2) Softpedia page 2 !