Wednesday, April 27, 2011

The Power Of Music







I mentioned in my last blog that I've been on a reading roll for the past month.

One of the books I picked up at the library during one fruitful visit was "Thus Spoke Zarathustra" by Nietzsche. I've never read anything by the great philosopher. I thought this might be a good time to remedy my ignorance.

I know nothing about his life either, so I also found "Nietzsche: A Philosophical Biography" by RĂ¼diger Safranski. I hoped it would give me context and let me fill in the gaps before I started on the main event.

It used to be that when I started a book I felt a moral obligation to finish it, all the way to the last page. But that's fallen by the wayside. Sometimes you know early on that something's not working for you. Time is precious. Why not take an economist's view, forget about sunk costs, and cease with further investment?

I tried, I really tried, with Joyce's "Ulysses". I got halfway through. I found Leopold Bloom in a bar spouting gibberish and waded right into pages of nonsense syllables. That's where I got stuck. I couldn't push through.

The Nietzsche biography was the same. I read about a quarter of it. It's not that the author didn't do a fine job. It was meticulous and well-researched. I just didn't care about Nietzsche. The book went back to the library last weekend, along "Zarathustra". I'll have to try again someday when I'm feeling more inspired. There were others in the pile that I was anxious to get to, and I only had three weeks.

One feature of Nietzsche's life struck me: his passion for music. Here's a paragraph from the overture that sums it up:


Over the course of many years, Nietzsche used the music of Wagner to gauge his aesthetic pleasure. After hearing the overture to the 'Meistersinger' for the first time, before his personal encounter with Wagner, he wrote to Rohde: 'Every fiber and nerve of my being is tingling. It has been a long time since I experienced such a sustained feeling of rapture.'


And this:


In 'The Birth of Tragedy', Nietzsche called this ecstatic life in music the 'rapture of the Dionysian state, which eradicates the ordinary bounds and limits of existence.'


Does that kind of passion still exist today? Has the ubiquity of music diminished its power to move us?

Music was rare back in those days. If you wanted to hear a musician or composer you either had to go where they lived or hope that a tour brought them to your town. Performances were live. There was no radio, no albums, no cassette tapes, no CDs, no Internet, no .mp3 downloads, no iPods.

Now it's hard to find silence. You can have music everywhere you go. Pop in some ear buds and you can have a hand-picked soundtrack for your life, excluding all other sounds. You can see any artist, alive or dead, who has a performance posted on the Internet. I've seen more of Stevie Ray Vaughn, one of my favorite guitar players, since he passed away in 1990 than I ever saw during his lifetime.

What we might perceive as a superior musical past, when giants walked the earth, is survivor bias. The dross musicians that were The Archies of their day had their music die off. There were a lot of bands and performers in the golden ages of classical music, jazz, rock and roll, and every decade since I've been alive that were terrible. They inspired little more than groans from all but their most devoted, die hard fans. We don't hear much about them anymore.

I asked my oldest daughter her opinion. She says that live performance, and the experience of seeing an artist with a large group, can still evoke that feeling of ecstacy. She assures me that an opportunity to see Daft Punk live, especially in their native Paris, would evoke a response that Nietzsche would both identify with and approve of.



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


Wednesday, April 20, 2011

The Power Of Reading





I've been on a nice roll reading books lately. I always have two stacks in play at once: non-technical and technical. The latter backlog is always longer, because I've allowed the right side of my brain to atrophy a bit as I've gotten older. I used to be more balanced, but I've had to devote more care and feeding to my technical side to keep up.

It started when I fell ill in the beginning of March and was confined to bed for several days to overcome a fever. I had a lot of time on my hands. A friend at work was kind enough to loan me a paperback copy of "In the Heart of the Sea: The Tragedy of the Whaleship Essex" by Nathaniel Philbrick. It was one of those recommendations that I feared would be returned without being opened. I'd have to embarrass myself and explain why I hadn't bothered to give it a look if I didn't try, so I started reading it.

