Showing posts with label Books. Show all posts
Showing posts with label Books. Show all posts

Tuesday, August 13, 2013

Geek Nostalgia...

Update: Mere minutes after I published this, reader, friend, and former colleague Doug W. wrote to say: “Sorry to out-geek you, but no way is this equation (from your blog today) correct.”  Out-geek me he did – and he caught a typo.  I've now fixed it (the pi / 2 term on the left)...

Long ago – before, I'm afraid, many of my readers were born – I was given the task of writing a “program library” that calculated a particular set of functions to a specified accuracy within a specified amount of (computational) time.  These included trigonometric functions, logarithmic functions, and a few others.

Initially I looked at Taylor series that converged on the functions I needed.  These are series with an infinite number of terms, each of which is trivially related to the terms preceding.  In other words, they're easy to compute.  It quickly became obvious, though, that the Taylor series converged too slowly to be useful for my problem – the computers I was writing the program for (Univac CP-642Bs) were just too slow.

What to do?  I did a lot of reading at libraries – first the San Francisco City library, then the technical library on the Navy base I was stationed at (Mare Island).  In the Navy's library I accidentally ran across a slim volume titled Approximations for Digital Computers, by Cecil Hastings.  As the preceding link shows, this book is well represented on the web even today (including free PDF and eBook downloads), despite it's 1954 publication date.

The book was a revelation for me, and a direct solution to my problem.  It contained numerous finite (and usually quite short!) polynomials that approximated most of the functions I needed, usually to better than the accuracy I needed.  Even better, for each of the approximations an error curve was included – and that could be directly used to improve the approximation even further.  Best of all, the first half of the book explains exactly how these approximations were created – so I could create my own approximations for the few that Hastings didn't already do.

Just as an example, here's the Hastings approximation for sin(x) that produces sines accurate to better than 1 part in 10-7:, for angle in radians, -1 <= x <= 1:

sin((pi/2)x) = 1.57079631847x - 0.64596371106x3 +
             0.07968967928x5 - 0.00467376557x7 + 0.00015148419x9

If you're a programmer, you'll see the beauty of that approximation right away. First of all, it's a finite series – no iteration to reduce errors is needed.  You just compute the five terms and add them up, and bada bing, bada boom, you've got your answer.  Second of all, the computation is easy – even for the ancient computers I was working with.

With that little book, and a couple weeks of work, I successfully implemented that programming library.  About a week after I delivered it (this would have been in 1973), a full Commander whom I didn't know dragged me out of a cryptography class and into a meeting with several Captains and a Rear Admiral.  At the time, I was a lowly E-5 (Petty Officer Second Class, in Navy parlance).  I had very little experience with officers of any rank, and absolutely none with this level.  I was terrified, and in spite of their best efforts,  only slightly put at ease by their smiles and evident good will.

This group of scary people told me why they'd dragged me up there.  They had given this problem (of writing that library) to two companies who had failed to deliver a usable result after more than a year of effort.  The second company declared it impossible.  The officers decided to give it to the school as a classroom exercise, thinking that it would make a good challenge to humble students upon.  The instructors, thinking it was for real, gave it to three of their best pupils, myself included – but as an assignment, not a challenge.  We all thought we had to deliver, or suffer some dire consequence.  The worst possible consequence was really, really bad – students flunking out of this school were sent to another school at Mare Island: the “swift boat” school, whose graduates went on patrols on Vietnam's rivers, and suffered the highest casualty rate of any of the U.S. Armed Forces.

So when those officers got back a piece of code after just three weeks that claimed to solve the problem, they were skeptical.  They tested it, and found that it exceeded both their accuracy specification and (especially) their performance specification.  They did find a couple of little bugs, but they were obviously just little bugs, not major fails.   So they dragged me out of class to explain to them just what magic I was using.

I happened to have the Hastings book with me, so I just whipped it out and showed them.  To say they were stunned – especially after I told them where I found the book – would be a major understatement.  Now they knew I wasn't a magician, but just a stubborn guy familiar with libraries :)

