Wednesday, November 30, 2011

How Do Your Get To Carnegie Hall?






It's an old joke:

A man stops a New Yorker on the sidewalk and asks him, "How do you get to Carnegie Hall?" The native answers: "Practice, practice, practice!"

Except it's not quite true. Practice is necessary, but not sufficient.

It's perfect practice that makes perfect. It won't do to simply burn bad habits into your muscle and brain memories. You have to repeat the right behavior to be able to recall it at a moment's notice.

I knew this after years of doing scales and arpeggio studies on the classical guitar. Sometimes I felt like I was practicing in my bad habits, because I wasn't focused enough on what I was doing.

Peter Norvig made me aware of the rule of 10,000 hours in his "Teach Yourself Programming In Ten Years". He presents five citations, including Malcolm Gladwell.

Now the Freakonomics guys have added their two cents: "The how of learning is deliberate practice."

This is true in sports, music, math, programming - everything. Technique matters; it's how you do it.

I've found that to be true in my new running venture. My new-found techniques learned by running barefoot have made it possible for me to run the Manchester Road Race without pain or stiffness. I was able to run the next day without any discomfort, although I will confess that my legs were tired. The only after-effect that consistently follows a run is tiredness in my feet. They're finally waking up after years of slumbering in their shoe cocoons. I think I've succeeded in learning how to run injury-free in middle age.

I have to remember that more when I work on my programming skills. I need to identify objectives better and be more aggressive about conquering them and making them mine.





profile for duffymo at Stack Overflow, Q&A for professional and enthusiast programmers

Wednesday, November 23, 2011

Clocks and Roulette Wheels


I've studied a fair amount of math during my education. Engineers were required to take four math classes: two semesters of calculus, differential and integral; multivariate calculus; ordinary differential equations. A fifth course in partial differential equations was recommended but optional. The engineering courses reinforced and built on this base. The prevailing wisdom was that the engineering department taught the same stuff as the math department, but better. I guess we all liked it better when the engineering department presented the material because it came with a context that fixed the ideas in your head.

I took all those and kept going. I decided to sign up for complex variables and linear algebra, just because I liked math. There were also two grad classes that presented integral transforms, calculus of variations, differential geometry, and generalized tensors. The numerical methods that I studied followed the same track: linear algebra for solving large systems of equations and eigenvalues; numerical integration; evaluation of special functions.

I never took a formal course in statistics or probability. The last two graduate classes that I took were in the statistics department: analysis of variance and design of experiments. I was glad to have taken them, but it certainly didn't turn me into a statistician.

I recount all this because it's finally occurred to me that I've missed out on something important. When faced with quantum mechanics and the loss of determinism, Einstein said the God did not play dice. I can't claim to know the gaming habits of God, but I can say that probability and statistics imbue everything around us. They're stand-ins for ignorance, an expression of what we don't know or are uncertain about.

Classical physicists, like Newton, Laplace and Einstein, viewed the universe as a clockwork. Anything could be predicted, given enough information. This is ironic in light of the great service that Laplace rendered to Bayes' theorem by putting it on such a firm mathematical footing. Quantum mechanics killed this idea in the small; non-linearity did the deed in the large. It's all a roulette wheel. Does that mean the universe is really a big casino?

I became aware of two schools of thought in statistics: frequentists and Bayesians. I read hints about the food fight that has been going on between the camps for two centuries, but I didn't understand exactly what it was about - until I read "The Theory That Would Not Die" by Bertsch MyGrayne. The writing style was a bit repetitive, but the story was wonderful.

There were two bits that I especially liked. The first was a quote from Jerry Cornfield to his two daughters as he lay dying: "You spend your whole life practicing your humor for the times when you really need it."

The second was from a section about Jimmie Savage and Dennis Lindley. As the amount of data increases, subjectivists move into agreement, the way scientists come to a consensus as evidence accumulates: "That's the way science is done."

I recently saw "Doing Bayesian Data Analysis: A Tutorial with R and BUGS" by John Kruschke on Amazon. I was intrigued. I knew Bayes and R; what was this BUGS thing about? But now I know, thanks to "The Theory That Would Not Die": it stands for Bayesian Inference Using Gibbs Sampling. There's even an open source project that implements it as a framework. I hope to check it out in the coming months.

I'm planning to add a few items to my must-read list. Probability will be on the list. So will Kruschke's book.





profile for duffymo at Stack Overflow, Q&A for professional and enthusiast programmers

Saturday, October 22, 2011

"Boomerang"




