Thursday, December 24, 2009

Good News and Bad News for Python Dev...

Good News and Bad News for Python Developers

As you've probably figured out by now I've become a fan of the Python programming language.
I haven't done anything large scale or in a team with it, but it looks like it can scale well.   It also has an increasing presence in the infrastructure of the various Linux distributions.   One of the pluses of that is that the distributions now have to worry though at least some of the challenges of easing forward to new releases of Python.   Python 3.1 is not a trivial target from 2.4 or 2.6, so I'm happy to see the transition is something that the Fedora and Ubuntu folks are working out while I bravely lag behind cheering their progress.

Anyhow, the good news is that it is possible to mix C and C++ libraries in with Python code.  The bad news is that you need to be some kind of guru to untangle a stack trace from such a combined environment when something crashes.
Dave Malcolm has proposed some additions to the gdb debugger for Fedora 13 to make it easier to debug such mixed stacks.   For a good time, take a look at the stack trace that Dave points to from his description of the proposed enhancement.   It certainly left me convinced I'm not ready to do any heavy duty mixing of Python and extensive C & C++ libraries.    And back in the day I did my share of Assembler language programming above and below PL/I wrestling with SYSUDUMPs back on the mainframes.

I'll stick my neck out and assert that programming with a mix of complex programming languages is always going to present challenges.   But after I saw Dave's example, I felt like I had to point it out so you can't later say that I never warned you.

Merry Christmas to you and yours!  (I borrowed the beautiful Christmas tree picture from the web page of Lynne Marshall. The page gave no attribution for the picture, so I don't have further credits to give for it).

Drew


Revised 02/03/2010 to correct a typo.

Thursday, October 8, 2009

Financial engineering


Financial engineering


Re-engineered to Smithereens is interesting reading. Linkedin.com pointed me to the piece via a posting there by the piece's author. I think her essay dwells a bit much on baby boomers, but maybe you have to have come from Lucent to see how losing sight of the purpose of a company can mess up the jobs of far more than one generation of (former) employees.  What the financial engineers seem to overlook is that if a company's stated mission is no grander than "Our mission is to make money for the stockholders", that that is not going to inspire many of the company's staff to rally round the corporate flag.  My undergrad degree is in Industrial Engineering and Operations Research, so I kind of can see where the numbers argue that its a great idea to sell off all the factories and outsource all the production of the company's products, but somehow along the way, the company (formerly known as Western Electric) lost the idea that the way the company earns its money is to sell products.   I'll not insist that you have to manufacture the products in order to sell them, but somehow with the factories gone, the management seemed to lose its sense of direction.  Didn't anyone understand that to sell products with a fat profit margin, you need to have products that people can't get from anyone else, not commodities.  Last year's gee-whiz item is next year's commodity (if not sooner).  Seems to me that things worked out better when the Great Depression idled the factories and management's reaction was to find ways to keep the factories working, even if that meant producing washing machines or some such things that are far out of the company's usual scope.  (Confession:  I tried to find something on the web to substantiate my assertion that Western Electric built washing machines during the Great Depression, but was surprised to learn they were making washing machines and sewing machines in the early 1920's.   Not what I expected to find   But I did find of Western Electric in the Great Depression:

The company paid its employees to make "articles in general
demand" from furniture to cigarette lighters to keep them employed,
then it distributed the goods at-cost through the company stores.

according to http://www.u-s-history.com/pages/h1802.html).  But now, in the 21st century, with no factories, the management just seems to blame the economy and look for more costs to slice ("The beatings will continue until company morale improves"). 

They sold off vast portions of the company, including the chip-business, which produces the raw materials (integrated circuits) from which innovative products can be built.   I'm a bit less comfortable with the notion that all the chips we'd ever need can be purchased from elsewhere.   If we buy commodity chips, how distinctive can our products be?   And if we pay other companies to make custom chips to our specifications, who is going to pocket the profit margin on those chips?   Surely Lucent management didn't make the humerous assumption that they are consumate deal-makers!

Lucent had some interesting starts on products that far out-distanced what the marketplace was currently demanding.    I'm thinking about the micromirror based optical router, long since canceled to the best of my knowledge.   "Nobody" needs that kind of bandwidth capacity.   Why walk away from a future market.   Wouldn't it have been smarter to help cultivate demand for more bandwidth.   Lucent had pioneered development of HDTV.    Why not work with web cam companies to bring HDTV to the PC?   HDTV video chats might step up the demand for IP bandwidth.  Youtube, I hear is already pressing the capacity of Internet service providers.   Verizon is gambling on the future by building FIOS now.   More bandwidth than the customer demands at present, but it'll take some real work and hefty investment for the cable companies to provide as much capacity as FIOS can.   Capacity isn't all that's needed to compete with the cable TV companies, but at least Verizon apparently noticed that they had competition and had to do something about it for Verizon to have a future.

(Disclosure:    I'm a Cablevision "triple play" subscriber.   I use Vonage for my home phone [though the Cablevision phone line has been useful to provide a phone for Aunt Dolly, who currently lives here].   My only monthly bill from Verizon is from Verizon Wireless for cell phone service.  [In other words, I'm not a FIOS subscriber even though they tell me it is now available in my neighborhood].  Since I am no longer employed by Bell Laboratories, I have so far managed to resist the call of the marketplace to move on up to HDTV.   I watch HBO on a plain old NTSC [that is, old non-digital] television set).