The best part of all, for me, was that they wanted to deploy this code as part of an upgrade to the Navy Tactical Data System (NTDS) – actual production code being used on our warships.  They pulled me out of class for two months (I just dropped back in on the next class cycle), and I worked with a hotshot Lt. Cmdr programmer and two Univac contractors to get my code tested and “production ready”.  That was the very first piece of production code I ever wrote, and I still get a warm feeling when I remember producing the master tape (for that was how we distributed code back then :)

Every few years since then, I've searched for a copy of Hastings' book.  Last time was probably ten years ago, when I bid on eBay for a copy – and lost, to someone willing to pay $200 for it.  A couple weeks ago I looked again – and found several copies available through Amazon's used book sources.  I ordered one that was in good condition, paying just $12 (including shipping!).  Today it arrived.

The copy I had used in 1973 was library-bound; the one I just received had the publisher's binding and the slip cover on it – so I didn't recognize the cover at all.  But the inside of the book – oh, my, that brought back good memories in a hurry.  Skimming Chapter 5, on Chebyshev polynomials, immediately brought back the sense of excitement, and even of adventure, that I felt on first reading this chapter.  I knew then even less mathematics than I do today, and that chapter was quite challenging for me to understand.  But once I did understand it, woo hoo!  “Revelatory” is the right word.

Awesome geek nostalgia moment!!!

Monday, May 20, 2013

Book Review: The Immortal Life of Henrietta Lacks...

Executive summary: excellent book; read it.

Henrietta Lacks was a black woman who died in 1951 – far too young, of cancer.  Her cells were sampled (without her knowledge or informed permission) and turned out to be immortal.  Such cells are incredibly useful for many different kinds of investigations and tests.  Researchers figured out how to grow her cells (dubbed “HeLa” cells) and soon they spread throughout the world of medical research.

That's an interesting bit of science history, and I can easily imagine someone writing a book about that.  That's not what Rebecca Skloot (the author of The Immortal Life of Henrietta Lacks) did.  In fact, science's use of HeLa cells isn't really detailed much at all in her book.  Instead, her book is mainly about the impact of HeLa cells on Henrietta Lacks' family – and Rebecca Skloot becomes a part of that story herself as she researches her book. 

I picked up this book thinking that it was going to be a sort of standard history of science book; a genre that I particularly like.  But instead it was something else altogether, something unlike any other book I've ever read.  Part science history, part human interest, part philosophy, and in places it reads like a novel.  I couldn't put the book down, and found much in it that provoked thought about the conflicts between medical research and human rights.  Some of these conflicts are avoidable, but others are, I suspect, intrinsic to the field. 

One helluva read, and I highly recommend it – despite the New York Times also recommending it :)

Monday, October 29, 2012

Nature of Code...

Daniel Shiffman's book The Nature of Code is up on the web, and free...

Friday, October 12, 2012

The Casual Vacancy...

I've just finished reading The Casual Vacancy by J. K. Rowling (the author of the Harry Potter series).  I enjoyed it, well enough that I'll buy and read whatever she writes next – but it sure was a big surprise!

First, it is most definitely not aimed at kids.  Unusually mature young adults might find it interesting, but clearly the main audience is adults, especially those with children (or at least with an interest in children).  Unlike with the Harry Potter series, in this book the plot isn't the core of the book – instead, it's with the detailed study of different personalities, of personal interactions (and their consequences, intended or not), and most especially of how children are impacted by the behavior of the adults around them.  There are quite a few interesting characters in this novel, and every one of them is painted with great attention to detail.  The entire novel is plausible – even, unusually, the bit of technical wizardry that is part of the plot (some kids hacking into a web site). 

When I finished, I wondered to myself if there was anything about her new novel that was like the Harry Potter series – because at first blush they seem utterly different.  But I did identify one common thread: complexity.  This novel, like the Harry Potter books, is engineered – by which I mean that she absolutely must have started by thinking out all the characters, their inter-relationships, and the timeline of events.  I know for certain that she did exactly this with the Harry Potter series, because I've seen her worksheet (a sort of handwritten spreadsheet) for that published on the web somewhere.  I'd be willing to bet you that she did the same thing for The Casual Vacancy.  It's just too darned complex to have happened by accident.

Bottom line: thumbs up.  It will take you a chapter or two to get immersed in the world she crafts, but after that you'll be completely engrossed...

