Monday, April 27, 2009

Undead spiders!

OK, lame title, but I couldn't help myself.

What it refers to, is an interesting piece of science news over at National Geographic, which reports on some new findings related to spiders.

Spider "Resurrections" Take Scientists by Surprise

Like zombies, spiders in a lab twitched back to life hours after "drowning"—and the scientists were as surprised as anyone.

The spiders, it seems, enter comas to survive for hours underwater, according to a new study.

The unexpected discovery was made during experiments intended to find out exactly how long spiders can survive underwater—a number of spiders and insects have long been known to be resistant to drowning.

I wasn't aware of this, but some spider species apparently take a long time to drown (we're talking 24 to 36 hours here), and the researchers were trying to find out exactly how long it took for these spiders to drown.

After the spiders had drowned, the researchers wanted to dry out the spiders, so they could weight them. This is when they found out that they spiders hadn't really drowned, but rather had gone into some kind of coma. After a fairly short while, the spiders started moving again, and after a couple of hours they were recovered.

So, just how long time does it take to really drown these things?

According to the article, the study should be in Biology Letters, but I wasn't able to locate it at the website.

Labels: , , ,

Sunday, April 12, 2009

Connectivity and literature

There is a lot of debate, at least in Denmark, about what it means for people to live in an age where they are always connected. No matter where you go, it's possible for other peoples to get hold of you. All of this is very interesting, relevant, and certainly something I might write about in a future blogpost.

This blogpost, however, is about what the connectivity means for literature. New York Times has an interesting article on the subject.

If Only Literature Could Be a Cellphone-Free Zone

Technology is rendering obsolete some classic narrative plot devices: missed connections, miscommunications, the inability to reach someone. Such gimmicks don’t pass the smell test when even the most remote destinations have wireless coverage. (It’s Odysseus, can someone look up the way to Ithaca? Use the “no Sirens” route.)

Of what significance is the loss to storytelling if characters from Sherwood Forest to the Gates of Hell can be instantly, if not constantly, connected?

I hadn't thought of this problem, but it's true. In this day and age, you'd have to be pretty selective in location, or make some pretty plausible reasons for someone to avoid technology, for such old plot devices to work.

Go read the article, and see what the different authors have to say about this.

Entirely in spirit with the article, I found it through facebook, where M.J. Rose linked to it.

Labels: , , ,

New Skeptics' Circle is up, and more

The 109th Skeptic's Circle is up over at the Lay Scientist: The Skeptics' Circle #109: The Credibility Crisis Edition

In related news, Ben Goldacre has made a chapter of his book Bad Science freely available. It was left out of earlier edition because of a lawsuit he was involved in, but after that was resolved, it is now included in the new editions of the book. Those of us who have the older version, can find it online instead.

Labels: , ,

Saturday, April 11, 2009

David Neiwert has a new book out

David Neiwert, whose blog Orcinus I've been a fan of since it started, has written a new book.

Here is his blogpost about it: Announcing 'The Eliminationists: How Hate Talk Radicalized the American Right'

His earlier books Strawberry Days: How Internment Destroyed a Japanese American Community, Death on the Fourth of July: The Story of a Killing, a Trial, and Hate Crime in America, and In God's Country: The Patriot Movement and the Pacific Northwest were all really great, so I am looking forward to The Eliminationists: How Hate Talk Radicalized the American Right (all Amazon links goes to his Amazon affiliate program).

In my opinion, David Neiwert is one of the best bloggers out there, and if people haven't read his earlier books, I certainly suggest checking them out.

Labels: , ,

Thursday, April 09, 2009

Pride as a virtue

NY Times has an article about the role of pride.

When All You Have Left Is Your Pride

"I have a new client, a laid-off lawyer, who’s commuting in every day — to his Starbucks,” said Robert C. Chope, a professor of counseling at San Francisco State University and president of the employment division of the American Counseling Association. “He gets dressed up, meets with colleagues, networks; he calls it his Western White House. I have encouraged him to keep his routine.”

The fine art of keeping up appearances may seem shallow and deceitful, the very embodiment of denial. But many psychologists beg to differ.

To the extent that it sustains good habits and reflects personal pride, they say, this kind of play-acting can be an extremely effective social strategy, especially in uncertain times.

The article goes on to explain how pride in yourself can lead to other people getting a better impression of you ("dominant but also likable").

I find the article quite interesting for several reasons.

The first reason is because it relates to myself. When I was younger, I was quite shy, and while I can still be somewhat shy in certain social settings, I doubt that anyone who works with me would consider me shy. The reason for this, is that I have a great deal of pride in my work and my abilities regarding it, and thus don't see any reason to hold back. This has helped me behave less shyly in other settings as well.

