18th Apr 2010

A Learning Project

Binil and I have decided to study Computer Systems: A Programmer’s Perspective together. We are going to use the first edition because we both already own that and the 2nd edition is damn costly. Binil is in California and I am in Washington, so it is going to be a long distance combined study. We imagine this would take up the rest of this year, and even then it will be a challenging task (because we intend to do the exercises as well).

One of the challenge would be to maintain the interest in the project. I usually lose interest in any book after reading about 100 pages or so and this book is a little over 900 pages. We have decided that one should help the other maintain the momentum, motivation and interest. Another challenge is that (as I mentioned earlier) we are not in the same location. We decided we would communicate through email during the weekdays and have a telecon on the weekends. We should be able to fine tune the process as we go along. We also expect other challenges to show up as we go along but failing halfway would be better than not doing it at all (this pearl of wisdom may not apply to everything, so reader discretion advised).

For the first week, starting today, we will attempt to read the first chapter (there are no exercises in the first chapter).

P.S. One of the reasons for making this blog post is that making our commitments public will give us more motivation and inspiration to complete it or at least stick with it for a longer period than otherwise.

Posted by Posted by pc under Filed under Learning Project, Personal Comments 4 Comments »

16th Apr 2010

Slow down or pay up

As I was driving to office today I noticed a message on the freeway warning board – “Slow down or pay up”. I find these warnings tasteless. The tone is offensive, just like the more frequently seen “Click It or Ticket”. That tone might works for kids but with adults I can imagine the response to such warnings to be “Fuck You”. In my opinion something more appropriate would “Please slow down for your own safety” or “Please slow down for the sake of everybody”.

P.S. I am not against keeping the speed within limits on the road, I am just saying that the message should be friendly. I could be wrong in my assessment because the “Click It or Ticket” is America’s most successful seat belt enforcement campaign creating a seat belt usage of 83%. On an unrelated note, 58.7% of statistics are made up on the spot.

Posted by Posted by pc under Filed under Rant Comments No Comments »

07th Apr 2010

Starbucks Economics

I am not a big Starbucks fan but today afternoon I was a little bored and I thought I would go for a walk and have a coffee at Starbucks on the way. I had a Chai Tea Latte and including the tip the total came around to $4. I found it a little bit difficult to digest that a cup of tea can cost so much and that quite a lot of people doesn’t seem to mind. From where I come from (India), $4 will buy you about 40 cups of tea (yeah, I know it is not a fair comparison).

Starbucks is not the only place where I find that people are overpaying without complaint. Just drive by any wealthy neighborhood and we find shops and boutiques waiting for their wealthy preys. When I find myself in such circumstances (i.e. goods being sold at a price seemingly more than what it deserves) I usually get a little stressed and angry at the system – “Let us boycott this and teach them a lesson”. But when I thought more about it today (sitting at Starbucks and drinking their latte) I think I was being totally stupid. Nobody should lose any sleep over this.  Such a system can thrive only when a reasonable number of people are willing to buy from them. Otherwise they will have to close down. The simple fact that Starbucks is thriving means that many people think that the coffee (and the environment) is worth the price. Why somebody would pay $4 for coffee is something that I might never understand but I felt a lot more comfortable, a lot more Zen, when it dawned on me that the system is self balancing. No war is required !

P.S. I hate it that Starbucks have a “Small” size but they never advertise it on their menu, I think it is a sleazy tactic.

Posted by Posted by pc under Filed under Money Matters, Personal, Rant Comments 2 Comments »

02nd Apr 2010

ClickOnce Installation for Multiple Users

An interesting question came up in one of the internal mailing lists at work about ClickOnce. The person who asked the question had the following scenario for his ClickOnce application.

The application runs in a call center. Assume there are 100 users and 100 computers. Any user can use any machine on a given day. Assuming everyone uses a different machine each day for 100 days then each day they will have to install the application on the machine they are using and by the 100th day each machine will have 100 installations of the app. Clearly not a desirable situation.

How do we go about solving this ?

