June 25, 2008

Programming Sutras aka Selections from Epigrams on Programming by Alan Perlis

Category: Software development — by Amit D. Chaudhary @ 9:46 pm

Epigrams on Programming by Alan Perlis are one liners on programming and Sutras mean thought threads, it is appropriate to call them Programming Sutras. The link to complete Epigrams on Programming by Alan Perlis and here are a selected few:

10. Get into a rut early: Do the same processes the same way. Accumulate idioms. Standardize. The only difference (!) between Shakespeare and you was the size of his idiom list - not the size of his vocabulary.

12. Recursion is the root of computation since it trades description for time.

15. Everything should be built top-down, except the first time.

19. A language that doesn’t affect the way you think about programming, is not worth knowing.

31. Simplicity does not precede complexity, but follows it.

43. In software systems it is often the early bird that makes the worm.

100. We will never run out of things to program as long as there is a single program around.
And immediately I made my peace with the fact that my career field is here to stay.

117. It goes against the grain of modern education to teach children to program. What fun is there in making plans, acquiring discipline in organizing thoughts, devoting attention to detail and learning to be self-critical?

• • •

March 10, 2008

Top Programming Languages

Category: Work, Software development — by Amit D. Chaudhary @ 6:47 pm

Top Programming Languages as per O’Reilly book sales


U N I T S T I T L E S M A R K E T S H A R E
Language 2006
Units
2007
Units
2006
Titles
2007
Titles
06Mkt
Share
07Mkt
Share
java 281,502 241,628 326 306 16% 14%
c# 195,291 232,102 170 179 11% 13%
php 194,722 158,538 95 103 11% 9%
javascript 185,031 203,225 82 117 10% 11%
c/c++ 180,713 167,344 245 238 10% 9%
.net languages 105,872 107,077 96 88 6% 6%
visual basic 147,710 99,964 152 127 8% 6%
ruby 67,664 95,731 17 40 4% 5%
sql 92,981 89,289 71 82 5% 5%
actionscript 66,568 85,971 33 41 4% 5%
vba 78,565 67,097 53 61 4% 4%
python 38,609 46,028 33 41 2% 3%
perl 50,483 37,984 50 43 2% 3%
transact sql 17,756 21,341 17 16 1% 1%
vbscript 22,976 18,167 17 16 1% 1%
powershell 1,377 13,961 1 9 0% 1%
shell script 14,466 11,479 13 12 1% 1%

Green are growing market share, Bold are of interest to me.
It is fair to point out, this is just one publisher, book sales are more forward looking, it is what those in the software development field are learning and they do not cover topics learnt using online resources.

Top Programming Languages as per TIOBE Programming Community index

The TIOBE Programming Community index gives an indication of the popularity of programming languages. The ratings are based on the number of skilled engineers world-wide, courses and third party vendors. The popular search engines Google, MSN, Yahoo!, and YouTube are used to calculate the ratings.

Position
Mar 2008
Position
Mar 2007
Delta in Position Programming Language Ratings
Mar 2008
Delta
Mar 2007
1 1 = Java 20.651% +2.61%
2 2 = C 15.593% -0.04%
3 5 ++ Visual Basic 10.795% +2.65%
4 4 = PHP 10.138% +0.68%
5 3 C++ 9.776% -1.33%
6 6 = Perl 5.781% -0.64%
7 7 = Python 4.593% +0.70%
8 9 + C# 4.143% +0.78%
9 12 ++++ Delphi 2.697% +0.94%
10 10 = Ruby 2.661% -0.11%
11 8 JavaScript 2.462% -1.02%

Green are growing market share, Bold are of interest to me.


• • •

October 2, 2007

How do you show dismay about your CEO & Company

Category: Work, Technology, Software development, Internet — by Amit D. Chaudhary @ 10:18 pm

You can callout your CEO’s latest viewpoint as ancient or extinct.

Do not know, if it is Hubris, plain Frustration or Refusal to take something so off lying down, Dare in Dinosaur Country redux shows Chutzpah (as per Wikipedia, the quality of audacity, for good or for bad) abd points out Microsoft, his employer to be in Dinosaur country, with the Microsoft CEO, Steve Ballmer saying in an interview

We need to change our capabilities so that we are not just good at writing bits that you put out on CD and deliver, but rather writing this thing that is a living, breathing, dynamic, organic thing.”

