Sunday, September 1, 2013

Preview - The Nature of Code

Normally books  attempting to teach numerical / scientific programming are rather hard to read  . One needs to be proficient not just in programming but also atleast good enough to follow the often heavy math /science involved . It takes hours to even go through the first few pages in Numerical recipes in C before one can start understanding it . However the book isnt to blame . It wasnt ever meant to be like Learn Java in 24hrs .

Enter the Nature of Code
This book is a rather different take on programming for the real world. It attempts to teach you the basics of physics , geometry and some computer science and does it in a simple way. I have barely scratched its surface and yet I am beginning to like it . The book is free to read online and has a pay what you like policy to buy the pdf. I cheaped out and got it for free to see just how good it is . It is really beginner friendly and not like hardcore programming textbooks . The book uses processing.js for code ( which is just javascript code) . So if you are new to programming and would love to do some physics programming , here is the best book to get you started

Saturday, August 24, 2013

Congress bids to tap into INTERNET generation , declares Orkut as Other Backward Caste.


The congress government in a bid to change its sagging image over YoPappusoDumb tweets has decided to play the divide and conquer card by declaring Orkut users as a Other Backward Community and therefore eligible to avail the plethora of schemes under the UPA government.
The moves comes after the UPA's efforts to effectively mobilise social media and support of internet savvy youngsters blew up like North Korea's nuclear missile . Citing increased abuse of the minority community on facebook and twitter , the Congress government's megaphone Diggy Singh gave the following report to our reporter “ We have watched the pathetic state of Orkut since 2009 when it was eclipsed by other social media networking sites . They have not only stolen away the intelligent users from Orkut , they also mock members of Orkut publicly and subject them to great humiliation . There is even a profile called Wall of Shame in facebook where orkut user's email id and phone numbers are posted so that members can make fun of Orkut users in other online communities . In fact one of our very own party officials have been subject to tremendous humiliation when the BJP and other parties knew that he had an Orkut account. “ When asked by our reporter to identify the official involved in the harassment case , Diggy declined citing privacy concerns . He however added that the person is now recuperating after such a vicious attack online in Italy . Ending the conversation with a firm note , he said “ As a secular state , we just cannot tolerate this kind of rampant communalism as practised by Modiji who sends updates only via his tweets . Every ,community needs to be addressed equally .”
The government has also said that it will direct BSNL to provide 27% reservation in internet bandwidth to certified Orkut users . The opposition condemned the move so strongly that online communities froze for over a minute before coming out of shock and resuming normal activities . A probe has been demanded to be taken up by the Election Commission for what many describe as a bribe to convert users into Orkut . BJP leaders meanwhile have added that “along with a ban on religious conversions , a ban on online community conversion will also be put into law once it comes into power”

Critics on facebook and twitter accused the congress of playing the minority card to manipulate vote banks during the next general elections . “Honestly who the bloody hell gives a scrap about these Orkut users “ posted a fb-ian on his wall , which was then liked and shared by fellow fb-ians .Facebook users destroyed effigies of Orkut pages on facebook and assaulted orkut supporters by spamming their walls with viagra and poonam pandey pictures . #BoycottOrkutAndolan became the trending hashtag on twitter . 

“  If bearing with people who had Shahid Kapoor themes for their profiles wasnt enough , I now have to hand over 27% of my bandwidth to these bollywood listening idiots “ laments Aditya Rockdick , a rocker from New Delhi both an active facebookie and twitterati .

Google meanwhile welcomes the move. “Honestly , we were in a conundrum as neither Orkut nor Google+ did as well as we expected . “ quotes Sergey Brin. “ The OBC status should bring a lot of relief and comfort to Orkut users who have been ignored by the rest of the world and have become unfriendables on other networks . No one should have to ever go through the experience of opening their accounts after 3 weeks and find just underwear ads and no updates from friends . Its too inhumane of us to even think of subjecting a person to such torture . “


