<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5901677483010489671</id><updated>2011-07-31T06:36:58.702+05:30</updated><category term='Game Theory'/><category term='The Beautiful Mathematics'/><category term='Random Rants'/><category term='Computer Security'/><category term='Algebra'/><category term='Fundebaazi'/><category term='Programming'/><title type='text'>Towards The Beginner's Mind</title><subtitle type='html'>Babblings on programming and mathematics, and some random rants :)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-6291929996426696799</id><published>2010-04-10T23:53:00.002+05:30</published><updated>2010-04-11T00:26:24.439+05:30</updated><title type='text'>What I am studying these days</title><content type='html'>So this one's about some key stuff that I am studying these days. I think I will maybe try to write some short posts summarizing some very specific stuff. I plan to write very brief summary of topics in these things (statistics, machine learning, multi-threaded programming, algorithms), as you have better sources than me to learn them. More importantly, I would like to write my experiences and things that occurred to me during my study.&lt;br /&gt;&lt;br /&gt;I have been studying the following stuff lately :&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Statistics&lt;/b&gt; : My aim is to gain a good solid understanding of machine learning (aka statistical inference). I am educating myself these days in the basics of statistics (and probability, I plan to write something soon in next posts on this). More importantly, I am trying to practice the problems and get a good intuitive feeling. I guess its pointless to go for advanced statistical methods and models, unless you have a good grounding in the basics. I am reading from the awesome book named Statistics, by Freedman, Pisani and Purves. This book doesn't have a lot of equations and that kind of stuff but its an awesome book in that it teaches you to think like a good statistician. Lots of case studies, interesting problems and nice cartoons :)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Concurrent Programming&lt;/b&gt; : using Java, that is. Now, I have read a lot of stuff how Java is not so good for it, but I still think that Java has one of the best support for concurrent programming. I am studying from two books : Java Concurrency in Practice (Doug Lea, Josh Bloch et al) and The Art of Multiprocessor Programming (Herlihy, Shavit). JCIP is a book that builds upon the framework supplied by Java while TAOMP also goes into the very core of how this framework is built (how these building blocks and synchronization primitives are built themselves, the algorithms and data structures). I try to code both examples showing the correct way and those showing flawed methods, and see the truth for myself. It really helps to clear things up, and build a good understanding. I am trying to get as good as I can as the future is going to be based on multi-core and not many programmers understand it enough to develop good multi-threaded software.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Algorithms&lt;/b&gt; : Well, this one's the usual thing but you need to keep revising, practicing and learning new ones. It always helps to be good at algorithms. Sometimes, you can suddenly recognize a situation that is perfectly fine to apply certain algorithm, if you keep in touch with algorithms. It feels really satisfying when you can solve something like that, and also inspires your co-workers to do some of their own study. Spread the word !&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;That's it for now. I hope to come back soon and write about some interesting cool stuff.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-6291929996426696799?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/6291929996426696799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=6291929996426696799' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/6291929996426696799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/6291929996426696799'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2010/04/what-i-am-studying-these-days.html' title='What I am studying these days'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-5287029881000942545</id><published>2010-04-10T23:17:00.003+05:30</published><updated>2010-04-11T00:27:36.481+05:30</updated><title type='text'>We need better managers in Indian software industry</title><content type='html'>I decided to keep writing on my blog and write frequently. However, its been really difficult to stick to that decision because of the constant and huge amount of work that keeps coming up and is definitely on a higher priority. I will keep trying though :)&lt;br /&gt;&lt;br /&gt;One of the things that I have been fed up with in the past few months is how it seems like this "disease" is spread almost in the whole of Indian software industry. The disease is : bad managers.&lt;br /&gt;&lt;br /&gt;Some of the traits I can gather about these managers are : &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt; they have lost touch with programming and hence lost respect among developers. In more worse situations, they are complete 'fuck-ups' with really poor programming skills. And still they choose to show off their "knowledge" at times ! seriously, you bastard ! &lt;/li&gt;&lt;br /&gt;&lt;li&gt; they keep using these buzzwords, business jargon too much. I am fine with the fact that you choose good words to express yourself, but if you overdo it you sound like an idiot, show-offish guy. And the developers get pissed off and the natural reaction is "Fuck off you idiot! you are screwing my precious time".&lt;/li&gt;&lt;br /&gt;&lt;li&gt; they don't understand that they need to trust good developers and encourage them, and moreover prevent less skilled ones coming into the team.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; they are too servile to foreign colleagues. This is so disgusting ! I mean c'mon you assholes, we are a free nation now, we work for them, we aren't their slaves !&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;I feel a lot of this is because of the way Indian software has been evolving since its inception. We started out as a cheap outsourcing destination, then services industry and now there are some people bringing in the product development aspect. As we have more and more product development and skilled programmers rise up the chain, we can expect things to change. I am not very sure about this but I hope it happens :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-5287029881000942545?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/5287029881000942545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=5287029881000942545' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/5287029881000942545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/5287029881000942545'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2010/04/we-need-better-managers-in-indian.html' title='We need better managers in Indian software industry'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-2284336860480967643</id><published>2009-12-19T12:31:00.006+05:30</published><updated>2009-12-19T15:54:45.588+05:30</updated><title type='text'>Finding Clojure</title><content type='html'>For the past week I have started learning &lt;a href="http://clojure.org/"&gt;Clojure&lt;/a&gt;. I have read quite a few articles talking about how Lisp is a language every programmer should learn, notably the &lt;a href="http://paulgraham.com/lisp.html"&gt;articles by Paul Graham&lt;/a&gt;. For those of you who don't know, Clojure in a nutshell is Lisp on top of JVM. &lt;br /&gt;&lt;br /&gt;I recently read &lt;a href="http://www.h3rald.com/articles/10-programming-languages/"&gt;a great post&lt;/a&gt;, which lists out 10 programming languages worth checking out. I do most of my work in Java these days and there are areas where I do believe that Java sucks. I am always happy to learn a new programming language, never mind the harsh reality being the lack of time. I had been mulling over Ruby and Scala, but then I found Clojure and also noticed how some cool startups like &lt;a href="http://flightcaster.com/"&gt;FlightCaster&lt;/a&gt; have been using it. &lt;br /&gt;&lt;br /&gt;Now since Clojure is built on top of JVM, you have access to Java and all kinds of Java libraries and frameworks. This is a very good thing, as Java is one of those languages that have libraries and frameworks for almost anything you would want to do.&lt;br /&gt;&lt;br /&gt;The other thing I like about Clojure is that the code is concise, shorter and simpler. A very good example illustrated in the book Programming Clojure by Stuart Holloway, was Java code for testing a blank string and the equivalent Clojure code. Less code means less to test and debug.&lt;br /&gt;&lt;br /&gt;Clojure has lots to offer as they say ... functional programming, Software Transactional Memory(this one is really interesting, a new way to handle concurrency instead of the traditional locking approach), macros etc. I will be writing more as I keep on learning. Till then, happy hacking !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-2284336860480967643?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/2284336860480967643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=2284336860480967643' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/2284336860480967643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/2284336860480967643'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2009/12/finding-clojure.html' title='Finding Clojure'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-5480819969817292242</id><published>2009-11-03T23:46:00.002+05:30</published><updated>2009-11-04T00:07:08.772+05:30</updated><title type='text'>Back to Blogging</title><content type='html'>Its been a long time since I wrote anything here. Lots of things that prevented me from writing anything, like my laziness :), workload from workplace and my own stuff and newfound love with Facebook and Twitter.&lt;br /&gt;&lt;br /&gt;So I have decided now that I will try to put in short posts, at a more frequent rate. However, I will also write some elaborate posts when I feel like and I have the time for it. If you come to think about it, there are so many things you want to write about, but its more important to get into them rather than necessarily find the time to write about them.&lt;br /&gt;&lt;br /&gt;This is what I am into now these days.&lt;br /&gt;&lt;br /&gt;Technology/Programming : Hadoop, Apache Mahout, CouchDB, Tapestry, Bixo, java.util.concurrent :)&lt;br /&gt;&lt;br /&gt;Music : Lots of trance music lately, with a bit of classical. Looking for a good blues collection. Also planning upon listening a couple of Hindustaani classical ragas more intently and learning their intricacies. Found some good ear training software too.&lt;br /&gt;&lt;br /&gt;Fitness : Started gymming today with a new determination to get into shape as soon as possible, long Diwali break broke the rhythm and ate upon past improvements :(&lt;br /&gt;&lt;br /&gt;Financial Clarity : Planning to get familiar with basics of financial instruments and share market and assess my financial situation with plans for future.&lt;br /&gt;&lt;br /&gt;Whoa ! big list that was ... but yes writing it out is a good way to organize thought processes. Well, time to conclude and come back with a new post later this week !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-5480819969817292242?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/5480819969817292242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=5480819969817292242' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/5480819969817292242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/5480819969817292242'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2009/11/back-to-blogging.html' title='Back to Blogging'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-6499001174507585342</id><published>2008-08-09T11:24:00.005+05:30</published><updated>2008-08-09T12:01:13.074+05:30</updated><title type='text'>Blogging from Manhattan through a MacBook !</title><content type='html'>Its been almost five months since I posted anything on my blog. I have been through a wide range of experiences in this period, from extremely bitter to really wonderful and pleasant. I hope to be able to put in articles more consistently now, as things seem to be settling down now.&lt;br /&gt;&lt;br /&gt;Its been 23 days since I set my foot on the American soil. I am writing this post currently from my apartment in Manhattan, New York and my happiness is doubled by the fact that I am using a MacBook ! ... I have long awaited to understand the loyalty of Mac fans and though I am very new to the fraternity (just a week), I am beginning to see why is it so. I have been to quite a few places in New York now and I have walked a lot here, which is a big change from Bangalore. This place is a sort of jungle of skyscrapers :) ... with so many people moving both above and below the roads. New York certainly deserves to be called one of the greatest cities of the world if not the greatest, which it perhaps is at present. There is so much energy moving around in this city, a place where people are living to get something done. Manhattan is a very safe place too, you can see girls walking around in streets at midnight. There are "thelaas" like we have in Indian cities, just more sophisticated. And you can see a lot of rickshaws at Times Square and in Central Park, just more sophisticated :) designer rickshaws infact ! ... a bicycle here is something which sets you apart from the crowd, just the reverse of what we have in India.&lt;br /&gt;&lt;br /&gt;There are so many observations which I want to put down, but it will take many posts so I will keep them for later posts.&lt;br /&gt;&lt;br /&gt;I intend to put some interesting stuff regarding Linux memory management, compilers and some ideas I have. The thing is that I want to put stuff that's my own hack (as I would like to call it) rather than something which you can find on technology sites or Wikipedia. I can't do it today but I hope I can start with something soon.&lt;br /&gt;&lt;br /&gt;Its been a very happy feeling to return back to my blog and I hope to do better this time :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-6499001174507585342?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/6499001174507585342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=6499001174507585342' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/6499001174507585342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/6499001174507585342'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2008/08/blogging-from-manhattan-through-macbook.html' title='Blogging from Manhattan through a MacBook !'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-3510754685798434431</id><published>2008-03-16T23:22:00.003+05:30</published><updated>2008-08-09T10:49:14.450+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Random Rants'/><title type='text'>Driver, where you taking us ?</title><content type='html'>Its a special day for me, my birthday :) ... nothing much happened today except I was able to pray in the famous Dakshineshwar temple here in Kolkata, after a long, slow walk from outside the temple premises to inside. It was a surprise for me as I had expected it to be an easy-going affair, I would be done in about half an hour, I had thought ... it took more than 2 hours, which I am thankful for, as it could have been more.&lt;br /&gt;&lt;br /&gt;So, here I am, 26 years of my life complete today and I am in a strange state. I feel happy, I feel sad, I feel confused, hopeful and sometimes I feel blank. It seems that this has been triggered because of my thoughtful, introspective mood that I entered yesterday night. There are so many things I have thought about since. Family, friends, studies, career ... And each of these topics makes me feel a lot of things as I have said earlier ... happy, sad, confused, hopeful, blank.&lt;br /&gt;&lt;br /&gt;I am not however, going to discuss (most of) my thoughts here. I rather thought of writing out some of the thoughts that I have for my blog though :)&lt;br /&gt;&lt;br /&gt;Well, this is a summary of what I think I would do with my blog this year :&lt;br /&gt;1) I feel like I need to write more articles that are geek-ish ;) ... what I mean to say is that, I want to write more articles that are not of a philosophical/intellectual mode ... I would like to put more concrete articles this year.&lt;br /&gt;2) I would like to put a lot of small math posts that would be relatively easier for people to grasp and fun too.&lt;br /&gt;3) As for programming, I would like to pick specific language features from those I know and discuss what I know and maybe that could help some new people ... maybe also invite the wrath of experts :D ... but I am ready for that, that's the way to grow !&lt;br /&gt;4) Put more material on data structures as used in Linux, material on Linux scheduler and Linux memory management.&lt;br /&gt;5) Some algorithms that are beautiful and less-known.&lt;br /&gt;6) Cryptography - Posts introducing readers to basics of cryptography, encryption schemes, some practical and wonderful aspects of cryptography.&lt;br /&gt;&lt;br /&gt;Hope, I can do justice to this list this year. Happy blogging to all of you and happy birthday to me ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-3510754685798434431?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/3510754685798434431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=3510754685798434431' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/3510754685798434431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/3510754685798434431'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2008/03/driver-where-you-taking-us.html' title='Driver, where you taking us ?'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-6088549532715544982</id><published>2008-03-11T00:16:00.003+05:30</published><updated>2008-03-11T01:19:49.535+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Random Rants'/><title type='text'>A whining post</title><content type='html'>Missed February 2008 in my blogging career, busy with exams and other stuff. I have three to four topics on which I would love to write something as soon as possible. However, it looks like even March is going to be unsparing. So, with not much time at hand, I thought of writing a post where I would list many of my recent dislikes (it feels so good to criticize ;) ... and hence I call this a whining post :)&lt;br /&gt;&lt;br /&gt;Well, here they are in no particular order or importance :&lt;br /&gt;&lt;br /&gt;1) Indian cricket team has created history in Australia with their sensational 2-0 thrashing of Australia in the triangular series finals. Moreover, they won the historic test in Perth which had become a holy grail of sorts for the Australians. And, the fact that India did this was even more breathtaking. The sad part is India could have won the test series also, had it not been some 'obnoxious umpiring' in the Sydney test. What irritates me now is the attitude of Indian media and some Indian fans. There are still a lot of people who dismiss Indian victory as fluke ... c'mon  now, what do you want ? Indian team came back after a major mental setback in the Sydney test to beat Australia, in nowhere else but Perth ! isn't that awesome ? Beating world champs in ODI versions 2-0 in triangular series finals emphasized the domination of Australia by India. The drama by Indian media is sickening, ridiculous, irritating, over-hyped, emotionally exploiting and what not ... the post-victory shows on leading news channels like Aaj Tak and Star News was senseless. They were blowing things out of proportion, I mean let the team relax, don't play with the sentiments of people for your ratings ... these same channels will not leave a stone unturned the next time Dhoni and gang fail ... the way they projected the clash between Harbhajan and Symonds, Hayden was shameful ... yes, Australians are bad losers but you got to be sensible with national broadcasts. The Indian media looks to me like a bunch of a**holes who flush the ethics with their shit.&lt;br /&gt;&lt;br /&gt;2) I love Ubuntu, this is the most satisfying Linux distro I've laid my hands upon (well, definitely some people won't agree but that's ok with me, you got your reasons to stick with your distro, have fun). However, there are somethings I would like to be improved. Firstly, and I am talking about Ubuntu 7.04, why is the shutdown so ugly ? On Windows XP, the application windows get closed one by one in a clean manner, the shutdown on Ubuntu is like a mad rush to wipe out the window graphics from the screen (you get white rectangles all overlapping, some colours too and then suddenly to the black screen, the sound is broken and sometimes there is no sound !). I have done a bit of searching and come across some links that I am not sure are talking about the same problem ... I would post about this if I can get it fixed. Secondly, why isn't there a group by name or group by type option in the Nautilus window manager in GNOME (even KDE doesn't have it) ... this is a comparison to Windows XP but that feature helps to make the folder view look more organized.&lt;br /&gt;&lt;br /&gt;3) There's this hand gesture that I see all the time when I am at some rock band show (be it in Bangalore or Kolkata) that really irritates me. A lot of young people do it, this is done basically by closing your two fingers just before the little finger along with the thumb, so that the index and little finger are pointing forward ... it's meant to show your appreciation to the band, but I intuitively feel that most of these people are bullshitting, they don't even understand the music. I am not a big guru of music but I would rather stay calm and clap when I have enjoyed some good music from the band ... it makes more sense because you are more likely to be awed and happy by a good/excellent performance rather than 'yo man'ing the performance ;) ... and I find more support for my theory because you can find these people behaving in the same fashion over a crap performance.&lt;br /&gt;&lt;br /&gt;4) The obsession of newspapers and media with politics and celebrities is disgusting ... what do millions of people who are working hard for their meals every day care about Britney Spears' baldness, Paris Hilton's exploits or Kareena-Saif romance ? Go to hell ... I wish there would be a lightning some day that would crack on each of these media people and these narcissistic celebrities who occupy unnecessary attention.&lt;br /&gt;&lt;br /&gt;I feel like I would spit out a lot more whining if I continue ... so I am cutting it short now and switching to work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-6088549532715544982?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/6088549532715544982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=6088549532715544982' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/6088549532715544982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/6088549532715544982'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2008/03/whining-post.html' title='A whining post'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-5567604388975156413</id><published>2008-01-26T12:13:00.000+05:30</published><updated>2008-01-29T21:29:17.164+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>Where are your tools ?</title><content type='html'>A new year brings with itself a new hope, a revived enthusiasm to set up things in your life in order. That's exactly the purpose of this post. I intend to help some students who are willing to strengthen their programming skills this year.&lt;br /&gt;&lt;br /&gt;I have observed that a number of students in colleges who like to program in C, C++ are a bit short on the knowledge or are in complete ignorance, of how to use tools that are used by professional programmers daily. These tools like make, gdb, prof/gprof, valgrind/Electric Fence, CVS/Subversion really help you a lot with programming projects and in fact programmers can't imagine doing their work without these tools. You seriously need them for large-scale projects, and even with smaller projects you will notice how helpful they are.&lt;br /&gt;&lt;br /&gt;My plan in this post is to give such students a short intro to these tools and places where they can start learning these tools. And as you may have noticed, there is bias towards the Linux/UNIX environment here. That's because it's really a much more powerful environment for programming than Windows. You need tos get good in Linux/UNIX environment if you really want to learn more and better about C, C++ programming.&lt;br /&gt;&lt;br /&gt;Note: This book, &lt;a href="http://www.amazon.com/Programmers-Toolbox-Prentice-Software-Development/dp/0132198576"&gt;The Linux Programmers Toolbox&lt;/a&gt; , by John Fusco, is a must-have for all those who are looking to do some serious programming in the Linux environment, and covers all the tools I mentioned. It's very well written also.&lt;br /&gt;&lt;br /&gt;So let's start with 'make'. When you are writing an application, you will have many source files, that roughly depict how you have broken your app into modules. Now, as will happen almost always, you will need to make changes to some module of your app to get things working, or maybe adding a new feature. Once you have made the changes you will need to recompile. This means you will recompile all your source files (in case you don't know make already) which is a waste of time and CPU resource because you changes only one or a small number of modules in your app. And, so ideally you don't need to recompile the ones you haven't changed. This is where make is so helpful and the importance increases when the size of your application's code increases. The book, &lt;a href="http://www.amazon.com/C-Nutshell-OReilly-Peter-Prinz/dp/0596006977"&gt;C in a Nutshell&lt;/a&gt;, by Prinz and Crawford, is also a good resource for learning about gcc, make and gdb. You should try to use GNU make as it is the one used almost in all open-source projects. The page is, &lt;a href="http://www.gnu.org/software/make/"&gt;GNU make&lt;/a&gt;, and has documentation and other relevant information on it. Even if the documentation looks a bit heavy, make sure you do read it every once in a while to know more about the capabilities and intricacies of make, it will help you in the long run.&lt;br /&gt;&lt;br /&gt;Now, another very essential tool, 'gdb'. gdb is the GNU debugger. For those of you who still do the debugging by using print statements, it's important you know how to use a debugger because a debugger can save you a lot of time and labour. That's because debuggers will display the values variables are having at any point in the code and so you don't have to guess which variable values to check through print statements, removing and re-writing print statements in your code again and again. Also, you can put breakpoints anywhere and let a particular section of the program run to get an idea of what's going on. Once again, the book &lt;a href="http://www.amazon.com/C-Nutshell-OReilly-Peter-Prinz/dp/0596006977"&gt;C in a Nutshell&lt;/a&gt;, is a good place to learn gdb and once again the GNU page manual, &lt;a href="http://sourceware.org/gdb/"&gt;gdb&lt;/a&gt;, is the authoritative source.&lt;br /&gt;&lt;br /&gt;Profilers become important when you want to improve the efficiency of your code. You need to identify the hotspots in your code, that is, the portions of your code which take up most of the execution time. Then you can think about why it's taking that much time, and try to substitute better algorithms. prof, gprof are some common profilers available on the Linux/UNIX systems. You can learn about gprof from this great doc, &lt;a href="http://www.gnu.org/software/binutils/manual/gprof-2.9.1/html_mono/gprof.html"&gt;GNU gprof&lt;/a&gt;, by Jay Fenlason and Richard Stallman. &lt;a href="http://docs.sun.com/source/819-3687/OtherTools.html"&gt;This SUN doc&lt;/a&gt;, is also a very good one.&lt;span style="display: block;" id="formatbar_Buttons"&gt;&lt;br /&gt;Let's move on to memory debuggers. Electric Fence is a memory debugger that triggers a program crash when the memory error occurs, so a debugger like gdb can be used to inspect the code that caused the error. You can learn about eFence (as it is called) on &lt;a href="http://linux.die.net/man/3/efence"&gt;this page&lt;/a&gt; by the author of the software, Bruce Perens. He also points to some tools that are better than eFence, however eFence is simpler and a good starting point. 'valgrind' is actually a suite of tools that can automatically detect many memory management and threading bugs, and profile your code in detail. valgrind emulates a CPU and so really slows down your program. You can do some tuning to get a bit improved runtime with valgrind. It's heavy-weight compared to less memory-demanding tools like Purify. valgrind consists of five tools, memcheck (a memory debugging tool), cachegrind (a profiling tool which provides information on cache hit-miss and branch prediction events), callgrind (a tool that shows the call relationships and costs), massif (a space profiling tool which provides information on parts of your code that allocate memory) and helgrind (a debugging tool for threaded programs). You can download valgrind from the &lt;a href="http://valgrind.org/"&gt;official site&lt;/a&gt;, and also find the very detailed and good manual there. Again, the manual may look heavy but you should read it.&lt;br /&gt;&lt;br /&gt;Well, all the above tools help you with the programming logic and builds. You also need a good tool to manage your code when you are working on a considerable sized project, since you will be revising your code and you need versions of the code so that you can fall back to a code that worked. Also, in the case where you are working in a team a tool is needed that can provide safe access to code to the programmers in team, that is, one person's edits are not interrupted by other and everyone gets latest version of code. In a nutshell, you need a verison control system, like RCS, CVS, Subversion etc. RCS is probably the oldest, CVS is the most tried and tested and Subversion is the newer one with a set of exciting new functionality not in CVS. In the beginning, stages it really won't make a difference which one you pick but eventually you should use CVS or newer alternatives like Subversion. &lt;a href="http://svnbook.red-bean.com/"&gt;The official Subversion book&lt;/a&gt; is a good place for learning Subversion. Some good places to learn CVS are the &lt;a href="http://ximbiot.com/cvs/cvshome/docs/"&gt;cvshome.org archive&lt;/a&gt;, &lt;a href="http://www.cs.utah.edu/dept/old/texinfo/cvs/FAQ.txt"&gt;the Utah University page&lt;/a&gt;.&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Ok, so with that I end my intro to these tools. I hope I have sparked some interest in some of you and you will go and try using these tools. And believe me, you should learn and use them because they are really necessary when you work on bigger projects. You will save a lot of time and improve your skills. Plus you will feel more like a professional programmer and that's cool, aint it ? ;-)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-5567604388975156413?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/5567604388975156413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=5567604388975156413' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/5567604388975156413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/5567604388975156413'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2008/01/where-are-your-tools.html' title='Where are your tools ?'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-5027690734502191910</id><published>2007-12-27T20:10:00.000+05:30</published><updated>2008-01-26T12:12:31.498+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fundebaazi'/><title type='text'>Revolution Lies Within !</title><content type='html'>&lt;div style="text-align: justify; font-family: verdana;"&gt;I have been reading many of Steve Yegge's posts lately. Most of his posts that I have read, are in essence (and this is related to programming):&lt;br /&gt;1) Think about your work.&lt;br /&gt;2) Improve the depth of your knowledge by learning more on the subject.&lt;br /&gt;3) Improve your programming wisdom by training yourself in various tools/languages.&lt;br /&gt;4) Improve your maths, learn as much maths as you can.&lt;br /&gt;&lt;br /&gt;The first two points are generic in nature. Even the third is generic if you try to understand the meaning at its core. The fourth one would be a bit surprising for many people but it is in fact the most radical of those points. This does not mean others aren't important but this one is an unorthodox advice. I want to talk here about the last two thoughts, as everyone is familiar with the first two (even if they don't follow them ;-).&lt;br /&gt;&lt;br /&gt;You can have a look at the posts (and I really recommend you to go and read them).&lt;br /&gt;&lt;a href="http://steve-yegge.blogspot.com/2006/03/math-for-programmers.html"&gt;Math For Programmers&lt;/a&gt;&lt;br /&gt;&lt;a href="http://steve-yegge.blogspot.com/2007/06/rich-programmer-food.html"&gt;Rich Programmer Food&lt;/a&gt;&lt;br /&gt;&lt;a href="http://steve-yegge.blogspot.com/2006/04/software-needs-philosophers.html"&gt;Software Needs Philosophers&lt;/a&gt;&lt;br /&gt;&lt;a href="http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html"&gt;Execution In The Kingdom Of Nouns&lt;/a&gt;&lt;br /&gt;&lt;a href="http://steve.yegge.googlepages.com/ten-challenges"&gt;Ten Challenges&lt;/a&gt;&lt;br /&gt;&lt;a href="http://steve.yegge.googlepages.com/tour-de-babel"&gt;Tour De Babel&lt;/a&gt;&lt;br /&gt;&lt;a href="http://steve.yegge.googlepages.com/being-the-averagest"&gt;Being The Averagest&lt;/a&gt;&lt;br /&gt;&lt;a href="http://steve.yegge.googlepages.com/practicing-programming"&gt;Practicing Programming&lt;/a&gt;&lt;br /&gt;&lt;a href="http://steve.yegge.googlepages.com/math-every-day"&gt;Math Everyday&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As I said earlier, the third one is generic too because it illustrates the importance of being open-minded, unprejudiced, unbiased. Here are some quotes (I found them on an interesting blog by &lt;a href="http://weblog.raganwald.com/"&gt;Reg Braithwaite&lt;/a&gt; and they quite illustrate the third point),&lt;br /&gt;&lt;br /&gt;Programming languages teach you not to want what they cannot provide. - Paul Graham, &lt;a href="http://lib.store.yahoo.net/lib/paulgraham/acl1.txt"&gt;ANSI Common Lisp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;An “X programmer”, for any value of X, is a weak player. You have to cross-train to be a decent athlete these days. Programmers need to be fluent in multiple languages with fundamentally different “character” before they can make truly informed design decisions. - Steve Yegge, &lt;a href="http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html"&gt;Code's Worst Enemy&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What I can conclude from reading these opinions and myself having a small look at functional programming is, that you definitely need to learn many different programming languages with different paradigms. You do not want to be one of those five blind men with the elephant, isn't it ? And, I really hate it when I see people raving over Java. I am not a Java-hater, though the language has got its own problems as many other languages do. I hate the sickening attitude of those Java-philes, because they look like a bunch of zombies to me. Zombies, zombie-d by Java, fanatically convinced of Java the Panacea, who have built a wall of 'bytecodes' around them and pretend that this enclosure with what it encloses is all that there is. Most of them are newcomers and less-experienced, as those who have been deep into the rabbit-hole of Java surely know that all is not well. Now, you may question my experience as I myself don't have years of experience behind me and that's perfectly valid. However, you have got to pay attention when senior programmers (those who have been there for more than a decade) point out problems with your current favourite language. As when Alexander Stepanov, the implementer of C++ STL and a hugely respected guru of generic programming, said the following:&lt;br /&gt;"I find OOP technically unsound."&lt;br /&gt;"I find OOP philosophically unsound."&lt;br /&gt;"I find OOP methodologically wrong."&lt;br /&gt;"I have yet to see an interesting piece of code that comes from these OO people."&lt;br /&gt;"I think that object-orientedness is almost as much of a hoax as artificial intelligence."&lt;br /&gt;&lt;br /&gt;When all you know is language X, you will fire up code without thinking whether X is a good candidate to solve the problem at hand. You will think in the terms of X, you will try to fit the problem into the mold of idioms of X, into a particular paradigm. When the only tool that you have is a hammer, everything looks like a nail.&lt;br /&gt;&lt;br /&gt;Coming to the fourth point, its really appalling to see that people just don't know or want to do maths. Whatever they learned, software jobs have washed it out of their minds. Its a great loss and they don't realize it. As an example of why should you study some maths, consider that you have a new problem at hand. Now, most perhaps you will come up with a simple, naive solution to it and use that. This will show up as a problem when considering the efficiency of your application. Had you known some maths, you might have tried optimizing or finding a better solution to the problem. You can say that you can workaround this problem by doing a search on algorithms for such a problem. However, that's not very easy unless you follow points 1 and 2 listed above. Also, in the worst case it may be a new kind of situation and then you are left helpless. If you knew maths, you could try to formulate the problem in some mathematical models you knew, and try developing a better solution. Most wonderful would be the situation where you could model it from scratch and develop a solution. As a more practical example, suppose you had some algorithm (or data structure) which work on the kind of problem you have at hand, but the problem isn't directly fitting into the domain of those algorithms or data structures. You could tweak the data structure or algorithm to fit into your requirements, you could analyze the costs involved ... all possible if you knew maths. Computer Science at a fundamental level is maths.&lt;br /&gt;&lt;br /&gt;People with engineering degrees from reputed institutes should be more technically-oriented rather than running for those management courses or jobs (its entirely my opinion). It just doesn't feel right to me. Our country needs a lot of technically skilled people to carry it into the league of advanced nations. The fire of real progress is going to be ignited through science and technology, not through management. Management makes sense only when you have some strong foundation, real growth and progress. So many managers and not enough technically-skilled people is a sure recipe for continuing to be the copycats that we are today. Little wonder why we don't have world-class software products, cutting-edge technology.&lt;br /&gt;&lt;br /&gt;Ok, let me wind up. Forget Java or C++ or Ruby, the point is that you need to have an introspection session regularly, where you stop working in the routine manner, and you try to think. Try to think whether you are on the right track, are you working with an open mind, is there something you are missing in your toolset, is your language really giving you what you want, do you need to know a new area of maths ... questions like these. I feel that this kind of checkup and acting upon the conclusions from it honestly, can make us wiser and help us grow.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-5027690734502191910?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/5027690734502191910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=5027690734502191910' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/5027690734502191910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/5027690734502191910'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2007/12/revolution-lies-within.html' title='Revolution Lies Within !'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-5203817248451442648</id><published>2007-12-12T19:25:00.000+05:30</published><updated>2007-12-19T11:59:13.302+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Random Rants'/><category scheme='http://www.blogger.com/atom/ns#' term='The Beautiful Mathematics'/><category scheme='http://www.blogger.com/atom/ns#' term='Algebra'/><title type='text'>On Happyness and Generators of Groups</title><content type='html'>&lt;div  style="text-align: justify;font-family:verdana;"&gt;&lt;span style="font-size:100%;"&gt;It usually happens to me. There are days when all I can think about is completing the work at hand or about my course of action for coming days. So I just keep on reading stuff, finishing assignments, preparing for exams, working on some of my ideas, dreaming and day-dreaming about rosy career-prospects ;-) ... and then somewhere in the middle of it, I realize as if I am trying to run as fast as I can without enjoying what the 'present' has to offer to me. It doesn't look very good and then I try to take a sort of small break and as a result some funny ideas come to my mind. So, this is a recollection of one of the recent such moments I had.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;I was trying to learn some functional programming few minutes before this break that I mentioned. &lt;/span&gt;&lt;span style="font-size:100%;"&gt;I pondered over the reason of why I wanted to learn functional programming. I answered, "because that would make me a better programmer". Okay, but why do I want to be a better programmer ? I answered, "because I love programming and it's really cool to know that you have learned something important, you have enhanced your skill, you have a wider perspective". Fine, but then I questioned, why does it matter really that I have gained a broader vision about programming a solution to a problem. To cut the chase, it finally dawned on me that the reason was "Happyness" (yes, that spelling is borrowed from the movie). Moreover, it dawned on me that in fact, Happyness was the answer if you started to ask questions and reduce your pursuits to some fundamental reason. I am very sure on this that everyone of us can apply this method of reasoning to themselves and the answer will inevitably turn out to be Happyness. It may be studying maths, working hard on your tennis games, practicing new moves in chess, staying late at office to finish some task ;-) ... whatever.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Well, that's half the story. A remarkable characteristic of human mind is that it's working is strongly based on patterns and it learns a lot through drawing analogies. Surprisingly, a strange analogy struck me in regards to the above mentioned stream of thought. Let me now bring you to the topic of groups and generators which will help you understand my crazy analogy.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Algebra is a beautiful subject indeed. It represents an example of what the mainstream mathematics of today looks like, which is, abstract. Yes, modern mathematics is hugely abstract in nature. It may surprise some people as mostly it is thought to be involving calculations. In fact, this was the scene a few centuries back. However, over the course of time, the emphasis has moved from computing to understanding, which brings in abstractness. Don't misinterpret me in that there was no understanding involved in mathematics a few centuries back. It's just that mathematics then was mostly used as a tool to calculate answers to problems, mostly physics-related. What happened that mathematicians studied some related problems and then in the process of study, refined their results more and more to some basic essentials, which became the abstract theories of mathematics we have today. In Algebra, we study mainly algebraic systems (such as groups, rings, fields), which simply put are, a set of objects together with some operations for combining them.&lt;br /&gt;&lt;br /&gt;Which brings us to Groups. Now, I am not going to bomb you with heavy mathematical definitions. I will try to explain to you in as much a layman-style as possible. Consider the set Z11={1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. Now, we will add an operation to this set ... it's multiplication (and you thought it was going to be some Lebesgue integral over the norms of the p-adic variation of this group !). Yes, plain old multiplication but with a little twist, it's called multiplication modulo 11 (in general modulo n). This is nothing complicated, all you have to do is that whenever you multiply any two numbers in the set Z11, you take the remainder of product divided by 11 as your result. For example, 2 x 6 = 1, because you take the remainder of 12 divided by 11. Similarly, 3 x 5 = 4, 4 x 7 = 3 and so on. Guess what? We have a group at our hands and it is the pair (Z11, multiplication modulo 11). Technically, there are some other properties this pair needs to satisfy to be called a group but, I won't be going into those and you can believe me here in that this pair is indeed a group.&lt;br /&gt;&lt;br /&gt;So, with the group at our hands, it's time to look at the element 2 in the set Z11. 2 here has a special property as does the group Z11. I am going to denote power operation by ^. Observe now. 2^0=1, 2^1=2, 2^2=4, 2^3=8, 2^4=5 (not 16, remember we divide the result of multiplication by 11), 2^5=10, 2^6=9, 2^7=7, 2^8=3, 2^9=6, and 2^10=1 again. What we have here is that a single element (2 here) generates the whole set when the operation is applied to it repeatedly. The power thing is actually 2 being multiplied with itself again and again. Thus, 2 is special and it is called the generator of the group (Z11 itself is special since it is an example of groups that have generators, many groups don't ... in fact put any prime in the place of 11, say p, and you will see that 2 is a generator of Zp).&lt;br /&gt;&lt;br /&gt;Okay, let me get to my crazy idea that I was going to talk to you after all. Probably you might have already got it or a feeling of what it is. To kill all the hyped suspense, the idea is:&lt;br /&gt;&lt;br /&gt;Happyness is the generator of the "group" formed over the pursuits or actions in our life.&lt;br /&gt;&lt;br /&gt;Crappy, isn't it ? Yeah, sorry to bother you all along but let me give some reasons as to why I think so. First, you can see the strong analogy between the questioning process I mentioned and the generation of group by a generator. What I mean to say is that, each of your actions fundamentally derives from the a desire to be happy. Hence, happyness when applied to itself through an operation (that I am not very clear about) generates all your other desires, actions and pursuits. Secondly, sometimes you find that at some stage of your questioning you may have more than one reason/answer for your question. This can also be explained in the analogy if you observe that 4^2=5, 4^3=9, 4^4=3. So 4 also generates some elements but not the whole group (try it, you will know why, it's not tough). It is 2 that generates the whole group. So is it with Happyness, it is the "fundamental" generator, or in other words, the generator of the (whole) group.&lt;br /&gt;&lt;br /&gt;Now, you may pose a valid question ... if we consider one person's desire/actions to be a group and do the same for another person, is it the case that the happyness element that they both have in their groups are the same ? I mean to say that whether when you feel happy and I feel happy (when the happyness element is expressed), is it the same feeling ? Well, I should say that analogies when carried too far or stretched too much, usually break. So, I am doubtful if this one holds. On a different note, this question is a very important one in Algebra, as it is basically the question of two groups being isomorphic (and I don't have the time to explain that here, maybe some other post :-)&lt;br /&gt;&lt;br /&gt;"This person has gone nuts!" ... must be the thought coming to your mind, so let me say goodbye and thanks for reading.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-5203817248451442648?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/5203817248451442648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=5203817248451442648' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/5203817248451442648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/5203817248451442648'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2007/12/on-happyness-and-generators-of-groups.html' title='On Happyness and Generators of Groups'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-7178155826520302688</id><published>2007-12-10T20:32:00.000+05:30</published><updated>2007-12-19T12:00:52.011+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Random Rants'/><title type='text'>I didn't do it, Lord screwed me !</title><content type='html'>&lt;div  style="text-align: justify;font-family:times new roman;"&gt;&lt;span style="font-size:130%;"&gt;/* crap.c */&lt;br /&gt;#include "screwed.h"&lt;br /&gt;&lt;br /&gt;int main(void) {&lt;br /&gt;&lt;br /&gt;/* At last it's over. I am really relieved. I had my Compilers final today. It was really terrible, I have messed it up really badly, but you know what, Lord Screwed Me ;-) ... How ? Here's how :&lt;br /&gt;&lt;br /&gt;1) Lord has not given me the strength to wake up and attend classes, especially, those that take place at 9:00 am, which was the case with Compilers class. (additional weakness: sleeping at 3:00 am)&lt;br /&gt;2) Lord has not given me the strength to stay awake and focus in classes as demanding as Compilers, I dozed off half the time in those lectures.&lt;br /&gt;3) Lord has not given me the wisdom to go through such tough material at least once a week so that I can feel comfortable with the concepts. I really have to wait for the finals to come for my recovery action to get started.&lt;br /&gt;4) Lord has not given me the wisdom to utilize a gap of two days before the tough final, so that I can still do it better than what I did, in fact could have been much better.&lt;br /&gt;5) Lord, aaaaaarrrghh ... has not given me the HUGE WISDOM to pick up question papers from the past few years and try to solve them at least. Even that would have helped me a lot.&lt;br /&gt;&lt;br /&gt;I am such a helpless guy ! ... Lord is a big, hidden sniper who enjoys playing "Shoot the Kid" game with me ;-) ...  */&lt;br /&gt;&lt;br /&gt;return SCREWED; /* haha */&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;You must have got the story by now. So, lame excuses aside, the real point of writing this post is that I wanted to communicate to you something I have realized in the past couple of days. Compilers is a very interesting, important paper and every computer science student should try to understand it as good as they can. Not convinced ? &lt;a href="http://steve-yegge.blogspot.com/2007/06/rich-programmer-food.html"&gt;Steve Yegge's post&lt;/a&gt; might give you an idea. Personally, I have read the dragon book on Compilers (Compilers: Principles, Techniques and Tools - Aho, Sethi, Ullman) in the past couple of days and I must say it's been challenging, stimulating and enlightening. It's definitely not easy but it isn't meant to be, it's not Java ;-) ... I have made a resolve: To keep on reading the book and improve my understanding of Compilers.&lt;br /&gt;&lt;br /&gt;Tell you what, I DIDN'T DO IT, LORD SCREWED ME ! ... haha :-)&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-7178155826520302688?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/7178155826520302688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=7178155826520302688' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/7178155826520302688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/7178155826520302688'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2007/12/i-didnt-do-it-lord-screwed-me.html' title='I didn&apos;t do it, Lord screwed me !'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-7305850654902612440</id><published>2007-12-03T19:01:00.000+05:30</published><updated>2007-12-05T17:01:07.775+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computer Security'/><title type='text'>A Slightly Helpful Guide to Learning Computer Security</title><content type='html'>&lt;div  style="text-align: justify;font-family:times new roman;"&gt;&lt;span style="font-size:130%;"&gt;Yet another guide to learning computer security ! ... Yes, but this one is with a DIFFERENCE. It will reveal to you all the untold secret methods that are never there in those other laughable tutorials on the net. Even those books in market won't teach you as much content you are going to learn here, and that too at a storming pace ... you will be able to hack your school's servers, read your enemy's mails (yes, hack Yahoo!, Gmail and many other mail servers !) and more with the super-hack tools presented in this series. And, all you need to do is to help me to continue this great service to wannabe hackers like you by donating me a small amount of 100 dollars ...&lt;br /&gt;&lt;br /&gt;;-) ... just kidding, I am not going to do any of what's mentioned above. Just to entertain you (a pathetic attempt, I admit) and sort of pun on some webpages with somewhat similar claims. My purpose in this post is to provide students and people who want to learn about computer security (with more than a passing interest), a somewhat helpful plan to do so. So let's get started.&lt;br /&gt;&lt;br /&gt;Well, we can make a vague and not so accurate (but practical for learning purposes) partitioning of this field. That is (a) OS+Network Security (b) Web Application Security (c) Cryptography. This definitely leaves out some areas since security is a huge field. Another thing is that these categories are not disjoint sets, that is there is stuff which cannot be said to fall in any one of the categories. However, this partitioning will do, as you are embarking on the journey. Let me explain briefly what these categories mean.&lt;br /&gt;(a) OS+Network Security - This covers the exploits that are targeted against the weaknesses, critical flaws in an operating system's code (like Windows or Linux or Mac) as well as network protocol implementations. So the major work here is to understand how these exploits work, finding new areas of OS, Networking code that are vulnerable and solutions to prevent the exploits.&lt;br /&gt;(b) Web Application Security - This covers the exploits targeted against the web applications like browsers, mail servers, web servers. Usually, the exploits use vulnerabilities in such software to gain access to system, or to retrieve confidential data from the databases behind the servers.&lt;br /&gt;(c) Cryptography - Cryptography is the science of secret storage and secure transmission of information. Various cryptosystems are used to enable the secure transmission of data over insecure channels like Internet. Now, cryptography is used both in OS and Web Security. So what I mean here is the study of cryptosystems, protocols, security of these systems, attacks on these systems etc.&lt;br /&gt;&lt;br /&gt;Well, so that was a crap intro to the three categories. You can get much better descriptions on Wikipedia. Let's move on to a plan for study. Let me remind you, I am not giving you any methods for cracking or breaking into other people's systems. Another very important thing is the fact that you are not going to be good in this field within couple of weeks, or months. It takes lot of hard work, patience, perseverance and you would better set a time frame of a couple of years at least. Well, that doesn't mean you will be an expert in couple of years, but you will be much ahead of the crowd if you put in real effort.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Avoiding Crap Sites on the Net:&lt;/span&gt;&lt;span style="font-size:130%;"&gt; Yes, there are so many of them. They will provide you with text files, webpages with hack descriptions and lots of them. The problem is that these are mostly the "script-kiddie" stuff. That is, they give you tools or methods used for hacking which have been developed by other crackers(yes, not hackers, there's a difference) and spread on the net. The problem is that you never learn why they work and you are a dead duck when they fail and maybe get you tracked down. Study good books to get your fundamentals right first.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Understanding Networking:&lt;/span&gt;&lt;span style="font-size:130%;"&gt; This is really important. You got to have your networking concepts really solid to understand the field of security. Unless you know how networking works, how the protocols work, in depth, you are going to be always on the surface of this ocean. So, try to get an account at your institute's lab and practice what you learn from books. For those who are out of institute, if you can build a small LAN with your friends maybe, you can still learn most of the stuff. You could also subscribe to lots of Unix/*nix accounts (some free) out there on Internet. Yes, books:&lt;br /&gt;(1) TCP/IP Illustrated Vol 1, Vol 3 - W. Richard Stevens, this is such a joy to read, the best thing being that it's not filled with only theory but also shows you all the details with tcpdump, read an practice this book thoroughly, it will enable you to understand the security issues and explore on your own. Vol 2 has a coverage of whole TCP/IP implementation, and is recommended if you want to take a really deep dive. You can manage without it usually while understanding the exploits but to design your own exploits or to tackle exploits you will need to get down to these gory details.&lt;br /&gt;(2) Computer Networking by Tanenbaum is also nice but is a lot of theory, you could read it to clarify some portions and more general coverage than Stevens&lt;br /&gt;(3) Internetworking with TCP/IP - Comer, haven't read it but I hear this one's also good&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Understanding Operating Systems:&lt;/span&gt;&lt;span style="font-size:130%;"&gt; This is really important if you want to get more into OS security. Even if you don't, it's very advisable to have a good idea of how an OS works in general. You will benefit from the knowledge in many other areas as well. The books are:&lt;br /&gt;(1) OS Concepts - Silberschatz, Galvin ... this is the standard OS textbook of general nature and you would do well to read it as much as you can. It's a very clearly written book that will provide you the concepts you will need to understand more specific texts.&lt;br /&gt;(2) The Design of the Unix Operating System - Maurice J. Bach ... this is a classic. It is outdated in some places but most of it is still relevant and gives you the idea underlying UNIX OS and most of its existing derivatives today (like Linux).&lt;br /&gt;(3) The Design and Implementation of 4.4 BSD Unix OS - McKusick, Bostic, Karels, Quarterman ... another classic, describes the Berkeley Unix, the other major stream of Unix kernel besides the AT&amp;amp;T Unix.&lt;br /&gt;(4) Understanding Linux Kernel, 3rd Ed. - Bovet, Cesati ... the definitive book for details of Linux kernel. Best if you read this one along with (1), covers the 2.6 kernel that is the latest major kernel version of Linux.&lt;br /&gt;In fact, anyone whether he intends to get more into OS security or not should read (1), and if you want to move into details pick up (2), (3) or (4). (3) and (4) are more up-to-date. (4) has the unique advantage in that it contains some real kernel code as well as pointers in the kernel tree to where you would find the code to the topic being discussed. Another important point to note is that if you want to do security stuff, Windows or Mac isn't a very good idea, as you have limits on how much you can peek into the internals (which frankly is very less). Linux provides you complete freedom to look at everything in it, you can go through code for every part of the kernel, device drivers and do changes at fundamental levels which are not possible on Windows or Mac.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Shell Programming:&lt;/span&gt;&lt;span style="font-size:130%;"&gt; You need to be good at shell programming, scripting, to carry out the tasks efficiently in Unix/Linux. Many exploits are written as shell scripts. Also they take a lot of burden by simplifying the task compared to what you would have to do if you were to write them in languages like C, C++. Books are:&lt;br /&gt;(1) The Unix Programming Environment - Kernighan, Pike ... the classic and much recommended book, will give you an idea of how the good Unix programmers use the shell for their work and the power of shell. You really need to absorb this book as much as you can.&lt;br /&gt;(2) Classic Shell Scripting - Robbins ... another very good and current book that will strengthen your shell programming skills.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Firewalls:&lt;/span&gt;&lt;span style="font-size:130%;"&gt; For those who were waiting for more related to Web Security, this one is a really important topic. However, please note that you need good networking concepts to move into this part. Firewalls are essential to security on web today. There are so many exploits and so many firewall-building/firewall-design strategies, that it is a very demanding and enjoyable area of study in itself.&lt;br /&gt;(1) Firewalls and Internet Security: Repelling the Wily Hacker - Cheswick, Bellovin ... this one's the only one I have looked at and it's probably the best book out there on the subject.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Web Application Security:&lt;/span&gt;&lt;span style="font-size:130%;"&gt; I haven't read much here and most of what I know is from a few good websites. I will be lisiting a collection of websites that have good content on security in the next part of this topic. Though, I can see from reviews that following books might be good:&lt;br /&gt;(1) Hacking Web Applications Exposed - Scambray, Shema, Sima ... another one from the trustworthy Hacking Exposed series.&lt;br /&gt;(2) Apache Security - Ristic ... I happened to glance through the book, looks pretty good to me, reviewers seem to agree.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Cryptography:&lt;/span&gt;&lt;span style="font-size:130%;"&gt; Well, this is something I am most interested about from all the three categories I mentioned. As I said earlier that what I mean by this section is the study of cryptosystems used today, the analysis of their security, attacks on them and mitigation strategies. Moreover, this part of security turns out to be heavily mathematical and algorithms-based. So if you are more hooked on to programming, OS's, networking etc. you might just want to know some basic ideas from this field and that would be fine.  That does not mean that cryptography doesn't involve programming, there's  programming here too, as these mathematical cryptosystems need to be implemented, that too correctly and efficiently. A very good, general, not too technical, introduction would be Simon Singh's The Codebook. For those of you who want to get into it a bit deeper, let me remind you that you need to be comfortable with some elementary algebra and number theory. The books are:&lt;br /&gt;(1) Introduction to Cryptography - J. Buchmann ... good material, with examples to get you working, gives you required maths background to understand the topics.&lt;br /&gt;(2) Cryptography, Theory and Practice - Douglas Stinson, 3rd Edn. ... a classic, really good textbook. Maths background is there but you need to be comfortable with some elementary algebra and number theory.&lt;br /&gt;(3) Handbook of Applied Cryptography - Oorschot, Menezes, Vanstone ... a very good textbook, with current material, lots of references to help you, good presentation. Best thing is that the whole book is downloadable freely.&lt;br /&gt;(4) An Introduction to Theory of Numbers - Niven, Zuckerman, Montgomery ... one of the best number theory books out there, very accessible and sufficient depth in topics too.&lt;br /&gt;(5) Contemporary Abstract Algebra - J. Gallian ... a very accessible introduction to Algebra. It is a really good book to start learning algebra, gives you a lot of examples and also gives applications of algebra.&lt;br /&gt;I could write a lot here but I plan to put more information in posts in the Cryptography category (to be added soon).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Other Important Books:&lt;/span&gt;&lt;span style="font-size:130%;"&gt; This section lists some books that are essential to your knowledge but I could not put them in one of the above categories. One reason being that they are different from the above books as they are meant to guide you in securing your systems, not to prepare you for an in-depth understanding of the exploits and vulnerabilities.&lt;br /&gt;(1) Practical Unix and Internet Security, 3rd Edn. - Garfinkel, Spafford, Schwartz ... a classic of its kind, you got to have this book on your shelf. Lots of information, with very clearly written material on system administration, intrusion detection, break-in forensics, and log analysis.&lt;br /&gt;(2) Hacking Linux Exposed - Hatch, Lee ... a very good read, it contains current material and exposes lots of security problems, provides you an understanding of various tools for keeping your systems secure and monitoring their security.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Books to develop your thinking style about security:&lt;/span&gt;&lt;span style="font-size:130%;"&gt; These are the sort of books that will give you an insight to the patterns of hacking exploits, how people have thought about these exploits.&lt;br /&gt;(1) Exploiting Software - Hoglund, McGraw ... does a Design Patterns thing for security exploits, gives you an insight as to how to look for vulnerabilties in software. Highly recommended.&lt;br /&gt;(2) Silence on The Wire - Michal Zalewski ... another thoroughly entertaining and insightful book on computer security. Highly recommended.&lt;br /&gt;&lt;br /&gt;Yes, this looks quite lengthy and I am feeling sleepy now. I wanted to add some sites you should look for to learn and be in touch with current security threats but, I will do that some other day as next part of this topic. Till then, best of luck in case you decided to get into this wonderful field :-)&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-7305850654902612440?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/7305850654902612440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=7305850654902612440' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/7305850654902612440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/7305850654902612440'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2007/12/slightly-helpful-guide-to-learning.html' title='A Slightly Helpful Guide to Learning Computer Security'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-4653336531399201242</id><published>2007-11-23T19:04:00.000+05:30</published><updated>2007-11-24T01:00:46.407+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fundebaazi'/><title type='text'>The Importance of Reading Classic Texts</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;Hi,&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;As the name of topic suggests, this is on classic texts. However, the domain considered is a narrow one. This is about technical books, mostly computer science books. This is one of the series of informal discussions that I keep on having with my friend Raghvendra. Raghvendra is from a Mathematics background and helps me with Maths, especially Algebra. I complement this by helping him (as well as I can) in the CS stuff. More importantly, he is fun-loving, sometimes lazy and casual like me and so we gel well :-)&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;Coming to the topic, this is an observation we had on the books that students study in colleges generally. Our observation leads us to conclude that most students prefer to read books that are easy-going, non-challenging and quick-fix solutions to exams. Let me once again remind you that this discussion is technical books centric, India centric.&lt;br /&gt;&lt;br /&gt;Let me start with CS books. When you observe what books people read for programming these mostly turn out to be Kanetkars, Balagurusamys, Schaums, Teach Yourselfs, Schildts, Eckels and stuff like that. There is one fact I am going to tell you and I can bet on this. If you really want to learn a programming language, understand it's subtleties and nuances, develop your understanding so that you can appreciate deeper issues, you got to read the programming language creator(s) book PERIOD ... Why is this so ? Let me start with where these other books fail. First of all, if you take any of these books to a really good programmer, he will tell you how many incorrect statements they have. A classic example is telling that C is both call-by-value and call-by-reference. Second they talk too much on something and then miss out critical points which leave your understanding incomplete and dangerously insufficient. Third, they teach you bad coding styles. Look at code written in K&amp;amp;R, Stroustrup etc ... they look beautiful and elegant. Fourth, many of these books really mess-up your learning as they take you unnecessarily into things you don't need when you are starting to learn a language (stuff like hardware interaction, graphics, Windows and Linux programming). Last, and the most important and interesting reason is that they don't force you to think, they are too easy going. The creator books are difficult for beginners, I agree but, if you proceed patiently and put in some effort, you understand the right concepts and these things stick into your mind. You save a lot of time and effort later on.&lt;br /&gt;&lt;br /&gt;Maths. There are so many classics, really wonderful books like Herstein's Algebra, Thomas-Finney's Calculus, Erwin Kreyzig's Engg Mathematics. I got some other names like Rudin's Real Analysis text, Dugundji's and Joshi's texts on Topology. Though, I really can't tell you why they are beautiful but Raghvendra prefers to read classics in Mathematics like I do in CS, so I believe they are going to be good. I am reading Herstein's Algebra and it is so wonderful when you have that AHA! moment, you can see the beauty that's there in those abstract structures. Thomas-Finney was one book I loved simply because of its style of presentation and the way it kept you showing how the mathematics related to some real world situations. Do you feel shaky about your concepts on limits, continuity and differentiability ? Pick up Thomas-Finney, give it a couple of days and you will see these things will come so naturally to you ever after.&lt;br /&gt;&lt;br /&gt;Physics. Feynman's Lectures. Absolute joy to read this trilogy. You feel like attending a real lecture and the insights that you gain are awesome. Equations come but there are interpretations, the emphasis on understanding the content of equations is throughout the books. The difference between how a mathematician sees equations and what they mean to a physicist is something really important to know if you are serious about Physics, or are interested.&lt;br /&gt;&lt;br /&gt;Hope, I got you to rethink on the topic of choosing a book when studying something. Let me know what you think, this is a nice thing to discuss :-)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-4653336531399201242?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/4653336531399201242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=4653336531399201242' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/4653336531399201242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/4653336531399201242'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2007/11/importance-of-reading-classic-texts.html' title='The Importance of Reading Classic Texts'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-422173936810363119</id><published>2007-11-21T19:44:00.000+05:30</published><updated>2007-11-28T19:22:14.737+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>Object Oriented Programming in C - Proof of Concept (Part 2)</title><content type='html'>&lt;div  style="text-align: justify;font-family:times new roman;"&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;span&gt;Explanation of Code in the first part&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;Let us now try to understand the C code that was put in the first part of this post. The files &lt;span style="font-weight: bold;"&gt;new.h&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;class.h&lt;/span&gt; are files that will be common for any user-defined objects (i.e. stacks, queues, complex number or any class that you would like to implement in C). The purpose of &lt;span style="font-weight: bold;"&gt;new.h&lt;/span&gt; is that it declares two functions &lt;span style="font-weight: bold;"&gt;new&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;and &lt;span&gt;&lt;span style="font-weight: bold;"&gt;delete&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/span&gt;that will be used to create and destroy, &lt;/span&gt;&lt;span style="font-size:130%;"&gt;respectively, &lt;/span&gt;&lt;span style="font-size:130%;"&gt;any type of objects. The declaration of &lt;span style="font-weight: bold;"&gt;new&lt;/span&gt; tells us that its first argument is a pointer to the type of object that is going to be created. The ellipsis indicates that it can take a variable number of arguments. The arguments will be fetched and passed to the constructor function (here &lt;span style="font-weight: bold;"&gt;Stack_ctor&lt;/span&gt;) of the particular object. Now, there are still some issues like multiple constructors but believe me, that can be handled. I haven't given the implementation of &lt;span style="font-weight: bold;"&gt;new&lt;/span&gt; or &lt;span style="font-weight: bold;"&gt;delete&lt;/span&gt; as I want to convey to you the idea and not bog you down with the details. &lt;span style="font-weight: bold;"&gt;delete&lt;/span&gt; just accepts the pointer to the object to be destroyed, calls the object's destructor (here &lt;span style="font-weight: bold;"&gt;Stack_dtor&lt;/span&gt;) and finally frees the pointer to the object. Yes, we do not have the facility of automatic destruction like the one provided in C++, this is a limitation, you need to call &lt;span style="font-weight: bold;"&gt;delete&lt;/span&gt; explicitly.&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;Now for &lt;span style="font-weight: bold;"&gt;class.h&lt;/span&gt;, this contains a &lt;span&gt;structure&lt;/span&gt;&lt;span&gt; &lt;span style="font-weight: bold;"&gt;Class&lt;/span&gt;&lt;/span&gt;, which is nothing but a container for information common to any object. It is something similar to the Object class in Java from which all objects are derived. It contains the size of the object, and then four function pointers. These are for the constructor, destructor, clone and differ functions (see comments for clone and differ functions, they don't affect much the discussion here). Every object is now going to have a pointer to this &lt;span style="font-weight: bold;"&gt;Class&lt;/span&gt; structure (and more importantly, it is going to be the first member of every object, since it gives us an interface to access the constructor, destructor functions of any object).&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;Now, the header file &lt;span style="font-weight: bold;"&gt;stack.h&lt;/span&gt;, contains a void pointer named &lt;span style="font-weight: bold;"&gt;Stack&lt;/span&gt;. The user needs to be know this header file only for his task. The pointer &lt;span style="font-weight: bold;"&gt;Stack&lt;/span&gt; points to information represented by the structure &lt;span&gt;Class&lt;/span&gt;. Later when we allocate an object using &lt;span style="font-weight: bold;"&gt;new&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;new&lt;/span&gt; will copy this information into the object and then call the object's constructor (here &lt;span style="font-weight: bold;"&gt;Stack_ctor&lt;/span&gt;). Keeping &lt;span style="font-weight: bold;"&gt;Stack&lt;/span&gt; a void pointer does not reveal any details to the user. Then, there are prototypes for the push and pop functions. Yes, you can point out that the void pointer arguments cannot be checked at compile time for the correct type. I have seen some compilers do that for the void pointers but yes this cannot be taken to be a standard behaviour. Proper runtime checks can be done with graceful exit in case of error.&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;Now, coming to the implementation of the stack in the file &lt;span style="font-weight: bold;"&gt;stack.c&lt;/span&gt;. First we see a structure &lt;span style="font-weight: bold;"&gt;Stack&lt;/span&gt; declared at the top. This structure holds the information generic to every object (the const void pointer &lt;span style="font-weight: bold;"&gt;class&lt;/span&gt; points to the &lt;span style="font-weight: bold;"&gt;Class&lt;/span&gt; structure for this object, this pointing is accomplished by the &lt;span&gt;new&lt;/span&gt; function) and it may also hold some variables. Then we have the variables declared with static storage type (this is done to get the effect of private variables in classes in object-oriented languages, same can be done for functions). Next come definitions for the constructor, destructor, clone and differ functions for the stack. Finally we make an instance of the &lt;span style="font-weight: bold;"&gt;Class&lt;/span&gt; structure, &lt;span style="font-weight: bold;"&gt;_Stack&lt;/span&gt;, and then make the our pointer &lt;span style="font-weight: bold;"&gt;Stack&lt;/span&gt; from &lt;span&gt;stack.h&lt;/span&gt; file to point to it. Later, &lt;span&gt;new&lt;/span&gt; will use&lt;span&gt; &lt;/span&gt;the pointer &lt;span style="font-weight: bold;"&gt;Stack&lt;/span&gt; to carry out complete initialization as I described earlier. The file ends with definitions for &lt;span&gt;push&lt;/span&gt; and &lt;span&gt;pop&lt;/span&gt; functions.&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-422173936810363119?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/422173936810363119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=422173936810363119' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/422173936810363119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/422173936810363119'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2007/11/object-oriented-programming-in-c-proof_21.html' title='Object Oriented Programming in C - Proof of Concept (Part 2)'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-8385579497511892659</id><published>2007-11-19T08:11:00.000+05:30</published><updated>2007-11-28T14:25:46.960+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>Object Oriented Programming in C - Proof of Concept</title><content type='html'>&lt;div  style="text-align: justify;font-family:times new roman;"&gt;&lt;span style="font-size:130%;"&gt;Hi,&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;I believe that the title of this post will come as a surprise to quite a few people in India (I don't know what is the situation outside). The major reason being that probably none of the books in the market on C programming, reveals that this is possible. Now, most people follow the textbooks and rarely try to question what the author is trying to teach them. If the author castigates C for something and praises C++/Java (your OO supporting language here), it is taken for granted, without ever questioning if what the book says is really correct (I mean things the authors say are problems with C or cannot be done in C).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;What I want to say is that there are a lot of biased programming texts in the market which do not the convey the true picture. C is their favourite scapegoat when they teach (?) object-oriented programming. Object-Oriented programming at its core is nothing more than a set of best practices, it is not a silver bullet. Any language that supports OO well is called object-oriented, C does not support it very well hence it is not called so. That does not mean you can't do it, it only requires true skill and solid knowledge of the concepts.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;Now we will see how to construct the equivalent of &lt;span&gt;class&lt;/span&gt; in C. Since class is the thing from where distinction starts between C and OO languages, this should be a convincing proof of concept. Let's put down the main (or you might say basic) features of the &lt;span&gt;class&lt;/span&gt; construct and try to get the equivalent in C.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul  style="text-align: justify;font-family:times new roman;"&gt;&lt;li&gt;&lt;span style="font-size:130%;"&gt;A class contains variables (state) and methods/member functions that operate on the state.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:130%;"&gt;A class provides you with data encapsulation so that only those methods that need to access the state of class and change it are allowed to do so.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:130%;"&gt;A class has constructor method(s) which allow for safe initialization.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:130%;"&gt;A class has a destructor that allows for reclamation of memory when it is not to be used again.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div  style="text-align: justify;font-family:times new roman;"&gt;&lt;span style="font-size:130%;"&gt;For the demo, let us take a simple class that represents a stack. The stack is being implemented using an array.&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;class Stack {&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;        char *symbols; // pointer to a character array containing the symbols (single chars) in the stack&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;        int top; // top of stack index&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;        int max_size; // maximum size&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;public:&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;        Stack(int size); // constructor&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;        ~Stack( ); // destructor&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;        void push(char symb);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;        char pop( );&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;};&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;Here's the C equivalent. However, I must first point out that much of the following has been taken from the ebook by Axel-Tobias Schreiner, &lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://www.planetpdf.com/codecuts/pdfs/ooc.pdf"&gt;ooc.pdf&lt;/a&gt;,&lt;/span&gt;&lt;span style="font-size:130%;"&gt; from where I learned this. There a couple of pages that point out an altenative and less frightening method to use object-oriented techniques in C. I will be listing them soon.&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;span&gt;Header File: new.h&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;/* methods for creating and destroying any object */&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;void *new (const void * type, ...);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;void delete (void * item);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;/* methods common to all objects */&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;void *clone (const void *self);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;int differ (const void *self, const void *other);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;size_t sizeOf (const void *self);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;span&gt;Header File: class.h&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;struct Class {&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;           size_t size;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;           void * (* ctor) (void * self, va_list * app);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;           void * (* dtor) (void * self);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;           void * (* clone) (const void * self);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;           int (* differ) (const void * self, const void * b);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;};&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;span&gt;Header File: stack.h&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;extern const void *Stack; /* the ADT representation for Stack */&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;void push (void *, char);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt; char pop (void *);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; &lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;span&gt;Implementation of Stack: stack.c&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;#include "class.h"&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;#include "stack.h"&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;struct Stack {&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;          const void *class; /* this should be the first member of the structure always */&lt;br /&gt;/* can put data that is publicly accessible here */&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;span style="font-size:130%;"&gt;};&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;/* Data Encapsulation provided by giving the following variables internal linkage in this file,&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;    only functions in this file can access and modify these variables directly */&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;static char *symbols;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;static int top;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;static int max_size;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;static void *Stack_ctor (void *_self, int size) { ... } /* the constructor function */&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;static void *Stack_dtor (void *_self) { ... } &lt;/span&gt;&lt;span style="font-size:130%;"&gt;/* the destructor function */&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;static void *Stack_clone (const void *_self) { ... } &lt;/span&gt;&lt;span style="font-size:130%;"&gt;/* this function completely copies one object to other */&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;static void *Stack_differ (const void *_self, const void *other) { ... } &lt;/span&gt;&lt;span style="font-size:130%;"&gt;/* this function can check if two objects are the same */&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;/* initialize the generic Class structure with function pointers specific to the object */&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;static const struct Class _Stack = {&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;         sizeof(struct Stack),&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;         Stack_ctor,&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;         Stack_dtor,&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;         Stack_clone,&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;         Stack_differ&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;};&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;const void *Stack = &amp;amp;( _Stack );&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;void push (&lt;/span&gt;&lt;span style="font-size:130%;"&gt;struct Stack *, &lt;/span&gt;&lt;span style="font-size:130%;"&gt;char symb) { ... }&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;char pop (struct Stack *) { ... }&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;span&gt;User Code&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;#include "stack.h"&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;#include "new.h"&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;int main (void)&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;{&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;     void *mystack = new (Stack, 20);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;     char popsymb;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;     push (mystack, 'X');&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;     popsymb = pop (mystack);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;     delete(mystack);&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;     return 0;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;}&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;To keep it easier, I have divided this topic into more than one posts. The explanation of above C code comes in the next part of this topic.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-8385579497511892659?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/8385579497511892659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=8385579497511892659' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/8385579497511892659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/8385579497511892659'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2007/11/object-oriented-programming-in-c-proof.html' title='Object Oriented Programming in C - Proof of Concept'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-6495130705718148137</id><published>2007-11-18T20:04:00.000+05:30</published><updated>2007-11-19T00:18:47.598+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Game Theory'/><category scheme='http://www.blogger.com/atom/ns#' term='The Beautiful Mathematics'/><title type='text'>The Question of Which Tire &amp; Focal Point Strategy</title><content type='html'>&lt;div  style="text-align: justify;font-family:times new roman;"&gt;&lt;span style="font-size:130%;"&gt;        There's a mail that has been circulated a lot in student groups as well as among people in software companies (as I came to witness during my software job).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;        This is about two friends who had a very good preparation for Chemistry (whatever) final for the semester. However, they had a party on weekend to attend and they decided to go for it. The party went really well and they missed to reach for the final on time. So, they concocted a story about their car tire being punctured and presented it to the professor as the reason why they were unable to reach on time. They asked for a makeup final and the professor agreed. When the final came, they were made to sit in different rooms and had two questions in the paper. First one was quite easy, 10 marks scored and they thought it was going to be cool when they turned the paper and found the second question, "Which tire ?".&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;          Now this incident is claimed to be real and that it took place in IIT-Bombay. However, I doubt that this is true since I have been reading Game Theory (you must have heard this name if you have watched the movie, A Beautiful Mind) from a very nice book (Games of Strategy - Avinash Dixit, Susan Skeath) and there I found this to be a Duke University incident. Anyways, that's not the interesting stuff. What makes this thing interesting is that it presents an example of what are called focal point strategies.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;          In fact, there is one more strategic lesson from this story. That is, to recognize that professor is an intelligent (rational, in  game theory jargon) player in this game. The students failed to take into account that professor may suspect their story to be fake, and that he may come up with such a question (whether in the final or maybe before it).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;          Now, coming back to the focal point strategies. The probability that both the friends picked up the same tire is easy to calculate and it is 1/4 or 25% (4 times 1/4 times 1/4). So they need to come up with some reasoning besides pure luck. Say, you are one of the students and you have some reasons to believe that the front right tire is most likely for puncture (pointed objects are more likely to be on side of the road, the trip had right turns mostly or anything you can come up with). What makes your choice good is not the reasons which you have thought of but, whether your friend has also made the same choice. So you need to consider whether your friend would think the same way (and pick the same choice as yours) and, that he thinks that you will also think the same way that he thinks that you think ... and so on. A chain of reasoning, and it needs to converge for the outcome to be in your favour (and your friend's). Hence, the name focal point. So to quote from the book, "what is needed is a convergence of expectations about what should be chosen in such circumstances. Such a commonly expected strategy on which players can successfully coordinate is called a focal point."&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;          There is obviously more than this to focal points but, for starters it is quite a good example. I will be putting some more as I keep learning from the book.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-6495130705718148137?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/6495130705718148137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=6495130705718148137' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/6495130705718148137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/6495130705718148137'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2007/11/question-of-which-tire-focal-point.html' title='The Question of Which Tire &amp; Focal Point Strategy'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5901677483010489671.post-3859179549856417086</id><published>2007-11-17T11:05:00.000+05:30</published><updated>2007-11-23T13:34:27.015+05:30</updated><title type='text'>The First Post</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;Hi,&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;    This is my first post now. I don't know how many people will read what I will be posting here from now onwards. However, it's going to start with my friends ;) ... most probably.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;I aim to put in here mostly Computer Science and Mathematics stuff but it's not going to be too geeky from the start. The reason being that I am a student currently and I really don't have the time and energy to put in the "hardcore" geeky stuff, as I would be better using my time working on those things. So what do I put in here and why ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;Well, after some years of studying programming (and CS), being in a software job for a while, I realized that many people (whom I encountered) who program/code still have a lot of misconceptions, that I myself had some time back . So, there will be some programming and design stuff, things that I have learned (and tested) from the programming gurus.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;    I have a major interest in cryptography and computer security right from the college days. As a result I have spent time on the Internet and waded through books in an attempt to be a "hacker" (No, I'm not going to hack someone, it's just the desire to learn the craft and it takes some time to become a real hacker). Hence, I feel that I can share my experience with students and people who want to get into this area but have no idea of how to start learning these things.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;    Finally (Sorry, I took so much time of yours), I intend to put in here some Maths stuff. Please don't feel uneasy as there won't be abstruse equations all over the place. I have observed that people in India generally have a disregard for this beautiful subject (which is in fact at the base of all modern science and technology). So, in a humble effort, I intend to show some examples of how beautiful Mathematics is. I hope some people will catch up with some Maths as a result of this blog :)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:times new roman;font-size:130%;"  &gt;    Thanks a lot for reading up to this point :D ... Abhinav.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5901677483010489671-3859179549856417086?l=towardsthebeginnersmind.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://towardsthebeginnersmind.blogspot.com/feeds/3859179549856417086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5901677483010489671&amp;postID=3859179549856417086' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/3859179549856417086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5901677483010489671/posts/default/3859179549856417086'/><link rel='alternate' type='text/html' href='http://towardsthebeginnersmind.blogspot.com/2007/11/first-post.html' title='The First Post'/><author><name>Abhinav Tripathi</name><uri>http://www.blogger.com/profile/13731604750245051105</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
