Alagu's Personal Weblog
 

1 Y!ear

I complete one year at work today! Let me jot it in teemus’s style

learnt a lot . met rasmus. great friends as teammates. shout. cubicle cricket. foosball. cycling 2 office. football. php. pecl. pool. trekking. inox movies. snacks (order). jump. hide & seek. brigade road shopping during office hours. mash. night outs. brindavan hotel. DC vs RCB IPL T20 with team. yblr. emiblr. hackdays. ubuntu. vim. self-cooking. ycore movies, t20. openhackday. unsolicited deal proposal fossconf. #linux-india. vegpuff. missed foss.in. barcamp. bcb. brtff . ymi. tintin. twitter. mokkai. june25.

I am lucky :)

Comments (1)

Know your Opcodes

Gopal says,

PHP programmers don’t really understand PHP.

They know how to use PHP - but they hardly know how it works,
mainly because it Just Works most of the time.

Very true. A level of abstraction is important for the programmer to concentrate on the logic, than handling cases for memory leaks and socket connections. With that said, it is equally important to know what is being done to the code to give the output.

PHP Code is compiled to Opcodes (like instruction codes) and instruction stack is processed. To see your opcodes, you need pecl/vld. Download it, compile it. For compiling, you might need the php-dev package. In ubuntu, php5-dev is the package name. To install :
$ phpize; ./configure; make; sudo make install
It puts the ‘vld.so’ shared object in your php-lib folder. Check whether vld is installed:
$ php -d extension=vld.so -m
Above command should list all the loaded modules, alongwith vld. Now, try it out :

$ cat test.php
<?
define('MY_BLA',42);
echo MY_BLA;
?>
$ php -d extension=vld.so -d vld.active=1  test.php
Branch analysis from position: 0
Return found
filename:       /tmp/test.php
function name:  (null)
number of ops:  7
compiled vars:  none
line     #  op                           fetch          ext  return  operands
——————————————————————————-
   2     0  SEND_VAL                                                 ‘MY_BLA’
         1  SEND_VAL                                                 42
         2  DO_FCALL                                      2          ‘define’
   3     3  FETCH_CONSTANT                                   ~1      ‘MY_BLA’
         4  ECHO                                                     ~1
   5     5  RETURN                                                   1
         6* ZEND_HANDLE_EXCEPTION

That gives a lot of opcodes! (Remember 8085?) All these opcodes are C macros .

For now, have a look at opcodes for your code and see how you can optimize your it until I come back with the next.

Comments (1)

Spoil your kids, please

Your children are not your children.
They are the sons and daughters of life’s longing for itself;
They come through you but not from you.
You may give them your love but not your thoughts,
For, they have their own thoughts.
You may house their bodies but not their souls,
For their souls lie in the house of tomorrow,
Which you cannot visit,
Not even in your dreams!

If you reached here after reading the quote, I appreciate your patience :)

I read the above lines in Hindu’s Open page. For a moment, it stuck like a lightning. Kahlil Gibran has given straight forward opinion for the parents and students who are victims of the current educational system (Including me).

Taare Zameen Par expressed how parents attribute everything with success. Things are forced upon them or rather they are made to think that what their parents think is the best choice, forcing the kid do what the parent failed to do as a kid, forcing them to walk exactly on their footpath and a lot more.

Being first in rat race may be appreciated by other rats, but what matters is how the person relates the success .

Being able to do is different from wanting to do. Do what you want to do, and show middle finger for the rest.

Comments (8)

The tag game

I’ve been tagged before, but too lazy to respond.Srikanth tagged me this time, and the questions were quite interesting. So here goes,

Last movie seen in a theatre:
Kuruvi (Suckiest movie, evar)

What book are you reading?
No, I am not reading anything

Favourite board game:
Ludo

Favourite magazine:
Vikatan (Tamil)

Favourite smells:
The smell of rain, Buttermilk

Favourite sound:
Airplane take off

Worst feeling in the world:
Being lonely

What is the first thing you think of when you wake up?
Snooze the alarm

Favourite fast food place:
Our college gate - Suppannan kadai

Future child’s name:
Blah

Finish this statement, “If I had a lot of money I’d…”
think what to do.

Do you drive fast?
Yes,yes!

Do you sleep with a stuffed animal?
No.

Storms - Cool or Scary?
Cool

Do you eat the stems on broccoli?
Yes

If you could dye your hair any colour, what would be your choice?
Multicoloured (Orange,Yellow,Green - all fluorescent)

Name all the different cities/towns you have lived in:
Mandapam,Calicut,Cochin,Bhubaneshwar,Valsad,Thanjavur,Erode,Trichy,Cochin(again),Bangalore, Sirkali (next)

Favourite sports to watch:
Tennis.

One nice thing about the person who sent this to you:
Techie.

What’s under your bed?
Floor

Would you like to be born as yourself again?
Yes

Morning person or night owl?
Night owl, but a wanna-be Morning person

Over easy or sunny side up?
Not both. Kalaki

Favourite place to relax:
Terrace.

Favourite ice cream flavour:
Chocolate

You pass this tag to –
If they read my blog - Vignesh, Karthi, Manas. (Please tag yourself, if you want)

Of all the people you tagged this to, who’s most likely to respond first?
I think all are lazy like me. Very tough question.

Comments

Cricket Score in your IM Status

I’ve been using this since IPL started - setting my IM status as the current Score.

Some even pinged and asked me, “Why are you wasting time updating ball by ball scores?” - answer is here.

It is a modification of the existing DBus example in pidgin. It is a cheap hack, urllib2 - readline - set status. So, you have edit i, change cricinfo url to current match,pick the line number and set your status. Though dirty, it works.

Can you do this in Google Talk? ;)

Comments

« Previous entries
I work at Yahoo! - the opinions expressed here are my own, and neither Yahoo! nor any other party necessarily agrees with them.