Was I wrong. I was engrossed in the first few pages and quickly fell into a reading trance.

The story of the Essex was well known at the start of the 20th century. It was the inspiration for Herman Melville's "Moby Dick". That name was on the tip of the tongue of every schoolchild back then. This book brought it back for me.

The Essex was a whaling boat that left Nantucket in 1819, at its height of economic power, in search of sperm whales. Whales were harder to find by that time, so captains headed around the tip of South America and into the Pacific in search of their prey. A whaling ship would be away for two or three years at a time. It was not a journey for the faint of heart: nothing in common with Princess Cruise Lines. I don't recall any mention of a midnight dessert buffet, but I might have missed it in my feverish state.

The descriptions of life on the boat were harrowing. I would imagine that the young men taken along to learn the trade suffered from some variant of post-traumatic stress syndrome. Killing a whale with harpoons, stripping the carcass with knives, boiling the blubber for oil, and storing it in the bowels of the boat sounds like one of the worst jobs ever invented.

The ship had only a quarter of its hold filled with oil when it was attacked by an unusually large whale and sunk off the coast of South America. It must have been a rebel that finally took the systematic murder of his pod personally. He rammed the ship, damaged the hull, and forced the crew into three whaling boats to survive.

The really hair-raising part of the story was just beginning.

They made poorly informed choices and ended up spending three months in open water on the Pacific. If only they'd known that a westerly tack towards Polynesia would have ended their troubles! The irony was that they feared Pacific atolls populated with cannibals. Instead they turned south and east, trying to make their way back to the South American coast.

Their only relief in those three months was a brief stop on a small, rocky, uninhabited island that provided some fresh water for drinking and tortoises for protein. Their food situation became dire enough to force the crew to resort to cannibalism. The captain shot his sister's son, along for the journey as a cabin boy, after he drew the short straw. They ate him with neither chianti nor fava beans.

Even worse, that man survived the journey and had to go home and tell his sister what had happened to her son.

It made me wonder how much of what we think of as our better nature is completely dependent on our ability to secure fundamental needs like sufficient water to drink, a regular supply of food, security from threats, adequate sleep, etc. All of us would be surprised at what we might become and how low we'd stoop given such horrible circumstances. So much of what we think of as civilization is dependent on the illusion that we can meet our needs with no more effort than it takes to walk into a grocery store and swipe a debit card in a reader. We're far more dependent on a fragile web of providers than we'd care to admit.

I enjoyed this book far more than I would have guessed when it was offered to me. It made me think of "The Perfect Storm: A True Story of Men Against the Sea" by Sebastian Junger, a more modern take on the dangers faced by men in boats on the water.

After I finished "Essex", I went to the library in town and trolled for four more books. I'll write more about those soon.


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


Sunday, April 17, 2011

Building A Desktop Computer







I bought my first PC back in 1994. I spent a summer as adjunct faculty at the Hartford Graduate Center (now Rensselaer@Hartford, a much more prestigeous name) teaching partial differential equations to first semester masters candidates and earned a cool two grand. That was the going rate for a desktop PC back in those days; it was before Moore's Law kicked into overdrive. I had money in hand. More importantly, I had my wife's approval. After a career spent using Digital Equipment VAX minicomputers and Sun SPARC Unix workstations, I was finally going to have a machine in my own home.

I think I was vaguely aware of the World Wide Web. If my memory is correct, I had a Mosaic browser available to me on my computer at work. It was chicken, meet egg: I could have placed an order for my first PC on the Internet, but I needed a PC and Internet access at home.

I called Gateway 2000 to place my order. '2000' seemed so futuristic, so far away at the time. They were a serious player in the crowded PC market. The person on the other end of the phone was most pleasant and helpful. Windows 3.1? Very good, sir. Would you like two 3.5" floppy drives, or would you prefer one plus a CD ROM drive? Excellent choice, sir. 512MB of RAM? What will you do with all that? It arrived soon after with a monitor that I had to bundle into my arms to pick up.

