1. ?: => To not to capture the text matched within the parenthesis.
2. /i => Case insensitive
3. perl -p -i -e 'some command' file => -e program is in command line -p substition to be done for every line in the file -i changes to be written back to the file when done
4. $line =~ s/^/|> /; => Make every line start with |>
5. ?=\d => Positive lookahead, check if next char is \d without moving cursor
6. ?<=\d => Positive lookbehind
7. ?! => Negative lookahead, check if next char does not match
8. ? Negative lookbehind
9. e.g. s/(?<=ABC)(?=EFG)/D/g => inserts D
10. /x => Free format regex, turns whitespace into ignore me and # into comment. Really helpful for writing complex regexes spanning multiple lines.
January 19, 2008
January 18, 2008
No country for old men
The movie kicked off reminding me of legendary 'The Good the Bad and the Ugly'. I thought if it were a western classic kind of a movie. As it proceeded, it sprang up many surprises and kept me at the edge of my seat(err.. bed). It made me label it as a thriller. And then finally when it ended, I was like what, when, how, why ?? I failed to fathom it, nevertheless people say it is a brilliant movie so may be.
January 16, 2008
Some 2007 movies to watch
Into the Wild
The Kite Runner
Michael Clayton
No Country for Old Men
Scaphandre et le papillon, Le
Sweeney Todd: The Demon Barber of Fleet Street
There Will Be Blood
The Great Debators
Eastern Promises
The Kite Runner
Michael Clayton
No Country for Old Men
Scaphandre et le papillon, Le
Sweeney Todd: The Demon Barber of Fleet Street
There Will Be Blood
The Great Debators
Eastern Promises
The Atonement
'The Atonement' (ref: http://imdb.com/title/tt0783233/) won the golden globe award for the best movie of the year. I saw it yesterday and knew exactly why. Although I havent seen the other movies competing with it, this one for sure is beautifully made. The movie revolves around the lives of Brioney, her elder sister and the sister's lover and deftly moves back and forward in time. The vivid colors and the lush green gardens in the first half provide an absolute contrast to the sombre war frames in the second half. I liked the way the movie (and yes the novel) did not deviate from its original theme and not try to go too deep in the war. The romance, the pain, the hopelessness and the atonement are so real that you can feel it. Full marks to the director and my two cents on it for the Oscar.
January 13, 2008
January 11, 2008
My foosball champ!
Shady boy won the yahoo wide foosball tournament! The excitement, tension, competition made it a mini t-20 tournament for me. And the final match drew parallels from the India-Pak draw match . With both team having won two sets each and equally poised at the decider with 4 points each, Shady's match winning goal from the defender's end came like a sixer. Also worth mentioning is Suhas's (Shady's parter) incredulous accuracy and speed with the ball from the attacker's end.
Way to go my gaming gizmo!
Way to go my gaming gizmo!
December 24, 2007
Taara zameen par
November 22, 2007
October 24, 2007
October 19, 2007
OOPs
Inheritance Vs. Composition vs Parameterized Types:
Inheritance - white-box-reuse. Internals of parent class visible.
Inheritance defined at compile time. Possible to modify implementation. (overriding)
Disadv - Parent class influence the physical representation.
Composition - black box reuse. No internal details visible.
Composition - defined at run time. Wont break encapsulation. Class hierarchies will remain small.
General rule of thumb - Prefer Composition over Inheritance.
Parmeterized Types - Generics , Templates
Inheritance - white-box-reuse. Internals of parent class visible.
Inheritance defined at compile time. Possible to modify implementation. (overriding)
Disadv - Parent class influence the physical representation.
Composition - black box reuse. No internal details visible.
Composition - defined at run time. Wont break encapsulation. Class hierarchies will remain small.
General rule of thumb - Prefer Composition over Inheritance.
Parmeterized Types - Generics , Templates
Subscribe to:
Posts (Atom)

