Universal hacker emblem
Conway's game of Life is used as an icon for hackers
Conway's game of Life is used as an icon for hackers
W00t! It's a Programmer's day today. I wish all the programmer's worldwide. The day is unofficially celebrated on the 256th (reason: 256 = 2 to the power of 8 = the number of values representable in a byte of data) day of the Gregorian calender year. Therefore, it usually falls on September 13, and on a leap year it is on September 12.
GREP:: Prints line matching a pattern. While digging out for pattern matching stuffs, i came across a brilliant search utility that works fine on Gnu/Linux. Actually all my mobile numbers were scattered in different files and each file containing huge amount of text including mobile numbers!! And i only wanted those numbers.<br />
atif@ct:~$ grep [0-9] home/atif/foo home/atif/bar
home/atif/foo:+91 9930001234
home/atif/foo:+91 9833730782
home/atif/foo:+91 9890422344
home/atif/bar:+91 9878565545
home/atif/bar:+91 9890786567
When i was in college, i had a topic Regular Expression under the subject Formal system automata! At that time i was so confused with "What exactly this pattern matching is" never understood the concept just mugged up and passed!! After getting into the real world and for writing real application i have been forced to get back to REGEXP again!! Now, after writing few stuffs, i understood the basic concepts!! How powerful this pattern matching thing is!! I am giving an small example "To replace all hyphens with underscores". I have used CL-PPCRE library for this.
cl-user> (cl-ppcre:regex-replace-all "-" "foo-bar-bazz" "_") => "foo_bar_bazz"
w00t! this is really exciting!! one can do wonders by using regexp to get rid of major problems such as one of the problem we face is To split date "14/08/2008" as ("14" "08" "2008").
cl-user> (cl-ppcre:split "/" "14/08/2008") => ("28" "09" "2008")
These are few examples of REGEXP. I will add more of it soon :-)