It's an interesting time to be alive. I love to read, and I'm awash in opportunities and technologies to make that possible. I'm connected to the Internet 24x7. I picked up a Kindle this year and like it very much, although it leaves something to be desired for reading technical material. I'm reading the third edition ofPeter Norvig's "Artificial Intelligence: A Modern Approach" on the Kindle, but I find myself going back to the first edition because the figures don't read well and don't zoom in when the text is resized.

No matter how technology marches on, I still love holding a real book in my hand. Going to the library is still and will always be one of my favorite things to do.

I was out and about this morning when I decided to pull into the town library to see what new books were on the shelves. I have a lot to do this weekend, so kicking back with a book wasn't on the schedule.

I couldn't resist when I saw Michael Lewis's newest offering entitled "Boomerang". He had me at "boom".

Michael Lewis has become one of my favorite authors. I've written about how much I enjoyed his books "The Big Short" and "Liar's Poker". His experience on Wall Street selling bonds for Salomon Brothers gave him an insider's understanding of an industry that's driving our news. There are few stories that compare to seeing the world's financial system teetering on the brink of collapse.

That's not to take any credit away from Lewis's writing. I've only read the prologue, but he finds a way to make the people and events memorable and entertaining. What a great insight: "I think I'll travel to the countries that are on the brink to see why they went awry." He's acting as the proxy for the hedge fund managers betting against foreign countries that they've never visited. His voice is so clear, so uniquely his. It's the essence of great story telling. He manages to take an arcane, dry subject like finance and turn that straw into page-turning gold. I admire him so much for developing that distinctive style and zeroing in on his subject.

I've got a list of things to accomplish today, but I plan to spend a little time with Michael Lewis later on. I can't wait!



profile for duffymo at Stack Overflow, Q&A for professional and enthusiast programmers

Saturday, October 15, 2011

Operational At Last



My new computer is finally operational and on-line.

I've never seen a modular power supply before, so it wasn't a surprise when my best assembly efforts were for naught.

Will did his best to sort me out over a cell phone, sight unseen.

Steve and John tried to figure out what I'd done wrong by looking at photographs that I e-mailed, but the detail wasn't sufficient.

It took a breakfast with Matt and Karim to see what my problem was. I brought my non-functioning PC in the back of my car one Sunday, and the two of them opened it up and had at it when we were done eating. They quickly diagnosed where I'd gone wrong and gave me the key to sorting it out.

I had to order a couple more items: a fourth G-Skill DDR, to bring my total RAM to 8GB, and a 3.5" bay for my SSD so I could move it up in the case, right under the CD drive.

When I first powered it up, using the wireless keyboard that is attached to my old machine, I was helpless. No drivers were available for the wireless keyboard, so I picked up a wired keyboard for $19.

I fired it up this afternoon and installed the Windows 7 64-bit OS. After adding the drivers I was fully operational - except for my SSD. I can see it in the BIOS; I can even see it listed as a disk drive in my device manager. But Windows 7 only finds my hard drive, not the SSD. I have to sort that out. The hardware graphics acceleration is disabled as well; I think that's a BIOS setting.

But it's nice to finally have this machine on-line and operational. It took me a while, but I learned a lot. There's still a lot of work to do installing software and moving documents from my old machine.

But I have a great sense of satisfaction today.

My sincerest thanks to Will, Steve, John, Matt, and Karim for the inspiration, patience, and advice.



profile for duffymo at Stack Overflow, Q&A for professional and enthusiast programmers

Sunday, September 18, 2011

A Shock To The System



I received shocking news at home last night: a friend sent a note telling me that my roommate from college, Luis DePina, passed away from brain stem cancer yesterday. Born on 10-Aug-1957, he was just 54 years old.

I remember the first time I met Lou like it was yesterday. My parents brought me up to Storrs to move me into Colt House, an all-male dorm that was home to 60 young men, before the start of classes in Sep 1975. They helped to lug my few possessions up the stairs to the fourth floor, got me sorted out, and then left me to my own devices. I was reading on my newly-made bed when the door opened - and all light coming in from the hallway was blocked by the 6'4", 220 lbm man who stood in the doorway. He stuck out his hand, said "Hi, I'm Lou DePina", and proceeded to move in.

It helps to understand that I grew up in Greenwich, CT - as white bread, as homogeneous a place as there was. I had never been past the steel-decked bridge near Sikorsky Aircraft in Stratford, CT. I could have told you who the mayor of New York City was, but I didn't know who was the governor of Connecticut. I had gone to a small Catholic high school, with a graduating class of 125. There were two African-American students in my class during those four years. One of them left before graduation to transfer to Greenwich High School to play football. I didn't have a personal relationship with either of them.