I couldn't do much with the damn thing. I had to buy a slow modem to access the Internet, which was frustrating as it could be. I couldn't do serious engineering work on it - I could barely do the kind of work that I wanted on the most powerful workstations available to me. The compilers were limited. But I loved having it. I wrote code and prose as best I could. It served me well, but by the time it reached the end of its life I couldn't bear it anymore. I loathed that machine by the time I got rid of it.

I added a second hard drive and maxed out the RAM slots, but those last years weren't kind. I wasn't a hardware guy, so I didn't know how to do anything. I told myself that I was an engineer first, then a software guy. Hardware was someone else's problem. I would have studied electrical engineering if I wanted to know a lot about it.

I don't remember exactly how long I kept it, but it overstayed its welcome. I swore off Gateway, which was in trouble and about to be subsumed in a contraction of the overcrowded market. I went with a proven winner for my second computer: Dell. Their stock had risen and split several times during that period of irrational exuberance. If I'd been smart enough to invest whatever funds I had on hand early in the process I would have been a rich man.

Once again, I placed my order over the phone. The person on the other end of the phone was most pleasant and helpful. I don't remember much about the specs now. I think the operating system was Windows 95. I thought that this machine would last me a very long time, but I was disappointed again. Dell's stock might have been a winner, but their customer service wasn't. I had some long and memorable phone calls with their tech support that were worthy of the comedy series "Outsourced". Once again, I added a second hard drive and maxed out the RAM slots, but those last years weren't kind. I still wasn't a hardware guy; I still didn't know how to do anything.

If I loathed the Gateway, I detested the Dell. I swore I'd never touch another machine of theirs again. Surely HP would be better! I had the Internet at my fingertips in 2005, so I placed this order on line. I didn't need the approval of a salesperson. It was click! click! click! and I had the machine of my dreams: Windows XP! 4GB RAM! Dual core Intel processors! A 220GB hard drive! Surely this one wouldn't disappoint me!

That's the machine that I'm still using now. I'm happy to say that after six years I don't hate this set-up. It's long in the tooth, but Moore's Law gave me something that has weathered the storm better than the others. I can still do what I need to do. I've written a lot of prose, a lot of code, browsed a lot of Internet on this thing.

But I'm still not a hardware guy; I still don't know how to do anything. It's time to do something about that.

I've wanted to build my own machine ever since reading Jeff Atwood's Coding Horror blog about building a PC back in 2007. My HP was only two years old at the time, so I didn't think I needed to be in the market for another one so soon.

Now it's four years later, and I could use another machine. Capabilities have gone up and prices have come down. The world of hardware continues to race along. If I was going to buy another OEM PC I would go for an Apple and see what that's like.

But I've decided that I want to try my hand at assembling my own and installing a operating system for the first time. It's almost a professional requirement.

I'll have lots of help: a friend at work has done this in his sleep, so he was kind enough to offer a complete parts recommendation from Newegg.

So I finally pulled the trigger this afternoon: I set up an account at Newegg and placed an order. My federal tax return will more than cover it. I have my wife's blessing.

This won't make me a hardware guy, but it's a start. I hope it'll give me some base experience and enough awareness to do what's needed to keep the machine up as the years go by.

I want to install an operating system - no, make that several operating systems - from scratch. After spending an engineering career working on nothing but Unix hardware, I've been unable to get away from Windows during my second act as a software professional. When I was an engineer I thought like a guy who didn't care about being an admin on his machine. I used what I was given; I didn't install software.

I'd like to get back to Linux and rediscover what I missed. Setting up my own machine to dual boot to Ubuntu would be fabulous. I want to learn why software professionals say Unix/Linux is a great environment in which to write software. I want to learn sed and awk and rediscover tools that could make my software development life better.

