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.