The quick answer is that you cannot solve it using ClickOnce in a straightforward manner. The reason ? ClickOnce installations are always per user. It is by design and not a side effect or even a configurable option. When you install a ClickOnce application it goes into C:\Users\<User>\AppData\Local\Apps\2.0\<Blah>. Here <Blah> is a set of folders with names that doesn’t make much sense. For example, here is an actual example of the full path to a ClickOnce installation – C:\Users\<User>\AppData\Local\Apps\2.0\8Y7PD2RC.9VE\L1OL139M.4W2. These names would be different on different machines. This makes it very hard to find the location of the installation, so we cannot share the installation between users (assuming that other users have access to this folder). Other users would not get desktop shortcuts and Start->Programs shortcuts. Also AppData is a hidden folder which makes it even harder to find for non-technical users.

So what do we do ?

For the specific scenario here, ClickOnce does not fit the bill as the deployment strategy. MSI is a better choice. XCopy might also work depending on the application requirements.

Posted by Posted by pc under Filed under Technical Comments No Comments »

02nd Apr 2010

Raymond Smullyan Books

As I mentioned in my previous post, I made an impulse purchase of 7 books by Raymond Smullyan from Amazon. Six of them arrived today, the remaining one book is not published yet. Here is the list of books that came today:

The remaining book is Set Theory and the Continuum Problem.

Raymond Smullyan is a remarkable man. He is a magician, mathematician, logician, concert pianist, philosopher and world renowned author of over 20 books. Some Interesting Memories: A Paradoxical Life is his autobiography and there is a film about him called This Film Needs No Title created by documentary filmmaker Tao Ruspoli. Smullyan is 90 years old now and lives a “retired life” in the Catskill Mountains in NY.

If you haven’t read any books by Smullyan I recommend that you get a couple of them from the library and give it a try. I am sure you won’t regret it.

Posted by Posted by pc under Filed under Books Comments No Comments »

31st Mar 2010

The battle to lose Stuff

As I mentioned in a previous post, I am trying to minimize the “stuff” in my life. It was something that I have been wanting to do for a little while now, but the decision to go ahead with it came after reading The Power of Less , by Leo Babauta, the second time. The first time I read it, I found the concept attractive and in sync with my thoughts. But I got distracted and I forgot about it. I came across it after later while I was browsing the library and this time I decided to atleast give it a try. As the first step I gave away quite a few of my books. I also sold some on Amazon. It wasn’t much compared to what I had but still it was a good start. Then I gave away many clothes and shoes with I don’t use anymore. It felt good on two levels – the joy of giving as well as being able to get my foot in the door of a new way of living.

I am ashamed to say that I made a splash starting from last Friday. I bought 2 new books from Borders on Friday. I had a copy of one of them from the library but I still wanted to have my own copy. I rationalized that this was a book that requires multiple readings and that it was a very good book and worth owning. I am still not sure whether this a good move. The 2nd book was one that I really wanted to get but considering my current situation I don’t think I would be able to get to reading that book for the next 6 months. Maybe I should have waited to see whether I would actually get time to read it.

On Sunday we went to Seattle Premium Outlet Mall in Tulalip and I bought quite a few new clothes. The primary reason we went to the mall was to get a pair of sunglasses for Rija and maybe some new clothes for her. When we were done, I had bought more clothes than Rija and also a pair of shoes. I have lots of clothes, I didn’t need to buy any new clothes but I gave in to the shopper’s impulse and as a result I have increased my Stuff. I am not very proud of this incident.

On Monday I was browsing through Amazon (I should really stop browsing through Amazon) and I stumbled on Set Theory and Continuum Problem by Raymond Smullyan. I thought this would a good book to buy as I had read other books by Smullyan and I have great respect for him. Also Binil had convinced me that learning some maths is good for anybody. The book was not expensive so I didn’t give much thought about it and decided to go ahead and buy the book. While ordering the book, Amazon showed me other books by Smullyan and I fell for end. All said and done I ordered 7 books. 7 books ! I am not sure whether I would ever get to read them, but I had to order it. Some part of me just craved for the transient high of obtaining new Stuff.

To top all this, yesterday we went to Walmart to get some medicine for Rija and I ended up with 3 new shirts ! How bad am I ?

Actually the books that I bought are very good and it will surely be fun and beneficial if I ever read them. The clothes that I bought are good and I look forward to wearing them. But did I need these ? I don’t think so.  I could have bought the books when I have the time to read them and I could have bought the clothes when I have worn out my existing clothes or given them to the needy.

I have to be more aware of my thoughts, emotions and impulses. I should avoid the temptations if I can’t resist them. My first steps faltered, but I am not giving up. I am going to try my best to minimize the Stuff in my life, instead I am looking forward to experiencing more of life’s little pleasures such as spending more time with friends and family, going for walks, playing games, long drives with my wife, visiting places, etc. In general enjoying the experience of living rather than that of having.