Thursday, July 12, 2012

The Fourth Time...

I just finished reading The Hobbit and the Lord of the Rings trilogy for the fourth time in my life.  The last time was about 15 years ago; the first time in the late '60s.  It was just as fresh and enjoyable to me this time as it was the first time, and just as terrific an escapist piece.  This is the first time I've reread the books since I first saw the Lord of the Rings movies, and finding the differences between the movies and the books added another bit of interest.

Monday, April 2, 2012

Escape from Camp 14...

This is one of the most intense non-fiction books I've read in years.  I've read a lot of history, which of course includes much about man's cruelty to man.  Only a few of the books I've read have the sheer emotional impact of this book.  Highly recommended, especially for anyone interested in current affairs.  You'll come away with a much better understanding of the cauldron of evil that is North Korea – and the reasons why it won't be easy to rid ourselves of it...

Blaine Harden's Escape from Camp 14 is the story of a North Korean man (Shin Dong-hyuk) who was born into what was intended to be a short, cruel life in the harshest of North Korea's slave labor/concentration camps.  For most of his life, he knew nothing of the world outside the camp.  He'd been taught to read and do basic arithmetic, but only so that he could perform the work in the camps.  His life was completely dominated by the daily struggle for food.  Though his parents were also in the camp, he knew nothing about familial love – his relatives were, basically, competitors for food.

The litany of what Shin endured in Camp 14 is mind-boggling: starved for years, recovered from injuries with no medical care, brutally punished frequently by guards and teachers for things like eating a few kernels of corn (or nothing at all), turned his mother and brother in for attempting escape – and then watched as both were brutally executed. 

After reading the book, what seemed even worse to me was Shin's making it all the way to adulthood in near-complete ignorance of the evilness of his context.  He had no idea that the world offered anything better, and no hope of ever obtaining better.  His dreams were of roast meat, as he knew nothing else to dream about...

Sunday, November 27, 2011

Sunday, February 13, 2011

The Ultimate Cookbook...

It's 2,400 pages and 47 pounds, and costs $625.

I think I'll wait for the Kindle edition...

Tuesday, January 4, 2011

Fascinating Side-Effect of the Kindle...

One that I certainly wouldn't have foreseen: sales of bodice-rippers are soaring, and all the growth is in the Kindle editions.

Strange are the ways of the world...

Tuesday, December 7, 2010

Reading...

Several months ago I purchased a Kindle, and I've been using it ever since – I haven't read a single paper book since first picking up the device (though I do still read paper magazines and the occasional newspaper).  At this point I have read almost 40 books on my Kindle, and my style of using it has settled down.  I can make some observations based on experience:

I don't miss the paper format at all.  The convenience and portability of the Kindle far outweigh any aesthetic loss.

Having an entire library (over 300 books now) that I can carry around means that I now find myself much more easily jumping around from book-to-book, reading what suits my mood and mental state.

The dictionary and word look-up facility built into the Kindle has me now doing something I did decades ago, but stopped: looking up every word I don't know.  The only ways Amazon could make this feature any better would be to (a) speed it up (it now takes 10 seconds or so to look up a word) and to (b) switch to the O.E.D. as the dictionary (“antique” words are often not in the Merriam dictionary included, and I read enough older literature for this to be annoying).