If enough people like Dare keep prodding the Giant, it might even wake up. Though, the reality is, it makes a lot of money from the Software on those CDs and pre-installed systems.

• • •

July 26, 2007

Math: For Programmers and in Everyday Life

Category: Software development, Personal development — by Amit D. Chaudhary @ 7:07 am

I knew the Math basics needed for choosing algorithms when programming, this is the simple stuff, mostly Big-O notation and comparision of O(N logN), O(N), O(N*N), etc. Two events in late 2006, early 2007 gave Maths more prominence for me.

One was reading the convincing argument by Steve Yegge I consider to be Uberdev.
Steve Yegge’s Math Every Day, Written in November 15th, 2004 when he was at Amazon.com

I just read a book called John von Neumann and the Origins of Modern Computing. Every few years I read a book that causes a discontinuity in my thinking — a step function that’s a lot larger than the little insights that most books or articles produce. For me, this was one of them.

Math is a funny thing; it’s not the way most people think of it — it’s an ever-expanding set of tools for modeling and solving problems. It’s very much driven by practical considerations; if a new problem comes up, and it’s not tractable to existing mathematical methods, then you work to make up new ones.

My new motto is “Math every day.” I’m giving myself one year to master all the math I was supposed to have learned in high school and college: algebra, geometry, trigonometry, limits and conic sections, differential calculus, integral calculus, multivariate calculus, simple differential equations, linear algebra and eigenvectors/eigenvalues, discrete math and logic, probability and statistics. I “knew” it all at one time or another, without really understanding what the heck it was for, so I should be able to put it all together again fairly quickly, if I put my mind to it.

Although I have not yet taken it to his level, I started keeping an open eye and learning approach to any Math I encounter.

Second was Google interviewers asking Math (Probability puzzles among others), See the birthday wager question at Shmula’s Google interview article. I have since realized that Discrete Mathematics is a prerequisite for some fields such as Data Mining and Machine Learning which matter for Internet companies such as Google, MSN, Yahoo & Amazon.

Interestingly, soon I started noticing more math in my day to day life, typical it tends to be Combinatorics (Permutation & Combination) and Probability. Here are a few actual life examples from the last 6-9 months:

  • Dilemma of the Garage door repairman

Our Garage door stopped working (would not open or close), so we get the Garage door repairman. He installs a new opener, but forgets the combination. He says their are millions of combinations and he will never get it even if it tried.

He shows it to me and if you look inside the Garage door opener (which one typically uses from their car), there are nine pins with each having two positions. Soon enough, it clicked to me, it maps neatly to a 9-bit integer value. The total possible values is 512 (2^9) which though a lot, is much less than millions.

  • A Bet against real estate median price rise

I rarely bet, but earlier in 2007 I took a bet against Seattle area (King County SFH, Single Family Home, to be precise) rising more than a certain percentage (one percent) in year 2007. I am now on track to probably lose this bet.

It seems logical during that time including the fact that real estate sales were falling and so on. So what happened? Primarily, I was just wrong in my understanding of the issues. However, also affecting it was the fact that the weightage changed. Median as you probably know implies half of the quantity is above that number and half are below. In recent months, sales for lower priced cities in King County have been dropped as a percentage of the county. This skews the balance, making it a much higher probability bet, now most cities SFH would now need to drop.

  • A Bet against India not winning the Cricket World Cup

Later on, a friend of mine to bet that India (the country where I was born and whose Cricket team I sometime follow) will win the Cricket World Cup. The weightage in this bet was the capability of the team, however the Indian Cricket team unlike, say the Australian is not head and shoulders over the rest. So with a no weightage scenario, this was a one team out of sixteen making it, I was getting 1:1 odds for a probability event of 15/16. I took it. And won. A good resource on making sense of odds: Figuring the Odds, Probability Puzzles.

  • How many confirmation numbers can Southwest airlines really give out

I noticed that all Southwest airline tickets are uniquely identified by a confirmation number which has six characters and contains numbers and alphabets. An example is CZ6H55. I was wondering how big is this space or rather how many confirmation numbers can Southwest airlines really give out, considering it is one of bigger domestic airline?

This is a case of permutations (changing positions of same numbers results in different confirmation numbers), each position can have 36 (26 alphabets + 10 digits) values and repetitions are allowed (DDDDDD should be valid.) The formula for this is 36 * 36 *…6 times = approx 2 billion.

