Archive for January, 2008

Modern Pricing of Interest-Rate Derivatives

Thursday, January 17th, 2008

Modern Pricing of Interest-Rate Derivatives

was troublshooting a piece of code today. found out within a covariance matrix they uses matrix eigen.

http://books.google.com/books?id=Zs4lmuf5MmwC&pg=PA394&lpg=PA394&dq=rebonato+covariance+matrix&source=web&ots=GE5M86-0hB&sig=ypM3R3dhysfwCYV6wYoq4yaF2TM
citeseer.ist.psu.edu/rebonato99most.html

Wake up Malaysia

Wednesday, January 16th, 2008

Keep fighting internally, Malaysian don’t even care about their Country just like me. Yea baby Scandal , Corruption, mis-use of Power , pollution etc …. On word to all bullshit Malaysia govt  stop all this  bullshit try to FIX it else face the consequences of the globalization.

I might not be the right person to say all this but I find that is kinda sad to see my own country going down to the drain like that. Look at Singapore and Vietnam ! Why people rather work in Singapore ? Tell me why man ? To be frank most of the talented people are being taken by Singapore OMFG please Malaysia differentiate between religion and people that can establish global link plus investment ! Stop all this nonsense Lingam , Corruption and cronies.

Let me name you companies that have F*cking lotsa of Malaysian in there !

Sembcorp , singtel , SIA , IBM , NCS , SCS , Banks ! financal organization like CPF which is equivalent to the Malaysia EPF flooed with Malaysian.

One country can’t stand for itself you need connection you need investment  You need vision. You need to embrace procedure that benefit the nation. You need to do it the right way.

GOD BLESS MALAYSIA !

Yea Dr M write whatever you want , condemn Badawi for the past years you have built weaklings in your cabinet. Sack Anwar Ibrahim dictate your own business . Establish your own bread business with your Japanese friend . Tell us did you ever FIX the issue we have in our country ? Did you ever care about all the nation ? Why you always think people come into your country would like to take away your land ? Please look at the F*ucking land we have what sorta of living standard we are at now ? People ask where is this Malaysia jungle ? People ask why your immigration officer wear such badges to remind them Say NO to corruption? Transportation going into the drain what hell did our transportation minister do ? build the largest airport ? for F*uck sake please care about those poor people build GOOD publis transport for them taxi with fare meter , train that goes to the most jam area have quota on vehicle per household.

What happen to the public library ? Send monkey to the space? Spent money on military weapon ? We are moderate islamic country we are commonwealth members we are ASEAN country why we need submarine and fighter planes ? C’mon strengthen your education infrastructure then only you talk about Military infrastructure.

I just hate freaking embarrassment news pop up on BBC, channelnewsasia and etc.

Sex scandal , tourism scandal what else ? C’mon bring it on people I know they choose to stay in Australia and other countries. For f*ck sake STOP all this nonsense

Say hi to SkypeJukeBot

Tuesday, January 1st, 2008

Howdy,

I wrote an amateur python code allow changing and playing music tracks on ubuntu 7.10+ skype4py + skype.  Wow I went to bed took a noon nap and woke up solve the overlapping music track issue. Some unix trick will do it. KILL the process before starting a new track. I just learned python the day before christmas this just a warm up session for my google android project. The real thing that I am going to develop will be starting from today.

Let me walk you through how this program can change music track on your linux system.

1) User A call the bot user.
2) User A invite User B to conference with the bot user.
3) Make sure the bot user’s linux machine has a loopback cable from mic to speaker.
4) On the ubuntu/linux machine install all the relevant stuff to get skype4python to work. DBus, Skype 1.4, Skype4py and etc.
5) Run the python SkypeJukeBot.py the code below.
6) From the party chat dialog window type "Play Track1" or "Play Track2" without the quote and is case sensitive.


import Skype4Py
import time
import os
import datetime

# function on message status
def on_message_status(message, status):
    print status   
    if status == Skype4Py.cmsReceived:
        print message.Body

skype = Skype4Py.Skype()
print "Begin Listening to Skype message"   
now = datetime.datetime.now()
messageReceivedtimeStamp = now
#print " Listener started : "messageReceivedtimeStamp
d = {}
print d
startupFlag =0
while(True):
    if startupFlag == 0:   
        for chat in skype.Chats:
            for message in chat.Messages:
                if message.Id not in d:            
                    d[message.Id] = message.Id
                else:
                    startupFlag =1
                    break
   
    for chat in skype.Chats:
        for message in chat.Messages:
            if message.Id not in d:            
                print message.Id               
                d[message.Id] = message.Id
                print "Skype Message from : " + message.FromHandle
                if message.Body == "Play Track1":
                    print "Music track changed by: " + message.FromHandle
                    print "Playing track 1 music"
                    msg= "Music track changed and playing track 1 "                   
                    for member in message.Chat.MemberObjects:
                                if member.Handle == skype.CurrentUserHandle:
                                    continue # don’t sent to myself
                            skype.SendMessage(member.Handle, msg)
                    os.system(’ps aux|gawk \’$11 == "mplayer" {print $2}\’ > pid.log’)
                    f = open(’pid.log’, ‘r+’)
                    pid = f.read()
                    print pid                   
                    if(pid != ""):                   
                        os.system(’kill -9 ‘ + pid)
                    os.system(’mplayer /home/kenneth/Music/Track1.m4a &’)
                   
                   
                if message.Body == "Play Track2":
                    print "Music track changed by: " + message.FromHandle
                    print "Playing track 2 music"
                    msg= "Music track changed and playing track 2 "                   
                    for member in message.Chat.MemberObjects:
                                if member.Handle == skype.CurrentUserHandle:
                                    continue # don’t sent to myself
                            skype.SendMessage(member.Handle, msg)
                   
                    os.system(’ ps aux|gawk \’$11 == "mplayer" {print $2}\’ > pid.log’)
                    f = open(’pid.log’, ‘r+’)
                    pid = f.read()
                    print pid                   
                    if(pid != ""):                   
                        os.system(’kill -9 ‘ + pid)
                    os.system(’mplayer /home/kenneth/Music/Track2.m4a’)
                   
skype.Attach()