Most of all, it's a chance to keep growing and expanding and learning. Stagnation and satisfaction are death; we all need to keep doing new things that we're afraid of, to expand that circle of light where knowledge and comfort live, and erode that ignorant darkness that's all around us.


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


Sunday, March 6, 2011

Mandelbrot Set












I just finished a trivial but entertaining programming project: rendering a Mandelbrot set using Java.

Mandelbrot sets are named after Benoit Mandelbrot, the recently deceased mathematician that "discovered" them. He took a simple recursive relationship and mapped it onto the complex plane by counting how many iterations were required to observe the magnitude diverge when repeatedly squaring the value at each point:



I've known about Mandelbrot sets for more than twenty years. Chaos theory was all the rage in the late 80s; James Glieck wrote a terrific, accessible book entitled "Chaos: Making A New Science" that summarizes the history beautifully.

Knowing about Mandelbrot sets and having successfully coded them for oneself are two very different things. I saw a question about an implementation on Stack Overflow. Having not gone through it for myself I had nothing to contribute, so I decided to tackle it.

It took me a little while. It all starts with a good Complex class. I implemented the basic arithmetic operators using a fluent style, because it seemed cleaner to me. I wrote a nice JUnit test and asked IntelliJ to tell me about code coverage.

I haven't done any Swing programming in a very long time. I had the set in black and white displaying quickly, but then I had to get a nice color map. It was a happy moment when I saw the picture that accompanies this posting.

That wasn't enough; I had to be able to use the mouse to select a sub-region and zoom in. Once that was working I wanted to be able to save the lovely images to a file. Adding a "save" button would be nice, but my first try just writes the image to an output file when the window closes:



I checked all my code into my local Subversion. I have 100% code coverage for my two model classes (Complex and Mandelbrot, which implements an IterativeFunction iterface) and two view classes (MandelbrotPanel and PixelMapper).

It's not much more than a nice undergraduate problem, but it made me happy to get through it and get such a satisfying result.

I've created an open source project on SourceForge.net and uploaded the code to their Subversion repository. Anyone with a Subversion client can download the code and give it a look:

svn co https://mandelbrotset.svn.sourceforge.net/svnroot/mandelbrotset mandelbrotset


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

Monday, January 31, 2011

Password Card













It seems like every day we see articles about personal information being compromised. Authorities like Bruce Schneier have recommendations on how often to change passwords.

I'm trying something different when it comes to computer security.

I found a site called PasswordCard.org that has a solution that flies in the face of the "don't write your passwords down" admonition.

The site is based on a simple assumption: We all know how to protect our wallets. The site provides a printable card that can be laminated and kept in a wallet. There are randomly generated strong passwords of varying length showing. The idea is to pick a password starting from any row and column, of sufficient length, and use that for a site. Go left to right, right to left, up or down, diagonally - it doesn't matter. Keep the site associated with a password safe and you're in good shape. Even if the card fell into someone else's hands, they'd have a herculean task to figure out the combination and site it applied to.

I want to be sure that Facebook, e-mail, financial accounts, etc. are safe. I won't be using a common password everywhere anymore, thanks to PasswordCard.org.





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

Wednesday, January 26, 2011

Pro-crastination















My character flaws are like grains of sand at the beach - too numerous to count. Like my sweet tooth. Pepperidge Farm's double chocolate Milano is a special weakness. Do they lace those things with crack cocaine? I think they must have hired the chemists from the tobacco companies who specialize in keeping users addicted. They probably got a sweet rate for their trouble, too.

Did I mention my awful sense of humor?

But one of my very worst traits is my procrastination and laziness.

I had a sad reminder of that this morning. The Taking Care Center where I swim is in the basement of a building across the street from where I work, two floors below street level. I had a very nice swim, during which time I played "stroke golf" to measure my efficiency and speed, did a set of 5x100 IM, and finished with a 1x200 kick with board set that left my poor hips tired and sore. I showered, dressed, and put my stuff back in my locker before trudging up four flights of stairs to get back to street level.