The result of math behind finding people with same birthday (See below) still surprises me as does the infinite monkey theorem states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type or create a particular chosen text, such as the complete works of William Shakespeare. Interestingly, as the wikipedia entry says. The probability of a monkey typing a given string of text as long as, say, Hamlet is so infinitesimally tiny that, were the experiment conducted, the chance of it actually occurring during a span of time of the order of the age of the universe is minuscule but not zero.

If you are interested in the probability question that Shmula was asked at Google and the response, my take is below:

Question:

you are at a party with a friend and 10 people are present including you and the friend. your friend makes you a wager that for every person you find that has the same birthday as you, you get $1; for every person he finds that does not have the same birthday as you, he gets $2. would you accept the wager?

My answer with explaination:

One way to look at it, for me to make money, out of 8 people, 6 or more would need to have birthday on same day as me, and 2 would need to be different.
or it is giving me odds of 2-to-1 (Odds =, if T is total, t1-to-t2, here t1+t2 = T, see dice case below for example)

Using above logical possibility #2
The odds that six people have their birthday on same date as me is
=1 - (364/365 * 364/365 * 364/365 * 364/365 * 364/365 * 364/365 )

=1 - (0.99726027 *0.99726027 *0.99726027 *0.99726027 *0.99726027 *0.99726027 *)

=1-(0.98367382)

=0.01632618

The odds seem to be 1 in 100 that I will make money with the above deal. So, I would not accept the wager if making money on it was my intention.

A variation, the chance that 1 person out of 25 in a party shares his\her birthday with me is (See details below)

~= 0.50

and out of 50, it is almost a surety

~= 0.97

For the probability background for above problem, I would suggest reading: Math Forum, Ask Dr. Math: Probability When to Add, When to Multiply?

And on a lighter note, here is a new way to learn maths, New Math (Tom Lehrer) Animation

• • •

March 9, 2007

Thoughts on learning Java

Category: Software development — by Amit D. Chaudhary @ 3:19 pm

Java is the defacto language of web development. A friend who is a programmer is learning Java at the same time as I am.

My suggestion, use the quite through Java tutorials by Sun which are better than any Beginner or Intermediate book including the nicely written, but too much time consuming Head First Java. I would recommend the later to someone starting programming or willing to trade “speed” over “having fun” while learning and you can only have one.

As Mr. Linderman said in the Heroes Episode Parasite: You can either have a life of happiness or a life of meaning, not both.

• • •

March 8, 2007

Product design methods from IDEO for Entrepreneurs, Engineers and Product Managers

Category: Work, Software development, Entrepreneur, Personal development — by Amit D. Chaudhary @ 4:31 pm

Product design methods from IDEO for Entrepreneurs, Engineers and Product Managers.

IDEO Method Cards which are available for $49 and allow product designers to use various angles (Learn, Look, Ask, and Try) and methods related to the same to help in brain storming,  gather more information, better design products and in general empathize better with the potential users. These can be useful for anyone creating or designing something including in Technology: Entrepreneurs, Engineers and Product Managers.
FastCompany has an article on using IDEO Method Cards for fictional product ideas: Out of the Box

For more on IDEO and it’s methods, consider the book:

Amazon.com link: The Art of Innovation: Lessons in Creativity from IDEO, America's Leading Design FirmThe Art of Innovation: Lessons in Creativity from IDEO, America’s Leading Design Firm

The book’s official page: The Art of Innovation

• • •

March 6, 2007

Learning Ruby and Ruby on Rails: Part 3

Category: Software development — by Amit D. Chaudhary @ 5:12 pm

The final step in learning Ruby and Rails I would suggest is on the same lines I have started. Go long. Go deep.

  • Learn Ruby

Use the following resources:

This is a quirky online mini book on Ruby with a fictional story and cartoons running with the guide and I cannot recommend it enough. A detailed review by me is in another blog post.

This is the complete first edition of ‘The’ Ruby book also called the PickAxe book which is available online. The second edition is available for purchase as a pdf from the publisher, paper book is cheaper at amazon.com.

  • Learn Rails
  • Agile Web Development with Rails, Second Edition

‘The’ book for Ruby, written by the Dave Thomas and buy a pdf edition from the publisher, paper book is cheaper at amazon.com

Then go ahead and write that killer web service.

