February, 2010

Graham Greene’s After the Affair

February 22, 2010 @ 8:53 pm · Filed under Culture

The other book I read this weekend was Graham Greene’s The End of the Affair. This book explores some of the themes of loss, commitment, and Catholicism that later show up in The Comedians, but it’s less mature in many ways. The story is less believable, and the rushed ending is irritating. Overall, though, it’s a an extremely moving account of love gone badly wrong. Many people group Greene with fellow Catholic novelist Evelyn Waugh, and After the Affair is often compared to Brideshead Revisited. But, Greene was temperamentally far better equipped to realistically write about sex than Waugh, and this book shows it. There are some hauntingly beautiful passages in the book, particularly the diary excerpts that constitute the center of the book’s plot. My favorite quote, though, is the following passage on unhappiness and happiness:

“The sense of unhappiness is so much easier to convey than that of happiness. In misery we seem to be aware of our own existence, even though it may be in the form of a monstrous egoism: this pain of mine is individual, this nerve that winces belongs to me and to no other. But happiness annihilates us: we lose our identity. The words of human love have been used by the saints to describe their vision of God, and so, I suppose, we might use the terms of prayer, meditation, contemplation to explain the intensity of the love we feel for a woman. We too surrender memory, intellect, intelligence, and we too experience the deprivation, the noche oscura, and sometimes as a reward a kind of peace. The act of love itself has been described as the little death, and lovers sometimes experience too the little peace. It is odd to find myself writing these phrases as though I loved what in fact I hate. Sometimes I don’t recognize my own thoughts. What do I know of phrases like ‘the dark night’ or of prayer, who have only one prayer? I have inherited them, that is all, like a husband who is left by death in the useless possession of a woman’s clothes, scents, pots of cream . . . And yet there was this peace . . .”

For my thoughts on The Comedians, see my post Let Us Go Up to Jerusalem and Die with Him

| Comments

Hadrian and the Triumph of Rome

February 22, 2010 @ 8:34 pm · Filed under Culture

I read Anthony Everitt’s Hadrian and the Triumph of Rome on Sunday. It’s a pretty conventional biography of Hadrian. Overall, I’d say it’s about the same quality as his work on Augustus (Augustus: The Life of Rome’s First Emperor). But, that’ s not saying much I’m afraid. In the end, there’s no substitute for Suetonius’s The Twelve Caesars.

| Comments

Metaphors of Science

February 16, 2010 @ 9:06 pm · Filed under Culture

“We proceed in step-by-step discussion from inference to inference, whereas He conceives through mere intuition. Thus, in order to gain insight into some properties of the circle, of which it possesses infinitely many, we begin with one of the simplest; we take it for a definition and proceed from it by means of inferences to a second property, from this to a third, hence a fourth, and so on. The divine intellect, on the other hand, grasps the essence of a circle senza temporaneo discorso (without the use of the profane reasoning) and thus apprehends the infinite array of it’s properties.”

— Galileo quoted in An Introduction to General Systems Thinking (Silver Anniversary Edition).

What Galileo discusses in this quote is the human inability to conceive of two properties at the same time. Similarly, we are incapable of thinking about two causes acting simultaneously. Instead, we are forced to break them out and think of them one at at time. Incidentally, this was a primary factor in my dissatisfaction with history. By our nature, humans are incapable of writing a coherent history of any event. Instead, we can merely contribute one of many complementary views. But God, as Galileo notes, is defined by his ability to conceive of a thing as a whole; rather than by a sequential consideration of properties. Now, what Galileo defined as Godly, will soon, I believe, be true of computers. One day, machines will have a richer view of the world than humans do, and will think of it in ways we cannot.

| Comments

Problems with Interpreting Observations

February 14, 2010 @ 9:40 pm · Filed under Culture

Recently, I’ve been reading An Introduction to General Systems Thinking (Silver Anniversary Edition). It’s a fascinating book, with insights on almost every page. Here’s the author’s thoughts on the problems of interpreting observations:

Whenever we observe a state that is both conspicuous and improbable, we are faced with a quandary. Do we believe our observation or do we invoke some special hypothesis?

Conservatism is introduced into the scientific investigation by the very assumption that observations must be consistent with present theories. An observation is more likely to be discarded as “erroneous” if it is out of consonance with theory. … The complete substitution of theory for observation is, of course, not scientific. Even worse is going through the motions of observing, but discarding as “spurious” every observation that does not fit theory.

This, then, is the problem. Raw, detailed observation of the world is just too rich a diet for science. No two situations are exactly alike unless we make them so. Every license plate we see is a miracle

“A statue is a situation which can be recognized if it occurs again.” But no state will ever occur again if we don’t lump many states into one “state.” Thus, in order to learn at all, we must forego some potential discrimination of states, some possibility of learning everything.

