Skip to content

Books - 4. page

Book Review: Google Maps API V2

Seven months ago, I wrote about Google Maps Gotchas. I mentioned Scott Davis’ Google Maps API Pragmatic Friday article, published by the Pragmatic Programmer folks. Well, a few things have happened since then. In April, Google released version two of their maps API (though they still haven’t set a date when version one will no longer be supported), Scott revised his article and I spent a tax deductible $8.50 to give it a read. What you’ll find below is my take on his article.

The good: first, the ordering was easy, and I received my custom PDF (complete with “Prepared Exclusively for Daniel Scott Moore” as a footer on every page) in less than 20 minutes. Scott explains in a very easy to understand fashion how to create a map. He also covers each of the API’s javascript objects and how to use them. In particular, I thought the list of events and objects that fire them (in the ‘Events’ chapter) was a good reference. Now, Google provides a class reference, but Scott’s are a bit easier to understand here’s a comparison, for the Gmarker class:

Google API:

A GMarker marks a position on the map. It implements the GOverlay interface andthus is added to the map using the GMap2.addOverlay() method.A marker object has a point, which is the geographical position where the marker is anchored on the map, and an icon. If the icon is not set in the constructor, the default icon G_DEFAULT_ICON is used.

After it is added to a map, the info window of that map can be opened through the marker. The marker object will fire mouse events and infowindow events.

Davis’ Book:

In the Core Objects section, we introduced the GLatLng. A GLatLng stores a Latitude / Longitude coordinate, but it doesn’t offer you a way to visualize it on a map. A GMarker is the way to add GLatLngs GMarker to the map for display purposes. The GMarker constructor takes a GLatLng as the only required argument.Once we have the marker, we need to tell the map to display it; map.addOverlay(myMarker) should do the trick. (Objects that you superimpose over the map are called Overlays.) You can remove the Overlays marker using map.removeOverlay(myMarker). To remove all overlays, use map.clearOverlays( ).

var myPoint = new GLatLng(38.898748, -77.037684);
var myMarker = new GMarker(myPoint);
map.addOverlay(myMarker);

Theoretically a map can support an unlimited number of markers, but anecdotal evidence suggests that performance starts to slow down significantly after a hundred or so markers. (File under, “Doc, it hurts when I do this.”)

I liked the real world examples–the fact that you could click through and see the code Scott was writing about in action on his website is a real plus. In addition, he builds a decently complex example in Chapter 7 where the user can add and delete cities. He also gives a good warning about examples that use Gmap, rather than Gmap2.

However, there were some issues. Scott’s coverage of the upgrade to version two of the API is, unfortunately, rather spotty. In his blog, the June release of that feature, and the April revision of the book). He also doesn’t cover GDownloadURL, a convenience method for XMLHttpRequest processing, or the GUnload methods. I’ll freely admit that the maps API is a moving target, and some of the omissions above may be due to that.

However, there are other problems. Though billed as a beginner book, he omits what I consider to be one of the fundamental challenges of Google Maps development–the performance obstacles large numbers of database driven markers (other than the comment mentioned above in the GMarker reference). In addition, he doesn’t cover design options, nor cross browser issues (like the transparent PNG in IE issue).

In the last chapter, he mentions good examples of mapping websites, but Scott omits references to useful websites–something that even dead tree books do. In particular, he doesn’t mention mapki.com (a wiki full of useful user provided data) nor the Google Maps group (which some users consider a primary differentiator between Google and Yahoo Maps).

One final gripe is that the 75 pages of content that I expected were really only 45–text only filled about 60% of the column width. I expect that in articles I read for free on the web, but in books that I pay for, I like a bit higher content to page ratio.

In short, this ebook is a good choice for the first time Google Maps builder. This is due to the tutorial nature of much of the book, the examples, and the explanation of typical good javascript code, such as using anonymous functions for the event handlers. It is not entirely adequate in covering version 2 of the API, possibly due to API changes, and it ignored some of the more complex aspects of the API.

If you’re looking for a folksy introduction to Google Maps api, it’s worth the $8.50 to have a coherent guide. If you’ve muddled through one google maps project, piecing together things from the API docs and various blogs, it becomes less worthwhile. But if you want some kind of discussion about complex Google Maps issues this document is not the right place to look.

[tags]Scott Davis, Google Maps, Pragmatic Fridays[/tags]

Book Review: Fallout