Sergey Brin also added that he would like to see Google+ users given a scheduled tribe status in India. “you know its a wilderness out there in the world of google+. One rarely gets to see another active user . Google+ is a jungle with neither stalkers nor girls “

Wednesday, August 21, 2013

Man dead, killed by falling Rupee

The Indian rupee's fall has never had fatal consequences  , until now . Mr.Bechara ,a labourer was walking on Rajiv Gandhi Marg when the rupee that has been falling for the past few days fell on his head , fatally injuring him . He was rushed to the nearest Rajiv Gandhi hospital, where he was pronounced dead on arrival . The incident shocked citizens across the country  as nobody till now has ever been affected directly by the falling rupee. "I was only worried about the rising price of Onion so far . Never has the fall of the rupee ever worried me . But now times have changed " laments Mr.Khan who is not a terrorist but a citizen of this country . 
The government has express its condolence over the death of Bechara and has provided a compensation of 1.25 lakhs to his family .

Monday, August 19, 2013

man tweets happy independence day against wishes

Owing to overwhelming  pressure of patriotic tweets ,shares and likes sweeping the country a man today was forced to tweet "Happy Independence day" tweets and reply to incoming wishes on his facebook wall. 
Mr. Jai Hind Singh , a programmer in Bangalore , who thought he would be independent of his American master for one day and sit and enjoy a day not staring at a monitor for 20 hrs , was perturbed  when his cellphone started beeping and spitting out independence day tweets and shares . Not wanting to be seen as a terrorist by the NSA and UPA monitoring his tweets, Mr. Singh quickly tweeted an independence day tweet and due to this simple mistake was forced to respond to each and every mention with the #indyday tag from his social circle. Infact the only thing Mr.Singh was able to do on independence day was to go to the toilet without having  to told to do so . Mr.Singh's friend Vijaykanth says " I waz enraged when I bound dad Singh did nod dweed Aapy independence dai. I dot dad he waz bakistaaan deeviravadhi and celebraded Independence Dai yesderdai . Only aafder his dweed did I conclude dad he is Gundian ".                        

Thursday, August 15, 2013

Indian Railways plans to replace IRCTC web portal with Telegraph


In a stunning move to improve the speed of booking tickets online , after complaints that spanned the breadth and width of India , Indian Railways has decided to replace its online portal with the just retired  Telegraph service . An highly placed railways official said " Indian Railways always believes that old is gold and what truly is classic will never die. We even keep the seats dirty and use coaches dating back to the Raj in our trains  to give passengers a nostalgic journey. Infact , we are even thinking of replacing the diesel engines with coal powered ones owing to the high fuel prices . Our decision to replace the online portal was not easy . However our internal performance reports show that booking
tickets via telegrams is faster than using our online portal . The railways minister Malliarjun Kharge was so impressed that he immediately fired all the IT staff at IRCTC and then bought out all now useless telegraph equipment from the BSNL exchange nearby and their engineers and operators ."  
The official also stressed on the fact that this system of booking tickets is unique and exists nowhere else in the world . He also points out that the system is unhackable  " Who the bloody hell knows morse code these days . The only thing people know today is C and Java code . " Meanwhile anticipating a huge demand for telegraph thanks to the move by IRCTC ,  NIIT has started offering Morse Code programming classes with guaranteed placements in IRCTC after completion of the course . 





-this is the beginning of my tidbit fake news column where i treat you to a small tasty snack once in every few days

Monday, July 29, 2013

The importance of habit and mathematics for programmers

