Posted by: sureshamrita | March 8, 2011

Nearest neighbour in C++

Using the min_element algorithm of the standard library, it is possible to write a nearest neighbor code as shown below.

using namespace std;
class NN{
  NN(int x):data(x){}
  bool operator()(int a, int b){
    return abs(a-data) < abs(b-data);
  int data;
using namespace std;
int main(){
vector<int> data(10);
for(int i = 0; i < 10; i++)data[i] = i;
NN n(4);
cout << *min_element(data.begin(),data.end(),n);
Posted by: sureshamrita | December 12, 2010

Simulation – some lessons

Recently I had to write a Recognition system simulator.  It was a medium sized code with around 4000 lines of C++. This is the first time I was writing a simulator and at the end of it, I felt I could have done it better.

Basically my code was monolithic. Just one executable at the end. I realized that this approach has the following difficulties:

  • When an error comes it is very difficult to know form which part of the code it came. We get an exception but which part of the code triggered the error in the first place?
  • We may later realize that some portion of the code is better written in another language, for example like matlab or python. But that would be impossible if we write a monolithic C++ code.

A simulation system has the following logical components:

  • The data generating unit.
  • Data processing unit.
  • Result display unit –  usually in the form of plots.

My experience is that each of these units should be written as different executables – in a language most suited to the job at hand. Finally all the binaries could be bundled by a shell script or python script.

It is also better that each of the above components output is stored in  a file. It may be a good idea to create filenames which  reflect the parameter values used for generating data. This approach has the advantage that it is easy to fix a bug. Ourself or a code segment can look at the output file and quickly find out if the file is in order.

I have more comment to add regarding presentation of the final result. When I first wrote the code, all the data processing was done using C++ and the plots were generated using gnuplot. But it is much easier to do some kind of data manipulation using matlab and also generate plots using matlab or excel. Such an approach is possible only if we make our code hybrid instead of monolithic.

I would like to acknowledge the inputs given by my lab mate, Dr Ninad Thakoor

Posted by: sureshamrita | October 23, 2010

Richard Hamming: You and your research

Transcription of the Bell Communications Research Colloquium Seminar
7 March 1986

J. F. Kaiser
Bell Communications Research
445 South Street
Morristown, NJ 07962−1910

At a seminar in the Bell Communications Research Colloquia Series, Dr. Richard W. Hamming, a Professor at the Naval Postgraduate School in Monterey, California and a retired Bell Labs scientist, gave a very interesting and stimulating talk, ‘You and Your Research’ to an overflow audience of some 200 Bellcore staff members and visitors at the Morris Research and Engineering Center on March 7, 1986. This talk centered on Hamming’s observations and research on the question ‘‘Why do so few scientists make significant contributions and so many are forgotten in the long run?’’ From his more than forty years of experience, thirty of which were at Bell Laboratories, he has made a number of direct observations, asked very pointed questions of scientists about what, how, and why they did things, studied the lives of great scientists and great contributions, and has done introspection and studied theories of creativity. The talk is about what he has learned in terms of the properties of the individual scientists, their abilities, traits, working habits, attitudes, and philosophy.

In order to make the information in the talk more widely available, the tape recording that was made of that talk was carefully transcribed. This transcription includes the discussions which followed in the question and answer period. As with any talk, the transcribed version suffers from translation as all the inflections of voice and the gestures of the speaker are lost; one must listen to the tape recording to recapture that part of the  presentation. While the recording of Richard Hamming’s talk was completely intelligible, that of some of the questioner’s remarks were not. Where the tape recording was not intelligible I have added in parentheses my impression of the questioner’s remarks. Where there was a question and I could identify the questioner, I have checked with each to ensure the accuracy of my interpretation of their remarks.


As a speaker in the Bell Communications Research Colloquium Series, Dr. Richard W. Hamming of the Naval Postgraduate School in Monterey, California, was introduced by Alan G. Chynoweth, Vice President, Applied Research, Bell Communications Research.

Alan G. Chynoweth: Greetings colleagues, and also to many of our former colleagues from Bell Labs who, I understand, are here to be with us today on what I regard as a particularly felicitous occasion. It gives me very great pleasure indeed to introduce to you my old friend and colleague from many many years back, Richard Hamming, or Dick Hamming as he has always been know to all of us.

Dick is one of the all time greats in the mathematics and computer science arenas, as I’m sure the audience here does not need reminding. He received his early education at the Universities of Chicago and Nebraska, and got his Ph.D. at Illinois; he then joined the Los Alamos project during the war. Afterwards, in 1946, he joined Bell Labs. And that is, of course, where I met Dick − when I joined Bell Labs in their physics research organization. In those days, we were in the habit of lunching together as a physics group, and for some reason this strange fellow from mathematics was always pleased to join us. We were always happy to have him with us because he brought so many unorthodox ideas and views. Those lunches were stimulating, I can assure you.

While our professional paths have not been very close over the years, nevertheless I’ve always recognized Dick in the halls of Bell Labs and have always had tremendous admiration for what he was doing. I think the record speaks for itself. It is too long to go through all the details, but let me point out, for example, that he has written seven books and of those seven books which tell of various areas of mathematics and computers and coding and information theory, three are already well into their second edition. That is testimony indeed to the prolific output and the stature of Dick Hamming.

I think I last met him − it must have been about ten years ago − at a rather curious little conference in Dublin, Ireland where we were both speakers. As always, he was tremendously entertaining. Just one more example of the provocative thoughts that he comes up with: I remember him saying, ‘‘There are wavelengths that people cannot see, there are sounds that people cannot hear, and maybe computers have thoughts that people cannot  think.’’ Well, with Dick Hamming around, we don’t need a computer. I think that we are in for an extremely entertaining talk.

THE TALK: ‘‘You and Your Research’’ by Dr. Richard W. Hamming

It’s a pleasure to be here. I doubt if I can live up to the Introduction. The title of my talk is, ‘‘You and Your Research.’’ It is not about managing research, it is about how you individually do your research. I could give a talk on the other subject − but it’s not, it’s about you. I’m not talking about ordinary run−of−the−mill research; I’m talking about great research. And for the sake of describing great research I’ll occasionally say Nobel−Prize type of work. It doesn’t have to gain the Nobel Prize, but I mean those kinds of things which we perceive are significant things. Relativity, if you want, Shannon’s information theory, any number of outstanding theories − that’s the kind of thing I’m talking about.

Now, how did I come to do this study? At Los Alamos I was brought in to run the computing machines which other people had got going, so those scientists and physicists could get back to business. I saw I was a stooge. I saw that although physically I was the same, they were different. And to put the thing bluntly, I was envious. I wanted to know why they were so different from me. I saw Feynman up close. I saw Fermi and Teller. I saw Oppenheimer. I saw Hans Bethe: he was my boss. I saw quite a few very capable people. I became very interested in the difference between those who do and those who might have done.

When I came to Bell Labs, I came into a very productive department. Bode was the department head at the time; Shannon was there, and there were other people. I continued examining the questions, “Why?” and “What is the difference?” I continued subsequently by reading biographies, autobiographies, asking people questions such as: “How did you come to do this?” I tried to find out what are the differences. And that’s what this talk is about.

Now, why is this talk important? I think it is important because, as far as I know, each of you has one life to live. Even if you believe in reincarnation it doesn’t do you any good from one life to the next! Why shouldn’t you do significant things in this one life, however you define significant? I’m not going to define it – you know what I mean. I will talk mainly about science because that is what I have studied. But so far as I know, and I’ve been told by others, much of what I say applies to many fields. Outstanding work is characterized very much the same way in most fields, but I will confine myself to science.

In order to get at you individually, I must talk in the first person. I have to get you to drop modesty and say to yourself, “Yes, I would like to do first-class work.” Our society frowns on people who set out to do really good work. You’re not supposed to; luck is supposed to descend on you and you do great things by chance. Well, that’s a kind of dumb thing to say. I say, why shouldn’t you set out to do something significant. You don’t have to tell other people, but shouldn’t you say to yourself, “Yes, I would like to do something significant.”

In order to get to the second stage, I have to drop modesty and talk in the first person about what I’ve seen, what I’ve done, and what I’ve heard. I’m going to talk about people, some of whom you know, and I trust that when we leave, you won’t quote me as saying some of the things I said.

Let me start not logically, but psychologically. I find that the major objection is that people think great science is done by luck. It’s all a matter of luck. Well, consider Einstein. Note how many different things he did that were good. Was it all luck? Wasn’t it a little too repetitive? Consider Shannon. He didn’t do just information theory. Several years before, he did some other good things and some which are still locked up in the security of cryptography. He did many good things.

You see again and again, that it is more than one thing from a good person. Once in a while a person does only one thing in his whole life, and we’ll talk about that later, but a lot of times there is repetition. I claim that luck will not cover everything. And I will cite Pasteur who said, “Luck favors the prepared mind.” And I think that says it the way I believe it. There is indeed an element of luck, and no, there isn’t. The prepared mind sooner or later finds something important and does it. So yes, it is luck. The particular thing you do is luck, but that you do something is not.

For example, when I came to Bell Labs, I shared an office for a while with Shannon. At the same time he was doing information theory, I was doing coding theory. It is suspicious that the two of us did it at the same place and at the same time – it was in the atmosphere. And you can say, “Yes, it was luck.” On the other hand you can say, “But why of all the people in Bell Labs then were those the two who did it?” Yes, it is partly luck, and partly it is the prepared mind; but `partly’ is the other thing I’m going to talk about. So, although I’ll come back several more times to luck, I want to dispose of this matter of luck as being the sole criterion whether you do great work or not. I claim you have some, but not total, control over it. And I will quote, finally, Newton on the matter. Newton said, “If others would think as hard as I did, then they would get similar results.”

One of the characteristics you see, and many people have it including great scientists, is that usually when they were young they had independent thoughts and had the courage to pursue them. For example, Einstein, somewhere around 12 or 14, asked himself the question, “What would a light wave look like if I went with the velocity of light to look at it?” Now he knew that electromagnetic theory says you cannot have a stationary local maximum. But if he moved along with the velocity of light, he would see a local maximum. He could see a contradiction at the age of 12, 14, or somewhere around there, that everything was not right and that the velocity of light had something peculiar. Is it luck that he finally created special relativity? Early on, he had laid down some of the pieces by thinking of the fragments. Now that’s the necessary but not sufficient condition. All of these items I will talk about are both luck and not luck.

How about having lots of `brains?’ It sounds good. Most of you in this room probably have more than enough brains to do first-class work. But great work is something else than mere brains. Brains are measured in various ways. In mathematics, theoretical physics, astrophysics, typically brains correlates to a great extent with the ability to manipulate symbols. And so the typical IQ test is apt to score them fairly high. On the other hand, in other fields it is something different. For example, Bill Pfann, the fellow who did zone melting, came into my office one day. He had this idea dimly in his mind about what he wanted and he had some equations. It was pretty clear to me that this man didn’t know much mathematics and he wasn’t really articulate. His problem seemed interesting so I took it home and did a little work. I finally showed him how to run computers so he could compute his own answers. I gave him the power to compute. He went ahead, with negligible recognition from his own department, but ultimately he has collected all the prizes in the field. Once he got well started, his shyness, his awkwardness, his inarticulateness, fell away and he became much more productive in many other ways. Certainly he became much more articulate.

And I can cite another person in the same way. I trust he isn’t in the audience, i.e. a fellow named Clogston. I met him when I was working on a problem with John Pierce’s group and I didn’t think he had much. I asked my friends who had been with him at school, “Was he like that in graduate school?” “Yes,” they replied. Well I would have fired the fellow, but J. R. Pierce was smart and kept him on. Clogston finally did the Clogston cable. After that there was a steady stream of good ideas. One success brought him confidence and courage.

One of the characteristics of successful scientists is having courage. Once you get your courage up and believe that you can do important problems, then you can. If you think you can’t, almost surely you are not going to. Courage is one of the things that Shannon had supremely. You have only to think of his major theorem. He wants to create a method of coding, but he doesn’t know what to do so he makes a random code. Then he is stuck. And then he asks the impossible question, “What would the average random code do?” He then proves that the average code is arbitrarily good, and that therefore there must be at least one good code. Who but a man of infinite courage could have dared to think those thoughts? That is the characteristic of great scientists; they have courage. They will go forward under incredible circumstances; they think and continue to think.

Age is another factor which the physicists particularly worry about. They always are saying that you have got to do it when you are young or you will never do it. Einstein did things very early, and all the quantum mechanic fellows were disgustingly young when they did their best work. Most mathematicians, theoretical physicists, and astrophysicists do what we consider their best work when they are young. It is not that they don’t do good work in their old age but what we value most is often what they did early. On the other hand, in music, politics and literature, often what we consider their best work was done late. I don’t know how whatever field you are in fits this scale, but age has some effect.

But let me say why age seems to have the effect it does. In the first place if you do some good work you will find yourself on all kinds of committees and unable to do any more work. You may find yourself as I saw Brattain when he got a Nobel Prize. The day the prize was announced we all assembled in Arnold Auditorium; all three winners got up and made speeches. The third one, Brattain, practically with tears in his eyes, said, “I know about this Nobel-Prize effect and I am not going to let it affect me; I am going to remain good old Walter Brattain.” Well I said to myself, “That is nice.” But in a few weeks I saw it was affecting him. Now he could only work on great problems.

When you are famous it is hard to work on small problems. This is what did Shannon in. After information theory, what do you do for an encore? The great scientists often make this error. They fail to continue to plant the little acorns from which the mighty oak trees grow. They try to get the big thing right off. And that isn’t the way things go. So that is another reason why you find that when you get early recognition it seems to sterilize you. In fact I will give you my favorite quotation of many years. The Institute for Advanced Study in Princeton, in my opinion, has ruined more good scientists than any institution has created, judged by what they did before they came and judged by what they did after. Not that they weren’t good afterwards, but they were superb before they got there and were only good afterwards.

This brings up the subject, out of order perhaps, of working conditions. What most people think are the best working conditions, are not. Very clearly they are not because people are often most productive when working conditions are bad. One of the better times of the Cambridge Physical Laboratories was when they had practically shacks – they did some of the best physics ever.

I give you a story from my own private life. Early on it became evident to me that Bell Laboratories was not going to give me the conventional acre of programming people to program computing machines in absolute binary. It was clear they weren’t going to. But that was the way everybody did it. I could go to the West Coast and get a job with the airplane companies without any trouble, but the exciting people were at Bell Labs and the fellows out there in the airplane companies were not. I thought for a long while about, “Did I want to go or not?” and I wondered how I could get the best of two possible worlds. I finally said to myself, “Hamming, you think the machines can do practically everything. Why can’t you make them write programs?” What appeared at first to me as a defect forced me into automatic programming very early. What appears to be a fault, often, by a change of viewpoint, turns out to be one of the greatest assets you can have. But you are not likely to think that when you first look the thing and say, “Gee, I’m never going to get enough programmers, so how can I ever do any great programming?”

And there are many other stories of the same kind; Grace Hopper has similar ones. I think that if you look carefully you will see that often the great scientists, by turning the problem around a bit, changed a defect to an asset. For example, many scientists when they found they couldn’t do a problem finally began to study why not. They then turned it around the other way and said, “But of course, this is what it is” and got an important result. So ideal working conditions are very strange. The ones you want aren’t always the best ones for you.

Now for the matter of drive. You observe that most great scientists have tremendous drive. I worked for ten years with John Tukey at Bell Labs. He had tremendous drive. One day about three or four years after I joined, I discovered that John Tukey was slightly younger than I was. John was a genius and I clearly was not. Well I went storming into Bode’s office and said, “How can anybody my age know as much as John Tukey does?” He leaned back in his chair, put his hands behind his head, grinned slightly, and said, “You would be surprised Hamming, how much you would know if you worked as hard as he did that many years.” I simply slunk out of the office!

What Bode was saying was this: “Knowledge and productivity are like compound interest.” Given two people of approximately the same ability and one person who works ten percent more than the other, the latter will more than twice outproduce the former. The more you know, the more you learn; the more you learn, the more you can do; the more you can do, the more the opportunity – it is very much like compound interest. I don’t want to give you a rate, but it is a very high rate. Given two people with exactly the same ability, the one person who manages day in and day out to get in one more hour of thinking will be tremendously more productive over a lifetime. I took Bode’s remark to heart; I spent a good deal more of my time for some years trying to work a bit harder and I found, in fact, I could get more work done. I don’t like to say it in front of my wife, but I did sort of neglect her sometimes; I needed to study. You have to neglect things if you intend to get what you want done. There’s no question about this.

On this matter of drive Edison says, “Genius is 99% perspiration and 1% inspiration.” He may have been exaggerating, but the idea is that solid work, steadily applied, gets you surprisingly far. The steady application of effort with a little bit more work, intelligently applied is what does it. That’s the trouble; drive, misapplied, doesn’t get you anywhere. I’ve often wondered why so many of my good friends at Bell Labs who worked as hard or harder than I did, didn’t have so much to show for it. The misapplication of effort is a very serious matter. Just hard work is not enough – it must be applied sensibly.

There’s another trait on the side which I want to talk about; that trait is ambiguity. It took me a while to discover its importance. Most people like to believe something is or is not true. Great scientists tolerate ambiguity very well. They believe the theory enough to go ahead; they doubt it enough to notice the errors and faults so they can step forward and create the new replacement theory. If you believe too much you’ll never notice the flaws; if you doubt too much you won’t get started. It requires a lovely balance. But most great scientists are well aware of why their theories are true and they are also well aware of some slight misfits which don’t quite fit and they don’t forget it. Darwin writes in his autobiography that he found it necessary to write down every piece of evidence which appeared to contradict his beliefs because otherwise they would disappear from his mind. When you find apparent flaws you’ve got to be sensitive and keep track of those things, and keep an eye out for how they can be explained or how the theory can be changed to fit them. Those are often the great contributions. Great contributions are rarely done by adding another decimal place. It comes down to an emotional commitment. Most great scientists are completely committed to their problem. Those who don’t become committed seldom produce outstanding, first-class work.

Now again, emotional commitment is not enough. It is a necessary condition apparently. And I think I can tell you the reason why. Everybody who has studied creativity is driven finally to saying, “creativity comes out of your subconscious.” Somehow, suddenly, there it is. It just appears. Well, we know very little about the subconscious; but one thing you are pretty well aware of is that your dreams also come out of your subconscious. And you’re aware your dreams are, to a fair extent, a reworking of the experiences of the day. If you are deeply immersed and committed to a topic, day after day after day, your subconscious has nothing to do but work on your problem. And so you wake up one morning, or on some afternoon, and there’s the answer. For those who don’t get committed to their current problem, the subconscious goofs off on other things and doesn’t produce the big result. So the way to manage yourself is that when you have a real important problem you don’t let anything else get the center of your attention – you keep your thoughts on the problem. Keep your subconscious starved so it has to work on your problem, so you can sleep peacefully and get the answer in the morning, free.

Now Alan Chynoweth mentioned that I used to eat at the physics table. I had been eating with the mathematicians and I found out that I already knew a fair amount of mathematics; in fact, I wasn’t learning much. The physics table was, as he said, an exciting place, but I think he exaggerated on how much I contributed. It was very interesting to listen to Shockley, Brattain, Bardeen, J. B. Johnson, Ken McKay and other people, and I was learning a lot. But unfortunately a Nobel Prize came, and a promotion came, and what was left was the dregs. Nobody wanted what was left. Well, there was no use eating with them!

Over on the other side of the dining hall was a chemistry table. I had worked with one of the fellows, Dave McCall; furthermore he was courting our secretary at the time. I went over and said, “Do you mind if I join you?” They can’t say no, so I started eating with them for a while. And I started asking, “What are the important problems of your field?” And after a week or so, “What important problems are you working on?” And after some more time I came in one day and said, “If what you are doing is not important, and if you don’t think it is going to lead to something important, why are you at Bell Labs working on it?” I wasn’t welcomed after that; I had to find somebody else to eat with! That was in the spring.

In the fall, Dave McCall stopped me in the hall and said, “Hamming, that remark of yours got underneath my skin. I thought about it all summer, i.e. what were the important problems in my field. I haven’t changed my research,” he says, “but I think it was well worthwhile.” And I said, “Thank you Dave,” and went on. I noticed a couple of months later he was made the head of the department. I noticed the other day he was a Member of the National Academy of Engineering. I noticed he has succeeded. I have never heard the names of any of the other fellows at that table mentioned in science and scientific circles. They were unable to ask themselves, “What are the important problems in my field?”

If you do not work on an important problem, it’s unlikely you’ll do important work. It’s perfectly obvious. Great scientists have thought through, in a careful way, a number of important problems in their field, and they keep an eye on wondering how to attack them. Let me warn you, `important problem’ must be phrased carefully. The three outstanding problems in physics, in a certain sense, were never worked on while I was at Bell Labs. By important I mean guaranteed a Nobel Prize and any sum of money you want to mention. We didn’t work on (1) time travel, (2) teleportation, and (3) antigravity. They are not important problems because we do not have an attack. It’s not the consequence that makes a problem important, it is that you have a reasonable attack. That is what makes a problem important. When I say that most scientists don’t work on important problems, I mean it in that sense. The average scientist, so far as I can make out, spends almost all his time working on problems which he believes will not be important and he also doesn’t believe that they will lead to important problems.

I spoke earlier about planting acorns so that oaks will grow. You can’t always know exactly where to be, but you can keep active in places where something might happen. And even if you believe that great science is a matter of luck, you can stand on a mountain top where lightning strikes; you don’t have to hide in the valley where you’re safe. But the average scientist does routine safe work almost all the time and so he (or she) doesn’t produce much. It’s that simple. If you want to do great work, you clearly must work on important problems, and you should have an idea.

Along those lines at some urging from John Tukey and others, I finally adopted what I called “Great Thoughts Time.” When I went to lunch Friday noon, I would only discuss great thoughts after that. By great thoughts I mean ones like: “What will be the role of computers in all of AT&T?”, “How will computers change science?” For example, I came up with the observation at that time that nine out of ten experiments were done in the lab and one in ten on the computer. I made a remark to the vice presidents one time, that it would be reversed, i.e. nine out of ten experiments would be done on the computer and one in ten in the lab. They knew I was a crazy mathematician and had no sense of reality. I knew they were wrong and they’ve been proved wrong while I have been proved right. They built laboratories when they didn’t need them. I saw that computers were transforming science because I spent a lot of time asking “What will be the impact of computers on science and how can I change it?” I asked myself, “How is it going to change Bell Labs?” I remarked one time, in the same address, that more than one-half of the people at Bell Labs will be interacting closely with computing machines before I leave. Well, you all have terminals now. I thought hard about where was my field going, where were the opportunities, and what were the important things to do. Let me go there so there is a chance I can do important things.

Most great scientists know many important problems. They have something between 10 and 20 important problems for which they are looking for an attack. And when they see a new idea come up, one hears them say “Well that bears on this problem.” They drop all the other things and get after it. Now I can tell you a horror story that was told to me but I can’t vouch for the truth of it. I was sitting in an airport talking to a friend of mine from Los Alamos about how it was lucky that the fission experiment occurred over in Europe when it did because that got us working on the atomic bomb here in the US. He said “No; at Berkeley we had gathered a bunch of data; we didn’t get around to reducing it because we were building some more equipment, but if we had reduced that data we would have found fission.” They had it in their hands and they didn’t pursue it. They came in second!

The great scientists, when an opportunity opens up, get after it and they pursue it. They drop all other things. They get rid of other things and they get after an idea because they had already thought the thing through. Their minds are prepared; they see the opportunity and they go after it. Now of course lots of times it doesn’t work out, but you don’t have to hit many of them to do some great science. It’s kind of easy. One of the chief tricks is to live a long time!

Another trait, it took me a while to notice. I noticed the following facts about people who work with the door open or the door closed. I notice that if you have the door to your office closed, you get more work done today and tomorrow, and you are more productive than most. But 10 years later somehow you don’t know quite know what problems are worth working on; all the hard work you do is sort of tangential in importance. He who works with the door open gets all kinds of interruptions, but he also occasionally gets clues as to what the world is and what might be important. Now I cannot prove the cause and effect sequence because you might say, “The closed door is symbolic of a closed mind.” I don’t know. But I can say there is a pretty good correlation between those who work with the doors open and those who ultimately do important things, although people who work with doors closed often work harder. Somehow they seem to work on slightly the wrong thing – not much, but enough that they miss fame.

I want to talk on another topic. It is based on the song which I think many of you know, “It ain’t what you do, it’s the way that you do it.” I’ll start with an example of my own. I was conned into doing on a digital computer, in the absolute binary days, a problem which the best analog computers couldn’t do. And I was getting an answer. When I thought carefully and said to myself, “You know, Hamming, you’re going to have to file a report on this military job; after you spend a lot of money you’re going to have to account for it and every analog installation is going to want the report to see if they can’t find flaws in it.” I was doing the required integration by a rather crummy method, to say the least, but I was getting the answer. And I realized that in truth the problem was not just to get the answer; it was to demonstrate for the first time, and beyond question, that I could beat the analog computer on its own ground with a digital machine. I reworked the method of solution, created a theory which was nice and elegant, and changed the way we computed the answer; the results were no different. The published report had an elegant method which was later known for years as “Hamming’s Method of Integrating Differential Equations.” It is somewhat obsolete now, but for a while it was a very good method. By changing the problem slightly, I did important work rather than trivial work.

In the same way, when using the machine up in the attic in the early days, I was solving one problem after another after another; a fair number were successful and there were a few failures. I went home one Friday after finishing a problem, and curiously enough I wasn’t happy; I was depressed. I could see life being a long sequence of one problem after another after another. After quite a while of thinking I decided, “No, I should be in the mass production of a variable product. I should be concerned with all of next year’s problems, not just the one in front of my face.” By changing the question I still got the same kind of results or better, but I changed things and did important work. I attacked the major problem – How do I conquer machines and do all of next year’s problems when I don’t know what they are going to be? How do I prepare for it? How do I do this one so I’ll be on top of it? How do I obey Newton’s rule? He said, “If I have seen further than others, it is because I’ve stood on the shoulders of giants.” These days we stand on each other’s feet!

You should do your job in such a fashion that others can build on top of it, so they will indeed say, “Yes, I’ve stood on so and so’s shoulders and I saw further.” The essence of science is cumulative. By changing a problem slightly you can often do great work rather than merely good work. Instead of attacking isolated problems, I made the resolution that I would never again solve an isolated problem except as characteristic of a class.

Now if you are much of a mathematician you know that the effort to generalize often means that the solution is simple. Often by stopping and saying, “This is the problem he wants but this is characteristic of so and so. Yes, I can attack the whole class with a far superior method than the particular one because I was earlier embedded in needless detail.” The business of abstraction frequently makes things simple. Furthermore, I filed away the methods and prepared for the future problems.

To end this part, I’ll remind you, “It is a poor workman who blames his tools – the good man gets on with the job, given what he’s got, and gets the best answer he can.” And I suggest that by altering the problem, by looking at the thing differently, you can make a great deal of difference in your final productivity because you can either do it in such a fashion that people can indeed build on what you’ve done, or you can do it in such a fashion that the next person has to essentially duplicate again what you’ve done. It isn’t just a matter of the job, it’s the way you write the report, the way you write the paper, the whole attitude. It’s just as easy to do a broad, general job as one very special case. And it’s much more satisfying and rewarding!

I have now come down to a topic which is very distasteful; it is not sufficient to do a job, you have to sell it. `Selling’ to a scientist is an awkward thing to do. It’s very ugly; you shouldn’t have to do it. The world is supposed to be waiting, and when you do something great, they should rush out and welcome it. But the fact is everyone is busy with their own work. You must present it so well that they will set aside what they are doing, look at what you’ve done, read it, and come back and say, “Yes, that was good.” I suggest that when you open a journal, as you turn the pages, you ask why you read some articles and not others. You had better write your report so when it is published in the Physical Review, or wherever else you want it, as the readers are turning the pages they won’t just turn your pages but they will stop and read yours. If they don’t stop and read it, you won’t get credit.

There are three things you have to do in selling. You have to learn to write clearly and well so that people will read it, you must learn to give reasonably formal talks, and you also must learn to give informal talks. We had a lot of so-called `back room scientists.’ In a conference, they would keep quiet. Three weeks later after a decision was made they filed a report saying why you should do so and so. Well, it was too late. They would not stand up right in the middle of a hot conference, in the middle of activity, and say, “We should do this for these reasons.” You need to master that form of communication as well as prepared speeches.

When I first started, I got practically physically ill while giving a speech, and I was very, very nervous. I realized I either had to learn to give speeches smoothly or I would essentially partially cripple my whole career. The first time IBM asked me to give a speech in New York one evening, I decided I was going to give a really good speech, a speech that was wanted, not a technical one but a broad one, and at the end if they liked it, I’d quietly say, “Any time you want one I’ll come in and give you one.” As a result, I got a great deal of practice giving speeches to a limited audience and I got over being afraid. Furthermore, I could also then study what methods were effective and what were ineffective.

While going to meetings I had already been studying why some papers are remembered and most are not. The technical person wants to give a highly limited technical talk. Most of the time the audience wants a broad general talk and wants much more survey and background than the speaker is willing to give. As a result, many talks are ineffective. The speaker names a topic and suddenly plunges into the details he’s solved. Few people in the audience may follow. You should paint a general picture to say why it’s important, and then slowly give a sketch of what was done. Then a larger number of people will say, “Yes, Joe has done that,” or “Mary has done that; I really see where it is; yes, Mary really gave a good talk; I understand what Mary has done.” The tendency is to give a highly restricted, safe talk; this is usually ineffective. Furthermore, many talks are filled with far too much information. So I say this idea of selling is obvious.

Let me summarize. You’ve got to work on important problems. I deny that it is all luck, but I admit there is a fair element of luck. I subscribe to Pasteur’s “Luck favors the prepared mind.” I favor heavily what I did. Friday afternoons for years – great thoughts only – means that I committed 10% of my time trying to understand the bigger problems in the field, i.e. what was and what was not important. I found in the early days I had believed `this’ and yet had spent all week marching in `that’ direction. It was kind of foolish. If I really believe the action is over there, why do I march in this direction? I either had to change my goal or change what I did. So I changed something I did and I marched in the direction I thought was important. It’s that easy.

Now you might tell me you haven’t got control over what you have to work on. Well, when you first begin, you may not. But once you’re moderately successful, there are more people asking for results than you can deliver and you have some power of choice, but not completely. I’ll tell you a story about that, and it bears on the subject of educating your boss. I had a boss named Schelkunoff; he was, and still is, a very good friend of mine. Some military person came to me and demanded some answers by Friday. Well, I had already dedicated my computing resources to reducing data on the fly for a group of scientists; I was knee deep in short, small, important problems. This military person wanted me to solve his problem by the end of the day on Friday. I said, “No, I’ll give it to you Monday. I can work on it over the weekend. I’m not going to do it now.” He goes down to my boss, Schelkunoff, and Schelkunoff says, “You must run this for him; he’s got to have it by Friday.” I tell him, “Why do I?”; he says, “You have to.” I said, “Fine, Sergei, but you’re sitting in your office Friday afternoon catching the late bus home to watch as this fellow walks out that door.” I gave the military person the answers late Friday afternoon. I then went to Schelkunoff’s office and sat down; as the man goes out I say, “You see Schelkunoff, this fellow has nothing under his arm; but I gave him the answers.” On Monday morning Schelkunoff called him up and said, “Did you come in to work over the weekend?” I could hear, as it were, a pause as the fellow ran through his mind of what was going to happen; but he knew he would have had to sign in, and he’d better not say he had when he hadn’t, so he said he hadn’t. Ever after that Schelkunoff said, “You set your deadlines; you can change them.”

One lesson was sufficient to educate my boss as to why I didn’t want to do big jobs that displaced exploratory research and why I was justified in not doing crash jobs which absorb all the research computing facilities. I wanted instead to use the facilities to compute a large number of small problems. Again, in the early days, I was limited in computing capacity and it was clear, in my area, that a “mathematician had no use for machines.” But I needed more machine capacity. Every time I had to tell some scientist in some other area, “No I can’t; I haven’t the machine capacity,” he complained. I said “Go tell your Vice President that Hamming needs more computing capacity.” After a while I could see what was happening up there at the top; many people said to my Vice President, “Your man needs more computing capacity.” I got it!

I also did a second thing. When I loaned what little programming power we had to help in the early days of computing, I said, “We are not getting the recognition for our programmers that they deserve. When you publish a paper you will thank that programmer or you aren’t getting any more help from me. That programmer is going to be thanked by name; she’s worked hard.” I waited a couple of years. I then went through a year of BSTJ articles and counted what fraction thanked some programmer. I took it into the boss and said, “That’s the central role computing is playing in Bell Labs; if the BSTJ is important, that’s how important computing is.” He had to give in. You can educate your bosses. It’s a hard job. In this talk I’m only viewing from the bottom up; I’m not viewing from the top down. But I am telling you how you can get what you want in spite of top management. You have to sell your ideas there also.

Well I now come down to the topic, “Is the effort to be a great scientist worth it?” To answer this, you must ask people. When you get beyond their modesty, most people will say, “Yes, doing really first-class work, and knowing it, is as good as wine, women and song put together,” or if it’s a woman she says, “It is as good as wine, men and song put together.” And if you look at the bosses, they tend to come back or ask for reports, trying to participate in those moments of discovery. They’re always in the way. So evidently those who have done it, want to do it again. But it is a limited survey. I have never dared to go out and ask those who didn’t do great work how they felt about the matter. It’s a biased sample, but I still think it is worth the struggle. I think it is very definitely worth the struggle to try and do first-class work because the truth is, the value is in the struggle more than it is in the result. The struggle to make something of yourself seems to be worthwhile in itself. The success and fame are sort of dividends, in my opinion.

I’ve told you how to do it. It is so easy, so why do so many people, with all their talents, fail? For example, my opinion, to this day, is that there are in the mathematics department at Bell Labs quite a few people far more able and far better endowed than I, but they didn’t produce as much. Some of them did produce more than I did; Shannon produced more than I did, and some others produced a lot, but I was highly productive against a lot of other fellows who were better equipped. Why is it so? What happened to them? Why do so many of the people who have great promise, fail?

Well, one of the reasons is drive and commitment. The people who do great work with less ability but who are committed to it, get more done that those who have great skill and dabble in it, who work during the day and go home and do other things and come back and work the next day. They don’t have the deep commitment that is apparently necessary for really first-class work. They turn out lots of good work, but we were talking, remember, about first-class work. There is a difference. Good people, very talented people, almost always turn out good work. We’re talking about the outstanding work, the type of work that gets the Nobel Prize and gets recognition.

The second thing is, I think, the problem of personality defects. Now I’ll cite a fellow whom I met out in Irvine. He had been the head of a computing center and he was temporarily on assignment as a special assistant to the president of the university. It was obvious he had a job with a great future. He took me into his office one time and showed me his method of getting letters done and how he took care of his correspondence. He pointed out how inefficient the secretary was. He kept all his letters stacked around there; he knew where everything was. And he would, on his word processor, get the letter out. He was bragging how marvelous it was and how he could get so much more work done without the secretary’s interference. Well, behind his back, I talked to the secretary. The secretary said, “Of course I can’t help him; I don’t get his mail. He won’t give me the stuff to log in; I don’t know where he puts it on the floor. Of course I can’t help him.” So I went to him and said, “Look, if you adopt the present method and do what you can do single-handedly, you can go just that far and no farther than you can do single-handedly. If you will learn to work with the system, you can go as far as the system will support you.” And, he never went any further. He had his personality defect of wanting total control and was not willing to recognize that you need the support of the system.

You find this happening again and again; good scientists will fight the system rather than learn to work with the system and take advantage of all the system has to offer. It has a lot, if you learn how to use it. It takes patience, but you can learn how to use the system pretty well, and you can learn how to get around it. After all, if you want a decision `No’, you just go to your boss and get a `No’ easy. If you want to do something, don’t ask, do it. Present him with an accomplished fact. Don’t give him a chance to tell you `No’. But if you want a `No’, it’s easy to get a `No’.

Another personality defect is ego assertion and I’ll speak in this case of my own experience. I came from Los Alamos and in the early days I was using a machine in New York at 590 Madison Avenue where we merely rented time. I was still dressing in western clothes, big slash pockets, a bolo and all those things. I vaguely noticed that I was not getting as good service as other people. So I set out to measure. You came in and you waited for your turn; I felt I was not getting a fair deal. I said to myself, “Why? No Vice President at IBM said, `Give Hamming a bad time’. It is the secretaries at the bottom who are doing this. When a slot appears, they’ll rush to find someone to slip in, but they go out and find somebody else. Now, why? I haven’t mistreated them.” Answer, I wasn’t dressing the way they felt somebody in that situation should. It came down to just that – I wasn’t dressing properly. I had to make the decision – was I going to assert my ego and dress the way I wanted to and have it steadily drain my effort from my professional life, or was I going to appear to conform better? I decided I would make an effort to appear to conform properly. The moment I did, I got much better service. And now, as an old colorful character, I get better service than other people.

You should dress according to the expectations of the audience spoken to. If I am going to give an address at the MIT computer center, I dress with a bolo and an old corduroy jacket or something else. I know enough not to let my clothes, my appearance, my manners get in the way of what I care about. An enormous number of scientists feel they must assert their ego and do their thing their way. They have got to be able to do this, that, or the other thing, and they pay a steady price.

John Tukey almost always dressed very casually. He would go into an important office and it would take a long time before the other fellow realized that this is a first-class man and he had better listen. For a long time John has had to overcome this kind of hostility. It’s wasted effort! I didn’t say you should conform; I said “The appearance of conforming gets you a long way.” If you chose to assert your ego in any number of ways, “I am going to do it my way,” you pay a small steady price throughout the whole of your professional career. And this, over a whole lifetime, adds up to an enormous amount of needless trouble.

By taking the trouble to tell jokes to the secretaries and being a little friendly, I got superb secretarial help. For instance, one time for some idiot reason all the reproducing services at Murray Hill were tied up. Don’t ask me how, but they were. I wanted something done. My secretary called up somebody at Holmdel, hopped the company car, made the hour-long trip down and got it reproduced, and then came back. It was a payoff for the times I had made an effort to cheer her up, tell her jokes and be friendly; it was that little extra work that later paid off for me. By realizing you have to use the system and studying how to get the system to do your work, you learn how to adapt the system to your desires. Or you can fight it steadily, as a small undeclared war, for the whole of your life.

And I think John Tukey paid a terrible price needlessly. He was a genius anyhow, but I think it would have been far better, and far simpler, had he been willing to conform a little bit instead of ego asserting. He is going to dress the way he wants all of the time. It applies not only to dress but to a thousand other things; people will continue to fight the system. Not that you shouldn’t occasionally!

When they moved the library from the middle of Murray Hill to the far end, a friend of mine put in a request for a bicycle. Well, the organization was not dumb. They waited awhile and sent back a map of the grounds saying, “Will you please indicate on this map what paths you are going to take so we can get an insurance policy covering you.” A few more weeks went by. They then asked, “Where are you going to store the bicycle and how will it be locked so we can do so and so.” He finally realized that of course he was going to be red-taped to death so he gave in. He rose to be the President of Bell Laboratories.

Barney Oliver was a good man. He wrote a letter one time to the IEEE. At that time the official shelf space at Bell Labs was so much and the height of the IEEE Proceedings at that time was larger; and since you couldn’t change the size of the official shelf space he wrote this letter to the IEEE Publication person saying, “Since so many IEEE members were at Bell Labs and since the official space was so high the journal size should be changed.” He sent it for his boss’s signature. Back came a carbon with his signature, but he still doesn’t know whether the original was sent or not. I am not saying you shouldn’t make gestures of reform. I am saying that my study of able people is that they don’t get themselves committed to that kind of warfare. They play it a little bit and drop it and get on with their work.

Many a second-rate fellow gets caught up in some little twitting of the system, and carries it through to warfare. He expends his energy in a foolish project. Now you are going to tell me that somebody has to change the system. I agree; somebody’s has to. Which do you want to be? The person who changes the system or the person who does first-class science? Which person is it that you want to be? Be clear, when you fight the system and struggle with it, what you are doing, how far to go out of amusement, and how much to waste your effort fighting the system. My advice is to let somebody else do it and you get on with becoming a first-class scientist. Very few of you have the ability to both reform the system and become a first-class scientist.

On the other hand, we can’t always give in. There are times when a certain amount of rebellion is sensible. I have observed almost all scientists enjoy a certain amount of twitting the system for the sheer love of it. What it comes down to basically is that you cannot be original in one area without having originality in others. Originality is being different. You can’t be an original scientist without having some other original characteristics. But many a scientist has let his quirks in other places make him pay a far higher price than is necessary for the ego satisfaction he or she gets. I’m not against all ego assertion; I’m against some.

Another fault is anger. Often a scientist becomes angry, and this is no way to handle things. Amusement, yes, anger, no. Anger is misdirected. You should follow and cooperate rather than struggle against the system all the time.

Another thing you should look for is the positive side of things instead of the negative. I have already given you several examples, and there are many, many more; how, given the situation, by changing the way I looked at it, I converted what was apparently a defect to an asset. I’ll give you another example. I am an egotistical person; there is no doubt about it. I knew that most people who took a sabbatical to write a book, didn’t finish it on time. So before I left, I told all my friends that when I come back, that book was going to be done! Yes, I would have it done – I’d have been ashamed to come back without it! I used my ego to make myself behave the way I wanted to. I bragged about something so I’d have to perform. I found out many times, like a cornered rat in a real trap, I was surprisingly capable. I have found that it paid to say, “Oh yes, I’ll get the answer for you Tuesday,” not having any idea how to do it. By Sunday night I was really hard thinking on how I was going to deliver by Tuesday. I often put my pride on the line and sometimes I failed, but as I said, like a cornered rat I’m surprised how often I did a good job. I think you need to learn to use yourself. I think you need to know how to convert a situation from one view to another which would increase the chance of success.

Now self-delusion in humans is very, very common. There are enumerable ways of you changing a thing and kidding yourself and making it look some other way. When you ask, “Why didn’t you do such and such,” the person has a thousand alibis. If you look at the history of science, usually these days there are 10 people right there ready, and we pay off for the person who is there first. The other nine fellows say, “Well, I had the idea but I didn’t do it and so on and so on.” There are so many alibis. Why weren’t you first? Why didn’t you do it right? Don’t try an alibi. Don’t try and kid yourself. You can tell other people all the alibis you want. I don’t mind. But to yourself try to be honest.

If you really want to be a first-class scientist you need to know yourself, your weaknesses, your strengths, and your bad faults, like my egotism. How can you convert a fault to an asset? How can you convert a situation where you haven’t got enough manpower to move into a direction when that’s exactly what you need to do? I say again that I have seen, as I studied the history, the successful scientist changed the viewpoint and what was a defect became an asset.

In summary, I claim that some of the reasons why so many people who have greatness within their grasp don’t succeed are: they don’t work on important problems, they don’t become emotionally involved, they don’t try and change what is difficult to some other situation which is easily done but is still important, and they keep giving themselves alibis why they don’t. They keep saying that it is a matter of luck. I’ve told you how easy it is; furthermore I’ve told you how to reform. Therefore, go forth and become great scientists!

Questions and Answers

A. G. Chynoweth: Well that was 50 minutes of concentrated wisdom and observations accumulated over a fantastic career; I lost track of all the observations that were striking home. Some of them are very very timely. One was the plea for more computer capacity; I was hearing nothing but that this morning from several people, over and over again. So that was right on the mark today even though here we are 20 – 30 years after when you were making similar remarks, Dick. I can think of all sorts of lessons that all of us can draw from your talk. And for one, as I walk around the halls in the future I hope I won’t see as many closed doors in Bellcore. That was one observation I thought was very intriguing.

Thank you very, very much indeed Dick; that was a wonderful recollection. I’ll now open it up for questions. I’m sure there are many people who would like to take up on some of the points that Dick was making.

Hamming: First let me respond to Alan Chynoweth about computing. I had computing in research and for 10 years I kept telling my management, “Get that !&@#% machine out of research. We are being forced to run problems all the time. We can’t do research because were too busy operating and running the computing machines.” Finally the message got through. They were going to move computing out of research to someplace else. I was persona non grata to say the least and I was surprised that people didn’t kick my shins because everybody was having their toy taken away from them. I went in to Ed David’s office and said, “Look Ed, you’ve got to give your researchers a machine. If you give them a great big machine, we’ll be back in the same trouble we were before, so busy keeping it going we can’t think. Give them the smallest machine you can because they are very able people. They will learn how to do things on a small machine instead of mass computing.” As far as I’m concerned, that’s how UNIX arose. We gave them a moderately small machine and they decided to make it do great things. They had to come up with a system to do it on. It is called UNIX!

A. G. Chynoweth: I just have to pick up on that one. In our present environment, Dick, while we wrestle with some of the red tape attributed to, or required by, the regulators, there is one quote that one exasperated AVP came up with and I’ve used it over and over again. He growled that, “UNIX was never a deliverable!”

Question: What about personal stress? Does that seem to make a difference?

Hamming: Yes, it does. If you don’t get emotionally involved, it doesn’t. I had incipient ulcers most of the years that I was at Bell Labs. I have since gone off to the Naval Postgraduate School and laid back somewhat, and now my health is much better. But if you want to be a great scientist you’re going to have to put up with stress. You can lead a nice life; you can be a nice guy or you can be a great scientist. But nice guys end last, is what Leo Durocher said. If you want to lead a nice happy life with a lot of recreation and everything else, you’ll lead a nice life.

Question: The remarks about having courage, no one could argue with; but those of us who have gray hairs or who are well established don’t have to worry too much. But what I sense among the young people these days is a real concern over the risk taking in a highly competitive environment. Do you have any words of wisdom on this?

Hamming: I’ll quote Ed David more. Ed David was concerned about the general loss of nerve in our society. It does seem to me that we’ve gone through various periods. Coming out of the war, coming out of Los Alamos where we built the bomb, coming out of building the radars and so on, there came into the mathematics department, and the research area, a group of people with a lot of guts. They’ve just seen things done; they’ve just won a war which was fantastic. We had reasons for having courage and therefore we did a great deal. I can’t arrange that situation to do it again. I cannot blame the present generation for not having it, but I agree with what you say; I just cannot attach blame to it. It doesn’t seem to me they have the desire for greatness; they lack the courage to do it. But we had, because we were in a favorable circumstance to have it; we just came through a tremendously successful war. In the war we were looking very, very bad for a long while; it was a very desperate struggle as you well know. And our success, I think, gave us courage and self confidence; that’s why you see, beginning in the late forties through the fifties, a tremendous productivity at the labs which was stimulated from the earlier times. Because many of us were earlier forced to learn other things – we were forced to learn the things we didn’t want to learn, we were forced to have an open door – and then we could exploit those things we learned. It is true, and I can’t do anything about it; I cannot blame the present generation either. It’s just a fact.

Question: Is there something management could or should do?

Hamming: Management can do very little. If you want to talk about managing research, that’s a totally different talk. I’d take another hour doing that. This talk is about how the individual gets very successful research done in spite of anything the management does or in spite of any other opposition. And how do you do it? Just as I observe people doing it. It’s just that simple and that hard!

Question: Is brainstorming a daily process?

Hamming: Once that was a very popular thing, but it seems not to have paid off. For myself I find it desirable to talk to other people; but a session of brainstorming is seldom worthwhile. I do go in to strictly talk to somebody and say, “Look, I think there has to be something here. Here’s what I think I see …” and then begin talking back and forth. But you want to pick capable people. To use another analogy, you know the idea called the `critical mass.’ If you have enough stuff you have critical mass. There is also the idea I used to call `sound absorbers’. When you get too many sound absorbers, you give out an idea and they merely say, “Yes, yes, yes.” What you want to do is get that critical mass in action; “Yes, that reminds me of so and so,” or, “Have you thought about that or this?” When you talk to other people, you want to get rid of those sound absorbers who are nice people but merely say, “Oh yes,” and to find those who will stimulate you right back.

For example, you couldn’t talk to John Pierce without being stimulated very quickly. There were a group of other people I used to talk with. For example there was Ed Gilbert; I used to go down to his office regularly and ask him questions and listen and come back stimulated. I picked my people carefully with whom I did or whom I didn’t brainstorm because the sound absorbers are a curse. They are just nice guys; they fill the whole space and they contribute nothing except they absorb ideas and the new ideas just die away instead of echoing on. Yes, I find it necessary to talk to people. I think people with closed doors fail to do this so they fail to get their ideas sharpened, such as “Did you ever notice something over here?” I never knew anything about it – I can go over and look. Somebody points the way. On my visit here, I have already found several books that I must read when I get home. I talk to people and ask questions when I think they can answer me and give me clues that I do not know about. I go out and look!

Question: What kind of tradeoffs did you make in allocating your time for reading and writing and actually doing research?

Hamming: I believed, in my early days, that you should spend at least as much time in the polish and presentation as you did in the original research. Now at least 50% of the time must go for the presentation. It’s a big, big number.

Question: How much effort should go into library work?

Hamming: It depends upon the field. I will say this about it. There was a fellow at Bell Labs, a very, very, smart guy. He was always in the library; he read everything. If you wanted references, you went to him and he gave you all kinds of references. But in the middle of forming these theories, I formed a proposition: there would be no effect named after him in the long run. He is now retired from Bell Labs and is an Adjunct Professor. He was very valuable; I’m not questioning that. He wrote some very good Physical Review articles; but there’s no effect named after him because he read too much. If you read all the time what other people have done you will think the way they thought. If you want to think new thoughts that are different, then do what a lot of creative people do – get the problem reasonably clear and then refuse to look at any answers until you’ve thought the problem through carefully how you would do it, how you could slightly change the problem to be the correct one. So yes, you need to keep up. You need to keep up more to find out what the problems are than to read to find the solutions. The reading is necessary to know what is going on and what is possible. But reading to get the solutions does not seem to be the way to do great research. So I’ll give you two answers. You read; but it is not the amount, it is the way you read that counts.

Question: How do you get your name attached to things?

Hamming: By doing great work. I’ll tell you the hamming window one. I had given Tukey a hard time, quite a few times, and I got a phone call from him from Princeton to me at Murray Hill. I knew that he was writing up power spectra and he asked me if I would mind if he called a certain window a “Hamming window.” And I said to him, “Come on, John; you know perfectly well I did only a small part of the work but you also did a lot.” He said, “Yes, Hamming, but you contributed a lot of small things; you’re entitled to some credit.” So he called it the hamming window. Now, let me go on. I had twitted John frequently about true greatness. I said true greatness is when your name is like ampere, watt, and fourier – when it’s spelled with a lower case letter. That’s how the hamming window came about.

Question: Dick, would you care to comment on the relative effectiveness between giving talks, writing papers, and writing books?

Hamming: In the short-haul, papers are very important if you want to stimulate someone tomorrow. If you want to get recognition long-haul, it seems to me writing books is more contribution because most of us need orientation. In this day of practically infinite knowledge, we need orientation to find our way. Let me tell you what infinite knowledge is. Since from the time of Newton to now, we have come close to doubling knowledge every 17 years, more or less. And we cope with that, essentially, by specialization. In the next 340 years at that rate, there will be 20 doublings, i.e. a million, and there will be a million fields of specialty for every one field now. It isn’t going to happen. The present growth of knowledge will choke itself off until we get different tools. I believe that books which try to digest, coordinate, get rid of the duplication, get rid of the less fruitful methods and present the underlying ideas clearly of what we know now, will be the things the future generations will value. Public talks are necessary; private talks are necessary; written papers are necessary. But I am inclined to believe that, in the long-haul, books which leave out what’s not essential are more important than books which tell you everything because you don’t want to know everything. I don’t want to know that much about penguins is the usual reply. You just want to know the essence.

Question: You mentioned the problem of the Nobel Prize and the subsequent notoriety of what was done to some of the careers. Isn’t that kind of a much more broad problem of fame? What can one do?

Hamming: Some things you could do are the following. Somewhere around every seven years make a significant, if not complete, shift in your field. Thus, I shifted from numerical analysis, to hardware, to software, and so on, periodically, because you tend to use up your ideas. When you go to a new field, you have to start over as a baby. You are no longer the big mukity muk and you can start back there and you can start planting those acorns which will become the giant oaks. Shannon, I believe, ruined himself. In fact when he left Bell Labs, I said, “That’s the end of Shannon’s scientific career.” I received a lot of flak from my friends who said that Shannon was just as smart as ever. I said, “Yes, he’ll be just as smart, but that’s the end of his scientific career,” and I truly believe it was.

You have to change. You get tired after a while; you use up your originality in one field. You need to get something nearby. I’m not saying that you shift from music to theoretical physics to English literature; I mean within your field you should shift areas so that you don’t go stale. You couldn’t get away with forcing a change every seven years, but if you could, I would require a condition for doing research, being that you will change your field of research every seven years with a reasonable definition of what it means, or at the end of 10 years, management has the right to compel you to change. I would insist on a change because I’m serious. What happens to the old fellows is that they get a technique going; they keep on using it. They were marching in that direction which was right then, but the world changes. There’s the new direction; but the old fellows are still marching in their former direction.

You need to get into a new field to get new viewpoints, and before you use up all the old ones. You can do something about this, but it takes effort and energy. It takes courage to say, “Yes, I will give up my great reputation.” For example, when error correcting codes were well launched, having these theories, I said, “Hamming, you are going to quit reading papers in the field; you are going to ignore it completely; you are going to try and do something else other than coast on that.” I deliberately refused to go on in that field. I wouldn’t even read papers to try to force myself to have a chance to do something else. I managed myself, which is what I’m preaching in this whole talk. Knowing many of my own faults, I manage myself. I have a lot of faults, so I’ve got a lot of problems, i.e. a lot of possibilities of management.

Question: Would you compare research and management?

Hamming: If you want to be a great researcher, you won’t make it being president of the company. If you want to be president of the company, that’s another thing. I’m not against being president of the company. I just don’t want to be. I think Ian Ross does a good job as President of Bell Labs. I’m not against it; but you have to be clear on what you want. Furthermore, when you’re young, you may have picked wanting to be a great scientist, but as you live longer, you may change your mind. For instance, I went to my boss, Bode, one day and said, “Why did you ever become department head? Why didn’t you just be a good scientist?” He said, “Hamming, I had a vision of what mathematics should be in Bell Laboratories. And I saw if that vision was going to be realized, I had to make it happen; I had to be department head.” When your vision of what you want to do is what you can do single-handedly, then you should pursue it. The day your vision, what you think needs to be done, is bigger than what you can do single-handedly, then you have to move toward management. And the bigger the vision is, the farther in management you have to go. If you have a vision of what the whole laboratory should be, or the whole Bell System, you have to get there to make it happen. You can’t make it happen from the bottom very easily. It depends upon what goals and what desires you have. And as they change in life, you have to be prepared to change. I chose to avoid management because I preferred to do what I could do single-handedly. But that’s the choice that I made, and it is biased. Each person is entitled to their choice. Keep an open mind. But when you do choose a path, for heaven’s sake be aware of what you have done and the choice you have made. Don’t try to do both sides.

Question: How important is one’s own expectation or how important is it to be in a group or surrounded by people who expect great work from you?

Hamming: At Bell Labs everyone expected good work from me – it was a big help. Everybody expects you to do a good job, so you do, if you’ve got pride. I think it’s very valuable to have first-class people around. I sought out the best people. The moment that physics table lost the best people, I left. The moment I saw that the same was true of the chemistry table, I left. I tried to go with people who had great ability so I could learn from them and who would expect great results out of me. By deliberately managing myself, I think I did much better than laissez faire.

Question: You, at the outset of your talk, minimized or played down luck; but you seemed also to gloss over the circumstances that got you to Los Alamos, that got you to Chicago, that got you to Bell Laboratories.

Hamming: There was some luck. On the other hand I don’t know the alternate branches. Until you can say that the other branches would not have been equally or more successful, I can’t say. Is it luck the particular thing you do? For example, when I met Feynman at Los Alamos, I knew he was going to get a Nobel Prize. I didn’t know what for. But I knew darn well he was going to do great work. No matter what directions came up in the future, this man would do great work. And sure enough, he did do great work. It isn’t that you only do a little great work at this circumstance and that was luck, there are many opportunities sooner or later. There are a whole pail full of opportunities, of which, if you’re in this situation, you seize one and you’re great over there instead of over here. There is an element of luck, yes and no. Luck favors a prepared mind; luck favors a prepared person. It is not guaranteed; I don’t guarantee success as being absolutely certain. I’d say luck changes the odds, but there is some definite control on the part of the individual.

Go forth, then, and do great work!

(End of the General Research Colloquium Talk.)


Richard W. Hamming was born February 11, 1915, in Chicago, Illinois. His formaleducation was marked by the following degrees (all in mathematics): B.S. 1937,University of Chicago; M.A. 1939, University of Nebraska; and Ph.D. 1942, University ofIllinois. His early experience was obtained at Los Alamos 1945−1946, i.e. at the close ofWorld War II, where he managed the computers used in building the first atomic bomb.From there he went directly to Bell Laboratories where he spent thirty years in variousaspects of computing, numerical analysis, and management of computing, i.e.1946−1976. On July 23, 1976 he ‘moved his office’ to the Naval Postgraduate School inMonterey, California where he taught, supervised research, and wrote books.

While at Bell Laboratories, he took time to teach in Universities, sometimes locally andsometimes on a full sabbatical leave; these activities included visiting professorships atNew York University, Princeton University (Statistics), City College of New York,Stanford University, 1960−61, Stevens Institute of Technology (Mathematics), and theUniversity of California, Irvine, 1970−71.

Richard Hamming has received a number of awards which include: Fellow, IEEE, 1968;the ACM Turing Prize, 1968; the IEEE Emanuel R. Piore Award, 1979; Member,National Academy of Engineering, 1980; and the Harold Pender Award, U. Penn., 1981.In 1987 a major IEEE award was named after him, namely the Richard W. HammingMedal, ‘‘For exceptional contributions to information sciences and systems’’; fittingly, hewas also the first recipient of this award, 1988. In 1996 in Munich he received theprestigious $130,000 Eduard Rhein Award for Achievement in Technology for his workon error correcting codes. He was both a Founder and Past President of ACM, and a VicePres. of the AAAS Mathematics Section.

He is probably best known for his pioneering work on error−correcting codes, his work onintegrating differential equations, and the spectral window which bears his name. Hisextensive writing has included a number of important, pioneering, and highly regardedbooks. These are:

  • Numerical Methods for Scientists and Engineers, McGraw−Hill, 1962; Secondedition 1973; Reprinted by Dover 1985; Translated into Russian.
  • Calculus and the Computer Revolution, Houghton−Mifflin, 1968.
  • Introduction to Applied Numerical Analysis, McGraw−Hill, 1971.Computers and Society, McGraw−Hill, 1972.
  • Digital Filters, Prentice−Hall, 1977; Second edition 1983; Third edition 1989;translated into several European languages.
  • Coding and Information Theory, Prentice−Hall, 1980; Second edition 1986.
  • Methods of Mathematics Applied to Calculus, Probability and Statistics,Prentice−Hall, 1985.
  • The Art of Probability for Scientists and Engineers, Addison−Wesley, 1991.
  • The Art of Doing Science and Engineering: Learning to Learn, Gordon and Breach,1997.

He continued a very active life as Adjunct Professor, teaching and writing in theMathematics and Computer Science Departments at the Naval Postgraduate School,Monterey, California for another twenty−one years before he retired to become ProfessorEmeritus in 1997. He was still teaching a course in the fall of 1997. He passed awayunexpectedly on January 7, 1998.


I would like to acknowledge the professional efforts of Donna Paradise of the WordProcessing Center who did the initial transcription of the talk from the tape recording.She made my job of editing much easier. The errors of sentence parsing and punctuationare mine and mine alone. Finally I would like to express my sincere appreciation toRichard Hamming and Alan Chynoweth for all of their help in bringing thistranscription to its present readable state.

J. F. Kaiser

Posted by: sureshamrita | October 4, 2010

Managing graduate student life in UCR

The purpose of this blog is to offer some of my personal experience to a  new comer with the hope that the fresher may find it useful. I joined UCR as a PhD student of the Electrical Engineering Dept, in Fall 2009. The first quarter was extremely difficult for me. But soon, with grace, I understood better and the second quarter was easier  and my third quarter was very good. Currently I am working on a research topic with my Professor. I think, as a student here, one has to manage primarily his/her studies, health, finance and some miscellaneous stuff like purchases/travel etc.

1. Academic Management

Obviously this is the most important aspect of a grad student. In the beginning it is managing the coursework and later it is managing research. I joined here after 12 years of my graduation from Indian Institute of Science, so I had almost forgotten how to manage studies in a demanding environment.

1.1 Be assured that you will definitely manage your studies very well

The first and foremost thing I wanted to tell you is that, you are capable of managing the academic demands here. I would say not just managing, but rather you would perform extremely well. Do you know why? UCR has a very good selection process and as I understand they get almost 10 – 20 times more applications. So if you got admission here, it just means that you are capable of the academic demands of this place. Right? So throw away all your concerns and anxieties, relax and excel!!!

1.2 Devote 3 hours outside class room/1 hr of  lecture

I think this is the single most important advice regarding studies. I heard this first when Prof Nannapaneni Narayana Rao of University of Illinois at Urbana-Champaign, gave a talk in my former institution, Amrita Vishwa Vidyapeetham. He said, in a lecture to teachers there that the professors of American universities typically plan their lectures expecting students to study 9 hours for their 3 hours of  lectures in a week. Later my professor also said the same thing to me. In fact if you look at the student evaluation of teaching format of the UCR, they ask whether you have spent at least 2 hours per contact hour. It is interesting to note that, even though I was fully aware of this, I did not do that in the first quarter because, one subject just took away my time and I didnot devote enough time for another subject which was relatively easy for me. But when I got my first internal marks for that subject, it was a shock to me and then I realized that I should have devoted much more time than I did even though my understanding of that subject was better. My professor said, “Dont cut into the 9 hours of study of any subject. If you want to spend more time on one, do it but not at the cost of other subjects”. So I guess this is the most important point to note regarding studies. I would also say, finish the material covered in a week on that week itself.

1.3 Never miss any lectures

Never miss classes. Never. However I have seen  one guy who is irregular in class but ends up with an A+. Is it not exceptional?

1.4 Get as much old question papers as possible

See, it is difficult to create or obtain challenging questions always. So professors tend to repeat their questions in exams. Many students solve the old question papers before they appear for exams. Why dont you do the same? Spend some time in the beginning of the course to collect as much question papers as possible from seniors or friends so that once the course starts, you need not spend time on such miscellaneous things. At least I know one guy, who believes – almost correctly – that he missed one grade in a course just because all other students had seen the previous years final paper while he missed that.

1.5 Be in touch with the Professor

Whether you are doing very well or very bad in a course, please be in touch with your professor – they are all happy to help you irrespective of your academic strength. I know of situations where students managed to get better grades because they were openly discussing their  problems with the professor on a regular basis and the professor knew that they  were really putting their best for the course. It really helps. So never be scared of talking to them. In my entire life, I have never seen  a professor who did not like a student approaching them and discussing!

2. Managing your health

Managing your health properly is very important when you are a grad student. The academic demands are not simple and obviously they can be managed only if you are healthy mentally, emotionally and physically. The best advice in this regard I ever saw comes from Dr. Bill Gray M.D. practicing in California. I had heard about him first in 1986 and as soon as I came here, I went and met him and he is my personal physician. He says : 50% of health is good sleep, 30% comes from regular exercise and only 10-15% from nutrition. I am sure the last part surprises you. I also thought eating healthy is the most important factor!.

50% of health is sleep!

50% of health is sleep!

He says, based on studies done in Stanford etc that one should sleep 8 and a quarter to 8 and a half hours during night and sleep deficit accumulates!. Let me quote some interesting paragraphs from his web page:

Until very recently, medical doctors received virtually no training at all on the value of sleep — physiology, pathology, effects of sleep deprivation, causes of insomnia, and natural vs. pharmacological treatments. Indeed, research into sleep did not take hold until the last half of the last century, primarily because of the difficulties of staying up all night to observe patients willing to have their sleep monitored. Nevertheless, science has advanced considerably, and Stanford Medical School has been one of the true pioneers. For myself as a clinician, I am grateful for the autobiographical tome written by William Dement, MD, of Stanford —The Promise of Sleep, Dell Publishing (1999). It describes the major research developments of the last several decades in an interesting personal style. Since reading this book. I have been able to recognize and treat sleep disorders with success, witnessing profound benefits in chronic disease. Basically, when sleep studies are done on general populations, rates of sleep deprivation range to 63%. Considering adults from 18 to about 75 years of age, the average need for sleep is about 8 1/4 hours per night. Moreover, the statistical distribution is very narrow, ranging from 8.0 hrs/night to 8 1/2 hours per night. It is true that there are a few percent of the population who need 6 or 7 hours of sleep a night, but the vast majority require between 8 and 8 1/2 hours, with very few exceptions.

30% of health is exercise

30% of health is exercise

Hey, instead of me doing cut and paste, why dont you go and read the full details from his web page direclty? Here it is! Again quoting Bill Gray, he says that 30% of health is good exercise. So go to the UCR student recreation center as frequently as you can. I wish I had done this from the first quarter itself!

UCR Student Recreation Center - visit as often as you can!

2.1 Yoga

I benefit a lot from doing yoga regularly for managing my academic stress. Fortunately I had learned it from India though I practice now a days much more regularly than earlier. I was able to refresh my learnings by attending 10 classes by Kishor in Fun Yoga School in Blaine (near the Indian store). I would strongly recommend his course if you want to learn yoga.

2.2 Meditation

Needless to say, if  you practice meditation regularly, it would be a lot helpful.

3. Managing Finance

I feel that managing finance requires a different understanding here than you would have had from India. The primary difference is, it is important to have a good credit history in the US if you want a phone connection (typically from AT & T) or a rental house or better loan from the bank. Credit history can be built only if you use credit cards or take loan from banks. So the first thing all students should get is a credit card. I have seen my friends saying that, they would like to pay cash for everything and they do not want to use credit cards at all. But if they decide that they want to take loan, they will end up paying very high interest just because they do not have a good credit history. In my understanding the following are the important points to know:

3.0  The best source on managing personal finance

Read the book, I will teach you to be rich written by Ramit Sethi (an Indian) and it costs just $10. I accidentally saw this book with a Chinese girl, very recently, while waiting for my flight in Ontario airport. I became curious and got the book for a thumb-through. I would say, this is the best source of information – quite reliable and useful – that I have ever seen. So I strongly recommend reading Ramit’s book 266 page book.

3.1 Getting a credit card

  1. Get a social security number at the earliest from SSN office. For this you must not be on fellowship from UCR. If you are on fellowship, wait for an year when it finishes and the moment you become an employee, get a letter from UCR International office and apply for SSN.
  2. Once you get SSN, go to  your bank and ask for a credit card. If they refuse, suggest that you can change your direct deposit to some other banks and get a credit card. Or ask for supervisor of the bank.

3.2 Managing your credit history

Credit history or credit report is a record of an individual’s or company’s past borrowing and repaying, including information about late payments and bankruptcy. (taken from Wikipedia)

  1. Make sure you pay your credit card bill in full. Otherwise they will charge huge interest from you. Beware, credit card is a double edged sword. Use it very carefully.
  2. You can view your credit history free once in 4 months by visiting There are three national credit bureaus, Experian, Equifax and TransUnion, each having its own database. Each one of them gives us a free report once a year. So if you use any one of them at a time, you can get a free report once in 4 months. The reports will tell you how good your credit profile is. If you want more detailed reports, you can pay roughly $15 and get a very useful report from

3.3 Know your credit score

A credit score in the United States is a number representing the creditworthiness of a person, the likelihood that person will pay his or her debts. (Taken from Wikipedia). It is a number between 300 and 850. You can get it free from I suggest that you keep a track of your credit profile and credit score. At least one friend (a student in UCR) told me that, his social security number was stolen by someone  and they used that get loan from some bank and they did not repay and finally the credit company cancelled this guys credit card. He had to painfully build a good credit history after that. Such events will not occur if you regularly monitor your credit report and credit score which can be done free.

3.4 Which bank to choose?

I would strongly recommend the school first credit union. They give roughly 4% interest on their summer saver accounts. This is the highest amount of interest one can get for savings in my knowledge. But I think you need a drivers licence or a DMV issued id card to start an account there.

3.4.1. Online savings bank

First of all do not be scared of online banks as they exist only in the internet. I have used them for more than year now and I am happy about them. If you are unable to have an account in the school first credit union, I would strongly recommend you to have an online savings account. I recommend They give around 1.2% interest on your savings. The only catch is that, it will take 2-4 days to get back your money, when you need it, to your checking account. But if you can plan your needs well ahead, its a wonderful idea, provided you have some difficulty in having a credit union account (in case you are yet to get your DMV id or drivers licence. There is nothing else that prevents one from getting an account there)

3.4.2 Shopsafe

This is actually a miscellaneous tip. If you are having a credit card from Bank of America, use their shopsafe facility. It allows you to create virtual credit card numbers, valid only for a duration of your choice and having credit limit fixed by you. It is a very safe thing to use when you want to transact online or want to give your credit card number over phone or email. In fact once one guy fooled me over phone saying that he is from a particular agency with which I have a recurring subscription and I was aware that there is some problem in my payment. He said he wanted my credit card information for resolving my payment issues as my shopsafe credit card charge was declined by the bank.  When I expressed difficulty in sharing credit card info over phone, he said my account details, home address etc and finally kind of trusted him and gave my shop safe credit card number which fortunately had less than $10 as credit limit. It turned out that he was trying to get my credit card info for misusing it but he could not use it as I gave my shopsafe number. Shopsafe has additional security that once the shopsafe credit card number is  used by a company, it can be reused only by that company. He might have tried to use that credit card  for some other purchase and the purchase would have been declined by Bank of America!

4. Managing DMV ID/Drivers Licence

4.0 DMV Sample Test Question Papers

For dmv sample test question papers (both written and behind the wheel) click here. There are 2 different sets of pdfs now.

4.1 DMV id

One need not have a dmv id if you have a drivers licence, because the drivers licence is considered as the id card in US. You may think that you need neither of them. But listen: If you have an id or drivers licence, you need not carry your passport while flying locally. Again, if  you want to open an account in a credit union (the best interest paying bank that I have seen in US) you need an id.   Due to some reason if you are not ready to read for the DMV written test and behind the wheel test, I strongly recommend that you apply for an id from DMV and it costs $31. It may take more than  2 months to get it but it is worth.

4.2 Drivers licence

By reading the sample questions available from the above link you get an idea of what kind of questions could be expected for the written test and the kind of maneuvers expected for the behind the wheel test . I would like to caution you that the dmv written test could be tricky. I passed it only on a second attempt, though they give two chances on the first day itself, without charging additional fee. It is also important that when you read for the dmv test, read the latest drivers handbook from web or get a hard copy of it from dmv office or your friends who have used it. Do not read a previous year’s handbook because they may have updated the handbook with critical information and they may ask questions from that. I emphasize this because one reason for my failure on first attempt of the written test was that I read only the 2008 handbook.

In this context I would like to acknowledge the generous help in the form of driving practice given to me by my friends Albert, Asong and Mariana.

5. Travel

Without car, travel is a big issue here as public transport is very bad at least in Riverside. Here are some tips.

5.1 Reaching Ontario Airport

From Bannockburn, get the Bus 204 (RTA)  and get down at Ontario Mills. Get 61 Pomona (omnibus) from there. As you might be aware already, RTA buses are free for UCR students but you have to pay for omnibus. (I  got this information from Nandita who travels frequently)

5.2 Reaching LAX

You can reach Metrolink Riverside terminal from school using Bus 1. From there you can get trains to LA Union station. From union station, buses are available to reach LAX.

5.3 Local Travel

For the UCR shuttle service, click on

6. Calling India

6.1 Vonage – for heavy callers

For heavy callers. If you talk to India for more than 1800 minutes/month this is better. You will have to pay around $35/month. As of now they have a promotion scheme where you can get it for $23/month for first 6 months. With vonage, you can call 60 different countries at a fixed rate. Vonage mobile is also available where you can call from your mobile without incurring mobile time. But then your mobile should have internet access.

6.2 Airtel

Airtel provides 600 minutes for $10. I think this is better than many other options available out there.

6.3 Smartvoip

If you can call from a computer, a cheaper option is smartvoip.

7. Miscellaneous

  • Read the  excellent article A mental makeover for the graduate student published in IEEE Potentials in the issue, July-Aug 2008 by Duval. She has beautifully described the problems and their solutions one may face during PhD, based on her own experience.  Just read it by clicking here. As you might already know, you should be logged into the school network to use IEEE publications or from home you can use your vpn. To know how to connect to school from home using a vpn, read this.
  • If you want to read more about sleep, read Why Sleep is Good For You
Posted by: sureshamrita | September 28, 2010

Installing new font in Ubuntu

  1. Login in as root
  2. Move the font file to say /usr/share/fonts/
  3. using the command, gnome-font-viewer view the font. Eg.
     gnome-font-viewer /usr/share/fonts/truetype/aarati.ttf
  4. Click on the install font button in the right bottom of the viewer.
  5. Restart the browser, you are done!

Inspiration for this article:

Posted by: sureshamrita | September 27, 2010

Email management (for gmail users)

My email inbox used to be crazy. It used to have large amount of emails to be processed later but never gets processed! Many a time important emails got buried in the volume of read and unread emails. I never knew how to manage this issue until I read the Inbox Zeroer article which I happened to read from the posts of Saravananan. Now my inbox containing important emails is almost always empty!!. This is how I achieved it.

  1. First of all, I started using Priority Inbox of Gmail. Soon it started categorizing my emails correctly.
  2. But the most important was the use of Boomerang for Gmail. It just helped me to implement a simple system devised by Merlin Mann for keeping my email inbox empty. This is how Boomerang helped me.

Boomerang for Gmail

From the Boomerange page,”Boomerang for Gmail is a Firefox / Chrome plugin that lets you take control of when you send and receive email messages. It works for Gmail accounts and Google Apps / Hosted Gmail email accounts.”

Now with Boomerang installed, when I get an email I have the following choices:

  • I decide that I need to reply only later. Then I select the Boomerang menu and choose when it should “re-appear” in my inbox. It may on the same day, or next day or days or weeks afterwards.  Soon the email disappears from my inbox and re-appears exactly at the time I asked it to re-appear. I may either boomerang my email again or respond to it. The net effect is that the mail disappears from my inbox for the time being.
  • Respond immediately.
  • Delete it.
  • Archive it.


Get an invitation code from this page and install it in gmail.

How it works

When you snooze an email, boomerang actually moves the email from the inbox and labels it “Boomerang”. The boomerang server keeps the header information and at the required time they move the mail back to our inbox. They say that they do not store the contents of our email.

What if I need to look at an email which I have snoozed for a later date?

Just click the “manage boomerang” menu on the right top of gmail. You can reschedule or move it to the inbox immediately or throw it away.

Sending emails at “appropriate times”

With boomerang installed, it is easy for me to schedule an email to be send later. You write your email, save it and then select the “send later” option. Select the date and time at which you want the email to be sent. I use this feature regularly like this: as myself and my wife are working in two different locations, more than 12 hours apart in time,  I  use this feature to drop emails to my wife’s inbox when she is working (and i am snoring)!

Posted by: sureshamrita | September 15, 2010

Eclipse: editing LaTeX files

I have been using emacs for a long time but finally moved to eclipse for almost all my routine editing purposes (tex, C, C++ etc). I find eclipse very comfortable to use with latex files. You must do the following to use eclipse with latex files.

  1. Install TeXlipse Plugin in eclipse. Installing a plugin in is very easy in eclipse. This is how. start eclipse. Click on the eclipse menu, Help->Install New Software. Enter this URL in the add site menu. If you follow the instructions, it will add TeXlipse and it will restart eclipse.
  2. How to check whether TeXlipse is installed: Click on Eclipse Menu, File->New->Other. You should be able to see LaTex Project.
  3. It is nice to see that TeXlipse will provide templates for beamer, article etc document classes.
  4. You  have to give a project name, select a location to store the tex files ( I usually select my own directory related to the project instead of choosing the  default ‘workspace’ option given by eclipse.
  5. I usually choose pdf as the output format and it will automatically select pdflatex as the builder.
  6. Clicking ‘next’ and ‘finish’ will finally create a document.
  7. Automatic Compilation of latex files: I am very very happy to use this option in eclipse. If you select the eclipse menu: Project->Build Automatically, every time  you save your latex file, it will run pdflatex required number of times. Wow !!!
  8. Configuring the pdf viewer: Eclipse will automatically launch your favorite pdf viewer on clicking the “Launch the Previewer” Icon as shown in the picture below, after you configure your viewers properly. To configure the viewer,  you need to provide 2 different information to eclipse. One is the viewer that you want eclipse to launch and the other is the argument to the viewer – which in general is the name of the pdf/dvi file you need to view. Select your current LaTeX project in the left pane, Click on eclipse menu: Window->Preferences->TeXlipse->Viewer Settings. You can add your preferred viewer. Once you have added or moved up the preferred viewer, click on that viewer entry and click edit. You get a form to fill the viewer name, viewer command and viewer arguments. In most cases viewer argument is %file which means that the corresponding pdf or dvi file will be given as the viewer argument when you lauch it.
  9. My topmost entry (entries are written with descending priority) is acroread(/usr/bin/acroread). You may note that Cntrl-R reloads a pdf document in acroread and just a mouse click in evince. (This is one reason to prefer evince to acroread when developing a pdf document using latex. You just need to click on the evince window only after compilation, which in a properly configured eclipse takes place on simply saving the file!).
  10. Enjoy latex editing in eclipse.
Posted by: sureshamrita | August 31, 2010

Virtualization using VirtualBox on a linux host

I wanted to run windows on my linux machine (Ubuntu 10.04/64 bit). I first tried Vmware but failed. Then I installed VirtualBox which was very comfortable for installation and configuration. I installed windows xp, ms office and visio. All are working fine. For sharing files between the two OS, the following may be  noted.

  • You must first install the guest additions from the VirtualBox menu (Devices->Install Guest Additions)
  • In Linux, your user id must be a member of the group, vboxusers. You can find out the groups in which you are a member by the command $ groups. If you are not a member of this group, you can edit /etc/group; and add your user id to it. You have to restart virtualbox after this!
  • After carrying out the above steps, from the virtual box menu, Devices -> shared folders will allow you to share directories.
  • For sharing USB/Web cam, click on the Devices->USB Devices and select what all you need. A √ mark will appear before the devices selected.

I am able to share usb drive, web cam (in yahoo video call only) and my home directory between these two operating systems. However, skype is not working, and I am unable to use my web cam in a chat environment in yahoo messenger. But video call is fine. Enjoy virtualbox!

Posted by: sureshamrita | August 28, 2010

rsnapshot backup

rsnapshot backup has the advantage that the recovery is very simple. The backed up files are kept as plain files (without compression) in the backup destination directory in the  hard disk and you need to just copy the files only when you want to recover. rsnapshot provides hourly / daily / weekly / monthly backups. This does not mean that the backup size is going to be huge as they maintain files without compression. Not exactly. Only the files which have changed between different runs of the backup, are copied as such. All other files are maintained as hardlinks and hardlinks takeup only very little space. Configuring rsnapshot is also very simple.

Most important thing first. How to recover? Just go to the backup destination directory. In this example, it is /backup/.snapshot. One can see directories such as hourly.0, hourly.1, hourly.2….daily.0, daily.1…, weekly.0, weekly.1….etc Each one of these directories will contain a complete copy of all the directories you wanted to backup at that instant of time.

Installation sudo aptitude install rsnapshot.

Configuration The Howto file in the rsnapshot web site, gives all the necessary information. However, some terms are described here. Open /etc/rsnapshot.conf

  • snapshot_root   /backup/.snapshots/
  • This is the directory where all backup files will be kept. This means that when you want to recover, you will first go to this directory

  • interval hourly 48
    interval daily 7
    interval weekly 4
    interval monthly 1

    For me it was confusing in the beginning to understand this. The first line above means that there will be 48 backups in a day (means every 30 minutes a backup is done). So once the backup system is up and running, the backup destination directory (in our example /backup/.snapshots/) there will be 48 directories named hourly.0 ….hourly.47. However please be noted that, just because we write hourly 48 in the configuration file, the backup program will not run 48 times a day. In fact, this entry only means that it will create 48 directories with name “hourly.xx” in the destination folder. How many times the program will run in a day just depends only on your crontab entry.

    The second line means that the backup destination directory will have daily.0 …daily.6 folders.

  • exclude *.o
  • I dont want the backup system be flooded with my obj files. Hence this entry.

  • backup /home/suresh/research localhost/
    backup /etc/ localhost/
  • This means that I need to backup /home/suresh/research and /etc/. You can have any number of entries here depending on your need.

  • Edit your crontab file (use the command $crontab -e as root) and add the following. (This is my example, your requirements may vary)
    */30 * * * *       /usr/bin/rsnapshot hourly
    15 13 * * *       /usr/bin/rsnapshot daily
    15 16 * * Fri     /usr/bin/rsnapshot weekly
    15 14 27 * *       /usr/bin/rsnapshot monthly

    If you do not remember the details of the crontab entries, please read the man page using the command man 5 crontab

    Acknowledgement: rsnapshot was introduced to me by my friend Dr Ninad . He also helped to me to configure it and understand it.

Posted by: sureshamrita | August 23, 2010

Linux Tips

  1. Display current hostname.
  2. changing the current hostname.
  3. Determining whether the CPU is 32/64 bit.
  4. Determining the whether the OS installed is 32/64 bit.
  5. Becoming a sudoer
  6. How to mount windows shares on your linux machine?

Diplay current host name :


Changing the host name : Edit the file /etc/hostname

Determining whether the CPU is 32/64 bit:

Method 1:

uname -m

Method 2:

cat /proc/cpuinfo|grep flags

The answer I get on my machine is:

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm tpr_shadow

In the above listing look at the colored flag. The flag “lm” means, Long Mode. (64bit Extensions, AMD’s AMD64 or Intel’s EM64T). For more information on CPU flags look at CPU feature flags and their meanings

Determining the whether the OS installed is 32/64 bit: uname -a

Becoming a sudoer: $/etc/sudoers file will show the groups which can do administrative tasks. In my machine it shows like this:


This means that all users belonging to the admin group can use sudo command. The NOPASSWD means that it will not ask for password when you use the sudo command.

$groups command will show what all groups you belong to. So if you are not a member of admin group, as shown by the groups command, just edit /etc/group file, add your user id to the admin group. My /etc/group file admin group entry looks like this.
Now you are ready to use sudo.

How to mount windows shares on your linux machine?

mount -t cifs //windows_share /mnt/ -o user=your_domain\\your_user_name

The abouve command mounts the specified windows share as /mnt in your machine.

You may have to install smbfs as shown below if the above command gives an error message.

aptitude install smbfs

« Newer Posts - Older Posts »