4/13/11

Think before you do.

Got registered a new domain name but donno how to use it!
Just a waste of money!

3/30/11

New Year

New Perisan Year.
New Hopes.
New Goals.
;)

11/21/10

work!

tired!
today was the first day @ work :D

9/8/10

No, no no! it's not possible!

-Really? I mean, your intention…

-About?

-Regularly updating your blo..

-Humm…, that stuff! I don’t know!

5/22/10

Facebook

Right now, I updated my status on Facebook and changed it to "''s closing his facebook account on sunday, 11.59 pm" .
Why? Because I think facebook's being very time-consuming and I spend more than 1 hour a day on it. Another thing about facebook is privacy! Facebook is disclosing my private life and I don't like it. So, I closed it!
P.S: It has nothing to do with depression or something like that! I'm alright and am living a joyful life!

Home, Sweet home!

Yes, you have not blogged here since a couple of months ago!
You tend to write on several blogs.
But you are not satisfied.
This is your home, danrah.com  …. Sweet home!
O danrah.com ! you’ll be rejuvenated!!!! Daniel is coming! A non-technical Daniel! An un-programmer Daniel!
Hello sweetie!

11/6/09

Really Quick python tutorial (Part I: Intro)

I want to start posting a series of notes about python that can be used by programmers. But note that i have not tried to use the correct syntax.

  •  Integer division returns the floor.  7/3=2   7/-3=-3
  • Complex numbers are supported but "i" turns into "j" or "J". another alternative is: complex(real,imaginary) function.  z.real and z.imag are used for accessing real and imaginary parts. conversion functions such as float() int() and long() don't work for complex numbers.  to get the magnitude of a complex number:abs(z)
  • in interactive mode, the last printed expression is assigned to the variable _. this variable should be treated as read-only by the user. if you assign a value to it explicitly, you would create an independent local variable with the same name masking the built in variable with its magic behaviour.
  • and equivalent to heredoc in php is using a pair of matching triple quotes: """ or '''.
  • string concatenation: +   repeat:*  word="hi"   '<'+word*5 + '>'
  • automatic concatenation: 'hi' 'hello'   = 'hihello'  (can only be used for two string literals
  • string indexing:  word="helpA"  word[4]=A   word[0:2]=He word[2:4]=lp
  • python strings can not be changed by indexing. but:   'x'+word[1:]=xelpA
  • And omitted first index defaults to zero. and omitted second string defaults to size of the string being sliced.
  • s=s[:i]+s[i:]
  • an index that is too large is replaced by the string size.
  • and upper bound smaller that the lower bound returns an empty string.
  • indices may be negative numbers , to start counting from the  right.
  • Out-of-range negative slice indices are truncated. word[-100:]=helpA
  • The indices are pointing between characters. 
  • length of string: len(s)
  • List items need not all have the same type.  a=['spam','eggs',100,1234]   3*a[:3]+['Boe!'] -> ['spam', 'eggs', 100, 'spam', 'eggs', 100, 'spam', 'eggs', 100, 'Boe!']
  • len(a) to get the length of a list.
  • using nested lists are also possible
Finbonacci series in python(note the multiple assignment):

a,b=0,1
while b<10:
  print b
  a,b=b,a+b