So it was a big change to be exposed to somebody so different from myself. Lou was an engineering major too, but we couldn't have been more different. I was awkward, worried, excessively religious, and had trouble connecting with all these strange people who thought so differently from me. Lou was a gifted athlete - he had been recruited to play on the varsity baseball team, and could have played on the basketball team in Connecticut's pre-Big East days.

But most of all, he was a genius at making people like him.

He was immediately given the nickname "Rook", short for "Rookie", by the upperclassmen. He then proceeded to ride roughshod over everyone in every competitive venue - be it basketball, foosball, or frisbee golf in the hallway. He was elected president of the dorm. Everyone who lived there knew and liked him.

We would go out into the quad on nice days and throw a baseball back and forth. I wasn't a baseball player, but I was game. Lou was an outfielder with a terrific arm. You had to pay attention when you were throwing with Lou, because you could hear the ball whizzing through the air when it got close. If you didn't position the pocket of the glove correctly you'd get a stinger that you wouldn't forget quickly.

I don't know how Lou managed to play baseball and keep up with school in the spring. I remember him coming back to the dorm exhausted after practice in the afternoon. The irony was that he was throwing to warm-up one day when he took a ball in the eye. He was talking with a teammate, and his throwing partner didn't realize that Lou's head was turned when he let the ball go. That was the end of his baseball career at Connecticut.

I found out later that Lou wasn't pleased at first with his new roommate. He talked with others about switching up after the first semester, because I wasn't having much fun. But things started looking up during the spring after I learned how to drink alcohol. The drinking age in Connecticut was 18 at the time. I was of legal age in high school, but I wasn't a drinker. I maintained that stance after going to college. We used to get home-made pizza for dinner on Friday nights from time to time, which was accompanied by a keg of beer (try that in today's litigious atmosphere). A friend asked me if I wanted to play racquet ball at the fieldhouse one Friday afternoon. When we returned from the game the pizza was gone, the keg was tapped, and there was a card game getting started in the cafeteria. I sat down next to Lou and started to play. He kept refilling my cup so I couldn't count how many beers I had drunk. By the time the game was over I was under the influence for the first time. They piled me into a car and took me to a party at another dorm, where they proceeded to introduce me to every girl we met by saying "He's drunk for the first time in his life."

The spell was broken. Lou taught me how to relax, to stop worrying so much, to enjoy myself, and to be interested in other people. If I took some of those lessons too far for a time and had to correct course, that was my fault. The lessons were well-needed and much appreciated.

We parted on the best of terms after three years of living together because both of us accepted positions as resident assistants in the dorms. It meant living alone in a single room. Both of us were busy with school and other things. Lou switched out of the college of engineering, so we didn't have classes together. We didn't see as much of each other on campus after that. I graduated in December and started working; Lou was still pursuing his degree. We didn't see each other after that. There was no e-mail, cell phones, Internet, or Facebook to help keep the connection alive.

I ran into him again at a Hershey Track and Field meet in New Britain years later. My oldest daughter was competing. The skies opened after we arrived, so everyone had to take refuge under the bleachers. There's where I saw Lou. He was director of recreation in Norwich. He had brought a group from the Y to the meet, including a young man with a beautiful, fluid sprinting style. (We stood to the side in between downpours and admired his form, with Lou critiquing it for me.) He told me that he was married and had a couple of young children in diapers. He had suffered an Achilles injury that stopped him from playing basketball, so he'd taken up golf as a substitute. It allowed him to continue to demonstrate his athletic prowess while doing what he did best - charming the people he played with. I wasn't surprised to hear that Lou was a central figure in Norwich politics.

It was the last time I saw him.

I'm sad to think that someone who was so important to me for those three years could have slipped away. It's a common thing, I suppose. As I've progressed through each phase of my life - high school, college, and a myriad of jobs in two disparate fields - I've had the pleasure of meeting lots of people that I loved spending time with. Lots of them are pleasant memories for me now. There are only so many hours in the day, so much emotion and energy that one can expend in maintaining relationships. Spouse, children, and family have to be the first priority.

But it doesn't diminish the affection I have for those people in the least.

There are three lessons here. First, relationships take energy and effort to keep up. You have to spend time in face-to-face contact. Sorry, Facebook. A long-distance electronic relationship is better than nothing, but it's a poor substitute for the immediacy of being there. Second, choose carefully. If it's not possible to hang onto every single person that you ever thought highly of, then you have to pick and choose. Let those people know that they're worth the effort. Write that e-mail, pick up the phone, and arrange contact. It can be breakfast, it can be a beer at a bar, it can be a stroll in the park. Just be there - early, late, and often. Don't let years go by and be left to wonder what the hell happened.