"Field of Dreams" projected the kind of thinking that Lucent management lacked.   "Build it and they will come".  But somehow Lucent was never interested in a market space until Cisco or someone had demonstrated that there was a significant market there.   That's not leadership.   "Me too" products are not a good way to bang big bucks to the bottom line.   At Lucent, the bottom line was "a lot fewer bottoms on the line".

Drew











Tuesday, October 6, 2009

How not to sell to me


How not to sell to me

From http://www.limofoundation.org/solutions/index.php

comes this gem of marketing speak:

MOTO U9 is designed for those who want to talk, rock, capture memories and send messages in style.

Sorry, but this is not an effective way to sell a cell phone to me.   Tell me how it makes it easier to send or organize my messages, but don't tell me how stylish I'll look when I'm using the phone.   Now maybe the marketer who crafted those words will smile and shrug and say "obviously I'm not in their target market", but I think what bothers me is the amount of stuff that gets marketed without any meaningful distinguishing characteristics that make the product worth its price.   I guess that explains why I use Linux and OpenOffice (both "free open source software") even as I help people with virus and malware afflictions on their Windows PC's.

My most recent adventure with a Windows Vista PC was a friend's HP that was afflicted with something that kept it away from Internet sites that might have been useful for curing what ailed it.    My friend had purchased Norton 360 Premier, but the infection on the computer kept the Norton package from being able to "Activate".   I tried bringing a copy of the install program for the AVG free (for home use) antivirus to the machine on a USB solid state drive since Google could find the site but when I'd click on the link on the infected machine, the browser would tell me the link is broken.  I checked the etc/hosts file, but that file wasn't what was mis-directing the http traffic.   I was disappointed that the AVG program wouldn't install from the USB drive.   Seems that much like Norton's "activation", the AVG installer looks back to an avg.com site to fetch the actual software to install.   For the next round, I rebooted the PC into "safe mode with networking".   From there I could install AVG.     After I got AVG installed, I ran it and it found a Ddnsfilter.dll file that it didn't like so it got rid of it.   Once that file was out of the way, Norton activation, et al was happy to run.   After scrubbing the machine with AVG, I scrubbed it again with Norton, finding another small number of comlaints, which were cleaned.    Then I scrubbed again with Windows Defender, ran Windows update to install all available patches.   Uninstalled AVG so there isn't the conflict of having 2 anti-virus scanners competing with each other, found some Adobe reader updates that wanted to be installed, so I let them in, found some HP updates, including an update to the PC's flash BIOS, so I let them in, scrubbed the whole thing with Adaware, finding only some cookies and the usual WildTangent garbage, scrubbed the whole thing with Spybot, finding very little to complain about.   If he had decent backups of his files, I'd have felt more confident in reloading the hard drive from scratch, but I think the machine is now as clean as it'll get.    I was impressed that Norton 360 Premier is more than just an antivirus for the money.   It also did a registry clean-up, a disk optimization and even made off-site (via the Internet) backups of something (his data files?).  If it chose wisely what it backed up, that makes it a pretty good deal for what I think amounts to about $35/year.

But I've gotten off the topic of this Blog entry:   "How not to sell to me".   From http://www.netezza.com/testdrive/ comes yet another approach to offend my sense of what I want from an ad:

Get meaningful, actionable analysis faster than you thought possible.

We'll tell you about the low price point later. Right now, just stand back and

watch Netezza TwinFin™ perform!


The good news for the marketeers is that I was only visiting the web site because the product name intrigued me enough that I wanted to know what it was.   I learned only that it is some kind of data warehouse server of unspecified capacity and unspecified price point, but they'll loan me one to try if I'll just fill out their lead-collection form.   All will be revealed to me later.    No thanks.   I was especially unimpressed that they had a link on the site that was supposed to take me to a video about the product, but just dumped me back at the promo page for the free loaner unit.  And don't get me started about the word "actionable"!


Drew






Wednesday, September 9, 2009

Holes in the Road

Holes in the Road

From time to time, especially in early Spring when the ice melts, the drivers of NY like to complain about the holes in the road.   After viewing the video clip about this hole in a Los Angeles road, I think it is clear that the good folks in Queens don't have anything worth griping about.   But then I remember many years ago (1981), while vacationing in the Kissimmee, Florida area, we took a side trip to Winter Park, Florida, just to see a sinkhole that had developed there.  I was pleasantly surprised today to find a video about that sink hole on Youtube.   But that hole wasn't something you'd compare to a pothole in a road.   It was more like a hole in the earth.  That Winter Park sinkhole ate a house, a car dealership, a part of a community swimming pool and left a yawning deep chasm in the middle of the town.   It swallowed five expensive Porsche sports cars (from the car dealership), but so far as I know, no people died as a result of that hole's formation.

There are another couple of aerial shots of the Winter Park sinkhole on this web page.   Looking at a map of Winter Park, Florida, there are numerous large circular lakes in town.   Red flag A marks the spot where the sink hole formed in 1981.   I was surprised at what a relatively small pond the sinkhole formed now that it has filled up with water.    You'll need to zoom in on the map to even seen that small circular pond.