For some reason a memory popped into my head while I was walking. I found myself back in the insurance industry after I left Kaman Aerospace for The Hartford in Jan 2005. Soon after I arrived I had a good idea. The engineering education that I received left me with a wealth of mathematical knowledge that was lying fallow since I left engineering back in 1995. But actuaries are the lifeblood of the insurance industry. Why not leverage something that I already had in this new field? At worst, it would improve my industry knowledge and make me a better developer. At best, it could become a new career path in case I needed one.

I contacted the head of the actuarial program at The Hartford and went so far as to order study guides for the first two actuarial exams. I found out right away that my knowledge was long on calculus of continuous functions and physics, but short on discrete math, statistics, and probability. I had a lot of work ahead of me to refresh my memory of the things I used to know and to fill in the gaps in my background by learning the new material.

As I trudged up those stairs this morning, I realized that six years have passed and I've made no progress whatsoever towards achieving this goal.

The thought depressed me terribly.

Six whole years gone by. It seemed daunting at the time, but if I'd been able to summon the energy and dedication to make a little progress every day I would have been able to get through it in spades. A long, steady accumulation of small steps does the trick every time.

How do you make something like this happen? There are lots of technical topics that I want to master (Python, Android, jQuery) and books to get through ("The Algorithm Design Manual", John C. Hull's derivatives and options text, etc.), but my efforts are too scattered, diffuse, and sporadic.

I could take the Nike approach - "Just Do It" - but that hasn't worked so far.

I've had great success in my fitness life with tracking. Just the act of writing it down and seeing progress helps. But what to write? Problems completed? Chapters read? What's the metric that I should track? My new One Hundred Push-ups regimen not only has the counting metric going for it, but it also mandates a Mon-Wed-Fri weekly schedule.

What's standing in my way besides my natural laziness?

The Internet isn't helping me. StackOverflow, Facebook, StumbleUpon - all are time sinks. I need to kill my television. It's like the hearth in my house - it's always on. It's too easy for me to surf over to a Celtics game and become an anti-athlete. I love the game, and know it well from a youth misspent trying to master it, but it's been years since I played myself. When did watching others do things become a worthy use of my precious time?

Seneca's "On The Shortness Of Life" says it best:

It’s not that we have a short time to live, but that we waste a lot of it.


I'm desperate for a plan. How can I fix this?




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

Saturday, January 15, 2011

One Hundred Pushups













I'm already obsessively tracking my swim progress each and every year. While my yardage totals and performance in the water would not be impressive for a trained swimmer, I've been pleased enough with my old guy efforts.

One of the joys of swimming is also a problem: buoyancy. The water holds me up when I'm swimming. It's gentle on joints - knees, ankles, and hips don't take the pounding that something like running or basketball would dish out. But you don't get the benefit of a weight-bearing activity.

We all lose muscle mass as we age. I've been thinking for a while that I need to mix some strength training into my routine. I've never been a machine or weight lifting kind of guy. The place where I swim today offers a lot of interesting alternatives besides swimming, but I'm not sure that they fit into my day as nicely as the early morning, before work swim does.

So what's my solution? I'm trying a regimen that I Stumbled Upon: One Hundred Pushups. The idea is to build strength by working your way up to 100 good push-ups per day over a six week period.

I like it, because it can fit into any day, it doesn't use machines, and I don't have to go to a special place in order to do it. I can also work it in with yoga, so I'd have all three legs of the fitness stool: aerobics, strength, and flexibility.

Today was my first day. I know, the web site says to work on Mon-Wed-Fri with weekends off, but I swam last night and wasn't up to doing pushups when I returned home. I did the test on Wed and found that I was average for a guy my age. So I'm starting at the beginning at Week 1.

I'm hoping that having a routine laid out will help me stay with it. I'll be tracking it in my Excel spreadsheet. I'll report back on my progress in six weeks.

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