A second reason is that explains something about the dynamics around consultants. Successful consultants are not only good at their work, but they are also somewhat arrogant (prideful, if you prefer). This doesn't always go over well, but in most cases I've found that consultants get along pretty well, not only with each other (regardless of their company background), but also with their clients. The study regarding other peoples' perception could explains some of this.
Of course, consultants who show themselves to be less competent than expected, will often find themselves quite disliked. So pride is not enough, in the long run - there must also be some ability to back it up.

Labels: , ,

Wednesday, April 08, 2009

Meat for sex among Chimpanzees

PLoS One has published an interesting new study on primate behavior.

Wild Chimpanzees Exchange Meat for Sex on a Long-Term Basis by Cristina M. Gomes and Christophe Boesch

It's long been known that chimpanzees share meat with each others, and that there is a tendency for male chimpanzees to share with female chimpanzees. This has lead to a hypothesis of an exchange of meat for sex, but so far there was no evidence to back this up.

Gomes and Boesch, however, observed a group of wild chimpanzees, and found that over a 22 month period, female chimpanzees more frequently had sex with male chimpanzees which had shared meat with them, than with other similar chimpanzees.

Humans and chimpanzees are unusual among primates in that they frequently perform group hunts of mammalian prey and share meat with conspecifics. Especially interesting are cases in which males give meat to unrelated females. The meat-for-sex hypothesis aims at explaining these cases by proposing that males and females exchange meat for sex, which would result in males increasing their mating success and females increasing their caloric intake without suffering the energetic costs and potential risk of injury related to hunting. Although chimpanzees have been shown to share meat extensively with females, there has not been much direct evidence in this species to support the meat-for-sex hypothesis. Here we show that female wild chimpanzees copulate more frequently with those males who, over a period of 22 months, share meat with them. We excluded other alternative hypotheses to exchanging meat for sex, by statistically controlling for rank of the male, age, rank and gregariousness of the female, association patterns of each male-female dyad and meat begging frequency of each female. Although males were more likely to share meat with estrous than anestrous females given their proportional representation in hunting parties, the relationship between mating success and sharing meat remained significant after excluding from the analysis sharing episodes with estrous females. These results strongly suggest that wild chimpanzees exchange meat for sex, and do so on a long-term basis. Similar studies on humans will determine if the direct nutritional benefits that women receive from hunters in foraging societies could also be driving the relationship between reproductive success and good hunting skills.

Given the fact that earlier research has shown that chimpanzees can understand the concept of bartering, I think the findings sounds plausible, but nevertheless I can't help pointing out that the meat sharing and the more frequent sex might both be symptoms of an already existing bond between the chimpanzees.

Labels: , , ,

Tuesday, April 07, 2009

The small world phenomenon

I expect that just about everyone on the internet is aware of the concept of sixth degrees of separation, which is the idea that everyone in the world is connected to everyone else by no more than six steps.

The name is based on an experiment by Stanley Milgram, which basically went along the lines: A person gets a letter for a given person. He (they were all male) is not allowed to send it directly to that person, unless he knows the person already. Instead he sends it to whatever friend he has which he considers most likely to be able to get the letter closer to the recipient. The experiment showed that ever letter that reached their destination would go through no more than six people, crossing social and racial boundaries.

This was a really groundbreaking experiment at the time, and even though later evaluations of the experiment have demonstrated many fundamental flaws (see e.g. here), it is still considered the first real experiment relating to the small world problem.

So, what is the small world problem?

Well, simply put, it’s the problem of why elements in worlds are more interconnected than they should be. Let’s take the human population. It’s intuitively easy to understand why everyone is connected to everyone else through their friends, but it’s not intuitively easy to understand how everyone can be connected in just six steps. We are more than sex billion people worldwide after all, and people are both socially and geographically divided.

In other words, how can a person like me, living in Denmark, be not only six steps, at most, removed from President Barack Obama, but also from an Afghan boy in Kabul or an Aboriginal elder in Australia?

If we presume that you are only linked to people close to you geographically and socioeconomically, then it would take quite a few steps to get to any of the people I mentioned, since each link will only get you a little closer to the people in question, especially since friends tend to hang out in clusters, where most people know each other.

Even though this will be true for most of your friends, however, there will be those people who fall outside the pattern. Even though most of your friends are clustered in a few clusters, there will be a few who don’t belong to any of these clusters, and which will connect you to other clusters. In other words, these friends will become a bridge between your clusters and other clusters, allowing people in your cluster to link with those clusters, even if they have never met anyone in any of those clusters.