The fact that I can download and read copyright-free books at no cost has me exploring all sorts of books that I'd probably never buy.  For example, I've just finished rereading Gulliver's Travels (Jonathan Swift), which I last read in my twenties.  I've also reread all of Jules Vernes' works that were translated to English, and I'm starting on Charles Dickens (many of which I've never read). 

I'm also buying books that I might not have purchased on paper, because of the cost differential.  For example, I recently purchased Decision Points (George W. Bush), and read it.  I'm glad I did – I rather liked the book (something I didn't expect), and it clarified something for me: that the essential thing I liked about Bush as President had nothing to do with his competence, but rather his decency and humility.  In this respect, the contrast with the current President couldn't be more stark...

Wednesday, September 29, 2010

Book Review of the Day...

From one of my favorite bloggers, TJIC (aka Travis J. I. Corcoran), who just read a book and really didn't like it all that much.  His review's conclusion:
I demand that this man (Editor: i.e., the author) be dragged to my quarters, be stripped to his shorts, and be staked out over an ant hive…

…at which point I will kick him in the balls over and over and over until I’m so tired that I’ve forgotten that this book exists.
But you'll definitely want to read the whole thing (if only so that you don't accidentally read the book being reviewed!)...

Saturday, May 22, 2010

Book Review: The Price of Glory...

Written by Alistair Horne, The Price of Glory is an eminently readable history of the horrifying Battle of Verdun in 1916, during the first World War.  The perspective of the narrator rambles over almost every possible position, often deliberately contrasting perspectives within a few sentences of each other.  For instance, in describing the battle for Fort Douaumont, the narrative flips freely from the perspective of the German attacker to the French defender, then from a front-line soldier to the battalion commander and then to the commanding general and even the politicians.  Horne is adept at weaving all these perspectives into a story that gives the reader a much deeper appreciation of the entire event.

And what an event!  Even before I read this book, I'd read enough about WWI to make the word “Verdun” unusually evocative of the horror of war.  After reading this book, I have the same deeply horrified feeling one has after reading one of Edgar Allen Poe's novels – with the additional frisson of knowing that Verdun really happened.  And, one can't help but think, might possibly happen again...

Highly recommended reading for anyone with even the slightest interest in World War I...

Link to Amazon: The Price of Glory: Verdun 1916

Sunday, May 2, 2010

Book Review: With the Old Breed...

With the Old Breed, by E. B. Sledge is remarkable for its focus on the lot of a Marine in the Pacific battles of World War II.  Only the barest high-level view is presented, just enough to give the reader the context in which Sledge and his fellow Marines fought.  This is not an analysis of the battles on Peleliu and Okinawa, but rather a straightforward description of what it was like for an ordinary American frontline soldier to be in those battles.  Sledge was a member of a 60mm mortar team, and spent most of his time in those battles at or immediately behind the front lines.

The prose is neither worshipful nor breathless, and is consequently all the more believeable.  I came away from reading this book with exactly what I'd hoped for in a descriptive history: knowledge of what actually happened.  The brutality of some scenes from this book are quite shocking, even to someone like me who has read extensively about World War II.  At the same time, more recent brutality on display from Al Qaeda, the Taliban, Hamas, and other terrorist organizations reminds one that mankind's capacity for such brutality has not disappeared.

Highly recommended reading for anyone interested in learning about the Pacific theater in World War II.

I'm glad my country never needed me to fight in any way that resembles how these men fought – and I'm profoundly grateful that there are men capable of doing so.

This book was made into the recent miniseries Pacific.  I have not seen the miniseries myself (I rarely watch television at all any more), but a friend and fellow history buff assures me that it resembles the book in only the most obscure and irrelevant ways, essentially filtering the entirely apolitical book through a progressive, politically-correct lens.  That assessment is more than enough to ensure that I will never watch the miniseries!

Wednesday, April 28, 2010

Recommended Books...

I recently finished two books that I highly recommend to anyone interested in 20th century history.

First is Churchill, by Roy Jenkins.  This is a superb biography of Winston Churchill, written by a well-known member of the House of Lords.  Its focus is political, but the other aspects of Churchill's remarkable life are not neglected.  I've read several other biographical works on Churchill, all focused on his World War II leadership; this one filled in many of the blanks for me. 

Second is a much shorter read: The Fall of Fortresses by Elmer Bendiner.  This is a classic work that I had never previously read.  It is by far the best depiction of the life of a bomber crew that I have ever seen.  Bendiner was a B-17 navigator who survived his 25 missions and came home in one piece.  Thirty-five years after the war, and after gaining a much wider perspective, he wrote this work that ranges from how the windows frosted up at high altitude to pondering the strategic wisdom of the bomber strategy.

Saturday, February 6, 2010

Immortal Human Cells...

The first line of human cells capable of reproducing ad infinitum (hence the label “immortal”) were derived in 1951 from a tumor on the unfortunate Henrietta Lacks.  Her cells have been used in thousands of medical experiments and tests, and they're still in use to this day.  Here's the fascinating story, which is the subject of a new book by Rebecca Skloot.

Thursday, December 3, 2009

Going Rogue...

Last night I finished reading Sarah Palin's Going Rogue.  A few reactions:
  • It's certainly no literary masterpiece, and I suspect she'd be quick to agree with that.  I had no problem staying awake while reading it, but I wasn't riveted by either the prose or the content.

  • She's very quick to use her religious beliefs instead of thinking.  By this I mean that you'll find her quite casually attributing an event to God's will (and not thinking it out any further), or justifying a position with by invoking God's desire instead of a thought-out ideology.  Palin invokes Reagan frequently in the book, but Reagan was in fact a very different kind of political animal – he was religious, of course, but his religion was the foundation for his ideology, not the ideology itself.  Palin comes across as having very little ideology beyond her religion and a vague, general sort of Alaskan independence, libertarianism, and scrappiness.  I like the latter elements; the first one scares me.

  • The last ten pages or so were the most interesting part of the entire book.  In this section, she comes closest to offering a vision of what we might expect from her in the future.  I read it closely, as I strongly suspect that Palin will be a factor in our nation's future politics.  I was disappointed, not so much by what's there, but by what's not there.  There is no clear vision, no clear agenda, no clear ideology.  I still know only vaguely what Sarah Palin believes in (other than God) – and I suspect the same thing is true of her.  I don't see a Ronald Reagan or Maggie Thatcher here, but rather a cartoonish copy, without foundation, wrapped in an attractive package.  I wish I could say otherwise.

  • I'm less likely to vote for her now (for any office) than I was before reading the book.  I can still imagine circumstances where I might vote for her as the lesser of two evils.  For example, if one could imagine (say) a 2012 ticket of Obama/Pelosi vs. Palin/Romney, I might well hold my nose and vote the Republican ticket – not so much because I was attracted to it, but because the alternative was so much worse.  But I would certainly not be an enthusiastic supporter of hers.

  • It seems to me unlikely that Palin would actually be able to clinch the Republican ticket in 2012.  Not impossible, but unlikely.  More likely is that she could make a robust run as an independent, like a modern Ross Perot.  I can easily imagine her forming a strong third party with the “tea party” folks as her base.  I can imagine any number of partners for her (Glenn Beck came immediately to mind, though the thought sends shivers of fear through me).  Would such an independent ticket have a chance?  The probabilities are against it; a more likely outcome is a badly split vote on the right, and a unified vote from the liberal opposition – not a pleasant outcome for me. 

Tuesday, July 22, 2008

Books...

Well, I finally made it back home, on Sunday evening. Naturally I was greeted with a large pile of things to do, both at home and at work. I think my week will be quite busy!

While on the trip (especially on the plane flights), I had time to read four books – all excellent and highly recommended:
  • American Patriot by Robert Coram. This is hands-down the best biographical work on a soldier of the Vietnam war that I have read. I was riveted, from the first page to the last. Colonel Bud Day (the subject of the book) is a man well worth knowing about – awarded the Medal of Honor for his actions while in prison in North Vietnam. He was the cellmate of John McCain; he and Mr. McCain helped each other survive that episode with their honor intact. Definitely in the “don't miss” category.

  • Generation Kill by Evan Wright. An excellent and sympathetic portrayal of the Marines of the First Recon Battalion as they invaded Iraq in 2003. This book has been criticized in some quarters for its allegedly biased reporting of civilian casualties in the war, but I think those critiques are more borne of ideological biases of the critics, and not faulty reporting by Mr. Wright – bad things happen in wars to perfectly innocent people, and I'm inclined to believe that's just as true in Iraq as it has been in all the wars of the 20th and 21st centuries. This book is well worth your time, most especially if you'd like to read some inspiring stories about the young men and women in America's military today.

  • Last of the Amazons and Gates of Fire, both by Steven Pressfield. These are the first two novels by Mr. Pressman that I've read, but they will not be the last. As the blurbs proclaim, his battle scenes are some of the most believable I've ever read. I've never been in combat, but I have been in the military – his portrayals of soldiers, especially in their ordinary lives, ring of truth and accuracy. Mr. Pressfield was a Marine (and his books are popular with our U.S. Marines today). Though he is not a professional historian, from everything I've read the historical events depicted in his novels are accurately represented, with some minor exceptions in timing, to improve the flow of the novel. The dialog is sprinkled with terms familiar to modern readers, and almost certainly not to contemporaries of the characters in his novels – the author takes this license to improve modern readers' understanding. I think it works, and brilliantly. Last of the Amazons is set in ancient Greece and its surrounding areas, and mainly is about the Amazon culture of women warriors. Gates of Fire is about the legendary (but real) Battle of Thermopylae, fought by a tiny detachment of Spartans and some allies against hordes of Persians. Both are superb, and highly recommended – and I will be reading the rest of Mr. Pressman's works.

Tuesday, July 1, 2008

War and Decision...

Even though the war in Iraq started just five years ago, there have already been quite a few books about it published. Unfortunately, most of these books have been written by people with a much stronger grasp on their opinions and ideology than on the facts. I've been assuming that we'd have to wait a decade or more before any first-hand material made it through the declassification and publication pipeline – but I've just finished reading one that has made it already: War and Decision, by Douglas J. Feith. Mr. Feith is not an outside observer – he was the Undersecretary of Defense for Policy from 2001 to 2005, and was right in the middle of all the decision making that led up to the war and through the first two years of the war.

This book has received very little attention in the mainstream media, and after reading it, it's easy to see why: the book demolishes the mainstream media's cherished myths about how we decided to go to war against Saddaam Hussein, and about why we conducted the war and its aftermath as we did. The book has the unmistakable ring of authenticity and truth – Mr. Feith is an observer with his own biases, but he writes like a historian, with scrupulous attention to sourcing and citations. Click on the link above to read other reviews of this fine book (not all of them are positive), and to buy it from Amazon if you'd like to. I highly recommend it.

Saturday, June 28, 2008

Wolf Totem

I just finished a most excellent book: Wolf Totem, by Jiang Rong, translated by Howard Goldblatt. This is (amazingly) a first novel by a Chinese writer; the writer's own experiences were the “research”. Most of the novel takes place in China of the 1960s, in the crazy days of Mao Tse Tung. The main character is a student who was forced out of the city and school to go work in the countryside. He volunteers to go to the most primitive place in all of China, to live with the nomadic Mongolian tribes who herd horses, sheep, and yaks.

As a reader, you walk away from this novel with a very detailed picture of the hard, surprisingly complex life of the Mongolian tribes. Their lives were immutably interlinked with the health of the vast Mongolian grasslands and the major creature populations it supported: humans, mice, marmots, sheep, horses, yaks, and...the awesomely fierce Mongolian wolves. Humans and wolves shared the top of the food chain, and had to stay in balance to keep the grasslands healthy. Human culture grew up around that need, with lore and custom finely honed to keep everything working.

Later in the novel, modern technology and an alien culture (the Han Chinese) moved into the grasslands, with technology and an utter disregard for maintaining the grassland habitat. The results are entirely predictable, and very sad. The novel can be read as a withering critique of the central Chinese “management” of Mongolia – which makes it all the more surprising that this book is a runaway bestseller in China, and has not been restricted by the government. In fact, this book has outsold any book ever published in China, save one: Mao's Little Red Book.

Don't miss it – it's simply wonderful.

Friday, April 18, 2008

Moment of Truth in Iraq...

I finished this book a couple of days ago.

Near the end Yon writes these words that resonate strongly with me:
“We can win. But we can still lose.

And if we lose, Iraq will be the worst foriegn policy disaster in our history. Imagine Vietnam, then multiply it by al Qaeda and Iran.”
His book is fascinating and full of informed perspective that's almost entirely missing from the mainstream media. It's a book written by someone who is an unabashed supporter of the war in Iraq – but who is also an unabashed critic of how it has been conducted (most especially before General Petraeus took over). Michael Yon is a warrior himself (Green Berets), and has the professional soldier's ingrained habit of seeing the world pragmatically, honestly – you won't get a less biased view of Iraq from anyone else I've ever heard of.

Run, don't walk, to buy his book. Whatever your view of the war in Iraq, you'll come away more informed.