I hope Florida won't mind that I've got Winter Park, Florida on my short list of places to not consider for my some-day retirement home, right up there with Centralia, Pennsylvania.

Drive carefully wherever you are.

Drew






Saturday, August 1, 2009

It's All In How You Spin It


It's All In How You Spin It

Here's another video clip from The Onion News Network.  Reminder:  As I've mentioned before, that site doesn't publish real news, just satirical humor.

Gap "For Kids By Kids" clothing line

Drew


Thursday, July 30, 2009

Vitamin D?


Vitamin D?

Looking for something to read?   I suggest that you Google for:

vitamin d flu

Among the many web pages that search will find for you is this one:


A few years ago when I read a paper that looked an awful lot like that one, there were a lot fewer pages on the web about vitamin D and the flu.  I dug around at the time in search of support for that guy's data point and found instead reports of vitamin D having little effect on health except in the case of extreme deficiency.   Reminded me of the flurry of reports of people swearing that vitamin C and Zinc could protect you against the common cold a few years ago.   Now there are so many pages about vitamin D to prevent swine flu that its hard to find anything that weighs in against it.   Dr. John J. Cannell of the "Vitamin D Council" seems to be to vitamin D as Linus Pauling was to vitamin C.  You can even watch Dr. Cannell on YouTube.   Here is another YouTube video preaching Dr. Cannell's message for him.
Picture copied, without explicit permission, from http://www.selftanningqueen.com/?p=850

Is the science in favor of your keeping your vitamin D level high?   I don't know.   But the anecdotes of warding off flu in the prison certainly appeal to my sense - they sound right.   Bummer that he couldn't show statistical significance in the observation.   Nevertheless, vitamin D tablets are inexpensive and have a long shelf life, so I've been making a point of taking a 1000 IU tablet each day for quite a while now.

Now if only there weren't those reports in early 2009 about not finding any good coming from taking a daily multi-vitamin.


I really want to believe.

Speaking of believing, there sure are a lot of web pages with conspiracy theories about FEMA and the Federal government in general.   The swine flu, I found web pages suggesting, is a man-made weapon.   And all I was looking for was that article about warding off flu in prison by handing out regular doses of vitamin D.

Your tax dollars at work:

But that's getting off the topic of vitamin D.

Drew





Wednesday, July 29, 2009

No Child Left Behind

Here's another video clip from The Onion News Network.  Reminder:  As I've mentioned before, that site doesn't publish real news, just satirical humor.  In this clip I think they achieve a fair balance of poking fun at television news and our beloved Federal government.  Of course in real life the teachers wouldn't be quite so flexible about the prescribed curriculum, would they?

Students First In Line Job Training

"It's good to see a positive story come out of a troubled school".

Drew

Monday, July 27, 2009

Healing


Healing

Recently, while surfing around the web, I came across a joke that made me laugh.  I sent it along to a Mississippi friend who also laughed.   But I didn't make a note of the URL where I got the joke from.   Looking around for the joke today using Google, I find this joke and minor variations of it appear probably hundreds of times on the web.

I didn't write this joke in the first place and I have no idea who did.  Sorry I can't give proper credit here...

I should caution that this joke mixes humor and religion.  The joke also is constructed on some old stereotypes, but I don't think anyone is harmed badly by the humor which all-but starts with "An Irishman, an Italian and a Redneck all walk into a bar...".  If you're the sort of person who is likely to get upset by such a combination, then this blog entry is probably not for you.

Having gotten those disclaimers out of the way, here's the joke (but first, a picture to lighten the page):