Third, and perhaps most important, is to not wait forever. Our time here is finite, and you don't know when it will end. If I've been waiting until my children were grown and settled to start picking up the thread with my old friend Lou, then I'm afraid that I waited too long. The opportunity is passed, never to come again. I hope I don't repeat that mistake.



profile for duffymo at Stack Overflow, Q&A for professional and enthusiast programmers

Sunday, September 11, 2011

Born To Run


I wrote earlier about my desire to learn to run again. It's gone fairly well. I have not pushed myself too hard in terms of mileage or frequency, but I'm happy to say that I've enjoyed it. I've been trying to feel a good pace (on the order of 8 minutes per mile) and avoid injury. It's been short, frequent repeats: half mile at a time on the road; quarter mile laps on a track.

My oldest daughter returned from a summer spent working in San Francisco. She had a pair of Vibram shoes and an autographed copy of Christopher McDougall's Born To Run. I asked her if I could read it.

I was hooked on the first page.

It's a riveting story, even if you're not interested in running. I recommend it to everyone. It begins with a visit to his doctor and a question: "Why does my foot hurt?" He's a middle aged runner, like me, trying to figure out why this activity is breaking his body down.

He learns about the Tarahumara, a Mexican Indian tribe that is legendary for their ultra-marathon prowess. It's a journey of discovery; he goes to the Copper Canyons to find them and learn their secrets.

That's a compelling beginning, but I think it was the way he wove other characters and places into the narrative that grabbed me. He introduced American runners and events. It all culminates with a race over rugged terrain between the Tarahumara and American challengers, including the author.

It's great stuff.

I loved the tie-in with evolution and biology. Homo sapiens is the ultimate marathon running species. Our bodies have evolved a unique combination of attributes that make us great runners (e.g. temperature regulation via sweating through the skin; Achilles tendon; a tendon to keep our heads from wobbling when we run; the capability to take multiple breaths per stride).

The day after I finished the book I went to the place where I swim to get a workout in before heading over to work. I noticed one of the fitness counselors had the book cover in the collage hanging on the wall that described his interests. I was astonished to see a newspaper clipping showing Christopher McDougall leading a group of barefoot runners in Bushnell Park last October!

I decided that I'd give barefoot running a try.

There's a small track upstairs from the pool. It's a mere 1/11th of a mile long, but it seemed like a safe place to try out barefoot running. I went up one day and ran two miles in bare feet. It felt strange but good.

The next days were difficult. My calves have not been worked like that in a long time, and the soles of my feet were on fire! But I was willing, even eager, to try it again.

My next effort was outside on a rubberized track at my local high school. It was far too much sensation for my poor feet, so I had to run on the grass instead. One visit turned into another. I ran again in bare feet tonight. It felt fine. I may begin to enjoy this.

I also picked up a copy of Ken Bob Saxon's Running Barefoot. I learned a lot reading it; I'm looking forward to putting it into practice. I was checking my cadence all afternoon. I wasn't able to make the 180+ per minute cadence, but I was consistently in the 160-180 range. I was easy, light, and smooth.

My latest goal is still in sight. The journey's been a good one so far.


profile for duffymo at Stack Overflow, Q&A for professional and enthusiast programmers






Tuesday, August 9, 2011

A New Computer





I spent the afternoon assembling the hardware I bought three months ago. Why the delay? It was a near-fatal combination of being busy, ill, and a terrible procrastinator. But there was nothing on the schedule today, so I decided that it was time to tackle it.

It went far better than I thought it would. I would put it right up there with IKEA. The instructions were pretty good, and almost everything fit together nicely. I started just after one o'clock this afternoon, and all the pieces were assembled before four o'clock.

I was worried about the CPU and cooler, but they slid right into place.

It wasn't clear at first where the solid-state disk drive would go, but the case was as ready as promised.

Everything is in the case, ready to go. Here's a shot with the side panel removed:



I have a few questions I'd like to review with some friends who are more experienced than I am. But once I have those resolved it'll be time to power up, set up the BIOS, and install the OS and software.

It's going to be a terrific machine once it comes on line. I'll wonder why it took me so long to get around to it.

Thanks to Will, Steve, John, Karim, and Matt for their encouragement and inspiration.






profile for duffymo at Stack Overflow, Q&A for professional and enthusiast programmers