This graphic novel, subtitled “J. Robert Oppenheimer, Leo Szilard, and the Political Science of the Atomic Bomb”, is a good quick read. It’s hard for my generation, raised with the fall of the Soviet Union, to appreciate how stupendous the atomic bomb really was. But this book does a great job of making the history of that period accessible. The book is not that short–around 200 pages–but, due to its graphic nature, is very easy to read.

Fallout is really divided into two major sections. The first is concerned with the idea and creation of the atomic bomb, starting from Szilard’s ideas in the 1930s and ending with the Trinity test in 1945. The second is concerned with the inquiry into Oppenheimer’s advisory position to the Atomic Energy Commission, which occured in the political climate of the 1950s. Both these are worth reading, but the second one, which has much more text–portions of letters are printed along with the graphics–is a chilling reminder of the craziness of that time.

With 6 different authors listed on the cover (and more in the back pages), the illustrations change often enough that you do have to pay attention to know who is speaking. Additional difficulties arise because there are so many characters. I think the book would be stronger if one author had been responsible for all of the graphic content because the characters would be easier to keep track of.

One very nice aspect of this book is the end notes. At the back of the book, extensive text outlines what parts are true and what parts are surmise. As the front of the book saysm “many of the quotes and incidents that you’ll think most likely to be made up are the best documented facts.” For example, Teller, one of the scientists, denies his similarity to Dr Strangelove, and another, Szilard, devises his own cancer treatment using radiation.

All in all, if you’re in for a light introduction to the history of one of the heaviest subjects, Fallout is a good choice.

“Fallout” at Amazon.

[tags]atomic bomb, graphic novel, oppenheimer[/tags]

Book Review: What Just Happened

I recently read ‘What Just Happened’, by James Gleick. I’m a big fan of his–I read ‘Chaos’ years ago. This book covered the history of chaos theory; I was engrossed by the fluid writing and deft handling of such a tough subject.

‘What Just Happened’ is not such a book–rather than a coherent look at recent history, this book is a collection of stories spanning that time (from 1992 to 2001). From spam to bugs to online pornography to passwords to email forwards, Mr Gleick covers a number of issues that are still relevant for us today. I will say that the number of forwards I’ve gotten since I left college has fallen dramatically, but the amount of spam has not. The internet still ‘makes it all too easy to fling random illiterate drivel across the planet’.

There are also a number of neat historic references. There is a five page article about Y2K, written in Jan of 1999, where Mr Gleick was already saying that we had nothing to worry about come 1/1/2000. Another suggests ways to ‘make Microsoft for capitalism’, written just around the release of Windows 95. Remember when we thought we could count on the US government to deal with monopolists?

On a personal note, I have to link to Zia Consulting, because one of their principals was mentioned in this book; you could apparently page Bindu Wavell over the Internet in December 1995.

The format of this book makes it a nice bus read. None of the articles are longer than forty pages and many are a good deal shorter. Whether you nod your head in agreement with some of the issues covered that are still present, or are wistfully transported back to the days when you were still interested in checking the status of a Coke machine over the Internet, this book has its moments. If you enjoy pop tech at all, or if you’ve been caught up in the wave the Internet has created over the past 15 years, chances are you’ll enjoy this book.

“What Just Happened” at Amazon.

“The Enthusiastic Employee” Author Interview

Here’s a very interesting interview with one of the authors of “The Enthusiastic Employee”. Updated 12/2/2006: Apparently you now have to sign up to view the interview. Here’s a tidbit of the interview to let you know if you want to sign up for a free account:

Knowledge@Wharton: Your research shows most workers are happy at a new job for about six months before the honeymoon ends. What goes wrong?

Sirota: We are often asked how to motivate employees. Our response is, that’s a silly question. The real question is: ‘How do you keep management from destroying motivation?’ When we look at the data we find that people coming to a new job are quite enthusiastic. Most of them are very happy to be there and looking forward to meeting their new coworkers. But as you study the data you find morale, or enthusiasm, declines precipitously after five or six months. One theory is that there is a natural honeymoon that is bound to end. And yet we find that in 10% of companies the honeymoon continues throughout a worker’s entire career. So there are organizations that are able to maintain enthusiasm.

As a general proposition it is hard to be enthusiastic about an organization that is not enthusiastic about you. Let’s look at a few specific things. One is job security. We expect employees to be enthusiastic, loyal and engaged in an organization, but with the slightest downturn or prospective downturn we get rid of them. They are expendable. They are treated like paperclips. How can you be loyal and committed to an organization that seems to have absolutely no concern about your job?