(Photo of the Beauty Bar (10/2012) from http://www.cosmopolitantv.es/planesgossipgirl/, used here without explicit permission)

The bartender was washing his glasses, when an elderly Irishman came in. With great difficulty, the Irishman hoisted his bad leg over the barstool, pulled himself up painfully, and asked for a sip of Irish whiskey. The Irishman looked down the bar and said, “Is that Jesus down there?” The bartender nodded, so the Irishman told him to give Jesus an Irish whiskey, too.

The next patron to come in was an ailing Italian with a hunched back, who moved very slow. He shuffled up to the barstool and asked for a glass of Chianti. He also looked down the bar and asked if that was Jesus sitting at the end of the bar. The bartender nodded, so the Italian said to give Him a glass of Chianti, too.

The third patron to enter the bar was a redneck, who swaggered into the bar and hollered, “Barkeep, set me up a cold one! Hey, is that God’s Boy down there?” The barkeep nodded, so the redneck told him to give Jesus a cold one, too.

As Jesus got up to leave, he walked over to the Irishman and touched him and said, “For your kindness, you are healed!” The Irishman felt the strength come back to his leg, so he got up and danced a jig out the door. Jesus touched the Italian and said, “For your kindness, you are healed!” The Italian felt his back straighten, so he raised his hands above his head and did a flip out the door.  Jesus walked toward the redneck, but the redneck jumped back and exclaimed, “Don’t touch me! I’m drawing disability!”

Drew

Thursday, July 23, 2009

The Other Things


The Other Things

Unless you've been far far away from the media this week, surely you're aware that this week marked the anniversary of the landing of man on the moon 40 years ago.  Over and over again, the TV has  been playing various sound bytes from John F. Kennedy's September 12, 1962 speech where he says "We choose to go to the moon in this decade".   In case you missed it here's a short clip:

Each time I listened to that speech this week, I noticed that he says  "We choose to go to the moon in this decade and do the other things...".   Generally the sound bite is like the one I linked to, trimmed enough as to remove all clues as to what "the other things" were.

Inquiring minds want to know.   So I dug to find the rest of the speech.

Here's a longer clip from that same speech that gives enough context to let you find what "the other things" were.

So, "the other things" were the hard science to make possible going to the moon and going on from there to explore space.   If he'd had some west coast speech writers he might have said "to boldly go where no man has gone before".  What I like about the speech is he was clearly pushing spending money for scientific research.  I often hear politicians suggesting that it would be good to fund things like curing AIDS or cancer, but nothing I can recall from recent speeches has said we, as a nation, need more scientists.

Here's a far longer video of that same speech:

http://www.youtube.com/watch?v=TuW4oGKzVKc (17 minute, 42 second version)

I was surprised to learn that the speech was not the speech where he first set the goal of the US getting to the moon in the 1960's.   In fact, the speech was in Houston and by September, 1962, there had apparently already been major strides in shaping the space program.  Houston evidently had already been picked for Mission Control and he describes Cape Canaveral's planned Vertical Assembly Building and the Saturn rocket engines.

Looking into that, I learned that the Saturn and a lunar landing program (with a target of the late 1960's) were already in the works in the Eisenhower administration.

As I was digging for that "We choose to go to the moon" speech, I came across this May 25, 1961 speech by Kennedy to Congress.

4-page transcript of 1961 "let's go to the moon" speech

Excerpt---

First, I believe that this nation should commit itself to achieving the goal, before this decade is out, of landing a man on the moon and returning him safely to the earth. No single space project in this period will be more impressive to mankind, or more important for the long-range exploration of space; and none will be so difficult or expensive to accomplish. We propose to accelerate the development of the appropriate lunar space craft. We propose to develop alternate liquid and solid fuel boosters, much larger than any now being developed, until certain which is superior. We propose additional funds for other engine development and for unmanned explorations--explorations which are particularly important for one purpose which this nation will never overlook: the survival of the man who first makes this daring flight. But in a very real sense, it will not be one man going to the moon--if we make this judgment affirmatively, it will be an entire nation. For all of us must work to put him there.

But wait, there's more!

Secondly, an additional 23 million dollars, together with 7 million dollars already available, will accelerate development of the Rover nuclear rocket. This gives promise of some day providing a means for even more exciting and ambitious exploration of space, perhaps beyond the moon, perhaps to the very end of the solar system itself.

Rover nuclear rocket??  I had to look that one up.   The expectation was you'd need such a thing to go to Mars.

So that program died about 1972 when it was clear there was no plan to try for Mars as a follow-on to reaching the moon.

But back to Kennedy's 1961 speech to Congress.   It also proposed 2 more items.   Item 3 was development of communications satellites.  Item 4 was development of weather satellites.   Hey!  No mention of GPS?

All that space program stuff was in section IX of the speech.   The other sections are interesting reading too.   The economy was recovering from another recession and the cold war was quite a bit more war-like than in later years when diplomacy requires that we say only nice things about the other countries.

The great battleground for the defense and expansion of freedom today is the whole southern half of the globe--Asia, Latin America, Africa and the Middle East--the lands of the rising peoples. Their revolution is the greatest in human history. They seek an end to injustice, tyranny, and exploitation. More than an end, they seek a beginning.

And theirs is a revolution which we would support regardless of the Cold War, and regardless of which political or economic route they should choose to freedom.

For the adversaries of freedom did not create the revolution; nor did they create the conditions which compel it. But they are seeking to ride the crest of its wave--to capture it for themselves.

Yet their aggression is more often concealed than open. They have fired no missiles; and their troops are seldom seen. They send arms, agitators, aid, technicians and propaganda to every troubled area. But where fighting is required, it is usually done by others--by guerrillas striking at night, by assassins striking alone--assassins who have taken the lives of four thousand civil officers in the last twelve months in Vietnam alone--by subversives and saboteurs and insurrectionists, who in some cases control whole areas inside of independent nations.

The talk of revolution reminds me of that routine by Hispanic comedian George Lopez who says that not only will the revolution be televised, but that it will be closed-captioned in Spanish.

Kennedy's speech was not the sort of words you'd pick to bill and coo with, say, a country you were depending upon to snap up tons of IOU's as if that paper was going to be worth something some day.   Maybe one day we'll have a national going-out-of-business sale.  How much of the national debt could we barter away in exchange for Michigan, including full rights to the factories of a couple of once-major auto manufacturers?  Probably not enough.

In closure, here's a brief collection of great presidential speeches.  Think history will be kind to them all?

http://www.youtube.com/watch?v=6rkb_wkfjyo&feature=related (36 seconds)


Drew


Wednesday, July 22, 2009

Literate Programming?


Literate Programming?

Oh, what a tangled web we weave...

Many moons ago (The year 1984 if you want to get specific), Donald Knuth documented the idea of Literate Programming.   Well, he did more than document it.   He concocted software to support it, and applied the technique to his development of TeX.

While researching this topic, I found a page that offers some insight that rings true with me:

Literate programming, however, is not a mainstream technique. Those who use literate programming tools often wonder why not. There have been no studies done of which I am aware, but the basic shortcoming of literate programming is that it is difficult to write a literate program quickly. Yes, once it is written, it is impeccably documented, easily debugged (in those cases where it isn't already provably correct), simply maintained by the original author and others, and in general simply has a far higher quality in every respect than an "illiterate" program. But it takes longer to see results. As we all know, the software industry is an impatient one. And corporate IT in industries other than our beloved software are even less patient and less likely to understand the benefits of good coding style.

So, with some spare time on my hands, my mind has once again turned to trying to reach a level of comfort where I feel I've mastered Python.   My software development style is to write a high level overview of the target program and its major piece-parts as comments first.   My target audience for those comments is mostly just me, so if I get interrupted, I can get re-oriented to the intent of the code by reading what I wrote.   Maybe I'm showing my roots - back in the old days I wrote code in really low level languages (IBM 360 assembler language, for instance).   When developing code, I'm most comfortable sketching out the intent in words and then filling in the code and test cases.

So I was thinking about this and it occurred to me that this is quite similar, I think, to the intent of Literate Programming.  That got me wondering if anyone had done anything with Literate Programming for Python.   I suspected the answer was fated to be "no" since Literate Programming's debut was 1984 and it never really caught on, so far as I can tell, in the real world, and Python didn't debut until 1990, and has only gotten big in the world of software development in recent years (That's from my point of view.   You are free to argue contrary points of view).   So, I did a google search for:

python literate programming
and Bam!    Google found 32,600 web pages to match my search.   What a set back to my journey to that distant lofty land where I feel like I've mastered the fine art of charming Python!   I sure didn't read all 32,600 pages, but after reading a few, I decided to postpone tackling Literate Programming as a formal development methodology at this time.   I found an example of a Python Literate Program using a tool called xlp.   Sorry, but I found the example to be quite off-putting.   Consider for example, this line:
Literate?   That line did not seem particularly enlightening as a snip of program documentation.   Numbered sections made me think of the programming language 'Basic".   Long ago I learned that if the code resembles Basic, to avert my eyes.  ("It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.")  Perhaps this specific literate program is just an unfortunate example... 

The providers of PyLit, another Python Literate Programming tool have provided a web page that is somewhat biased, I believe, towards PyLit, but that provides an overview of other Literate Programming tools for comparison.  Maybe I'm overly sensitive to descriptions, but I was put off by the pro-PyLit page's categorization of PyLit as "semi-literate".   I confess to not having dug hard to find an example of a program written using PyLit, but it annoyed me that there didn't seem to be a conspicuous link on that overview page to an example.

From my reading of that overview page, the tool that left me with the most favorable impression was pyreport, but bear in mind that I didn't actually try the tool and that XML and LaTeX and reStructuredText are all things that from my point of view are potentially "in the way" of my getting comfortable with Python.

In the end, I decided to heed the advice of Monty Python and "Run Away!" from Literate Programming for now.   Things I think I learned from my looking into this today is that Python is reasonably flexible in the order of the code in the source files, particularly given that today there's not much cause to be shy about making a procedure call for the sake of clean packaging of ideas.   And Python already has more than enough provisions for embedding documentation into the program (e.g. docutils).  So, I'm proceeding with the expectation that I can produce reasonably readable programs without having to add another layer of tools to my learning curve.

So, what's to learn to be a Python expert?

  1. Python language basics.   (that's the easy part...).  The trick of course is to write idiomatic Python and not to write in, say, C style when programming with Python.   As the old proverb cautions, there is no programming language in which it is not possible to code in Fortran.   Cleanly documenting the code with reStructuredText is sort of part of writing idiomatic Python code, so I'll mention that as part of this item.
  2. Python library.   It seems to go on and on forever... (Don't you just hate it when the syllabus handed out on the first day of class tells you: "Required reading includes the Library of Congress, which has been put on reserve.").  There's the Python Standard Library, the odds and ends in the Cheese Shop and there are many frameworks (e.g. CherryPy) and other available bits of possibly useful freely available code.
  3. Effective object oriented programming.   (my brain was well molded into seeing top-down structured code as the way to program.   That was back in the days when Dikstra's "Go To considered harmful" was still subject to spirited debate.  For example, see Knuth's wonderfully perverse for its time "Structured Programming with Go To Statements", whose title I more than once have mis-remembered as "Do You Suffer from Painful Elimination?".  So the mechanics of "objects" seem clean enough to me, but darned if I feel like I've got good intuition yet as to when it is appropriate to make something be an "object".
  4. Driving a program through effective test coverage by developing good unit tests in conjunction with the code.  From my limited experience so far, in an interpreted language like Python, it is vital to exercise all the code at unit test time as a clean compile means far less than it does in a more "traditional" strongly typed at compile-time language.  Of course there are more than a few tools to choose among for unit test support of Python code (unittest, doctest,py.unit).  Which is best?   Hey!  I said I'm still just learning.  And, no, that isn't an exhaustive list of possibly relevant unit test frameworks.  And I've been sufficiently embarrassed at some dumb mistakes by myself to think pychecker or pylint or pep8.py may be important.   And, no, I don't think that's an exhaustive list of available static-checking tools either.
  5. IDE's for Python.    I was awed at how much glop I accidentally introduced into my source when using vi to write Python code.  SPE (Stani's Python Editor) seems to be a much better fit, but as usual, there are lots of alternatives that I may be unwise in passing over.  (eric, idle, eclipse with pydev and ANT, just to name a few that I'm aware of).   I'll toss change control (e.g. subversion) into this item too since the IDE presumably needs to work with the source code control system.  (As I look into this, I'm finding a disappointing lack of integration of subversion and most IDE's.   If it's there, I'm not finding it in SPE).
  6. Debugging Python code.  Of course there's more than one debugger to choose among.  Profiling/performance tuning needs to be mentioned somewhere, so I'll put it here.
  7. GUI's and GUI development tools for Python.  There are too many choices and at this point I haven't a clue which is the right pick.   I suspect I'm best off with plain old least common denominator "tk" as created for TCL and used by Perl even though it is merely functional and not "pretty", at least not when I last looked.
  8. Parallelism and Python.   Co-routines, threads, multi-tasking.
  9. Packaging for distribution.   Python eggs.
  10. Alternate implementations (Pypy, jython, ipython (debugger, IDE, not sure what to call it?), psyco, Shed Skin, Unladen Swallow, cython, Iron Python, Python 3.x).

And when I'm comfortable with all of the above, I'll be comfortable calling myself something of an expert for the Python programming language.  Once upon a time I considered myself an expert in the PL/I programming language.  PL/I is now all-but dead because it was too complex.   But somehow the learning curve for Python looks to be more formidable.  Of course back in the days of PL/I, there were no IDE's, unless you count 80-column coding pads, no GUI's, little concern about multi-processing, and a very limited library to draw upon.  Debuggers are pretty specific to running in an interactive environment.   In a batch processing programming environment, there were SYSUDUMP hex printouts of memory at the time of the crash.  And we walked up hill through the snow to get to school - and up hill to get home too.   Trying to learn OOP at the same time as learning Python is just a matter of trying to catch up with the times for having spent much time and energy on system and network administration instead of keeping my hand in as a software developer in recent years.

Drew
Revised 08/03/2009 to enlarge the list of alternate Python implementations.
Revised 12/20/2012 to clean up the HTML. Darn if I know how the list formating and whatnot had gone bad.

Revised 11/26/2014 to replace a failed link to the Knuth "Structured Programming" article with a URL that works at present. I sure hate it when I use a link and then the web page it references vanishes.








Monday, July 13, 2009

What's on your dashboard?


This picture is from an article NJ Wants to Ban GPS in cars? The article itself is nothing special. I think it is simply about another effort to impose on drivers a requirement that they not be too distracted from driving while driving. What I liked about the article was the picture. Kind of reminded me of my friend's van which, on the one hand has more cup holders than passengers, but on the other hand, on those occasions when I have a cup I'd like to set down, something always seems to be atop every cup holder. The only legit permanent non-cup occupant of the cupholders is a cup-shaped multiplier of the dashboard "cigarette lighter" power outlet. A retractable wire from this cup shaped object plugs into the dashboard and the top of the cup presents 3 or so additional "cigarette lighter" outlets so, for example, you can charge a couple of cell phones and a bluetooth ear-piece. Way in the back of the van there's a 110VAC outlet so you can charge your notebook PC even if you just have the conventional AC adapter for your PC. But we do have a strict rule that the driver must bring the vehicle to a full and complete stop before editing a blog entry.

Tuesday, June 30, 2009

Toxic ink - printed money recall

Toxic ink - printed money recall

If you aren't familiar with The Onion Network News, please take notice that it is a satirical web site, not actual news. All too often when I watch one of their videos, I find they had a catchy concept, but didn't put enough effort into the writing. But I finally found one that seems to be on the mark. I'd like to draw to your attention Treasury Department issues emergency recall of all U.S. dollars.

Monday, June 22, 2009

Cornell Hydraulics Lab

Cornell Hydraulics Lab

The Cornell University campus in Ithaca, NY sits atop a hill overlooking downtown Ithaca and the southern tip of Lake Cayuga, one of the finger lakes of New York state.  The campus is bounded on the north and the south by deep gorges.  (The basis for the bad pun on all those "Ithaca is gorges" T-shirts).  Well, "bounded" is too strong a word as bits of campus have long since spilled across Cascadilla Gorge into College Town to the south of the main campus; and to the north of Fall Creek gorge, North Campus is a nearly city-sized collection of dormitories.

Fall Creek gorge had the interesting feature of the long-abandoned Hydraulics Lab built into the wall of the gorge just below Beebee Lake.   In 2005, some relatives of a Cornell student took a trip to Ithaca and they posted a very nice web page documenting the trip with pictures and words.  Among their pictures was this photo of the Hydraulics Lab, which they captioned "Fall Creek and the Hydraulics Lab from the Thurston Avenue Bridge."

     Fall Creek and the Hydraulics Lab from the Thurston Avenue Bridge.


In good weather, the Cornell campus is a fabulously beautiful place. If you are unfamiliar with it, click on the "campus" link up above here. Click on the virtual tour check box just below the map and click on the various panorama points on the map to see various 360-degree pictures of the place. "Stroll around the grounds a bit, until you feel at home".

Memorial Day weekend, 2009, I went back to visit the Cornell campus.   Through fortuitous bad planning, that turned out to be the weekend for Cornell's graduation ceremony.  (No wonder I'd had such a hard time reserving a hotel room - we ended up in a hotel in Owego, about 30 miles to the south of Ithaca).  I picked up a graduation edition of the Cornell Daily Sun in the lobby of Willard Straight Hall and didn't get around to reading it until I'd gotten home.  I was surprised to learn from the paper that one cold night in February, 2009, the hydraulics lab collapsed into the gorge.   That motivated me to look for more info on the web and I found a March 2009 Cornell Daily Sun article (link now dead, sniff, sniff) about the proposed clean-up of the site.   That article included this wintery "after" photo:

Vanishing act: The remains of the old Hydraulics Lab,
 which collapsed into Fall Creek Gorge

Alas, in 9/2013 that archived article and the photo were tidied up from the Sun's web site. Happily, I found another copy of the photo on George Lowery's Cornell blog.


If you look at the "after" photo, you can see the large vertical water pipe that must have been the central feature of the lab at the time it was in use

The Hydraulics Lab had stood for 111 years.  The estimate is that to remove the remnants will cost a million dollars.  That leaves me wondering what did it cost to build the lab in the first place?  The rock of the building matched the walls of the gorge very nicely.  Was the rock for the building carved from the site or is most rock in the area roughly the same color as the gorge walls?

Can you imagine the expense and time it would take to try to build such a lab on that site today?  I'm sure it would have to be fully handicapped accessible, and would require bathrooms and a sewage system connection.   Most likely it would never get the necessary permits at all, but if it did, and if in another 111 years the modern replacement was to again collapse into the gorge, my hunch is that it would leave a heck of a lot more debris than the above picture shows.

Thinking about the old lab got me to wondering.   What motivated the engineering school to build such a lab on so challenging a site as this one more than a century ago?  The more I thought about it, the more I realized that engineering has sure changed a whole bunch since the late 1800's.  I entered Cornell's Engineering school in 1970.  As a freshman, I was in a select group that, as an experiment, studied PL/C computer programming instead of mechanical drawing.   Within a year or 2, the T-squares, drawing boards, triangles and mechanical drawing classes were gone entirely.   PL/C was a Cornell variant of the PL/I programming language.  PL/I's lifespan didn't turn out to be as long as that of T-squares.  Computing in 1970 was mostly batch processing.   We'd submit our programs on 80-column punched cards and get our error messages back on fanfold printouts that would come off a line-printer.  The printers would only print in upper case, unless you made special arrangements for a print-chain to be mounted that included lower case letters.   The Internet and the Web, even PC's were still many years off into the future.   Cornell's computer was an IBM 360/65 mainframe located off-campus out near the Ithaca airport that did both academic and administrative processing.  The computing facilities in Upson, Clark and Warren Hall's were just remote job entry stations, little (Well, the size of a kitchen counter. That's "little" compared to a room-sized 360/65) 360/20 computers to drive the card reader(s) and line printers and a 56Kbps (?) communication line to the mainframe at Langmuir Labs.  The giant mainframe had a total of 512KB of memory.   Today when I type that I have to force my fingers to type that K because my reflex is to think 512MB of memory would be unthinkably small.  (Just this weekend a friend asked me to look at his notebook PC to see why it was so slow.  I pointed out that he was running Windows Vista with only 1GB [that's 1024MB which is 2048x as much memory as Cornell's mainframe had back in the day] of memory).

So 35 years since I graduated from Engineering school, I'm wondering how did I ever write papers and stuff without Google.  I had a mechanical portable typewriter and if it hadn't been for corrasable paper, I'd probably have been stuck in high school until word processors became available.   They became available on campus to undergrads about 1973.   I remember Tim Metcalf, my very forward thinking roommate, used the by-then available online computer terminals to produce his resume while job hunting our senior year.   My portable typewriter and ream of corrasable paper apparently slipped through a window of opportunity as checking today for the correct spelling of corrasable, I find that that kind of paper apparently has been banned for final copies of thesis submissions as it doesn't have proper archival properties for long term shelf life of the typed documents.  If you wanted to buy such paper today, good luck to you.   Staples doesn't have it.   But then I was mildly surprised to find Staples still has a selection of a dozen varieties of typewriter to chose among.

But think back to the late 1800's when campus buildings were not yet wired for electricity.   Were there gas lights in the dorm rooms?  My memory of hydraulics as a topic in 1970's physics classes were maybe an experiment with a couple of columns of water, different diameter columns, connected to each other at the bottom with some tubing.  At first I was asking myself what the academic value was of a huge steel pipe encasing a column of water many feet tall in that ancient hydraulics lab to have justified the trouble and expense of building that hydraulics lab.  Then it hit me, hydraulics in the late 1800's surely wasn't something you'd only encounter in the service station's "lift" for raising your car for an oil change.   Hydraulics must have encompassed the study of water power for driving machinery.  Now I'd feel more confident in this speculation if I could find something about a large steam engine elsewhere in the engineering school to study another major source of mechanical power in the late nineteenth century.  I Googled for

cornell steam engine

and didn't find anything about a steam engine lab, but I did find an online copy of an 1878 book about steam engines by Cornell Professor Robert Thurston, and mention of a patented improvement to the steam engine that had been invented by Cornell Professor J. E. Sweet that apparently was the foundation of Brampton, Ontario having a manufacturing industry.

Hmm...  Given my tendency to have my attention wander off to tangentially related topics, maybe I'm lucky that Google wasn't around to distract me when I was in college.

In case you were wondering, the collapsed Hydraulics Lab was quite separate from the Cornell hydroelectric plant.   From digging around on the web, the Fall Creek hydroelectric plant was built in 1904.  By the time I was at Cornell in the 1970's, the plant had fallen into dis-use, but during one of the various energy crises (1981), the hydro electric plant was restored and apparently remains in service today.
Cornell Hydroelectric plant

If you do visit Cornell, be sure to wear comfortable walking shoes.  Puzzling that there hasn't been significant seismic activity in Ithaca, yet I found the hills are significantly steeper now than they were in 1970.  It's still a stunningly beautiful place to visit in the Spring or anytime that isn't winter.

Drew
Revised 08/03/2009 to fix a typographic error.
Revised 06/03/2010 to replace the link to the Cornell steam engine article.    The old link has gone 404 on me.
Revised 5/4/2013 to fix the URL's of the images. Old URL's as posted no longer worked, but thankfully the pictures are still online
Revised 9/21/2013 to replace the photo of the collapsed lab as the Cornell Sun copy has vanished from the web.
Revised 9/22/2013 to replace the link to the campus map, which went 404 on me too. New map has virtual tour feature! Revised mention of IBM 360's to provide a link to a web page to show what they look like lest I mislead in describing the "360/20" as "little".
Hey! Didn't you get the memo about Web 2.0? The idea is that you aren't stuck just reading the site. If you run into a missing photo or broken link or typo or even a bad idea, you can leave a comment to let me know about it, so I can fix things up.
Revised 9/22/2013 to replace the links about the hydroelectric plant with links that are currently in good working order.
Revised 9/22/2013 to replace the link about corrasable paper not being acceptable for theses final submission to put in a link that is currently in working order.
Revised link to staples web site and noted that they now have even more typewriters listed than they used to.












Thursday, June 18, 2009

New Tools

New Tools

After years of getting along just fine without it, thank you, I decided today I really ought to take a look at Google docs.  Why today?   Well, a friend, Ravi Narayan, had pointed me today at http://wave.google.com/, a rather long video intro to the soon-to-be-released Google Waves service.  The first 5 minutes of the video is boring as heck, but if you stick with it, I promise you it gets better.   They make a few mentions of the Google docs tools that I've been meaning to look at.  So, I finally had fresh motivation to at least look at the Google docs tools.

It was remarkably painless to get started.  Biggest hassle was that enabling the offline mode of operation required installing the Google Gears add-on to my Firefox browser.   And, of course, that required me to exit and restart the browser.  That wasn't so bad.  I confess that so far I've only really tried the word processor.  Puzzling to me that it doesn't seem to have any sort of program version identifier except for saying Google docs beta in the top left corner of the window.  I'm running Firefox 3.0.11 on Ubuntu 8.10 Linux on an Acer 5315-2122 notebook PC.   The Google Gears Firefox extension is 0.5.21.0.

I noticed the the Google Docs word processor makes it trivial to "publish" the document to a blog.  Since I've been told more than once that I really ought to try blogging, I went ahead and set up a blog account on Google's blogspot.com.   I was peeved to find that drew.blogspot.com is already taken, though quite inactive so far as I can see.   But seeing as my full name is Robert Drew Davis, I settled for rdrewd.blogspot.com.  Too bad I can't manage to be more humerously creative on demand for naming the blog.  So it goes.

If you still have time on your hands after watching the Google Waves video, I stumbled across this unrelated 40 minute video by a Google executive who gave a very nice lecture at his alma mater: Jonathan Rosenberg: Inside the Black Box.   I think you'll find that watching it is time well spent.

If you'd like a shorter video about a bit of the innards of Google Waves, see Google Wave: Live collaborative editing.

Know even less than me about Google docs?   Here's a video to get you oriented in less than 3 minutes:  Google Docs in Plain English.   And here's another even shorter one to explain the offline option: Google Docs: Working offline.

Having frittered away hours today watching these videos on youtube, I don't feel as bad about that time as I do with the non-refundable minutes I spent watching Charlie the Unicorn (Lesson:  Don't give in to peer pressure) and An inconvenient dessert.  So, while I'm on the topic of videos, I'll make a wish for software that I don't have a clue how to write:   I wish there was software that would  make it easy to skim through a video analogous to the way I can skim through a web page or a book to get the general idea without investing the time to actually see it all.  If it actually requires some level of machine understanding of the audio and video content, I believe it's going to be a long time before such a tool materializes.

Drew
Revised 12/07/2009 to touch up the link so it works while you're logged into the Google Wave preview.