I  think I am in the right position to write an article on the importance of mathematics in my career. No this isnt a rehash of Steve Yegge's Math for programmers article. The outline is similar but this is based on my own experience.
I was lazy when it was the right time for me to study. I wasted my high school days ,playing games on my computer , reading Sci-Fi novels and bumming time with my friends on the road , hanging out like there is no tomorrow. We hung out till late night ,returning home often late.  I rarely gave a shit about my studies , by the middle of my final year at high school , I guess I should have realized that there is no way I'd make decent marks in the exam . Yet I was over confident , thinking that I still could burn the midnight oil and study in time for my final exam. I had this distorted view of the world where I believed that I was only a few hours away from learning everything .
All these dreams shattered on the day of the result . Confident of a rather decent marks in math , I was shattered when I saw my math results. low 70s . Not bad , but bad enough in today's world to ensure that I get stuck in a dump for the next 4 years wearing formal dresses  and being trained to be a corporate slave. I wanted out . Thankfully I got a second chance . A decent course at a rather good college. Some freedom . Yet I bummed most of my next 3 years too out of sheer habit.

I then realized at the end of the 3rd year that the reason I was failing to learn math was not because I was bad at math. It was because of the fact that I learnt to make it a habit to learn math the way its meant to be learnt . Unlike 10th grade CBSE where I learnt most of my subjects by reading the book like a novel in less than 30 mins , there is no way you could learn calculus or matrices just by skimming problems , theorems and solution. You have to work them out , find answers , break your head over incomprehensible solutions and hints . Its a mental exercise . I spent all my time in high school learning matrices without knowing what is a singular matrix. I just learnt it a few days ago. For a guy that dreams of being a Computational Scientist this is like shooting an elephant with a revolver . You are just going to get trampled. I spent a lot of time , reading problems , reading solutions , but NEVER spent time solving them .
I cant stress on the importance of maths in a programmer's toolbox enough. Imagine trying to build a bicycle without a spanner. Can it be done ? Even if thats possible , what do you lose in terms of time and energy  ? Math is the language of science. With a knowledge of mathematics you don't just learn about numbers. You learn how to use it to solve problems AND analyze your solutions. You have a powerful toolkit in your hand with which you can build efficient solutions . Some of you must have heard of NP-complete problems. Basically its a problem where the solution takes tonnes of time and for a problem of sufficiently big size it will take a time beyond that of humanity's lifetime . However instead of being defeated at the prospect of such daunting problems , mathematics gives programmers tools to solve a few problems in a (slightly) shorter period of time. There are ways to defeat problems in specific contexts even though you cant find a general solution for the set of such problems .
From measuring running times , to formulating proofs for the correctness of your solution to a problem , math is really really important to a programmer's toolbox.
Some of you might say , "but I don't work with mathematics . I work on projects that arent really mathy or too involved in computer science . I design websites and create software for online applications "
Granted , such projects are not too involved in math. But the very fundamentals of your software lies in mathematics. Why is a linked list slower than a hash table ? Why is merge sort preferred over quicksort or bubble sort ? Such questions are answers based on math. You are indirectly using the product of mathematics in your software. If it weren't for such tools we'd all be stuck in the stone age of computers , trying to make faster and bigger computers never realizing that math can help solve some problems faster by giving you a set of more appropriate tools. In fact to every programmer I'd suggest learning math purely for the profound enlightenment it gives when you can understand something that you take for granted .
And habit ? where does that figure in ? Well , its important to cultivate a habit for solving problems and trying to formulate your solutions before attempting to search for one . I cant stress on this enough . Granted solutions to problems are available all over. But the reason people learn maths is to enjoy the journey and not the destination. By solving you problems you train yourself to identify solutions and generate a heuristic for solving problems in the future . You discover patterns in problems and methods that are quite an experience by themselves . A habit of solving problems makes it easier to solve the N+1 th problem after solving N problems . You dont have to really push yourself to solve it . Your brain does it by itself. You learn the intricacies of a method and can find shortcuts and many other alternatives . It feels more like a walk in the park  on a cool breezy evening , rather than a sprint across hot concrete .
So if you are a programmer and you have problems like me learning mathematics , remember that it is never too late to learn mathematics . There are plenty of sites of learn . Khanacademy is one of my favorites as the videos are designed for young people and are very very approachable. Additionally I find some math lectures of MIT to be easy to understand too . So start learning math today 

Saturday, May 18, 2013

Choosing an online course .