“The Enthusiastic Employee” at Amazon.

Book Review: Saving Capitalism From the Capitalists

If you’ve seen ‘Meet the Fockers,’ you probably remember the scene where Greg’s parents have constructed a shrine to him, full of 8th place medals and the odd 10th place ribbon. Greg apparently didn’t do too well in competition, but his parents loved him anyway. Not everyone is so forgiving, and most people had competition. To rephrase that, most people hate losing at competition–winning is just fine, thank you very much. In a free market system as well, most firms and people don’t like competition–it forces firms to respond to customers and people to work harder. However, the overall benefits to society are larger in a system where everything is competitive.

Saving Capitalism from the Capitalists, by Rashuram Rajan and Luigi Zingales, examines competition from an academic perspective, choosing to focus on financial markets. As you’d expect from two economics professors, they argue that markets are the most powerful economic invention of all time, and the solution to many problems facing us today is to make them more prevalent. However, the central thesis of their book is that markets depend on governments for vital infrastructure (rule of law, contracts, etc) and thus depend on politics. Because of the nature of politics the interests of a focused few can outweigh the interests of a diffuse many. This means that government regulation of markets can be easily hijacked by those with disliking competition to smother it.

The authors examine many cases where this hijacking occurred, from developed and developing countries and many different time periods. They focus on finance because free flow of capital has a magnifying effect on competition since upstart produces of goods often need capital. The focus is on incumbent firms, who are usually the party with the will and ability to influence the government to put the needs of the few over the needs of the many.

Other issues they tackle include the emergence of financial markets, whether finance benefits the rich disproportinately, and how the free markets of the early 20th century were rolled back in the 1930s and what replaced them.

Well written, if dense, this book would have been average had the last chapter, which proposes solutions to the political vulnerabilty of markets, been omitted. However, with their proposed solutions, which build on the foundation that they laid out in previous chapters, I feel that this book is a useful read for anyone interested in knowing how the world works and might work better. In addition, I think it’s wise and brave of them to trumpet that current markets aren’t really free but instead are usually hijacked by powerful incumbent firms. This is something that you don’t hear economists acknowledge often enough.

“Saving Capitalism From the Capitalists” at Amazon.

Book Review: The Beast In the Garden

I just finished The Beast In the Garden: A Modern Parable of Man and Nature by David Baron. This non-fiction book is a quick read and outlines the comeback of the mountain lion, or cougar, along the Front Range, during the late 1980s to early 1990s. The cougar had been nearly wiped out by government bounties in the early part of the twentieth century, but the explosion of deer along the Front Range, along with revocation of that bounty, led to a comeback. In parts of the Denver metro area, mountain lions came to co-exist with human beings. This was especially true in Boulder, where the nature loving Boulderites assured a plentiful meat supply when they wouldn’t cull deer herds. The mountain lions grow familiar with human habits, learn that humans don’t mean danger, and end up mauling a high school student.

I really enjoyed the way the events were outlined, and Baron does a good job of making sure the science and character development are well balanced. He follows a few of the key players for the entire time, while bringing in other interesting characters, like the cougar hunter, as they appear. The science seems reasonable to me, though I haven’t taken a biology class since high school: large animals don’t have a natural aversion to humanity. Rather, this is a learned trait passed from generation to generation. Remove the killing that caused the aversion, and the animals will become more and more comfortable around humanity, to the point of considering humans a food source.

In the larger sense, though, this book is about managing wilderness, and realizing that as soon as you put a house up in a forest, you’ve changed the stakes. Humans love being around nature, but bleat for help as soon as nature threatens. In some ways, we want a Disneyland version of the forest–all of the beauty with none of the danger. You see this all the time with folks who build around national forest; as soon as fires season comes, they need to be protected. This is a thorny problem, and answers aren’t simple. The Beast In the Garden really is a parable, and I’m not sure we’ve learned the lessons.

Book Review: Dancing with Cats

If you have a chance to read Dancing With Cats by Burton Silver and Heather Busch, don’t bother. However, pick it up and glance through the photos. For it’s in the pictures, of cats and humans cavorting, of almost impossibly resonant images, that this book shines. (Visit the Museum of Non Primate Art for more.) The text is a bit much, using words like ‘aura’ and negative energy, and apparently meaning it. But, if you like cats and have a sense of the absurd, oh the pictures–check it on Amazon.com. I chuckled and chortled through the entire book.

“Dancing With Cats” on Amazon.