Science does not, and cannot, deal with miracles. Science deals only with repetitive events. Each science has to have characteristic ways of lumping the states of the systems it observes, in order to generate repetition. How does it lump? Not in arbitrary ways, but in ways determined by its past experience — ways that “work” for that science. Gradually, as the science matures, the “brain” is traded for the “eye,” until it becomes almost impossible to break a scientific paradigm (a traditional way of lumping) with mere empirical observations.

Now, if the issues outlined in the above quote are a problem for the hard sciences, they are a disaster in fuzzier disciplines like history, economics, and politics. They also have implications for business. Most of the time, you will find, that there is no widespread agreement among your co-workers on the state you are facing. And, if you all do agree, it’s probably just that your viewpoints are not really independent, not that you are all correct.

| Comments

PHP Insertion Sort

February 10, 2010 @ 12:38 pm · Filed under Code

Insertion sorts are good when your data is already partially sorted, or if you have a small collection to sort. That’s about the best I can say for them. Here’s two versions in PHP. The first uses two functions:

function insertion_sort($a)
for ($i=1; $i < count($a); $i++) { inserter(&$a,$i,$a[$i]); } }

function inserter($a,$pos,$a_value)
$temp = $a[$pos];
$i = $pos;
while($i >= 0 && $a[$i-1] > $a_value)
$a[$i] = $a[$i-1];
$i = $i-1;
$a[$i] = $temp;

The second uses one function:

function insertion_sort($a)
for($j=1; $j < count($a); $j++) { $temp = $a[$j]; $i = $j; while(($i >= 0) && ($a[$i-1] > $temp)){
$a[$i] = $a[$i-1];
$a[$i] = $temp;

To test them, use the following code:

$haystack = array(1,5,6,3);
print_r ($haystack);

| Comments

PHP Sequential or Linear Search Algorithm

February 8, 2010 @ 2:07 pm · Filed under Code

Sequential search, or linear search, is the simplest searching algorithm. Indeed, given it’s brute force approach of just traversing a collection from the first to last element, it’s hard to justify calling it an algorithm at all. However, here’s an example in PHP:

function sequential_search($needle,$haystack) {
for($i = 0; $i < count($haystack); $i++) { if ($needle == $i) return true; } return false; }

Here's an example of how you would use this algorithm to look for the number 3 inside an array:

$haystack = array(1,2,3,4);
$needle = 3;
$success = sequential_search($needle, $haystack);

| Comments

Who is Going to Organize Social Information on the Web?

February 8, 2010 @ 8:48 am · Filed under Technology

Mike Arrington has a good post today on how social media today is a lot like search was 10 years ago. You can read it here. In it, he notes

“The online social landscape today sort of feels to me like search did in 1999. It’s a mess, but we donĂ¢’t complain much about it because we don’t know there’s a better way.

Everything is decentralized, and no one is working to centralize stuff. I’ve got photos on Flickr, Posterous and Facebook (and even a few on MySpace), reviews on Yelp (but movie reviews on Flixster), location on Foursquare, Loopt and Gowalla, status updates on Facebook and Twitter, and videos on YouTube. Etc. I’ve got dozens of social graphs on dozens of sites, and trying to remember which friends puts his or her pictures on which site is a huge challenge.

And the amount of spam and just general nonsense that is flooding all of these services is crippling. As a user, I spend far too much time weeding it all out to find the few gems of real content from people I care about.”

He then goes on to call for someone to organize it:

“Someone will eventually help us make sense of all these various types of services, and help us separate the noise and spam from the real signal. I don’t know who’s going to do it, and I certainly don’t know how (if I did, I’d be doing it, not writing about it). But at some point soon, one of the Internet giants, or some new startup we’ve never heard of, is going to fix this mess for us.”

While I agree with both of his points, I don’t think figuring out the when and who is that difficult. I’m willing to confidently predict that the social media space will be organized in the next two years, and that it will be done by either Facebook or Google. The reason I have such confidence in this prediction is simple. Facebook and Google are the only two companies that have both the computing power, and the ability to collect the information necessary to actually organize the social space. Actually collecting the social information on is the first, and larger, problem. Here, Facebook has a huge advantage over Google, because it’s the largest social network in the world. However, it’s only a relative advantage. Google is a close second in the amount of information it collects. The second problem is that actually organizing the world’s social graph is a large-scale computational problem that is even more difficult than organizing the world’s web pages. Now, I was extremely impressed with the amount of technical energy I felt at Facebook when I visited their campus for the Hip Hop for PHP event, but Google still has a huge advantage in computing resources and skill. Google’s basic computational infrastructure is far ahead of Facebook’s, and indeed anyone else’s infrastructure..
So, out of these two, who would I bet on? I’d make Google the 2-1 favorite. But, as we saw in the Superbowl yesterday, favorites don’t always win.

| Comments

HipHop for PHP

February 2, 2010 @ 1:52 pm · Filed under Technology

Here’s my quick take on HipHop for PHP that was posted by Larry at ZDNet. I’m attending the HipHop event tonight, and I will add more about it later.

| Comments