• • •

March 5, 2007

What a way to learn! or notes on Why’s (Poignant) Guide to Ruby by Why the Lucky Stiff

Category: Software development — by Amit D. Chaudhary @ 9:33 pm

I recently read Why’s (Poignant) Guide to Ruby by Why the Lucky Stiff in my quest to learn Ruby and Rails.

These are some notes or a mini review , if you are planning to learn Ruby.

Why’s Guide is a quirky online mini book on Ruby with a fictional story and cartoons running with the guide and I cannot recommend it enough. You will have fun and some laughter along the way, as a matter of fact, learning rarely felt this good.

However I should warn as the chapters progress and the serial killer appears, the guide spawns multiple genres from Comedy to Black Comedy to Macabre Thrillers. The characters include among others the foxes, the elf and the ham and the serial killer and space traveler Dr. Cham. Also, I did find myself skipping some sections when I felt a need for urgency to get to the Ruby part of the chapter.

On the technical aspect, the guide covers basic syntax, objects, builtin data structures, file IO, user input, developer tools such as the interactive ruby (irb) and ruby man pages (ri) and advanced ruby features like ‘method missing’, modules and mixin, inspect, etc.

Here are some cartoons and snippets from Why’s Guide to Ruby to give you an idea:

Why's (Poignant) Guide to Ruby Cartoon Foxes: InfomercialBrain health.

Vitamin R. Goes straight to the head. Ruby will teach you to express your ideas through a computer. You will be writing stories for a machine. The language will become a tool for you to better connect your mind to the world.

We start off the book by getting along well in the Introduction. This togetherness, this synergy, propels us through the book, with me guiding you on your way.

So you’ve got to know that synergy doesn’t actually mean synergy in this book. I can’t do normal synergy. No, in this book, synergy means cartoon foxes. What I’m saying is: this book will be starting off with an exorbitant amount of cartoon foxes.

And I will be counting on you to turn them into synergy

I’m proud of you. Anyone will tell you how much I brag about you. How I go on and on about this great anonymous person out there who scrolls and reads and scrolls and reads. “These kids,” I tell them. “Man, these kids got heart. I never…”

And my heart glows bright red under my filmy, translucent skin and they have to administer 10cc of JavaScript to get me to come back. (I respond well to toxins in the blood.) Man, that stuff will kick the peaches right out your gills!

Why's (Poignant) Guide to Ruby Cartoon Foxes: Burnout

• • •

February 20, 2007

Learning Ruby and Ruby on Rails: Part 2

Category: Software development — by Amit D. Chaudhary @ 9:51 am

2. Now explore a little bit of Rails

Follow the following tutorial and complementary article. Implement the code if you feel upto it

This is one of the better tutorial I came across, it lets you use the web server which comes with Rails, the format is slides and creates an actual example. Again, should take 1-2 hours to finish to enough

She covers why the above works, MVC, some ruby and active record.

After the above, my inclination is to dig in deeper into Ruby to get better idea. And then to use a book to get deeper into Rails. Your other option is to use the additional tutorials to dig in deeper.
Additional tutorials for Rails

List of tutorials for Rails

• • •

February 19, 2007

Learning Ruby and Ruby on Rails: Part 1

Category: Software development — by Amit D. Chaudhary @ 2:15 pm

Be aware there is a lot of information on Ruby and Ruby on Rails (RoR) in form of articles, tutorials, books, blogs, screencasts, etc.

Ideal approach might be to not over prepare, just dip in and see if it is worth exploring further.

1. Start with a little bit of Ruby

Rails is implemented in and uses the programming language Ruby. Use the articles below to an idea about Ruby and write some code.

Comes with eight guided chapters, should take 1-2 hours to finish to enough. One has to write the code to proceed to next steps in each chapter

Tips:

-Type in exactly as prompted to move to next step and use the up arrow to save some typing

-Use help 2 to start at end of chapter 2.

-Typing ‘reset’ exits from the extended prompt (..), ‘back’ takes to previous page of the tutorial and
‘end’ closes the current file or block.

He covers language features, compares to Java and gets you considering Ruby as a scripting language replacement for Perl, etc.

If you do need all the links I found to be able to decide which articles to read first, email me a note or add a comment and I will put them together.

• • •
Next Page »
Powered by: WordPress Theme based on Sharepoint like theme from: ADMIN-BG