No I am not a showoff. Starting since yesterday I have decided to blog about stuff that occurs in my life .And since I havent received any recommendations I chose to write about that I am familiar with .

The start of every May means one thing . Heat and boredom .  A complete disorientation with day and time. Spent lurking in my bedroom , sleeping till noon and having coffee at 12 . Nights stretch into the wee hours of the morning , dozing off only when I am too sleepy to realize that I am lying on the keyboard face down. And I thought to myself one fine day ( yesterday  doesn't sound dramatic)
 "I am sitting here wasting my life , and the hard-earned money of my parents . Who gives  a fuck if the cat can do somersaults or the dog knows to sing a song ? . I must get on with something useful and stop slacking off. "

I decided to do 2 useful things over the summer and the next 6 months (intern sem ! yipee !) . Learn to write better programs .
Draw dragons .

Seriously. I am not kidding when I mention that I want to draw dragons . It started with the Harry Potter mania when I first saw the Hungarian Horntail on the cover of the Goblet of fire and was all the more encouraged when I read the Inheritance series (remember the series starting with Eragon ? ) . Big bad-ass creatures breathing mouthful of fire  and growing as big as an entire village  inspired pure awesomeness . The only thing I could breathe out is the stinking vapor of onion   from last night's  chutney . Govind therefore resolved to learn how to paint your dragon  over the next semester.Its what people call extra-curricular activities.

Point 1 is my primary target . I do code. But not as much as I like . And certainly not as good as I want to . Knowing C , C++ , Java, Guava , R,S,X,D is like learning French,German, Watusi, Inuit .
It certainly helps to know languages . But there IS a difference between literature and  advertisement (read Shakespeare vs Arindham Chaudhari).Mere knowledge of programming lang. wont help. The ones that actually worth learning are techniques and principles.

To enhance my insubstantial skills in programming I have decided to do an online course with 2 constraints .
1. Take  only one course at a time
2. Any course as long as it doesn't involve Java

Point 1 is the wisdom resulting from years of experience trying to multi-task and failing in all of them miserably. I have taken 10 courses so far and have left all of them in the middle without completion . Either I cant finish the exercises on time , or get wrong answers or dont understand the questions or all of them .  Single tasking is like playing test cricket . Takes time and is boring but in the end is the best way to do something .
Multi-tasking is like IPL . Full of glitz , glam , energy and stupidity . Our mind isnt designed to handle parallel tasks by nature .

Point 2 is a very  important one from a personal perspective. Java is like learning Hindi or Tamil at school . You dont like it . You dont want it . You would do away with it . Yet you have no choice but to learn .

Imagine that you are doing something. You are a mature person capable or reasoning and taking your own decisions . But your nanny doesn't think so .She thinks you are mischievous like you were as a child (read C and buffer overflow). She automatically assumes that anything you do has an unstated intent to it . So she decides to discipline you. You cant just go to pee. You'd have to say (throw clause): "Dear Ms.McNanny. It is my intention to pee.Can I go to pee and come back in exactly 2 mins  ?"
To that Nanny would reply : "Certainly my dear. Take 5 minutes and not more else I will have to whoop your ass" (try catch)
Then you would go into the bathroom , take your wiener out and take a pee. And if you take an extra second to make sure that you do the deed without messing yourself, the nanny would come  right in bursting into the toilet with a stick to whoop your ass(Exception e)

Sounds boring ? Imagine this 10 times over everyday. Welcome to Java 101.

Unfortunately this nanny behavior is so much enamored by the Academic world in India that everyone insists that you use Java . Its type-safe , garbage collected , platform-independent , safe, generic blah blah blah .....

Kill me please.

Anyway apologies if you my dear non-programmer couldn't understand half the shit I posted above. Don't worry. I didnt either .I do hope you get the gist of what I said though.

Anyway coming back to the point , my search for an online course is still on. 5 years ago , there was just Khan academy (I think) . Today you have tonnes of sites with thousands of courses to take and work on . Going through all of them is a course in itself.Let me see  if I can get my hands on a good one .