Thursday, February 19, 2009

Whitespace

Whitespace sensitive languages are evil.

Saturday, February 14, 2009

1,234,567,890 seconds since the Epoch ...

At 23:31:30 UTC on February 13th, 2009, it was 1,234,567,890 seconds since the Unix Epoch

In Unix world, the calendar starts on Jan-1,1970 and Unix systems compute time since the epoch.[5]

The system call, 'gettimeofday()'- returns the number of seconds since the Epoch, which is defined as Jan-1,1970.
[http://www.opengroup.org/onlinepubs/000095399/functions/gettimeofday.html]

As was pointed out on Slashdot,([1][4]) if you want to be really precise about it, you would figure out that Unix time does not take into account leap seconds. Therefore Feb-13,2009 @23:31:30 UTC is not exactly 1,234,567,890 seconds from Jan-1, 1970.

To be precise, Feb-13,2009 @23:31:30 UT1 is 1,234,567,890 seconds from Jan-1, 1970 See http://en.wikipedia.org/wiki/Universal_Time for an explanation of what UT1 is and how it differs from UTC.[2]

People across the globe celebrated this time by having party and such. See the coordination link below[3]

Possibly interesting further reading :

[1]http://entertainment.slashdot.org/article.pl?sid=09/02/13/1534240
[2]http://en.wikipedia.org/wiki/Universal_Time
[3]http://www.1234567890day.com/
[4]http://entertainment.slashdot.org/comments.pl?sid=1127059&cid=26851049
[5]http://en.wikipedia.org/wiki/Unix_time

Anyway, Happy 1,234,567,890 seconds since the Epoch!!

Thursday, February 12, 2009

Classic TV Ads

I went Youtube surfing a while ago and found a bunch of old TV ads/spots that used to be played over the air many many years ago. Its been atleast on the order of 8-10 years since I've seen any of these aired. These were classics in their content and evoke memories of days gone by.

Spread The Light of Freedom


This was a television spot that was created by the Lok Seva Sanchar Parishad many years ago. It was a part of 2-3 series that were aimed at spreading the message of National Harmony and Integration. This one is my favorite amogst the lot. It features famous atheletes of the time carrying a flaming torch across the country.
(2:37 in duration, completely instrumental)

Note: Doordarshan is the Indian state run TV broadcaster. The music clip starting at 2:16 to the end is the closing verses of the Indian National Anthem.






Bajaj

A manufacturer of vehicles in India, came out with this ad in 1989. Classic for its content. I seem to remember this playing every weekend morning before some of my favorite cartoons.

(40 seconds long, Hindi words)




Doodh

(Note: Doodh = Milk in Hindi) The ad is promoting milk consumption. -This ad that took me by surprise. Without having seen the ad for atleast 8 years in a stretch, the first time I viewed it on Youtube, I found that I could sing the words of the jingle flawlessly without stumbing or hesitating even a bit for the words.. Talk about information retrieval! I was impressed by my own ability to be able to recall this so well.

(32 seconds long, combination of Hindi and English content)





I'll post more of these if I come across more interesting ones.

Thursday, February 05, 2009

Creating GMail Interface buttons

Gmail recently introduced new buttons' in its interface.



They look pretty nifty and simple, but a lot of work went into them. Google's Visual Lead Douglas Bowman (stopdesign.com) was the leading force behind the creation of this new set of buttons. He wrote a detailed blog entry on the design and describes the work that went into creating the set of buttons that are just right for the job. Read his blog entry by following the link below

Read "Recreating the button" by Douglas Bowman (stopdesign.com)

Tuesday, February 03, 2009

Building SimpleScalar/ARM cross compiler based on gcc-2.95.2

This entry talks about my experience in building the SimpleScalar/ARM cross compiler based on gcc-2.95.2

This was built on Ubuntu 8.10 with gcc-3.4 running on a Virtual Machine - Sun Virtual Box, XP Host, x86 Architecture

(The following instructions are an updated version to the instructions in ANNOUNCE.cross from http://www.eecs.umich.edu/~taustin/code/arm-cross/ANNOUNCE.cross)

--
1. Get all packages from http://www.simplescalar.com/v4test.html
cross compiler kit

http://www.eecs.umich.edu/~taustin/code/arm-cross/ANNOUNCE.cross
http://www.eecs.umich.edu/~taustin/code/arm-cross/gcc-2.95.2.tar.gz
http://www.eecs.umich.edu/~taustin/code/arm-cross/binutils-2.10.tar.gz
http://www.eecs.umich.edu/~taustin/code/arm-cross/glibc-2.1.3.tar.gz

2. Untar and expand all 3 .tar.gz files into a single folder. (/home/example/arm-cross)

3. Make sure you have gcc-3.4 installed on the system. (Ubuntu's GCC 4.3.2 did not compile this package)

4. Build and Install binutils

cd binutils-2.10
../configure --target=arm-linux --prefix=/home/example/arm-cross
make
make install
cd ..

5. You should now have a bin/ folder inside arm-cross/. Add this to your path. (If using bash shell, use the below command, modify to fit your shell)
export PATH=$PATH:/home/example/arm-cross/bin

6. Rehash the filesystem to see the newly created executables.
In Ubuntu 8.10, rehash is /usr/bin/c_rehash - no arguments, just executable

7. Now build the GNU GCC cross compiler (This is what gave me the most trouble- after lots of playing around, the following steps worked) [1]

7.a. inside arm-cross/

cd gcc-2.95.2
../configure --prefix=/home/example/arm-cross --target=arm-linux --with-as=/home/example/arm-cross/bin/arm-linux-as

This should configure without any errors.

7.b. Now, edit the Makefile. Inside the Makefile, find and replace 'rmdir' with 'rm -rf' (without the quotes)

7.c The current version of libgcc (as shipped with Ubuntu 8.10) seems to be incompatible with the build environment of the cross compiler, so we are going to build it with STATIC linkage. [2]

make LANGUAGES=c BOOT_LDFLAGS=-static

This should take a while, but should complete without any errors.

If you encounter any errors in this step, check the above steps carefully. Before reattempting to build, always do a 'make distclean'. This will purge all files that were created during the make process and allow you to start afresh. One of the side effects of make distclean is that it will also remove the Makefile. Hence you will have to begin at the ./configure step again.

If this passes successfully, install the package using the below:

make LANGUAGES=c install

At this point you have the compiler installed and working.

Here's the output of the version string as reported by the cross compiler at this stage:

example@machine:~/$ arm-linux-gcc -v
Reading specs from /home/example/arm-cross/lib/gcc-lib/arm-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release)

8. Now follow the instructions in ANNOUNCE.cross to fix the specs

vim /home/example/arm-cross/lib/gcc-lib/arm-linux/2.95.2/specs

replace all occurrences of "elf32arm" with "armelf_linux",
this fixes an innocuous incompatibility between the most
recent GCC and GLIBC libraries...

9. You now have a working arm-cross compiler that can produce binaries that can be run on SimpleScalar/ARM

arm-linux-gcc example_code.c -o object_file.o

Now run object_file.o using the appropriate simplescalar tool.

-------------------------------------------------------------
[1]
To fix error with xgcc

from http://sourceware.org/ml/crossgcc/2001-02/msg00081.html
use an explicit "--with-as=/path/to/as" on the gcc configure line

[2]
This fixes the set of messages:

ibgcc1.S: Assembler messages:
libgcc1.S:1: Warning: rest of line ignored; first ignored character is `@'
libgcc1.S:2: Warning: rest of line ignored; first ignored character is `@'

from
https://www.linuxquestions.org/questions/linux-general-1/arm-toolchain-problem-350988/

use the BUILD_LDFLAGS=-static

Sunday, February 01, 2009

February

Monthly Overview: (http://shine.yahoo.com/astrology/virgo/monthly-overview/)

As the month gets going, you're going to be tempted on multiple occasions to rush. On the 1st, you don't want to spend the extra minute brushing your teeth. You want to skip the flossing. You want to hit 'send' before you spell check. You want to buy a suit without trying it on. You don't want to leave the chicken in the oven for the whole 45 minutes. The rule for you to keep in mind? Slow down! Rushing will get you nowhere (but you could contract salmonella), so watch out! You'll be in a better place for action-taking and decision-making on the 5th and 6th. Your life is more or less charmed on the 10th and 11th, when everything you touch turns successful. Going with the flow on the 16th is what you want to do, but you could find your canoe is stuck. Disentangle yourself, carefully. You're feeling awfully romantic on the 19th and 20th, so make sure somebody's going out on a date with you one of these two nights! You'll be ready to get things fixed-up
quick on the 25th, but your colleagues aren't on the same page, so watch out. On the 28th, talk shop. You'll enjoy it.

Monthly Career: (http://shine.yahoo.com/astrology/virgo/monthly-career/)

A little soul searching, when it comes to where you're at with your career, would be helpful on the 1st. A lot of soul searching would be really helpful. After all, if you never ask yourself just how you feel about your work, where you're at, how you're doing and where you're headed, how will you be able to do a good job navigating your way there? Go over all those itty-bitty nitpicky details on the 4th. You'll be ready to try being a little bit more flexible on the 8th and 9th, if only because you've run out of other ideas for how to address the problem. You'll see just what an excellent approach this was when everything comes out just right on the 11th. Your curiosity could propel you into a very romantic place on the 14th. Who knew that that cutie at the office was so very interested? If you're taken, let them down easy. Hard work pays off, just the way it's supposed to on the 19th and 20th. A couple of super confusing details threaten to derail you
on the 25th. Research on the 28th will get it all under control.
--
Monthly Relationships (http://shine.yahoo.com/astrology/virgo/monthly-love/)

Sure, it's romantic to do things for the object of your affections. But giving too much of yourself too much of the time isn't romantic at all. On the 1st, it's time for you to step back and recharge. Spend all your energy doing nice things for yourself, and you'll find that, in the long run, you have a lot more energy for romance. After all, you can't take care of other people if you're all tapped out yourself. You should keep this in mind: Your job is to love you. From there, you can love others. Put romance on the back burner again on the 5th, when your best bet is to organize friends or family in some kind of activity. On the 10th, you're finally in tiptop form and ready to welcome romance with open arms. Guess what? Romance embraces you right back! Excellent! Now hold hands! If you're curious and you want to get to know them better, be sure to schedule something special on the 14th. You two are getting along like gangbusters on the 19th. You're
ready to take things to the next level on the 24th, but don't criticize them if they lag. On the 28th, you're compatible.
--

January Review

Lets just say that less said the better.
January's so called accurate predictions didn't come true. Nothing happened on any of the many specific dates in january - though if you look at the financial aspects of it, they may have slipped by about a week.

Oh well, lets see if February works out any better shall we?