Suddenly your network is much larger than it appears. And since this goes for any friend of anyone in the cluster which doesn’t belong to the cluster, there are lots of links to other clusters. In other words, people might be clustered together in interlinked groups, but there are plenty of connections between these clusters.

There is obviously a lot of research into small world phenomena, and there are several good books about the subject if you’re interested in learning about this subject.

Duncan J. Watts: Six Degrees: The New Science of Networks
Duncan J. Watts: Small Worlds: The Dynamics of Networks between Order and Randomness
Mark Buchanan: Small World: Uncovering Nature's Hidden Networks
Mark Buchanan: Nexus: Small Worlds and the Groundbreaking Theory of Networks
Steven Strogatz: Sync: The Emerging Science of Spontaneous Order

Note: I plane to write more on the issue of small worlds in the future, but I thought I'd write a small post explaining the basic concept, just to get started on the subject

Labels: ,

The Grindstone Journal

I have been amiss in not mentioning the Grindstone Journal. It is an Oklahoma based progressive journal, which some times uses some of my blog posts as material.

Please go and take a look at the website. Lots of good stuff there.


Monday, April 06, 2009

Debugging friendly code

When you often take over other people’s code, you often start getting your own pet issue which you focus on. Well, my pet issue is debugging, or rather ease of debugging. I don’t want to have to know and understand the whole business domain, program or component when I want to fix an error (bug). Most of the time, it should be possible to fix errors by stepping through the code while debugging, and finding the error.

For this to be possible, however, requires the code to be debugging friendly. By this I mean that each class, method and even code line should have well defined responsibilities, which leaves no doubt where and how the error occurred.
This sounds all well and fine on the abstract plan, but how does it relate to real code? Well, that’s of course a little harder to say, but I can give some general guidelines which should be followed to achieve this.

  • Methods should be limited in scope. E.g. if you need to implement a method which fetches something from the database, the method should not also be responsible for putting the data in the cache or convert the data into a different data type. If those things are necessary, a method should be made for each of those functionalities.

  • Methods should be generalized as much as possible. Instead of copy and pasting methods and then modifying them to suit your needs, see if it isn’t possible to generalize the functionality in some way or other, so just one function is responsible for it.

  • Methods, parameters, classes, variables etc. should have telling names. Don’t pass x, y, z along as parameters in a method call. On the other hand, don’t make long names explaining the exact circumstances when it’s obvious from the scope what it is. The id of a customer object doesn’t need to get called customer Id.

  • Use local variables! Martin Fowler might disagree, but he probably doesn’t have to debug other peoples’ code very often. When you call methodX(methodY(Z)) it’s not possible to easily see whether it’s method or methodY which causes the null pointer exception.

  • Make unit tests for, at least, the critical methods.

  • Comment the code. Don’t explain the obvious, but rather focus on explaining the assumptions behind what you’re doing.

  • Check parameters for illegal values. If your parameter should never be null, then check for that – in case it is null, then throw an exception, explaining the problem. This shows other people (or a later you) that someone thought of the possibility, and didn’t just forget to handle null values as input parameters.

  • Ensure that your method behaves in a uniform way, i.e. giving the same parameters the method should always behave the same way (barring other dependencies). I once experienced a ToString() method in a class which always appended something at the end of the string, causing the behavior to different dependent on whether the method had been called before or not.

All of these things might seem simple, but when the project is 3 months over time, your customer or project leader (or both!) is breathing down your neck, then it’s easy to cut corners. You might also know the system and/or domain very well, which allows you to make some assumptions which are not obvious for others – not only does this make it harder for others to debug, but it also might cause people to use the code in the wrong way.

So, what happens if you come across code, or inherit code, which doesn’t conform to my guidelines? Well, be bold and refactor. Do it one step at the time – if method calls are used as parameters, make local variables. If methods are responsible for several things, split it into several methods with distinct responsibilities, and so on. And of course, make sure that there are unit tests.

Labels: , ,

Short news, endangered species edition

While browsing around on National Geographic I came across two pieces of news related to endangered species.

Guantanamo's Wild Side: Huge Boas, "Banana Rats," More

It turns out that the US military base at Guantanamo Bay is the home of a lot of wildlife, much of which is endangered, or at least threatened. They obviously don't live in the prison camp, but in the military base as a whole, specially the more remote parts.

6,000 Rare, Large River Dolphins Found in Bangladesh

A previously unknown population of Irrawaddy dolphins discovered in Bangladesh has given scientists "great hope" for the survival of the rare species, conservationists said Wednesday.

A research team estimated that 6,000 Irrawaddy dolphins thrive in the country's Sundarbans mangrove forests and nearby waters of the Bay of Bengal.

This is obviously great news as well, and we can hope it's possible to protect this population, to ensure the survival of the species.

Labels: , , ,