Posted by Posted by pc under Filed under Minimalism, Personal Comments No Comments »

30th Mar 2010

The Checklist Manifesto – Book Review

This is a review for The Checklist Manifesto: How To Get Things Right (Hardcover) by Atul Gawande.

Dr.Atul Gawande is one amazing dude. Let us deviate for a moment to see what his biography on the book sleeve says:

Atul Gawande is the author of The Checklist Manifesto, Better and Complications. He is also a MacArthur Fellow, a general surgeon at the Brigham and Women’s Hospital in Boston, a staff writer for The New Yorker, and an assistant professor at Harvard Medical School and the Harvard School of Public Health, he also leads the World Health Organization’s Safe Surgery Saves Lives program.

How can one person do all that ? He must be The Dude.

I haven’t read Better and Complications but both books have good reviews on Amazon. However, The Checklist Manifesto falls short of expectations set by the author’s previous achievements. The reason for this is that the book’s message is really thin – checklists are good, they can even save lives. The book is full of anecdotes from the author’s life. It is fun to read those anecdotes but in the back of my mind I kept looking for the author’s insight into creating a good checklist or a sample of one he made or any other kind of advice. But the book just kept on making cases to prove that having a checklist is good and they work (especially in the context of medical profession).

One of the strength of the book is the excellent writing style of the author.

Tangentially this book is an eye opener regarding the working of the surgery room and emergency room in hospitals. Things could go wrong in hundreds of ways. Dr.Atul sums it up very well in his book with this:

we (medical care professionals) are as apt to harm as we are to heal

I also respect him in writing about a surgery he did when the patient almost died because of his “fault”. It requires great strength to admit one’s mistake.

Bottom line is that this book is worth reading for people in medical profession (although checklists could useful in a lot of other situations, this book is probably most useful for medical professionals). I would rate the book 3 out of 5 and would recommend reading Better and Complications.

Posted by Posted by pc under Filed under Book Review Comments No Comments »

29th Mar 2010

Advanced .NET Debugging – Book Review

This review is for: Advanced .NET Debugging (Paperback) by Mario Hewardt.

If you program for the .NET framework you need this book. It helps to take your debugging skills (as well as understanding of the platform) to the next level. How many times in the past have we tried to nail down a particularly tricky bug, and after hours (or days) of pulling at your hair, given up in despair and doubted our worth as a good programmer ? Well, if you have trodden down that path, then I am sure this book will help. I wish to warn you that this is not a book for a beginner nor for the faint-hearted. It will show you the tools, it will show you the way, but you will have to walk that path which begins by buying this book and reading it.

If you already have Advanced Windows Debugging by the same author and have read it, then you should be in good shape to tackle this one. But if you haven’t, fear not, you can still make it.

The book is soft-bound, neatly printed in about 500 pages and contains 10 chapters divided into 3 parts. It doesn’t weight much and can be easily carried around.

Part 1 consists of 3 chapters. In the first chapter the reader is an introduction to the tools. The 2nd chapter – CLR fundamentals – contrary to its name, is not a high level overview for the newbie. Instead it is a wealth of information for all .NET programmers. No matter how senior a programmer you are, I will bet that you will still learn something (probably a lot) from this chapter. The 3rd chapter – Basic Debugging Tasks – is a bit lengthy (I don’t mean that in a bad way) at about 100 pages, helps you get acquainted with the tools and commands.

Part 2 consists of 4 chapters – Assembly Loader, Managed Heap and Garbage Collection, Synchronization and Interoperability. As you might guess from the names, it is pretty advanced. It is hard, but you will emerge with a much better and clearer understanding of the platform. The chapter on interoperability might not be useful for everybody, but for those who have felt the pain of COM interop or PInvoke this chapter pays for the price of the book many times over.

Part 3 consists of the advanced-advanced topics. There is a chapter named Postmortem debugging which includes debugging problems when you have no access to the live machine and you cannot reproduce the problem locally. It consists of taking a dump file and analyzing it off-site. Not an everyday topic for most programmers, but you will surely be thankful for this chapter if you ever come across it. It also explains how the Windows error reporting works. The second last chapter is called PowerTools which includes discussion of PowerDbg which allows you to control native debuggers using powershell (how cool is that !). There is also information on Visual Studio integration with SOS and on CLR Profiler. The last chapter, a small one at about 15 pages, is on .NET 4.0 (based on Beta 1 release though).

The writing style is very clear and precise. There are plenty of samples and some good diagrams to help your understand the concepts better (i loved them, a picture is worth a thousand words). In short, this is book worth purchasing and worth reading and worth reading again (which is what I am going to do).

There is a support website for the book here.

Posted by Posted by pc under Filed under .NET, Book Review Comments No Comments »

27th Mar 2010

New Books

I got a 40% off coupon from Borders so I decided to indulge myself a bit. Unfortunately the coupon could not be used on Borders.com which meant I had only a limited choice that the stores offered. The Redmond store is a little better than other Borders stores I have been to, but still the choice of technical books is still very limited. When I get a 40% off coupon I usually try to get the higher priced books but most of the time they are not available in stores. They usually allow only one coupon per customer but it is not tracked in the system it so you can come back later when another store clerk is at the counter or even the next day (if the coupon is valid for the next day) or you can go to another store and use the same coupon (all customers get the same coupon). I took my wife with me and she has a Borders membership card too so I managed to get two books at 40% off:

The Art of Strategy: A Game Theorist’s Guide to Success in Business and Life

and

Metaprogramming Ruby

I have been reading The Art of Strategy from a copy I borrowed from library, but I loved the book so much that I thought I should have a copy of my own (I know, it goes against the philosophy of minimalism that I am trying to practice). I decided to buy the book anyway because it is a book that I will have to read multiple times. I believe it is a book worth buying. It is a book on Game Theory, a branch of applied maths, and is quite an interesting read. I have not completed reading it and when I do, I intend to post a review here. But I recommend you get a copy for yourself and start reading immediately. Borrow a copy from the library if you are not sure whether Game Theory will hold your interest.

I love Ruby. It is the programming language for programmers with aesthetic sense. The name couldn’t be more apt because you can write “beautiful code” in Ruby. But that is not Ruby’s only strength. One of the biggest selling point of Ruby is its Metaprogramming capabilities. I have played a little with Ruby and I have a few Ruby books on my shelf but I haven’t taken the effort to move my Ruby knowledge to the next level. Becoming a master in any programming language involves understanding its underlying philosophy and its strengths. Moreover it should be useful to learn metaprogramming concepts even though I may never get to program extensively in Ruby. The book has good reviews on Amazon and it looked very readable when I flipped through it in the book store. If I don’t find it very useful I can return it within 30 days – one of the best things about America :)

I have borrowed quite a few books from library recently and I think most of them are very good. More details and reviews of those books in a future post.

Posted by Posted by pc under Filed under Books, Personal Comments 2 Comments »

27th Mar 2010

Ladies and Gentlemen, this is *the* F# book !

Programming F# Front Cover

It has been a long time since I got excited about a programming book as much as I did with Programming F#. I have all the books on F# available in the market today. But I should say that this is the best book for learning F# if you have no experience with functional programming. I am not sure how this book would be for a person who is totally new to programming (chances are they would find this ahead of their curve). But for a person who has good experience with imperative programming this book would get you up and running with F# in specific and functional programming in general.

The book by Don Syme Expert F# (Expert’s Voice in .Net) (who invented F#) is also good but not as good as Programming F# for new functional programmers. But once you have read this book, Don Syme’s book might be a good follow up.

The strongest point of this book is the clarity with which concepts are explained and the choice of good examples to explain a concept. They are concise and to the point. It also made the book surprisingly small (at a little less than 400 pages). But no worries, everything that you need to get a firm footing in F# is in here.

This is truly a 5 star book. Highly recommended.

The table of contents:
Part I. Multiparadigm Programming

Chapter 1. Introduction to F#
Chapter 2. Fundamentals
Chapter 3. Functional Programming
Chapter 4. Imperative Programming
Chapter 5. Object-Oriented Programming
Chapter 6. .NET Programming
Chapter 7. Applied Functional Programming
Chapter 8. Applied Object-Oriented Programming

Part II. Programming F#

Chapter 9. Scripting
Chapter 10. Computation Expressions
Chapter 11. Asynchronous and Parallel Programming
Chapter 12. Reflection
Chapter 13. Quotations
Appendix A. Overview of .NET Libraries
Appendix B. F# Interop

Posted by Posted by pc under Filed under Book Review, F#, Technical Comments No Comments »